{"version":3,"file":"chunk.523.a7df706e79b6a24ef9b2.js","names":["esCompat","m","__esModule","default","n","d","t","Z","r","e","Object","defineProperty","value","o","i","s","a","c","p","u","container","this","PlatformLoggerServiceImpl","getProviders","map","provider","component","getComponent","type","service","getImmediate","concat","library","version","filter","logString","join","l","logger","Logger","DEFAULT_ENTRY_NAME","PLATFORM_LOG_STRING","_a","firebase","_apps","Map","_serverApps","_components","_addComponent","app","addComponent","debug","name","_registerComponent","componentName","has","set","__values","values","next","done","error","return","call","_getProvider","heartbeatController","getProvider","optional","triggerHeartbeat","_isFirebaseApp","obj","options","ERRORS","ERROR_FACTORY","ErrorFactory","q","config","_this","_isDeleted","_options","__assign","_config","_name","_automaticDataCollectionEnabled","automaticDataCollectionEnabled","_container","Component","FirebaseAppImpl","prototype","get","checkDestroyed","val","enumerable","configurable","isDeleted","create","appName","W","serverConfig","apiKey","appImpl","_serverConfig","_finalizationRegistry","FinalizationRegistry","automaticCleanup","_refCount","incRefCount","releaseOnDeref","registerVersion","packageName","__extends","FirebaseServerAppImpl","register","deleteApp","initializeApp","rawConfig","String","getDefaultAppConfig","existingApp","deepEqual","ComponentContainer","b","newApp","__awaiter","__generator","label","cleanupProviders","delete","decRefCount","Promise","all","libraryKeyOrName","variant","libraryMismatch","match","versionMismatch","warning","push","warn","DB_NAME","DB_VERSION","STORE_NAME","dbPromise","getDbPromise","openDB","upgrade","db","oldVersion","createObjectStore","console","catch","originalErrorMessage","message","readHeartbeatsFromIndexedDB","trys","sent","tx","transaction","objectStore","computeKey","result","FirebaseError","e_1","idbGetError","writeHeartbeatsToIndexedDB","heartbeatObject","put","e_2","appId","C","_heartbeatsCache","_storage","HeartbeatStorageImpl","_heartbeatsCachePromise","read","then","HeartbeatServiceImpl","platformLogger","agent","getPlatformInfoString","date","getUTCDateString","heartbeats","_c","_d","lastSentHeartbeatDate","some","singleDateHeartbeat","hbTimestamp","Date","valueOf","now","overwrite","length","_b","heartbeatsCache","maxSize","heartbeatsToSend","unsentEntries","slice","heartbeatEntry","find","hb","dates","countBytes","pop","headerString","base64urlEncodeWithoutPadding","JSON","stringify","toISOString","substring","P","_canUseIndexedDBPromise","runIndexedDBEnvironmentCheck","isIndexedDBAvailable","validateIndexedDBOpenable","idbHeartbeatObject","heartbeatsObject","existingHeartbeatsObject","add","__spreadArray","__read","SDK_VERSION","_DEFAULT_ENTRY_NAME","h","_addOrOverwriteComponent","addOrOverwriteComponent","f","_clearComponents","clear","O","g","_","_isFirebaseServerApp","settings","A","_removeServiceInstance","instanceIdentifier","clearInstance","z","L","getApp","getApps","Array","from","w","initializeServerApp","_serverAppConfig","appOptions","isBrowser","nameObj","nameString","reduce","hash","Math","imul","charCodeAt","onLog","logCallback","setUserLogHandler","R","setLogLevel","logLevel","setLogLevelImpl","prodErrorMap","_DEFAULT_AUTH_ERROR_FACTORY","logClient","_logError","msg","LogLevel","ERROR","arguments","args","_fail","authOrCode","rest","createErrorInternal","_createError","_errorWithCustomMessage","auth","code","errorMap","_serverAppCurrentUserOperationNotSupportedError","_assertInstanceOf","object","instance","constructor","fullParams","_errorFactory","_assert","assertion","debugFail","failure","Error","debugAssert","_getCurrentUrl","self","location","href","_isHttpOrHttps","_getCurrentScheme","protocol","Delay","shortDelay","longDelay","isMobile","isMobileCordova","isReactNative","navigator","onLine","isBrowserExtension","min","_emulatorUrl","path","emulator","url","startsWith","FetchProvider","initialize","fetchImpl","headersImpl","responseImpl","fetch","globalThis","headers","Headers","response","Response","SERVER_ERROR_MAP","CREDENTIAL_MISMATCH","MISSING_CUSTOM_TOKEN","INVALID_IDENTIFIER","MISSING_CONTINUE_URI","INVALID_PASSWORD","MISSING_PASSWORD","INVALID_LOGIN_CREDENTIALS","EMAIL_EXISTS","PASSWORD_LOGIN_DISABLED","INVALID_IDP_RESPONSE","INVALID_PENDING_TOKEN","FEDERATED_USER_ID_ALREADY_LINKED","MISSING_REQ_TYPE","EMAIL_NOT_FOUND","RESET_PASSWORD_EXCEED_LIMIT","EXPIRED_OOB_CODE","INVALID_OOB_CODE","MISSING_OOB_CODE","CREDENTIAL_TOO_OLD_LOGIN_AGAIN","INVALID_ID_TOKEN","TOKEN_EXPIRED","USER_NOT_FOUND","TOO_MANY_ATTEMPTS_TRY_LATER","PASSWORD_DOES_NOT_MEET_REQUIREMENTS","INVALID_CODE","INVALID_SESSION_INFO","INVALID_TEMPORARY_PROOF","MISSING_SESSION_INFO","SESSION_EXPIRED","MISSING_ANDROID_PACKAGE_NAME","UNAUTHORIZED_DOMAIN","INVALID_OAUTH_CLIENT_ID","ADMIN_ONLY_OPERATION","INVALID_MFA_PENDING_CREDENTIAL","MFA_ENROLLMENT_NOT_FOUND","MISSING_MFA_ENROLLMENT_ID","MISSING_MFA_PENDING_CREDENTIAL","SECOND_FACTOR_EXISTS","SECOND_FACTOR_LIMIT_EXCEEDED","BLOCKING_FUNCTION_ERROR_RESPONSE","RECAPTCHA_NOT_ENABLED","MISSING_RECAPTCHA_TOKEN","INVALID_RECAPTCHA_TOKEN","INVALID_RECAPTCHA_ACTION","MISSING_CLIENT_TYPE","MISSING_RECAPTCHA_VERSION","INVALID_RECAPTCHA_VERSION","INVALID_REQ_TYPE","DEFAULT_API_TIMEOUT_MS","_addTidIfNecessary","request","tenantId","assign","async","_performApiRequest","method","_performFetchWithErrorHandling","customErrorMap","body","params","query","querystring","key","_getAdditionalHeaders","languageCode","_getFinalTarget","apiHost","referrerPolicy","fetchFn","_canInitEmulator","networkTimeout","NetworkTimeout","race","promise","clearNetworkTimeout","json","_makeTaggedError","ok","errorMessage","serverErrorCode","serverErrorMessage","split","authError","toLowerCase","replace","_performSignInRequest","serverResponse","_serverResponse","host","base","apiScheme","_parseEnforcementState","enforcementStateStr","timer","reject","setTimeout","clearTimeout","errorParams","email","phoneNumber","customData","_tokenResponse","isV2","grecaptcha","getResponse","isEnterprise","enterprise","RecaptchaConfig","siteKey","recaptchaEnforcementState","recaptchaKey","getProviderEnforcementState","providerStr","enforcementState","isProviderEnabled","getRecaptchaConfig","getAccountInfo","utcTimestampToDateString","utcTimestamp","Number","isNaN","getTime","toUTCString","getIdTokenResult","user","forceRefresh","userInternal","getModularInstance","token","getIdToken","claims","_parseToken","exp","auth_time","iat","signInProvider","sign_in_provider","authTime","secondsStringToMilliseconds","issuedAtTime","expirationTime","signInSecondFactor","sign_in_second_factor","seconds","algorithm","payload","signature","decoded","base64Decode","parse","toString","_tokenExpiresIn","parsedToken","_logoutIfInvalidated","currentUser","signOut","ProactiveRefresh","isRunning","timerId","errorBackoff","_start","schedule","_stop","getInterval","wasError","interval","stsTokenManager","max","iteration","UserMetadata","createdAt","lastLoginAt","_initializeTime","lastSignInTime","creationTime","_copy","metadata","toJSON","_reloadWithoutSaving","idToken","users","coreAccount","_notifyReloadListener","newProviderData","providerUserInfo","extractProviderData","providerData","original","newData","providerId","oldIsAnonymous","isAnonymous","newIsAnonymous","passwordHash","updates","uid","localId","displayName","photoURL","photoUrl","emailVerified","reload","_persistUserIfCurrent","_notifyListenersIfCurrent","providers","__rest","rawId","StsTokenManager","refreshToken","accessToken","isExpired","updateFromServerResponse","expiresIn","updateTokensAndExpiration","updateFromIdToken","getToken","refresh","clearRefreshToken","oldToken","grant_type","refresh_token","tokenApiHost","access_token","expires_in","expiresInSec","fromJSON","manager","_assign","_clone","_performRefresh","assertStringOrUndefined","UserImpl","opt","proactiveRefresh","reloadUserInfo","reloadListener","userInfo","newUser","_onReload","callback","_startProactiveRefresh","_stopProactiveRefresh","_updateTokensIfNecessary","tokensRefreshed","_redirectEventId","_fromJSON","plainObjectTokenManager","isArray","_fromIdTokenResponse","idTokenResponse","_fromGetAccountInfoResponse","instanceCache","_getInstance","cls","Function","InMemoryPersistence","storage","_isAvailable","_set","_get","_remove","_addListener","_key","_listener","_removeListener","inMemoryPersistence","_persistenceKeyName","PersistenceUserManager","persistence","userKey","fullUserKey","fullPersistenceKey","boundEventHandler","_onStorageEvent","bind","setCurrentUser","getCurrentUser","blob","removeCurrentUser","savePersistenceForRedirect","setPersistence","newPersistence","persistenceHierarchy","availablePersistences","selectedPersistence","userToMigrate","migrationHierarchy","_shouldAllowMigration","_getBrowserName","userAgent","ua","includes","_isIEMobile","_isFirefox","_isBlackBerry","_isWebOS","_isSafari","_isChromeIOS","_isAndroid","re","matches","getUA","test","_isIOS","_isMobileBrowser","_getClientVersion","clientPlatform","reportedPlatform","frameworks","reportedFrameworks","AuthMiddlewareQueue","queue","pushCallback","onAbort","wrappedCallback","resolve","index","runMiddleware","nextUser","onAbortStack","beforeStateCallback","reverse","originalMessage","PasswordPolicyImpl","responseOptions","customStrengthOptions","minPasswordLength","maxPasswordLength","containsLowercaseCharacter","containsLowercaseLetter","containsUppercaseCharacter","containsUppercaseLetter","containsNumericCharacter","containsNonAlphanumericCharacter","allowedNonAlphanumericCharacters","forceUpgradeOnSignin","schemaVersion","validatePassword","password","status","isValid","passwordPolicy","validatePasswordLengthOptions","validatePasswordCharacterOptions","meetsMinPasswordLength","meetsMaxPasswordLength","passwordChar","updatePasswordCharacterOptionsStatuses","charAt","AuthImpl","heartbeatServiceProvider","appCheckServiceProvider","emulatorConfig","operations","authStateSubscription","Subscription","idTokenSubscription","beforeStateQueue","redirectUser","isProactiveRefreshEnabled","EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION","_isInitialized","_deleted","_initializationPromise","_popupRedirectResolver","_agentRecaptchaConfig","_tenantRecaptchaConfigs","_projectPasswordPolicy","_tenantPasswordPolicies","lastNotifiedUid","appVerificationDisabledForTesting","clientVersion","sdkClientVersion","_initializeWithPersistence","popupRedirectResolver","persistenceManager","_shouldInitProactively","_initialize","initializeCurrentUser","assertedPersistence","_currentUser","_updateCurrentUser","initializeCurrentUserFromIdToken","directlySetCurrentUser","err","authIdToken","previouslyStoredUser","futureCurrentUser","needsTocheckMiddleware","authDomain","getOrInitRedirectPersistenceManager","redirectUserEventId","storedUserEventId","tryRedirectSignIn","_overrideRedirectResult","reloadAndSetCurrentUserOrClear","redirectResolver","_completeRedirectFn","_setRedirectUser","useDeviceLanguage","navigatorLanguage","languages","language","_delete","updateCurrentUser","userExtern","skipBeforeStateCallbacks","notifyAuthListeners","redirectPersistenceManager","_getRecaptchaConfig","_getPasswordPolicyInternal","_updatePasswordPolicy","_getPersistence","_updateErrorMap","onAuthStateChanged","nextOrObserver","completed","registerStateListener","beforeAuthStateChanged","onIdTokenChanged","authStateReady","unsubscribe","revokeAccessToken","tokenType","redirectManager","resolver","_redirectPersistence","_redirectUserForId","id","currentUid","subscription","cb","isUnsubscribed","addObserver","action","_logFramework","framework","sort","_getFrameworks","heartbeatsHeader","getHeartbeatsHeader","appCheckToken","_getAppCheckToken","appCheckTokenResult","WARN","_castAuth","observer","createSubscribe","externalJSProvider","loadJS","recaptchaV2Script","recaptchaEnterpriseScript","gapiScript","_loadJS","_generateCallbackName","prefix","floor","random","RecaptchaEnterpriseVerifier","authExtern","verify","retrieveRecaptchaToken","window","ready","execute","clientType","jsHelpers\r\n                        ._loadJS","injectRecaptchaFields","captchaResp","verifier","captchaResponse","newRequest","recaptchaVersion","handleRecaptchaFlow","authInstance","actionName","actionMethod","requestWithRecaptcha","log","initializeAuth","deps","isInitialized","initialOptions","getOptions","connectAuthEmulator","authInternal","disableWarnings","extractProtocol","port","authority","exec","substr","hostAndPort","bracketedIPv6","parsePort","portStr","freeze","attachBanner","el","document","createElement","sty","style","innerText","position","width","backgroundColor","border","color","bottom","left","margin","zIndex","textAlign","classList","appendChild","info","readyState","addEventListener","protocolEnd","indexOf","AuthCredential","signInMethod","_getIdTokenResponse","_auth","_linkToIdToken","_idToken","_getReauthenticationResolver","resetPassword","linkEmailPassword","signInWithPassword","sendOobCode","sendPasswordResetEmail","sendSignInLinkToEmail","EmailAuthCredential","_email","_password","_tenantId","super","_fromEmailAndPassword","_fromEmailAndCode","oobCode","returnSecureToken","signInWithIdp","OAuthCredential","pendingToken","_fromParams","cred","nonce","oauthToken","oauthTokenSecret","secret","buildRequest","autoCreate","requestUri","postBody","id_token","oauth_token_secret","VERIFY_PHONE_NUMBER_FOR_EXISTING_ERROR_MAP_","PhoneAuthCredential","_fromVerification","verificationId","verificationCode","_fromTokenResponse","temporaryProof","_makeVerificationRequest","operation","sessionInfo","ActionCodeURL","actionLink","searchParams","querystringDecode","extractQuerystring","mode","continueUrl","parseLink","link","doubleDeepLink","deep_link_id","iOSDeepLink","EmailAuthProvider","PROVIDER_ID","credential","credentialWithLink","emailLink","actionCodeUrl","FederatedAuthProvider","defaultLanguageCode","customParameters","setDefaultLanguage","setCustomParameters","customOAuthParameters","getCustomParameters","BaseOAuthProvider","scopes","addScope","scope","getScopes","OAuthProvider","credentialFromJSON","_credential","rawNonce","credentialFromResult","userCredential","oauthCredentialFromTaggedObject","credentialFromError","tokenResponse","oauthIdToken","oauthAccessToken","FacebookAuthProvider","FACEBOOK_SIGN_IN_METHOD","credentialFromTaggedObject","GoogleAuthProvider","GOOGLE_SIGN_IN_METHOD","GithubAuthProvider","GITHUB_SIGN_IN_METHOD","SAMLAuthCredential","_create","SAMLAuthProvider","samlCredentialFromTaggedObject","TwitterAuthProvider","TWITTER_SIGN_IN_METHOD","signUp","UserCredentialImpl","operationType","providerIdForResponse","_forOperation","MultiFactorError","setPrototypeOf","_fromErrorAndOperation","_processCredentialSavingMfaContextIfNecessary","providerDataAsNames","Set","pid","_link","bypassAuthState","_assertLinkedStatus","expected","_reauthenticate","parsed","sub","_signInWithCredential","signInWithCredential","linkWithCredential","reauthenticateWithCredential","MultiFactorInfoImpl","factorId","mfaEnrollmentId","enrollmentTime","enrolledAt","_fromServerResponse","enrollment","PhoneMultiFactorInfoImpl","TotpMultiFactorInfoImpl","phoneInfo","_setActionCodeSettingsOnRequest","actionCodeSettings","dynamicLinkDomain","canHandleCodeInApp","handleCodeInApp","iOS","bundleId","iOSBundleId","android","androidInstallApp","installApp","androidMinimumVersionCode","minimumVersion","androidPackageName","recachePasswordPolicy","checkActionCode","authModular","account.resetPassword","requestType","newEmail","mfaInfo","multiFactorInfo","data","previousEmail","updateEmailOrPassword","GenericAdditionalUserInfo","isNewUser","profile","FederatedAdditionalUserInfoWithUsername","username","FacebookAdditionalUserInfo","GithubAdditionalUserInfo","login","GoogleAdditionalUserInfo","TwitterAdditionalUserInfo","screenName","MultiFactorSessionImpl","_fromIdtoken","_fromMfaPendingCredential","mfaPendingCredential","multiFactorSession","pendingCredential","MultiFactorResolverImpl","session","hints","signInResolver","_fromError","mfaResponse","_process","resolveSignIn","assertionExtern","MultiFactorUserImpl","enrolledFactors","_fromUser","getSession","enroll","finalizeMfaResponse","unenroll","infoOrUid","multiFactorUserCache","WeakMap","STORAGE_AVAILABLE_KEY","BrowserPersistenceClass","storageRetriever","setItem","removeItem","getItem","BrowserLocalPersistence","localStorage","event","poll","onStorageEvent","listeners","localCache","pollTimer","safariLocalStorageNotSynced","top","fallbackToPolling","forAllChangedKeys","keys","newValue","oldValue","_oldValue","notifyListeners","detachListener","stopPolling","storedValue","triggerListeners","isIE","documentMode","listener","startPolling","setInterval","StorageEvent","clearInterval","attachListener","removeEventListener","size","browserLocalPersistence","BrowserSessionPersistence","sessionStorage","browserSessionPersistence","Receiver","eventTarget","handlersMap","handleEvent","existingInstance","receivers","receiver","isListeningto","newInstance","messageEvent","eventId","eventType","handlers","ports","postMessage","promises","handler","origin","fulfilled","reason","_subscribe","eventHandler","_unsubscribe","_generateEventId","digits","Sender","target","removeMessageHandler","messageChannel","port1","onMessage","close","_send","timeout","MessageChannel","completionTimer","start","ackTimer","port2","finally","_window","_isWorker","WorkerGlobalScope","importScripts","DB_OBJECTSTORE_NAME","DB_DATA_KEYPATH","DBPromise","toPromise","getObjectStore","isReadWrite","_openDatabase","indexedDB","open","keyPath","objectStoreNames","contains","deleteDatabase","_putObject","Gt","_deleteObject","IndexedDBLocalPersistence","pendingWrites","sender","serviceWorkerReceiverAvailable","activeServiceWorker","_workerInitializationPromise","initializeServiceWorkerMessaging","_openDb","_withRetries","op","numAttempts","initializeReceiver","initializeSender","_origin","keyProcessed","_poll","_data","serviceWorker","active","results","notifyServiceWorker","controller","_withPendingWrite","write","getAllRequest","getAll","keysInResult","fbase_key","localKey","indexedDBLocalPersistence","_WIDGET_ID_START","MockReCaptcha","counter","_widgets","render","parameters","MockWidget","reset","optWidgetId","containerOrId","deleted","responseToken","clickHandler","getElementById","isVisible","checkIfDeleted","len","chars","allowedChars","expiredCallback","_JSLOAD_CALLBACK","jsHelpers._generateCallbackName","NETWORK_TIMEOUT_DELAY","ReCaptchaLoaderImpl","hostLanguage","librarySeparatelyLoaded","load","hl","shouldResolveImmediately","recaptcha","widgetId","jsHelpers._loadJS","onload","clearedOneInstance","MockReCaptchaLoaderImpl","RECAPTCHA_VERIFIER_TYPE","DEFAULT_PARAMS","theme","ConfirmationResultImpl","onConfirmation","confirm","authCredential","_verifyPhoneNumber","recaptchaToken","phoneInfoOptions","phoneEnrollmentInfo","phoneSessionInfo","multiFactorHint","multiFactorUid","phoneSignInInfo","phoneResponseInfo","_reset","PhoneAuthProvider","verifyPhoneNumber","phoneOptions","applicationVerifier","_withDefaultResolver","resolverOverride","IdpCredential","_buildIdpRequest","sessionId","returnIdpCredential","_signIn","_reauth","_linkUser","AbstractPopupRedirectOperation","pendingPromise","eventManager","onExecution","registerConsumer","onAuthEvent","urlResponse","getIdpTask","onError","unregisterAndCleanUp","unregisterConsumer","cleanUp","_POLL_WINDOW_CLOSE_TIMEOUT","PopupOperation","authWindow","pollId","currentPopupAction","cancel","executeNotNull","_openPopup","associatedEvent","_originValidation","_isIframeWebStorageSupported","isSupported","pollUserCancellation","closed","PENDING_REDIRECT_KEY","redirectOutcomeMap","RedirectAction","readyOutcome","pendingRedirectKey","resolverPersistence","hasPendingRedirect","_setPendingRedirectStatus","_getRedirectResult","resolverExtern","prepareUserForRedirect","AuthEventManager","cachedEventUids","consumers","queuedRedirectEvent","hasHandledPotentialRedirect","lastProcessedEventTime","authEventConsumer","isEventForConsumer","sendToConsumer","saveEventToCache","onEvent","hasEventBeenHandled","handled","forEach","consumer","isNullRedirectEvent","eventIdMatches","eventUid","v","_getProjectConfig","IP_ADDRESS_REGEX","HTTP_REGEX","matchDomain","currentUrl","hostname","URL","ceUrl","escapedDomainPattern","RegExp","NETWORK_TIMEOUT","resetUnloadedGapiModules","beacon","___jsl","H","hint","CP","cachedGApiLoader","PING_TIMEOUT","IFRAME_ATTRIBUTES","height","tabindex","EID_FROM_APIHOST","getIframeUrl","eid","fw","BASE_POPUP_OPTIONS","resizable","statusbar","toolbar","AuthPopup","FIREBASE_APP_CHECK_FRAGMENT_ID","encodeURIComponent","_getRedirectUrl","authType","redirectUrl","additionalParams","isEmpty","entries","tid","paramsDict","appCheckTokenFragment","WEB_STORAGE_SUPPORT_KEY","browserPopupRedirectResolver","eventManagers","iframes","originValidationPromises","screen","availHeight","availWidth","scrollbars","optionsString","accum","standalone","click","createEvent","initMouseEvent","dispatchEvent","newWin","focus","_openRedirect","initAndGetManager","iframe","context","loadGapiIframe","gapi","getContext","ontimeout","Iframe","cbName","js._generateCallbackName","js\r\n                ._loadJS","loadGapi","where","messageHandlersFilter","CROSS_ORIGIN_IFRAMES_FILTER","attributes","dontclear","restyle","setHideOnLeave","networkError","networkErrorTimer","clearTimerAndResolve","ping","iframeEvent","authEvent","send","authorizedDomains","domain","MultiFactorAssertionImpl","_finalizeEnroll","_finalizeSignIn","PhoneMultiFactorAssertionImpl","_fromCredential","phoneVerificationInfo","PhoneMultiFactorGenerator","FACTOR_ID","TotpMultiFactorGenerator","assertionForEnrollment","oneTimePassword","TotpMultiFactorAssertionImpl","_fromSecret","assertionForSignIn","enrollmentId","_fromEnrollmentId","generateSecret","mfaSession","totpEnrollmentInfo","TotpSecret","_fromStartTotpMfaEnrollmentResponse","otp","totpVerificationInfo","_makeTotpVerificationInfo","secretKey","hashingAlgorithm","codeLength","codeIntervalSeconds","enrollmentCompletionDeadline","totpSessionInfo","sharedSecretKey","verificationCodeLength","periodSec","finalizeEnrollmentTime","generateQrCodeUrl","accountName","issuer","useDefaults","_isEmptyString","input","cr","pr","AuthInterop","internalListeners","getUid","assertAuthConfigured","addAuthTokenListener","updateProactiveRefresh","removeAuthTokenListener","authIdTokenMaxAge","getExperimentalSetting","lastPostedIdToken","setAttribute","onerror","charset","getElementsByTagName","hierarchy","setInstantiationMode","setInstanceCreatedCallback","_instanceIdentifier","_instance","AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY","ARGUMENT_ERROR","APP_NOT_AUTHORIZED","APP_NOT_INSTALLED","CAPTCHA_CHECK_FAILED","CODE_EXPIRED","CORDOVA_NOT_READY","CORS_UNSUPPORTED","CREDENTIAL_ALREADY_IN_USE","DEPENDENT_SDK_INIT_BEFORE_AUTH","DYNAMIC_LINK_NOT_ACTIVATED","EMAIL_CHANGE_NEEDS_VERIFICATION","EMULATOR_CONFIG_FAILED","EXPIRED_POPUP_REQUEST","INTERNAL_ERROR","INVALID_API_KEY","INVALID_APP_CREDENTIAL","INVALID_APP_ID","INVALID_AUTH","INVALID_AUTH_EVENT","INVALID_CERT_HASH","INVALID_CONTINUE_URI","INVALID_CORDOVA_CONFIGURATION","INVALID_CUSTOM_TOKEN","INVALID_DYNAMIC_LINK_DOMAIN","INVALID_EMAIL","INVALID_EMULATOR_SCHEME","INVALID_MESSAGE_PAYLOAD","INVALID_MFA_SESSION","INVALID_OAUTH_PROVIDER","INVALID_ORIGIN","INVALID_PERSISTENCE","INVALID_PHONE_NUMBER","INVALID_PROVIDER_ID","INVALID_RECIPIENT_EMAIL","INVALID_SENDER","INVALID_TENANT_ID","MFA_INFO_NOT_FOUND","MFA_REQUIRED","MISSING_APP_CREDENTIAL","MISSING_AUTH_DOMAIN","MISSING_CODE","MISSING_IFRAME_START","MISSING_IOS_BUNDLE_ID","MISSING_OR_INVALID_NONCE","MISSING_MFA_INFO","MISSING_MFA_SESSION","MISSING_PHONE_NUMBER","MODULE_DESTROYED","NEED_CONFIRMATION","NETWORK_REQUEST_FAILED","NULL_USER","NO_AUTH_EVENT","NO_SUCH_PROVIDER","OPERATION_NOT_ALLOWED","OPERATION_NOT_SUPPORTED","POPUP_BLOCKED","POPUP_CLOSED_BY_USER","PROVIDER_ALREADY_LINKED","QUOTA_EXCEEDED","REDIRECT_CANCELLED_BY_USER","REDIRECT_OPERATION_PENDING","REJECTED_CREDENTIAL","SECOND_FACTOR_ALREADY_ENROLLED","TENANT_ID_MISMATCH","TIMEOUT","UNSUPPORTED_FIRST_FACTOR","UNSUPPORTED_PERSISTENCE","UNSUPPORTED_TENANT_OPERATION","UNVERIFIED_EMAIL","USER_CANCELLED","USER_DELETED","USER_DISABLED","USER_MISMATCH","USER_SIGNED_OUT","WEAK_PASSWORD","WEB_STORAGE_UNSUPPORTED","ALREADY_INITIALIZED","ActionCodeOperation","EMAIL_SIGNIN","PASSWORD_RESET","RECOVER_EMAIL","REVERT_SECOND_FACTOR_ADDITION","VERIFY_AND_CHANGE_EMAIL","VERIFY_EMAIL","He","Ee","Tn","ge","Jn","Ye","Ve","Qe","FactorId","PHONE","TOTP","$e","Ze","Fe","Je","OperationType","LINK","REAUTHENTICATE","SIGN_IN","Ue","hn","rr","ProviderId","FACEBOOK","GITHUB","GOOGLE","PASSWORD","TWITTER","RecaptchaVerifier","destroyed","tokenChangeListeners","renderPromise","isInvisible","makeTokenCallback","_recaptchaLoader","validateStartingState","assertNotDestroyed","getAssertedRecaptcha","tokenChange","makeRenderPromise","childNodes","node","removeChild","sitekey","hasChildNodes","existing","globalFunc","init","guaranteedEmpty","recaptchaSiteKey","et","tt","SignInMethod","EMAIL_LINK","EMAIL_PASSWORD","or","sr","nt","te","_e","_clearRedirectOutcomes","jt","Oe","xn","Sn","Zn","be","fe","_isIOS7Or8","wn","se","applyActionCode","St","Ct","er","Pt","gt","confirmPasswordReset","newPassword","account\r\n        .resetPassword","ke","createUserWithEmailAndPassword","signUpResponse","debugErrorMap","deleteUser","fetchSignInMethodsForEmail","identifier","continueUri","signinMethods","getAdditionalUserInfo","rawUserInfo","kind","getAuth","authTokenSyncPath","isSecureContext","authTokenSyncUrl","mintCookie","idTokenResult","idTokenAge","Authorization","authEmulatorHost","getDefaultEmulatorHost","F","getMultiFactorResolver","errorInternal","getRedirectResult","ie","tn","Se","initializeRecaptchaConfig","isSignInWithEmailLink","ht","linkWithPhoneNumber","appVerifier","linkWithPopup","resolverInternal","linkWithRedirect","multiFactor","userModular","Rt","parseActionCodeURL","Mt","reauthenticateWithPhoneNumber","reauthenticateWithPopup","reauthenticateWithRedirect","Q","sendEmailVerification","authentication.sendPasswordResetEmail","api.sendSignInLinkToEmail","signInAnonymously","bt","signInWithCustomToken","customToken","signInWithEmailAndPassword","signInWithEmailLink","signInWithPhoneNumber","signInWithPopup","signInWithRedirect","unlink","deleteProvider","providersLeft","pd","updateEmail","updatePassword","updatePhoneNumber","updateProfile","profileRequest","passwordProvider","verifyBeforeUpdateEmail","verifyPasswordResetCode","AuthErrorCodes","instanceFactory","multipleInstances","serviceProps","instantiationMode","onInstanceCreated","setMultipleInstances","setServiceProps","props","Provider","instances","instancesDeferred","instancesOptions","onInitCallbacks","normalizedIdentifier","normalizeInstanceIdentifier","deferred","Deferred","shouldAutoInitialize","getOrInitializeService","setComponent","instanceDeferred","services","INTERNAL","opts","isComponentSet","existingCallbacks","callbacks","invokeOnInitCallbacks","User","isAuthenticated","toKey","isEqual","otherUser","UNAUTHENTICATED","__PRIVATE_logClient","__PRIVATE_getLogLevel","__PRIVATE_logDebug","DEBUG","__PRIVATE_argToString","__PRIVATE_logError","__PRIVATE_logWarn","fail","__PRIVATE_failure","__PRIVATE_debugCast","Code","OK","CANCELLED","UNKNOWN","INVALID_ARGUMENT","DEADLINE_EXCEEDED","NOT_FOUND","ALREADY_EXISTS","PERMISSION_DENIED","RESOURCE_EXHAUSTED","FAILED_PRECONDITION","ABORTED","OUT_OF_RANGE","UNIMPLEMENTED","UNAVAILABLE","DATA_LOSS","FirestoreError","__PRIVATE_Deferred","__PRIVATE_OAuthToken","__PRIVATE_EmptyAuthCredentialsProvider","invalidateToken","asyncQueue","changeListener","enqueueRetryable","shutdown","__PRIVATE_EmulatorAuthCredentialsProvider","__PRIVATE_FirebaseAuthCredentialsProvider","__PRIVATE_authProvider","__PRIVATE_lastTokenId","__PRIVATE_tokenCounter","__PRIVATE_guardedChangeListener","__PRIVATE_nextToken","__PRIVATE_tokenListener","__PRIVATE_getUser","__PRIVATE_awaitNextToken","__PRIVATE_currentTokenAttempt","__PRIVATE_registerAuth","onInit","__PRIVATE_initialTokenCounter","__PRIVATE_tokenData","__PRIVATE_hardAssert","__PRIVATE_currentUid","__PRIVATE_FirstPartyToken","__PRIVATE_sessionIndex","__PRIVATE_iamToken","__PRIVATE_authTokenFactory","FIRST_PARTY","__PRIVATE__headers","__PRIVATE_getAuthToken","__PRIVATE_authHeaderTokenValue","__PRIVATE_FirstPartyAuthCredentialsProvider","AppCheckToken","__PRIVATE_FirebaseAppCheckTokenProvider","__PRIVATE_appCheckProvider","appCheck","onTokenChanged","tokenResult","__PRIVATE_tokenUpdated","__PRIVATE_latestAppCheckToken","__PRIVATE_registerAppCheck","addTokenListener","removeTokenListener","__PRIVATE_randomBytes","__PRIVATE_nBytes","crypto","msCrypto","bytes","Uint8Array","getRandomValues","__PRIVATE_i","__PRIVATE_AutoId","static","__PRIVATE_maxMultiple","__PRIVATE_chars","__PRIVATE_autoId","N","right","__PRIVATE_arrayEquals","comparator","every","__PRIVATE_immediateSuccessor","Timestamp","nanoseconds","fromMillis","milliseconds","nanos","toDate","toMillis","_compareTo","other","__PRIVATE_primitiveComparator","__PRIVATE_adjustedSeconds","padStart","SnapshotVersion","timestamp","compareTo","toMicroseconds","toTimestamp","BasePath","segments","offset","child","nameOrPath","limit","segment","construct","popFirst","popLast","firstSegment","lastSegment","isPrefixOf","isImmediateParentOf","potentialChild","fn","end","toArray","p1","p2","ResourcePath","canonicalString","toUriEncodedString","pathComponents","__PRIVATE_identifierRegExp","FieldPath","str","isValidIdentifier","isKeyField","current","__PRIVATE_addCurrentSegment","__PRIVATE_inBackticks","DocumentKey","fromString","emptyPath","collectionGroup","hasCollectionId","collectionId","getCollectionGroup","getCollectionPath","k1","k2","FieldIndex","indexId","fields","indexState","__PRIVATE_fieldIndexGetArraySegment","__PRIVATE_fieldIndex","__PRIVATE_fieldIndexGetDirectionalSegments","cmp","__PRIVATE_indexSegmentComparator","UNKNOWN_ID","IndexSegment","fieldPath","IndexState","sequenceNumber","IndexOffset","J","readTime","largestBatchId","__PRIVATE_successorSeconds","__PRIVATE_successorNanos","__PRIVATE_successor","fromTimestamp","empty","__PRIVATE_newIndexOffsetFromDocument","documentKey","$","__PRIVATE_PRIMARY_LEASE_LOST_ERROR_MSG","PersistenceTransaction","onCommittedListeners","addOnCommittedListener","raiseOnCommittedEvent","__PRIVATE_ignoreIfPrimaryLeaseLoss","PersistencePromise","nextCallback","catchCallback","isDone","callbackAttached","nextFn","catchFn","wrapFailure","wrapSuccess","wrapUserFunction","expectedCount","__PRIVATE_resolvedCount","element","predicates","predicate","__PRIVATE_isTrue","collection","__PRIVATE_promises","waitFor","array","condition","process","__PRIVATE_SimpleDbTransaction","aborted","__PRIVATE_completionDeferred","oncomplete","onabort","__PRIVATE_IndexedDbTransactionError","__PRIVATE_checkForAndReportiOSError","__PRIVATE_completionPromise","abort","__PRIVATE_maybeCommit","__PRIVATE_maybeV3IndexedDb","commit","store","__PRIVATE_storeName","__PRIVATE_SimpleDbStore","__PRIVATE_SimpleDb","__PRIVATE_schemaConverter","__PRIVATE_getIOSVersion","__PRIVATE_wrapRequest","__PRIVATE_isMockPersistence","__PRIVATE_ua","__PRIVATE_iOSVersion","__PRIVATE_isUnsupportedIOS","__PRIVATE_androidVersion","__PRIVATE_getAndroidVersion","__PRIVATE_isUnsupportedAndroid","__PRIVATE_env","__PRIVATE_USE_MOCK_PERSISTENCE","txn","__PRIVATE_iOSVersionRegex","onsuccess","onblocked","onupgradeneeded","__PRIVATE_createOrUpgrade","__PRIVATE_versionchangelistener","onversionchange","__PRIVATE_setVersionChangeListener","__PRIVATE_versionChangeListener","__PRIVATE_objectStores","__PRIVATE_transactionFn","__PRIVATE_readonly","__PRIVATE_attemptNumber","__PRIVATE_ensureDb","__PRIVATE_transactionFnResult","__PRIVATE_retryable","undefined","__PRIVATE_androidVersionRegex","__PRIVATE_IterationController","__PRIVATE_dbCursor","__PRIVATE_shouldStop","__PRIVATE_skipToKey","__PRIVATE_nextKey","cursor","__PRIVATE_skip","__PRIVATE_actionName","cause","__PRIVATE_isIndexedDbTransactionError","__PRIVATE_keyOrValue","count","__PRIVATE_loadAll","__PRIVATE_indexOrRange","range","__PRIVATE_iterateOptions","__PRIVATE_iterateCursor","__PRIVATE_loadFirst","__PRIVATE_deleteAll","__PRIVATE_keysOnly","control","__PRIVATE_iterate","__PRIVATE_optionsOrCallback","__PRIVATE_iterateSerial","__PRIVATE_cursorRequest","primaryKey","__PRIVATE_shouldContinue","continue","__PRIVATE_userResult","__PRIVATE_userPromise","__PRIVATE_indexName","direction","openKeyCursor","openCursor","__PRIVATE_reportedIOSError","__PRIVATE_IOS_ERROR","__PRIVATE_newError","__PRIVATE_IndexBackfillerScheduler","__PRIVATE_backfiller","task","__PRIVATE_schedule","stop","started","delay","enqueueAfterDelay","__PRIVATE_backfill","__PRIVATE_IndexBackfiller","localStore","__PRIVATE_maxDocumentsToProcess","runTransaction","__PRIVATE_writeIndexEntries","__PRIVATE_transation","__PRIVATE_processedCollectionGroups","__PRIVATE_documentsRemaining","__PRIVATE_continueLoop","doWhile","indexManager","getNextCollectionGroupToUpdate","__PRIVATE_writeEntriesForCollectionGroup","__PRIVATE_documentsProcessed","__PRIVATE_documentsRemainingUnderCap","getMinOffsetFromCollectionGroup","__PRIVATE_existingOffset","localDocuments","getNextDocuments","__PRIVATE_nextBatch","docs","changes","updateIndexEntries","__PRIVATE_getNewOffset","__PRIVATE_newOffset","updateCollectionGroup","__PRIVATE_lookupResult","__PRIVATE_maxOffset","__PRIVATE_indexOffsetComparator","batchId","__PRIVATE_ListenSequence","previousValue","__PRIVATE_sequenceNumberSyncer","sequenceNumberHandler","__PRIVATE_setPreviousValue","__PRIVATE_writeNewSequenceNumber","writeSequenceNumber","__PRIVATE_externalPreviousValue","__PRIVATE_nextValue","__PRIVATE_isNullOrUndefined","__PRIVATE_isNegativeZero","isSafeInteger","isInteger","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","__PRIVATE_encodeResourcePath","__PRIVATE_encodeSeparator","__PRIVATE_encodeSegment","__PRIVATE_resultBuf","__PRIVATE_escapeChar","__PRIVATE_decodeResourcePath","__PRIVATE_lastReasonableEscapeIndex","__PRIVATE_segmentBuilder","__PRIVATE_currentPiece","__PRIVATE_INVALID","__PRIVATE_DbMutationBatchUserMutationsKeyPath","qe","userId","__PRIVATE_newDbDocumentMutationKey","__PRIVATE_DbDocumentMutationPlaceholder","__PRIVATE_DbRemoteDocumentKeyPath","__PRIVATE_DbRemoteDocumentDocumentKeyIndexPath","__PRIVATE_DbRemoteDocumentCollectionGroupIndexPath","__PRIVATE_DbTargetQueryTargetsKeyPath","__PRIVATE_DbTargetDocumentKeyPath","__PRIVATE_DbTargetDocumentDocumentTargetsKeyPath","__PRIVATE_DbCollectionParentKeyPath","__PRIVATE_DbIndexStateKeyPath","__PRIVATE_DbIndexStateSequenceNumberIndexPath","__PRIVATE_DbIndexEntryKeyPath","__PRIVATE_DbIndexEntryDocumentKeyIndexPath","__PRIVATE_DbDocumentOverlayKeyPath","__PRIVATE_DbDocumentOverlayCollectionPathOverlayIndexPath","__PRIVATE_DbDocumentOverlayCollectionGroupOverlayIndexPath","__PRIVATE_V11_STORES","__PRIVATE_V12_STORES","__PRIVATE_V13_STORES","__PRIVATE_V14_STORES","__PRIVATE_V15_STORES","__PRIVATE_V16_STORES","__PRIVATE_IndexedDbTransaction","__PRIVATE_simpleDbTransaction","currentSequenceNumber","Ke","__PRIVATE_indexedDbTransaction","__PRIVATE_getStore","__PRIVATE_objectSize","hasOwnProperty","SortedMap","root","LLRBNode","EMPTY","insert","copy","BLACK","remove","__PRIVATE_prunedNodes","minKey","maxKey","inorderTraversal","k","__PRIVATE_descriptions","reverseTraversal","getIterator","SortedMapIterator","getIteratorFrom","getReverseIterator","getReverseIteratorFrom","startKey","isReverse","nodeStack","getNext","hasNext","peek","RED","fixUp","removeMin","isRed","moveRedLeft","__PRIVATE_smallest","rotateRight","moveRedRight","rotateLeft","colorFlip","__PRIVATE_nl","__PRIVATE_nr","checkMaxDepth","__PRIVATE_blackDepth","check","pow","LLRBEmptyNode","SortedSet","elem","first","last","forEachInRange","iter","forEachWhile","firstAfterOrEqual","SortedSetIterator","unionWith","__PRIVATE_thisIt","__PRIVATE_otherIt","__PRIVATE_thisElem","__PRIVATE_otherElem","__PRIVATE_res","targetId","__PRIVATE_advanceIterator","__PRIVATE_it","FieldMask","extraFields","__PRIVATE_mergedMaskSet","covers","__PRIVATE_fieldMaskPath","__PRIVATE_Base64DecodeError","ByteString","binaryString","base64","__PRIVATE_encoded","atob","DOMException","fromCharCode","Symbol","iterator","toBase64","raw","btoa","toUint8Array","buffer","approximateByteSize","__PRIVATE_ISO_TIMESTAMP_REG_EXP","__PRIVATE_normalizeTimestamp","__PRIVATE_fraction","__PRIVATE_nanoStr","__PRIVATE_parsedDate","__PRIVATE_normalizeNumber","__PRIVATE_normalizeByteString","fromBase64String","fromUint8Array","__PRIVATE_isServerTimestamp","mapValue","__type__","stringValue","__PRIVATE_getPreviousValue","__previous_value__","__PRIVATE_getLocalWriteTime","localWriteTime","__local_write_time__","timestampValue","DatabaseInfo","databaseId","persistenceKey","ssl","forceLongPolling","autoDetectLongPolling","longPollingOptions","useFetchStreams","DatabaseId","projectId","database","isDefaultDatabase","MAX_VALUE","MIN_VALUE","nullValue","__PRIVATE_typeOrder","__PRIVATE_isMaxValue","At","__PRIVATE_leftType","booleanValue","__PRIVATE_leftTimestamp","__PRIVATE_rightTimestamp","__PRIVATE_timestampEquals","bytesValue","__PRIVATE_blobEquals","referenceValue","geoPointValue","latitude","longitude","__PRIVATE_geoPointEquals","integerValue","__PRIVATE_n1","doubleValue","__PRIVATE_n2","__PRIVATE_numberEquals","arrayValue","__PRIVATE_valueEquals","__PRIVATE_leftMap","__PRIVATE_rightMap","__PRIVATE_haystack","__PRIVATE_needle","_t","__PRIVATE_rightType","__PRIVATE_leftNumber","__PRIVATE_rightNumber","__PRIVATE_compareNumbers","__PRIVATE_compareTimestamps","__PRIVATE_leftBytes","__PRIVATE_rightBytes","__PRIVATE_leftPath","__PRIVATE_rightPath","__PRIVATE_leftSegments","__PRIVATE_rightSegments","comparison","__PRIVATE_leftArray","__PRIVATE_rightArray","compare","__PRIVATE_valueCompare","__PRIVATE_leftKeys","__PRIVATE_rightKeys","__PRIVATE_keyCompare","canonicalId","__PRIVATE_canonifyValue","__PRIVATE_normalizedTimestamp","byteString","__PRIVATE_canonifyByteString","fromName","__PRIVATE_canonifyReference","__PRIVATE_geoPoint","__PRIVATE_canonifyGeoPoint","__PRIVATE_sortedKeys","__PRIVATE_canonifyMap","__PRIVATE_estimateByteSize","__PRIVATE_previousSize","__PRIVATE_estimateMapByteSize","wt","__PRIVATE_isNullValue","__PRIVATE_isNanValue","__PRIVATE_isMapValue","__PRIVATE_deepClone","source","__PRIVATE_valuesGetLowerBound","NaN","__PRIVATE_refValue","__PRIVATE_valuesGetUpperBound","Dt","inclusive","ObjectValue","field","__PRIVATE_currentLevel","getFieldsMap","setAll","parent","__PRIVATE_upserts","__PRIVATE_deletes","__PRIVATE_fieldsMap","applyChanges","__PRIVATE_nestedValue","__PRIVATE_inserts","clone","__PRIVATE_extractFieldMask","__PRIVATE_currentPath","__PRIVATE_nestedFields","__PRIVATE_nestedPath","MutableDocument","documentType","createTime","documentState","convertToFoundDocument","convertToNoDocument","convertToUnknownDocument","setHasCommittedMutations","setHasLocalMutations","setReadTime","hasLocalMutations","hasCommittedMutations","hasPendingWrites","isValidDocument","isFoundDocument","isNoDocument","isUnknownDocument","mutableCopy","Bound","__PRIVATE_boundCompareToDocument","bound","orderBy","doc","__PRIVATE_orderByComponent","dir","Xt","OrderBy","Ht","Filter","FieldFilter","createKeyFieldInFilter","__PRIVATE_KeyFieldFilter","__PRIVATE_ArrayContainsFilter","__PRIVATE_InFilter","__PRIVATE_NotInFilter","__PRIVATE_ArrayContainsAnyFilter","__PRIVATE_KeyFieldInFilter","__PRIVATE_KeyFieldNotInFilter","matchesComparison","isInequality","getFlattenedFilters","getFilters","CompositeFilter","filters","__PRIVATE_compositeFilterIsConjunction","__PRIVATE_memoizedFlattenedFilters","__PRIVATE_subfilter","compositeFilter","__PRIVATE_compositeFilterIsDisjunction","__PRIVATE_compositeFilterIsFlatConjunction","__PRIVATE_compositeFilterIsFlat","__PRIVATE_canonifyFilter","__PRIVATE_canonicalIdsString","__PRIVATE_f1","__PRIVATE_f2","__PRIVATE_fieldFilterEquals","__PRIVATE_f1Filter","__PRIVATE_filterEquals","nn","__PRIVATE_otherFilters","__PRIVATE_mergedFilters","__PRIVATE_stringifyFilter","__PRIVATE_stringifyCompositeFilter","__PRIVATE_extractDocumentKeysFromArrayValue","__PRIVATE_arrayValueContains","__PRIVATE_TargetImpl","startAt","endAt","__PRIVATE_newTarget","__PRIVATE_canonifyTarget","__PRIVATE_targetImpl","__PRIVATE_memoizedCanonicalId","__PRIVATE_orderByEquals","__PRIVATE_boundEquals","__PRIVATE_targetIsDocumentTarget","isDocumentKey","On","__PRIVATE_targetGetAscendingBound","fieldFilter","__PRIVATE_targetGetFieldFiltersForPath","__PRIVATE_filterValue","__PRIVATE_filterInclusive","__PRIVATE_lowerBoundCompare","__PRIVATE_cursorValue","__PRIVATE_targetGetDescendingBound","__PRIVATE_upperBoundCompare","__PRIVATE_QueryImpl","explicitOrderBy","limitType","__PRIVATE_newQuery","__PRIVATE_newQueryForPath","__PRIVATE_queryMatchesAllDocuments","__PRIVATE_isCollectionGroupQuery","__PRIVATE_queryNormalizedOrderBy","__PRIVATE_queryImpl","__PRIVATE_memoizedNormalizedOrderBy","__PRIVATE_fieldsNormalized","__PRIVATE_lastDirection","__PRIVATE_inequalityFields","keyField","__PRIVATE_queryToTarget","__PRIVATE_memoizedTarget","__PRIVATE__queryToTarget","__PRIVATE_orderBys","Rn","__PRIVATE_newFilters","__PRIVATE_queryWithLimit","kn","__PRIVATE_targetEquals","__PRIVATE_canonifyQuery","__PRIVATE_stringifyQuery","En","__PRIVATE_docPath","__PRIVATE_queryMatchesOrderBy","__PRIVATE_boundSortsBeforeDocument","__PRIVATE_boundSortsAfterDocument","__PRIVATE_queryCollectionGroup","__PRIVATE_newQueryComparator","__PRIVATE_d1","__PRIVATE_d2","__PRIVATE_comparedOnKeyField","comp","__PRIVATE_compareDocs","v1","v2","ObjectMap","mapKeyFn","equalsFn","inner","innerSize","__PRIVATE_otherKey","splice","__PRIVATE_EMPTY_MUTABLE_DOCUMENT_MAP","__PRIVATE_mutableDocumentMap","__PRIVATE_EMPTY_DOCUMENT_MAP","documentMap","__PRIVATE_convertOverlayedDocumentMapToDocumentMap","documents","overlayedDocument","__PRIVATE_newOverlayMap","__PRIVATE_newDocumentKeyMap","__PRIVATE_newMutationMap","__PRIVATE_EMPTY_DOCUMENT_VERSION_MAP","__PRIVATE_EMPTY_DOCUMENT_KEY_SET","Kn","__PRIVATE_EMPTY_TARGET_ID_SET","__PRIVATE_targetIdSet","serializer","useProto3Json","Infinity","__PRIVATE_toInteger","toNumber","__PRIVATE_toDouble","TransformOperation","__PRIVATE_applyTransformOperationToLocalView","transform","__PRIVATE_ServerTimestampTransform","serverTimestamp","__PRIVATE_ArrayUnionTransformOperation","__PRIVATE_applyArrayUnionTransformOperation","__PRIVATE_ArrayRemoveTransformOperation","__PRIVATE_applyArrayRemoveTransformOperation","__PRIVATE_baseValue","__PRIVATE_computeTransformOperationBaseValue","sum","asNumber","__PRIVATE_operand","__PRIVATE_applyNumericIncrementTransformOperationToLocalView","__PRIVATE_applyTransformOperationToRemoteDocument","__PRIVATE_transformResult","__PRIVATE_NumericIncrementTransformOperation","__PRIVATE_isNumber","elements","__PRIVATE_coercedFieldValuesArray","__PRIVATE_toUnion","__PRIVATE_toRemove","FieldTransform","MutationResult","transformResults","Precondition","updateTime","exists","isNone","fr","precondition","Mutation","Or","mask","__PRIVATE_DeleteMutation","none","__PRIVATE_SetMutation","__PRIVATE_docValue","__PRIVATE_patchValue","__PRIVATE_maskSet","__PRIVATE_PatchMutation","__PRIVATE_mutationApplyToRemoteDocument","mutation","__PRIVATE_mutationResult","__PRIVATE_newData","__PRIVATE_serverTransformResults","fieldTransforms","__PRIVATE_preconditionIsValidForDocument","__PRIVATE_getPatch","__PRIVATE_patchMutationApplyToRemoteDocument","__PRIVATE_deleteMutationApplyToRemoteDocument","__PRIVATE_mutationApplyToLocalView","__PRIVATE_previousMask","__PRIVATE_localTransformResults","fieldMask","gr","__PRIVATE_baseObject","__PRIVATE_fieldTransform","__PRIVATE_existingValue","__PRIVATE_coercedValue","_r","getFieldMask","__PRIVATE_mutableDocument","__PRIVATE_VerifyMutation","MutationBatch","baseMutations","mutations","applyToRemoteDocument","batchResult","mutationResults","applyToLocalView","mutatedFields","applyToLocalDocumentSet","documentsWithoutRemoteVersion","overlays","__PRIVATE_overlay","__PRIVATE_calculateOverlayMutation","__PRIVATE_documentKeySet","__PRIVATE_mutationEquals","MutationBatchResult","batch","commitVersion","docVersions","__PRIVATE_versionMap","Overlay","getKey","__PRIVATE_AggregateImpl","alias","aggregateType","ExistenceFilter","unchangedNames","__PRIVATE_RpcCode","RpcCode","__PRIVATE_isPermanentError","__PRIVATE_mapCodeFromRpcCode","__PRIVATE_testingHooksSpi","__PRIVATE_newTextEncoder","TextEncoder","__PRIVATE_MAX_64_BIT_UNSIGNED_INTEGER","Integer","__PRIVATE_getMd5HashValue","__PRIVATE_encodedValue","encode","__PRIVATE_md5","Md5","update","digest","__PRIVATE_get64BitUints","Bytes","__PRIVATE_dataView","DataView","__PRIVATE_chunk1","getUint32","__PRIVATE_chunk2","__PRIVATE_chunk3","__PRIVATE_chunk4","BloomFilter","bitmap","padding","hashCount","__PRIVATE_BloomFilterError","__PRIVATE_bitCount","__PRIVATE_bitCountInInteger","fromNumber","__PRIVATE_getBitIndex","__PRIVATE_num1","__PRIVATE_num2","__PRIVATE_hashIndex","__PRIVATE_hashValue","multiply","getBits","modulo","__PRIVATE_isBitSet","mightContain","__PRIVATE_md5HashedValue","__PRIVATE_hash1","__PRIVATE_hash2","ceil","bloomFilter","item","__PRIVATE_setBit","__PRIVATE_indexOfByte","RemoteEvent","snapshotVersion","targetChanges","targetMismatches","documentUpdates","resolvedLimboDocuments","resumeToken","TargetChange","createSynthesizedTargetChangeForCurrentChange","addedDocuments","modifiedDocuments","removedDocuments","__PRIVATE_DocumentWatchChange","__PRIVATE_updatedTargetIds","removedTargetIds","__PRIVATE_newDoc","__PRIVATE_ExistenceFilterChange","__PRIVATE_existenceFilter","__PRIVATE_WatchTargetChange","state","targetIds","EMPTY_BYTE_STRING","__PRIVATE_TargetState","__PRIVATE_documentChanges","__PRIVATE__resumeToken","__PRIVATE__current","__PRIVATE_isPending","__PRIVATE_pendingResponses","__PRIVATE_hasPendingChanges","__PRIVATE__hasPendingChanges","__PRIVATE_updateResumeToken","__PRIVATE_toTargetChange","changeType","__PRIVATE_clearPendingChanges","__PRIVATE_snapshotChangesMap","__PRIVATE_addDocumentChange","__PRIVATE_removeDocumentChange","__PRIVATE_recordPendingTargetRequest","__PRIVATE_recordTargetResponse","__PRIVATE_markCurrent","__PRIVATE_WatchChangeAggregator","__PRIVATE_metadataProvider","__PRIVATE_targetStates","__PRIVATE_pendingDocumentUpdates","__PRIVATE_pendingDocumentTargetMapping","__PRIVATE_handleDocumentChange","__PRIVATE_docChange","__PRIVATE_addDocumentToTarget","__PRIVATE_removeDocumentFromTarget","__PRIVATE_handleTargetChange","targetChange","forEachTarget","__PRIVATE_targetState","__PRIVATE_ensureTargetState","__PRIVATE_isActiveTarget","removeTarget","__PRIVATE_resetTarget","__PRIVATE_handleExistenceFilter","__PRIVATE_watchChange","targetData","__PRIVATE_targetDataForActiveTarget","newNoDocument","__PRIVATE_currentSize","__PRIVATE_getCurrentDocumentCountForTarget","__PRIVATE_parseBloomFilter","__PRIVATE_applyBloomFilter","purpose","__PRIVATE_pendingTargetResets","__PRIVATE_notifyOnExistenceFilterMismatch","localCacheCount","__PRIVATE_bloomFilterStatus","existenceFilterCount","applied","bitmapLength","bits","_f","__PRIVATE_getDatabaseId","__PRIVATE_normalizedBitmap","__PRIVATE_currentCount","__PRIVATE_filterRemovedDocuments","__PRIVATE_existingKeys","getRemoteKeysForTarget","__PRIVATE_removalCount","documentPath","__PRIVATE_createRemoteEvent","__PRIVATE_targetContainsDocument","__PRIVATE_targets","__PRIVATE_isOnlyLimboTarget","remoteEvent","__PRIVATE_documentTargetMap","__PRIVATE_ensureDocumentTargetMapping","__PRIVATE_updatedDocument","__PRIVATE_targetMapping","__PRIVATE_targetActive","__PRIVATE_getTargetDataForTarget","__PRIVATE_DIRECTIONS","__PRIVATE_dirs","__PRIVATE_OPERATORS","__PRIVATE_ops","__PRIVATE_COMPOSITE_OPERATORS","JsonProtoSerializer","__PRIVATE_toInt32Proto","ao","co","__PRIVATE_fromVersion","uo","__PRIVATE_toResourcePath","lo","__PRIVATE_resourcePath","__PRIVATE_fullyQualifiedPrefixPath","__PRIVATE_fromResourceName","__PRIVATE_resource","__PRIVATE_isValidResourceName","ho","__PRIVATE_toResourceName","__PRIVATE_extractLocalPathFromResourceName","__PRIVATE_toQueryPath","__PRIVATE_fromQueryPath","__PRIVATE_resourceName","__PRIVATE_getEncodedDatabaseId","__PRIVATE_toMutationDocument","__PRIVATE_toName","__PRIVATE_fromDocument","newFoundDocument","toMutation","updateMask","__PRIVATE_toDocumentMask","updateTransforms","setToServerValue","appendMissingElements","removeAllFromArray","increment","currentDocument","__PRIVATE_toVersion","yo","proto","__PRIVATE_fromPrecondition","fromServerFormat","__PRIVATE_fromFieldTransform","paths","fieldPaths","__PRIVATE_fromDocumentMask","vo","qo","__PRIVATE_queryTarget","structuredQuery","allDescendants","__PRIVATE_toFilter","__PRIVATE_toFilters","order","__PRIVATE_toFieldPathReference","__PRIVATE_toDirection","__PRIVATE_toOrder","before","__PRIVATE_toEndAtCursor","__PRIVATE_convertQueryTargetToQuery","__PRIVATE_fromCount","__PRIVATE_filterBy","__PRIVATE_fromFilter","__PRIVATE_fromFilters","__PRIVATE_fromFieldPathReference","__PRIVATE_fromOrder","__PRIVATE_fromInt32Proto","__PRIVATE_fromStartAtCursor","unaryFilter","__PRIVATE_nanField","__PRIVATE_nullField","__PRIVATE_notNanField","__PRIVATE_notNullField","__PRIVATE_fromUnaryFilter","__PRIVATE_fromOperatorName","__PRIVATE_fromFieldFilter","__PRIVATE_fromCompositeOperatorName","__PRIVATE_fromCompositeFilter","__PRIVATE_toOperatorName","__PRIVATE_toCompositeOperatorName","__PRIVATE_fieldReference","__PRIVATE_toUnaryOrFieldFilter","__PRIVATE_protos","__PRIVATE_toCompositeFilter","__PRIVATE_canonicalFields","TargetData","lastLimboFreeSnapshotVersion","withSequenceNumber","withResumeToken","withExpectedCount","withLastLimboFreeSnapshotVersion","__PRIVATE_LocalSerializer","__PRIVATE_remoteSerializer","Co","__PRIVATE_localSerializer","__PRIVATE_remoteDoc","prefixPath","documentId","__PRIVATE_toDbTimestampKey","__PRIVATE_toDocument","noDocument","__PRIVATE_toDbTimestamp","unknownDocument","__PRIVATE_fromDbTimestamp","__PRIVATE_dbTimestamp","jo","__PRIVATE_dbBatch","__PRIVATE_fromMutation","__PRIVATE_currentMutation","__PRIVATE_transformMutation","localWriteTimeMs","__PRIVATE_fromDbTarget","__PRIVATE_dbTarget","__PRIVATE_dbQuery","__PRIVATE_documentsTarget","__PRIVATE_fromQueryTarget","lastListenSequenceNumber","Xo","__PRIVATE_dbLastLimboFreeTimestamp","__PRIVATE_queryProto","__PRIVATE_toDocumentsTarget","__PRIVATE_toQueryTarget","__PRIVATE_fromBundledQuery","bundledQuery","Ho","__PRIVATE_dbDocumentOverlay","overlayMutation","Vo","__PRIVATE_docKey","__PRIVATE_docId","__PRIVATE_toDbIndexState","__PRIVATE_IndexedDbBundleCache","getBundleMetadata","__PRIVATE_bundlesStore","__PRIVATE_bundle","__PRIVATE_dbBundle","saveBundleMetadata","__PRIVATE_bundleMetadata","getNamedQuery","queryName","__PRIVATE_namedQueriesStore","__PRIVATE_dbNamedQuery","saveNamedQuery","__PRIVATE_IndexedDbDocumentOverlayCache","getOverlay","__PRIVATE_documentOverlayStore","__PRIVATE_toDbDocumentOverlayKey","__PRIVATE_dbOverlay","__PRIVATE_fromDbDocumentOverlay","getOverlays","saveOverlays","__PRIVATE_saveOverlay","removeOverlaysForBatchId","documentKeys","__PRIVATE_collectionPaths","collectionPath","IDBKeyRange","getOverlaysForCollection","sinceBatchId","POSITIVE_INFINITY","__PRIVATE_dbOverlays","getOverlaysForCollectionGroup","__PRIVATE_currentBatchId","__PRIVATE_toDbDocumentOverlay","__PRIVATE_FirestoreIndexValueWriter","__PRIVATE_writeIndexValue","__PRIVATE_encoder","__PRIVATE_writeIndexValueAux","__PRIVATE_writeInfinity","__PRIVATE_indexValue","__PRIVATE_writeValueTypeLabel","__PRIVATE_writeNumber","__PRIVATE_writeString","__PRIVATE_writeIndexString","__PRIVATE_writeTruncationMarker","__PRIVATE_writeBytes","__PRIVATE_writeIndexEntityRef","__PRIVATE_writeIndexMap","__PRIVATE_writeIndexArray","__PRIVATE_stringIndexValue","__PRIVATE_writeUnlabeledIndexString","__PRIVATE_mapIndexValue","__PRIVATE_arrayIndexValue","__PRIVATE_numberOfLeadingZerosInByte","x","__PRIVATE_zeros","__PRIVATE_unsignedNumLength","__PRIVATE_numBits","__PRIVATE_leadingZeros","__PRIVATE_INSTANCE","__PRIVATE_OrderedCodeWriter","__PRIVATE_writeBytesAscending","__PRIVATE_byte","__PRIVATE_writeByteAscending","__PRIVATE_writeSeparatorAscending","__PRIVATE_writeBytesDescending","__PRIVATE_writeByteDescending","__PRIVATE_writeSeparatorDescending","__PRIVATE_writeUtf8Ascending","__PRIVATE_sequence","charCode","__PRIVATE_codePoint","codePointAt","__PRIVATE_writeUtf8Descending","__PRIVATE_writeNumberAscending","__PRIVATE_toOrderedBits","__PRIVATE_ensureAvailable","__PRIVATE_writeNumberDescending","__PRIVATE_writeInfinityAscending","__PRIVATE_writeEscapedByteAscending","__PRIVATE_writeInfinityDescending","__PRIVATE_writeEscapedByteDescending","seed","__PRIVATE_encodedBytes","__PRIVATE_dv","ArrayBuffer","setFloat64","__PRIVATE_doubleToLongBits","__PRIVATE_isNegative","__PRIVATE_masked","__PRIVATE_minCapacity","__PRIVATE_newLength","__PRIVATE_newBuffer","__PRIVATE_AscendingIndexByteEncoder","__PRIVATE_orderedCode","__PRIVATE_DescendingIndexByteEncoder","__PRIVATE_IndexByteEncoder","__PRIVATE_forKind","__PRIVATE_ascending","__PRIVATE_descending","__PRIVATE_IndexEntry","directionalValue","__PRIVATE_currentLength","ci","__PRIVATE_compareByteArrays","pi","__PRIVATE_TargetIndexMatcher","__PRIVATE_inequalityFilters","__PRIVATE_lhs","__PRIVATE_rhs","__PRIVATE_equalityFilters","__PRIVATE_hasMultipleInequality","__PRIVATE_servedByIndex","__PRIVATE_arraySegment","__PRIVATE_hasMatchingEqualityFilter","__PRIVATE_equalitySegments","__PRIVATE_segmentIndex","__PRIVATE_orderBysIndex","__PRIVATE_inequalityFilter","__PRIVATE_matchesFilter","__PRIVATE_matchesOrderBy","__PRIVATE_buildTargetIndex","__PRIVATE_uniqueFields","__PRIVATE_isArrayOperator","__PRIVATE_computeInExpansion","__PRIVATE_expandedFilters","__PRIVATE_getDnfTerms","__PRIVATE_computeDistributedNormalForm","__PRIVATE_isDisjunctiveNormalForm","__PRIVATE_isSingleFieldFilter","__PRIVATE_isFlatConjunction","__PRIVATE_subFilter","__PRIVATE_newFilter","__PRIVATE_applyAssociation","__PRIVATE_runningResult","__PRIVATE_applyDistribution","zi","__PRIVATE_applyDistributionFieldFilters","__PRIVATE_applyDistributionFieldAndCompositeFilters","__PRIVATE_compositeFilterWithAddedFilters","__PRIVATE_disjunctionSide","__PRIVATE_otherSide","__PRIVATE_updatedFilters","__PRIVATE_newSubfilters","__PRIVATE_MemoryIndexManager","__PRIVATE_collectionParentIndex","__PRIVATE_MemoryCollectionParentIndex","addToCollectionParentIndex","getCollectionParents","getEntries","addFieldIndex","deleteFieldIndex","deleteAllFieldIndexes","createTargetIndexes","getDocumentsMatchingTarget","getIndexType","getFieldIndexes","getMinOffset","parentPath","__PRIVATE_existingParents","__PRIVATE_added","__PRIVATE_EMPTY_VALUE","__PRIVATE_IndexedDbIndexManager","__PRIVATE_collectionParentsCache","__PRIVATE_targetToDnfSubTargets","__PRIVATE_collectionParent","__PRIVATE_collectionParentsStore","__PRIVATE_parentPaths","entry","indexes","__PRIVATE_indexConfigurationStore","__PRIVATE_dbIndex","__PRIVATE_states","__PRIVATE_indexStateStore","__PRIVATE_indexEntriesStore","__PRIVATE_getSubTargets","__PRIVATE_subTarget","__PRIVATE_indexEntries","__PRIVATE_canServeTarget","__PRIVATE_getFieldIndex","__PRIVATE_fieldIndexToString","__PRIVATE_arrayValues","__PRIVATE_notInValues","lowerBound","__PRIVATE_segmentBound","upperBound","__PRIVATE_targetGetUpperBound","__PRIVATE_lowerBoundEncoded","__PRIVATE_encodeBound","__PRIVATE_upperBoundEncoded","__PRIVATE_notInEncoded","__PRIVATE_encodeValues","__PRIVATE_indexRanges","__PRIVATE_generateIndexRanges","__PRIVATE_indexRange","fromSegments","__PRIVATE_subTargets","__PRIVATE_term","__PRIVATE_lowerBounds","__PRIVATE_lowerBoundInclusive","__PRIVATE_upperBounds","__PRIVATE_upperBoundInclusive","__PRIVATE_totalScans","__PRIVATE_scansPerArrayElement","__PRIVATE_encodeSingleElement","__PRIVATE_generateLowerBound","__PRIVATE_generateUpperBound","__PRIVATE_notInBound","__PRIVATE_notIn","createRange","__PRIVATE_targetIndexMatcher","candidate","__PRIVATE_indexType","__PRIVATE_hasArraySegment","__PRIVATE_targetGetSegmentCount","__PRIVATE_targetHasLimit","__PRIVATE_encodeDirectionalElements","__PRIVATE_directionalEncoder","__PRIVATE_encodeDirectionalKey","__PRIVATE_directionalSegments","__PRIVATE_fieldIndexGetKeyOrder","__PRIVATE_encoders","__PRIVATE_valueIdx","__PRIVATE_isInFilter","__PRIVATE_expandIndexValues","__PRIVATE_getEncodedBytes","prefixes","__PRIVATE_arrayElement","__PRIVATE_clonedEncoder","__PRIVATE_indexConfigs","__PRIVATE_indexConfig","__PRIVATE_decodedState","__PRIVATE_decodedSegments","__PRIVATE_fromDbIndexConfiguration","__PRIVATE_getNextSequenceNumber","__PRIVATE_nextSequenceNumber","__PRIVATE_configs","__PRIVATE_memoizedIndexes","__PRIVATE_memoizedCollectionIndexes","__PRIVATE_fieldIndexes","__PRIVATE_getExistingIndexEntries","__PRIVATE_existingEntries","__PRIVATE_newEntries","__PRIVATE_computeIndexEntries","__PRIVATE_updateEntries","__PRIVATE_addIndexEntry","__PRIVATE_indexEntry","orderedDocumentKey","__PRIVATE_deleteIndexEntry","__PRIVATE_indexEntryComparator","only","after","__PRIVATE_onAdd","__PRIVATE_onRemove","__PRIVATE_beforeIt","__PRIVATE_afterIt","__PRIVATE_beforeValue","__PRIVATE_afterValue","__PRIVATE_removed","__PRIVATE_diffSortedSets","lower","upper","__PRIVATE_bounds","__PRIVATE_notInValue","__PRIVATE_cmpToLower","__PRIVATE_cmpToUpper","__PRIVATE_ranges","__PRIVATE_isRangeMatchable","__PRIVATE_getMinOffsetFromFieldIndexes","mapArray","__PRIVATE_minOffset","__PRIVATE_maxBatchId","__PRIVATE_GC_DID_NOT_RUN","didRun","sequenceNumbersCollected","targetsRemoved","documentsRemoved","LruParams","cacheSizeCollectionThreshold","percentileToCollect","maximumSequenceNumbersToCollect","cacheSize","DEFAULT_COLLECTION_PERCENTILE","DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT","removeMutationBatch","__PRIVATE_mutationStore","__PRIVATE_indexTxn","__PRIVATE_numDeleted","__PRIVATE_removePromise","__PRIVATE_indexKey","__PRIVATE_dbDocumentSize","DISABLED","__PRIVATE_IndexedDbMutationQueue","referenceDelegate","checkEmpty","NEGATIVE_INFINITY","__PRIVATE_mutationsStore","addMutationBatch","__PRIVATE_documentStore","__PRIVATE_documentMutationsStore","__PRIVATE_serializedBaseMutations","__PRIVATE_serializedMutations","__PRIVATE_toDbMutationBatch","__PRIVATE_collectionParents","__PRIVATE_documentKeysByBatchId","lookupMutationBatch","__PRIVATE_fromDbMutationBatch","__PRIVATE_lookupMutationKeys","getNextMutationBatchAfterBatchId","__PRIVATE_nextBatchId","__PRIVATE_foundBatch","getHighestUnacknowledgedBatchId","getAllMutationBatches","__PRIVATE_dbBatches","getAllMutationBatchesAffectingDocumentKey","__PRIVATE_indexPrefix","__PRIVATE_newDbDocumentMutationPrefixForPath","__PRIVATE_indexStart","__PRIVATE_userID","__PRIVATE_encodedPath","getAllMutationBatchesAffectingDocumentKeys","__PRIVATE_uniqueBatchIDs","__PRIVATE_batchID","__PRIVATE_lookupMutationBatches","getAllMutationBatchesAffectingQuery","__PRIVATE_queryPath","__PRIVATE_immediateChildrenLength","__PRIVATE_batchIDs","__PRIVATE_removeCachedMutationKeys","markPotentiallyOrphaned","performConsistencyCheck","__PRIVATE_startRange","__PRIVATE_danglingMutationReferences","containsKey","__PRIVATE_mutationQueueContainsKey","__PRIVATE_getMutationQueueMetadata","__PRIVATE_mutationQueuesStore","lastAcknowledgedBatchId","lastStreamToken","__PRIVATE_TargetIdGenerator","__PRIVATE_lastId","__PRIVATE_IndexedDbTargetCache","allocateTargetId","__PRIVATE_retrieveMetadata","__PRIVATE_targetIdGenerator","highestTargetId","__PRIVATE_saveMetadata","getLastRemoteSnapshotVersion","lastRemoteSnapshotVersion","getHighestSequenceNumber","__PRIVATE_targetGlobal","highestListenSequenceNumber","setTargetsMetadata","addTargetData","__PRIVATE_saveTargetData","targetCount","__PRIVATE_updateMetadataFromTargetData","updateTargetData","removeTargetData","removeMatchingKeysForTargetId","__PRIVATE_targetsStore","removeTargets","activeTargetIds","__PRIVATE_globalTargetStore","__PRIVATE_toDbTarget","updated","getTargetCount","getTargetData","found","addMatchingKeys","__PRIVATE_documentTargetStore","addReference","removeMatchingKeys","removeReference","getMatchingKeysForTargetId","__PRIVATE_bufferEntryComparator","__PRIVATE_bIndex","__PRIVATE_aSequence","__PRIVATE_aIndex","__PRIVATE_bSequence","__PRIVATE_seqCmp","__PRIVATE_RollingSequenceNumberBuffer","__PRIVATE_maxElements","__PRIVATE_nextIndex","__PRIVATE_previousIndex","__PRIVATE_addElement","__PRIVATE_highestValue","maxValue","__PRIVATE_LruScheduler","garbageCollector","__PRIVATE_gcTask","__PRIVATE_scheduleGC","collectGarbage","__PRIVATE_LruGarbageCollectorImpl","__PRIVATE_delegate","calculateTargetCount","percentile","__PRIVATE_getSequenceNumberCount","nthSequenceNumber","__PRIVATE_forEachOrphanedDocumentSequenceNumber","removeOrphanedDocuments","collect","getCacheSize","__PRIVATE_runGarbageCollection","__PRIVATE_upperBoundSequenceNumber","__PRIVATE_sequenceNumbersToCollect","__PRIVATE_countedTargetsTs","__PRIVATE_foundUpperBoundTs","__PRIVATE_removedTargetsTs","__PRIVATE_removedDocumentsTs","__PRIVATE_startTs","__PRIVATE_sequenceNumbers","__PRIVATE_numTargetsRemoved","Vi","__PRIVATE_IndexedDbLruDelegateImpl","__PRIVATE_newLruGarbageCollector","__PRIVATE_docCountPromise","__PRIVATE_orphanedDocumentCount","getTargetCache","__PRIVATE_docCount","__PRIVATE_orphanedCount","__PRIVATE_forEachOrphanedDocument","__PRIVATE_writeSentinelKey","__PRIVATE_isPinned","__PRIVATE_mutationQueuesContainKey","__PRIVATE_changeBuffer","getRemoteDocumentCache","newChangeBuffer","__PRIVATE_documentCount","getEntry","removeEntry","apply","updateLimboDocument","__PRIVATE_nextPath","__PRIVATE_nextToReport","getSize","__PRIVATE_sentinelRow","RemoteDocumentChangeBuffer","changesApplied","addEntry","assertNotApplied","newInvalidDocument","__PRIVATE_bufferedEntry","getFromCache","getAllFromCache","__PRIVATE_IndexedDbRemoteDocumentCacheImpl","setIndexManager","__PRIVATE_remoteDocumentsStore","updateMetadata","__PRIVATE_sizeDelta","getMetadata","byteSize","__PRIVATE_setMetadata","__PRIVATE_dbKey","__PRIVATE_dbRemoteDoc","__PRIVATE_maybeDecodeDocument","__PRIVATE_getSizedEntry","__PRIVATE_forEachDbEntry","__PRIVATE_getSizedEntries","__PRIVATE_sizeMap","__PRIVATE_dbKeyComparator","__PRIVATE_keyIter","__PRIVATE_potentialKey","getDocumentsMatchingQuery","mutatedDocs","__PRIVATE_endKey","__PRIVATE_dbRemoteDocs","incrementDocumentReadCount","__PRIVATE_queryMatches","getAllFromCollectionGroup","__PRIVATE_dbCollectionGroupKey","__PRIVATE_IndexedDbRemoteDocumentChangeBuffer","trackRemovals","__PRIVATE_documentGlobalStore","newUnknownDocument","__PRIVATE_dbTimestampKey","__PRIVATE_fromDbTimestampKey","__PRIVATE_newIndexedDbRemoteDocumentCache","__PRIVATE_documentCache","__PRIVATE_documentStates","documentChange","__PRIVATE_previousDoc","__PRIVATE_toDbRemoteDocument","__PRIVATE_deletedDoc","__PRIVATE_getResult","os","OverlayedDocument","LocalDocumentsView","remoteDocumentCache","mutationQueue","documentOverlayCache","getDocument","getDocuments","getLocalViewOfDocuments","existenceStateChanged","populateOverlays","computeViews","__PRIVATE_computeViewsResult","getOverlayedDocuments","__PRIVATE_missingOverlays","__PRIVATE_recalculateDocuments","recalculateAndSaveOverlays","__PRIVATE_recalculatedFields","__PRIVATE_masks","__PRIVATE_documentsByBatchId","key1","key2","__PRIVATE_processed","__PRIVATE_batches","__PRIVATE_baseDoc","__PRIVATE_newSet","recalculateAndSaveOverlaysForDocumentKeys","__PRIVATE_isDocumentQuery","getDocumentsMatchingDocumentQuery","getDocumentsMatchingCollectionGroupQuery","getDocumentsMatchingCollectionQuery","__PRIVATE_originalDocs","__PRIVATE_overlaysPromise","__PRIVATE_modifiedDocs","__PRIVATE_localDocs","__PRIVATE_parents","__PRIVATE_collectionQuery","__PRIVATE_remoteDocuments","__PRIVATE_MemoryBundleCache","__PRIVATE_bundles","__PRIVATE_namedQueries","__PRIVATE_fromBundleMetadata","namedQuery","__PRIVATE_fromProtoNamedQuery","__PRIVATE_MemoryDocumentOverlayCache","__PRIVATE_overlayByBatchId","__PRIVATE_immediateChildrenPathLength","__PRIVATE_batchIdToOverlays","__PRIVATE_overlaysForBatchId","__PRIVATE_batchIter","__PRIVATE_existing","__PRIVATE_ReferenceSet","__PRIVATE_DocReference","__PRIVATE_compareByKey","__PRIVATE_compareByTargetId","__PRIVATE_refsByKey","ref","__PRIVATE_refsByTarget","__PRIVATE_addReferences","__PRIVATE_removeRef","__PRIVATE_removeReferences","__PRIVATE_removeReferencesForId","__PRIVATE_emptyKey","__PRIVATE_startRef","__PRIVATE_endRef","__PRIVATE_removeAllReferences","__PRIVATE_referencesForId","__PRIVATE_firstRef","__PRIVATE_targetOrBatchId","__PRIVATE_MemoryMutationQueue","__PRIVATE_batchesByDocumentKey","__PRIVATE_findMutationBatch","__PRIVATE_rawIndex","__PRIVATE_indexOfBatchId","__PRIVATE_findMutationBatches","__PRIVATE_startPath","__PRIVATE_rowKeyPath","__PRIVATE_indexOfExistingBatchId","shift","__PRIVATE_references","__PRIVATE_MemoryRemoteDocumentCacheImpl","__PRIVATE_sizer","__PRIVATE_limti","__PRIVATE_forEachDocumentKey","__PRIVATE_MemoryRemoteDocumentChangeBuffer","__PRIVATE_MemoryTargetCache","__PRIVATE_forTargetCache","__PRIVATE_highestSequenceNumber","__PRIVATE_removals","__PRIVATE_matchingKeys","__PRIVATE_MemoryPersistence","__PRIVATE_referenceDelegateFactory","__PRIVATE__started","__PRIVATE_targetCache","__PRIVATE_documentSize","__PRIVATE_bundleCache","setDatabaseDeletedListener","setNetworkEnabled","getIndexManager","getDocumentOverlayCache","getMutationQueue","__PRIVATE_queue","__PRIVATE_mutationQueues","getBundleCache","transactionOperation","__PRIVATE_MemoryTransaction","__PRIVATE_listenSequence","__PRIVATE_onTransactionStarted","__PRIVATE_onTransactionCommitted","__PRIVATE_MemoryEagerDelegate","__PRIVATE_localViewReferences","__PRIVATE_orphanedDocuments","__PRIVATE__orphanedDocuments","cache","fromPath","__PRIVATE_isReferenced","__PRIVATE_MemoryLruDelegate","__PRIVATE_lruParams","__PRIVATE_orphanedSequenceNumbers","__PRIVATE_orphanedAt","__PRIVATE_SchemaConverter","autoIncrement","createIndex","unique","__PRIVATE_createQueryCache","deleteObjectStore","__PRIVATE_dropQueryCache","__PRIVATE_globalStore","__PRIVATE_writeEmptyTargetGlobalEntry","__PRIVATE_existingMutations","__PRIVATE_v3MutationsStore","__PRIVATE_writeAll","__PRIVATE_upgradeMutationBatchSchemaAndMigrateData","__PRIVATE_removeAcknowledgedMutations","__PRIVATE_addDocumentGlobal","__PRIVATE_ensureSequenceNumbers","__PRIVATE_createCollectionParentIndex","__PRIVATE_rewriteCanonicalIds","__PRIVATE_remoteDocumentStore","__PRIVATE_rewriteRemoteDocumentCache","__PRIVATE_runOverlayMigration","__PRIVATE_queuesStore","__PRIVATE_queues","__PRIVATE_documentsStore","__PRIVATE_docSentinelKey","__PRIVATE_maybeSentinel","pathSegments","__PRIVATE_targetStore","__PRIVATE_originalDbTarget","__PRIVATE_originalTargetData","__PRIVATE_updatedDbTarget","__PRIVATE_legacyRemoteDocumentStore","writes","__PRIVATE_legacyDocument","__PRIVATE_dbRemoteDocument","__PRIVATE_memoryPersistence","__PRIVATE_factory","__PRIVATE_userToDocumentSet","__PRIVATE_documentSet","__PRIVATE_allDocumentKeysForUser","__PRIVATE_forUser","__PRIVATE_PRIMARY_LEASE_EXCLUSIVE_ERROR_MSG","__PRIVATE_IndexedDbPersistence","allowTabSynchronization","clientId","__PRIVATE_forceOwningTab","__PRIVATE_schemaVersion","isPrimary","networkEnabled","inForeground","__PRIVATE_lastGarbageCollectionTime","__PRIVATE_primaryStateListener","__PRIVATE_isAvailable","__PRIVATE_dbName","__PRIVATE_simpleDb","__PRIVATE_webStorage","__PRIVATE_updateClientMetadataAndTryBecomePrimary","__PRIVATE_attachVisibilityHandler","__PRIVATE_attachWindowUnloadHook","__PRIVATE_scheduleClientMetadataAndPrimaryLeaseRefreshes","__PRIVATE_setPrimaryStateListener","__PRIVATE_primaryState","databaseDeletedListener","newVersion","enqueueAndForget","__PRIVATE_clientMetadataStore","updateTimeMs","__PRIVATE_verifyPrimaryLease","__PRIVATE_success","__PRIVATE_canActAsPrimary","__PRIVATE_releasePrimaryLeaseIfHeld","__PRIVATE_acquireOrExtendPrimaryLease","__PRIVATE_primaryClientStore","__PRIVATE_primaryClient","__PRIVATE_isLocalClient","__PRIVATE_removeClientMetadata","__PRIVATE_isWithinAge","__PRIVATE_inactiveClients","__PRIVATE_metadataStore","__PRIVATE_existingClients","__PRIVATE_filterActiveClients","__PRIVATE_inactive","__PRIVATE_client","__PRIVATE_inactiveClient","__PRIVATE_zombiedClientLocalStorageKey","__PRIVATE_clientMetadataRefresher","__PRIVATE_maybeGarbageCollectMultiClientState","ownerId","__PRIVATE_currentPrimary","leaseTimestampMs","__PRIVATE_isClientZombied","__PRIVATE_otherClient","__PRIVATE_otherClientHasBetterNetworkState","__PRIVATE_otherClientHasBetterVisibility","__PRIVATE_otherClientHasSameNetworkState","__PRIVATE_markClientZombied","__PRIVATE_detachVisibilityHandler","__PRIVATE_detachWindowUnloadHook","__PRIVATE_simpleDbTxn","__PRIVATE_persistenceTransaction","__PRIVATE_removeClientZombiedEntry","__PRIVATE_clients","__PRIVATE_activityThresholdMs","__PRIVATE_getActiveClients","__PRIVATE_clientMetadata","__PRIVATE_simpleDbMode","__PRIVATE_getObjectStores","__PRIVATE_holdsPrimaryLease","__PRIVATE_verifyAllowTabSynchronization","__PRIVATE_newPrimary","__PRIVATE_maxAgeMs","__PRIVATE_documentVisibilityHandler","visibilityState","__PRIVATE_windowUnloadHandler","__PRIVATE_safariIndexdbBugVersionRegex","isSafari","appVersion","enterRestrictedMode","__PRIVATE_isZombied","qs","__PRIVATE_LocalViewChanges","fromCache","__PRIVATE_addedKeys","__PRIVATE_removedKeys","__PRIVATE_viewSnapshot","docChanges","QueryContext","_documentReadCount","documentReadCount","amount","__PRIVATE_QueryEngine","__PRIVATE_relativeIndexReadCostPerDocument","__PRIVATE_getDefaultRelativeIndexReadCostPerDocument","__PRIVATE_localDocumentsView","__PRIVATE_initialized","__PRIVATE_remoteKeys","__PRIVATE_queryResult","__PRIVATE_performQueryUsingIndex","__PRIVATE_performQueryUsingRemoteKeys","__PRIVATE_executeFullCollectionScan","__PRIVATE_indexAutoCreationEnabled","__PRIVATE_createCacheIndexes","__PRIVATE_resultSize","__PRIVATE_indexAutoCreationMinCollectionSize","__PRIVATE_indexedDocuments","__PRIVATE_previousResults","__PRIVATE_applyQuery","__PRIVATE_needsRefill","__PRIVATE_appendRemainingResults","__PRIVATE_newIndexOffsetSuccessorFromReadTime","__PRIVATE_queryResults","__PRIVATE_maybeDoc","__PRIVATE_sortedPreviousResults","__PRIVATE_limboFreeSnapshotVersion","__PRIVATE_docAtLimitEdge","__PRIVATE_indexedResults","__PRIVATE_remainingResults","__PRIVATE_LocalStoreImpl","__PRIVATE_queryEngine","initialUser","__PRIVATE_collectionGroupReadTime","__PRIVATE_initializeUserComponents","__PRIVATE_targetDataByTarget","__PRIVATE_newLocalStore","__PRIVATE_localStoreHandleUserChange","__PRIVATE_localStoreImpl","__PRIVATE_oldBatches","__PRIVATE_promisedOldBatches","__PRIVATE_newBatches","removedBatchIds","addedBatchIds","__PRIVATE_changedKeys","__PRIVATE_affectedDocuments","__PRIVATE_localStoreGetLastRemoteSnapshotVersion","__PRIVATE_populateDocumentChangeBuffer","__PRIVATE_documentBuffer","__PRIVATE_updatedKeys","__PRIVATE_existenceChangedKeys","__PRIVATE_existingDocs","__PRIVATE_changedDocuments","__PRIVATE_existingDoc","Es","__PRIVATE_afterBatchId","xs","__PRIVATE_cached","__PRIVATE_cachedTargetData","__PRIVATE_targetIdByTarget","__PRIVATE_localStoreReleaseTarget","__PRIVATE_keepPersistedTargetData","__PRIVATE_localStoreExecuteQuery","__PRIVATE_usePreviousResults","__PRIVATE_localStoreGetTargetData","__PRIVATE_setMaxReadTime","Cs","__PRIVATE_targetCacheImpl","__PRIVATE_localStoreGetNewDocumentChanges","__PRIVATE_changedDocs","__PRIVATE_localStoreSaveNamedQuery","__PRIVATE_allocated","__PRIVATE_localStoreAllocateTarget","__PRIVATE_newTargetData","createWebStorageClientStateKey","createWebStorageMutationBatchKey","__PRIVATE_mutationKey","createWebStorageQueryTargetMetadataKey","__PRIVATE_MutationMetadata","__PRIVATE_mutationBatch","__PRIVATE_firestoreError","__PRIVATE_validData","__PRIVATE_toWebStorageJSON","__PRIVATE_batchMetadata","__PRIVATE_QueryTargetMetadata","__PRIVATE_RemoteClientState","__PRIVATE_clientState","__PRIVATE_activeTargetIdsSet","__PRIVATE_SharedOnlineState","onlineState","__PRIVATE_LocalClientState","__PRIVATE_addQueryTarget","__PRIVATE_removeQueryTarget","__PRIVATE_WebStorageSharedClientState","__PRIVATE_localClientId","syncEngine","onlineStateHandler","__PRIVATE_storageListener","__PRIVATE_handleWebStorageEvent","__PRIVATE_escapedPersistenceKey","__PRIVATE_localClientStorageKey","__PRIVATE_sequenceNumberKey","__PRIVATE_activeClients","__PRIVATE_clientStateKeyRe","__PRIVATE_mutationBatchKeyRe","__PRIVATE_queryTargetKeyRe","__PRIVATE_onlineStateKey","__PRIVATE_bundleLoadedKey","__PRIVATE_storageItem","__PRIVATE_fromWebStorageEntry","__PRIVATE_persistClientState","__PRIVATE_onlineStateJSON","__PRIVATE_fromWebStorageOnlineState","__PRIVATE_handleOnlineStateEvent","__PRIVATE_earlyEvents","getAllActiveQueryTargets","__PRIVATE_extractActiveQueryTargets","isActiveQueryTarget","addPendingMutation","__PRIVATE_persistMutationState","updateMutationState","__PRIVATE_removeMutationState","addLocalQueryTarget","__PRIVATE_queryState","__PRIVATE_localClientState","removeLocalQueryTarget","isLocalQueryTarget","clearQueryState","updateQueryState","__PRIVATE_persistQueryTargetState","handleUserChange","setOnlineState","__PRIVATE_persistOnlineState","notifyBundleLoaded","collectionGroups","__PRIVATE_persistBundleLoadedState","__PRIVATE_storageEvent","storageArea","__PRIVATE_fromWebStorageClientStateKey","__PRIVATE_handleClientStateEvent","__PRIVATE_fromWebStorageClientState","__PRIVATE_mutationMetadata","__PRIVATE_fromWebStorageMutationMetadata","__PRIVATE_handleMutationBatchEvent","__PRIVATE_queryTargetMetadata","__PRIVATE_fromWebStorageQueryTargetMetadata","__PRIVATE_handleQueryTargetEvent","__PRIVATE_seqString","__PRIVATE_parsed","__PRIVATE_fromWebStoreBundleLoadedState","__PRIVATE_cg","__PRIVATE_synchronizeWithChangedDocuments","__PRIVATE_mutationState","__PRIVATE_targetKey","__PRIVATE_targetMetadata","__PRIVATE_applyBatchState","__PRIVATE_applyTargetState","__PRIVATE_updatedClients","__PRIVATE_existingTargets","__PRIVATE_newTargets","__PRIVATE_addedTargets","__PRIVATE_removedTargets","__PRIVATE_applyActiveTargetsChange","__PRIVATE_activeTargets","__PRIVATE_kev","__PRIVATE_MemorySharedClientState","__PRIVATE_localState","__PRIVATE_NoopConnectivityMonitor","__PRIVATE_addCallback","__PRIVATE_BrowserConnectivityMonitor","__PRIVATE_onNetworkAvailable","__PRIVATE_onNetworkUnavailable","__PRIVATE_configureNetworkMonitoring","__PRIVATE_callbacks","__PRIVATE_networkAvailableListener","__PRIVATE_networkUnavailableListener","__PRIVATE_lastUniqueDebugId","__PRIVATE_generateUniqueDebugId","round","__PRIVATE_maxResult","__PRIVATE_RPC_NAME_URL_MAPPING","__PRIVATE_StreamBridge","__PRIVATE_sendFn","__PRIVATE_closeFn","__PRIVATE_onConnected","__PRIVATE_wrappedOnConnected","__PRIVATE_onOpen","__PRIVATE_wrappedOnOpen","__PRIVATE_onClose","__PRIVATE_wrappedOnClose","__PRIVATE_wrappedOnMessage","__PRIVATE_callOnConnected","__PRIVATE_callOnOpen","__PRIVATE_callOnClose","__PRIVATE_callOnMessage","__PRIVATE_LOG_TAG","__PRIVATE_WebChannelConnection","__PRIVATE_RestConnection","databaseInfo","__PRIVATE_baseUrl","__PRIVATE_databasePath","__PRIVATE_requestParams","__PRIVATE_shouldResourcePathBeIncludedInRequest","__PRIVATE_invokeRPC","__PRIVATE_rpcName","__PRIVATE_req","__PRIVATE_authToken","streamId","__PRIVATE_makeUrl","__PRIVATE_modifyHeadersForRequest","__PRIVATE_performRPCRequest","__PRIVATE_invokeStreamingRPC","__PRIVATE_expectedResponseCount","__PRIVATE_urlRpcName","terminate","__PRIVATE_xhr","XhrIo","setWithCredentials","listenOnce","EventType","COMPLETE","getLastErrorCode","ErrorCode","NO_ERROR","getResponseJson","HTTP_ERROR","getStatus","getResponseText","__PRIVATE_responseError","__PRIVATE_firestoreErrorCode","__PRIVATE_serverError","__PRIVATE_mapCodeFromHttpResponseErrorStatus","__PRIVATE_requestString","__PRIVATE_openStream","__PRIVATE_urlParts","__PRIVATE_webchannelTransport","createWebChannelTransport","__PRIVATE_requestStats","getStatEventTarget","httpSessionIdParam","initMessageHeaders","messageUrlParams","sendRawJson","supportsCrossDomainXhr","internalChannelParams","forwardChannelRequestTimeoutMs","detectBufferingProxy","__PRIVATE_longPollingTimeoutSeconds","timeoutSeconds","longPollingTimeout","xmlHttpFactory","FetchXmlHttpFactory","encodeInitMessageHeaders","channel","createWebChannel","__PRIVATE_opened","__PRIVATE_streamBridge","__PRIVATE_unguardedEventListen","listen","param","WebChannel","OPEN","CLOSE","MESSAGE","__PRIVATE_msgData","__PRIVATE_msgDataOrError","Event","STAT_EVENT","stat","Stat","PROXY","NOPROXY","__PRIVATE_getWindow","__PRIVATE_newSerializer","__PRIVATE_ExponentialBackoff","__PRIVATE_initialDelayMs","__PRIVATE_backoffFactor","__PRIVATE_maxDelayMs","__PRIVATE_currentBaseMs","__PRIVATE_resetToMax","__PRIVATE_backoffAndRun","__PRIVATE_desiredDelayWithJitterMs","__PRIVATE_jitterDelayMs","__PRIVATE_delaySoFarMs","__PRIVATE_lastAttemptTime","__PRIVATE_remainingDelayMs","__PRIVATE_timerPromise","__PRIVATE_skipBackoff","skipDelay","__PRIVATE_PersistentStream","__PRIVATE_connectionTimerId","__PRIVATE_idleTimerId","__PRIVATE_healthTimerId","connection","authCredentialsProvider","appCheckCredentialsProvider","stream","__PRIVATE_backoff","__PRIVATE_isStarted","__PRIVATE_isOpen","__PRIVATE_performBackoff","__PRIVATE_inhibitBackoff","__PRIVATE_markIdle","__PRIVATE_idleTimer","__PRIVATE_handleIdleCloseTimer","__PRIVATE_sendRequest","__PRIVATE_cancelIdleCheck","__PRIVATE_cancelHealthCheck","__PRIVATE_healthCheck","__PRIVATE_finalState","__PRIVATE_closeCount","__PRIVATE_tearDown","__PRIVATE_dispatchIfNotClosed","__PRIVATE_getCloseGuardedDispatcher","__PRIVATE_startStream","__PRIVATE_rpcError","__PRIVATE_handleStreamClose","__PRIVATE_startRpc","__PRIVATE_startCloseCount","__PRIVATE_PersistentListenStream","authCredentials","appCheckCredentials","__PRIVATE_watchChangeProto","__PRIVATE_change","__PRIVATE_fromWatchTargetChangeState","targetChangeType","Buffer","__PRIVATE_causeProto","__PRIVATE_entityChange","documentDelete","__PRIVATE_docDelete","documentRemove","__PRIVATE_docRemove","snapshot","__PRIVATE_onWatchChange","__PRIVATE_watch","addTarget","__PRIVATE_toBytes","__PRIVATE_toTarget","labels","__PRIVATE_toLabel","__PRIVATE_unwatch","__PRIVATE_PersistentWriteStream","__PRIVATE_handshakeComplete","__PRIVATE_handshakeComplete_","__PRIVATE_writeMutations","__PRIVATE_responseProto","streamToken","commitTime","__PRIVATE_fromWriteResult","writeResults","__PRIVATE_onMutationResult","__PRIVATE_onHandshakeComplete","__PRIVATE_writeHandshake","__PRIVATE_DatastoreImpl","Datastore","__PRIVATE_verifyInitialized","__PRIVATE_terminated","__PRIVATE_OnlineStateTracker","__PRIVATE_handleWatchStreamStart","__PRIVATE_watchStreamFailures","__PRIVATE_setAndBroadcast","__PRIVATE_onlineStateTimer","__PRIVATE_logClientOfflineWarningIfNecessary","__PRIVATE_handleWatchStreamFailure","__PRIVATE_clearOnlineStateTimer","__PRIVATE_newState","__PRIVATE_shouldWarnClientIsOffline","details","__PRIVATE_RemoteStoreImpl","datastore","__PRIVATE_connectivityMonitor","remoteSyncer","__PRIVATE_listenTargets","__PRIVATE_offlineCauses","__PRIVATE_canUseNetwork","remoteStore","__PRIVATE_remoteStoreImpl","__PRIVATE_disableNetworkInternal","__PRIVATE_onlineStateTracker","__PRIVATE_enableNetworkInternal","__PRIVATE_networkStatusHandler","__PRIVATE_onNetworkStatusChange","Oa","__PRIVATE_shouldStartWatchStream","__PRIVATE_startWatchStream","__PRIVATE_ensureWatchStream","__PRIVATE_sendWatchRequest","ma","__PRIVATE_watchStream","__PRIVATE_sendUnwatchRequest","__PRIVATE_watchChangeAggregator","__PRIVATE_cleanUpWatchStreamState","__PRIVATE_onWatchStreamConnected","__PRIVATE_onWatchStreamOpen","__PRIVATE_onWatchStreamClose","__PRIVATE_onWatchStreamChange","rejectListen","__PRIVATE_disableNetworkUntilRecovery","__PRIVATE_targetPurpose","__PRIVATE_requestTargetData","applyRemoteEvent","__PRIVATE_raiseWatchSnapshot","__PRIVATE_executeWithRecovery","__PRIVATE_fillWritePipeline","__PRIVATE_writeStream","__PRIVATE_ensureWriteStream","__PRIVATE_lastBatchIdRetrieved","__PRIVATE_writePipeline","__PRIVATE_canAddToWritePipeline","__PRIVATE_localStoreGetNextMutationBatch","__PRIVATE_addToWritePipeline","__PRIVATE_shouldStartWriteStream","__PRIVATE_startWriteStream","__PRIVATE_onWriteStreamOpen","__PRIVATE_onWriteHandshakeComplete","applySuccessfulWrite","__PRIVATE_onWriteStreamClose","__PRIVATE_isPermanentWriteError","rejectFailedWrite","__PRIVATE_handleWriteError","__PRIVATE_remoteStoreHandleCredentialChange","verifyOperationInProgress","__PRIVATE_usesNetwork","handleCredentialChange","__PRIVATE_remoteStoreApplyPrimaryState","__PRIVATE_datastoreImpl","enabled","DelayedOperation","targetTimeMs","removalCallback","delayMs","__PRIVATE_targetTime","__PRIVATE_delayedOp","timerHandle","handleDelayElapsed","Ha","DocumentSet","keyedMap","sortedSet","oldSet","__PRIVATE_thisDoc","__PRIVATE_otherDoc","__PRIVATE_docStrings","__PRIVATE_DocumentChangeSet","track","__PRIVATE_oldChange","__PRIVATE_changeMap","__PRIVATE_getChanges","ViewSnapshot","oldDocs","mutatedKeys","syncStateChanged","excludesMetadataChanges","hasCachedResults","emptySet","__PRIVATE_queryEquals","__PRIVATE_otherChanges","__PRIVATE_QueryListenersInfo","__PRIVATE_hasRemoteListeners","__PRIVATE_listeners","__PRIVATE_listensToRemoteStore","__PRIVATE_EventManagerImpl","__PRIVATE_snapshotsInSyncListeners","__PRIVATE_eventManagerListen","__PRIVATE_eventManagerImpl","__PRIVATE_listenerAction","__PRIVATE_queryInfo","queries","__PRIVATE_viewSnap","onListen","onFirstRemoteStoreListen","__PRIVATE_wrapInUserErrorIfRecoverable","__PRIVATE_applyOnlineStateChange","__PRIVATE_onViewSnapshot","__PRIVATE_raiseSnapshotsInSyncEvent","__PRIVATE_eventManagerUnlisten","onUnlisten","onLastRemoteStoreUnlisten","ec","__PRIVATE_viewSnaps","__PRIVATE_raisedEvent","__PRIVATE_eventManagerOnWatchError","__PRIVATE_ListenerDataSource","ListenerDataSource","J_","__PRIVATE_QueryListener","__PRIVATE_queryObserver","__PRIVATE_snap","includeMetadataChanges","__PRIVATE_raisedInitialEvent","__PRIVATE_shouldRaiseEvent","__PRIVATE_shouldRaiseInitialEvent","__PRIVATE_raiseInitialEvent","__PRIVATE_maybeOnline","__PRIVATE_waitForSyncWhenOnline","__PRIVATE_hasPendingWritesChanged","fromInitialDocuments","Cache","__PRIVATE_SizedBundleElement","__PRIVATE_payload","byteLength","__PRIVATE_isBundleMetadata","__PRIVATE_BundleConverterImpl","__PRIVATE_toDocumentKey","__PRIVATE_toMutableDocument","__PRIVATE_bundledDoc","__PRIVATE_toSnapshotVersion","time","__PRIVATE_BundleLoader","progress","__PRIVATE_bundleInitialProgress","__PRIVATE_addSizedElement","bytesLoaded","documentsLoaded","documentMetadata","__PRIVATE_getQueryDocumentMapping","__PRIVATE_queryDocumentMap","__PRIVATE_bundleConverter","__PRIVATE_bundleDoc","__PRIVATE_bundleName","__PRIVATE_umbrellaTargetData","__PRIVATE_documentChangeResult","taskState","__PRIVATE_changedCollectionGroups","totalDocuments","totalBytes","__PRIVATE_AddedLimboDocument","__PRIVATE_RemovedLimboDocument","__PRIVATE_View","__PRIVATE__syncedDocuments","__PRIVATE_limboDocuments","__PRIVATE_docComparator","__PRIVATE_syncedDocuments","__PRIVATE_computeDocChanges","__PRIVATE_previousChanges","__PRIVATE_changeSet","__PRIVATE_oldDocumentSet","__PRIVATE_newMutatedKeys","__PRIVATE_newDocumentSet","__PRIVATE_lastDocInLimit","__PRIVATE_firstDocInLimit","__PRIVATE_oldDoc","__PRIVATE_oldDocHadPendingMutations","__PRIVATE_newDocHasPendingMutations","__PRIVATE_changeApplied","__PRIVATE_shouldWaitForSyncedDocument","__PRIVATE_limboResolutionEnabled","__PRIVATE_targetIsPendingReset","__PRIVATE_c1","__PRIVATE_c2","__PRIVATE_applyTargetChange","__PRIVATE_limboChanges","__PRIVATE_updateLimboDocuments","__PRIVATE_newSyncState","__PRIVATE_syncState","__PRIVATE_shouldBeInLimbo","__PRIVATE_oldLimboDocuments","__PRIVATE_synchronizeWithPersistedState","__PRIVATE_computeInitialSnapshot","__PRIVATE_QueryView","view","LimboResolution","__PRIVATE_SyncEngineImpl","sharedClientState","maxConcurrentLimboResolutions","__PRIVATE_queriesByTarget","__PRIVATE_enqueuedLimboResolutions","__PRIVATE_activeLimboResolutionsByTarget","__PRIVATE_limboDocumentRefs","__PRIVATE_pendingWritesCallbacks","__PRIVATE_forSyncEngine","isPrimaryClient","__PRIVATE__isPrimaryClient","__PRIVATE_syncEngineListen","__PRIVATE_shouldListenToRemote","__PRIVATE_syncEngineImpl","__PRIVATE_ensureWatchCallbacks","__PRIVATE_queryView","__PRIVATE_queryViewsByQuery","__PRIVATE_allocateTargetAndMaybeListen","__PRIVATE_triggerRemoteStoreListen","__PRIVATE_shouldInitializeView","__PRIVATE_initializeViewAndComputeSnapshot","__PRIVATE_remoteStoreListen","__PRIVATE_applyDocChanges","__PRIVATE_viewDocChanges","__PRIVATE_viewChange","__PRIVATE_updateTrackedLimbos","__PRIVATE_synthesizedTargetChange","__PRIVATE_syncEngineUnlisten","__PRIVATE_shouldUnlistenToRemote","__PRIVATE_remoteStoreUnlisten","__PRIVATE_removeAndCleanupTarget","__PRIVATE_triggerRemoteStoreUnlisten","__PRIVATE_syncEngineApplyRemoteEvent","__PRIVATE_remoteVersion","__PRIVATE_newTargetDataByTargetMap","__PRIVATE_oldTargetData","__PRIVATE_updateRemoteVersion","__PRIVATE_limboResolution","__PRIVATE_receivedDocument","__PRIVATE_syncEngineEmitNewSnapsAndNotifyLocalStore","__PRIVATE_syncEngineApplyOnlineStateChange","__PRIVATE_newViewSnapshots","__PRIVATE_eventManagerOnOnlineStateChange","__PRIVATE_syncEngineListener","__PRIVATE_syncEngineRejectListen","__PRIVATE_limboKey","__PRIVATE_activeLimboTargetsByKey","__PRIVATE_pumpEnqueuedLimboResolutions","__PRIVATE_syncEngineApplySuccessfulWrite","__PRIVATE_mutationBatchResult","__PRIVATE_affected","__PRIVATE_docKeys","__PRIVATE_promiseChain","__PRIVATE_ackVersion","__PRIVATE_processUserCallback","__PRIVATE_triggerPendingWritesCallbacks","__PRIVATE_syncEngineRejectFailedWrite","__PRIVATE_affectedKeys","__PRIVATE_newCallbacks","__PRIVATE_mutationUserCallbacks","__PRIVATE_onWatchError","__PRIVATE_removeLimboTarget","__PRIVATE_limboTargetId","__PRIVATE_limboChange","__PRIVATE_trackLimboChange","__PRIVATE_keyString","__PRIVATE_limboTargetIdGenerator","__PRIVATE_newSnaps","__PRIVATE_docChangesInAllViews","__PRIVATE_queriesProcessed","__PRIVATE_fromSnapshot","__PRIVATE_viewChanges","__PRIVATE_updatedTargetData","__PRIVATE_localStoreNotifyLocalViewChanges","__PRIVATE_syncEngineHandleCredentialChange","__PRIVATE_errorMessage","__PRIVATE_rejectOutstandingPendingWritesCallbacks","Ic","__PRIVATE_keySet","__PRIVATE_synchronizeViewAndComputeSnapshot","__PRIVATE_syncEngineSynchronizeWithChangedDocuments","__PRIVATE_syncEngineApplyBatchState","__PRIVATE_batchState","__PRIVATE_mutationQueueImpl","__PRIVATE_synchronizeQueryViewsAndRaiseSnapshots","__PRIVATE_transitionToPrimary","__PRIVATE_activeQueries","__PRIVATE_localStoreGetCachedTarget","__PRIVATE_synthesizeTargetToQuery","__PRIVATE_syncEngineGetActiveClients","__PRIVATE_localStoreGetActiveClients","__PRIVATE_syncEngineApplyTargetState","__PRIVATE_synthesizedRemoteEvent","createSynthesizedRemoteEventForCurrentChange","__PRIVATE_syncEngineApplyActiveTargetsChange","__PRIVATE_syncEngineGetRemoteKeysForTarget","__PRIVATE_eventManagerOnWatchChange","__PRIVATE_syncEngineEnsureWriteCallbacks","MemoryOfflineComponentProvider","synchronizeTabs","cfg","createSharedClientState","createPersistence","createLocalStore","gcScheduler","createGarbageCollectionScheduler","indexBackfillerScheduler","createIndexBackfillerScheduler","__PRIVATE_LruGcMemoryOfflineComponentProvider","cacheSizeBytes","withCacheSize","DEFAULT","__PRIVATE_IndexedDbOfflineComponentProvider","__PRIVATE_onlineComponentProvider","forceOwnership","__PRIVATE_indexBackfiller","__PRIVATE_indexedDbStoragePrefix","__PRIVATE_MultiTabOfflineComponentProvider","__PRIVATE_syncEngineApplyPrimaryState","OnlineComponentProvider","offlineComponentProvider","createDatastore","createRemoteStore","createEventManager","createSyncEngine","__PRIVATE_newEventManager","__PRIVATE_newDatastore","__PRIVATE_newConnectivityMonitor","startAsPrimary","__PRIVATE_newSyncEngine","__PRIVATE_toByteStreamReaderHelper","__PRIVATE_bytesPerRead","__PRIVATE_readFrom","releaseLock","__PRIVATE_AsyncObserver","muted","__PRIVATE_scheduleEvent","__PRIVATE_mute","__PRIVATE_eventHandler","__PRIVATE_BundleReaderImpl","__PRIVATE_reader","__PRIVATE_textDecoder","TextDecoder","__PRIVATE_nextElementImpl","__PRIVATE_lengthBuffer","__PRIVATE_readLength","__PRIVATE_lengthString","decode","__PRIVATE_raiseError","__PRIVATE_jsonString","__PRIVATE_readJsonString","__PRIVATE_indexOfOpenBracket","findIndex","__PRIVATE_pullMoreDataToBuffer","Transaction","committed","lastTransactionError","ensureCommitNotCalled","__PRIVATE_fromFound","missing","__PRIVATE_fromMissing","__PRIVATE_invokeBatchGetDocumentsRpc","recordVersion","writtenDocs","preconditionForUpdate","__PRIVATE_unwritten","readVersions","__PRIVATE_invokeCommitRpc","__PRIVATE_docVersion","__PRIVATE_existingVersion","__PRIVATE_TransactionRunner","updateFunction","__PRIVATE_attemptsRemaining","maxAttempts","__PRIVATE_run","__PRIVATE_runWithBackOff","__PRIVATE_tryRunUpdateFunction","__PRIVATE_commitError","__PRIVATE_handleTransactionError","__PRIVATE_userPromiseError","__PRIVATE_isRetryableTransactionError","FirestoreClient","newId","authCredentialListener","appCheckCredentialListener","__PRIVATE_newAppCheckToken","configuration","setCredentialChangeListener","setAppCheckTokenChangeListener","verifyNotTerminated","isShuttingDown","enqueueAndForgetEvenWhileRestricted","_onlineComponents","_offlineComponents","__PRIVATE_setOfflineComponentProvider","__PRIVATE_setOnlineComponentProvider","__PRIVATE_ensureOfflineComponents","__PRIVATE_canFallbackFromIndexedDbError","_uninitializedComponentsProvider","_offline","__PRIVATE_ensureOnlineComponents","_online","__PRIVATE_getPersistence","__PRIVATE_getLocalStore","__PRIVATE_getRemoteStore","__PRIVATE_getSyncEngine","__PRIVATE_getDatastore","__PRIVATE_getEventManager","__PRIVATE_firestoreClientGetDocumentViaSnapshotListener","__PRIVATE_wrappedObserver","__PRIVATE_readDocumentViaSnapshotListener","__PRIVATE_firestoreClientGetDocumentsViaSnapshotListener","__PRIVATE_executeQueryViaSnapshotListener","__PRIVATE_cloneLongPollingOptions","__PRIVATE_datastoreInstances","__PRIVATE_validateNonEmptyArgument","__PRIVATE_functionName","__PRIVATE_argumentName","__PRIVATE_argument","__PRIVATE_validateIsNotUsedTogether","optionName1","argument1","optionName2","argument2","__PRIVATE_validateDocumentPath","__PRIVATE_validateCollectionPath","__PRIVATE_valueDescription","__PRIVATE_customObjectName","__PRIVATE_cast","_delegate","description","qp","FirestoreSettingsImpl","credentials","ignoreUndefinedProperties","experimentalForceLongPolling","experimentalAutoDetectLongPolling","experimentalLongPollingOptions","__PRIVATE_options1","__PRIVATE_options2","Firestore","_authCredentials","_appCheckCredentials","_databaseId","_app","_persistenceKey","_settingsFrozen","_initialized","_terminated","_terminateTask","_setSettings","_settings","sessionIndex","iamToken","authTokenFactory","client","__PRIVATE_makeAuthCredentialsProvider","_getSettings","_freezeSettings","_terminate","firestore","__PRIVATE_removeComponents","connectFirestoreEmulator","__PRIVATE_newHostSetting","mockUserToken","MOCK_USER","createMockUserToken","user_id","Query","converter","_query","withConverter","DocumentReference","_path","CollectionReference","__PRIVATE_absolutePath","queryEqual","__PRIVATE_AsyncQueueImpl","__PRIVATE_visibilityHandler","__PRIVATE__isShuttingDown","enqueue","__PRIVATE_verifyNotFailed","__PRIVATE_enqueueInternal","purgeExistingTasks","__PRIVATE_skipNonRestrictedTasks","__PRIVATE_retryableOps","__PRIVATE_retryNextOp","__PRIVATE_newTail","__PRIVATE_tail","__PRIVATE_operationInProgress","stack","__PRIVATE_timerIdsToSkip","createAndSchedule","__PRIVATE_removedOp","__PRIVATE_removeDelayedOperation","__PRIVATE_delayedOperations","__PRIVATE_currentTail","__PRIVATE_containsDelayedOperation","__PRIVATE_runAllDelayedOperationsUntil","__PRIVATE_lastTimerId","__PRIVATE_drain","__PRIVATE_skipDelaysForTimerId","__PRIVATE_isPartialObserver","__PRIVATE_methods","LoadBundleTask","_progressObserver","onProgress","complete","onRejected","_taskCompletionResolver","onFulfilled","_completeWith","_updateProgress","_failWith","_lastProgress","__PRIVATE_LiteFirestore","_queue","_firestoreClient","__PRIVATE_configureFirestore","ensureFirestoreConfigured","_offlineComponentProvider","_onlineComponentProvider","_offlineKind","__PRIVATE_setPersistenceProviders","__PRIVATE_persistenceResult","__PRIVATE_verifyNotInitialized","AggregateField","_internalFieldPath","AggregateQuerySnapshot","_userDataWriter","convertObjectMap","_byteString","fieldNames","_internalPath","__PRIVATE_InternalFieldPath","FieldValue","_methodName","GeoPoint","isFinite","_lat","_long","__PRIVATE_RESERVED_FIELD_REGEX","ParsedSetData","ParsedUpdateData","__PRIVATE_isWrite","__PRIVATE_dataSource","__PRIVATE_ParseContextImpl","__PRIVATE_validatePath","__PRIVATE_contextWith","__PRIVATE_childContextForField","__PRIVATE_childPath","__PRIVATE_validatePathSegment","__PRIVATE_childContextForFieldPath","__PRIVATE_childContextForArray","__PRIVATE_createError","methodName","__PRIVATE_hasConverter","__PRIVATE_targetDoc","__PRIVATE_UserDataReader","__PRIVATE_createContext","__PRIVATE_newUserDataReader","tu","__PRIVATE_userDataReader","merge","mergeFields","__PRIVATE_validatePlainObject","__PRIVATE_updateData","__PRIVATE_parseObject","__PRIVATE_validatedFieldPaths","__PRIVATE_stringOrFieldPath","__PRIVATE_fieldPathFromArgument","__PRIVATE_fieldMaskContains","__PRIVATE_DeleteFieldValueImpl","_toFieldTransform","__PRIVATE_createSentinelChildContext","__PRIVATE_fieldValue","__PRIVATE_ServerTimestampFieldValueImpl","__PRIVATE_ArrayUnionFieldValueImpl","__PRIVATE__elements","__PRIVATE_parseContext","__PRIVATE_parsedElements","__PRIVATE_parseData","arrayUnion","__PRIVATE_ArrayRemoveFieldValueImpl","__PRIVATE_NumericIncrementFieldValueImpl","__PRIVATE__operand","__PRIVATE_numericIncrement","__PRIVATE_parseUpdateData","__PRIVATE_fieldMaskPaths","__PRIVATE_fieldPathFromDotSeparatedString","__PRIVATE_childContext","__PRIVATE_parsedValue","pu","moreFieldsAndValues","__PRIVATE_parseQueryValue","__PRIVATE_allowArrays","du","__PRIVATE_looksLikeJsonObject","__PRIVATE_entryIndex","__PRIVATE_parsedEntry","__PRIVATE_parseArray","fromDate","__PRIVATE_thisDb","__PRIVATE_otherDb","getPrototypeOf","__PRIVATE_isPlainObject","__PRIVATE_FIELD_PATH_RESERVED","search","__PRIVATE_hasPath","__PRIVATE_hasDocument","DocumentSnapshot","_firestore","_document","_converter","QueryDocumentSnapshot","fromFirestore","convertValue","_u","arg","__PRIVATE_validateHasExplicitOrderByForLimitToLast","AppliableConstraint","QueryConstraint","QueryFieldFilterConstraint","_field","_op","_value","_apply","_parse","__PRIVATE_validateNewFieldFilter","__PRIVATE_queryWithAddedFilter","__PRIVATE_dataReader","__PRIVATE_validateDisjunctiveFilterElements","__PRIVATE_referenceList","__PRIVATE_parseDocumentIdValue","QueryCompositeFilterConstraint","_queryConstraints","__PRIVATE_parsedFilters","__PRIVATE_queryConstraint","__PRIVATE_parsedFilter","_getOperator","__PRIVATE_testQuery","__PRIVATE_subFilters","_getQueryConstraints","QueryOrderByConstraint","_direction","__PRIVATE_newOrderBy","__PRIVATE_queryWithAddedOrderBy","QueryLimitConstraint","_limit","_limitType","QueryStartAtConstraint","_docOrFields","_inclusive","__PRIVATE_newQueryBoundFromDocOrFields","__PRIVATE_queryWithStartAt","QueryEndAtConstraint","__PRIVATE_queryWithEndAt","__PRIVATE_docOrFields","components","__PRIVATE_rawValue","__PRIVATE_wrapped","__PRIVATE_documentIdValue","operator","__PRIVATE_conflictingOp","__PRIVATE_operators","__PRIVATE_conflictingOps","Iu","AbstractUserDataWriter","serverTimestampBehavior","convertTimestamp","convertServerTimestamp","convertBytes","convertReference","convertGeoPoint","convertArray","convertObject","__PRIVATE_normalizedValue","convertDocumentKey","expectedDatabaseId","__PRIVATE_applyFirestoreDataConverter","__PRIVATE_convertedValue","toFirestore","__PRIVATE_LiteUserDataWriter","SnapshotMetadata","__PRIVATE_LiteDocumentSnapshot","userDataWriter","_firestoreImpl","serverTimestamps","QuerySnapshot","_snapshot","thisArg","_cachedChanges","_cachedChangesIncludeMetadataChanges","__PRIVATE_querySnapshot","oldIndex","newIndex","__PRIVATE_indexTracker","__PRIVATE_resultChangeType","__PRIVATE_changesFromSnapshot","__PRIVATE_ExpUserDataWriter","executeWrite","__PRIVATE_syncEngineWrite","__PRIVATE_userCallback","__PRIVATE_overlayedDocuments","__PRIVATE_remoteDocs","__PRIVATE_docsWithoutRemoteVersion","__PRIVATE_mutationExtractBaseValue","__PRIVATE_localStoreWriteLocally","__PRIVATE_firestoreClientWrite","__PRIVATE_convertToDocSnapshot","getAggregateFromServer","aggregateSpec","__PRIVATE_internalAggregates","__PRIVATE_aggregate","__PRIVATE_firestoreClientRunAggregateQuery","__PRIVATE_aggregates","__PRIVATE_invokeRunAggregationQueryRpc","f_","__PRIVATE_aliasMap","aggregations","__PRIVATE_aggregationNum","__PRIVATE_serverAlias","avg","structuredAggregationQuery","__PRIVATE_memoizedAggregateTarget","__PRIVATE_queryToAggregateTarget","__PRIVATE_filteredResult","__PRIVATE_unmappedAggregateFields","aggregateFields","__PRIVATE_accumulator","__PRIVATE_aggregateResult","__PRIVATE_MemoryLocalCacheImpl","__PRIVATE_PersistentLocalCacheImpl","tabManager","persistentSingleTabManager","__PRIVATE_MemoryEagerGabageCollectorImpl","__PRIVATE_MemoryLruGabageCollectorImpl","__PRIVATE_SingleTabManagerImpl","__PRIVATE_MultiTabManagerImpl","__PRIVATE_DEFAULT_TRANSACTION_OPTIONS","WriteBatch","_commitHandler","_mutations","_committed","_dataReader","documentRef","_verifyNotCommitted","__PRIVATE_validateReference","__PRIVATE_parseSetData","__PRIVATE_fieldOrUpdateData","__PRIVATE_parseUpdateVarargs","_transaction","lookup","__PRIVATE_liteDocumentSnapshot","__PRIVATE_tryGetString","property","PersistentCacheIndexManager","_client","__PRIVATE_setPersistentCacheIndexAutoCreationEnabled","isEnabled","__PRIVATE_localStoreSetIndexAutoCreationEnabled","__PRIVATE_persistentCacheIndexManagerByFirestore","__PRIVATE_TestingHooksSpiImpl","__PRIVATE_existenceFilterMismatchCallbacksById","__PRIVATE_testingHooksSpiImplInstance","__PRIVATE_setTestingHooksSpi","onExistenceFilterMismatch","__PRIVATE_registerFirestore","__PRIVATE_firestoreInstance","__PRIVATE_databaseIdFromApp","__PRIVATE_EmptyAppCheckTokenProvider","TestingHooks","__PRIVATE_isBase64Available","reference","__PRIVATE_docRef","queryConstraints","__PRIVATE_validateQueryFilterConstraint","__PRIVATE_indexedDbClearPersistence","deleteField","persistenceSettings","__PRIVATE_localStoreReadDocument","__PRIVATE_appOrDatabaseId","__PRIVATE_optionalDatabaseId","__PRIVATE_emulator","getDefaultEmulatorHostnameAndPort","__PRIVATE_cachedInstance","initializeFirestore","__PRIVATE_existingInstance","__PRIVATE_initialSettings","__PRIVATE_validatePositiveNumber","bundleData","__PRIVATE_resultTask","__PRIVATE_firestoreClientLoadBundle","content","ReadableStream","getReader","__PRIVATE_toByteStreamReader","__PRIVATE_createBundleReader","__PRIVATE_syncEngineLoadBundle","__PRIVATE_bundleReader","__PRIVATE_currentReadTime","__PRIVATE_loader","__PRIVATE_nextElement","memoryEagerGarbageCollector","__PRIVATE_localStoreGetNamedQuery","onSnapshot","__PRIVATE_currArg","__PRIVATE_internalOptions","__PRIVATE_userObserver","__PRIVATE_internalQuery","__PRIVATE_removeSnapshotsInSyncListener","persistentMultipleTabManager","__PRIVATE_additionalQueryConstraints","__PRIVATE_compositeFilterCount","__PRIVATE_fieldFilterCount","constraint","__PRIVATE_optionsWithDefaults","__PRIVATE_firestoreClientTransaction","__PRIVATE_internalTransaction","setDoc","__PRIVATE_jsonOrConfiguration","__PRIVATE_parsedIndexes","__PRIVATE_indexConfiguration","arrayConfig","__PRIVATE_newFieldIndexes","__PRIVATE_oldFieldIndexes","__PRIVATE_bLen","__PRIVATE_aLen","__PRIVATE_fieldIndexSemanticComparator","__PRIVATE_localStoreConfigureFieldIndexes","__PRIVATE_highestBatchId","__PRIVATE_localStoreGetHighestUnacknowledgedBatchId","opStr","levelStringToEnum","verbose","VERBOSE","INFO","silent","SILENT","defaultLogLevel","ConsoleMethod","defaultLogHandler","logType","_i","_logLevel","_logHandler","_userLogHandler","TypeError","level","inst","customLogLevel","userLogHandler","ignored","instances_1","NODE_CLIENT","NODE_ADMIN","assert","assertionError","CONSTANTS","stringToByteArray","out","byteToCharMap_","charToByteMap_","byteToCharMapWebSafe_","charToByteMapWebSafe_","ENCODED_VALS_BASE","ENCODED_VALS","ENCODED_VALS_WEBSAFE","HAS_NATIVE_SUPPORT","encodeByteArray","webSafe","init_","byteToCharMap","output","byte1","haveByte2","byte2","haveByte3","byte3","outByte1","outByte2","outByte3","outByte4","encodeString","decodeString","pos","c1","c2","c3","decodeStringToByteArray","charToByteMap","byte4","DecodeBase64StringError","base64Encode","utf8Bytes","deepExtend","prop","getGlobal","global","getDefaults","__FIREBASE_DEFAULTS__","env","defaultsJsonString","cookie","productName","emulatorHosts","wrapCallback","isNode","forceEnvironment","captureStackTrace","serviceName","errors","fullCode","template","PATTERN","fullMessage","jsonEval","header","parts","isObject","thing","ObserverProxy","executor","onNoObservers","observers","unsubscribes","observerCount","finalized","forEachObserver","subscribe","methods","noop","unsub","unsubscribeOne","finalError","sendOne","errorPrefix","fnName","argName","MAX_VALUE_MILLIS","M","RANDOM_FACTOR","Sha1","chain_","buf_","W_","pad_","inbuf_","total_","blockSize","compress_","buf","lengthMinusBlock","inbuf","totalBits","j","areCookiesEnabled","cookieEnabled","calculateBackoffMillis","backoffCount","backoffFactor","currBaseValue","randomWait","project","iss","aud","identities","alg","proxy","deepCopy","aKeys","bKeys","aProp","bProp","queryStart","fragmentStart","separatorIndex","lastIndexOf","parseInt","isAdmin","admin","runtime","chrome","browser","isElectron","cordova","phonegap","PhoneGap","isNodeSdk","product","isUWP","isValidFormat","isValidTimestamp","validSince","validUntil","nbf","contextObj","res","ordinal","cent","abs","dec","promiseWithTimeout","timeInMS","deferredPromise","querystringParams","arrayVal","decodeURIComponent","safeGet","stringLength","high","uuidv4","validateArgCount","minCount","maxCount","argCount","argError","validateCallback","argumentName","validateContextObject","preExist","DB_CHECK_NAME","validateNamespace","namespace","$jscomp.arrayIteratorImpl","$jscomp.defineProperty","defineProperties","$jscomp.global","writable","ea","ia","__proto__","fa","$jscomp.polyfill","$jscomp.iteratorPrototype","B","D","G","CustomEvent","cancelable","initCustomEvent","la","E","S","$jscomp.makeIterator","$jscomp.iteratorFromArray","$jscomp.owns","isExtensible","seal","V","head","list","K","goog","goog.global","goog.isArrayLike","goog.isObject","goog.getUid","goog.UID_PROPERTY_","goog.uidCounter_","goog.bindNative_","selfObj","var_args","goog.bindJs_","boundArgs","newArgs","unshift","goog.bind","goog.partial","goog.inherits","childCtor","parentCtor","tempCtor","superClass_","childCtor.base","me","goog.Disposable","goog.Disposable.MONITORING_MODE","goog.Disposable.MonitoringMode.OFF","goog.Disposable.instances_","disposed_","onDisposeCallbacks_","OFF","dispose","goog.Disposable.prototype.dispose","disposeInternal","goog.Disposable.prototype.disposeInternal","arr","fromIndex","rv","extend","arr1","arr2","len1","len2","goog.events.Event","opt_target","currentTarget","defaultPrevented","preventDefault","goog.events.Event.prototype.preventDefault","PASSIVE_EVENTS","goog.globaladdEventListener","passive","nullFunction","goog.globalremoveEventListener","goog.string.internal.isEmptyOrWhitespace","getNativeUserAgentString","goog.globalnavigator","matchUserAgent","goog.reflect.sinkValue","goog.userAgent.IE","goog.userAgent.EDGE","goog.userAgent.EDGE_OR_IE","goog.userAgent.GECKO","subString","goog.userAgent.WEBKIT","goog.userAgent.getDocumentMode_","goog.userAgent.OPERA","docMode","parseFloat","Ma","goog.userAgent.VERSION","Qa","goog.events.BrowserEvent","opt_e","opt_currentTarget","goog.events.Eventcall","relatedTarget","button","screenY","screenX","clientY","clientX","metaKey","shiftKey","altKey","ctrlKey","pointerId","pointerType","event_","relevantTouch","changedTouches","srcElement","nodeName","MOUSEOVER","fromElement","MOUSEOUT","toElement","pageX","pageY","goog.events.BrowserEvent.IE_POINTER_TYPE_MAP","goog.events.BrowserEventsuperClass_preventDefaultcall","ee","TOUCH","PEN","MOUSE","goog.events.BrowserEvent.prototype.preventDefault","returnValue","ne","goog.events.Listener","src","capture","opt_handler","goog.events.ListenableKey.counter_","removed","callOnce","goog.events.Listener.prototype.markAsRemoved","opt_obj","PROTOTYPE_FIELDS","goog.events.ListenerMap","typeCount_","goog.events.ListenerMap.prototype.removeByKey","markAsRemoved","goog.events.ListenerMap.findListenerIndex_","listenerArray","opt_useCapture","opt_listenerScope","listenerObj","goog.events.ListenerMap.prototype.add","typeStr","le","goog.events.onStringMap_","goog.events.listen","opt_options","once","goog.events.listenOnce","goog.events.wrapListener","goog.events.Listenable.IMPLEMENTED_BY_PROP","goog.events.listen_","listenerMap","goog.events.getListenerMap_","goog.events.LISTENER_MAP_PROP_","goog.events.getProxy","proxyCallbackFunction","goog.events.handleBrowserEvent_","eventObject","goog.events.BrowserFeature.PASSIVE_EVENTS","attachEvent","goog.events.getOnString_","addListener","removeListener","goog.events.unlisten","eventTargetListeners_","goog.events.unlistenByKey","removeByKey","detachEvent","goog.events.onString_","opt_evt","listenerFn","listenerHandler","goog.events.LISTENER_WRAPPER_PROP_","goog.events.EventTarget","goog.Disposablecall","actualEventTarget_","parentEventTarget_","goog.events.EventTarget.prototype.dispatchEvent","ancestorsTree","ancestor","getParentEventTarget","oldEvent","opt_ancestorsTree","fireListeners","goog.events.EventTarget.prototype.fireListeners","unlistenByKey","goog.events.EventTarget.prototype.removeEventListener","opt_capture","opt_handlerScope","goog.events.EventTarget.prototype.disposeInternal","goog.events.EventTargetsuperClass_disposeInternalcall","removeAllListeners","goog.events.EventTarget.prototype.listen","goog.events.EventTarget.prototype.listenOnce","we","FreeList","create_","reset_","occupants_","head_","WorkQueue","workTail_","workHead_","workQueue","wb","xb","module$contents$goog$async$WorkQueue_WorkQueue.freelist_get","WorkItem","goog.string.splitLimit","separator","returnVal","throwException","exception","goog.globalsetTimeout","Bb","Te","workQueueScheduled","run","initializeRunner","goog.globalPromiseresolve","module$contents$goog$async$run_run.processWorkQueue","Ie","run.processWorkQueue","module$contents$goog$async$WorkQueue_WorkQueue.freelist_put","module$contents$goog$async$WorkQueue_WorkQueue.DEFAULT_MAX_UNUSED","goog.Timer","opt_interval","opt_timerObject","goog.events.EventTargetcall","interval_","timerObject_","boundTick_","tick_","last_","goog.Timer.prototype.stop","timer_","goog.Timer.callOnce","opt_delay","goog.Timer.MAX_TIMEOUT_","Throttle","listener_","args_","shouldFire_","Pe","JSC$2231_enabled","goog.Timer.prototype","JSC$2231_timer_","goog.Timer.prototype.tick_","elapsed","goog.Timer.intervalScale","dispatchTick","goog.Timer.TICK","goog.Timer.prototype.start","goog.Timer.prototype.disposeInternal","goog.TimersuperClass_disposeInternalcall","$jscomp.objectCreate","$jscomp.setPrototypeOf","Mb","Nb","getOwnPropertyDescriptor","doAction_","onTimer_","goog.events.EventHandler","opt_scope","handler_","keys_","goog.globalclearTimeout","Ge","goog.events.EventHandler.prototype.listen_","opt_fn","goog.events.EventHandler.typeArray_","goog.events.EventHandler.prototype.removeAll","goog.labs.net.webChannel.WebChannelDebug","redactEnabled_","WebChannelDebug.prototype.xmlHttpChannelResponseText","responseText","opt_desc","WebChannelDebug.prototype.redactResponse_","responseArray","dataPart","goog.json.serialize","goog.events.EventHandler.prototype.disposeInternal","goog.events.EventHandlersuperClass_disposeInternalcall","removeAll","goog.events.EventHandler.prototype.handleEvent","disableRedact","WebChannelDebug.prototype.disableRedact","WebChannelDebug.prototype.info","goog.labs.net.webChannel.requestStats.eventTarget_","requestStats.getStatEventTarget_","requestStats.ServerReachabilityEvent","goog.labs.net.webChannel.requestStats.EventSERVER_REACHABILITY_EVENT","SERVER_REACHABILITY_EVENT","requestStats.notifyServerReachabilityEvent","reachabilityType","goog.labs.net.webChannel.requestStats.getStatEventTarget_","goog.labs.net.webChannel.requestStats.ServerReachabilityEvent","requestStats.StatEvent","goog.labs.net.webChannel.requestStats.EventSTAT_EVENT","requestStats.notifyStatEvent","goog.labs.net.webChannel.requestStats.StatEvent","requestStats.TimingEvent","goog.labs.net.webChannel.requestStats.EventTIMING_EVENT","TIMING_EVENT","requestStats.setTimeout","ms","goog.labs.net.webChannel.requestStats.TimingEvent","ct","ACCESS_DENIED","FILE_NOT_FOUND","FF_SILENT_ERROR","CUSTOM_ERROR","EXCEPTION","ABORT","OFFLINE","pt","SUCCESS","READY","READY_STATE_CHANGE","INCREMENTAL_DATA","PROGRESS","DOWNLOAD_PROGRESS","UPLOAD_PROGRESS","goog.net.XmlHttpFactory","goog.net.XmlHttpFactory.prototype.getOptions","cachedOptions_","internalGetOptions","goog.net.WebChannel","goog.net.WebChannel.MessageEvent","goog.net.WebChannel.ErrorEvent","goog.net.DefaultXmlHttpFactory","goog.labs.net.webChannel.ChannelRequest","channelDebug","opt_requestId","opt_retryId","channel_","channelDebug_","rid_","retryId_","eventHandler_","timeout_","goog.labs.net.webChannel.ChannelRequest.TIMEOUT_MS_","EDGE_POLLING_INTERVAL_","pollingTimer_","extraHeaders_","successful_","postData_","requestUri_","baseUri_","type_","requestStartTime_","watchDogTimeoutTime_","watchDogTimerId_","pendingMessages_","xmlHttp_","xmlHttpChunkStart_","lastError_","verb_","lastStatusCode_","cancelled_","readyStateChangeThrottleMs_","readyStateChangeThrottle_","firstByteReceived_","initialResponseDecoded_","decodeInitialResponse_","decodeChunks_","fetchResponseState_","goog.labs.net.webChannel.FetchResponseState","textDecoder","responseBuffer","responseArrivedForFetch","createInstance","goog.net.DefaultXmlHttpFactory.prototype.createInstance","XMLHttpRequest","goog.net.DefaultXmlHttpFactory.prototype.internalGetOptions","goog.net.XmlHttp.factory_","factory","goog.labs.net.webChannel.ChannelRequest.INVALID_CHUNK_","goog.labs.net.webChannel.ChannelRequest.INCOMPLETE_CHUNK_","ChannelRequest.prototype.xmlHttpPost","uri","postData","XML_HTTP","makeUnique","sendXmlHttp_","ChannelRequest.prototype.sendXmlHttp_","hostPrefix","ensureWatchDogTimer_","setValues","queryData_","useSecondaryDomains","supportsCrossDomainXhrs_","createXhrIo","xmlHttpHandler_","listen_","readyStateChangeHandler_","goog.labs.net.webChannel.requestStats.notifyServerReachabilityEvent","REQUEST_MADE","WebChannelDebug.prototype.xmlHttpChannelRequest","verb","attempt","keyValue","keyParts","ChannelRequest.prototype.useFetchStreamsForResponse_","CLOSE_REQUEST","usesFetchStreams_","ChannelRequest.prototype.decodeNextChunks_","chunkText","decodeNextChunksSuccessful","getNextChunk_","BAD_DATA","goog.labs.net.webChannel.requestStats.notifyStatEvent","REQUEST_INCOMPLETE_DATA","xmlHttpChannelResponseText","REQUEST_BAD_DATA","safeOnRequestData_","useFetchStreamsForResponse_","NO_DATA","REQUEST_NO_DATA","backChannelRequest_","detectBufferingProxy_","bpDetectionDone_","clearBpDetectionTimer_","cleanup_","dispatchFailure_","ChannelRequest.prototype.getNextChunk_","sizeStartIndex","sizeEndIndex","chunkStartIndex","ChannelRequest.prototype.ensureWatchDogTimer_","startWatchDogTimer_","ChannelRequest.prototype.startWatchDogTimer_","goog.labs.net.webChannel.requestStats.setTimeout","onWatchDogTimeout_","ChannelRequest.prototype.cancelWatchDogTimer_","ChannelRequest.prototype.dispatchFailure_","CLOSED","state_","onRequestComplete","ChannelRequest.prototype.cleanup_","cancelWatchDogTimer_","xmlhttp","ChannelRequest.prototype.safeOnRequestData_","hasRequest","forwardChannelRequestPool_","OPENED","wireCodec_","parser_","ex","responseValues","handlePostResponse_","backChannelTimerId_","goog.labs.net.webChannel.WebChannelBase.RTT_ESTIMATE","clearDeadBackchannelTimer_","cancelBackChannelRequest_","maybeRetryBackChannel_","BACKCHANNEL_MISSING","lastPostResponseArrayId_","lastArrayId_","goog.labs.net.webChannel.WebChannelBase.OUTSTANDING_DATA_BACKCHANNEL_RETRY_CUTOFF","enableStreaming_","backChannelRetryCount_","deadBackChannelTimerId_","onBackChannelDead_","getRequestCount","onForwardChannelFlushed_","forwardChannelFlushedCallback_","signalError_","BAD_RESPONSE","nextArray","onInput_","OPENING","sid_","hostPrefix_","negotiatedVersion","channelVersion_","negotiatedServerVersion","serverVersion_","serverKeepaliveMs","backChannelRequestTimeoutMs_","applyControlHeaders_","xhr","clientProtocol","xhr_","getResponseHeader","goog.net.WebChannel.X_CLIENT_WIRE_PROTOCOL","requestPool_","maxSize_","maxPoolSizeConfigured_","request_","addRequest","getHttpSessionIdParam","httpSessionIdParam_","httpSessionIdHeader","goog.net.WebChannel.X_HTTP_SESSION_ID","setHttpSessionId","httpSessionId_","setParameterValue","forwardChannelUri_","channelOpened","handshakeRttMs_","startBackchannelAfterHandshake_","backChannelUri_","createDataUri","getBackChannelUri","path_","removeRequest","opt_timeout","ensureBackChannel_","outgoingMaps_","ensureForwardChannel_","STOP","disconnect","channelHandleArray","BACK_CHANNEL_ACTIVITY","goog.structs.forEach","col","goog.structs.getKeys","getKeys","getValues","goog.structs.getValues","Ot","ChannelRequest.prototype.setTimeout","goog.labs.net.webChannel.ChannelRequest.prototype","ChannelRequest.prototype.readyStateChangeHandler_","evt","throttle","INTERACTIVE","getReadyState","fire","ChannelRequest.prototype.xmlHttpHandler_","onXmlHttpReadyStateChanged_","errorCode","statusCode","REQUEST_FAILED","REQUEST_SUCCEEDED","responseChunks","responseLength","requestCompleted","goog.globalTextDecoder","WebChannelDebug.prototype.xmlHttpChannelResponseMetaData","goog.net.WebChannel.X_HTTP_INITIAL_RESPONSE","initialResponse","UNKNOWN_SESSION_ID","REQUEST_UNKNOWN_SESSION_ID","decodeNextChunks_","pollResponse_","goog.net.XhrIo.prototype.getResponseHeaders","headersObject","headersArray","getAllResponseHeaders","LOADED","trim","STATUS","REQUEST_BAD_STATUS","ChannelRequest.prototype.pollResponse_","ChannelRequest.prototype.cancel","ChannelRequest.prototype.onWatchDogTimeout_","WebChannelDebug.prototype.timeoutResponse","handleTimeout_","REQUEST_TIMEOUT","xt","goog.Uri","opt_uri","domain_","userInfo_","scheme_","port_","fragment_","ignoreCase_","setScheme","setUserInfo","setDomain","setPort","setPath","setQueryData","setFragment","goog.uri.utils.splitRe_","SCHEME","goog.Uri.decodeOrEmpty_","USER_INFO","DOMAIN","PORT","PATH","QUERY_DATA","FRAGMENT","goog.Uri.QueryData","goog.Uri.prototype.clone","goog.Uri.prototype.setScheme","newScheme","opt_decode","goog.Uri.prototype.setPort","newPort","goog.Uri.prototype.setQueryData","queryData","goog.Uri.QueryData.prototype.setIgnoreCase","ignoreCase","ensureKeyMapInitialized_","invalidateCache_","encodedQuery_","keyMap_","lowerCase","goog.Uri.encodeSpecialChars_","goog.Uri.reDisallowedInQuery_","goog.Uri.prototype.setParameterValue","goog.Uri.prototype.makeUnique","RANDOM","opt_preserveReserved","decodeURI","unescapedPart","extra","opt_removeDoubleEncoding","encoded","encodeURI","goog.Uri.encodeChar_","ch","goog.Uri.prototype.toString","scheme","getScheme","goog.Uri.reDisallowedInSchemeOrUserInfo_","getDomain","getUserInfo","getPort","getPath","hasDomain","goog.Uri.reDisallowedInAbsolutePath_","goog.Uri.reDisallowedInRelativePath_","getEncodedQuery","fragment","getFragment","goog.Uri.reDisallowedInFragment_","goog.Uri.prototype.resolve","relativeUri","absoluteUri","overridden","hasPath","lastSlashIndex","leadingSlash","opt_query","opt_ignoreCase","count_","goog.Uri.QueryData.prototype.ensureKeyMapInitialized_","goog.uri.utils.parseQueryData","encodedQuery","pairs","indexOfEquals","goog.Uri.QueryData.prototype.remove","getKeyName_","goog.Uri.QueryData.prototype.containsKey","goog.Uri.QueryData.prototype.setValues","goog.Uri.QueryData.prototype.clone","goog.Uri.QueryData.prototype.getKeyName_","keyName","mapId","ForwardChannelRequestPool","opt_maxPoolSize","module$contents$goog$labs$net$webChannel$ForwardChannelRequestPool_ForwardChannelRequestPool.MAX_POOL_SIZE_","goog.globalPerformanceNavigationTiming","PerformanceNavigationTiming","entrys","goog.globalperformancegetEntriesByType","performance","getEntriesByType","nextHopProtocol","goog.globalchrome","goog.globalchromeloadTimes","loadTimes","wasFetchedViaSpdy","goog.Uri.QueryData.prototype.add","goog.Uri.QueryData.prototype","goog.Uri.QueryData.prototype.forEach","goog.Uri.QueryData.prototype.getKeys","vals","goog.Uri.QueryData.prototype.getValues","opt_key","goog.Uri.QueryData.prototype.set","goog.Uri.QueryData.prototype.get","opt_default","goog.Uri.QueryData.prototype.toString","sb","encodedKey","an","ForwardChannelRequestPool.prototype.isFull","ForwardChannelRequestPool.prototype.getRequestCount","ForwardChannelRequestPool.prototype.hasRequest","req","ForwardChannelRequestPool.prototype.addRequest","ForwardChannelRequestPool.prototype.removeRequest","ForwardChannelRequestPool.prototype.getPendingMessages","goog.labs.net.webChannel.WireV8","goog.json.NativeJsonProcessor","WireV8.prototype.encodeMessage","opt_prefix","encodedValue","netUtils.imageCallback_","img","debugText","goog.net.FetchXmlHttpFactory","worker_","worker","streamBinaryChunks_","streamBinaryChunks","goog.net.FetchXmlHttp","credentialsMode_","goog.net.FetchXmlHttp.RequestState.UNSENT","responseType","statusText","onreadystatechange","requestHeaders_","responseHeaders_","method_","url_","inProgress_","textDecoder_","currentReader_","fetchResponse_","ForwardChannelRequestPool.prototype.cancel","getPendingMessages","goog.net.FetchXmlHttpFactory.prototype.createInstance","goog.functions.constant","retValue","UNSENT","goog.net.FetchXmlHttp.prototype.readInputFromFetch_","handleDataFromStream_","handleSendFailure_","goog.net.FetchXmlHttp.prototype.requestDone_","DONE","dispatchCallback_","goog.net.FetchXmlHttp.prototype.dispatchCallback_","mn","goog.net.FetchXmlHttp.prototype.open","goog.net.FetchXmlHttp.prototype","goog.net.FetchXmlHttp.prototype.send","opt_data","requestInit","Request","handleResponse_","goog.net.FetchXmlHttp.prototype.abort","requestDone_","goog.net.FetchXmlHttp.prototype.handleResponse_","HEADER_RECEIVED","LOADING","arrayBuffer","handleResponseArrayBuffer_","goog.globalReadableStream","readInputFromFetch_","text","handleResponseText_","goog.net.FetchXmlHttp.prototype.handleDataFromStream_","dataPacket","newText","goog.net.FetchXmlHttp.prototype.handleResponseText_","goog.net.FetchXmlHttp.prototype.handleResponseArrayBuffer_","responseArrayBuffer","goog.net.FetchXmlHttp.prototype.handleSendFailure_","setRequestHeader","goog.net.FetchXmlHttp.prototype.setRequestHeader","append","goog.net.FetchXmlHttp.prototype.getResponseHeader","goog.net.FetchXmlHttp.prototype.getAllResponseHeaders","lines","pair","getCredentialsMode","setCredentialsMode","vn","goog.net.XhrIo","opt_xmlHttpFactory","xmlHttpFactory_","active_","xhrOptions_","lastUri_","lastErrorCode_","inAbort_","inOpen_","inSend_","errorDispatched_","timeoutInterval_","timeoutId_","responseType_","goog.net.XhrIo.ResponseType.DEFAULT","useXhr2Timeout_","withCredentials_","goog.net.XhrIo.HTTP_SCHEME_PATTERN","goog.net.XhrIo.METHODS_WITH_FORM_DATA","goog.net.XhrIo.prototype.error_","dispatchErrors_","cleanUpXhr_","goog.net.XhrIo.prototype.dispatchErrors_","goog.net.XhrIo.prototype.onReadyStateChangeHelper_","LOCAL_REQUEST_ERROR","onReadyStateChange_","isComplete","isSuccess","CREATED","ACCEPTED","NO_CONTENT","PARTIAL_CONTENT","NOT_MODIFIED","QUIRK_IE_NO_CONTENT","goog.globalself","goog.globalselflocation","goog.globalselflocationprotocol","goog.net.XhrIo.HTTP_SCHEME_PATTERNtest","getStatusText","goog.net.XhrIo.prototype.cleanUpXhr_","opt_fromDispose","cleanUpTimeoutTimer_","clearedOnReadyStateChange","USE_NULL_FUNCTION","goog.net.XhrIo.prototype.cleanUpTimeoutTimer_","goog.net.XhrIo.prototype.getReadyState","UNINITIALIZED","goog.net.XhrIo.prototype.getResponse","TEXT","ARRAY_BUFFER","mozResponseArrayBuffer","exports.generateHttpHeadersOverwriteParam","exports.setHttpHeadersWithOverwriteParam","urlParam","extraHeaders","httpHeaders","module$exports$goog$net$rpc$HttpCors.generateHttpHeadersOverwriteParam","getInternalChannelParam","paramName","defaultValue","goog.labs.net.webChannel.WebChannelBase","extraParams_","httpHeadersOverwriteParam_","initHeaders_","nextMapId_","nextRid_","failFast_","forwardChannelTimerId_","allowStreamingMode_","backChannelAttemptId_","forwardChannelRetryCount_","baseRetryDelayMs_","retryDelaySeedMs_","forwardChannelMaxRetries_","forwardChannelRequestTimeoutMs_","concurrentRequestLimit","fastHandshake_","fastHandshake","encodeInitMessageHeaders_","blockingHandshake_","blockingHandshake","longPollingTimeout_","nonAckedMapsAtChannelClose_","bpDetectionTimerId_","WebChannelBase.prototype.disconnect","cancelRequests_","rid","addAdditionalParams_","requestSent","goog.globalnavigatorsendBeacon","sendBeacon","goog.globalImage","Image","onClose_","WebChannelBase.prototype.cancelBackChannelRequest_","WebChannelBase.prototype.cancelRequests_","clearForwardChannelTimer_","WebChannelBase.prototype.ensureForwardChannel_","isFull","onStartForwardChannelTimer_","WebChannelBase.prototype.makeForwardChannelRequest_","opt_retryRequest","module$exports$goog$net$rpc$HttpCors.setHttpHeadersWithOverwriteParam","requeuePendingMaps_","requestText","dequeueOutgoingMaps_","goog.labs.net.webChannel.WebChannelBase.MAX_MAPS_PER_REQUEST_","xmlHttpPost","WebChannelBase.prototype.addAdditionalParams_","WebChannelBase.prototype.dequeueOutgoingMaps_","maxNum","badMapHandler","badMapError","messageQueue","encodeMessage","pendingMessages","WebChannelBase.prototype.ensureBackChannel_","onStartBackChannelTimer_","WebChannelBase.prototype.maybeRetryBackChannel_","goog.labs.net.webChannel.WebChannelBase.BACK_CHANNEL_MAX_RETRIES","getRetryTime_","WebChannelBase.prototype.clearBpDetectionTimer_","WebChannelBase.prototype.startBackChannel_","WebChannelBase.prototype.clearDeadBackchannelTimer_","WebChannelBase.prototype.onRequestComplete","BACK_CHANNEL","FORWARD_CHANNEL","rtt","retries","lastError","WebChannelBase.prototype.maybeRetryForwardChannel_","INIT","getForwardChannelMaxRetries","WebChannelBase.prototype.getRetryTime_","retryCount","retryTime","isActive","goog.labs.net.webChannel.WebChannelBase.INACTIVE_CHANNEL_RETRY_FACTOR","WebChannelBase.prototype.signalError_","imageUri","testNetworkCallback_","goog.globallocation","goog.globallocationprotocol","netUtils.testLoadImage","goog.labs.net.webChannel.netUtils.imageCallback_","goog.labs.net.webChannel.netUtils.NETWORK_TIMEOUT","ERROR_OTHER","onError_","channelError","WebChannelBase.prototype.onClose_","channelClosed","WebChannelBase.prototype.createDataUri","locationPage","hostName","opt_scheme","opt_domain","opt_port","getHttpSessionId","WebChannelBase.prototype.createXhrIo","isStreaming","WebChannelBase.Handler","goog.labs.net.webChannel.WebChannelBaseTransport","goog.userAgent.DOCUMENT_MODE","WebChannelBaseTransport.Channel","messageUrlParams_","messageHeaders","clientProtocolHeaderRequired","goog.net.WebChannel.X_CLIENT_PROTOCOL","goog.net.WebChannel.X_CLIENT_PROTOCOL_WEB_CHANNEL","initHeaders","messageContentType","goog.net.WebChannel.X_WEBCHANNEL_CONTENT_TYPE","clientProfile","goog.net.WebChannel.X_WEBCHANNEL_CLIENT_PROFILE","httpHeadersOverwriteParam","supportsCrossDomainXhr_","sendRawJson_","channelHandler_","goog.labs.net.webChannel.WebChannelBaseTransport.Channel.Handler_","WebChannelBaseTransport.Channel.MessageEvent","goog.net.WebChannel.MessageEventcall","metadataKey","WebChannelBaseTransport.Channel.ErrorEvent","goog.net.WebChannel.ErrorEventcall","NETWORK_ERROR","WebChannelBaseTransport.Channel.Handler_","goog.crypt.Md5","block_","totalLength_","blockLength_","goog.crypt.Md5.prototype.compress_","opt_offset","X","goog.math.Integer","sign","sign_","localBits","bits_","qn","goog.net.XhrIo.prototype.setWithCredentials","withCredentials","goog.net.XhrIo.prototype","JSC$2324_send","goog.net.XhrIo.prototype.send","opt_method","opt_content","opt_headers","toUpperCase","createXhr","goog.net.XmlHttp.factory_createInstance","goog.net.XmlHttp.factory_getOptions","error_","contentTypeKey","contentIsFormData","FormData","goog.net.XhrIo.CONTENT_TYPE_HEADER","goog.net.XhrIo.FORM_CONTENT_TYPE","goog.net.XhrIo.shouldUseXhr2Timeout_","JSC$2324_timeout_","goog.net.XhrIo.prototype.timeout_","goog.net.XhrIo.prototype.abort","opt_failureCode","goog.net.XhrIo.prototype.disposeInternal","goog.net.XhrIosuperClass_disposeInternalcall","goog.net.XhrIo.prototype.onReadyStateChange_","isDisposed","onReadyStateChangeHelper_","onReadyStateChangeEntryPoint_","goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_","goog.net.XhrIo.prototype.isActive","goog.net.XhrIo.prototype.getStatus","goog.net.XhrIo.prototype.getResponseText","goog.net.XhrIo.prototype.getResponseJson","opt_xssiPrefix","goog.json.hybrid.parse","goog.net.XhrIo.prototype.getLastErrorCode","JSC$2324_getLastError","goog.net.XhrIo.prototype.getLastError","goog.labs.net.webChannel.Wire.LATEST_CHANNEL_VERSION","goog.labs.net.webChannel.WebChannelBase.prototype","JSC$2331_state_","WebChannelBase.prototype.onStartForwardChannelTimer_","startForwardChannel_","total","goog.labs.net.webChannel.Wire.RAW_DATA_KEY","__data__","goog.labs.net.webChannel.WebChannelBase.MAX_CHARS_PER_GET_","goog.net.WebChannelTransport.CLIENT_VERSION","makeForwardChannelRequest_","WebChannelBase.prototype.onStartBackChannelTimer_","startBackChannel_","bpDetectionTimeout","onBpDetectionTimer_","WebChannelBase.prototype.onBpDetectionTimer_","WebChannelBase.prototype.onBackChannelDead_","BACKCHANNEL_DEAD","WebChannelBase.prototype.testNetworkCallback_","networkUp","ERROR_NETWORK","WebChannelBase.prototype.isActive","WebChannelBase.Handler.prototype.channelOpened","goog.labs.net.webChannel.WebChannelBase.Handler.prototype","WebChannelBase.Handler.prototype.channelHandleArray","WebChannelBase.Handler.prototype.channelError","WebChannelBase.Handler.prototype.channelClosed","WebChannelBase.Handler.prototype.isActive","WebChannelBase.Handler.prototype.badMapError","WebChannelBaseTransport.prototype.createWebChannel","goog.labs.net.webChannel.WebChannelBaseTransport.Channel","WebChannelBaseTransport.Channel.prototype.open","CONNECT_ATTEMPT","channelPath","opt_extraParams","connectChannel_","WebChannelBaseTransport.Channel.prototype.close","WebChannelBaseTransport.Channel.prototype.send","rawJson","messageToMapObject_","goog.labs.net.webChannel.Wire.QueuedMap","WebChannelBaseTransport.Channel.prototype.disposeInternal","goog.labs.net.webChannel.WebChannelBaseTransport.ChannelsuperClass_disposeInternalcall","goog.labs.net.webChannel.WebChannelBaseTransport.Channel.MessageEvent","goog.labs.net.webChannel.WebChannelBaseTransport.Channel.ErrorEvent","goog.labs.net.webChannel.WebChannelBase.Handler","WebChannelBaseTransport.Channel.Handler_.prototype.channelOpened","WebChannelBaseTransport.Channel.Handler_.prototype.channelHandleArray","WebChannelBaseTransport.Channel.Handler_.prototype.channelError","WebChannelBaseTransport.Channel.Handler_.prototype.channelClosed","goog.crypt.Md5.prototype.reset","goog.crypt.Md5.prototype.update","opt_length","block","blockLength","goog.crypt.Md5.prototype.digest","pad","br","goog.math.Integer.fromInt","goog.reflect.cache","valueFn","cacheObj","goog.math.Integer.IntCache_","goog.math.Integer.fromNumber","goog.math.Integer.ZERO","negate","goog.math.Integer.TWO_PWR_32_DBL_","goog.math.Integer.ONE","goog.math.Integer.TWO_PWR_24_","goog.math.Integer.prototype.isZero","goog.math.Integer.prototype.isNegative","goog.math.Integer.prototype.negate","not","goog.math.Integer.prototype.subtract","goog.math.Integer.carry16_","goog.math.Integer.DivisionResult","quotient","remainder","goog.math.Integer.prototype.divideAndRemainder","isZero","isNegative","divideAndRemainder","slowDivide_","twoPower","multiple","shiftLeft","shiftRight","total2","subtract","rem","approx","delta","log2","LN2","approxRem","approxRes","goog.math.Integer.prototype.shiftLeft","bit_delta","goog.math.Integer.prototype.shiftRight","numBits","arr_delta","lr","goog.math.Integer.prototype.toNumber","getBitsUnsigned","goog.math.Integer.prototype","goog.math.Integer.prototype.toString","opt_radix","radix","radixToPower","remDiv","toInt","goog.math.Integer.prototype.getBits","JSC$2356_compare","goog.math.Integer.prototype.compare","diff","goog.math.Integer.prototype.abs","goog.math.Integer.prototype.add","carry","c0","JSC$2356_multiply","goog.math.Integer.prototype.multiply","lessThan","a1","a0","b1","b0","goog.math.Integer.prototype.modulo","and","goog.math.Integer.prototype.and","goog.math.Integer.prototype.or","xor","goog.math.Integer.prototype.xor","goog.net.ErrorCode","goog.net.EventType","goog.net.WebChannel.EventType","getLastError","goog.math.Integer.fromString","power","module","goog.net.createWebChannelTransport","requestStats.getStatEventTarget","goog.labs.net.webChannel.requestStats.Event","goog.labs.net.webChannel.requestStats.Stat","TEST_STAGE_ONE_START","TEST_STAGE_TWO_START","TEST_STAGE_TWO_DATA_ONE","TEST_STAGE_TWO_DATA_TWO","TEST_STAGE_TWO_DATA_BOTH","TEST_STAGE_ONE_FAILED","TEST_STAGE_TWO_FAILED","BROWSER_OFFLINE","Orbit","Coordinator","_sources","_strategies","sources","addSource","strategies","strategy","addStrategy","_defaultActivationOptions","defaultActivationOptions","Info","_activated","removeSource","getSource","objectValues","sourceNames","removeStrategy","getStrategy","strategyNames","activated","activate","_activate","deactivate","_deactivate","_currentActivationOptions","beforeSourceActivation","afterSourceActivation","beforeSourceDeactivation","afterSourceDeactivation","Strategy","_sourceNames","_logPrefix","logPrefix","_customLogLevel","coordinator","_coordinator","getSourceName","Assertion","LogTruncationStrategy","_transformListeners","_connectSource","_disconnectSource","_review","transformId","transformLog","requestQueue","syncQueue","_truncateSources","relativePosition","chain","truncate","sourceName","on","off","EventLoggingStrategy","_events","events","_interfaces","interfaces","_eventListeners","_activateSource","_deactivateSource","_sourceEvents","_sourceInterfaces","_interfaceEvents","isPullable","isPushable","isQueryable","isSyncable","isUpdatable","interfaceName","None","_generateListener","deepSet","deepGet","ConnectionStrategy","defaultName","_event","_action","_catch","_filter","_blocking","blocking","generateListener","defaultListener","invokeAction","handleBlockingResponse","RequestStrategy","passHints","fullResponse","assignHints","SyncStrategy","deprecate","Bucket","Exception","Log","NotLoggedException","Notifier","OutOfRangeException","TaskProcessor","TaskQueue","y","evented","fulfillAll","fulfillInSeries","isEvented","settleInSeries","globals","uuid","randomUUID","customRandomUUID","_started","_settled","_settlement","_success","settled","settle","perform","emit","EVENTED","Klass","eventName","notifierForEvent","notifier","_eventedNotifiers","one","createIfUndefined","_tasks","_processors","_performer","_bucket","bucket","autoProcess","autoActivate","_reify","performer","currentProcessor","_error","processing","processor","reified","_reified","_persist","_settle","retry","_cancel","skip","resolution","_resolution","_complete","_resolve","_reject","_settleEach","_loadTasksFromBucket","tasks","_applySettings","_namespace","_version","ids","rollback","clearedData","_initData","_loadDataFromBucket","bucketData","QueryExpressionParseError","expression","QueryNotAllowed","TransformNotAllowed","OperationTerm","_operation","toOperation","deepMerge","QueryTerm","_expression","toQueryExpression","buildQuery","queryOrExpressions","queryOptions","queryId","queryBuilder","expressions","isQuery","isQueryTerm","requestOptionsForSource","so","extractRequestOptionsForSource","mapNamedFullResponses","responses","Source","requestQueueSettings","syncQueueSettings","_queryBuilder","_transformBuilder","transformBuilder","_defaultQueryOptions","defaultQueryOptions","_defaultTransformOptions","defaultTransformOptions","_transformLog","_syncQueue","_requestQueue","getQueryOptions","getTransformOptions","transformed","transforms","buildTransform","transformOrOperations","transformOptions","PULLABLE","pullable","pull","__pull__","otherResponses","_pull","PUSHABLE","pushable","__push__","_push","QUERYABLE","queryable","__query__","SYNCABLE","syncable","sync","transformOrTransforms","__sync__","_sync","UPDATABLE","updatable","__update__","_update","IdentityMap","_serializer","_map","identity","serialize","record","deserialize","callbackFn","toStringTag","ClientError","InvalidServerResponse","JSONAPIAtomicOperationSerializer","JSONAPIAtomicOperationsDocumentSerializer","JSONAPIAtomicResultsDocumentSerializer","U","JSONAPIBaseSerializer","JSONAPIDocumentSerializer","JSONAPIRequestProcessor","JSONAPIResourceFieldSerializer","JSONAPIResourceIdentitySerializer","JSONAPIResourceSerializer","JSONAPISerializer","JSONAPISerializers","JSONAPISource","Y","JSONAPIURLBuilder","NetworkError","QueryRequestProcessors","ServerError","TransformRequestProcessors","appendQueryParams","buildJSONAPISerializerFor","encodeQueryParams","getQueryRequests","getTransformRequests","flattenObjectToParams","newPath","rawParam","fullUrl","filterOption","queryParams","serializerFor","keyMap","resourceNamespace","resourceHost","resourceURL","resourcePath","resourceType","resourceId","ResourceTypePath","ResourceIdentity","resourceRelationshipURL","relationship","serializeRelationshipInPath","relatedResourceURL","buildFilterParam","filterSpecifier","attributeFilter","serializeFieldParam","attribute","relatedRecordFilter","relation","relatedRecordsFilter","records","fieldParam","buildSortParam","sortSpecifiers","sortSpecifier","descending","fieldName","attributeSort","buildPageParam","pageSpecifier","pageParam","buildIncludeParam","includeSpecifier","buildFieldsParam","fieldsSpecifier","typeParam","ResourceTypeParam","resourceAttribute","resourceRelationship","ResourceFieldParam","ResourceFieldPath","BaseSerializer","serializationOptions","deserializationOptions","schema","_schema","_keyMap","resourceSerializer","Resource","documentSerializer","ResourceDocument","identitySerializer","typeSerializer","ResourceType","fieldSerializer","ResourceField","atomicOperationSerializer","ResourceAtomicOperation","atomicOperationsDocumentSerializer","ResourceAtomicOperationsDocument","atomicResultsDocumentSerializer","ResourceAtomicResultsDocument","serializeAddRecordOperation","serializeUpdateRecordOperation","serializeRemoveRecordOperation","serializeAddToRelatedRecordsOperation","serializeRemoveFromRelatedRecordsOperation","serializeReplaceRelatedRecordOperation","serializeReplaceRelatedRecordsOperation","serializeReplaceAttributeOperation","deserializeAddOperation","deserializeUpdateOperation","deserializeRemoveOperation","relatedRecord","relatedRecords","resource","isRelatedResourceOperation","model","getModel","serializeAttributes","serializeRelationships","serializeLinks","serializeMeta","customOptions","buildDeserializationOptions","includeKeys","deserializeAttributes","deserializeRelationships","deserializeLinks","deserializeMeta","serializeAttribute","fieldOptions","resValue","serialization","resField","relationships","serializeRelationship","deserializeAttribute","deserialization","deserializeRelationship","resData","resourceIdentity","links","meta","getResourceKey","_resourceKeys","_getCustomResourceKey","availableKeys","recordIdentity","resourceKey","idToKey","primaryRecord","idFromKeys","generateId","pushRecord","resDocument","serializeRecords","serializeRecord","buildSerializationOptions","deserializeResources","primaryRecords","deserializeResource","included","resources","StringSerializer","defaultSerializerClassFor","buildSerializerClassFor","unknown","NoopSerializer","boolean","BooleanSerializer","string","DateSerializer","datetime","DateTimeSerializer","number","NumberSerializer","serializerClassFor","serializerSettingsFor","defaultSerializerSettingsFor","buildSerializerSettingsFor","sharedSettings","settingsByType","inflectors","customSerializerSettingsFor","defaultSerializerSettings","customSerializerSettings","customSerializerFor","backupSerializerFor","buildSerializerFor","allowedContentTypes","SerializerClass","_serializerFor","URLBuilderClass","urlBuilderOptions","urlBuilder","initDefaultFetchSettings","customSettings","initFetchSettings","timedOut","handleFetchError","handleFetchResponse","defaultFetchSettings","operationsFromDeserializedDocument","deserialized","buildFetchSettings","page","include","mergeRequestOptions","customRequestOptions","queryOrTransform","queryExpressionOrOperation","preprocessResponseDocument","responseHasContent","ignoreUnrecognizedContent","contentType","allowedContentType","Accept","responseDetail","handleFetchResponseError","requestProcessor","requests","ExpressionToRequestMap","findRecord","cloneRecordIdentity","findRecords","findRelatedRecord","findRelatedRecords","recordDoc","raiseNotFoundExceptions","RecordNotFoundException","partialSet","prev","addRecord","requestDoc","handleChanges","removeRecord","updateRecord","addToRelatedRecords","resourceIdentitySerializer","removeFromRelatedRecords","replaceRelatedRecord","replaceRelatedRecords","prevRequest","newRequestNeeded","equalRecordIdentities","replaceRecordAttribute","replaceRecordHasMany","OperationToRequestMap","replaceAttribute","updatedRecord","updateOps","recordDiffs","includedOps","RecordSource","maxRequestsPerTransform","maxRequestsPerQuery","RequestProcessorClass","parallelRequests","maxRequests","processTransformRequests","processQueryRequests","getQueryRequestProcessor","getTransformRequestProcessor","serializers","attr","resourceIds","recordId","existingId","keyToId","_generateNewId","recordType","recordAttribute","recordRelationship","serializeAtomicOperationsDocument","serializeAtomicOperations","serializeAtomicOperation","serializeId","serializeIdentity","attrOptions","deserializeAtomicOperationsDocument","deserializeAtomicOperations","deserializeAtomicOperation","deserializeResourceIdentity","hasAttribute","resourceRel","hasRelationship","resourceData","serializeResults","deserializeAtomicResults","MemoryCache","MemorySource","SIZE","BUCKET_SIZE","MASK","MAX_INDEX_NODE","MIN_ARRAY_NODE","nothing","constant","hashFragment","toBitmap","fromBitmap","bit","arrayUpdate","mutate","at","arraySpliceOut","LEAF","COLLISION","INDEX","ARRAY","__hamt_isEmpty","_modify","edit","keyEq","Leaf","isEmptyNode","Leaf__modify","Collision","children","Collision__modify","IndexedNode","IndexedNode__modify","ArrayNode","ArrayNode__modify","mergeLeaves","h1","n1","h2","n2","subH1","subH2","canEditNode","_v","_newValue","frag","indx","canEdit","newChildren","subNodes","newChild","tryGetHash","alt","_root","tryGet","hasHash","defKeyCompare","modifyHash","_size","newRoot","_editable","_edit","setTree","setHash","del","removeHash","beginMutation","HAMTMap","endMutation","appk","lazyVisitChildren","lazyVisit","visit","HAMTMapIterator","buildPairs","buildKeys","buildValues","fold","toVisit","v0","editable","newSize","getHash","modify","deleteHash","transient","ImmutableMap","setMany","removeMany","RecordCache","validatorFor","validators","autoValidate","buildRecordValidatorFor","_validatorFor","normalizer","StandardRecordNormalizer","validateInputs","RecordQueryBuilder","RecordTransformBuilder","ae","ce","pe","LiveQuery","debounce","onNext","tick","ticks","nextTick","cancelTick","unsubscribePatch","operationRelevantForQuery","unsubscribeReset","change","queryExpressionRelevantForChange","findRecordQueryExpressionRelevantForChange","findRecordsQueryExpressionRelevantForChange","findRelatedRecordQueryExpressionRelevantForChange","findRelatedRecordsQueryExpressionRelevantForChange","relationshipDef","getRelationship","resolvedPromise","setImmediate","WeakSet","SyncLiveQueryUpdate","_cache","SyncLiveQuery","SyncOperationProcessor","accessor","_accessor","validate","immediate","getInverseRelationship","getInverseRelationships","getAllInverseRelationships","inverseRelationships","eachRelationship","relationshipData","SyncCacheIntegrityProcessor","removeInverseRelationship","getRelatedRecordSync","removeInverseRelationships","getRelatedRecordsSync","removeAllInverseRelationships","addInverseRelationship","addInverseRelationships","addAllInverseRelationships","clearInverseRelationshipOps","inverseRelationship","addInverseRelationshipsSync","removeInverseRelationshipsSync","currentRecord","getRecordSync","ops","getInverseRelationshipsSync","relatedRecordReplaced","currentRelatedRecord","inverse","removeRelationshipOp","addRelationshipOp","relatedRecordsReplaced","currentRelatedRecords","addedRecords","removedRecords","uniqueRecordIdentities","removeRelatedRecordsOps","addRelatedRecordsOps","dependent","isHasMany","recordArrayFromData","SyncSchemaConsistencyProcessor","currentRelationshipData","SyncSchemaValidationProcessor","issues","validateRecordOperation","ValidationError","SyncInverseTransformOperators","eq","replacement","changed","grouping","currentValue","relationshipChanged","currentData","equalRecordIdentitySets","replaceKey","recordsInclude","SyncQueryOperators","getRecordsSync","filterRecords","sortRecords","paginateRecords","relatedIds","relatedId","applyFilter","actual","comparisonValues","comparisonOrders","sortExpression","record1","record2","values1","values2","paginationOptions","SyncTransformOperators","setRecordSync","mergedRecord","mergeRecords","removeRecordSync","Ce","SyncRecordCache","_queryOperators","queryOperators","_transformOperators","transformOperators","_inverseTransformOperators","inverseTransformOperators","_debounceLiveQueries","debounceLiveQueries","_transformBuffer","transformBuffer","processors","Processor","getQueryOperator","getTransformOperator","getInverseTransformOperator","applyRecordChangesetSync","changeset","setRecords","removeRecords","setRecordsSync","removeRecordsSync","patch","operationOrOperations","inverseOperations","liveQuery","queryOperator","useBuffer","_initTransformBuffer","startTrackingChanges","stopTrackingChanges","appliedOperations","appliedOperationResults","_applyTransformOperations","_applyTransformOperation","_getTransformBuffer","recordsReferencedByOperations","ir","resetState","primary","inverseOp","preparedOps","serializeRecordRelationshipIdentity","rri","serializeRecordIdentity","deserializeRecordRelationshipIdentity","deserializeRecordIdentity","SimpleRecordTransformBuffer","_state","_delta","rels","rel","typeOrIdentities","recordIdentities","recordIdentityOrIdentities","_getInverseRelationshipsSync","ri","Xe","trackUpdateOperations","_base","_isTrackingUpdateOperations","fork","forkedCache","coalesce","remainingOptions","isTrackingUpdateOperations","getAllUpdateOperations","coalesceRecordOperations","rebase","_records","types","models","typedMap","recordMap","typedIds","_inverseRelationships","newRels","_updateOperations","baseRecords","_resetInverseRelationships","baseRelationships","_transforms","_transformInverses","_logCleared","_logTruncated","_logRolledback","cacheSettings","_forkPoint","cacheClass","forkPoint","_applyTransform","_retrieveOperationResult","_retrieveQueryExpressionResult","MemorySource_1","forkedSource","requestOptions","sinceTransformId","getTransformsSince","getAllTransforms","transformsSince","allTransforms","getTransform","getInverseOperations","_clearTransformFromHistory","Reflect","decorate","set1","set2","serialized1","serializeRecordIdentities","serialized2","exclusiveIdentities","dedupeRecordIdentities","dict","deduped","sri","recordsIncludeAll","mergeRecordSection","section","replacementDepth","isRecordIdentity","identities1","identities2","validateDate","minimum","validator","validation","maximum","exclusiveMinimum","exclusiveMaximum","StandardValidators","standardValidators","minItems","maxItems","minLength","maxLength","formatValidationDescription","summary","SchemaError","ModelNotDefined","AttributeNotDefined","KeyNotDefined","RelationshipNotDefined","RecordException","specifier","RecordKeyMap","_idsToKeys","_keysToIds","idValue","markOperationToDelete","isOperationMarkedToDelete","mergeOperations","superceded","superceding","consecutiveOps","isReplaceFieldOp","updateRecordReplaceAttribute","updateRecordReplaceHasOne","updateRecordReplaceHasMany","updateRecordAddToHasMany","currentOp","nextOp","fullRecordUpdate","diffRecord","member","updatedValue","relName","StandardRecordValidators","BaseRecordOperationTerm","$transformBuilder","$validatorFor","$schema","RecordOperation","AddRecordTerm","UpdateRecordTerm","RemoveRecordTerm","ReplaceAttributeTerm","ReplaceKeyTerm","AddToRelatedRecordsTerm","RemoveFromRelatedRecordsTerm","ReplaceRelatedRecordsTerm","ReplaceRelatedRecordTerm","BaseRecordQueryTerm","$queryBuilder","RecordQueryExpression","FindRecordTerm","FindRelatedRecordTerm","FindRecordsTerm","specifiers","$sortParamToSpecifier","$pageParamToSpecifier","$filterParamToSpecifier","$normalizeRecordIdentity","$parseSortParamString","$normalizer","$normalizeRecordType","rt","normalizeRecordType","normalizeRecordIdentity","RecordSchema","pluralize","singularize","_deprecateRelationshipModel","_models","word","getAttribute","attributeDef","keyDef","hasModel","hasKey","eachAttribute","eachKey","ue","de","recordInitializer","normalizeRecord","initializeRecord","$normalizeRecord","validateRecordAttribute","defIssues","RecordFieldDefinition","required","RecordAttribute","notNull","validateRecordValue","valueIssues","validateRecordFieldDefinition","validateRecordIdentity","RecordIdentity","modelDef","RecordType","validateRecordKey","RecordKey","Record","partialRecord","RelatedRecord","RecordRelationship","validateRecordRelationship","dataIssues","validateRelatedRecord","arrayIssues","validateRecordType","validateRecord","recordIdentityIssues","validateKey","keyIssues","validateAttribute","attrIssues","validateRelationship","relationshipIssues","relatedRecordIssues","allowedType","relatedType","allowedTypes","standardRecordValidators","recordKey","recordOperation","recordQueryExpression","recordIssues","fieldIssues","recordFieldDefinition","ve","cloneInputs","cloneRecord","autoUpgrade","buildInflector","camelize","capitalize","dasherize","decamelize","standardInflectors","standardInverseInflectors","underscore","getFullYear","getMonth","getDate","year","month","mappings","fallback","chr","inverseInflectors","buildInverseInflectors","inflector","applyInflector","inverseInflector","inflectorOrName","serializerClasses","serializerSettings","settingsForType","firstResult","multiline","dup","setTime","expose","destination","properties","ptr","lut","d0","d1","d2","d3","Breadcrumbs","BrowserClient","BrowserProfilingIntegration","ga","BrowserTracing","Us","Dedupe","dn","FunctionToString","GlobalHandlers","HttpContext","un","Hub","InboundFilters","Integrations","ya","LinkedErrors","pn","ModuleMetadata","Replay","Ms","Scope","TryCatch","Vt","WINDOW","je","addBreadcrumb","addGlobalEventProcessor","addTracingExtensions","captureEvent","captureException","captureMessage","captureUserFeedback","yn","chromeStackLineParser","Wt","configureScope","createTransport","We","createUserFeedbackEnvelope","defaultIntegrations","defaultRequestInstrumentationOptions","Bs","defaultStackLineParsers","It","defaultStackParser","eventFromException","eventFromMessage","ut","exceptionFromError","ot","extractTraceparentData","qG","flush","forceLoad","geckoStackLineParser","getActiveSpan","getActiveTransaction","oe","getCurrentHub","getHubFromCarrier","T","zn","instrumentOutgoingRequests","Ps","lastEventId","makeBrowserOfflineTransport","makeFetchTransport","makeMain","makeMultiplexedTransport","makeXHRTransport","onLoad","An","onProfilingStartRouteTransaction","opera10StackLineParser","Nt","opera11StackLineParser","setContext","setExtra","setExtras","setMeasurement","setTag","setTags","setUser","showReportDialog","spanStatusfromHttpCode","startInactiveSpan","startSpan","Re","startSpanManual","startTransaction","trace","Le","winjsStackLineParser","kt","withScope","wrap","gn","originalFunctionToString","__initStatic","setupOnce","HK","DEFAULT_IGNORE_ERRORS","DEFAULT_IGNORE_TRANSACTIONS","processEvent","internalOptions","clientOptions","allowUrls","denyUrls","ignoreErrors","disableErrorDefaults","ignoreTransactions","disableTransactionDefaults","ignoreInternal","__SENTRY_DEBUG__","possibleMessages","lastException","U0","getEventDescription","_getEventFilterUrl","frames","filename","kg","jH","YO","getGlobalEventProcessors","cW","J8","ipAddress","ip_address","did","ignoreDuration","sid","duration","release","environment","_notifyingListeners","_scopeListeners","_eventProcessors","_breadcrumbs","_attachments","_user","_tags","_extra","_contexts","_sdkProcessingMetadata","_propagationContext","newScope","addScopeListener","addEventProcessor","_session","updateSession","_notifyScopeListeners","getUser","getRequestSession","_requestSession","setRequestSession","setFingerprint","_fingerprint","setLevel","_level","setTransactionName","_transactionName","setSpan","_span","getSpan","getTransaction","setSession","PO","tags","contexts","fingerprint","requestSession","propagationContext","breadcrumbs","getLastBreadcrumb","clearBreadcrumbs","addAttachment","getAttachments","clearAttachments","applyToEvent","additionalEventProcessors","dynamicSamplingContext","sdkProcessingMetadata","_applyFingerprint","_getBreadcrumbs","setSDKProcessingMetadata","setPropagationContext","getPropagationContext","generatePropagationContext","traceId","spanId","DEFAULT_BREADCRUMBS","_stack","bindClient","isOlderThan","getStackTop","setupIntegrations","pushScope","getScope","getStack","popScope","getClient","_lastEventId","event_id","DM","_withClient","originalException","syntheticException","beforeBreadcrumb","maxBreadcrumbs","yW","consoleSandbox","mergedBreadcrumb","getIntegration","_callExtensionMethod","traceHeaders","captureSession","endSession","_sendSessionUpdate","closeSession","startSession","ph","Jr","attrs","user_agent","shouldSendDefaultPii","Boolean","sendDefaultPii","__SENTRY__","extensions","GLOBAL_OBJ","hub","setHubOnCarrier","acs","carrier","filenameMetadataMap","parsedStacks","parser","_sentryModuleMetadata","I","ensureMetadataStacksAreParsed","forEachEnvelopeItem","stacktrace","module_metadata","stripMetadataFromStackFrames","stackParser","frame","addMetadataToStackFrames","captureContext","customSamplingContext","maybeOptions","__SENTRY_TRACING__","enableTracing","errorsInstrumented","errorCallback","activeTransaction","tag","_maxlen","spans","span","startTimestamp","instrumenter","parentSpanId","sampled","endTimestamp","setName","startChild","spanContext","childSpan","spanRecorder","setData","setStatus","setHttpStatus","finish","logMessage","spanMetadata","toTraceparent","$p","toContext","updateWithContext","getTraceContext","parent_span_id","span_id","trace_id","start_timestamp","publicKey","getDsn","user_segment","public_key","_measurements","_hub","_trimEnd","trimEnd","_frozenDynamicSamplingContext","initSpanRecorder","unit","setMetadata","_finishTransaction","getDynamicSamplingContext","sampleRate","dsc","setHub","transaction_info","idleTimeout","finalTimeout","heartbeatInterval","IDLE_TRANSACTION_FINISH_REASONS","Me","_pushActivity","_popActivity","transactionSpanId","maxlen","transactionContext","_idleHub","_idleTimeout","_finalTimeout","_heartbeatInterval","_onScope","activities","_heartbeatCounter","_finished","_idleTimeoutCanceledPermanently","_beforeFinishCallbacks","_finishReason","he","_restartIdleTimeout","registerBeforeFinishCallback","_pingHeartbeat","cancelIdleTimeout","restartOnChildSpanChange","_idleTimeoutID","setFinishReason","_beat","_prevHeartbeatString","sample","samplingContext","tracesSampler","parentSampled","tracesSampleRate","rate","i2","_startTransaction","transactionInstrumenter","configInstrumenter","Ae","onScope","addInstrumentationHandler","ye","makeRequest","mL","filteredEnvelopeItems","WD","Jd","rateLimits","recordEnvelopeLoss","drain","getEventForEnvelopeItem","Ne","activeSpan","maybePromiseResult","finishAndSetSpan","ctx","createChildSpanOrTransaction","parentSpan","normalizeContext","xe","SENTRY_API_VERSION","getBaseApiEndpoint","dsn","tunnelOrOptions","tunnel","_metadata","sdk","De","_j","sentry_key","sentry_version","sentry_client","Be","matcher","U4","otherTransports","makeOverrideReleaseTransport","envelope","getEvent","transports","ignoreOnError","__sentry_wrapped__","mechanism","addExceptionTypeValue","addExceptionMechanism","sentryWrapped","markFunctionWrapped","addNonEnumerableProperty","integrations","integration","isDefaultInstance","integrationsByName","finalIntegrations","integrationIndex","installedIntegrations","preprocessEvent","normalizeDepth","normalizeMaxBreadth","dist","maxValueLength","applyClientOptions","applyIntegrationsMetadata","_sentryDebugIds","debugIdStackFramesCache","debugIdStackParserCache","parsedStack","acc","applyDebugIds","finalScope","getEventProcessors","attachments","debug_id","abs_path","filenameDebugIdMap","debug_meta","images","code_file","applyDebugMeta","normalized","ALREADY_SEEN_ERROR","_integrations","_integrationsInitialized","_numProcessing","_outcomes","_hooks","_dsn","vK","_transport","transport","recordDroppedEvent","transportOptions","promisedEvent","_captureEvent","sendSession","getSdkMetadata","getTransport","_isClientDoneProcessing","_isEnabled","setupIntegration","getIntegrationById","addIntegration","sendEvent","HY","enhanceEventWithSdkInfo","Cd","createAttachmentEnvelopeItem","attachment","textEncoder","_sendEnvelope","sent_at","RA","sendClientReports","_updateSessionFromEvent","errored","crashed","ticked","_prepareEvent","_processEvent","finalEvent","$2","__sentry__","beforeSend","beforeSendTransaction","beforeSendResult","beforeSendLabel","processedEvent","_clearOutcomes","category","quantity","isErrorEvent","isTransactionEvent","st","it","framesToPop","reactMinifiedRegexp","extractMessage","attachStacktrace","dt","lt","isUnhandledRejection","VW","TX","fm","VZ","cO","__serialized__","synthetic","getNonErrorObjectExceptionValue","zf","feedback","SENTRY_SDK_SOURCE","packages","_flushOutcomes","ft","cachedFetchImpl","nativeFetch","zt","Du","sandbox","contentWindow","pendingBodySize","pendingCount","keepalive","fetchOptions","XHR_READYSTATE_DONE","mt","UNKNOWN_FUNCTION","createFrame","func","function","in_app","chromeRegex","chromeEvalRegex","vt","qt","yt","geckoREgex","geckoEvalRegex","Lt","winjsRegex","opera10Regex","Tt","opera11Regex","Et","pE","extractSafariExtensionDetails","isSafariExtension","Bt","onunhandledrejection","_installFunc","globalHandlerLog","installFunc","_installGlobalOnErrorHandler","Ut","line","column","__sentry_own_request__","Ft","_eventFromIncompleteOnError","_enhanceEventWithInitialFrame","eventFromUnknownInput","addMechanismAndCapture","_installGlobalOnUnhandledRejectionHandler","detail","_eventFromRejectionWithPrimitive","HD","l4","ev0sf","colno","lineno","getHubAndOptions","DEFAULT_EVENT_TARGET","requestAnimationFrame","fill","_wrapTimeFunction","_wrapRAF","_wrapXHR","originalSend","xmlHttpRequestProps","wrapOptions","_wrapEventTarget","originalRemoveEventListener","Zt","$t","MAX_ALLOWED_STRING_LENGTH","dom","history","sentry","maxStringLength","en","keyAttrs","htmlTreeAsString","addSentryBreadcrumb","_consoleBreadcrumb","handlerData","breadcrumb","_xhrBreadcrumb","xU","status_code","_fetchBreadcrumb","fetchData","_historyBreadcrumb","to","parsedFrom","cn","applyAggregateErrorsToEvent","referrer","Referer","currentEvent","bn","ln","_previousEvent","_isSameStacktrace","Mn","frameA","_isSameFingerprint","_getExceptionFromEvent","_getFramesFromEvent","__SENTRY_RELEASE__","SENTRY_RELEASE","autoSessionTracking","clientClass","initAndBind","startSessionOnHub","script","dsnLike","dialogOptions","encodedOptions","injectionPoint","removeTrailingSlash","Wn","Nn","In","Dn","isShadowRoot","shadowRoot","isNativeShadowDom","stringifyStylesheet","rules","cssRules","cssText","fixBrowserCompatibilityIssuesInCSS","stringifyRule","rule","importStringified","layerName","statement","supportsText","media","escapeImportStatement","selectorText","NodeType","Mirror","idNodeMap","nodeMetaMap","getId","getMeta","getNode","getIds","removeNodeFromMap","hasNode","shouldMaskInput","maskInputOptions","tagName","maskInputValue","isMasked","maskInputFn","repeat","ORIGINAL_ATTRIBUTE_NAME","getInputType","getInputValue","_id","tagNameRegex","IGNORED_NODE","genId","canvasService","canvasCtx","URL_IN_CSS_REF","URL_PROTOCOL_MATCH","URL_WWW_MATCH","DATA_URI","absoluteToStylesheet","nr","SRCSET_NOT_SPACES","SRCSET_COMMAS_OR_SPACES","absoluteToDoc","getHref","transformAttribute","collectCharacters","ar","inParens","descriptorsStr","ur","ignoreAttribute","distanceToMatch","nodeType","ELEMENT_NODE","parentNode","createMatchPredicate","className","needMaskingText","unmaskDistance","maskDistance","lowerIfExists","maybeAttr","serializeNodeWithId","mirror","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","skipChild","inlineStylesheet","maskAttributeFn","maskTextFn","slimDOMOptions","dataURLOptions","inlineImages","recordCanvas","onSerialize","onIframeLoad","iframeLoadTimeout","onStylesheetLoad","stylesheetLoadTimeout","keepIframeSrcFn","newlyAddedElement","preserveWhiteSpace","DOCUMENT_NODE","compatMode","DOCUMENT_TYPE_NODE","publicId","systemId","rootId","HTMLFormElement","Un","Qn","styleSheets","textContent","Pn","sheet","Gn","Hn","checked","Mr","Fn","selected","select","__context","canvas","getImageData","Vn","Uint32Array","toDataURL","quality","blankCanvas","crossOrigin","image","naturalWidth","recordInlineImage","scrollLeft","scrollTop","getBoundingClientRect","class","rr_width","rr_height","contentDocument","customElements","isCustomElement","isSVG","ownerSVGElement","needBlock","isCustom","TEXT_NODE","nextSibling","previousSibling","textarea","isStyle","CDATA_SECTION_NODE","COMMENT_NODE","sn","comment","Comment","Element","headFavicon","headMetaDescKeywords","headMetaSocial","headMetaRobots","headMetaHttpEquiv","headMetaAuthorship","headMetaVerification","_serializedNode","recordChild","Bn","serializedNode","Document","headWhitespace","zr","serializedChildNode","iframeEl","fired","onceIframeLoaded","styleSheetLoaded","onceStylesheetLoaded","DEPARTED_MIRROR_ACCESS_WARNING","_mirror","leading","previous","trailing","hookSetter","win","wrapped","__rrweb_original__","Proxy","nowTimestamp","getWindowScroll","documentElement","parentElement","getWindowHeight","innerHeight","getWindowWidth","innerWidth","isBlocked","hr","unblockDistance","isIgnored","isAncestorRemoved","Cn","Sr","legacy_isTouchEvent","isSerializedIframe","isSerializedStylesheet","hasShadowRoot","StyleSheetMirror","styleIDMap","idStyleMap","getStyle","getShadowHost","getRootNode","Node","DOCUMENT_FRAGMENT_NODE","shadowHost","inDom","ownerDocument","Ir","rootShadowHost","EventType2","IncrementalSource","IncrementalSource2","MouseInteractions","MouseInteractions2","PointerTypes","PointerTypes2","CanvasContext","CanvasContext2","isNodeInLinkedList","DoubleLinkedList","tail","addNode","Fr","__ln","removeNode","moveKey","MutationBuffer","frozen","locked","texts","removes","mapRemoves","movedMap","addedSet","movedSet","droppedSet","processMutations","Xr","ns","nextId","Dr","Tr","iframeManager","addIframe","Nr","stylesheetManager","trackLinkElement","Er","shadowDomManager","addShadowRoot","attachIframe","observeAttachShadow","attachLinkElement","adds","parentId","addedIds","Gr","pushAdd","tailNode","unhandledNode","addList","styleDiff","_unchangedStyles","mutationCb","processMutation","Rr","unattachedDoc","Lr","attributeName","old","getPropertyValue","getPropertyPriority","newPriority","deepDelete","Ur","isShadow","genAdds","processedNodeManager","inOtherBuffer","canvasManager","unfreeze","isFrozen","lock","unlock","addsSet","isParentRemoved","Kr","_isParentRemoved","isAncestorInSet","Qr","_isAncestorInSet","errorHandler","callbackWrapper","Zr","mutationBuffers","getEventTarget","composedPath","initMutationObserver","Hr","mutationBuffer","MutationObserver","Zone","__symbol__","mutationObserverCtor","onMutation","attributeOldValue","characterData","characterDataOldValue","childList","subtree","initScrollObserver","scrollCb","sampling","ro","defaultView","qr","scroll","wrapEventWithUserTriggeredFlag","userTriggered","INPUT_TAGS","lastInputValueMap","getNestedCSSRulePositions","childRule","hasNestedCSSRule","parentRule","parentStyleSheet","getIdAndStyleId","ownerNode","styleId","initAdoptedStyleSheetObserver","hostId","ShadowRoot","initObservers","mousemoveCb","mouseInteractionCb","viewportResizeCb","inputCb","mediaInteractionCb","styleSheetRuleCb","styleDeclarationCb","canvasMutationCb","fontCb","selectionCb","customElementCb","hooks","mousemove","mouseInteraction","viewportResize","mediaInteaction","styleSheetRule","styleDeclaration","canvasMutation","font","selection","customElement","mergeHooks","oo","mousemoveCallback","positions","timeBaseline","kr","timeOffset","wrappedCb","endsWith","disableMap","Yr","Touch","Pr","MouseDown","thisEventKey","MouseUp","Pen","currentPointerType","Click","PointerEvent","TouchStart","TouchEnd","io","Wr","wr","lastH","lastW","ignoreClass","ignoreSelector","userTriggeredOnInput","isTrusted","isChecked","cbWithDedup","querySelectorAll","Xn","lastInputValue","HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement","currentTime","volume","playbackRate","CSSStyleSheet","insertRule","styleMirror","deleteRule","replaceSync","Mo","supportedNestedCSSRuleTypes","unmodifiedFunctions","po","ignoreCSSAttributes","CSSStyleDeclaration","setProperty","priority","removeProperty","collectFonts","FontFace","fontMap","family","descriptors","fontSource","yr","fonts","initFontObserver","getSelection","isCollapsed","collapsed","rangeCount","getRangeAt","startContainer","startOffset","endContainer","endOffset","ranges","updateSelection","define","plugins","pluginHandlers","mutationObserver","mousemoveHandler","mouseInteractionHandler","scrollHandler","viewportResizeHandler","inputHandler","mediaInteractionHandler","styleSheetObserver","adoptedStyleSheetObserver","styleDeclarationObserver","fontObserver","selectionObserver","customElementObserver","canMonkeyPatchNestedCSSRule","CrossOriginIframeMirror","generateIdFn","iframeIdToRemoteIdMap","iframeRemoteIdToIdMap","getIdToRemoteIdMap","getRemoteIdToIdMap","idToRemoteIdMap","remoteIdToIdMap","getRemoteId","getRemoteIds","IframeManager","crossOriginIframeMap","crossOriginIframeMirror","fo","$n","crossOriginIframeRootIdMap","wrappedEmit","recordCrossOriginIframes","crossOriginIframeStyleMirror","addLoadListener","loadListener","isAttachIframe","adoptStyleSheets","adoptedStyleSheets","handleMessage","crossOriginMessageEvent","transformCrossOriginEvent","isCheckout","Cr","FullSnapshot","replaceIdOnNode","patchRootIdOnNode","Meta","Load","DomContentLoaded","Plugin","Custom","replaceIds","IncrementalSnapshot","Br","Drag","TouchMove","MouseMove","ViewportResize","MediaInteraction","MouseInteraction","Scroll","CanvasMutation","Input","StyleSheetRule","StyleDeclaration","replaceStyleIds","Font","Selection","AdoptedStyleSheet","styles","ShadowDomManager","shadowDoms","restoreHandlers","bypassOptions","patchAttachShadow","go","canvasVarMap","saveWebGLVar","Wo","_o","contextMap","serializeArg","Float32Array","rr_type","HTMLImageElement","HTMLCanvasElement","ImageData","serializeArgs","isInstanceOfWebGLObject","initCanvasContextObserver","contextType","preserveDrawingBuffer","contextAttributes","patchGLPrototype","getOwnPropertyNames","setter","WorkerFactory","Blob","createObjectURL","Worker","CanvasManager","pendingCanvasMutations","resetObservers","rafStamps","latestId","invokeId","initCanvasMutationObserver","initCanvasFPSObserver","wo","Ro","snapshotInProgressMap","commands","lastSnapshotTime","matchedCanvas","getContextAttributes","createImageBitmap","throw","step","rafId","canvasContextReset","cancelAnimationFrame","startRAFTimestamping","startPendingCanvasMutationFlusher","CanvasRenderingContext2D","WebGL2RenderingContext","canvas2DReset","canvasWebGL1and2Reset","flushPendingCanvasMutations","flushPendingCanvasMutationFor","getOwnPropertySymbols","propertyIsEnumerable","StylesheetManager","trackedLinkElements","xr","adoptedStyleSheetCb","trackStylesheetInLinkElement","styleIds","adoptedStyleSheetData","ProcessedNodeManager","nodeMap","loop","periodicallyClear","destroy","wrapEvent","vr","takeFullSnapshot","recording","jn","checkoutEveryNms","checkoutEveryNth","maskAllInputs","packFn","mousemoveWait","recordAfter","registerErrorHandler","passEmitsToParent","tel","week","radio","checkbox","_maskInputOptions","_slimDOMOptions","NodeList","DOMTokenList","eventProcessor","no","lastFullSnapshotEvent","incrementalSnapshotCount","Eo","No","ko","zo","getMirror","plugin","nodeMirror","To","Oo","slimDOM","initialOffset","bo","unregisterErrorHandler","Po","Yo","replay","throttledAddEvent","Fo","closest","addCustomEvent","Do","freezePage","Uo","slowClickConfig","_addBreadcrumbEvent","_lastMutation","_lastScroll","_clicks","_timeout","_threshold","threshold","_scollTimeout","scrollTimeout","_replay","_ignoreSelector","addListeners","_handleMultiClick","obs","_teardown","cleanupWindowOpen","removeListeners","_checkClickTimeout","handleClick","nodeId","clickBreadcrumb","clickCount","_scheduleCheckClicks","_getClicks","_checkClicks","mutationAfter","scrollAfter","timedOutClicks","_generateBreadcrumbs","route","timeAfterClickMs","endReason","metric","SLOW_CLICK_TAGS","nowInSeconds","Go","Ko","ATTRIBUTES_TO_RECORD","Qo","Jo","normalizedKey","Zo","Bo","NAVIGATION_ENTRY_KEYS","isNavigationEntryEqual","$o","ti","ni","oi","ii","_totalSize","hasCheckout","hasEvents","addEvent","getEarliestTimestamp","si","_worker","ensureReady","_ensureReadyPromise","success","logInfo","_getAndIncrementId","ai","_earliestTimestamp","_sendEventToWorker","_finishRequest","_fallback","_compression","_used","_ensureWorkerIsLoadedPromise","_ensureWorkerIsLoaded","ensureWorkerIsLoaded","_switchToCompressionWorker","addEventPromises","ui","di","li","lastActivity","segmentId","previousSessionId","bi","sessionSampleRate","allowBuffering","stickySession","saveSession","hi","initialTime","expiry","targetTime","Mi","maxReplayDuration","sessionIdleExpire","fi","sessionOptions","traceInternals","logInfoNextTick","Oi","Ai","mi","_addEvent","eventBuffer","recordingMode","beforeAddRecordingEvent","isPaused","timeouts","sessionIdlePause","initialTimestamp","timestampInMs","gi","yi","traceIds","replayContext","handleTransactionEvent","errorIds","replayId","sendBufferedReplayOrFlush","handleErrorEvent","vi","qi","_experiments","createPerformanceSpans","Wi","wi","Li","Ri","Si","ki","Ti","Ni","Ei","xi","ALLOWED_PRIMITIVES","_evaluateJsonPos","Ci","_handleObj","_handleArr","_handleColon","_handleComma","_handleObjClose","_handleArrClose","_handleQuote","_isEscaped","Bi","Ii","Pi","URLSearchParams","Yi","ji","Fi","Xi","_meta","warnings","Ui","bodySize","Hi","filteredHeaders","_serializeFormData","formData","Gi","baseURI","_getFetchRequestArgBody","getAllHeaders","allowedHeaders","allHeaders","getHeadersFromOptions","Ji","_LAST_BREADCRUMB","hasHooks","createMemoryEntry","memoryEntry","jsHeapSizeLimit","totalJSHeapSize","usedJSHeapSize","memory","ENTRY_TYPES","entryType","initiatorType","responseEnd","startTime","decodedBodySize","encodedBodySize","responseStatus","transferSize","paint","navigation","domComplete","domContentLoadedEventStart","domContentLoadedEventEnd","domInteractive","loadEventStart","loadEventEnd","redirectCount","startTimeOrNavigationActivation","createPerformanceEntry","getAbsoluteTime","Z1","timeOrigin","is","checkAndHandleExpiredSession","hadFirstEvent","addEventSync","errorSampleRate","useCompressionOption","blockAllMedia","useCompression","networkDetailHasUrls","networkCaptureBodies","networkRequestHasHeaders","networkResponseHasHeaders","addSettingsEvent","ss","as","replayData","retryConfig","recordingData","eventContext","payloadWithSequence","segment_id","urls","replay_start_timestamp","error_ids","trace_ids","replay_id","replay_type","eventHint","preparedEvent","replayEvent","createEventEnvelopeHeaders","_retryCount","captureExceptions","cs","ps","recordingOptions","ReplayContainer","performanceEvents","_lastActivity","_isPaused","_hasInitializedCoreListeners","_context","initialUrl","_recordingOptions","_debouncedFlush","maxWait","cancelTimers","callbackReturnValue","maxTimerId","debounced","_flush","flushMinDelay","_throttledAddEvent","durationSeconds","_cleanup","isThrottled","slowClickTimeout","slowClickIgnoreSelectors","clickDetector","initializeSampling","_initializeSessionForSampling","_initializeRecording","_handleException","startBuffering","startRecording","_stopRecording","stopRecording","forceFlush","_removeListeners","force","clearSession","pause","resume","_checkSession","continueRecording","flushImmediate","_updateUserActivity","_updateSessionActivity","_maybeSaveSession","addUpdate","triggerUserActivity","updateUserActivity","conditionalFlush","cancelFlush","getSessionId","setInitialState","pathname","_clearContext","getCurrentRoute","lastTransaction","_addListeners","shouldRefreshSession","_refreshSession","$i","newBreadcrumb","isTruncated","Fv","addBreadcrumbEvent","isClick","getClickTargetNode","networkDetailAllowUrls","networkDetailDenyUrls","networkRequestHeaders","networkResponseHeaders","parseContentLengthHeader","getBodySize","enrichXhrBreadcrumb","request_body_size","response_body_size","getAllowedHeaders","requestBodySize","responseBodySize","addNetworkBreadcrumb","Ki","enrichFetchBreadcrumb","urlMatches","fetchArgs","Qi","_getRequestInfo","buildSkippedNetworkRequestOrResponse","captureDetails","bodyText","handleNetworkBreadcrumbs","includeAfterSendEventHandling","__rrweb__","afterSendHandler","es","addGlobalListeners","_performanceObserver","PerformanceObserver","currentList","newList","existingLcpEntries","newEntries","ei","newNavigationEntries","newLcpEntry","performanceObserver","buffered","__init","_doChangeToForegroundTasks","_doChangeToBackgroundTasks","__init2","__init3","__init4","isContentEditable","handleKeyboardEvent","_createCustomBreadcrumb","_triggerFullSnapshot","_addPerformanceEntries","rs","_updateInitialTimestampFromEventBuffer","_popEventContext","_runFlush","__init5","minReplayDuration","tooShort","_flushLock","__init6","mutationLimit","mutationBreadcrumbLimit","getOption","selectors","defaultSelectors","deprecatedClassOption","deprecatedSelectorOption","allSelectors","ds","KV","MEDIA_SELECTORS","DEFAULT_NETWORK_HEADERS","flushMaxDelay","maskAttributes","unmask","unblock","ignore","maskFn","us","privacyOptions","maskAttribute","_initialOptions","ls","hs","_setup","getReplayId","replaysSessionSampleRate","finalOptions","replaysOnErrorSampleRate","_getMergedNetworkHeaders","bs","zs","Os","reportAllChanges","prevValue","__WEB_VITALS_POLYFILL__","timing","navigationEntry","As","activationStart","gs","navigationType","prerendering","rating","_s","supportedEntryTypes","ys","firstHiddenTime","vs","onHidden","reportedMetricIDs","ws","Ls","msToSec","getBrowserPerformanceAPI","_lcpEntry","_clsEntry","_performanceCursor","Ss","mark","report","onFID","Rs","handleEntries","hadRecentInput","sessionValue","sessionEntries","Ws","clsCallback","lcpCallback","_addPerformanceNavigationTiming","eventEnd","_startChild","Ds","traceFetch","traceXHR","enableHTTPTimings","tracingOrigins","tracePropagationTargets","shouldCreateSpanForRequest","shouldAttachHeaders","shouldCreateSpan","__span","shouldCreateSpanResult","requestSpan","getDynamicSamplingContextFromClient","IQ","V9","newHeaders","baggage","newBaggageHeaders","addHTTPTimings","__sentry_xhr_span_id__","setHeaderOnXhr","resourceTiming","timingSpanData","js","redirectStart","fetchStart","domainLookupStart","domainLookupEnd","connectStart","secureConnectionStart","connectEnd","requestStart","responseStart","spanData","entryTypes","sentryTraceHeader","sentryBaggageHeader","DEFAULT_BROWSER_TRACING_OPTIONS","markBackgroundTransactions","routingInstrumentation","customStartTransaction","startTransactionOnPageLoad","startTransactionOnLocationChange","startingUrl","enableLongTask","_hasSetTracePropagationTargets","Xs","_collectWebVitals","observe","enableInteractions","_getCurrentHub","instrumentRouting","_createRouteTransaction","onStartRouteTransaction","hidden","statusType","_registerInteractionListener","beforeNavigate","Hs","traceparentData","KA","sentryTrace","finalContext","_latestRouteName","_latestRouteSource","idleTransaction","performanceEntries","_addRequest","_addNavigationSpans","responseStartTimestamp","requestStartTimestamp","_addMeasureSpans","resourceName","_addResourceSpans","effectiveType","deviceMemory","hardwareConcurrency","_trackNavigator","fid","measurementName","ks","Ts","_tagMetricInfo","addPerformanceEntries","inflightInteractionTransaction","qT","Vs","Gs","MAX_DELAY","promisifyRequest","Qs","getAllKeys","createIndexedDbStore","V$","Zs","maxQueueSize","f4","createStore","$s","flushTimer","unref","flushIn","retryDelay","shouldStore","flushWithBackOff","flushAtStartup","MS_TO_NS","THREAD_ID_STRING","THREAD_NAME","OS_PLATFORM","OS_PLATFORM_VERSION","OS_ARCH","OS_BROWSER","OS_MODEL","OS_LOCALE","userAgentData","da","getHighEntropyValues","fullVersionList","ba","ha","samples","processedProfile","profile_id","stacks","thread_metadata","na","ra","stackId","EMPTY_STACK_ID","STACK_ID","elapsed_since_start_ns","stack_id","thread_id","frameId","stackTop","platform","build_number","device","locale","manufacturer","architecture","is_emulator","transactions","active_thread_id","relative_start_ns","relative_end_ns","za","PROFILING_CONSTRUCTOR_FAILED","Aa","Profiler","profilesSampleRate","profiler","stopProfilerSpan","maxDurationTimeoutID","PROFILE_MAP","addProfileToMap","originalFinish","wrapTransactionWithProfiling","profilesToAddToEnvelope","addProfilesToEnvelope","windowIntegrations","Sentry","INTEGRATIONS","isGlobalObj","CaptureConsole","Debug","ExtraErrorData","Offline","ReportingObserver","RewriteFrames","SessionTiming","CONSOLE_LEVELS","originalConsole","wrappedLevels","makeLogger","enable","disable","objectToString","isBuiltin","wat","DEFAULT_MAX_STRING_LENGTH","_htmlElementAsString","keyAttrPairs","classes","serializeEventTarget","nextStr","currentElem","getOwnProperties","extractedProps","levels","_levels","originalConsoleMethod","debugger","defaultFunctionName","depth","maxProperties","memo","__sentry_skip_normalization__","newObj","numAdded","unmemoize","enhanceEventWithErrorData","_extractErrorData","extraErrorInfo","maxStoredEvents","offlineEventStore","_sendEvents","_cacheEvent","_enforceMaxEvents","iterate","_purgeEvents","_purgeEvent","plainBody","splitPathRe","resolvedPath","resolvedAbsolute","up","_prefix","iteratee","_iteratee","samePartsLength","outputParts","_processExceptionsEvent","_processStacktrace","_startTime","_getTransaction","exceptionFromErrorImplementation","maxValueLimit","exceptions","aggregateExceptionsFromError","prevExceptions","exceptionId","applyExceptionGroupFieldsForParentException","applyExceptionGroupFieldsForChildException","newExceptions","newException","newExceptionId","childError","is_exception_group","exception_id","parent_id","EN","_3","bU","jm","lq","baggageHeader","baggageObject","objectKey","baggageHeaderToObject","Rf","querySelector","discarded_events","DSN_REGEX","pass","dsnFromComponents","__SENTRY_BROWSER_BUNDLE__","BO","gv","zQ","stringifiedPayload","merged","subarray","items","dropUndefinedKeys","content_type","attachment_type","sessions","client_report","user_report","replay_event","replay_recording","check_in","sdkInfo","BAGGAGE_HEADER_NAME","RU","DEFAULT_RETRY_AFTER","B1","MAX_BAGGAGE_STRING_LENGTH","SENTRY_BAGGAGE_KEY_PREFIX","SENTRY_BAGGAGE_KEY_PREFIX_REGEX","SENTRY_XHR_DATA_KEY","SentryError","SyncPromise","TRACEPARENT_REGEXP","_browserPerformanceTimeOriginMode","addContextToFrame","EG","Db","oq","addItemToEnvelope","xp","addOrUpdateIntegration","addRequestDataToEvent","addRequestDataToTransaction","arrayify","lE","baggageHeaderToDynamicSamplingContext","basename","browserPerformanceTimeOrigin","checkOrSetAlreadyCaught","Cf","convertToPlainObject","Sh","createClientReportEnvelope","createEnvelope","createStackParser","dateTimestampInSeconds","dirname","disabledUntil","dsnFromString","dsnToString","dynamicRequire","l$","dynamicSamplingContextToSentryBaggageHeader","envelopeContainsItemType","envelopeItemTypeToDataCategory","escapeStringForRegex","extractExceptionKeysForMessage","extractPathForTransaction","extractRequestData","filenameIsInApp","generateSentryTraceHeader","getDomElement","getFunctionName","$P","getGlobalObject","getGlobalSingleton","getLocationHref","getNumberOfUrlSegments","$A","getOriginalFunction","getSDKSource","getSanitizedUrlString","tF","getSdkMetadataForEnvelopeHeader","instrumentDOM","W4","instrumentXHR","isAbsolute","isBrowserBundle","isDOMError","isDOMException","isElement","kK","isError","isEvent","isInstanceOf","isMatchingPattern","zC","isNativeFetch","isNodeEnv","isPlainObject","isPrimitive","isRateLimited","isRegExp","Kj","isString","isSyntheticEvent","Cy","isThenable","isVueViewModel","y1","loadModule","$y","makeDsn","makeFifoCache","makePromiseBuffer","$Q","memoBuilder","nodeStackLineParser","Ep","normalize","normalizePath","normalizeToSize","Qy","objectify","mz","originalConsoleMethods","LD","parseEnvelope","parseFetchArgs","Vh","parseRetryAfterHeader","JY","parseSemver","J4","parseStackFrames","parseUrl","rejectedSyncPromise","relative","resetInstrumentationHandlers","t4","resolvedSyncPromise","safeJoin","nK","serializeEnvelope","severityFromString","severityLevelFromString","VT","snipLine","JM","stackParserFromStackParserOptions","Sq","stringMatchesSomePattern","stripSentryFramesAndReverse","UV","stripUrlQueryAndFragment","supportsDOMError","zO","supportsDOMException","fL","supportsErrorEvent","S$","supportsFetch","Ak","supportsHistory","supportsNativeFetch","t$","supportsReferrerPolicy","hv","supportsReportingObserver","zb","timestampInSeconds","timestampWithMs","_I","tracingContextFromHeaders","$G","updateRateLimits","WG","urlEncode","usingPerformanceAPI","sV","uuid4","validSeverityLevels","Tx","walk","_p","normalizedPath","DEFAULT_INCLUDES","ip","DEFAULT_REQUEST_INCLUDES","DEFAULT_USER_INCLUDES","baseUrl","customRoute","originalUrl","socket","encrypted","requestData","extractedUser","remoteAddress","extractQueryParams","setNestedKey","defaultIntegrationInstance","userIntegrations","forcedOptions","addOrUpdateIntegrationInArray","userIntegrationsFunc","allowExclusionByUser","evictionOrder","instrumented","triggerHandlers","onpopstate","lastHref","_oldOnErrorHandler","__SENTRY_LOADER__","_oldOnUnhandledRejectionHandler","instrument","hasProp","getUrlFromResource","request_headers","xhrInfo","onreadystatechangeHandler","readyStateArgs","sentryXhrData","debounceDuration","debounceTimerID","lastCapturedEvent","makeDOMEventHandler","__sentry_instrumentation_handlers__","refCount","handlerForType","originalAddEventListener","__isVue","_isVue","wrappedFuncs","getRandomByte","firstException","buildmetadata","major","minor","prerelease","__sentry_captured__","functionName","methodStart","typeName","require","mod","cwd","hmd","__sentry_override_normalization_depth__","__sentry_original__","_dropUndefinedKeys","memoizationMap","inputValue","objectified","limits","updatedRateLimits","localStack","newLine","pattern","requireExactStringMatch","testString","patterns","ErrorEvent","DOMError","PENDING","RESOLVED","REJECTED","_handlers","onfulfilled","onrejected","_executeHandlers","isRejected","onfinally","_setResult","cachedHandlers","dateTimestampSource","nowSeconds","platformPerformance","timestampSource","navigationStart","sampledString","pushState","replaceState","GLOBAL","Big","MAX_DP","NAME","INVALID","INVALID_DP","INVALID_RM","DIV_BY_ZERO","UNDEFINED","NUMERIC","sd","rm","more","xc","RM","doExponential","isNonzero","isneg","yc","div","dp","DP","bl","bz","al","rl","qc","gte","lte","minus","xlty","plus","ygtx","times","prec","sqrt","half","toExponential","mul","toFixed","NE","PE","strict","toPrecision","_Big_","nl","exports","TrackedAsyncData","initializer","waiter","buildWaiter","State","tracked","_TrackedAsyncData","_classPrivateFieldInitSpec","_classPrivateFieldGet","_classPrivateFieldSet","beginAsync","endAsync","for","since","available","until","isPending","isResolved","dependentKeyCompat","toPrimitive","vendor","matchesSelector","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","selector","nodes","ios","MSStream","ClickOutsideModifier","Modifier","_defineProperty","_destroy","registerDestructor","cleanup","exceptSelector","didSetup","_init","_createHandler","cancelOutsideListenerSetup","_addClickOutsideListener","_removeClickOutsideListener","isRemoved","isInside","modifier","CssTransitionModifier","owner","finishedTransitionIn","guardedRun","transitionOut","positional","named","setupProperties","installed","getElementToClone","nextElementSibling","transitionIn","transitionName","didTransitionIn","didTransitionOut","parentSelector","enterClass","enterActiveClass","enterToClass","leaveClass","leaveActiveClass","leaveToClass","addClone","cloneNode","insertBefore","removeClone","isConnected","transition","activeClassName","toClassName","addClass","removeClass","transitionDuration","transitionDelay","animationDuration","animationDelay","animationIterationCount","getComputedStyle","later","gen","_initializerDefineProperty","_typeof","_applyDecoratedDescriptor","CaptureEventsModifier","_pos","triggerValidation","uniqueId","HeadlessFormControlCheckboxComponent","setComponentTemplate","createTemplateFactory","handleInput","setValue","HeadlessFormControlInputComponent","HeadlessFormControlRadioGroupLabelComponent","moduleName","isStrictMode","HeadlessFormLabelComponent","HeadlessFormControlRadioInputComponent","HeadlessFormControlRadioComponent","HeadlessFormControlRadioGroupComponent","HeadlessFormControlSelectOptionComponent","isSelected","HeadlessFormControlSelectComponent","HeadlessFormControlTextareaComponent","HeadlessFormErrorsComponent","HeadlessFormFieldComponent","LabelComponent","InputComponent","CheckboxComponent","ErrorsComponent","SelectComponent","TextareaComponent","RadioGroupComponent","registerField","willDestroy","unregisterField","hasErrors","valueAsString","valueAsStringOrNumber","valueAsBoolean","FieldData","fieldRegistration","HeadlessFormComponent","FieldComponent","elementModifier","formElement","TrackedObject","effectiveData","dataMode","internalData","ownKeys","deleteProperty","validateOn","revalidateOn","fieldValidationEvent","fieldRevalidationEvent","hasValidationErrors","validationState","nativeValidation","ignoreNativeValidation","validateNative","customFormValidation","customFieldValidations","fieldValidationResult","fieldErrors","existingFieldErrors","_validate","form","checkValidity","HTMLButtonElement","HTMLFieldSetElement","HTMLObjectElement","HTMLOutputElement","validity","valid","validationMessage","visibleErrors","showErrorsFor","showAllValidations","validationEnabled","onSubmit","onInvalid","submissionState","onReset","handleFieldValidation","handleFieldRevalidation","cached","descriptor","decorators","desc","decorator","Bq","zA","SHIFT_KEY_MAP","MAC_ALT_KEY_MAP","å","ç","ƒ","µ","ø","π","œ","ß","Ω","ª","º","æ","MAC_SHIFT_ALT_KEY_MAP","Å","ı","Î","Ï","Ó","ˆ","Ô","Ò","Â","Ø","Œ","Í","ˇ","Á","ﬁ","ﬂ","Ú","Æ","validModifiers","ifKey","helper","keyCombo","KeyboardEvent","isKey","listenerName","_class2","_descriptor","_class","Helper","compute","keyboardActivated","keyboardPriority","keyboardHandlers","keyboard","unregister","inject","getMouseName","buttonCode","keyResponder","createClass","DecoratedClass","responder","keyboardHandlerNames","propertyName","propertyValue","_emberKeyboardOnKeyDecoratorData","listenerNames","DEFAULT_EVENT_NAME","onKey","onKeyClassic","parentKeyboardHandlerNames","validKeys","formattedListener","keysString","mouseDown","mouseUp","touchEnd","touchStart","triggerKeyEvent","KeyboardListener","createMatchingKeyboardEvent","triggerKeyDown","triggerKeyPress","triggerKeyUp","getCode","getKeyCode","QG","W0","yR","keyDown","keyPress","keyUp","ONLY_WHEN_FOCUSED_TAG_NAMES","onlyWhenFocused","onFocus","onFocusOut","removeEventListeners","addEventListeners","activatedParamValue","isFocused","keyboardFirstResponder","canHandleKeyboardEvent","ekEvent","modifier$1","triggerResponderListener","responderListenerName","KeyboardService","Service","activeResponders","registeredResponders","sortedResponders","propName","firstResponders","normalResponders","FastBoot","emberKeyboardConfig","getOwner","resolveRegistration","emberKeyboard","disableOnInputFields","_disableOnInput","_listeners","_respond","isImmediatePropagationStopped","isPropagationStopped","stopImmediatePropagation","stopPropagation","previousPriorityLevel","currentPriorityLevel","ALL_SYMBOL","listenerOrListenerName","getPlatform","keyOrCode","keyboardEvent","mouseEvent","MouseEvent","keyboardListener","onlyModifiers","ALL_MODIFIERS_EXCEPT_CMD","names","ALT_REGEX","SHIFT_REGEX","CTRL_REGEX","META_REGEX","CMD_REGEX","part","keyArrayOrString","keyArray","runInDebug","osName","ClassBasedModifierManager","capabilities","createModifier","modifierClass","installModifier","createdState","installedState","updateModifier","destroyModifier","ClassBasedModifier","setOwner","setModifierManager","Manager","MANAGER","teardown","computeFn","allowEmpty","globalAllowEmpty","isBlank","BaseHelper","moment","disableInterval","__config__","supportsGlobalAllowEmpty","localeOrTimeZoneChanged","recompute","clearTimer","intervalTimer","morphMoment","timeZone","momentService","tz","_super","isAfter","precision","comparisonArgs","isBefore","isBetween","inclusivity","_params","isSameOrAfter","isSameOrBefore","isSame","momentAdd","additionArgs","typeOf","momentCalendar","formatHash","referenceTime","formats","mergedFormats","calendar","momentDiff","float","dateA","dateB","momentDuration","momentOrMomentTimezone","humanize","momentFormat","defaultFormatDidChange","formatArgs","defaultFormat","format","momentFromNow","hideAffix","fromNow","momentFrom","momentSubtract","subtractionArgs","momentToDate","hidePrefix","momentToNow","hide","toNow","momentTo","unix","unixTimeStamp","utc","utcTime","Evented","_timeZone","localeOptions","outputFormat","computed","factoryFor","readOnly","propertyKey","setLocale","changeLocale","updateLocale","setProperties","trigger","setTimeZone","changeTimeZone","isMoment","momentObj","findMoment","PikadayInputComponent","useUTC","yearRange","yearArray","i18n","previousMonth","nextMonth","months","weekdays","weekdaysShort","firstDay","onClose","isDestroying","onSelect","onDraw","didChange","onSelection","PikadayInputlessComponent","setContainer","eager","maybeFindMoment","importSync","Pikaday","hasMoment","hasEventListeners","sto","removeEvent","hasClass","isDate","isWeekend","day","getDay","isLeapYear","getDaysInMonth","setToStartOfDay","setHours","compareDates","fireEvent","ev","initEvent","createEventObject","adjustCalendar","defaults","ariaLabel","reposition","defaultDate","setDefaultDate","firstWeekOfYearMinDays","formatStrict","minDate","maxDate","showWeekNumber","pickWholeWeek","minYear","maxYear","minMonth","maxMonth","startRange","endRange","isRTL","yearSuffix","showMonthAfterYear","showDaysInNextAndPreviousMonths","enableSelectionDaysInNextAndPreviousMonths","numberOfMonths","mainCalendar","blurFieldOnSelect","onOpen","keyboardInput","renderDayName","abbr","renderDay","ariaSelected","isDisabled","isToday","hasEvent","isInRange","isStartRange","isEndRange","renderRow","days","isRowSelected","renderTitle","refYear","randId","monthHtml","yearHtml","isMinYear","isMaxYear","html","_onMouseDown","prevMonth","setDate","blur","_onChange","gotoMonth","gotoYear","_onKeyChange","keyCode","adjustDate","_parseFieldValue","_onInputChange","firedBy","show","_onInputFocus","_onInputClick","_onInputBlur","pEl","activeElement","_onClick","onchange","defDate","gotoDate","disableWeekends","disableDayFn","nom","setMinDate","setMaxDate","toDateString","getMoment","setMoment","preventOnSelect","draw","newCalendar","calendars","firstVisibleDate","lastVisibleDate","visibleDate","setMonth","adjustCalendars","newDay","difference","gotoToday","setStartRange","setEndRange","_y","_m","innerHTML","adjustPosition","viewportWidth","viewportHeight","clientRect","leftAligned","bottomAligned","offsetWidth","offsetHeight","clientWidth","clientHeight","pageYOffset","pageXOffset","offsetLeft","offsetTop","offsetParent","row","yearOfPreviousMonth","yearOfNextMonth","daysInPreviousMonth","cells","isWeekSelected","dayNumber","monthNumber","yearNumber","dayConfig","isoWeek","yearDay","weekDay","dayInFirstWeek","dayShift","prevWeekDay","jan4th","daysBetween","makePikaday","PikadayModifier","getPikadayOptions","pikadayOptions","valueAltered","copyDate","syncDisabled","IsActiveHelper","trackActiveRoute","router","handleQueryParams","ReplaceWithHelper","maybeEvent","replaceWith","RootURLHelper","rootURL","RouteParams","_router","_inputParams","_transitionTo","_replaceWith","_processedParams","urlFor","transitionTo","RouteParamsHelper","TransitionToHelper","UrlForHelper","possibleQueryParams","isQueryParams","currentURL","currentRouteName","buildOptions","defaultOptions","attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","cdataTagName","cdataPositionChar","indentBy","supressEmptyNode","tagValueProcessor","attrValueProcessor","Parser","isAttribute","attrPrefixLen","isCDATA","replaceCDATAstr","replaceCDATAarr","processTextOrObjNode","indentate","tagEndChar","buildTextNode","buildEmptyTextNode","buildObjNode","buildEmptyObjNode","buildTextValNode","buildObjectNode","j2x","attrStr","cdata","jObj","rootNodeName","arrLen","Ks","char","nilChar","missingChar","nilPremitive","missingPremitive","emptyChar","emptyValue","boundryChar","objStart","arrStart","arrayEnd","charsArr","e_schema","getValue","hasValidData","attrsMap","itemSchema","arr_len","arr_i","processValue","isAppChar","x2j","convert2nimn","util","convertToJson","parentTagName","alwaysCreateTextNode","isEmptyObject","isExist","asArray","isTagNameInArrayMode","tagname","arrayMode","_cToJsonStr","convertToJsonString","nodeToJson","xmlToNodeobj","x2xmlnode","xmlData","givenOptions","validationOption","parseTrueNumberOnly","parseNodeValue","numParseOptions","leadingZeros","traversableObj","getTraversalObj","convertTonimn","j2xParser","parseToNimn","nameStartChar","nameRegexp","regexName","newOptions","isName","getAllMatches","regex","allmatches","startIndex","lastIndex","allowBooleanAttributes","readPI","getErrorObject","getLineNumberForPosition","readCommentAndCDATA","angleBracketsCount","tagFound","reachedRoot","tagStartPos","closingTag","readAttributeStr","attrStrStart","validateAttributeString","tagClosed","otg","openPos","afterAmp","validateAmpersand","doubleQuote","singleQuote","startChar","validAttrStrRegxp","attrNames","getPositionFromMatch","attrName","validateAttrName","lineNumber","addChild","xmlNode","ignoreNameSpace","parseAttributeValue","trimValues","hex","stopNodes","processTagValue","parseValue","resolveNameSpace","shouldParse","newval","attrsRegx","buildAttributesMap","attrCollection","closingIndexForOpeningTag","attrBoundary","tagExp","findClosingIndex","errMsg","closingIndex","xmlObj","currentNode","textData","closeIndex","colonIndex","childNode","shouldBuildAttributesMap","createFocusTrap","getOwnPropertyDescriptors","isTabEvent","isKeyForward","isKeyBackward","idx","valueOrHandler","getActualTarget","internalTrapStack","userOptions","trap","trapStack","returnFocusOnDeactivate","escapeDeactivates","delayInitialFocus","containers","containerGroups","tabbableGroups","nodeFocusedBeforeActivation","mostRecentlyFocusedNode","paused","delayInitialFocusTimer","configOverrideOptions","optionName","configOptionName","findContainerIndex","tabbableNodes","getNodeForOption","optionValue","getInitialFocusNode","firstTabbableGroup","firstTabbableNode","updateTabbableNodes","tabbable","tabbableOptions","focusableNodes","focusable","lastTabbableNode","nextTabbableNode","forward","nodeIdx","isTabbable","group","tryFocus","preventScroll","getReturnFocusNode","previousActiveElement","checkPointerDown","clickOutsideDeactivates","returnFocus","isFocusable","allowOutsideClick","checkFocusIn","targetContained","checkKey","isBackward","destinationNode","containerIndex","containerGroup","startOfGroupIndex","destinationGroupIndex","lastOfGroupIndex","checkClick","activeTrap","trapIndex","activateOptions","onActivate","onPostActivate","checkCanFocusTrap","finishActivation","deactivateOptions","onDeactivate","onPostDeactivate","checkCanReturnFocus","unpause","finishDeactivation","updateContainerElements","containerElements","elementsAsArray","AcroForm","AcroFormAppearance","AcroFormButton","AcroFormCheckBox","AcroFormChoiceField","AcroFormComboBox","AcroFormEditBox","AcroFormListBox","AcroFormPasswordField","AcroFormPushButton","AcroFormRadioButton","AcroFormTextField","GState","ShadingPattern","TilingPattern","jsPDF","u8","u16","Uint16Array","u32","fleb","fdeb","clim","freb","eb","fl","revfl","fd","revfd","rev","hMap","cd","mb","rvb","sv","r_1","flt","fdt","flm","flrm","fdm","fdrm","bits16","shft","slc","wbits","wbits16","hTree","t2","i0","i1","maxSym","tr","mbt","lft","cst","i2_1","i2_2","i2_3","lc","cl","cli","cln","clen","cf","wfblk","dat","wblk","final","syms","lf","df","dlt","mlb","ddt","mdb","lclt","nlc","lcdt","ndc","lcfreq","lct","mlcb","nlcc","lm","ll","dm","dl","flen","ftlen","dtlen","llm","lcts","clct","dst","deo","zlibSync","pre","post","lvl","plvl","lst","msk_1","bs1_1","bs2_1","hsh","lc_1","imod","pimod","ch_1","dif","maxn","maxd","ml","mmd","md","lin","din","mem","dopt","lv","unzlibSync","sl","noBuf","noSt","cbuf","nbuf","lbt","dbt","tbts","hLit","hcLen","tl","ldt","clt","clb","clbmsk","clm","lms","dms","mxa","sym","dsym","globalObject","consoleLog","download","saveAs","corsEnabled","_global","HTMLAnchorElement","webkitURL","revokeObjectURL","msSaveOrOpenBlob","autoBom","popup","title","HTMLElement","safari","isChromeIOS","FileReader","reader","onloadend","readAsDataURL","RGBColor","color_string","channels","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","feldspar","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslateblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","violetred","wheat","white","whitesmoke","yellow","yellowgreen","color_defs","example","toRGB","toHex","md5cycle","ff","gg","hh","add32","cmn","md51","md5blk","md5blks","hex_chr","rhex","singleToByteString","md5Bin","md5Check","lsw","rc4","lastKey","lastState","num","permissionOptions","print","PDFSecurity","permissions","userPassword","ownerPassword","fileId","protection","perm","paddedUserPassword","paddedOwnerPassword","processOwnerPassword","encryptionKey","lsbFirstWord","hexToBytes","toPDFName","strLength","PubSub","topics","topic","publish","tokens","getTopics","supported","objectNumber","Pattern","gState","matrix","coords","colors","boundingBox","xStep","yStep","cloneIndex","orientation","compressPdf","userUnit","floatPrecision","defaultPathOperation","encryptionOptions","compress","encryption","userPermissions","putOnlyUsedFonts","usedFonts","API","internal","__private__","pdfVersion","getPdfVersion","setPdfVersion","pageFormats","a2","a3","a4","a5","a6","a7","a8","a9","a10","b2","b3","b4","b5","b6","b7","b8","b9","b10","c4","c5","c6","c7","c8","c9","c10","letter","legal","ledger","tabloid","getPageFormats","getPageFormat","ApiMode","apiMode","advancedAPI","saveGraphicsState","Matrix","scaleFactor","getPageHeight","setFontSize","getFontSize","ADVANCED","compatAPI","restoreGraphicsState","COMPAT","combineFontStyleAndFontWeight","fontStyle","fontWeight","doSwitch","isAdvancedAPI","hpf","advancedApiModeTrap","roundToPrecision","parmPrecision","tmpPrecision","f2","f3","scale","transformScaleY","setPrecision","creationDate","getFileId","setFileId","convertDateToPDFDate","parmDate","tzoffset","getTimezoneOffset","tzsign","tzhour","tzmin","timeZoneString","padd2","getHours","getMinutes","getSeconds","convertPDFDateToDate","parmPDFDate","hour","minutes","setCreationDate","tmpCreationDateString","getCreationDate","currentPage","padd2Hex","hexString","offsets","contentLength","additionalObjects","pages","hasCustomDestination","outputDestination","setCustomOutputDestination","setOutputDestination","resetCustomOutputDestination","getArrayBuffer","ab","standardFonts","getStandardFonts","activeFontSize","fontSize","zoomMode","R2L","setR2L","getR2L","pageMode","setZoomMode","zoom","getZoomMode","layoutMode","setPageMode","pmode","getPageMode","setLayoutMode","layout","getLayoutMode","setDisplayMode","documentProperties","subject","author","keywords","creator","getDocumentProperty","getDocumentProperties","setDocumentProperties","setDocumentProperty","activeFontKey","pageMatrix","fontmap","fontStateStack","patternMap","gStates","gStatesMap","activeGState","pagesContext","hotfixes","renderTargets","renderTargetMap","renderTargetStack","sx","shy","shx","sy","ty","_matrix","atan2","decompose","scaleX","shear","scaleY","translate","rotate","skew","inversed","quot","aInv","bInv","cInv","dInv","applyToPoint","Point","applyToRectangle","rect","pt1","pt2","Rectangle","matrixMult","m1","m2","identityMatrix","unitMatrix","addPattern","patternKey","addShadingPattern","beginTilingPattern","beginNewRenderTarget","endTilingPattern","restore","newObject","oid","newObjectDeferred","newObjectDeferredBegin","doOutput","newAdditionalObject","objId","rootDictionaryObjId","resourceDictionaryObjId","decodeColorString","colorEncoded","floatVal","colorAsRGB","encodeColorString","ch1","ch2","ch3","ch4","letterArray","pdfColorType","rgbColor","putStream","alreadyAppliedFilters","addLength1","valueOfLength1","objectId","encryptor","processedData","keyValues","additionalKeyValues","filterAsString","processDataByFilters","reverseChain","decodeParmsArray","putPage","pageNumber","pageObjectNumber","pageContentsObjId","contentsObjId","mediaBox","bottomLeftX","bottomLeftY","topRightX","topRightY","cropBox","bleedBox","trimBox","artBox","pageContext","pageContent","putPages","pageObjectNumbers","kids","putFont","isAlreadyPutted","postScriptName","encoding","putXObject","xObject","putShadingPattern","numberSamples","funcObjectNumber","tValues","dT","aColor","bColor","putTilingPattern","deferredResourceDictionaryIds","resourcesObjectId","patternObjectId","resourcesOid","objectOid","putGState","putResourceDictionary","objectIds","fontKey","gStateKey","xObjectKey","addFontToFontDictionary","fontName","addFont","isStandardFont","pdfEscape","flags","sourceEncoding","encodingBlock","outputEncoding","newtext","isUnicode","bch","autoencode","codePages","noBOM","beginPage","_setPage","_addPage","parmFormat","parmOrientation","dimensions","setLineWidth","lineWidth","strokeColor","lineCapID","lineJoinID","_deletePage","setPage","getNumberOfPages","getFont","fontNameLowerCase","disableWarning","noFallback","normal","putInfo","putCatalog","tmpRootDictionaryObjId","pcn","putTrailer","putHeader","putXRef","buildDocument","toHexString","offsetOfXRef","getBlob","save","dataURI","pdfDocument","unescape","pdfObjectUrl","integrity","htmlForNewWindow","nW","htmlForPDFjsNewWindow","pdfJsUrl","PDFjsNewWindow","PDFViewerApplication","htmlForDataURLNewWindow","dataURLNewWindow","foo","alert","bar","hasHotfix","hotfixName","getPageInfo","pageNumberOneBased","getPageInfoByObjId","getCurrentPageInfo","addPage","insertPage","beforePage","movePage","targetPage","tmpPages","tmpPagesContext","deletePage","angle","align","charSpace","maxWidth","horizontalScale","transformationMatrix","tmp","isHex","xtra","lineHeight","lineHeightFactor","ESC","TabLen","transformTextToSpecialArray","curDa","sa","processTextByFunction","processingFunction","tmpResult","textIsOfTypeString","tmpTextIsOfTypeString","descent","baseline","splitTextToSize","textLine","mutex","PI","rotationDirection","cos","sin","activeCharSpace","setCharSpace","getCharSpace","lang","renderingMode","parmRenderingMode","stroke","usedRenderingMode","lineWidths","pageWidth","pageSize","getWidth","activeFont","wordSpacingPerLine","newY","getStringUnitWidth","doKerning","newX","prevWidth","getHorizontalCoordinate","getVerticalCoordinate","posX","posY","activeFontEncoding","wordSpacing","generatePosition","parmPosX","parmPosY","parmTransformationMatrix","lineIndex","textColor","clip","clipEvenOdd","discardPath","isValidStyle","setDefaultPathOperation","fillWithOptionalPattern","fillEvenOdd","fillStroke","fillStrokeEvenOdd","fillWithPattern","putStyle","cloneTilingPattern","patternData","patternId","clipRuleFromStyle","setGState","moveTo","lineTo","curveTo","x1","x2","y2","x3","y3","scalex","scaley","leg","x4","y4","triangle","roundedRect","rx","ry","MyArc","SQRT2","ellipse","lx","ly","circle","setFont","getFontEntry","getFontList","encodingOptions","getLineWidth","setLineDash","setLineDashPattern","dashArray","dashPhase","getLineHeight","setLineHeightFactor","getLineHeightFactor","getHorizontalCoordinateString","getVerticalCoordinateString","getStrokeColor","getDrawColor","setStrokeColor","setDrawColor","fillColor","getFillColor","setFillColor","getTextColor","setTextColor","CapJoinStyles","butt","but","miter","rounded","projecting","square","bevel","setLineCap","setLineJoin","setLineMiterLimit","setMiterLimit","addGState","equals","duplicate","fontState","setCurrentTransformationMatrix","_x","_type","_w","_h","RenderTarget","getPageWidth","setPageWidth","setPageHeight","beginFormObject","endFormObject","newXObject","xObjectId","doFormObject","getFormObject","returnPromise","unload","newEvents","eventname","handler_and_args","getCoordinateString","collections","setWidth","getHeight","setHeight","getEncryptor","getPDFVersion","arrayOfFonts","dictionary","byte","generation","jsPDFAPI","pdfUnescape","f5","__acroform__","inherit","createFormXObject","formObject","xobj","AcroFormXObject","BBox","setBit","bitPosition","clearBit","getBit","getBitForPdf","setBitForPdf","clearBitForPdf","calculateCoordinates","coordinates","lowerLeft_X","lowerLeft_Y","upperRight_X","upperRight_Y","calculateAppearanceStream","appearanceStreamContent","DV","_V","calcRes","calculateX","maxFontSize","textSplit","isSmallerThanWidth","lastLine","calculateFontSpace","FontSize","startX","lastLength","textHeight","startY","lastY","firstWordInLine","lastWordInLine","currWord","lineCount","isWithNewLine","nextLineIsSmaller","isLastWord","currLine","acroformPluginTemplate","xForms","acroFormDictionaryRoot","printedOut","createAnnotationReference","annotations","arrayToPdfArray","toPdfString","AcroFormPDFObject","_objId","_scope","keyValueList","getKeyValueListForStream","_stream","_BBox","AcroFormDictionary","_DA","_Kids","AcroFormField","_F","_Ff","_Rect","_FT","_T","AcroFormChildClass","FieldNum","_fontName","_fontStyle","_fontSize","_maxFontSize","_color","_DV","Rect","hasAnnotation","_page","_hasAppearanceStream","Ff","_Q","FT","_TI","_Opt","setOptions","addOption","removeOption","allEntries","combo","hasAppearanceStream","_AS","_MK","CA","pushButton","_parent","_optionName","caption","appearanceState","_AppearanceType","RadioButton","Circle","createAppearanceStream","setAppearance","appearance","Kids","getCA","createOption","Parent","addField","CheckBox","_MaxLen","YesNormal","YesPushDown","Off","OffPushDown","encodedColor","DotRadius","Bezier_C","DotRadiusBezier","kc","dc","Cross","cross","calculateCross","createDefaultAppearanceStream","fieldObject","acroformPlugin","_eventID","Fields","fieldArray","standardFields","oldRect","DA","appearanceStreamString","ChoiceField","ListBox","ComboBox","EditBox","Button","PushButton","TextField","PasswordField","Appearance","notEmpty","toLookup","__addimage__","imageFileTypeHeaders","PNG","TIFF","JPEG","JPEG2000","GIF87a","GIF89a","WEBP","BMP","getImageFileTypeByImageData","imageData","fallbackFormat","headerSchemata","compareResult","fileType","Uint8ClampedArray","isArrayBufferView","putImage","colorSpace","color_spaces","INDEXED","palette","sMask","DEVICE_CMYK","bitsPerComponent","decodeParameters","transparency","predictor","arrayBufferToBinaryString","putResourcesCallback","addImage_images","putXObjectsDictCallback","getImages","getImageIndex","isImageTypeSupported","isDOMElement","getImageDataFromElement","tmpImageData","loadFile","mimeType","checkImagesForAlias","determineWidthAndHeight","writeImageToPDF","rotation","dims","coord","vcoord","rotationTransformationMatrix","DEVICE_RGB","DEVICE_GRAY","CAL_GREY","CAL_RGB","LAB","ICC_BASED","SEPARATION","DEVICE_N","DCT_DECODE","FLATE_DECODE","LZW_DECODE","JPX_DECODE","JBIG2_DECODE","ASCII85_DECODE","ASCII_HEX_DECODE","RUN_LENGTH_DECODE","CCITT_FAX_DECODE","image_compression","NONE","FAST","MEDIUM","SLOW","sHashCode","validateStringAsBase64","possibleBase64String","extractImageFromDataUrl","dataUrl","dataUrlParts","extractedInfo","supportsArrayBuffer","isArrayBuffer","Int8Array","Int16Array","Int32Array","Float64Array","binaryStringToUint8Array","binary_string","addImage","compression","processImageData","dataAsBinaryString","convertBase64ToBinaryString","stringData","throwError","base64Info","rawData","getImageProperties","addPageData","putPageData","anno","pageInfo","pageAnnos","escape","objText","objPopup","encryptorText","bounds","contents","loc","_nameMap","finalBounds","magFactor","createAnnotation","textWithLink","linkHeight","linkWidth","totalLineWidth","getTextWidth","numOfLines","arabicSubstitionA","ligatures","arabic_diacritics","alfletter","__arabicParser__","isInArabicSubstitutionA","isArabicLetter","isArabicEndLetter","isArabicAlfLetter","arabicLetterHasIsolatedForm","arabicLetterHasFinalForm","arabicLetterHasInitialForm","arabicLetterHasMedialForm","resolveLigatures","letters","tmpLigatures","effectedLetters","isArabicDiacritic","getCorrectForm","currentChar","beforeChar","nextChar","parseArabic","currentLetter","prevLetter","nextLetter","words","newWords","processArabic","tmpText","autoPrint","refAutoPrintTag","addJS","Canvas","jsPdfInstance","_width","pageWrapXEnabled","pageWrapX","_height","pageWrapYEnabled","pageWrapY","_childNodes","_style","pdf","context2d","_canvas","NO_MARGINS","printingHeaderRow","__cell__","headerFunction","margins","lastCell","Cell","_text","_lineNumber","_align","setHeaderFunction","getTextDimensions","amountOfLines","tempWidth","cellAddPage","cell","currentCell","tableHeaderRow","printHeaders","printHeaderRow","table","headerName","headerNames","headerLabels","headerAligns","columnMatrix","columnWidths","columnMinWidths","tableHeaderConfigs","autoSize","css","headerBackgroundColor","headerTextColor","table_font_size","prompt","rec","rowHeight","calculateLineHeight","setTableHeaderRow","pv","cv","rowStart","cellData","cellStart","table_x","table_y","new_page","tableHeaderCell","tempHeaderConf","currentTextColor","fontStyleOrder","italic","oblique","fontStretchOrder","fontStretchLookup","fontWeights","fontWeightsLookup","normalizeFontFace","fontFace","weight","stretch","searchFromPivot","matchingSet","pivot","defaultGenericFontFamilies","fixed","monospace","terminal","cursive","fantasy","serif","systemFonts","icon","menu","ruleToString","eatWhiteSpace","trimLeft","parseQuotedFontFamily","quote","parseNonQuotedFontFamily","jsNamesObj","jsJsObj","defaultFont","_ctx","ContextLayer","isStrokeTransparent","strokeOpacity","strokeStyle","fillStyle","isFillTransparent","fillOpacity","textBaseline","lineJoin","lineCap","globalCompositeOperation","globalAlpha","clip_path","currentPoint","miterLimit","lastPoint","lineDashOffset","lineDash","prevPageLastElemOffset","ignoreClearRect","Context2D","_pdf","_pageWrapXEnabled","_pageWrapYEnabled","_posX","_posY","_autoPaging","lastBreak","pageBreaks","_ctxStack","rgba","getRGBA","_fontFaceMap","getFontFaceMap","fontFaces","convertedFontFaces","_fontFaces","fontFamily","fontSizeUnit","remaining","fontFaceMap","defaultFontFamily","genericFontFamilies","ordering","jsPdfFontName","fallbackFonts","arial","Arial","verdana","Verdana","helvetica","Helvetica","getLineDash","pathPreProcess","beginPath","closePath","pathBegin","quadraticCurveTo","cpx","cpy","pt0","bezierCurveTo","cp1x","cp1y","cp2x","cp2y","arc","radius","startAngle","endAngle","counterclockwise","isIdentity","xpt","x_radPt","x_radPt0","arcTo","fillRect","strokeRect","clearRect","doStackPush","tmpPageNumber","ctxStack","doStackPop","isCanvasGradient","getColor","fillText","degs","rad2deg","putText","strokeText","measureText","txtWidth","scalewidth","scaleheight","setTransform","hasMargins","drawImage","swidth","sheight","imageProperties","factorX","factorY","clipFactorX","clipFactorY","clipPath","decomposedTransformationMatrix","xRect","pageArray","getPagesByPath","sortPages","autoPaging","pageWidthMinusMargins","topMargin","firstPageHeight","pageHeightMinusMargins","previousPageHeightSum","tmpPaths","pathPositionRedo","drawPaths","tmpRect","needsClipping","yOffset","rectOfQuadraticCurve","getQuadraticCurveBoundary","rectOfBezierCurve","getBezierCurveBoundary","isClip","tmpPath","oldLineWidth","origPath","xPath","moves","begin","deltas","iii","began","arcs","drawArc","drawLine","drawLines","doClip","getBaseline","getTextBottom","yBaseLine","createLinearGradient","canvasGradient","colorStops","addColorStop","createPattern","createRadialGradient","includeMove","curves","createArc","curve","doMove","drawCurve","textDimensions","yTop","oldSize","baselineRect","textBounds","pageHeightMinusBottomMargin","pageWidthMinusRightMargin","textBoundsOnPage","doSlice","croppedText","baseLineRectOnPage","prevX","prevY","anticlockwise","twoPi","halfPi","totalAngle","sgn","createSmallArc","q1","q2","cos_ar","sin_ar","ey","midX1","midY1","midX2","midY2","resultX1","resultX2","resultY1","resultY2","ax","ay","bx","by","cx","cy","dx","dy","px","py","qx","qy","minx","miny","maxx","maxy","tobx","toby","tocx","tocy","todx","tody","prevLineDash","nextLineDash","ASCII85Encode","ASCII85Decode","ASCIIHexDecode","regexCheckIfHex","FlateEncode","origData","filterChain","sanitizeUnicode","dataLength","charArray","StringFromCharCode","overrideMimeType","loadImageFile","loadHtml2Canvas","html2canvas","import","loadDomPurify","DOMPurify","dompurify","objType","sanitize","convert","setProgress","overlay","enableLinks","toContainer","toCanvas","toImg","toPdf","thenList","setPageSize","containerCSS","display","windowWidth","scrollWidth","javascriptEnabled","createTextNode","nodeValue","firstChild","scrollHeight","overflow","prereqs","onrendered","toContext2d","allowTaint","scrollX","scrollY","imageTimeout","logging","removeContainer","foreignObjectRendering","useCORS","windowHeight","imgData","outputImg","outputPdf","doCallback","fns","setMargin","cbk","toPx","getPageSize","ratio","updateProgress","thenCore","thenBase","selfPromise","thenExternal","catchExternal","using","export","format_as_string","pageHeight","javascript","namesOid","outline","createNamedDestinations","totalPages","dests","names2Oid","makeRef","genIds_r","renderRoot","renderItems","count_r","objEnd","makeString","markers","processJPEG","numcomponents","getCharWidthsArray","splitLongWord","splitParagraphIntoLines","makeImage","scratchCanvas","scratchCtx","chunkSize","palLen","delayDen","delayNum","palShort","_ref","animation","readUInt32","_results","colorType","compressionMethod","filterMethod","interlaceMethod","numFrames","numPlays","xOffset","readUInt16","disposeOp","blendOp","indexed","grayscale","rgb","hasAlphaChannel","pixelBitlength","decodePixels","pixelBytes","fullPixels","x0","y0","abyte","pa","paeth","pb","pc","pixels","scanlineLength","upperLeft","_k","_l","fullPos","partPos","decodePalette","ret","_ref1","copyToImageData","alpha","_decodedPalette","hasBrowserCanvas","putImageData","decodeFrames","_len","createImageData","renderFrame","animate","doFrame","frameNumber","stopAnimation","_png","GifReader","pf0","global_palette_flag","num_global_colors","global_palette_offset","global_palette_size","no_eof","transparent_index","disposal","loop_count","block_size","pf1","pf2","interlace_flag","num_local_colors","palette_offset","palette_size","has_local_palette","data_offset","data_length","interlaced","loopCount","frameInfo","frame_num","decodeAndBlitFrameBGRA","num_pixels","index_stream","GifReaderLZWOutputIndexStream","trans","framewidth","framestride","xleft","opbeg","opend","scanstride","interlaceskip","il","decodeAndBlitFrameRGBA","code_stream","output_length","min_code_size","clear_code","eoi_code","next_code","cur_code_size","code_mask","cur_shift","cur","subblock_size","code_table","prev_code","chase_code","chase_length","chase","JPEGEncoder","YDC_HT","UVDC_HT","YAC_HT","UVAC_HT","currentQuality","ffloor","YTable","UVTable","fdtbl_Y","fdtbl_UV","bitcode","outputfDCTQuant","DU","byteout","bytenew","bytepos","YDU","UDU","VDU","RGB_YUV_TABLE","ZigZag","std_dc_luminance_nrcodes","std_dc_luminance_values","std_ac_luminance_nrcodes","std_ac_luminance_values","std_dc_chrominance_nrcodes","std_dc_chrominance_values","std_ac_chrominance_nrcodes","std_ac_chrominance_values","computeHuffmanTbl","nrcodes","std_table","codevalue","pos_in_table","HT","writeBits","posval","writeByte","writeWord","processDU","CDU","fdtbl","DC","HTDC","HTAC","EOB","M16zeroes","DU_DCT","d4","d5","d6","d7","fDCTQuant","dataOff","tmp0","tmp7","tmp1","tmp6","tmp2","tmp5","tmp3","tmp4","tmp10","tmp13","tmp11","tmp12","z1","z5","z2","z4","z3","z11","z13","tmp0p2","tmp7p2","tmp1p2","tmp6p2","tmp2p2","tmp5p2","tmp3p2","tmp4p2","tmp10p2","tmp13p2","tmp11p2","tmp12p2","z1p2","z5p2","z2p2","z4p2","z3p2","z11p2","z13p2","Diff","end0pos","lng","startpos","nrzeroes","nrmarker","setQuality","sf","YQT","UVQT","aasf","writeDQT","DCY","DCU","DCV","quadWidth","fillbits","sfcc","nrlower","nrupper","cat","nrneg","initCategoryNumber","BmpDecoder","is_with_alpha","datav","bottom_up","flag","parseHeader","parseBGR","WebPDecoder","wa","Ed","_WebPDecoder","Fd","Ub","jc","Qb","qb","nd","Ca","Ka","oa","Yc","Zc","ca","Sb","Ra","bb","Vb","ob","Gd","Hd","Wb","Sa","Xb","Id","Ta","Yb","Zb","Xa","$b","ac","bc","xa","yb","ud","hd","jd","aa","Ia","cc","Kd","Ld","Ea","Md","Nd","Od","Pd","Qd","fb","gb","Ab","Ja","Rd","Sd","Tc","lb","Cb","RGBA","kb","Td","Ud","ib","bd","Da","Vd","Wd","ka","Mc","Nc","fc","Rc","Xd","Kb","gc","Ua","Va","Ib","Jb","hc","ic","Yd","Ba","Wa","Zd","$d","ta","Eb","Dc","mc","nc","ub","vc","Ya","oc","Fb","rc","va","sc","Gb","tc","uc","Hb","wc","zc","qd","rd","tb","Pb","wd","xd","vb","Ac","Bc","Cc","VP8LMapColor32b","VP8LMapColor8b","rb","Oc","qa","ja","Fa","La","Za","$a","jb","nb","Pa","Ga","Na","Ec","Fc","yd","td","Rb","Lb","Gc","Wc","Xc","Pc","Tb","zd","vd","od","ld","dd","Hc","ze","Sc","Qc","ad","Ob","Ad","Dd","Kc","ed","$c","Jc","Bd","gd","Uc","Vc","Lc","af","bf","ef","gf","hf","jf","kf","mf","nf","of","pf","qf","rf","tf","uf","vf","wf","xf","yf","Af","Bf","kd","Df","Ef","Gf","Hf","If","Jf","Kf","Lf","Mf","Nf","Of","Pf","Predictor0","Predictor1","Predictor2","Predictor3","Predictor4","Predictor5","Predictor6","Predictor7","Predictor8","Predictor9","Predictor10","Predictor11","Predictor12","Predictor13","PredictorAdd0","PredictorAdd1","PredictorAdd2","ColorIndexInverseTransform","MapARGB","VP8LColorIndexInverseTransformAlpha","MapAlpha","VP8LPredictorsAdd","VP8LPredictors","VP8LPredictorsAdd_C","VP8LPredictors_C","UpsampleRgbLinePair","UpsampleBgrLinePair","UpsampleRgbaLinePair","UpsampleBgraLinePair","UpsampleArgbLinePair","UpsampleRgba4444LinePair","UpsampleRgb565LinePair","Qf","WebPDecodeRGBA","GetTag","data_off","GetLE24","GetLE32","webpdecoder","imagearray","src_off","alpha_chunk","alpha_size","alpha_offset","fourcc","payload_size","payload_size_padded","src_size","feature_flags","src_off_","canvas_width","canvas_height","bgcolor","temp","offset_x","offset_y","blend","rgbaoutput","dataurl","loop_counter","imgwidth","imgheight","compressBytes","lineLength","colorsPerPixel","filter_method","filterUp","filterSub","filterAverage","filterPaeth","applyPngFilterMethod","prevLine","filter_methods","getFilterMethods","ind","getIndexOfSmallestSum","filterNone","upLeft","paethPredictor","pLeft","pUp","pUpLeft","arrays","processPNG","trns","pal","smask","alphaData","hasColors","pixel","pbl","pDiff","processGIF89A","rawImageData","processGIF87A","fileSize","reserved","headerSize","getInt32","planes","getUint16","bitPP","rawSize","importantColors","getUint8","quad","bitn","bit1","xlen","bit4","bit8","bit15","dif_w","_1_5","bit16","_1_6","bit24","bit32","getData","processBMP","processWEBP","processRGBA","imagePixels","rgbOut","alphaOut","outIndex","alphaIndex","rgbData","setLanguage","langCode","languageSettings","isSubscribed","sq","hy","ast","az","eu","bg","my","zh","eo","fj","fy","fur","gl","gu","hu","iu","kk","km","ky","tlh","mk","mr","mo","nv","ng","om","pl","qu","ru","sz","sg","sk","sw","th","tig","ts","tk","uk","hsb","xh","zu","char_code","widths","Unicode","widthsFractionOf","fof","kerning","kerningFractionOf","kerningValue","prior_char_code","default_char_width","widthOfString","widthOfGlyph","characterToGlyph","widths_array","firstLineMaxLen","maxLen","answer","workingLen","startOfLine","lineIndent","postProcess","line_length","textIndent","separator_length","current_word_length","spaceCharWidth","wrds","wrd","paragraphs","fsize","fontUnit_maxLen","__fontmetrics__","mappingUncompress","mappingCompress","keystring","valuestring","numberprefix","uncompress","stringparts","parent_key_pair","activeobject","parentchain","keyparts","valueparts","datalen","WinAnsiEncoding","encodings","Courier","fontMetrics","ZapfDingbats","metrics","file","existsFileInVFS","getFileFromVFS","TTFFont","glyIdsUsed","loadCanvg","canvg","addSvgAsImage","svg","ignoreMouse","ignoreAnimation","ignoreDimensions","putTotalPages","pageExpression","replaceExpression","totalNumberOfPages","pdfEscape16","viewerPreferences","doReset","configurationTemplate","HideToolbar","explicitSet","valueSet","HideMenubar","HideWindowUI","FitWindow","CenterWindow","DisplayDocTitle","NonFullScreenPageMode","Direction","ViewArea","ViewClip","PrintArea","PrintClip","PrintScaling","Duplex","PickTrayByPDFSize","PrintPageRange","NumCopies","configurationKeys","rangeArray","arrayContainsElement","viewerpreferences","vPref","pdfDict","postPutResources","rdf_beginning","__metadata__","namespaceuri","utf8_xmpmeta_beginning","utf8_rdf_beginning","utf8_metadata","utf8_rdf_ending","utf8_xmpmeta_ending","total_len","metadata_object_number","addMetadata","padz","toUnicode","toUnicodeCmap","codes","unicode","unicodeMap","pdfOutput","subset","pdfOutput2","fontTable","cmap","fontDescriptor","PDFObject","bbox","stemV","italicAngle","ascender","decender","capHeight","DescendantFont","hmtx","unitsPerEm","utf8TextFunction","cmapConfirm","strText","codeMap","parms","_initializeVFS","vFS","addFileToVFS","filecontent","__bidiEngine__","_hasUbatB","_hasUbatS","_isInVisual","_isInRtl","_isOutVisual","_isOutRtl","_isSymmetricSwapping","_UNICODE_TYPES","_bidiUnicodeTypes","_STATE_TABLE_LTR","_STATE_TABLE_RTL","_TYPE_NAMES_MAP","AN","_UNICODE_RANGES_MAP","_SWAP_TABLE","_LTR_RANGES_REG_EXPR","_lastArabic","_dir","_getCharType","rangeIdx","_isContextualDirRtl","charType","_resolveCharType","resolvedTypes","wType","nType","cType","rtlCandidate","_invertString","sourceToTargetMap","_computeLevels","hiLevel","newLevel","prevState","condPos","newState","stateTable","_invertByLevel","low","_reorder","DIR_RTL","doBidiReorder","isSymmetricSwappingOrig","isInputVisual","isOutputVisual","isInputRtl","isOutputRtl","isSymmetricSwapping","bidiEngine","Data","readString","Subset","registerTTF","directory","Directory","HeadTable","NameTable","CmapTable","hhea","HheaTable","maxp","MaxpTable","HmtxTable","PostTable","os2","OS2Table","loca","LocaTable","glyf","GlyfTable","lineGap","xMin","yMin","xMax","yMax","italic_angle","xHeight","familyClass","isSerif","isScript","isFixedPitch","character","glyph","forGlyph","advance","includeGap","gap","Table","readByte","writeUInt32","readInt32","int","writeInt32","writeUInt16","readInt16","writeInt16","writeString","readShort","writeShort","readLongLong","writeLongLong","readInt","writeInt","checksum","scalarType","tableCount","searchRange","entrySelector","rangeShift","tables","adjustment","directoryLength","headOffset","tableData","__slice","__hasProp","ctor","__super__","revision","checkSumAdjustment","magicNumber","created","modified","macStyle","lowestRecPPEM","fontDirectionHint","indexToLocFormat","glyphDataFormat","CmapEntry","endCode","glyphId","glyphIds","idDelta","idRangeOffset","saveOffset","segCount","segCountX2","startCode","platformID","encodingID","charmap","charMap","endCodes","glyphIDs","nextID","rangeOffsets","startCodes","startGlyph","subtable","_len1","_len2","_len3","_len4","_len5","_len6","_len7","_n","_q","new","maxGlyphID","advanceWidthMax","minLeftSideBearing","minRightSideBearing","xMaxExtent","caretSlopeRise","caretSlopeRun","caretOffset","metricDataFormat","numberOfMetrics","averageCharWidth","weightClass","widthClass","ySubscriptXSize","ySubscriptYSize","ySubscriptXOffset","ySubscriptYOffset","ySuperscriptXSize","ySuperscriptYSize","ySuperscriptXOffset","ySuperscriptYOffset","yStrikeoutSize","yStrikeoutPosition","panose","charRange","vendorID","firstCharIndex","lastCharIndex","ascent","winAscent","winDescent","codePageRange","defaultChar","breakChar","maxContext","numberOfGlyphs","underlinePosition","underlineThickness","minMemType42","maxMemType42","minMemType1","maxMemType1","glyphNameIndex","_results1","numGlyphs","NameEntry","languageID","stringOffset","strings","nameID","copyright","fontSubfamily","uniqueSubfamily","postscriptName","trademark","designer","vendorUrl","designerUrl","license","licenseUrl","preferredFamily","preferredSubfamily","compatibleFull","sampleText","maxPoints","maxContours","maxCompositePoints","maxComponentContours","maxZones","maxTwilightPoints","maxStorage","maxFunctionDefs","maxInstructionDefs","maxStackElements","maxSizeOfInstructions","maxComponentElements","maxComponentDepth","lsbCount","lsb","leftSideBearings","glyphFor","numberOfContours","lengthOf","CompoundGlyph","SimpleGlyph","glyphs","mapping","old2new","compound","glyphOffsets","activeGlyphs","glyfPtr","listGlyf","newLocaTable","unicodes","generateCmap","roman","unicodeCmap","glyphsFor","additionalIDs","glyID","new2old","newIDs","nextGlyphID","oldID","oldIDs","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","_dereq_","scheduleDrain","draining","WebKitMutationObserver","called","scriptEl","onmessage","oldQueue","FULFILLED","outcome","safelyResolveThenable","QueueItem","callFulfilled","otherCallFulfilled","callRejected","otherCallRejected","unwrap","getThen","thenable","onSuccess","tryCatch","iterable","resolved","allResolver","outValue","idb","webkitIndexedDB","mozIndexedDB","OIndexedDB","msIndexedDB","createBlob","builder","BlobBuilder","MSBlobBuilder","MozBlobBuilder","WebKitBlobBuilder","Promise$1","executeCallback","executeTwoCallbacks","normalizeKey","getCallback","DETECT_BLOB_SUPPORT_STORE","supportsBlobs","dbContexts","READ_ONLY","READ_WRITE","_binStringToArrayBuffer","bin","_checkBlobSupport","matchedChrome","matchedEdge","_deferReadiness","dbInfo","dbContext","deferredOperation","deferredOperations","dbReady","_advanceReadiness","_rejectReadiness","_getConnection","upgradeNeeded","forages","dbArgs","openreq","storeName","_getOriginalConnection","_getUpgradedConnection","_isUpgradeNeeded","defaultVersion","isNewStore","isDowngrade","isUpgrade","incVersion","_decodeBlob","encodedBlob","_isEncodedBlob","__local_forage_encoded_blob","_fullyReady","_initReady","_dbInfo","createTransaction","forage","asyncStorage","_driver","_initStorage","initPromises","_defaultConfig","_support","openDatabase","hasFetch","iterationNumber","blobSupport","readAsBinaryString","advanced","dropInstance","currentConfig","dropObjectPromise","_forage2","dropDBPromise","BASE_CHARS","BLOB_TYPE_PREFIX_REGEX","SERIALIZED_MARKER","TYPE_ARRAYBUFFER","TYPE_BLOB","TYPE_INT8ARRAY","TYPE_UINT8ARRAY","TYPE_UINT8CLAMPEDARRAY","TYPE_INT16ARRAY","TYPE_INT32ARRAY","TYPE_UINT16ARRAY","TYPE_UINT32ARRAY","TYPE_FLOAT32ARRAY","TYPE_FLOAT64ARRAY","toString$1","stringToBuffer","serializedString","encoded1","encoded2","encoded3","encoded4","bufferLength","bufferToString","base64String","localforageSerializer","valueType","marker","fileReader","readAsArrayBuffer","blobType","SERIALIZED_MARKER_LENGTH","createDbTable","executeSql","tryExecuteSql","sqlStatement","SYNTAX_ERR","rows","_setItem","retriesLeft","originalValue","sqlError","QUOTA_ERR","webSQLStorage","dbInfoPromise","storeNames","operationInfo","dropTable","_getKeyPrefix","defaultConfig","keyPrefix","localStorageWrapper","localStorageTestKey","keyPrefixLength","itemKey","searchElement","DefinedDrivers","DriverSupport","DefaultDrivers","INDEXEDDB","WEBSQL","LOCALSTORAGE","DefaultDriverOrder","OptionalDriverMethods","LibraryMethods","DefaultConfig","driver","callWhenReady","localForageInstance","libraryMethod","_args","LocalForage","driverTypeKey","Constructor","driverName","defineDriver","_driverSet","_initDriver","_ready","_wrapLibraryMethodsWithReady","setDriver","driverObject","complianceError","driverMethods","driverMethodName","methodNotImplementedFactory","optionalDriverMethod","setDriverSupport","support","getDriver","getDriverPromise","getSerializer","serializerPromise","drivers","supportedDrivers","_getSupportedDrivers","setDriverToConfig","extendSelfWithDriver","_extend","oldDriverSetDone","currentDriverIndex","driverPromiseLoop","supports","libraryMethodsAndProperties","localforage_js","hashClear","hashDelete","hashGet","hashHas","hashSet","Hash","listCacheClear","listCacheDelete","listCacheGet","listCacheHas","listCacheSet","ListCache","mapCacheClear","mapCacheDelete","mapCacheGet","mapCacheHas","mapCacheSet","MapCache","setCacheAdd","setCacheHas","SetCache","stackClear","stackDelete","stackGet","stackHas","stackSet","Stack","accumulator","resIndex","baseIndexOf","baseTimes","isArguments","isBuffer","isIndex","isTypedArray","inherited","isArr","isArg","isBuff","isType","skipIndexes","initAccum","baseRandom","baseClamp","copyArray","shuffleSelf","asciiSize","baseAssignValue","objValue","baseEach","copyObject","keysIn","arrayEach","assignValue","baseAssign","baseAssignIn","cloneBuffer","copySymbols","copySymbolsIn","getAllKeysIn","getTag","initCloneArray","initCloneByTag","initCloneObject","isMap","isSet","argsTag","funcTag","objectTag","cloneableTags","baseClone","bitmask","customizer","isDeep","isFlat","isFunc","stacked","subValue","objectCreate","baseCreate","arrayIncludes","arrayIncludesWith","arrayMap","baseUnary","cacheHas","isCommon","valuesLength","outer","valuesIndex","baseForOwn","baseForOwnRight","baseEachRight","toInteger","toLength","fromRight","eachFunc","arrayPush","isFlattenable","baseFlatten","isStrict","baseFor","baseForRight","createBaseFor","arrayFilter","isFunction","castPath","keysFunc","symbolsFunc","getRawTag","symToStringTag","baseFindIndex","baseIsNaN","strictIndexOf","nativeMin","othLength","othIndex","caches","seen","baseGetTag","isObjectLike","baseIsEqualDeep","baseIsEqual","equalArrays","equalByTag","equalObjects","arrayTag","equalFunc","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","matchData","noCustomizer","srcValue","COMPARE_PARTIAL_FLAG","toSource","reIsHostCtor","funcProto","objectProto","funcToString","reIsNative","isLength","typedArrayTags","baseMatches","baseMatchesProperty","isPrototype","nativeKeys","nativeKeysIn","isProto","isArrayLike","baseIsMatch","getMatchData","matchesStrictComparable","hasIn","isStrictComparable","assignMergeValue","baseMergeDeep","baseMerge","srcIndex","cloneTypedArray","isArrayLikeObject","toPlainObject","mergeFunc","isTyped","baseGet","baseIteratee","baseMap","baseSortBy","compareMultiple","iteratees","orders","criteria","basePickBy","baseSet","baseIndexOfWith","baseUnset","nativeFloor","nativeRandom","overRest","setToString","arraySample","nested","baseSetToString","comparer","baseSortedIndexBy","isSymbol","retHighest","MAX_ARRAY_LENGTH","mid","valIsNaN","valIsNull","valIsSymbol","valIsUndefined","othIsDefined","othIsNull","othIsReflexive","othIsSymbol","setLow","symbolProto","symbolToString","baseToString","trimmedEndIndex","reTrimStart","createSet","setToArray","seenIndex","updater","baseSlice","isDrop","baseDifference","baseUniq","assignFunc","valsLength","stringToPath","nmd","freeExports","freeModule","allocUnsafe","cloneArrayBuffer","dataView","byteOffset","reFlags","regexp","symbolValueOf","symbol","typedArray","valIsDefined","valIsReflexive","compareAscending","objCriteria","othCriteria","ordersLength","isNew","getSymbols","getSymbolsIn","coreJsData","arrayAggregator","baseAggregator","baseRest","isIterateeCall","assigner","guard","findIndexFunc","baseInverter","toIteratee","baseToPairs","mapToArray","setToPairs","customDefaultsMerge","getNative","arraySome","isPartial","arrLength","arrStacked","othStacked","arrValue","othValue","compared","objProps","objLength","objStacked","skipCtor","objCtor","othCtor","flatten","freeGlobal","baseGetAllKeys","isKeyable","baseIsNative","getPrototype","nativeObjectToString","isOwn","unmasked","stubArray","nativeGetSymbols","mapTag","promiseTag","weakMapTag","dataViewTag","dataViewCtorString","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","Ctor","ctorString","hasFunc","reHasUnicode","nativeCreate","cloneDataView","cloneRegExp","cloneSymbol","spreadableSymbol","isConcatSpreadable","reIsUint","reIsDeepProp","reIsPlainProp","maskSrcKey","IE_PROTO","assocIndexOf","getMapData","memoize","freeProcess","nodeUtil","binding","nativeMax","otherArgs","freeSelf","nativeNow","lastCalled","stamp","rand","LARGE_ARRAY_SIZE","hasUnicode","unicodeSize","memoizeCapped","rePropName","reEscapeChar","reWhitespace","rsAstralRange","rsAstral","rsCombo","rsFitz","rsNonAstral","rsRegional","rsSurrPair","reOptMod","rsModifier","rsOptVar","rsSeq","rsSymbol","reUnicode","chunk","compact","differenceBy","differenceWith","drop","dropRight","dropRightWhile","dropWhile","findLastIndex","flattenDeep","flattenDepth","fromPairs","initial","intersection","intersectionBy","intersectionWith","nth","pullAll","pullAllBy","pullAllWith","pullAt","sortedIndex","sortedIndexBy","sortedIndexOf","sortedLastIndex","sortedLastIndexBy","sortedLastIndexOf","sortedUniq","sortedUniqBy","take","takeRight","takeRightWhile","takeWhile","union","unionBy","uniq","uniqBy","uniqWith","unzip","unzipWith","without","xorBy","xorWith","zip","zipObject","zipObjectDeep","zipWith","createAssigner","assignIn","assignInWith","assignWith","baseAt","nativeCeil","countBy","each","eachRight","findLast","flatMap","flatMapDeep","flatMapDepth","forEachRight","groupBy","invokeMap","keyBy","partition","reduceRight","sampleSize","shuffle","sortBy","createAggregator","propsIndex","propsLength","mergeWith","defaultsDeep","baseWhile","arrayEvery","baseEvery","baseFill","baseFilter","baseFindKey","castFunction","arrayEachRight","baseFunctions","baseHas","baseHasIn","baseIntersection","castArrayLikeObject","mapped","createInverter","invert","invertBy","baseInvoke","invoke","baseIsArguments","stubFalse","baseIsMap","nodeIsMap","objectCtorString","baseIsSet","nodeIsSet","baseIsTypedArray","nodeIsTypedArray","nativeJoin","arrayLikeKeys","baseKeys","baseKeysIn","strictLastIndexOf","memoized","baseNth","entriesIn","extendWith","findKey","findLastKey","forIn","forInRight","forOwn","forOwnRight","functions","functionsIn","mapKeys","mapValues","omit","omitBy","pick","pickBy","setWith","toPairs","toPairsIn","unset","updateWith","valuesIn","customOmitClone","flatRest","CLONE_DEEP_FLAG","baseOrderBy","basePick","baseProperty","basePropertyDeep","basePullAll","basePullAt","arrayReduce","baseReduce","arrayReduceRight","nativeReverse","baseSample","arraySampleSize","baseSampleSize","arrayShuffle","baseShuffle","stringSize","baseSome","baseSortedIndex","baseSortedUniq","toFinite","baseTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","isBinary","isArrLike","baseUpdate","baseValues","baseXor","baseZipObject","cachedGuess","zones","countries","guesses","logError","momentVersion","charCodeToInt","unpackBase60","whole","fractional","multiplier","arrayToInt","mapIndices","indices","unpack","untils","abbrs","population","packedString","Country","country_name","zone_names","OffsetAt","timeString","toTimeString","ZoneScore","zone","offsetScore","abbrScore","findChange","sortZoneScores","localeCompare","addToGuesses","guessesForUserOffsets","guessesOffset","offsetsLength","filteredGuesses","checkedOffsets","normalizeName","addZone","packed","getZone","caller","addLink","aliases","normal0","normal1","needsOffset","isUnixTimestamp","_tzm","unpacked","_index","zone_name","country_code","offsetNext","offsetPrev","moveAmbiguousForward","moveInvalidForward","mom","utcOffset","scoreOffsetAt","offsetAt","dataVersion","_zones","_links","_names","_countries","country_zones","zoneExists","didShowError","guess","ignoreCache","intlName","Intl","DateTimeFormat","resolvedOptions","zoneScore","nextOffset","startYear","lastOffset","zoneScores","zonesForCountry","country","with_offset","abbrWrap","_z","resetZoneWrap","defaultZone","updateOffset","keepTime","_isUTC","zoneName","zoneAbbr","local","setDefault","momentProperties","defineLocale","monthsShort","weekdaysMin","meridiemParse","isPM","meridiem","hours","isLower","longDateFormat","LT","LTS","LL","LLL","LLLL","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","relativeTime","future","past","mm","MM","yy","dayOfMonthOrdinalParse","dow","doy","pluralForm","plurals","withoutSuffix","isFuture","weekdaysParseExact","minute","postformat","symbolMap","preparse","numberMap","suffixes","relativeTimeWithPlural","forms","isFormat","period","ww","lastDigit","last2Digits","meridiemHour","monthsShortRegex","monthsParseExact","relativeTimeWithMutation","mutationTable","lastNumber","monthsParse","monthsRegex","minWeekdaysParse","weekdaysParse","fullWeekdaysParse","shortWeekdaysParse","monthsStrictRegex","monthsShortStrictRegex","longMonthsParse","shortMonthsParse","lll","llll","plural","processRelativeTime","monthsNominativeEl","monthsGenitiveEl","momentToFormat","_monthsGenitiveEl","_monthsNominativeEl","calendarEl","_calendarEl","monthsShortDot","invalidDate","numbersPast","numbersFuture","monthsShortWithDots","monthsShortWithoutDots","weekEndings","eras","narrow","eraYearOrdinalRegex","eraYearOrdinalParse","$0","$1","isUpper","eifelerRegelAppliesToNumber","units","translateSingular","special","relativeTimeWithSingular","translator","correctGrammaticalCase","wordKey","relativeTimeMr","monthsNominative","monthsSubjective","numbersNouns","numberNoun","hundred","ten","hm","processHoursFunction","nominative","accusative","genitive","hookCallback","hasOwnProp","isObjectEmpty","isUndefined","isNumber","createUTC","createLocalOrUTC","getParsingFlags","_pf","unusedTokens","unusedInput","charsLeftOver","nullInput","invalidEra","invalidMonth","invalidFormat","userInvalidated","iso","parsedDateParts","era","rfc2822","weekdayMismatch","_isValid","parsedParts","isNowValid","invalidWeekday","_strict","bigHour","createInvalid","fun","updateInProgress","copyConfig","momentPropertiesLen","_isAMomentObject","_offset","_locale","Moment","suppressDeprecationWarnings","firstTime","deprecationHandler","argLen","deprecations","deprecateSimple","mergeConfigs","parentConfig","childConfig","Locale","zeroFill","targetLength","forceSign","absNumber","zerosToFill","formattingTokens","localFormattingTokens","formatFunctions","formatTokenFunctions","addFormatToken","padded","localeData","formatMoment","expandFormat","replaceLongDateFormatTokens","addUnitAlias","shorthand","normalizeUnits","normalizeObjectUnits","inputObject","normalizedProp","normalizedInput","priorities","addUnitPriority","absFloor","argumentForCoercion","coercedNumber","makeGetSet","set$1","daysInMonth","regexes","match1","match2","match3","match4","match6","match1to2","match3to4","match5to6","match1to3","match1to4","match1to6","matchUnsigned","matchSigned","matchOffset","matchShortOffset","matchWord","addRegexToken","strictRegex","getParseRegexForToken","regexEscape","matched","p3","p4","addParseToken","tokenLen","addWeekParseToken","addTimeToArrayFromToken","YEAR","MONTH","DATE","HOUR","MINUTE","SECOND","MILLISECOND","WEEK","WEEKDAY","modMonth","defaultLocaleMonths","defaultLocaleMonthsShort","MONTHS_IN_FORMAT","defaultMonthsShortRegex","defaultMonthsRegex","handleStrictParse","monthName","llc","toLocaleLowerCase","_monthsParse","_longMonthsParse","_shortMonthsParse","dayOfMonth","getSetMonth","computeMonthsParse","cmpLenRev","shortPieces","longPieces","mixedPieces","_monthsRegex","_monthsShortRegex","_monthsStrictRegex","_monthsShortStrictRegex","daysInYear","parseTwoDigitYear","getSetYear","createDate","setFullYear","createUTCDate","UTC","setUTCFullYear","firstWeekOffset","fwd","getUTCDay","dayOfYearFromWeeks","weekday","resYear","resDayOfYear","dayOfYear","weekOfYear","resWeek","weekOffset","weeksInYear","weekOffsetNext","shiftWeekdays","weekdaysMinRegex","weekdaysShortRegex","weekdaysRegex","defaultLocaleWeekdays","defaultLocaleWeekdaysShort","defaultLocaleWeekdaysMin","defaultWeekdaysRegex","defaultWeekdaysShortRegex","defaultWeekdaysMinRegex","handleStrictParse$1","weekdayName","_weekdaysParse","_shortWeekdaysParse","_minWeekdaysParse","computeWeekdaysParse","minp","shortp","longp","minPieces","_weekdaysRegex","_weekdaysShortRegex","_weekdaysMinRegex","_weekdaysStrictRegex","_weekdaysShortStrictRegex","_weekdaysMinStrictRegex","hFormat","lowercase","matchMeridiem","_meridiemParse","kInput","_isPm","_meridiem","pos1","pos2","globalLocale","getSetHour","baseConfig","locales","localeFamilies","commonPrefix","minl","normalizeLocale","loadLocale","oldLocale","_abbr","aliasedRequire","getSetGlobalLocale","getLocale","parentLocale","checkOverflow","_overflowDayOfYear","_overflowWeeks","_overflowWeekday","extendedIsoRegex","basicIsoRegex","tzRegex","isoDates","isoTimes","aspNetJsonRegex","obsOffsets","UT","GMT","EDT","EST","CDT","CST","MDT","MST","PDT","PST","configFromISO","allowTime","dateFormat","timeFormat","tzFormat","isoDatesLen","isoTimesLen","configFromStringAndFormat","untruncateYear","yearStr","configFromRFC2822","parsedArray","monthStr","dayStr","hourStr","minuteStr","secondStr","weekdayStr","parsedInput","obsOffset","militaryOffset","numOffset","setUTCMinutes","configFromArray","currentDate","expectedWeekday","yearToUse","nowValue","_useUTC","weekYear","weekdayOverflow","curWeek","GG","createLocal","_week","_dayOfYear","_nextDay","ISO_8601","RFC_2822","skipped","totalParsedInputLength","isPm","erasConvertYear","prepareConfig","tempConfig","bestMoment","scoreToBeat","currentScore","validFormatFound","bestFormatIsValid","configfLen","score","createFromInputFallback","dayOrDate","second","millisecond","isUTC","prototypeMin","prototypeMax","moments","Duration","years","quarters","quarter","weeks","unitHasDecimal","orderLen","_milliseconds","_days","_months","_bubble","isDuration","absRound","offsetFromString","chunkOffset","cloneWithOffset","getDateOffset","isUtc","aspNetRegex","isoRegex","createDuration","diffRes","parseIso","positiveMomentsDifference","inp","createAdder","addSubtract","isAdding","invalid","isMomentInput","arrayTest","dataTypeTest","objectTest","propertyTest","propertyLen","monthDiff","wholeMonthDiff","anchor","newLocaleData","defaultFormatUtc","MS_PER_SECOND","MS_PER_MINUTE","MS_PER_HOUR","MS_PER_400_YEARS","mod$1","dividend","divisor","localStartOfDate","utcStartOfDate","matchEraAbbr","erasAbbrRegex","computeErasParse","abbrPieces","namePieces","narrowPieces","_erasRegex","_erasNameRegex","_erasAbbrRegex","_erasNarrowRegex","addWeekYearFormatToken","getter","getSetWeekYearHelper","weeksTarget","setWeekAll","dayOfYearData","erasNameRegex","erasNarrowRegex","erasParse","_eraYearOrdinalRegex","isoWeekYear","_dayOfMonthOrdinalParse","_ordinalParse","_dayOfMonthOrdinalParseLenient","getSetDayOfMonth","getSetMinute","getSetMillisecond","getSetSecond","parseMs","preParsePostFormat","sod","startOf","calendarFormat","asFloat","that","zoneDelta","endOf","startOfDate","isoWeekday","inputString","invalidAt","localInput","localFrom","localTo","inputMs","parsingFlags","prioritized","unitsObj","prioritizedLen","toObject","keepOffset","inspect","suffix","isLocal","creationData","eraName","eraNarrow","eraAbbr","eraYear","isoWeeks","weekInfo","weeksInWeekYear","isoWeeksInYear","isoWeeksInISOWeekYear","keepLocalTime","keepMinutes","localAdjust","_changeInProgress","parseZone","tZone","hasAlignedHourOffset","isDST","isUtcOffset","isDSTShifted","_isDSTShifted","array1","array2","dontConvert","lengthDiff","diffs","proto$1","get$1","listMonthsImpl","listWeekdaysImpl","localeSorted","_calendar","_longDateFormat","formatUpper","tok","_invalidDate","_ordinal","_relativeTime","pastFuture","_eras","_monthsShort","_monthsParseExact","firstDayOfYear","firstDayOfWeek","_weekdays","_weekdaysMin","_weekdaysShort","_weekdaysParseExact","_fullWeekdaysParse","langData","mathAbs","addSubtract$1","absCeil","daysToMonths","monthsToDays","makeAs","asMilliseconds","asSeconds","asMinutes","asHours","asDays","asWeeks","asMonths","asQuarters","asYears","makeGetter","thresholds","substituteTimeAgo","abs$1","toISOString$1","totalSign","ymSign","daysSign","hmsSign","proto$2","monthsFromDays","argWithSuffix","argThresholds","withSuffix","posNegDuration","toIsoString","tmpLocale","relativeTimeRounding","roundingFunction","relativeTimeThreshold","myMoment","HTML5_FMT","DATETIME_LOCAL","DATETIME_LOCAL_SECONDS","DATETIME_LOCAL_MS","TIME","TIME_SECONDS","TIME_MS","dynamicTyping","dynamicTypingFunction","WORKERS_SUPPORTED","BLOB_URL","userStep","userChunk","userComplete","userError","workerId","NODE_STREAM_INPUT","readable","File","unparse","delimiter","BAD_DELIMITERS","quotes","skipEmptyLines","newline","quoteChar","columns","escapeChar","escapeFormulae","RECORD_SEP","UNIT_SEP","BYTE_ORDER_MARK","LocalChunkSize","RemoteChunkSize","DefaultDelimiter","ParserHandle","NetworkStreamer","FileStreamer","StringStreamer","ReadableStreamStreamer","jQuery","files","inputElem","instanceConfig","_handle","_completed","_halted","_input","_baseIndex","_partialLine","_rowCount","_nextChunk","isFirstChunk","_completeResults","streamer","parseChunk","beforeFirstChunk","preview","WORKER_ID","finished","_sendError","_readChunk","_chunkLoaded","_chunkError","downloadRequestBody","downloadRequestHeaders","webkitSlice","mozSlice","FileReaderSync","readAsText","_streamData","_streamEnd","_streamError","_checkIsFinished","_streamCleanUp","transformHeader","comments","successful","bestDelimiter","delimitersToGuess","getCharIndex","fastMode","linebreak","truncated","PusherPresenceChannelMock","PusherChannelMock","PusherFactoryMock","PusherMock","pusher_channel_mock_1","pusher_factory_mock_1","pusher_js_mock_1","pusher_presence_channel_mock_1","objectApply","Members","members","addMember","memberData","user_info","removeMember","myID","proxyPresenceChannel","internals","subscribed","unbind","unbind_all","_arguments","generator","rejected","emitDisconnectionEvents","emitConnectionEvents","__spreadArrays","jl","pusherKey","pusherClientInstance","pusherClient","proxy_presence_channel_1","PusherMockInstance","presenceChannel","pusher_events_1","pusher_js_mock_instance_1","clientKey","setAuthInfo","authorizer","authorize","channelName","allChannels","extendStatics","__","members_1","modules","__webpack_require__","INVALID_BYTE","_paddingCharacter","Coder","_encodeByte","maxDecodedLength","_getPaddingLength","paddingLength","haveBad","v3","_decodeChar","stdCoder","URLSafeCoder","urlSafeCoder","encodedLength","decodedLength","INVALID_UTF16","INVALID_UTF8","n3","nacl","randombytes","_0","_9","gf0","gf1","_121665","D2","ts64","crypto_verify_16","crypto_verify_32","crypto_core_salsa20","x15","j1","j2","j3","j4","j5","j6","j7","j8","j9","j10","j11","j12","j13","j14","j15","x8","x12","x5","x13","x9","x10","x6","x14","x11","x7","core_salsa20","crypto_core_hsalsa20","core_hsalsa20","sigma","crypto_stream_salsa20_xor","cpos","mpos","crypto_stream_salsa20","crypto_stream","crypto_stream_xor","poly1305","leftover","fin","t0","t1","t3","t5","t6","t7","crypto_onetimeauth","crypto_onetimeauth_verify","crypto_secretbox","crypto_secretbox_open","set25519","car25519","sel25519","pack25519","neq25519","par25519","unpack25519","t8","t16","t24","b11","b12","b13","b14","b15","t9","t10","t11","t12","t13","t14","t15","t17","t18","t19","t20","t21","t22","t23","t25","t26","t27","t28","t29","t30","inv25519","pow2523","crypto_scalarmult","crypto_scalarmult_base","crypto_box_keypair","crypto_box_beforenm","blocks","h3","h4","h5","h6","h7","h8","h9","r1","r2","r3","r4","r5","r6","r7","r8","r9","h0","d8","d9","mac","want","crypto_box_afternm","crypto_box_open_afternm","crypto_hashblocks_hl","bh0","bl0","ah1","ah2","ah3","ah4","ah5","ah6","ah7","al0","al1","al2","al3","al4","al5","al6","al7","wh","wl","bh1","bh2","bh3","bh4","bh5","bh6","bl1","bl2","bl3","bl4","bl5","bl6","bh7","bl7","ah0","crypto_hash","cswap","pack","scalarmult","scalarbase","crypto_sign_keypair","pk","modL","crypto_sign","sm","crypto_sign_open","den","den6","crypto_sign_BYTES","crypto_sign_PUBLICKEYBYTES","crypto_sign_SECRETKEYBYTES","checkLengths","crypto_secretbox_NONCEBYTES","checkArrayTypes","lowlevel","crypto_box","crypto_box_open","crypto_secretbox_KEYBYTES","crypto_secretbox_ZEROBYTES","crypto_secretbox_BOXZEROBYTES","crypto_scalarmult_BYTES","crypto_scalarmult_SCALARBYTES","crypto_box_PUBLICKEYBYTES","crypto_box_SECRETKEYBYTES","crypto_box_BEFORENMBYTES","crypto_box_NONCEBYTES","crypto_box_ZEROBYTES","crypto_box_BOXZEROBYTES","crypto_sign_SEEDBYTES","crypto_hash_BYTES","randomBytes","secretbox","keyLength","nonceLength","overheadLength","scalarMult","scalarLength","groupElementLength","box","checkBoxLengths","keyPair","fromSecretKey","publicKeyLength","secretKeyLength","sharedKeyLength","detached","fromSeed","seedLength","signatureLength","hashLength","setPRNG","AuthRequestType","lastId","ScriptReceiverFactory","ScriptReceivers","endpoint","loading","DependencyLoader","createScriptRequest","successCallback","wasSuccessful","useTLS","cdn_https","cdn_http","getRoot","DependenciesReceivers","Dependencies","dependency_loader","urlStore","authenticationEndpoint","authorizationEndpoint","javascriptQuickStart","triggeringClientEvents","encryptedChannelSupport","urlObj","urlPrefix","_newTarget","authOptions","authRequestType","createXHR","headersProvider","dynamicHeaders","HTTPAuthError","UserAuthentication","url_store","ChannelAuthorization","b64chars","b64tab","base64_i","cb_utob","cb_encode","ccc","padlen","ord","Timer","timers_clearTimeout","timers_clearInterval","timers_extends","abstract_timer","Util","defer","OneOffTimer","boundArguments","safeJSONStringify","arrayIndexOf","nativeIndexOf","filterObject","any","buildQueryString","utob","objects","derez","nu","$ref","globalLog","globalLogWarn","globalLogError","defaultLoggingFunction","core_pusher","logToConsole","logger_Logger","callbackName","nextAuthCallbackID","auth_callbacks","callback_name","ScriptRequest","errorString","errorScript","JSONPRequest","getAgent","createJSONPRequest","getGenericURL","baseScheme","hostTLS","hostNonTLS","getGenericPath","queryString","getInitial","httpPath","http","sockjs","_callbacks","CallbackRegistry","prefixedEventName","removeCallback","removeAllCallbacks","failThrough","callback_registry","global_callbacks","Dispatcher","unbind_global","transportConnectionInitializer","timeline","activityTimeout","generateUniqueID","transport_connection_extends","TransportConnection","handlesActivityChecks","supportsPing","getSocket","changeState","bindListeners","beforeOpen","onopen","buildTimelineMessage","closeEvent","wasClean","unbindListeners","onclose","onactivity","onActivity","cid","dispatcher","Transport","transport_connection","WSTransport","transports_transport","getWebSocketAPI","createWebSocket","httpConfiguration","streamingConfiguration","HTTPFactory","createStreamingSocket","pollingConfiguration","createPollingSocket","xhrConfiguration","isXHRSupported","xhr_streaming","xhr_polling","SockJSTransport","SockJS","js_path","ignore_null_origin","ignoreNullOrigin","xdrConfiguration","isXDRSupported","XDRStreamingTransport","XDRPollingTransport","xdr_streaming","xdr_polling","net_info_Network","net_info_extends","NetInfo","minPingDelay","maxPingDelay","pingDelay","AssistantToTheTransportManager","createConnection","openTimestamp","onClosed","reportDeath","lifespan","isAlive","Protocol","decodeMessage","messageData","pusherEventData","pusherEvent","processHandshake","activity_timeout","socket_id","getCloseAction","getCloseError","connection_extends","Connection","protocol_protocol","send_event","activity","handleCloseEvent","Handshake","connection_connection","TimelineSender","TimelineTransport","pusher","subscriptionPending","subscriptionCancelled","channel_extends","Channel","socketId","BadEventName","handleSubscriptionSucceededEvent","handleSubscriptionCountEvent","subscription_count","subscriptionCount","channel_data","private_channel_extends","PrivateChannel","channelAuthorizer","channels_channel","subscriptionData","presence","presence_channel_extends","PresenceChannel","authData","channelData","setMyID","signinDonePromise","user_data","handleInternalEvent","addedMember","removedMember","onSubscription","private_channel","encrypted_channel_extends","EncryptedChannel","sharedSecret","shared_secret","UnsupportedFeature","handleEncryptedEvent","ciphertext","cipherText","getDataToEmit","usingTLS","errorCallbacks","buildErrorCallbacks","connectionCallbacks","buildConnectionCallbacks","handshakeCallbacks","buildHandshakeCallbacks","Network","getNetwork","netinfo","retryIn","sendActivityCheck","updateStrategy","connection_manager_extends","ConnectionManager","runner","updateState","startConnecting","setUnavailableTimer","disconnectInternally","handshake","connect","handshakeError","abortConnecting","clearRetryTimer","clearUnavailableTimer","abandonConnection","retryTimer","ensureAborted","unavailableTimer","unavailableTimeout","stopActivityCheck","activityTimer","pongTimeout","pong_timed_out","resetActivityCheck","shouldRetry","connected","setConnection","withErrorEmitted","tls_only","refused","backoff","previousState","newStateDescription","Channels","createEncryptedChannel","createPrivateChannel","createPresenceChannel","BadChannelName","createChannel","createChannels","createConnectionManager","connection_manager","presence_channel","encrypted_channel","createTimelineSender","timeline_sender","createHandshake","connection_handshake","createAssistantToTheTransportManager","assistant_to_the_transport_manager","livesLeft","lives","TransportManager","failFast","timeoutLimit","SequentialStrategy","minPriority","tryNextStrategy","tryStrategy","forceMinPriority","BestConnectedEverStrategy","callbackBuilder","runners","abortRunner","ttl","CachedStrategy","getLocalStorage","serializedCache","getTransportCacheKey","flushTransportCache","latency","sequential_strategy","DelayedStrategy","trueBranch","falseBranch","IfStrategy","FirstConnectedStrategy","testSupportsStrategy","getRequest","xdr","XDomainRequest","RequestTimedOut","onprogress","onChunk","abortRequest","http_request_extends","HTTPRequest","unloader","addUnloadListener","removeUnloadListener","advanceBuffer","isBufferTooLong","unreadData","endOfLinePosition","getUniqueURL","randomNumber","randomInt","TimelineLevel","CONNECTING","openStream","HTTPSocket","sendRaw","sendHeartbeat","createSocketRequest","closeStream","onHeartbeat","urlParts","getReceiveURL","onFinished","reconnect","Yt","getXHRAPI","getDefaultStrategy","baseOptions","defineTransport","definedTransports","defineTransportStrategy","wsStrategy","ws_options","wsHost","wsPort","wssPort","wsPath","wss_options","sockjs_options","httpHost","httpPort","httpsPort","ws_manager","transport_manager","streaming_manager","ws_transport","wss_transport","sockjs_transport","xhr_streaming_transport","xdr_streaming_transport","xhr_polling_transport","xdr_polling_transport","ws_loop","wss_loop","sockjs_loop","streaming_loop","if_strategy","polling_loop","http_loop","best_connected_ever_strategy","delayed_strategy","http_fallback_loop","cached_strategy","first_connected_strategy","Transports","createSocket","http_streaming_socket","http_polling_socket","http_socket","createRequest","http_xhr_request","http_request","http_http","http_xdomain_request","jsonp_timeline","WebSocket","MozWebSocket","setup","PusherClass","Pusher","initializeOnDocumentBody","onDocumentBody","getProtocol","getAuthorizers","ajax","xhr_auth","jsonp","jsonp_auth","jsonp_request","script_request","createXMLHttpRequest","createMicrosoftXHR","ActiveXObject","createXDR","documentProtocol","uniqueID","Timeline","timeline_level","sendfn","bundle","lib","cluster","features","TransportStrategy","failAttempt","UnsupportedStrategy","TransportPriorityTooLow","onInitialized","serializedTransport","TransportClosed","strategy_builder_defineTransport","transportClass","strategy_builder_Transports","UnsupportedTransport","enabledTransports","disabledTransports","strategy_builder_UnsupportedStrategy","transport_strategy","getAssistant","Qt","getHttpHost","getWebsocketHost","getWebsocketHostFromCluster","shouldUseTLS","forceTLS","getEnableStatsConfig","enableStats","disableStats","buildUserAuthenticator","userAuthentication","customHandler","paramsProvider","dynamicParams","buildChannelAuthorizer","channelAuthorization","authTransport","authEndpoint","channelAuthorizerGenerator","deprecatedAuthorizerOptions","bindWatchlistInternalEvent","watchlist_extends","WatchlistFacade","watchlistEvent","_signin","_newSigninPromiseIfNeeded","watchlist","_onSigninSuccess","serverToUserChannel","user_extends","UserFacade","signin_requested","userAuthenticator","_onAuthorize","_signinDoneResolve","_subscribeChannels","bind_global","reinstateSubscription","rej","setDone","app_key","statsHost","timelineParams","global_emitter","sessionID","timeline_timeline","getClientFeatures","timelineSender","subscribeAll","isUsingTLS","isReady","timelineSenderTimer","PeriodicTimer","event_name","channel_name","cancelSubscription","signin","pusher_Pusher","PusherWithEncryption","nacl_fast","pusher_with_encryption_extends","slug","appendChar","customMap","hexRegex","numRegex","consider","decimalPoint","eNotation","trimmedStr","skipLike","numTrimmedByZeros","numStr","candidateSelectors","candidateSelector","NoElement","getCandidates","includeContainer","candidates","getCandidatesIteratively","elementsToCheck","assigned","assignedElements","nestedCandidates","scopeParent","getShadowRoot","validShadowRoot","shadowRootFilter","getTabindex","isScope","tabIndex","sortOrderedTabbables","documentOrder","isInput","isZeroArea","isNodeMatchingSelectorFocusable","disabled","displayCheck","visibility","nodeUnderDetails","originalNode","rootNode","assignedSlot","nodeRootHost","attached","_nodeRootHost","_nodeRootHost2","getClientRects","isNodeMatchingSelectorTabbable","radioSet","radioScope","queryRadios","CSS","isValidShadowRootTabbable","shadowHostNode","sortByOrder","regularTabbables","orderedTabbables","candidateTabindex","sortable","focusableCandidateSelector","_createClass","protoProps","staticProps","_classCallCheck","TetherBase","zeroElement","getActualBoundingClientRect","boundingRect","_frameElement","frameElement","frameRect","getScrollParents","parents","overflowX","overflowY","zeroPosCache","getOrigin","removeUtilElements","getBounds","docEl","clientTop","clientLeft","getOffsetParent","_scrollBarSize","getScrollBarSize","pointerEvents","widthContained","widthScroll","getClassName","setClassName","SVGAnimatedString","baseVal","updateClasses","bindings","_bindings$event$i","Utils","_slicedToArray","_arr","_x6","_x7","_x8","_again","_TetherBase$Utils","within","lastCall","lastDuration","pendingTimeout","transformKey","tethers","tether","MIRROR_LR","center","MIRROR_TB","middle","OFFSET_MAP","attachmentToOffset","addOffset","offsetToPx","parseOffset","_value$split","_value$split2","parseAttachment","TetherClass","_Evented","subClass","superClass","classPrefix","_this2","targetOffset","targetAttachment","targetModifier","jquery","getClass","addTargetClasses","scrollParents","scrollBottom","borderTopWidth","borderBottomWidth","borderLeftWidth","fitAdj","scrollPercentage","_this3","_this4","_this5","elementAttach","targetAttach","_this6","_addAttachClasses","side","_this7","flushChanges","clearCache","relativeToAttachment","updateAttachClasses","elementPos","lastSize","_lastSize","targetPos","getTargetBounds","targetSize","manualOffset","manualTargetOffset","scrollbarSize","viewport","optimizations","moveElement","offsetPosition","offsetParentStyle","offsetParentSize","offsetBorder","move","_this8","same","point","transcribe","_same","gpu","yPos","xPos","devicePixelRatio","moved","bodyElement","offsetParentIsBody","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement","writeCSS","Tether","BOUNDS_FORMAT","constraints","targetHeight","targetWidth","allClasses","outOfBoundsClass","pinnedClass","addClasses","tAttachment","eAttachment","pin","changeAttachX","changeAttachY","_attachment$split","_attachment$split2","oobClass","pinned","oob","abutted","targetPosSide","shiftTop","_shift2","timeoutDuration","longerTimeoutBrowsers","scheduled","functionToCheck","getStyleComputedProperty","getParentNode","getScrollParent","getReferenceNode","referenceNode","isIE11","MSInputMethodContext","isIE10","noOffsetParent","findCommonOffsetParent","element1","element2","compareDocumentPosition","DOCUMENT_POSITION_FOLLOWING","setStart","setEnd","commonAncestorContainer","firstElementChild","element1root","getScroll","upperSide","scrollingElement","getBordersSize","axis","sideA","sideB","computedStyle","getWindowSizes","getClientRect","sizes","horizScrollbar","vertScrollbar","getOffsetRectRelativeToArbitraryNode","fixedPosition","runIsIE","isHTML","childrenRect","parentRect","scrollParent","marginTop","marginLeft","isFixed","getFixedPositionOffsetParent","getBoundaries","popper","boundariesElement","boundaries","excludeScroll","relativeOffset","boundariesNode","isPaddingNumber","computeAutoPlacement","placement","refRect","rects","sortedAreas","area","filteredAreas","computedPlacement","variation","getReferenceOffsets","getOuterSizes","marginBottom","marginRight","getOppositePlacement","getPopperOffsets","referenceOffsets","popperRect","popperOffsets","isHoriz","mainSide","secondarySide","measurement","secondaryMeasurement","runModifiers","modifiers","ends","isDestroyed","arrowStyles","flipped","positionFixed","flip","originalPlacement","isCreated","onUpdate","onCreate","isModifierEnabled","modifierName","getSupportedPropertyName","upperProp","toCheck","removeAttribute","willChange","disableEventListeners","removeOnDestroy","getWindow","attachToScrollParents","isBody","setupEventListeners","updateBound","scrollElement","eventsEnabled","enableEventListeners","scheduleUpdate","isNumeric","setStyles","isFirefox","isModifierRequired","requestingName","requestedName","requesting","isRequired","requested","validPlacements","placements","clockwise","basePlacement","shiftvariation","isVertical","shiftOffsets","useHeight","fragments","divider","splitRegex","mergeWithPrevious","index2","preventOverflow","transformProp","popperStyles","escapeWithReference","secondary","keepTogether","opSide","arrow","arrowElement","sideCapitalized","altSide","arrowElementSize","popperMarginSide","popperBorderSide","sideValue","placementOpposite","flipOrder","behavior","refOffsets","overlapsRef","overflowsLeft","overflowsRight","overflowsTop","overflowsBottom","overflowsBoundaries","flippedVariationByRef","flipVariations","flippedVariationByContent","flipVariationsByContent","flippedVariation","subtractLength","computeStyle","legacyGpuAccelerationOption","gpuAcceleration","offsetParentRect","shouldRound","noRound","referenceWidth","popperWidth","isVariation","horizontalToInteger","verticalToInteger","prefixedProperty","invertTop","invertLeft","applyStyle","modifierOptions","Popper","Defaults","PopperUtils","DEFAULT_OPTIONS","arrowSelector","innerSelector","Tooltip","_isOpen","_popperOptions","_setEventListeners","allowHtml","tooltipGenerator","tooltipNode","titleNode","_addTitleContent","_isOpening","_tooltipNode","popperInstance","_findContainer","_append","popperOptions","_hide","directEvents","oppositeEvents","usedByTooltip","_scheduleShow","_scheduleHide","closeOnClickOutside","computedDelay","_showTimeout","_show","_setTooltipNodeEvent","_clearTitleContent","lastTitle","_dispose","toggle","updateTitleContent","_updateTitleContent","relatedreference","relatedreference2","evt2","FUNC_TYPE","UNDEF_TYPE","OBJ_TYPE","STR_TYPE","MODEL","TYPE","VENDOR","VERSION","ARCHITECTURE","CONSOLE","MOBILE","TABLET","SMARTTV","WEARABLE","EMBEDDED","AMAZON","APPLE","ASUS","BLACKBERRY","BROWSER","CHROME","FIREFOX","HUAWEI","LG","MICROSOFT","MOTOROLA","OPERA","SAMSUNG","SHARP","SONY","XIAOMI","ZEBRA","enumerize","enums","str1","str2","lowerize","rgxMapper","strMapper","windowsVersionMap","ME","XP","Vista","RT","cpu","engine","EDGE","UAParser","getResult","_ua","_rgxmap","mergedRegexes","getBrowser","_browser","getCPU","_cpu","getDevice","_device","getEngine","_engine","getOS","_os","setUA","CPU","DEVICE","ENGINE","OS","Zepto","ActionTypes","SpecialTargets","Start","Stop","Raise","Send","Cancel","NullEvent","Assign","After","DoneState","DoneInvoke","Init","Invoke","ErrorExecution","ErrorCommunication","ErrorPlatform","ErrorCustom","Update","Pure","Choose","Internal","raise","nullEvent","doneState","errorExecution","errorPlatform","choose","pure","STATE_DELIMITER","EMPTY_ACTIVITY_MAP","DEFAULT_GUARD_TYPE","IS_PRODUCTION","matchesState","parentStateId","childStateId","parentStateValue","toStateValue","childStateValue","getEventType","toStatePath","stateId","stateValue","pathToStateValue","statePath","collectionKeys","mapFilterValues","e_1_1","props_1","props_1_1","e_2_1","toStatePaths","subStateValue","subPath","toArrayStrict","mapContext","mapper","e_5","subMapper","e_5_1","isPromiseLike","updateHistoryStates","hist","states","subHist","updateContext","assignActions","updatedContext","assignAction","e_7","assignment","partialUpdate","propAssignment","e_7_1","toGuard","guardMap","symbolObservable","observable","isMachine","currentId","toEventObject","toSCXMLEvent","scxmlEvent","$$type","toTransitionConfigArray","configLike","transitionLike","evaluateGuard","machine","guards","guardMeta","cond","condFn","toInvokeSource","toObserver","nextHandler","completionHandler","isObserver","createInvokeId","stateNodeId","getActionFunction","actionType","actionFunctionMap","toActionObject","actionObject","toActionObjects","subAction","toActivityDefinition","raise$1","resolveRaise","send$1","resolveSend","delaysMap","resolvedDelay","resolvedEvent","configDelay","resolvedTarget","sendParent","sendTo","actor","sendUpdate","respond","defaultLogExpr","expr","log$1","resolveLog","sendId","cancel$1","activityDef","actorRef","resolveStop","actorRefOrString","resolvedActorRef","assign$1","isActionObject","delayRef","idSuffix","doneInvoke","getActions","forwardTo","originalTarget_1","escalate","errorData","error$1","conds","pluckAssigns","actionBlocks","actionBlocks_1","actionBlocks_1_1","resolveActions","currentState","currentContext","predictableExec","preserveActionOrder","preservedContexts","deferredToBlockEnd","handleAction","sendAction","delays","choose$1","matchedActions","actions","resolvedActionsFromChoose","resolvedContextFromChoose","pure$1","resolvedActionsFromPure","resolvedContext","stop$1","resolvedActionObject","exec_1","contextIndex_1","resolvedActions","block_1","block_1_1","serviceStack","provide","consume","createNullActor","getSnapshot","createDeferredActor","entity","tempActor","initialState_1","withContext","initialState","toActorRef","actorRefLike","isLeafNode","stateNode","getAllChildren","getChildren","getAllStateNodes","stateNodes","getConfiguration","prevStateNodes","e_3","e_4","prevAdjList","getAdjList","configuration_1","configuration_1_1","adjList","configuration_2","configuration_2_1","initialStateNodes","e_3_1","configuration_3","configuration_3_1","e_4_1","getValueFromAdj","baseNode","childStateNodes","childStateNode","csn","configuration_4","configuration_4_1","isInFinalState","getTagsFromConfiguration","stateValuesEqual","_sessionid","historyValue","toStrings","transitions","ownEvents","inert","valueKeys","jsonValues","hasTag","can","transitionData","getTransitionData","deferEvents","Scheduler","processingEvent","initialized","flushEvents","sessionIdIndex","spawnBehavior","mailbox","flushing","event_1","actorCtx","handleError","InterpreterStatus","DEFAULT_SPAWN_OPTIONS","autoForward","NotStarted","Running","Stopped","Interpreter","delayedEventsMap","contextListeners","stopListeners","doneListeners","eventListeners","sendListeners","_outgoingQueue","scheduler","nextState","_nextState","isParent","predictableActionArguments","_exec","actionOrExec","invokeSource","serviceCreator","resolvedData","spawn","spawnActivity","stopChild","clock","resolvedId","_initialState","actionsConfig","devTools","_g","finalChildStateNode","doneData","_stopChildren","onTransition","nextListenerOrObserver","completeListener","completeOnce","onDone","onStop","onSend","onChange","resolvedState","resolveState","attachDev","e_6","e_8","e_9","e_10","e_6_1","e_8_1","e_9_1","e_10_1","exitActions","onExit","e_11","batchChanged","batchedActions","_loop_1","events_1","events_1_1","e_11_1","nextEvents","nextEvent","e_12","e_12_1","childId","spawnPromise","spawnCallback","spawnActor","spawnObservable","spawnMachine","childService","doneEvent","canceled","errorEvent","originalError","currentError","originalStackTrace","stackTrace","unsubscribed","emitted","callbackStop","newListener","implementation","spawnEffect","__REDUX_DEVTOOLS_EXTENSION__","devToolsOptions","autoPause","stateSanitizer","jump","__xstate__","interpret","resolveSpawnOptions","nameOrOptions","isLazyEntity","toInvokeDefinition","invokeConfig","invokeDef","simpleSrc","NULL_EVENT","WILDCARD","EMPTY_OBJECT","isStateId","StateNode","_stateInfo","__xstatenode","__cache","relativeValue","initialStateValue","delayedTransitions","idMap","parallel","stateConfig","dfs","_transient","always","onEntry","exit","withConfig","definition","getDelayedTransitions","formatTransitions","sameEventType","afterConfig","mutateEntryExit","configTransition","resolvedTransition","delayedTransition","formatTransition","getStateNodes","getStateNode","subStateKeys","subStateNodes","subStateKey","handles","stateFromConfig","transitionLeafNode","transitionCompoundNode","_transition","transitionParallelNode","transitionMap","stateTransitions","enabledTransitions","entryNodes","entrySet","exitSet","selectedTransition","nextStateNodes","stateIn","in","isInState","getStateNodeById","guardPassed","allNextStateNodes","getRelativeStateNodes","isInternal","reentryNodes","targetNode","getExternalReentryNodes","possibleAncestor","resolvedConfig","prevConfig","resolvedConfig_1","resolvedConfig_1_1","prevConfig_1","prevConfig_1_1","doneEvents","grandparent","entryStates","exitStates","entryActions","invokeActions","stopActions","resolvedStateValue","getResolvedPath","stateTransition","resolveTransition","resolveRaisedTransition","originalEvent","currentActions","willTransition","resolvedConfiguration","start$1","truthy","falsy","items_1","items_1_1","raisedEvents","nonRaisedActions","invokeDefinition","invokeSrc","didUpdateContext","hasAlwaysTransitions","maybeNextState","raisedEvent","stateKey","resolvedStateId","STATE_IDENTIFIER","getStateNodeByPath","arrayStatePath","currentStateNode","subStateNode","stateIdentifier","getInitialState","historyConfig","relativeStateId","resolveHistory","initialPath","getFromRelativePath","relativePath","childStatePath","relativeStateValue","historyTarget","relativeChildPath","subHistoryValue","props_2","props_2_1","subStatePath","childStateIds","stateIds","resolveTarget","_target","isInternalTarget","transitionConfig","normalizedTarget","onConfig","wildcardConfigs","strictTransitionConfigs_1","transitionConfigArray","hasNonLastUnguardedTarget","eventText","eventlessConfig","doneConfig","settleTransitions","formattedTransitions","delayedTransitions_1","delayedTransitions_1_1","warned","Machine","initialContext","createMachine","mapState","stateMap","foundStateId","mappedStateId","matchState","patterns_1","patterns_1_1","createSchema","sendParent$1","sendUpdate$1","forwardTo$1","doneInvoke$1","_utils","addedDiff","lhs","rhs","_default","deletedDiff","_added","_interopRequireDefault","_updated","added","deletedValues","_detailed","_diff","updatedDiff","__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","src_exports","awaitAsync","dataset","BASE64_REGEX","BIC_REGEX","CUID2_REGEX","DECIMAL_REGEX","EMAIL_REGEX","EMOJI_REGEX","HEXADECIMAL_REGEX","HEX_COLOR_REGEX","IMEI_REGEX","IPV4_REGEX","IPV6_REGEX","IP_REGEX","ISO_DATE_REGEX","ISO_DATE_TIME_REGEX","ISO_TIMESTAMP_REGEX","ISO_TIME_REGEX","ISO_TIME_SECOND_REGEX","ISO_WEEK_REGEX","MAC48_REGEX","MAC64_REGEX","MAC_REGEX","NANO_ID_REGEX","OCTAL_REGEX","ULID_REGEX","UUID_REGEX","ValiError","_addIssue","_isLuhnAlgo","_isValidObjectKey","_joinExpects","_stringify","arrayAsync","bic","bigint","brand","checkAsync","checkItems","creditCard","cuid2","custom","customAsync","decimal","deleteGlobalConfig","deleteGlobalMessage","deleteSchemaMessage","deleteSpecificMessage","emoji","entriesFromList","enum","enum_","everyItem","excludes","fallbackAsync","filterItems","findItem","finite","forwardAsync","function_","getDefault","getDefaultsAsync","getDotPath","getFallback","getFallbacks","getFallbacksAsync","getGlobalConfig","getGlobalMessage","getSchemaMessage","getSpecificMessage","hexColor","hexadecimal","imei","integer","intersect","intersectAsync","ipv4","ipv6","isOfKind","isOfType","isValiError","isoDate","isoDateTime","isoTime","isoTimeSecond","isoTimestamp","keyof","lazy","lazyAsync","literal","looseObject","looseObjectAsync","looseTuple","looseTupleAsync","mac48","mac64","mapAsync","mapItems","maxBytes","minBytes","minSize","minValue","multipleOf","nan","nanoid","never","nonEmpty","nonNullable","nonNullableAsync","nonNullish","nonNullishAsync","nonOptional","nonOptionalAsync","notBytes","notLength","notSize","notValue","null","null_","nullable","nullableAsync","nullish","nullishAsync","objectAsync","objectWithRest","objectWithRestAsync","octal","optionalAsync","parseAsync","parserAsync","partial","partialAsync","partialCheck","partialCheckAsync","picklist","pipe","pipeAsync","rawCheck","rawCheckAsync","rawTransform","rawTransformAsync","readonly","recordAsync","reduceItems","requiredAsync","safeInteger","safeParse","safeParseAsync","safeParser","safeParserAsync","setAsync","setGlobalConfig","setGlobalMessage","setSchemaMessage","setSpecificMessage","someItem","sortItems","strictObject","strictObjectAsync","strictTuple","strictTupleAsync","toMaxValue","toMinValue","transformAsync","trimStart","tuple","tupleAsync","tupleWithRest","tupleWithRestAsync","ulid","undefined_","undefinedable","undefinedableAsync","unionAsync","variantAsync","void","void_","except","__copyProps","store2","store3","store4","config2","abortEarly","abortPipeEarly","expects","received","issue","requirement","isSchema","typed","NON_DIGIT_REGEX","number2","length2","value2","object2","hasOwn","_run","CREDIT_CARD_REGEX","SANITIZE_REGEX","PROVIDER_REGEX_LIST","sanitized","regex2","description_","HASH_LENGTHS","md4","md5","sha1","sha256","sha384","sha512","ripemd128","ripemd160","tiger128","tiger160","tiger192","crc32","crc32b","adler32","option","_isPartiallyTyped","pathList","addIssue","NEVER","config_","fallback2","outputDataset","flatErrors","dotPath","pathKeys","prevIssues","pathInput","pathValue","pathItem","fromEntries","itemDataset","itemDatasets","check2","enum__","class_","_merge","value1","outputs","optionDataset","mergeDataset","optionDatasets","literal_","valueDataset","valueDatasets","inputKey","keyDataset","datasets","normalDatasets","restDatasets","entryKey","entryValue","_subIssues","validDataset","typedDatasets","untypedDatasets","maxDiscriminatorPriority","invalidDiscriminatorKey","expectedDiscriminators","parseOptions","variant2","allKeys","keysAreValid","currentPriority","currentKey","pipe2","arg2","arg3","deleteDB","instanceOfAny","constructors","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","IDBTransaction","IDBRequest","unlisten","IDBCursor","IDBDatabase","continuePrimaryKey","IDBObjectStore","IDBIndex","transformCachableValue","blocked","terminated","openPromise","readMethods","writeMethods","cachedMethods","getMethod","targetFuncName","useIndex","isWrite","oldTraps","__decorate","__param","paramIndex","__esDecorate","descriptorIn","contextIn","initializers","extraInitializers","accept","access","addInitializer","__runInitializers","useValue","__propKey","__setFunctionName","__metadata","metadataValue","__createBinding","__exportStar","__spread","__await","__asyncGenerator","asyncIterator","fulfill","__asyncDelegator","__asyncValues","__makeTemplateObject","cooked","__setModuleDefault","__importStar","__importDefault","__classPrivateFieldGet","__classPrivateFieldSet","__classPrivateFieldIn","__addDisposableResource","asyncDispose","_SuppressedError","SuppressedError","suppressed","__disposeResources","hasError"],"sources":["webpack://__ember_auto_import__/./node_modules/@embroider/macros/src/addon/es-compat.js","webpack://__ember_auto_import__/../src/constants.ts","webpack://__ember_auto_import__/../src/errors.ts","webpack://__ember_auto_import__/../src/platformLoggerService.ts","webpack://__ember_auto_import__/../src/logger.ts","webpack://__ember_auto_import__/../src/internal.ts","webpack://__ember_auto_import__/../src/firebaseApp.ts","webpack://__ember_auto_import__/../src/firebaseServerApp.ts","webpack://__ember_auto_import__/../src/api.ts","webpack://__ember_auto_import__/../src/indexeddb.ts","webpack://__ember_auto_import__/../src/heartbeatService.ts","webpack://__ember_auto_import__/../src/registerCoreComponents.ts","webpack://__ember_auto_import__/../src/index.ts","webpack://__ember_auto_import__/../../src/core/errors.ts","webpack://__ember_auto_import__/../../src/core/util/log.ts","webpack://__ember_auto_import__/../../src/core/util/assert.ts","webpack://__ember_auto_import__/../../src/core/util/location.ts","webpack://__ember_auto_import__/../../src/core/util/delay.ts","webpack://__ember_auto_import__/../../src/core/util/navigator.ts","webpack://__ember_auto_import__/../../src/core/util/emulator.ts","webpack://__ember_auto_import__/../../src/core/util/fetch_provider.ts","webpack://__ember_auto_import__/../../src/api/errors.ts","webpack://__ember_auto_import__/../../src/api/index.ts","webpack://__ember_auto_import__/../../src/platform_browser/recaptcha/recaptcha.ts","webpack://__ember_auto_import__/../../src/api/authentication/recaptcha.ts","webpack://__ember_auto_import__/../../src/api/account_management/account.ts","webpack://__ember_auto_import__/../../src/core/util/time.ts","webpack://__ember_auto_import__/../../src/core/user/id_token_result.ts","webpack://__ember_auto_import__/../../src/core/user/invalidation.ts","webpack://__ember_auto_import__/../../src/core/user/proactive_refresh.ts","webpack://__ember_auto_import__/../../src/core/user/user_metadata.ts","webpack://__ember_auto_import__/../../src/core/user/reload.ts","webpack://__ember_auto_import__/../../src/core/user/token_manager.ts","webpack://__ember_auto_import__/../../src/api/authentication/token.ts","webpack://__ember_auto_import__/../../src/core/user/user_impl.ts","webpack://__ember_auto_import__/../../src/core/util/instantiator.ts","webpack://__ember_auto_import__/../../src/core/persistence/in_memory.ts","webpack://__ember_auto_import__/../../src/core/persistence/persistence_user_manager.ts","webpack://__ember_auto_import__/../../src/core/util/browser.ts","webpack://__ember_auto_import__/../../src/core/util/version.ts","webpack://__ember_auto_import__/../../src/core/auth/middleware.ts","webpack://__ember_auto_import__/../../src/core/auth/password_policy_impl.ts","webpack://__ember_auto_import__/../../src/core/auth/auth_impl.ts","webpack://__ember_auto_import__/../../src/api/password_policy/get_password_policy.ts","webpack://__ember_auto_import__/../../src/platform_browser/load_js.ts","webpack://__ember_auto_import__/../../src/platform_browser/recaptcha/recaptcha_enterprise_verifier.ts","webpack://__ember_auto_import__/../../src/core/auth/initialize.ts","webpack://__ember_auto_import__/../../src/core/auth/emulator.ts","webpack://__ember_auto_import__/../../src/core/credentials/auth_credential.ts","webpack://__ember_auto_import__/../../src/api/account_management/email_and_password.ts","webpack://__ember_auto_import__/../../src/api/authentication/email_and_password.ts","webpack://__ember_auto_import__/../../src/core/credentials/email.ts","webpack://__ember_auto_import__/../../src/api/authentication/email_link.ts","webpack://__ember_auto_import__/../../src/api/authentication/idp.ts","webpack://__ember_auto_import__/../../src/core/credentials/oauth.ts","webpack://__ember_auto_import__/../../src/api/authentication/sms.ts","webpack://__ember_auto_import__/../../src/core/credentials/phone.ts","webpack://__ember_auto_import__/../../src/core/action_code_url.ts","webpack://__ember_auto_import__/../../src/core/providers/email.ts","webpack://__ember_auto_import__/../../src/core/providers/federated.ts","webpack://__ember_auto_import__/../../src/core/providers/oauth.ts","webpack://__ember_auto_import__/../../src/core/providers/facebook.ts","webpack://__ember_auto_import__/../../src/core/providers/google.ts","webpack://__ember_auto_import__/../../src/core/providers/github.ts","webpack://__ember_auto_import__/../../src/core/credentials/saml.ts","webpack://__ember_auto_import__/../../src/core/providers/saml.ts","webpack://__ember_auto_import__/../../src/core/providers/twitter.ts","webpack://__ember_auto_import__/../../src/api/authentication/sign_up.ts","webpack://__ember_auto_import__/../../src/core/user/user_credential_impl.ts","webpack://__ember_auto_import__/../../src/mfa/mfa_error.ts","webpack://__ember_auto_import__/../../src/core/util/providers.ts","webpack://__ember_auto_import__/../../src/core/user/link_unlink.ts","webpack://__ember_auto_import__/../../src/core/user/reauthenticate.ts","webpack://__ember_auto_import__/../../src/core/strategies/credential.ts","webpack://__ember_auto_import__/../../src/mfa/mfa_info.ts","webpack://__ember_auto_import__/../../src/core/strategies/action_code_settings.ts","webpack://__ember_auto_import__/../../src/core/strategies/email_and_password.ts","webpack://__ember_auto_import__/../../src/core/user/account_info.ts","webpack://__ember_auto_import__/../../src/core/user/additional_user_info.ts","webpack://__ember_auto_import__/../../src/core/index.ts","webpack://__ember_auto_import__/../../src/mfa/mfa_session.ts","webpack://__ember_auto_import__/../../src/mfa/mfa_resolver.ts","webpack://__ember_auto_import__/../../src/api/account_management/mfa.ts","webpack://__ember_auto_import__/../../src/mfa/mfa_user.ts","webpack://__ember_auto_import__/../../src/core/persistence/index.ts","webpack://__ember_auto_import__/../../src/platform_browser/persistence/browser.ts","webpack://__ember_auto_import__/../../src/platform_browser/persistence/local_storage.ts","webpack://__ember_auto_import__/../../src/platform_browser/persistence/session_storage.ts","webpack://__ember_auto_import__/../../src/platform_browser/messagechannel/receiver.ts","webpack://__ember_auto_import__/../../src/platform_browser/messagechannel/promise.ts","webpack://__ember_auto_import__/../../src/core/util/event_id.ts","webpack://__ember_auto_import__/../../src/platform_browser/messagechannel/sender.ts","webpack://__ember_auto_import__/../../src/platform_browser/auth_window.ts","webpack://__ember_auto_import__/../../src/platform_browser/util/worker.ts","webpack://__ember_auto_import__/../../src/platform_browser/persistence/indexed_db.ts","webpack://__ember_auto_import__/../../src/platform_browser/recaptcha/recaptcha_mock.ts","webpack://__ember_auto_import__/../../src/platform_browser/recaptcha/recaptcha_loader.ts","webpack://__ember_auto_import__/../../src/platform_browser/recaptcha/recaptcha_verifier.ts","webpack://__ember_auto_import__/../../src/platform_browser/strategies/phone.ts","webpack://__ember_auto_import__/../../src/api/authentication/mfa.ts","webpack://__ember_auto_import__/../../src/platform_browser/providers/phone.ts","webpack://__ember_auto_import__/../../src/core/util/resolver.ts","webpack://__ember_auto_import__/../../src/core/strategies/idp.ts","webpack://__ember_auto_import__/../../src/core/strategies/abstract_popup_redirect_operation.ts","webpack://__ember_auto_import__/../../src/platform_browser/strategies/popup.ts","webpack://__ember_auto_import__/../../src/core/strategies/redirect.ts","webpack://__ember_auto_import__/../../src/platform_browser/strategies/redirect.ts","webpack://__ember_auto_import__/../../src/core/auth/auth_event_manager.ts","webpack://__ember_auto_import__/../../src/api/project_config/get_project_config.ts","webpack://__ember_auto_import__/../../src/core/util/validate_origin.ts","webpack://__ember_auto_import__/../../src/platform_browser/iframe/gapi.ts","webpack://__ember_auto_import__/../../src/platform_browser/iframe/iframe.ts","webpack://__ember_auto_import__/../../src/platform_browser/util/popup.ts","webpack://__ember_auto_import__/../../src/core/util/handler.ts","webpack://__ember_auto_import__/../../src/platform_browser/popup_redirect.ts","webpack://__ember_auto_import__/../../src/mfa/mfa_assertion.ts","webpack://__ember_auto_import__/../../src/platform_browser/mfa/assertions/phone.ts","webpack://__ember_auto_import__/../../src/mfa/assertions/totp.ts","webpack://__ember_auto_import__/../../src/core/auth/firebase_internal.ts","webpack://__ember_auto_import__/../../src/platform_browser/index.ts","webpack://__ember_auto_import__/../../src/core/auth/register.ts","webpack://__ember_auto_import__/../../src/model/enum_maps.ts","webpack://__ember_auto_import__/../../src/core/strategies/email.ts","webpack://__ember_auto_import__/../../src/api/authentication/create_auth_uri.ts","webpack://__ember_auto_import__/../../src/core/strategies/email_link.ts","webpack://__ember_auto_import__/../../src/core/strategies/anonymous.ts","webpack://__ember_auto_import__/../../src/core/strategies/custom_token.ts","webpack://__ember_auto_import__/../../src/api/authentication/custom_token.ts","webpack://__ember_auto_import__/../../src/api/account_management/profile.ts","webpack://__ember_auto_import__/../src/component.ts","webpack://__ember_auto_import__/../src/provider.ts","webpack://__ember_auto_import__/../src/component_container.ts","webpack://__ember_auto_import__/../src/auth/user.ts","webpack://__ember_auto_import__/../src/core/version.ts","webpack://__ember_auto_import__/../src/util/log.ts","webpack://__ember_auto_import__/../src/platform/browser/format_json.ts","webpack://__ember_auto_import__/../src/util/assert.ts","webpack://__ember_auto_import__/../src/util/error.ts","webpack://__ember_auto_import__/../src/util/promise.ts","webpack://__ember_auto_import__/../src/api/credentials.ts","webpack://__ember_auto_import__/../src/platform/browser/random_bytes.ts","webpack://__ember_auto_import__/../src/util/misc.ts","webpack://__ember_auto_import__/../src/lite-api/timestamp.ts","webpack://__ember_auto_import__/../src/core/snapshot_version.ts","webpack://__ember_auto_import__/../src/model/path.ts","webpack://__ember_auto_import__/../src/model/document_key.ts","webpack://__ember_auto_import__/../src/model/field_index.ts","webpack://__ember_auto_import__/../src/local/persistence_transaction.ts","webpack://__ember_auto_import__/../src/local/local_store.ts","webpack://__ember_auto_import__/../src/local/persistence_promise.ts","webpack://__ember_auto_import__/../src/local/simple_db.ts","webpack://__ember_auto_import__/../src/local/index_backfiller.ts","webpack://__ember_auto_import__/../src/core/listen_sequence.ts","webpack://__ember_auto_import__/../src/util/types.ts","webpack://__ember_auto_import__/../src/local/encoded_resource_path.ts","webpack://__ember_auto_import__/../src/local/indexeddb_sentinels.ts","webpack://__ember_auto_import__/../src/local/indexeddb_schema_legacy.ts","webpack://__ember_auto_import__/../src/local/indexeddb_transaction.ts","webpack://__ember_auto_import__/../src/util/obj.ts","webpack://__ember_auto_import__/../src/util/sorted_map.ts","webpack://__ember_auto_import__/../src/util/sorted_set.ts","webpack://__ember_auto_import__/../src/model/field_mask.ts","webpack://__ember_auto_import__/../src/util/base64_decode_error.ts","webpack://__ember_auto_import__/../src/util/byte_string.ts","webpack://__ember_auto_import__/../src/platform/browser/base64.ts","webpack://__ember_auto_import__/../src/model/normalize.ts","webpack://__ember_auto_import__/../src/model/server_timestamps.ts","webpack://__ember_auto_import__/../src/core/database_info.ts","webpack://__ember_auto_import__/../src/model/values.ts","webpack://__ember_auto_import__/../src/model/object_value.ts","webpack://__ember_auto_import__/../src/model/document.ts","webpack://__ember_auto_import__/../src/core/bound.ts","webpack://__ember_auto_import__/../src/core/order_by.ts","webpack://__ember_auto_import__/../src/core/filter.ts","webpack://__ember_auto_import__/../src/core/target.ts","webpack://__ember_auto_import__/../src/core/query.ts","webpack://__ember_auto_import__/../src/util/obj_map.ts","webpack://__ember_auto_import__/../src/model/collections.ts","webpack://__ember_auto_import__/../src/remote/number_serializer.ts","webpack://__ember_auto_import__/../src/model/transform_operation.ts","webpack://__ember_auto_import__/../src/model/mutation.ts","webpack://__ember_auto_import__/../src/model/mutation_batch.ts","webpack://__ember_auto_import__/../src/model/overlay.ts","webpack://__ember_auto_import__/../src/core/aggregate.ts","webpack://__ember_auto_import__/../src/remote/existence_filter.ts","webpack://__ember_auto_import__/../src/remote/rpc_error.ts","webpack://__ember_auto_import__/../src/util/testing_hooks_spi.ts","webpack://__ember_auto_import__/../src/platform/browser/text_serializer.ts","webpack://__ember_auto_import__/../src/remote/bloom_filter.ts","webpack://__ember_auto_import__/../src/remote/remote_event.ts","webpack://__ember_auto_import__/../src/remote/watch_change.ts","webpack://__ember_auto_import__/../src/remote/serializer.ts","webpack://__ember_auto_import__/../src/local/target_data.ts","webpack://__ember_auto_import__/../src/local/local_serializer.ts","webpack://__ember_auto_import__/../src/local/indexeddb_bundle_cache.ts","webpack://__ember_auto_import__/../src/local/indexeddb_document_overlay_cache.ts","webpack://__ember_auto_import__/../src/index/firestore_index_value_writer.ts","webpack://__ember_auto_import__/../src/index/ordered_code_writer.ts","webpack://__ember_auto_import__/../src/index/index_byte_encoder.ts","webpack://__ember_auto_import__/../src/index/index_entry.ts","webpack://__ember_auto_import__/../src/model/target_index_matcher.ts","webpack://__ember_auto_import__/../src/util/logic_utils.ts","webpack://__ember_auto_import__/../src/local/memory_index_manager.ts","webpack://__ember_auto_import__/../src/local/indexeddb_index_manager.ts","webpack://__ember_auto_import__/../src/local/lru_garbage_collector.ts","webpack://__ember_auto_import__/../src/local/indexeddb_mutation_batch_impl.ts","webpack://__ember_auto_import__/../src/local/indexeddb_mutation_queue.ts","webpack://__ember_auto_import__/../src/core/target_id_generator.ts","webpack://__ember_auto_import__/../src/local/indexeddb_target_cache.ts","webpack://__ember_auto_import__/../src/local/lru_garbage_collector_impl.ts","webpack://__ember_auto_import__/../src/local/indexeddb_lru_delegate_impl.ts","webpack://__ember_auto_import__/../src/local/remote_document_change_buffer.ts","webpack://__ember_auto_import__/../src/local/indexeddb_remote_document_cache.ts","webpack://__ember_auto_import__/../src/local/overlayed_document.ts","webpack://__ember_auto_import__/../src/local/local_documents_view.ts","webpack://__ember_auto_import__/../src/local/memory_bundle_cache.ts","webpack://__ember_auto_import__/../src/local/memory_document_overlay_cache.ts","webpack://__ember_auto_import__/../src/local/reference_set.ts","webpack://__ember_auto_import__/../src/local/memory_mutation_queue.ts","webpack://__ember_auto_import__/../src/local/memory_remote_document_cache.ts","webpack://__ember_auto_import__/../src/local/memory_target_cache.ts","webpack://__ember_auto_import__/../src/local/memory_persistence.ts","webpack://__ember_auto_import__/../src/local/indexeddb_schema_converter.ts","webpack://__ember_auto_import__/../src/local/indexeddb_persistence.ts","webpack://__ember_auto_import__/../src/local/indexeddb_schema.ts","webpack://__ember_auto_import__/../src/local/local_view_changes.ts","webpack://__ember_auto_import__/../src/local/query_context.ts","webpack://__ember_auto_import__/../src/local/query_engine.ts","webpack://__ember_auto_import__/../src/local/local_store_impl.ts","webpack://__ember_auto_import__/../src/local/shared_client_state_schema.ts","webpack://__ember_auto_import__/../src/local/shared_client_state.ts","webpack://__ember_auto_import__/../src/remote/connectivity_monitor_noop.ts","webpack://__ember_auto_import__/../src/platform/browser/connectivity_monitor.ts","webpack://__ember_auto_import__/../src/util/debug_uid.ts","webpack://__ember_auto_import__/../src/remote/rest_connection.ts","webpack://__ember_auto_import__/../src/remote/stream_bridge.ts","webpack://__ember_auto_import__/../src/platform/browser/webchannel_connection.ts","webpack://__ember_auto_import__/../src/platform/browser/dom.ts","webpack://__ember_auto_import__/../src/platform/browser/serializer.ts","webpack://__ember_auto_import__/../src/remote/backoff.ts","webpack://__ember_auto_import__/../src/remote/persistent_stream.ts","webpack://__ember_auto_import__/../src/remote/datastore.ts","webpack://__ember_auto_import__/../src/remote/online_state_tracker.ts","webpack://__ember_auto_import__/../src/remote/remote_store.ts","webpack://__ember_auto_import__/../src/util/async_queue.ts","webpack://__ember_auto_import__/../src/model/document_set.ts","webpack://__ember_auto_import__/../src/core/view_snapshot.ts","webpack://__ember_auto_import__/../src/core/event_manager.ts","webpack://__ember_auto_import__/../src/util/bundle_reader.ts","webpack://__ember_auto_import__/../src/core/bundle_impl.ts","webpack://__ember_auto_import__/../src/core/view.ts","webpack://__ember_auto_import__/../src/core/sync_engine_impl.ts","webpack://__ember_auto_import__/../src/core/component_provider.ts","webpack://__ember_auto_import__/../src/platform/browser/connection.ts","webpack://__ember_auto_import__/../src/util/byte_stream.ts","webpack://__ember_auto_import__/../src/util/async_observer.ts","webpack://__ember_auto_import__/../src/util/bundle_reader_impl.ts","webpack://__ember_auto_import__/../src/core/transaction.ts","webpack://__ember_auto_import__/../src/core/transaction_runner.ts","webpack://__ember_auto_import__/../src/core/firestore_client.ts","webpack://__ember_auto_import__/../src/api/long_polling_options.ts","webpack://__ember_auto_import__/../src/lite-api/components.ts","webpack://__ember_auto_import__/../src/util/input_validation.ts","webpack://__ember_auto_import__/../src/lite-api/settings.ts","webpack://__ember_auto_import__/../src/lite-api/database.ts","webpack://__ember_auto_import__/../src/lite-api/reference.ts","webpack://__ember_auto_import__/../src/util/async_queue_impl.ts","webpack://__ember_auto_import__/../src/api/observer.ts","webpack://__ember_auto_import__/../src/api/bundle.ts","webpack://__ember_auto_import__/../src/api/database.ts","webpack://__ember_auto_import__/../src/lite-api/aggregate_types.ts","webpack://__ember_auto_import__/../src/lite-api/bytes.ts","webpack://__ember_auto_import__/../src/lite-api/field_path.ts","webpack://__ember_auto_import__/../src/lite-api/field_value.ts","webpack://__ember_auto_import__/../src/lite-api/geo_point.ts","webpack://__ember_auto_import__/../src/lite-api/user_data_reader.ts","webpack://__ember_auto_import__/../src/lite-api/snapshot.ts","webpack://__ember_auto_import__/../src/lite-api/query.ts","webpack://__ember_auto_import__/../src/lite-api/user_data_writer.ts","webpack://__ember_auto_import__/../src/lite-api/reference_impl.ts","webpack://__ember_auto_import__/../src/lite-api/aggregate.ts","webpack://__ember_auto_import__/../src/api/snapshot.ts","webpack://__ember_auto_import__/../src/api/reference_impl.ts","webpack://__ember_auto_import__/../src/api/aggregate.ts","webpack://__ember_auto_import__/../src/api/cache_config.ts","webpack://__ember_auto_import__/../src/core/transaction_options.ts","webpack://__ember_auto_import__/../src/lite-api/write_batch.ts","webpack://__ember_auto_import__/../src/api/transaction.ts","webpack://__ember_auto_import__/../src/lite-api/transaction.ts","webpack://__ember_auto_import__/../src/api/index_configuration.ts","webpack://__ember_auto_import__/../src/api/persistent_cache_index_manager.ts","webpack://__ember_auto_import__/../src/util/testing_hooks.ts","webpack://__ember_auto_import__/../src/register.ts","webpack://__ember_auto_import__/../src/lite-api/field_value_impl.ts","webpack://__ember_auto_import__/../src/platform/browser/byte_stream_reader.ts","webpack://__ember_auto_import__/../src/util/array.ts","webpack://__ember_auto_import__/../src/api/write_batch.ts","webpack://__ember_auto_import__/../src/assert.ts","webpack://__ember_auto_import__/../src/crypt.ts","webpack://__ember_auto_import__/../src/deepCopy.ts","webpack://__ember_auto_import__/../src/global.ts","webpack://__ember_auto_import__/../src/defaults.ts","webpack://__ember_auto_import__/../src/deferred.ts","webpack://__ember_auto_import__/../src/environment.ts","webpack://__ember_auto_import__/../src/json.ts","webpack://__ember_auto_import__/../src/jwt.ts","webpack://__ember_auto_import__/../src/obj.ts","webpack://__ember_auto_import__/../src/subscribe.ts","webpack://__ember_auto_import__/../src/validation.ts","webpack://__ember_auto_import__/../src/utf8.ts","webpack://__ember_auto_import__/../src/exponential_backoff.ts","webpack://__ember_auto_import__/../src/compat.ts","webpack://__ember_auto_import__/../src/sha1.ts","webpack://__ember_auto_import__/../src/emulator.ts","webpack://__ember_auto_import__/../src/query.ts","webpack://__ember_auto_import__/../src/formatters.ts","webpack://__ember_auto_import__/../src/promise.ts","webpack://__ember_auto_import__/../src/uuid.ts","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/base.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/es6/util/arrayiterator.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/es6/util/makeiterator.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/util/objectcreate.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/es6/util/setprototypeof.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/util/defineproperty.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/util/global.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/util/polyfill.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/es6/symbol.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/es6/util/iteratorfromarray.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/util/owns.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/es6/promise/promise.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/es6/array/values.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/es6/array/keys.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/es6/weakmap.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/es6/map.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/es6/array/find.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/util/findinternal.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/es6/array/entries.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/es6/array/from.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/es6/set.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/disposable/disposable.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/array/array.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/events/event.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/events/browserfeature.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/string/internal.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/labs/useragent/util.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/reflect/reflect.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/useragent/useragent.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/labs/useragent/browser.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/labs/useragent/engine.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/events/browserevent.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/events/eventtype.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/events/listenable.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/events/listenablekey.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/events/listener.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/events/listenermap.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/object/object.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/events/events.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/events/eventtarget.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/json/json.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/async/freelist.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/async/workqueue.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/async/run.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/string/string.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/net/xhrio.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/async/throwexception.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/timer/timer.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/async/throttle.js","webpack://__ember_auto_import__/src/com/google/javascript/jscomp/js/es6/util/inherits.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/events/eventhandler.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/labs/net/webchannel/webchanneldebug.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/labs/net/webchannel/requeststats.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/net/errorcode.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/net/eventtype.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/net/xmlhttpfactory.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/labs/net/webchannel.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/net/xmlhttp.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/labs/net/webchannel/channelrequest.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/labs/net/webchannel/environment.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/uri/uri.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/labs/net/webchannel/webchannelbase.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/disposable/dispose.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/labs/net/webchannel/wirev8.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/labs/net/webchannel/forwardchannelrequestpool.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/structs/structs.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/uri/utils.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/labs/net/webchannel/wire.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/json/nativejsonprocessor.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/labs/net/webchannel/netutils.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/net/fetchxmlhttpfactory.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/functions/functions.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/json/hybrid.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/net/httpstatus.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/net/rpc/httpcors.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/labs/net/webchannel/webchannelbasetransport.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/crypt/md5.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/crypt/hash.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/math/integer.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/labs/net/webchanneltransport.js","webpack://__ember_auto_import__/src/index.js","webpack://__ember_auto_import__/../../node_modules/google-closure-library/closure/goog/labs/net/webchanneltransportfactory.js","webpack://__ember_auto_import__/../../src/coordinator.ts","webpack://__ember_auto_import__/../../src/strategy.ts","webpack://__ember_auto_import__/../../../src/strategies/log-truncation-strategy.ts","webpack://__ember_auto_import__/../../../src/strategies/event-logging-strategy.ts","webpack://__ember_auto_import__/../../../src/strategies/connection-strategy.ts","webpack://__ember_auto_import__/../../../src/strategies/request-strategy.ts","webpack://__ember_auto_import__/../../../src/strategies/sync-strategy.ts","webpack://__ember_auto_import__/../../src/deprecate.ts","webpack://__ember_auto_import__/../../src/exception.ts","webpack://__ember_auto_import__/../../src/main.ts","webpack://__ember_auto_import__/../../src/assert.ts","webpack://__ember_auto_import__/../../src/task-processor.ts","webpack://__ember_auto_import__/../../src/notifier.ts","webpack://__ember_auto_import__/../../src/evented.ts","webpack://__ember_auto_import__/../../src/task-queue.ts","webpack://__ember_auto_import__/../../src/bucket.ts","webpack://__ember_auto_import__/../../src/log.ts","webpack://__ember_auto_import__/../../src/operation-term.ts","webpack://__ember_auto_import__/../../src/query-term.ts","webpack://__ember_auto_import__/../../src/query.ts","webpack://__ember_auto_import__/../../src/request.ts","webpack://__ember_auto_import__/../../src/response.ts","webpack://__ember_auto_import__/../../src/source.ts","webpack://__ember_auto_import__/../../src/transform.ts","webpack://__ember_auto_import__/../../../src/source-interfaces/pullable.ts","webpack://__ember_auto_import__/../../../src/source-interfaces/pushable.ts","webpack://__ember_auto_import__/../../../src/source-interfaces/queryable.ts","webpack://__ember_auto_import__/../../../src/source-interfaces/syncable.ts","webpack://__ember_auto_import__/../../../src/source-interfaces/updatable.ts","webpack://__ember_auto_import__/../../src/identity-map.ts","webpack://__ember_auto_import__/../../../src/lib/exceptions.ts","webpack://__ember_auto_import__/../../../src/serializers/jsonapi-serializers.ts","webpack://__ember_auto_import__/../../../src/lib/query-params.ts","webpack://__ember_auto_import__/../../src/jsonapi-url-builder.ts","webpack://__ember_auto_import__/../../../src/serializers/jsonapi-base-serializer.ts","webpack://__ember_auto_import__/../../../src/serializers/jsonapi-atomic-operation-serializer.ts","webpack://__ember_auto_import__/../../../src/serializers/jsonapi-resource-serializer.ts","webpack://__ember_auto_import__/../../../src/serializers/jsonapi-resource-identity-serializer.ts","webpack://__ember_auto_import__/../../../src/serializers/jsonapi-document-serializer.ts","webpack://__ember_auto_import__/../../../src/serializers/jsonapi-resource-field-serializer.ts","webpack://__ember_auto_import__/../../../src/serializers/jsonapi-serializer-builder.ts","webpack://__ember_auto_import__/../../src/jsonapi-request-processor.ts","webpack://__ember_auto_import__/../../../src/lib/query-requests.ts","webpack://__ember_auto_import__/../../../src/lib/transform-requests.ts","webpack://__ember_auto_import__/../../src/jsonapi-source.ts","webpack://__ember_auto_import__/../../src/jsonapi-serializer.ts","webpack://__ember_auto_import__/../../../src/serializers/jsonapi-atomic-operations-document-serializer.ts","webpack://__ember_auto_import__/../../../src/serializers/jsonapi-atomic-results-document-serializer.ts","webpack://__ember_auto_import__/../../../src/utils/hamt.ts","webpack://__ember_auto_import__/../../src/immutable-map.ts","webpack://__ember_auto_import__/../../src/record-cache.ts","webpack://__ember_auto_import__/../../../src/live-query/live-query.ts","webpack://__ember_auto_import__/../../../src/live-query/record-change.ts","webpack://__ember_auto_import__/../../../src/live-query/sync-live-query.ts","webpack://__ember_auto_import__/../../src/sync-operation-processor.ts","webpack://__ember_auto_import__/../../../../src/operation-processors/utils/cache-integrity-utils.ts","webpack://__ember_auto_import__/../../../src/operation-processors/sync-cache-integrity-processor.ts","webpack://__ember_auto_import__/../../../../src/operation-processors/utils/schema-consistency-utils.ts","webpack://__ember_auto_import__/../../../src/operation-processors/sync-schema-consistency-processor.ts","webpack://__ember_auto_import__/../../../src/operation-processors/sync-schema-validation-processor.ts","webpack://__ember_auto_import__/../../../src/operators/sync-inverse-transform-operators.ts","webpack://__ember_auto_import__/../../../src/operators/sync-query-operators.ts","webpack://__ember_auto_import__/../../../src/operators/sync-transform-operators.ts","webpack://__ember_auto_import__/../../src/sync-record-cache.ts","webpack://__ember_auto_import__/../../src/simple-record-transform-buffer.ts","webpack://__ember_auto_import__/../../../src/operators/async-transform-operators.ts","webpack://__ember_auto_import__/../../src/async-record-cache.ts","webpack://__ember_auto_import__/../../src/memory-cache.ts","webpack://__ember_auto_import__/../../src/memory-source.ts","webpack://__ember_auto_import__/../../src/record.ts","webpack://__ember_auto_import__/../../src/array-validator.ts","webpack://__ember_auto_import__/../../src/date-validator.ts","webpack://__ember_auto_import__/../../src/standard-validators.ts","webpack://__ember_auto_import__/../../src/boolean-validator.ts","webpack://__ember_auto_import__/../../src/number-validator.ts","webpack://__ember_auto_import__/../../src/object-validator.ts","webpack://__ember_auto_import__/../../src/string-validator.ts","webpack://__ember_auto_import__/../../src/validator.ts","webpack://__ember_auto_import__/../../src/record-exceptions.ts","webpack://__ember_auto_import__/../../src/record-key-map.ts","webpack://__ember_auto_import__/../../src/record-operation.ts","webpack://__ember_auto_import__/../../../src/record-validators/standard-record-validators.ts","webpack://__ember_auto_import__/../../src/record-operation-term.ts","webpack://__ember_auto_import__/../../src/record-query-term.ts","webpack://__ember_auto_import__/../../src/record-query-builder.ts","webpack://__ember_auto_import__/../../src/record-schema.ts","webpack://__ember_auto_import__/../../src/record-transform-builder.ts","webpack://__ember_auto_import__/../../../src/record-validators/record-attribute-validator.ts","webpack://__ember_auto_import__/../../../src/record-validators/record-field-definition-validator.ts","webpack://__ember_auto_import__/../../../src/record-validators/record-identity-validator.ts","webpack://__ember_auto_import__/../../../src/record-validators/record-key-validator.ts","webpack://__ember_auto_import__/../../../src/record-validators/record-operation-validator.ts","webpack://__ember_auto_import__/../../../src/record-validators/record-relationship-validator.ts","webpack://__ember_auto_import__/../../../src/record-validators/record-type-validator.ts","webpack://__ember_auto_import__/../../../src/record-validators/record-validator.ts","webpack://__ember_auto_import__/../../../src/record-validators/related-record-validator.ts","webpack://__ember_auto_import__/../../../src/record-validators/standard-record-validator-dict.ts","webpack://__ember_auto_import__/../../../src/record-validators/record-query-expression-validator.ts","webpack://__ember_auto_import__/../../../src/record-validators/record-validator-builder.ts","webpack://__ember_auto_import__/../../src/validator-builder.ts","webpack://__ember_auto_import__/../../src/standard-record-normalizer.ts","webpack://__ember_auto_import__/../../src/record-source.ts","webpack://__ember_auto_import__/../../src/base-serializer.ts","webpack://__ember_auto_import__/../../src/boolean-serializer.ts","webpack://__ember_auto_import__/../../src/date-serializer.ts","webpack://__ember_auto_import__/../../src/date-time-serializer.ts","webpack://__ember_auto_import__/../../src/inflector.ts","webpack://__ember_auto_import__/../../src/noop-serializer.ts","webpack://__ember_auto_import__/../../src/number-serializer.ts","webpack://__ember_auto_import__/../../src/standard-inflectors.ts","webpack://__ember_auto_import__/../../src/string-serializer.ts","webpack://__ember_auto_import__/../../src/serializer-builders.ts","webpack://__ember_auto_import__/../../src/arrays.ts","webpack://__ember_auto_import__/../../src/eq.ts","webpack://__ember_auto_import__/../../src/objects.ts","webpack://__ember_auto_import__/../../src/strings.ts","webpack://__ember_auto_import__/../../src/uuid.ts","webpack://__ember_auto_import__/../../../src/integrations/functiontostring.ts","webpack://__ember_auto_import__/../../../src/integrations/inboundfilters.ts","webpack://__ember_auto_import__/../../src/constants.ts","webpack://__ember_auto_import__/../../src/eventProcessors.ts","webpack://__ember_auto_import__/../../src/session.ts","webpack://__ember_auto_import__/../../src/scope.ts","webpack://__ember_auto_import__/../../src/hub.ts","webpack://__ember_auto_import__/../../src/metadata.ts","webpack://__ember_auto_import__/../../../src/integrations/metadata.ts","webpack://__ember_auto_import__/../../src/version.ts","webpack://__ember_auto_import__/../../src/exports.ts","webpack://__ember_auto_import__/../../../src/utils/hasTracingEnabled.ts","webpack://__ember_auto_import__/../../../src/tracing/utils.ts","webpack://__ember_auto_import__/../../../src/tracing/errors.ts","webpack://__ember_auto_import__/../../../src/tracing/span.ts","webpack://__ember_auto_import__/../../../src/tracing/dynamicSamplingContext.ts","webpack://__ember_auto_import__/../../../src/tracing/transaction.ts","webpack://__ember_auto_import__/../../../src/tracing/idletransaction.ts","webpack://__ember_auto_import__/../../../src/tracing/hubextensions.ts","webpack://__ember_auto_import__/../../../src/transports/base.ts","webpack://__ember_auto_import__/../../../src/tracing/trace.ts","webpack://__ember_auto_import__/../../src/api.ts","webpack://__ember_auto_import__/../../../src/transports/multiplexed.ts","webpack://__ember_auto_import__/../../../src/tracing/measurement.ts","webpack://__ember_auto_import__/../../../src/helpers.ts","webpack://__ember_auto_import__/../../src/integration.ts","webpack://__ember_auto_import__/../../../src/utils/prepareEvent.ts","webpack://__ember_auto_import__/../../src/baseclient.ts","webpack://__ember_auto_import__/../../src/envelope.ts","webpack://__ember_auto_import__/../../../src/eventbuilder.ts","webpack://__ember_auto_import__/../../../src/userfeedback.ts","webpack://__ember_auto_import__/../../../src/client.ts","webpack://__ember_auto_import__/../../../../src/transports/utils.ts","webpack://__ember_auto_import__/../../../../src/transports/fetch.ts","webpack://__ember_auto_import__/../../../../src/transports/xhr.ts","webpack://__ember_auto_import__/../../../src/stack-parsers.ts","webpack://__ember_auto_import__/../../../../src/integrations/globalhandlers.ts","webpack://__ember_auto_import__/../../../../src/integrations/trycatch.ts","webpack://__ember_auto_import__/../../../../src/integrations/breadcrumbs.ts","webpack://__ember_auto_import__/../../../../src/integrations/linkederrors.ts","webpack://__ember_auto_import__/../../../../src/integrations/httpcontext.ts","webpack://__ember_auto_import__/../../../../src/integrations/dedupe.ts","webpack://__ember_auto_import__/../../../src/sdk.ts","webpack://__ember_auto_import__/../../src/sdk.ts","webpack://__ember_auto_import__/../../../src/utils/isSentryRequestUrl.ts","webpack://__ember_auto_import__/../../../src/constants.ts","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/utils.js","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/types/dist/rrweb-types.js","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/mutation.js","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/error-handler.js","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observer.js","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/cross-origin-iframe-mirror.js","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/iframe-manager.js","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/shadow-dom-manager.js","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/ext/base64-arraybuffer/dist/base64-arraybuffer.es5.js","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/serialize-args.js","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas.js","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/webgl.js","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/_virtual/image-bitmap-data-url-worker.js","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/ext/tslib/tslib.es6.js","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/2d.js","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/stylesheet-manager.js","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/processed-node-manager.js","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/index.js","webpack://__ember_auto_import__/../../../src/util/timestamp.ts","webpack://__ember_auto_import__/../../../src/coreHandlers/util/addBreadcrumbEvent.ts","webpack://__ember_auto_import__/../../../src/coreHandlers/util/domUtils.ts","webpack://__ember_auto_import__/../../../src/coreHandlers/util/onWindowOpen.ts","webpack://__ember_auto_import__/../../../src/coreHandlers/handleClick.ts","webpack://__ember_auto_import__/../../../src/util/createBreadcrumb.ts","webpack://__ember_auto_import__/../../../../../node_modules/@sentry-internal/rrweb-snapshot/es/rrweb-snapshot.js","webpack://__ember_auto_import__/../../../src/coreHandlers/util/getAttributesToRecord.ts","webpack://__ember_auto_import__/../../../src/coreHandlers/handleDom.ts","webpack://__ember_auto_import__/../../../src/util/dedupePerformanceEntries.ts","webpack://__ember_auto_import__/../../../src/util/log.ts","webpack://__ember_auto_import__/../../../src/eventBuffer/error.ts","webpack://__ember_auto_import__/../../../src/eventBuffer/EventBufferArray.ts","webpack://__ember_auto_import__/../../../src/eventBuffer/WorkerHandler.ts","webpack://__ember_auto_import__/../../../src/eventBuffer/EventBufferCompressionWorker.ts","webpack://__ember_auto_import__/../../../src/eventBuffer/EventBufferProxy.ts","webpack://__ember_auto_import__/../../../src/util/hasSessionStorage.ts","webpack://__ember_auto_import__/../../../src/util/isSampled.ts","webpack://__ember_auto_import__/../../../src/session/saveSession.ts","webpack://__ember_auto_import__/../../../src/session/Session.ts","webpack://__ember_auto_import__/../../../src/session/createSession.ts","webpack://__ember_auto_import__/../../../src/util/isExpired.ts","webpack://__ember_auto_import__/../../../src/util/isSessionExpired.ts","webpack://__ember_auto_import__/../../../src/session/shouldRefreshSession.ts","webpack://__ember_auto_import__/../../../src/session/loadOrCreateSession.ts","webpack://__ember_auto_import__/../../../src/session/fetchSession.ts","webpack://__ember_auto_import__/../../../src/util/addEvent.ts","webpack://__ember_auto_import__/../../../src/util/eventUtils.ts","webpack://__ember_auto_import__/../../../src/coreHandlers/handleAfterSendEvent.ts","webpack://__ember_auto_import__/../../../src/util/createPerformanceSpans.ts","webpack://__ember_auto_import__/../../../src/coreHandlers/util/addNetworkBreadcrumb.ts","webpack://__ember_auto_import__/../../../src/util/shouldFilterRequest.ts","webpack://__ember_auto_import__/../../../src/util/truncateJson/constants.ts","webpack://__ember_auto_import__/../../../src/util/truncateJson/completeJson.ts","webpack://__ember_auto_import__/../../../src/util/truncateJson/evaluateJson.ts","webpack://__ember_auto_import__/../../../src/util/truncateJson/fixJson.ts","webpack://__ember_auto_import__/../../../src/coreHandlers/util/networkUtils.ts","webpack://__ember_auto_import__/../../../src/coreHandlers/util/fetchUtils.ts","webpack://__ember_auto_import__/../../../src/coreHandlers/handleScope.ts","webpack://__ember_auto_import__/../../../src/util/addGlobalListeners.ts","webpack://__ember_auto_import__/../../../src/util/addMemoryEntry.ts","webpack://__ember_auto_import__/../../../src/util/createPerformanceEntries.ts","webpack://__ember_auto_import__/../../../src/util/handleRecordingEmit.ts","webpack://__ember_auto_import__/../../../src/util/sendReplayRequest.ts","webpack://__ember_auto_import__/../../../src/util/sendReplay.ts","webpack://__ember_auto_import__/../../../src/util/prepareRecordingData.ts","webpack://__ember_auto_import__/../../../src/util/prepareReplayEvent.ts","webpack://__ember_auto_import__/../../../src/util/createReplayEnvelope.ts","webpack://__ember_auto_import__/../../../src/util/throttle.ts","webpack://__ember_auto_import__/../../../src/replay.ts","webpack://__ember_auto_import__/../../../src/util/debounce.ts","webpack://__ember_auto_import__/../../../src/session/clearSession.ts","webpack://__ember_auto_import__/../../../src/types/rrweb.ts","webpack://__ember_auto_import__/../../../src/eventBuffer/index.ts","webpack://__ember_auto_import__/../../../../replay-worker/build/npm/esm/index.js","webpack://__ember_auto_import__/../../../../replay-worker/build/npm/esm/worker.ts","webpack://__ember_auto_import__/../../../src/coreHandlers/handleHistory.ts","webpack://__ember_auto_import__/../../../src/coreHandlers/handleNetworkBreadcrumbs.ts","webpack://__ember_auto_import__/../../../src/coreHandlers/util/xhrUtils.ts","webpack://__ember_auto_import__/../../../src/coreHandlers/handleFetch.ts","webpack://__ember_auto_import__/../../../src/coreHandlers/handleXhr.ts","webpack://__ember_auto_import__/../../../src/coreHandlers/handleGlobalEvent.ts","webpack://__ember_auto_import__/../../../src/util/isRrwebError.ts","webpack://__ember_auto_import__/../../../src/coreHandlers/util/shouldSampleForBufferEvent.ts","webpack://__ember_auto_import__/../../../src/coreHandlers/performanceObserver.ts","webpack://__ember_auto_import__/../../../src/coreHandlers/handleKeyboardEvent.ts","webpack://__ember_auto_import__/../../../src/util/getPrivacyOptions.ts","webpack://__ember_auto_import__/../../../src/util/isBrowser.ts","webpack://__ember_auto_import__/../../../src/integration.ts","webpack://__ember_auto_import__/../../../src/util/maskAttribute.ts","webpack://__ember_auto_import__/../../../src/browser/types.ts","webpack://__ember_auto_import__/../../../../../src/browser/web-vitals/lib/bindReporter.ts","webpack://__ember_auto_import__/../../../../../src/browser/web-vitals/lib/getNavigationEntry.ts","webpack://__ember_auto_import__/../../../../../src/browser/web-vitals/lib/getActivationStart.ts","webpack://__ember_auto_import__/../../../../../src/browser/web-vitals/lib/initMetric.ts","webpack://__ember_auto_import__/../../../../../src/browser/web-vitals/lib/generateUniqueID.ts","webpack://__ember_auto_import__/../../../../../src/browser/web-vitals/lib/observe.ts","webpack://__ember_auto_import__/../../../../../src/browser/web-vitals/lib/onHidden.ts","webpack://__ember_auto_import__/../../../../../src/browser/web-vitals/lib/getVisibilityWatcher.ts","webpack://__ember_auto_import__/../../../../src/browser/web-vitals/getLCP.ts","webpack://__ember_auto_import__/../../../../src/browser/metrics/utils.ts","webpack://__ember_auto_import__/../../../../src/browser/metrics/index.ts","webpack://__ember_auto_import__/../../../../src/browser/web-vitals/getFID.ts","webpack://__ember_auto_import__/../../../../src/browser/web-vitals/getCLS.ts","webpack://__ember_auto_import__/../../../src/browser/request.ts","webpack://__ember_auto_import__/../../../src/browser/browsertracing.ts","webpack://__ember_auto_import__/../../../src/browser/router.ts","webpack://__ember_auto_import__/../../../src/browser/backgroundtab.ts","webpack://__ember_auto_import__/../../../src/transports/offline.ts","webpack://__ember_auto_import__/../../../../src/transports/offline.ts","webpack://__ember_auto_import__/../../../../src/profiling/utils.ts","webpack://__ember_auto_import__/../../../../src/profiling/hubextensions.ts","webpack://__ember_auto_import__/../../../../src/profiling/integration.ts","webpack://__ember_auto_import__/../../../src/index.ts","webpack://__ember_auto_import__/../../src/worldwide.ts","webpack://__ember_auto_import__/../../src/logger.ts","webpack://__ember_auto_import__/../../src/is.ts","webpack://__ember_auto_import__/../../src/browser.ts","webpack://__ember_auto_import__/../../src/object.ts","webpack://__ember_auto_import__/../../src/severity.ts","webpack://__ember_auto_import__/../../src/string.ts","webpack://__ember_auto_import__/../../../src/captureconsole.ts","webpack://__ember_auto_import__/../../../src/debug.ts","webpack://__ember_auto_import__/../../../src/dedupe.ts","webpack://__ember_auto_import__/../../src/stacktrace.ts","webpack://__ember_auto_import__/../../src/normalize.ts","webpack://__ember_auto_import__/../../src/memo.ts","webpack://__ember_auto_import__/../../../src/extraerrordata.ts","webpack://__ember_auto_import__/../../../src/offline.ts","webpack://__ember_auto_import__/../../src/misc.ts","webpack://__ember_auto_import__/../../src/supports.ts","webpack://__ember_auto_import__/../../../src/reportingobserver.ts","webpack://__ember_auto_import__/../../src/path.ts","webpack://__ember_auto_import__/../../../src/rewriteframes.ts","webpack://__ember_auto_import__/../../../src/sessiontiming.ts","webpack://__ember_auto_import__/../../../src/transaction.ts","webpack://__ember_auto_import__/../../src/aggregate-errors.ts","webpack://__ember_auto_import__/../../src/baggage.ts","webpack://__ember_auto_import__/../../src/clientreport.ts","webpack://__ember_auto_import__/../../src/dsn.ts","webpack://__ember_auto_import__/../../src/env.ts","webpack://__ember_auto_import__/../../src/error.ts","webpack://__ember_auto_import__/../../src/requestdata.ts","webpack://__ember_auto_import__/../../src/userIntegrations.ts","webpack://__ember_auto_import__/../../src/cache.ts","webpack://__ember_auto_import__/../../src/eventbuilder.ts","webpack://__ember_auto_import__/../../../src/vendor/escapeStringForRegex.ts","webpack://__ember_auto_import__/../../src/instrument.ts","webpack://__ember_auto_import__/../../src/node-stack-trace.ts","webpack://__ember_auto_import__/../../src/node.ts","webpack://__ember_auto_import__/../../src/promisebuffer.ts","webpack://__ember_auto_import__/../../src/ratelimit.ts","webpack://__ember_auto_import__/../../src/syncpromise.ts","webpack://__ember_auto_import__/../../src/time.ts","webpack://__ember_auto_import__/../../src/tracing.ts","webpack://__ember_auto_import__/../../src/url.ts","webpack://__ember_auto_import__/../../../src/vendor/supportsHistory.ts","webpack://__ember_auto_import__/./node_modules/@teamtopia/ui-library/node_modules/big.js/big.js","webpack://__ember_auto_import__/../../src/helpers/load.ts","webpack://__ember_auto_import__/../src/tracked-async-data.ts","webpack://__ember_auto_import__/../../src/-private/matches-selector.js","webpack://__ember_auto_import__/../../src/utils.js","webpack://__ember_auto_import__/../../src/modifiers/on-click-outside.js","webpack://__ember_auto_import__/../../src/utils/transition-utils.js","webpack://__ember_auto_import__/../../src/modifiers/css-transition.js","webpack://__ember_auto_import__/./node_modules/ember-headless-form/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js","webpack://__ember_auto_import__/./node_modules/ember-headless-form/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://__ember_auto_import__/./node_modules/ember-headless-form/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://__ember_auto_import__/./node_modules/ember-headless-form/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://__ember_auto_import__/./node_modules/ember-headless-form/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://__ember_auto_import__/./node_modules/ember-headless-form/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js","webpack://__ember_auto_import__/../../../src/-private/modifiers/capture-events.ts","webpack://__ember_auto_import__/../../src/-private/utils.ts","webpack://__ember_auto_import__/../../../../src/-private/components/control/checkbox.ts","webpack://__ember_auto_import__/../../../../src/-private/components/control/input.ts","webpack://__ember_auto_import__/../../../../../src/-private/components/control/radio-group/label.ts","webpack://__ember_auto_import__/../../../src/-private/components/label.ts","webpack://__ember_auto_import__/../../../../../src/-private/components/control/radio-group/radio/input.ts","webpack://__ember_auto_import__/../../../../../src/-private/components/control/radio-group/radio.ts","webpack://__ember_auto_import__/../../../../src/-private/components/control/radio-group.ts","webpack://__ember_auto_import__/../../../../../src/-private/components/control/select/option.ts","webpack://__ember_auto_import__/../../../../src/-private/components/control/select.ts","webpack://__ember_auto_import__/../../../../src/-private/components/control/textarea.ts","webpack://__ember_auto_import__/../../../src/-private/components/errors.ts","webpack://__ember_auto_import__/../../../src/-private/components/field.ts","webpack://__ember_auto_import__/../../src/components/headless-form.ts","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/_rollupPluginBabelHelpers-30c82890.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/fixtures/key-maps.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/fixtures/modifiers-array.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/helpers/if-key.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/helpers/on-key.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/utils/get-mouse-code.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/decorators/key-responder.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/decorators/on-key.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/listeners/mouse-events.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/fixtures/mouse-buttons-array.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/listeners/touch-events.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/utils/trigger-event.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/index.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/listeners/key-events.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/modifiers/on-key.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/services/keyboard.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/utils/handle-key-event.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/utils/sort.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/utils/get-mouse-name.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/utils/is-key.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/utils/keyboard-listener.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/utils/listener-name.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/utils/get-cmd-key.js","webpack://__ember_auto_import__/./node_modules/ember-keyboard/dist/utils/platform.js","webpack://__ember_auto_import__/../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://__ember_auto_import__/../src/-private/class-based/modifier-manager.ts","webpack://__ember_auto_import__/../src/-private/class-based/modifier.ts","webpack://__ember_auto_import__/../src/-private/function-based/modifier.ts","webpack://__ember_auto_import__/../src/-private/function-based/modifier-manager.ts","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helper-compute-36ed98e8.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/-base.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/is-after.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/is-before.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/is-between.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/is-same-or-after.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/is-same-or-before.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/is-same.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/moment-add.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/moment-calendar.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/moment-diff.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/moment-duration.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/moment-format.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/moment-from-now.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/moment-from.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/moment-subtract.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/moment-to-date.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/moment-to-now.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/moment-to.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/moment.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/now.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/unix.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/helpers/utc.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/index.js","webpack://__ember_auto_import__/./node_modules/ember-moment/dist/services/moment.js","webpack://__ember_auto_import__/../../src/components/pikaday-input.hbs","webpack://__ember_auto_import__/../../src/components/pikaday-input.js","webpack://__ember_auto_import__/../../src/components/pikaday-inputless.hbs","webpack://__ember_auto_import__/../../src/components/pikaday-inputless.js","webpack://__ember_auto_import__/../src/find-moment.js","webpack://__ember_auto_import__/../../src/modifiers/pikaday.js","webpack://__ember_auto_import__/../../vendor/pikaday.js","webpack://__ember_auto_import__/./node_modules/ember-router-helpers/dist/_rollupPluginBabelHelpers-7db585ca.js","webpack://__ember_auto_import__/./node_modules/ember-router-helpers/dist/helpers/is-active.js","webpack://__ember_auto_import__/./node_modules/ember-router-helpers/dist/helpers/replace-with.js","webpack://__ember_auto_import__/./node_modules/ember-router-helpers/dist/helpers/root-url.js","webpack://__ember_auto_import__/./node_modules/ember-router-helpers/dist/helpers/route-params.js","webpack://__ember_auto_import__/./node_modules/ember-router-helpers/dist/utils/route-params.js","webpack://__ember_auto_import__/./node_modules/ember-router-helpers/dist/helpers/transition-to.js","webpack://__ember_auto_import__/./node_modules/ember-router-helpers/dist/helpers/url-for.js","webpack://__ember_auto_import__/./node_modules/ember-router-helpers/dist/utils/handle-query-params.js","webpack://__ember_auto_import__/./node_modules/ember-router-helpers/dist/utils/track-active-route.js","webpack://__ember_auto_import__/./node_modules/fast-xml-parser/src/json2xml.js","webpack://__ember_auto_import__/./node_modules/fast-xml-parser/src/nimndata.js","webpack://__ember_auto_import__/./node_modules/fast-xml-parser/src/node2json.js","webpack://__ember_auto_import__/./node_modules/fast-xml-parser/src/node2json_str.js","webpack://__ember_auto_import__/./node_modules/fast-xml-parser/src/parser.js","webpack://__ember_auto_import__/./node_modules/fast-xml-parser/src/util.js","webpack://__ember_auto_import__/./node_modules/fast-xml-parser/src/validator.js","webpack://__ember_auto_import__/./node_modules/fast-xml-parser/src/xmlNode.js","webpack://__ember_auto_import__/./node_modules/fast-xml-parser/src/xmlstr2xmlnode.js","webpack://__ember_auto_import__/../index.ts","webpack://__ember_auto_import__/../index.js","webpack://__ember_auto_import__/./node_modules/jspdf/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://__ember_auto_import__/./node_modules/fflate/esm/browser.js","webpack://__ember_auto_import__/../src/libs/globalObject.js","webpack://__ember_auto_import__/../src/libs/console.js","webpack://__ember_auto_import__/../src/libs/FileSaver.js","webpack://__ember_auto_import__/../src/libs/AtobBtoa.js","webpack://__ember_auto_import__/../src/libs/rgbcolor.js","webpack://__ember_auto_import__/../src/libs/md5.js","webpack://__ember_auto_import__/../src/libs/rc4.js","webpack://__ember_auto_import__/../src/libs/pdfsecurity.js","webpack://__ember_auto_import__/../src/libs/pdfname.js","webpack://__ember_auto_import__/../src/jspdf.js","webpack://__ember_auto_import__/../src/modules/acroform.js","webpack://__ember_auto_import__/../src/modules/annotations.js","webpack://__ember_auto_import__/../src/libs/fontFace.js","webpack://__ember_auto_import__/../src/modules/addimage.js","webpack://__ember_auto_import__/../src/modules/arabic.js","webpack://__ember_auto_import__/../src/modules/autoprint.js","webpack://__ember_auto_import__/../src/modules/canvas.js","webpack://__ember_auto_import__/../src/modules/cell.js","webpack://__ember_auto_import__/../src/modules/javascript.js","webpack://__ember_auto_import__/../src/modules/context2d.js","webpack://__ember_auto_import__/../src/modules/filters.js","webpack://__ember_auto_import__/../src/modules/fileloading.js","webpack://__ember_auto_import__/../src/modules/html.js","webpack://__ember_auto_import__/../src/modules/outline.js","webpack://__ember_auto_import__/../src/modules/jpeg_support.js","webpack://__ember_auto_import__/../src/libs/png.js","webpack://__ember_auto_import__/../src/modules/split_text_to_size.js","webpack://__ember_auto_import__/../src/libs/omggif.js","webpack://__ember_auto_import__/../src/libs/JPEGEncoder.js","webpack://__ember_auto_import__/../src/libs/BMPDecoder.js","webpack://__ember_auto_import__/../src/libs/WebPDecoder.js","webpack://__ember_auto_import__/../src/modules/png_support.js","webpack://__ember_auto_import__/../src/modules/gif_support.js","webpack://__ember_auto_import__/../src/modules/bmp_support.js","webpack://__ember_auto_import__/../src/modules/webp_support.js","webpack://__ember_auto_import__/../src/modules/rgba_support.js","webpack://__ember_auto_import__/../src/modules/setlanguage.js","webpack://__ember_auto_import__/../src/modules/standard_fonts_metrics.js","webpack://__ember_auto_import__/../src/modules/ttfsupport.js","webpack://__ember_auto_import__/../src/modules/svg.js","webpack://__ember_auto_import__/../src/modules/total_pages.js","webpack://__ember_auto_import__/../src/modules/viewerpreferences.js","webpack://__ember_auto_import__/../src/modules/xmp_metadata.js","webpack://__ember_auto_import__/../src/modules/utf8.js","webpack://__ember_auto_import__/../src/modules/vfs.js","webpack://__ember_auto_import__/../src/libs/bidiEngine.js","webpack://__ember_auto_import__/../src/libs/ttffont.js","webpack://__ember_auto_import__/./node_modules/localforage/dist/localforage.js","webpack://__ember_auto_import__/./node_modules/lodash/_DataView.js","webpack://__ember_auto_import__/./node_modules/lodash/_Hash.js","webpack://__ember_auto_import__/./node_modules/lodash/_ListCache.js","webpack://__ember_auto_import__/./node_modules/lodash/_Map.js","webpack://__ember_auto_import__/./node_modules/lodash/_MapCache.js","webpack://__ember_auto_import__/./node_modules/lodash/_Promise.js","webpack://__ember_auto_import__/./node_modules/lodash/_Set.js","webpack://__ember_auto_import__/./node_modules/lodash/_SetCache.js","webpack://__ember_auto_import__/./node_modules/lodash/_Stack.js","webpack://__ember_auto_import__/./node_modules/lodash/_Symbol.js","webpack://__ember_auto_import__/./node_modules/lodash/_Uint8Array.js","webpack://__ember_auto_import__/./node_modules/lodash/_WeakMap.js","webpack://__ember_auto_import__/./node_modules/lodash/_apply.js","webpack://__ember_auto_import__/./node_modules/lodash/_arrayAggregator.js","webpack://__ember_auto_import__/./node_modules/lodash/_arrayEach.js","webpack://__ember_auto_import__/./node_modules/lodash/_arrayEachRight.js","webpack://__ember_auto_import__/./node_modules/lodash/_arrayEvery.js","webpack://__ember_auto_import__/./node_modules/lodash/_arrayFilter.js","webpack://__ember_auto_import__/./node_modules/lodash/_arrayIncludes.js","webpack://__ember_auto_import__/./node_modules/lodash/_arrayIncludesWith.js","webpack://__ember_auto_import__/./node_modules/lodash/_arrayLikeKeys.js","webpack://__ember_auto_import__/./node_modules/lodash/_arrayMap.js","webpack://__ember_auto_import__/./node_modules/lodash/_arrayPush.js","webpack://__ember_auto_import__/./node_modules/lodash/_arrayReduce.js","webpack://__ember_auto_import__/./node_modules/lodash/_arrayReduceRight.js","webpack://__ember_auto_import__/./node_modules/lodash/_arraySample.js","webpack://__ember_auto_import__/./node_modules/lodash/_arraySampleSize.js","webpack://__ember_auto_import__/./node_modules/lodash/_arrayShuffle.js","webpack://__ember_auto_import__/./node_modules/lodash/_arraySome.js","webpack://__ember_auto_import__/./node_modules/lodash/_asciiSize.js","webpack://__ember_auto_import__/./node_modules/lodash/_assignMergeValue.js","webpack://__ember_auto_import__/./node_modules/lodash/_assignValue.js","webpack://__ember_auto_import__/./node_modules/lodash/_assocIndexOf.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseAggregator.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseAssign.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseAssignIn.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseAssignValue.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseAt.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseClamp.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseClone.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseCreate.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseDifference.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseEach.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseEachRight.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseEvery.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseFill.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseFilter.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseFindIndex.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseFindKey.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseFlatten.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseFor.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseForOwn.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseForOwnRight.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseForRight.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseFunctions.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseGet.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseGetAllKeys.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseGetTag.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseHas.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseHasIn.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseIndexOf.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseIndexOfWith.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseIntersection.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseInverter.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseInvoke.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseIsArguments.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseIsEqual.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseIsEqualDeep.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseIsMap.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseIsMatch.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseIsNaN.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseIsNative.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseIsSet.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseIsTypedArray.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseIteratee.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseKeys.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseKeysIn.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseMap.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseMatches.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseMatchesProperty.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseMerge.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseMergeDeep.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseNth.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseOrderBy.js","webpack://__ember_auto_import__/./node_modules/lodash/_basePick.js","webpack://__ember_auto_import__/./node_modules/lodash/_basePickBy.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseProperty.js","webpack://__ember_auto_import__/./node_modules/lodash/_basePropertyDeep.js","webpack://__ember_auto_import__/./node_modules/lodash/_basePullAll.js","webpack://__ember_auto_import__/./node_modules/lodash/_basePullAt.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseRandom.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseReduce.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseRest.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseSample.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseSampleSize.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseSet.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseSetToString.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseShuffle.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseSlice.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseSome.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseSortBy.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseSortedIndex.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseSortedIndexBy.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseSortedUniq.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseTimes.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseToPairs.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseToString.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseTrim.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseUnary.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseUniq.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseUnset.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseUpdate.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseValues.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseWhile.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseXor.js","webpack://__ember_auto_import__/./node_modules/lodash/_baseZipObject.js","webpack://__ember_auto_import__/./node_modules/lodash/_cacheHas.js","webpack://__ember_auto_import__/./node_modules/lodash/_castArrayLikeObject.js","webpack://__ember_auto_import__/./node_modules/lodash/_castFunction.js","webpack://__ember_auto_import__/./node_modules/lodash/_castPath.js","webpack://__ember_auto_import__/./node_modules/lodash/_cloneArrayBuffer.js","webpack://__ember_auto_import__/./node_modules/lodash/_cloneBuffer.js","webpack://__ember_auto_import__/./node_modules/lodash/_cloneDataView.js","webpack://__ember_auto_import__/./node_modules/lodash/_cloneRegExp.js","webpack://__ember_auto_import__/./node_modules/lodash/_cloneSymbol.js","webpack://__ember_auto_import__/./node_modules/lodash/_cloneTypedArray.js","webpack://__ember_auto_import__/./node_modules/lodash/_compareAscending.js","webpack://__ember_auto_import__/./node_modules/lodash/_compareMultiple.js","webpack://__ember_auto_import__/./node_modules/lodash/_copyArray.js","webpack://__ember_auto_import__/./node_modules/lodash/_copyObject.js","webpack://__ember_auto_import__/./node_modules/lodash/_copySymbols.js","webpack://__ember_auto_import__/./node_modules/lodash/_copySymbolsIn.js","webpack://__ember_auto_import__/./node_modules/lodash/_coreJsData.js","webpack://__ember_auto_import__/./node_modules/lodash/_createAggregator.js","webpack://__ember_auto_import__/./node_modules/lodash/_createAssigner.js","webpack://__ember_auto_import__/./node_modules/lodash/_createBaseEach.js","webpack://__ember_auto_import__/./node_modules/lodash/_createBaseFor.js","webpack://__ember_auto_import__/./node_modules/lodash/_createFind.js","webpack://__ember_auto_import__/./node_modules/lodash/_createInverter.js","webpack://__ember_auto_import__/./node_modules/lodash/_createSet.js","webpack://__ember_auto_import__/./node_modules/lodash/_createToPairs.js","webpack://__ember_auto_import__/./node_modules/lodash/_customDefaultsMerge.js","webpack://__ember_auto_import__/./node_modules/lodash/_customOmitClone.js","webpack://__ember_auto_import__/./node_modules/lodash/_defineProperty.js","webpack://__ember_auto_import__/./node_modules/lodash/_equalArrays.js","webpack://__ember_auto_import__/./node_modules/lodash/_equalByTag.js","webpack://__ember_auto_import__/./node_modules/lodash/_equalObjects.js","webpack://__ember_auto_import__/./node_modules/lodash/_flatRest.js","webpack://__ember_auto_import__/./node_modules/lodash/_freeGlobal.js","webpack://__ember_auto_import__/./node_modules/lodash/_getAllKeys.js","webpack://__ember_auto_import__/./node_modules/lodash/_getAllKeysIn.js","webpack://__ember_auto_import__/./node_modules/lodash/_getMapData.js","webpack://__ember_auto_import__/./node_modules/lodash/_getMatchData.js","webpack://__ember_auto_import__/./node_modules/lodash/_getNative.js","webpack://__ember_auto_import__/./node_modules/lodash/_getPrototype.js","webpack://__ember_auto_import__/./node_modules/lodash/_getRawTag.js","webpack://__ember_auto_import__/./node_modules/lodash/_getSymbols.js","webpack://__ember_auto_import__/./node_modules/lodash/_getSymbolsIn.js","webpack://__ember_auto_import__/./node_modules/lodash/_getTag.js","webpack://__ember_auto_import__/./node_modules/lodash/_getValue.js","webpack://__ember_auto_import__/./node_modules/lodash/_hasPath.js","webpack://__ember_auto_import__/./node_modules/lodash/_hasUnicode.js","webpack://__ember_auto_import__/./node_modules/lodash/_hashClear.js","webpack://__ember_auto_import__/./node_modules/lodash/_hashDelete.js","webpack://__ember_auto_import__/./node_modules/lodash/_hashGet.js","webpack://__ember_auto_import__/./node_modules/lodash/_hashHas.js","webpack://__ember_auto_import__/./node_modules/lodash/_hashSet.js","webpack://__ember_auto_import__/./node_modules/lodash/_initCloneArray.js","webpack://__ember_auto_import__/./node_modules/lodash/_initCloneByTag.js","webpack://__ember_auto_import__/./node_modules/lodash/_initCloneObject.js","webpack://__ember_auto_import__/./node_modules/lodash/_isFlattenable.js","webpack://__ember_auto_import__/./node_modules/lodash/_isIndex.js","webpack://__ember_auto_import__/./node_modules/lodash/_isIterateeCall.js","webpack://__ember_auto_import__/./node_modules/lodash/_isKey.js","webpack://__ember_auto_import__/./node_modules/lodash/_isKeyable.js","webpack://__ember_auto_import__/./node_modules/lodash/_isMasked.js","webpack://__ember_auto_import__/./node_modules/lodash/_isPrototype.js","webpack://__ember_auto_import__/./node_modules/lodash/_isStrictComparable.js","webpack://__ember_auto_import__/./node_modules/lodash/_listCacheClear.js","webpack://__ember_auto_import__/./node_modules/lodash/_listCacheDelete.js","webpack://__ember_auto_import__/./node_modules/lodash/_listCacheGet.js","webpack://__ember_auto_import__/./node_modules/lodash/_listCacheHas.js","webpack://__ember_auto_import__/./node_modules/lodash/_listCacheSet.js","webpack://__ember_auto_import__/./node_modules/lodash/_mapCacheClear.js","webpack://__ember_auto_import__/./node_modules/lodash/_mapCacheDelete.js","webpack://__ember_auto_import__/./node_modules/lodash/_mapCacheGet.js","webpack://__ember_auto_import__/./node_modules/lodash/_mapCacheHas.js","webpack://__ember_auto_import__/./node_modules/lodash/_mapCacheSet.js","webpack://__ember_auto_import__/./node_modules/lodash/_mapToArray.js","webpack://__ember_auto_import__/./node_modules/lodash/_matchesStrictComparable.js","webpack://__ember_auto_import__/./node_modules/lodash/_memoizeCapped.js","webpack://__ember_auto_import__/./node_modules/lodash/_nativeCreate.js","webpack://__ember_auto_import__/./node_modules/lodash/_nativeKeys.js","webpack://__ember_auto_import__/./node_modules/lodash/_nativeKeysIn.js","webpack://__ember_auto_import__/./node_modules/lodash/_nodeUtil.js","webpack://__ember_auto_import__/./node_modules/lodash/_objectToString.js","webpack://__ember_auto_import__/./node_modules/lodash/_overArg.js","webpack://__ember_auto_import__/./node_modules/lodash/_overRest.js","webpack://__ember_auto_import__/./node_modules/lodash/_parent.js","webpack://__ember_auto_import__/./node_modules/lodash/_root.js","webpack://__ember_auto_import__/./node_modules/lodash/_safeGet.js","webpack://__ember_auto_import__/./node_modules/lodash/_setCacheAdd.js","webpack://__ember_auto_import__/./node_modules/lodash/_setCacheHas.js","webpack://__ember_auto_import__/./node_modules/lodash/_setToArray.js","webpack://__ember_auto_import__/./node_modules/lodash/_setToPairs.js","webpack://__ember_auto_import__/./node_modules/lodash/_setToString.js","webpack://__ember_auto_import__/./node_modules/lodash/_shortOut.js","webpack://__ember_auto_import__/./node_modules/lodash/_shuffleSelf.js","webpack://__ember_auto_import__/./node_modules/lodash/_stackClear.js","webpack://__ember_auto_import__/./node_modules/lodash/_stackDelete.js","webpack://__ember_auto_import__/./node_modules/lodash/_stackGet.js","webpack://__ember_auto_import__/./node_modules/lodash/_stackHas.js","webpack://__ember_auto_import__/./node_modules/lodash/_stackSet.js","webpack://__ember_auto_import__/./node_modules/lodash/_strictIndexOf.js","webpack://__ember_auto_import__/./node_modules/lodash/_strictLastIndexOf.js","webpack://__ember_auto_import__/./node_modules/lodash/_stringSize.js","webpack://__ember_auto_import__/./node_modules/lodash/_stringToPath.js","webpack://__ember_auto_import__/./node_modules/lodash/_toKey.js","webpack://__ember_auto_import__/./node_modules/lodash/_toSource.js","webpack://__ember_auto_import__/./node_modules/lodash/_trimmedEndIndex.js","webpack://__ember_auto_import__/./node_modules/lodash/_unicodeSize.js","webpack://__ember_auto_import__/./node_modules/lodash/array.js","webpack://__ember_auto_import__/./node_modules/lodash/assign.js","webpack://__ember_auto_import__/./node_modules/lodash/assignIn.js","webpack://__ember_auto_import__/./node_modules/lodash/assignInWith.js","webpack://__ember_auto_import__/./node_modules/lodash/assignWith.js","webpack://__ember_auto_import__/./node_modules/lodash/at.js","webpack://__ember_auto_import__/./node_modules/lodash/chunk.js","webpack://__ember_auto_import__/./node_modules/lodash/collection.js","webpack://__ember_auto_import__/./node_modules/lodash/compact.js","webpack://__ember_auto_import__/./node_modules/lodash/concat.js","webpack://__ember_auto_import__/./node_modules/lodash/constant.js","webpack://__ember_auto_import__/./node_modules/lodash/countBy.js","webpack://__ember_auto_import__/./node_modules/lodash/create.js","webpack://__ember_auto_import__/./node_modules/lodash/defaults.js","webpack://__ember_auto_import__/./node_modules/lodash/defaultsDeep.js","webpack://__ember_auto_import__/./node_modules/lodash/difference.js","webpack://__ember_auto_import__/./node_modules/lodash/differenceBy.js","webpack://__ember_auto_import__/./node_modules/lodash/differenceWith.js","webpack://__ember_auto_import__/./node_modules/lodash/drop.js","webpack://__ember_auto_import__/./node_modules/lodash/dropRight.js","webpack://__ember_auto_import__/./node_modules/lodash/dropRightWhile.js","webpack://__ember_auto_import__/./node_modules/lodash/dropWhile.js","webpack://__ember_auto_import__/./node_modules/lodash/each.js","webpack://__ember_auto_import__/./node_modules/lodash/eachRight.js","webpack://__ember_auto_import__/./node_modules/lodash/entries.js","webpack://__ember_auto_import__/./node_modules/lodash/entriesIn.js","webpack://__ember_auto_import__/./node_modules/lodash/eq.js","webpack://__ember_auto_import__/./node_modules/lodash/every.js","webpack://__ember_auto_import__/./node_modules/lodash/extend.js","webpack://__ember_auto_import__/./node_modules/lodash/extendWith.js","webpack://__ember_auto_import__/./node_modules/lodash/fill.js","webpack://__ember_auto_import__/./node_modules/lodash/filter.js","webpack://__ember_auto_import__/./node_modules/lodash/find.js","webpack://__ember_auto_import__/./node_modules/lodash/findIndex.js","webpack://__ember_auto_import__/./node_modules/lodash/findKey.js","webpack://__ember_auto_import__/./node_modules/lodash/findLast.js","webpack://__ember_auto_import__/./node_modules/lodash/findLastIndex.js","webpack://__ember_auto_import__/./node_modules/lodash/findLastKey.js","webpack://__ember_auto_import__/./node_modules/lodash/first.js","webpack://__ember_auto_import__/./node_modules/lodash/flatMap.js","webpack://__ember_auto_import__/./node_modules/lodash/flatMapDeep.js","webpack://__ember_auto_import__/./node_modules/lodash/flatMapDepth.js","webpack://__ember_auto_import__/./node_modules/lodash/flatten.js","webpack://__ember_auto_import__/./node_modules/lodash/flattenDeep.js","webpack://__ember_auto_import__/./node_modules/lodash/flattenDepth.js","webpack://__ember_auto_import__/./node_modules/lodash/forEach.js","webpack://__ember_auto_import__/./node_modules/lodash/forEachRight.js","webpack://__ember_auto_import__/./node_modules/lodash/forIn.js","webpack://__ember_auto_import__/./node_modules/lodash/forInRight.js","webpack://__ember_auto_import__/./node_modules/lodash/forOwn.js","webpack://__ember_auto_import__/./node_modules/lodash/forOwnRight.js","webpack://__ember_auto_import__/./node_modules/lodash/fromPairs.js","webpack://__ember_auto_import__/./node_modules/lodash/functions.js","webpack://__ember_auto_import__/./node_modules/lodash/functionsIn.js","webpack://__ember_auto_import__/./node_modules/lodash/get.js","webpack://__ember_auto_import__/./node_modules/lodash/groupBy.js","webpack://__ember_auto_import__/./node_modules/lodash/has.js","webpack://__ember_auto_import__/./node_modules/lodash/hasIn.js","webpack://__ember_auto_import__/./node_modules/lodash/head.js","webpack://__ember_auto_import__/./node_modules/lodash/identity.js","webpack://__ember_auto_import__/./node_modules/lodash/includes.js","webpack://__ember_auto_import__/./node_modules/lodash/indexOf.js","webpack://__ember_auto_import__/./node_modules/lodash/initial.js","webpack://__ember_auto_import__/./node_modules/lodash/intersection.js","webpack://__ember_auto_import__/./node_modules/lodash/intersectionBy.js","webpack://__ember_auto_import__/./node_modules/lodash/intersectionWith.js","webpack://__ember_auto_import__/./node_modules/lodash/invert.js","webpack://__ember_auto_import__/./node_modules/lodash/invertBy.js","webpack://__ember_auto_import__/./node_modules/lodash/invoke.js","webpack://__ember_auto_import__/./node_modules/lodash/invokeMap.js","webpack://__ember_auto_import__/./node_modules/lodash/isArguments.js","webpack://__ember_auto_import__/./node_modules/lodash/isArray.js","webpack://__ember_auto_import__/./node_modules/lodash/isArrayLike.js","webpack://__ember_auto_import__/./node_modules/lodash/isArrayLikeObject.js","webpack://__ember_auto_import__/./node_modules/lodash/isBuffer.js","webpack://__ember_auto_import__/./node_modules/lodash/isFunction.js","webpack://__ember_auto_import__/./node_modules/lodash/isLength.js","webpack://__ember_auto_import__/./node_modules/lodash/isMap.js","webpack://__ember_auto_import__/./node_modules/lodash/isObject.js","webpack://__ember_auto_import__/./node_modules/lodash/isObjectLike.js","webpack://__ember_auto_import__/./node_modules/lodash/isPlainObject.js","webpack://__ember_auto_import__/./node_modules/lodash/isSet.js","webpack://__ember_auto_import__/./node_modules/lodash/isString.js","webpack://__ember_auto_import__/./node_modules/lodash/isSymbol.js","webpack://__ember_auto_import__/./node_modules/lodash/isTypedArray.js","webpack://__ember_auto_import__/./node_modules/lodash/join.js","webpack://__ember_auto_import__/./node_modules/lodash/keyBy.js","webpack://__ember_auto_import__/./node_modules/lodash/keys.js","webpack://__ember_auto_import__/./node_modules/lodash/keysIn.js","webpack://__ember_auto_import__/./node_modules/lodash/last.js","webpack://__ember_auto_import__/./node_modules/lodash/lastIndexOf.js","webpack://__ember_auto_import__/./node_modules/lodash/map.js","webpack://__ember_auto_import__/./node_modules/lodash/mapKeys.js","webpack://__ember_auto_import__/./node_modules/lodash/mapValues.js","webpack://__ember_auto_import__/./node_modules/lodash/memoize.js","webpack://__ember_auto_import__/./node_modules/lodash/merge.js","webpack://__ember_auto_import__/./node_modules/lodash/mergeWith.js","webpack://__ember_auto_import__/./node_modules/lodash/negate.js","webpack://__ember_auto_import__/./node_modules/lodash/noop.js","webpack://__ember_auto_import__/./node_modules/lodash/nth.js","webpack://__ember_auto_import__/./node_modules/lodash/object.js","webpack://__ember_auto_import__/./node_modules/lodash/omit.js","webpack://__ember_auto_import__/./node_modules/lodash/omitBy.js","webpack://__ember_auto_import__/./node_modules/lodash/orderBy.js","webpack://__ember_auto_import__/./node_modules/lodash/partition.js","webpack://__ember_auto_import__/./node_modules/lodash/pick.js","webpack://__ember_auto_import__/./node_modules/lodash/pickBy.js","webpack://__ember_auto_import__/./node_modules/lodash/property.js","webpack://__ember_auto_import__/./node_modules/lodash/pull.js","webpack://__ember_auto_import__/./node_modules/lodash/pullAll.js","webpack://__ember_auto_import__/./node_modules/lodash/pullAllBy.js","webpack://__ember_auto_import__/./node_modules/lodash/pullAllWith.js","webpack://__ember_auto_import__/./node_modules/lodash/pullAt.js","webpack://__ember_auto_import__/./node_modules/lodash/reduce.js","webpack://__ember_auto_import__/./node_modules/lodash/reduceRight.js","webpack://__ember_auto_import__/./node_modules/lodash/reject.js","webpack://__ember_auto_import__/./node_modules/lodash/remove.js","webpack://__ember_auto_import__/./node_modules/lodash/result.js","webpack://__ember_auto_import__/./node_modules/lodash/reverse.js","webpack://__ember_auto_import__/./node_modules/lodash/sample.js","webpack://__ember_auto_import__/./node_modules/lodash/sampleSize.js","webpack://__ember_auto_import__/./node_modules/lodash/set.js","webpack://__ember_auto_import__/./node_modules/lodash/setWith.js","webpack://__ember_auto_import__/./node_modules/lodash/shuffle.js","webpack://__ember_auto_import__/./node_modules/lodash/size.js","webpack://__ember_auto_import__/./node_modules/lodash/slice.js","webpack://__ember_auto_import__/./node_modules/lodash/some.js","webpack://__ember_auto_import__/./node_modules/lodash/sortBy.js","webpack://__ember_auto_import__/./node_modules/lodash/sortedIndex.js","webpack://__ember_auto_import__/./node_modules/lodash/sortedIndexBy.js","webpack://__ember_auto_import__/./node_modules/lodash/sortedIndexOf.js","webpack://__ember_auto_import__/./node_modules/lodash/sortedLastIndex.js","webpack://__ember_auto_import__/./node_modules/lodash/sortedLastIndexBy.js","webpack://__ember_auto_import__/./node_modules/lodash/sortedLastIndexOf.js","webpack://__ember_auto_import__/./node_modules/lodash/sortedUniq.js","webpack://__ember_auto_import__/./node_modules/lodash/sortedUniqBy.js","webpack://__ember_auto_import__/./node_modules/lodash/stubArray.js","webpack://__ember_auto_import__/./node_modules/lodash/stubFalse.js","webpack://__ember_auto_import__/./node_modules/lodash/tail.js","webpack://__ember_auto_import__/./node_modules/lodash/take.js","webpack://__ember_auto_import__/./node_modules/lodash/takeRight.js","webpack://__ember_auto_import__/./node_modules/lodash/takeRightWhile.js","webpack://__ember_auto_import__/./node_modules/lodash/takeWhile.js","webpack://__ember_auto_import__/./node_modules/lodash/toFinite.js","webpack://__ember_auto_import__/./node_modules/lodash/toInteger.js","webpack://__ember_auto_import__/./node_modules/lodash/toLength.js","webpack://__ember_auto_import__/./node_modules/lodash/toNumber.js","webpack://__ember_auto_import__/./node_modules/lodash/toPairs.js","webpack://__ember_auto_import__/./node_modules/lodash/toPairsIn.js","webpack://__ember_auto_import__/./node_modules/lodash/toPlainObject.js","webpack://__ember_auto_import__/./node_modules/lodash/toString.js","webpack://__ember_auto_import__/./node_modules/lodash/transform.js","webpack://__ember_auto_import__/./node_modules/lodash/union.js","webpack://__ember_auto_import__/./node_modules/lodash/unionBy.js","webpack://__ember_auto_import__/./node_modules/lodash/unionWith.js","webpack://__ember_auto_import__/./node_modules/lodash/uniq.js","webpack://__ember_auto_import__/./node_modules/lodash/uniqBy.js","webpack://__ember_auto_import__/./node_modules/lodash/uniqWith.js","webpack://__ember_auto_import__/./node_modules/lodash/unset.js","webpack://__ember_auto_import__/./node_modules/lodash/unzip.js","webpack://__ember_auto_import__/./node_modules/lodash/unzipWith.js","webpack://__ember_auto_import__/./node_modules/lodash/update.js","webpack://__ember_auto_import__/./node_modules/lodash/updateWith.js","webpack://__ember_auto_import__/./node_modules/lodash/values.js","webpack://__ember_auto_import__/./node_modules/lodash/valuesIn.js","webpack://__ember_auto_import__/./node_modules/lodash/without.js","webpack://__ember_auto_import__/./node_modules/lodash/xor.js","webpack://__ember_auto_import__/./node_modules/lodash/xorBy.js","webpack://__ember_auto_import__/./node_modules/lodash/xorWith.js","webpack://__ember_auto_import__/./node_modules/lodash/zip.js","webpack://__ember_auto_import__/./node_modules/lodash/zipObject.js","webpack://__ember_auto_import__/./node_modules/lodash/zipObjectDeep.js","webpack://__ember_auto_import__/./node_modules/lodash/zipWith.js","webpack://__ember_auto_import__/./node_modules/moment-timezone/index.js","webpack://__ember_auto_import__/./node_modules/moment-timezone/moment-timezone.js","webpack://__ember_auto_import__/./node_modules/moment/locale/af.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ar-dz.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ar-kw.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ar-ly.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ar-ma.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ar-sa.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ar-tn.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ar.js","webpack://__ember_auto_import__/./node_modules/moment/locale/az.js","webpack://__ember_auto_import__/./node_modules/moment/locale/be.js","webpack://__ember_auto_import__/./node_modules/moment/locale/bg.js","webpack://__ember_auto_import__/./node_modules/moment/locale/bm.js","webpack://__ember_auto_import__/./node_modules/moment/locale/bn-bd.js","webpack://__ember_auto_import__/./node_modules/moment/locale/bn.js","webpack://__ember_auto_import__/./node_modules/moment/locale/bo.js","webpack://__ember_auto_import__/./node_modules/moment/locale/br.js","webpack://__ember_auto_import__/./node_modules/moment/locale/bs.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ca.js","webpack://__ember_auto_import__/./node_modules/moment/locale/cs.js","webpack://__ember_auto_import__/./node_modules/moment/locale/cv.js","webpack://__ember_auto_import__/./node_modules/moment/locale/cy.js","webpack://__ember_auto_import__/./node_modules/moment/locale/da.js","webpack://__ember_auto_import__/./node_modules/moment/locale/de-at.js","webpack://__ember_auto_import__/./node_modules/moment/locale/de-ch.js","webpack://__ember_auto_import__/./node_modules/moment/locale/de.js","webpack://__ember_auto_import__/./node_modules/moment/locale/dv.js","webpack://__ember_auto_import__/./node_modules/moment/locale/el.js","webpack://__ember_auto_import__/./node_modules/moment/locale/en-au.js","webpack://__ember_auto_import__/./node_modules/moment/locale/en-ca.js","webpack://__ember_auto_import__/./node_modules/moment/locale/en-gb.js","webpack://__ember_auto_import__/./node_modules/moment/locale/en-ie.js","webpack://__ember_auto_import__/./node_modules/moment/locale/en-il.js","webpack://__ember_auto_import__/./node_modules/moment/locale/en-in.js","webpack://__ember_auto_import__/./node_modules/moment/locale/en-nz.js","webpack://__ember_auto_import__/./node_modules/moment/locale/en-sg.js","webpack://__ember_auto_import__/./node_modules/moment/locale/eo.js","webpack://__ember_auto_import__/./node_modules/moment/locale/es-do.js","webpack://__ember_auto_import__/./node_modules/moment/locale/es-mx.js","webpack://__ember_auto_import__/./node_modules/moment/locale/es-us.js","webpack://__ember_auto_import__/./node_modules/moment/locale/es.js","webpack://__ember_auto_import__/./node_modules/moment/locale/et.js","webpack://__ember_auto_import__/./node_modules/moment/locale/eu.js","webpack://__ember_auto_import__/./node_modules/moment/locale/fa.js","webpack://__ember_auto_import__/./node_modules/moment/locale/fi.js","webpack://__ember_auto_import__/./node_modules/moment/locale/fil.js","webpack://__ember_auto_import__/./node_modules/moment/locale/fo.js","webpack://__ember_auto_import__/./node_modules/moment/locale/fr-ca.js","webpack://__ember_auto_import__/./node_modules/moment/locale/fr-ch.js","webpack://__ember_auto_import__/./node_modules/moment/locale/fr.js","webpack://__ember_auto_import__/./node_modules/moment/locale/fy.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ga.js","webpack://__ember_auto_import__/./node_modules/moment/locale/gd.js","webpack://__ember_auto_import__/./node_modules/moment/locale/gl.js","webpack://__ember_auto_import__/./node_modules/moment/locale/gom-deva.js","webpack://__ember_auto_import__/./node_modules/moment/locale/gom-latn.js","webpack://__ember_auto_import__/./node_modules/moment/locale/gu.js","webpack://__ember_auto_import__/./node_modules/moment/locale/he.js","webpack://__ember_auto_import__/./node_modules/moment/locale/hi.js","webpack://__ember_auto_import__/./node_modules/moment/locale/hr.js","webpack://__ember_auto_import__/./node_modules/moment/locale/hu.js","webpack://__ember_auto_import__/./node_modules/moment/locale/hy-am.js","webpack://__ember_auto_import__/./node_modules/moment/locale/id.js","webpack://__ember_auto_import__/./node_modules/moment/locale/is.js","webpack://__ember_auto_import__/./node_modules/moment/locale/it-ch.js","webpack://__ember_auto_import__/./node_modules/moment/locale/it.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ja.js","webpack://__ember_auto_import__/./node_modules/moment/locale/jv.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ka.js","webpack://__ember_auto_import__/./node_modules/moment/locale/kk.js","webpack://__ember_auto_import__/./node_modules/moment/locale/km.js","webpack://__ember_auto_import__/./node_modules/moment/locale/kn.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ko.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ku.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ky.js","webpack://__ember_auto_import__/./node_modules/moment/locale/lb.js","webpack://__ember_auto_import__/./node_modules/moment/locale/lo.js","webpack://__ember_auto_import__/./node_modules/moment/locale/lt.js","webpack://__ember_auto_import__/./node_modules/moment/locale/lv.js","webpack://__ember_auto_import__/./node_modules/moment/locale/me.js","webpack://__ember_auto_import__/./node_modules/moment/locale/mi.js","webpack://__ember_auto_import__/./node_modules/moment/locale/mk.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ml.js","webpack://__ember_auto_import__/./node_modules/moment/locale/mn.js","webpack://__ember_auto_import__/./node_modules/moment/locale/mr.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ms-my.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ms.js","webpack://__ember_auto_import__/./node_modules/moment/locale/mt.js","webpack://__ember_auto_import__/./node_modules/moment/locale/my.js","webpack://__ember_auto_import__/./node_modules/moment/locale/nb.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ne.js","webpack://__ember_auto_import__/./node_modules/moment/locale/nl-be.js","webpack://__ember_auto_import__/./node_modules/moment/locale/nl.js","webpack://__ember_auto_import__/./node_modules/moment/locale/nn.js","webpack://__ember_auto_import__/./node_modules/moment/locale/oc-lnc.js","webpack://__ember_auto_import__/./node_modules/moment/locale/pa-in.js","webpack://__ember_auto_import__/./node_modules/moment/locale/pl.js","webpack://__ember_auto_import__/./node_modules/moment/locale/pt-br.js","webpack://__ember_auto_import__/./node_modules/moment/locale/pt.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ro.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ru.js","webpack://__ember_auto_import__/./node_modules/moment/locale/sd.js","webpack://__ember_auto_import__/./node_modules/moment/locale/se.js","webpack://__ember_auto_import__/./node_modules/moment/locale/si.js","webpack://__ember_auto_import__/./node_modules/moment/locale/sk.js","webpack://__ember_auto_import__/./node_modules/moment/locale/sl.js","webpack://__ember_auto_import__/./node_modules/moment/locale/sq.js","webpack://__ember_auto_import__/./node_modules/moment/locale/sr-cyrl.js","webpack://__ember_auto_import__/./node_modules/moment/locale/sr.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ss.js","webpack://__ember_auto_import__/./node_modules/moment/locale/sv.js","webpack://__ember_auto_import__/./node_modules/moment/locale/sw.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ta.js","webpack://__ember_auto_import__/./node_modules/moment/locale/te.js","webpack://__ember_auto_import__/./node_modules/moment/locale/tet.js","webpack://__ember_auto_import__/./node_modules/moment/locale/tg.js","webpack://__ember_auto_import__/./node_modules/moment/locale/th.js","webpack://__ember_auto_import__/./node_modules/moment/locale/tk.js","webpack://__ember_auto_import__/./node_modules/moment/locale/tl-ph.js","webpack://__ember_auto_import__/./node_modules/moment/locale/tlh.js","webpack://__ember_auto_import__/./node_modules/moment/locale/tr.js","webpack://__ember_auto_import__/./node_modules/moment/locale/tzl.js","webpack://__ember_auto_import__/./node_modules/moment/locale/tzm-latn.js","webpack://__ember_auto_import__/./node_modules/moment/locale/tzm.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ug-cn.js","webpack://__ember_auto_import__/./node_modules/moment/locale/uk.js","webpack://__ember_auto_import__/./node_modules/moment/locale/ur.js","webpack://__ember_auto_import__/./node_modules/moment/locale/uz-latn.js","webpack://__ember_auto_import__/./node_modules/moment/locale/uz.js","webpack://__ember_auto_import__/./node_modules/moment/locale/vi.js","webpack://__ember_auto_import__/./node_modules/moment/locale/x-pseudo.js","webpack://__ember_auto_import__/./node_modules/moment/locale/yo.js","webpack://__ember_auto_import__/./node_modules/moment/locale/zh-cn.js","webpack://__ember_auto_import__/./node_modules/moment/locale/zh-hk.js","webpack://__ember_auto_import__/./node_modules/moment/locale/zh-mo.js","webpack://__ember_auto_import__/./node_modules/moment/locale/zh-tw.js","webpack://__ember_auto_import__/./node_modules/moment/moment.js","webpack://__ember_auto_import__/./node_modules/papaparse/papaparse.min.js","webpack://__ember_auto_import__/./node_modules/pusher-js-mock/lib/index.js","webpack://__ember_auto_import__/./node_modules/pusher-js-mock/lib/members.js","webpack://__ember_auto_import__/./node_modules/pusher-js-mock/lib/proxy-presence-channel.js","webpack://__ember_auto_import__/./node_modules/pusher-js-mock/lib/pusher-channel-mock.js","webpack://__ember_auto_import__/./node_modules/pusher-js-mock/lib/pusher-events.js","webpack://__ember_auto_import__/./node_modules/pusher-js-mock/lib/pusher-factory-mock.js","webpack://__ember_auto_import__/./node_modules/pusher-js-mock/lib/pusher-js-mock-instance.js","webpack://__ember_auto_import__/./node_modules/pusher-js-mock/lib/pusher-js-mock.js","webpack://__ember_auto_import__/./node_modules/pusher-js-mock/lib/pusher-presence-channel-mock.js","webpack://__ember_auto_import__/Pusher/webpack/universalModuleDefinition","webpack://__ember_auto_import__/Pusher/webpack/bootstrap","webpack://__ember_auto_import__/Pusher/node_modules/@stablelib/base64/base64.ts","webpack://__ember_auto_import__/Pusher/node_modules/@stablelib/utf8/utf8.ts","webpack://__ember_auto_import__/Pusher/node_modules/tweetnacl/nacl-fast.js","webpack://__ember_auto_import__/Pusher/src/core/pusher-with-encryption.js","webpack://__ember_auto_import__/Pusher/crypto (ignored)","webpack://__ember_auto_import__/Pusher/src/runtimes/web/dom/script_receiver_factory.ts","webpack://__ember_auto_import__/Pusher/src/core/auth/options.ts","webpack://__ember_auto_import__/Pusher/src/core/defaults.ts","webpack://__ember_auto_import__/Pusher/src/runtimes/web/dom/dependency_loader.ts","webpack://__ember_auto_import__/Pusher/src/runtimes/web/dom/dependencies.ts","webpack://__ember_auto_import__/Pusher/src/core/utils/url_store.ts","webpack://__ember_auto_import__/Pusher/src/core/base64.ts","webpack://__ember_auto_import__/Pusher/src/core/errors.ts","webpack://__ember_auto_import__/Pusher/src/runtimes/isomorphic/auth/xhr_auth.ts","webpack://__ember_auto_import__/Pusher/src/core/utils/timers/abstract_timer.ts","webpack://__ember_auto_import__/Pusher/src/core/utils/timers/index.ts","webpack://__ember_auto_import__/Pusher/src/core/util.ts","webpack://__ember_auto_import__/Pusher/src/core/utils/collections.ts","webpack://__ember_auto_import__/Pusher/src/core/logger.ts","webpack://__ember_auto_import__/Pusher/src/runtimes/web/auth/jsonp_auth.ts","webpack://__ember_auto_import__/Pusher/src/runtimes/web/dom/script_request.ts","webpack://__ember_auto_import__/Pusher/src/runtimes/web/dom/jsonp_request.ts","webpack://__ember_auto_import__/Pusher/src/runtimes/web/timeline/jsonp_timeline.ts","webpack://__ember_auto_import__/Pusher/src/core/transports/url_schemes.ts","webpack://__ember_auto_import__/Pusher/src/core/events/callback_registry.ts","webpack://__ember_auto_import__/Pusher/src/core/events/dispatcher.ts","webpack://__ember_auto_import__/Pusher/src/core/transports/transport_connection.ts","webpack://__ember_auto_import__/Pusher/src/core/transports/transport.ts","webpack://__ember_auto_import__/Pusher/src/runtimes/isomorphic/transports/transports.ts","webpack://__ember_auto_import__/Pusher/src/runtimes/web/transports/transports.ts","webpack://__ember_auto_import__/Pusher/src/runtimes/web/net_info.ts","webpack://__ember_auto_import__/Pusher/src/core/transports/assistant_to_the_transport_manager.ts","webpack://__ember_auto_import__/Pusher/src/core/connection/protocol/protocol.ts","webpack://__ember_auto_import__/Pusher/src/core/connection/connection.ts","webpack://__ember_auto_import__/Pusher/src/core/connection/handshake/index.ts","webpack://__ember_auto_import__/Pusher/src/core/timeline/timeline_sender.ts","webpack://__ember_auto_import__/Pusher/src/core/channels/channel.ts","webpack://__ember_auto_import__/Pusher/src/core/channels/private_channel.ts","webpack://__ember_auto_import__/Pusher/src/core/channels/members.ts","webpack://__ember_auto_import__/Pusher/src/core/channels/presence_channel.ts","webpack://__ember_auto_import__/Pusher/src/core/channels/encrypted_channel.ts","webpack://__ember_auto_import__/Pusher/src/core/connection/connection_manager.ts","webpack://__ember_auto_import__/Pusher/src/core/channels/channels.ts","webpack://__ember_auto_import__/Pusher/src/core/utils/factory.ts","webpack://__ember_auto_import__/Pusher/src/core/transports/transport_manager.ts","webpack://__ember_auto_import__/Pusher/src/core/strategies/sequential_strategy.ts","webpack://__ember_auto_import__/Pusher/src/core/strategies/best_connected_ever_strategy.ts","webpack://__ember_auto_import__/Pusher/src/core/strategies/cached_strategy.ts","webpack://__ember_auto_import__/Pusher/src/core/strategies/delayed_strategy.ts","webpack://__ember_auto_import__/Pusher/src/core/strategies/if_strategy.ts","webpack://__ember_auto_import__/Pusher/src/core/strategies/first_connected_strategy.ts","webpack://__ember_auto_import__/Pusher/src/runtimes/web/default_strategy.ts","webpack://__ember_auto_import__/Pusher/src/core/http/state.ts","webpack://__ember_auto_import__/Pusher/src/runtimes/web/http/http_xdomain_request.ts","webpack://__ember_auto_import__/Pusher/src/core/http/http_request.ts","webpack://__ember_auto_import__/Pusher/src/core/http/http_socket.ts","webpack://__ember_auto_import__/Pusher/src/core/timeline/level.ts","webpack://__ember_auto_import__/Pusher/src/core/http/http_streaming_socket.ts","webpack://__ember_auto_import__/Pusher/src/core/http/http_polling_socket.ts","webpack://__ember_auto_import__/Pusher/src/runtimes/isomorphic/http/http_xhr_request.ts","webpack://__ember_auto_import__/Pusher/src/runtimes/web/runtime.ts","webpack://__ember_auto_import__/Pusher/src/runtimes/web/transports/transport_connection_initializer.ts","webpack://__ember_auto_import__/Pusher/src/runtimes/isomorphic/http/http.ts","webpack://__ember_auto_import__/Pusher/src/runtimes/web/http/http.ts","webpack://__ember_auto_import__/Pusher/src/core/timeline/timeline.ts","webpack://__ember_auto_import__/Pusher/src/core/strategies/transport_strategy.ts","webpack://__ember_auto_import__/Pusher/src/core/strategies/strategy_builder.ts","webpack://__ember_auto_import__/Pusher/src/core/config.ts","webpack://__ember_auto_import__/Pusher/src/core/auth/user_authenticator.ts","webpack://__ember_auto_import__/Pusher/src/core/auth/deprecated_channel_authorizer.ts","webpack://__ember_auto_import__/Pusher/src/core/auth/channel_authorizer.ts","webpack://__ember_auto_import__/Pusher/src/core/watchlist.ts","webpack://__ember_auto_import__/Pusher/src/core/user.ts","webpack://__ember_auto_import__/Pusher/src/core/utils/flat_promise.ts","webpack://__ember_auto_import__/Pusher/src/core/pusher.ts","webpack://__ember_auto_import__/Pusher/src/core/pusher-with-encryption.ts","webpack://__ember_auto_import__/./node_modules/pusher-js/with-encryption/index.js","webpack://__ember_auto_import__/./node_modules/slugify/slugify.js","webpack://__ember_auto_import__/./node_modules/strnum/strnum.js","webpack://__ember_auto_import__/../src/index.js","webpack://__ember_auto_import__/./node_modules/tether/dist/js/tether.js","webpack://__ember_auto_import__/../../src/utils/isBrowser.js","webpack://__ember_auto_import__/../../src/utils/debounce.js","webpack://__ember_auto_import__/../../src/utils/isFunction.js","webpack://__ember_auto_import__/../../src/utils/getStyleComputedProperty.js","webpack://__ember_auto_import__/../../src/utils/getParentNode.js","webpack://__ember_auto_import__/../../src/utils/getScrollParent.js","webpack://__ember_auto_import__/../../src/utils/getReferenceNode.js","webpack://__ember_auto_import__/../../src/utils/isIE.js","webpack://__ember_auto_import__/../../src/utils/getOffsetParent.js","webpack://__ember_auto_import__/../../src/utils/getRoot.js","webpack://__ember_auto_import__/../../src/utils/findCommonOffsetParent.js","webpack://__ember_auto_import__/../../src/utils/isOffsetContainer.js","webpack://__ember_auto_import__/../../src/utils/getScroll.js","webpack://__ember_auto_import__/../../src/utils/getBordersSize.js","webpack://__ember_auto_import__/../../src/utils/getWindowSizes.js","webpack://__ember_auto_import__/../../src/utils/getClientRect.js","webpack://__ember_auto_import__/../../src/utils/getBoundingClientRect.js","webpack://__ember_auto_import__/../../src/utils/getOffsetRectRelativeToArbitraryNode.js","webpack://__ember_auto_import__/../../src/utils/includeScroll.js","webpack://__ember_auto_import__/../../src/utils/isFixed.js","webpack://__ember_auto_import__/../../src/utils/getFixedPositionOffsetParent.js","webpack://__ember_auto_import__/../../src/utils/getBoundaries.js","webpack://__ember_auto_import__/../../src/utils/getViewportOffsetRectRelativeToArtbitraryNode.js","webpack://__ember_auto_import__/../../src/utils/computeAutoPlacement.js","webpack://__ember_auto_import__/../../src/utils/getReferenceOffsets.js","webpack://__ember_auto_import__/../../src/utils/getOuterSizes.js","webpack://__ember_auto_import__/../../src/utils/getOppositePlacement.js","webpack://__ember_auto_import__/../../src/utils/getPopperOffsets.js","webpack://__ember_auto_import__/../../src/utils/find.js","webpack://__ember_auto_import__/../../src/utils/runModifiers.js","webpack://__ember_auto_import__/../../src/utils/findIndex.js","webpack://__ember_auto_import__/../../src/methods/update.js","webpack://__ember_auto_import__/../../src/utils/isModifierEnabled.js","webpack://__ember_auto_import__/../../src/utils/getSupportedPropertyName.js","webpack://__ember_auto_import__/../../src/methods/destroy.js","webpack://__ember_auto_import__/../../src/utils/getWindow.js","webpack://__ember_auto_import__/../../src/utils/setupEventListeners.js","webpack://__ember_auto_import__/../../src/methods/enableEventListeners.js","webpack://__ember_auto_import__/../../src/methods/disableEventListeners.js","webpack://__ember_auto_import__/../../src/utils/removeEventListeners.js","webpack://__ember_auto_import__/../../src/utils/isNumeric.js","webpack://__ember_auto_import__/../../src/utils/setStyles.js","webpack://__ember_auto_import__/../../src/modifiers/computeStyle.js","webpack://__ember_auto_import__/../../src/utils/isModifierRequired.js","webpack://__ember_auto_import__/../../src/methods/placements.js","webpack://__ember_auto_import__/../../src/utils/clockwise.js","webpack://__ember_auto_import__/../../src/modifiers/index.js","webpack://__ember_auto_import__/../../src/modifiers/shift.js","webpack://__ember_auto_import__/../../src/modifiers/offset.js","webpack://__ember_auto_import__/../../src/modifiers/preventOverflow.js","webpack://__ember_auto_import__/../../src/modifiers/keepTogether.js","webpack://__ember_auto_import__/../../src/modifiers/arrow.js","webpack://__ember_auto_import__/../../src/modifiers/flip.js","webpack://__ember_auto_import__/../../src/utils/getOppositeVariation.js","webpack://__ember_auto_import__/../../src/modifiers/inner.js","webpack://__ember_auto_import__/../../src/modifiers/hide.js","webpack://__ember_auto_import__/../../src/utils/getRoundedOffsets.js","webpack://__ember_auto_import__/../../src/modifiers/applyStyle.js","webpack://__ember_auto_import__/../../src/utils/setAttributes.js","webpack://__ember_auto_import__/../../src/methods/defaults.js","webpack://__ember_auto_import__/../../src/index.js","webpack://__ember_auto_import__/../../../popper/src/utils/isFunction.js","webpack://__ember_auto_import__/./node_modules/ua-parser-js/src/ua-parser.js","webpack://__ember_auto_import__/./node_modules/xstate/es/_virtual/_tslib.js","webpack://__ember_auto_import__/./node_modules/xstate/es/types.js","webpack://__ember_auto_import__/./node_modules/xstate/es/actionTypes.js","webpack://__ember_auto_import__/./node_modules/xstate/es/utils.js","webpack://__ember_auto_import__/./node_modules/xstate/es/constants.js","webpack://__ember_auto_import__/./node_modules/xstate/es/environment.js","webpack://__ember_auto_import__/./node_modules/xstate/es/actions.js","webpack://__ember_auto_import__/./node_modules/xstate/es/serviceScope.js","webpack://__ember_auto_import__/./node_modules/xstate/es/Actor.js","webpack://__ember_auto_import__/./node_modules/xstate/es/stateUtils.js","webpack://__ember_auto_import__/./node_modules/xstate/es/State.js","webpack://__ember_auto_import__/./node_modules/xstate/es/scheduler.js","webpack://__ember_auto_import__/./node_modules/xstate/es/registry.js","webpack://__ember_auto_import__/./node_modules/xstate/es/devTools.js","webpack://__ember_auto_import__/./node_modules/xstate/es/behaviors.js","webpack://__ember_auto_import__/./node_modules/xstate/es/interpreter.js","webpack://__ember_auto_import__/./node_modules/xstate/es/invokeUtils.js","webpack://__ember_auto_import__/./node_modules/xstate/es/StateNode.js","webpack://__ember_auto_import__/./node_modules/xstate/es/Machine.js","webpack://__ember_auto_import__/./node_modules/xstate/es/mapState.js","webpack://__ember_auto_import__/./node_modules/xstate/es/match.js","webpack://__ember_auto_import__/./node_modules/xstate/es/schema.js","webpack://__ember_auto_import__/./node_modules/xstate/es/index.js","webpack://__ember_auto_import__/./node_modules/deep-object-diff/cjs/added.js","webpack://__ember_auto_import__/./node_modules/deep-object-diff/cjs/deleted.js","webpack://__ember_auto_import__/./node_modules/deep-object-diff/cjs/detailed.js","webpack://__ember_auto_import__/./node_modules/deep-object-diff/cjs/diff.js","webpack://__ember_auto_import__/./node_modules/deep-object-diff/cjs/index.js","webpack://__ember_auto_import__/./node_modules/deep-object-diff/cjs/updated.js","webpack://__ember_auto_import__/./node_modules/deep-object-diff/cjs/utils.js","webpack://__ember_auto_import__/./node_modules/valibot/dist/index.cjs","webpack://__ember_auto_import__/./node_modules/idb/build/wrap-idb-value.js","webpack://__ember_auto_import__/./node_modules/idb/build/index.js","webpack://__ember_auto_import__/./node_modules/tslib/tslib.es6.mjs"],"sourcesContent":["export default function esCompat(m) {\n  return m?.__esModule ? m : { default: m };\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { name as appName } from '../package.json';\nimport { name as appCompatName } from '../../app-compat/package.json';\nimport { name as analyticsCompatName } from '../../../packages/analytics-compat/package.json';\nimport { name as analyticsName } from '../../../packages/analytics/package.json';\nimport { name as appCheckCompatName } from '../../../packages/app-check-compat/package.json';\nimport { name as appCheckName } from '../../../packages/app-check/package.json';\nimport { name as authName } from '../../../packages/auth/package.json';\nimport { name as authCompatName } from '../../../packages/auth-compat/package.json';\nimport { name as databaseName } from '../../../packages/database/package.json';\nimport { name as databaseCompatName } from '../../../packages/database-compat/package.json';\nimport { name as functionsName } from '../../../packages/functions/package.json';\nimport { name as functionsCompatName } from '../../../packages/functions-compat/package.json';\nimport { name as installationsName } from '../../../packages/installations/package.json';\nimport { name as installationsCompatName } from '../../../packages/installations-compat/package.json';\nimport { name as messagingName } from '../../../packages/messaging/package.json';\nimport { name as messagingCompatName } from '../../../packages/messaging-compat/package.json';\nimport { name as performanceName } from '../../../packages/performance/package.json';\nimport { name as performanceCompatName } from '../../../packages/performance-compat/package.json';\nimport { name as remoteConfigName } from '../../../packages/remote-config/package.json';\nimport { name as remoteConfigCompatName } from '../../../packages/remote-config-compat/package.json';\nimport { name as storageName } from '../../../packages/storage/package.json';\nimport { name as storageCompatName } from '../../../packages/storage-compat/package.json';\nimport { name as firestoreName } from '../../../packages/firestore/package.json';\nimport { name as firestoreCompatName } from '../../../packages/firestore-compat/package.json';\nimport { name as packageName } from '../../../packages/firebase/package.json';\n\n/**\n * The default app name\n *\n * @internal\n */\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\n\nexport const PLATFORM_LOG_STRING = {\n  [appName]: 'fire-core',\n  [appCompatName]: 'fire-core-compat',\n  [analyticsName]: 'fire-analytics',\n  [analyticsCompatName]: 'fire-analytics-compat',\n  [appCheckName]: 'fire-app-check',\n  [appCheckCompatName]: 'fire-app-check-compat',\n  [authName]: 'fire-auth',\n  [authCompatName]: 'fire-auth-compat',\n  [databaseName]: 'fire-rtdb',\n  [databaseCompatName]: 'fire-rtdb-compat',\n  [functionsName]: 'fire-fn',\n  [functionsCompatName]: 'fire-fn-compat',\n  [installationsName]: 'fire-iid',\n  [installationsCompatName]: 'fire-iid-compat',\n  [messagingName]: 'fire-fcm',\n  [messagingCompatName]: 'fire-fcm-compat',\n  [performanceName]: 'fire-perf',\n  [performanceCompatName]: 'fire-perf-compat',\n  [remoteConfigName]: 'fire-rc',\n  [remoteConfigCompatName]: 'fire-rc-compat',\n  [storageName]: 'fire-gcs',\n  [storageCompatName]: 'fire-gcs-compat',\n  [firestoreName]: 'fire-fst',\n  [firestoreCompatName]: 'fire-fst-compat',\n  'fire-js': 'fire-js', // Platform identifier for JS SDK.\n  [packageName]: 'fire-js-all'\n} as const;\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n  NO_APP = 'no-app',\n  BAD_APP_NAME = 'bad-app-name',\n  DUPLICATE_APP = 'duplicate-app',\n  APP_DELETED = 'app-deleted',\n  SERVER_APP_DELETED = 'server-app-deleted',\n  NO_OPTIONS = 'no-options',\n  INVALID_APP_ARGUMENT = 'invalid-app-argument',\n  INVALID_LOG_ARGUMENT = 'invalid-log-argument',\n  IDB_OPEN = 'idb-open',\n  IDB_GET = 'idb-get',\n  IDB_WRITE = 'idb-set',\n  IDB_DELETE = 'idb-delete',\n  FINALIZATION_REGISTRY_NOT_SUPPORTED = 'finalization-registry-not-supported',\n  INVALID_SERVER_APP_ENVIRONMENT = 'invalid-server-app-environment'\n}\n\nconst ERRORS: ErrorMap<AppError> = {\n  [AppError.NO_APP]:\n    \"No Firebase App '{$appName}' has been created - \" +\n    'call initializeApp() first',\n  [AppError.BAD_APP_NAME]: \"Illegal App name: '{$appName}'\",\n  [AppError.DUPLICATE_APP]:\n    \"Firebase App named '{$appName}' already exists with different options or config\",\n  [AppError.APP_DELETED]: \"Firebase App named '{$appName}' already deleted\",\n  [AppError.SERVER_APP_DELETED]: 'Firebase Server App has been deleted',\n  [AppError.NO_OPTIONS]:\n    'Need to provide options, when not being deployed to hosting via source.',\n  [AppError.INVALID_APP_ARGUMENT]:\n    'firebase.{$appName}() takes either no argument or a ' +\n    'Firebase App instance.',\n  [AppError.INVALID_LOG_ARGUMENT]:\n    'First argument to `onLog` must be null or a function.',\n  [AppError.IDB_OPEN]:\n    'Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.',\n  [AppError.IDB_GET]:\n    'Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.',\n  [AppError.IDB_WRITE]:\n    'Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.',\n  [AppError.IDB_DELETE]:\n    'Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.',\n  [AppError.FINALIZATION_REGISTRY_NOT_SUPPORTED]:\n    'FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.',\n  [AppError.INVALID_SERVER_APP_ENVIRONMENT]:\n    'FirebaseServerApp is not for use in browser environments.'\n};\n\ninterface ErrorParams {\n  [AppError.NO_APP]: { appName: string };\n  [AppError.BAD_APP_NAME]: { appName: string };\n  [AppError.DUPLICATE_APP]: { appName: string };\n  [AppError.APP_DELETED]: { appName: string };\n  [AppError.INVALID_APP_ARGUMENT]: { appName: string };\n  [AppError.IDB_OPEN]: { originalErrorMessage?: string };\n  [AppError.IDB_GET]: { originalErrorMessage?: string };\n  [AppError.IDB_WRITE]: { originalErrorMessage?: string };\n  [AppError.IDB_DELETE]: { originalErrorMessage?: string };\n  [AppError.FINALIZATION_REGISTRY_NOT_SUPPORTED]: { appName?: string };\n}\n\nexport const ERROR_FACTORY = new ErrorFactory<AppError, ErrorParams>(\n  'app',\n  'Firebase',\n  ERRORS\n);\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  ComponentContainer,\n  ComponentType,\n  Provider,\n  Name\n} from '@firebase/component';\nimport { PlatformLoggerService, VersionService } from './types';\n\nexport class PlatformLoggerServiceImpl implements PlatformLoggerService {\n  constructor(private readonly container: ComponentContainer) {}\n  // In initial implementation, this will be called by installations on\n  // auth token refresh, and installations will send this string.\n  getPlatformInfoString(): string {\n    const providers = this.container.getProviders();\n    // Loop through providers and get library/version pairs from any that are\n    // version components.\n    return providers\n      .map(provider => {\n        if (isVersionServiceProvider(provider)) {\n          const service = provider.getImmediate() as VersionService;\n          return `${service.library}/${service.version}`;\n        } else {\n          return null;\n        }\n      })\n      .filter(logString => logString)\n      .join(' ');\n  }\n}\n/**\n *\n * @param provider check if this provider provides a VersionService\n *\n * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider\n * provides VersionService. The provider is not necessarily a 'app-version'\n * provider.\n */\nfunction isVersionServiceProvider(provider: Provider<Name>): boolean {\n  const component = provider.getComponent();\n  return component?.type === ComponentType.VERSION;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Logger } from '@firebase/logger';\n\nexport const logger = new Logger('@firebase/app');\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  FirebaseApp,\n  FirebaseOptions,\n  FirebaseServerApp\n} from './public-types';\nimport { Component, Provider, Name } from '@firebase/component';\nimport { logger } from './logger';\nimport { DEFAULT_ENTRY_NAME } from './constants';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { FirebaseServerAppImpl } from './firebaseServerApp';\n\n/**\n * @internal\n */\nexport const _apps = new Map<string, FirebaseApp>();\n\n/**\n * @internal\n */\nexport const _serverApps = new Map<string, FirebaseServerApp>();\n\n/**\n * Registered components.\n *\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const _components = new Map<string, Component<any>>();\n\n/**\n * @param component - the component being added to this app's container\n *\n * @internal\n */\nexport function _addComponent<T extends Name>(\n  app: FirebaseApp,\n  component: Component<T>\n): void {\n  try {\n    (app as FirebaseAppImpl).container.addComponent(component);\n  } catch (e) {\n    logger.debug(\n      `Component ${component.name} failed to register with FirebaseApp ${app.name}`,\n      e\n    );\n  }\n}\n\n/**\n *\n * @internal\n */\nexport function _addOrOverwriteComponent(\n  app: FirebaseApp,\n  component: Component\n): void {\n  (app as FirebaseAppImpl).container.addOrOverwriteComponent(component);\n}\n\n/**\n *\n * @param component - the component to register\n * @returns whether or not the component is registered successfully\n *\n * @internal\n */\nexport function _registerComponent<T extends Name>(\n  component: Component<T>\n): boolean {\n  const componentName = component.name;\n  if (_components.has(componentName)) {\n    logger.debug(\n      `There were multiple attempts to register component ${componentName}.`\n    );\n\n    return false;\n  }\n\n  _components.set(componentName, component);\n\n  // add the component to existing app instances\n  for (const app of _apps.values()) {\n    _addComponent(app as FirebaseAppImpl, component);\n  }\n\n  for (const serverApp of _serverApps.values()) {\n    _addComponent(serverApp as FirebaseServerAppImpl, component);\n  }\n\n  return true;\n}\n\n/**\n *\n * @param app - FirebaseApp instance\n * @param name - service name\n *\n * @returns the provider for the service with the matching name\n *\n * @internal\n */\nexport function _getProvider<T extends Name>(\n  app: FirebaseApp,\n  name: T\n): Provider<T> {\n  const heartbeatController = (app as FirebaseAppImpl).container\n    .getProvider('heartbeat')\n    .getImmediate({ optional: true });\n  if (heartbeatController) {\n    void heartbeatController.triggerHeartbeat();\n  }\n  return (app as FirebaseAppImpl).container.getProvider(name);\n}\n\n/**\n *\n * @param app - FirebaseApp instance\n * @param name - service name\n * @param instanceIdentifier - service instance identifier in case the service supports multiple instances\n *\n * @internal\n */\nexport function _removeServiceInstance<T extends Name>(\n  app: FirebaseApp,\n  name: T,\n  instanceIdentifier: string = DEFAULT_ENTRY_NAME\n): void {\n  _getProvider(app, name).clearInstance(instanceIdentifier);\n}\n\n/**\n *\n * @param obj - an object of type FirebaseApp or FirebaseOptions.\n *\n * @returns true if the provide object is of type FirebaseApp.\n *\n * @internal\n */\nexport function _isFirebaseApp(\n  obj: FirebaseApp | FirebaseOptions\n): obj is FirebaseApp {\n  return (obj as FirebaseApp).options !== undefined;\n}\n\n/**\n *\n * @param obj - an object of type FirebaseApp.\n *\n * @returns true if the provided object is of type FirebaseServerAppImpl.\n *\n * @internal\n */\nexport function _isFirebaseServerApp(\n  obj: FirebaseApp | FirebaseServerApp\n): obj is FirebaseServerApp {\n  return (obj as FirebaseServerApp).settings !== undefined;\n}\n\n/**\n * Test only\n *\n * @internal\n */\nexport function _clearComponents(): void {\n  _components.clear();\n}\n\n/**\n * Exported in order to be used in app-compat package\n */\nexport { DEFAULT_ENTRY_NAME as _DEFAULT_ENTRY_NAME };\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  FirebaseApp,\n  FirebaseOptions,\n  FirebaseAppSettings\n} from './public-types';\nimport {\n  ComponentContainer,\n  Component,\n  ComponentType\n} from '@firebase/component';\nimport { ERROR_FACTORY, AppError } from './errors';\n\nexport class FirebaseAppImpl implements FirebaseApp {\n  protected readonly _options: FirebaseOptions;\n  protected readonly _name: string;\n  /**\n   * Original config values passed in as a constructor parameter.\n   * It is only used to compare with another config object to support idempotent initializeApp().\n   *\n   * Updating automaticDataCollectionEnabled on the App instance will not change its value in _config.\n   */\n  private readonly _config: Required<FirebaseAppSettings>;\n  private _automaticDataCollectionEnabled: boolean;\n  protected _isDeleted = false;\n  private readonly _container: ComponentContainer;\n\n  constructor(\n    options: FirebaseOptions,\n    config: Required<FirebaseAppSettings>,\n    container: ComponentContainer\n  ) {\n    this._options = { ...options };\n    this._config = { ...config };\n    this._name = config.name;\n    this._automaticDataCollectionEnabled =\n      config.automaticDataCollectionEnabled;\n    this._container = container;\n    this.container.addComponent(\n      new Component('app', () => this, ComponentType.PUBLIC)\n    );\n  }\n\n  get automaticDataCollectionEnabled(): boolean {\n    this.checkDestroyed();\n    return this._automaticDataCollectionEnabled;\n  }\n\n  set automaticDataCollectionEnabled(val: boolean) {\n    this.checkDestroyed();\n    this._automaticDataCollectionEnabled = val;\n  }\n\n  get name(): string {\n    this.checkDestroyed();\n    return this._name;\n  }\n\n  get options(): FirebaseOptions {\n    this.checkDestroyed();\n    return this._options;\n  }\n\n  get config(): Required<FirebaseAppSettings> {\n    this.checkDestroyed();\n    return this._config;\n  }\n\n  get container(): ComponentContainer {\n    return this._container;\n  }\n\n  get isDeleted(): boolean {\n    return this._isDeleted;\n  }\n\n  set isDeleted(val: boolean) {\n    this._isDeleted = val;\n  }\n\n  /**\n   * This function will throw an Error if the App has already been deleted -\n   * use before performing API actions on the App.\n   */\n  protected checkDestroyed(): void {\n    if (this.isDeleted) {\n      throw ERROR_FACTORY.create(AppError.APP_DELETED, { appName: this._name });\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  FirebaseAppSettings,\n  FirebaseServerApp,\n  FirebaseServerAppSettings,\n  FirebaseOptions\n} from './public-types';\nimport { deleteApp, registerVersion } from './api';\nimport { ComponentContainer } from '@firebase/component';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { ERROR_FACTORY, AppError } from './errors';\nimport { name as packageName, version } from '../package.json';\n\nexport class FirebaseServerAppImpl\n  extends FirebaseAppImpl\n  implements FirebaseServerApp\n{\n  private readonly _serverConfig: FirebaseServerAppSettings;\n  private _finalizationRegistry: FinalizationRegistry<object>;\n  private _refCount: number;\n\n  constructor(\n    options: FirebaseOptions | FirebaseAppImpl,\n    serverConfig: FirebaseServerAppSettings,\n    name: string,\n    container: ComponentContainer\n  ) {\n    // Build configuration parameters for the FirebaseAppImpl base class.\n    const automaticDataCollectionEnabled =\n      serverConfig.automaticDataCollectionEnabled !== undefined\n        ? serverConfig.automaticDataCollectionEnabled\n        : false;\n\n    // Create the FirebaseAppSettings object for the FirebaseAppImp constructor.\n    const config: Required<FirebaseAppSettings> = {\n      name,\n      automaticDataCollectionEnabled\n    };\n\n    if ((options as FirebaseOptions).apiKey !== undefined) {\n      // Construct the parent FirebaseAppImp object.\n      super(options as FirebaseOptions, config, container);\n    } else {\n      const appImpl: FirebaseAppImpl = options as FirebaseAppImpl;\n      super(appImpl.options, config, container);\n    }\n\n    // Now construct the data for the FirebaseServerAppImpl.\n    this._serverConfig = {\n      automaticDataCollectionEnabled,\n      ...serverConfig\n    };\n\n    this._finalizationRegistry = new FinalizationRegistry(() => {\n      this.automaticCleanup();\n    });\n\n    this._refCount = 0;\n    this.incRefCount(this._serverConfig.releaseOnDeref);\n\n    // Do not retain a hard reference to the dref object, otherwise the FinalizationRegisry\n    // will never trigger.\n    this._serverConfig.releaseOnDeref = undefined;\n    serverConfig.releaseOnDeref = undefined;\n\n    registerVersion(packageName, version, 'serverapp');\n  }\n\n  toJSON(): undefined {\n    return undefined;\n  }\n\n  get refCount(): number {\n    return this._refCount;\n  }\n\n  // Increment the reference count of this server app. If an object is provided, register it\n  // with the finalization registry.\n  incRefCount(obj: object | undefined): void {\n    if (this.isDeleted) {\n      return;\n    }\n    this._refCount++;\n    if (obj !== undefined) {\n      this._finalizationRegistry.register(obj, this);\n    }\n  }\n\n  // Decrement the reference count.\n  decRefCount(): number {\n    if (this.isDeleted) {\n      return 0;\n    }\n    return --this._refCount;\n  }\n\n  // Invoked by the FinalizationRegistry callback to note that this app should go through its\n  // reference counts and delete itself if no reference count remain. The coordinating logic that\n  // handles this is in deleteApp(...).\n  private automaticCleanup(): void {\n    void deleteApp(this);\n  }\n\n  get settings(): FirebaseServerAppSettings {\n    this.checkDestroyed();\n    return this._serverConfig;\n  }\n\n  /**\n   * This function will throw an Error if the App has already been deleted -\n   * use before performing API actions on the App.\n   */\n  protected checkDestroyed(): void {\n    if (this.isDeleted) {\n      throw ERROR_FACTORY.create(AppError.SERVER_APP_DELETED);\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  FirebaseApp,\n  FirebaseServerApp,\n  FirebaseOptions,\n  FirebaseAppSettings,\n  FirebaseServerAppSettings\n} from './public-types';\nimport { DEFAULT_ENTRY_NAME, PLATFORM_LOG_STRING } from './constants';\nimport { ERROR_FACTORY, AppError } from './errors';\nimport {\n  ComponentContainer,\n  Component,\n  Name,\n  ComponentType\n} from '@firebase/component';\nimport { version } from '../../firebase/package.json';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { FirebaseServerAppImpl } from './firebaseServerApp';\nimport {\n  _apps,\n  _components,\n  _isFirebaseApp,\n  _registerComponent,\n  _serverApps\n} from './internal';\nimport { logger } from './logger';\nimport {\n  LogLevelString,\n  setLogLevel as setLogLevelImpl,\n  LogCallback,\n  LogOptions,\n  setUserLogHandler\n} from '@firebase/logger';\nimport { deepEqual, getDefaultAppConfig, isBrowser } from '@firebase/util';\n\nexport { FirebaseError } from '@firebase/util';\n\n/**\n * The current SDK version.\n *\n * @public\n */\nexport const SDK_VERSION = version;\n\n/**\n * Creates and initializes a {@link @firebase/app#FirebaseApp} instance.\n *\n * See\n * {@link\n *   https://firebase.google.com/docs/web/setup#add_firebase_to_your_app\n *   | Add Firebase to your app} and\n * {@link\n *   https://firebase.google.com/docs/web/setup#multiple-projects\n *   | Initialize multiple projects} for detailed documentation.\n *\n * @example\n * ```javascript\n *\n * // Initialize default app\n * // Retrieve your own options values by adding a web app on\n * // https://console.firebase.google.com\n * initializeApp({\n *   apiKey: \"AIza....\",                             // Auth / General Use\n *   authDomain: \"YOUR_APP.firebaseapp.com\",         // Auth with popup/redirect\n *   databaseURL: \"https://YOUR_APP.firebaseio.com\", // Realtime Database\n *   storageBucket: \"YOUR_APP.appspot.com\",          // Storage\n *   messagingSenderId: \"123456789\"                  // Cloud Messaging\n * });\n * ```\n *\n * @example\n * ```javascript\n *\n * // Initialize another app\n * const otherApp = initializeApp({\n *   databaseURL: \"https://<OTHER_DATABASE_NAME>.firebaseio.com\",\n *   storageBucket: \"<OTHER_STORAGE_BUCKET>.appspot.com\"\n * }, \"otherApp\");\n * ```\n *\n * @param options - Options to configure the app's services.\n * @param name - Optional name of the app to initialize. If no name\n *   is provided, the default is `\"[DEFAULT]\"`.\n *\n * @returns The initialized app.\n *\n * @public\n */\nexport function initializeApp(\n  options: FirebaseOptions,\n  name?: string\n): FirebaseApp;\n/**\n * Creates and initializes a FirebaseApp instance.\n *\n * @param options - Options to configure the app's services.\n * @param config - FirebaseApp Configuration\n *\n * @public\n */\nexport function initializeApp(\n  options: FirebaseOptions,\n  config?: FirebaseAppSettings\n): FirebaseApp;\n/**\n * Creates and initializes a FirebaseApp instance.\n *\n * @public\n */\nexport function initializeApp(): FirebaseApp;\nexport function initializeApp(\n  _options?: FirebaseOptions,\n  rawConfig = {}\n): FirebaseApp {\n  let options = _options;\n\n  if (typeof rawConfig !== 'object') {\n    const name = rawConfig;\n    rawConfig = { name };\n  }\n\n  const config: Required<FirebaseAppSettings> = {\n    name: DEFAULT_ENTRY_NAME,\n    automaticDataCollectionEnabled: false,\n    ...rawConfig\n  };\n  const name = config.name;\n\n  if (typeof name !== 'string' || !name) {\n    throw ERROR_FACTORY.create(AppError.BAD_APP_NAME, {\n      appName: String(name)\n    });\n  }\n\n  options ||= getDefaultAppConfig();\n\n  if (!options) {\n    throw ERROR_FACTORY.create(AppError.NO_OPTIONS);\n  }\n\n  const existingApp = _apps.get(name) as FirebaseAppImpl;\n  if (existingApp) {\n    // return the existing app if options and config deep equal the ones in the existing app.\n    if (\n      deepEqual(options, existingApp.options) &&\n      deepEqual(config, existingApp.config)\n    ) {\n      return existingApp;\n    } else {\n      throw ERROR_FACTORY.create(AppError.DUPLICATE_APP, { appName: name });\n    }\n  }\n\n  const container = new ComponentContainer(name);\n  for (const component of _components.values()) {\n    container.addComponent(component);\n  }\n\n  const newApp = new FirebaseAppImpl(options, config, container);\n\n  _apps.set(name, newApp);\n\n  return newApp;\n}\n\n/**\n * Creates and initializes a {@link @firebase/app#FirebaseServerApp} instance.\n *\n * The `FirebaseServerApp` is similar to `FirebaseApp`, but is intended for execution in\n * server side rendering environments only. Initialization will fail if invoked from a\n * browser environment.\n *\n * See\n * {@link\n *   https://firebase.google.com/docs/web/setup#add_firebase_to_your_app\n *   | Add Firebase to your app} and\n * {@link\n *   https://firebase.google.com/docs/web/setup#multiple-projects\n *   | Initialize multiple projects} for detailed documentation.\n *\n * @example\n * ```javascript\n *\n * // Initialize an instance of `FirebaseServerApp`.\n * // Retrieve your own options values by adding a web app on\n * // https://console.firebase.google.com\n * initializeServerApp({\n *     apiKey: \"AIza....\",                             // Auth / General Use\n *     authDomain: \"YOUR_APP.firebaseapp.com\",         // Auth with popup/redirect\n *     databaseURL: \"https://YOUR_APP.firebaseio.com\", // Realtime Database\n *     storageBucket: \"YOUR_APP.appspot.com\",          // Storage\n *     messagingSenderId: \"123456789\"                  // Cloud Messaging\n *   },\n *   {\n *    authIdToken: \"Your Auth ID Token\"\n *   });\n * ```\n *\n * @param options - `Firebase.AppOptions` to configure the app's services, or a\n *   a `FirebaseApp` instance which contains the `AppOptions` within.\n * @param config - `FirebaseServerApp` configuration.\n *\n * @returns The initialized `FirebaseServerApp`.\n *\n * @public\n */\nexport function initializeServerApp(\n  options: FirebaseOptions | FirebaseApp,\n  config: FirebaseServerAppSettings\n): FirebaseServerApp;\n\nexport function initializeServerApp(\n  _options: FirebaseOptions | FirebaseApp,\n  _serverAppConfig: FirebaseServerAppSettings\n): FirebaseServerApp {\n  if (isBrowser()) {\n    // FirebaseServerApp isn't designed to be run in browsers.\n    throw ERROR_FACTORY.create(AppError.INVALID_SERVER_APP_ENVIRONMENT);\n  }\n\n  if (_serverAppConfig.automaticDataCollectionEnabled === undefined) {\n    _serverAppConfig.automaticDataCollectionEnabled = false;\n  }\n\n  let appOptions: FirebaseOptions;\n  if (_isFirebaseApp(_options)) {\n    appOptions = _options.options;\n  } else {\n    appOptions = _options;\n  }\n\n  // Build an app name based on a hash of the configuration options.\n  const nameObj = {\n    ..._serverAppConfig,\n    ...appOptions\n  };\n\n  // However, Do not mangle the name based on releaseOnDeref, since it will vary between the\n  // construction of FirebaseServerApp instances. For example, if the object is the request headers.\n  if (nameObj.releaseOnDeref !== undefined) {\n    delete nameObj.releaseOnDeref;\n  }\n\n  const hashCode = (s: string): number => {\n    return [...s].reduce(\n      (hash, c) => (Math.imul(31, hash) + c.charCodeAt(0)) | 0,\n      0\n    );\n  };\n\n  if (_serverAppConfig.releaseOnDeref !== undefined) {\n    if (typeof FinalizationRegistry === 'undefined') {\n      throw ERROR_FACTORY.create(\n        AppError.FINALIZATION_REGISTRY_NOT_SUPPORTED,\n        {}\n      );\n    }\n  }\n\n  const nameString = '' + hashCode(JSON.stringify(nameObj));\n  const existingApp = _serverApps.get(nameString) as FirebaseServerApp;\n  if (existingApp) {\n    (existingApp as FirebaseServerAppImpl).incRefCount(\n      _serverAppConfig.releaseOnDeref\n    );\n    return existingApp;\n  }\n\n  const container = new ComponentContainer(nameString);\n  for (const component of _components.values()) {\n    container.addComponent(component);\n  }\n\n  const newApp = new FirebaseServerAppImpl(\n    appOptions,\n    _serverAppConfig,\n    nameString,\n    container\n  );\n\n  _serverApps.set(nameString, newApp);\n\n  return newApp;\n}\n\n/**\n * Retrieves a {@link @firebase/app#FirebaseApp} instance.\n *\n * When called with no arguments, the default app is returned. When an app name\n * is provided, the app corresponding to that name is returned.\n *\n * An exception is thrown if the app being retrieved has not yet been\n * initialized.\n *\n * @example\n * ```javascript\n * // Return the default app\n * const app = getApp();\n * ```\n *\n * @example\n * ```javascript\n * // Return a named app\n * const otherApp = getApp(\"otherApp\");\n * ```\n *\n * @param name - Optional name of the app to return. If no name is\n *   provided, the default is `\"[DEFAULT]\"`.\n *\n * @returns The app corresponding to the provided app name.\n *   If no app name is provided, the default app is returned.\n *\n * @public\n */\nexport function getApp(name: string = DEFAULT_ENTRY_NAME): FirebaseApp {\n  const app = _apps.get(name);\n  if (!app && name === DEFAULT_ENTRY_NAME && getDefaultAppConfig()) {\n    return initializeApp();\n  }\n  if (!app) {\n    throw ERROR_FACTORY.create(AppError.NO_APP, { appName: name });\n  }\n\n  return app;\n}\n\n/**\n * A (read-only) array of all initialized apps.\n * @public\n */\nexport function getApps(): FirebaseApp[] {\n  return Array.from(_apps.values());\n}\n\n/**\n * Renders this app unusable and frees the resources of all associated\n * services.\n *\n * @example\n * ```javascript\n * deleteApp(app)\n *   .then(function() {\n *     console.log(\"App deleted successfully\");\n *   })\n *   .catch(function(error) {\n *     console.log(\"Error deleting app:\", error);\n *   });\n * ```\n *\n * @public\n */\nexport async function deleteApp(app: FirebaseApp): Promise<void> {\n  let cleanupProviders = false;\n  const name = app.name;\n  if (_apps.has(name)) {\n    cleanupProviders = true;\n    _apps.delete(name);\n  } else if (_serverApps.has(name)) {\n    const firebaseServerApp = app as FirebaseServerAppImpl;\n    if (firebaseServerApp.decRefCount() <= 0) {\n      _serverApps.delete(name);\n      cleanupProviders = true;\n    }\n  }\n\n  if (cleanupProviders) {\n    await Promise.all(\n      (app as FirebaseAppImpl).container\n        .getProviders()\n        .map(provider => provider.delete())\n    );\n    (app as FirebaseAppImpl).isDeleted = true;\n  }\n}\n\n/**\n * Registers a library's name and version for platform logging purposes.\n * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)\n * @param version - Current version of that library.\n * @param variant - Bundle variant, e.g., node, rn, etc.\n *\n * @public\n */\nexport function registerVersion(\n  libraryKeyOrName: string,\n  version: string,\n  variant?: string\n): void {\n  // TODO: We can use this check to whitelist strings when/if we set up\n  // a good whitelist system.\n  let library = PLATFORM_LOG_STRING[libraryKeyOrName] ?? libraryKeyOrName;\n  if (variant) {\n    library += `-${variant}`;\n  }\n  const libraryMismatch = library.match(/\\s|\\//);\n  const versionMismatch = version.match(/\\s|\\//);\n  if (libraryMismatch || versionMismatch) {\n    const warning = [\n      `Unable to register library \"${library}\" with version \"${version}\":`\n    ];\n    if (libraryMismatch) {\n      warning.push(\n        `library name \"${library}\" contains illegal characters (whitespace or \"/\")`\n      );\n    }\n    if (libraryMismatch && versionMismatch) {\n      warning.push('and');\n    }\n    if (versionMismatch) {\n      warning.push(\n        `version name \"${version}\" contains illegal characters (whitespace or \"/\")`\n      );\n    }\n    logger.warn(warning.join(' '));\n    return;\n  }\n  _registerComponent(\n    new Component(\n      `${library}-version` as Name,\n      () => ({ library, version }),\n      ComponentType.VERSION\n    )\n  );\n}\n\n/**\n * Sets log handler for all Firebase SDKs.\n * @param logCallback - An optional custom log handler that executes user code whenever\n * the Firebase SDK makes a logging call.\n *\n * @public\n */\nexport function onLog(\n  logCallback: LogCallback | null,\n  options?: LogOptions\n): void {\n  if (logCallback !== null && typeof logCallback !== 'function') {\n    throw ERROR_FACTORY.create(AppError.INVALID_LOG_ARGUMENT);\n  }\n  setUserLogHandler(logCallback, options);\n}\n\n/**\n * Sets log level for all Firebase SDKs.\n *\n * All of the log types above the current log level are captured (i.e. if\n * you set the log level to `info`, errors are logged, but `debug` and\n * `verbose` logs are not).\n *\n * @public\n */\nexport function setLogLevel(logLevel: LogLevelString): void {\n  setLogLevelImpl(logLevel);\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseError } from '@firebase/util';\nimport { DBSchema, openDB, IDBPDatabase } from 'idb';\nimport { AppError, ERROR_FACTORY } from './errors';\nimport { FirebaseApp } from './public-types';\nimport { HeartbeatsInIndexedDB } from './types';\nimport { logger } from './logger';\n\nconst DB_NAME = 'firebase-heartbeat-database';\nconst DB_VERSION = 1;\nconst STORE_NAME = 'firebase-heartbeat-store';\n\ninterface AppDB extends DBSchema {\n  'firebase-heartbeat-store': {\n    key: string;\n    value: HeartbeatsInIndexedDB;\n  };\n}\n\nlet dbPromise: Promise<IDBPDatabase<AppDB>> | null = null;\nfunction getDbPromise(): Promise<IDBPDatabase<AppDB>> {\n  if (!dbPromise) {\n    dbPromise = openDB<AppDB>(DB_NAME, DB_VERSION, {\n      upgrade: (db, oldVersion) => {\n        // We don't use 'break' in this switch statement, the fall-through\n        // behavior is what we want, because if there are multiple versions between\n        // the old version and the current version, we want ALL the migrations\n        // that correspond to those versions to run, not only the last one.\n        // eslint-disable-next-line default-case\n        switch (oldVersion) {\n          case 0:\n            try {\n              db.createObjectStore(STORE_NAME);\n            } catch (e) {\n              // Safari/iOS browsers throw occasional exceptions on\n              // db.createObjectStore() that may be a bug. Avoid blocking\n              // the rest of the app functionality.\n              console.warn(e);\n            }\n        }\n      }\n    }).catch(e => {\n      throw ERROR_FACTORY.create(AppError.IDB_OPEN, {\n        originalErrorMessage: e.message\n      });\n    });\n  }\n  return dbPromise;\n}\n\nexport async function readHeartbeatsFromIndexedDB(\n  app: FirebaseApp\n): Promise<HeartbeatsInIndexedDB | undefined> {\n  try {\n    const db = await getDbPromise();\n    const tx = db.transaction(STORE_NAME);\n    const result = await tx.objectStore(STORE_NAME).get(computeKey(app));\n    // We already have the value but tx.done can throw,\n    // so we need to await it here to catch errors\n    await tx.done;\n    return result;\n  } catch (e) {\n    if (e instanceof FirebaseError) {\n      logger.warn(e.message);\n    } else {\n      const idbGetError = ERROR_FACTORY.create(AppError.IDB_GET, {\n        originalErrorMessage: (e as Error)?.message\n      });\n      logger.warn(idbGetError.message);\n    }\n  }\n}\n\nexport async function writeHeartbeatsToIndexedDB(\n  app: FirebaseApp,\n  heartbeatObject: HeartbeatsInIndexedDB\n): Promise<void> {\n  try {\n    const db = await getDbPromise();\n    const tx = db.transaction(STORE_NAME, 'readwrite');\n    const objectStore = tx.objectStore(STORE_NAME);\n    await objectStore.put(heartbeatObject, computeKey(app));\n    await tx.done;\n  } catch (e) {\n    if (e instanceof FirebaseError) {\n      logger.warn(e.message);\n    } else {\n      const idbGetError = ERROR_FACTORY.create(AppError.IDB_WRITE, {\n        originalErrorMessage: (e as Error)?.message\n      });\n      logger.warn(idbGetError.message);\n    }\n  }\n}\n\nfunction computeKey(app: FirebaseApp): string {\n  return `${app.name}!${app.options.appId}`;\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ComponentContainer } from '@firebase/component';\nimport {\n  base64urlEncodeWithoutPadding,\n  isIndexedDBAvailable,\n  validateIndexedDBOpenable\n} from '@firebase/util';\nimport {\n  readHeartbeatsFromIndexedDB,\n  writeHeartbeatsToIndexedDB\n} from './indexeddb';\nimport { FirebaseApp } from './public-types';\nimport {\n  HeartbeatsByUserAgent,\n  HeartbeatService,\n  HeartbeatsInIndexedDB,\n  HeartbeatStorage,\n  SingleDateHeartbeat\n} from './types';\n\nconst MAX_HEADER_BYTES = 1024;\n// 30 days\nconst STORED_HEARTBEAT_RETENTION_MAX_MILLIS = 30 * 24 * 60 * 60 * 1000;\n\nexport class HeartbeatServiceImpl implements HeartbeatService {\n  /**\n   * The persistence layer for heartbeats\n   * Leave public for easier testing.\n   */\n  _storage: HeartbeatStorageImpl;\n\n  /**\n   * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate\n   * the header string.\n   * Stores one record per date. This will be consolidated into the standard\n   * format of one record per user agent string before being sent as a header.\n   * Populated from indexedDB when the controller is instantiated and should\n   * be kept in sync with indexedDB.\n   * Leave public for easier testing.\n   */\n  _heartbeatsCache: HeartbeatsInIndexedDB | null = null;\n\n  /**\n   * the initialization promise for populating heartbeatCache.\n   * If getHeartbeatsHeader() is called before the promise resolves\n   * (hearbeatsCache == null), it should wait for this promise\n   * Leave public for easier testing.\n   */\n  _heartbeatsCachePromise: Promise<HeartbeatsInIndexedDB>;\n  constructor(private readonly container: ComponentContainer) {\n    const app = this.container.getProvider('app').getImmediate();\n    this._storage = new HeartbeatStorageImpl(app);\n    this._heartbeatsCachePromise = this._storage.read().then(result => {\n      this._heartbeatsCache = result;\n      return result;\n    });\n  }\n\n  /**\n   * Called to report a heartbeat. The function will generate\n   * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it\n   * to IndexedDB.\n   * Note that we only store one heartbeat per day. So if a heartbeat for today is\n   * already logged, subsequent calls to this function in the same day will be ignored.\n   */\n  async triggerHeartbeat(): Promise<void> {\n    const platformLogger = this.container\n      .getProvider('platform-logger')\n      .getImmediate();\n\n    // This is the \"Firebase user agent\" string from the platform logger\n    // service, not the browser user agent.\n    const agent = platformLogger.getPlatformInfoString();\n    const date = getUTCDateString();\n    if (this._heartbeatsCache?.heartbeats == null) {\n      this._heartbeatsCache = await this._heartbeatsCachePromise;\n      // If we failed to construct a heartbeats cache, then return immediately.\n      if (this._heartbeatsCache?.heartbeats == null) {\n        return;\n      }\n    }\n    // Do not store a heartbeat if one is already stored for this day\n    // or if a header has already been sent today.\n    if (\n      this._heartbeatsCache.lastSentHeartbeatDate === date ||\n      this._heartbeatsCache.heartbeats.some(\n        singleDateHeartbeat => singleDateHeartbeat.date === date\n      )\n    ) {\n      return;\n    } else {\n      // There is no entry for this date. Create one.\n      this._heartbeatsCache.heartbeats.push({ date, agent });\n    }\n    // Remove entries older than 30 days.\n    this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter(\n      singleDateHeartbeat => {\n        const hbTimestamp = new Date(singleDateHeartbeat.date).valueOf();\n        const now = Date.now();\n        return now - hbTimestamp <= STORED_HEARTBEAT_RETENTION_MAX_MILLIS;\n      }\n    );\n    return this._storage.overwrite(this._heartbeatsCache);\n  }\n\n  /**\n   * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.\n   * It also clears all heartbeats from memory as well as in IndexedDB.\n   *\n   * NOTE: Consuming product SDKs should not send the header if this method\n   * returns an empty string.\n   */\n  async getHeartbeatsHeader(): Promise<string> {\n    if (this._heartbeatsCache === null) {\n      await this._heartbeatsCachePromise;\n    }\n    // If it's still null or the array is empty, there is no data to send.\n    if (\n      this._heartbeatsCache?.heartbeats == null ||\n      this._heartbeatsCache.heartbeats.length === 0\n    ) {\n      return '';\n    }\n    const date = getUTCDateString();\n    // Extract as many heartbeats from the cache as will fit under the size limit.\n    const { heartbeatsToSend, unsentEntries } = extractHeartbeatsForHeader(\n      this._heartbeatsCache.heartbeats\n    );\n    const headerString = base64urlEncodeWithoutPadding(\n      JSON.stringify({ version: 2, heartbeats: heartbeatsToSend })\n    );\n    // Store last sent date to prevent another being logged/sent for the same day.\n    this._heartbeatsCache.lastSentHeartbeatDate = date;\n    if (unsentEntries.length > 0) {\n      // Store any unsent entries if they exist.\n      this._heartbeatsCache.heartbeats = unsentEntries;\n      // This seems more likely than emptying the array (below) to lead to some odd state\n      // since the cache isn't empty and this will be called again on the next request,\n      // and is probably safest if we await it.\n      await this._storage.overwrite(this._heartbeatsCache);\n    } else {\n      this._heartbeatsCache.heartbeats = [];\n      // Do not wait for this, to reduce latency.\n      void this._storage.overwrite(this._heartbeatsCache);\n    }\n    return headerString;\n  }\n}\n\nfunction getUTCDateString(): string {\n  const today = new Date();\n  // Returns date format 'YYYY-MM-DD'\n  return today.toISOString().substring(0, 10);\n}\n\nexport function extractHeartbeatsForHeader(\n  heartbeatsCache: SingleDateHeartbeat[],\n  maxSize = MAX_HEADER_BYTES\n): {\n  heartbeatsToSend: HeartbeatsByUserAgent[];\n  unsentEntries: SingleDateHeartbeat[];\n} {\n  // Heartbeats grouped by user agent in the standard format to be sent in\n  // the header.\n  const heartbeatsToSend: HeartbeatsByUserAgent[] = [];\n  // Single date format heartbeats that are not sent.\n  let unsentEntries = heartbeatsCache.slice();\n  for (const singleDateHeartbeat of heartbeatsCache) {\n    // Look for an existing entry with the same user agent.\n    const heartbeatEntry = heartbeatsToSend.find(\n      hb => hb.agent === singleDateHeartbeat.agent\n    );\n    if (!heartbeatEntry) {\n      // If no entry for this user agent exists, create one.\n      heartbeatsToSend.push({\n        agent: singleDateHeartbeat.agent,\n        dates: [singleDateHeartbeat.date]\n      });\n      if (countBytes(heartbeatsToSend) > maxSize) {\n        // If the header would exceed max size, remove the added heartbeat\n        // entry and stop adding to the header.\n        heartbeatsToSend.pop();\n        break;\n      }\n    } else {\n      heartbeatEntry.dates.push(singleDateHeartbeat.date);\n      // If the header would exceed max size, remove the added date\n      // and stop adding to the header.\n      if (countBytes(heartbeatsToSend) > maxSize) {\n        heartbeatEntry.dates.pop();\n        break;\n      }\n    }\n    // Pop unsent entry from queue. (Skipped if adding the entry exceeded\n    // quota and the loop breaks early.)\n    unsentEntries = unsentEntries.slice(1);\n  }\n  return {\n    heartbeatsToSend,\n    unsentEntries\n  };\n}\n\nexport class HeartbeatStorageImpl implements HeartbeatStorage {\n  private _canUseIndexedDBPromise: Promise<boolean>;\n  constructor(public app: FirebaseApp) {\n    this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();\n  }\n  async runIndexedDBEnvironmentCheck(): Promise<boolean> {\n    if (!isIndexedDBAvailable()) {\n      return false;\n    } else {\n      return validateIndexedDBOpenable()\n        .then(() => true)\n        .catch(() => false);\n    }\n  }\n  /**\n   * Read all heartbeats.\n   */\n  async read(): Promise<HeartbeatsInIndexedDB> {\n    const canUseIndexedDB = await this._canUseIndexedDBPromise;\n    if (!canUseIndexedDB) {\n      return { heartbeats: [] };\n    } else {\n      const idbHeartbeatObject = await readHeartbeatsFromIndexedDB(this.app);\n      if (idbHeartbeatObject?.heartbeats) {\n        return idbHeartbeatObject;\n      } else {\n        return { heartbeats: [] };\n      }\n    }\n  }\n  // overwrite the storage with the provided heartbeats\n  async overwrite(heartbeatsObject: HeartbeatsInIndexedDB): Promise<void> {\n    const canUseIndexedDB = await this._canUseIndexedDBPromise;\n    if (!canUseIndexedDB) {\n      return;\n    } else {\n      const existingHeartbeatsObject = await this.read();\n      return writeHeartbeatsToIndexedDB(this.app, {\n        lastSentHeartbeatDate:\n          heartbeatsObject.lastSentHeartbeatDate ??\n          existingHeartbeatsObject.lastSentHeartbeatDate,\n        heartbeats: heartbeatsObject.heartbeats\n      });\n    }\n  }\n  // add heartbeats\n  async add(heartbeatsObject: HeartbeatsInIndexedDB): Promise<void> {\n    const canUseIndexedDB = await this._canUseIndexedDBPromise;\n    if (!canUseIndexedDB) {\n      return;\n    } else {\n      const existingHeartbeatsObject = await this.read();\n      return writeHeartbeatsToIndexedDB(this.app, {\n        lastSentHeartbeatDate:\n          heartbeatsObject.lastSentHeartbeatDate ??\n          existingHeartbeatsObject.lastSentHeartbeatDate,\n        heartbeats: [\n          ...existingHeartbeatsObject.heartbeats,\n          ...heartbeatsObject.heartbeats\n        ]\n      });\n    }\n  }\n}\n\n/**\n * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped\n * in a platform logging header JSON object, stringified, and converted\n * to base 64.\n */\nexport function countBytes(heartbeatsCache: HeartbeatsByUserAgent[]): number {\n  // base64 has a restricted set of characters, all of which should be 1 byte.\n  return base64urlEncodeWithoutPadding(\n    // heartbeatsCache wrapper properties\n    JSON.stringify({ version: 2, heartbeats: heartbeatsCache })\n  ).length;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Component, ComponentType } from '@firebase/component';\nimport { PlatformLoggerServiceImpl } from './platformLoggerService';\nimport { name, version } from '../package.json';\nimport { _registerComponent } from './internal';\nimport { registerVersion } from './api';\nimport { HeartbeatServiceImpl } from './heartbeatService';\n\nexport function registerCoreComponents(variant?: string): void {\n  _registerComponent(\n    new Component(\n      'platform-logger',\n      container => new PlatformLoggerServiceImpl(container),\n      ComponentType.PRIVATE\n    )\n  );\n  _registerComponent(\n    new Component(\n      'heartbeat',\n      container => new HeartbeatServiceImpl(container),\n      ComponentType.PRIVATE\n    )\n  );\n\n  // Register `app` package.\n  registerVersion(name, version, variant);\n  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\n  registerVersion(name, version, '__BUILD_TARGET__');\n  // Register platform SDK identifier (no version).\n  registerVersion('fire-js', '');\n}\n","/**\n * Firebase App\n *\n * @remarks This package coordinates the communication between the different Firebase components\n * @packageDocumentation\n */\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { registerCoreComponents } from './registerCoreComponents';\n\nexport * from './api';\nexport * from './internal';\nexport * from './public-types';\n\nregisterCoreComponents('__RUNTIME_ENV__');\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AuthErrorMap, User } from '../model/public_types';\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nimport { IdTokenMfaResponse } from '../api/authentication/mfa';\nimport { AppName } from '../model/auth';\nimport { AuthCredential } from './credentials';\n\n/**\n * Enumeration of Firebase Auth error codes.\n *\n * @internal\n */\nexport const enum AuthErrorCode {\n  ADMIN_ONLY_OPERATION = 'admin-restricted-operation',\n  ARGUMENT_ERROR = 'argument-error',\n  APP_NOT_AUTHORIZED = 'app-not-authorized',\n  APP_NOT_INSTALLED = 'app-not-installed',\n  CAPTCHA_CHECK_FAILED = 'captcha-check-failed',\n  CODE_EXPIRED = 'code-expired',\n  CORDOVA_NOT_READY = 'cordova-not-ready',\n  CORS_UNSUPPORTED = 'cors-unsupported',\n  CREDENTIAL_ALREADY_IN_USE = 'credential-already-in-use',\n  CREDENTIAL_MISMATCH = 'custom-token-mismatch',\n  CREDENTIAL_TOO_OLD_LOGIN_AGAIN = 'requires-recent-login',\n  DEPENDENT_SDK_INIT_BEFORE_AUTH = 'dependent-sdk-initialized-before-auth',\n  DYNAMIC_LINK_NOT_ACTIVATED = 'dynamic-link-not-activated',\n  EMAIL_CHANGE_NEEDS_VERIFICATION = 'email-change-needs-verification',\n  EMAIL_EXISTS = 'email-already-in-use',\n  EMULATOR_CONFIG_FAILED = 'emulator-config-failed',\n  EXPIRED_OOB_CODE = 'expired-action-code',\n  EXPIRED_POPUP_REQUEST = 'cancelled-popup-request',\n  INTERNAL_ERROR = 'internal-error',\n  INVALID_API_KEY = 'invalid-api-key',\n  INVALID_APP_CREDENTIAL = 'invalid-app-credential',\n  INVALID_APP_ID = 'invalid-app-id',\n  INVALID_AUTH = 'invalid-user-token',\n  INVALID_AUTH_EVENT = 'invalid-auth-event',\n  INVALID_CERT_HASH = 'invalid-cert-hash',\n  INVALID_CODE = 'invalid-verification-code',\n  INVALID_CONTINUE_URI = 'invalid-continue-uri',\n  INVALID_CORDOVA_CONFIGURATION = 'invalid-cordova-configuration',\n  INVALID_CUSTOM_TOKEN = 'invalid-custom-token',\n  INVALID_DYNAMIC_LINK_DOMAIN = 'invalid-dynamic-link-domain',\n  INVALID_EMAIL = 'invalid-email',\n  INVALID_EMULATOR_SCHEME = 'invalid-emulator-scheme',\n  INVALID_CREDENTIAL = 'invalid-credential',\n  INVALID_MESSAGE_PAYLOAD = 'invalid-message-payload',\n  INVALID_MFA_SESSION = 'invalid-multi-factor-session',\n  INVALID_OAUTH_CLIENT_ID = 'invalid-oauth-client-id',\n  INVALID_OAUTH_PROVIDER = 'invalid-oauth-provider',\n  INVALID_OOB_CODE = 'invalid-action-code',\n  INVALID_ORIGIN = 'unauthorized-domain',\n  INVALID_PASSWORD = 'wrong-password',\n  INVALID_PERSISTENCE = 'invalid-persistence-type',\n  INVALID_PHONE_NUMBER = 'invalid-phone-number',\n  INVALID_PROVIDER_ID = 'invalid-provider-id',\n  INVALID_RECIPIENT_EMAIL = 'invalid-recipient-email',\n  INVALID_SENDER = 'invalid-sender',\n  INVALID_SESSION_INFO = 'invalid-verification-id',\n  INVALID_TENANT_ID = 'invalid-tenant-id',\n  LOGIN_BLOCKED = 'login-blocked',\n  MFA_INFO_NOT_FOUND = 'multi-factor-info-not-found',\n  MFA_REQUIRED = 'multi-factor-auth-required',\n  MISSING_ANDROID_PACKAGE_NAME = 'missing-android-pkg-name',\n  MISSING_APP_CREDENTIAL = 'missing-app-credential',\n  MISSING_AUTH_DOMAIN = 'auth-domain-config-required',\n  MISSING_CODE = 'missing-verification-code',\n  MISSING_CONTINUE_URI = 'missing-continue-uri',\n  MISSING_IFRAME_START = 'missing-iframe-start',\n  MISSING_IOS_BUNDLE_ID = 'missing-ios-bundle-id',\n  MISSING_OR_INVALID_NONCE = 'missing-or-invalid-nonce',\n  MISSING_MFA_INFO = 'missing-multi-factor-info',\n  MISSING_MFA_SESSION = 'missing-multi-factor-session',\n  MISSING_PHONE_NUMBER = 'missing-phone-number',\n  MISSING_PASSWORD = 'missing-password',\n  MISSING_SESSION_INFO = 'missing-verification-id',\n  MODULE_DESTROYED = 'app-deleted',\n  NEED_CONFIRMATION = 'account-exists-with-different-credential',\n  NETWORK_REQUEST_FAILED = 'network-request-failed',\n  NULL_USER = 'null-user',\n  NO_AUTH_EVENT = 'no-auth-event',\n  NO_SUCH_PROVIDER = 'no-such-provider',\n  OPERATION_NOT_ALLOWED = 'operation-not-allowed',\n  OPERATION_NOT_SUPPORTED = 'operation-not-supported-in-this-environment',\n  POPUP_BLOCKED = 'popup-blocked',\n  POPUP_CLOSED_BY_USER = 'popup-closed-by-user',\n  PROVIDER_ALREADY_LINKED = 'provider-already-linked',\n  QUOTA_EXCEEDED = 'quota-exceeded',\n  REDIRECT_CANCELLED_BY_USER = 'redirect-cancelled-by-user',\n  REDIRECT_OPERATION_PENDING = 'redirect-operation-pending',\n  REJECTED_CREDENTIAL = 'rejected-credential',\n  SECOND_FACTOR_ALREADY_ENROLLED = 'second-factor-already-in-use',\n  SECOND_FACTOR_LIMIT_EXCEEDED = 'maximum-second-factor-count-exceeded',\n  TENANT_ID_MISMATCH = 'tenant-id-mismatch',\n  TIMEOUT = 'timeout',\n  TOKEN_EXPIRED = 'user-token-expired',\n  TOO_MANY_ATTEMPTS_TRY_LATER = 'too-many-requests',\n  UNAUTHORIZED_DOMAIN = 'unauthorized-continue-uri',\n  UNSUPPORTED_FIRST_FACTOR = 'unsupported-first-factor',\n  UNSUPPORTED_PERSISTENCE = 'unsupported-persistence-type',\n  UNSUPPORTED_TENANT_OPERATION = 'unsupported-tenant-operation',\n  UNVERIFIED_EMAIL = 'unverified-email',\n  USER_CANCELLED = 'user-cancelled',\n  USER_DELETED = 'user-not-found',\n  USER_DISABLED = 'user-disabled',\n  USER_MISMATCH = 'user-mismatch',\n  USER_SIGNED_OUT = 'user-signed-out',\n  WEAK_PASSWORD = 'weak-password',\n  WEB_STORAGE_UNSUPPORTED = 'web-storage-unsupported',\n  ALREADY_INITIALIZED = 'already-initialized',\n  RECAPTCHA_NOT_ENABLED = 'recaptcha-not-enabled',\n  MISSING_RECAPTCHA_TOKEN = 'missing-recaptcha-token',\n  INVALID_RECAPTCHA_TOKEN = 'invalid-recaptcha-token',\n  INVALID_RECAPTCHA_ACTION = 'invalid-recaptcha-action',\n  MISSING_CLIENT_TYPE = 'missing-client-type',\n  MISSING_RECAPTCHA_VERSION = 'missing-recaptcha-version',\n  INVALID_RECAPTCHA_VERSION = 'invalid-recaptcha-version',\n  INVALID_REQ_TYPE = 'invalid-req-type',\n  UNSUPPORTED_PASSWORD_POLICY_SCHEMA_VERSION = 'unsupported-password-policy-schema-version',\n  PASSWORD_DOES_NOT_MEET_REQUIREMENTS = 'password-does-not-meet-requirements'\n}\n\nfunction _debugErrorMap(): ErrorMap<AuthErrorCode> {\n  return {\n    [AuthErrorCode.ADMIN_ONLY_OPERATION]:\n      'This operation is restricted to administrators only.',\n    [AuthErrorCode.ARGUMENT_ERROR]: '',\n    [AuthErrorCode.APP_NOT_AUTHORIZED]:\n      \"This app, identified by the domain where it's hosted, is not \" +\n      'authorized to use Firebase Authentication with the provided API key. ' +\n      'Review your key configuration in the Google API console.',\n    [AuthErrorCode.APP_NOT_INSTALLED]:\n      'The requested mobile application corresponding to the identifier (' +\n      'Android package name or iOS bundle ID) provided is not installed on ' +\n      'this device.',\n    [AuthErrorCode.CAPTCHA_CHECK_FAILED]:\n      'The reCAPTCHA response token provided is either invalid, expired, ' +\n      'already used or the domain associated with it does not match the list ' +\n      'of whitelisted domains.',\n    [AuthErrorCode.CODE_EXPIRED]:\n      'The SMS code has expired. Please re-send the verification code to try ' +\n      'again.',\n    [AuthErrorCode.CORDOVA_NOT_READY]: 'Cordova framework is not ready.',\n    [AuthErrorCode.CORS_UNSUPPORTED]: 'This browser is not supported.',\n    [AuthErrorCode.CREDENTIAL_ALREADY_IN_USE]:\n      'This credential is already associated with a different user account.',\n    [AuthErrorCode.CREDENTIAL_MISMATCH]:\n      'The custom token corresponds to a different audience.',\n    [AuthErrorCode.CREDENTIAL_TOO_OLD_LOGIN_AGAIN]:\n      'This operation is sensitive and requires recent authentication. Log in ' +\n      'again before retrying this request.',\n    [AuthErrorCode.DEPENDENT_SDK_INIT_BEFORE_AUTH]:\n      'Another Firebase SDK was initialized and is trying to use Auth before Auth is ' +\n      'initialized. Please be sure to call `initializeAuth` or `getAuth` before ' +\n      'starting any other Firebase SDK.',\n    [AuthErrorCode.DYNAMIC_LINK_NOT_ACTIVATED]:\n      'Please activate Dynamic Links in the Firebase Console and agree to the terms and ' +\n      'conditions.',\n    [AuthErrorCode.EMAIL_CHANGE_NEEDS_VERIFICATION]:\n      'Multi-factor users must always have a verified email.',\n    [AuthErrorCode.EMAIL_EXISTS]:\n      'The email address is already in use by another account.',\n    [AuthErrorCode.EMULATOR_CONFIG_FAILED]:\n      'Auth instance has already been used to make a network call. Auth can ' +\n      'no longer be configured to use the emulator. Try calling ' +\n      '\"connectAuthEmulator()\" sooner.',\n    [AuthErrorCode.EXPIRED_OOB_CODE]: 'The action code has expired.',\n    [AuthErrorCode.EXPIRED_POPUP_REQUEST]:\n      'This operation has been cancelled due to another conflicting popup being opened.',\n    [AuthErrorCode.INTERNAL_ERROR]: 'An internal AuthError has occurred.',\n    [AuthErrorCode.INVALID_APP_CREDENTIAL]:\n      'The phone verification request contains an invalid application verifier.' +\n      ' The reCAPTCHA token response is either invalid or expired.',\n    [AuthErrorCode.INVALID_APP_ID]:\n      'The mobile app identifier is not registed for the current project.',\n    [AuthErrorCode.INVALID_AUTH]:\n      \"This user's credential isn't valid for this project. This can happen \" +\n      \"if the user's token has been tampered with, or if the user isn't for \" +\n      'the project associated with this API key.',\n    [AuthErrorCode.INVALID_AUTH_EVENT]: 'An internal AuthError has occurred.',\n    [AuthErrorCode.INVALID_CODE]:\n      'The SMS verification code used to create the phone auth credential is ' +\n      'invalid. Please resend the verification code sms and be sure to use the ' +\n      'verification code provided by the user.',\n    [AuthErrorCode.INVALID_CONTINUE_URI]:\n      'The continue URL provided in the request is invalid.',\n    [AuthErrorCode.INVALID_CORDOVA_CONFIGURATION]:\n      'The following Cordova plugins must be installed to enable OAuth sign-in: ' +\n      'cordova-plugin-buildinfo, cordova-universal-links-plugin, ' +\n      'cordova-plugin-browsertab, cordova-plugin-inappbrowser and ' +\n      'cordova-plugin-customurlscheme.',\n    [AuthErrorCode.INVALID_CUSTOM_TOKEN]:\n      'The custom token format is incorrect. Please check the documentation.',\n    [AuthErrorCode.INVALID_DYNAMIC_LINK_DOMAIN]:\n      'The provided dynamic link domain is not configured or authorized for the current project.',\n    [AuthErrorCode.INVALID_EMAIL]: 'The email address is badly formatted.',\n    [AuthErrorCode.INVALID_EMULATOR_SCHEME]:\n      'Emulator URL must start with a valid scheme (http:// or https://).',\n    [AuthErrorCode.INVALID_API_KEY]:\n      'Your API key is invalid, please check you have copied it correctly.',\n    [AuthErrorCode.INVALID_CERT_HASH]:\n      'The SHA-1 certificate hash provided is invalid.',\n    [AuthErrorCode.INVALID_CREDENTIAL]:\n      'The supplied auth credential is incorrect, malformed or has expired.',\n    [AuthErrorCode.INVALID_MESSAGE_PAYLOAD]:\n      'The email template corresponding to this action contains invalid characters in its message. ' +\n      'Please fix by going to the Auth email templates section in the Firebase Console.',\n    [AuthErrorCode.INVALID_MFA_SESSION]:\n      'The request does not contain a valid proof of first factor successful sign-in.',\n    [AuthErrorCode.INVALID_OAUTH_PROVIDER]:\n      'EmailAuthProvider is not supported for this operation. This operation ' +\n      'only supports OAuth providers.',\n    [AuthErrorCode.INVALID_OAUTH_CLIENT_ID]:\n      'The OAuth client ID provided is either invalid or does not match the ' +\n      'specified API key.',\n    [AuthErrorCode.INVALID_ORIGIN]:\n      'This domain is not authorized for OAuth operations for your Firebase ' +\n      'project. Edit the list of authorized domains from the Firebase console.',\n    [AuthErrorCode.INVALID_OOB_CODE]:\n      'The action code is invalid. This can happen if the code is malformed, ' +\n      'expired, or has already been used.',\n    [AuthErrorCode.INVALID_PASSWORD]:\n      'The password is invalid or the user does not have a password.',\n    [AuthErrorCode.INVALID_PERSISTENCE]:\n      'The specified persistence type is invalid. It can only be local, session or none.',\n    [AuthErrorCode.INVALID_PHONE_NUMBER]:\n      'The format of the phone number provided is incorrect. Please enter the ' +\n      'phone number in a format that can be parsed into E.164 format. E.164 ' +\n      'phone numbers are written in the format [+][country code][subscriber ' +\n      'number including area code].',\n    [AuthErrorCode.INVALID_PROVIDER_ID]:\n      'The specified provider ID is invalid.',\n    [AuthErrorCode.INVALID_RECIPIENT_EMAIL]:\n      'The email corresponding to this action failed to send as the provided ' +\n      'recipient email address is invalid.',\n    [AuthErrorCode.INVALID_SENDER]:\n      'The email template corresponding to this action contains an invalid sender email or name. ' +\n      'Please fix by going to the Auth email templates section in the Firebase Console.',\n    [AuthErrorCode.INVALID_SESSION_INFO]:\n      'The verification ID used to create the phone auth credential is invalid.',\n    [AuthErrorCode.INVALID_TENANT_ID]:\n      \"The Auth instance's tenant ID is invalid.\",\n    [AuthErrorCode.LOGIN_BLOCKED]:\n      'Login blocked by user-provided method: {$originalMessage}',\n    [AuthErrorCode.MISSING_ANDROID_PACKAGE_NAME]:\n      'An Android Package Name must be provided if the Android App is required to be installed.',\n    [AuthErrorCode.MISSING_AUTH_DOMAIN]:\n      'Be sure to include authDomain when calling firebase.initializeApp(), ' +\n      'by following the instructions in the Firebase console.',\n    [AuthErrorCode.MISSING_APP_CREDENTIAL]:\n      'The phone verification request is missing an application verifier ' +\n      'assertion. A reCAPTCHA response token needs to be provided.',\n    [AuthErrorCode.MISSING_CODE]:\n      'The phone auth credential was created with an empty SMS verification code.',\n    [AuthErrorCode.MISSING_CONTINUE_URI]:\n      'A continue URL must be provided in the request.',\n    [AuthErrorCode.MISSING_IFRAME_START]: 'An internal AuthError has occurred.',\n    [AuthErrorCode.MISSING_IOS_BUNDLE_ID]:\n      'An iOS Bundle ID must be provided if an App Store ID is provided.',\n    [AuthErrorCode.MISSING_OR_INVALID_NONCE]:\n      'The request does not contain a valid nonce. This can occur if the ' +\n      'SHA-256 hash of the provided raw nonce does not match the hashed nonce ' +\n      'in the ID token payload.',\n    [AuthErrorCode.MISSING_PASSWORD]: 'A non-empty password must be provided',\n    [AuthErrorCode.MISSING_MFA_INFO]:\n      'No second factor identifier is provided.',\n    [AuthErrorCode.MISSING_MFA_SESSION]:\n      'The request is missing proof of first factor successful sign-in.',\n    [AuthErrorCode.MISSING_PHONE_NUMBER]:\n      'To send verification codes, provide a phone number for the recipient.',\n    [AuthErrorCode.MISSING_SESSION_INFO]:\n      'The phone auth credential was created with an empty verification ID.',\n    [AuthErrorCode.MODULE_DESTROYED]:\n      'This instance of FirebaseApp has been deleted.',\n    [AuthErrorCode.MFA_INFO_NOT_FOUND]:\n      'The user does not have a second factor matching the identifier provided.',\n    [AuthErrorCode.MFA_REQUIRED]:\n      'Proof of ownership of a second factor is required to complete sign-in.',\n    [AuthErrorCode.NEED_CONFIRMATION]:\n      'An account already exists with the same email address but different ' +\n      'sign-in credentials. Sign in using a provider associated with this ' +\n      'email address.',\n    [AuthErrorCode.NETWORK_REQUEST_FAILED]:\n      'A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred.',\n    [AuthErrorCode.NO_AUTH_EVENT]: 'An internal AuthError has occurred.',\n    [AuthErrorCode.NO_SUCH_PROVIDER]:\n      'User was not linked to an account with the given provider.',\n    [AuthErrorCode.NULL_USER]:\n      'A null user object was provided as the argument for an operation which ' +\n      'requires a non-null user object.',\n    [AuthErrorCode.OPERATION_NOT_ALLOWED]:\n      'The given sign-in provider is disabled for this Firebase project. ' +\n      'Enable it in the Firebase console, under the sign-in method tab of the ' +\n      'Auth section.',\n    [AuthErrorCode.OPERATION_NOT_SUPPORTED]:\n      'This operation is not supported in the environment this application is ' +\n      'running on. \"location.protocol\" must be http, https or chrome-extension' +\n      ' and web storage must be enabled.',\n    [AuthErrorCode.POPUP_BLOCKED]:\n      'Unable to establish a connection with the popup. It may have been blocked by the browser.',\n    [AuthErrorCode.POPUP_CLOSED_BY_USER]:\n      'The popup has been closed by the user before finalizing the operation.',\n    [AuthErrorCode.PROVIDER_ALREADY_LINKED]:\n      'User can only be linked to one identity for the given provider.',\n    [AuthErrorCode.QUOTA_EXCEEDED]:\n      \"The project's quota for this operation has been exceeded.\",\n    [AuthErrorCode.REDIRECT_CANCELLED_BY_USER]:\n      'The redirect operation has been cancelled by the user before finalizing.',\n    [AuthErrorCode.REDIRECT_OPERATION_PENDING]:\n      'A redirect sign-in operation is already pending.',\n    [AuthErrorCode.REJECTED_CREDENTIAL]:\n      'The request contains malformed or mismatching credentials.',\n    [AuthErrorCode.SECOND_FACTOR_ALREADY_ENROLLED]:\n      'The second factor is already enrolled on this account.',\n    [AuthErrorCode.SECOND_FACTOR_LIMIT_EXCEEDED]:\n      'The maximum allowed number of second factors on a user has been exceeded.',\n    [AuthErrorCode.TENANT_ID_MISMATCH]:\n      \"The provided tenant ID does not match the Auth instance's tenant ID\",\n    [AuthErrorCode.TIMEOUT]: 'The operation has timed out.',\n    [AuthErrorCode.TOKEN_EXPIRED]:\n      \"The user's credential is no longer valid. The user must sign in again.\",\n    [AuthErrorCode.TOO_MANY_ATTEMPTS_TRY_LATER]:\n      'We have blocked all requests from this device due to unusual activity. ' +\n      'Try again later.',\n    [AuthErrorCode.UNAUTHORIZED_DOMAIN]:\n      'The domain of the continue URL is not whitelisted.  Please whitelist ' +\n      'the domain in the Firebase console.',\n    [AuthErrorCode.UNSUPPORTED_FIRST_FACTOR]:\n      'Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.',\n    [AuthErrorCode.UNSUPPORTED_PERSISTENCE]:\n      'The current environment does not support the specified persistence type.',\n    [AuthErrorCode.UNSUPPORTED_TENANT_OPERATION]:\n      'This operation is not supported in a multi-tenant context.',\n    [AuthErrorCode.UNVERIFIED_EMAIL]:\n      'The operation requires a verified email.',\n    [AuthErrorCode.USER_CANCELLED]:\n      'The user did not grant your application the permissions it requested.',\n    [AuthErrorCode.USER_DELETED]:\n      'There is no user record corresponding to this identifier. The user may ' +\n      'have been deleted.',\n    [AuthErrorCode.USER_DISABLED]:\n      'The user account has been disabled by an administrator.',\n    [AuthErrorCode.USER_MISMATCH]:\n      'The supplied credentials do not correspond to the previously signed in user.',\n    [AuthErrorCode.USER_SIGNED_OUT]: '',\n    [AuthErrorCode.WEAK_PASSWORD]:\n      'The password must be 6 characters long or more.',\n    [AuthErrorCode.WEB_STORAGE_UNSUPPORTED]:\n      'This browser is not supported or 3rd party cookies and data may be disabled.',\n    [AuthErrorCode.ALREADY_INITIALIZED]:\n      'initializeAuth() has already been called with ' +\n      'different options. To avoid this error, call initializeAuth() with the ' +\n      'same options as when it was originally called, or call getAuth() to return the' +\n      ' already initialized instance.',\n    [AuthErrorCode.MISSING_RECAPTCHA_TOKEN]:\n      'The reCAPTCHA token is missing when sending request to the backend.',\n    [AuthErrorCode.INVALID_RECAPTCHA_TOKEN]:\n      'The reCAPTCHA token is invalid when sending request to the backend.',\n    [AuthErrorCode.INVALID_RECAPTCHA_ACTION]:\n      'The reCAPTCHA action is invalid when sending request to the backend.',\n    [AuthErrorCode.RECAPTCHA_NOT_ENABLED]:\n      'reCAPTCHA Enterprise integration is not enabled for this project.',\n    [AuthErrorCode.MISSING_CLIENT_TYPE]:\n      'The reCAPTCHA client type is missing when sending request to the backend.',\n    [AuthErrorCode.MISSING_RECAPTCHA_VERSION]:\n      'The reCAPTCHA version is missing when sending request to the backend.',\n    [AuthErrorCode.INVALID_REQ_TYPE]: 'Invalid request parameters.',\n    [AuthErrorCode.INVALID_RECAPTCHA_VERSION]:\n      'The reCAPTCHA version is invalid when sending request to the backend.',\n    [AuthErrorCode.UNSUPPORTED_PASSWORD_POLICY_SCHEMA_VERSION]:\n      'The password policy received from the backend uses a schema version that is not supported by this version of the Firebase SDK.',\n    [AuthErrorCode.PASSWORD_DOES_NOT_MEET_REQUIREMENTS]:\n      'The password does not meet the requirements.'\n  };\n}\n\nexport interface ErrorMapRetriever extends AuthErrorMap {\n  (): ErrorMap<AuthErrorCode>;\n}\n\nfunction _prodErrorMap(): ErrorMap<AuthErrorCode> {\n  // We will include this one message in the prod error map since by the very\n  // nature of this error, developers will never be able to see the message\n  // using the debugErrorMap (which is installed during auth initialization).\n  return {\n    [AuthErrorCode.DEPENDENT_SDK_INIT_BEFORE_AUTH]:\n      'Another Firebase SDK was initialized and is trying to use Auth before Auth is ' +\n      'initialized. Please be sure to call `initializeAuth` or `getAuth` before ' +\n      'starting any other Firebase SDK.'\n  } as ErrorMap<AuthErrorCode>;\n}\n\n/**\n * A verbose error map with detailed descriptions for most error codes.\n *\n * See discussion at {@link AuthErrorMap}\n *\n * @public\n */\nexport const debugErrorMap: AuthErrorMap = _debugErrorMap;\n\n/**\n * A minimal error map with all verbose error messages stripped.\n *\n * See discussion at {@link AuthErrorMap}\n *\n * @public\n */\nexport const prodErrorMap: AuthErrorMap = _prodErrorMap;\n\nexport interface NamedErrorParams {\n  appName: AppName;\n  credential?: AuthCredential;\n  email?: string;\n  phoneNumber?: string;\n  tenantId?: string;\n  user?: User;\n  _serverResponse?: object;\n}\n\n/**\n * @internal\n */\ntype GenericAuthErrorParams = {\n  [key in Exclude<\n    AuthErrorCode,\n    | AuthErrorCode.ARGUMENT_ERROR\n    | AuthErrorCode.DEPENDENT_SDK_INIT_BEFORE_AUTH\n    | AuthErrorCode.INTERNAL_ERROR\n    | AuthErrorCode.MFA_REQUIRED\n    | AuthErrorCode.NO_AUTH_EVENT\n    | AuthErrorCode.OPERATION_NOT_SUPPORTED\n  >]: {\n    appName?: AppName;\n    email?: string;\n    phoneNumber?: string;\n    message?: string;\n  };\n};\n\n/**\n * @internal\n */\nexport interface AuthErrorParams extends GenericAuthErrorParams {\n  [AuthErrorCode.ARGUMENT_ERROR]: { appName?: AppName };\n  [AuthErrorCode.DEPENDENT_SDK_INIT_BEFORE_AUTH]: { appName?: AppName };\n  [AuthErrorCode.INTERNAL_ERROR]: { appName?: AppName };\n  [AuthErrorCode.LOGIN_BLOCKED]: {\n    appName?: AppName;\n    originalMessage?: string;\n  };\n  [AuthErrorCode.OPERATION_NOT_SUPPORTED]: { appName?: AppName };\n  [AuthErrorCode.NO_AUTH_EVENT]: { appName?: AppName };\n  [AuthErrorCode.MFA_REQUIRED]: {\n    appName: AppName;\n    _serverResponse: IdTokenMfaResponse;\n  };\n  [AuthErrorCode.INVALID_CORDOVA_CONFIGURATION]: {\n    appName: AppName;\n    missingPlugin?: string;\n  };\n}\n\nexport const _DEFAULT_AUTH_ERROR_FACTORY = new ErrorFactory<\n  AuthErrorCode,\n  AuthErrorParams\n>('auth', 'Firebase', _prodErrorMap());\n\n/**\n * A map of potential `Auth` error codes, for easier comparison with errors\n * thrown by the SDK.\n *\n * @remarks\n * Note that you can't tree-shake individual keys\n * in the map, so by using the map you might substantially increase your\n * bundle size.\n *\n * @public\n */\nexport const AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY = {\n  ADMIN_ONLY_OPERATION: 'auth/admin-restricted-operation',\n  ARGUMENT_ERROR: 'auth/argument-error',\n  APP_NOT_AUTHORIZED: 'auth/app-not-authorized',\n  APP_NOT_INSTALLED: 'auth/app-not-installed',\n  CAPTCHA_CHECK_FAILED: 'auth/captcha-check-failed',\n  CODE_EXPIRED: 'auth/code-expired',\n  CORDOVA_NOT_READY: 'auth/cordova-not-ready',\n  CORS_UNSUPPORTED: 'auth/cors-unsupported',\n  CREDENTIAL_ALREADY_IN_USE: 'auth/credential-already-in-use',\n  CREDENTIAL_MISMATCH: 'auth/custom-token-mismatch',\n  CREDENTIAL_TOO_OLD_LOGIN_AGAIN: 'auth/requires-recent-login',\n  DEPENDENT_SDK_INIT_BEFORE_AUTH: 'auth/dependent-sdk-initialized-before-auth',\n  DYNAMIC_LINK_NOT_ACTIVATED: 'auth/dynamic-link-not-activated',\n  EMAIL_CHANGE_NEEDS_VERIFICATION: 'auth/email-change-needs-verification',\n  EMAIL_EXISTS: 'auth/email-already-in-use',\n  EMULATOR_CONFIG_FAILED: 'auth/emulator-config-failed',\n  EXPIRED_OOB_CODE: 'auth/expired-action-code',\n  EXPIRED_POPUP_REQUEST: 'auth/cancelled-popup-request',\n  INTERNAL_ERROR: 'auth/internal-error',\n  INVALID_API_KEY: 'auth/invalid-api-key',\n  INVALID_APP_CREDENTIAL: 'auth/invalid-app-credential',\n  INVALID_APP_ID: 'auth/invalid-app-id',\n  INVALID_AUTH: 'auth/invalid-user-token',\n  INVALID_AUTH_EVENT: 'auth/invalid-auth-event',\n  INVALID_CERT_HASH: 'auth/invalid-cert-hash',\n  INVALID_CODE: 'auth/invalid-verification-code',\n  INVALID_CONTINUE_URI: 'auth/invalid-continue-uri',\n  INVALID_CORDOVA_CONFIGURATION: 'auth/invalid-cordova-configuration',\n  INVALID_CUSTOM_TOKEN: 'auth/invalid-custom-token',\n  INVALID_DYNAMIC_LINK_DOMAIN: 'auth/invalid-dynamic-link-domain',\n  INVALID_EMAIL: 'auth/invalid-email',\n  INVALID_EMULATOR_SCHEME: 'auth/invalid-emulator-scheme',\n  INVALID_IDP_RESPONSE: 'auth/invalid-credential',\n  INVALID_LOGIN_CREDENTIALS: 'auth/invalid-credential',\n  INVALID_MESSAGE_PAYLOAD: 'auth/invalid-message-payload',\n  INVALID_MFA_SESSION: 'auth/invalid-multi-factor-session',\n  INVALID_OAUTH_CLIENT_ID: 'auth/invalid-oauth-client-id',\n  INVALID_OAUTH_PROVIDER: 'auth/invalid-oauth-provider',\n  INVALID_OOB_CODE: 'auth/invalid-action-code',\n  INVALID_ORIGIN: 'auth/unauthorized-domain',\n  INVALID_PASSWORD: 'auth/wrong-password',\n  INVALID_PERSISTENCE: 'auth/invalid-persistence-type',\n  INVALID_PHONE_NUMBER: 'auth/invalid-phone-number',\n  INVALID_PROVIDER_ID: 'auth/invalid-provider-id',\n  INVALID_RECIPIENT_EMAIL: 'auth/invalid-recipient-email',\n  INVALID_SENDER: 'auth/invalid-sender',\n  INVALID_SESSION_INFO: 'auth/invalid-verification-id',\n  INVALID_TENANT_ID: 'auth/invalid-tenant-id',\n  MFA_INFO_NOT_FOUND: 'auth/multi-factor-info-not-found',\n  MFA_REQUIRED: 'auth/multi-factor-auth-required',\n  MISSING_ANDROID_PACKAGE_NAME: 'auth/missing-android-pkg-name',\n  MISSING_APP_CREDENTIAL: 'auth/missing-app-credential',\n  MISSING_AUTH_DOMAIN: 'auth/auth-domain-config-required',\n  MISSING_CODE: 'auth/missing-verification-code',\n  MISSING_CONTINUE_URI: 'auth/missing-continue-uri',\n  MISSING_IFRAME_START: 'auth/missing-iframe-start',\n  MISSING_IOS_BUNDLE_ID: 'auth/missing-ios-bundle-id',\n  MISSING_OR_INVALID_NONCE: 'auth/missing-or-invalid-nonce',\n  MISSING_MFA_INFO: 'auth/missing-multi-factor-info',\n  MISSING_MFA_SESSION: 'auth/missing-multi-factor-session',\n  MISSING_PHONE_NUMBER: 'auth/missing-phone-number',\n  MISSING_SESSION_INFO: 'auth/missing-verification-id',\n  MODULE_DESTROYED: 'auth/app-deleted',\n  NEED_CONFIRMATION: 'auth/account-exists-with-different-credential',\n  NETWORK_REQUEST_FAILED: 'auth/network-request-failed',\n  NULL_USER: 'auth/null-user',\n  NO_AUTH_EVENT: 'auth/no-auth-event',\n  NO_SUCH_PROVIDER: 'auth/no-such-provider',\n  OPERATION_NOT_ALLOWED: 'auth/operation-not-allowed',\n  OPERATION_NOT_SUPPORTED: 'auth/operation-not-supported-in-this-environment',\n  POPUP_BLOCKED: 'auth/popup-blocked',\n  POPUP_CLOSED_BY_USER: 'auth/popup-closed-by-user',\n  PROVIDER_ALREADY_LINKED: 'auth/provider-already-linked',\n  QUOTA_EXCEEDED: 'auth/quota-exceeded',\n  REDIRECT_CANCELLED_BY_USER: 'auth/redirect-cancelled-by-user',\n  REDIRECT_OPERATION_PENDING: 'auth/redirect-operation-pending',\n  REJECTED_CREDENTIAL: 'auth/rejected-credential',\n  SECOND_FACTOR_ALREADY_ENROLLED: 'auth/second-factor-already-in-use',\n  SECOND_FACTOR_LIMIT_EXCEEDED: 'auth/maximum-second-factor-count-exceeded',\n  TENANT_ID_MISMATCH: 'auth/tenant-id-mismatch',\n  TIMEOUT: 'auth/timeout',\n  TOKEN_EXPIRED: 'auth/user-token-expired',\n  TOO_MANY_ATTEMPTS_TRY_LATER: 'auth/too-many-requests',\n  UNAUTHORIZED_DOMAIN: 'auth/unauthorized-continue-uri',\n  UNSUPPORTED_FIRST_FACTOR: 'auth/unsupported-first-factor',\n  UNSUPPORTED_PERSISTENCE: 'auth/unsupported-persistence-type',\n  UNSUPPORTED_TENANT_OPERATION: 'auth/unsupported-tenant-operation',\n  UNVERIFIED_EMAIL: 'auth/unverified-email',\n  USER_CANCELLED: 'auth/user-cancelled',\n  USER_DELETED: 'auth/user-not-found',\n  USER_DISABLED: 'auth/user-disabled',\n  USER_MISMATCH: 'auth/user-mismatch',\n  USER_SIGNED_OUT: 'auth/user-signed-out',\n  WEAK_PASSWORD: 'auth/weak-password',\n  WEB_STORAGE_UNSUPPORTED: 'auth/web-storage-unsupported',\n  ALREADY_INITIALIZED: 'auth/already-initialized',\n  RECAPTCHA_NOT_ENABLED: 'auth/recaptcha-not-enabled',\n  MISSING_RECAPTCHA_TOKEN: 'auth/missing-recaptcha-token',\n  INVALID_RECAPTCHA_TOKEN: 'auth/invalid-recaptcha-token',\n  INVALID_RECAPTCHA_ACTION: 'auth/invalid-recaptcha-action',\n  MISSING_CLIENT_TYPE: 'auth/missing-client-type',\n  MISSING_RECAPTCHA_VERSION: 'auth/missing-recaptcha-version',\n  INVALID_RECAPTCHA_VERSION: 'auth/invalid-recaptcha-version',\n  INVALID_REQ_TYPE: 'auth/invalid-req-type'\n} as const;\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Logger, LogLevel } from '@firebase/logger';\nimport { SDK_VERSION } from '@firebase/app';\n\nexport { LogLevel };\n\nconst logClient = new Logger('@firebase/auth');\n\n// Helper methods are needed because variables can't be exported as read/write\nexport function _getLogLevel(): LogLevel {\n  return logClient.logLevel;\n}\n\nexport function _setLogLevel(newLevel: LogLevel): void {\n  logClient.logLevel = newLevel;\n}\n\nexport function _logDebug(msg: string, ...args: string[]): void {\n  if (logClient.logLevel <= LogLevel.DEBUG) {\n    logClient.debug(`Auth (${SDK_VERSION}): ${msg}`, ...args);\n  }\n}\n\nexport function _logWarn(msg: string, ...args: string[]): void {\n  if (logClient.logLevel <= LogLevel.WARN) {\n    logClient.warn(`Auth (${SDK_VERSION}): ${msg}`, ...args);\n  }\n}\n\nexport function _logError(msg: string, ...args: string[]): void {\n  if (logClient.logLevel <= LogLevel.ERROR) {\n    logClient.error(`Auth (${SDK_VERSION}): ${msg}`, ...args);\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Auth } from '../../model/public_types';\nimport { ErrorFactory, FirebaseError } from '@firebase/util';\nimport { AuthInternal } from '../../model/auth';\nimport {\n  _DEFAULT_AUTH_ERROR_FACTORY,\n  AuthErrorCode,\n  AuthErrorParams,\n  prodErrorMap,\n  ErrorMapRetriever\n} from '../errors';\nimport { _logError } from './log';\n\ntype AuthErrorListParams<K> = K extends keyof AuthErrorParams\n  ? [AuthErrorParams[K]]\n  : [];\ntype LessAppName<K extends AuthErrorCode> = Omit<AuthErrorParams[K], 'appName'>;\n\n/**\n * Unconditionally fails, throwing a developer facing INTERNAL_ERROR\n *\n * @example\n * ```javascript\n * fail(auth, AuthErrorCode.MFA_REQUIRED);  // Error: the MFA_REQUIRED error needs more params than appName\n * fail(auth, AuthErrorCode.MFA_REQUIRED, {serverResponse});  // Compiles\n * fail(AuthErrorCode.INTERNAL_ERROR);  // Compiles; internal error does not need appName\n * fail(AuthErrorCode.USER_DELETED);  // Error: USER_DELETED requires app name\n * fail(auth, AuthErrorCode.USER_DELETED);  // Compiles; USER_DELETED _only_ needs app name\n * ```\n *\n * @param appName App name for tagging the error\n * @throws FirebaseError\n */\nexport function _fail<K extends AuthErrorCode>(\n  code: K,\n  ...data: {} extends AuthErrorParams[K]\n    ? [AuthErrorParams[K]?]\n    : [AuthErrorParams[K]]\n): never;\nexport function _fail<K extends AuthErrorCode>(\n  auth: Auth,\n  code: K,\n  ...data: {} extends LessAppName<K> ? [LessAppName<K>?] : [LessAppName<K>]\n): never;\nexport function _fail<K extends AuthErrorCode>(\n  authOrCode: Auth | K,\n  ...rest: unknown[]\n): never {\n  throw createErrorInternal(authOrCode, ...rest);\n}\n\nexport function _createError<K extends AuthErrorCode>(\n  code: K,\n  ...data: {} extends AuthErrorParams[K]\n    ? [AuthErrorParams[K]?]\n    : [AuthErrorParams[K]]\n): FirebaseError;\nexport function _createError<K extends AuthErrorCode>(\n  auth: Auth,\n  code: K,\n  ...data: {} extends LessAppName<K> ? [LessAppName<K>?] : [LessAppName<K>]\n): FirebaseError;\nexport function _createError<K extends AuthErrorCode>(\n  authOrCode: Auth | K,\n  ...rest: unknown[]\n): FirebaseError {\n  return createErrorInternal(authOrCode, ...rest);\n}\n\nexport function _errorWithCustomMessage(\n  auth: Auth,\n  code: AuthErrorCode,\n  message: string\n): FirebaseError {\n  const errorMap = {\n    ...(prodErrorMap as ErrorMapRetriever)(),\n    [code]: message\n  };\n  const factory = new ErrorFactory<AuthErrorCode, AuthErrorParams>(\n    'auth',\n    'Firebase',\n    errorMap\n  );\n  return factory.create(code, {\n    appName: auth.name\n  });\n}\n\nexport function _serverAppCurrentUserOperationNotSupportedError(\n  auth: Auth\n): FirebaseError {\n  return _errorWithCustomMessage(\n    auth,\n    AuthErrorCode.OPERATION_NOT_SUPPORTED,\n    'Operations that alter the current user are not supported in conjunction with FirebaseServerApp'\n  );\n}\n\nexport function _assertInstanceOf(\n  auth: Auth,\n  object: object,\n  instance: unknown\n): void {\n  const constructorInstance = instance as { new (...args: unknown[]): unknown };\n  if (!(object instanceof constructorInstance)) {\n    if (constructorInstance.name !== object.constructor.name) {\n      _fail(auth, AuthErrorCode.ARGUMENT_ERROR);\n    }\n\n    throw _errorWithCustomMessage(\n      auth,\n      AuthErrorCode.ARGUMENT_ERROR,\n      `Type of ${object.constructor.name} does not match expected instance.` +\n        `Did you pass a reference from a different Auth SDK?`\n    );\n  }\n}\n\nfunction createErrorInternal<K extends AuthErrorCode>(\n  authOrCode: Auth | K,\n  ...rest: unknown[]\n): FirebaseError {\n  if (typeof authOrCode !== 'string') {\n    const code = rest[0] as K;\n    const fullParams = [...rest.slice(1)] as AuthErrorListParams<K>;\n    if (fullParams[0]) {\n      fullParams[0].appName = authOrCode.name;\n    }\n\n    return (authOrCode as AuthInternal)._errorFactory.create(\n      code,\n      ...fullParams\n    );\n  }\n\n  return _DEFAULT_AUTH_ERROR_FACTORY.create(\n    authOrCode,\n    ...(rest as AuthErrorListParams<K>)\n  );\n}\n\nexport function _assert<K extends AuthErrorCode>(\n  assertion: unknown,\n  code: K,\n  ...data: {} extends AuthErrorParams[K]\n    ? [AuthErrorParams[K]?]\n    : [AuthErrorParams[K]]\n): asserts assertion;\nexport function _assert<K extends AuthErrorCode>(\n  assertion: unknown,\n  auth: Auth,\n  code: K,\n  ...data: {} extends LessAppName<K> ? [LessAppName<K>?] : [LessAppName<K>]\n): asserts assertion;\nexport function _assert<K extends AuthErrorCode>(\n  assertion: unknown,\n  authOrCode: Auth | K,\n  ...rest: unknown[]\n): asserts assertion {\n  if (!assertion) {\n    throw createErrorInternal(authOrCode, ...rest);\n  }\n}\n\n// We really do want to accept literally any function type here\n// eslint-disable-next-line @typescript-eslint/ban-types\ntype TypeExpectation = Function | string | MapType;\n\ninterface MapType extends Record<string, TypeExpectation | Optional> {}\n\nclass Optional {\n  constructor(readonly type: TypeExpectation) {}\n}\n\nexport function opt(type: TypeExpectation): Optional {\n  return new Optional(type);\n}\n\n/**\n * Asserts the runtime types of arguments. The 'expected' field can be one of\n * a class, a string (representing a \"typeof\" call), or a record map of name\n * to type. Furthermore, the opt() function can be used to mark a field as\n * optional. For example:\n *\n * function foo(auth: Auth, profile: {displayName?: string}, update = false) {\n *   assertTypes(arguments, [AuthImpl, {displayName: opt('string')}, opt('boolean')]);\n * }\n *\n * opt() can be used for any type:\n * function foo(auth?: Auth) {\n *   assertTypes(arguments, [opt(AuthImpl)]);\n * }\n *\n * The string types can be or'd together, and you can use \"null\" as well (note\n * that typeof null === 'object'; this is an edge case). For example:\n *\n * function foo(profile: {displayName?: string | null}) {\n *   assertTypes(arguments, [{displayName: opt('string|null')}]);\n * }\n *\n * @param args\n * @param expected\n */\nexport function assertTypes(\n  args: Omit<IArguments, 'callee'>,\n  ...expected: Array<TypeExpectation | Optional>\n): void {\n  if (args.length > expected.length) {\n    _fail(AuthErrorCode.ARGUMENT_ERROR, {});\n  }\n\n  for (let i = 0; i < expected.length; i++) {\n    let expect = expected[i];\n    const arg = args[i];\n\n    if (expect instanceof Optional) {\n      // If the arg is undefined, then it matches \"optional\" and we can move to\n      // the next arg\n      if (typeof arg === 'undefined') {\n        continue;\n      }\n      expect = expect.type;\n    }\n\n    if (typeof expect === 'string') {\n      // Handle the edge case for null because typeof null === 'object'\n      if (expect.includes('null') && arg === null) {\n        continue;\n      }\n\n      const required = expect.split('|');\n      _assert(required.includes(typeof arg), AuthErrorCode.ARGUMENT_ERROR, {});\n    } else if (typeof expect === 'object') {\n      // Recursively check record arguments\n      const record = arg as Record<string, unknown>;\n      const map = expect as MapType;\n      const keys = Object.keys(expect);\n\n      assertTypes(\n        keys.map(k => record[k]),\n        ...keys.map(k => map[k])\n      );\n    } else {\n      _assert(arg instanceof expect, AuthErrorCode.ARGUMENT_ERROR, {});\n    }\n  }\n}\n\n/**\n * Unconditionally fails, throwing an internal error with the given message.\n *\n * @param failure type of failure encountered\n * @throws Error\n */\nexport function debugFail(failure: string): never {\n  // Log the failure in addition to throw an exception, just in case the\n  // exception is swallowed.\n  const message = `INTERNAL ASSERTION FAILED: ` + failure;\n  _logError(message);\n\n  // NOTE: We don't use FirebaseError here because these are internal failures\n  // that cannot be handled by the user. (Also it would create a circular\n  // dependency between the error and assert modules which doesn't work.)\n  throw new Error(message);\n}\n\n/**\n * Fails if the given assertion condition is false, throwing an Error with the\n * given message if it did.\n *\n * @param assertion\n * @param message\n */\nexport function debugAssert(\n  assertion: unknown,\n  message: string\n): asserts assertion {\n  if (!assertion) {\n    debugFail(message);\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function _getCurrentUrl(): string {\n  return (typeof self !== 'undefined' && self.location?.href) || '';\n}\n\nexport function _isHttpOrHttps(): boolean {\n  return _getCurrentScheme() === 'http:' || _getCurrentScheme() === 'https:';\n}\n\nexport function _getCurrentScheme(): string | null {\n  return (typeof self !== 'undefined' && self.location?.protocol) || null;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isMobileCordova, isReactNative } from '@firebase/util';\nimport { _isOnline } from './navigator';\nimport { debugAssert } from './assert';\n\nexport const enum DelayMin {\n  OFFLINE = 5000\n}\n\n/**\n * A structure to help pick between a range of long and short delay durations\n * depending on the current environment. In general, the long delay is used for\n * mobile environments whereas short delays are used for desktop environments.\n */\nexport class Delay {\n  // The default value for the offline delay timeout in ms.\n\n  private readonly isMobile: boolean;\n  constructor(\n    private readonly shortDelay: number,\n    private readonly longDelay: number\n  ) {\n    // Internal error when improperly initialized.\n    debugAssert(\n      longDelay > shortDelay,\n      'Short delay should be less than long delay!'\n    );\n    this.isMobile = isMobileCordova() || isReactNative();\n  }\n\n  get(): number {\n    if (!_isOnline()) {\n      // Pick the shorter timeout.\n      return Math.min(DelayMin.OFFLINE, this.shortDelay);\n    }\n    // If running in a mobile environment, return the long delay, otherwise\n    // return the short delay.\n    // This could be improved in the future to dynamically change based on other\n    // variables instead of just reading the current environment.\n    return this.isMobile ? this.longDelay : this.shortDelay;\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isBrowserExtension } from '@firebase/util';\nimport { _isHttpOrHttps } from './location';\n\n/**\n * Determine whether the browser is working online\n */\nexport function _isOnline(): boolean {\n  if (\n    typeof navigator !== 'undefined' &&\n    navigator &&\n    'onLine' in navigator &&\n    typeof navigator.onLine === 'boolean' &&\n    // Apply only for traditional web apps and Chrome extensions.\n    // This is especially true for Cordova apps which have unreliable\n    // navigator.onLine behavior unless cordova-plugin-network-information is\n    // installed which overwrites the native navigator.onLine value and\n    // defines navigator.connection.\n    (_isHttpOrHttps() || isBrowserExtension() || 'connection' in navigator)\n  ) {\n    return navigator.onLine;\n  }\n  // If we can't determine the state, assume it is online.\n  return true;\n}\n\nexport function _getUserLanguage(): string | null {\n  if (typeof navigator === 'undefined') {\n    return null;\n  }\n  const navigatorLanguage: NavigatorLanguage = navigator;\n  return (\n    // Most reliable, but only supported in Chrome/Firefox.\n    (navigatorLanguage.languages && navigatorLanguage.languages[0]) ||\n    // Supported in most browsers, but returns the language of the browser\n    // UI, not the language set in browser settings.\n    navigatorLanguage.language ||\n    // Couldn't determine language.\n    null\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ConfigInternal } from '../../model/auth';\nimport { debugAssert } from './assert';\n\nexport function _emulatorUrl(config: ConfigInternal, path?: string): string {\n  debugAssert(config.emulator, 'Emulator should always be set here');\n  const { url } = config.emulator;\n\n  if (!path) {\n    return url;\n  }\n\n  return `${url}${path.startsWith('/') ? path.slice(1) : path}`;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { debugFail } from './assert';\n\nexport class FetchProvider {\n  private static fetchImpl: typeof fetch | null;\n  private static headersImpl: typeof Headers | null;\n  private static responseImpl: typeof Response | null;\n\n  static initialize(\n    fetchImpl: typeof fetch,\n    headersImpl?: typeof Headers,\n    responseImpl?: typeof Response\n  ): void {\n    this.fetchImpl = fetchImpl;\n    if (headersImpl) {\n      this.headersImpl = headersImpl;\n    }\n    if (responseImpl) {\n      this.responseImpl = responseImpl;\n    }\n  }\n\n  static fetch(): typeof fetch {\n    if (this.fetchImpl) {\n      return this.fetchImpl;\n    }\n    if (typeof self !== 'undefined' && 'fetch' in self) {\n      return self.fetch;\n    }\n    if (typeof globalThis !== 'undefined' && globalThis.fetch) {\n      return globalThis.fetch;\n    }\n    if (typeof fetch !== 'undefined') {\n      return fetch;\n    }\n    debugFail(\n      'Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill'\n    );\n  }\n\n  static headers(): typeof Headers {\n    if (this.headersImpl) {\n      return this.headersImpl;\n    }\n    if (typeof self !== 'undefined' && 'Headers' in self) {\n      return self.Headers;\n    }\n    if (typeof globalThis !== 'undefined' && globalThis.Headers) {\n      return globalThis.Headers;\n    }\n    if (typeof Headers !== 'undefined') {\n      return Headers;\n    }\n    debugFail(\n      'Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill'\n    );\n  }\n\n  static response(): typeof Response {\n    if (this.responseImpl) {\n      return this.responseImpl;\n    }\n    if (typeof self !== 'undefined' && 'Response' in self) {\n      return self.Response;\n    }\n    if (typeof globalThis !== 'undefined' && globalThis.Response) {\n      return globalThis.Response;\n    }\n    if (typeof Response !== 'undefined') {\n      return Response;\n    }\n    debugFail(\n      'Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill'\n    );\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AuthErrorCode } from '../core/errors';\n\n/**\n * Errors that can be returned by the backend\n */\nexport const enum ServerError {\n  ADMIN_ONLY_OPERATION = 'ADMIN_ONLY_OPERATION',\n  BLOCKING_FUNCTION_ERROR_RESPONSE = 'BLOCKING_FUNCTION_ERROR_RESPONSE',\n  CAPTCHA_CHECK_FAILED = 'CAPTCHA_CHECK_FAILED',\n  CORS_UNSUPPORTED = 'CORS_UNSUPPORTED',\n  CREDENTIAL_MISMATCH = 'CREDENTIAL_MISMATCH',\n  CREDENTIAL_TOO_OLD_LOGIN_AGAIN = 'CREDENTIAL_TOO_OLD_LOGIN_AGAIN',\n  DYNAMIC_LINK_NOT_ACTIVATED = 'DYNAMIC_LINK_NOT_ACTIVATED',\n  EMAIL_CHANGE_NEEDS_VERIFICATION = 'EMAIL_CHANGE_NEEDS_VERIFICATION',\n  EMAIL_EXISTS = 'EMAIL_EXISTS',\n  EMAIL_NOT_FOUND = 'EMAIL_NOT_FOUND',\n  EXPIRED_OOB_CODE = 'EXPIRED_OOB_CODE',\n  FEDERATED_USER_ID_ALREADY_LINKED = 'FEDERATED_USER_ID_ALREADY_LINKED',\n  INVALID_APP_CREDENTIAL = 'INVALID_APP_CREDENTIAL',\n  INVALID_APP_ID = 'INVALID_APP_ID',\n  INVALID_CERT_HASH = 'INVALID_CERT_HASH',\n  INVALID_CODE = 'INVALID_CODE',\n  INVALID_CONTINUE_URI = 'INVALID_CONTINUE_URI',\n  INVALID_CUSTOM_TOKEN = 'INVALID_CUSTOM_TOKEN',\n  INVALID_DYNAMIC_LINK_DOMAIN = 'INVALID_DYNAMIC_LINK_DOMAIN',\n  INVALID_EMAIL = 'INVALID_EMAIL',\n  INVALID_ID_TOKEN = 'INVALID_ID_TOKEN',\n  INVALID_IDP_RESPONSE = 'INVALID_IDP_RESPONSE',\n  INVALID_IDENTIFIER = 'INVALID_IDENTIFIER',\n  INVALID_LOGIN_CREDENTIALS = 'INVALID_LOGIN_CREDENTIALS',\n  INVALID_MESSAGE_PAYLOAD = 'INVALID_MESSAGE_PAYLOAD',\n  INVALID_MFA_PENDING_CREDENTIAL = 'INVALID_MFA_PENDING_CREDENTIAL',\n  INVALID_OAUTH_CLIENT_ID = 'INVALID_OAUTH_CLIENT_ID',\n  INVALID_OOB_CODE = 'INVALID_OOB_CODE',\n  INVALID_PASSWORD = 'INVALID_PASSWORD',\n  INVALID_PENDING_TOKEN = 'INVALID_PENDING_TOKEN',\n  INVALID_PHONE_NUMBER = 'INVALID_PHONE_NUMBER',\n  INVALID_PROVIDER_ID = 'INVALID_PROVIDER_ID',\n  INVALID_RECIPIENT_EMAIL = 'INVALID_RECIPIENT_EMAIL',\n  INVALID_SENDER = 'INVALID_SENDER',\n  INVALID_SESSION_INFO = 'INVALID_SESSION_INFO',\n  INVALID_TEMPORARY_PROOF = 'INVALID_TEMPORARY_PROOF',\n  INVALID_TENANT_ID = 'INVALID_TENANT_ID',\n  MFA_ENROLLMENT_NOT_FOUND = 'MFA_ENROLLMENT_NOT_FOUND',\n  MISSING_ANDROID_PACKAGE_NAME = 'MISSING_ANDROID_PACKAGE_NAME',\n  MISSING_APP_CREDENTIAL = 'MISSING_APP_CREDENTIAL',\n  MISSING_CODE = 'MISSING_CODE',\n  MISSING_CONTINUE_URI = 'MISSING_CONTINUE_URI',\n  MISSING_CUSTOM_TOKEN = 'MISSING_CUSTOM_TOKEN',\n  MISSING_IOS_BUNDLE_ID = 'MISSING_IOS_BUNDLE_ID',\n  MISSING_MFA_ENROLLMENT_ID = 'MISSING_MFA_ENROLLMENT_ID',\n  MISSING_MFA_PENDING_CREDENTIAL = 'MISSING_MFA_PENDING_CREDENTIAL',\n  MISSING_OOB_CODE = 'MISSING_OOB_CODE',\n  MISSING_OR_INVALID_NONCE = 'MISSING_OR_INVALID_NONCE',\n  MISSING_PASSWORD = 'MISSING_PASSWORD',\n  MISSING_REQ_TYPE = 'MISSING_REQ_TYPE',\n  MISSING_PHONE_NUMBER = 'MISSING_PHONE_NUMBER',\n  MISSING_SESSION_INFO = 'MISSING_SESSION_INFO',\n  OPERATION_NOT_ALLOWED = 'OPERATION_NOT_ALLOWED',\n  PASSWORD_LOGIN_DISABLED = 'PASSWORD_LOGIN_DISABLED',\n  QUOTA_EXCEEDED = 'QUOTA_EXCEEDED',\n  RESET_PASSWORD_EXCEED_LIMIT = 'RESET_PASSWORD_EXCEED_LIMIT',\n  REJECTED_CREDENTIAL = 'REJECTED_CREDENTIAL',\n  SECOND_FACTOR_EXISTS = 'SECOND_FACTOR_EXISTS',\n  SECOND_FACTOR_LIMIT_EXCEEDED = 'SECOND_FACTOR_LIMIT_EXCEEDED',\n  SESSION_EXPIRED = 'SESSION_EXPIRED',\n  TENANT_ID_MISMATCH = 'TENANT_ID_MISMATCH',\n  TOKEN_EXPIRED = 'TOKEN_EXPIRED',\n  TOO_MANY_ATTEMPTS_TRY_LATER = 'TOO_MANY_ATTEMPTS_TRY_LATER',\n  UNSUPPORTED_FIRST_FACTOR = 'UNSUPPORTED_FIRST_FACTOR',\n  UNSUPPORTED_TENANT_OPERATION = 'UNSUPPORTED_TENANT_OPERATION',\n  UNAUTHORIZED_DOMAIN = 'UNAUTHORIZED_DOMAIN',\n  UNVERIFIED_EMAIL = 'UNVERIFIED_EMAIL',\n  USER_CANCELLED = 'USER_CANCELLED',\n  USER_DISABLED = 'USER_DISABLED',\n  USER_NOT_FOUND = 'USER_NOT_FOUND',\n  WEAK_PASSWORD = 'WEAK_PASSWORD',\n  RECAPTCHA_NOT_ENABLED = 'RECAPTCHA_NOT_ENABLED',\n  MISSING_RECAPTCHA_TOKEN = 'MISSING_RECAPTCHA_TOKEN',\n  INVALID_RECAPTCHA_TOKEN = 'INVALID_RECAPTCHA_TOKEN',\n  INVALID_RECAPTCHA_ACTION = 'INVALID_RECAPTCHA_ACTION',\n  MISSING_CLIENT_TYPE = 'MISSING_CLIENT_TYPE',\n  MISSING_RECAPTCHA_VERSION = 'MISSING_RECAPTCHA_VERSION',\n  INVALID_RECAPTCHA_VERSION = 'INVALID_RECAPTCHA_VERSION',\n  INVALID_REQ_TYPE = 'INVALID_REQ_TYPE',\n  PASSWORD_DOES_NOT_MEET_REQUIREMENTS = 'PASSWORD_DOES_NOT_MEET_REQUIREMENTS'\n}\n\n/**\n * API Response in the event of an error\n */\nexport interface JsonError {\n  error: {\n    code: number;\n    message: string;\n    errors?: [\n      {\n        message: ServerError;\n        domain: string;\n        reason: string;\n      }\n    ];\n  };\n}\n\n/**\n * Type definition for a map from server errors to developer visible errors\n */\nexport declare type ServerErrorMap<ApiError extends string> = {\n  readonly [K in ApiError]: AuthErrorCode;\n};\n\n/**\n * Map from errors returned by the server to errors to developer visible errors\n */\nexport const SERVER_ERROR_MAP: Partial<ServerErrorMap<ServerError>> = {\n  // Custom token errors.\n  [ServerError.CREDENTIAL_MISMATCH]: AuthErrorCode.CREDENTIAL_MISMATCH,\n  // This can only happen if the SDK sends a bad request.\n  [ServerError.MISSING_CUSTOM_TOKEN]: AuthErrorCode.INTERNAL_ERROR,\n\n  // Create Auth URI errors.\n  [ServerError.INVALID_IDENTIFIER]: AuthErrorCode.INVALID_EMAIL,\n  // This can only happen if the SDK sends a bad request.\n  [ServerError.MISSING_CONTINUE_URI]: AuthErrorCode.INTERNAL_ERROR,\n\n  // Sign in with email and password errors (some apply to sign up too).\n  [ServerError.INVALID_PASSWORD]: AuthErrorCode.INVALID_PASSWORD,\n  // This can only happen if the SDK sends a bad request.\n  [ServerError.MISSING_PASSWORD]: AuthErrorCode.MISSING_PASSWORD,\n  // Thrown if Email Enumeration Protection is enabled in the project and the email or password is\n  // invalid.\n  [ServerError.INVALID_LOGIN_CREDENTIALS]: AuthErrorCode.INVALID_CREDENTIAL,\n\n  // Sign up with email and password errors.\n  [ServerError.EMAIL_EXISTS]: AuthErrorCode.EMAIL_EXISTS,\n  [ServerError.PASSWORD_LOGIN_DISABLED]: AuthErrorCode.OPERATION_NOT_ALLOWED,\n\n  // Verify assertion for sign in with credential errors:\n  [ServerError.INVALID_IDP_RESPONSE]: AuthErrorCode.INVALID_CREDENTIAL,\n  [ServerError.INVALID_PENDING_TOKEN]: AuthErrorCode.INVALID_CREDENTIAL,\n  [ServerError.FEDERATED_USER_ID_ALREADY_LINKED]:\n    AuthErrorCode.CREDENTIAL_ALREADY_IN_USE,\n\n  // This can only happen if the SDK sends a bad request.\n  [ServerError.MISSING_REQ_TYPE]: AuthErrorCode.INTERNAL_ERROR,\n\n  // Send Password reset email errors:\n  [ServerError.EMAIL_NOT_FOUND]: AuthErrorCode.USER_DELETED,\n  [ServerError.RESET_PASSWORD_EXCEED_LIMIT]:\n    AuthErrorCode.TOO_MANY_ATTEMPTS_TRY_LATER,\n\n  [ServerError.EXPIRED_OOB_CODE]: AuthErrorCode.EXPIRED_OOB_CODE,\n  [ServerError.INVALID_OOB_CODE]: AuthErrorCode.INVALID_OOB_CODE,\n  // This can only happen if the SDK sends a bad request.\n  [ServerError.MISSING_OOB_CODE]: AuthErrorCode.INTERNAL_ERROR,\n\n  // Operations that require ID token in request:\n  [ServerError.CREDENTIAL_TOO_OLD_LOGIN_AGAIN]:\n    AuthErrorCode.CREDENTIAL_TOO_OLD_LOGIN_AGAIN,\n  [ServerError.INVALID_ID_TOKEN]: AuthErrorCode.INVALID_AUTH,\n  [ServerError.TOKEN_EXPIRED]: AuthErrorCode.TOKEN_EXPIRED,\n  [ServerError.USER_NOT_FOUND]: AuthErrorCode.TOKEN_EXPIRED,\n\n  // Other errors.\n  [ServerError.TOO_MANY_ATTEMPTS_TRY_LATER]:\n    AuthErrorCode.TOO_MANY_ATTEMPTS_TRY_LATER,\n  [ServerError.PASSWORD_DOES_NOT_MEET_REQUIREMENTS]:\n    AuthErrorCode.PASSWORD_DOES_NOT_MEET_REQUIREMENTS,\n\n  // Phone Auth related errors.\n  [ServerError.INVALID_CODE]: AuthErrorCode.INVALID_CODE,\n  [ServerError.INVALID_SESSION_INFO]: AuthErrorCode.INVALID_SESSION_INFO,\n  [ServerError.INVALID_TEMPORARY_PROOF]: AuthErrorCode.INVALID_CREDENTIAL,\n  [ServerError.MISSING_SESSION_INFO]: AuthErrorCode.MISSING_SESSION_INFO,\n  [ServerError.SESSION_EXPIRED]: AuthErrorCode.CODE_EXPIRED,\n\n  // Other action code errors when additional settings passed.\n  // MISSING_CONTINUE_URI is getting mapped to INTERNAL_ERROR above.\n  // This is OK as this error will be caught by client side validation.\n  [ServerError.MISSING_ANDROID_PACKAGE_NAME]:\n    AuthErrorCode.MISSING_ANDROID_PACKAGE_NAME,\n  [ServerError.UNAUTHORIZED_DOMAIN]: AuthErrorCode.UNAUTHORIZED_DOMAIN,\n\n  // getProjectConfig errors when clientId is passed.\n  [ServerError.INVALID_OAUTH_CLIENT_ID]: AuthErrorCode.INVALID_OAUTH_CLIENT_ID,\n\n  // User actions (sign-up or deletion) disabled errors.\n  [ServerError.ADMIN_ONLY_OPERATION]: AuthErrorCode.ADMIN_ONLY_OPERATION,\n\n  // Multi factor related errors.\n  [ServerError.INVALID_MFA_PENDING_CREDENTIAL]:\n    AuthErrorCode.INVALID_MFA_SESSION,\n  [ServerError.MFA_ENROLLMENT_NOT_FOUND]: AuthErrorCode.MFA_INFO_NOT_FOUND,\n  [ServerError.MISSING_MFA_ENROLLMENT_ID]: AuthErrorCode.MISSING_MFA_INFO,\n  [ServerError.MISSING_MFA_PENDING_CREDENTIAL]:\n    AuthErrorCode.MISSING_MFA_SESSION,\n  [ServerError.SECOND_FACTOR_EXISTS]:\n    AuthErrorCode.SECOND_FACTOR_ALREADY_ENROLLED,\n  [ServerError.SECOND_FACTOR_LIMIT_EXCEEDED]:\n    AuthErrorCode.SECOND_FACTOR_LIMIT_EXCEEDED,\n\n  // Blocking functions related errors.\n  [ServerError.BLOCKING_FUNCTION_ERROR_RESPONSE]: AuthErrorCode.INTERNAL_ERROR,\n\n  // Recaptcha related errors.\n  [ServerError.RECAPTCHA_NOT_ENABLED]: AuthErrorCode.RECAPTCHA_NOT_ENABLED,\n  [ServerError.MISSING_RECAPTCHA_TOKEN]: AuthErrorCode.MISSING_RECAPTCHA_TOKEN,\n  [ServerError.INVALID_RECAPTCHA_TOKEN]: AuthErrorCode.INVALID_RECAPTCHA_TOKEN,\n  [ServerError.INVALID_RECAPTCHA_ACTION]:\n    AuthErrorCode.INVALID_RECAPTCHA_ACTION,\n  [ServerError.MISSING_CLIENT_TYPE]: AuthErrorCode.MISSING_CLIENT_TYPE,\n  [ServerError.MISSING_RECAPTCHA_VERSION]:\n    AuthErrorCode.MISSING_RECAPTCHA_VERSION,\n  [ServerError.INVALID_RECAPTCHA_VERSION]:\n    AuthErrorCode.INVALID_RECAPTCHA_VERSION,\n  [ServerError.INVALID_REQ_TYPE]: AuthErrorCode.INVALID_REQ_TYPE\n};\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseError, querystring } from '@firebase/util';\n\nimport { AuthErrorCode, NamedErrorParams } from '../core/errors';\nimport {\n  _createError,\n  _errorWithCustomMessage,\n  _fail\n} from '../core/util/assert';\nimport { Delay } from '../core/util/delay';\nimport { _emulatorUrl } from '../core/util/emulator';\nimport { FetchProvider } from '../core/util/fetch_provider';\nimport { Auth } from '../model/public_types';\nimport { AuthInternal, ConfigInternal } from '../model/auth';\nimport { IdTokenResponse, TaggedWithTokenResponse } from '../model/id_token';\nimport { IdTokenMfaResponse } from './authentication/mfa';\nimport { SERVER_ERROR_MAP, ServerError, ServerErrorMap } from './errors';\n\nexport const enum HttpMethod {\n  POST = 'POST',\n  GET = 'GET'\n}\n\nexport const enum HttpHeader {\n  CONTENT_TYPE = 'Content-Type',\n  X_FIREBASE_LOCALE = 'X-Firebase-Locale',\n  X_CLIENT_VERSION = 'X-Client-Version',\n  X_FIREBASE_GMPID = 'X-Firebase-gmpid',\n  X_FIREBASE_CLIENT = 'X-Firebase-Client',\n  X_FIREBASE_APP_CHECK = 'X-Firebase-AppCheck'\n}\n\nexport const enum Endpoint {\n  CREATE_AUTH_URI = '/v1/accounts:createAuthUri',\n  DELETE_ACCOUNT = '/v1/accounts:delete',\n  RESET_PASSWORD = '/v1/accounts:resetPassword',\n  SIGN_UP = '/v1/accounts:signUp',\n  SIGN_IN_WITH_CUSTOM_TOKEN = '/v1/accounts:signInWithCustomToken',\n  SIGN_IN_WITH_EMAIL_LINK = '/v1/accounts:signInWithEmailLink',\n  SIGN_IN_WITH_IDP = '/v1/accounts:signInWithIdp',\n  SIGN_IN_WITH_PASSWORD = '/v1/accounts:signInWithPassword',\n  SIGN_IN_WITH_PHONE_NUMBER = '/v1/accounts:signInWithPhoneNumber',\n  SEND_VERIFICATION_CODE = '/v1/accounts:sendVerificationCode',\n  SEND_OOB_CODE = '/v1/accounts:sendOobCode',\n  SET_ACCOUNT_INFO = '/v1/accounts:update',\n  GET_ACCOUNT_INFO = '/v1/accounts:lookup',\n  GET_RECAPTCHA_PARAM = '/v1/recaptchaParams',\n  START_MFA_ENROLLMENT = '/v2/accounts/mfaEnrollment:start',\n  FINALIZE_MFA_ENROLLMENT = '/v2/accounts/mfaEnrollment:finalize',\n  START_MFA_SIGN_IN = '/v2/accounts/mfaSignIn:start',\n  FINALIZE_MFA_SIGN_IN = '/v2/accounts/mfaSignIn:finalize',\n  WITHDRAW_MFA = '/v2/accounts/mfaEnrollment:withdraw',\n  GET_PROJECT_CONFIG = '/v1/projects',\n  GET_RECAPTCHA_CONFIG = '/v2/recaptchaConfig',\n  GET_PASSWORD_POLICY = '/v2/passwordPolicy',\n  TOKEN = '/v1/token',\n  REVOKE_TOKEN = '/v2/accounts:revokeToken'\n}\n\nexport const enum RecaptchaClientType {\n  WEB = 'CLIENT_TYPE_WEB',\n  ANDROID = 'CLIENT_TYPE_ANDROID',\n  IOS = 'CLIENT_TYPE_IOS'\n}\n\nexport const enum RecaptchaVersion {\n  ENTERPRISE = 'RECAPTCHA_ENTERPRISE'\n}\n\nexport const enum RecaptchaActionName {\n  SIGN_IN_WITH_PASSWORD = 'signInWithPassword',\n  GET_OOB_CODE = 'getOobCode',\n  SIGN_UP_PASSWORD = 'signUpPassword'\n}\n\nexport const enum EnforcementState {\n  ENFORCE = 'ENFORCE',\n  AUDIT = 'AUDIT',\n  OFF = 'OFF',\n  ENFORCEMENT_STATE_UNSPECIFIED = 'ENFORCEMENT_STATE_UNSPECIFIED'\n}\n\n// Providers that have reCAPTCHA Enterprise support.\nexport const enum RecaptchaProvider {\n  EMAIL_PASSWORD_PROVIDER = 'EMAIL_PASSWORD_PROVIDER'\n}\n\nexport const DEFAULT_API_TIMEOUT_MS = new Delay(30_000, 60_000);\n\nexport function _addTidIfNecessary<T extends { tenantId?: string }>(\n  auth: Auth,\n  request: T\n): T {\n  if (auth.tenantId && !request.tenantId) {\n    return {\n      ...request,\n      tenantId: auth.tenantId\n    };\n  }\n  return request;\n}\n\nexport async function _performApiRequest<T, V>(\n  auth: Auth,\n  method: HttpMethod,\n  path: Endpoint,\n  request?: T,\n  customErrorMap: Partial<ServerErrorMap<ServerError>> = {}\n): Promise<V> {\n  return _performFetchWithErrorHandling(auth, customErrorMap, async () => {\n    let body = {};\n    let params = {};\n    if (request) {\n      if (method === HttpMethod.GET) {\n        params = request;\n      } else {\n        body = {\n          body: JSON.stringify(request)\n        };\n      }\n    }\n\n    const query = querystring({\n      key: auth.config.apiKey,\n      ...params\n    }).slice(1);\n\n    const headers = await (auth as AuthInternal)._getAdditionalHeaders();\n    headers[HttpHeader.CONTENT_TYPE] = 'application/json';\n\n    if (auth.languageCode) {\n      headers[HttpHeader.X_FIREBASE_LOCALE] = auth.languageCode;\n    }\n\n    return FetchProvider.fetch()(\n      _getFinalTarget(auth, auth.config.apiHost, path, query),\n      {\n        method,\n        headers,\n        referrerPolicy: 'no-referrer',\n        ...body\n      }\n    );\n  });\n}\n\nexport async function _performFetchWithErrorHandling<V>(\n  auth: Auth,\n  customErrorMap: Partial<ServerErrorMap<ServerError>>,\n  fetchFn: () => Promise<Response>\n): Promise<V> {\n  (auth as AuthInternal)._canInitEmulator = false;\n  const errorMap = { ...SERVER_ERROR_MAP, ...customErrorMap };\n  try {\n    const networkTimeout = new NetworkTimeout<Response>(auth);\n    const response: Response = await Promise.race<Promise<Response>>([\n      fetchFn(),\n      networkTimeout.promise\n    ]);\n\n    // If we've reached this point, the fetch succeeded and the networkTimeout\n    // didn't throw; clear the network timeout delay so that Node won't hang\n    networkTimeout.clearNetworkTimeout();\n\n    const json = await response.json();\n    if ('needConfirmation' in json) {\n      throw _makeTaggedError(auth, AuthErrorCode.NEED_CONFIRMATION, json);\n    }\n\n    if (response.ok && !('errorMessage' in json)) {\n      return json;\n    } else {\n      const errorMessage = response.ok ? json.errorMessage : json.error.message;\n      const [serverErrorCode, serverErrorMessage] = errorMessage.split(' : ');\n      if (serverErrorCode === ServerError.FEDERATED_USER_ID_ALREADY_LINKED) {\n        throw _makeTaggedError(\n          auth,\n          AuthErrorCode.CREDENTIAL_ALREADY_IN_USE,\n          json\n        );\n      } else if (serverErrorCode === ServerError.EMAIL_EXISTS) {\n        throw _makeTaggedError(auth, AuthErrorCode.EMAIL_EXISTS, json);\n      } else if (serverErrorCode === ServerError.USER_DISABLED) {\n        throw _makeTaggedError(auth, AuthErrorCode.USER_DISABLED, json);\n      }\n      const authError =\n        errorMap[serverErrorCode as ServerError] ||\n        (serverErrorCode\n          .toLowerCase()\n          .replace(/[_\\s]+/g, '-') as unknown as AuthErrorCode);\n      if (serverErrorMessage) {\n        throw _errorWithCustomMessage(auth, authError, serverErrorMessage);\n      } else {\n        _fail(auth, authError);\n      }\n    }\n  } catch (e) {\n    if (e instanceof FirebaseError) {\n      throw e;\n    }\n    // Changing this to a different error code will log user out when there is a network error\n    // because we treat any error other than NETWORK_REQUEST_FAILED as token is invalid.\n    // https://github.com/firebase/firebase-js-sdk/blob/4fbc73610d70be4e0852e7de63a39cb7897e8546/packages/auth/src/core/auth/auth_impl.ts#L309-L316\n    _fail(auth, AuthErrorCode.NETWORK_REQUEST_FAILED, { 'message': String(e) });\n  }\n}\n\nexport async function _performSignInRequest<T, V extends IdTokenResponse>(\n  auth: Auth,\n  method: HttpMethod,\n  path: Endpoint,\n  request?: T,\n  customErrorMap: Partial<ServerErrorMap<ServerError>> = {}\n): Promise<V> {\n  const serverResponse = (await _performApiRequest<T, V | IdTokenMfaResponse>(\n    auth,\n    method,\n    path,\n    request,\n    customErrorMap\n  )) as V;\n  if ('mfaPendingCredential' in serverResponse) {\n    _fail(auth, AuthErrorCode.MFA_REQUIRED, {\n      _serverResponse: serverResponse\n    });\n  }\n\n  return serverResponse;\n}\n\nexport function _getFinalTarget(\n  auth: Auth,\n  host: string,\n  path: string,\n  query: string\n): string {\n  const base = `${host}${path}?${query}`;\n\n  if (!(auth as AuthInternal).config.emulator) {\n    return `${auth.config.apiScheme}://${base}`;\n  }\n\n  return _emulatorUrl(auth.config as ConfigInternal, base);\n}\n\nexport function _parseEnforcementState(\n  enforcementStateStr: string\n): EnforcementState {\n  switch (enforcementStateStr) {\n    case 'ENFORCE':\n      return EnforcementState.ENFORCE;\n    case 'AUDIT':\n      return EnforcementState.AUDIT;\n    case 'OFF':\n      return EnforcementState.OFF;\n    default:\n      return EnforcementState.ENFORCEMENT_STATE_UNSPECIFIED;\n  }\n}\n\nclass NetworkTimeout<T> {\n  // Node timers and browser timers are fundamentally incompatible, but we\n  // don't care about the value here\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private timer: any | null = null;\n  readonly promise = new Promise<T>((_, reject) => {\n    this.timer = setTimeout(() => {\n      return reject(\n        _createError(this.auth, AuthErrorCode.NETWORK_REQUEST_FAILED)\n      );\n    }, DEFAULT_API_TIMEOUT_MS.get());\n  });\n\n  clearNetworkTimeout(): void {\n    clearTimeout(this.timer);\n  }\n\n  constructor(private readonly auth: Auth) {}\n}\n\ninterface PotentialResponse extends IdTokenResponse {\n  email?: string;\n  phoneNumber?: string;\n}\n\nexport function _makeTaggedError(\n  auth: Auth,\n  code: AuthErrorCode,\n  response: PotentialResponse\n): FirebaseError {\n  const errorParams: NamedErrorParams = {\n    appName: auth.name\n  };\n\n  if (response.email) {\n    errorParams.email = response.email;\n  }\n  if (response.phoneNumber) {\n    errorParams.phoneNumber = response.phoneNumber;\n  }\n\n  const error = _createError(auth, code, errorParams);\n\n  // We know customData is defined on error because errorParams is defined\n  (error.customData! as TaggedWithTokenResponse)._tokenResponse = response;\n  return error;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { RecaptchaParameters } from '../../model/public_types';\nimport {\n  GetRecaptchaConfigResponse,\n  RecaptchaEnforcementProviderState\n} from '../../api/authentication/recaptcha';\nimport { EnforcementState, _parseEnforcementState } from '../../api/index';\n\n// reCAPTCHA v2 interface\nexport interface Recaptcha {\n  render: (container: HTMLElement, parameters: RecaptchaParameters) => number;\n  getResponse: (id: number) => string;\n  execute: (id: number) => unknown;\n  reset: (id: number) => unknown;\n}\n\nexport function isV2(\n  grecaptcha: Recaptcha | GreCAPTCHA | undefined\n): grecaptcha is Recaptcha {\n  return (\n    grecaptcha !== undefined &&\n    (grecaptcha as Recaptcha).getResponse !== undefined\n  );\n}\n\n// reCAPTCHA Enterprise & v3 shared interface\nexport interface GreCAPTCHATopLevel extends GreCAPTCHA {\n  enterprise: GreCAPTCHA;\n}\n\n// reCAPTCHA Enterprise interface\nexport interface GreCAPTCHA {\n  ready: (callback: () => void) => void;\n  execute: (siteKey: string, options: { action: string }) => Promise<string>;\n  render: (\n    container: string | HTMLElement,\n    parameters: GreCAPTCHARenderOption\n  ) => string;\n}\n\nexport interface GreCAPTCHARenderOption {\n  sitekey: string;\n  size: 'invisible';\n}\n\nexport function isEnterprise(\n  grecaptcha: Recaptcha | GreCAPTCHA | undefined\n): grecaptcha is GreCAPTCHATopLevel {\n  return (\n    grecaptcha !== undefined &&\n    (grecaptcha as GreCAPTCHATopLevel).enterprise !== undefined\n  );\n}\n\n// TODO(chuanr): Replace this with the AuthWindow after resolving the dependency issue in Node.js env.\ndeclare global {\n  interface Window {\n    grecaptcha?: Recaptcha | GreCAPTCHATopLevel;\n  }\n}\n\nexport class RecaptchaConfig {\n  /**\n   * The reCAPTCHA site key.\n   */\n  siteKey: string = '';\n\n  /**\n   * The list of providers and their enablement status for reCAPTCHA Enterprise.\n   */\n  recaptchaEnforcementState: RecaptchaEnforcementProviderState[] = [];\n\n  constructor(response: GetRecaptchaConfigResponse) {\n    if (response.recaptchaKey === undefined) {\n      throw new Error('recaptchaKey undefined');\n    }\n    // Example response.recaptchaKey: \"projects/proj123/keys/sitekey123\"\n    this.siteKey = response.recaptchaKey.split('/')[3];\n    this.recaptchaEnforcementState = response.recaptchaEnforcementState;\n  }\n\n  /**\n   * Returns the reCAPTCHA Enterprise enforcement state for the given provider.\n   *\n   * @param providerStr - The provider whose enforcement state is to be returned.\n   * @returns The reCAPTCHA Enterprise enforcement state for the given provider.\n   */\n  getProviderEnforcementState(providerStr: string): EnforcementState | null {\n    if (\n      !this.recaptchaEnforcementState ||\n      this.recaptchaEnforcementState.length === 0\n    ) {\n      return null;\n    }\n\n    for (const recaptchaEnforcementState of this.recaptchaEnforcementState) {\n      if (\n        recaptchaEnforcementState.provider &&\n        recaptchaEnforcementState.provider === providerStr\n      ) {\n        return _parseEnforcementState(\n          recaptchaEnforcementState.enforcementState\n        );\n      }\n    }\n    return null;\n  }\n\n  /**\n   * Returns true if the reCAPTCHA Enterprise enforcement state for the provider is set to ENFORCE or AUDIT.\n   *\n   * @param providerStr - The provider whose enablement state is to be returned.\n   * @returns Whether or not reCAPTCHA Enterprise protection is enabled for the given provider.\n   */\n  isProviderEnabled(providerStr: string): boolean {\n    return (\n      this.getProviderEnforcementState(providerStr) ===\n        EnforcementState.ENFORCE ||\n      this.getProviderEnforcementState(providerStr) === EnforcementState.AUDIT\n    );\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  Endpoint,\n  HttpMethod,\n  RecaptchaClientType,\n  RecaptchaVersion,\n  _performApiRequest,\n  _addTidIfNecessary\n} from '../index';\nimport { Auth } from '../../model/public_types';\n\ninterface GetRecaptchaParamResponse {\n  recaptchaSiteKey?: string;\n}\n\nexport async function getRecaptchaParams(auth: Auth): Promise<string> {\n  return (\n    (\n      await _performApiRequest<void, GetRecaptchaParamResponse>(\n        auth,\n        HttpMethod.GET,\n        Endpoint.GET_RECAPTCHA_PARAM\n      )\n    ).recaptchaSiteKey || ''\n  );\n}\n\n// The following functions are for reCAPTCHA enterprise integration.\ninterface GetRecaptchaConfigRequest {\n  tenantId?: string;\n  clientType?: RecaptchaClientType;\n  version?: RecaptchaVersion;\n}\n\nexport interface RecaptchaEnforcementProviderState {\n  provider: string;\n  enforcementState: string;\n}\n\nexport interface GetRecaptchaConfigResponse {\n  recaptchaKey: string;\n  recaptchaEnforcementState: RecaptchaEnforcementProviderState[];\n}\n\nexport async function getRecaptchaConfig(\n  auth: Auth,\n  request: GetRecaptchaConfigRequest\n): Promise<GetRecaptchaConfigResponse> {\n  return _performApiRequest<\n    GetRecaptchaConfigRequest,\n    GetRecaptchaConfigResponse\n  >(\n    auth,\n    HttpMethod.GET,\n    Endpoint.GET_RECAPTCHA_CONFIG,\n    _addTidIfNecessary(auth, request)\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Endpoint, HttpMethod, _performApiRequest } from '../index';\nimport { MfaEnrollment } from './mfa';\nimport { Auth } from '../../model/public_types';\n\nexport interface DeleteAccountRequest {\n  idToken: string;\n}\n\nexport async function deleteAccount(\n  auth: Auth,\n  request: DeleteAccountRequest\n): Promise<void> {\n  return _performApiRequest<DeleteAccountRequest, void>(\n    auth,\n    HttpMethod.POST,\n    Endpoint.DELETE_ACCOUNT,\n    request\n  );\n}\n\nexport interface ProviderUserInfo {\n  providerId: string;\n  rawId?: string;\n  email?: string;\n  displayName?: string;\n  photoUrl?: string;\n  phoneNumber?: string;\n}\n\nexport interface DeleteLinkedAccountsRequest {\n  idToken: string;\n  deleteProvider: string[];\n}\n\nexport interface DeleteLinkedAccountsResponse {\n  providerUserInfo: ProviderUserInfo[];\n}\n\nexport async function deleteLinkedAccounts(\n  auth: Auth,\n  request: DeleteLinkedAccountsRequest\n): Promise<DeleteLinkedAccountsResponse> {\n  return _performApiRequest<\n    DeleteLinkedAccountsRequest,\n    DeleteLinkedAccountsResponse\n  >(auth, HttpMethod.POST, Endpoint.SET_ACCOUNT_INFO, request);\n}\n\nexport interface APIUserInfo {\n  localId?: string;\n  displayName?: string;\n  photoUrl?: string;\n  email?: string;\n  emailVerified?: boolean;\n  phoneNumber?: string;\n  lastLoginAt?: number;\n  createdAt?: number;\n  tenantId?: string;\n  passwordHash?: string;\n  providerUserInfo?: ProviderUserInfo[];\n  mfaInfo?: MfaEnrollment[];\n}\n\nexport interface GetAccountInfoRequest {\n  idToken: string;\n}\n\nexport interface GetAccountInfoResponse {\n  users: APIUserInfo[];\n}\n\nexport async function getAccountInfo(\n  auth: Auth,\n  request: GetAccountInfoRequest\n): Promise<GetAccountInfoResponse> {\n  return _performApiRequest<GetAccountInfoRequest, GetAccountInfoResponse>(\n    auth,\n    HttpMethod.POST,\n    Endpoint.GET_ACCOUNT_INFO,\n    request\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function utcTimestampToDateString(\n  utcTimestamp?: string | number\n): string | undefined {\n  if (!utcTimestamp) {\n    return undefined;\n  }\n  try {\n    // Convert to date object.\n    const date = new Date(Number(utcTimestamp));\n    // Test date is valid.\n    if (!isNaN(date.getTime())) {\n      // Convert to UTC date string.\n      return date.toUTCString();\n    }\n  } catch (e) {\n    // Do nothing. undefined will be returned.\n  }\n  return undefined;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IdTokenResult, ParsedToken, User } from '../../model/public_types';\nimport { base64Decode, getModularInstance } from '@firebase/util';\n\nimport { UserInternal } from '../../model/user';\nimport { _assert } from '../util/assert';\nimport { _logError } from '../util/log';\nimport { utcTimestampToDateString } from '../util/time';\nimport { AuthErrorCode } from '../errors';\n\n/**\n * Returns a JSON Web Token (JWT) used to identify the user to a Firebase service.\n *\n * @remarks\n * Returns the current token if it has not expired or if it will not expire in the next five\n * minutes. Otherwise, this will refresh the token and return a new one.\n *\n * @param user - The user.\n * @param forceRefresh - Force refresh regardless of token expiration.\n *\n * @public\n */\nexport function getIdToken(user: User, forceRefresh = false): Promise<string> {\n  return getModularInstance(user).getIdToken(forceRefresh);\n}\n\n/**\n * Returns a deserialized JSON Web Token (JWT) used to identify the user to a Firebase service.\n *\n * @remarks\n * Returns the current token if it has not expired or if it will not expire in the next five\n * minutes. Otherwise, this will refresh the token and return a new one.\n *\n * @param user - The user.\n * @param forceRefresh - Force refresh regardless of token expiration.\n *\n * @public\n */\nexport async function getIdTokenResult(\n  user: User,\n  forceRefresh = false\n): Promise<IdTokenResult> {\n  const userInternal = getModularInstance(user) as UserInternal;\n  const token = await userInternal.getIdToken(forceRefresh);\n  const claims = _parseToken(token);\n\n  _assert(\n    claims && claims.exp && claims.auth_time && claims.iat,\n    userInternal.auth,\n    AuthErrorCode.INTERNAL_ERROR\n  );\n  const firebase =\n    typeof claims.firebase === 'object' ? claims.firebase : undefined;\n\n  const signInProvider: string | undefined = firebase?.['sign_in_provider'];\n\n  return {\n    claims,\n    token,\n    authTime: utcTimestampToDateString(\n      secondsStringToMilliseconds(claims.auth_time)\n    )!,\n    issuedAtTime: utcTimestampToDateString(\n      secondsStringToMilliseconds(claims.iat)\n    )!,\n    expirationTime: utcTimestampToDateString(\n      secondsStringToMilliseconds(claims.exp)\n    )!,\n    signInProvider: signInProvider || null,\n    signInSecondFactor: firebase?.['sign_in_second_factor'] || null\n  };\n}\n\nfunction secondsStringToMilliseconds(seconds: string): number {\n  return Number(seconds) * 1000;\n}\n\nexport function _parseToken(token: string): ParsedToken | null {\n  const [algorithm, payload, signature] = token.split('.');\n  if (\n    algorithm === undefined ||\n    payload === undefined ||\n    signature === undefined\n  ) {\n    _logError('JWT malformed, contained fewer than 3 sections');\n    return null;\n  }\n\n  try {\n    const decoded = base64Decode(payload);\n    if (!decoded) {\n      _logError('Failed to decode base64 JWT payload');\n      return null;\n    }\n    return JSON.parse(decoded);\n  } catch (e) {\n    _logError(\n      'Caught error parsing JWT payload as JSON',\n      (e as Error)?.toString()\n    );\n    return null;\n  }\n}\n\n/**\n * Extract expiresIn TTL from a token by subtracting the expiration from the issuance.\n */\nexport function _tokenExpiresIn(token: string): number {\n  const parsedToken = _parseToken(token);\n  _assert(parsedToken, AuthErrorCode.INTERNAL_ERROR);\n  _assert(typeof parsedToken.exp !== 'undefined', AuthErrorCode.INTERNAL_ERROR);\n  _assert(typeof parsedToken.iat !== 'undefined', AuthErrorCode.INTERNAL_ERROR);\n  return Number(parsedToken.exp) - Number(parsedToken.iat);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseError } from '@firebase/util';\n\nimport { UserInternal } from '../../model/user';\nimport { AuthErrorCode } from '../errors';\n\nexport async function _logoutIfInvalidated<T>(\n  user: UserInternal,\n  promise: Promise<T>,\n  bypassAuthState = false\n): Promise<T> {\n  if (bypassAuthState) {\n    return promise;\n  }\n  try {\n    return await promise;\n  } catch (e) {\n    if (e instanceof FirebaseError && isUserInvalidated(e)) {\n      if (user.auth.currentUser === user) {\n        await user.auth.signOut();\n      }\n    }\n\n    throw e;\n  }\n}\n\nfunction isUserInvalidated({ code }: FirebaseError): boolean {\n  return (\n    code === `auth/${AuthErrorCode.USER_DISABLED}` ||\n    code === `auth/${AuthErrorCode.TOKEN_EXPIRED}`\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseError } from '@firebase/util';\nimport { UserInternal } from '../../model/user';\nimport { AuthErrorCode } from '../errors';\n\n// Refresh the token five minutes before expiration\nexport const enum Duration {\n  OFFSET = 5 * 1000 * 60,\n  RETRY_BACKOFF_MIN = 30 * 1000,\n  RETRY_BACKOFF_MAX = 16 * 60 * 1000\n}\n\nexport class ProactiveRefresh {\n  private isRunning = false;\n\n  // Node timers and browser timers return fundamentally different types.\n  // We don't actually care what the value is but TS won't accept unknown and\n  // we can't cast properly in both environments.\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private timerId: any | null = null;\n  private errorBackoff = Duration.RETRY_BACKOFF_MIN;\n\n  constructor(private readonly user: UserInternal) {}\n\n  _start(): void {\n    if (this.isRunning) {\n      return;\n    }\n\n    this.isRunning = true;\n    this.schedule();\n  }\n\n  _stop(): void {\n    if (!this.isRunning) {\n      return;\n    }\n\n    this.isRunning = false;\n    if (this.timerId !== null) {\n      clearTimeout(this.timerId);\n    }\n  }\n\n  private getInterval(wasError: boolean): number {\n    if (wasError) {\n      const interval = this.errorBackoff;\n      this.errorBackoff = Math.min(\n        this.errorBackoff * 2,\n        Duration.RETRY_BACKOFF_MAX\n      );\n      return interval;\n    } else {\n      // Reset the error backoff\n      this.errorBackoff = Duration.RETRY_BACKOFF_MIN;\n      const expTime = this.user.stsTokenManager.expirationTime ?? 0;\n      const interval = expTime - Date.now() - Duration.OFFSET;\n\n      return Math.max(0, interval);\n    }\n  }\n\n  private schedule(wasError = false): void {\n    if (!this.isRunning) {\n      // Just in case...\n      return;\n    }\n\n    const interval = this.getInterval(wasError);\n    this.timerId = setTimeout(async () => {\n      await this.iteration();\n    }, interval);\n  }\n\n  private async iteration(): Promise<void> {\n    try {\n      await this.user.getIdToken(true);\n    } catch (e) {\n      // Only retry on network errors\n      if (\n        (e as FirebaseError)?.code ===\n        `auth/${AuthErrorCode.NETWORK_REQUEST_FAILED}`\n      ) {\n        this.schedule(/* wasError */ true);\n      }\n\n      return;\n    }\n    this.schedule();\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { UserMetadata as UserMetadataType } from '../../model/public_types';\n\nimport { utcTimestampToDateString } from '../util/time';\n\nexport class UserMetadata implements UserMetadataType {\n  creationTime?: string;\n  lastSignInTime?: string;\n\n  constructor(\n    private createdAt?: string | number,\n    private lastLoginAt?: string | number\n  ) {\n    this._initializeTime();\n  }\n\n  private _initializeTime(): void {\n    this.lastSignInTime = utcTimestampToDateString(this.lastLoginAt);\n    this.creationTime = utcTimestampToDateString(this.createdAt);\n  }\n\n  _copy(metadata: UserMetadata): void {\n    this.createdAt = metadata.createdAt;\n    this.lastLoginAt = metadata.lastLoginAt;\n    this._initializeTime();\n  }\n\n  toJSON(): object {\n    return {\n      createdAt: this.createdAt,\n      lastLoginAt: this.lastLoginAt\n    };\n  }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { User, UserInfo } from '../../model/public_types';\n\nimport {\n  getAccountInfo,\n  ProviderUserInfo\n} from '../../api/account_management/account';\nimport { UserInternal } from '../../model/user';\nimport { AuthErrorCode } from '../errors';\nimport { _assert } from '../util/assert';\nimport { _logoutIfInvalidated } from './invalidation';\nimport { UserMetadata } from './user_metadata';\nimport { getModularInstance } from '@firebase/util';\n\nexport async function _reloadWithoutSaving(user: UserInternal): Promise<void> {\n  const auth = user.auth;\n  const idToken = await user.getIdToken();\n  const response = await _logoutIfInvalidated(\n    user,\n    getAccountInfo(auth, { idToken })\n  );\n\n  _assert(response?.users.length, auth, AuthErrorCode.INTERNAL_ERROR);\n\n  const coreAccount = response.users[0];\n\n  user._notifyReloadListener(coreAccount);\n\n  const newProviderData = coreAccount.providerUserInfo?.length\n    ? extractProviderData(coreAccount.providerUserInfo)\n    : [];\n\n  const providerData = mergeProviderData(user.providerData, newProviderData);\n\n  // Preserves the non-nonymous status of the stored user, even if no more\n  // credentials (federated or email/password) are linked to the user. If\n  // the user was previously anonymous, then use provider data to update.\n  // On the other hand, if it was not anonymous before, it should never be\n  // considered anonymous now.\n  const oldIsAnonymous = user.isAnonymous;\n  const newIsAnonymous =\n    !(user.email && coreAccount.passwordHash) && !providerData?.length;\n  const isAnonymous = !oldIsAnonymous ? false : newIsAnonymous;\n\n  const updates: Partial<UserInternal> = {\n    uid: coreAccount.localId,\n    displayName: coreAccount.displayName || null,\n    photoURL: coreAccount.photoUrl || null,\n    email: coreAccount.email || null,\n    emailVerified: coreAccount.emailVerified || false,\n    phoneNumber: coreAccount.phoneNumber || null,\n    tenantId: coreAccount.tenantId || null,\n    providerData,\n    metadata: new UserMetadata(coreAccount.createdAt, coreAccount.lastLoginAt),\n    isAnonymous\n  };\n\n  Object.assign(user, updates);\n}\n\n/**\n * Reloads user account data, if signed in.\n *\n * @param user - The user.\n *\n * @public\n */\nexport async function reload(user: User): Promise<void> {\n  const userInternal: UserInternal = getModularInstance(user) as UserInternal;\n  await _reloadWithoutSaving(userInternal);\n\n  // Even though the current user hasn't changed, update\n  // current user will trigger a persistence update w/ the\n  // new info.\n  await userInternal.auth._persistUserIfCurrent(userInternal);\n  userInternal.auth._notifyListenersIfCurrent(userInternal);\n}\n\nfunction mergeProviderData(\n  original: UserInfo[],\n  newData: UserInfo[]\n): UserInfo[] {\n  const deduped = original.filter(\n    o => !newData.some(n => n.providerId === o.providerId)\n  );\n  return [...deduped, ...newData];\n}\n\nexport function extractProviderData(providers: ProviderUserInfo[]): UserInfo[] {\n  return providers.map(({ providerId, ...provider }) => {\n    return {\n      providerId,\n      uid: provider.rawId || '',\n      displayName: provider.displayName || null,\n      email: provider.email || null,\n      phoneNumber: provider.phoneNumber || null,\n      photoURL: provider.photoUrl || null\n    };\n  });\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FinalizeMfaResponse } from '../../api/authentication/mfa';\nimport { requestStsToken } from '../../api/authentication/token';\nimport { AuthInternal } from '../../model/auth';\nimport { IdTokenResponse } from '../../model/id_token';\nimport { AuthErrorCode } from '../errors';\nimport { PersistedBlob } from '../persistence';\nimport { _assert, debugFail } from '../util/assert';\nimport { _tokenExpiresIn } from './id_token_result';\n\n/**\n * The number of milliseconds before the official expiration time of a token\n * to refresh that token, to provide a buffer for RPCs to complete.\n */\nexport const enum Buffer {\n  TOKEN_REFRESH = 30_000\n}\n\n/**\n * We need to mark this class as internal explicitly to exclude it in the public typings, because\n * it references AuthInternal which has a circular dependency with UserInternal.\n *\n * @internal\n */\nexport class StsTokenManager {\n  refreshToken: string | null = null;\n  accessToken: string | null = null;\n  expirationTime: number | null = null;\n\n  get isExpired(): boolean {\n    return (\n      !this.expirationTime ||\n      Date.now() > this.expirationTime - Buffer.TOKEN_REFRESH\n    );\n  }\n\n  updateFromServerResponse(\n    response: IdTokenResponse | FinalizeMfaResponse\n  ): void {\n    _assert(response.idToken, AuthErrorCode.INTERNAL_ERROR);\n    _assert(\n      typeof response.idToken !== 'undefined',\n      AuthErrorCode.INTERNAL_ERROR\n    );\n    _assert(\n      typeof response.refreshToken !== 'undefined',\n      AuthErrorCode.INTERNAL_ERROR\n    );\n    const expiresIn =\n      'expiresIn' in response && typeof response.expiresIn !== 'undefined'\n        ? Number(response.expiresIn)\n        : _tokenExpiresIn(response.idToken);\n    this.updateTokensAndExpiration(\n      response.idToken,\n      response.refreshToken,\n      expiresIn\n    );\n  }\n\n  updateFromIdToken(idToken: string): void {\n    _assert(idToken.length !== 0, AuthErrorCode.INTERNAL_ERROR);\n    const expiresIn = _tokenExpiresIn(idToken);\n    this.updateTokensAndExpiration(idToken, null, expiresIn);\n  }\n\n  async getToken(\n    auth: AuthInternal,\n    forceRefresh = false\n  ): Promise<string | null> {\n    if (!forceRefresh && this.accessToken && !this.isExpired) {\n      return this.accessToken;\n    }\n\n    _assert(this.refreshToken, auth, AuthErrorCode.TOKEN_EXPIRED);\n\n    if (this.refreshToken) {\n      await this.refresh(auth, this.refreshToken!);\n      return this.accessToken;\n    }\n\n    return null;\n  }\n\n  clearRefreshToken(): void {\n    this.refreshToken = null;\n  }\n\n  private async refresh(auth: AuthInternal, oldToken: string): Promise<void> {\n    const { accessToken, refreshToken, expiresIn } = await requestStsToken(\n      auth,\n      oldToken\n    );\n    this.updateTokensAndExpiration(\n      accessToken,\n      refreshToken,\n      Number(expiresIn)\n    );\n  }\n\n  private updateTokensAndExpiration(\n    accessToken: string,\n    refreshToken: string | null,\n    expiresInSec: number\n  ): void {\n    this.refreshToken = refreshToken || null;\n    this.accessToken = accessToken || null;\n    this.expirationTime = Date.now() + expiresInSec * 1000;\n  }\n\n  static fromJSON(appName: string, object: PersistedBlob): StsTokenManager {\n    const { refreshToken, accessToken, expirationTime } = object;\n\n    const manager = new StsTokenManager();\n    if (refreshToken) {\n      _assert(typeof refreshToken === 'string', AuthErrorCode.INTERNAL_ERROR, {\n        appName\n      });\n      manager.refreshToken = refreshToken;\n    }\n    if (accessToken) {\n      _assert(typeof accessToken === 'string', AuthErrorCode.INTERNAL_ERROR, {\n        appName\n      });\n      manager.accessToken = accessToken;\n    }\n    if (expirationTime) {\n      _assert(\n        typeof expirationTime === 'number',\n        AuthErrorCode.INTERNAL_ERROR,\n        {\n          appName\n        }\n      );\n      manager.expirationTime = expirationTime;\n    }\n    return manager;\n  }\n\n  toJSON(): object {\n    return {\n      refreshToken: this.refreshToken,\n      accessToken: this.accessToken,\n      expirationTime: this.expirationTime\n    };\n  }\n\n  _assign(stsTokenManager: StsTokenManager): void {\n    this.accessToken = stsTokenManager.accessToken;\n    this.refreshToken = stsTokenManager.refreshToken;\n    this.expirationTime = stsTokenManager.expirationTime;\n  }\n\n  _clone(): StsTokenManager {\n    return Object.assign(new StsTokenManager(), this.toJSON());\n  }\n\n  _performRefresh(): never {\n    return debugFail('not implemented');\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint-disable camelcase */\n\nimport { querystring } from '@firebase/util';\n\nimport {\n  _getFinalTarget,\n  _performFetchWithErrorHandling,\n  _performApiRequest,\n  _addTidIfNecessary,\n  HttpMethod,\n  HttpHeader,\n  Endpoint\n} from '../index';\nimport { FetchProvider } from '../../core/util/fetch_provider';\nimport { Auth } from '../../model/public_types';\nimport { AuthInternal } from '../../model/auth';\n\nexport const enum TokenType {\n  REFRESH_TOKEN = 'REFRESH_TOKEN',\n  ACCESS_TOKEN = 'ACCESS_TOKEN'\n}\n\n/** The server responses with snake_case; we convert to camelCase */\ninterface RequestStsTokenServerResponse {\n  access_token: string;\n  expires_in: string;\n  refresh_token: string;\n}\n\nexport interface RequestStsTokenResponse {\n  accessToken: string;\n  expiresIn: string;\n  refreshToken: string;\n}\n\nexport interface RevokeTokenRequest {\n  providerId: string;\n  tokenType: TokenType;\n  token: string;\n  idToken: string;\n  tenantId?: string;\n}\n\nexport interface RevokeTokenResponse {}\n\nexport async function requestStsToken(\n  auth: Auth,\n  refreshToken: string\n): Promise<RequestStsTokenResponse> {\n  const response =\n    await _performFetchWithErrorHandling<RequestStsTokenServerResponse>(\n      auth,\n      {},\n      async () => {\n        const body = querystring({\n          'grant_type': 'refresh_token',\n          'refresh_token': refreshToken\n        }).slice(1);\n        const { tokenApiHost, apiKey } = auth.config;\n        const url = _getFinalTarget(\n          auth,\n          tokenApiHost,\n          Endpoint.TOKEN,\n          `key=${apiKey}`\n        );\n\n        const headers = await (auth as AuthInternal)._getAdditionalHeaders();\n        headers[HttpHeader.CONTENT_TYPE] = 'application/x-www-form-urlencoded';\n\n        return FetchProvider.fetch()(url, {\n          method: HttpMethod.POST,\n          headers,\n          body\n        });\n      }\n    );\n\n  // The response comes back in snake_case. Convert to camel:\n  return {\n    accessToken: response.access_token,\n    expiresIn: response.expires_in,\n    refreshToken: response.refresh_token\n  };\n}\n\nexport async function revokeToken(\n  auth: Auth,\n  request: RevokeTokenRequest\n): Promise<RevokeTokenResponse> {\n  return _performApiRequest<RevokeTokenRequest, RevokeTokenResponse>(\n    auth,\n    HttpMethod.POST,\n    Endpoint.REVOKE_TOKEN,\n    _addTidIfNecessary(auth, request)\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IdTokenResult, UserInfo } from '../../model/public_types';\nimport { NextFn } from '@firebase/util';\nimport {\n  APIUserInfo,\n  GetAccountInfoResponse,\n  deleteAccount\n} from '../../api/account_management/account';\nimport { FinalizeMfaResponse } from '../../api/authentication/mfa';\nimport { AuthInternal } from '../../model/auth';\nimport { IdTokenResponse } from '../../model/id_token';\nimport {\n  MutableUserInfo,\n  UserInternal,\n  UserParameters\n} from '../../model/user';\nimport { AuthErrorCode } from '../errors';\nimport { PersistedBlob } from '../persistence';\nimport {\n  _assert,\n  _serverAppCurrentUserOperationNotSupportedError\n} from '../util/assert';\nimport { getIdTokenResult } from './id_token_result';\nimport { _logoutIfInvalidated } from './invalidation';\nimport { ProactiveRefresh } from './proactive_refresh';\nimport { extractProviderData, _reloadWithoutSaving, reload } from './reload';\nimport { StsTokenManager } from './token_manager';\nimport { UserMetadata } from './user_metadata';\nimport { ProviderId } from '../../model/enums';\nimport { _isFirebaseServerApp } from '@firebase/app';\n\nfunction assertStringOrUndefined(\n  assertion: unknown,\n  appName: string\n): asserts assertion is string | undefined {\n  _assert(\n    typeof assertion === 'string' || typeof assertion === 'undefined',\n    AuthErrorCode.INTERNAL_ERROR,\n    { appName }\n  );\n}\n\nexport class UserImpl implements UserInternal {\n  // For the user object, provider is always Firebase.\n  readonly providerId = ProviderId.FIREBASE;\n  stsTokenManager: StsTokenManager;\n  // Last known accessToken so we know when it changes\n  private accessToken: string | null;\n\n  uid: string;\n  auth: AuthInternal;\n  emailVerified: boolean;\n  isAnonymous: boolean;\n  tenantId: string | null;\n  readonly metadata: UserMetadata;\n  providerData: MutableUserInfo[];\n\n  // Optional fields from UserInfo\n  displayName: string | null;\n  email: string | null;\n  phoneNumber: string | null;\n  photoURL: string | null;\n\n  _redirectEventId?: string;\n  private readonly proactiveRefresh = new ProactiveRefresh(this);\n\n  constructor({ uid, auth, stsTokenManager, ...opt }: UserParameters) {\n    this.uid = uid;\n    this.auth = auth;\n    this.stsTokenManager = stsTokenManager;\n    this.accessToken = stsTokenManager.accessToken;\n    this.displayName = opt.displayName || null;\n    this.email = opt.email || null;\n    this.emailVerified = opt.emailVerified || false;\n    this.phoneNumber = opt.phoneNumber || null;\n    this.photoURL = opt.photoURL || null;\n    this.isAnonymous = opt.isAnonymous || false;\n    this.tenantId = opt.tenantId || null;\n    this.providerData = opt.providerData ? [...opt.providerData] : [];\n    this.metadata = new UserMetadata(\n      opt.createdAt || undefined,\n      opt.lastLoginAt || undefined\n    );\n  }\n\n  async getIdToken(forceRefresh?: boolean): Promise<string> {\n    const accessToken = await _logoutIfInvalidated(\n      this,\n      this.stsTokenManager.getToken(this.auth, forceRefresh)\n    );\n    _assert(accessToken, this.auth, AuthErrorCode.INTERNAL_ERROR);\n\n    if (this.accessToken !== accessToken) {\n      this.accessToken = accessToken;\n      await this.auth._persistUserIfCurrent(this);\n      this.auth._notifyListenersIfCurrent(this);\n    }\n\n    return accessToken;\n  }\n\n  getIdTokenResult(forceRefresh?: boolean): Promise<IdTokenResult> {\n    return getIdTokenResult(this, forceRefresh);\n  }\n\n  reload(): Promise<void> {\n    return reload(this);\n  }\n\n  private reloadUserInfo: APIUserInfo | null = null;\n  private reloadListener: NextFn<APIUserInfo> | null = null;\n\n  _assign(user: UserInternal): void {\n    if (this === user) {\n      return;\n    }\n    _assert(this.uid === user.uid, this.auth, AuthErrorCode.INTERNAL_ERROR);\n    this.displayName = user.displayName;\n    this.photoURL = user.photoURL;\n    this.email = user.email;\n    this.emailVerified = user.emailVerified;\n    this.phoneNumber = user.phoneNumber;\n    this.isAnonymous = user.isAnonymous;\n    this.tenantId = user.tenantId;\n    this.providerData = user.providerData.map(userInfo => ({ ...userInfo }));\n    this.metadata._copy(user.metadata);\n    this.stsTokenManager._assign(user.stsTokenManager);\n  }\n\n  _clone(auth: AuthInternal): UserInternal {\n    const newUser = new UserImpl({\n      ...this,\n      auth,\n      stsTokenManager: this.stsTokenManager._clone()\n    });\n    newUser.metadata._copy(this.metadata);\n    return newUser;\n  }\n\n  _onReload(callback: NextFn<APIUserInfo>): void {\n    // There should only ever be one listener, and that is a single instance of MultiFactorUser\n    _assert(!this.reloadListener, this.auth, AuthErrorCode.INTERNAL_ERROR);\n    this.reloadListener = callback;\n    if (this.reloadUserInfo) {\n      this._notifyReloadListener(this.reloadUserInfo);\n      this.reloadUserInfo = null;\n    }\n  }\n\n  _notifyReloadListener(userInfo: APIUserInfo): void {\n    if (this.reloadListener) {\n      this.reloadListener(userInfo);\n    } else {\n      // If no listener is subscribed yet, save the result so it's available when they do subscribe\n      this.reloadUserInfo = userInfo;\n    }\n  }\n\n  _startProactiveRefresh(): void {\n    this.proactiveRefresh._start();\n  }\n\n  _stopProactiveRefresh(): void {\n    this.proactiveRefresh._stop();\n  }\n\n  async _updateTokensIfNecessary(\n    response: IdTokenResponse | FinalizeMfaResponse,\n    reload = false\n  ): Promise<void> {\n    let tokensRefreshed = false;\n    if (\n      response.idToken &&\n      response.idToken !== this.stsTokenManager.accessToken\n    ) {\n      this.stsTokenManager.updateFromServerResponse(response);\n      tokensRefreshed = true;\n    }\n\n    if (reload) {\n      await _reloadWithoutSaving(this);\n    }\n\n    await this.auth._persistUserIfCurrent(this);\n    if (tokensRefreshed) {\n      this.auth._notifyListenersIfCurrent(this);\n    }\n  }\n\n  async delete(): Promise<void> {\n    if (_isFirebaseServerApp(this.auth.app)) {\n      return Promise.reject(\n        _serverAppCurrentUserOperationNotSupportedError(this.auth)\n      );\n    }\n    const idToken = await this.getIdToken();\n    await _logoutIfInvalidated(this, deleteAccount(this.auth, { idToken }));\n    this.stsTokenManager.clearRefreshToken();\n\n    // TODO: Determine if cancellable-promises are necessary to use in this class so that delete()\n    //       cancels pending actions...\n\n    return this.auth.signOut();\n  }\n\n  toJSON(): PersistedBlob {\n    return {\n      uid: this.uid,\n      email: this.email || undefined,\n      emailVerified: this.emailVerified,\n      displayName: this.displayName || undefined,\n      isAnonymous: this.isAnonymous,\n      photoURL: this.photoURL || undefined,\n      phoneNumber: this.phoneNumber || undefined,\n      tenantId: this.tenantId || undefined,\n      providerData: this.providerData.map(userInfo => ({ ...userInfo })),\n      stsTokenManager: this.stsTokenManager.toJSON(),\n      // Redirect event ID must be maintained in case there is a pending\n      // redirect event.\n      _redirectEventId: this._redirectEventId,\n      ...this.metadata.toJSON(),\n\n      // Required for compatibility with the legacy SDK (go/firebase-auth-sdk-persistence-parsing):\n      apiKey: this.auth.config.apiKey,\n      appName: this.auth.name\n      // Missing authDomain will be tolerated by the legacy SDK.\n      // stsTokenManager.apiKey isn't actually required (despite the legacy SDK persisting it).\n    };\n  }\n\n  get refreshToken(): string {\n    return this.stsTokenManager.refreshToken || '';\n  }\n\n  static _fromJSON(auth: AuthInternal, object: PersistedBlob): UserInternal {\n    const displayName = object.displayName ?? undefined;\n    const email = object.email ?? undefined;\n    const phoneNumber = object.phoneNumber ?? undefined;\n    const photoURL = object.photoURL ?? undefined;\n    const tenantId = object.tenantId ?? undefined;\n    const _redirectEventId = object._redirectEventId ?? undefined;\n    const createdAt = object.createdAt ?? undefined;\n    const lastLoginAt = object.lastLoginAt ?? undefined;\n    const {\n      uid,\n      emailVerified,\n      isAnonymous,\n      providerData,\n      stsTokenManager: plainObjectTokenManager\n    } = object;\n\n    _assert(uid && plainObjectTokenManager, auth, AuthErrorCode.INTERNAL_ERROR);\n\n    const stsTokenManager = StsTokenManager.fromJSON(\n      this.name,\n      plainObjectTokenManager as PersistedBlob\n    );\n\n    _assert(typeof uid === 'string', auth, AuthErrorCode.INTERNAL_ERROR);\n    assertStringOrUndefined(displayName, auth.name);\n    assertStringOrUndefined(email, auth.name);\n    _assert(\n      typeof emailVerified === 'boolean',\n      auth,\n      AuthErrorCode.INTERNAL_ERROR\n    );\n    _assert(\n      typeof isAnonymous === 'boolean',\n      auth,\n      AuthErrorCode.INTERNAL_ERROR\n    );\n    assertStringOrUndefined(phoneNumber, auth.name);\n    assertStringOrUndefined(photoURL, auth.name);\n    assertStringOrUndefined(tenantId, auth.name);\n    assertStringOrUndefined(_redirectEventId, auth.name);\n    assertStringOrUndefined(createdAt, auth.name);\n    assertStringOrUndefined(lastLoginAt, auth.name);\n    const user = new UserImpl({\n      uid,\n      auth,\n      email,\n      emailVerified,\n      displayName,\n      isAnonymous,\n      photoURL,\n      phoneNumber,\n      tenantId,\n      stsTokenManager,\n      createdAt,\n      lastLoginAt\n    });\n\n    if (providerData && Array.isArray(providerData)) {\n      user.providerData = providerData.map(userInfo => ({ ...userInfo }));\n    }\n\n    if (_redirectEventId) {\n      user._redirectEventId = _redirectEventId;\n    }\n\n    return user;\n  }\n\n  /**\n   * Initialize a User from an idToken server response\n   * @param auth\n   * @param idTokenResponse\n   */\n  static async _fromIdTokenResponse(\n    auth: AuthInternal,\n    idTokenResponse: IdTokenResponse,\n    isAnonymous: boolean = false\n  ): Promise<UserInternal> {\n    const stsTokenManager = new StsTokenManager();\n    stsTokenManager.updateFromServerResponse(idTokenResponse);\n\n    // Initialize the Firebase Auth user.\n    const user = new UserImpl({\n      uid: idTokenResponse.localId,\n      auth,\n      stsTokenManager,\n      isAnonymous\n    });\n\n    // Updates the user info and data and resolves with a user instance.\n    await _reloadWithoutSaving(user);\n    return user;\n  }\n\n  /**\n   * Initialize a User from an idToken server response\n   * @param auth\n   * @param idTokenResponse\n   */\n  static async _fromGetAccountInfoResponse(\n    auth: AuthInternal,\n    response: GetAccountInfoResponse,\n    idToken: string\n  ): Promise<UserInternal> {\n    const coreAccount = response.users[0];\n    _assert(coreAccount.localId !== undefined, AuthErrorCode.INTERNAL_ERROR);\n\n    const providerData: UserInfo[] =\n      coreAccount.providerUserInfo !== undefined\n        ? extractProviderData(coreAccount.providerUserInfo)\n        : [];\n\n    const isAnonymous =\n      !(coreAccount.email && coreAccount.passwordHash) && !providerData?.length;\n\n    const stsTokenManager = new StsTokenManager();\n    stsTokenManager.updateFromIdToken(idToken);\n\n    // Initialize the Firebase Auth user.\n    const user = new UserImpl({\n      uid: coreAccount.localId,\n      auth,\n      stsTokenManager,\n      isAnonymous\n    });\n\n    // update the user with data from the GetAccountInfo response.\n    const updates: Partial<UserInternal> = {\n      uid: coreAccount.localId,\n      displayName: coreAccount.displayName || null,\n      photoURL: coreAccount.photoUrl || null,\n      email: coreAccount.email || null,\n      emailVerified: coreAccount.emailVerified || false,\n      phoneNumber: coreAccount.phoneNumber || null,\n      tenantId: coreAccount.tenantId || null,\n      providerData,\n      metadata: new UserMetadata(\n        coreAccount.createdAt,\n        coreAccount.lastLoginAt\n      ),\n      isAnonymous:\n        !(coreAccount.email && coreAccount.passwordHash) &&\n        !providerData?.length\n    };\n\n    Object.assign(user, updates);\n    return user;\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { debugAssert } from './assert';\n\n/**\n * Our API has a lot of one-off constants that are used to do things.\n * Unfortunately we can't export these as classes instantiated directly since\n * the constructor may side effect and therefore can't be proven to be safely\n * culled. Instead, we export these classes themselves as a lowerCamelCase\n * constant, and instantiate them under the hood.\n */\nexport interface SingletonInstantiator<T> {\n  new (): T;\n}\n\nconst instanceCache: Map<unknown, unknown> = new Map();\n\nexport function _getInstance<T>(cls: unknown): T {\n  debugAssert(cls instanceof Function, 'Expected a class definition');\n  let instance = instanceCache.get(cls) as T | undefined;\n\n  if (instance) {\n    debugAssert(\n      instance instanceof cls,\n      'Instance stored in cache mismatched with class'\n    );\n    return instance;\n  }\n\n  instance = new (cls as SingletonInstantiator<T>)();\n  instanceCache.set(cls, instance);\n  return instance;\n}\n\nexport function _clearInstanceMap(): void {\n  instanceCache.clear();\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Persistence } from '../../model/public_types';\n\nimport {\n  PersistenceInternal,\n  PersistenceType,\n  PersistenceValue,\n  StorageEventListener\n} from '../persistence';\n\nexport class InMemoryPersistence implements PersistenceInternal {\n  static type: 'NONE' = 'NONE';\n  readonly type = PersistenceType.NONE;\n  storage: Record<string, PersistenceValue> = {};\n\n  async _isAvailable(): Promise<boolean> {\n    return true;\n  }\n\n  async _set(key: string, value: PersistenceValue): Promise<void> {\n    this.storage[key] = value;\n  }\n\n  async _get<T extends PersistenceValue>(key: string): Promise<T | null> {\n    const value = this.storage[key];\n    return value === undefined ? null : (value as T);\n  }\n\n  async _remove(key: string): Promise<void> {\n    delete this.storage[key];\n  }\n\n  _addListener(_key: string, _listener: StorageEventListener): void {\n    // Listeners are not supported for in-memory storage since it cannot be shared across windows/workers\n    return;\n  }\n\n  _removeListener(_key: string, _listener: StorageEventListener): void {\n    // Listeners are not supported for in-memory storage since it cannot be shared across windows/workers\n    return;\n  }\n}\n\n/**\n * An implementation of {@link Persistence} of type 'NONE'.\n *\n * @public\n */\nexport const inMemoryPersistence: Persistence = InMemoryPersistence;\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ApiKey, AppName, AuthInternal } from '../../model/auth';\nimport { UserInternal } from '../../model/user';\nimport { PersistedBlob, PersistenceInternal } from '../persistence';\nimport { UserImpl } from '../user/user_impl';\nimport { _getInstance } from '../util/instantiator';\nimport { inMemoryPersistence } from './in_memory';\n\nexport const enum KeyName {\n  AUTH_USER = 'authUser',\n  AUTH_EVENT = 'authEvent',\n  REDIRECT_USER = 'redirectUser',\n  PERSISTENCE_USER = 'persistence'\n}\nexport const enum Namespace {\n  PERSISTENCE = 'firebase'\n}\n\nexport function _persistenceKeyName(\n  key: string,\n  apiKey: ApiKey,\n  appName: AppName\n): string {\n  return `${Namespace.PERSISTENCE}:${key}:${apiKey}:${appName}`;\n}\n\nexport class PersistenceUserManager {\n  private readonly fullUserKey: string;\n  private readonly fullPersistenceKey: string;\n  private readonly boundEventHandler: () => void;\n\n  private constructor(\n    public persistence: PersistenceInternal,\n    private readonly auth: AuthInternal,\n    private readonly userKey: string\n  ) {\n    const { config, name } = this.auth;\n    this.fullUserKey = _persistenceKeyName(this.userKey, config.apiKey, name);\n    this.fullPersistenceKey = _persistenceKeyName(\n      KeyName.PERSISTENCE_USER,\n      config.apiKey,\n      name\n    );\n    this.boundEventHandler = auth._onStorageEvent.bind(auth);\n    this.persistence._addListener(this.fullUserKey, this.boundEventHandler);\n  }\n\n  setCurrentUser(user: UserInternal): Promise<void> {\n    return this.persistence._set(this.fullUserKey, user.toJSON());\n  }\n\n  async getCurrentUser(): Promise<UserInternal | null> {\n    const blob = await this.persistence._get<PersistedBlob>(this.fullUserKey);\n    return blob ? UserImpl._fromJSON(this.auth, blob) : null;\n  }\n\n  removeCurrentUser(): Promise<void> {\n    return this.persistence._remove(this.fullUserKey);\n  }\n\n  savePersistenceForRedirect(): Promise<void> {\n    return this.persistence._set(\n      this.fullPersistenceKey,\n      this.persistence.type\n    );\n  }\n\n  async setPersistence(newPersistence: PersistenceInternal): Promise<void> {\n    if (this.persistence === newPersistence) {\n      return;\n    }\n\n    const currentUser = await this.getCurrentUser();\n    await this.removeCurrentUser();\n\n    this.persistence = newPersistence;\n\n    if (currentUser) {\n      return this.setCurrentUser(currentUser);\n    }\n  }\n\n  delete(): void {\n    this.persistence._removeListener(this.fullUserKey, this.boundEventHandler);\n  }\n\n  static async create(\n    auth: AuthInternal,\n    persistenceHierarchy: PersistenceInternal[],\n    userKey = KeyName.AUTH_USER\n  ): Promise<PersistenceUserManager> {\n    if (!persistenceHierarchy.length) {\n      return new PersistenceUserManager(\n        _getInstance(inMemoryPersistence),\n        auth,\n        userKey\n      );\n    }\n\n    // Eliminate any persistences that are not available\n    const availablePersistences = (\n      await Promise.all(\n        persistenceHierarchy.map(async persistence => {\n          if (await persistence._isAvailable()) {\n            return persistence;\n          }\n          return undefined;\n        })\n      )\n    ).filter(persistence => persistence) as PersistenceInternal[];\n\n    // Fall back to the first persistence listed, or in memory if none available\n    let selectedPersistence =\n      availablePersistences[0] ||\n      _getInstance<PersistenceInternal>(inMemoryPersistence);\n\n    const key = _persistenceKeyName(userKey, auth.config.apiKey, auth.name);\n\n    // Pull out the existing user, setting the chosen persistence to that\n    // persistence if the user exists.\n    let userToMigrate: UserInternal | null = null;\n    // Note, here we check for a user in _all_ persistences, not just the\n    // ones deemed available. If we can migrate a user out of a broken\n    // persistence, we will (but only if that persistence supports migration).\n    for (const persistence of persistenceHierarchy) {\n      try {\n        const blob = await persistence._get<PersistedBlob>(key);\n        if (blob) {\n          const user = UserImpl._fromJSON(auth, blob); // throws for unparsable blob (wrong format)\n          if (persistence !== selectedPersistence) {\n            userToMigrate = user;\n          }\n          selectedPersistence = persistence;\n          break;\n        }\n      } catch {}\n    }\n\n    // If we find the user in a persistence that does support migration, use\n    // that migration path (of only persistences that support migration)\n    const migrationHierarchy = availablePersistences.filter(\n      p => p._shouldAllowMigration\n    );\n\n    // If the persistence does _not_ allow migration, just finish off here\n    if (\n      !selectedPersistence._shouldAllowMigration ||\n      !migrationHierarchy.length\n    ) {\n      return new PersistenceUserManager(selectedPersistence, auth, userKey);\n    }\n\n    selectedPersistence = migrationHierarchy[0];\n    if (userToMigrate) {\n      // This normally shouldn't throw since chosenPersistence.isAvailable() is true, but if it does\n      // we'll just let it bubble to surface the error.\n      await selectedPersistence._set(key, userToMigrate.toJSON());\n    }\n\n    // Attempt to clear the key in other persistences but ignore errors. This helps prevent issues\n    // such as users getting stuck with a previous account after signing out and refreshing the tab.\n    await Promise.all(\n      persistenceHierarchy.map(async persistence => {\n        if (persistence !== selectedPersistence) {\n          try {\n            await persistence._remove(key);\n          } catch {}\n        }\n      })\n    );\n    return new PersistenceUserManager(selectedPersistence, auth, userKey);\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isIE, getUA } from '@firebase/util';\n\ninterface NavigatorStandalone extends Navigator {\n  standalone?: unknown;\n}\n\ninterface Document {\n  documentMode?: number;\n}\n\n/**\n * Enums for Browser name.\n */\nexport const enum BrowserName {\n  ANDROID = 'Android',\n  BLACKBERRY = 'Blackberry',\n  EDGE = 'Edge',\n  FIREFOX = 'Firefox',\n  IE = 'IE',\n  IEMOBILE = 'IEMobile',\n  OPERA = 'Opera',\n  OTHER = 'Other',\n  CHROME = 'Chrome',\n  SAFARI = 'Safari',\n  SILK = 'Silk',\n  WEBOS = 'Webos'\n}\n\n/**\n * Determine the browser for the purposes of reporting usage to the API\n */\nexport function _getBrowserName(userAgent: string): BrowserName | string {\n  const ua = userAgent.toLowerCase();\n  if (ua.includes('opera/') || ua.includes('opr/') || ua.includes('opios/')) {\n    return BrowserName.OPERA;\n  } else if (_isIEMobile(ua)) {\n    // Windows phone IEMobile browser.\n    return BrowserName.IEMOBILE;\n  } else if (ua.includes('msie') || ua.includes('trident/')) {\n    return BrowserName.IE;\n  } else if (ua.includes('edge/')) {\n    return BrowserName.EDGE;\n  } else if (_isFirefox(ua)) {\n    return BrowserName.FIREFOX;\n  } else if (ua.includes('silk/')) {\n    return BrowserName.SILK;\n  } else if (_isBlackBerry(ua)) {\n    // Blackberry browser.\n    return BrowserName.BLACKBERRY;\n  } else if (_isWebOS(ua)) {\n    // WebOS default browser.\n    return BrowserName.WEBOS;\n  } else if (_isSafari(ua)) {\n    return BrowserName.SAFARI;\n  } else if (\n    (ua.includes('chrome/') || _isChromeIOS(ua)) &&\n    !ua.includes('edge/')\n  ) {\n    return BrowserName.CHROME;\n  } else if (_isAndroid(ua)) {\n    // Android stock browser.\n    return BrowserName.ANDROID;\n  } else {\n    // Most modern browsers have name/version at end of user agent string.\n    const re = /([a-zA-Z\\d\\.]+)\\/[a-zA-Z\\d\\.]*$/;\n    const matches = userAgent.match(re);\n    if (matches?.length === 2) {\n      return matches[1];\n    }\n  }\n  return BrowserName.OTHER;\n}\n\nexport function _isFirefox(ua = getUA()): boolean {\n  return /firefox\\//i.test(ua);\n}\n\nexport function _isSafari(userAgent = getUA()): boolean {\n  const ua = userAgent.toLowerCase();\n  return (\n    ua.includes('safari/') &&\n    !ua.includes('chrome/') &&\n    !ua.includes('crios/') &&\n    !ua.includes('android')\n  );\n}\n\nexport function _isChromeIOS(ua = getUA()): boolean {\n  return /crios\\//i.test(ua);\n}\n\nexport function _isIEMobile(ua = getUA()): boolean {\n  return /iemobile/i.test(ua);\n}\n\nexport function _isAndroid(ua = getUA()): boolean {\n  return /android/i.test(ua);\n}\n\nexport function _isBlackBerry(ua = getUA()): boolean {\n  return /blackberry/i.test(ua);\n}\n\nexport function _isWebOS(ua = getUA()): boolean {\n  return /webos/i.test(ua);\n}\n\nexport function _isIOS(ua = getUA()): boolean {\n  return (\n    /iphone|ipad|ipod/i.test(ua) ||\n    (/macintosh/i.test(ua) && /mobile/i.test(ua))\n  );\n}\n\nexport function _isIOS7Or8(ua = getUA()): boolean {\n  return (\n    /(iPad|iPhone|iPod).*OS 7_\\d/i.test(ua) ||\n    /(iPad|iPhone|iPod).*OS 8_\\d/i.test(ua)\n  );\n}\n\nexport function _isIOSStandalone(ua = getUA()): boolean {\n  return _isIOS(ua) && !!(window.navigator as NavigatorStandalone)?.standalone;\n}\n\nexport function _isIE10(): boolean {\n  return isIE() && (document as Document).documentMode === 10;\n}\n\nexport function _isMobileBrowser(ua: string = getUA()): boolean {\n  // TODO: implement getBrowserName equivalent for OS.\n  return (\n    _isIOS(ua) ||\n    _isAndroid(ua) ||\n    _isWebOS(ua) ||\n    _isBlackBerry(ua) ||\n    /windows phone/i.test(ua) ||\n    _isIEMobile(ua)\n  );\n}\n\nexport function _isIframe(): boolean {\n  try {\n    // Check that the current window is not the top window.\n    // If so, return true.\n    return !!(window && window !== window.top);\n  } catch (e) {\n    return false;\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SDK_VERSION } from '@firebase/app';\nimport { _getBrowserName } from './browser';\nimport { getUA } from '@firebase/util';\n\nexport const enum ClientImplementation {\n  CORE = 'JsCore'\n}\n\n/**\n * @internal\n */\nexport const enum ClientPlatform {\n  BROWSER = 'Browser',\n  NODE = 'Node',\n  REACT_NATIVE = 'ReactNative',\n  CORDOVA = 'Cordova',\n  WORKER = 'Worker',\n  WEB_EXTENSION = 'WebExtension'\n}\n\n/*\n * Determine the SDK version string\n */\nexport function _getClientVersion(\n  clientPlatform: ClientPlatform,\n  frameworks: readonly string[] = []\n): string {\n  let reportedPlatform: string;\n  switch (clientPlatform) {\n    case ClientPlatform.BROWSER:\n      // In a browser environment, report the browser name.\n      reportedPlatform = _getBrowserName(getUA());\n      break;\n    case ClientPlatform.WORKER:\n      // Technically a worker runs from a browser but we need to differentiate a\n      // worker from a browser.\n      // For example: Chrome-Worker/JsCore/4.9.1/FirebaseCore-web.\n      reportedPlatform = `${_getBrowserName(getUA())}-${clientPlatform}`;\n      break;\n    default:\n      reportedPlatform = clientPlatform;\n  }\n  const reportedFrameworks = frameworks.length\n    ? frameworks.join(',')\n    : 'FirebaseCore-web'; /* default value if no other framework is used */\n  return `${reportedPlatform}/${ClientImplementation.CORE}/${SDK_VERSION}/${reportedFrameworks}`;\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AuthInternal } from '../../model/auth';\nimport { Unsubscribe, User } from '../../model/public_types';\nimport { AuthErrorCode } from '../errors';\n\ninterface MiddlewareEntry {\n  (user: User | null): Promise<void>;\n  onAbort?: () => void;\n}\n\nexport class AuthMiddlewareQueue {\n  private readonly queue: MiddlewareEntry[] = [];\n\n  constructor(private readonly auth: AuthInternal) {}\n\n  pushCallback(\n    callback: (user: User | null) => void | Promise<void>,\n    onAbort?: () => void\n  ): Unsubscribe {\n    // The callback could be sync or async. Wrap it into a\n    // function that is always async.\n    const wrappedCallback: MiddlewareEntry = (\n      user: User | null\n    ): Promise<void> =>\n      new Promise((resolve, reject) => {\n        try {\n          const result = callback(user);\n          // Either resolve with existing promise or wrap a non-promise\n          // return value into a promise.\n          resolve(result);\n        } catch (e) {\n          // Sync callback throws.\n          reject(e);\n        }\n      });\n    // Attach the onAbort if present\n    wrappedCallback.onAbort = onAbort;\n    this.queue.push(wrappedCallback);\n\n    const index = this.queue.length - 1;\n    return () => {\n      // Unsubscribe. Replace with no-op. Do not remove from array, or it will disturb\n      // indexing of other elements.\n      this.queue[index] = () => Promise.resolve();\n    };\n  }\n\n  async runMiddleware(nextUser: User | null): Promise<void> {\n    if (this.auth.currentUser === nextUser) {\n      return;\n    }\n\n    // While running the middleware, build a temporary stack of onAbort\n    // callbacks to call if one middleware callback rejects.\n\n    const onAbortStack: Array<() => void> = [];\n    try {\n      for (const beforeStateCallback of this.queue) {\n        await beforeStateCallback(nextUser);\n\n        // Only push the onAbort if the callback succeeds\n        if (beforeStateCallback.onAbort) {\n          onAbortStack.push(beforeStateCallback.onAbort);\n        }\n      }\n    } catch (e) {\n      // Run all onAbort, with separate try/catch to ignore any errors and\n      // continue\n      onAbortStack.reverse();\n      for (const onAbort of onAbortStack) {\n        try {\n          onAbort();\n        } catch (_) {\n          /* swallow error */\n        }\n      }\n\n      throw this.auth._errorFactory.create(AuthErrorCode.LOGIN_BLOCKED, {\n        originalMessage: (e as Error)?.message\n      });\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { GetPasswordPolicyResponse } from '../../api/password_policy/get_password_policy';\nimport {\n  PasswordPolicyCustomStrengthOptions,\n  PasswordPolicyInternal,\n  PasswordValidationStatusInternal\n} from '../../model/password_policy';\nimport { PasswordValidationStatus } from '../../model/public_types';\n\n// Minimum min password length enforced by the backend, even if no minimum length is set.\nconst MINIMUM_MIN_PASSWORD_LENGTH = 6;\n\n/**\n * Stores password policy requirements and provides password validation against the policy.\n *\n * @internal\n */\nexport class PasswordPolicyImpl implements PasswordPolicyInternal {\n  readonly customStrengthOptions: PasswordPolicyCustomStrengthOptions;\n  readonly allowedNonAlphanumericCharacters: string;\n  readonly enforcementState: string;\n  readonly forceUpgradeOnSignin: boolean;\n  readonly schemaVersion: number;\n\n  constructor(response: GetPasswordPolicyResponse) {\n    // Only include custom strength options defined in the response.\n    const responseOptions = response.customStrengthOptions;\n    this.customStrengthOptions = {};\n    // TODO: Remove once the backend is updated to include the minimum min password length instead of undefined when there is no minimum length set.\n    this.customStrengthOptions.minPasswordLength =\n      responseOptions.minPasswordLength ?? MINIMUM_MIN_PASSWORD_LENGTH;\n    if (responseOptions.maxPasswordLength) {\n      this.customStrengthOptions.maxPasswordLength =\n        responseOptions.maxPasswordLength;\n    }\n    if (responseOptions.containsLowercaseCharacter !== undefined) {\n      this.customStrengthOptions.containsLowercaseLetter =\n        responseOptions.containsLowercaseCharacter;\n    }\n    if (responseOptions.containsUppercaseCharacter !== undefined) {\n      this.customStrengthOptions.containsUppercaseLetter =\n        responseOptions.containsUppercaseCharacter;\n    }\n    if (responseOptions.containsNumericCharacter !== undefined) {\n      this.customStrengthOptions.containsNumericCharacter =\n        responseOptions.containsNumericCharacter;\n    }\n    if (responseOptions.containsNonAlphanumericCharacter !== undefined) {\n      this.customStrengthOptions.containsNonAlphanumericCharacter =\n        responseOptions.containsNonAlphanumericCharacter;\n    }\n\n    this.enforcementState = response.enforcementState;\n    if (this.enforcementState === 'ENFORCEMENT_STATE_UNSPECIFIED') {\n      this.enforcementState = 'OFF';\n    }\n\n    // Use an empty string if no non-alphanumeric characters are specified in the response.\n    this.allowedNonAlphanumericCharacters =\n      response.allowedNonAlphanumericCharacters?.join('') ?? '';\n\n    this.forceUpgradeOnSignin = response.forceUpgradeOnSignin ?? false;\n    this.schemaVersion = response.schemaVersion;\n  }\n\n  validatePassword(password: string): PasswordValidationStatus {\n    const status: PasswordValidationStatusInternal = {\n      isValid: true,\n      passwordPolicy: this\n    };\n\n    // Check the password length and character options.\n    this.validatePasswordLengthOptions(password, status);\n    this.validatePasswordCharacterOptions(password, status);\n\n    // Combine the status into single isValid property.\n    status.isValid &&= status.meetsMinPasswordLength ?? true;\n    status.isValid &&= status.meetsMaxPasswordLength ?? true;\n    status.isValid &&= status.containsLowercaseLetter ?? true;\n    status.isValid &&= status.containsUppercaseLetter ?? true;\n    status.isValid &&= status.containsNumericCharacter ?? true;\n    status.isValid &&= status.containsNonAlphanumericCharacter ?? true;\n\n    return status;\n  }\n\n  /**\n   * Validates that the password meets the length options for the policy.\n   *\n   * @param password Password to validate.\n   * @param status Validation status.\n   */\n  private validatePasswordLengthOptions(\n    password: string,\n    status: PasswordValidationStatusInternal\n  ): void {\n    const minPasswordLength = this.customStrengthOptions.minPasswordLength;\n    const maxPasswordLength = this.customStrengthOptions.maxPasswordLength;\n    if (minPasswordLength) {\n      status.meetsMinPasswordLength = password.length >= minPasswordLength;\n    }\n    if (maxPasswordLength) {\n      status.meetsMaxPasswordLength = password.length <= maxPasswordLength;\n    }\n  }\n\n  /**\n   * Validates that the password meets the character options for the policy.\n   *\n   * @param password Password to validate.\n   * @param status Validation status.\n   */\n  private validatePasswordCharacterOptions(\n    password: string,\n    status: PasswordValidationStatusInternal\n  ): void {\n    // Assign statuses for requirements even if the password is an empty string.\n    this.updatePasswordCharacterOptionsStatuses(\n      status,\n      /* containsLowercaseCharacter= */ false,\n      /* containsUppercaseCharacter= */ false,\n      /* containsNumericCharacter= */ false,\n      /* containsNonAlphanumericCharacter= */ false\n    );\n\n    let passwordChar;\n    for (let i = 0; i < password.length; i++) {\n      passwordChar = password.charAt(i);\n      this.updatePasswordCharacterOptionsStatuses(\n        status,\n        /* containsLowercaseCharacter= */ passwordChar >= 'a' &&\n          passwordChar <= 'z',\n        /* containsUppercaseCharacter= */ passwordChar >= 'A' &&\n          passwordChar <= 'Z',\n        /* containsNumericCharacter= */ passwordChar >= '0' &&\n          passwordChar <= '9',\n        /* containsNonAlphanumericCharacter= */ this.allowedNonAlphanumericCharacters.includes(\n          passwordChar\n        )\n      );\n    }\n  }\n\n  /**\n   * Updates the running validation status with the statuses for the character options.\n   * Expected to be called each time a character is processed to update each option status\n   * based on the current character.\n   *\n   * @param status Validation status.\n   * @param containsLowercaseCharacter Whether the character is a lowercase letter.\n   * @param containsUppercaseCharacter Whether the character is an uppercase letter.\n   * @param containsNumericCharacter Whether the character is a numeric character.\n   * @param containsNonAlphanumericCharacter Whether the character is a non-alphanumeric character.\n   */\n  private updatePasswordCharacterOptionsStatuses(\n    status: PasswordValidationStatusInternal,\n    containsLowercaseCharacter: boolean,\n    containsUppercaseCharacter: boolean,\n    containsNumericCharacter: boolean,\n    containsNonAlphanumericCharacter: boolean\n  ): void {\n    if (this.customStrengthOptions.containsLowercaseLetter) {\n      status.containsLowercaseLetter ||= containsLowercaseCharacter;\n    }\n    if (this.customStrengthOptions.containsUppercaseLetter) {\n      status.containsUppercaseLetter ||= containsUppercaseCharacter;\n    }\n    if (this.customStrengthOptions.containsNumericCharacter) {\n      status.containsNumericCharacter ||= containsNumericCharacter;\n    }\n    if (this.customStrengthOptions.containsNonAlphanumericCharacter) {\n      status.containsNonAlphanumericCharacter ||=\n        containsNonAlphanumericCharacter;\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  _isFirebaseServerApp,\n  _FirebaseService,\n  FirebaseApp\n} from '@firebase/app';\nimport { Provider } from '@firebase/component';\nimport { AppCheckInternalComponentName } from '@firebase/app-check-interop-types';\nimport {\n  Auth,\n  AuthErrorMap,\n  AuthSettings,\n  EmulatorConfig,\n  NextOrObserver,\n  Persistence,\n  PopupRedirectResolver,\n  User,\n  UserCredential,\n  CompleteFn,\n  ErrorFn,\n  NextFn,\n  Unsubscribe,\n  PasswordValidationStatus\n} from '../../model/public_types';\nimport {\n  createSubscribe,\n  ErrorFactory,\n  FirebaseError,\n  getModularInstance,\n  Observer,\n  Subscribe\n} from '@firebase/util';\n\nimport { AuthInternal, ConfigInternal } from '../../model/auth';\nimport { PopupRedirectResolverInternal } from '../../model/popup_redirect';\nimport { UserInternal } from '../../model/user';\nimport {\n  AuthErrorCode,\n  AuthErrorParams,\n  ErrorMapRetriever,\n  _DEFAULT_AUTH_ERROR_FACTORY\n} from '../errors';\nimport { PersistenceInternal } from '../persistence';\nimport {\n  KeyName,\n  PersistenceUserManager\n} from '../persistence/persistence_user_manager';\nimport { _reloadWithoutSaving } from '../user/reload';\nimport {\n  _assert,\n  _serverAppCurrentUserOperationNotSupportedError\n} from '../util/assert';\nimport { _getInstance } from '../util/instantiator';\nimport { _getUserLanguage } from '../util/navigator';\nimport { _getClientVersion } from '../util/version';\nimport { HttpHeader } from '../../api';\nimport {\n  RevokeTokenRequest,\n  TokenType,\n  revokeToken\n} from '../../api/authentication/token';\nimport { AuthMiddlewareQueue } from './middleware';\nimport { RecaptchaConfig } from '../../platform_browser/recaptcha/recaptcha';\nimport { _logWarn } from '../util/log';\nimport { _getPasswordPolicy } from '../../api/password_policy/get_password_policy';\nimport { PasswordPolicyInternal } from '../../model/password_policy';\nimport { PasswordPolicyImpl } from './password_policy_impl';\nimport { getAccountInfo } from '../../api/account_management/account';\nimport { UserImpl } from '../user/user_impl';\n\ninterface AsyncAction {\n  (): Promise<void>;\n}\n\nexport const enum DefaultConfig {\n  TOKEN_API_HOST = 'securetoken.googleapis.com',\n  API_HOST = 'identitytoolkit.googleapis.com',\n  API_SCHEME = 'https'\n}\n\nexport class AuthImpl implements AuthInternal, _FirebaseService {\n  currentUser: User | null = null;\n  emulatorConfig: EmulatorConfig | null = null;\n  private operations = Promise.resolve();\n  private persistenceManager?: PersistenceUserManager;\n  private redirectPersistenceManager?: PersistenceUserManager;\n  private authStateSubscription = new Subscription<User>(this);\n  private idTokenSubscription = new Subscription<User>(this);\n  private readonly beforeStateQueue = new AuthMiddlewareQueue(this);\n  private redirectUser: UserInternal | null = null;\n  private isProactiveRefreshEnabled = false;\n  private readonly EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION: number = 1;\n\n  // Any network calls will set this to true and prevent subsequent emulator\n  // initialization\n  _canInitEmulator = true;\n  _isInitialized = false;\n  _deleted = false;\n  _initializationPromise: Promise<void> | null = null;\n  _popupRedirectResolver: PopupRedirectResolverInternal | null = null;\n  _errorFactory: ErrorFactory<AuthErrorCode, AuthErrorParams> =\n    _DEFAULT_AUTH_ERROR_FACTORY;\n  _agentRecaptchaConfig: RecaptchaConfig | null = null;\n  _tenantRecaptchaConfigs: Record<string, RecaptchaConfig> = {};\n  _projectPasswordPolicy: PasswordPolicyInternal | null = null;\n  _tenantPasswordPolicies: Record<string, PasswordPolicyInternal> = {};\n  readonly name: string;\n\n  // Tracks the last notified UID for state change listeners to prevent\n  // repeated calls to the callbacks. Undefined means it's never been\n  // called, whereas null means it's been called with a signed out user\n  private lastNotifiedUid: string | null | undefined = undefined;\n\n  languageCode: string | null = null;\n  tenantId: string | null = null;\n  settings: AuthSettings = { appVerificationDisabledForTesting: false };\n\n  constructor(\n    public readonly app: FirebaseApp,\n    private readonly heartbeatServiceProvider: Provider<'heartbeat'>,\n    private readonly appCheckServiceProvider: Provider<AppCheckInternalComponentName>,\n    public readonly config: ConfigInternal\n  ) {\n    this.name = app.name;\n    this.clientVersion = config.sdkClientVersion;\n  }\n\n  _initializeWithPersistence(\n    persistenceHierarchy: PersistenceInternal[],\n    popupRedirectResolver?: PopupRedirectResolver\n  ): Promise<void> {\n    if (popupRedirectResolver) {\n      this._popupRedirectResolver = _getInstance(popupRedirectResolver);\n    }\n\n    // Have to check for app deletion throughout initialization (after each\n    // promise resolution)\n    this._initializationPromise = this.queue(async () => {\n      if (this._deleted) {\n        return;\n      }\n\n      this.persistenceManager = await PersistenceUserManager.create(\n        this,\n        persistenceHierarchy\n      );\n\n      if (this._deleted) {\n        return;\n      }\n\n      // Initialize the resolver early if necessary (only applicable to web:\n      // this will cause the iframe to load immediately in certain cases)\n      if (this._popupRedirectResolver?._shouldInitProactively) {\n        // If this fails, don't halt auth loading\n        try {\n          await this._popupRedirectResolver._initialize(this);\n        } catch (e) {\n          /* Ignore the error */\n        }\n      }\n\n      await this.initializeCurrentUser(popupRedirectResolver);\n\n      this.lastNotifiedUid = this.currentUser?.uid || null;\n\n      if (this._deleted) {\n        return;\n      }\n\n      this._isInitialized = true;\n    });\n\n    return this._initializationPromise;\n  }\n\n  /**\n   * If the persistence is changed in another window, the user manager will let us know\n   */\n  async _onStorageEvent(): Promise<void> {\n    if (this._deleted) {\n      return;\n    }\n\n    const user = await this.assertedPersistence.getCurrentUser();\n\n    if (!this.currentUser && !user) {\n      // No change, do nothing (was signed out and remained signed out).\n      return;\n    }\n\n    // If the same user is to be synchronized.\n    if (this.currentUser && user && this.currentUser.uid === user.uid) {\n      // Data update, simply copy data changes.\n      this._currentUser._assign(user);\n      // If tokens changed from previous user tokens, this will trigger\n      // notifyAuthListeners_.\n      await this.currentUser.getIdToken();\n      return;\n    }\n\n    // Update current Auth state. Either a new login or logout.\n    // Skip blocking callbacks, they should not apply to a change in another tab.\n    await this._updateCurrentUser(user, /* skipBeforeStateCallbacks */ true);\n  }\n\n  private async initializeCurrentUserFromIdToken(\n    idToken: string\n  ): Promise<void> {\n    try {\n      const response = await getAccountInfo(this, { idToken });\n      const user = await UserImpl._fromGetAccountInfoResponse(\n        this,\n        response,\n        idToken\n      );\n      await this.directlySetCurrentUser(user);\n    } catch (err) {\n      console.warn(\n        'FirebaseServerApp could not login user with provided authIdToken: ',\n        err\n      );\n      await this.directlySetCurrentUser(null);\n    }\n  }\n\n  private async initializeCurrentUser(\n    popupRedirectResolver?: PopupRedirectResolver\n  ): Promise<void> {\n    if (_isFirebaseServerApp(this.app)) {\n      const idToken = this.app.settings.authIdToken;\n      if (idToken) {\n        // Start the auth operation in the next tick to allow a moment for the customer's app to\n        // attach an emulator, if desired.\n        return new Promise<void>(resolve => {\n          setTimeout(() =>\n            this.initializeCurrentUserFromIdToken(idToken).then(\n              resolve,\n              resolve\n            )\n          );\n        });\n      } else {\n        return this.directlySetCurrentUser(null);\n      }\n    }\n\n    // First check to see if we have a pending redirect event.\n    const previouslyStoredUser =\n      (await this.assertedPersistence.getCurrentUser()) as UserInternal | null;\n    let futureCurrentUser = previouslyStoredUser;\n    let needsTocheckMiddleware = false;\n    if (popupRedirectResolver && this.config.authDomain) {\n      await this.getOrInitRedirectPersistenceManager();\n      const redirectUserEventId = this.redirectUser?._redirectEventId;\n      const storedUserEventId = futureCurrentUser?._redirectEventId;\n      const result = await this.tryRedirectSignIn(popupRedirectResolver);\n\n      // If the stored user (i.e. the old \"currentUser\") has a redirectId that\n      // matches the redirect user, then we want to initially sign in with the\n      // new user object from result.\n      // TODO(samgho): More thoroughly test all of this\n      if (\n        (!redirectUserEventId || redirectUserEventId === storedUserEventId) &&\n        result?.user\n      ) {\n        futureCurrentUser = result.user as UserInternal;\n        needsTocheckMiddleware = true;\n      }\n    }\n\n    // If no user in persistence, there is no current user. Set to null.\n    if (!futureCurrentUser) {\n      return this.directlySetCurrentUser(null);\n    }\n\n    if (!futureCurrentUser._redirectEventId) {\n      // This isn't a redirect link operation, we can reload and bail.\n      // First though, ensure that we check the middleware is happy.\n      if (needsTocheckMiddleware) {\n        try {\n          await this.beforeStateQueue.runMiddleware(futureCurrentUser);\n        } catch (e) {\n          futureCurrentUser = previouslyStoredUser;\n          // We know this is available since the bit is only set when the\n          // resolver is available\n          this._popupRedirectResolver!._overrideRedirectResult(this, () =>\n            Promise.reject(e)\n          );\n        }\n      }\n\n      if (futureCurrentUser) {\n        return this.reloadAndSetCurrentUserOrClear(futureCurrentUser);\n      } else {\n        return this.directlySetCurrentUser(null);\n      }\n    }\n\n    _assert(this._popupRedirectResolver, this, AuthErrorCode.ARGUMENT_ERROR);\n    await this.getOrInitRedirectPersistenceManager();\n\n    // If the redirect user's event ID matches the current user's event ID,\n    // DO NOT reload the current user, otherwise they'll be cleared from storage.\n    // This is important for the reauthenticateWithRedirect() flow.\n    if (\n      this.redirectUser &&\n      this.redirectUser._redirectEventId === futureCurrentUser._redirectEventId\n    ) {\n      return this.directlySetCurrentUser(futureCurrentUser);\n    }\n\n    return this.reloadAndSetCurrentUserOrClear(futureCurrentUser);\n  }\n\n  private async tryRedirectSignIn(\n    redirectResolver: PopupRedirectResolver\n  ): Promise<UserCredential | null> {\n    // The redirect user needs to be checked (and signed in if available)\n    // during auth initialization. All of the normal sign in and link/reauth\n    // flows call back into auth and push things onto the promise queue. We\n    // need to await the result of the redirect sign in *inside the promise\n    // queue*. This presents a problem: we run into deadlock. See:\n    //    ┌> [Initialization] ─────┐\n    //    ┌> [<other queue tasks>] │\n    //    └─ [getRedirectResult] <─┘\n    //    where [] are tasks on the queue and arrows denote awaits\n    // Initialization will never complete because it's waiting on something\n    // that's waiting for initialization to complete!\n    //\n    // Instead, this method calls getRedirectResult() (stored in\n    // _completeRedirectFn) with an optional parameter that instructs all of\n    // the underlying auth operations to skip anything that mutates auth state.\n\n    let result: UserCredential | null = null;\n    try {\n      // We know this._popupRedirectResolver is set since redirectResolver\n      // is passed in. The _completeRedirectFn expects the unwrapped extern.\n      result = await this._popupRedirectResolver!._completeRedirectFn(\n        this,\n        redirectResolver,\n        true\n      );\n    } catch (e) {\n      // Swallow any errors here; the code can retrieve them in\n      // getRedirectResult().\n      await this._setRedirectUser(null);\n    }\n\n    return result;\n  }\n\n  private async reloadAndSetCurrentUserOrClear(\n    user: UserInternal\n  ): Promise<void> {\n    try {\n      await _reloadWithoutSaving(user);\n    } catch (e) {\n      if (\n        (e as FirebaseError)?.code !==\n        `auth/${AuthErrorCode.NETWORK_REQUEST_FAILED}`\n      ) {\n        // Something's wrong with the user's token. Log them out and remove\n        // them from storage\n        return this.directlySetCurrentUser(null);\n      }\n    }\n\n    return this.directlySetCurrentUser(user);\n  }\n\n  useDeviceLanguage(): void {\n    this.languageCode = _getUserLanguage();\n  }\n\n  async _delete(): Promise<void> {\n    this._deleted = true;\n  }\n\n  async updateCurrentUser(userExtern: User | null): Promise<void> {\n    if (_isFirebaseServerApp(this.app)) {\n      return Promise.reject(\n        _serverAppCurrentUserOperationNotSupportedError(this)\n      );\n    }\n    // The public updateCurrentUser method needs to make a copy of the user,\n    // and also check that the project matches\n    const user = userExtern\n      ? (getModularInstance(userExtern) as UserInternal)\n      : null;\n    if (user) {\n      _assert(\n        user.auth.config.apiKey === this.config.apiKey,\n        this,\n        AuthErrorCode.INVALID_AUTH\n      );\n    }\n    return this._updateCurrentUser(user && user._clone(this));\n  }\n\n  async _updateCurrentUser(\n    user: User | null,\n    skipBeforeStateCallbacks: boolean = false\n  ): Promise<void> {\n    if (this._deleted) {\n      return;\n    }\n    if (user) {\n      _assert(\n        this.tenantId === user.tenantId,\n        this,\n        AuthErrorCode.TENANT_ID_MISMATCH\n      );\n    }\n\n    if (!skipBeforeStateCallbacks) {\n      await this.beforeStateQueue.runMiddleware(user);\n    }\n\n    return this.queue(async () => {\n      await this.directlySetCurrentUser(user as UserInternal | null);\n      this.notifyAuthListeners();\n    });\n  }\n\n  async signOut(): Promise<void> {\n    if (_isFirebaseServerApp(this.app)) {\n      return Promise.reject(\n        _serverAppCurrentUserOperationNotSupportedError(this)\n      );\n    }\n    // Run first, to block _setRedirectUser() if any callbacks fail.\n    await this.beforeStateQueue.runMiddleware(null);\n    // Clear the redirect user when signOut is called\n    if (this.redirectPersistenceManager || this._popupRedirectResolver) {\n      await this._setRedirectUser(null);\n    }\n\n    // Prevent callbacks from being called again in _updateCurrentUser, as\n    // they were already called in the first line.\n    return this._updateCurrentUser(null, /* skipBeforeStateCallbacks */ true);\n  }\n\n  setPersistence(persistence: Persistence): Promise<void> {\n    if (_isFirebaseServerApp(this.app)) {\n      return Promise.reject(\n        _serverAppCurrentUserOperationNotSupportedError(this)\n      );\n    }\n    return this.queue(async () => {\n      await this.assertedPersistence.setPersistence(_getInstance(persistence));\n    });\n  }\n\n  _getRecaptchaConfig(): RecaptchaConfig | null {\n    if (this.tenantId == null) {\n      return this._agentRecaptchaConfig;\n    } else {\n      return this._tenantRecaptchaConfigs[this.tenantId];\n    }\n  }\n\n  async validatePassword(password: string): Promise<PasswordValidationStatus> {\n    if (!this._getPasswordPolicyInternal()) {\n      await this._updatePasswordPolicy();\n    }\n\n    // Password policy will be defined after fetching.\n    const passwordPolicy: PasswordPolicyInternal =\n      this._getPasswordPolicyInternal()!;\n\n    // Check that the policy schema version is supported by the SDK.\n    // TODO: Update this logic to use a max supported policy schema version once we have multiple schema versions.\n    if (\n      passwordPolicy.schemaVersion !==\n      this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION\n    ) {\n      return Promise.reject(\n        this._errorFactory.create(\n          AuthErrorCode.UNSUPPORTED_PASSWORD_POLICY_SCHEMA_VERSION,\n          {}\n        )\n      );\n    }\n\n    return passwordPolicy.validatePassword(password);\n  }\n\n  _getPasswordPolicyInternal(): PasswordPolicyInternal | null {\n    if (this.tenantId === null) {\n      return this._projectPasswordPolicy;\n    } else {\n      return this._tenantPasswordPolicies[this.tenantId];\n    }\n  }\n\n  async _updatePasswordPolicy(): Promise<void> {\n    const response = await _getPasswordPolicy(this);\n\n    const passwordPolicy: PasswordPolicyInternal = new PasswordPolicyImpl(\n      response\n    );\n\n    if (this.tenantId === null) {\n      this._projectPasswordPolicy = passwordPolicy;\n    } else {\n      this._tenantPasswordPolicies[this.tenantId] = passwordPolicy;\n    }\n  }\n\n  _getPersistence(): string {\n    return this.assertedPersistence.persistence.type;\n  }\n\n  _updateErrorMap(errorMap: AuthErrorMap): void {\n    this._errorFactory = new ErrorFactory<AuthErrorCode, AuthErrorParams>(\n      'auth',\n      'Firebase',\n      (errorMap as ErrorMapRetriever)()\n    );\n  }\n\n  onAuthStateChanged(\n    nextOrObserver: NextOrObserver<User>,\n    error?: ErrorFn,\n    completed?: CompleteFn\n  ): Unsubscribe {\n    return this.registerStateListener(\n      this.authStateSubscription,\n      nextOrObserver,\n      error,\n      completed\n    );\n  }\n\n  beforeAuthStateChanged(\n    callback: (user: User | null) => void | Promise<void>,\n    onAbort?: () => void\n  ): Unsubscribe {\n    return this.beforeStateQueue.pushCallback(callback, onAbort);\n  }\n\n  onIdTokenChanged(\n    nextOrObserver: NextOrObserver<User>,\n    error?: ErrorFn,\n    completed?: CompleteFn\n  ): Unsubscribe {\n    return this.registerStateListener(\n      this.idTokenSubscription,\n      nextOrObserver,\n      error,\n      completed\n    );\n  }\n\n  authStateReady(): Promise<void> {\n    return new Promise((resolve, reject) => {\n      if (this.currentUser) {\n        resolve();\n      } else {\n        const unsubscribe = this.onAuthStateChanged(() => {\n          unsubscribe();\n          resolve();\n        }, reject);\n      }\n    });\n  }\n\n  /**\n   * Revokes the given access token. Currently only supports Apple OAuth access tokens.\n   */\n  async revokeAccessToken(token: string): Promise<void> {\n    if (this.currentUser) {\n      const idToken = await this.currentUser.getIdToken();\n      // Generalize this to accept other providers once supported.\n      const request: RevokeTokenRequest = {\n        providerId: 'apple.com',\n        tokenType: TokenType.ACCESS_TOKEN,\n        token,\n        idToken\n      };\n      if (this.tenantId != null) {\n        request.tenantId = this.tenantId;\n      }\n      await revokeToken(this, request);\n    }\n  }\n\n  toJSON(): object {\n    return {\n      apiKey: this.config.apiKey,\n      authDomain: this.config.authDomain,\n      appName: this.name,\n      currentUser: this._currentUser?.toJSON()\n    };\n  }\n\n  async _setRedirectUser(\n    user: UserInternal | null,\n    popupRedirectResolver?: PopupRedirectResolver\n  ): Promise<void> {\n    const redirectManager = await this.getOrInitRedirectPersistenceManager(\n      popupRedirectResolver\n    );\n    return user === null\n      ? redirectManager.removeCurrentUser()\n      : redirectManager.setCurrentUser(user);\n  }\n\n  private async getOrInitRedirectPersistenceManager(\n    popupRedirectResolver?: PopupRedirectResolver\n  ): Promise<PersistenceUserManager> {\n    if (!this.redirectPersistenceManager) {\n      const resolver: PopupRedirectResolverInternal | null =\n        (popupRedirectResolver && _getInstance(popupRedirectResolver)) ||\n        this._popupRedirectResolver;\n      _assert(resolver, this, AuthErrorCode.ARGUMENT_ERROR);\n      this.redirectPersistenceManager = await PersistenceUserManager.create(\n        this,\n        [_getInstance(resolver._redirectPersistence)],\n        KeyName.REDIRECT_USER\n      );\n      this.redirectUser =\n        await this.redirectPersistenceManager.getCurrentUser();\n    }\n\n    return this.redirectPersistenceManager;\n  }\n\n  async _redirectUserForId(id: string): Promise<UserInternal | null> {\n    // Make sure we've cleared any pending persistence actions if we're not in\n    // the initializer\n    if (this._isInitialized) {\n      await this.queue(async () => {});\n    }\n\n    if (this._currentUser?._redirectEventId === id) {\n      return this._currentUser;\n    }\n\n    if (this.redirectUser?._redirectEventId === id) {\n      return this.redirectUser;\n    }\n\n    return null;\n  }\n\n  async _persistUserIfCurrent(user: UserInternal): Promise<void> {\n    if (user === this.currentUser) {\n      return this.queue(async () => this.directlySetCurrentUser(user));\n    }\n  }\n\n  /** Notifies listeners only if the user is current */\n  _notifyListenersIfCurrent(user: UserInternal): void {\n    if (user === this.currentUser) {\n      this.notifyAuthListeners();\n    }\n  }\n\n  _key(): string {\n    return `${this.config.authDomain}:${this.config.apiKey}:${this.name}`;\n  }\n\n  _startProactiveRefresh(): void {\n    this.isProactiveRefreshEnabled = true;\n    if (this.currentUser) {\n      this._currentUser._startProactiveRefresh();\n    }\n  }\n\n  _stopProactiveRefresh(): void {\n    this.isProactiveRefreshEnabled = false;\n    if (this.currentUser) {\n      this._currentUser._stopProactiveRefresh();\n    }\n  }\n\n  /** Returns the current user cast as the internal type */\n  get _currentUser(): UserInternal {\n    return this.currentUser as UserInternal;\n  }\n\n  private notifyAuthListeners(): void {\n    if (!this._isInitialized) {\n      return;\n    }\n\n    this.idTokenSubscription.next(this.currentUser);\n\n    const currentUid = this.currentUser?.uid ?? null;\n    if (this.lastNotifiedUid !== currentUid) {\n      this.lastNotifiedUid = currentUid;\n      this.authStateSubscription.next(this.currentUser);\n    }\n  }\n\n  private registerStateListener(\n    subscription: Subscription<User>,\n    nextOrObserver: NextOrObserver<User>,\n    error?: ErrorFn,\n    completed?: CompleteFn\n  ): Unsubscribe {\n    if (this._deleted) {\n      return () => {};\n    }\n\n    const cb =\n      typeof nextOrObserver === 'function'\n        ? nextOrObserver\n        : nextOrObserver.next.bind(nextOrObserver);\n\n    let isUnsubscribed = false;\n\n    const promise = this._isInitialized\n      ? Promise.resolve()\n      : this._initializationPromise;\n    _assert(promise, this, AuthErrorCode.INTERNAL_ERROR);\n    // The callback needs to be called asynchronously per the spec.\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\n    promise.then(() => {\n      if (isUnsubscribed) {\n        return;\n      }\n      cb(this.currentUser);\n    });\n\n    if (typeof nextOrObserver === 'function') {\n      const unsubscribe = subscription.addObserver(\n        nextOrObserver,\n        error,\n        completed\n      );\n      return () => {\n        isUnsubscribed = true;\n        unsubscribe();\n      };\n    } else {\n      const unsubscribe = subscription.addObserver(nextOrObserver);\n      return () => {\n        isUnsubscribed = true;\n        unsubscribe();\n      };\n    }\n  }\n\n  /**\n   * Unprotected (from race conditions) method to set the current user. This\n   * should only be called from within a queued callback. This is necessary\n   * because the queue shouldn't rely on another queued callback.\n   */\n  private async directlySetCurrentUser(\n    user: UserInternal | null\n  ): Promise<void> {\n    if (this.currentUser && this.currentUser !== user) {\n      this._currentUser._stopProactiveRefresh();\n    }\n    if (user && this.isProactiveRefreshEnabled) {\n      user._startProactiveRefresh();\n    }\n\n    this.currentUser = user;\n\n    if (user) {\n      await this.assertedPersistence.setCurrentUser(user);\n    } else {\n      await this.assertedPersistence.removeCurrentUser();\n    }\n  }\n\n  private queue(action: AsyncAction): Promise<void> {\n    // In case something errors, the callback still should be called in order\n    // to keep the promise chain alive\n    this.operations = this.operations.then(action, action);\n    return this.operations;\n  }\n\n  private get assertedPersistence(): PersistenceUserManager {\n    _assert(this.persistenceManager, this, AuthErrorCode.INTERNAL_ERROR);\n    return this.persistenceManager;\n  }\n\n  private frameworks: string[] = [];\n  private clientVersion: string;\n  _logFramework(framework: string): void {\n    if (!framework || this.frameworks.includes(framework)) {\n      return;\n    }\n    this.frameworks.push(framework);\n\n    // Sort alphabetically so that \"FirebaseCore-web,FirebaseUI-web\" and\n    // \"FirebaseUI-web,FirebaseCore-web\" aren't viewed as different.\n    this.frameworks.sort();\n    this.clientVersion = _getClientVersion(\n      this.config.clientPlatform,\n      this._getFrameworks()\n    );\n  }\n  _getFrameworks(): readonly string[] {\n    return this.frameworks;\n  }\n  async _getAdditionalHeaders(): Promise<Record<string, string>> {\n    // Additional headers on every request\n    const headers: Record<string, string> = {\n      [HttpHeader.X_CLIENT_VERSION]: this.clientVersion\n    };\n\n    if (this.app.options.appId) {\n      headers[HttpHeader.X_FIREBASE_GMPID] = this.app.options.appId;\n    }\n\n    // If the heartbeat service exists, add the heartbeat string\n    const heartbeatsHeader = await this.heartbeatServiceProvider\n      .getImmediate({\n        optional: true\n      })\n      ?.getHeartbeatsHeader();\n    if (heartbeatsHeader) {\n      headers[HttpHeader.X_FIREBASE_CLIENT] = heartbeatsHeader;\n    }\n\n    // If the App Check service exists, add the App Check token in the headers\n    const appCheckToken = await this._getAppCheckToken();\n    if (appCheckToken) {\n      headers[HttpHeader.X_FIREBASE_APP_CHECK] = appCheckToken;\n    }\n\n    return headers;\n  }\n\n  async _getAppCheckToken(): Promise<string | undefined> {\n    const appCheckTokenResult = await this.appCheckServiceProvider\n      .getImmediate({ optional: true })\n      ?.getToken();\n    if (appCheckTokenResult?.error) {\n      // Context: appCheck.getToken() will never throw even if an error happened.\n      // In the error case, a dummy token will be returned along with an error field describing\n      // the error. In general, we shouldn't care about the error condition and just use\n      // the token (actual or dummy) to send requests.\n      _logWarn(\n        `Error while retrieving App Check token: ${appCheckTokenResult.error}`\n      );\n    }\n    return appCheckTokenResult?.token;\n  }\n}\n\n/**\n * Method to be used to cast down to our private implmentation of Auth.\n * It will also handle unwrapping from the compat type if necessary\n *\n * @param auth Auth object passed in from developer\n */\nexport function _castAuth(auth: Auth): AuthInternal {\n  return getModularInstance(auth) as AuthInternal;\n}\n\n/** Helper class to wrap subscriber logic */\nclass Subscription<T> {\n  private observer: Observer<T | null> | null = null;\n  readonly addObserver: Subscribe<T | null> = createSubscribe(\n    observer => (this.observer = observer)\n  );\n\n  constructor(readonly auth: AuthInternal) {}\n\n  get next(): NextFn<T | null> {\n    _assert(this.observer, this.auth, AuthErrorCode.INTERNAL_ERROR);\n    return this.observer.next.bind(this.observer);\n  }\n}\n","/**\n * @license\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  _performApiRequest,\n  Endpoint,\n  HttpMethod,\n  _addTidIfNecessary\n} from '../index';\nimport { Auth } from '../../model/public_types';\n\n/**\n * Request object for fetching the password policy.\n */\nexport interface GetPasswordPolicyRequest {\n  tenantId?: string;\n}\n\n/**\n * Response object for fetching the password policy.\n */\nexport interface GetPasswordPolicyResponse {\n  customStrengthOptions: {\n    minPasswordLength?: number;\n    maxPasswordLength?: number;\n    containsLowercaseCharacter?: boolean;\n    containsUppercaseCharacter?: boolean;\n    containsNumericCharacter?: boolean;\n    containsNonAlphanumericCharacter?: boolean;\n  };\n  allowedNonAlphanumericCharacters?: string[];\n  enforcementState: string;\n  forceUpgradeOnSignin?: boolean;\n  schemaVersion: number;\n}\n\n/**\n * Fetches the password policy for the currently set tenant or the project if no tenant is set.\n *\n * @param auth Auth object.\n * @param request Password policy request.\n * @returns Password policy response.\n */\nexport async function _getPasswordPolicy(\n  auth: Auth,\n  request: GetPasswordPolicyRequest = {}\n): Promise<GetPasswordPolicyResponse> {\n  return _performApiRequest<\n    GetPasswordPolicyRequest,\n    GetPasswordPolicyResponse\n  >(\n    auth,\n    HttpMethod.GET,\n    Endpoint.GET_PASSWORD_POLICY,\n    _addTidIfNecessary(auth, request)\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ninterface ExternalJSProvider {\n  loadJS(url: string): Promise<Event>;\n  recaptchaV2Script: string;\n  recaptchaEnterpriseScript: string;\n  gapiScript: string;\n}\n\nlet externalJSProvider: ExternalJSProvider = {\n  async loadJS() {\n    throw new Error('Unable to load external scripts');\n  },\n\n  recaptchaV2Script: '',\n  recaptchaEnterpriseScript: '',\n  gapiScript: ''\n};\n\nexport function _setExternalJSProvider(p: ExternalJSProvider): void {\n  externalJSProvider = p;\n}\n\nexport function _loadJS(url: string): Promise<Event> {\n  return externalJSProvider.loadJS(url);\n}\n\nexport function _recaptchaV2ScriptUrl(): string {\n  return externalJSProvider.recaptchaV2Script;\n}\n\nexport function _recaptchaEnterpriseScriptUrl(): string {\n  return externalJSProvider.recaptchaEnterpriseScript;\n}\n\nexport function _gapiScriptUrl(): string {\n  return externalJSProvider.gapiScript;\n}\n\nexport function _generateCallbackName(prefix: string): string {\n  return `__${prefix}${Math.floor(Math.random() * 1000000)}`;\n}\n","/* eslint-disable @typescript-eslint/no-require-imports */\n/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isEnterprise, RecaptchaConfig } from './recaptcha';\nimport { getRecaptchaConfig } from '../../api/authentication/recaptcha';\nimport {\n  RecaptchaClientType,\n  RecaptchaVersion,\n  RecaptchaActionName,\n  RecaptchaProvider\n} from '../../api';\n\nimport { Auth } from '../../model/public_types';\nimport { AuthInternal } from '../../model/auth';\nimport { _castAuth } from '../../core/auth/auth_impl';\nimport * as jsHelpers from '../load_js';\nimport { AuthErrorCode } from '../../core/errors';\n\nexport const RECAPTCHA_ENTERPRISE_VERIFIER_TYPE = 'recaptcha-enterprise';\nexport const FAKE_TOKEN = 'NO_RECAPTCHA';\n\nexport class RecaptchaEnterpriseVerifier {\n  /**\n   * Identifies the type of application verifier (e.g. \"recaptcha-enterprise\").\n   */\n  readonly type = RECAPTCHA_ENTERPRISE_VERIFIER_TYPE;\n\n  private readonly auth: AuthInternal;\n\n  /**\n   *\n   * @param authExtern - The corresponding Firebase {@link Auth} instance.\n   *\n   */\n  constructor(authExtern: Auth) {\n    this.auth = _castAuth(authExtern);\n  }\n\n  /**\n   * Executes the verification process.\n   *\n   * @returns A Promise for a token that can be used to assert the validity of a request.\n   */\n  async verify(\n    action: string = 'verify',\n    forceRefresh = false\n  ): Promise<string> {\n    async function retrieveSiteKey(auth: AuthInternal): Promise<string> {\n      if (!forceRefresh) {\n        if (auth.tenantId == null && auth._agentRecaptchaConfig != null) {\n          return auth._agentRecaptchaConfig.siteKey;\n        }\n        if (\n          auth.tenantId != null &&\n          auth._tenantRecaptchaConfigs[auth.tenantId] !== undefined\n        ) {\n          return auth._tenantRecaptchaConfigs[auth.tenantId].siteKey;\n        }\n      }\n\n      return new Promise<string>(async (resolve, reject) => {\n        getRecaptchaConfig(auth, {\n          clientType: RecaptchaClientType.WEB,\n          version: RecaptchaVersion.ENTERPRISE\n        })\n          .then(response => {\n            if (response.recaptchaKey === undefined) {\n              reject(new Error('recaptcha Enterprise site key undefined'));\n            } else {\n              const config = new RecaptchaConfig(response);\n              if (auth.tenantId == null) {\n                auth._agentRecaptchaConfig = config;\n              } else {\n                auth._tenantRecaptchaConfigs[auth.tenantId] = config;\n              }\n              return resolve(config.siteKey);\n            }\n          })\n          .catch(error => {\n            reject(error);\n          });\n      });\n    }\n\n    function retrieveRecaptchaToken(\n      siteKey: string,\n      resolve: (value: string | PromiseLike<string>) => void,\n      reject: (reason?: unknown) => void\n    ): void {\n      const grecaptcha = window.grecaptcha;\n      if (isEnterprise(grecaptcha)) {\n        grecaptcha.enterprise.ready(() => {\n          grecaptcha.enterprise\n            .execute(siteKey, { action })\n            .then(token => {\n              resolve(token);\n            })\n            .catch(() => {\n              resolve(FAKE_TOKEN);\n            });\n        });\n      } else {\n        reject(Error('No reCAPTCHA enterprise script loaded.'));\n      }\n    }\n\n    return new Promise<string>((resolve, reject) => {\n      retrieveSiteKey(this.auth)\n        .then(siteKey => {\n          if (!forceRefresh && isEnterprise(window.grecaptcha)) {\n            retrieveRecaptchaToken(siteKey, resolve, reject);\n          } else {\n            if (typeof window === 'undefined') {\n              reject(\n                new Error('RecaptchaVerifier is only supported in browser')\n              );\n              return;\n            }\n            let url = jsHelpers._recaptchaEnterpriseScriptUrl();\n            if (url.length !== 0) {\n              url += siteKey;\n            }\n            jsHelpers\n              ._loadJS(url)\n              .then(() => {\n                retrieveRecaptchaToken(siteKey, resolve, reject);\n              })\n              .catch(error => {\n                reject(error);\n              });\n          }\n        })\n        .catch(error => {\n          reject(error);\n        });\n    });\n  }\n}\n\nexport async function injectRecaptchaFields<T>(\n  auth: AuthInternal,\n  request: T,\n  action: RecaptchaActionName,\n  captchaResp = false\n): Promise<T> {\n  const verifier = new RecaptchaEnterpriseVerifier(auth);\n  let captchaResponse;\n  try {\n    captchaResponse = await verifier.verify(action);\n  } catch (error) {\n    captchaResponse = await verifier.verify(action, true);\n  }\n  const newRequest = { ...request };\n  if (!captchaResp) {\n    Object.assign(newRequest, { captchaResponse });\n  } else {\n    Object.assign(newRequest, { 'captchaResp': captchaResponse });\n  }\n  Object.assign(newRequest, { 'clientType': RecaptchaClientType.WEB });\n  Object.assign(newRequest, {\n    'recaptchaVersion': RecaptchaVersion.ENTERPRISE\n  });\n  return newRequest;\n}\n\ntype ActionMethod<TRequest, TResponse> = (\n  auth: Auth,\n  request: TRequest\n) => Promise<TResponse>;\n\nexport async function handleRecaptchaFlow<TRequest, TResponse>(\n  authInstance: AuthInternal,\n  request: TRequest,\n  actionName: RecaptchaActionName,\n  actionMethod: ActionMethod<TRequest, TResponse>\n): Promise<TResponse> {\n  if (\n    authInstance\n      ._getRecaptchaConfig()\n      ?.isProviderEnabled(RecaptchaProvider.EMAIL_PASSWORD_PROVIDER)\n  ) {\n    const requestWithRecaptcha = await injectRecaptchaFields(\n      authInstance,\n      request,\n      actionName,\n      actionName === RecaptchaActionName.GET_OOB_CODE\n    );\n    return actionMethod(authInstance, requestWithRecaptcha);\n  } else {\n    return actionMethod(authInstance, request).catch(async error => {\n      if (error.code === `auth/${AuthErrorCode.MISSING_RECAPTCHA_TOKEN}`) {\n        console.log(\n          `${actionName} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`\n        );\n        const requestWithRecaptcha = await injectRecaptchaFields(\n          authInstance,\n          request,\n          actionName,\n          actionName === RecaptchaActionName.GET_OOB_CODE\n        );\n        return actionMethod(authInstance, requestWithRecaptcha);\n      } else {\n        return Promise.reject(error);\n      }\n    });\n  }\n}\n\nexport async function _initializeRecaptchaConfig(auth: Auth): Promise<void> {\n  const authInternal = _castAuth(auth);\n\n  const response = await getRecaptchaConfig(authInternal, {\n    clientType: RecaptchaClientType.WEB,\n    version: RecaptchaVersion.ENTERPRISE\n  });\n\n  const config = new RecaptchaConfig(response);\n  if (authInternal.tenantId == null) {\n    authInternal._agentRecaptchaConfig = config;\n  } else {\n    authInternal._tenantRecaptchaConfigs[authInternal.tenantId] = config;\n  }\n\n  if (config.isProviderEnabled(RecaptchaProvider.EMAIL_PASSWORD_PROVIDER)) {\n    const verifier = new RecaptchaEnterpriseVerifier(authInternal);\n    void verifier.verify();\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { _getProvider, FirebaseApp } from '@firebase/app';\nimport { deepEqual } from '@firebase/util';\nimport { Auth, Dependencies } from '../../model/public_types';\n\nimport { AuthErrorCode } from '../errors';\nimport { PersistenceInternal } from '../persistence';\nimport { _fail } from '../util/assert';\nimport { _getInstance } from '../util/instantiator';\nimport { AuthImpl } from './auth_impl';\n\n/**\n * Initializes an {@link Auth} instance with fine-grained control over\n * {@link Dependencies}.\n *\n * @remarks\n *\n * This function allows more control over the {@link Auth} instance than\n * {@link getAuth}. `getAuth` uses platform-specific defaults to supply\n * the {@link Dependencies}. In general, `getAuth` is the easiest way to\n * initialize Auth and works for most use cases. Use `initializeAuth` if you\n * need control over which persistence layer is used, or to minimize bundle\n * size if you're not using either `signInWithPopup` or `signInWithRedirect`.\n *\n * For example, if your app only uses anonymous accounts and you only want\n * accounts saved for the current session, initialize `Auth` with:\n *\n * ```js\n * const auth = initializeAuth(app, {\n *   persistence: browserSessionPersistence,\n *   popupRedirectResolver: undefined,\n * });\n * ```\n *\n * @public\n */\nexport function initializeAuth(app: FirebaseApp, deps?: Dependencies): Auth {\n  const provider = _getProvider(app, 'auth');\n\n  if (provider.isInitialized()) {\n    const auth = provider.getImmediate() as AuthImpl;\n    const initialOptions = provider.getOptions() as Dependencies;\n    if (deepEqual(initialOptions, deps ?? {})) {\n      return auth;\n    } else {\n      _fail(auth, AuthErrorCode.ALREADY_INITIALIZED);\n    }\n  }\n\n  const auth = provider.initialize({ options: deps }) as AuthImpl;\n\n  return auth;\n}\n\nexport function _initializeAuthInstance(\n  auth: AuthImpl,\n  deps?: Dependencies\n): void {\n  const persistence = deps?.persistence || [];\n  const hierarchy = (\n    Array.isArray(persistence) ? persistence : [persistence]\n  ).map<PersistenceInternal>(_getInstance);\n  if (deps?.errorMap) {\n    auth._updateErrorMap(deps.errorMap);\n  }\n\n  // This promise is intended to float; auth initialization happens in the\n  // background, meanwhile the auth object may be used by the app.\n  // eslint-disable-next-line @typescript-eslint/no-floating-promises\n  auth._initializeWithPersistence(hierarchy, deps?.popupRedirectResolver);\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Auth } from '../../model/public_types';\nimport { AuthErrorCode } from '../errors';\nimport { _assert } from '../util/assert';\nimport { _castAuth } from './auth_impl';\n\n/**\n * Changes the {@link Auth} instance to communicate with the Firebase Auth Emulator, instead of production\n * Firebase Auth services.\n *\n * @remarks\n * This must be called synchronously immediately following the first call to\n * {@link initializeAuth}.  Do not use with production credentials as emulator\n * traffic is not encrypted.\n *\n *\n * @example\n * ```javascript\n * connectAuthEmulator(auth, 'http://127.0.0.1:9099', { disableWarnings: true });\n * ```\n *\n * @param auth - The {@link Auth} instance.\n * @param url - The URL at which the emulator is running (eg, 'http://localhost:9099').\n * @param options - Optional. `options.disableWarnings` defaults to `false`. Set it to\n * `true` to disable the warning banner attached to the DOM.\n *\n * @public\n */\nexport function connectAuthEmulator(\n  auth: Auth,\n  url: string,\n  options?: { disableWarnings: boolean }\n): void {\n  const authInternal = _castAuth(auth);\n  _assert(\n    authInternal._canInitEmulator,\n    authInternal,\n    AuthErrorCode.EMULATOR_CONFIG_FAILED\n  );\n\n  _assert(\n    /^https?:\\/\\//.test(url),\n    authInternal,\n    AuthErrorCode.INVALID_EMULATOR_SCHEME\n  );\n\n  const disableWarnings = !!options?.disableWarnings;\n\n  const protocol = extractProtocol(url);\n  const { host, port } = extractHostAndPort(url);\n  const portStr = port === null ? '' : `:${port}`;\n\n  // Always replace path with \"/\" (even if input url had no path at all, or had a different one).\n  authInternal.config.emulator = { url: `${protocol}//${host}${portStr}/` };\n  authInternal.settings.appVerificationDisabledForTesting = true;\n  authInternal.emulatorConfig = Object.freeze({\n    host,\n    port,\n    protocol: protocol.replace(':', ''),\n    options: Object.freeze({ disableWarnings })\n  });\n\n  if (!disableWarnings) {\n    emitEmulatorWarning();\n  }\n}\n\nfunction extractProtocol(url: string): string {\n  const protocolEnd = url.indexOf(':');\n  return protocolEnd < 0 ? '' : url.substr(0, protocolEnd + 1);\n}\n\nfunction extractHostAndPort(url: string): {\n  host: string;\n  port: number | null;\n} {\n  const protocol = extractProtocol(url);\n  const authority = /(\\/\\/)?([^?#/]+)/.exec(url.substr(protocol.length)); // Between // and /, ? or #.\n  if (!authority) {\n    return { host: '', port: null };\n  }\n  const hostAndPort = authority[2].split('@').pop() || ''; // Strip out \"username:password@\".\n  const bracketedIPv6 = /^(\\[[^\\]]+\\])(:|$)/.exec(hostAndPort);\n  if (bracketedIPv6) {\n    const host = bracketedIPv6[1];\n    return { host, port: parsePort(hostAndPort.substr(host.length + 1)) };\n  } else {\n    const [host, port] = hostAndPort.split(':');\n    return { host, port: parsePort(port) };\n  }\n}\n\nfunction parsePort(portStr: string): number | null {\n  if (!portStr) {\n    return null;\n  }\n  const port = Number(portStr);\n  if (isNaN(port)) {\n    return null;\n  }\n  return port;\n}\n\nfunction emitEmulatorWarning(): void {\n  function attachBanner(): void {\n    const el = document.createElement('p');\n    const sty = el.style;\n    el.innerText =\n      'Running in emulator mode. Do not use with production credentials.';\n    sty.position = 'fixed';\n    sty.width = '100%';\n    sty.backgroundColor = '#ffffff';\n    sty.border = '.1em solid #000000';\n    sty.color = '#b50000';\n    sty.bottom = '0px';\n    sty.left = '0px';\n    sty.margin = '0px';\n    sty.zIndex = '10000';\n    sty.textAlign = 'center';\n    el.classList.add('firebase-emulator-warning');\n    document.body.appendChild(el);\n  }\n\n  if (typeof console !== 'undefined' && typeof console.info === 'function') {\n    console.info(\n      'WARNING: You are using the Auth Emulator,' +\n        ' which is intended for local testing only.  Do not use with' +\n        ' production credentials.'\n    );\n  }\n  if (typeof window !== 'undefined' && typeof document !== 'undefined') {\n    if (document.readyState === 'loading') {\n      window.addEventListener('DOMContentLoaded', attachBanner);\n    } else {\n      attachBanner();\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { PhoneOrOauthTokenResponse } from '../../api/authentication/mfa';\nimport { AuthInternal } from '../../model/auth';\nimport { IdTokenResponse } from '../../model/id_token';\nimport { debugFail } from '../util/assert';\n\n/**\n * Interface that represents the credentials returned by an {@link AuthProvider}.\n *\n * @remarks\n * Implementations specify the details about each auth provider's credential requirements.\n *\n * @public\n */\nexport class AuthCredential {\n  /** @internal */\n  protected constructor(\n    /**\n     * The authentication provider ID for the credential.\n     *\n     * @remarks\n     * For example, 'facebook.com', or 'google.com'.\n     */\n    readonly providerId: string,\n    /**\n     * The authentication sign in method for the credential.\n     *\n     * @remarks\n     * For example, {@link SignInMethod}.EMAIL_PASSWORD, or\n     * {@link SignInMethod}.EMAIL_LINK. This corresponds to the sign-in method\n     * identifier as returned in {@link fetchSignInMethodsForEmail}.\n     */\n    readonly signInMethod: string\n  ) {}\n\n  /**\n   * Returns a JSON-serializable representation of this object.\n   *\n   * @returns a JSON-serializable representation of this object.\n   */\n  toJSON(): object {\n    return debugFail('not implemented');\n  }\n\n  /** @internal */\n  _getIdTokenResponse(_auth: AuthInternal): Promise<PhoneOrOauthTokenResponse> {\n    return debugFail('not implemented');\n  }\n  /** @internal */\n  _linkToIdToken(\n    _auth: AuthInternal,\n    _idToken: string\n  ): Promise<IdTokenResponse> {\n    return debugFail('not implemented');\n  }\n  /** @internal */\n  _getReauthenticationResolver(_auth: AuthInternal): Promise<IdTokenResponse> {\n    return debugFail('not implemented');\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ActionCodeOperation, Auth } from '../../model/public_types';\n\nimport {\n  Endpoint,\n  HttpMethod,\n  _addTidIfNecessary,\n  _performApiRequest\n} from '../index';\nimport { IdTokenResponse } from '../../model/id_token';\nimport { MfaEnrollment } from './mfa';\nimport { SignUpRequest, SignUpResponse } from '../authentication/sign_up';\n\nexport interface ResetPasswordRequest {\n  oobCode: string;\n  newPassword?: string;\n  tenantId?: string;\n}\n\nexport interface ResetPasswordResponse {\n  email: string;\n  newEmail?: string;\n  requestType?: ActionCodeOperation;\n  mfaInfo?: MfaEnrollment;\n}\n\nexport async function resetPassword(\n  auth: Auth,\n  request: ResetPasswordRequest\n): Promise<ResetPasswordResponse> {\n  return _performApiRequest<ResetPasswordRequest, ResetPasswordResponse>(\n    auth,\n    HttpMethod.POST,\n    Endpoint.RESET_PASSWORD,\n    _addTidIfNecessary(auth, request)\n  );\n}\nexport interface UpdateEmailPasswordRequest {\n  idToken: string;\n  returnSecureToken?: boolean;\n  email?: string;\n  password?: string;\n}\n\nexport interface UpdateEmailPasswordResponse extends IdTokenResponse {}\n\nexport async function updateEmailPassword(\n  auth: Auth,\n  request: UpdateEmailPasswordRequest\n): Promise<UpdateEmailPasswordResponse> {\n  return _performApiRequest<\n    UpdateEmailPasswordRequest,\n    UpdateEmailPasswordResponse\n  >(auth, HttpMethod.POST, Endpoint.SET_ACCOUNT_INFO, request);\n}\n\n// Used for linking an email/password account to an existing idToken. Uses the same request/response\n// format as updateEmailPassword.\nexport async function linkEmailPassword(\n  auth: Auth,\n  request: SignUpRequest\n): Promise<SignUpResponse> {\n  return _performApiRequest<SignUpRequest, SignUpResponse>(\n    auth,\n    HttpMethod.POST,\n    Endpoint.SIGN_UP,\n    request\n  );\n}\n\nexport interface ApplyActionCodeRequest {\n  oobCode: string;\n  tenantId?: string;\n}\n\nexport interface ApplyActionCodeResponse {}\n\nexport async function applyActionCode(\n  auth: Auth,\n  request: ApplyActionCodeRequest\n): Promise<ApplyActionCodeResponse> {\n  return _performApiRequest<ApplyActionCodeRequest, ApplyActionCodeResponse>(\n    auth,\n    HttpMethod.POST,\n    Endpoint.SET_ACCOUNT_INFO,\n    _addTidIfNecessary(auth, request)\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ActionCodeOperation, Auth } from '../../model/public_types';\n\nimport {\n  Endpoint,\n  HttpMethod,\n  RecaptchaClientType,\n  RecaptchaVersion,\n  _addTidIfNecessary,\n  _performApiRequest,\n  _performSignInRequest\n} from '../index';\nimport { IdToken, IdTokenResponse } from '../../model/id_token';\n\nexport interface SignInWithPasswordRequest {\n  returnSecureToken?: boolean;\n  email: string;\n  password: string;\n  tenantId?: string;\n  captchaResponse?: string;\n  clientType?: RecaptchaClientType;\n  recaptchaVersion?: RecaptchaVersion;\n}\n\nexport interface SignInWithPasswordResponse extends IdTokenResponse {\n  email: string;\n  displayName: string;\n}\n\nexport async function signInWithPassword(\n  auth: Auth,\n  request: SignInWithPasswordRequest\n): Promise<SignInWithPasswordResponse> {\n  return _performSignInRequest<\n    SignInWithPasswordRequest,\n    SignInWithPasswordResponse\n  >(\n    auth,\n    HttpMethod.POST,\n    Endpoint.SIGN_IN_WITH_PASSWORD,\n    _addTidIfNecessary(auth, request)\n  );\n}\n\nexport interface GetOobCodeRequest {\n  email?: string; // Everything except VERIFY_AND_CHANGE_EMAIL\n  continueUrl?: string;\n  iOSBundleId?: string;\n  iosAppStoreId?: string;\n  androidPackageName?: string;\n  androidInstallApp?: boolean;\n  androidMinimumVersionCode?: string;\n  canHandleCodeInApp?: boolean;\n  dynamicLinkDomain?: string;\n  tenantId?: string;\n  targetProjectid?: string;\n}\n\nexport interface VerifyEmailRequest extends GetOobCodeRequest {\n  requestType: ActionCodeOperation.VERIFY_EMAIL;\n  idToken: IdToken;\n}\n\nexport interface PasswordResetRequest extends GetOobCodeRequest {\n  requestType: ActionCodeOperation.PASSWORD_RESET;\n  email: string;\n  captchaResp?: string;\n  clientType?: RecaptchaClientType;\n  recaptchaVersion?: RecaptchaVersion;\n}\n\nexport interface EmailSignInRequest extends GetOobCodeRequest {\n  requestType: ActionCodeOperation.EMAIL_SIGNIN;\n  email: string;\n  captchaResp?: string;\n  clientType?: RecaptchaClientType;\n  recaptchaVersion?: RecaptchaVersion;\n}\n\nexport interface VerifyAndChangeEmailRequest extends GetOobCodeRequest {\n  requestType: ActionCodeOperation.VERIFY_AND_CHANGE_EMAIL;\n  idToken: IdToken;\n  newEmail: string;\n}\n\ninterface GetOobCodeResponse {\n  email: string;\n}\n\nexport interface VerifyEmailResponse extends GetOobCodeResponse {}\nexport interface PasswordResetResponse extends GetOobCodeResponse {}\nexport interface EmailSignInResponse extends GetOobCodeResponse {}\nexport interface VerifyAndChangeEmailResponse extends GetOobCodeRequest {}\n\nasync function sendOobCode(\n  auth: Auth,\n  request: GetOobCodeRequest\n): Promise<GetOobCodeResponse> {\n  return _performApiRequest<GetOobCodeRequest, GetOobCodeResponse>(\n    auth,\n    HttpMethod.POST,\n    Endpoint.SEND_OOB_CODE,\n    _addTidIfNecessary(auth, request)\n  );\n}\n\nexport async function sendEmailVerification(\n  auth: Auth,\n  request: VerifyEmailRequest\n): Promise<VerifyEmailResponse> {\n  return sendOobCode(auth, request);\n}\n\nexport async function sendPasswordResetEmail(\n  auth: Auth,\n  request: PasswordResetRequest\n): Promise<PasswordResetResponse> {\n  return sendOobCode(auth, request);\n}\n\nexport async function sendSignInLinkToEmail(\n  auth: Auth,\n  request: EmailSignInRequest\n): Promise<EmailSignInResponse> {\n  return sendOobCode(auth, request);\n}\n\nexport async function verifyAndChangeEmail(\n  auth: Auth,\n  request: VerifyAndChangeEmailRequest\n): Promise<VerifyAndChangeEmailResponse> {\n  return sendOobCode(auth, request);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ProviderId, SignInMethod } from '../../model/enums';\n\nimport { linkEmailPassword } from '../../api/account_management/email_and_password';\nimport {\n  signInWithPassword,\n  SignInWithPasswordRequest\n} from '../../api/authentication/email_and_password';\nimport {\n  signInWithEmailLink,\n  signInWithEmailLinkForLinking\n} from '../../api/authentication/email_link';\nimport { AuthInternal } from '../../model/auth';\nimport { IdTokenResponse } from '../../model/id_token';\nimport { AuthErrorCode } from '../errors';\nimport { _fail } from '../util/assert';\nimport { AuthCredential } from './auth_credential';\nimport { handleRecaptchaFlow } from '../../platform_browser/recaptcha/recaptcha_enterprise_verifier';\nimport { RecaptchaActionName, RecaptchaClientType } from '../../api';\nimport { SignUpRequest } from '../../api/authentication/sign_up';\n/**\n * Interface that represents the credentials returned by {@link EmailAuthProvider} for\n * {@link ProviderId}.PASSWORD\n *\n * @remarks\n * Covers both {@link SignInMethod}.EMAIL_PASSWORD and\n * {@link SignInMethod}.EMAIL_LINK.\n *\n * @public\n */\nexport class EmailAuthCredential extends AuthCredential {\n  /** @internal */\n  private constructor(\n    /** @internal */\n    readonly _email: string,\n    /** @internal */\n    readonly _password: string,\n    signInMethod: SignInMethod,\n    /** @internal */\n    readonly _tenantId: string | null = null\n  ) {\n    super(ProviderId.PASSWORD, signInMethod);\n  }\n\n  /** @internal */\n  static _fromEmailAndPassword(\n    email: string,\n    password: string\n  ): EmailAuthCredential {\n    return new EmailAuthCredential(\n      email,\n      password,\n      SignInMethod.EMAIL_PASSWORD\n    );\n  }\n\n  /** @internal */\n  static _fromEmailAndCode(\n    email: string,\n    oobCode: string,\n    tenantId: string | null = null\n  ): EmailAuthCredential {\n    return new EmailAuthCredential(\n      email,\n      oobCode,\n      SignInMethod.EMAIL_LINK,\n      tenantId\n    );\n  }\n\n  /** {@inheritdoc AuthCredential.toJSON} */\n  toJSON(): object {\n    return {\n      email: this._email,\n      password: this._password,\n      signInMethod: this.signInMethod,\n      tenantId: this._tenantId\n    };\n  }\n\n  /**\n   * Static method to deserialize a JSON representation of an object into an {@link  AuthCredential}.\n   *\n   * @param json - Either `object` or the stringified representation of the object. When string is\n   * provided, `JSON.parse` would be called first.\n   *\n   * @returns If the JSON input does not represent an {@link AuthCredential}, null is returned.\n   */\n  static fromJSON(json: object | string): EmailAuthCredential | null {\n    const obj = typeof json === 'string' ? JSON.parse(json) : json;\n    if (obj?.email && obj?.password) {\n      if (obj.signInMethod === SignInMethod.EMAIL_PASSWORD) {\n        return this._fromEmailAndPassword(obj.email, obj.password);\n      } else if (obj.signInMethod === SignInMethod.EMAIL_LINK) {\n        return this._fromEmailAndCode(obj.email, obj.password, obj.tenantId);\n      }\n    }\n    return null;\n  }\n\n  /** @internal */\n  async _getIdTokenResponse(auth: AuthInternal): Promise<IdTokenResponse> {\n    switch (this.signInMethod) {\n      case SignInMethod.EMAIL_PASSWORD:\n        const request: SignInWithPasswordRequest = {\n          returnSecureToken: true,\n          email: this._email,\n          password: this._password,\n          clientType: RecaptchaClientType.WEB\n        };\n        return handleRecaptchaFlow(\n          auth,\n          request,\n          RecaptchaActionName.SIGN_IN_WITH_PASSWORD,\n          signInWithPassword\n        );\n      case SignInMethod.EMAIL_LINK:\n        return signInWithEmailLink(auth, {\n          email: this._email,\n          oobCode: this._password\n        });\n      default:\n        _fail(auth, AuthErrorCode.INTERNAL_ERROR);\n    }\n  }\n\n  /** @internal */\n  async _linkToIdToken(\n    auth: AuthInternal,\n    idToken: string\n  ): Promise<IdTokenResponse> {\n    switch (this.signInMethod) {\n      case SignInMethod.EMAIL_PASSWORD:\n        const request: SignUpRequest = {\n          idToken,\n          returnSecureToken: true,\n          email: this._email,\n          password: this._password,\n          clientType: RecaptchaClientType.WEB\n        };\n        return handleRecaptchaFlow(\n          auth,\n          request,\n          RecaptchaActionName.SIGN_UP_PASSWORD,\n          linkEmailPassword\n        );\n      case SignInMethod.EMAIL_LINK:\n        return signInWithEmailLinkForLinking(auth, {\n          idToken,\n          email: this._email,\n          oobCode: this._password\n        });\n      default:\n        _fail(auth, AuthErrorCode.INTERNAL_ERROR);\n    }\n  }\n\n  /** @internal */\n  _getReauthenticationResolver(auth: AuthInternal): Promise<IdTokenResponse> {\n    return this._getIdTokenResponse(auth);\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  _performSignInRequest,\n  Endpoint,\n  HttpMethod,\n  _addTidIfNecessary\n} from '../index';\nimport { IdTokenResponse } from '../../model/id_token';\nimport { Auth } from '../../model/public_types';\n\nexport interface SignInWithEmailLinkRequest {\n  email: string;\n  oobCode: string;\n  tenantId?: string;\n}\n\nexport interface SignInWithEmailLinkResponse extends IdTokenResponse {\n  email: string;\n  isNewUser: boolean;\n}\n\nexport async function signInWithEmailLink(\n  auth: Auth,\n  request: SignInWithEmailLinkRequest\n): Promise<SignInWithEmailLinkResponse> {\n  return _performSignInRequest<\n    SignInWithEmailLinkRequest,\n    SignInWithEmailLinkResponse\n  >(\n    auth,\n    HttpMethod.POST,\n    Endpoint.SIGN_IN_WITH_EMAIL_LINK,\n    _addTidIfNecessary(auth, request)\n  );\n}\n\nexport interface SignInWithEmailLinkForLinkingRequest\n  extends SignInWithEmailLinkRequest {\n  idToken: string;\n}\n\nexport async function signInWithEmailLinkForLinking(\n  auth: Auth,\n  request: SignInWithEmailLinkForLinkingRequest\n): Promise<SignInWithEmailLinkResponse> {\n  return _performSignInRequest<\n    SignInWithEmailLinkForLinkingRequest,\n    SignInWithEmailLinkResponse\n  >(\n    auth,\n    HttpMethod.POST,\n    Endpoint.SIGN_IN_WITH_EMAIL_LINK,\n    _addTidIfNecessary(auth, request)\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  Endpoint,\n  HttpMethod,\n  _addTidIfNecessary,\n  _performSignInRequest\n} from '../index';\nimport { IdToken, IdTokenResponse } from '../../model/id_token';\nimport { Auth } from '../../model/public_types';\n\nexport interface SignInWithIdpRequest {\n  requestUri: string;\n  postBody?: string;\n  sessionId?: string;\n  tenantId?: string;\n  returnSecureToken: boolean;\n  returnIdpCredential?: boolean;\n  idToken?: IdToken;\n  autoCreate?: boolean;\n  pendingToken?: string;\n}\n\n/**\n * @internal\n */\nexport interface SignInWithIdpResponse extends IdTokenResponse {\n  oauthAccessToken?: string;\n  oauthTokenSecret?: string;\n  nonce?: string;\n  oauthIdToken?: string;\n  pendingToken?: string;\n}\n\nexport async function signInWithIdp(\n  auth: Auth,\n  request: SignInWithIdpRequest\n): Promise<SignInWithIdpResponse> {\n  return _performSignInRequest<SignInWithIdpRequest, SignInWithIdpResponse>(\n    auth,\n    HttpMethod.POST,\n    Endpoint.SIGN_IN_WITH_IDP,\n    _addTidIfNecessary(auth, request)\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { querystring } from '@firebase/util';\n\nimport {\n  signInWithIdp,\n  SignInWithIdpRequest\n} from '../../api/authentication/idp';\nimport { AuthInternal } from '../../model/auth';\nimport { IdTokenResponse } from '../../model/id_token';\nimport { AuthErrorCode } from '../errors';\nimport { _fail } from '../util/assert';\nimport { AuthCredential } from './auth_credential';\n\nconst IDP_REQUEST_URI = 'http://localhost';\n\nexport interface OAuthCredentialParams {\n  // OAuth 2 uses either id token or access token\n  idToken?: string | null;\n  accessToken?: string | null;\n\n  // These fields are used with OAuth 1\n  oauthToken?: string;\n  secret?: string;\n  oauthTokenSecret?: string;\n\n  // Nonce is only set if pendingToken is not present\n  nonce?: string;\n  pendingToken?: string;\n\n  // Utilities\n  providerId: string;\n  signInMethod: string;\n}\n\n/**\n * Represents the OAuth credentials returned by an {@link OAuthProvider}.\n *\n * @remarks\n * Implementations specify the details about each auth provider's credential requirements.\n *\n * @public\n */\nexport class OAuthCredential extends AuthCredential {\n  /**\n   * The OAuth ID token associated with the credential if it belongs to an OIDC provider,\n   * such as `google.com`.\n   * @readonly\n   */\n  idToken?: string;\n  /**\n   * The OAuth access token associated with the credential if it belongs to an\n   * {@link OAuthProvider}, such as `facebook.com`, `twitter.com`, etc.\n   * @readonly\n   */\n  accessToken?: string;\n  /**\n   * The OAuth access token secret associated with the credential if it belongs to an OAuth 1.0\n   * provider, such as `twitter.com`.\n   * @readonly\n   */\n  secret?: string;\n\n  private nonce?: string;\n  private pendingToken: string | null = null;\n\n  /** @internal */\n  static _fromParams(params: OAuthCredentialParams): OAuthCredential {\n    const cred = new OAuthCredential(params.providerId, params.signInMethod);\n\n    if (params.idToken || params.accessToken) {\n      // OAuth 2 and either ID token or access token.\n      if (params.idToken) {\n        cred.idToken = params.idToken;\n      }\n\n      if (params.accessToken) {\n        cred.accessToken = params.accessToken;\n      }\n\n      // Add nonce if available and no pendingToken is present.\n      if (params.nonce && !params.pendingToken) {\n        cred.nonce = params.nonce;\n      }\n\n      if (params.pendingToken) {\n        cred.pendingToken = params.pendingToken;\n      }\n    } else if (params.oauthToken && params.oauthTokenSecret) {\n      // OAuth 1 and OAuth token with token secret\n      cred.accessToken = params.oauthToken;\n      cred.secret = params.oauthTokenSecret;\n    } else {\n      _fail(AuthErrorCode.ARGUMENT_ERROR);\n    }\n\n    return cred;\n  }\n\n  /** {@inheritdoc AuthCredential.toJSON}  */\n  toJSON(): object {\n    return {\n      idToken: this.idToken,\n      accessToken: this.accessToken,\n      secret: this.secret,\n      nonce: this.nonce,\n      pendingToken: this.pendingToken,\n      providerId: this.providerId,\n      signInMethod: this.signInMethod\n    };\n  }\n\n  /**\n   * Static method to deserialize a JSON representation of an object into an\n   * {@link  AuthCredential}.\n   *\n   * @param json - Input can be either Object or the stringified representation of the object.\n   * When string is provided, JSON.parse would be called first.\n   *\n   * @returns If the JSON input does not represent an {@link  AuthCredential}, null is returned.\n   */\n  static fromJSON(json: string | object): OAuthCredential | null {\n    const obj = typeof json === 'string' ? JSON.parse(json) : json;\n    const { providerId, signInMethod, ...rest }: OAuthCredentialParams = obj;\n    if (!providerId || !signInMethod) {\n      return null;\n    }\n\n    const cred = new OAuthCredential(providerId, signInMethod);\n    cred.idToken = rest.idToken || undefined;\n    cred.accessToken = rest.accessToken || undefined;\n    cred.secret = rest.secret;\n    cred.nonce = rest.nonce;\n    cred.pendingToken = rest.pendingToken || null;\n    return cred;\n  }\n\n  /** @internal */\n  _getIdTokenResponse(auth: AuthInternal): Promise<IdTokenResponse> {\n    const request = this.buildRequest();\n    return signInWithIdp(auth, request);\n  }\n\n  /** @internal */\n  _linkToIdToken(\n    auth: AuthInternal,\n    idToken: string\n  ): Promise<IdTokenResponse> {\n    const request = this.buildRequest();\n    request.idToken = idToken;\n    return signInWithIdp(auth, request);\n  }\n\n  /** @internal */\n  _getReauthenticationResolver(auth: AuthInternal): Promise<IdTokenResponse> {\n    const request = this.buildRequest();\n    request.autoCreate = false;\n    return signInWithIdp(auth, request);\n  }\n\n  private buildRequest(): SignInWithIdpRequest {\n    const request: SignInWithIdpRequest = {\n      requestUri: IDP_REQUEST_URI,\n      returnSecureToken: true\n    };\n\n    if (this.pendingToken) {\n      request.pendingToken = this.pendingToken;\n    } else {\n      const postBody: Record<string, string> = {};\n      if (this.idToken) {\n        postBody['id_token'] = this.idToken;\n      }\n      if (this.accessToken) {\n        postBody['access_token'] = this.accessToken;\n      }\n      if (this.secret) {\n        postBody['oauth_token_secret'] = this.secret;\n      }\n\n      postBody['providerId'] = this.providerId;\n      if (this.nonce && !this.pendingToken) {\n        postBody['nonce'] = this.nonce;\n      }\n\n      request.postBody = querystring(postBody);\n    }\n\n    return request;\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  Endpoint,\n  HttpMethod,\n  _addTidIfNecessary,\n  _makeTaggedError,\n  _performApiRequest,\n  _performSignInRequest\n} from '../index';\nimport { AuthErrorCode } from '../../core/errors';\nimport { IdTokenResponse } from '../../model/id_token';\nimport { ServerError, ServerErrorMap } from '../errors';\nimport { Auth } from '../../model/public_types';\n\nexport interface SendPhoneVerificationCodeRequest {\n  phoneNumber: string;\n  recaptchaToken: string;\n  tenantId?: string;\n}\n\nexport interface SendPhoneVerificationCodeResponse {\n  sessionInfo: string;\n}\n\nexport async function sendPhoneVerificationCode(\n  auth: Auth,\n  request: SendPhoneVerificationCodeRequest\n): Promise<SendPhoneVerificationCodeResponse> {\n  return _performApiRequest<\n    SendPhoneVerificationCodeRequest,\n    SendPhoneVerificationCodeResponse\n  >(\n    auth,\n    HttpMethod.POST,\n    Endpoint.SEND_VERIFICATION_CODE,\n    _addTidIfNecessary(auth, request)\n  );\n}\n\n/**\n * @internal\n */\nexport interface SignInWithPhoneNumberRequest {\n  temporaryProof?: string;\n  phoneNumber?: string;\n  sessionInfo?: string;\n  code?: string;\n  tenantId?: string;\n}\n\nexport interface LinkWithPhoneNumberRequest\n  extends SignInWithPhoneNumberRequest {\n  idToken: string;\n}\n\n/**\n * @internal\n */\nexport interface SignInWithPhoneNumberResponse extends IdTokenResponse {\n  temporaryProof?: string;\n  phoneNumber?: string;\n}\n\nexport async function signInWithPhoneNumber(\n  auth: Auth,\n  request: SignInWithPhoneNumberRequest\n): Promise<SignInWithPhoneNumberResponse> {\n  return _performSignInRequest<\n    SignInWithPhoneNumberRequest,\n    SignInWithPhoneNumberResponse\n  >(\n    auth,\n    HttpMethod.POST,\n    Endpoint.SIGN_IN_WITH_PHONE_NUMBER,\n    _addTidIfNecessary(auth, request)\n  );\n}\n\nexport async function linkWithPhoneNumber(\n  auth: Auth,\n  request: LinkWithPhoneNumberRequest\n): Promise<SignInWithPhoneNumberResponse> {\n  const response = await _performSignInRequest<\n    LinkWithPhoneNumberRequest,\n    SignInWithPhoneNumberResponse\n  >(\n    auth,\n    HttpMethod.POST,\n    Endpoint.SIGN_IN_WITH_PHONE_NUMBER,\n    _addTidIfNecessary(auth, request)\n  );\n  if (response.temporaryProof) {\n    throw _makeTaggedError(auth, AuthErrorCode.NEED_CONFIRMATION, response);\n  }\n  return response;\n}\n\ninterface VerifyPhoneNumberForExistingRequest\n  extends SignInWithPhoneNumberRequest {\n  operation: 'REAUTH';\n}\n\nconst VERIFY_PHONE_NUMBER_FOR_EXISTING_ERROR_MAP_: Partial<\n  ServerErrorMap<ServerError>\n> = {\n  [ServerError.USER_NOT_FOUND]: AuthErrorCode.USER_DELETED\n};\n\nexport async function verifyPhoneNumberForExisting(\n  auth: Auth,\n  request: SignInWithPhoneNumberRequest\n): Promise<SignInWithPhoneNumberResponse> {\n  const apiRequest: VerifyPhoneNumberForExistingRequest = {\n    ...request,\n    operation: 'REAUTH'\n  };\n  return _performSignInRequest<\n    VerifyPhoneNumberForExistingRequest,\n    SignInWithPhoneNumberResponse\n  >(\n    auth,\n    HttpMethod.POST,\n    Endpoint.SIGN_IN_WITH_PHONE_NUMBER,\n    _addTidIfNecessary(auth, apiRequest),\n    VERIFY_PHONE_NUMBER_FOR_EXISTING_ERROR_MAP_\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ProviderId, SignInMethod } from '../../model/enums';\n\nimport { PhoneOrOauthTokenResponse } from '../../api/authentication/mfa';\nimport {\n  linkWithPhoneNumber,\n  signInWithPhoneNumber,\n  SignInWithPhoneNumberRequest,\n  verifyPhoneNumberForExisting\n} from '../../api/authentication/sms';\nimport { AuthInternal } from '../../model/auth';\nimport { IdTokenResponse } from '../../model/id_token';\nimport { AuthCredential } from './auth_credential';\n\nexport interface PhoneAuthCredentialParameters {\n  verificationId?: string;\n  verificationCode?: string;\n  phoneNumber?: string;\n  temporaryProof?: string;\n}\n\n/**\n * Represents the credentials returned by {@link PhoneAuthProvider}.\n *\n * @public\n */\nexport class PhoneAuthCredential extends AuthCredential {\n  private constructor(private readonly params: PhoneAuthCredentialParameters) {\n    super(ProviderId.PHONE, SignInMethod.PHONE);\n  }\n\n  /** @internal */\n  static _fromVerification(\n    verificationId: string,\n    verificationCode: string\n  ): PhoneAuthCredential {\n    return new PhoneAuthCredential({ verificationId, verificationCode });\n  }\n\n  /** @internal */\n  static _fromTokenResponse(\n    phoneNumber: string,\n    temporaryProof: string\n  ): PhoneAuthCredential {\n    return new PhoneAuthCredential({ phoneNumber, temporaryProof });\n  }\n\n  /** @internal */\n  _getIdTokenResponse(auth: AuthInternal): Promise<PhoneOrOauthTokenResponse> {\n    return signInWithPhoneNumber(auth, this._makeVerificationRequest());\n  }\n\n  /** @internal */\n  _linkToIdToken(\n    auth: AuthInternal,\n    idToken: string\n  ): Promise<IdTokenResponse> {\n    return linkWithPhoneNumber(auth, {\n      idToken,\n      ...this._makeVerificationRequest()\n    });\n  }\n\n  /** @internal */\n  _getReauthenticationResolver(auth: AuthInternal): Promise<IdTokenResponse> {\n    return verifyPhoneNumberForExisting(auth, this._makeVerificationRequest());\n  }\n\n  /** @internal */\n  _makeVerificationRequest(): SignInWithPhoneNumberRequest {\n    const { temporaryProof, phoneNumber, verificationId, verificationCode } =\n      this.params;\n    if (temporaryProof && phoneNumber) {\n      return { temporaryProof, phoneNumber };\n    }\n\n    return {\n      sessionInfo: verificationId,\n      code: verificationCode\n    };\n  }\n\n  /** {@inheritdoc AuthCredential.toJSON} */\n  toJSON(): object {\n    const obj: Record<string, string> = {\n      providerId: this.providerId\n    };\n    if (this.params.phoneNumber) {\n      obj.phoneNumber = this.params.phoneNumber;\n    }\n    if (this.params.temporaryProof) {\n      obj.temporaryProof = this.params.temporaryProof;\n    }\n    if (this.params.verificationCode) {\n      obj.verificationCode = this.params.verificationCode;\n    }\n    if (this.params.verificationId) {\n      obj.verificationId = this.params.verificationId;\n    }\n\n    return obj;\n  }\n\n  /** Generates a phone credential based on a plain object or a JSON string. */\n  static fromJSON(json: object | string): PhoneAuthCredential | null {\n    if (typeof json === 'string') {\n      json = JSON.parse(json);\n    }\n\n    const { verificationId, verificationCode, phoneNumber, temporaryProof } =\n      json as { [key: string]: string };\n    if (\n      !verificationCode &&\n      !verificationId &&\n      !phoneNumber &&\n      !temporaryProof\n    ) {\n      return null;\n    }\n\n    return new PhoneAuthCredential({\n      verificationId,\n      verificationCode,\n      phoneNumber,\n      temporaryProof\n    });\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { extractQuerystring, querystringDecode } from '@firebase/util';\nimport { ActionCodeOperation } from '../model/public_types';\nimport { AuthErrorCode } from './errors';\nimport { _assert } from './util/assert';\n\n/**\n * Enums for fields in URL query string.\n *\n * @enum {string}\n */\nconst enum QueryField {\n  API_KEY = 'apiKey',\n  CODE = 'oobCode',\n  CONTINUE_URL = 'continueUrl',\n  LANGUAGE_CODE = 'languageCode',\n  MODE = 'mode',\n  TENANT_ID = 'tenantId'\n}\n\n/**\n * Maps the mode string in action code URL to Action Code Info operation.\n *\n * @param mode\n */\nfunction parseMode(mode: string | null): ActionCodeOperation | null {\n  switch (mode) {\n    case 'recoverEmail':\n      return ActionCodeOperation.RECOVER_EMAIL;\n    case 'resetPassword':\n      return ActionCodeOperation.PASSWORD_RESET;\n    case 'signIn':\n      return ActionCodeOperation.EMAIL_SIGNIN;\n    case 'verifyEmail':\n      return ActionCodeOperation.VERIFY_EMAIL;\n    case 'verifyAndChangeEmail':\n      return ActionCodeOperation.VERIFY_AND_CHANGE_EMAIL;\n    case 'revertSecondFactorAddition':\n      return ActionCodeOperation.REVERT_SECOND_FACTOR_ADDITION;\n    default:\n      return null;\n  }\n}\n\n/**\n * Helper to parse FDL links\n *\n * @param url\n */\nfunction parseDeepLink(url: string): string {\n  const link = querystringDecode(extractQuerystring(url))['link'];\n\n  // Double link case (automatic redirect).\n  const doubleDeepLink = link\n    ? querystringDecode(extractQuerystring(link))['deep_link_id']\n    : null;\n  // iOS custom scheme links.\n  const iOSDeepLink = querystringDecode(extractQuerystring(url))[\n    'deep_link_id'\n  ];\n  const iOSDoubleDeepLink = iOSDeepLink\n    ? querystringDecode(extractQuerystring(iOSDeepLink))['link']\n    : null;\n  return iOSDoubleDeepLink || iOSDeepLink || doubleDeepLink || link || url;\n}\n\n/**\n * A utility class to parse email action URLs such as password reset, email verification,\n * email link sign in, etc.\n *\n * @public\n */\nexport class ActionCodeURL {\n  /**\n   * The API key of the email action link.\n   */\n  readonly apiKey: string;\n  /**\n   * The action code of the email action link.\n   */\n  readonly code: string;\n  /**\n   * The continue URL of the email action link. Null if not provided.\n   */\n  readonly continueUrl: string | null;\n  /**\n   * The language code of the email action link. Null if not provided.\n   */\n  readonly languageCode: string | null;\n  /**\n   * The action performed by the email action link. It returns from one of the types from\n   * {@link ActionCodeInfo}\n   */\n  readonly operation: string;\n  /**\n   * The tenant ID of the email action link. Null if the email action is from the parent project.\n   */\n  readonly tenantId: string | null;\n\n  /**\n   * @param actionLink - The link from which to extract the URL.\n   * @returns The {@link ActionCodeURL} object, or null if the link is invalid.\n   *\n   * @internal\n   */\n  constructor(actionLink: string) {\n    const searchParams = querystringDecode(extractQuerystring(actionLink));\n    const apiKey = searchParams[QueryField.API_KEY] ?? null;\n    const code = searchParams[QueryField.CODE] ?? null;\n    const operation = parseMode(searchParams[QueryField.MODE] ?? null);\n    // Validate API key, code and mode.\n    _assert(apiKey && code && operation, AuthErrorCode.ARGUMENT_ERROR);\n    this.apiKey = apiKey;\n    this.operation = operation;\n    this.code = code;\n    this.continueUrl = searchParams[QueryField.CONTINUE_URL] ?? null;\n    this.languageCode = searchParams[QueryField.LANGUAGE_CODE] ?? null;\n    this.tenantId = searchParams[QueryField.TENANT_ID] ?? null;\n  }\n\n  /**\n   * Parses the email action link string and returns an {@link ActionCodeURL} if the link is valid,\n   * otherwise returns null.\n   *\n   * @param link  - The email action link string.\n   * @returns The {@link ActionCodeURL} object, or null if the link is invalid.\n   *\n   * @public\n   */\n  static parseLink(link: string): ActionCodeURL | null {\n    const actionLink = parseDeepLink(link);\n    try {\n      return new ActionCodeURL(actionLink);\n    } catch {\n      return null;\n    }\n  }\n}\n\n/**\n * Parses the email action link string and returns an {@link ActionCodeURL} if\n * the link is valid, otherwise returns null.\n *\n * @public\n */\nexport function parseActionCodeURL(link: string): ActionCodeURL | null {\n  return ActionCodeURL.parseLink(link);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ProviderId, SignInMethod } from '../../model/enums';\nimport { AuthProvider } from '../../model/public_types';\n\nimport { ActionCodeURL } from '../action_code_url';\nimport { EmailAuthCredential } from '../credentials/email';\nimport { AuthErrorCode } from '../errors';\nimport { _assert } from '../util/assert';\n\n/**\n * Provider for generating {@link EmailAuthCredential}.\n *\n * @public\n */\nexport class EmailAuthProvider implements AuthProvider {\n  /**\n   * Always set to {@link ProviderId}.PASSWORD, even for email link.\n   */\n  static readonly PROVIDER_ID: 'password' = ProviderId.PASSWORD;\n  /**\n   * Always set to {@link SignInMethod}.EMAIL_PASSWORD.\n   */\n  static readonly EMAIL_PASSWORD_SIGN_IN_METHOD: 'password' =\n    SignInMethod.EMAIL_PASSWORD;\n  /**\n   * Always set to {@link SignInMethod}.EMAIL_LINK.\n   */\n  static readonly EMAIL_LINK_SIGN_IN_METHOD: 'emailLink' =\n    SignInMethod.EMAIL_LINK;\n  /**\n   * Always set to {@link ProviderId}.PASSWORD, even for email link.\n   */\n  readonly providerId = EmailAuthProvider.PROVIDER_ID;\n\n  /**\n   * Initialize an {@link AuthCredential} using an email and password.\n   *\n   * @example\n   * ```javascript\n   * const authCredential = EmailAuthProvider.credential(email, password);\n   * const userCredential = await signInWithCredential(auth, authCredential);\n   * ```\n   *\n   * @example\n   * ```javascript\n   * const userCredential = await signInWithEmailAndPassword(auth, email, password);\n   * ```\n   *\n   * @param email - Email address.\n   * @param password - User account password.\n   * @returns The auth provider credential.\n   */\n  static credential(email: string, password: string): EmailAuthCredential {\n    return EmailAuthCredential._fromEmailAndPassword(email, password);\n  }\n\n  /**\n   * Initialize an {@link AuthCredential} using an email and an email link after a sign in with\n   * email link operation.\n   *\n   * @example\n   * ```javascript\n   * const authCredential = EmailAuthProvider.credentialWithLink(auth, email, emailLink);\n   * const userCredential = await signInWithCredential(auth, authCredential);\n   * ```\n   *\n   * @example\n   * ```javascript\n   * await sendSignInLinkToEmail(auth, email);\n   * // Obtain emailLink from user.\n   * const userCredential = await signInWithEmailLink(auth, email, emailLink);\n   * ```\n   *\n   * @param auth - The {@link Auth} instance used to verify the link.\n   * @param email - Email address.\n   * @param emailLink - Sign-in email link.\n   * @returns - The auth provider credential.\n   */\n  static credentialWithLink(\n    email: string,\n    emailLink: string\n  ): EmailAuthCredential {\n    const actionCodeUrl = ActionCodeURL.parseLink(emailLink);\n    _assert(actionCodeUrl, AuthErrorCode.ARGUMENT_ERROR);\n\n    return EmailAuthCredential._fromEmailAndCode(\n      email,\n      actionCodeUrl.code,\n      actionCodeUrl.tenantId\n    );\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AuthProvider } from '../../model/public_types';\n\n/**\n * Map of OAuth Custom Parameters.\n *\n * @public\n */\nexport type CustomParameters = Record<string, string>;\n\n/**\n * The base class for all Federated providers (OAuth (including OIDC), SAML).\n *\n * This class is not meant to be instantiated directly.\n *\n * @public\n */\nexport abstract class FederatedAuthProvider implements AuthProvider {\n  /** @internal */\n  defaultLanguageCode: string | null = null;\n  /** @internal */\n  private customParameters: CustomParameters = {};\n\n  /**\n   * Constructor for generic OAuth providers.\n   *\n   * @param providerId - Provider for which credentials should be generated.\n   */\n  constructor(readonly providerId: string) {}\n\n  /**\n   * Set the language gode.\n   *\n   * @param languageCode - language code\n   */\n  setDefaultLanguage(languageCode: string | null): void {\n    this.defaultLanguageCode = languageCode;\n  }\n\n  /**\n   * Sets the OAuth custom parameters to pass in an OAuth request for popup and redirect sign-in\n   * operations.\n   *\n   * @remarks\n   * For a detailed list, check the reserved required OAuth 2.0 parameters such as `client_id`,\n   * `redirect_uri`, `scope`, `response_type`, and `state` are not allowed and will be ignored.\n   *\n   * @param customOAuthParameters - The custom OAuth parameters to pass in the OAuth request.\n   */\n  setCustomParameters(customOAuthParameters: CustomParameters): AuthProvider {\n    this.customParameters = customOAuthParameters;\n    return this;\n  }\n\n  /**\n   * Retrieve the current list of {@link CustomParameters}.\n   */\n  getCustomParameters(): CustomParameters {\n    return this.customParameters;\n  }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AuthProvider, UserCredential } from '../../model/public_types';\n\nimport { _assert } from '../util/assert';\nimport { AuthErrorCode } from '../errors';\n\nimport { OAuthCredential, OAuthCredentialParams } from '../credentials/oauth';\nimport { UserCredentialInternal } from '../../model/user';\nimport { FirebaseError } from '@firebase/util';\nimport { TaggedWithTokenResponse } from '../../model/id_token';\nimport { SignInWithIdpResponse } from '../../../internal';\nimport { FederatedAuthProvider } from './federated';\n\n/**\n * Defines the options for initializing an {@link OAuthCredential}.\n *\n * @remarks\n * For ID tokens with nonce claim, the raw nonce has to also be provided.\n *\n * @public\n */\nexport interface OAuthCredentialOptions {\n  /**\n   * The OAuth ID token used to initialize the {@link OAuthCredential}.\n   */\n  idToken?: string;\n  /**\n   * The OAuth access token used to initialize the {@link OAuthCredential}.\n   */\n  accessToken?: string;\n  /**\n   * The raw nonce associated with the ID token.\n   *\n   * @remarks\n   * It is required when an ID token with a nonce field is provided. The SHA-256 hash of the\n   * raw nonce must match the nonce field in the ID token.\n   */\n  rawNonce?: string;\n}\n\n/**\n * Common code to all OAuth providers. This is separate from the\n * {@link OAuthProvider} so that child providers (like\n * {@link GoogleAuthProvider}) don't inherit the `credential` instance method.\n * Instead, they rely on a static `credential` method.\n */\nexport abstract class BaseOAuthProvider\n  extends FederatedAuthProvider\n  implements AuthProvider\n{\n  /** @internal */\n  private scopes: string[] = [];\n\n  /**\n   * Add an OAuth scope to the credential.\n   *\n   * @param scope - Provider OAuth scope to add.\n   */\n  addScope(scope: string): AuthProvider {\n    // If not already added, add scope to list.\n    if (!this.scopes.includes(scope)) {\n      this.scopes.push(scope);\n    }\n    return this;\n  }\n\n  /**\n   * Retrieve the current list of OAuth scopes.\n   */\n  getScopes(): string[] {\n    return [...this.scopes];\n  }\n}\n\n/**\n * Provider for generating generic {@link OAuthCredential}.\n *\n * @example\n * ```javascript\n * // Sign in using a redirect.\n * const provider = new OAuthProvider('google.com');\n * // Start a sign in process for an unauthenticated user.\n * provider.addScope('profile');\n * provider.addScope('email');\n * await signInWithRedirect(auth, provider);\n * // This will trigger a full page redirect away from your app\n *\n * // After returning from the redirect when your app initializes you can obtain the result\n * const result = await getRedirectResult(auth);\n * if (result) {\n *   // This is the signed-in user\n *   const user = result.user;\n *   // This gives you a OAuth Access Token for the provider.\n *   const credential = provider.credentialFromResult(auth, result);\n *   const token = credential.accessToken;\n * }\n * ```\n *\n * @example\n * ```javascript\n * // Sign in using a popup.\n * const provider = new OAuthProvider('google.com');\n * provider.addScope('profile');\n * provider.addScope('email');\n * const result = await signInWithPopup(auth, provider);\n *\n * // The signed-in user info.\n * const user = result.user;\n * // This gives you a OAuth Access Token for the provider.\n * const credential = provider.credentialFromResult(auth, result);\n * const token = credential.accessToken;\n * ```\n * @public\n */\nexport class OAuthProvider extends BaseOAuthProvider {\n  /**\n   * Creates an {@link OAuthCredential} from a JSON string or a plain object.\n   * @param json - A plain object or a JSON string\n   */\n  static credentialFromJSON(json: object | string): OAuthCredential {\n    const obj = typeof json === 'string' ? JSON.parse(json) : json;\n    _assert(\n      'providerId' in obj && 'signInMethod' in obj,\n      AuthErrorCode.ARGUMENT_ERROR\n    );\n    return OAuthCredential._fromParams(obj);\n  }\n\n  /**\n   * Creates a {@link OAuthCredential} from a generic OAuth provider's access token or ID token.\n   *\n   * @remarks\n   * The raw nonce is required when an ID token with a nonce field is provided. The SHA-256 hash of\n   * the raw nonce must match the nonce field in the ID token.\n   *\n   * @example\n   * ```javascript\n   * // `googleUser` from the onsuccess Google Sign In callback.\n   * // Initialize a generate OAuth provider with a `google.com` providerId.\n   * const provider = new OAuthProvider('google.com');\n   * const credential = provider.credential({\n   *   idToken: googleUser.getAuthResponse().id_token,\n   * });\n   * const result = await signInWithCredential(credential);\n   * ```\n   *\n   * @param params - Either the options object containing the ID token, access token and raw nonce\n   * or the ID token string.\n   */\n  credential(params: OAuthCredentialOptions): OAuthCredential {\n    return this._credential({ ...params, nonce: params.rawNonce });\n  }\n\n  /** An internal credential method that accepts more permissive options */\n  private _credential(\n    params: Omit<OAuthCredentialParams, 'signInMethod' | 'providerId'>\n  ): OAuthCredential {\n    _assert(params.idToken || params.accessToken, AuthErrorCode.ARGUMENT_ERROR);\n    // For OAuthCredential, sign in method is same as providerId.\n    return OAuthCredential._fromParams({\n      ...params,\n      providerId: this.providerId,\n      signInMethod: this.providerId\n    });\n  }\n\n  /**\n   * Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}.\n   *\n   * @param userCredential - The user credential.\n   */\n  static credentialFromResult(\n    userCredential: UserCredential\n  ): OAuthCredential | null {\n    return OAuthProvider.oauthCredentialFromTaggedObject(\n      userCredential as UserCredentialInternal\n    );\n  }\n  /**\n   * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was\n   * thrown during a sign-in, link, or reauthenticate operation.\n   *\n   * @param userCredential - The user credential.\n   */\n  static credentialFromError(error: FirebaseError): OAuthCredential | null {\n    return OAuthProvider.oauthCredentialFromTaggedObject(\n      (error.customData || {}) as TaggedWithTokenResponse\n    );\n  }\n\n  private static oauthCredentialFromTaggedObject({\n    _tokenResponse: tokenResponse\n  }: TaggedWithTokenResponse): OAuthCredential | null {\n    if (!tokenResponse) {\n      return null;\n    }\n\n    const {\n      oauthIdToken,\n      oauthAccessToken,\n      oauthTokenSecret,\n      pendingToken,\n      nonce,\n      providerId\n    } = tokenResponse as SignInWithIdpResponse;\n    if (\n      !oauthAccessToken &&\n      !oauthTokenSecret &&\n      !oauthIdToken &&\n      !pendingToken\n    ) {\n      return null;\n    }\n\n    if (!providerId) {\n      return null;\n    }\n\n    try {\n      return new OAuthProvider(providerId)._credential({\n        idToken: oauthIdToken,\n        accessToken: oauthAccessToken,\n        nonce,\n        pendingToken\n      });\n    } catch (e) {\n      return null;\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { UserCredential } from '../../model/public_types';\nimport { FirebaseError } from '@firebase/util';\n\nimport { TaggedWithTokenResponse } from '../../model/id_token';\nimport { UserCredentialInternal } from '../../model/user';\nimport { OAuthCredential } from '../credentials/oauth';\nimport { BaseOAuthProvider } from './oauth';\nimport { ProviderId, SignInMethod } from '../../model/enums';\n\n/**\n * Provider for generating an {@link OAuthCredential} for {@link ProviderId}.FACEBOOK.\n *\n * @example\n * ```javascript\n * // Sign in using a redirect.\n * const provider = new FacebookAuthProvider();\n * // Start a sign in process for an unauthenticated user.\n * provider.addScope('user_birthday');\n * await signInWithRedirect(auth, provider);\n * // This will trigger a full page redirect away from your app\n *\n * // After returning from the redirect when your app initializes you can obtain the result\n * const result = await getRedirectResult(auth);\n * if (result) {\n *   // This is the signed-in user\n *   const user = result.user;\n *   // This gives you a Facebook Access Token.\n *   const credential = FacebookAuthProvider.credentialFromResult(result);\n *   const token = credential.accessToken;\n * }\n * ```\n *\n * @example\n * ```javascript\n * // Sign in using a popup.\n * const provider = new FacebookAuthProvider();\n * provider.addScope('user_birthday');\n * const result = await signInWithPopup(auth, provider);\n *\n * // The signed-in user info.\n * const user = result.user;\n * // This gives you a Facebook Access Token.\n * const credential = FacebookAuthProvider.credentialFromResult(result);\n * const token = credential.accessToken;\n * ```\n *\n * @public\n */\nexport class FacebookAuthProvider extends BaseOAuthProvider {\n  /** Always set to {@link SignInMethod}.FACEBOOK. */\n  static readonly FACEBOOK_SIGN_IN_METHOD: 'facebook.com' =\n    SignInMethod.FACEBOOK;\n  /** Always set to {@link ProviderId}.FACEBOOK. */\n  static readonly PROVIDER_ID: 'facebook.com' = ProviderId.FACEBOOK;\n\n  constructor() {\n    super(ProviderId.FACEBOOK);\n  }\n\n  /**\n   * Creates a credential for Facebook.\n   *\n   * @example\n   * ```javascript\n   * // `event` from the Facebook auth.authResponseChange callback.\n   * const credential = FacebookAuthProvider.credential(event.authResponse.accessToken);\n   * const result = await signInWithCredential(credential);\n   * ```\n   *\n   * @param accessToken - Facebook access token.\n   */\n  static credential(accessToken: string): OAuthCredential {\n    return OAuthCredential._fromParams({\n      providerId: FacebookAuthProvider.PROVIDER_ID,\n      signInMethod: FacebookAuthProvider.FACEBOOK_SIGN_IN_METHOD,\n      accessToken\n    });\n  }\n\n  /**\n   * Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}.\n   *\n   * @param userCredential - The user credential.\n   */\n  static credentialFromResult(\n    userCredential: UserCredential\n  ): OAuthCredential | null {\n    return FacebookAuthProvider.credentialFromTaggedObject(\n      userCredential as UserCredentialInternal\n    );\n  }\n\n  /**\n   * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was\n   * thrown during a sign-in, link, or reauthenticate operation.\n   *\n   * @param userCredential - The user credential.\n   */\n  static credentialFromError(error: FirebaseError): OAuthCredential | null {\n    return FacebookAuthProvider.credentialFromTaggedObject(\n      (error.customData || {}) as TaggedWithTokenResponse\n    );\n  }\n\n  private static credentialFromTaggedObject({\n    _tokenResponse: tokenResponse\n  }: TaggedWithTokenResponse): OAuthCredential | null {\n    if (!tokenResponse || !('oauthAccessToken' in tokenResponse)) {\n      return null;\n    }\n\n    if (!tokenResponse.oauthAccessToken) {\n      return null;\n    }\n\n    try {\n      return FacebookAuthProvider.credential(tokenResponse.oauthAccessToken);\n    } catch {\n      return null;\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { UserCredential } from '../../model/public_types';\nimport { FirebaseError } from '@firebase/util';\n\nimport { SignInWithIdpResponse } from '../../api/authentication/idp';\nimport { TaggedWithTokenResponse } from '../../model/id_token';\nimport { UserCredentialInternal } from '../../model/user';\nimport { OAuthCredential } from '../credentials/oauth';\nimport { BaseOAuthProvider } from './oauth';\nimport { ProviderId, SignInMethod } from '../../model/enums';\n\n/**\n * Provider for generating an {@link OAuthCredential} for {@link ProviderId}.GOOGLE.\n *\n * @example\n * ```javascript\n * // Sign in using a redirect.\n * const provider = new GoogleAuthProvider();\n * // Start a sign in process for an unauthenticated user.\n * provider.addScope('profile');\n * provider.addScope('email');\n * await signInWithRedirect(auth, provider);\n * // This will trigger a full page redirect away from your app\n *\n * // After returning from the redirect when your app initializes you can obtain the result\n * const result = await getRedirectResult(auth);\n * if (result) {\n *   // This is the signed-in user\n *   const user = result.user;\n *   // This gives you a Google Access Token.\n *   const credential = GoogleAuthProvider.credentialFromResult(result);\n *   const token = credential.accessToken;\n * }\n * ```\n *\n * @example\n * ```javascript\n * // Sign in using a popup.\n * const provider = new GoogleAuthProvider();\n * provider.addScope('profile');\n * provider.addScope('email');\n * const result = await signInWithPopup(auth, provider);\n *\n * // The signed-in user info.\n * const user = result.user;\n * // This gives you a Google Access Token.\n * const credential = GoogleAuthProvider.credentialFromResult(result);\n * const token = credential.accessToken;\n * ```\n *\n * @public\n */\nexport class GoogleAuthProvider extends BaseOAuthProvider {\n  /** Always set to {@link SignInMethod}.GOOGLE. */\n  static readonly GOOGLE_SIGN_IN_METHOD: 'google.com' = SignInMethod.GOOGLE;\n  /** Always set to {@link ProviderId}.GOOGLE. */\n  static readonly PROVIDER_ID: 'google.com' = ProviderId.GOOGLE;\n\n  constructor() {\n    super(ProviderId.GOOGLE);\n    this.addScope('profile');\n  }\n\n  /**\n   * Creates a credential for Google. At least one of ID token and access token is required.\n   *\n   * @example\n   * ```javascript\n   * // \\`googleUser\\` from the onsuccess Google Sign In callback.\n   * const credential = GoogleAuthProvider.credential(googleUser.getAuthResponse().id_token);\n   * const result = await signInWithCredential(credential);\n   * ```\n   *\n   * @param idToken - Google ID token.\n   * @param accessToken - Google access token.\n   */\n  static credential(\n    idToken?: string | null,\n    accessToken?: string | null\n  ): OAuthCredential {\n    return OAuthCredential._fromParams({\n      providerId: GoogleAuthProvider.PROVIDER_ID,\n      signInMethod: GoogleAuthProvider.GOOGLE_SIGN_IN_METHOD,\n      idToken,\n      accessToken\n    });\n  }\n\n  /**\n   * Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}.\n   *\n   * @param userCredential - The user credential.\n   */\n  static credentialFromResult(\n    userCredential: UserCredential\n  ): OAuthCredential | null {\n    return GoogleAuthProvider.credentialFromTaggedObject(\n      userCredential as UserCredentialInternal\n    );\n  }\n  /**\n   * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was\n   * thrown during a sign-in, link, or reauthenticate operation.\n   *\n   * @param userCredential - The user credential.\n   */\n  static credentialFromError(error: FirebaseError): OAuthCredential | null {\n    return GoogleAuthProvider.credentialFromTaggedObject(\n      (error.customData || {}) as TaggedWithTokenResponse\n    );\n  }\n\n  private static credentialFromTaggedObject({\n    _tokenResponse: tokenResponse\n  }: TaggedWithTokenResponse): OAuthCredential | null {\n    if (!tokenResponse) {\n      return null;\n    }\n\n    const { oauthIdToken, oauthAccessToken } =\n      tokenResponse as SignInWithIdpResponse;\n    if (!oauthIdToken && !oauthAccessToken) {\n      // This could be an oauth 1 credential or a phone credential\n      return null;\n    }\n\n    try {\n      return GoogleAuthProvider.credential(oauthIdToken, oauthAccessToken);\n    } catch {\n      return null;\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { UserCredential } from '../../model/public_types';\nimport { FirebaseError } from '@firebase/util';\n\nimport { TaggedWithTokenResponse } from '../../model/id_token';\nimport { UserCredentialInternal } from '../../model/user';\nimport { OAuthCredential } from '../credentials/oauth';\nimport { BaseOAuthProvider } from './oauth';\nimport { ProviderId, SignInMethod } from '../../model/enums';\n\n/**\n * Provider for generating an {@link OAuthCredential} for {@link ProviderId}.GITHUB.\n *\n * @remarks\n * GitHub requires an OAuth 2.0 redirect, so you can either handle the redirect directly, or use\n * the {@link signInWithPopup} handler:\n *\n * @example\n * ```javascript\n * // Sign in using a redirect.\n * const provider = new GithubAuthProvider();\n * // Start a sign in process for an unauthenticated user.\n * provider.addScope('repo');\n * await signInWithRedirect(auth, provider);\n * // This will trigger a full page redirect away from your app\n *\n * // After returning from the redirect when your app initializes you can obtain the result\n * const result = await getRedirectResult(auth);\n * if (result) {\n *   // This is the signed-in user\n *   const user = result.user;\n *   // This gives you a Github Access Token.\n *   const credential = GithubAuthProvider.credentialFromResult(result);\n *   const token = credential.accessToken;\n * }\n * ```\n *\n * @example\n * ```javascript\n * // Sign in using a popup.\n * const provider = new GithubAuthProvider();\n * provider.addScope('repo');\n * const result = await signInWithPopup(auth, provider);\n *\n * // The signed-in user info.\n * const user = result.user;\n * // This gives you a Github Access Token.\n * const credential = GithubAuthProvider.credentialFromResult(result);\n * const token = credential.accessToken;\n * ```\n * @public\n */\nexport class GithubAuthProvider extends BaseOAuthProvider {\n  /** Always set to {@link SignInMethod}.GITHUB. */\n  static readonly GITHUB_SIGN_IN_METHOD: 'github.com' = SignInMethod.GITHUB;\n  /** Always set to {@link ProviderId}.GITHUB. */\n  static readonly PROVIDER_ID: 'github.com' = ProviderId.GITHUB;\n\n  constructor() {\n    super(ProviderId.GITHUB);\n  }\n\n  /**\n   * Creates a credential for Github.\n   *\n   * @param accessToken - Github access token.\n   */\n  static credential(accessToken: string): OAuthCredential {\n    return OAuthCredential._fromParams({\n      providerId: GithubAuthProvider.PROVIDER_ID,\n      signInMethod: GithubAuthProvider.GITHUB_SIGN_IN_METHOD,\n      accessToken\n    });\n  }\n\n  /**\n   * Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}.\n   *\n   * @param userCredential - The user credential.\n   */\n  static credentialFromResult(\n    userCredential: UserCredential\n  ): OAuthCredential | null {\n    return GithubAuthProvider.credentialFromTaggedObject(\n      userCredential as UserCredentialInternal\n    );\n  }\n\n  /**\n   * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was\n   * thrown during a sign-in, link, or reauthenticate operation.\n   *\n   * @param userCredential - The user credential.\n   */\n  static credentialFromError(error: FirebaseError): OAuthCredential | null {\n    return GithubAuthProvider.credentialFromTaggedObject(\n      (error.customData || {}) as TaggedWithTokenResponse\n    );\n  }\n\n  private static credentialFromTaggedObject({\n    _tokenResponse: tokenResponse\n  }: TaggedWithTokenResponse): OAuthCredential | null {\n    if (!tokenResponse || !('oauthAccessToken' in tokenResponse)) {\n      return null;\n    }\n\n    if (!tokenResponse.oauthAccessToken) {\n      return null;\n    }\n\n    try {\n      return GithubAuthProvider.credential(tokenResponse.oauthAccessToken);\n    } catch {\n      return null;\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Represents the SAML credentials returned by an {@link SAMLAuthProvider}.\n *\n * @public\n */\n\nimport {\n  signInWithIdp,\n  SignInWithIdpRequest\n} from '../../api/authentication/idp';\nimport { AuthInternal } from '../../model/auth';\nimport { IdTokenResponse } from '../../model/id_token';\nimport { AuthCredential } from './auth_credential';\n\nconst IDP_REQUEST_URI = 'http://localhost';\n\n/**\n * @public\n */\nexport class SAMLAuthCredential extends AuthCredential {\n  /** @internal */\n  private constructor(\n    providerId: string,\n    private readonly pendingToken: string\n  ) {\n    super(providerId, providerId);\n  }\n\n  /** @internal */\n  _getIdTokenResponse(auth: AuthInternal): Promise<IdTokenResponse> {\n    const request = this.buildRequest();\n    return signInWithIdp(auth, request);\n  }\n\n  /** @internal */\n  _linkToIdToken(\n    auth: AuthInternal,\n    idToken: string\n  ): Promise<IdTokenResponse> {\n    const request = this.buildRequest();\n    request.idToken = idToken;\n    return signInWithIdp(auth, request);\n  }\n\n  /** @internal */\n  _getReauthenticationResolver(auth: AuthInternal): Promise<IdTokenResponse> {\n    const request = this.buildRequest();\n    request.autoCreate = false;\n    return signInWithIdp(auth, request);\n  }\n\n  /** {@inheritdoc AuthCredential.toJSON}  */\n  toJSON(): object {\n    return {\n      signInMethod: this.signInMethod,\n      providerId: this.providerId,\n      pendingToken: this.pendingToken\n    };\n  }\n\n  /**\n   * Static method to deserialize a JSON representation of an object into an\n   * {@link  AuthCredential}.\n   *\n   * @param json - Input can be either Object or the stringified representation of the object.\n   * When string is provided, JSON.parse would be called first.\n   *\n   * @returns If the JSON input does not represent an {@link  AuthCredential}, null is returned.\n   */\n  static fromJSON(json: string | object): SAMLAuthCredential | null {\n    const obj = typeof json === 'string' ? JSON.parse(json) : json;\n    const { providerId, signInMethod, pendingToken }: Record<string, string> =\n      obj;\n    if (\n      !providerId ||\n      !signInMethod ||\n      !pendingToken ||\n      providerId !== signInMethod\n    ) {\n      return null;\n    }\n\n    return new SAMLAuthCredential(providerId, pendingToken);\n  }\n\n  /**\n   * Helper static method to avoid exposing the constructor to end users.\n   *\n   * @internal\n   */\n  static _create(providerId: string, pendingToken: string): SAMLAuthCredential {\n    return new SAMLAuthCredential(providerId, pendingToken);\n  }\n\n  private buildRequest(): SignInWithIdpRequest {\n    return {\n      requestUri: IDP_REQUEST_URI,\n      returnSecureToken: true,\n      pendingToken: this.pendingToken\n    };\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseError } from '@firebase/util';\nimport { SignInWithIdpResponse } from '../../api/authentication/idp';\nimport { TaggedWithTokenResponse } from '../../model/id_token';\nimport { UserCredential } from '../../model/public_types';\nimport { UserCredentialInternal } from '../../model/user';\nimport { AuthCredential } from '../credentials';\nimport { SAMLAuthCredential } from '../credentials/saml';\nimport { AuthErrorCode } from '../errors';\nimport { _assert } from '../util/assert';\nimport { FederatedAuthProvider } from './federated';\n\nconst SAML_PROVIDER_PREFIX = 'saml.';\n\n/**\n * An {@link AuthProvider} for SAML.\n *\n * @public\n */\nexport class SAMLAuthProvider extends FederatedAuthProvider {\n  /**\n   * Constructor. The providerId must start with \"saml.\"\n   * @param providerId - SAML provider ID.\n   */\n  constructor(providerId: string) {\n    _assert(\n      providerId.startsWith(SAML_PROVIDER_PREFIX),\n      AuthErrorCode.ARGUMENT_ERROR\n    );\n    super(providerId);\n  }\n\n  /**\n   * Generates an {@link AuthCredential} from a {@link UserCredential} after a\n   * successful SAML flow completes.\n   *\n   * @remarks\n   *\n   * For example, to get an {@link AuthCredential}, you could write the\n   * following code:\n   *\n   * ```js\n   * const userCredential = await signInWithPopup(auth, samlProvider);\n   * const credential = SAMLAuthProvider.credentialFromResult(userCredential);\n   * ```\n   *\n   * @param userCredential - The user credential.\n   */\n  static credentialFromResult(\n    userCredential: UserCredential\n  ): AuthCredential | null {\n    return SAMLAuthProvider.samlCredentialFromTaggedObject(\n      userCredential as UserCredentialInternal\n    );\n  }\n\n  /**\n   * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was\n   * thrown during a sign-in, link, or reauthenticate operation.\n   *\n   * @param userCredential - The user credential.\n   */\n  static credentialFromError(error: FirebaseError): AuthCredential | null {\n    return SAMLAuthProvider.samlCredentialFromTaggedObject(\n      (error.customData || {}) as TaggedWithTokenResponse\n    );\n  }\n\n  /**\n   * Creates an {@link AuthCredential} from a JSON string or a plain object.\n   * @param json - A plain object or a JSON string\n   */\n  static credentialFromJSON(json: string | object): AuthCredential {\n    const credential = SAMLAuthCredential.fromJSON(json);\n    _assert(credential, AuthErrorCode.ARGUMENT_ERROR);\n    return credential;\n  }\n\n  private static samlCredentialFromTaggedObject({\n    _tokenResponse: tokenResponse\n  }: TaggedWithTokenResponse): SAMLAuthCredential | null {\n    if (!tokenResponse) {\n      return null;\n    }\n\n    const { pendingToken, providerId } = tokenResponse as SignInWithIdpResponse;\n\n    if (!pendingToken || !providerId) {\n      return null;\n    }\n\n    try {\n      return SAMLAuthCredential._create(providerId, pendingToken);\n    } catch (e) {\n      return null;\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @license\n * Copyright 2020 Twitter LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { UserCredential } from '../../model/public_types';\nimport { FirebaseError } from '@firebase/util';\n\nimport { SignInWithIdpResponse } from '../../api/authentication/idp';\nimport { TaggedWithTokenResponse } from '../../model/id_token';\nimport { UserCredentialInternal } from '../../model/user';\nimport { OAuthCredential } from '../credentials/oauth';\nimport { BaseOAuthProvider } from './oauth';\nimport { ProviderId, SignInMethod } from '../../model/enums';\n\n/**\n * Provider for generating an {@link OAuthCredential} for {@link ProviderId}.TWITTER.\n *\n * @example\n * ```javascript\n * // Sign in using a redirect.\n * const provider = new TwitterAuthProvider();\n * // Start a sign in process for an unauthenticated user.\n * await signInWithRedirect(auth, provider);\n * // This will trigger a full page redirect away from your app\n *\n * // After returning from the redirect when your app initializes you can obtain the result\n * const result = await getRedirectResult(auth);\n * if (result) {\n *   // This is the signed-in user\n *   const user = result.user;\n *   // This gives you a Twitter Access Token and Secret.\n *   const credential = TwitterAuthProvider.credentialFromResult(result);\n *   const token = credential.accessToken;\n *   const secret = credential.secret;\n * }\n * ```\n *\n * @example\n * ```javascript\n * // Sign in using a popup.\n * const provider = new TwitterAuthProvider();\n * const result = await signInWithPopup(auth, provider);\n *\n * // The signed-in user info.\n * const user = result.user;\n * // This gives you a Twitter Access Token and Secret.\n * const credential = TwitterAuthProvider.credentialFromResult(result);\n * const token = credential.accessToken;\n * const secret = credential.secret;\n * ```\n *\n * @public\n */\nexport class TwitterAuthProvider extends BaseOAuthProvider {\n  /** Always set to {@link SignInMethod}.TWITTER. */\n  static readonly TWITTER_SIGN_IN_METHOD: 'twitter.com' = SignInMethod.TWITTER;\n  /** Always set to {@link ProviderId}.TWITTER. */\n  static readonly PROVIDER_ID: 'twitter.com' = ProviderId.TWITTER;\n\n  constructor() {\n    super(ProviderId.TWITTER);\n  }\n\n  /**\n   * Creates a credential for Twitter.\n   *\n   * @param token - Twitter access token.\n   * @param secret - Twitter secret.\n   */\n  static credential(token: string, secret: string): OAuthCredential {\n    return OAuthCredential._fromParams({\n      providerId: TwitterAuthProvider.PROVIDER_ID,\n      signInMethod: TwitterAuthProvider.TWITTER_SIGN_IN_METHOD,\n      oauthToken: token,\n      oauthTokenSecret: secret\n    });\n  }\n\n  /**\n   * Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}.\n   *\n   * @param userCredential - The user credential.\n   */\n  static credentialFromResult(\n    userCredential: UserCredential\n  ): OAuthCredential | null {\n    return TwitterAuthProvider.credentialFromTaggedObject(\n      userCredential as UserCredentialInternal\n    );\n  }\n\n  /**\n   * Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was\n   * thrown during a sign-in, link, or reauthenticate operation.\n   *\n   * @param userCredential - The user credential.\n   */\n  static credentialFromError(error: FirebaseError): OAuthCredential | null {\n    return TwitterAuthProvider.credentialFromTaggedObject(\n      (error.customData || {}) as TaggedWithTokenResponse\n    );\n  }\n\n  private static credentialFromTaggedObject({\n    _tokenResponse: tokenResponse\n  }: TaggedWithTokenResponse): OAuthCredential | null {\n    if (!tokenResponse) {\n      return null;\n    }\n    const { oauthAccessToken, oauthTokenSecret } =\n      tokenResponse as SignInWithIdpResponse;\n    if (!oauthAccessToken || !oauthTokenSecret) {\n      return null;\n    }\n\n    try {\n      return TwitterAuthProvider.credential(oauthAccessToken, oauthTokenSecret);\n    } catch {\n      return null;\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  Endpoint,\n  HttpMethod,\n  RecaptchaClientType,\n  RecaptchaVersion,\n  _addTidIfNecessary,\n  _performSignInRequest\n} from '../index';\nimport { IdTokenResponse } from '../../model/id_token';\nimport { Auth } from '../../model/public_types';\n\nexport interface SignUpRequest {\n  idToken?: string;\n  returnSecureToken?: boolean;\n  email?: string;\n  password?: string;\n  tenantId?: string;\n  captchaResponse?: string;\n  clientType?: RecaptchaClientType;\n  recaptchaVersion?: RecaptchaVersion;\n}\n\nexport interface SignUpResponse extends IdTokenResponse {\n  displayName?: string;\n  email?: string;\n}\n\nexport async function signUp(\n  auth: Auth,\n  request: SignUpRequest\n): Promise<SignUpResponse> {\n  return _performSignInRequest<SignUpRequest, SignUpResponse>(\n    auth,\n    HttpMethod.POST,\n    Endpoint.SIGN_UP,\n    _addTidIfNecessary(auth, request)\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { PhoneOrOauthTokenResponse } from '../../api/authentication/mfa';\nimport { IdTokenResponse } from '../../model/id_token';\nimport { UserInternal, UserCredentialInternal } from '../../model/user';\nimport { UserImpl } from './user_impl';\nimport { AuthInternal } from '../../model/auth';\nimport { OperationType, ProviderId } from '../../model/enums';\n\ninterface UserCredentialParams {\n  readonly user: UserInternal;\n  readonly providerId: ProviderId | string | null;\n  readonly _tokenResponse?: PhoneOrOauthTokenResponse;\n  readonly operationType: OperationType;\n}\n\nexport class UserCredentialImpl\n  implements UserCredentialInternal, UserCredentialParams\n{\n  readonly user: UserInternal;\n  readonly providerId: ProviderId | string | null;\n  readonly _tokenResponse: PhoneOrOauthTokenResponse | undefined;\n  readonly operationType: OperationType;\n\n  constructor(params: UserCredentialParams) {\n    this.user = params.user;\n    this.providerId = params.providerId;\n    this._tokenResponse = params._tokenResponse;\n    this.operationType = params.operationType;\n  }\n\n  static async _fromIdTokenResponse(\n    auth: AuthInternal,\n    operationType: OperationType,\n    idTokenResponse: IdTokenResponse,\n    isAnonymous: boolean = false\n  ): Promise<UserCredentialInternal> {\n    const user = await UserImpl._fromIdTokenResponse(\n      auth,\n      idTokenResponse,\n      isAnonymous\n    );\n    const providerId = providerIdForResponse(idTokenResponse);\n    const userCred = new UserCredentialImpl({\n      user,\n      providerId,\n      _tokenResponse: idTokenResponse,\n      operationType\n    });\n    return userCred;\n  }\n\n  static async _forOperation(\n    user: UserInternal,\n    operationType: OperationType,\n    response: PhoneOrOauthTokenResponse\n  ): Promise<UserCredentialImpl> {\n    await user._updateTokensIfNecessary(response, /* reload */ true);\n    const providerId = providerIdForResponse(response);\n    return new UserCredentialImpl({\n      user,\n      providerId,\n      _tokenResponse: response,\n      operationType\n    });\n  }\n}\n\nfunction providerIdForResponse(\n  response: IdTokenResponse\n): ProviderId | string | null {\n  if (response.providerId) {\n    return response.providerId;\n  }\n\n  if ('phoneNumber' in response) {\n    return ProviderId.PHONE;\n  }\n\n  return null;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MultiFactorError as MultiFactorErrorPublic } from '../model/public_types';\nimport { FirebaseError } from '@firebase/util';\nimport { AuthInternal } from '../model/auth';\nimport { IdTokenResponse } from '../model/id_token';\nimport { AuthErrorCode } from '../core/errors';\nimport { UserInternal } from '../model/user';\nimport { AuthCredential } from '../core/credentials';\nimport { IdTokenMfaResponse } from '../api/authentication/mfa';\nimport { OperationType } from '../model/enums';\n\nexport type MultiFactorErrorData = MultiFactorErrorPublic['customData'] & {\n  _serverResponse: IdTokenMfaResponse;\n};\n\nexport class MultiFactorError\n  extends FirebaseError\n  implements MultiFactorErrorPublic\n{\n  readonly customData: MultiFactorErrorData;\n\n  private constructor(\n    auth: AuthInternal,\n    error: FirebaseError,\n    readonly operationType: OperationType,\n    readonly user?: UserInternal\n  ) {\n    super(error.code, error.message);\n    // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n    Object.setPrototypeOf(this, MultiFactorError.prototype);\n    this.customData = {\n      appName: auth.name,\n      tenantId: auth.tenantId ?? undefined,\n      _serverResponse: error.customData!._serverResponse as IdTokenMfaResponse,\n      operationType\n    };\n  }\n\n  static _fromErrorAndOperation(\n    auth: AuthInternal,\n    error: FirebaseError,\n    operationType: OperationType,\n    user?: UserInternal\n  ): MultiFactorError {\n    return new MultiFactorError(auth, error, operationType, user);\n  }\n}\n\nexport function _processCredentialSavingMfaContextIfNecessary(\n  auth: AuthInternal,\n  operationType: OperationType,\n  credential: AuthCredential,\n  user?: UserInternal\n): Promise<IdTokenResponse> {\n  const idTokenProvider =\n    operationType === OperationType.REAUTHENTICATE\n      ? credential._getReauthenticationResolver(auth)\n      : credential._getIdTokenResponse(auth);\n\n  return idTokenProvider.catch(error => {\n    if (error.code === `auth/${AuthErrorCode.MFA_REQUIRED}`) {\n      throw MultiFactorError._fromErrorAndOperation(\n        auth,\n        error,\n        operationType,\n        user\n      );\n    }\n\n    throw error;\n  });\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface ProviderAssociatedObject {\n  providerId?: string;\n}\n\n/**\n * Takes a set of UserInfo provider data and converts it to a set of names\n */\nexport function providerDataAsNames<T extends ProviderAssociatedObject>(\n  providerData: T[]\n): Set<string> {\n  return new Set(\n    providerData\n      .map(({ providerId }) => providerId)\n      .filter(pid => !!pid) as string[]\n  );\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { User } from '../../model/public_types';\n\nimport { deleteLinkedAccounts } from '../../api/account_management/account';\nimport { UserInternal, UserCredentialInternal } from '../../model/user';\nimport { AuthCredential } from '../credentials';\nimport { AuthErrorCode } from '../errors';\nimport { _assert } from '../util/assert';\nimport { providerDataAsNames } from '../util/providers';\nimport { _logoutIfInvalidated } from './invalidation';\nimport { _reloadWithoutSaving } from './reload';\nimport { UserCredentialImpl } from './user_credential_impl';\nimport { getModularInstance } from '@firebase/util';\nimport { OperationType, ProviderId } from '../../model/enums';\n\n/**\n * Unlinks a provider from a user account.\n *\n * @param user - The user.\n * @param providerId - The provider to unlink.\n *\n * @public\n */\nexport async function unlink(user: User, providerId: string): Promise<User> {\n  const userInternal = getModularInstance(user) as UserInternal;\n  await _assertLinkedStatus(true, userInternal, providerId);\n  const { providerUserInfo } = await deleteLinkedAccounts(userInternal.auth, {\n    idToken: await userInternal.getIdToken(),\n    deleteProvider: [providerId]\n  });\n\n  const providersLeft = providerDataAsNames(providerUserInfo || []);\n\n  userInternal.providerData = userInternal.providerData.filter(pd =>\n    providersLeft.has(pd.providerId)\n  );\n  if (!providersLeft.has(ProviderId.PHONE)) {\n    userInternal.phoneNumber = null;\n  }\n\n  await userInternal.auth._persistUserIfCurrent(userInternal);\n  return userInternal;\n}\n\nexport async function _link(\n  user: UserInternal,\n  credential: AuthCredential,\n  bypassAuthState = false\n): Promise<UserCredentialInternal> {\n  const response = await _logoutIfInvalidated(\n    user,\n    credential._linkToIdToken(user.auth, await user.getIdToken()),\n    bypassAuthState\n  );\n  return UserCredentialImpl._forOperation(user, OperationType.LINK, response);\n}\n\nexport async function _assertLinkedStatus(\n  expected: boolean,\n  user: UserInternal,\n  provider: string\n): Promise<void> {\n  await _reloadWithoutSaving(user);\n  const providerIds = providerDataAsNames(user.providerData);\n\n  const code =\n    expected === false\n      ? AuthErrorCode.PROVIDER_ALREADY_LINKED\n      : AuthErrorCode.NO_SUCH_PROVIDER;\n  _assert(providerIds.has(provider) === expected, user.auth, code);\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseError } from '@firebase/util';\nimport { _processCredentialSavingMfaContextIfNecessary } from '../../mfa/mfa_error';\nimport { OperationType } from '../../model/enums';\nimport { UserInternal } from '../../model/user';\nimport { AuthCredential } from '../credentials';\nimport { AuthErrorCode } from '../errors';\nimport { _assert, _fail } from '../util/assert';\nimport { _parseToken } from './id_token_result';\nimport { _logoutIfInvalidated } from './invalidation';\nimport { UserCredentialImpl } from './user_credential_impl';\nimport { _isFirebaseServerApp } from '@firebase/app';\nimport { _serverAppCurrentUserOperationNotSupportedError } from '../../core/util/assert';\n\nexport async function _reauthenticate(\n  user: UserInternal,\n  credential: AuthCredential,\n  bypassAuthState = false\n): Promise<UserCredentialImpl> {\n  const { auth } = user;\n  if (_isFirebaseServerApp(auth.app)) {\n    return Promise.reject(\n      _serverAppCurrentUserOperationNotSupportedError(auth)\n    );\n  }\n  const operationType = OperationType.REAUTHENTICATE;\n\n  try {\n    const response = await _logoutIfInvalidated(\n      user,\n      _processCredentialSavingMfaContextIfNecessary(\n        auth,\n        operationType,\n        credential,\n        user\n      ),\n      bypassAuthState\n    );\n    _assert(response.idToken, auth, AuthErrorCode.INTERNAL_ERROR);\n    const parsed = _parseToken(response.idToken);\n    _assert(parsed, auth, AuthErrorCode.INTERNAL_ERROR);\n\n    const { sub: localId } = parsed;\n    _assert(user.uid === localId, auth, AuthErrorCode.USER_MISMATCH);\n\n    return UserCredentialImpl._forOperation(user, operationType, response);\n  } catch (e) {\n    // Convert user deleted error into user mismatch\n    if ((e as FirebaseError)?.code === `auth/${AuthErrorCode.USER_DELETED}`) {\n      _fail(auth, AuthErrorCode.USER_MISMATCH);\n    }\n    throw e;\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { UserCredential, Auth, User } from '../../model/public_types';\n\nimport { _processCredentialSavingMfaContextIfNecessary } from '../../mfa/mfa_error';\nimport { AuthInternal } from '../../model/auth';\nimport { UserInternal } from '../../model/user';\nimport { AuthCredential } from '../credentials';\nimport { _assertLinkedStatus, _link } from '../user/link_unlink';\nimport { _reauthenticate } from '../user/reauthenticate';\nimport { UserCredentialImpl } from '../user/user_credential_impl';\nimport { _castAuth } from '../auth/auth_impl';\nimport { getModularInstance } from '@firebase/util';\nimport { OperationType } from '../../model/enums';\nimport { _isFirebaseServerApp } from '@firebase/app';\nimport { _serverAppCurrentUserOperationNotSupportedError } from '../../core/util/assert';\n\nexport async function _signInWithCredential(\n  auth: AuthInternal,\n  credential: AuthCredential,\n  bypassAuthState = false\n): Promise<UserCredential> {\n  if (_isFirebaseServerApp(auth.app)) {\n    return Promise.reject(\n      _serverAppCurrentUserOperationNotSupportedError(auth)\n    );\n  }\n  const operationType = OperationType.SIGN_IN;\n  const response = await _processCredentialSavingMfaContextIfNecessary(\n    auth,\n    operationType,\n    credential\n  );\n  const userCredential = await UserCredentialImpl._fromIdTokenResponse(\n    auth,\n    operationType,\n    response\n  );\n\n  if (!bypassAuthState) {\n    await auth._updateCurrentUser(userCredential.user);\n  }\n  return userCredential;\n}\n\n/**\n * Asynchronously signs in with the given credentials.\n *\n * @remarks\n * An {@link AuthProvider} can be used to generate the credential.\n *\n * This method is not supported by {@link Auth} instances created with a\n * {@link @firebase/app#FirebaseServerApp}.\n *\n * @param auth - The {@link Auth} instance.\n * @param credential - The auth credential.\n *\n * @public\n */\nexport async function signInWithCredential(\n  auth: Auth,\n  credential: AuthCredential\n): Promise<UserCredential> {\n  return _signInWithCredential(_castAuth(auth), credential);\n}\n\n/**\n * Links the user account with the given credentials.\n *\n * @remarks\n * An {@link AuthProvider} can be used to generate the credential.\n *\n * @param user - The user.\n * @param credential - The auth credential.\n *\n * @public\n */\nexport async function linkWithCredential(\n  user: User,\n  credential: AuthCredential\n): Promise<UserCredential> {\n  const userInternal = getModularInstance(user) as UserInternal;\n\n  await _assertLinkedStatus(false, userInternal, credential.providerId);\n\n  return _link(userInternal, credential);\n}\n\n/**\n * Re-authenticates a user using a fresh credential.\n *\n * @remarks\n * Use before operations such as {@link updatePassword} that require tokens from recent sign-in\n * attempts. This method can be used to recover from a `CREDENTIAL_TOO_OLD_LOGIN_AGAIN` error\n * or a `TOKEN_EXPIRED` error.\n *\n * This method is not supported on any {@link User} signed in by {@link Auth} instances\n * created with a {@link @firebase/app#FirebaseServerApp}.\n *\n * @param user - The user.\n * @param credential - The auth credential.\n *\n * @public\n */\nexport async function reauthenticateWithCredential(\n  user: User,\n  credential: AuthCredential\n): Promise<UserCredential> {\n  return _reauthenticate(getModularInstance(user) as UserInternal, credential);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  FactorId,\n  MultiFactorInfo,\n  PhoneMultiFactorInfo,\n  TotpMultiFactorInfo\n} from '../model/public_types';\nimport {\n  PhoneMfaEnrollment,\n  MfaEnrollment,\n  TotpMfaEnrollment\n} from '../api/account_management/mfa';\nimport { AuthErrorCode } from '../core/errors';\nimport { _fail } from '../core/util/assert';\nimport { AuthInternal } from '../model/auth';\n\nexport abstract class MultiFactorInfoImpl implements MultiFactorInfo {\n  readonly uid: string;\n  readonly displayName?: string | null;\n  readonly enrollmentTime: string;\n\n  protected constructor(readonly factorId: FactorId, response: MfaEnrollment) {\n    this.uid = response.mfaEnrollmentId;\n    this.enrollmentTime = new Date(response.enrolledAt).toUTCString();\n    this.displayName = response.displayName;\n  }\n\n  static _fromServerResponse(\n    auth: AuthInternal,\n    enrollment: MfaEnrollment\n  ): MultiFactorInfoImpl {\n    if ('phoneInfo' in enrollment) {\n      return PhoneMultiFactorInfoImpl._fromServerResponse(auth, enrollment);\n    } else if ('totpInfo' in enrollment) {\n      return TotpMultiFactorInfoImpl._fromServerResponse(auth, enrollment);\n    }\n    return _fail(auth, AuthErrorCode.INTERNAL_ERROR);\n  }\n}\n\nexport class PhoneMultiFactorInfoImpl\n  extends MultiFactorInfoImpl\n  implements PhoneMultiFactorInfo\n{\n  readonly phoneNumber: string;\n\n  private constructor(response: PhoneMfaEnrollment) {\n    super(FactorId.PHONE, response);\n    this.phoneNumber = response.phoneInfo;\n  }\n\n  static _fromServerResponse(\n    _auth: AuthInternal,\n    enrollment: MfaEnrollment\n  ): PhoneMultiFactorInfoImpl {\n    return new PhoneMultiFactorInfoImpl(enrollment as PhoneMfaEnrollment);\n  }\n}\nexport class TotpMultiFactorInfoImpl\n  extends MultiFactorInfoImpl\n  implements TotpMultiFactorInfo\n{\n  private constructor(response: TotpMfaEnrollment) {\n    super(FactorId.TOTP, response);\n  }\n\n  static _fromServerResponse(\n    _auth: AuthInternal,\n    enrollment: MfaEnrollment\n  ): TotpMultiFactorInfoImpl {\n    return new TotpMultiFactorInfoImpl(enrollment as TotpMfaEnrollment);\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ActionCodeSettings, Auth } from '../../model/public_types';\n\nimport { GetOobCodeRequest } from '../../api/authentication/email_and_password';\nimport { AuthErrorCode } from '../errors';\nimport { _assert } from '../util/assert';\n\nexport function _setActionCodeSettingsOnRequest(\n  auth: Auth,\n  request: GetOobCodeRequest,\n  actionCodeSettings: ActionCodeSettings\n): void {\n  _assert(\n    actionCodeSettings.url?.length > 0,\n    auth,\n    AuthErrorCode.INVALID_CONTINUE_URI\n  );\n  _assert(\n    typeof actionCodeSettings.dynamicLinkDomain === 'undefined' ||\n      actionCodeSettings.dynamicLinkDomain.length > 0,\n    auth,\n    AuthErrorCode.INVALID_DYNAMIC_LINK_DOMAIN\n  );\n\n  request.continueUrl = actionCodeSettings.url;\n  request.dynamicLinkDomain = actionCodeSettings.dynamicLinkDomain;\n  request.canHandleCodeInApp = actionCodeSettings.handleCodeInApp;\n\n  if (actionCodeSettings.iOS) {\n    _assert(\n      actionCodeSettings.iOS.bundleId.length > 0,\n      auth,\n      AuthErrorCode.MISSING_IOS_BUNDLE_ID\n    );\n    request.iOSBundleId = actionCodeSettings.iOS.bundleId;\n  }\n\n  if (actionCodeSettings.android) {\n    _assert(\n      actionCodeSettings.android.packageName.length > 0,\n      auth,\n      AuthErrorCode.MISSING_ANDROID_PACKAGE_NAME\n    );\n    request.androidInstallApp = actionCodeSettings.android.installApp;\n    request.androidMinimumVersionCode =\n      actionCodeSettings.android.minimumVersion;\n    request.androidPackageName = actionCodeSettings.android.packageName;\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  ActionCodeInfo,\n  ActionCodeOperation,\n  ActionCodeSettings,\n  Auth,\n  UserCredential\n} from '../../model/public_types';\n\nimport * as account from '../../api/account_management/email_and_password';\nimport * as authentication from '../../api/authentication/email_and_password';\nimport { signUp, SignUpRequest } from '../../api/authentication/sign_up';\nimport { MultiFactorInfoImpl } from '../../mfa/mfa_info';\nimport { EmailAuthProvider } from '../providers/email';\nimport { UserCredentialImpl } from '../user/user_credential_impl';\nimport {\n  _assert,\n  _serverAppCurrentUserOperationNotSupportedError\n} from '../util/assert';\nimport { _setActionCodeSettingsOnRequest } from './action_code_settings';\nimport { signInWithCredential } from './credential';\nimport { _castAuth } from '../auth/auth_impl';\nimport { AuthErrorCode } from '../errors';\nimport { getModularInstance } from '@firebase/util';\nimport { OperationType } from '../../model/enums';\nimport { handleRecaptchaFlow } from '../../platform_browser/recaptcha/recaptcha_enterprise_verifier';\nimport { IdTokenResponse } from '../../model/id_token';\nimport { RecaptchaActionName, RecaptchaClientType } from '../../api';\nimport { _isFirebaseServerApp } from '@firebase/app';\n\n/**\n * Updates the password policy cached in the {@link Auth} instance if a policy is already\n * cached for the project or tenant.\n *\n * @remarks\n * We only fetch the password policy if the password did not meet policy requirements and\n * there is an existing policy cached. A developer must call validatePassword at least\n * once for the cache to be automatically updated.\n *\n * @param auth - The {@link Auth} instance.\n *\n * @private\n */\nasync function recachePasswordPolicy(auth: Auth): Promise<void> {\n  const authInternal = _castAuth(auth);\n  if (authInternal._getPasswordPolicyInternal()) {\n    await authInternal._updatePasswordPolicy();\n  }\n}\n\n/**\n * Sends a password reset email to the given email address. This method does not throw an error when\n * there's no user account with the given email address and\n * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}\n * is enabled.\n *\n * @remarks\n * To complete the password reset, call {@link confirmPasswordReset} with the code supplied in\n * the email sent to the user, along with the new password specified by the user.\n *\n * @example\n * ```javascript\n * const actionCodeSettings = {\n *   url: 'https://www.example.com/?email=user@example.com',\n *   iOS: {\n *      bundleId: 'com.example.ios'\n *   },\n *   android: {\n *     packageName: 'com.example.android',\n *     installApp: true,\n *     minimumVersion: '12'\n *   },\n *   handleCodeInApp: true\n * };\n * await sendPasswordResetEmail(auth, 'user@example.com', actionCodeSettings);\n * // Obtain code from user.\n * await confirmPasswordReset('user@example.com', code);\n * ```\n *\n * @param auth - The {@link Auth} instance.\n * @param email - The user's email address.\n * @param actionCodeSettings - The {@link ActionCodeSettings}.\n *\n * @public\n */\nexport async function sendPasswordResetEmail(\n  auth: Auth,\n  email: string,\n  actionCodeSettings?: ActionCodeSettings\n): Promise<void> {\n  const authInternal = _castAuth(auth);\n  const request: authentication.PasswordResetRequest = {\n    requestType: ActionCodeOperation.PASSWORD_RESET,\n    email,\n    clientType: RecaptchaClientType.WEB\n  };\n  if (actionCodeSettings) {\n    _setActionCodeSettingsOnRequest(authInternal, request, actionCodeSettings);\n  }\n  await handleRecaptchaFlow(\n    authInternal,\n    request,\n    RecaptchaActionName.GET_OOB_CODE,\n    authentication.sendPasswordResetEmail\n  );\n}\n\n/**\n * Completes the password reset process, given a confirmation code and new password.\n *\n * @param auth - The {@link Auth} instance.\n * @param oobCode - A confirmation code sent to the user.\n * @param newPassword - The new password.\n *\n * @public\n */\nexport async function confirmPasswordReset(\n  auth: Auth,\n  oobCode: string,\n  newPassword: string\n): Promise<void> {\n  await account\n    .resetPassword(getModularInstance(auth), {\n      oobCode,\n      newPassword\n    })\n    .catch(async error => {\n      if (\n        error.code ===\n        `auth/${AuthErrorCode.PASSWORD_DOES_NOT_MEET_REQUIREMENTS}`\n      ) {\n        void recachePasswordPolicy(auth);\n      }\n\n      throw error;\n    });\n  // Do not return the email.\n}\n\n/**\n * Applies a verification code sent to the user by email or other out-of-band mechanism.\n *\n * @param auth - The {@link Auth} instance.\n * @param oobCode - A verification code sent to the user.\n *\n * @public\n */\nexport async function applyActionCode(\n  auth: Auth,\n  oobCode: string\n): Promise<void> {\n  await account.applyActionCode(getModularInstance(auth), { oobCode });\n}\n\n/**\n * Checks a verification code sent to the user by email or other out-of-band mechanism.\n *\n * @returns metadata about the code.\n *\n * @param auth - The {@link Auth} instance.\n * @param oobCode - A verification code sent to the user.\n *\n * @public\n */\nexport async function checkActionCode(\n  auth: Auth,\n  oobCode: string\n): Promise<ActionCodeInfo> {\n  const authModular = getModularInstance(auth);\n  const response = await account.resetPassword(authModular, { oobCode });\n\n  // Email could be empty only if the request type is EMAIL_SIGNIN or\n  // VERIFY_AND_CHANGE_EMAIL.\n  // New email should not be empty if the request type is\n  // VERIFY_AND_CHANGE_EMAIL.\n  // Multi-factor info could not be empty if the request type is\n  // REVERT_SECOND_FACTOR_ADDITION.\n  const operation = response.requestType;\n  _assert(operation, authModular, AuthErrorCode.INTERNAL_ERROR);\n  switch (operation) {\n    case ActionCodeOperation.EMAIL_SIGNIN:\n      break;\n    case ActionCodeOperation.VERIFY_AND_CHANGE_EMAIL:\n      _assert(response.newEmail, authModular, AuthErrorCode.INTERNAL_ERROR);\n      break;\n    case ActionCodeOperation.REVERT_SECOND_FACTOR_ADDITION:\n      _assert(response.mfaInfo, authModular, AuthErrorCode.INTERNAL_ERROR);\n    // fall through\n    default:\n      _assert(response.email, authModular, AuthErrorCode.INTERNAL_ERROR);\n  }\n\n  // The multi-factor info for revert second factor addition\n  let multiFactorInfo: MultiFactorInfoImpl | null = null;\n  if (response.mfaInfo) {\n    multiFactorInfo = MultiFactorInfoImpl._fromServerResponse(\n      _castAuth(authModular),\n      response.mfaInfo\n    );\n  }\n\n  return {\n    data: {\n      email:\n        (response.requestType === ActionCodeOperation.VERIFY_AND_CHANGE_EMAIL\n          ? response.newEmail\n          : response.email) || null,\n      previousEmail:\n        (response.requestType === ActionCodeOperation.VERIFY_AND_CHANGE_EMAIL\n          ? response.email\n          : response.newEmail) || null,\n      multiFactorInfo\n    },\n    operation\n  };\n}\n\n/**\n * Checks a password reset code sent to the user by email or other out-of-band mechanism.\n *\n * @returns the user's email address if valid.\n *\n * @param auth - The {@link Auth} instance.\n * @param code - A verification code sent to the user.\n *\n * @public\n */\nexport async function verifyPasswordResetCode(\n  auth: Auth,\n  code: string\n): Promise<string> {\n  const { data } = await checkActionCode(getModularInstance(auth), code);\n  // Email should always be present since a code was sent to it\n  return data.email!;\n}\n\n/**\n * Creates a new user account associated with the specified email address and password.\n *\n * @remarks\n * On successful creation of the user account, this user will also be signed in to your application.\n *\n * User account creation can fail if the account already exists or the password is invalid.\n *\n * This method is not supported on {@link Auth} instances created with a\n * {@link @firebase/app#FirebaseServerApp}.\n *\n * Note: The email address acts as a unique identifier for the user and enables an email-based\n * password reset. This function will create a new user account and set the initial user password.\n *\n * @param auth - The {@link Auth} instance.\n * @param email - The user's email address.\n * @param password - The user's chosen password.\n *\n * @public\n */\nexport async function createUserWithEmailAndPassword(\n  auth: Auth,\n  email: string,\n  password: string\n): Promise<UserCredential> {\n  if (_isFirebaseServerApp(auth.app)) {\n    return Promise.reject(\n      _serverAppCurrentUserOperationNotSupportedError(auth)\n    );\n  }\n  const authInternal = _castAuth(auth);\n  const request: SignUpRequest = {\n    returnSecureToken: true,\n    email,\n    password,\n    clientType: RecaptchaClientType.WEB\n  };\n  const signUpResponse: Promise<IdTokenResponse> = handleRecaptchaFlow(\n    authInternal,\n    request,\n    RecaptchaActionName.SIGN_UP_PASSWORD,\n    signUp\n  );\n  const response = await signUpResponse.catch(error => {\n    if (\n      error.code === `auth/${AuthErrorCode.PASSWORD_DOES_NOT_MEET_REQUIREMENTS}`\n    ) {\n      void recachePasswordPolicy(auth);\n    }\n\n    throw error;\n  });\n\n  const userCredential = await UserCredentialImpl._fromIdTokenResponse(\n    authInternal,\n    OperationType.SIGN_IN,\n    response\n  );\n  await authInternal._updateCurrentUser(userCredential.user);\n\n  return userCredential;\n}\n\n/**\n * Asynchronously signs in using an email and password.\n *\n * @remarks\n * Fails with an error if the email address and password do not match. When\n * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}\n * is enabled, this method fails with \"auth/invalid-credential\" in case of an invalid\n * email/password.\n *\n * This method is not supported on {@link Auth} instances created with a\n * {@link @firebase/app#FirebaseServerApp}.\n *\n * Note: The user's password is NOT the password used to access the user's email account. The\n * email address serves as a unique identifier for the user, and the password is used to access\n * the user's account in your Firebase project. See also: {@link createUserWithEmailAndPassword}.\n *\n *\n * @param auth - The {@link Auth} instance.\n * @param email - The users email address.\n * @param password - The users password.\n *\n * @public\n */\nexport function signInWithEmailAndPassword(\n  auth: Auth,\n  email: string,\n  password: string\n): Promise<UserCredential> {\n  if (_isFirebaseServerApp(auth.app)) {\n    return Promise.reject(\n      _serverAppCurrentUserOperationNotSupportedError(auth)\n    );\n  }\n  return signInWithCredential(\n    getModularInstance(auth),\n    EmailAuthProvider.credential(email, password)\n  ).catch(async error => {\n    if (\n      error.code === `auth/${AuthErrorCode.PASSWORD_DOES_NOT_MEET_REQUIREMENTS}`\n    ) {\n      void recachePasswordPolicy(auth);\n    }\n\n    throw error;\n  });\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { User } from '../../model/public_types';\n\nimport {\n  updateEmailPassword as apiUpdateEmailPassword,\n  UpdateEmailPasswordRequest\n} from '../../api/account_management/email_and_password';\nimport { updateProfile as apiUpdateProfile } from '../../api/account_management/profile';\nimport { UserInternal } from '../../model/user';\nimport { _logoutIfInvalidated } from './invalidation';\nimport { getModularInstance } from '@firebase/util';\nimport { ProviderId } from '../../model/enums';\nimport { _isFirebaseServerApp } from '@firebase/app';\nimport { _serverAppCurrentUserOperationNotSupportedError } from '../../core/util/assert';\n\n/**\n * Updates a user's profile data.\n *\n * @param user - The user.\n * @param profile - The profile's `displayName` and `photoURL` to update.\n *\n * @public\n */\nexport async function updateProfile(\n  user: User,\n  {\n    displayName,\n    photoURL: photoUrl\n  }: { displayName?: string | null; photoURL?: string | null }\n): Promise<void> {\n  if (displayName === undefined && photoUrl === undefined) {\n    return;\n  }\n\n  const userInternal = getModularInstance(user) as UserInternal;\n  const idToken = await userInternal.getIdToken();\n  const profileRequest = {\n    idToken,\n    displayName,\n    photoUrl,\n    returnSecureToken: true\n  };\n  const response = await _logoutIfInvalidated(\n    userInternal,\n    apiUpdateProfile(userInternal.auth, profileRequest)\n  );\n\n  userInternal.displayName = response.displayName || null;\n  userInternal.photoURL = response.photoUrl || null;\n\n  // Update the password provider as well\n  const passwordProvider = userInternal.providerData.find(\n    ({ providerId }) => providerId === ProviderId.PASSWORD\n  );\n  if (passwordProvider) {\n    passwordProvider.displayName = userInternal.displayName;\n    passwordProvider.photoURL = userInternal.photoURL;\n  }\n\n  await userInternal._updateTokensIfNecessary(response);\n}\n\n/**\n * Updates the user's email address.\n *\n * @remarks\n * An email will be sent to the original email address (if it was set) that allows to revoke the\n * email address change, in order to protect them from account hijacking.\n *\n * This method is not supported on any {@link User} signed in by {@link Auth} instances\n * created with a {@link @firebase/app#FirebaseServerApp}.\n *\n * Important: this is a security sensitive operation that requires the user to have recently signed\n * in. If this requirement isn't met, ask the user to authenticate again and then call\n * {@link reauthenticateWithCredential}.\n *\n * @param user - The user.\n * @param newEmail - The new email address.\n *\n * Throws \"auth/operation-not-allowed\" error when\n * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}\n * is enabled.\n * Deprecated - Use {@link verifyBeforeUpdateEmail} instead.\n *\n * @public\n */\nexport function updateEmail(user: User, newEmail: string): Promise<void> {\n  const userInternal = getModularInstance(user) as UserInternal;\n  if (_isFirebaseServerApp(userInternal.auth.app)) {\n    return Promise.reject(\n      _serverAppCurrentUserOperationNotSupportedError(userInternal.auth)\n    );\n  }\n  return updateEmailOrPassword(userInternal, newEmail, null);\n}\n\n/**\n * Updates the user's password.\n *\n * @remarks\n * Important: this is a security sensitive operation that requires the user to have recently signed\n * in. If this requirement isn't met, ask the user to authenticate again and then call\n * {@link reauthenticateWithCredential}.\n *\n * @param user - The user.\n * @param newPassword - The new password.\n *\n * @public\n */\nexport function updatePassword(user: User, newPassword: string): Promise<void> {\n  return updateEmailOrPassword(\n    getModularInstance(user) as UserInternal,\n    null,\n    newPassword\n  );\n}\n\nasync function updateEmailOrPassword(\n  user: UserInternal,\n  email: string | null,\n  password: string | null\n): Promise<void> {\n  const { auth } = user;\n  const idToken = await user.getIdToken();\n  const request: UpdateEmailPasswordRequest = {\n    idToken,\n    returnSecureToken: true\n  };\n\n  if (email) {\n    request.email = email;\n  }\n\n  if (password) {\n    request.password = password;\n  }\n\n  const response = await _logoutIfInvalidated(\n    user,\n    apiUpdateEmailPassword(auth, request)\n  );\n  await user._updateTokensIfNecessary(response, /* reload */ true);\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AdditionalUserInfo, UserCredential } from '../../model/public_types';\nimport { IdTokenResponse, IdTokenResponseKind } from '../../model/id_token';\nimport { _parseToken } from './id_token_result';\nimport { UserCredentialInternal } from '../../model/user';\nimport { ProviderId } from '../../model/enums';\n\n/**\n * Parse the `AdditionalUserInfo` from the ID token response.\n *\n */\nexport function _fromIdTokenResponse(\n  idTokenResponse?: IdTokenResponse\n): AdditionalUserInfo | null {\n  if (!idTokenResponse) {\n    return null;\n  }\n  const { providerId } = idTokenResponse;\n  const profile = idTokenResponse.rawUserInfo\n    ? JSON.parse(idTokenResponse.rawUserInfo)\n    : {};\n  const isNewUser =\n    idTokenResponse.isNewUser ||\n    idTokenResponse.kind === IdTokenResponseKind.SignupNewUser;\n  if (!providerId && idTokenResponse?.idToken) {\n    const signInProvider = _parseToken(idTokenResponse.idToken)?.firebase?.[\n      'sign_in_provider'\n    ];\n    if (signInProvider) {\n      const filteredProviderId =\n        signInProvider !== ProviderId.ANONYMOUS &&\n        signInProvider !== ProviderId.CUSTOM\n          ? (signInProvider as ProviderId)\n          : null;\n      // Uses generic class in accordance with the legacy SDK.\n      return new GenericAdditionalUserInfo(isNewUser, filteredProviderId);\n    }\n  }\n  if (!providerId) {\n    return null;\n  }\n  switch (providerId) {\n    case ProviderId.FACEBOOK:\n      return new FacebookAdditionalUserInfo(isNewUser, profile);\n    case ProviderId.GITHUB:\n      return new GithubAdditionalUserInfo(isNewUser, profile);\n    case ProviderId.GOOGLE:\n      return new GoogleAdditionalUserInfo(isNewUser, profile);\n    case ProviderId.TWITTER:\n      return new TwitterAdditionalUserInfo(\n        isNewUser,\n        profile,\n        idTokenResponse.screenName || null\n      );\n    case ProviderId.CUSTOM:\n    case ProviderId.ANONYMOUS:\n      return new GenericAdditionalUserInfo(isNewUser, null);\n    default:\n      return new GenericAdditionalUserInfo(isNewUser, providerId, profile);\n  }\n}\n\nclass GenericAdditionalUserInfo implements AdditionalUserInfo {\n  constructor(\n    readonly isNewUser: boolean,\n    readonly providerId: ProviderId | string | null,\n    readonly profile: Record<string, unknown> = {}\n  ) {}\n}\n\nclass FederatedAdditionalUserInfoWithUsername extends GenericAdditionalUserInfo {\n  constructor(\n    isNewUser: boolean,\n    providerId: ProviderId,\n    profile: Record<string, unknown>,\n    readonly username: string | null\n  ) {\n    super(isNewUser, providerId, profile);\n  }\n}\n\nclass FacebookAdditionalUserInfo extends GenericAdditionalUserInfo {\n  constructor(isNewUser: boolean, profile: Record<string, unknown>) {\n    super(isNewUser, ProviderId.FACEBOOK, profile);\n  }\n}\n\nclass GithubAdditionalUserInfo extends FederatedAdditionalUserInfoWithUsername {\n  constructor(isNewUser: boolean, profile: Record<string, unknown>) {\n    super(\n      isNewUser,\n      ProviderId.GITHUB,\n      profile,\n      typeof profile?.login === 'string' ? profile?.login : null\n    );\n  }\n}\n\nclass GoogleAdditionalUserInfo extends GenericAdditionalUserInfo {\n  constructor(isNewUser: boolean, profile: Record<string, unknown>) {\n    super(isNewUser, ProviderId.GOOGLE, profile);\n  }\n}\n\nclass TwitterAdditionalUserInfo extends FederatedAdditionalUserInfoWithUsername {\n  constructor(\n    isNewUser: boolean,\n    profile: Record<string, unknown>,\n    screenName: string | null\n  ) {\n    super(isNewUser, ProviderId.TWITTER, profile, screenName);\n  }\n}\n\n/**\n * Extracts provider specific {@link AdditionalUserInfo} for the given credential.\n *\n * @param userCredential - The user credential.\n *\n * @public\n */\nexport function getAdditionalUserInfo(\n  userCredential: UserCredential\n): AdditionalUserInfo | null {\n  const { user, _tokenResponse } = userCredential as UserCredentialInternal;\n  if (user.isAnonymous && !_tokenResponse) {\n    // Handle the special case where signInAnonymously() gets called twice.\n    // No network call is made so there's nothing to actually fill this in\n    return {\n      providerId: null,\n      isNewUser: false,\n      profile: null\n    };\n  }\n\n  return _fromIdTokenResponse(_tokenResponse);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getModularInstance } from '@firebase/util';\nimport {\n  Auth,\n  NextOrObserver,\n  Persistence,\n  User,\n  CompleteFn,\n  ErrorFn,\n  Unsubscribe,\n  PasswordValidationStatus\n} from '../model/public_types';\nimport { _initializeRecaptchaConfig } from '../platform_browser/recaptcha/recaptcha_enterprise_verifier';\nimport { _castAuth } from '../core/auth/auth_impl';\n\nexport {\n  debugErrorMap,\n  prodErrorMap,\n  AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as AuthErrorCodes\n} from './errors';\n\n// Non-optional auth methods.\n/**\n * Changes the type of persistence on the {@link Auth} instance for the currently saved\n * `Auth` session and applies this type of persistence for future sign-in requests, including\n * sign-in with redirect requests.\n *\n * @remarks\n * This makes it easy for a user signing in to specify whether their session should be\n * remembered or not. It also makes it easier to never persist the `Auth` state for applications\n * that are shared by other users or have sensitive data.\n *\n * This method does not work in a Node.js environment or with {@link Auth} instances created with a\n * {@link @firebase/app#FirebaseServerApp}.\n *\n * @example\n * ```javascript\n * setPersistence(auth, browserSessionPersistence);\n * ```\n *\n * @param auth - The {@link Auth} instance.\n * @param persistence - The {@link Persistence} to use.\n * @returns A `Promise` that resolves once the persistence change has completed\n *\n * @public\n */\nexport function setPersistence(\n  auth: Auth,\n  persistence: Persistence\n): Promise<void> {\n  return getModularInstance(auth).setPersistence(persistence);\n}\n\n/**\n * Loads the reCAPTCHA configuration into the `Auth` instance.\n *\n * @remarks\n * This will load the reCAPTCHA config, which indicates whether the reCAPTCHA\n * verification flow should be triggered for each auth provider, into the\n * current Auth session.\n *\n * If initializeRecaptchaConfig() is not invoked, the auth flow will always start\n * without reCAPTCHA verification. If the provider is configured to require reCAPTCHA\n * verification, the SDK will transparently load the reCAPTCHA config and restart the\n * auth flows.\n *\n * Thus, by calling this optional method, you will reduce the latency of future auth flows.\n * Loading the reCAPTCHA config early will also enhance the signal collected by reCAPTCHA.\n *\n * This method does not work in a Node.js environment.\n *\n * @example\n * ```javascript\n * initializeRecaptchaConfig(auth);\n * ```\n *\n * @param auth - The {@link Auth} instance.\n *\n * @public\n */\nexport function initializeRecaptchaConfig(auth: Auth): Promise<void> {\n  return _initializeRecaptchaConfig(auth);\n}\n\n/**\n * Validates the password against the password policy configured for the project or tenant.\n *\n * @remarks\n * If no tenant ID is set on the `Auth` instance, then this method will use the password\n * policy configured for the project. Otherwise, this method will use the policy configured\n * for the tenant. If a password policy has not been configured, then the default policy\n * configured for all projects will be used.\n *\n * If an auth flow fails because a submitted password does not meet the password policy\n * requirements and this method has previously been called, then this method will use the\n * most recent policy available when called again.\n *\n * @example\n * ```javascript\n * validatePassword(auth, 'some-password');\n * ```\n *\n * @param auth The {@link Auth} instance.\n * @param password The password to validate.\n *\n * @public\n */\nexport async function validatePassword(\n  auth: Auth,\n  password: string\n): Promise<PasswordValidationStatus> {\n  const authInternal = _castAuth(auth);\n  return authInternal.validatePassword(password);\n}\n\n/**\n * Adds an observer for changes to the signed-in user's ID token.\n *\n * @remarks\n * This includes sign-in, sign-out, and token refresh events.\n * This will not be triggered automatically upon ID token expiration. Use {@link User.getIdToken} to refresh the ID token.\n *\n * @param auth - The {@link Auth} instance.\n * @param nextOrObserver - callback triggered on change.\n * @param error - Deprecated. This callback is never triggered. Errors\n * on signing in/out can be caught in promises returned from\n * sign-in/sign-out functions.\n * @param completed - Deprecated. This callback is never triggered.\n *\n * @public\n */\nexport function onIdTokenChanged(\n  auth: Auth,\n  nextOrObserver: NextOrObserver<User>,\n  error?: ErrorFn,\n  completed?: CompleteFn\n): Unsubscribe {\n  return getModularInstance(auth).onIdTokenChanged(\n    nextOrObserver,\n    error,\n    completed\n  );\n}\n/**\n * Adds a blocking callback that runs before an auth state change\n * sets a new user.\n *\n * @param auth - The {@link Auth} instance.\n * @param callback - callback triggered before new user value is set.\n *   If this throws, it blocks the user from being set.\n * @param onAbort - callback triggered if a later `beforeAuthStateChanged()`\n *   callback throws, allowing you to undo any side effects.\n */\nexport function beforeAuthStateChanged(\n  auth: Auth,\n  callback: (user: User | null) => void | Promise<void>,\n  onAbort?: () => void\n): Unsubscribe {\n  return getModularInstance(auth).beforeAuthStateChanged(callback, onAbort);\n}\n/**\n * Adds an observer for changes to the user's sign-in state.\n *\n * @remarks\n * To keep the old behavior, see {@link onIdTokenChanged}.\n *\n * @param auth - The {@link Auth} instance.\n * @param nextOrObserver - callback triggered on change.\n * @param error - Deprecated. This callback is never triggered. Errors\n * on signing in/out can be caught in promises returned from\n * sign-in/sign-out functions.\n * @param completed - Deprecated. This callback is never triggered.\n *\n * @public\n */\nexport function onAuthStateChanged(\n  auth: Auth,\n  nextOrObserver: NextOrObserver<User>,\n  error?: ErrorFn,\n  completed?: CompleteFn\n): Unsubscribe {\n  return getModularInstance(auth).onAuthStateChanged(\n    nextOrObserver,\n    error,\n    completed\n  );\n}\n/**\n * Sets the current language to the default device/browser preference.\n *\n * @param auth - The {@link Auth} instance.\n *\n * @public\n */\nexport function useDeviceLanguage(auth: Auth): void {\n  getModularInstance(auth).useDeviceLanguage();\n}\n/**\n * Asynchronously sets the provided user as {@link Auth.currentUser} on the\n * {@link Auth} instance.\n *\n * @remarks\n * A new instance copy of the user provided will be made and set as currentUser.\n *\n * This will trigger {@link onAuthStateChanged} and {@link onIdTokenChanged} listeners\n * like other sign in methods.\n *\n * The operation fails with an error if the user to be updated belongs to a different Firebase\n * project.\n *\n * This method is not supported by {@link Auth} instances created with a\n * {@link @firebase/app#FirebaseServerApp}.\n *\n * @param auth - The {@link Auth} instance.\n * @param user - The new {@link User}.\n *\n * @public\n */\nexport function updateCurrentUser(\n  auth: Auth,\n  user: User | null\n): Promise<void> {\n  return getModularInstance(auth).updateCurrentUser(user);\n}\n/**\n * Signs out the current user.\n *\n * @remarks\n * This method is not supported by {@link Auth} instances created with a\n * {@link @firebase/app#FirebaseServerApp}.\n *\n * @param auth - The {@link Auth} instance.\n *\n * @public\n */\nexport function signOut(auth: Auth): Promise<void> {\n  return getModularInstance(auth).signOut();\n}\n\n/**\n * Revokes the given access token. Currently only supports Apple OAuth access tokens.\n *\n * @param auth - The {@link Auth} instance.\n * @param token - The Apple OAuth access token.\n *\n * @public\n */\nexport function revokeAccessToken(auth: Auth, token: string): Promise<void> {\n  const authInternal = _castAuth(auth);\n  return authInternal.revokeAccessToken(token);\n}\n\nexport { initializeAuth } from './auth/initialize';\nexport { connectAuthEmulator } from './auth/emulator';\n\n// credentials\nexport { AuthCredential } from './credentials';\nexport { EmailAuthCredential } from './credentials/email';\nexport { OAuthCredential } from './credentials/oauth';\nexport { PhoneAuthCredential } from './credentials/phone';\n\n// persistence\nexport { inMemoryPersistence } from './persistence/in_memory';\n\n// providers\nexport { EmailAuthProvider } from './providers/email';\nexport { FacebookAuthProvider } from './providers/facebook';\nexport { CustomParameters } from './providers/federated';\nexport { GoogleAuthProvider } from './providers/google';\nexport { GithubAuthProvider } from './providers/github';\nexport { OAuthProvider, OAuthCredentialOptions } from './providers/oauth';\nexport { SAMLAuthProvider } from './providers/saml';\nexport { TwitterAuthProvider } from './providers/twitter';\n\n// strategies\nexport { signInAnonymously } from './strategies/anonymous';\nexport {\n  signInWithCredential,\n  linkWithCredential,\n  reauthenticateWithCredential\n} from './strategies/credential';\nexport { signInWithCustomToken } from './strategies/custom_token';\nexport {\n  sendPasswordResetEmail,\n  confirmPasswordReset,\n  applyActionCode,\n  checkActionCode,\n  verifyPasswordResetCode,\n  createUserWithEmailAndPassword,\n  signInWithEmailAndPassword\n} from './strategies/email_and_password';\nexport {\n  sendSignInLinkToEmail,\n  isSignInWithEmailLink,\n  signInWithEmailLink\n} from './strategies/email_link';\nexport {\n  fetchSignInMethodsForEmail,\n  sendEmailVerification,\n  verifyBeforeUpdateEmail\n} from './strategies/email';\n\n// core\nexport { ActionCodeURL, parseActionCodeURL } from './action_code_url';\n\n// user\nexport {\n  updateProfile,\n  updateEmail,\n  updatePassword\n} from './user/account_info';\nexport { getIdToken, getIdTokenResult } from './user/id_token_result';\nexport { unlink } from './user/link_unlink';\nexport { getAdditionalUserInfo } from './user/additional_user_info';\n\n// Non-optional user methods.\nexport { reload } from './user/reload';\n/**\n * Deletes and signs out the user.\n *\n * @remarks\n * Important: this is a security-sensitive operation that requires the user to have recently\n * signed in. If this requirement isn't met, ask the user to authenticate again and then call\n * {@link reauthenticateWithCredential}.\n *\n * @param user - The user.\n *\n * @public\n */\nexport async function deleteUser(user: User): Promise<void> {\n  return getModularInstance(user).delete();\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { UserInternal } from '../model/user';\nimport { MultiFactorSession } from '../model/public_types';\n\nexport const enum MultiFactorSessionType {\n  ENROLL = 'enroll',\n  SIGN_IN = 'signin'\n}\n\ninterface SerializedMultiFactorSession {\n  multiFactorSession: {\n    idToken?: string;\n    pendingCredential?: string;\n  };\n}\n\nexport class MultiFactorSessionImpl implements MultiFactorSession {\n  private constructor(\n    readonly type: MultiFactorSessionType,\n    readonly credential: string,\n    readonly user?: UserInternal\n  ) {}\n\n  static _fromIdtoken(\n    idToken: string,\n    user?: UserInternal\n  ): MultiFactorSessionImpl {\n    return new MultiFactorSessionImpl(\n      MultiFactorSessionType.ENROLL,\n      idToken,\n      user\n    );\n  }\n\n  static _fromMfaPendingCredential(\n    mfaPendingCredential: string\n  ): MultiFactorSessionImpl {\n    return new MultiFactorSessionImpl(\n      MultiFactorSessionType.SIGN_IN,\n      mfaPendingCredential\n    );\n  }\n\n  toJSON(): SerializedMultiFactorSession {\n    const key =\n      this.type === MultiFactorSessionType.ENROLL\n        ? 'idToken'\n        : 'pendingCredential';\n    return {\n      multiFactorSession: {\n        [key]: this.credential\n      }\n    };\n  }\n\n  static fromJSON(\n    obj: Partial<SerializedMultiFactorSession>\n  ): MultiFactorSessionImpl | null {\n    if (obj?.multiFactorSession) {\n      if (obj.multiFactorSession?.pendingCredential) {\n        return MultiFactorSessionImpl._fromMfaPendingCredential(\n          obj.multiFactorSession.pendingCredential\n        );\n      } else if (obj.multiFactorSession?.idToken) {\n        return MultiFactorSessionImpl._fromIdtoken(\n          obj.multiFactorSession.idToken\n        );\n      }\n    }\n    return null;\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  Auth,\n  MultiFactorResolver,\n  UserCredential,\n  MultiFactorError\n} from '../model/public_types';\n\nimport { _castAuth } from '../core/auth/auth_impl';\nimport { AuthErrorCode } from '../core/errors';\nimport { UserCredentialImpl } from '../core/user/user_credential_impl';\nimport { _assert, _fail } from '../core/util/assert';\nimport { UserCredentialInternal } from '../model/user';\nimport { MultiFactorAssertionImpl } from './mfa_assertion';\nimport { MultiFactorError as MultiFactorErrorInternal } from './mfa_error';\nimport { MultiFactorInfoImpl } from './mfa_info';\nimport { MultiFactorSessionImpl } from './mfa_session';\nimport { getModularInstance } from '@firebase/util';\nimport { OperationType } from '../model/enums';\n\nexport class MultiFactorResolverImpl implements MultiFactorResolver {\n  private constructor(\n    readonly session: MultiFactorSessionImpl,\n    readonly hints: MultiFactorInfoImpl[],\n    private readonly signInResolver: (\n      assertion: MultiFactorAssertionImpl\n    ) => Promise<UserCredentialInternal>\n  ) {}\n\n  /** @internal */\n  static _fromError(\n    authExtern: Auth,\n    error: MultiFactorErrorInternal\n  ): MultiFactorResolverImpl {\n    const auth = _castAuth(authExtern);\n    const serverResponse = error.customData._serverResponse;\n    const hints = (serverResponse.mfaInfo || []).map(enrollment =>\n      MultiFactorInfoImpl._fromServerResponse(auth, enrollment)\n    );\n\n    _assert(\n      serverResponse.mfaPendingCredential,\n      auth,\n      AuthErrorCode.INTERNAL_ERROR\n    );\n    const session = MultiFactorSessionImpl._fromMfaPendingCredential(\n      serverResponse.mfaPendingCredential\n    );\n\n    return new MultiFactorResolverImpl(\n      session,\n      hints,\n      async (\n        assertion: MultiFactorAssertionImpl\n      ): Promise<UserCredentialInternal> => {\n        const mfaResponse = await assertion._process(auth, session);\n        // Clear out the unneeded fields from the old login response\n        delete serverResponse.mfaInfo;\n        delete serverResponse.mfaPendingCredential;\n\n        // Use in the new token & refresh token in the old response\n        const idTokenResponse = {\n          ...serverResponse,\n          idToken: mfaResponse.idToken,\n          refreshToken: mfaResponse.refreshToken\n        };\n\n        // TODO: we should collapse this switch statement into UserCredentialImpl._forOperation and have it support the SIGN_IN case\n        switch (error.operationType) {\n          case OperationType.SIGN_IN:\n            const userCredential =\n              await UserCredentialImpl._fromIdTokenResponse(\n                auth,\n                error.operationType,\n                idTokenResponse\n              );\n            await auth._updateCurrentUser(userCredential.user);\n            return userCredential;\n          case OperationType.REAUTHENTICATE:\n            _assert(error.user, auth, AuthErrorCode.INTERNAL_ERROR);\n            return UserCredentialImpl._forOperation(\n              error.user,\n              error.operationType,\n              idTokenResponse\n            );\n          default:\n            _fail(auth, AuthErrorCode.INTERNAL_ERROR);\n        }\n      }\n    );\n  }\n\n  async resolveSignIn(\n    assertionExtern: MultiFactorAssertionImpl\n  ): Promise<UserCredential> {\n    const assertion = assertionExtern as MultiFactorAssertionImpl;\n    return this.signInResolver(assertion);\n  }\n}\n\n/**\n * Provides a {@link MultiFactorResolver} suitable for completion of a\n * multi-factor flow.\n *\n * @param auth - The {@link Auth} instance.\n * @param error - The {@link MultiFactorError} raised during a sign-in, or\n * reauthentication operation.\n *\n * @public\n */\nexport function getMultiFactorResolver(\n  auth: Auth,\n  error: MultiFactorError\n): MultiFactorResolver {\n  const authModular = getModularInstance(auth);\n  const errorInternal = error as MultiFactorErrorInternal;\n  _assert(\n    error.customData.operationType,\n    authModular,\n    AuthErrorCode.ARGUMENT_ERROR\n  );\n  _assert(\n    errorInternal.customData._serverResponse?.mfaPendingCredential,\n    authModular,\n    AuthErrorCode.ARGUMENT_ERROR\n  );\n\n  return MultiFactorResolverImpl._fromError(authModular, errorInternal);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  Endpoint,\n  HttpMethod,\n  _addTidIfNecessary,\n  _performApiRequest\n} from '../index';\nimport { SignInWithPhoneNumberRequest } from '../authentication/sms';\nimport { FinalizeMfaResponse } from '../authentication/mfa';\nimport { AuthInternal } from '../../model/auth';\n\n/**\n * MFA Info as returned by the API.\n */\ninterface BaseMfaEnrollment {\n  mfaEnrollmentId: string;\n  enrolledAt: number;\n  displayName?: string;\n}\n\n/**\n * An MFA provided by SMS verification.\n */\nexport interface PhoneMfaEnrollment extends BaseMfaEnrollment {\n  phoneInfo: string;\n}\n\n/**\n * An MFA provided by TOTP (Time-based One Time Password).\n */\nexport interface TotpMfaEnrollment extends BaseMfaEnrollment {}\n\n/**\n * MfaEnrollment can be any subtype of BaseMfaEnrollment, currently only PhoneMfaEnrollment and TotpMfaEnrollment are supported.\n */\nexport type MfaEnrollment = PhoneMfaEnrollment | TotpMfaEnrollment;\n\nexport interface StartPhoneMfaEnrollmentRequest {\n  idToken: string;\n  phoneEnrollmentInfo: {\n    phoneNumber: string;\n    recaptchaToken: string;\n  };\n  tenantId?: string;\n}\n\nexport interface StartPhoneMfaEnrollmentResponse {\n  phoneSessionInfo: {\n    sessionInfo: string;\n  };\n}\n\nexport function startEnrollPhoneMfa(\n  auth: AuthInternal,\n  request: StartPhoneMfaEnrollmentRequest\n): Promise<StartPhoneMfaEnrollmentResponse> {\n  return _performApiRequest<\n    StartPhoneMfaEnrollmentRequest,\n    StartPhoneMfaEnrollmentResponse\n  >(\n    auth,\n    HttpMethod.POST,\n    Endpoint.START_MFA_ENROLLMENT,\n    _addTidIfNecessary(auth, request)\n  );\n}\n\nexport interface FinalizePhoneMfaEnrollmentRequest {\n  idToken: string;\n  phoneVerificationInfo: SignInWithPhoneNumberRequest;\n  displayName?: string | null;\n  tenantId?: string;\n}\n\nexport interface FinalizePhoneMfaEnrollmentResponse\n  extends FinalizeMfaResponse {}\n\nexport function finalizeEnrollPhoneMfa(\n  auth: AuthInternal,\n  request: FinalizePhoneMfaEnrollmentRequest\n): Promise<FinalizePhoneMfaEnrollmentResponse> {\n  return _performApiRequest<\n    FinalizePhoneMfaEnrollmentRequest,\n    FinalizePhoneMfaEnrollmentResponse\n  >(\n    auth,\n    HttpMethod.POST,\n    Endpoint.FINALIZE_MFA_ENROLLMENT,\n    _addTidIfNecessary(auth, request)\n  );\n}\nexport interface StartTotpMfaEnrollmentRequest {\n  idToken: string;\n  totpEnrollmentInfo: {};\n  tenantId?: string;\n}\n\nexport interface StartTotpMfaEnrollmentResponse {\n  totpSessionInfo: {\n    sharedSecretKey: string;\n    verificationCodeLength: number;\n    hashingAlgorithm: string;\n    periodSec: number;\n    sessionInfo: string;\n    finalizeEnrollmentTime: number;\n  };\n}\n\nexport function startEnrollTotpMfa(\n  auth: AuthInternal,\n  request: StartTotpMfaEnrollmentRequest\n): Promise<StartTotpMfaEnrollmentResponse> {\n  return _performApiRequest<\n    StartTotpMfaEnrollmentRequest,\n    StartTotpMfaEnrollmentResponse\n  >(\n    auth,\n    HttpMethod.POST,\n    Endpoint.START_MFA_ENROLLMENT,\n    _addTidIfNecessary(auth, request)\n  );\n}\n\nexport interface TotpVerificationInfo {\n  sessionInfo: string;\n  verificationCode: string;\n}\nexport interface FinalizeTotpMfaEnrollmentRequest {\n  idToken: string;\n  totpVerificationInfo: TotpVerificationInfo;\n  displayName?: string | null;\n  tenantId?: string;\n}\n\nexport interface FinalizeTotpMfaEnrollmentResponse\n  extends FinalizeMfaResponse {}\n\nexport function finalizeEnrollTotpMfa(\n  auth: AuthInternal,\n  request: FinalizeTotpMfaEnrollmentRequest\n): Promise<FinalizeTotpMfaEnrollmentResponse> {\n  return _performApiRequest<\n    FinalizeTotpMfaEnrollmentRequest,\n    FinalizeTotpMfaEnrollmentResponse\n  >(\n    auth,\n    HttpMethod.POST,\n    Endpoint.FINALIZE_MFA_ENROLLMENT,\n    _addTidIfNecessary(auth, request)\n  );\n}\n\nexport interface WithdrawMfaRequest {\n  idToken: string;\n  mfaEnrollmentId: string;\n  tenantId?: string;\n}\n\nexport interface WithdrawMfaResponse extends FinalizeMfaResponse {}\n\nexport function withdrawMfa(\n  auth: AuthInternal,\n  request: WithdrawMfaRequest\n): Promise<WithdrawMfaResponse> {\n  return _performApiRequest<WithdrawMfaRequest, WithdrawMfaResponse>(\n    auth,\n    HttpMethod.POST,\n    Endpoint.WITHDRAW_MFA,\n    _addTidIfNecessary(auth, request)\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n  MultiFactorAssertion,\n  MultiFactorInfo,\n  MultiFactorSession,\n  MultiFactorUser,\n  User\n} from '../model/public_types';\n\nimport { withdrawMfa } from '../api/account_management/mfa';\nimport { _logoutIfInvalidated } from '../core/user/invalidation';\nimport { UserInternal } from '../model/user';\nimport { MultiFactorAssertionImpl } from './mfa_assertion';\nimport { MultiFactorInfoImpl } from './mfa_info';\nimport { MultiFactorSessionImpl } from './mfa_session';\nimport { getModularInstance } from '@firebase/util';\n\nexport class MultiFactorUserImpl implements MultiFactorUser {\n  enrolledFactors: MultiFactorInfo[] = [];\n\n  private constructor(readonly user: UserInternal) {\n    user._onReload(userInfo => {\n      if (userInfo.mfaInfo) {\n        this.enrolledFactors = userInfo.mfaInfo.map(enrollment =>\n          MultiFactorInfoImpl._fromServerResponse(user.auth, enrollment)\n        );\n      }\n    });\n  }\n\n  static _fromUser(user: UserInternal): MultiFactorUserImpl {\n    return new MultiFactorUserImpl(user);\n  }\n\n  async getSession(): Promise<MultiFactorSession> {\n    return MultiFactorSessionImpl._fromIdtoken(\n      await this.user.getIdToken(),\n      this.user\n    );\n  }\n\n  async enroll(\n    assertionExtern: MultiFactorAssertion,\n    displayName?: string | null\n  ): Promise<void> {\n    const assertion = assertionExtern as MultiFactorAssertionImpl;\n    const session = (await this.getSession()) as MultiFactorSessionImpl;\n    const finalizeMfaResponse = await _logoutIfInvalidated(\n      this.user,\n      assertion._process(this.user.auth, session, displayName)\n    );\n    // New tokens will be issued after enrollment of the new second factors.\n    // They need to be updated on the user.\n    await this.user._updateTokensIfNecessary(finalizeMfaResponse);\n    // The user needs to be reloaded to get the new multi-factor information\n    // from server. USER_RELOADED event will be triggered and `enrolledFactors`\n    // will be updated.\n    return this.user.reload();\n  }\n\n  async unenroll(infoOrUid: MultiFactorInfo | string): Promise<void> {\n    const mfaEnrollmentId =\n      typeof infoOrUid === 'string' ? infoOrUid : infoOrUid.uid;\n    const idToken = await this.user.getIdToken();\n    try {\n      const idTokenResponse = await _logoutIfInvalidated(\n        this.user,\n        withdrawMfa(this.user.auth, {\n          idToken,\n          mfaEnrollmentId\n        })\n      );\n      // Remove the second factor from the user's list.\n      this.enrolledFactors = this.enrolledFactors.filter(\n        ({ uid }) => uid !== mfaEnrollmentId\n      );\n      // Depending on whether the backend decided to revoke the user's session,\n      // the tokenResponse may be empty. If the tokens were not updated (and they\n      // are now invalid), reloading the user will discover this and invalidate\n      // the user's state accordingly.\n      await this.user._updateTokensIfNecessary(idTokenResponse);\n      await this.user.reload();\n    } catch (e) {\n      throw e;\n    }\n  }\n}\n\nconst multiFactorUserCache = new WeakMap<User, MultiFactorUser>();\n\n/**\n * The {@link MultiFactorUser} corresponding to the user.\n *\n * @remarks\n * This is used to access all multi-factor properties and operations related to the user.\n *\n * @param user - The user.\n *\n * @public\n */\nexport function multiFactor(user: User): MultiFactorUser {\n  const userModular = getModularInstance(user);\n  if (!multiFactorUserCache.has(userModular)) {\n    multiFactorUserCache.set(\n      userModular,\n      MultiFactorUserImpl._fromUser(userModular as UserInternal)\n    );\n  }\n  return multiFactorUserCache.get(userModular)!;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Persistence } from '../../model/public_types';\n\nexport const enum PersistenceType {\n  SESSION = 'SESSION',\n  LOCAL = 'LOCAL',\n  NONE = 'NONE'\n}\n\nexport type PersistedBlob = Record<string, unknown>;\n\nexport interface Instantiator<T> {\n  (blob: PersistedBlob): T;\n}\n\nexport type PersistenceValue = PersistedBlob | string;\n\nexport const STORAGE_AVAILABLE_KEY = '__sak';\n\nexport interface StorageEventListener {\n  (value: PersistenceValue | null): void;\n}\n\nexport interface PersistenceInternal extends Persistence {\n  type: PersistenceType;\n  _isAvailable(): Promise<boolean>;\n  _set(key: string, value: PersistenceValue): Promise<void>;\n  _get<T extends PersistenceValue>(key: string): Promise<T | null>;\n  _remove(key: string): Promise<void>;\n  _addListener(key: string, listener: StorageEventListener): void;\n  _removeListener(key: string, listener: StorageEventListener): void;\n  // Should this persistence allow migration up the chosen hierarchy?\n  _shouldAllowMigration?: boolean;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  PersistenceValue,\n  STORAGE_AVAILABLE_KEY,\n  PersistenceType\n} from '../../core/persistence';\n\n// There are two different browser persistence types: local and session.\n// Both have the same implementation but use a different underlying storage\n// object.\n\nexport abstract class BrowserPersistenceClass {\n  protected constructor(\n    protected readonly storageRetriever: () => Storage,\n    readonly type: PersistenceType\n  ) {}\n\n  _isAvailable(): Promise<boolean> {\n    try {\n      if (!this.storage) {\n        return Promise.resolve(false);\n      }\n      this.storage.setItem(STORAGE_AVAILABLE_KEY, '1');\n      this.storage.removeItem(STORAGE_AVAILABLE_KEY);\n      return Promise.resolve(true);\n    } catch {\n      return Promise.resolve(false);\n    }\n  }\n\n  _set(key: string, value: PersistenceValue): Promise<void> {\n    this.storage.setItem(key, JSON.stringify(value));\n    return Promise.resolve();\n  }\n\n  _get<T extends PersistenceValue>(key: string): Promise<T | null> {\n    const json = this.storage.getItem(key);\n    return Promise.resolve(json ? JSON.parse(json) : null);\n  }\n\n  _remove(key: string): Promise<void> {\n    this.storage.removeItem(key);\n    return Promise.resolve();\n  }\n\n  protected get storage(): Storage {\n    return this.storageRetriever();\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Persistence } from '../../model/public_types';\n\nimport { getUA } from '@firebase/util';\nimport {\n  _isSafari,\n  _isIOS,\n  _isIframe,\n  _isMobileBrowser,\n  _isIE10\n} from '../../core/util/browser';\nimport {\n  PersistenceInternal as InternalPersistence,\n  PersistenceType,\n  PersistenceValue,\n  StorageEventListener\n} from '../../core/persistence';\nimport { BrowserPersistenceClass } from './browser';\n\nfunction _iframeCannotSyncWebStorage(): boolean {\n  const ua = getUA();\n  return _isSafari(ua) || _isIOS(ua);\n}\n\n// The polling period in case events are not supported\nexport const _POLLING_INTERVAL_MS = 1000;\n\n// The IE 10 localStorage cross tab synchronization delay in milliseconds\nconst IE10_LOCAL_STORAGE_SYNC_DELAY = 10;\n\nclass BrowserLocalPersistence\n  extends BrowserPersistenceClass\n  implements InternalPersistence\n{\n  static type: 'LOCAL' = 'LOCAL';\n\n  constructor() {\n    super(() => window.localStorage, PersistenceType.LOCAL);\n  }\n\n  private readonly boundEventHandler = (\n    event: StorageEvent,\n    poll?: boolean\n  ): void => this.onStorageEvent(event, poll);\n  private readonly listeners: Record<string, Set<StorageEventListener>> = {};\n  private readonly localCache: Record<string, string | null> = {};\n  // setTimeout return value is platform specific\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private pollTimer: any | null = null;\n\n  // Safari or iOS browser and embedded in an iframe.\n  private readonly safariLocalStorageNotSynced =\n    _iframeCannotSyncWebStorage() && _isIframe();\n  // Whether to use polling instead of depending on window events\n  private readonly fallbackToPolling = _isMobileBrowser();\n  readonly _shouldAllowMigration = true;\n\n  private forAllChangedKeys(\n    cb: (key: string, oldValue: string | null, newValue: string | null) => void\n  ): void {\n    // Check all keys with listeners on them.\n    for (const key of Object.keys(this.listeners)) {\n      // Get value from localStorage.\n      const newValue = this.storage.getItem(key);\n      const oldValue = this.localCache[key];\n      // If local map value does not match, trigger listener with storage event.\n      // Differentiate this simulated event from the real storage event.\n      if (newValue !== oldValue) {\n        cb(key, oldValue, newValue);\n      }\n    }\n  }\n\n  private onStorageEvent(event: StorageEvent, poll = false): void {\n    // Key would be null in some situations, like when localStorage is cleared\n    if (!event.key) {\n      this.forAllChangedKeys(\n        (key: string, _oldValue: string | null, newValue: string | null) => {\n          this.notifyListeners(key, newValue);\n        }\n      );\n      return;\n    }\n\n    const key = event.key;\n\n    // Check the mechanism how this event was detected.\n    // The first event will dictate the mechanism to be used.\n    if (poll) {\n      // Environment detects storage changes via polling.\n      // Remove storage event listener to prevent possible event duplication.\n      this.detachListener();\n    } else {\n      // Environment detects storage changes via storage event listener.\n      // Remove polling listener to prevent possible event duplication.\n      this.stopPolling();\n    }\n\n    // Safari embedded iframe. Storage event will trigger with the delta\n    // changes but no changes will be applied to the iframe localStorage.\n    if (this.safariLocalStorageNotSynced) {\n      // Get current iframe page value.\n      const storedValue = this.storage.getItem(key);\n      // Value not synchronized, synchronize manually.\n      if (event.newValue !== storedValue) {\n        if (event.newValue !== null) {\n          // Value changed from current value.\n          this.storage.setItem(key, event.newValue);\n        } else {\n          // Current value deleted.\n          this.storage.removeItem(key);\n        }\n      } else if (this.localCache[key] === event.newValue && !poll) {\n        // Already detected and processed, do not trigger listeners again.\n        return;\n      }\n    }\n\n    const triggerListeners = (): void => {\n      // Keep local map up to date in case storage event is triggered before\n      // poll.\n      const storedValue = this.storage.getItem(key);\n      if (!poll && this.localCache[key] === storedValue) {\n        // Real storage event which has already been detected, do nothing.\n        // This seems to trigger in some IE browsers for some reason.\n        return;\n      }\n      this.notifyListeners(key, storedValue);\n    };\n\n    const storedValue = this.storage.getItem(key);\n    if (\n      _isIE10() &&\n      storedValue !== event.newValue &&\n      event.newValue !== event.oldValue\n    ) {\n      // IE 10 has this weird bug where a storage event would trigger with the\n      // correct key, oldValue and newValue but localStorage.getItem(key) does\n      // not yield the updated value until a few milliseconds. This ensures\n      // this recovers from that situation.\n      setTimeout(triggerListeners, IE10_LOCAL_STORAGE_SYNC_DELAY);\n    } else {\n      triggerListeners();\n    }\n  }\n\n  private notifyListeners(key: string, value: string | null): void {\n    this.localCache[key] = value;\n    const listeners = this.listeners[key];\n    if (listeners) {\n      for (const listener of Array.from(listeners)) {\n        listener(value ? JSON.parse(value) : value);\n      }\n    }\n  }\n\n  private startPolling(): void {\n    this.stopPolling();\n\n    this.pollTimer = setInterval(() => {\n      this.forAllChangedKeys(\n        (key: string, oldValue: string | null, newValue: string | null) => {\n          this.onStorageEvent(\n            new StorageEvent('storage', {\n              key,\n              oldValue,\n              newValue\n            }),\n            /* poll */ true\n          );\n        }\n      );\n    }, _POLLING_INTERVAL_MS);\n  }\n\n  private stopPolling(): void {\n    if (this.pollTimer) {\n      clearInterval(this.pollTimer);\n      this.pollTimer = null;\n    }\n  }\n\n  private attachListener(): void {\n    window.addEventListener('storage', this.boundEventHandler);\n  }\n\n  private detachListener(): void {\n    window.removeEventListener('storage', this.boundEventHandler);\n  }\n\n  _addListener(key: string, listener: StorageEventListener): void {\n    if (Object.keys(this.listeners).length === 0) {\n      // Whether browser can detect storage event when it had already been pushed to the background.\n      // This may happen in some mobile browsers. A localStorage change in the foreground window\n      // will not be detected in the background window via the storage event.\n      // This was detected in iOS 7.x mobile browsers\n      if (this.fallbackToPolling) {\n        this.startPolling();\n      } else {\n        this.attachListener();\n      }\n    }\n    if (!this.listeners[key]) {\n      this.listeners[key] = new Set();\n      // Populate the cache to avoid spuriously triggering on first poll.\n      this.localCache[key] = this.storage.getItem(key);\n    }\n    this.listeners[key].add(listener);\n  }\n\n  _removeListener(key: string, listener: StorageEventListener): void {\n    if (this.listeners[key]) {\n      this.listeners[key].delete(listener);\n\n      if (this.listeners[key].size === 0) {\n        delete this.listeners[key];\n      }\n    }\n\n    if (Object.keys(this.listeners).length === 0) {\n      this.detachListener();\n      this.stopPolling();\n    }\n  }\n\n  // Update local cache on base operations:\n\n  async _set(key: string, value: PersistenceValue): Promise<void> {\n    await super._set(key, value);\n    this.localCache[key] = JSON.stringify(value);\n  }\n\n  async _get<T extends PersistenceValue>(key: string): Promise<T | null> {\n    const value = await super._get<T>(key);\n    this.localCache[key] = JSON.stringify(value);\n    return value;\n  }\n\n  async _remove(key: string): Promise<void> {\n    await super._remove(key);\n    delete this.localCache[key];\n  }\n}\n\n/**\n * An implementation of {@link Persistence} of type `LOCAL` using `localStorage`\n * for the underlying storage.\n *\n * @public\n */\nexport const browserLocalPersistence: Persistence = BrowserLocalPersistence;\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Persistence } from '../../model/public_types';\n\nimport {\n  PersistenceInternal as InternalPersistence,\n  PersistenceType,\n  StorageEventListener\n} from '../../core/persistence';\nimport { BrowserPersistenceClass } from './browser';\n\nclass BrowserSessionPersistence\n  extends BrowserPersistenceClass\n  implements InternalPersistence\n{\n  static type: 'SESSION' = 'SESSION';\n\n  constructor() {\n    super(() => window.sessionStorage, PersistenceType.SESSION);\n  }\n\n  _addListener(_key: string, _listener: StorageEventListener): void {\n    // Listeners are not supported for session storage since it cannot be shared across windows\n    return;\n  }\n\n  _removeListener(_key: string, _listener: StorageEventListener): void {\n    // Listeners are not supported for session storage since it cannot be shared across windows\n    return;\n  }\n}\n\n/**\n * An implementation of {@link Persistence} of `SESSION` using `sessionStorage`\n * for the underlying storage.\n *\n * @public\n */\nexport const browserSessionPersistence: Persistence = BrowserSessionPersistence;\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  ReceiverHandler,\n  _EventType,\n  _ReceiverResponse,\n  SenderMessageEvent,\n  _Status,\n  _SenderRequest\n} from './index';\nimport { _allSettled } from './promise';\n\n/**\n * Interface class for receiving messages.\n *\n */\nexport class Receiver {\n  private static readonly receivers: Receiver[] = [];\n  private readonly boundEventHandler: EventListener;\n\n  private readonly handlersMap: {\n    // Typescript doesn't have existential types :(\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    [eventType: string]: Set<ReceiverHandler<any, any>>;\n  } = {};\n\n  constructor(private readonly eventTarget: EventTarget) {\n    this.boundEventHandler = this.handleEvent.bind(this);\n  }\n\n  /**\n   * Obtain an instance of a Receiver for a given event target, if none exists it will be created.\n   *\n   * @param eventTarget - An event target (such as window or self) through which the underlying\n   * messages will be received.\n   */\n  static _getInstance(eventTarget: EventTarget): Receiver {\n    // The results are stored in an array since objects can't be keys for other\n    // objects. In addition, setting a unique property on an event target as a\n    // hash map key may not be allowed due to CORS restrictions.\n    const existingInstance = this.receivers.find(receiver =>\n      receiver.isListeningto(eventTarget)\n    );\n    if (existingInstance) {\n      return existingInstance;\n    }\n    const newInstance = new Receiver(eventTarget);\n    this.receivers.push(newInstance);\n    return newInstance;\n  }\n\n  private isListeningto(eventTarget: EventTarget): boolean {\n    return this.eventTarget === eventTarget;\n  }\n\n  /**\n   * Fans out a MessageEvent to the appropriate listeners.\n   *\n   * @remarks\n   * Sends an {@link Status.ACK} upon receipt and a {@link Status.DONE} once all handlers have\n   * finished processing.\n   *\n   * @param event - The MessageEvent.\n   *\n   */\n  private async handleEvent<\n    T extends _ReceiverResponse,\n    S extends _SenderRequest\n  >(event: Event): Promise<void> {\n    const messageEvent = event as MessageEvent<SenderMessageEvent<S>>;\n    const { eventId, eventType, data } = messageEvent.data;\n\n    const handlers: Set<ReceiverHandler<T, S>> | undefined =\n      this.handlersMap[eventType];\n    if (!handlers?.size) {\n      return;\n    }\n\n    messageEvent.ports[0].postMessage({\n      status: _Status.ACK,\n      eventId,\n      eventType\n    });\n\n    const promises = Array.from(handlers).map(async handler =>\n      handler(messageEvent.origin, data)\n    );\n    const response = await _allSettled(promises);\n    messageEvent.ports[0].postMessage({\n      status: _Status.DONE,\n      eventId,\n      eventType,\n      response\n    });\n  }\n\n  /**\n   * Subscribe an event handler for a particular event.\n   *\n   * @param eventType - Event name to subscribe to.\n   * @param eventHandler - The event handler which should receive the events.\n   *\n   */\n  _subscribe<T extends _ReceiverResponse, S extends _SenderRequest>(\n    eventType: _EventType,\n    eventHandler: ReceiverHandler<T, S>\n  ): void {\n    if (Object.keys(this.handlersMap).length === 0) {\n      this.eventTarget.addEventListener('message', this.boundEventHandler);\n    }\n\n    if (!this.handlersMap[eventType]) {\n      this.handlersMap[eventType] = new Set();\n    }\n\n    this.handlersMap[eventType].add(eventHandler);\n  }\n\n  /**\n   * Unsubscribe an event handler from a particular event.\n   *\n   * @param eventType - Event name to unsubscribe from.\n   * @param eventHandler - Optinoal event handler, if none provided, unsubscribe all handlers on this event.\n   *\n   */\n  _unsubscribe<T extends _ReceiverResponse, S extends _SenderRequest>(\n    eventType: _EventType,\n    eventHandler?: ReceiverHandler<T, S>\n  ): void {\n    if (this.handlersMap[eventType] && eventHandler) {\n      this.handlersMap[eventType].delete(eventHandler);\n    }\n    if (!eventHandler || this.handlersMap[eventType].size === 0) {\n      delete this.handlersMap[eventType];\n    }\n\n    if (Object.keys(this.handlersMap).length === 0) {\n      this.eventTarget.removeEventListener('message', this.boundEventHandler);\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** TODO: remove this once tslib has a polyfill for Promise.allSettled */\ninterface PromiseFulfilledResult<T> {\n  fulfilled: true;\n  value: T;\n}\n\ninterface PromiseRejectedResult {\n  fulfilled: false;\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  reason: any;\n}\n\nexport type PromiseSettledResult<T> =\n  | PromiseFulfilledResult<T>\n  | PromiseRejectedResult;\n\n/**\n * Shim for Promise.allSettled, note the slightly different format of `fulfilled` vs `status`.\n *\n * @param promises - Array of promises to wait on.\n */\nexport function _allSettled<T>(\n  promises: Array<Promise<T>>\n): Promise<Array<PromiseSettledResult<T>>> {\n  return Promise.all(\n    promises.map(async promise => {\n      try {\n        const value = await promise;\n        return {\n          fulfilled: true,\n          value\n        } as PromiseFulfilledResult<T>;\n      } catch (reason) {\n        return {\n          fulfilled: false,\n          reason\n        } as PromiseRejectedResult;\n      }\n    })\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function _generateEventId(prefix = '', digits = 10): string {\n  let random = '';\n  for (let i = 0; i < digits; i++) {\n    random += Math.floor(Math.random() * 10);\n  }\n  return prefix + random;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { _generateEventId } from '../../core/util/event_id';\nimport {\n  _SenderRequest,\n  _EventType,\n  ReceiverMessageEvent,\n  _MessageError,\n  SenderMessageEvent,\n  _Status,\n  _ReceiverMessageResponse,\n  _ReceiverResponse,\n  _TimeoutDuration\n} from './index';\n\ninterface MessageHandler {\n  messageChannel: MessageChannel;\n  onMessage: EventListenerOrEventListenerObject;\n}\n\n/**\n * Interface for sending messages and waiting for a completion response.\n *\n */\nexport class Sender {\n  private readonly handlers = new Set<MessageHandler>();\n\n  constructor(private readonly target: ServiceWorker) {}\n\n  /**\n   * Unsubscribe the handler and remove it from our tracking Set.\n   *\n   * @param handler - The handler to unsubscribe.\n   */\n  private removeMessageHandler(handler: MessageHandler): void {\n    if (handler.messageChannel) {\n      handler.messageChannel.port1.removeEventListener(\n        'message',\n        handler.onMessage\n      );\n      handler.messageChannel.port1.close();\n    }\n    this.handlers.delete(handler);\n  }\n\n  /**\n   * Send a message to the Receiver located at {@link target}.\n   *\n   * @remarks\n   * We'll first wait a bit for an ACK , if we get one we will wait significantly longer until the\n   * receiver has had a chance to fully process the event.\n   *\n   * @param eventType - Type of event to send.\n   * @param data - The payload of the event.\n   * @param timeout - Timeout for waiting on an ACK from the receiver.\n   *\n   * @returns An array of settled promises from all the handlers that were listening on the receiver.\n   */\n  async _send<T extends _ReceiverResponse, S extends _SenderRequest>(\n    eventType: _EventType,\n    data: S,\n    timeout = _TimeoutDuration.ACK\n  ): Promise<_ReceiverMessageResponse<T>> {\n    const messageChannel =\n      typeof MessageChannel !== 'undefined' ? new MessageChannel() : null;\n    if (!messageChannel) {\n      throw new Error(_MessageError.CONNECTION_UNAVAILABLE);\n    }\n    // Node timers and browser timers return fundamentally different types.\n    // We don't actually care what the value is but TS won't accept unknown and\n    // we can't cast properly in both environments.\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    let completionTimer: any;\n    let handler: MessageHandler;\n    return new Promise<_ReceiverMessageResponse<T>>((resolve, reject) => {\n      const eventId = _generateEventId('', 20);\n      messageChannel.port1.start();\n      const ackTimer = setTimeout(() => {\n        reject(new Error(_MessageError.UNSUPPORTED_EVENT));\n      }, timeout);\n      handler = {\n        messageChannel,\n        onMessage(event: Event): void {\n          const messageEvent = event as MessageEvent<ReceiverMessageEvent<T>>;\n          if (messageEvent.data.eventId !== eventId) {\n            return;\n          }\n          switch (messageEvent.data.status) {\n            case _Status.ACK:\n              // The receiver should ACK first.\n              clearTimeout(ackTimer);\n              completionTimer = setTimeout(() => {\n                reject(new Error(_MessageError.TIMEOUT));\n              }, _TimeoutDuration.COMPLETION);\n              break;\n            case _Status.DONE:\n              // Once the receiver's handlers are finished we will get the results.\n              clearTimeout(completionTimer);\n              resolve(messageEvent.data.response);\n              break;\n            default:\n              clearTimeout(ackTimer);\n              clearTimeout(completionTimer);\n              reject(new Error(_MessageError.INVALID_RESPONSE));\n              break;\n          }\n        }\n      };\n      this.handlers.add(handler);\n      messageChannel.port1.addEventListener('message', handler.onMessage);\n      this.target.postMessage(\n        {\n          eventType,\n          eventId,\n          data\n        } as SenderMessageEvent<S>,\n        [messageChannel.port2]\n      );\n    }).finally(() => {\n      if (handler) {\n        this.removeMessageHandler(handler);\n      }\n    });\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Recaptcha, GreCAPTCHATopLevel } from './recaptcha/recaptcha';\n\n/**\n * A specialized window type that melds the normal window type plus the\n * various bits we need. The three different blocks that are &'d together\n * cant be defined in the same block together.\n */\nexport type AuthWindow = {\n  // Standard window types\n  [T in keyof Window]: Window[T];\n} & {\n  // Any known / named properties we want to add\n  grecaptcha?: Recaptcha | GreCAPTCHATopLevel;\n  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n  ___jsl?: Record<string, any>;\n  gapi?: typeof gapi;\n} & {\n  // A final catch-all for callbacks (which will have random names) that\n  // we will stick on the window.\n  [callback: string]: (...args: unknown[]) => void;\n};\n\n/**\n * Lazy accessor for window, since the compat layer won't tree shake this out,\n * we need to make sure not to mess with window unless we have to\n */\nexport function _window(): AuthWindow {\n  return window as unknown as AuthWindow;\n}\n\nexport function _setWindowLocation(url: string): void {\n  _window().location.href = url;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { _window } from '../auth_window';\n\nexport function _isWorker(): boolean {\n  return (\n    typeof _window()['WorkerGlobalScope'] !== 'undefined' &&\n    typeof _window()['importScripts'] === 'function'\n  );\n}\n\nexport async function _getActiveServiceWorker(): Promise<ServiceWorker | null> {\n  if (!navigator?.serviceWorker) {\n    return null;\n  }\n  try {\n    const registration = await navigator.serviceWorker.ready;\n    return registration.active;\n  } catch {\n    return null;\n  }\n}\n\nexport function _getServiceWorkerController(): ServiceWorker | null {\n  return navigator?.serviceWorker?.controller || null;\n}\n\nexport function _getWorkerGlobalScope(): ServiceWorker | null {\n  return _isWorker() ? (self as unknown as ServiceWorker) : null;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Persistence } from '../../model/public_types';\nimport {\n  PersistedBlob,\n  PersistenceInternal as InternalPersistence,\n  PersistenceType,\n  PersistenceValue,\n  StorageEventListener,\n  STORAGE_AVAILABLE_KEY\n} from '../../core/persistence/';\nimport {\n  _EventType,\n  _PingResponse,\n  KeyChangedResponse,\n  KeyChangedRequest,\n  PingRequest,\n  _TimeoutDuration\n} from '../messagechannel/index';\nimport { Receiver } from '../messagechannel/receiver';\nimport { Sender } from '../messagechannel/sender';\nimport {\n  _isWorker,\n  _getActiveServiceWorker,\n  _getServiceWorkerController,\n  _getWorkerGlobalScope\n} from '../util/worker';\n\nexport const DB_NAME = 'firebaseLocalStorageDb';\nconst DB_VERSION = 1;\nconst DB_OBJECTSTORE_NAME = 'firebaseLocalStorage';\nconst DB_DATA_KEYPATH = 'fbase_key';\n\ninterface DBObject {\n  [DB_DATA_KEYPATH]: string;\n  value: PersistedBlob;\n}\n\n/**\n * Promise wrapper for IDBRequest\n *\n * Unfortunately we can't cleanly extend Promise<T> since promises are not callable in ES6\n *\n */\nclass DBPromise<T> {\n  constructor(private readonly request: IDBRequest) {}\n\n  toPromise(): Promise<T> {\n    return new Promise<T>((resolve, reject) => {\n      this.request.addEventListener('success', () => {\n        resolve(this.request.result);\n      });\n      this.request.addEventListener('error', () => {\n        reject(this.request.error);\n      });\n    });\n  }\n}\n\nfunction getObjectStore(db: IDBDatabase, isReadWrite: boolean): IDBObjectStore {\n  return db\n    .transaction([DB_OBJECTSTORE_NAME], isReadWrite ? 'readwrite' : 'readonly')\n    .objectStore(DB_OBJECTSTORE_NAME);\n}\n\nexport async function _clearDatabase(db: IDBDatabase): Promise<void> {\n  const objectStore = getObjectStore(db, true);\n  return new DBPromise<void>(objectStore.clear()).toPromise();\n}\n\nexport function _deleteDatabase(): Promise<void> {\n  const request = indexedDB.deleteDatabase(DB_NAME);\n  return new DBPromise<void>(request).toPromise();\n}\n\nexport function _openDatabase(): Promise<IDBDatabase> {\n  const request = indexedDB.open(DB_NAME, DB_VERSION);\n  return new Promise((resolve, reject) => {\n    request.addEventListener('error', () => {\n      reject(request.error);\n    });\n\n    request.addEventListener('upgradeneeded', () => {\n      const db = request.result;\n\n      try {\n        db.createObjectStore(DB_OBJECTSTORE_NAME, { keyPath: DB_DATA_KEYPATH });\n      } catch (e) {\n        reject(e);\n      }\n    });\n\n    request.addEventListener('success', async () => {\n      const db: IDBDatabase = request.result;\n      // Strange bug that occurs in Firefox when multiple tabs are opened at the\n      // same time. The only way to recover seems to be deleting the database\n      // and re-initializing it.\n      // https://github.com/firebase/firebase-js-sdk/issues/634\n\n      if (!db.objectStoreNames.contains(DB_OBJECTSTORE_NAME)) {\n        // Need to close the database or else you get a `blocked` event\n        db.close();\n        await _deleteDatabase();\n        resolve(await _openDatabase());\n      } else {\n        resolve(db);\n      }\n    });\n  });\n}\n\nexport async function _putObject(\n  db: IDBDatabase,\n  key: string,\n  value: PersistenceValue | string\n): Promise<void> {\n  const request = getObjectStore(db, true).put({\n    [DB_DATA_KEYPATH]: key,\n    value\n  });\n  return new DBPromise<void>(request).toPromise();\n}\n\nasync function getObject(\n  db: IDBDatabase,\n  key: string\n): Promise<PersistedBlob | null> {\n  const request = getObjectStore(db, false).get(key);\n  const data = await new DBPromise<DBObject | undefined>(request).toPromise();\n  return data === undefined ? null : data.value;\n}\n\nexport function _deleteObject(db: IDBDatabase, key: string): Promise<void> {\n  const request = getObjectStore(db, true).delete(key);\n  return new DBPromise<void>(request).toPromise();\n}\n\nexport const _POLLING_INTERVAL_MS = 800;\nexport const _TRANSACTION_RETRY_COUNT = 3;\n\nclass IndexedDBLocalPersistence implements InternalPersistence {\n  static type: 'LOCAL' = 'LOCAL';\n\n  type = PersistenceType.LOCAL;\n  db?: IDBDatabase;\n  readonly _shouldAllowMigration = true;\n\n  private readonly listeners: Record<string, Set<StorageEventListener>> = {};\n  private readonly localCache: Record<string, PersistenceValue | null> = {};\n  // setTimeout return value is platform specific\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private pollTimer: any | null = null;\n  private pendingWrites = 0;\n\n  private receiver: Receiver | null = null;\n  private sender: Sender | null = null;\n  private serviceWorkerReceiverAvailable = false;\n  private activeServiceWorker: ServiceWorker | null = null;\n  // Visible for testing only\n  readonly _workerInitializationPromise: Promise<void>;\n\n  constructor() {\n    // Fire & forget the service worker registration as it may never resolve\n    this._workerInitializationPromise =\n      this.initializeServiceWorkerMessaging().then(\n        () => {},\n        () => {}\n      );\n  }\n\n  async _openDb(): Promise<IDBDatabase> {\n    if (this.db) {\n      return this.db;\n    }\n    this.db = await _openDatabase();\n    return this.db;\n  }\n\n  async _withRetries<T>(op: (db: IDBDatabase) => Promise<T>): Promise<T> {\n    let numAttempts = 0;\n\n    while (true) {\n      try {\n        const db = await this._openDb();\n        return await op(db);\n      } catch (e) {\n        if (numAttempts++ > _TRANSACTION_RETRY_COUNT) {\n          throw e;\n        }\n        if (this.db) {\n          this.db.close();\n          this.db = undefined;\n        }\n        // TODO: consider adding exponential backoff\n      }\n    }\n  }\n\n  /**\n   * IndexedDB events do not propagate from the main window to the worker context.  We rely on a\n   * postMessage interface to send these events to the worker ourselves.\n   */\n  private async initializeServiceWorkerMessaging(): Promise<void> {\n    return _isWorker() ? this.initializeReceiver() : this.initializeSender();\n  }\n\n  /**\n   * As the worker we should listen to events from the main window.\n   */\n  private async initializeReceiver(): Promise<void> {\n    this.receiver = Receiver._getInstance(_getWorkerGlobalScope()!);\n    // Refresh from persistence if we receive a KeyChanged message.\n    this.receiver._subscribe(\n      _EventType.KEY_CHANGED,\n      async (_origin: string, data: KeyChangedRequest) => {\n        const keys = await this._poll();\n        return {\n          keyProcessed: keys.includes(data.key)\n        };\n      }\n    );\n    // Let the sender know that we are listening so they give us more timeout.\n    this.receiver._subscribe(\n      _EventType.PING,\n      async (_origin: string, _data: PingRequest) => {\n        return [_EventType.KEY_CHANGED];\n      }\n    );\n  }\n\n  /**\n   * As the main window, we should let the worker know when keys change (set and remove).\n   *\n   * @remarks\n   * {@link https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/ready | ServiceWorkerContainer.ready}\n   * may not resolve.\n   */\n  private async initializeSender(): Promise<void> {\n    // Check to see if there's an active service worker.\n    this.activeServiceWorker = await _getActiveServiceWorker();\n    if (!this.activeServiceWorker) {\n      return;\n    }\n    this.sender = new Sender(this.activeServiceWorker);\n    // Ping the service worker to check what events they can handle.\n    const results = await this.sender._send<_PingResponse, PingRequest>(\n      _EventType.PING,\n      {},\n      _TimeoutDuration.LONG_ACK\n    );\n    if (!results) {\n      return;\n    }\n    if (\n      results[0]?.fulfilled &&\n      results[0]?.value.includes(_EventType.KEY_CHANGED)\n    ) {\n      this.serviceWorkerReceiverAvailable = true;\n    }\n  }\n\n  /**\n   * Let the worker know about a changed key, the exact key doesn't technically matter since the\n   * worker will just trigger a full sync anyway.\n   *\n   * @remarks\n   * For now, we only support one service worker per page.\n   *\n   * @param key - Storage key which changed.\n   */\n  private async notifyServiceWorker(key: string): Promise<void> {\n    if (\n      !this.sender ||\n      !this.activeServiceWorker ||\n      _getServiceWorkerController() !== this.activeServiceWorker\n    ) {\n      return;\n    }\n    try {\n      await this.sender._send<KeyChangedResponse, KeyChangedRequest>(\n        _EventType.KEY_CHANGED,\n        { key },\n        // Use long timeout if receiver has previously responded to a ping from us.\n        this.serviceWorkerReceiverAvailable\n          ? _TimeoutDuration.LONG_ACK\n          : _TimeoutDuration.ACK\n      );\n    } catch {\n      // This is a best effort approach. Ignore errors.\n    }\n  }\n\n  async _isAvailable(): Promise<boolean> {\n    try {\n      if (!indexedDB) {\n        return false;\n      }\n      const db = await _openDatabase();\n      await _putObject(db, STORAGE_AVAILABLE_KEY, '1');\n      await _deleteObject(db, STORAGE_AVAILABLE_KEY);\n      return true;\n    } catch {}\n    return false;\n  }\n\n  private async _withPendingWrite(write: () => Promise<void>): Promise<void> {\n    this.pendingWrites++;\n    try {\n      await write();\n    } finally {\n      this.pendingWrites--;\n    }\n  }\n\n  async _set(key: string, value: PersistenceValue): Promise<void> {\n    return this._withPendingWrite(async () => {\n      await this._withRetries((db: IDBDatabase) => _putObject(db, key, value));\n      this.localCache[key] = value;\n      return this.notifyServiceWorker(key);\n    });\n  }\n\n  async _get<T extends PersistenceValue>(key: string): Promise<T | null> {\n    const obj = (await this._withRetries((db: IDBDatabase) =>\n      getObject(db, key)\n    )) as T;\n    this.localCache[key] = obj;\n    return obj;\n  }\n\n  async _remove(key: string): Promise<void> {\n    return this._withPendingWrite(async () => {\n      await this._withRetries((db: IDBDatabase) => _deleteObject(db, key));\n      delete this.localCache[key];\n      return this.notifyServiceWorker(key);\n    });\n  }\n\n  private async _poll(): Promise<string[]> {\n    // TODO: check if we need to fallback if getAll is not supported\n    const result = await this._withRetries((db: IDBDatabase) => {\n      const getAllRequest = getObjectStore(db, false).getAll();\n      return new DBPromise<DBObject[] | null>(getAllRequest).toPromise();\n    });\n\n    if (!result) {\n      return [];\n    }\n\n    // If we have pending writes in progress abort, we'll get picked up on the next poll\n    if (this.pendingWrites !== 0) {\n      return [];\n    }\n\n    const keys = [];\n    const keysInResult = new Set();\n    if (result.length !== 0) {\n      for (const { fbase_key: key, value } of result) {\n        keysInResult.add(key);\n        if (JSON.stringify(this.localCache[key]) !== JSON.stringify(value)) {\n          this.notifyListeners(key, value as PersistenceValue);\n          keys.push(key);\n        }\n      }\n    }\n\n    for (const localKey of Object.keys(this.localCache)) {\n      if (this.localCache[localKey] && !keysInResult.has(localKey)) {\n        // Deleted\n        this.notifyListeners(localKey, null);\n        keys.push(localKey);\n      }\n    }\n    return keys;\n  }\n\n  private notifyListeners(\n    key: string,\n    newValue: PersistenceValue | null\n  ): void {\n    this.localCache[key] = newValue;\n    const listeners = this.listeners[key];\n    if (listeners) {\n      for (const listener of Array.from(listeners)) {\n        listener(newValue);\n      }\n    }\n  }\n\n  private startPolling(): void {\n    this.stopPolling();\n\n    this.pollTimer = setInterval(\n      async () => this._poll(),\n      _POLLING_INTERVAL_MS\n    );\n  }\n\n  private stopPolling(): void {\n    if (this.pollTimer) {\n      clearInterval(this.pollTimer);\n      this.pollTimer = null;\n    }\n  }\n\n  _addListener(key: string, listener: StorageEventListener): void {\n    if (Object.keys(this.listeners).length === 0) {\n      this.startPolling();\n    }\n    if (!this.listeners[key]) {\n      this.listeners[key] = new Set();\n      // Populate the cache to avoid spuriously triggering on first poll.\n      void this._get(key); // This can happen in the background async and we can return immediately.\n    }\n    this.listeners[key].add(listener);\n  }\n\n  _removeListener(key: string, listener: StorageEventListener): void {\n    if (this.listeners[key]) {\n      this.listeners[key].delete(listener);\n\n      if (this.listeners[key].size === 0) {\n        delete this.listeners[key];\n      }\n    }\n\n    if (Object.keys(this.listeners).length === 0) {\n      this.stopPolling();\n    }\n  }\n}\n\n/**\n * An implementation of {@link Persistence} of type `LOCAL` using `indexedDB`\n * for the underlying storage.\n *\n * @public\n */\nexport const indexedDBLocalPersistence: Persistence = IndexedDBLocalPersistence;\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AuthErrorCode } from '../../core/errors';\nimport { _assert } from '../../core/util/assert';\nimport { AuthInternal } from '../../model/auth';\nimport { RecaptchaParameters } from '../../model/public_types';\nimport {\n  Recaptcha,\n  GreCAPTCHATopLevel,\n  GreCAPTCHARenderOption,\n  GreCAPTCHA\n} from './recaptcha';\n\nexport const _SOLVE_TIME_MS = 500;\nexport const _EXPIRATION_TIME_MS = 60_000;\nexport const _WIDGET_ID_START = 1_000_000_000_000;\n\nexport interface Widget {\n  getResponse: () => string | null;\n  delete: () => void;\n  execute: () => void;\n}\n\nexport class MockReCaptcha implements Recaptcha {\n  private counter = _WIDGET_ID_START;\n  _widgets = new Map<number, Widget>();\n\n  constructor(private readonly auth: AuthInternal) {}\n\n  render(\n    container: string | HTMLElement,\n    parameters?: RecaptchaParameters\n  ): number {\n    const id = this.counter;\n    this._widgets.set(\n      id,\n      new MockWidget(container, this.auth.name, parameters || {})\n    );\n    this.counter++;\n    return id;\n  }\n\n  reset(optWidgetId?: number): void {\n    const id = optWidgetId || _WIDGET_ID_START;\n    void this._widgets.get(id)?.delete();\n    this._widgets.delete(id);\n  }\n\n  getResponse(optWidgetId?: number): string {\n    const id = optWidgetId || _WIDGET_ID_START;\n    return this._widgets.get(id)?.getResponse() || '';\n  }\n\n  async execute(optWidgetId?: number | string): Promise<string> {\n    const id: number = (optWidgetId as number) || _WIDGET_ID_START;\n    void this._widgets.get(id)?.execute();\n    return '';\n  }\n}\n\nexport class MockGreCAPTCHATopLevel implements GreCAPTCHATopLevel {\n  enterprise: GreCAPTCHA = new MockGreCAPTCHA();\n  ready(callback: () => void): void {\n    callback();\n  }\n\n  execute(\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    _siteKey: string,\n    _options: { action: string }\n  ): Promise<string> {\n    return Promise.resolve('token');\n  }\n  render(\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    _container: string | HTMLElement,\n    _parameters: GreCAPTCHARenderOption\n  ): string {\n    return '';\n  }\n}\n\nexport class MockGreCAPTCHA implements GreCAPTCHA {\n  ready(callback: () => void): void {\n    callback();\n  }\n\n  execute(\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    _siteKey: string,\n    _options: { action: string }\n  ): Promise<string> {\n    return Promise.resolve('token');\n  }\n  render(\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    _container: string | HTMLElement,\n    _parameters: GreCAPTCHARenderOption\n  ): string {\n    return '';\n  }\n}\n\nexport class MockWidget {\n  private readonly container: HTMLElement;\n  private readonly isVisible: boolean;\n  private timerId: number | null = null;\n  private deleted = false;\n  private responseToken: string | null = null;\n  private readonly clickHandler = (): void => {\n    this.execute();\n  };\n\n  constructor(\n    containerOrId: string | HTMLElement,\n    appName: string,\n    private readonly params: RecaptchaParameters\n  ) {\n    const container =\n      typeof containerOrId === 'string'\n        ? document.getElementById(containerOrId)\n        : containerOrId;\n    _assert(container, AuthErrorCode.ARGUMENT_ERROR, { appName });\n\n    this.container = container;\n    this.isVisible = this.params.size !== 'invisible';\n    if (this.isVisible) {\n      this.execute();\n    } else {\n      this.container.addEventListener('click', this.clickHandler);\n    }\n  }\n\n  getResponse(): string | null {\n    this.checkIfDeleted();\n    return this.responseToken;\n  }\n\n  delete(): void {\n    this.checkIfDeleted();\n    this.deleted = true;\n    if (this.timerId) {\n      clearTimeout(this.timerId);\n      this.timerId = null;\n    }\n    this.container.removeEventListener('click', this.clickHandler);\n  }\n\n  execute(): void {\n    this.checkIfDeleted();\n    if (this.timerId) {\n      return;\n    }\n\n    this.timerId = window.setTimeout(() => {\n      this.responseToken = generateRandomAlphaNumericString(50);\n      const { callback, 'expired-callback': expiredCallback } = this.params;\n      if (callback) {\n        try {\n          callback(this.responseToken);\n        } catch (e) {}\n      }\n\n      this.timerId = window.setTimeout(() => {\n        this.timerId = null;\n        this.responseToken = null;\n        if (expiredCallback) {\n          try {\n            expiredCallback();\n          } catch (e) {}\n        }\n\n        if (this.isVisible) {\n          this.execute();\n        }\n      }, _EXPIRATION_TIME_MS);\n    }, _SOLVE_TIME_MS);\n  }\n\n  private checkIfDeleted(): void {\n    if (this.deleted) {\n      throw new Error('reCAPTCHA mock was already deleted!');\n    }\n  }\n}\n\nfunction generateRandomAlphaNumericString(len: number): string {\n  const chars = [];\n  const allowedChars =\n    '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n  for (let i = 0; i < len; i++) {\n    chars.push(\n      allowedChars.charAt(Math.floor(Math.random() * allowedChars.length))\n    );\n  }\n  return chars.join('');\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { querystring } from '@firebase/util';\n\nimport { AuthErrorCode } from '../../core/errors';\nimport { _assert, _createError } from '../../core/util/assert';\nimport { Delay } from '../../core/util/delay';\nimport { AuthInternal } from '../../model/auth';\nimport { _window } from '../auth_window';\nimport * as jsHelpers from '../load_js';\nimport { Recaptcha, isV2 } from './recaptcha';\nimport { MockReCaptcha } from './recaptcha_mock';\n\n// ReCaptcha will load using the same callback, so the callback function needs\n// to be kept around\nexport const _JSLOAD_CALLBACK = jsHelpers._generateCallbackName('rcb');\nconst NETWORK_TIMEOUT_DELAY = new Delay(30000, 60000);\n\n/**\n * We need to mark this interface as internal explicitly to exclude it in the public typings, because\n * it references AuthInternal which has a circular dependency with UserInternal.\n *\n * @internal\n */\nexport interface ReCaptchaLoader {\n  load(auth: AuthInternal, hl?: string): Promise<Recaptcha>;\n  clearedOneInstance(): void;\n}\n\n/**\n * Loader for the GReCaptcha library. There should only ever be one of this.\n */\nexport class ReCaptchaLoaderImpl implements ReCaptchaLoader {\n  private hostLanguage = '';\n  private counter = 0;\n  /**\n   * Check for `render()` method. `window.grecaptcha` will exist if the Enterprise\n   * version of the ReCAPTCHA script was loaded by someone else (e.g. App Check) but\n   * `window.grecaptcha.render()` will not. Another load will add it.\n   */\n  private readonly librarySeparatelyLoaded = !!_window().grecaptcha?.render;\n\n  load(auth: AuthInternal, hl = ''): Promise<Recaptcha> {\n    _assert(isHostLanguageValid(hl), auth, AuthErrorCode.ARGUMENT_ERROR);\n\n    if (this.shouldResolveImmediately(hl) && isV2(_window().grecaptcha)) {\n      return Promise.resolve(_window().grecaptcha! as Recaptcha);\n    }\n    return new Promise<Recaptcha>((resolve, reject) => {\n      const networkTimeout = _window().setTimeout(() => {\n        reject(_createError(auth, AuthErrorCode.NETWORK_REQUEST_FAILED));\n      }, NETWORK_TIMEOUT_DELAY.get());\n\n      _window()[_JSLOAD_CALLBACK] = () => {\n        _window().clearTimeout(networkTimeout);\n        delete _window()[_JSLOAD_CALLBACK];\n\n        const recaptcha = _window().grecaptcha as Recaptcha;\n\n        if (!recaptcha || !isV2(recaptcha)) {\n          reject(_createError(auth, AuthErrorCode.INTERNAL_ERROR));\n          return;\n        }\n\n        // Wrap the greptcha render function so that we know if the developer has\n        // called it separately\n        const render = recaptcha.render;\n        recaptcha.render = (container, params) => {\n          const widgetId = render(container, params);\n          this.counter++;\n          return widgetId;\n        };\n\n        this.hostLanguage = hl;\n        resolve(recaptcha);\n      };\n\n      const url = `${jsHelpers._recaptchaV2ScriptUrl()}?${querystring({\n        onload: _JSLOAD_CALLBACK,\n        render: 'explicit',\n        hl\n      })}`;\n\n      jsHelpers._loadJS(url).catch(() => {\n        clearTimeout(networkTimeout);\n        reject(_createError(auth, AuthErrorCode.INTERNAL_ERROR));\n      });\n    });\n  }\n\n  clearedOneInstance(): void {\n    this.counter--;\n  }\n\n  private shouldResolveImmediately(hl: string): boolean {\n    // We can resolve immediately if:\n    //   • grecaptcha is already defined AND (\n    //     1. the requested language codes are the same OR\n    //     2. there exists already a ReCaptcha on the page\n    //     3. the library was already loaded by the app\n    // In cases (2) and (3), we _can't_ reload as it would break the recaptchas\n    // that are already in the page\n    return (\n      !!_window().grecaptcha?.render &&\n      (hl === this.hostLanguage ||\n        this.counter > 0 ||\n        this.librarySeparatelyLoaded)\n    );\n  }\n}\n\nfunction isHostLanguageValid(hl: string): boolean {\n  return hl.length <= 6 && /^\\s*[a-zA-Z0-9\\-]*\\s*$/.test(hl);\n}\n\nexport class MockReCaptchaLoaderImpl implements ReCaptchaLoader {\n  async load(auth: AuthInternal): Promise<Recaptcha> {\n    return new MockReCaptcha(auth);\n  }\n\n  clearedOneInstance(): void {}\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Auth, RecaptchaParameters } from '../../model/public_types';\nimport { getRecaptchaParams } from '../../api/authentication/recaptcha';\nimport { _castAuth } from '../../core/auth/auth_impl';\nimport { AuthErrorCode } from '../../core/errors';\nimport { _assert } from '../../core/util/assert';\nimport { _isHttpOrHttps } from '../../core/util/location';\nimport { ApplicationVerifierInternal } from '../../model/application_verifier';\nimport { AuthInternal } from '../../model/auth';\nimport { _window } from '../auth_window';\nimport { _isWorker } from '../util/worker';\nimport { Recaptcha } from './recaptcha';\nimport {\n  MockReCaptchaLoaderImpl,\n  ReCaptchaLoader,\n  ReCaptchaLoaderImpl\n} from './recaptcha_loader';\n\nexport const RECAPTCHA_VERIFIER_TYPE = 'recaptcha';\n\nconst DEFAULT_PARAMS: RecaptchaParameters = {\n  theme: 'light',\n  type: 'image'\n};\n\ntype TokenCallback = (token: string) => void;\n\n/**\n * An {@link https://www.google.com/recaptcha/ | reCAPTCHA}-based application verifier.\n *\n * @remarks\n * `RecaptchaVerifier` does not work in a Node.js environment.\n *\n * @public\n */\nexport class RecaptchaVerifier implements ApplicationVerifierInternal {\n  /**\n   * The application verifier type.\n   *\n   * @remarks\n   * For a reCAPTCHA verifier, this is 'recaptcha'.\n   */\n  readonly type = RECAPTCHA_VERIFIER_TYPE;\n  private destroyed = false;\n  private widgetId: number | null = null;\n  private readonly container: HTMLElement;\n  private readonly isInvisible: boolean;\n  private readonly tokenChangeListeners = new Set<TokenCallback>();\n  private renderPromise: Promise<number> | null = null;\n  private readonly auth: AuthInternal;\n\n  /** @internal */\n  readonly _recaptchaLoader: ReCaptchaLoader;\n  private recaptcha: Recaptcha | null = null;\n\n  /**\n   * @param authExtern - The corresponding Firebase {@link Auth} instance.\n   *\n   * @param containerOrId - The reCAPTCHA container parameter.\n   *\n   * @remarks\n   * This has different meaning depending on whether the reCAPTCHA is hidden or visible. For a\n   * visible reCAPTCHA the container must be empty. If a string is used, it has to correspond to\n   * an element ID. The corresponding element must also must be in the DOM at the time of\n   * initialization.\n   *\n   * @param parameters - The optional reCAPTCHA parameters.\n   *\n   * @remarks\n   * Check the reCAPTCHA docs for a comprehensive list. All parameters are accepted except for\n   * the sitekey. Firebase Auth backend provisions a reCAPTCHA for each project and will\n   * configure this upon rendering. For an invisible reCAPTCHA, a size key must have the value\n   * 'invisible'.\n   */\n  constructor(\n    authExtern: Auth,\n    containerOrId: HTMLElement | string,\n    private readonly parameters: RecaptchaParameters = {\n      ...DEFAULT_PARAMS\n    }\n  ) {\n    this.auth = _castAuth(authExtern);\n    this.isInvisible = this.parameters.size === 'invisible';\n    _assert(\n      typeof document !== 'undefined',\n      this.auth,\n      AuthErrorCode.OPERATION_NOT_SUPPORTED\n    );\n    const container =\n      typeof containerOrId === 'string'\n        ? document.getElementById(containerOrId)\n        : containerOrId;\n    _assert(container, this.auth, AuthErrorCode.ARGUMENT_ERROR);\n\n    this.container = container;\n    this.parameters.callback = this.makeTokenCallback(this.parameters.callback);\n\n    this._recaptchaLoader = this.auth.settings.appVerificationDisabledForTesting\n      ? new MockReCaptchaLoaderImpl()\n      : new ReCaptchaLoaderImpl();\n\n    this.validateStartingState();\n    // TODO: Figure out if sdk version is needed\n  }\n\n  /**\n   * Waits for the user to solve the reCAPTCHA and resolves with the reCAPTCHA token.\n   *\n   * @returns A Promise for the reCAPTCHA token.\n   */\n  async verify(): Promise<string> {\n    this.assertNotDestroyed();\n    const id = await this.render();\n    const recaptcha = this.getAssertedRecaptcha();\n\n    const response = recaptcha.getResponse(id);\n    if (response) {\n      return response;\n    }\n\n    return new Promise<string>(resolve => {\n      const tokenChange = (token: string): void => {\n        if (!token) {\n          return; // Ignore token expirations.\n        }\n        this.tokenChangeListeners.delete(tokenChange);\n        resolve(token);\n      };\n\n      this.tokenChangeListeners.add(tokenChange);\n      if (this.isInvisible) {\n        recaptcha.execute(id);\n      }\n    });\n  }\n\n  /**\n   * Renders the reCAPTCHA widget on the page.\n   *\n   * @returns A Promise that resolves with the reCAPTCHA widget ID.\n   */\n  render(): Promise<number> {\n    try {\n      this.assertNotDestroyed();\n    } catch (e) {\n      // This method returns a promise. Since it's not async (we want to return the\n      // _same_ promise if rendering is still occurring), the API surface should\n      // reject with the error rather than just throw\n      return Promise.reject(e);\n    }\n\n    if (this.renderPromise) {\n      return this.renderPromise;\n    }\n\n    this.renderPromise = this.makeRenderPromise().catch(e => {\n      this.renderPromise = null;\n      throw e;\n    });\n\n    return this.renderPromise;\n  }\n\n  /** @internal */\n  _reset(): void {\n    this.assertNotDestroyed();\n    if (this.widgetId !== null) {\n      this.getAssertedRecaptcha().reset(this.widgetId);\n    }\n  }\n\n  /**\n   * Clears the reCAPTCHA widget from the page and destroys the instance.\n   */\n  clear(): void {\n    this.assertNotDestroyed();\n    this.destroyed = true;\n    this._recaptchaLoader.clearedOneInstance();\n    if (!this.isInvisible) {\n      this.container.childNodes.forEach(node => {\n        this.container.removeChild(node);\n      });\n    }\n  }\n\n  private validateStartingState(): void {\n    _assert(!this.parameters.sitekey, this.auth, AuthErrorCode.ARGUMENT_ERROR);\n    _assert(\n      this.isInvisible || !this.container.hasChildNodes(),\n      this.auth,\n      AuthErrorCode.ARGUMENT_ERROR\n    );\n    _assert(\n      typeof document !== 'undefined',\n      this.auth,\n      AuthErrorCode.OPERATION_NOT_SUPPORTED\n    );\n  }\n\n  private makeTokenCallback(\n    existing: TokenCallback | string | undefined\n  ): TokenCallback {\n    return token => {\n      this.tokenChangeListeners.forEach(listener => listener(token));\n      if (typeof existing === 'function') {\n        existing(token);\n      } else if (typeof existing === 'string') {\n        const globalFunc = _window()[existing];\n        if (typeof globalFunc === 'function') {\n          globalFunc(token);\n        }\n      }\n    };\n  }\n\n  private assertNotDestroyed(): void {\n    _assert(!this.destroyed, this.auth, AuthErrorCode.INTERNAL_ERROR);\n  }\n\n  private async makeRenderPromise(): Promise<number> {\n    await this.init();\n    if (!this.widgetId) {\n      let container = this.container;\n      if (!this.isInvisible) {\n        const guaranteedEmpty = document.createElement('div');\n        container.appendChild(guaranteedEmpty);\n        container = guaranteedEmpty;\n      }\n\n      this.widgetId = this.getAssertedRecaptcha().render(\n        container,\n        this.parameters\n      );\n    }\n\n    return this.widgetId;\n  }\n\n  private async init(): Promise<void> {\n    _assert(\n      _isHttpOrHttps() && !_isWorker(),\n      this.auth,\n      AuthErrorCode.INTERNAL_ERROR\n    );\n\n    await domReady();\n    this.recaptcha = await this._recaptchaLoader.load(\n      this.auth,\n      this.auth.languageCode || undefined\n    );\n\n    const siteKey = await getRecaptchaParams(this.auth);\n    _assert(siteKey, this.auth, AuthErrorCode.INTERNAL_ERROR);\n    this.parameters.sitekey = siteKey;\n  }\n\n  private getAssertedRecaptcha(): Recaptcha {\n    _assert(this.recaptcha, this.auth, AuthErrorCode.INTERNAL_ERROR);\n    return this.recaptcha;\n  }\n}\n\nfunction domReady(): Promise<void> {\n  let resolver: (() => void) | null = null;\n  return new Promise<void>(resolve => {\n    if (document.readyState === 'complete') {\n      resolve();\n      return;\n    }\n\n    // Document not ready, wait for load before resolving.\n    // Save resolver, so we can remove listener in case it was externally\n    // cancelled.\n    resolver = () => resolve();\n    window.addEventListener('load', resolver);\n  }).catch(e => {\n    if (resolver) {\n      window.removeEventListener('load', resolver);\n    }\n\n    throw e;\n  });\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  ApplicationVerifier,\n  Auth,\n  ConfirmationResult,\n  PhoneInfoOptions,\n  User,\n  UserCredential\n} from '../../model/public_types';\n\nimport { startEnrollPhoneMfa } from '../../api/account_management/mfa';\nimport { startSignInPhoneMfa } from '../../api/authentication/mfa';\nimport { sendPhoneVerificationCode } from '../../api/authentication/sms';\nimport { ApplicationVerifierInternal } from '../../model/application_verifier';\nimport { PhoneAuthCredential } from '../../core/credentials/phone';\nimport { AuthErrorCode } from '../../core/errors';\nimport { _assertLinkedStatus, _link } from '../../core/user/link_unlink';\nimport {\n  _assert,\n  _serverAppCurrentUserOperationNotSupportedError\n} from '../../core/util/assert';\nimport { AuthInternal } from '../../model/auth';\nimport {\n  linkWithCredential,\n  reauthenticateWithCredential,\n  signInWithCredential\n} from '../../core/strategies/credential';\nimport {\n  MultiFactorSessionImpl,\n  MultiFactorSessionType\n} from '../../mfa/mfa_session';\nimport { UserInternal } from '../../model/user';\nimport { RECAPTCHA_VERIFIER_TYPE } from '../recaptcha/recaptcha_verifier';\nimport { _castAuth } from '../../core/auth/auth_impl';\nimport { getModularInstance } from '@firebase/util';\nimport { ProviderId } from '../../model/enums';\nimport { _isFirebaseServerApp } from '@firebase/app';\n\ninterface OnConfirmationCallback {\n  (credential: PhoneAuthCredential): Promise<UserCredential>;\n}\n\nclass ConfirmationResultImpl implements ConfirmationResult {\n  constructor(\n    readonly verificationId: string,\n    private readonly onConfirmation: OnConfirmationCallback\n  ) {}\n\n  confirm(verificationCode: string): Promise<UserCredential> {\n    const authCredential = PhoneAuthCredential._fromVerification(\n      this.verificationId,\n      verificationCode\n    );\n    return this.onConfirmation(authCredential);\n  }\n}\n\n/**\n * Asynchronously signs in using a phone number.\n *\n * @remarks\n * This method sends a code via SMS to the given\n * phone number, and returns a {@link ConfirmationResult}. After the user\n * provides the code sent to their phone, call {@link ConfirmationResult.confirm}\n * with the code to sign the user in.\n *\n * For abuse prevention, this method also requires a {@link ApplicationVerifier}.\n * This SDK includes a reCAPTCHA-based implementation, {@link RecaptchaVerifier}.\n * This function can work on other platforms that do not support the\n * {@link RecaptchaVerifier} (like React Native), but you need to use a\n * third-party {@link ApplicationVerifier} implementation.\n *\n * This method does not work in a Node.js environment or with {@link Auth} instances created with a\n * {@link @firebase/app#FirebaseServerApp}.\n *\n * @example\n * ```javascript\n * // 'recaptcha-container' is the ID of an element in the DOM.\n * const applicationVerifier = new firebase.auth.RecaptchaVerifier('recaptcha-container');\n * const confirmationResult = await signInWithPhoneNumber(auth, phoneNumber, applicationVerifier);\n * // Obtain a verificationCode from the user.\n * const credential = await confirmationResult.confirm(verificationCode);\n * ```\n *\n * @param auth - The {@link Auth} instance.\n * @param phoneNumber - The user's phone number in E.164 format (e.g. +16505550101).\n * @param appVerifier - The {@link ApplicationVerifier}.\n *\n * @public\n */\nexport async function signInWithPhoneNumber(\n  auth: Auth,\n  phoneNumber: string,\n  appVerifier: ApplicationVerifier\n): Promise<ConfirmationResult> {\n  if (_isFirebaseServerApp(auth.app)) {\n    return Promise.reject(\n      _serverAppCurrentUserOperationNotSupportedError(auth)\n    );\n  }\n  const authInternal = _castAuth(auth);\n  const verificationId = await _verifyPhoneNumber(\n    authInternal,\n    phoneNumber,\n    getModularInstance(appVerifier as ApplicationVerifierInternal)\n  );\n  return new ConfirmationResultImpl(verificationId, cred =>\n    signInWithCredential(authInternal, cred)\n  );\n}\n\n/**\n * Links the user account with the given phone number.\n *\n * @remarks\n * This method does not work in a Node.js environment.\n *\n * @param user - The user.\n * @param phoneNumber - The user's phone number in E.164 format (e.g. +16505550101).\n * @param appVerifier - The {@link ApplicationVerifier}.\n *\n * @public\n */\nexport async function linkWithPhoneNumber(\n  user: User,\n  phoneNumber: string,\n  appVerifier: ApplicationVerifier\n): Promise<ConfirmationResult> {\n  const userInternal = getModularInstance(user) as UserInternal;\n  await _assertLinkedStatus(false, userInternal, ProviderId.PHONE);\n  const verificationId = await _verifyPhoneNumber(\n    userInternal.auth,\n    phoneNumber,\n    getModularInstance(appVerifier as ApplicationVerifierInternal)\n  );\n  return new ConfirmationResultImpl(verificationId, cred =>\n    linkWithCredential(userInternal, cred)\n  );\n}\n\n/**\n * Re-authenticates a user using a fresh phone credential.\n *\n * @remarks\n * Use before operations such as {@link updatePassword} that require tokens from recent sign-in attempts.\n *\n * This method does not work in a Node.js environment or on any {@link User} signed in by\n * {@link Auth} instances created with a {@link @firebase/app#FirebaseServerApp}.\n *\n * @param user - The user.\n * @param phoneNumber - The user's phone number in E.164 format (e.g. +16505550101).\n * @param appVerifier - The {@link ApplicationVerifier}.\n *\n * @public\n */\nexport async function reauthenticateWithPhoneNumber(\n  user: User,\n  phoneNumber: string,\n  appVerifier: ApplicationVerifier\n): Promise<ConfirmationResult> {\n  const userInternal = getModularInstance(user) as UserInternal;\n  if (_isFirebaseServerApp(userInternal.auth.app)) {\n    return Promise.reject(\n      _serverAppCurrentUserOperationNotSupportedError(userInternal.auth)\n    );\n  }\n  const verificationId = await _verifyPhoneNumber(\n    userInternal.auth,\n    phoneNumber,\n    getModularInstance(appVerifier as ApplicationVerifierInternal)\n  );\n  return new ConfirmationResultImpl(verificationId, cred =>\n    reauthenticateWithCredential(userInternal, cred)\n  );\n}\n\n/**\n * Returns a verification ID to be used in conjunction with the SMS code that is sent.\n *\n */\nexport async function _verifyPhoneNumber(\n  auth: AuthInternal,\n  options: PhoneInfoOptions | string,\n  verifier: ApplicationVerifierInternal\n): Promise<string> {\n  const recaptchaToken = await verifier.verify();\n\n  try {\n    _assert(\n      typeof recaptchaToken === 'string',\n      auth,\n      AuthErrorCode.ARGUMENT_ERROR\n    );\n    _assert(\n      verifier.type === RECAPTCHA_VERIFIER_TYPE,\n      auth,\n      AuthErrorCode.ARGUMENT_ERROR\n    );\n\n    let phoneInfoOptions: PhoneInfoOptions;\n\n    if (typeof options === 'string') {\n      phoneInfoOptions = {\n        phoneNumber: options\n      };\n    } else {\n      phoneInfoOptions = options;\n    }\n\n    if ('session' in phoneInfoOptions) {\n      const session = phoneInfoOptions.session as MultiFactorSessionImpl;\n\n      if ('phoneNumber' in phoneInfoOptions) {\n        _assert(\n          session.type === MultiFactorSessionType.ENROLL,\n          auth,\n          AuthErrorCode.INTERNAL_ERROR\n        );\n        const response = await startEnrollPhoneMfa(auth, {\n          idToken: session.credential,\n          phoneEnrollmentInfo: {\n            phoneNumber: phoneInfoOptions.phoneNumber,\n            recaptchaToken\n          }\n        });\n        return response.phoneSessionInfo.sessionInfo;\n      } else {\n        _assert(\n          session.type === MultiFactorSessionType.SIGN_IN,\n          auth,\n          AuthErrorCode.INTERNAL_ERROR\n        );\n        const mfaEnrollmentId =\n          phoneInfoOptions.multiFactorHint?.uid ||\n          phoneInfoOptions.multiFactorUid;\n        _assert(mfaEnrollmentId, auth, AuthErrorCode.MISSING_MFA_INFO);\n        const response = await startSignInPhoneMfa(auth, {\n          mfaPendingCredential: session.credential,\n          mfaEnrollmentId,\n          phoneSignInInfo: {\n            recaptchaToken\n          }\n        });\n        return response.phoneResponseInfo.sessionInfo;\n      }\n    } else {\n      const { sessionInfo } = await sendPhoneVerificationCode(auth, {\n        phoneNumber: phoneInfoOptions.phoneNumber,\n        recaptchaToken\n      });\n      return sessionInfo;\n    }\n  } finally {\n    verifier._reset();\n  }\n}\n\n/**\n * Updates the user's phone number.\n *\n * @remarks\n * This method does not work in a Node.js environment or on any {@link User} signed in by\n * {@link Auth} instances created with a {@link @firebase/app#FirebaseServerApp}.\n *\n * @example\n * ```\n * // 'recaptcha-container' is the ID of an element in the DOM.\n * const applicationVerifier = new RecaptchaVerifier('recaptcha-container');\n * const provider = new PhoneAuthProvider(auth);\n * const verificationId = await provider.verifyPhoneNumber('+16505550101', applicationVerifier);\n * // Obtain the verificationCode from the user.\n * const phoneCredential = PhoneAuthProvider.credential(verificationId, verificationCode);\n * await updatePhoneNumber(user, phoneCredential);\n * ```\n *\n * @param user - The user.\n * @param credential - A credential authenticating the new phone number.\n *\n * @public\n */\nexport async function updatePhoneNumber(\n  user: User,\n  credential: PhoneAuthCredential\n): Promise<void> {\n  const userInternal = getModularInstance(user) as UserInternal;\n  if (_isFirebaseServerApp(userInternal.auth.app)) {\n    return Promise.reject(\n      _serverAppCurrentUserOperationNotSupportedError(userInternal.auth)\n    );\n  }\n  await _link(userInternal, credential);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  _performApiRequest,\n  Endpoint,\n  HttpMethod,\n  _addTidIfNecessary\n} from '../index';\nimport { Auth } from '../../model/public_types';\nimport { IdTokenResponse } from '../../model/id_token';\nimport { MfaEnrollment } from '../account_management/mfa';\nimport { SignInWithIdpResponse } from './idp';\nimport {\n  SignInWithPhoneNumberRequest,\n  SignInWithPhoneNumberResponse\n} from './sms';\n\nexport interface FinalizeMfaResponse {\n  idToken: string;\n  refreshToken: string;\n}\n\n/**\n * @internal\n */\nexport interface IdTokenMfaResponse extends IdTokenResponse {\n  mfaPendingCredential?: string;\n  mfaInfo?: MfaEnrollment[];\n}\n\nexport interface StartPhoneMfaSignInRequest {\n  mfaPendingCredential: string;\n  mfaEnrollmentId: string;\n  phoneSignInInfo: {\n    recaptchaToken: string;\n  };\n  tenantId?: string;\n}\n\nexport interface StartPhoneMfaSignInResponse {\n  phoneResponseInfo: {\n    sessionInfo: string;\n  };\n}\n\nexport function startSignInPhoneMfa(\n  auth: Auth,\n  request: StartPhoneMfaSignInRequest\n): Promise<StartPhoneMfaSignInResponse> {\n  return _performApiRequest<\n    StartPhoneMfaSignInRequest,\n    StartPhoneMfaSignInResponse\n  >(\n    auth,\n    HttpMethod.POST,\n    Endpoint.START_MFA_SIGN_IN,\n    _addTidIfNecessary(auth, request)\n  );\n}\n\nexport interface FinalizePhoneMfaSignInRequest {\n  mfaPendingCredential: string;\n  phoneVerificationInfo: SignInWithPhoneNumberRequest;\n  tenantId?: string;\n}\n\n// TOTP MFA Sign in only has a finalize phase. Phone MFA has a start phase to initiate sending an\n// SMS and a finalize phase to complete sign in. With TOTP, the user already has the OTP in the\n// TOTP/Authenticator app.\nexport interface FinalizeTotpMfaSignInRequest {\n  mfaPendingCredential: string;\n  totpVerificationInfo: { verificationCode: string };\n  tenantId?: string;\n  mfaEnrollmentId: string;\n}\n\nexport interface FinalizePhoneMfaSignInResponse extends FinalizeMfaResponse {}\n\nexport interface FinalizeTotpMfaSignInResponse extends FinalizeMfaResponse {}\n\nexport function finalizeSignInPhoneMfa(\n  auth: Auth,\n  request: FinalizePhoneMfaSignInRequest\n): Promise<FinalizePhoneMfaSignInResponse> {\n  return _performApiRequest<\n    FinalizePhoneMfaSignInRequest,\n    FinalizePhoneMfaSignInResponse\n  >(\n    auth,\n    HttpMethod.POST,\n    Endpoint.FINALIZE_MFA_SIGN_IN,\n    _addTidIfNecessary(auth, request)\n  );\n}\n\nexport function finalizeSignInTotpMfa(\n  auth: Auth,\n  request: FinalizeTotpMfaSignInRequest\n): Promise<FinalizeTotpMfaSignInResponse> {\n  return _performApiRequest<\n    FinalizeTotpMfaSignInRequest,\n    FinalizeTotpMfaSignInResponse\n  >(\n    auth,\n    HttpMethod.POST,\n    Endpoint.FINALIZE_MFA_SIGN_IN,\n    _addTidIfNecessary(auth, request)\n  );\n}\n\n/**\n * @internal\n */\nexport type PhoneOrOauthTokenResponse =\n  | SignInWithPhoneNumberResponse\n  | SignInWithIdpResponse\n  | IdTokenResponse;\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  Auth,\n  PhoneInfoOptions,\n  ApplicationVerifier,\n  UserCredential\n} from '../../model/public_types';\n\nimport { SignInWithPhoneNumberResponse } from '../../api/authentication/sms';\nimport { ApplicationVerifierInternal as ApplicationVerifierInternal } from '../../model/application_verifier';\nimport { AuthInternal as AuthInternal } from '../../model/auth';\nimport { UserCredentialInternal as UserCredentialInternal } from '../../model/user';\nimport { PhoneAuthCredential } from '../../core/credentials/phone';\nimport { _verifyPhoneNumber } from '../strategies/phone';\nimport { _castAuth } from '../../core/auth/auth_impl';\nimport { AuthCredential } from '../../core';\nimport { FirebaseError, getModularInstance } from '@firebase/util';\nimport { TaggedWithTokenResponse } from '../../model/id_token';\nimport { ProviderId, SignInMethod } from '../../model/enums';\n\n/**\n * Provider for generating an {@link PhoneAuthCredential}.\n *\n * @remarks\n * `PhoneAuthProvider` does not work in a Node.js environment.\n *\n * @example\n * ```javascript\n * // 'recaptcha-container' is the ID of an element in the DOM.\n * const applicationVerifier = new RecaptchaVerifier('recaptcha-container');\n * const provider = new PhoneAuthProvider(auth);\n * const verificationId = await provider.verifyPhoneNumber('+16505550101', applicationVerifier);\n * // Obtain the verificationCode from the user.\n * const phoneCredential = PhoneAuthProvider.credential(verificationId, verificationCode);\n * const userCredential = await signInWithCredential(auth, phoneCredential);\n * ```\n *\n * @public\n */\nexport class PhoneAuthProvider {\n  /** Always set to {@link ProviderId}.PHONE. */\n  static readonly PROVIDER_ID: 'phone' = ProviderId.PHONE;\n  /** Always set to {@link SignInMethod}.PHONE. */\n  static readonly PHONE_SIGN_IN_METHOD: 'phone' = SignInMethod.PHONE;\n\n  /** Always set to {@link ProviderId}.PHONE. */\n  readonly providerId = PhoneAuthProvider.PROVIDER_ID;\n  private readonly auth: AuthInternal;\n\n  /**\n   * @param auth - The Firebase {@link Auth} instance in which sign-ins should occur.\n   *\n   */\n  constructor(auth: Auth) {\n    this.auth = _castAuth(auth);\n  }\n\n  /**\n   *\n   * Starts a phone number authentication flow by sending a verification code to the given phone\n   * number.\n   *\n   * @example\n   * ```javascript\n   * const provider = new PhoneAuthProvider(auth);\n   * const verificationId = await provider.verifyPhoneNumber(phoneNumber, applicationVerifier);\n   * // Obtain verificationCode from the user.\n   * const authCredential = PhoneAuthProvider.credential(verificationId, verificationCode);\n   * const userCredential = await signInWithCredential(auth, authCredential);\n   * ```\n   *\n   * @example\n   * An alternative flow is provided using the `signInWithPhoneNumber` method.\n   * ```javascript\n   * const confirmationResult = signInWithPhoneNumber(auth, phoneNumber, applicationVerifier);\n   * // Obtain verificationCode from the user.\n   * const userCredential = confirmationResult.confirm(verificationCode);\n   * ```\n   *\n   * @param phoneInfoOptions - The user's {@link PhoneInfoOptions}. The phone number should be in\n   * E.164 format (e.g. +16505550101).\n   * @param applicationVerifier - For abuse prevention, this method also requires a\n   * {@link ApplicationVerifier}. This SDK includes a reCAPTCHA-based implementation,\n   * {@link RecaptchaVerifier}.\n   *\n   * @returns A Promise for a verification ID that can be passed to\n   * {@link PhoneAuthProvider.credential} to identify this flow..\n   */\n  verifyPhoneNumber(\n    phoneOptions: PhoneInfoOptions | string,\n    applicationVerifier: ApplicationVerifier\n  ): Promise<string> {\n    return _verifyPhoneNumber(\n      this.auth,\n      phoneOptions,\n      getModularInstance(applicationVerifier as ApplicationVerifierInternal)\n    );\n  }\n\n  /**\n   * Creates a phone auth credential, given the verification ID from\n   * {@link PhoneAuthProvider.verifyPhoneNumber} and the code that was sent to the user's\n   * mobile device.\n   *\n   * @example\n   * ```javascript\n   * const provider = new PhoneAuthProvider(auth);\n   * const verificationId = provider.verifyPhoneNumber(phoneNumber, applicationVerifier);\n   * // Obtain verificationCode from the user.\n   * const authCredential = PhoneAuthProvider.credential(verificationId, verificationCode);\n   * const userCredential = signInWithCredential(auth, authCredential);\n   * ```\n   *\n   * @example\n   * An alternative flow is provided using the `signInWithPhoneNumber` method.\n   * ```javascript\n   * const confirmationResult = await signInWithPhoneNumber(auth, phoneNumber, applicationVerifier);\n   * // Obtain verificationCode from the user.\n   * const userCredential = await confirmationResult.confirm(verificationCode);\n   * ```\n   *\n   * @param verificationId - The verification ID returned from {@link PhoneAuthProvider.verifyPhoneNumber}.\n   * @param verificationCode - The verification code sent to the user's mobile device.\n   *\n   * @returns The auth provider credential.\n   */\n  static credential(\n    verificationId: string,\n    verificationCode: string\n  ): PhoneAuthCredential {\n    return PhoneAuthCredential._fromVerification(\n      verificationId,\n      verificationCode\n    );\n  }\n\n  /**\n   * Generates an {@link AuthCredential} from a {@link UserCredential}.\n   * @param userCredential - The user credential.\n   */\n  static credentialFromResult(\n    userCredential: UserCredential\n  ): AuthCredential | null {\n    const credential = userCredential as UserCredentialInternal;\n    return PhoneAuthProvider.credentialFromTaggedObject(credential);\n  }\n\n  /**\n   * Returns an {@link AuthCredential} when passed an error.\n   *\n   * @remarks\n   *\n   * This method works for errors like\n   * `auth/account-exists-with-different-credentials`. This is useful for\n   * recovering when attempting to set a user's phone number but the number\n   * in question is already tied to another account. For example, the following\n   * code tries to update the current user's phone number, and if that\n   * fails, links the user with the account associated with that number:\n   *\n   * ```js\n   * const provider = new PhoneAuthProvider(auth);\n   * const verificationId = await provider.verifyPhoneNumber(number, verifier);\n   * try {\n   *   const code = ''; // Prompt the user for the verification code\n   *   await updatePhoneNumber(\n   *       auth.currentUser,\n   *       PhoneAuthProvider.credential(verificationId, code));\n   * } catch (e) {\n   *   if ((e as FirebaseError)?.code === 'auth/account-exists-with-different-credential') {\n   *     const cred = PhoneAuthProvider.credentialFromError(e);\n   *     await linkWithCredential(auth.currentUser, cred);\n   *   }\n   * }\n   *\n   * // At this point, auth.currentUser.phoneNumber === number.\n   * ```\n   *\n   * @param error - The error to generate a credential from.\n   */\n  static credentialFromError(error: FirebaseError): AuthCredential | null {\n    return PhoneAuthProvider.credentialFromTaggedObject(\n      (error.customData || {}) as TaggedWithTokenResponse\n    );\n  }\n\n  private static credentialFromTaggedObject({\n    _tokenResponse: tokenResponse\n  }: TaggedWithTokenResponse): AuthCredential | null {\n    if (!tokenResponse) {\n      return null;\n    }\n    const { phoneNumber, temporaryProof } =\n      tokenResponse as SignInWithPhoneNumberResponse;\n    if (phoneNumber && temporaryProof) {\n      return PhoneAuthCredential._fromTokenResponse(\n        phoneNumber,\n        temporaryProof\n      );\n    }\n    return null;\n  }\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { PopupRedirectResolver } from '../../model/public_types';\nimport { AuthInternal } from '../../model/auth';\nimport { PopupRedirectResolverInternal } from '../../model/popup_redirect';\nimport { AuthErrorCode } from '../errors';\nimport { _assert } from './assert';\nimport { _getInstance } from './instantiator';\n\n/**\n * Chooses a popup/redirect resolver to use. This prefers the override (which\n * is directly passed in), and falls back to the property set on the auth\n * object. If neither are available, this function errors w/ an argument error.\n */\nexport function _withDefaultResolver(\n  auth: AuthInternal,\n  resolverOverride: PopupRedirectResolver | undefined\n): PopupRedirectResolverInternal {\n  if (resolverOverride) {\n    return _getInstance(resolverOverride);\n  }\n\n  _assert(auth._popupRedirectResolver, auth, AuthErrorCode.ARGUMENT_ERROR);\n\n  return auth._popupRedirectResolver;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  signInWithIdp,\n  SignInWithIdpRequest\n} from '../../api/authentication/idp';\nimport { PhoneOrOauthTokenResponse } from '../../api/authentication/mfa';\nimport { AuthInternal } from '../../model/auth';\nimport { IdTokenResponse } from '../../model/id_token';\nimport { UserInternal, UserCredentialInternal } from '../../model/user';\nimport { AuthCredential } from '../credentials';\nimport { _link as _linkUser } from '../user/link_unlink';\nimport { _reauthenticate } from '../user/reauthenticate';\nimport { _assert } from '../util/assert';\nimport { _signInWithCredential } from './credential';\nimport { AuthErrorCode } from '../errors';\nimport { ProviderId } from '../../model/enums';\n\nexport interface IdpTaskParams {\n  auth: AuthInternal;\n  requestUri: string;\n  sessionId?: string;\n  tenantId?: string;\n  postBody?: string;\n  pendingToken?: string;\n  user?: UserInternal;\n  bypassAuthState?: boolean;\n}\n\nexport type IdpTask = (\n  params: IdpTaskParams\n) => Promise<UserCredentialInternal>;\n\nclass IdpCredential extends AuthCredential {\n  constructor(readonly params: IdpTaskParams) {\n    super(ProviderId.CUSTOM, ProviderId.CUSTOM);\n  }\n\n  _getIdTokenResponse(auth: AuthInternal): Promise<PhoneOrOauthTokenResponse> {\n    return signInWithIdp(auth, this._buildIdpRequest());\n  }\n\n  _linkToIdToken(\n    auth: AuthInternal,\n    idToken: string\n  ): Promise<IdTokenResponse> {\n    return signInWithIdp(auth, this._buildIdpRequest(idToken));\n  }\n\n  _getReauthenticationResolver(auth: AuthInternal): Promise<IdTokenResponse> {\n    return signInWithIdp(auth, this._buildIdpRequest());\n  }\n\n  private _buildIdpRequest(idToken?: string): SignInWithIdpRequest {\n    const request: SignInWithIdpRequest = {\n      requestUri: this.params.requestUri,\n      sessionId: this.params.sessionId,\n      postBody: this.params.postBody,\n      tenantId: this.params.tenantId,\n      pendingToken: this.params.pendingToken,\n      returnSecureToken: true,\n      returnIdpCredential: true\n    };\n\n    if (idToken) {\n      request.idToken = idToken;\n    }\n\n    return request;\n  }\n}\n\nexport function _signIn(\n  params: IdpTaskParams\n): Promise<UserCredentialInternal> {\n  return _signInWithCredential(\n    params.auth,\n    new IdpCredential(params),\n    params.bypassAuthState\n  ) as Promise<UserCredentialInternal>;\n}\n\nexport function _reauth(\n  params: IdpTaskParams\n): Promise<UserCredentialInternal> {\n  const { auth, user } = params;\n  _assert(user, auth, AuthErrorCode.INTERNAL_ERROR);\n  return _reauthenticate(\n    user,\n    new IdpCredential(params),\n    params.bypassAuthState\n  );\n}\n\nexport async function _link(\n  params: IdpTaskParams\n): Promise<UserCredentialInternal> {\n  const { auth, user } = params;\n  _assert(user, auth, AuthErrorCode.INTERNAL_ERROR);\n  return _linkUser(user, new IdpCredential(params), params.bypassAuthState);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseError } from '@firebase/util';\n\nimport {\n  AuthEvent,\n  AuthEventConsumer,\n  AuthEventType,\n  EventManager,\n  PopupRedirectResolverInternal\n} from '../../model/popup_redirect';\nimport { UserInternal, UserCredentialInternal } from '../../model/user';\nimport { AuthErrorCode } from '../errors';\nimport { debugAssert, _fail } from '../util/assert';\nimport {\n  _link,\n  _reauth,\n  _signIn,\n  IdpTask,\n  IdpTaskParams\n} from '../strategies/idp';\nimport { AuthInternal } from '../../model/auth';\n\ninterface PendingPromise {\n  resolve: (cred: UserCredentialInternal | null) => void;\n  reject: (error: Error) => void;\n}\n\n/**\n * Popup event manager. Handles the popup's entire lifecycle; listens to auth\n * events\n */\nexport abstract class AbstractPopupRedirectOperation\n  implements AuthEventConsumer\n{\n  private pendingPromise: PendingPromise | null = null;\n  private eventManager: EventManager | null = null;\n  readonly filter: AuthEventType[];\n\n  abstract eventId: string | null;\n\n  constructor(\n    protected readonly auth: AuthInternal,\n    filter: AuthEventType | AuthEventType[],\n    protected readonly resolver: PopupRedirectResolverInternal,\n    protected user?: UserInternal,\n    protected readonly bypassAuthState = false\n  ) {\n    this.filter = Array.isArray(filter) ? filter : [filter];\n  }\n\n  abstract onExecution(): Promise<void>;\n\n  execute(): Promise<UserCredentialInternal | null> {\n    return new Promise<UserCredentialInternal | null>(\n      async (resolve, reject) => {\n        this.pendingPromise = { resolve, reject };\n\n        try {\n          this.eventManager = await this.resolver._initialize(this.auth);\n          await this.onExecution();\n          this.eventManager.registerConsumer(this);\n        } catch (e) {\n          this.reject(e as Error);\n        }\n      }\n    );\n  }\n\n  async onAuthEvent(event: AuthEvent): Promise<void> {\n    const { urlResponse, sessionId, postBody, tenantId, error, type } = event;\n    if (error) {\n      this.reject(error);\n      return;\n    }\n\n    const params: IdpTaskParams = {\n      auth: this.auth,\n      requestUri: urlResponse!,\n      sessionId: sessionId!,\n      tenantId: tenantId || undefined,\n      postBody: postBody || undefined,\n      user: this.user,\n      bypassAuthState: this.bypassAuthState\n    };\n\n    try {\n      this.resolve(await this.getIdpTask(type)(params));\n    } catch (e) {\n      this.reject(e as Error);\n    }\n  }\n\n  onError(error: FirebaseError): void {\n    this.reject(error);\n  }\n\n  private getIdpTask(type: AuthEventType): IdpTask {\n    switch (type) {\n      case AuthEventType.SIGN_IN_VIA_POPUP:\n      case AuthEventType.SIGN_IN_VIA_REDIRECT:\n        return _signIn;\n      case AuthEventType.LINK_VIA_POPUP:\n      case AuthEventType.LINK_VIA_REDIRECT:\n        return _link;\n      case AuthEventType.REAUTH_VIA_POPUP:\n      case AuthEventType.REAUTH_VIA_REDIRECT:\n        return _reauth;\n      default:\n        _fail(this.auth, AuthErrorCode.INTERNAL_ERROR);\n    }\n  }\n\n  protected resolve(cred: UserCredentialInternal | null): void {\n    debugAssert(this.pendingPromise, 'Pending promise was never set');\n    this.pendingPromise.resolve(cred);\n    this.unregisterAndCleanUp();\n  }\n\n  protected reject(error: Error): void {\n    debugAssert(this.pendingPromise, 'Pending promise was never set');\n    this.pendingPromise.reject(error);\n    this.unregisterAndCleanUp();\n  }\n\n  private unregisterAndCleanUp(): void {\n    if (this.eventManager) {\n      this.eventManager.unregisterConsumer(this);\n    }\n\n    this.pendingPromise = null;\n    this.cleanUp();\n  }\n\n  abstract cleanUp(): void;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  Auth,\n  AuthProvider,\n  PopupRedirectResolver,\n  User,\n  UserCredential\n} from '../../model/public_types';\n\nimport { _castAuth } from '../../core/auth/auth_impl';\nimport { AuthErrorCode } from '../../core/errors';\nimport {\n  _assert,\n  debugAssert,\n  _createError,\n  _assertInstanceOf\n} from '../../core/util/assert';\nimport { Delay } from '../../core/util/delay';\nimport { _generateEventId } from '../../core/util/event_id';\nimport { AuthInternal } from '../../model/auth';\nimport {\n  AuthEventType,\n  PopupRedirectResolverInternal\n} from '../../model/popup_redirect';\nimport { UserInternal } from '../../model/user';\nimport { _withDefaultResolver } from '../../core/util/resolver';\nimport { AuthPopup } from '../util/popup';\nimport { AbstractPopupRedirectOperation } from '../../core/strategies/abstract_popup_redirect_operation';\nimport { FederatedAuthProvider } from '../../core/providers/federated';\nimport { getModularInstance } from '@firebase/util';\nimport { _isFirebaseServerApp } from '@firebase/app';\n\n/*\n * The event timeout is the same on mobile and desktop, no need for Delay. Set this to 8s since\n * blocking functions can take upto 7s to complete sign in, as documented in:\n * https://cloud.google.com/identity-platform/docs/blocking-functions#understanding_blocking_functions\n * https://firebase.google.com/docs/auth/extend-with-blocking-functions#understanding_blocking_functions\n */\nexport const enum _Timeout {\n  AUTH_EVENT = 8000\n}\nexport const _POLL_WINDOW_CLOSE_TIMEOUT = new Delay(2000, 10000);\n\n/**\n * Authenticates a Firebase client using a popup-based OAuth authentication flow.\n *\n * @remarks\n * If succeeds, returns the signed in user along with the provider's credential. If sign in was\n * unsuccessful, returns an error object containing additional information about the error.\n *\n * This method does not work in a Node.js environment or with {@link Auth} instances created with a\n * {@link @firebase/app#FirebaseServerApp}.\n *\n * @example\n * ```javascript\n * // Sign in using a popup.\n * const provider = new FacebookAuthProvider();\n * const result = await signInWithPopup(auth, provider);\n *\n * // The signed-in user info.\n * const user = result.user;\n * // This gives you a Facebook Access Token.\n * const credential = provider.credentialFromResult(auth, result);\n * const token = credential.accessToken;\n * ```\n *\n * @param auth - The {@link Auth} instance.\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\n *\n * @public\n */\nexport async function signInWithPopup(\n  auth: Auth,\n  provider: AuthProvider,\n  resolver?: PopupRedirectResolver\n): Promise<UserCredential> {\n  if (_isFirebaseServerApp(auth.app)) {\n    return Promise.reject(\n      _createError(auth, AuthErrorCode.OPERATION_NOT_SUPPORTED)\n    );\n  }\n  const authInternal = _castAuth(auth);\n  _assertInstanceOf(auth, provider, FederatedAuthProvider);\n  const resolverInternal = _withDefaultResolver(authInternal, resolver);\n  const action = new PopupOperation(\n    authInternal,\n    AuthEventType.SIGN_IN_VIA_POPUP,\n    provider,\n    resolverInternal\n  );\n  return action.executeNotNull();\n}\n\n/**\n * Reauthenticates the current user with the specified {@link OAuthProvider} using a pop-up based\n * OAuth flow.\n *\n * @remarks\n * If the reauthentication is successful, the returned result will contain the user and the\n * provider's credential.\n *\n * This method does not work in a Node.js environment or on any {@link User} signed in by\n * {@link Auth} instances created with a {@link @firebase/app#FirebaseServerApp}.\n *\n * @example\n * ```javascript\n * // Sign in using a popup.\n * const provider = new FacebookAuthProvider();\n * const result = await signInWithPopup(auth, provider);\n * // Reauthenticate using a popup.\n * await reauthenticateWithPopup(result.user, provider);\n * ```\n *\n * @param user - The user.\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\n *\n * @public\n */\nexport async function reauthenticateWithPopup(\n  user: User,\n  provider: AuthProvider,\n  resolver?: PopupRedirectResolver\n): Promise<UserCredential> {\n  const userInternal = getModularInstance(user) as UserInternal;\n  if (_isFirebaseServerApp(userInternal.auth.app)) {\n    return Promise.reject(\n      _createError(userInternal.auth, AuthErrorCode.OPERATION_NOT_SUPPORTED)\n    );\n  }\n  _assertInstanceOf(userInternal.auth, provider, FederatedAuthProvider);\n  const resolverInternal = _withDefaultResolver(userInternal.auth, resolver);\n  const action = new PopupOperation(\n    userInternal.auth,\n    AuthEventType.REAUTH_VIA_POPUP,\n    provider,\n    resolverInternal,\n    userInternal\n  );\n  return action.executeNotNull();\n}\n\n/**\n * Links the authenticated provider to the user account using a pop-up based OAuth flow.\n *\n * @remarks\n * If the linking is successful, the returned result will contain the user and the provider's credential.\n *\n * This method does not work in a Node.js environment.\n *\n * @example\n * ```javascript\n * // Sign in using some other provider.\n * const result = await signInWithEmailAndPassword(auth, email, password);\n * // Link using a popup.\n * const provider = new FacebookAuthProvider();\n * await linkWithPopup(result.user, provider);\n * ```\n *\n * @param user - The user.\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\n *\n * @public\n */\nexport async function linkWithPopup(\n  user: User,\n  provider: AuthProvider,\n  resolver?: PopupRedirectResolver\n): Promise<UserCredential> {\n  const userInternal = getModularInstance(user) as UserInternal;\n  _assertInstanceOf(userInternal.auth, provider, FederatedAuthProvider);\n  const resolverInternal = _withDefaultResolver(userInternal.auth, resolver);\n\n  const action = new PopupOperation(\n    userInternal.auth,\n    AuthEventType.LINK_VIA_POPUP,\n    provider,\n    resolverInternal,\n    userInternal\n  );\n  return action.executeNotNull();\n}\n\n/**\n * Popup event manager. Handles the popup's entire lifecycle; listens to auth\n * events\n *\n */\nclass PopupOperation extends AbstractPopupRedirectOperation {\n  // Only one popup is ever shown at once. The lifecycle of the current popup\n  // can be managed / cancelled by the constructor.\n  private static currentPopupAction: PopupOperation | null = null;\n  private authWindow: AuthPopup | null = null;\n  private pollId: number | null = null;\n\n  constructor(\n    auth: AuthInternal,\n    filter: AuthEventType,\n    private readonly provider: AuthProvider,\n    resolver: PopupRedirectResolverInternal,\n    user?: UserInternal\n  ) {\n    super(auth, filter, resolver, user);\n    if (PopupOperation.currentPopupAction) {\n      PopupOperation.currentPopupAction.cancel();\n    }\n\n    PopupOperation.currentPopupAction = this;\n  }\n\n  async executeNotNull(): Promise<UserCredential> {\n    const result = await this.execute();\n    _assert(result, this.auth, AuthErrorCode.INTERNAL_ERROR);\n    return result;\n  }\n\n  async onExecution(): Promise<void> {\n    debugAssert(\n      this.filter.length === 1,\n      'Popup operations only handle one event'\n    );\n    const eventId = _generateEventId();\n    this.authWindow = await this.resolver._openPopup(\n      this.auth,\n      this.provider,\n      this.filter[0], // There's always one, see constructor\n      eventId\n    );\n    this.authWindow.associatedEvent = eventId;\n\n    // Check for web storage support and origin validation _after_ the popup is\n    // loaded. These operations are slow (~1 second or so) Rather than\n    // waiting on them before opening the window, optimistically open the popup\n    // and check for storage support at the same time. If storage support is\n    // not available, this will cause the whole thing to reject properly. It\n    // will also close the popup, but since the promise has already rejected,\n    // the popup closed by user poll will reject into the void.\n    this.resolver._originValidation(this.auth).catch(e => {\n      this.reject(e);\n    });\n\n    this.resolver._isIframeWebStorageSupported(this.auth, isSupported => {\n      if (!isSupported) {\n        this.reject(\n          _createError(this.auth, AuthErrorCode.WEB_STORAGE_UNSUPPORTED)\n        );\n      }\n    });\n\n    // Handle user closure. Notice this does *not* use await\n    this.pollUserCancellation();\n  }\n\n  get eventId(): string | null {\n    return this.authWindow?.associatedEvent || null;\n  }\n\n  cancel(): void {\n    this.reject(_createError(this.auth, AuthErrorCode.EXPIRED_POPUP_REQUEST));\n  }\n\n  cleanUp(): void {\n    if (this.authWindow) {\n      this.authWindow.close();\n    }\n\n    if (this.pollId) {\n      window.clearTimeout(this.pollId);\n    }\n\n    this.authWindow = null;\n    this.pollId = null;\n    PopupOperation.currentPopupAction = null;\n  }\n\n  private pollUserCancellation(): void {\n    const poll = (): void => {\n      if (this.authWindow?.window?.closed) {\n        // Make sure that there is sufficient time for whatever action to\n        // complete. The window could have closed but the sign in network\n        // call could still be in flight. This is specifically true for\n        // Firefox or if the opener is in an iframe, in which case the oauth\n        // helper closes the popup.\n        this.pollId = window.setTimeout(() => {\n          this.pollId = null;\n          this.reject(\n            _createError(this.auth, AuthErrorCode.POPUP_CLOSED_BY_USER)\n          );\n        }, _Timeout.AUTH_EVENT);\n        return;\n      }\n\n      this.pollId = window.setTimeout(poll, _POLL_WINDOW_CLOSE_TIMEOUT.get());\n    };\n\n    poll();\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AuthInternal } from '../../model/auth';\nimport {\n  AuthEvent,\n  AuthEventType,\n  PopupRedirectResolverInternal\n} from '../../model/popup_redirect';\nimport { UserCredentialInternal } from '../../model/user';\nimport { PersistenceInternal } from '../persistence';\nimport { _persistenceKeyName } from '../persistence/persistence_user_manager';\nimport { _getInstance } from '../util/instantiator';\nimport { AbstractPopupRedirectOperation } from './abstract_popup_redirect_operation';\n\nconst PENDING_REDIRECT_KEY = 'pendingRedirect';\n\n// We only get one redirect outcome for any one auth, so just store it\n// in here.\nconst redirectOutcomeMap: Map<\n  string,\n  () => Promise<UserCredentialInternal | null>\n> = new Map();\n\nexport class RedirectAction extends AbstractPopupRedirectOperation {\n  eventId = null;\n\n  constructor(\n    auth: AuthInternal,\n    resolver: PopupRedirectResolverInternal,\n    bypassAuthState = false\n  ) {\n    super(\n      auth,\n      [\n        AuthEventType.SIGN_IN_VIA_REDIRECT,\n        AuthEventType.LINK_VIA_REDIRECT,\n        AuthEventType.REAUTH_VIA_REDIRECT,\n        AuthEventType.UNKNOWN\n      ],\n      resolver,\n      undefined,\n      bypassAuthState\n    );\n  }\n\n  /**\n   * Override the execute function; if we already have a redirect result, then\n   * just return it.\n   */\n  async execute(): Promise<UserCredentialInternal | null> {\n    let readyOutcome = redirectOutcomeMap.get(this.auth._key());\n    if (!readyOutcome) {\n      try {\n        const hasPendingRedirect = await _getAndClearPendingRedirectStatus(\n          this.resolver,\n          this.auth\n        );\n        const result = hasPendingRedirect ? await super.execute() : null;\n        readyOutcome = () => Promise.resolve(result);\n      } catch (e) {\n        readyOutcome = () => Promise.reject(e);\n      }\n\n      redirectOutcomeMap.set(this.auth._key(), readyOutcome);\n    }\n\n    // If we're not bypassing auth state, the ready outcome should be set to\n    // null.\n    if (!this.bypassAuthState) {\n      redirectOutcomeMap.set(this.auth._key(), () => Promise.resolve(null));\n    }\n\n    return readyOutcome();\n  }\n\n  async onAuthEvent(event: AuthEvent): Promise<void> {\n    if (event.type === AuthEventType.SIGN_IN_VIA_REDIRECT) {\n      return super.onAuthEvent(event);\n    } else if (event.type === AuthEventType.UNKNOWN) {\n      // This is a sentinel value indicating there's no pending redirect\n      this.resolve(null);\n      return;\n    }\n\n    if (event.eventId) {\n      const user = await this.auth._redirectUserForId(event.eventId);\n      if (user) {\n        this.user = user;\n        return super.onAuthEvent(event);\n      } else {\n        this.resolve(null);\n      }\n    }\n  }\n\n  async onExecution(): Promise<void> {}\n\n  cleanUp(): void {}\n}\n\nexport async function _getAndClearPendingRedirectStatus(\n  resolver: PopupRedirectResolverInternal,\n  auth: AuthInternal\n): Promise<boolean> {\n  const key = pendingRedirectKey(auth);\n  const persistence = resolverPersistence(resolver);\n  if (!(await persistence._isAvailable())) {\n    return false;\n  }\n  const hasPendingRedirect = (await persistence._get(key)) === 'true';\n  await persistence._remove(key);\n  return hasPendingRedirect;\n}\n\nexport async function _setPendingRedirectStatus(\n  resolver: PopupRedirectResolverInternal,\n  auth: AuthInternal\n): Promise<void> {\n  return resolverPersistence(resolver)._set(pendingRedirectKey(auth), 'true');\n}\n\nexport function _clearRedirectOutcomes(): void {\n  redirectOutcomeMap.clear();\n}\n\nexport function _overrideRedirectResult(\n  auth: AuthInternal,\n  result: () => Promise<UserCredentialInternal | null>\n): void {\n  redirectOutcomeMap.set(auth._key(), result);\n}\n\nfunction resolverPersistence(\n  resolver: PopupRedirectResolverInternal\n): PersistenceInternal {\n  return _getInstance(resolver._redirectPersistence);\n}\n\nfunction pendingRedirectKey(auth: AuthInternal): string {\n  return _persistenceKeyName(\n    PENDING_REDIRECT_KEY,\n    auth.config.apiKey,\n    auth.name\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  Auth,\n  AuthProvider,\n  PopupRedirectResolver,\n  User,\n  UserCredential\n} from '../../model/public_types';\n\nimport { _castAuth } from '../../core/auth/auth_impl';\nimport { _assertLinkedStatus } from '../../core/user/link_unlink';\nimport {\n  _assertInstanceOf,\n  _serverAppCurrentUserOperationNotSupportedError\n} from '../../core/util/assert';\nimport { _generateEventId } from '../../core/util/event_id';\nimport { AuthEventType } from '../../model/popup_redirect';\nimport { UserInternal } from '../../model/user';\nimport { _withDefaultResolver } from '../../core/util/resolver';\nimport {\n  RedirectAction,\n  _setPendingRedirectStatus\n} from '../../core/strategies/redirect';\nimport { FederatedAuthProvider } from '../../core/providers/federated';\nimport { getModularInstance } from '@firebase/util';\nimport { _isFirebaseServerApp } from '@firebase/app';\n\n/**\n * Authenticates a Firebase client using a full-page redirect flow.\n *\n * @remarks\n * To handle the results and errors for this operation, refer to {@link getRedirectResult}.\n * Follow the {@link https://firebase.google.com/docs/auth/web/redirect-best-practices\n * | best practices} when using {@link signInWithRedirect}.\n *\n * This method does not work in a Node.js environment or with {@link Auth} instances created with a\n * {@link @firebase/app#FirebaseServerApp}.\n *\n * @example\n * ```javascript\n * // Sign in using a redirect.\n * const provider = new FacebookAuthProvider();\n * // You can add additional scopes to the provider:\n * provider.addScope('user_birthday');\n * // Start a sign in process for an unauthenticated user.\n * await signInWithRedirect(auth, provider);\n * // This will trigger a full page redirect away from your app\n *\n * // After returning from the redirect when your app initializes you can obtain the result\n * const result = await getRedirectResult(auth);\n * if (result) {\n *   // This is the signed-in user\n *   const user = result.user;\n *   // This gives you a Facebook Access Token.\n *   const credential = provider.credentialFromResult(auth, result);\n *   const token = credential.accessToken;\n * }\n * // As this API can be used for sign-in, linking and reauthentication,\n * // check the operationType to determine what triggered this redirect\n * // operation.\n * const operationType = result.operationType;\n * ```\n *\n * @param auth - The {@link Auth} instance.\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\n *\n * @public\n */\nexport function signInWithRedirect(\n  auth: Auth,\n  provider: AuthProvider,\n  resolver?: PopupRedirectResolver\n): Promise<never> {\n  return _signInWithRedirect(auth, provider, resolver) as Promise<never>;\n}\n\nexport async function _signInWithRedirect(\n  auth: Auth,\n  provider: AuthProvider,\n  resolver?: PopupRedirectResolver\n): Promise<void | never> {\n  if (_isFirebaseServerApp(auth.app)) {\n    return Promise.reject(\n      _serverAppCurrentUserOperationNotSupportedError(auth)\n    );\n  }\n  const authInternal = _castAuth(auth);\n  _assertInstanceOf(auth, provider, FederatedAuthProvider);\n  // Wait for auth initialization to complete, this will process pending redirects and clear the\n  // PENDING_REDIRECT_KEY in persistence. This should be completed before starting a new\n  // redirect and creating a PENDING_REDIRECT_KEY entry.\n  await authInternal._initializationPromise;\n  const resolverInternal = _withDefaultResolver(authInternal, resolver);\n  await _setPendingRedirectStatus(resolverInternal, authInternal);\n\n  return resolverInternal._openRedirect(\n    authInternal,\n    provider,\n    AuthEventType.SIGN_IN_VIA_REDIRECT\n  );\n}\n\n/**\n * Reauthenticates the current user with the specified {@link OAuthProvider} using a full-page redirect flow.\n * @remarks\n * To handle the results and errors for this operation, refer to {@link getRedirectResult}.\n * Follow the {@link https://firebase.google.com/docs/auth/web/redirect-best-practices\n * | best practices} when using {@link reauthenticateWithRedirect}.\n *\n * This method does not work in a Node.js environment or with {@link Auth} instances\n * created with a {@link @firebase/app#FirebaseServerApp}.\n *\n * @example\n * ```javascript\n * // Sign in using a redirect.\n * const provider = new FacebookAuthProvider();\n * const result = await signInWithRedirect(auth, provider);\n * // This will trigger a full page redirect away from your app\n *\n * // After returning from the redirect when your app initializes you can obtain the result\n * const result = await getRedirectResult(auth);\n * // Reauthenticate using a redirect.\n * await reauthenticateWithRedirect(result.user, provider);\n * // This will again trigger a full page redirect away from your app\n *\n * // After returning from the redirect when your app initializes you can obtain the result\n * const result = await getRedirectResult(auth);\n * ```\n *\n * @param user - The user.\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\n *\n * @public\n */\nexport function reauthenticateWithRedirect(\n  user: User,\n  provider: AuthProvider,\n  resolver?: PopupRedirectResolver\n): Promise<never> {\n  return _reauthenticateWithRedirect(\n    user,\n    provider,\n    resolver\n  ) as Promise<never>;\n}\nexport async function _reauthenticateWithRedirect(\n  user: User,\n  provider: AuthProvider,\n  resolver?: PopupRedirectResolver\n): Promise<void | never> {\n  const userInternal = getModularInstance(user) as UserInternal;\n  _assertInstanceOf(userInternal.auth, provider, FederatedAuthProvider);\n  if (_isFirebaseServerApp(userInternal.auth.app)) {\n    return Promise.reject(\n      _serverAppCurrentUserOperationNotSupportedError(userInternal.auth)\n    );\n  }\n  // Wait for auth initialization to complete, this will process pending redirects and clear the\n  // PENDING_REDIRECT_KEY in persistence. This should be completed before starting a new\n  // redirect and creating a PENDING_REDIRECT_KEY entry.\n  await userInternal.auth._initializationPromise;\n  // Allow the resolver to error before persisting the redirect user\n  const resolverInternal = _withDefaultResolver(userInternal.auth, resolver);\n  await _setPendingRedirectStatus(resolverInternal, userInternal.auth);\n\n  const eventId = await prepareUserForRedirect(userInternal);\n  return resolverInternal._openRedirect(\n    userInternal.auth,\n    provider,\n    AuthEventType.REAUTH_VIA_REDIRECT,\n    eventId\n  );\n}\n\n/**\n * Links the {@link OAuthProvider} to the user account using a full-page redirect flow.\n * @remarks\n * To handle the results and errors for this operation, refer to {@link getRedirectResult}.\n * Follow the {@link https://firebase.google.com/docs/auth/web/redirect-best-practices\n * | best practices} when using {@link linkWithRedirect}.\n *\n * This method does not work in a Node.js environment or with {@link Auth} instances\n * created with a {@link @firebase/app#FirebaseServerApp}.\n *\n * @example\n * ```javascript\n * // Sign in using some other provider.\n * const result = await signInWithEmailAndPassword(auth, email, password);\n * // Link using a redirect.\n * const provider = new FacebookAuthProvider();\n * await linkWithRedirect(result.user, provider);\n * // This will trigger a full page redirect away from your app\n *\n * // After returning from the redirect when your app initializes you can obtain the result\n * const result = await getRedirectResult(auth);\n * ```\n *\n * @param user - The user.\n * @param provider - The provider to authenticate. The provider has to be an {@link OAuthProvider}.\n * Non-OAuth providers like {@link EmailAuthProvider} will throw an error.\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\n *\n * @public\n */\nexport function linkWithRedirect(\n  user: User,\n  provider: AuthProvider,\n  resolver?: PopupRedirectResolver\n): Promise<never> {\n  return _linkWithRedirect(user, provider, resolver) as Promise<never>;\n}\nexport async function _linkWithRedirect(\n  user: User,\n  provider: AuthProvider,\n  resolver?: PopupRedirectResolver\n): Promise<void | never> {\n  const userInternal = getModularInstance(user) as UserInternal;\n  _assertInstanceOf(userInternal.auth, provider, FederatedAuthProvider);\n  // Wait for auth initialization to complete, this will process pending redirects and clear the\n  // PENDING_REDIRECT_KEY in persistence. This should be completed before starting a new\n  // redirect and creating a PENDING_REDIRECT_KEY entry.\n  await userInternal.auth._initializationPromise;\n  // Allow the resolver to error before persisting the redirect user\n  const resolverInternal = _withDefaultResolver(userInternal.auth, resolver);\n  await _assertLinkedStatus(false, userInternal, provider.providerId);\n  await _setPendingRedirectStatus(resolverInternal, userInternal.auth);\n\n  const eventId = await prepareUserForRedirect(userInternal);\n  return resolverInternal._openRedirect(\n    userInternal.auth,\n    provider,\n    AuthEventType.LINK_VIA_REDIRECT,\n    eventId\n  );\n}\n\n/**\n * Returns a {@link UserCredential} from the redirect-based sign-in flow.\n *\n * @remarks\n * If sign-in succeeded, returns the signed in user. If sign-in was unsuccessful, fails with an\n * error. If no redirect operation was called, returns `null`.\n *\n * This method does not work in a Node.js environment or with {@link Auth} instances created with a\n * {@link @firebase/app#FirebaseServerApp}.\n *\n * @example\n * ```javascript\n * // Sign in using a redirect.\n * const provider = new FacebookAuthProvider();\n * // You can add additional scopes to the provider:\n * provider.addScope('user_birthday');\n * // Start a sign in process for an unauthenticated user.\n * await signInWithRedirect(auth, provider);\n * // This will trigger a full page redirect away from your app\n *\n * // After returning from the redirect when your app initializes you can obtain the result\n * const result = await getRedirectResult(auth);\n * if (result) {\n *   // This is the signed-in user\n *   const user = result.user;\n *   // This gives you a Facebook Access Token.\n *   const credential = provider.credentialFromResult(auth, result);\n *   const token = credential.accessToken;\n * }\n * // As this API can be used for sign-in, linking and reauthentication,\n * // check the operationType to determine what triggered this redirect\n * // operation.\n * const operationType = result.operationType;\n * ```\n *\n * @param auth - The {@link Auth} instance.\n * @param resolver - An instance of {@link PopupRedirectResolver}, optional\n * if already supplied to {@link initializeAuth} or provided by {@link getAuth}.\n *\n * @public\n */\nexport async function getRedirectResult(\n  auth: Auth,\n  resolver?: PopupRedirectResolver\n): Promise<UserCredential | null> {\n  await _castAuth(auth)._initializationPromise;\n  return _getRedirectResult(auth, resolver, false);\n}\n\nexport async function _getRedirectResult(\n  auth: Auth,\n  resolverExtern?: PopupRedirectResolver,\n  bypassAuthState = false\n): Promise<UserCredential | null> {\n  if (_isFirebaseServerApp(auth.app)) {\n    return Promise.reject(\n      _serverAppCurrentUserOperationNotSupportedError(auth)\n    );\n  }\n  const authInternal = _castAuth(auth);\n  const resolver = _withDefaultResolver(authInternal, resolverExtern);\n  const action = new RedirectAction(authInternal, resolver, bypassAuthState);\n  const result = await action.execute();\n\n  if (result && !bypassAuthState) {\n    delete result.user._redirectEventId;\n    await authInternal._persistUserIfCurrent(result.user as UserInternal);\n    await authInternal._setRedirectUser(null, resolverExtern);\n  }\n\n  return result;\n}\n\nasync function prepareUserForRedirect(user: UserInternal): Promise<string> {\n  const eventId = _generateEventId(`${user.uid}:::`);\n  user._redirectEventId = eventId;\n  await user.auth._setRedirectUser(user);\n  await user.auth._persistUserIfCurrent(user);\n  return eventId;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  AuthEvent,\n  AuthEventConsumer,\n  AuthEventType,\n  EventManager\n} from '../../model/popup_redirect';\nimport { AuthErrorCode } from '../errors';\nimport { AuthInternal } from '../../model/auth';\nimport { _createError } from '../util/assert';\n\n// The amount of time to store the UIDs of seen events; this is\n// set to 10 min by default\nconst EVENT_DUPLICATION_CACHE_DURATION_MS = 10 * 60 * 1000;\n\nexport class AuthEventManager implements EventManager {\n  private readonly cachedEventUids: Set<string> = new Set();\n  private readonly consumers: Set<AuthEventConsumer> = new Set();\n  protected queuedRedirectEvent: AuthEvent | null = null;\n  protected hasHandledPotentialRedirect = false;\n  private lastProcessedEventTime = Date.now();\n\n  constructor(private readonly auth: AuthInternal) {}\n\n  registerConsumer(authEventConsumer: AuthEventConsumer): void {\n    this.consumers.add(authEventConsumer);\n\n    if (\n      this.queuedRedirectEvent &&\n      this.isEventForConsumer(this.queuedRedirectEvent, authEventConsumer)\n    ) {\n      this.sendToConsumer(this.queuedRedirectEvent, authEventConsumer);\n      this.saveEventToCache(this.queuedRedirectEvent);\n      this.queuedRedirectEvent = null;\n    }\n  }\n\n  unregisterConsumer(authEventConsumer: AuthEventConsumer): void {\n    this.consumers.delete(authEventConsumer);\n  }\n\n  onEvent(event: AuthEvent): boolean {\n    // Check if the event has already been handled\n    if (this.hasEventBeenHandled(event)) {\n      return false;\n    }\n\n    let handled = false;\n    this.consumers.forEach(consumer => {\n      if (this.isEventForConsumer(event, consumer)) {\n        handled = true;\n        this.sendToConsumer(event, consumer);\n        this.saveEventToCache(event);\n      }\n    });\n\n    if (this.hasHandledPotentialRedirect || !isRedirectEvent(event)) {\n      // If we've already seen a redirect before, or this is a popup event,\n      // bail now\n      return handled;\n    }\n\n    this.hasHandledPotentialRedirect = true;\n\n    // If the redirect wasn't handled, hang on to it\n    if (!handled) {\n      this.queuedRedirectEvent = event;\n      handled = true;\n    }\n\n    return handled;\n  }\n\n  private sendToConsumer(event: AuthEvent, consumer: AuthEventConsumer): void {\n    if (event.error && !isNullRedirectEvent(event)) {\n      const code =\n        (event.error.code?.split('auth/')[1] as AuthErrorCode) ||\n        AuthErrorCode.INTERNAL_ERROR;\n      consumer.onError(_createError(this.auth, code));\n    } else {\n      consumer.onAuthEvent(event);\n    }\n  }\n\n  private isEventForConsumer(\n    event: AuthEvent,\n    consumer: AuthEventConsumer\n  ): boolean {\n    const eventIdMatches =\n      consumer.eventId === null ||\n      (!!event.eventId && event.eventId === consumer.eventId);\n    return consumer.filter.includes(event.type) && eventIdMatches;\n  }\n\n  private hasEventBeenHandled(event: AuthEvent): boolean {\n    if (\n      Date.now() - this.lastProcessedEventTime >=\n      EVENT_DUPLICATION_CACHE_DURATION_MS\n    ) {\n      this.cachedEventUids.clear();\n    }\n\n    return this.cachedEventUids.has(eventUid(event));\n  }\n\n  private saveEventToCache(event: AuthEvent): void {\n    this.cachedEventUids.add(eventUid(event));\n    this.lastProcessedEventTime = Date.now();\n  }\n}\n\nfunction eventUid(e: AuthEvent): string {\n  return [e.type, e.eventId, e.sessionId, e.tenantId].filter(v => v).join('-');\n}\n\nfunction isNullRedirectEvent({ type, error }: AuthEvent): boolean {\n  return (\n    type === AuthEventType.UNKNOWN &&\n    error?.code === `auth/${AuthErrorCode.NO_AUTH_EVENT}`\n  );\n}\n\nfunction isRedirectEvent(event: AuthEvent): boolean {\n  switch (event.type) {\n    case AuthEventType.SIGN_IN_VIA_REDIRECT:\n    case AuthEventType.LINK_VIA_REDIRECT:\n    case AuthEventType.REAUTH_VIA_REDIRECT:\n      return true;\n    case AuthEventType.UNKNOWN:\n      return isNullRedirectEvent(event);\n    default:\n      return false;\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { _performApiRequest, Endpoint, HttpMethod } from '../index';\nimport { Auth } from '../../model/public_types';\n\nexport interface GetProjectConfigRequest {\n  androidPackageName?: string;\n  iosBundleId?: string;\n}\n\nexport interface GetProjectConfigResponse {\n  authorizedDomains: string[];\n}\n\nexport async function _getProjectConfig(\n  auth: Auth,\n  request: GetProjectConfigRequest = {}\n): Promise<GetProjectConfigResponse> {\n  return _performApiRequest<GetProjectConfigRequest, GetProjectConfigResponse>(\n    auth,\n    HttpMethod.GET,\n    Endpoint.GET_PROJECT_CONFIG,\n    request\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { _getProjectConfig } from '../../api/project_config/get_project_config';\nimport { AuthInternal } from '../../model/auth';\nimport { AuthErrorCode } from '../errors';\nimport { _fail } from './assert';\nimport { _getCurrentUrl } from './location';\n\nconst IP_ADDRESS_REGEX = /^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/;\nconst HTTP_REGEX = /^https?/;\n\nexport async function _validateOrigin(auth: AuthInternal): Promise<void> {\n  // Skip origin validation if we are in an emulated environment\n  if (auth.config.emulator) {\n    return;\n  }\n\n  const { authorizedDomains } = await _getProjectConfig(auth);\n\n  for (const domain of authorizedDomains) {\n    try {\n      if (matchDomain(domain)) {\n        return;\n      }\n    } catch {\n      // Do nothing if there's a URL error; just continue searching\n    }\n  }\n\n  // In the old SDK, this error also provides helpful messages.\n  _fail(auth, AuthErrorCode.INVALID_ORIGIN);\n}\n\nfunction matchDomain(expected: string): boolean {\n  const currentUrl = _getCurrentUrl();\n  const { protocol, hostname } = new URL(currentUrl);\n  if (expected.startsWith('chrome-extension://')) {\n    const ceUrl = new URL(expected);\n\n    if (ceUrl.hostname === '' && hostname === '') {\n      // For some reason we're not parsing chrome URLs properly\n      return (\n        protocol === 'chrome-extension:' &&\n        expected.replace('chrome-extension://', '') ===\n          currentUrl.replace('chrome-extension://', '')\n      );\n    }\n\n    return protocol === 'chrome-extension:' && ceUrl.hostname === hostname;\n  }\n\n  if (!HTTP_REGEX.test(protocol)) {\n    return false;\n  }\n\n  if (IP_ADDRESS_REGEX.test(expected)) {\n    // The domain has to be exactly equal to the pattern, as an IP domain will\n    // only contain the IP, no extra character.\n    return hostname === expected;\n  }\n\n  // Dots in pattern should be escaped.\n  const escapedDomainPattern = expected.replace(/\\./g, '\\\\.');\n  // Non ip address domains.\n  // domain.com = *.domain.com OR domain.com\n  const re = new RegExp(\n    '^(.+\\\\.' + escapedDomainPattern + '|' + escapedDomainPattern + ')$',\n    'i'\n  );\n  return re.test(hostname);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AuthErrorCode } from '../../core/errors';\nimport { _createError } from '../../core/util/assert';\nimport { Delay } from '../../core/util/delay';\nimport { AuthInternal } from '../../model/auth';\nimport { _window } from '../auth_window';\nimport * as js from '../load_js';\n\nconst NETWORK_TIMEOUT = new Delay(30000, 60000);\n\n/**\n * Reset unlaoded GApi modules. If gapi.load fails due to a network error,\n * it will stop working after a retrial. This is a hack to fix this issue.\n */\nfunction resetUnloadedGapiModules(): void {\n  // Clear last failed gapi.load state to force next gapi.load to first\n  // load the failed gapi.iframes module.\n  // Get gapix.beacon context.\n  const beacon = _window().___jsl;\n  // Get current hint.\n  if (beacon?.H) {\n    // Get gapi hint.\n    for (const hint of Object.keys(beacon.H)) {\n      // Requested modules.\n      beacon.H[hint].r = beacon.H[hint].r || [];\n      // Loaded modules.\n      beacon.H[hint].L = beacon.H[hint].L || [];\n      // Set requested modules to a copy of the loaded modules.\n      beacon.H[hint].r = [...beacon.H[hint].L];\n      // Clear pending callbacks.\n      if (beacon.CP) {\n        for (let i = 0; i < beacon.CP.length; i++) {\n          // Remove all failed pending callbacks.\n          beacon.CP[i] = null;\n        }\n      }\n    }\n  }\n}\n\nfunction loadGapi(auth: AuthInternal): Promise<gapi.iframes.Context> {\n  return new Promise<gapi.iframes.Context>((resolve, reject) => {\n    // Function to run when gapi.load is ready.\n    function loadGapiIframe(): void {\n      // The developer may have tried to previously run gapi.load and failed.\n      // Run this to fix that.\n      resetUnloadedGapiModules();\n      gapi.load('gapi.iframes', {\n        callback: () => {\n          resolve(gapi.iframes.getContext());\n        },\n        ontimeout: () => {\n          // The above reset may be sufficient, but having this reset after\n          // failure ensures that if the developer calls gapi.load after the\n          // connection is re-established and before another attempt to embed\n          // the iframe, it would work and would not be broken because of our\n          // failed attempt.\n          // Timeout when gapi.iframes.Iframe not loaded.\n          resetUnloadedGapiModules();\n          reject(_createError(auth, AuthErrorCode.NETWORK_REQUEST_FAILED));\n        },\n        timeout: NETWORK_TIMEOUT.get()\n      });\n    }\n\n    if (_window().gapi?.iframes?.Iframe) {\n      // If gapi.iframes.Iframe available, resolve.\n      resolve(gapi.iframes.getContext());\n    } else if (!!_window().gapi?.load) {\n      // Gapi loader ready, load gapi.iframes.\n      loadGapiIframe();\n    } else {\n      // Create a new iframe callback when this is called so as not to overwrite\n      // any previous defined callback. This happens if this method is called\n      // multiple times in parallel and could result in the later callback\n      // overwriting the previous one. This would end up with a iframe\n      // timeout.\n      const cbName = js._generateCallbackName('iframefcb');\n      // GApi loader not available, dynamically load platform.js.\n      _window()[cbName] = () => {\n        // GApi loader should be ready.\n        if (!!gapi.load) {\n          loadGapiIframe();\n        } else {\n          // Gapi loader failed, throw error.\n          reject(_createError(auth, AuthErrorCode.NETWORK_REQUEST_FAILED));\n        }\n      };\n      // Load GApi loader.\n      return js\n        ._loadJS(`${js._gapiScriptUrl()}?onload=${cbName}`)\n        .catch(e => reject(e));\n    }\n  }).catch(error => {\n    // Reset cached promise to allow for retrial.\n    cachedGApiLoader = null;\n    throw error;\n  });\n}\n\nlet cachedGApiLoader: Promise<gapi.iframes.Context> | null = null;\nexport function _loadGapi(auth: AuthInternal): Promise<gapi.iframes.Context> {\n  cachedGApiLoader = cachedGApiLoader || loadGapi(auth);\n  return cachedGApiLoader;\n}\n\nexport function _resetLoader(): void {\n  cachedGApiLoader = null;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SDK_VERSION } from '@firebase/app';\nimport { querystring } from '@firebase/util';\nimport { DefaultConfig } from '../../../internal';\n\nimport { AuthErrorCode } from '../../core/errors';\nimport { _assert, _createError } from '../../core/util/assert';\nimport { Delay } from '../../core/util/delay';\nimport { _emulatorUrl } from '../../core/util/emulator';\nimport { AuthInternal } from '../../model/auth';\nimport { _window } from '../auth_window';\nimport * as gapiLoader from './gapi';\n\nconst PING_TIMEOUT = new Delay(5000, 15000);\nconst IFRAME_PATH = '__/auth/iframe';\nconst EMULATED_IFRAME_PATH = 'emulator/auth/iframe';\n\nconst IFRAME_ATTRIBUTES = {\n  style: {\n    position: 'absolute',\n    top: '-100px',\n    width: '1px',\n    height: '1px'\n  },\n  'aria-hidden': 'true',\n  tabindex: '-1'\n};\n\n// Map from apiHost to endpoint ID for passing into iframe. In current SDK, apiHost can be set to\n// anything (not from a list of endpoints with IDs as in legacy), so this is the closest we can get.\nconst EID_FROM_APIHOST = new Map([\n  [DefaultConfig.API_HOST, 'p'], // production\n  ['staging-identitytoolkit.sandbox.googleapis.com', 's'], // staging\n  ['test-identitytoolkit.sandbox.googleapis.com', 't'] // test\n]);\n\nfunction getIframeUrl(auth: AuthInternal): string {\n  const config = auth.config;\n  _assert(config.authDomain, auth, AuthErrorCode.MISSING_AUTH_DOMAIN);\n  const url = config.emulator\n    ? _emulatorUrl(config, EMULATED_IFRAME_PATH)\n    : `https://${auth.config.authDomain}/${IFRAME_PATH}`;\n\n  const params: Record<string, string> = {\n    apiKey: config.apiKey,\n    appName: auth.name,\n    v: SDK_VERSION\n  };\n  const eid = EID_FROM_APIHOST.get(auth.config.apiHost);\n  if (eid) {\n    params.eid = eid;\n  }\n  const frameworks = auth._getFrameworks();\n  if (frameworks.length) {\n    params.fw = frameworks.join(',');\n  }\n  return `${url}?${querystring(params).slice(1)}`;\n}\n\nexport async function _openIframe(\n  auth: AuthInternal\n): Promise<gapi.iframes.Iframe> {\n  const context = await gapiLoader._loadGapi(auth);\n  const gapi = _window().gapi;\n  _assert(gapi, auth, AuthErrorCode.INTERNAL_ERROR);\n  return context.open(\n    {\n      where: document.body,\n      url: getIframeUrl(auth),\n      messageHandlersFilter: gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER,\n      attributes: IFRAME_ATTRIBUTES,\n      dontclear: true\n    },\n    (iframe: gapi.iframes.Iframe) =>\n      new Promise(async (resolve, reject) => {\n        await iframe.restyle({\n          // Prevent iframe from closing on mouse out.\n          setHideOnLeave: false\n        });\n\n        const networkError = _createError(\n          auth,\n          AuthErrorCode.NETWORK_REQUEST_FAILED\n        );\n        // Confirm iframe is correctly loaded.\n        // To fallback on failure, set a timeout.\n        const networkErrorTimer = _window().setTimeout(() => {\n          reject(networkError);\n        }, PING_TIMEOUT.get());\n        // Clear timer and resolve pending iframe ready promise.\n        function clearTimerAndResolve(): void {\n          _window().clearTimeout(networkErrorTimer);\n          resolve(iframe);\n        }\n        // This returns an IThenable. However the reject part does not call\n        // when the iframe is not loaded.\n        iframe.ping(clearTimerAndResolve).then(clearTimerAndResolve, () => {\n          reject(networkError);\n        });\n      })\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getUA } from '@firebase/util';\n\nimport { AuthErrorCode } from '../../core/errors';\nimport { _assert } from '../../core/util/assert';\nimport {\n  _isChromeIOS,\n  _isFirefox,\n  _isIOSStandalone\n} from '../../core/util/browser';\nimport { AuthInternal } from '../../model/auth';\n\nconst BASE_POPUP_OPTIONS = {\n  location: 'yes',\n  resizable: 'yes',\n  statusbar: 'yes',\n  toolbar: 'no'\n};\n\nconst DEFAULT_WIDTH = 500;\nconst DEFAULT_HEIGHT = 600;\nconst TARGET_BLANK = '_blank';\n\nconst FIREFOX_EMPTY_URL = 'http://localhost';\n\nexport class AuthPopup {\n  associatedEvent: string | null = null;\n\n  constructor(readonly window: Window | null) {}\n\n  close(): void {\n    if (this.window) {\n      try {\n        this.window.close();\n      } catch (e) {}\n    }\n  }\n}\n\nexport function _open(\n  auth: AuthInternal,\n  url?: string,\n  name?: string,\n  width = DEFAULT_WIDTH,\n  height = DEFAULT_HEIGHT\n): AuthPopup {\n  const top = Math.max((window.screen.availHeight - height) / 2, 0).toString();\n  const left = Math.max((window.screen.availWidth - width) / 2, 0).toString();\n  let target = '';\n\n  const options: { [key: string]: string } = {\n    ...BASE_POPUP_OPTIONS,\n    width: width.toString(),\n    height: height.toString(),\n    top,\n    left\n  };\n\n  // Chrome iOS 7 and 8 is returning an undefined popup win when target is\n  // specified, even though the popup is not necessarily blocked.\n  const ua = getUA().toLowerCase();\n\n  if (name) {\n    target = _isChromeIOS(ua) ? TARGET_BLANK : name;\n  }\n\n  if (_isFirefox(ua)) {\n    // Firefox complains when invalid URLs are popped out. Hacky way to bypass.\n    url = url || FIREFOX_EMPTY_URL;\n    // Firefox disables by default scrolling on popup windows, which can create\n    // issues when the user has many Google accounts, for instance.\n    options.scrollbars = 'yes';\n  }\n\n  const optionsString = Object.entries(options).reduce(\n    (accum, [key, value]) => `${accum}${key}=${value},`,\n    ''\n  );\n\n  if (_isIOSStandalone(ua) && target !== '_self') {\n    openAsNewWindowIOS(url || '', target);\n    return new AuthPopup(null);\n  }\n\n  // about:blank getting sanitized causing browsers like IE/Edge to display\n  // brief error message before redirecting to handler.\n  const newWin = window.open(url || '', target, optionsString);\n  _assert(newWin, auth, AuthErrorCode.POPUP_BLOCKED);\n\n  // Flaky on IE edge, encapsulate with a try and catch.\n  try {\n    newWin.focus();\n  } catch (e) {}\n\n  return new AuthPopup(newWin);\n}\n\nfunction openAsNewWindowIOS(url: string, target: string): void {\n  const el = document.createElement('a');\n  el.href = url;\n  el.target = target;\n  const click = document.createEvent('MouseEvent');\n  click.initMouseEvent(\n    'click',\n    true,\n    true,\n    window,\n    1,\n    0,\n    0,\n    0,\n    0,\n    false,\n    false,\n    false,\n    false,\n    1,\n    null\n  );\n  el.dispatchEvent(click);\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SDK_VERSION } from '@firebase/app';\nimport { AuthProvider } from '../../model/public_types';\nimport { ApiKey, AppName, AuthInternal } from '../../model/auth';\nimport { AuthEventType } from '../../model/popup_redirect';\nimport { AuthErrorCode } from '../errors';\nimport { _assert } from './assert';\nimport { isEmpty, querystring } from '@firebase/util';\nimport { _emulatorUrl } from './emulator';\nimport { FederatedAuthProvider } from '../providers/federated';\nimport { BaseOAuthProvider } from '../providers/oauth';\n\n/**\n * URL for Authentication widget which will initiate the OAuth handshake\n *\n * @internal\n */\nconst WIDGET_PATH = '__/auth/handler';\n\n/**\n * URL for emulated environment\n *\n * @internal\n */\nconst EMULATOR_WIDGET_PATH = 'emulator/auth/handler';\n\n/**\n * Fragment name for the App Check token that gets passed to the widget\n *\n * @internal\n */\nconst FIREBASE_APP_CHECK_FRAGMENT_ID = encodeURIComponent('fac');\n\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\ntype WidgetParams = {\n  apiKey: ApiKey;\n  appName: AppName;\n  authType: AuthEventType;\n  redirectUrl?: string;\n  v: string;\n  providerId?: string;\n  scopes?: string;\n  customParameters?: string;\n  eventId?: string;\n  tid?: string;\n} & { [key: string]: string | undefined };\n\nexport async function _getRedirectUrl(\n  auth: AuthInternal,\n  provider: AuthProvider,\n  authType: AuthEventType,\n  redirectUrl?: string,\n  eventId?: string,\n  additionalParams?: Record<string, string>\n): Promise<string> {\n  _assert(auth.config.authDomain, auth, AuthErrorCode.MISSING_AUTH_DOMAIN);\n  _assert(auth.config.apiKey, auth, AuthErrorCode.INVALID_API_KEY);\n\n  const params: WidgetParams = {\n    apiKey: auth.config.apiKey,\n    appName: auth.name,\n    authType,\n    redirectUrl,\n    v: SDK_VERSION,\n    eventId\n  };\n\n  if (provider instanceof FederatedAuthProvider) {\n    provider.setDefaultLanguage(auth.languageCode);\n    params.providerId = provider.providerId || '';\n    if (!isEmpty(provider.getCustomParameters())) {\n      params.customParameters = JSON.stringify(provider.getCustomParameters());\n    }\n\n    // TODO set additionalParams from the provider as well?\n    for (const [key, value] of Object.entries(additionalParams || {})) {\n      params[key] = value;\n    }\n  }\n\n  if (provider instanceof BaseOAuthProvider) {\n    const scopes = provider.getScopes().filter(scope => scope !== '');\n    if (scopes.length > 0) {\n      params.scopes = scopes.join(',');\n    }\n  }\n\n  if (auth.tenantId) {\n    params.tid = auth.tenantId;\n  }\n\n  // TODO: maybe set eid as endipointId\n  // TODO: maybe set fw as Frameworks.join(\",\")\n\n  const paramsDict = params as Record<string, string | number>;\n  for (const key of Object.keys(paramsDict)) {\n    if (paramsDict[key] === undefined) {\n      delete paramsDict[key];\n    }\n  }\n\n  // Sets the App Check token to pass to the widget\n  const appCheckToken = await auth._getAppCheckToken();\n  const appCheckTokenFragment = appCheckToken\n    ? `#${FIREBASE_APP_CHECK_FRAGMENT_ID}=${encodeURIComponent(appCheckToken)}`\n    : '';\n\n  // Start at index 1 to skip the leading '&' in the query string\n  return `${getHandlerBase(auth)}?${querystring(paramsDict).slice(\n    1\n  )}${appCheckTokenFragment}`;\n}\n\nfunction getHandlerBase({ config }: AuthInternal): string {\n  if (!config.emulator) {\n    return `https://${config.authDomain}/${WIDGET_PATH}`;\n  }\n\n  return _emulatorUrl(config, EMULATOR_WIDGET_PATH);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AuthProvider, PopupRedirectResolver } from '../model/public_types';\n\nimport { AuthEventManager } from '../core/auth/auth_event_manager';\nimport { AuthErrorCode } from '../core/errors';\nimport { _assert, debugAssert, _fail } from '../core/util/assert';\nimport { _generateEventId } from '../core/util/event_id';\nimport { _getCurrentUrl } from '../core/util/location';\nimport { _validateOrigin } from '../core/util/validate_origin';\nimport { AuthInternal } from '../model/auth';\nimport {\n  AuthEventType,\n  EventManager,\n  GapiAuthEvent,\n  GapiOutcome,\n  PopupRedirectResolverInternal\n} from '../model/popup_redirect';\nimport { _setWindowLocation } from './auth_window';\nimport { _openIframe } from './iframe/iframe';\nimport { browserSessionPersistence } from './persistence/session_storage';\nimport { _open, AuthPopup } from './util/popup';\nimport { _getRedirectResult } from './strategies/redirect';\nimport { _getRedirectUrl } from '../core/util/handler';\nimport { _isIOS, _isMobileBrowser, _isSafari } from '../core/util/browser';\nimport { _overrideRedirectResult } from '../core/strategies/redirect';\n\n/**\n * The special web storage event\n *\n */\nconst WEB_STORAGE_SUPPORT_KEY = 'webStorageSupport';\n\ninterface WebStorageSupportMessage extends gapi.iframes.Message {\n  [index: number]: Record<string, boolean>;\n}\n\ninterface ManagerOrPromise {\n  manager?: EventManager;\n  promise?: Promise<EventManager>;\n}\n\nclass BrowserPopupRedirectResolver implements PopupRedirectResolverInternal {\n  private readonly eventManagers: Record<string, ManagerOrPromise> = {};\n  private readonly iframes: Record<string, gapi.iframes.Iframe> = {};\n  private readonly originValidationPromises: Record<string, Promise<void>> = {};\n\n  readonly _redirectPersistence = browserSessionPersistence;\n\n  // Wrapping in async even though we don't await anywhere in order\n  // to make sure errors are raised as promise rejections\n  async _openPopup(\n    auth: AuthInternal,\n    provider: AuthProvider,\n    authType: AuthEventType,\n    eventId?: string\n  ): Promise<AuthPopup> {\n    debugAssert(\n      this.eventManagers[auth._key()]?.manager,\n      '_initialize() not called before _openPopup()'\n    );\n\n    const url = await _getRedirectUrl(\n      auth,\n      provider,\n      authType,\n      _getCurrentUrl(),\n      eventId\n    );\n    return _open(auth, url, _generateEventId());\n  }\n\n  async _openRedirect(\n    auth: AuthInternal,\n    provider: AuthProvider,\n    authType: AuthEventType,\n    eventId?: string\n  ): Promise<never> {\n    await this._originValidation(auth);\n    const url = await _getRedirectUrl(\n      auth,\n      provider,\n      authType,\n      _getCurrentUrl(),\n      eventId\n    );\n    _setWindowLocation(url);\n    return new Promise(() => {});\n  }\n\n  _initialize(auth: AuthInternal): Promise<EventManager> {\n    const key = auth._key();\n    if (this.eventManagers[key]) {\n      const { manager, promise } = this.eventManagers[key];\n      if (manager) {\n        return Promise.resolve(manager);\n      } else {\n        debugAssert(promise, 'If manager is not set, promise should be');\n        return promise;\n      }\n    }\n\n    const promise = this.initAndGetManager(auth);\n    this.eventManagers[key] = { promise };\n\n    // If the promise is rejected, the key should be removed so that the\n    // operation can be retried later.\n    promise.catch(() => {\n      delete this.eventManagers[key];\n    });\n\n    return promise;\n  }\n\n  private async initAndGetManager(auth: AuthInternal): Promise<EventManager> {\n    const iframe = await _openIframe(auth);\n    const manager = new AuthEventManager(auth);\n    iframe.register<GapiAuthEvent>(\n      'authEvent',\n      (iframeEvent: GapiAuthEvent | null) => {\n        _assert(iframeEvent?.authEvent, auth, AuthErrorCode.INVALID_AUTH_EVENT);\n        // TODO: Consider splitting redirect and popup events earlier on\n\n        const handled = manager.onEvent(iframeEvent.authEvent);\n        return { status: handled ? GapiOutcome.ACK : GapiOutcome.ERROR };\n      },\n      gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER\n    );\n\n    this.eventManagers[auth._key()] = { manager };\n    this.iframes[auth._key()] = iframe;\n    return manager;\n  }\n\n  _isIframeWebStorageSupported(\n    auth: AuthInternal,\n    cb: (supported: boolean) => unknown\n  ): void {\n    const iframe = this.iframes[auth._key()];\n    iframe.send<gapi.iframes.Message, WebStorageSupportMessage>(\n      WEB_STORAGE_SUPPORT_KEY,\n      { type: WEB_STORAGE_SUPPORT_KEY },\n      result => {\n        const isSupported = result?.[0]?.[WEB_STORAGE_SUPPORT_KEY];\n        if (isSupported !== undefined) {\n          cb(!!isSupported);\n        }\n\n        _fail(auth, AuthErrorCode.INTERNAL_ERROR);\n      },\n      gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER\n    );\n  }\n\n  _originValidation(auth: AuthInternal): Promise<void> {\n    const key = auth._key();\n    if (!this.originValidationPromises[key]) {\n      this.originValidationPromises[key] = _validateOrigin(auth);\n    }\n\n    return this.originValidationPromises[key];\n  }\n\n  get _shouldInitProactively(): boolean {\n    // Mobile browsers and Safari need to optimistically initialize\n    return _isMobileBrowser() || _isSafari() || _isIOS();\n  }\n\n  _completeRedirectFn = _getRedirectResult;\n\n  _overrideRedirectResult = _overrideRedirectResult;\n}\n\n/**\n * An implementation of {@link PopupRedirectResolver} suitable for browser\n * based applications.\n *\n * @remarks\n * This method does not work in a Node.js environment.\n *\n * @public\n */\nexport const browserPopupRedirectResolver: PopupRedirectResolver =\n  BrowserPopupRedirectResolver;\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { FactorId, MultiFactorAssertion } from '../model/public_types';\nimport { debugFail } from '../core/util/assert';\nimport { MultiFactorSessionImpl, MultiFactorSessionType } from './mfa_session';\nimport { FinalizeMfaResponse } from '../api/authentication/mfa';\nimport { AuthInternal } from '../model/auth';\n\nexport abstract class MultiFactorAssertionImpl implements MultiFactorAssertion {\n  protected constructor(readonly factorId: FactorId) {}\n\n  _process(\n    auth: AuthInternal,\n    session: MultiFactorSessionImpl,\n    displayName?: string | null\n  ): Promise<FinalizeMfaResponse> {\n    switch (session.type) {\n      case MultiFactorSessionType.ENROLL:\n        return this._finalizeEnroll(auth, session.credential, displayName);\n      case MultiFactorSessionType.SIGN_IN:\n        return this._finalizeSignIn(auth, session.credential);\n      default:\n        return debugFail('unexpected MultiFactorSessionType');\n    }\n  }\n\n  abstract _finalizeEnroll(\n    auth: AuthInternal,\n    idToken: string,\n    displayName?: string | null\n  ): Promise<FinalizeMfaResponse>;\n  abstract _finalizeSignIn(\n    auth: AuthInternal,\n    mfaPendingCredential: string\n  ): Promise<FinalizeMfaResponse>;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n  FactorId,\n  PhoneMultiFactorAssertion\n} from '../../../model/public_types';\n\nimport { MultiFactorAssertionImpl } from '../../../mfa/mfa_assertion';\nimport { AuthInternal } from '../../../model/auth';\nimport { finalizeEnrollPhoneMfa } from '../../../api/account_management/mfa';\nimport { PhoneAuthCredential } from '../../../core/credentials/phone';\nimport {\n  finalizeSignInPhoneMfa,\n  FinalizeMfaResponse\n} from '../../../api/authentication/mfa';\n\n/**\n * {@inheritdoc PhoneMultiFactorAssertion}\n *\n * @public\n */\nexport class PhoneMultiFactorAssertionImpl\n  extends MultiFactorAssertionImpl\n  implements PhoneMultiFactorAssertion\n{\n  private constructor(private readonly credential: PhoneAuthCredential) {\n    super(FactorId.PHONE);\n  }\n\n  /** @internal */\n  static _fromCredential(\n    credential: PhoneAuthCredential\n  ): PhoneMultiFactorAssertionImpl {\n    return new PhoneMultiFactorAssertionImpl(credential);\n  }\n\n  /** @internal */\n  _finalizeEnroll(\n    auth: AuthInternal,\n    idToken: string,\n    displayName?: string | null\n  ): Promise<FinalizeMfaResponse> {\n    return finalizeEnrollPhoneMfa(auth, {\n      idToken,\n      displayName,\n      phoneVerificationInfo: this.credential._makeVerificationRequest()\n    });\n  }\n\n  /** @internal */\n  _finalizeSignIn(\n    auth: AuthInternal,\n    mfaPendingCredential: string\n  ): Promise<FinalizeMfaResponse> {\n    return finalizeSignInPhoneMfa(auth, {\n      mfaPendingCredential,\n      phoneVerificationInfo: this.credential._makeVerificationRequest()\n    });\n  }\n}\n\n/**\n * Provider for generating a {@link PhoneMultiFactorAssertion}.\n *\n * @public\n */\nexport class PhoneMultiFactorGenerator {\n  private constructor() {}\n\n  /**\n   * Provides a {@link PhoneMultiFactorAssertion} to confirm ownership of the phone second factor.\n   *\n   * @remarks\n   * This method does not work in a Node.js environment.\n   *\n   * @param phoneAuthCredential - A credential provided by {@link PhoneAuthProvider.credential}.\n   * @returns A {@link PhoneMultiFactorAssertion} which can be used with\n   * {@link MultiFactorResolver.resolveSignIn}\n   */\n  static assertion(credential: PhoneAuthCredential): PhoneMultiFactorAssertion {\n    return PhoneMultiFactorAssertionImpl._fromCredential(credential);\n  }\n\n  /**\n   * The identifier of the phone second factor: `phone`.\n   */\n  static FACTOR_ID = 'phone';\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n  TotpMultiFactorAssertion,\n  MultiFactorSession,\n  FactorId\n} from '../../model/public_types';\nimport { AuthInternal } from '../../model/auth';\nimport {\n  finalizeEnrollTotpMfa,\n  startEnrollTotpMfa,\n  StartTotpMfaEnrollmentResponse,\n  TotpVerificationInfo\n} from '../../api/account_management/mfa';\nimport {\n  FinalizeMfaResponse,\n  finalizeSignInTotpMfa\n} from '../../api/authentication/mfa';\nimport { MultiFactorAssertionImpl } from '../../mfa/mfa_assertion';\nimport { MultiFactorSessionImpl } from '../mfa_session';\nimport { AuthErrorCode } from '../../core/errors';\nimport { _assert } from '../../core/util/assert';\n\n/**\n * Provider for generating a {@link TotpMultiFactorAssertion}.\n *\n * @public\n */\nexport class TotpMultiFactorGenerator {\n  /**\n   * Provides a {@link TotpMultiFactorAssertion} to confirm ownership of\n   * the TOTP (time-based one-time password) second factor.\n   * This assertion is used to complete enrollment in TOTP second factor.\n   *\n   * @param secret A {@link TotpSecret} containing the shared secret key and other TOTP parameters.\n   * @param oneTimePassword One-time password from TOTP App.\n   * @returns A {@link TotpMultiFactorAssertion} which can be used with\n   * {@link MultiFactorUser.enroll}.\n   */\n  static assertionForEnrollment(\n    secret: TotpSecret,\n    oneTimePassword: string\n  ): TotpMultiFactorAssertion {\n    return TotpMultiFactorAssertionImpl._fromSecret(secret, oneTimePassword);\n  }\n\n  /**\n   * Provides a {@link TotpMultiFactorAssertion} to confirm ownership of the TOTP second factor.\n   * This assertion is used to complete signIn with TOTP as the second factor.\n   *\n   * @param enrollmentId identifies the enrolled TOTP second factor.\n   * @param oneTimePassword One-time password from TOTP App.\n   * @returns A {@link TotpMultiFactorAssertion} which can be used with\n   * {@link MultiFactorResolver.resolveSignIn}.\n   */\n  static assertionForSignIn(\n    enrollmentId: string,\n    oneTimePassword: string\n  ): TotpMultiFactorAssertion {\n    return TotpMultiFactorAssertionImpl._fromEnrollmentId(\n      enrollmentId,\n      oneTimePassword\n    );\n  }\n\n  /**\n   * Returns a promise to {@link TotpSecret} which contains the TOTP shared secret key and other parameters.\n   * Creates a TOTP secret as part of enrolling a TOTP second factor.\n   * Used for generating a QR code URL or inputting into a TOTP app.\n   * This method uses the auth instance corresponding to the user in the multiFactorSession.\n   *\n   * @param session The {@link MultiFactorSession} that the user is part of.\n   * @returns A promise to {@link TotpSecret}.\n   */\n  static async generateSecret(\n    session: MultiFactorSession\n  ): Promise<TotpSecret> {\n    const mfaSession = session as MultiFactorSessionImpl;\n    _assert(\n      typeof mfaSession.user?.auth !== 'undefined',\n      AuthErrorCode.INTERNAL_ERROR\n    );\n    const response = await startEnrollTotpMfa(mfaSession.user.auth, {\n      idToken: mfaSession.credential,\n      totpEnrollmentInfo: {}\n    });\n    return TotpSecret._fromStartTotpMfaEnrollmentResponse(\n      response,\n      mfaSession.user.auth\n    );\n  }\n\n  /**\n   * The identifier of the TOTP second factor: `totp`.\n   */\n  static FACTOR_ID: 'totp' = FactorId.TOTP;\n}\n\nexport class TotpMultiFactorAssertionImpl\n  extends MultiFactorAssertionImpl\n  implements TotpMultiFactorAssertion\n{\n  constructor(\n    readonly otp: string,\n    readonly enrollmentId?: string,\n    readonly secret?: TotpSecret\n  ) {\n    super(FactorId.TOTP);\n  }\n\n  /** @internal */\n  static _fromSecret(\n    secret: TotpSecret,\n    otp: string\n  ): TotpMultiFactorAssertionImpl {\n    return new TotpMultiFactorAssertionImpl(otp, undefined, secret);\n  }\n\n  /** @internal */\n  static _fromEnrollmentId(\n    enrollmentId: string,\n    otp: string\n  ): TotpMultiFactorAssertionImpl {\n    return new TotpMultiFactorAssertionImpl(otp, enrollmentId);\n  }\n\n  /** @internal */\n  async _finalizeEnroll(\n    auth: AuthInternal,\n    idToken: string,\n    displayName?: string | null\n  ): Promise<FinalizeMfaResponse> {\n    _assert(\n      typeof this.secret !== 'undefined',\n      auth,\n      AuthErrorCode.ARGUMENT_ERROR\n    );\n    return finalizeEnrollTotpMfa(auth, {\n      idToken,\n      displayName,\n      totpVerificationInfo: this.secret._makeTotpVerificationInfo(this.otp)\n    });\n  }\n\n  /** @internal */\n  async _finalizeSignIn(\n    auth: AuthInternal,\n    mfaPendingCredential: string\n  ): Promise<FinalizeMfaResponse> {\n    _assert(\n      this.enrollmentId !== undefined && this.otp !== undefined,\n      auth,\n      AuthErrorCode.ARGUMENT_ERROR\n    );\n    const totpVerificationInfo = { verificationCode: this.otp };\n    return finalizeSignInTotpMfa(auth, {\n      mfaPendingCredential,\n      mfaEnrollmentId: this.enrollmentId,\n      totpVerificationInfo\n    });\n  }\n}\n\n/**\n * Provider for generating a {@link TotpMultiFactorAssertion}.\n *\n * Stores the shared secret key and other parameters to generate time-based OTPs.\n * Implements methods to retrieve the shared secret key and generate a QR code URL.\n * @public\n */\nexport class TotpSecret {\n  /**\n   * Shared secret key/seed used for enrolling in TOTP MFA and generating OTPs.\n   */\n  readonly secretKey: string;\n  /**\n   * Hashing algorithm used.\n   */\n  readonly hashingAlgorithm: string;\n  /**\n   * Length of the one-time passwords to be generated.\n   */\n  readonly codeLength: number;\n  /**\n   * The interval (in seconds) when the OTP codes should change.\n   */\n  readonly codeIntervalSeconds: number;\n  /**\n   * The timestamp (UTC string) by which TOTP enrollment should be completed.\n   */\n  // This can be used by callers to show a countdown of when to enter OTP code by.\n  readonly enrollmentCompletionDeadline: string;\n\n  // The public members are declared outside the constructor so the docs can be generated.\n  private constructor(\n    secretKey: string,\n    hashingAlgorithm: string,\n    codeLength: number,\n    codeIntervalSeconds: number,\n    enrollmentCompletionDeadline: string,\n    private readonly sessionInfo: string,\n    private readonly auth: AuthInternal\n  ) {\n    this.secretKey = secretKey;\n    this.hashingAlgorithm = hashingAlgorithm;\n    this.codeLength = codeLength;\n    this.codeIntervalSeconds = codeIntervalSeconds;\n    this.enrollmentCompletionDeadline = enrollmentCompletionDeadline;\n  }\n\n  /** @internal */\n  static _fromStartTotpMfaEnrollmentResponse(\n    response: StartTotpMfaEnrollmentResponse,\n    auth: AuthInternal\n  ): TotpSecret {\n    return new TotpSecret(\n      response.totpSessionInfo.sharedSecretKey,\n      response.totpSessionInfo.hashingAlgorithm,\n      response.totpSessionInfo.verificationCodeLength,\n      response.totpSessionInfo.periodSec,\n      new Date(response.totpSessionInfo.finalizeEnrollmentTime).toUTCString(),\n      response.totpSessionInfo.sessionInfo,\n      auth\n    );\n  }\n\n  /** @internal */\n  _makeTotpVerificationInfo(otp: string): TotpVerificationInfo {\n    return { sessionInfo: this.sessionInfo, verificationCode: otp };\n  }\n\n  /**\n   * Returns a QR code URL as described in\n   * https://github.com/google/google-authenticator/wiki/Key-Uri-Format\n   * This can be displayed to the user as a QR code to be scanned into a TOTP app like Google Authenticator.\n   * If the optional parameters are unspecified, an accountName of <userEmail> and issuer of <firebaseAppName> are used.\n   *\n   * @param accountName the name of the account/app along with a user identifier.\n   * @param issuer issuer of the TOTP (likely the app name).\n   * @returns A QR code URL string.\n   */\n  generateQrCodeUrl(accountName?: string, issuer?: string): string {\n    let useDefaults = false;\n    if (_isEmptyString(accountName) || _isEmptyString(issuer)) {\n      useDefaults = true;\n    }\n    if (useDefaults) {\n      if (_isEmptyString(accountName)) {\n        accountName = this.auth.currentUser?.email || 'unknownuser';\n      }\n      if (_isEmptyString(issuer)) {\n        issuer = this.auth.name;\n      }\n    }\n    return `otpauth://totp/${issuer}:${accountName}?secret=${this.secretKey}&issuer=${issuer}&algorithm=${this.hashingAlgorithm}&digits=${this.codeLength}`;\n  }\n}\n\n/** @internal */\nfunction _isEmptyString(input?: string): boolean {\n  return typeof input === 'undefined' || input?.length === 0;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Unsubscribe } from '@firebase/util';\nimport { FirebaseAuthInternal } from '@firebase/auth-interop-types';\n\nimport { AuthInternal } from '../../model/auth';\nimport { UserInternal } from '../../model/user';\nimport { _assert } from '../util/assert';\nimport { AuthErrorCode } from '../errors';\n\ninterface TokenListener {\n  (tok: string | null): unknown;\n}\n\nexport class AuthInterop implements FirebaseAuthInternal {\n  private readonly internalListeners: Map<TokenListener, Unsubscribe> =\n    new Map();\n\n  constructor(private readonly auth: AuthInternal) {}\n\n  getUid(): string | null {\n    this.assertAuthConfigured();\n    return this.auth.currentUser?.uid || null;\n  }\n\n  async getToken(\n    forceRefresh?: boolean\n  ): Promise<{ accessToken: string } | null> {\n    this.assertAuthConfigured();\n    await this.auth._initializationPromise;\n    if (!this.auth.currentUser) {\n      return null;\n    }\n\n    const accessToken = await this.auth.currentUser.getIdToken(forceRefresh);\n    return { accessToken };\n  }\n\n  addAuthTokenListener(listener: TokenListener): void {\n    this.assertAuthConfigured();\n    if (this.internalListeners.has(listener)) {\n      return;\n    }\n\n    const unsubscribe = this.auth.onIdTokenChanged(user => {\n      listener(\n        (user as UserInternal | null)?.stsTokenManager.accessToken || null\n      );\n    });\n    this.internalListeners.set(listener, unsubscribe);\n    this.updateProactiveRefresh();\n  }\n\n  removeAuthTokenListener(listener: TokenListener): void {\n    this.assertAuthConfigured();\n    const unsubscribe = this.internalListeners.get(listener);\n    if (!unsubscribe) {\n      return;\n    }\n\n    this.internalListeners.delete(listener);\n    unsubscribe();\n    this.updateProactiveRefresh();\n  }\n\n  private assertAuthConfigured(): void {\n    _assert(\n      this.auth._initializationPromise,\n      AuthErrorCode.DEPENDENT_SDK_INIT_BEFORE_AUTH\n    );\n  }\n\n  private updateProactiveRefresh(): void {\n    if (this.internalListeners.size > 0) {\n      this.auth._startProactiveRefresh();\n    } else {\n      this.auth._stopProactiveRefresh();\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseApp, getApp, _getProvider } from '@firebase/app';\n\nimport {\n  initializeAuth,\n  beforeAuthStateChanged,\n  onIdTokenChanged,\n  connectAuthEmulator\n} from '..';\nimport { registerAuth } from '../core/auth/register';\nimport { ClientPlatform } from '../core/util/version';\nimport { browserLocalPersistence } from './persistence/local_storage';\nimport { browserSessionPersistence } from './persistence/session_storage';\nimport { indexedDBLocalPersistence } from './persistence/indexed_db';\nimport { browserPopupRedirectResolver } from './popup_redirect';\nimport { Auth, User } from '../model/public_types';\nimport { getDefaultEmulatorHost, getExperimentalSetting } from '@firebase/util';\nimport { _setExternalJSProvider } from './load_js';\nimport { _createError } from '../core/util/assert';\nimport { AuthErrorCode } from '../core/errors';\n\nconst DEFAULT_ID_TOKEN_MAX_AGE = 5 * 60;\nconst authIdTokenMaxAge =\n  getExperimentalSetting('authIdTokenMaxAge') || DEFAULT_ID_TOKEN_MAX_AGE;\n\nlet lastPostedIdToken: string | undefined | null = null;\n\nconst mintCookieFactory = (url: string) => async (user: User | null) => {\n  const idTokenResult = user && (await user.getIdTokenResult());\n  const idTokenAge =\n    idTokenResult &&\n    (new Date().getTime() - Date.parse(idTokenResult.issuedAtTime)) / 1_000;\n  if (idTokenAge && idTokenAge > authIdTokenMaxAge) {\n    return;\n  }\n  // Specifically trip null => undefined when logged out, to delete any existing cookie\n  const idToken = idTokenResult?.token;\n  if (lastPostedIdToken === idToken) {\n    return;\n  }\n  lastPostedIdToken = idToken;\n  await fetch(url, {\n    method: idToken ? 'POST' : 'DELETE',\n    headers: idToken\n      ? {\n          'Authorization': `Bearer ${idToken}`\n        }\n      : {}\n  });\n};\n\n/**\n * Returns the Auth instance associated with the provided {@link @firebase/app#FirebaseApp}.\n * If no instance exists, initializes an Auth instance with platform-specific default dependencies.\n *\n * @param app - The Firebase App.\n *\n * @public\n */\nexport function getAuth(app: FirebaseApp = getApp()): Auth {\n  const provider = _getProvider(app, 'auth');\n\n  if (provider.isInitialized()) {\n    return provider.getImmediate();\n  }\n\n  const auth = initializeAuth(app, {\n    popupRedirectResolver: browserPopupRedirectResolver,\n    persistence: [\n      indexedDBLocalPersistence,\n      browserLocalPersistence,\n      browserSessionPersistence\n    ]\n  });\n\n  const authTokenSyncPath = getExperimentalSetting('authTokenSyncURL');\n  // Only do the Cookie exchange in a secure context\n  if (\n    authTokenSyncPath &&\n    typeof isSecureContext === 'boolean' &&\n    isSecureContext\n  ) {\n    // Don't allow urls (XSS possibility), only paths on the same domain\n    const authTokenSyncUrl = new URL(authTokenSyncPath, location.origin);\n    if (location.origin === authTokenSyncUrl.origin) {\n      const mintCookie = mintCookieFactory(authTokenSyncUrl.toString());\n      beforeAuthStateChanged(auth, mintCookie, () =>\n        mintCookie(auth.currentUser)\n      );\n      onIdTokenChanged(auth, user => mintCookie(user));\n    }\n  }\n\n  const authEmulatorHost = getDefaultEmulatorHost('auth');\n  if (authEmulatorHost) {\n    connectAuthEmulator(auth, `http://${authEmulatorHost}`);\n  }\n\n  return auth;\n}\n\nfunction getScriptParentElement(): HTMLDocument | HTMLHeadElement {\n  return document.getElementsByTagName('head')?.[0] ?? document;\n}\n\n_setExternalJSProvider({\n  loadJS(url: string): Promise<Event> {\n    // TODO: consider adding timeout support & cancellation\n    return new Promise((resolve, reject) => {\n      const el = document.createElement('script');\n      el.setAttribute('src', url);\n      el.onload = resolve;\n      el.onerror = e => {\n        const error = _createError(AuthErrorCode.INTERNAL_ERROR);\n        error.customData = e as unknown as Record<string, unknown>;\n        reject(error);\n      };\n      el.type = 'text/javascript';\n      el.charset = 'UTF-8';\n      getScriptParentElement().appendChild(el);\n    });\n  },\n\n  gapiScript: 'https://apis.google.com/js/api.js',\n  recaptchaV2Script: 'https://www.google.com/recaptcha/api.js',\n  recaptchaEnterpriseScript:\n    'https://www.google.com/recaptcha/enterprise.js?render='\n});\n\nregisterAuth(ClientPlatform.BROWSER);\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { _registerComponent, registerVersion } from '@firebase/app';\nimport {\n  Component,\n  ComponentType,\n  InstantiationMode\n} from '@firebase/component';\n\nimport { name, version } from '../../../package.json';\nimport { AuthErrorCode } from '../errors';\nimport { _assert } from '../util/assert';\nimport { _getClientVersion, ClientPlatform } from '../util/version';\nimport { _castAuth, AuthImpl, DefaultConfig } from './auth_impl';\nimport { AuthInterop } from './firebase_internal';\nimport { ConfigInternal } from '../../model/auth';\nimport { Dependencies } from '../../model/public_types';\nimport { _initializeAuthInstance } from './initialize';\n\nexport const enum _ComponentName {\n  AUTH = 'auth',\n  AUTH_INTERNAL = 'auth-internal'\n}\n\nfunction getVersionForPlatform(\n  clientPlatform: ClientPlatform\n): string | undefined {\n  switch (clientPlatform) {\n    case ClientPlatform.NODE:\n      return 'node';\n    case ClientPlatform.REACT_NATIVE:\n      return 'rn';\n    case ClientPlatform.WORKER:\n      return 'webworker';\n    case ClientPlatform.CORDOVA:\n      return 'cordova';\n    case ClientPlatform.WEB_EXTENSION:\n      return 'web-extension';\n    default:\n      return undefined;\n  }\n}\n\n/** @internal */\nexport function registerAuth(clientPlatform: ClientPlatform): void {\n  _registerComponent(\n    new Component(\n      _ComponentName.AUTH,\n      (container, { options: deps }: { options?: Dependencies }) => {\n        const app = container.getProvider('app').getImmediate()!;\n        const heartbeatServiceProvider =\n          container.getProvider<'heartbeat'>('heartbeat');\n        const appCheckServiceProvider =\n          container.getProvider<'app-check-internal'>('app-check-internal');\n        const { apiKey, authDomain } = app.options;\n\n        _assert(\n          apiKey && !apiKey.includes(':'),\n          AuthErrorCode.INVALID_API_KEY,\n          { appName: app.name }\n        );\n\n        const config: ConfigInternal = {\n          apiKey,\n          authDomain,\n          clientPlatform,\n          apiHost: DefaultConfig.API_HOST,\n          tokenApiHost: DefaultConfig.TOKEN_API_HOST,\n          apiScheme: DefaultConfig.API_SCHEME,\n          sdkClientVersion: _getClientVersion(clientPlatform)\n        };\n\n        const authInstance = new AuthImpl(\n          app,\n          heartbeatServiceProvider,\n          appCheckServiceProvider,\n          config\n        );\n        _initializeAuthInstance(authInstance, deps);\n\n        return authInstance;\n      },\n      ComponentType.PUBLIC\n    )\n      /**\n       * Auth can only be initialized by explicitly calling getAuth() or initializeAuth()\n       * For why we do this, See go/firebase-next-auth-init\n       */\n      .setInstantiationMode(InstantiationMode.EXPLICIT)\n      /**\n       * Because all firebase products that depend on auth depend on auth-internal directly,\n       * we need to initialize auth-internal after auth is initialized to make it available to other firebase products.\n       */\n      .setInstanceCreatedCallback(\n        (container, _instanceIdentifier, _instance) => {\n          const authInternalProvider = container.getProvider(\n            _ComponentName.AUTH_INTERNAL\n          );\n          authInternalProvider.initialize();\n        }\n      )\n  );\n\n  _registerComponent(\n    new Component(\n      _ComponentName.AUTH_INTERNAL,\n      container => {\n        const auth = _castAuth(\n          container.getProvider(_ComponentName.AUTH).getImmediate()!\n        );\n        return (auth => new AuthInterop(auth))(auth);\n      },\n      ComponentType.PRIVATE\n    ).setInstantiationMode(InstantiationMode.EXPLICIT)\n  );\n\n  registerVersion(name, version, getVersionForPlatform(clientPlatform));\n  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\n  registerVersion(name, version, '__BUILD_TARGET__');\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * An enum of factors that may be used for multifactor authentication.\n *\n * @public\n */\nexport const FactorId = {\n  /** Phone as second factor */\n  PHONE: 'phone',\n  TOTP: 'totp'\n} as const;\n\n/**\n * Enumeration of supported providers.\n *\n * @public\n */\nexport const ProviderId = {\n  /** Facebook provider ID */\n  FACEBOOK: 'facebook.com',\n  /** GitHub provider ID */\n  GITHUB: 'github.com',\n  /** Google provider ID */\n  GOOGLE: 'google.com',\n  /** Password provider */\n  PASSWORD: 'password',\n  /** Phone provider */\n  PHONE: 'phone',\n  /** Twitter provider ID */\n  TWITTER: 'twitter.com'\n} as const;\n\n/**\n * Enumeration of supported sign-in methods.\n *\n * @public\n */\nexport const SignInMethod = {\n  /** Email link sign in method */\n  EMAIL_LINK: 'emailLink',\n  /** Email/password sign in method */\n  EMAIL_PASSWORD: 'password',\n  /** Facebook sign in method */\n  FACEBOOK: 'facebook.com',\n  /** GitHub sign in method */\n  GITHUB: 'github.com',\n  /** Google sign in method */\n  GOOGLE: 'google.com',\n  /** Phone sign in method */\n  PHONE: 'phone',\n  /** Twitter sign in method */\n  TWITTER: 'twitter.com'\n} as const;\n\n/**\n * Enumeration of supported operation types.\n *\n * @public\n */\nexport const OperationType = {\n  /** Operation involving linking an additional provider to an already signed-in user. */\n  LINK: 'link',\n  /** Operation involving using a provider to reauthenticate an already signed-in user. */\n  REAUTHENTICATE: 'reauthenticate',\n  /** Operation involving signing in a user. */\n  SIGN_IN: 'signIn'\n} as const;\n\n/**\n * An enumeration of the possible email action types.\n *\n * @public\n */\nexport const ActionCodeOperation = {\n  /** The email link sign-in action. */\n  EMAIL_SIGNIN: 'EMAIL_SIGNIN',\n  /** The password reset action. */\n  PASSWORD_RESET: 'PASSWORD_RESET',\n  /** The email revocation action. */\n  RECOVER_EMAIL: 'RECOVER_EMAIL',\n  /** The revert second factor addition email action. */\n  REVERT_SECOND_FACTOR_ADDITION: 'REVERT_SECOND_FACTOR_ADDITION',\n  /** The revert second factor addition email action. */\n  VERIFY_AND_CHANGE_EMAIL: 'VERIFY_AND_CHANGE_EMAIL',\n  /** The email verification action. */\n  VERIFY_EMAIL: 'VERIFY_EMAIL'\n} as const;\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  ActionCodeOperation,\n  ActionCodeSettings,\n  Auth,\n  User\n} from '../../model/public_types';\n\nimport {\n  createAuthUri,\n  CreateAuthUriRequest\n} from '../../api/authentication/create_auth_uri';\nimport * as api from '../../api/authentication/email_and_password';\nimport { UserInternal } from '../../model/user';\nimport { _getCurrentUrl, _isHttpOrHttps } from '../util/location';\nimport { _setActionCodeSettingsOnRequest } from './action_code_settings';\nimport { getModularInstance } from '@firebase/util';\n\n/**\n * Gets the list of possible sign in methods for the given email address. This method returns an\n * empty list when\n * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}\n * is enabled, irrespective of the number of authentication methods available for the given email.\n *\n * @remarks\n * This is useful to differentiate methods of sign-in for the same provider, eg.\n * {@link EmailAuthProvider} which has 2 methods of sign-in,\n * {@link SignInMethod}.EMAIL_PASSWORD and\n * {@link SignInMethod}.EMAIL_LINK.\n *\n * @param auth - The {@link Auth} instance.\n * @param email - The user's email address.\n *\n * Deprecated. Migrating off of this method is recommended as a security best-practice.\n * Learn more in the Identity Platform documentation for\n * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}.\n * @public\n */\nexport async function fetchSignInMethodsForEmail(\n  auth: Auth,\n  email: string\n): Promise<string[]> {\n  // createAuthUri returns an error if continue URI is not http or https.\n  // For environments like Cordova, Chrome extensions, native frameworks, file\n  // systems, etc, use http://localhost as continue URL.\n  const continueUri = _isHttpOrHttps() ? _getCurrentUrl() : 'http://localhost';\n  const request: CreateAuthUriRequest = {\n    identifier: email,\n    continueUri\n  };\n\n  const { signinMethods } = await createAuthUri(\n    getModularInstance(auth),\n    request\n  );\n\n  return signinMethods || [];\n}\n\n/**\n * Sends a verification email to a user.\n *\n * @remarks\n * The verification process is completed by calling {@link applyActionCode}.\n *\n * @example\n * ```javascript\n * const actionCodeSettings = {\n *   url: 'https://www.example.com/?email=user@example.com',\n *   iOS: {\n *      bundleId: 'com.example.ios'\n *   },\n *   android: {\n *     packageName: 'com.example.android',\n *     installApp: true,\n *     minimumVersion: '12'\n *   },\n *   handleCodeInApp: true\n * };\n * await sendEmailVerification(user, actionCodeSettings);\n * // Obtain code from the user.\n * await applyActionCode(auth, code);\n * ```\n *\n * @param user - The user.\n * @param actionCodeSettings - The {@link ActionCodeSettings}.\n *\n * @public\n */\nexport async function sendEmailVerification(\n  user: User,\n  actionCodeSettings?: ActionCodeSettings | null\n): Promise<void> {\n  const userInternal = getModularInstance(user) as UserInternal;\n  const idToken = await user.getIdToken();\n  const request: api.VerifyEmailRequest = {\n    requestType: ActionCodeOperation.VERIFY_EMAIL,\n    idToken\n  };\n  if (actionCodeSettings) {\n    _setActionCodeSettingsOnRequest(\n      userInternal.auth,\n      request,\n      actionCodeSettings\n    );\n  }\n\n  const { email } = await api.sendEmailVerification(userInternal.auth, request);\n\n  if (email !== user.email) {\n    await user.reload();\n  }\n}\n\n/**\n * Sends a verification email to a new email address.\n *\n * @remarks\n * The user's email will be updated to the new one after being verified.\n *\n * If you have a custom email action handler, you can complete the verification process by calling\n * {@link applyActionCode}.\n *\n * @example\n * ```javascript\n * const actionCodeSettings = {\n *   url: 'https://www.example.com/?email=user@example.com',\n *   iOS: {\n *      bundleId: 'com.example.ios'\n *   },\n *   android: {\n *     packageName: 'com.example.android',\n *     installApp: true,\n *     minimumVersion: '12'\n *   },\n *   handleCodeInApp: true\n * };\n * await verifyBeforeUpdateEmail(user, 'newemail@example.com', actionCodeSettings);\n * // Obtain code from the user.\n * await applyActionCode(auth, code);\n * ```\n *\n * @param user - The user.\n * @param newEmail - The new email address to be verified before update.\n * @param actionCodeSettings - The {@link ActionCodeSettings}.\n *\n * @public\n */\nexport async function verifyBeforeUpdateEmail(\n  user: User,\n  newEmail: string,\n  actionCodeSettings?: ActionCodeSettings | null\n): Promise<void> {\n  const userInternal = getModularInstance(user) as UserInternal;\n  const idToken = await user.getIdToken();\n  const request: api.VerifyAndChangeEmailRequest = {\n    requestType: ActionCodeOperation.VERIFY_AND_CHANGE_EMAIL,\n    idToken,\n    newEmail\n  };\n  if (actionCodeSettings) {\n    _setActionCodeSettingsOnRequest(\n      userInternal.auth,\n      request,\n      actionCodeSettings\n    );\n  }\n\n  const { email } = await api.verifyAndChangeEmail(userInternal.auth, request);\n\n  if (email !== user.email) {\n    // If the local copy of the email on user is outdated, reload the\n    // user.\n    await user.reload();\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  Endpoint,\n  HttpMethod,\n  _addTidIfNecessary,\n  _performApiRequest\n} from '../index';\nimport { Auth } from '../../model/public_types';\n\nexport interface CreateAuthUriRequest {\n  identifier: string;\n  continueUri: string;\n  tenantId?: string;\n}\n\nexport interface CreateAuthUriResponse {\n  signinMethods: string[];\n}\n\nexport async function createAuthUri(\n  auth: Auth,\n  request: CreateAuthUriRequest\n): Promise<CreateAuthUriResponse> {\n  return _performApiRequest<CreateAuthUriRequest, CreateAuthUriResponse>(\n    auth,\n    HttpMethod.POST,\n    Endpoint.CREATE_AUTH_URI,\n    _addTidIfNecessary(auth, request)\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  ActionCodeOperation,\n  ActionCodeSettings,\n  Auth,\n  UserCredential\n} from '../../model/public_types';\n\nimport * as api from '../../api/authentication/email_and_password';\nimport { ActionCodeURL } from '../action_code_url';\nimport { EmailAuthProvider } from '../providers/email';\nimport { _getCurrentUrl } from '../util/location';\nimport { _setActionCodeSettingsOnRequest } from './action_code_settings';\nimport { signInWithCredential } from './credential';\nimport { AuthErrorCode } from '../errors';\nimport { _assert } from '../util/assert';\nimport { getModularInstance } from '@firebase/util';\nimport { _castAuth } from '../auth/auth_impl';\nimport { handleRecaptchaFlow } from '../../platform_browser/recaptcha/recaptcha_enterprise_verifier';\nimport { RecaptchaActionName, RecaptchaClientType } from '../../api';\nimport { _isFirebaseServerApp } from '@firebase/app';\nimport { _serverAppCurrentUserOperationNotSupportedError } from '../../core/util/assert';\n\n/**\n * Sends a sign-in email link to the user with the specified email.\n *\n * @remarks\n * The sign-in operation has to always be completed in the app unlike other out of band email\n * actions (password reset and email verifications). This is because, at the end of the flow,\n * the user is expected to be signed in and their Auth state persisted within the app.\n *\n * To complete sign in with the email link, call {@link signInWithEmailLink} with the email\n * address and the email link supplied in the email sent to the user.\n *\n * @example\n * ```javascript\n * const actionCodeSettings = {\n *   url: 'https://www.example.com/?email=user@example.com',\n *   iOS: {\n *      bundleId: 'com.example.ios'\n *   },\n *   android: {\n *     packageName: 'com.example.android',\n *     installApp: true,\n *     minimumVersion: '12'\n *   },\n *   handleCodeInApp: true\n * };\n * await sendSignInLinkToEmail(auth, 'user@example.com', actionCodeSettings);\n * // Obtain emailLink from the user.\n * if(isSignInWithEmailLink(auth, emailLink)) {\n *   await signInWithEmailLink(auth, 'user@example.com', emailLink);\n * }\n * ```\n *\n * @param authInternal - The {@link Auth} instance.\n * @param email - The user's email address.\n * @param actionCodeSettings - The {@link ActionCodeSettings}.\n *\n * @public\n */\nexport async function sendSignInLinkToEmail(\n  auth: Auth,\n  email: string,\n  actionCodeSettings: ActionCodeSettings\n): Promise<void> {\n  const authInternal = _castAuth(auth);\n  const request: api.EmailSignInRequest = {\n    requestType: ActionCodeOperation.EMAIL_SIGNIN,\n    email,\n    clientType: RecaptchaClientType.WEB\n  };\n  function setActionCodeSettings(\n    request: api.EmailSignInRequest,\n    actionCodeSettings: ActionCodeSettings\n  ): void {\n    _assert(\n      actionCodeSettings.handleCodeInApp,\n      authInternal,\n      AuthErrorCode.ARGUMENT_ERROR\n    );\n    if (actionCodeSettings) {\n      _setActionCodeSettingsOnRequest(\n        authInternal,\n        request,\n        actionCodeSettings\n      );\n    }\n  }\n  setActionCodeSettings(request, actionCodeSettings);\n  await handleRecaptchaFlow(\n    authInternal,\n    request,\n    RecaptchaActionName.GET_OOB_CODE,\n    api.sendSignInLinkToEmail\n  );\n}\n\n/**\n * Checks if an incoming link is a sign-in with email link suitable for {@link signInWithEmailLink}.\n *\n * @param auth - The {@link Auth} instance.\n * @param emailLink - The link sent to the user's email address.\n *\n * @public\n */\nexport function isSignInWithEmailLink(auth: Auth, emailLink: string): boolean {\n  const actionCodeUrl = ActionCodeURL.parseLink(emailLink);\n  return actionCodeUrl?.operation === ActionCodeOperation.EMAIL_SIGNIN;\n}\n\n/**\n * Asynchronously signs in using an email and sign-in email link.\n *\n * @remarks\n * If no link is passed, the link is inferred from the current URL.\n *\n * Fails with an error if the email address is invalid or OTP in email link expires.\n *\n * This method is not supported by {@link Auth} instances created with a\n * {@link @firebase/app#FirebaseServerApp}.\n *\n * Note: Confirm the link is a sign-in email link before calling this method firebase.auth.Auth.isSignInWithEmailLink.\n *\n * @example\n * ```javascript\n * const actionCodeSettings = {\n *   url: 'https://www.example.com/?email=user@example.com',\n *   iOS: {\n *      bundleId: 'com.example.ios'\n *   },\n *   android: {\n *     packageName: 'com.example.android',\n *     installApp: true,\n *     minimumVersion: '12'\n *   },\n *   handleCodeInApp: true\n * };\n * await sendSignInLinkToEmail(auth, 'user@example.com', actionCodeSettings);\n * // Obtain emailLink from the user.\n * if(isSignInWithEmailLink(auth, emailLink)) {\n *   await signInWithEmailLink(auth, 'user@example.com', emailLink);\n * }\n * ```\n *\n *\n * @param auth - The {@link Auth} instance.\n * @param email - The user's email address.\n * @param emailLink - The link sent to the user's email address.\n *\n * @public\n */\nexport async function signInWithEmailLink(\n  auth: Auth,\n  email: string,\n  emailLink?: string\n): Promise<UserCredential> {\n  if (_isFirebaseServerApp(auth.app)) {\n    return Promise.reject(\n      _serverAppCurrentUserOperationNotSupportedError(auth)\n    );\n  }\n  const authModular = getModularInstance(auth);\n  const credential = EmailAuthProvider.credentialWithLink(\n    email,\n    emailLink || _getCurrentUrl()\n  );\n  // Check if the tenant ID in the email link matches the tenant ID on Auth\n  // instance.\n  _assert(\n    credential._tenantId === (authModular.tenantId || null),\n    authModular,\n    AuthErrorCode.TENANT_ID_MISMATCH\n  );\n  return signInWithCredential(authModular, credential);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Auth, UserCredential } from '../../model/public_types';\nimport { signUp } from '../../api/authentication/sign_up';\nimport { UserInternal } from '../../model/user';\nimport { UserCredentialImpl } from '../user/user_credential_impl';\nimport { _castAuth } from '../auth/auth_impl';\nimport { OperationType } from '../../model/enums';\nimport { _isFirebaseServerApp } from '@firebase/app';\nimport { _serverAppCurrentUserOperationNotSupportedError } from '../../core/util/assert';\n\n/**\n * Asynchronously signs in as an anonymous user.\n *\n * @remarks\n * If there is already an anonymous user signed in, that user will be returned; otherwise, a\n * new anonymous user identity will be created and returned.\n *\n * This method is not supported by {@link Auth} instances created with a\n * {@link @firebase/app#FirebaseServerApp}.\n *\n * @param auth - The {@link Auth} instance.\n *\n * @public\n */\nexport async function signInAnonymously(auth: Auth): Promise<UserCredential> {\n  if (_isFirebaseServerApp(auth.app)) {\n    return Promise.reject(\n      _serverAppCurrentUserOperationNotSupportedError(auth)\n    );\n  }\n  const authInternal = _castAuth(auth);\n  await authInternal._initializationPromise;\n  if (authInternal.currentUser?.isAnonymous) {\n    // If an anonymous user is already signed in, no need to sign them in again.\n    return new UserCredentialImpl({\n      user: authInternal.currentUser as UserInternal,\n      providerId: null,\n      operationType: OperationType.SIGN_IN\n    });\n  }\n  const response = await signUp(authInternal, {\n    returnSecureToken: true\n  });\n  const userCredential = await UserCredentialImpl._fromIdTokenResponse(\n    authInternal,\n    OperationType.SIGN_IN,\n    response,\n    true\n  );\n  await authInternal._updateCurrentUser(userCredential.user);\n  return userCredential;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Auth, UserCredential } from '../../model/public_types';\n\nimport { signInWithCustomToken as getIdTokenResponse } from '../../api/authentication/custom_token';\nimport { IdTokenResponse } from '../../model/id_token';\nimport { UserCredentialImpl } from '../user/user_credential_impl';\nimport { _castAuth } from '../auth/auth_impl';\nimport { OperationType } from '../../model/enums';\nimport { _isFirebaseServerApp } from '@firebase/app';\nimport { _serverAppCurrentUserOperationNotSupportedError } from '../../core/util/assert';\n/**\n * Asynchronously signs in using a custom token.\n *\n * @remarks\n * Custom tokens are used to integrate Firebase Auth with existing auth systems, and must\n * be generated by an auth backend using the\n * {@link https://firebase.google.com/docs/reference/admin/node/admin.auth.Auth#createcustomtoken | createCustomToken}\n * method in the {@link https://firebase.google.com/docs/auth/admin | Admin SDK} .\n *\n * Fails with an error if the token is invalid, expired, or not accepted by the Firebase Auth service.\n *\n * This method is not supported by {@link Auth} instances created with a\n * {@link @firebase/app#FirebaseServerApp}.\n *\n * @param auth - The {@link Auth} instance.\n * @param customToken - The custom token to sign in with.\n *\n * @public\n */\nexport async function signInWithCustomToken(\n  auth: Auth,\n  customToken: string\n): Promise<UserCredential> {\n  if (_isFirebaseServerApp(auth.app)) {\n    return Promise.reject(\n      _serverAppCurrentUserOperationNotSupportedError(auth)\n    );\n  }\n  const authInternal = _castAuth(auth);\n  const response: IdTokenResponse = await getIdTokenResponse(authInternal, {\n    token: customToken,\n    returnSecureToken: true\n  });\n  const cred = await UserCredentialImpl._fromIdTokenResponse(\n    authInternal,\n    OperationType.SIGN_IN,\n    response\n  );\n  await authInternal._updateCurrentUser(cred.user);\n  return cred;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  Endpoint,\n  HttpMethod,\n  _addTidIfNecessary,\n  _performSignInRequest\n} from '../index';\nimport { IdTokenResponse } from '../../model/id_token';\nimport { Auth } from '../../model/public_types';\n\nexport interface SignInWithCustomTokenRequest {\n  token: string;\n  returnSecureToken: boolean;\n  tenantId?: string;\n}\n\nexport interface SignInWithCustomTokenResponse extends IdTokenResponse {}\n\nexport async function signInWithCustomToken(\n  auth: Auth,\n  request: SignInWithCustomTokenRequest\n): Promise<SignInWithCustomTokenResponse> {\n  return _performSignInRequest<\n    SignInWithCustomTokenRequest,\n    SignInWithCustomTokenResponse\n  >(\n    auth,\n    HttpMethod.POST,\n    Endpoint.SIGN_IN_WITH_CUSTOM_TOKEN,\n    _addTidIfNecessary(auth, request)\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Endpoint, HttpMethod, _performApiRequest } from '../index';\nimport { IdTokenResponse } from '../../model/id_token';\nimport { Auth } from '../../model/public_types';\n\nexport interface UpdateProfileRequest {\n  idToken: string;\n  displayName?: string | null;\n  photoUrl?: string | null;\n  returnSecureToken: boolean;\n}\n\nexport interface UpdateProfileResponse extends IdTokenResponse {\n  displayName?: string | null;\n  photoUrl?: string | null;\n}\n\nexport async function updateProfile(\n  auth: Auth,\n  request: UpdateProfileRequest\n): Promise<UpdateProfileResponse> {\n  return _performApiRequest<UpdateProfileRequest, UpdateProfileResponse>(\n    auth,\n    HttpMethod.POST,\n    Endpoint.SET_ACCOUNT_INFO,\n    request\n  );\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n  InstantiationMode,\n  InstanceFactory,\n  ComponentType,\n  Dictionary,\n  Name,\n  onInstanceCreatedCallback\n} from './types';\n\n/**\n * Component for service name T, e.g. `auth`, `auth-internal`\n */\nexport class Component<T extends Name = Name> {\n  multipleInstances = false;\n  /**\n   * Properties to be added to the service namespace\n   */\n  serviceProps: Dictionary = {};\n\n  instantiationMode = InstantiationMode.LAZY;\n\n  onInstanceCreated: onInstanceCreatedCallback<T> | null = null;\n\n  /**\n   *\n   * @param name The public service name, e.g. app, auth, firestore, database\n   * @param instanceFactory Service factory responsible for creating the public interface\n   * @param type whether the service provided by the component is public or private\n   */\n  constructor(\n    readonly name: T,\n    readonly instanceFactory: InstanceFactory<T>,\n    readonly type: ComponentType\n  ) {}\n\n  setInstantiationMode(mode: InstantiationMode): this {\n    this.instantiationMode = mode;\n    return this;\n  }\n\n  setMultipleInstances(multipleInstances: boolean): this {\n    this.multipleInstances = multipleInstances;\n    return this;\n  }\n\n  setServiceProps(props: Dictionary): this {\n    this.serviceProps = props;\n    return this;\n  }\n\n  setInstanceCreatedCallback(callback: onInstanceCreatedCallback<T>): this {\n    this.onInstanceCreated = callback;\n    return this;\n  }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Deferred } from '@firebase/util';\nimport { ComponentContainer } from './component_container';\nimport { DEFAULT_ENTRY_NAME } from './constants';\nimport {\n  InitializeOptions,\n  InstantiationMode,\n  Name,\n  NameServiceMapping,\n  OnInitCallBack\n} from './types';\nimport { Component } from './component';\n\n/**\n * Provider for instance for service name T, e.g. 'auth', 'auth-internal'\n * NameServiceMapping[T] is an alias for the type of the instance\n */\nexport class Provider<T extends Name> {\n  private component: Component<T> | null = null;\n  private readonly instances: Map<string, NameServiceMapping[T]> = new Map();\n  private readonly instancesDeferred: Map<\n    string,\n    Deferred<NameServiceMapping[T]>\n  > = new Map();\n  private readonly instancesOptions: Map<string, Record<string, unknown>> =\n    new Map();\n  private onInitCallbacks: Map<string, Set<OnInitCallBack<T>>> = new Map();\n\n  constructor(\n    private readonly name: T,\n    private readonly container: ComponentContainer\n  ) {}\n\n  /**\n   * @param identifier A provider can provide mulitple instances of a service\n   * if this.component.multipleInstances is true.\n   */\n  get(identifier?: string): Promise<NameServiceMapping[T]> {\n    // if multipleInstances is not supported, use the default name\n    const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\n\n    if (!this.instancesDeferred.has(normalizedIdentifier)) {\n      const deferred = new Deferred<NameServiceMapping[T]>();\n      this.instancesDeferred.set(normalizedIdentifier, deferred);\n\n      if (\n        this.isInitialized(normalizedIdentifier) ||\n        this.shouldAutoInitialize()\n      ) {\n        // initialize the service if it can be auto-initialized\n        try {\n          const instance = this.getOrInitializeService({\n            instanceIdentifier: normalizedIdentifier\n          });\n          if (instance) {\n            deferred.resolve(instance);\n          }\n        } catch (e) {\n          // when the instance factory throws an exception during get(), it should not cause\n          // a fatal error. We just return the unresolved promise in this case.\n        }\n      }\n    }\n\n    return this.instancesDeferred.get(normalizedIdentifier)!.promise;\n  }\n\n  /**\n   *\n   * @param options.identifier A provider can provide mulitple instances of a service\n   * if this.component.multipleInstances is true.\n   * @param options.optional If optional is false or not provided, the method throws an error when\n   * the service is not immediately available.\n   * If optional is true, the method returns null if the service is not immediately available.\n   */\n  getImmediate(options: {\n    identifier?: string;\n    optional: true;\n  }): NameServiceMapping[T] | null;\n  getImmediate(options?: {\n    identifier?: string;\n    optional?: false;\n  }): NameServiceMapping[T];\n  getImmediate(options?: {\n    identifier?: string;\n    optional?: boolean;\n  }): NameServiceMapping[T] | null {\n    // if multipleInstances is not supported, use the default name\n    const normalizedIdentifier = this.normalizeInstanceIdentifier(\n      options?.identifier\n    );\n    const optional = options?.optional ?? false;\n\n    if (\n      this.isInitialized(normalizedIdentifier) ||\n      this.shouldAutoInitialize()\n    ) {\n      try {\n        return this.getOrInitializeService({\n          instanceIdentifier: normalizedIdentifier\n        });\n      } catch (e) {\n        if (optional) {\n          return null;\n        } else {\n          throw e;\n        }\n      }\n    } else {\n      // In case a component is not initialized and should/can not be auto-initialized at the moment, return null if the optional flag is set, or throw\n      if (optional) {\n        return null;\n      } else {\n        throw Error(`Service ${this.name} is not available`);\n      }\n    }\n  }\n\n  getComponent(): Component<T> | null {\n    return this.component;\n  }\n\n  setComponent(component: Component<T>): void {\n    if (component.name !== this.name) {\n      throw Error(\n        `Mismatching Component ${component.name} for Provider ${this.name}.`\n      );\n    }\n\n    if (this.component) {\n      throw Error(`Component for ${this.name} has already been provided`);\n    }\n\n    this.component = component;\n\n    // return early without attempting to initialize the component if the component requires explicit initialization (calling `Provider.initialize()`)\n    if (!this.shouldAutoInitialize()) {\n      return;\n    }\n\n    // if the service is eager, initialize the default instance\n    if (isComponentEager(component)) {\n      try {\n        this.getOrInitializeService({ instanceIdentifier: DEFAULT_ENTRY_NAME });\n      } catch (e) {\n        // when the instance factory for an eager Component throws an exception during the eager\n        // initialization, it should not cause a fatal error.\n        // TODO: Investigate if we need to make it configurable, because some component may want to cause\n        // a fatal error in this case?\n      }\n    }\n\n    // Create service instances for the pending promises and resolve them\n    // NOTE: if this.multipleInstances is false, only the default instance will be created\n    // and all promises with resolve with it regardless of the identifier.\n    for (const [\n      instanceIdentifier,\n      instanceDeferred\n    ] of this.instancesDeferred.entries()) {\n      const normalizedIdentifier =\n        this.normalizeInstanceIdentifier(instanceIdentifier);\n\n      try {\n        // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy.\n        const instance = this.getOrInitializeService({\n          instanceIdentifier: normalizedIdentifier\n        })!;\n        instanceDeferred.resolve(instance);\n      } catch (e) {\n        // when the instance factory throws an exception, it should not cause\n        // a fatal error. We just leave the promise unresolved.\n      }\n    }\n  }\n\n  clearInstance(identifier: string = DEFAULT_ENTRY_NAME): void {\n    this.instancesDeferred.delete(identifier);\n    this.instancesOptions.delete(identifier);\n    this.instances.delete(identifier);\n  }\n\n  // app.delete() will call this method on every provider to delete the services\n  // TODO: should we mark the provider as deleted?\n  async delete(): Promise<void> {\n    const services = Array.from(this.instances.values());\n\n    await Promise.all([\n      ...services\n        .filter(service => 'INTERNAL' in service) // legacy services\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        .map(service => (service as any).INTERNAL!.delete()),\n      ...services\n        .filter(service => '_delete' in service) // modularized services\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        .map(service => (service as any)._delete())\n    ]);\n  }\n\n  isComponentSet(): boolean {\n    return this.component != null;\n  }\n\n  isInitialized(identifier: string = DEFAULT_ENTRY_NAME): boolean {\n    return this.instances.has(identifier);\n  }\n\n  getOptions(identifier: string = DEFAULT_ENTRY_NAME): Record<string, unknown> {\n    return this.instancesOptions.get(identifier) || {};\n  }\n\n  initialize(opts: InitializeOptions = {}): NameServiceMapping[T] {\n    const { options = {} } = opts;\n    const normalizedIdentifier = this.normalizeInstanceIdentifier(\n      opts.instanceIdentifier\n    );\n    if (this.isInitialized(normalizedIdentifier)) {\n      throw Error(\n        `${this.name}(${normalizedIdentifier}) has already been initialized`\n      );\n    }\n\n    if (!this.isComponentSet()) {\n      throw Error(`Component ${this.name} has not been registered yet`);\n    }\n\n    const instance = this.getOrInitializeService({\n      instanceIdentifier: normalizedIdentifier,\n      options\n    })!;\n\n    // resolve any pending promise waiting for the service instance\n    for (const [\n      instanceIdentifier,\n      instanceDeferred\n    ] of this.instancesDeferred.entries()) {\n      const normalizedDeferredIdentifier =\n        this.normalizeInstanceIdentifier(instanceIdentifier);\n      if (normalizedIdentifier === normalizedDeferredIdentifier) {\n        instanceDeferred.resolve(instance);\n      }\n    }\n\n    return instance;\n  }\n\n  /**\n   *\n   * @param callback - a function that will be invoked  after the provider has been initialized by calling provider.initialize().\n   * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program.\n   *\n   * @param identifier An optional instance identifier\n   * @returns a function to unregister the callback\n   */\n  onInit(callback: OnInitCallBack<T>, identifier?: string): () => void {\n    const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\n    const existingCallbacks =\n      this.onInitCallbacks.get(normalizedIdentifier) ??\n      new Set<OnInitCallBack<T>>();\n    existingCallbacks.add(callback);\n    this.onInitCallbacks.set(normalizedIdentifier, existingCallbacks);\n\n    const existingInstance = this.instances.get(normalizedIdentifier);\n    if (existingInstance) {\n      callback(existingInstance, normalizedIdentifier);\n    }\n\n    return () => {\n      existingCallbacks.delete(callback);\n    };\n  }\n\n  /**\n   * Invoke onInit callbacks synchronously\n   * @param instance the service instance`\n   */\n  private invokeOnInitCallbacks(\n    instance: NameServiceMapping[T],\n    identifier: string\n  ): void {\n    const callbacks = this.onInitCallbacks.get(identifier);\n    if (!callbacks) {\n      return;\n    }\n    for (const callback of callbacks) {\n      try {\n        callback(instance, identifier);\n      } catch {\n        // ignore errors in the onInit callback\n      }\n    }\n  }\n\n  private getOrInitializeService({\n    instanceIdentifier,\n    options = {}\n  }: {\n    instanceIdentifier: string;\n    options?: Record<string, unknown>;\n  }): NameServiceMapping[T] | null {\n    let instance = this.instances.get(instanceIdentifier);\n    if (!instance && this.component) {\n      instance = this.component.instanceFactory(this.container, {\n        instanceIdentifier: normalizeIdentifierForFactory(instanceIdentifier),\n        options\n      });\n      this.instances.set(instanceIdentifier, instance);\n      this.instancesOptions.set(instanceIdentifier, options);\n\n      /**\n       * Invoke onInit listeners.\n       * Note this.component.onInstanceCreated is different, which is used by the component creator,\n       * while onInit listeners are registered by consumers of the provider.\n       */\n      this.invokeOnInitCallbacks(instance, instanceIdentifier);\n\n      /**\n       * Order is important\n       * onInstanceCreated() should be called after this.instances.set(instanceIdentifier, instance); which\n       * makes `isInitialized()` return true.\n       */\n      if (this.component.onInstanceCreated) {\n        try {\n          this.component.onInstanceCreated(\n            this.container,\n            instanceIdentifier,\n            instance\n          );\n        } catch {\n          // ignore errors in the onInstanceCreatedCallback\n        }\n      }\n    }\n\n    return instance || null;\n  }\n\n  private normalizeInstanceIdentifier(\n    identifier: string = DEFAULT_ENTRY_NAME\n  ): string {\n    if (this.component) {\n      return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME;\n    } else {\n      return identifier; // assume multiple instances are supported before the component is provided.\n    }\n  }\n\n  private shouldAutoInitialize(): boolean {\n    return (\n      !!this.component &&\n      this.component.instantiationMode !== InstantiationMode.EXPLICIT\n    );\n  }\n}\n\n// undefined should be passed to the service factory for the default instance\nfunction normalizeIdentifierForFactory(identifier: string): string | undefined {\n  return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier;\n}\n\nfunction isComponentEager<T extends Name>(component: Component<T>): boolean {\n  return component.instantiationMode === InstantiationMode.EAGER;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Provider } from './provider';\nimport { Component } from './component';\nimport { Name } from './types';\n\n/**\n * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal`\n */\nexport class ComponentContainer {\n  private readonly providers = new Map<string, Provider<Name>>();\n\n  constructor(private readonly name: string) {}\n\n  /**\n   *\n   * @param component Component being added\n   * @param overwrite When a component with the same name has already been registered,\n   * if overwrite is true: overwrite the existing component with the new component and create a new\n   * provider with the new component. It can be useful in tests where you want to use different mocks\n   * for different tests.\n   * if overwrite is false: throw an exception\n   */\n  addComponent<T extends Name>(component: Component<T>): void {\n    const provider = this.getProvider(component.name);\n    if (provider.isComponentSet()) {\n      throw new Error(\n        `Component ${component.name} has already been registered with ${this.name}`\n      );\n    }\n\n    provider.setComponent(component);\n  }\n\n  addOrOverwriteComponent<T extends Name>(component: Component<T>): void {\n    const provider = this.getProvider(component.name);\n    if (provider.isComponentSet()) {\n      // delete the existing provider from the container, so we can register the new component\n      this.providers.delete(component.name);\n    }\n\n    this.addComponent(component);\n  }\n\n  /**\n   * getProvider provides a type safe interface where it can only be called with a field name\n   * present in NameServiceMapping interface.\n   *\n   * Firebase SDKs providing services should extend NameServiceMapping interface to register\n   * themselves.\n   */\n  getProvider<T extends Name>(name: T): Provider<T> {\n    if (this.providers.has(name)) {\n      return this.providers.get(name) as unknown as Provider<T>;\n    }\n\n    // create a Provider for a service that hasn't registered with Firebase\n    const provider = new Provider<T>(name, this);\n    this.providers.set(name, provider as unknown as Provider<Name>);\n\n    return provider as Provider<T>;\n  }\n\n  getProviders(): Array<Provider<Name>> {\n    return Array.from(this.providers.values());\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Simple wrapper around a nullable UID. Mostly exists to make code more\n * readable.\n */\nexport class User {\n  /** A user with a null UID. */\n  static readonly UNAUTHENTICATED = new User(null);\n\n  // TODO(mikelehen): Look into getting a proper uid-equivalent for\n  // non-FirebaseAuth providers.\n  static readonly GOOGLE_CREDENTIALS = new User('google-credentials-uid');\n  static readonly FIRST_PARTY = new User('first-party-uid');\n  static readonly MOCK_USER = new User('mock-user');\n\n  constructor(readonly uid: string | null) {}\n\n  isAuthenticated(): boolean {\n    return this.uid != null;\n  }\n\n  /**\n   * Returns a key representing this user, suitable for inclusion in a\n   * dictionary.\n   */\n  toKey(): string {\n    if (this.isAuthenticated()) {\n      return 'uid:' + this.uid;\n    } else {\n      return 'anonymous-user';\n    }\n  }\n\n  isEqual(otherUser: User): boolean {\n    return otherUser.uid === this.uid;\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** The semver (www.semver.org) version of the SDK. */\nimport { version } from '../../../firebase/package.json';\nexport let SDK_VERSION = version;\nexport function setSDKVersion(version: string): void {\n  SDK_VERSION = version;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Logger, LogLevel, LogLevelString } from '@firebase/logger';\n\nimport { SDK_VERSION } from '../core/version';\nimport { formatJSON } from '../platform/format_json';\n\nexport { LogLevel, LogLevelString };\n\nconst logClient = new Logger('@firebase/firestore');\n\n// Helper methods are needed because variables can't be exported as read/write\nexport function getLogLevel(): LogLevel {\n  return logClient.logLevel;\n}\n\n/**\n * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).\n *\n * @param logLevel - The verbosity you set for activity and error logging. Can\n *   be any of the following values:\n *\n *   <ul>\n *     <li>`debug` for the most verbose logging level, primarily for\n *     debugging.</li>\n *     <li>`error` to log errors only.</li>\n *     <li><code>`silent` to turn off logging.</li>\n *   </ul>\n */\nexport function setLogLevel(logLevel: LogLevelString): void {\n  logClient.setLogLevel(logLevel);\n}\n\nexport function logDebug(msg: string, ...obj: unknown[]): void {\n  if (logClient.logLevel <= LogLevel.DEBUG) {\n    const args = obj.map(argToString);\n    logClient.debug(`Firestore (${SDK_VERSION}): ${msg}`, ...args);\n  }\n}\n\nexport function logError(msg: string, ...obj: unknown[]): void {\n  if (logClient.logLevel <= LogLevel.ERROR) {\n    const args = obj.map(argToString);\n    logClient.error(`Firestore (${SDK_VERSION}): ${msg}`, ...args);\n  }\n}\n\n/**\n * @internal\n */\nexport function logWarn(msg: string, ...obj: unknown[]): void {\n  if (logClient.logLevel <= LogLevel.WARN) {\n    const args = obj.map(argToString);\n    logClient.warn(`Firestore (${SDK_VERSION}): ${msg}`, ...args);\n  }\n}\n\n/**\n * Converts an additional log parameter to a string representation.\n */\nfunction argToString(obj: unknown): string | unknown {\n  if (typeof obj === 'string') {\n    return obj;\n  } else {\n    try {\n      return formatJSON(obj);\n    } catch (e) {\n      // Converting to JSON failed, just log the object directly\n      return obj;\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** Formats an object as a JSON string, suitable for logging. */\nexport function formatJSON(value: unknown): string {\n  return JSON.stringify(value);\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SDK_VERSION } from '../core/version';\n\nimport { logError } from './log';\n\n/**\n * Unconditionally fails, throwing an Error with the given message.\n * Messages are stripped in production builds.\n *\n * Returns `never` and can be used in expressions:\n * @example\n * let futureVar = fail('not implemented yet');\n */\nexport function fail(failure: string = 'Unexpected state'): never {\n  // Log the failure in addition to throw an exception, just in case the\n  // exception is swallowed.\n  const message =\n    `FIRESTORE (${SDK_VERSION}) INTERNAL ASSERTION FAILED: ` + failure;\n  logError(message);\n\n  // NOTE: We don't use FirestoreError here because these are internal failures\n  // that cannot be handled by the user. (Also it would create a circular\n  // dependency between the error and assert modules which doesn't work.)\n  throw new Error(message);\n}\n\n/**\n * Fails if the given assertion condition is false, throwing an Error with the\n * given message if it did.\n *\n * Messages are stripped in production builds.\n */\nexport function hardAssert(\n  assertion: boolean,\n  message?: string\n): asserts assertion {\n  if (!assertion) {\n    fail(message);\n  }\n}\n\n/**\n * Fails if the given assertion condition is false, throwing an Error with the\n * given message if it did.\n *\n * The code of callsites invoking this function are stripped out in production\n * builds. Any side-effects of code within the debugAssert() invocation will not\n * happen in this case.\n *\n * @internal\n */\nexport function debugAssert(\n  assertion: boolean,\n  message: string\n): asserts assertion {\n  if (!assertion) {\n    fail(message);\n  }\n}\n\n/**\n * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an\n * instance of `T` before casting.\n */\nexport function debugCast<T>(\n  obj: object,\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  constructor: { new (...args: any[]): T }\n): T | never {\n  debugAssert(\n    obj instanceof constructor,\n    `Expected type '${constructor.name}', but was '${obj.constructor.name}'`\n  );\n  return obj as T;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseError } from '@firebase/util';\n\n/**\n * The set of Firestore status codes. The codes are the same at the ones\n * exposed by gRPC here:\n * https://github.com/grpc/grpc/blob/master/doc/statuscodes.md\n *\n * Possible values:\n * - 'cancelled': The operation was cancelled (typically by the caller).\n * - 'unknown': Unknown error or an error from a different error domain.\n * - 'invalid-argument': Client specified an invalid argument. Note that this\n *   differs from 'failed-precondition'. 'invalid-argument' indicates\n *   arguments that are problematic regardless of the state of the system\n *   (e.g. an invalid field name).\n * - 'deadline-exceeded': Deadline expired before operation could complete.\n *   For operations that change the state of the system, this error may be\n *   returned even if the operation has completed successfully. For example,\n *   a successful response from a server could have been delayed long enough\n *   for the deadline to expire.\n * - 'not-found': Some requested document was not found.\n * - 'already-exists': Some document that we attempted to create already\n *   exists.\n * - 'permission-denied': The caller does not have permission to execute the\n *   specified operation.\n * - 'resource-exhausted': Some resource has been exhausted, perhaps a\n *   per-user quota, or perhaps the entire file system is out of space.\n * - 'failed-precondition': Operation was rejected because the system is not\n *   in a state required for the operation's execution.\n * - 'aborted': The operation was aborted, typically due to a concurrency\n *   issue like transaction aborts, etc.\n * - 'out-of-range': Operation was attempted past the valid range.\n * - 'unimplemented': Operation is not implemented or not supported/enabled.\n * - 'internal': Internal errors. Means some invariants expected by\n *   underlying system has been broken. If you see one of these errors,\n *   something is very broken.\n * - 'unavailable': The service is currently unavailable. This is most likely\n *   a transient condition and may be corrected by retrying with a backoff.\n * - 'data-loss': Unrecoverable data loss or corruption.\n * - 'unauthenticated': The request does not have valid authentication\n *   credentials for the operation.\n */\nexport type FirestoreErrorCode =\n  | 'cancelled'\n  | 'unknown'\n  | 'invalid-argument'\n  | 'deadline-exceeded'\n  | 'not-found'\n  | 'already-exists'\n  | 'permission-denied'\n  | 'resource-exhausted'\n  | 'failed-precondition'\n  | 'aborted'\n  | 'out-of-range'\n  | 'unimplemented'\n  | 'internal'\n  | 'unavailable'\n  | 'data-loss'\n  | 'unauthenticated';\n\n/**\n * Error Codes describing the different ways Firestore can fail. These come\n * directly from GRPC.\n */\nexport type Code = FirestoreErrorCode;\n\nexport const Code = {\n  // Causes are copied from:\n  // https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\n  /** Not an error; returned on success. */\n  OK: 'ok' as FirestoreErrorCode,\n\n  /** The operation was cancelled (typically by the caller). */\n  CANCELLED: 'cancelled' as FirestoreErrorCode,\n\n  /** Unknown error or an error from a different error domain. */\n  UNKNOWN: 'unknown' as FirestoreErrorCode,\n\n  /**\n   * Client specified an invalid argument. Note that this differs from\n   * FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are\n   * problematic regardless of the state of the system (e.g., a malformed file\n   * name).\n   */\n  INVALID_ARGUMENT: 'invalid-argument' as FirestoreErrorCode,\n\n  /**\n   * Deadline expired before operation could complete. For operations that\n   * change the state of the system, this error may be returned even if the\n   * operation has completed successfully. For example, a successful response\n   * from a server could have been delayed long enough for the deadline to\n   * expire.\n   */\n  DEADLINE_EXCEEDED: 'deadline-exceeded' as FirestoreErrorCode,\n\n  /** Some requested entity (e.g., file or directory) was not found. */\n  NOT_FOUND: 'not-found' as FirestoreErrorCode,\n\n  /**\n   * Some entity that we attempted to create (e.g., file or directory) already\n   * exists.\n   */\n  ALREADY_EXISTS: 'already-exists' as FirestoreErrorCode,\n\n  /**\n   * The caller does not have permission to execute the specified operation.\n   * PERMISSION_DENIED must not be used for rejections caused by exhausting\n   * some resource (use RESOURCE_EXHAUSTED instead for those errors).\n   * PERMISSION_DENIED must not be used if the caller can not be identified\n   * (use UNAUTHENTICATED instead for those errors).\n   */\n  PERMISSION_DENIED: 'permission-denied' as FirestoreErrorCode,\n\n  /**\n   * The request does not have valid authentication credentials for the\n   * operation.\n   */\n  UNAUTHENTICATED: 'unauthenticated' as FirestoreErrorCode,\n\n  /**\n   * Some resource has been exhausted, perhaps a per-user quota, or perhaps the\n   * entire file system is out of space.\n   */\n  RESOURCE_EXHAUSTED: 'resource-exhausted' as FirestoreErrorCode,\n\n  /**\n   * Operation was rejected because the system is not in a state required for\n   * the operation's execution. For example, directory to be deleted may be\n   * non-empty, an rmdir operation is applied to a non-directory, etc.\n   *\n   * A litmus test that may help a service implementor in deciding\n   * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:\n   *  (a) Use UNAVAILABLE if the client can retry just the failing call.\n   *  (b) Use ABORTED if the client should retry at a higher-level\n   *      (e.g., restarting a read-modify-write sequence).\n   *  (c) Use FAILED_PRECONDITION if the client should not retry until\n   *      the system state has been explicitly fixed. E.g., if an \"rmdir\"\n   *      fails because the directory is non-empty, FAILED_PRECONDITION\n   *      should be returned since the client should not retry unless\n   *      they have first fixed up the directory by deleting files from it.\n   *  (d) Use FAILED_PRECONDITION if the client performs conditional\n   *      REST Get/Update/Delete on a resource and the resource on the\n   *      server does not match the condition. E.g., conflicting\n   *      read-modify-write on the same resource.\n   */\n  FAILED_PRECONDITION: 'failed-precondition' as FirestoreErrorCode,\n\n  /**\n   * The operation was aborted, typically due to a concurrency issue like\n   * sequencer check failures, transaction aborts, etc.\n   *\n   * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\n   * and UNAVAILABLE.\n   */\n  ABORTED: 'aborted' as FirestoreErrorCode,\n\n  /**\n   * Operation was attempted past the valid range. E.g., seeking or reading\n   * past end of file.\n   *\n   * Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed\n   * if the system state changes. For example, a 32-bit file system will\n   * generate INVALID_ARGUMENT if asked to read at an offset that is not in the\n   * range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from\n   * an offset past the current file size.\n   *\n   * There is a fair bit of overlap between FAILED_PRECONDITION and\n   * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error)\n   * when it applies so that callers who are iterating through a space can\n   * easily look for an OUT_OF_RANGE error to detect when they are done.\n   */\n  OUT_OF_RANGE: 'out-of-range' as FirestoreErrorCode,\n\n  /** Operation is not implemented or not supported/enabled in this service. */\n  UNIMPLEMENTED: 'unimplemented' as FirestoreErrorCode,\n\n  /**\n   * Internal errors. Means some invariants expected by underlying System has\n   * been broken. If you see one of these errors, Something is very broken.\n   */\n  INTERNAL: 'internal' as FirestoreErrorCode,\n\n  /**\n   * The service is currently unavailable. This is a most likely a transient\n   * condition and may be corrected by retrying with a backoff.\n   *\n   * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,\n   * and UNAVAILABLE.\n   */\n  UNAVAILABLE: 'unavailable' as FirestoreErrorCode,\n\n  /** Unrecoverable data loss or corruption. */\n  DATA_LOSS: 'data-loss' as FirestoreErrorCode\n};\n\n/** An error returned by a Firestore operation. */\nexport class FirestoreError extends FirebaseError {\n  /** The stack of the error. */\n  readonly stack?: string;\n\n  /** @hideconstructor */\n  constructor(\n    /**\n     * The backend error code associated with this error.\n     */\n    readonly code: FirestoreErrorCode,\n    /**\n     * A custom error description.\n     */\n    readonly message: string\n  ) {\n    super(code, message);\n\n    // HACK: We write a toString property directly because Error is not a real\n    // class and so inheritance does not work correctly. We could alternatively\n    // do the same \"back-door inheritance\" trick that FirebaseError does.\n    this.toString = () => `${this.name}: [code=${this.code}]: ${this.message}`;\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface Resolver<R> {\n  (value: R | Promise<R>): void;\n}\n\nexport interface Rejecter {\n  (reason?: Error): void;\n}\n\nexport class Deferred<R = void> {\n  promise: Promise<R>;\n  // Assigned synchronously in constructor by Promise constructor callback.\n  resolve!: Resolver<R>;\n  reject!: Rejecter;\n\n  constructor() {\n    this.promise = new Promise((resolve: Resolver<R>, reject: Rejecter) => {\n      this.resolve = resolve;\n      this.reject = reject;\n    });\n  }\n}\n\n/**\n * Takes an array of values and a function from a value to a Promise. The function is run on each\n * value sequentially, waiting for the previous promise to resolve before starting the next one.\n * The returned promise resolves once the function has been run on all values.\n */\nexport function sequence<T>(\n  values: T[],\n  fn: (value: T) => Promise<void>\n): Promise<void> {\n  let p = Promise.resolve();\n  for (const value of values) {\n    p = p.then(() => fn(value));\n  }\n  return p;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  AppCheckInternalComponentName,\n  AppCheckTokenListener,\n  AppCheckTokenResult,\n  FirebaseAppCheckInternal\n} from '@firebase/app-check-interop-types';\nimport {\n  FirebaseAuthInternal,\n  FirebaseAuthInternalName\n} from '@firebase/auth-interop-types';\nimport { Provider } from '@firebase/component';\n\nimport { User } from '../auth/user';\nimport { debugAssert, hardAssert } from '../util/assert';\nimport { AsyncQueue } from '../util/async_queue';\nimport { Code, FirestoreError } from '../util/error';\nimport { logDebug } from '../util/log';\nimport { Deferred } from '../util/promise';\n\n// TODO(mikelehen): This should be split into multiple files and probably\n// moved to an auth/ folder to match other platforms.\n\n/**\n * @internal\n */\nexport type AuthTokenFactory = () => string;\n\n/**\n * @internal\n */\nexport interface FirstPartyCredentialsSettings {\n  // These are external types. Prevent minification.\n  ['type']: 'firstParty';\n  ['sessionIndex']: string;\n  ['iamToken']: string | null;\n  ['authTokenFactory']: AuthTokenFactory | null;\n}\n\nexport interface ProviderCredentialsSettings {\n  // These are external types. Prevent minification.\n  ['type']: 'provider';\n  ['client']: CredentialsProvider<User>;\n}\n\n/** Settings for private credentials */\nexport type CredentialsSettings =\n  | FirstPartyCredentialsSettings\n  | ProviderCredentialsSettings;\n\nexport type TokenType = 'OAuth' | 'FirstParty' | 'AppCheck';\nexport interface Token {\n  /** Type of token. */\n  type: TokenType;\n\n  /**\n   * The user with which the token is associated (used for persisting user\n   * state on disk, etc.).\n   * This will be null for Tokens of the type 'AppCheck'.\n   */\n  user?: User;\n\n  /** Header values to set for this token */\n  headers: Map<string, string>;\n}\n\nexport class OAuthToken implements Token {\n  type = 'OAuth' as TokenType;\n  headers = new Map();\n\n  constructor(value: string, public user: User) {\n    this.headers.set('Authorization', `Bearer ${value}`);\n  }\n}\n\n/**\n * A Listener for credential change events. The listener should fetch a new\n * token and may need to invalidate other state if the current user has also\n * changed.\n */\nexport type CredentialChangeListener<T> = (credential: T) => Promise<void>;\n\n/**\n * Provides methods for getting the uid and token for the current user and\n * listening for changes.\n */\nexport interface CredentialsProvider<T> {\n  /**\n   * Starts the credentials provider and specifies a listener to be notified of\n   * credential changes (sign-in / sign-out, token changes). It is immediately\n   * called once with the initial user.\n   *\n   * The change listener is invoked on the provided AsyncQueue.\n   */\n  start(\n    asyncQueue: AsyncQueue,\n    changeListener: CredentialChangeListener<T>\n  ): void;\n\n  /** Requests a token for the current user. */\n  getToken(): Promise<Token | null>;\n\n  /**\n   * Marks the last retrieved token as invalid, making the next GetToken request\n   * force-refresh the token.\n   */\n  invalidateToken(): void;\n\n  shutdown(): void;\n}\n\n/**\n * A CredentialsProvider that always yields an empty token.\n * @internal\n */\nexport class EmptyAuthCredentialsProvider implements CredentialsProvider<User> {\n  getToken(): Promise<Token | null> {\n    return Promise.resolve<Token | null>(null);\n  }\n\n  invalidateToken(): void {}\n\n  start(\n    asyncQueue: AsyncQueue,\n    changeListener: CredentialChangeListener<User>\n  ): void {\n    // Fire with initial user.\n    asyncQueue.enqueueRetryable(() => changeListener(User.UNAUTHENTICATED));\n  }\n\n  shutdown(): void {}\n}\n\n/**\n * A CredentialsProvider that always returns a constant token. Used for\n * emulator token mocking.\n */\nexport class EmulatorAuthCredentialsProvider\n  implements CredentialsProvider<User>\n{\n  constructor(private token: Token) {}\n\n  /**\n   * Stores the listener registered with setChangeListener()\n   * This isn't actually necessary since the UID never changes, but we use this\n   * to verify the listen contract is adhered to in tests.\n   */\n  private changeListener: CredentialChangeListener<User> | null = null;\n\n  getToken(): Promise<Token | null> {\n    return Promise.resolve(this.token);\n  }\n\n  invalidateToken(): void {}\n\n  start(\n    asyncQueue: AsyncQueue,\n    changeListener: CredentialChangeListener<User>\n  ): void {\n    debugAssert(\n      !this.changeListener,\n      'Can only call setChangeListener() once.'\n    );\n    this.changeListener = changeListener;\n    // Fire with initial user.\n    asyncQueue.enqueueRetryable(() => changeListener(this.token.user!));\n  }\n\n  shutdown(): void {\n    this.changeListener = null;\n  }\n}\n\n/** Credential provider for the Lite SDK. */\nexport class LiteAuthCredentialsProvider implements CredentialsProvider<User> {\n  private auth: FirebaseAuthInternal | null = null;\n\n  constructor(authProvider: Provider<FirebaseAuthInternalName>) {\n    authProvider.onInit(auth => {\n      this.auth = auth;\n    });\n  }\n\n  getToken(): Promise<Token | null> {\n    if (!this.auth) {\n      return Promise.resolve(null);\n    }\n\n    return this.auth.getToken().then(tokenData => {\n      if (tokenData) {\n        hardAssert(\n          typeof tokenData.accessToken === 'string',\n          'Invalid tokenData returned from getToken():' + tokenData\n        );\n        return new OAuthToken(\n          tokenData.accessToken,\n          new User(this.auth!.getUid())\n        );\n      } else {\n        return null;\n      }\n    });\n  }\n\n  invalidateToken(): void {}\n\n  start(\n    asyncQueue: AsyncQueue,\n    changeListener: CredentialChangeListener<User>\n  ): void {}\n\n  shutdown(): void {}\n}\n\nexport class FirebaseAuthCredentialsProvider\n  implements CredentialsProvider<User>\n{\n  /**\n   * The auth token listener registered with FirebaseApp, retained here so we\n   * can unregister it.\n   */\n  private tokenListener!: () => void;\n\n  /** Tracks the current User. */\n  private currentUser: User = User.UNAUTHENTICATED;\n\n  /**\n   * Counter used to detect if the token changed while a getToken request was\n   * outstanding.\n   */\n  private tokenCounter = 0;\n\n  private forceRefresh = false;\n\n  private auth: FirebaseAuthInternal | null = null;\n\n  constructor(private authProvider: Provider<FirebaseAuthInternalName>) {}\n\n  start(\n    asyncQueue: AsyncQueue,\n    changeListener: CredentialChangeListener<User>\n  ): void {\n    let lastTokenId = this.tokenCounter;\n\n    // A change listener that prevents double-firing for the same token change.\n    const guardedChangeListener: (user: User) => Promise<void> = user => {\n      if (this.tokenCounter !== lastTokenId) {\n        lastTokenId = this.tokenCounter;\n        return changeListener(user);\n      } else {\n        return Promise.resolve();\n      }\n    };\n\n    // A promise that can be waited on to block on the next token change.\n    // This promise is re-created after each change.\n    let nextToken = new Deferred<void>();\n\n    this.tokenListener = () => {\n      this.tokenCounter++;\n      this.currentUser = this.getUser();\n      nextToken.resolve();\n      nextToken = new Deferred<void>();\n      asyncQueue.enqueueRetryable(() =>\n        guardedChangeListener(this.currentUser)\n      );\n    };\n\n    const awaitNextToken: () => void = () => {\n      const currentTokenAttempt = nextToken;\n      asyncQueue.enqueueRetryable(async () => {\n        await currentTokenAttempt.promise;\n        await guardedChangeListener(this.currentUser);\n      });\n    };\n\n    const registerAuth = (auth: FirebaseAuthInternal): void => {\n      logDebug('FirebaseAuthCredentialsProvider', 'Auth detected');\n      this.auth = auth;\n      this.auth.addAuthTokenListener(this.tokenListener);\n      awaitNextToken();\n    };\n\n    this.authProvider.onInit(auth => registerAuth(auth));\n\n    // Our users can initialize Auth right after Firestore, so we give it\n    // a chance to register itself with the component framework before we\n    // determine whether to start up in unauthenticated mode.\n    setTimeout(() => {\n      if (!this.auth) {\n        const auth = this.authProvider.getImmediate({ optional: true });\n        if (auth) {\n          registerAuth(auth);\n        } else {\n          // If auth is still not available, proceed with `null` user\n          logDebug('FirebaseAuthCredentialsProvider', 'Auth not yet detected');\n          nextToken.resolve();\n          nextToken = new Deferred<void>();\n        }\n      }\n    }, 0);\n\n    awaitNextToken();\n  }\n\n  getToken(): Promise<Token | null> {\n    debugAssert(\n      this.tokenListener != null,\n      'FirebaseAuthCredentialsProvider not started.'\n    );\n\n    // Take note of the current value of the tokenCounter so that this method\n    // can fail (with an ABORTED error) if there is a token change while the\n    // request is outstanding.\n    const initialTokenCounter = this.tokenCounter;\n    const forceRefresh = this.forceRefresh;\n    this.forceRefresh = false;\n\n    if (!this.auth) {\n      return Promise.resolve(null);\n    }\n\n    return this.auth.getToken(forceRefresh).then(tokenData => {\n      // Cancel the request since the token changed while the request was\n      // outstanding so the response is potentially for a previous user (which\n      // user, we can't be sure).\n      if (this.tokenCounter !== initialTokenCounter) {\n        logDebug(\n          'FirebaseAuthCredentialsProvider',\n          'getToken aborted due to token change.'\n        );\n        return this.getToken();\n      } else {\n        if (tokenData) {\n          hardAssert(\n            typeof tokenData.accessToken === 'string',\n            'Invalid tokenData returned from getToken():' + tokenData\n          );\n          return new OAuthToken(tokenData.accessToken, this.currentUser);\n        } else {\n          return null;\n        }\n      }\n    });\n  }\n\n  invalidateToken(): void {\n    this.forceRefresh = true;\n  }\n\n  shutdown(): void {\n    if (this.auth) {\n      this.auth.removeAuthTokenListener(this.tokenListener!);\n    }\n  }\n\n  // Auth.getUid() can return null even with a user logged in. It is because\n  // getUid() is synchronous, but the auth code populating Uid is asynchronous.\n  // This method should only be called in the AuthTokenListener callback\n  // to guarantee to get the actual user.\n  private getUser(): User {\n    const currentUid = this.auth && this.auth.getUid();\n    hardAssert(\n      currentUid === null || typeof currentUid === 'string',\n      'Received invalid UID: ' + currentUid\n    );\n    return new User(currentUid);\n  }\n}\n\n/*\n * FirstPartyToken provides a fresh token each time its value\n * is requested, because if the token is too old, requests will be rejected.\n * Technically this may no longer be necessary since the SDK should gracefully\n * recover from unauthenticated errors (see b/33147818 for context), but it's\n * safer to keep the implementation as-is.\n */\nexport class FirstPartyToken implements Token {\n  type = 'FirstParty' as TokenType;\n  user = User.FIRST_PARTY;\n  private _headers = new Map();\n\n  constructor(\n    private readonly sessionIndex: string,\n    private readonly iamToken: string | null,\n    private readonly authTokenFactory: AuthTokenFactory | null\n  ) {}\n\n  /**\n   * Gets an authorization token, using a provided factory function, or return\n   * null.\n   */\n  private getAuthToken(): string | null {\n    if (this.authTokenFactory) {\n      return this.authTokenFactory();\n    } else {\n      return null;\n    }\n  }\n\n  get headers(): Map<string, string> {\n    this._headers.set('X-Goog-AuthUser', this.sessionIndex);\n    // Use array notation to prevent minification\n    const authHeaderTokenValue = this.getAuthToken();\n    if (authHeaderTokenValue) {\n      this._headers.set('Authorization', authHeaderTokenValue);\n    }\n    if (this.iamToken) {\n      this._headers.set('X-Goog-Iam-Authorization-Token', this.iamToken);\n    }\n\n    return this._headers;\n  }\n}\n\n/*\n * Provides user credentials required for the Firestore JavaScript SDK\n * to authenticate the user, using technique that is only available\n * to applications hosted by Google.\n */\nexport class FirstPartyAuthCredentialsProvider\n  implements CredentialsProvider<User>\n{\n  constructor(\n    private sessionIndex: string,\n    private iamToken: string | null,\n    private authTokenFactory: AuthTokenFactory | null\n  ) {}\n\n  getToken(): Promise<Token | null> {\n    return Promise.resolve(\n      new FirstPartyToken(\n        this.sessionIndex,\n        this.iamToken,\n        this.authTokenFactory\n      )\n    );\n  }\n\n  start(\n    asyncQueue: AsyncQueue,\n    changeListener: CredentialChangeListener<User>\n  ): void {\n    // Fire with initial uid.\n    asyncQueue.enqueueRetryable(() => changeListener(User.FIRST_PARTY));\n  }\n\n  shutdown(): void {}\n\n  invalidateToken(): void {}\n}\n\nexport class AppCheckToken implements Token {\n  type = 'AppCheck' as TokenType;\n  headers = new Map();\n\n  constructor(private value: string) {\n    if (value && value.length > 0) {\n      this.headers.set('x-firebase-appcheck', this.value);\n    }\n  }\n}\n\nexport class FirebaseAppCheckTokenProvider\n  implements CredentialsProvider<string>\n{\n  /**\n   * The AppCheck token listener registered with FirebaseApp, retained here so\n   * we can unregister it.\n   */\n  private tokenListener!: AppCheckTokenListener;\n  private forceRefresh = false;\n  private appCheck: FirebaseAppCheckInternal | null = null;\n  private latestAppCheckToken: string | null = null;\n\n  constructor(\n    private appCheckProvider: Provider<AppCheckInternalComponentName>\n  ) {}\n\n  start(\n    asyncQueue: AsyncQueue,\n    changeListener: CredentialChangeListener<string>\n  ): void {\n    const onTokenChanged: (\n      tokenResult: AppCheckTokenResult\n    ) => Promise<void> = tokenResult => {\n      if (tokenResult.error != null) {\n        logDebug(\n          'FirebaseAppCheckTokenProvider',\n          `Error getting App Check token; using placeholder token instead. Error: ${tokenResult.error.message}`\n        );\n      }\n      const tokenUpdated = tokenResult.token !== this.latestAppCheckToken;\n      this.latestAppCheckToken = tokenResult.token;\n      logDebug(\n        'FirebaseAppCheckTokenProvider',\n        `Received ${tokenUpdated ? 'new' : 'existing'} token.`\n      );\n      return tokenUpdated\n        ? changeListener(tokenResult.token)\n        : Promise.resolve();\n    };\n\n    this.tokenListener = (tokenResult: AppCheckTokenResult) => {\n      asyncQueue.enqueueRetryable(() => onTokenChanged(tokenResult));\n    };\n\n    const registerAppCheck = (appCheck: FirebaseAppCheckInternal): void => {\n      logDebug('FirebaseAppCheckTokenProvider', 'AppCheck detected');\n      this.appCheck = appCheck;\n      this.appCheck.addTokenListener(this.tokenListener);\n    };\n\n    this.appCheckProvider.onInit(appCheck => registerAppCheck(appCheck));\n\n    // Our users can initialize AppCheck after Firestore, so we give it\n    // a chance to register itself with the component framework.\n    setTimeout(() => {\n      if (!this.appCheck) {\n        const appCheck = this.appCheckProvider.getImmediate({ optional: true });\n        if (appCheck) {\n          registerAppCheck(appCheck);\n        } else {\n          // If AppCheck is still not available, proceed without it.\n          logDebug(\n            'FirebaseAppCheckTokenProvider',\n            'AppCheck not yet detected'\n          );\n        }\n      }\n    }, 0);\n  }\n\n  getToken(): Promise<Token | null> {\n    debugAssert(\n      this.tokenListener != null,\n      'FirebaseAppCheckTokenProvider not started.'\n    );\n\n    const forceRefresh = this.forceRefresh;\n    this.forceRefresh = false;\n\n    if (!this.appCheck) {\n      return Promise.resolve(null);\n    }\n\n    return this.appCheck.getToken(forceRefresh).then(tokenResult => {\n      if (tokenResult) {\n        hardAssert(\n          typeof tokenResult.token === 'string',\n          'Invalid tokenResult returned from getToken():' + tokenResult\n        );\n        this.latestAppCheckToken = tokenResult.token;\n        return new AppCheckToken(tokenResult.token);\n      } else {\n        return null;\n      }\n    });\n  }\n\n  invalidateToken(): void {\n    this.forceRefresh = true;\n  }\n\n  shutdown(): void {\n    if (this.appCheck) {\n      this.appCheck.removeTokenListener(this.tokenListener!);\n    }\n  }\n}\n\n/**\n * An AppCheck token provider that always yields an empty token.\n * @internal\n */\nexport class EmptyAppCheckTokenProvider implements CredentialsProvider<string> {\n  getToken(): Promise<Token | null> {\n    return Promise.resolve<Token | null>(new AppCheckToken(''));\n  }\n\n  invalidateToken(): void {}\n\n  start(\n    asyncQueue: AsyncQueue,\n    changeListener: CredentialChangeListener<string>\n  ): void {}\n\n  shutdown(): void {}\n}\n\n/** AppCheck token provider for the Lite SDK. */\nexport class LiteAppCheckTokenProvider implements CredentialsProvider<string> {\n  private appCheck: FirebaseAppCheckInternal | null = null;\n\n  constructor(\n    private appCheckProvider: Provider<AppCheckInternalComponentName>\n  ) {\n    appCheckProvider.onInit(appCheck => {\n      this.appCheck = appCheck;\n    });\n  }\n\n  getToken(): Promise<Token | null> {\n    if (!this.appCheck) {\n      return Promise.resolve(null);\n    }\n\n    return this.appCheck.getToken().then(tokenResult => {\n      if (tokenResult) {\n        hardAssert(\n          typeof tokenResult.token === 'string',\n          'Invalid tokenResult returned from getToken():' + tokenResult\n        );\n        return new AppCheckToken(tokenResult.token);\n      } else {\n        return null;\n      }\n    });\n  }\n\n  invalidateToken(): void {}\n\n  start(\n    asyncQueue: AsyncQueue,\n    changeListener: CredentialChangeListener<string>\n  ): void {}\n\n  shutdown(): void {}\n}\n\n/**\n * Builds a CredentialsProvider depending on the type of\n * the credentials passed in.\n */\nexport function makeAuthCredentialsProvider(\n  credentials?: CredentialsSettings\n): CredentialsProvider<User> {\n  if (!credentials) {\n    return new EmptyAuthCredentialsProvider();\n  }\n  switch (credentials['type']) {\n    case 'firstParty':\n      return new FirstPartyAuthCredentialsProvider(\n        credentials['sessionIndex'] || '0',\n        credentials['iamToken'] || null,\n        credentials['authTokenFactory'] || null\n      );\n\n    case 'provider':\n      return credentials['client'];\n\n    default:\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        'makeAuthCredentialsProvider failed due to invalid credential type'\n      );\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { debugAssert } from '../../util/assert';\n\n/**\n * Generates `nBytes` of random bytes.\n *\n * If `nBytes < 0` , an error will be thrown.\n */\nexport function randomBytes(nBytes: number): Uint8Array {\n  debugAssert(nBytes >= 0, `Expecting non-negative nBytes, got: ${nBytes}`);\n\n  // Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.\n  const crypto =\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    typeof self !== 'undefined' && (self.crypto || (self as any)['msCrypto']);\n  const bytes = new Uint8Array(nBytes);\n  if (crypto && typeof crypto.getRandomValues === 'function') {\n    crypto.getRandomValues(bytes);\n  } else {\n    // Falls back to Math.random\n    for (let i = 0; i < nBytes; i++) {\n      bytes[i] = Math.floor(Math.random() * 256);\n    }\n  }\n  return bytes;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { randomBytes } from '../platform/random_bytes';\n\nimport { debugAssert } from './assert';\n\nexport type EventHandler<E> = (value: E) => void;\nexport interface Indexable {\n  [k: string]: unknown;\n}\n\n/**\n * A utility class for generating unique alphanumeric IDs of a specified length.\n *\n * @internal\n * Exported internally for testing purposes.\n */\nexport class AutoId {\n  static newId(): string {\n    // Alphanumeric characters\n    const chars =\n      'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n    // The largest byte value that is a multiple of `char.length`.\n    const maxMultiple = Math.floor(256 / chars.length) * chars.length;\n    debugAssert(\n      0 < maxMultiple && maxMultiple < 256,\n      `Expect maxMultiple to be (0, 256), but got ${maxMultiple}`\n    );\n\n    let autoId = '';\n    const targetLength = 20;\n    while (autoId.length < targetLength) {\n      const bytes = randomBytes(40);\n      for (let i = 0; i < bytes.length; ++i) {\n        // Only accept values that are [0, maxMultiple), this ensures they can\n        // be evenly mapped to indices of `chars` via a modulo operation.\n        if (autoId.length < targetLength && bytes[i] < maxMultiple) {\n          autoId += chars.charAt(bytes[i] % chars.length);\n        }\n      }\n    }\n    debugAssert(autoId.length === targetLength, 'Invalid auto ID: ' + autoId);\n\n    return autoId;\n  }\n}\n\nexport function primitiveComparator<T>(left: T, right: T): number {\n  if (left < right) {\n    return -1;\n  }\n  if (left > right) {\n    return 1;\n  }\n  return 0;\n}\n\nexport interface Equatable<T> {\n  isEqual(other: T): boolean;\n}\n\nexport interface Iterable<V> {\n  forEach: (cb: (v: V) => void) => void;\n}\n\n/** Helper to compare arrays using isEqual(). */\nexport function arrayEquals<T>(\n  left: T[],\n  right: T[],\n  comparator: (l: T, r: T) => boolean\n): boolean {\n  if (left.length !== right.length) {\n    return false;\n  }\n  return left.every((value, index) => comparator(value, right[index]));\n}\n/**\n * Returns the immediate lexicographically-following string. This is useful to\n * construct an inclusive range for indexeddb iterators.\n */\nexport function immediateSuccessor(s: string): string {\n  // Return the input string, with an additional NUL byte appended.\n  return s + '\\0';\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Code, FirestoreError } from '../util/error';\nimport { primitiveComparator } from '../util/misc';\n\n// The earliest date supported by Firestore timestamps (0001-01-01T00:00:00Z).\nconst MIN_SECONDS = -62135596800;\n\n// Number of nanoseconds in a millisecond.\nconst MS_TO_NANOS = 1e6;\n\n/**\n * A `Timestamp` represents a point in time independent of any time zone or\n * calendar, represented as seconds and fractions of seconds at nanosecond\n * resolution in UTC Epoch time.\n *\n * It is encoded using the Proleptic Gregorian Calendar which extends the\n * Gregorian calendar backwards to year one. It is encoded assuming all minutes\n * are 60 seconds long, i.e. leap seconds are \"smeared\" so that no leap second\n * table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to\n * 9999-12-31T23:59:59.999999999Z.\n *\n * For examples and further specifications, refer to the\n * {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.\n */\nexport class Timestamp {\n  /**\n   * Creates a new timestamp with the current date, with millisecond precision.\n   *\n   * @returns a new timestamp representing the current date.\n   */\n  static now(): Timestamp {\n    return Timestamp.fromMillis(Date.now());\n  }\n\n  /**\n   * Creates a new timestamp from the given date.\n   *\n   * @param date - The date to initialize the `Timestamp` from.\n   * @returns A new `Timestamp` representing the same point in time as the given\n   *     date.\n   */\n  static fromDate(date: Date): Timestamp {\n    return Timestamp.fromMillis(date.getTime());\n  }\n\n  /**\n   * Creates a new timestamp from the given number of milliseconds.\n   *\n   * @param milliseconds - Number of milliseconds since Unix epoch\n   *     1970-01-01T00:00:00Z.\n   * @returns A new `Timestamp` representing the same point in time as the given\n   *     number of milliseconds.\n   */\n  static fromMillis(milliseconds: number): Timestamp {\n    const seconds = Math.floor(milliseconds / 1000);\n    const nanos = Math.floor((milliseconds - seconds * 1000) * MS_TO_NANOS);\n    return new Timestamp(seconds, nanos);\n  }\n\n  /**\n   * Creates a new timestamp.\n   *\n   * @param seconds - The number of seconds of UTC time since Unix epoch\n   *     1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n   *     9999-12-31T23:59:59Z inclusive.\n   * @param nanoseconds - The non-negative fractions of a second at nanosecond\n   *     resolution. Negative second values with fractions must still have\n   *     non-negative nanoseconds values that count forward in time. Must be\n   *     from 0 to 999,999,999 inclusive.\n   */\n  constructor(\n    /**\n     * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.\n     */\n    readonly seconds: number,\n    /**\n     * The fractions of a second at nanosecond resolution.*\n     */\n    readonly nanoseconds: number\n  ) {\n    if (nanoseconds < 0) {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        'Timestamp nanoseconds out of range: ' + nanoseconds\n      );\n    }\n    if (nanoseconds >= 1e9) {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        'Timestamp nanoseconds out of range: ' + nanoseconds\n      );\n    }\n    if (seconds < MIN_SECONDS) {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        'Timestamp seconds out of range: ' + seconds\n      );\n    }\n    // This will break in the year 10,000.\n    if (seconds >= 253402300800) {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        'Timestamp seconds out of range: ' + seconds\n      );\n    }\n  }\n\n  /**\n   * Converts a `Timestamp` to a JavaScript `Date` object. This conversion\n   * causes a loss of precision since `Date` objects only support millisecond\n   * precision.\n   *\n   * @returns JavaScript `Date` object representing the same point in time as\n   *     this `Timestamp`, with millisecond precision.\n   */\n  toDate(): Date {\n    return new Date(this.toMillis());\n  }\n\n  /**\n   * Converts a `Timestamp` to a numeric timestamp (in milliseconds since\n   * epoch). This operation causes a loss of precision.\n   *\n   * @returns The point in time corresponding to this timestamp, represented as\n   *     the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z.\n   */\n  toMillis(): number {\n    return this.seconds * 1000 + this.nanoseconds / MS_TO_NANOS;\n  }\n\n  _compareTo(other: Timestamp): number {\n    if (this.seconds === other.seconds) {\n      return primitiveComparator(this.nanoseconds, other.nanoseconds);\n    }\n    return primitiveComparator(this.seconds, other.seconds);\n  }\n\n  /**\n   * Returns true if this `Timestamp` is equal to the provided one.\n   *\n   * @param other - The `Timestamp` to compare against.\n   * @returns true if this `Timestamp` is equal to the provided one.\n   */\n  isEqual(other: Timestamp): boolean {\n    return (\n      other.seconds === this.seconds && other.nanoseconds === this.nanoseconds\n    );\n  }\n\n  /** Returns a textual representation of this `Timestamp`. */\n  toString(): string {\n    return (\n      'Timestamp(seconds=' +\n      this.seconds +\n      ', nanoseconds=' +\n      this.nanoseconds +\n      ')'\n    );\n  }\n\n  /** Returns a JSON-serializable representation of this `Timestamp`. */\n  toJSON(): { seconds: number; nanoseconds: number } {\n    return { seconds: this.seconds, nanoseconds: this.nanoseconds };\n  }\n\n  /**\n   * Converts this object to a primitive string, which allows `Timestamp` objects\n   * to be compared using the `>`, `<=`, `>=` and `>` operators.\n   */\n  valueOf(): string {\n    // This method returns a string of the form <seconds>.<nanoseconds> where\n    // <seconds> is translated to have a non-negative value and both <seconds>\n    // and <nanoseconds> are left-padded with zeroes to be a consistent length.\n    // Strings with this format then have a lexiographical ordering that matches\n    // the expected ordering. The <seconds> translation is done to avoid having\n    // a leading negative sign (i.e. a leading '-' character) in its string\n    // representation, which would affect its lexiographical ordering.\n    const adjustedSeconds = this.seconds - MIN_SECONDS;\n    // Note: Up to 12 decimal digits are required to represent all valid\n    // 'seconds' values.\n    const formattedSeconds = String(adjustedSeconds).padStart(12, '0');\n    const formattedNanoseconds = String(this.nanoseconds).padStart(9, '0');\n    return formattedSeconds + '.' + formattedNanoseconds;\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Timestamp } from '../lite-api/timestamp';\n\n/**\n * A version of a document in Firestore. This corresponds to the version\n * timestamp, such as update_time or read_time.\n */\nexport class SnapshotVersion {\n  static fromTimestamp(value: Timestamp): SnapshotVersion {\n    return new SnapshotVersion(value);\n  }\n\n  static min(): SnapshotVersion {\n    return new SnapshotVersion(new Timestamp(0, 0));\n  }\n\n  static max(): SnapshotVersion {\n    return new SnapshotVersion(new Timestamp(253402300799, 1e9 - 1));\n  }\n\n  private constructor(private timestamp: Timestamp) {}\n\n  compareTo(other: SnapshotVersion): number {\n    return this.timestamp._compareTo(other.timestamp);\n  }\n\n  isEqual(other: SnapshotVersion): boolean {\n    return this.timestamp.isEqual(other.timestamp);\n  }\n\n  /** Returns a number representation of the version for use in spec tests. */\n  toMicroseconds(): number {\n    // Convert to microseconds.\n    return this.timestamp.seconds * 1e6 + this.timestamp.nanoseconds / 1000;\n  }\n\n  toString(): string {\n    return 'SnapshotVersion(' + this.timestamp.toString() + ')';\n  }\n\n  toTimestamp(): Timestamp {\n    return this.timestamp;\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { debugAssert, fail } from '../util/assert';\nimport { Code, FirestoreError } from '../util/error';\n\nexport const DOCUMENT_KEY_NAME = '__name__';\n\n/**\n * Path represents an ordered sequence of string segments.\n */\nabstract class BasePath<B extends BasePath<B>> {\n  private segments: string[];\n  private offset: number;\n  private len: number;\n\n  constructor(segments: string[], offset?: number, length?: number) {\n    if (offset === undefined) {\n      offset = 0;\n    } else if (offset > segments.length) {\n      fail('offset ' + offset + ' out of range ' + segments.length);\n    }\n\n    if (length === undefined) {\n      length = segments.length - offset;\n    } else if (length > segments.length - offset) {\n      fail('length ' + length + ' out of range ' + (segments.length - offset));\n    }\n    this.segments = segments;\n    this.offset = offset;\n    this.len = length;\n  }\n\n  /**\n   * Abstract constructor method to construct an instance of B with the given\n   * parameters.\n   */\n  protected abstract construct(\n    segments: string[],\n    offset?: number,\n    length?: number\n  ): B;\n\n  /**\n   * Returns a String representation.\n   *\n   * Implementing classes are required to provide deterministic implementations as\n   * the String representation is used to obtain canonical Query IDs.\n   */\n  abstract toString(): string;\n\n  get length(): number {\n    return this.len;\n  }\n\n  isEqual(other: B): boolean {\n    return BasePath.comparator(this, other) === 0;\n  }\n\n  child(nameOrPath: string | B): B {\n    const segments = this.segments.slice(this.offset, this.limit());\n    if (nameOrPath instanceof BasePath) {\n      nameOrPath.forEach(segment => {\n        segments.push(segment);\n      });\n    } else {\n      segments.push(nameOrPath);\n    }\n    return this.construct(segments);\n  }\n\n  /** The index of one past the last segment of the path. */\n  private limit(): number {\n    return this.offset + this.length;\n  }\n\n  popFirst(size?: number): B {\n    size = size === undefined ? 1 : size;\n    debugAssert(\n      this.length >= size,\n      \"Can't call popFirst() with less segments\"\n    );\n    return this.construct(\n      this.segments,\n      this.offset + size,\n      this.length - size\n    );\n  }\n\n  popLast(): B {\n    debugAssert(!this.isEmpty(), \"Can't call popLast() on empty path\");\n    return this.construct(this.segments, this.offset, this.length - 1);\n  }\n\n  firstSegment(): string {\n    debugAssert(!this.isEmpty(), \"Can't call firstSegment() on empty path\");\n    return this.segments[this.offset];\n  }\n\n  lastSegment(): string {\n    debugAssert(!this.isEmpty(), \"Can't call lastSegment() on empty path\");\n    return this.get(this.length - 1);\n  }\n\n  get(index: number): string {\n    debugAssert(index < this.length, 'Index out of range');\n    return this.segments[this.offset + index];\n  }\n\n  isEmpty(): boolean {\n    return this.length === 0;\n  }\n\n  isPrefixOf(other: this): boolean {\n    if (other.length < this.length) {\n      return false;\n    }\n\n    for (let i = 0; i < this.length; i++) {\n      if (this.get(i) !== other.get(i)) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  isImmediateParentOf(potentialChild: this): boolean {\n    if (this.length + 1 !== potentialChild.length) {\n      return false;\n    }\n\n    for (let i = 0; i < this.length; i++) {\n      if (this.get(i) !== potentialChild.get(i)) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  forEach(fn: (segment: string) => void): void {\n    for (let i = this.offset, end = this.limit(); i < end; i++) {\n      fn(this.segments[i]);\n    }\n  }\n\n  toArray(): string[] {\n    return this.segments.slice(this.offset, this.limit());\n  }\n\n  static comparator<T extends BasePath<T>>(\n    p1: BasePath<T>,\n    p2: BasePath<T>\n  ): number {\n    const len = Math.min(p1.length, p2.length);\n    for (let i = 0; i < len; i++) {\n      const left = p1.get(i);\n      const right = p2.get(i);\n      if (left < right) {\n        return -1;\n      }\n      if (left > right) {\n        return 1;\n      }\n    }\n    if (p1.length < p2.length) {\n      return -1;\n    }\n    if (p1.length > p2.length) {\n      return 1;\n    }\n    return 0;\n  }\n}\n\n/**\n * A slash-separated path for navigating resources (documents and collections)\n * within Firestore.\n *\n * @internal\n */\nexport class ResourcePath extends BasePath<ResourcePath> {\n  protected construct(\n    segments: string[],\n    offset?: number,\n    length?: number\n  ): ResourcePath {\n    return new ResourcePath(segments, offset, length);\n  }\n\n  canonicalString(): string {\n    // NOTE: The client is ignorant of any path segments containing escape\n    // sequences (e.g. __id123__) and just passes them through raw (they exist\n    // for legacy reasons and should not be used frequently).\n\n    return this.toArray().join('/');\n  }\n\n  toString(): string {\n    return this.canonicalString();\n  }\n\n  /**\n   * Returns a string representation of this path\n   * where each path segment has been encoded with\n   * `encodeURIComponent`.\n   */\n  toUriEncodedString(): string {\n    return this.toArray().map(encodeURIComponent).join('/');\n  }\n\n  /**\n   * Creates a resource path from the given slash-delimited string. If multiple\n   * arguments are provided, all components are combined. Leading and trailing\n   * slashes from all components are ignored.\n   */\n  static fromString(...pathComponents: string[]): ResourcePath {\n    // NOTE: The client is ignorant of any path segments containing escape\n    // sequences (e.g. __id123__) and just passes them through raw (they exist\n    // for legacy reasons and should not be used frequently).\n\n    const segments: string[] = [];\n    for (const path of pathComponents) {\n      if (path.indexOf('//') >= 0) {\n        throw new FirestoreError(\n          Code.INVALID_ARGUMENT,\n          `Invalid segment (${path}). Paths must not contain // in them.`\n        );\n      }\n      // Strip leading and traling slashed.\n      segments.push(...path.split('/').filter(segment => segment.length > 0));\n    }\n\n    return new ResourcePath(segments);\n  }\n\n  static emptyPath(): ResourcePath {\n    return new ResourcePath([]);\n  }\n}\n\nconst identifierRegExp = /^[_a-zA-Z][_a-zA-Z0-9]*$/;\n\n/**\n * A dot-separated path for navigating sub-objects within a document.\n * @internal\n */\nexport class FieldPath extends BasePath<FieldPath> {\n  protected construct(\n    segments: string[],\n    offset?: number,\n    length?: number\n  ): FieldPath {\n    return new FieldPath(segments, offset, length);\n  }\n\n  /**\n   * Returns true if the string could be used as a segment in a field path\n   * without escaping.\n   */\n  private static isValidIdentifier(segment: string): boolean {\n    return identifierRegExp.test(segment);\n  }\n\n  canonicalString(): string {\n    return this.toArray()\n      .map(str => {\n        str = str.replace(/\\\\/g, '\\\\\\\\').replace(/`/g, '\\\\`');\n        if (!FieldPath.isValidIdentifier(str)) {\n          str = '`' + str + '`';\n        }\n        return str;\n      })\n      .join('.');\n  }\n\n  toString(): string {\n    return this.canonicalString();\n  }\n\n  /**\n   * Returns true if this field references the key of a document.\n   */\n  isKeyField(): boolean {\n    return this.length === 1 && this.get(0) === DOCUMENT_KEY_NAME;\n  }\n\n  /**\n   * The field designating the key of a document.\n   */\n  static keyField(): FieldPath {\n    return new FieldPath([DOCUMENT_KEY_NAME]);\n  }\n\n  /**\n   * Parses a field string from the given server-formatted string.\n   *\n   * - Splitting the empty string is not allowed (for now at least).\n   * - Empty segments within the string (e.g. if there are two consecutive\n   *   separators) are not allowed.\n   *\n   * TODO(b/37244157): we should make this more strict. Right now, it allows\n   * non-identifier path components, even if they aren't escaped.\n   */\n  static fromServerFormat(path: string): FieldPath {\n    const segments: string[] = [];\n    let current = '';\n    let i = 0;\n\n    const addCurrentSegment = (): void => {\n      if (current.length === 0) {\n        throw new FirestoreError(\n          Code.INVALID_ARGUMENT,\n          `Invalid field path (${path}). Paths must not be empty, begin ` +\n            `with '.', end with '.', or contain '..'`\n        );\n      }\n      segments.push(current);\n      current = '';\n    };\n\n    let inBackticks = false;\n\n    while (i < path.length) {\n      const c = path[i];\n      if (c === '\\\\') {\n        if (i + 1 === path.length) {\n          throw new FirestoreError(\n            Code.INVALID_ARGUMENT,\n            'Path has trailing escape character: ' + path\n          );\n        }\n        const next = path[i + 1];\n        if (!(next === '\\\\' || next === '.' || next === '`')) {\n          throw new FirestoreError(\n            Code.INVALID_ARGUMENT,\n            'Path has invalid escape sequence: ' + path\n          );\n        }\n        current += next;\n        i += 2;\n      } else if (c === '`') {\n        inBackticks = !inBackticks;\n        i++;\n      } else if (c === '.' && !inBackticks) {\n        addCurrentSegment();\n        i++;\n      } else {\n        current += c;\n        i++;\n      }\n    }\n    addCurrentSegment();\n\n    if (inBackticks) {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        'Unterminated ` in path: ' + path\n      );\n    }\n\n    return new FieldPath(segments);\n  }\n\n  static emptyPath(): FieldPath {\n    return new FieldPath([]);\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { debugAssert } from '../util/assert';\n\nimport { ResourcePath } from './path';\n\n/**\n * @internal\n */\nexport class DocumentKey {\n  constructor(readonly path: ResourcePath) {\n    debugAssert(\n      DocumentKey.isDocumentKey(path),\n      'Invalid DocumentKey with an odd number of segments: ' +\n        path.toArray().join('/')\n    );\n  }\n\n  static fromPath(path: string): DocumentKey {\n    return new DocumentKey(ResourcePath.fromString(path));\n  }\n\n  static fromName(name: string): DocumentKey {\n    return new DocumentKey(ResourcePath.fromString(name).popFirst(5));\n  }\n\n  static empty(): DocumentKey {\n    return new DocumentKey(ResourcePath.emptyPath());\n  }\n\n  get collectionGroup(): string {\n    debugAssert(\n      !this.path.isEmpty(),\n      'Cannot get collection group for empty key'\n    );\n    return this.path.popLast().lastSegment();\n  }\n\n  /** Returns true if the document is in the specified collectionId. */\n  hasCollectionId(collectionId: string): boolean {\n    return (\n      this.path.length >= 2 &&\n      this.path.get(this.path.length - 2) === collectionId\n    );\n  }\n\n  /** Returns the collection group (i.e. the name of the parent collection) for this key. */\n  getCollectionGroup(): string {\n    debugAssert(\n      !this.path.isEmpty(),\n      'Cannot get collection group for empty key'\n    );\n    return this.path.get(this.path.length - 2);\n  }\n\n  /** Returns the fully qualified path to the parent collection. */\n  getCollectionPath(): ResourcePath {\n    return this.path.popLast();\n  }\n\n  isEqual(other: DocumentKey | null): boolean {\n    return (\n      other !== null && ResourcePath.comparator(this.path, other.path) === 0\n    );\n  }\n\n  toString(): string {\n    return this.path.toString();\n  }\n\n  static comparator(k1: DocumentKey, k2: DocumentKey): number {\n    return ResourcePath.comparator(k1.path, k2.path);\n  }\n\n  static isDocumentKey(path: ResourcePath): boolean {\n    return path.length % 2 === 0;\n  }\n\n  /**\n   * Creates and returns a new document key with the given segments.\n   *\n   * @param segments - The segments of the path to the document\n   * @returns A new instance of DocumentKey\n   */\n  static fromSegments(segments: string[]): DocumentKey {\n    return new DocumentKey(new ResourcePath(segments.slice()));\n  }\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport { Timestamp } from '../lite-api/timestamp';\nimport { primitiveComparator } from '../util/misc';\n\nimport { Document } from './document';\nimport { DocumentKey } from './document_key';\nimport { FieldPath } from './path';\n\n/**\n * The initial mutation batch id for each index. Gets updated during index\n * backfill.\n */\nexport const INITIAL_LARGEST_BATCH_ID = -1;\n\n/**\n * The initial sequence number for each index. Gets updated during index\n * backfill.\n */\nexport const INITIAL_SEQUENCE_NUMBER = 0;\n\n/**\n * An index definition for field indexes in Firestore.\n *\n * Every index is associated with a collection. The definition contains a list\n * of fields and their index kind (which can be `ASCENDING`, `DESCENDING` or\n * `CONTAINS` for ArrayContains/ArrayContainsAny queries).\n *\n * Unlike the backend, the SDK does not differentiate between collection or\n * collection group-scoped indices. Every index can be used for both single\n * collection and collection group queries.\n */\nexport class FieldIndex {\n  /** An ID for an index that has not yet been added to persistence.  */\n  static UNKNOWN_ID = -1;\n\n  constructor(\n    /**\n     * The index ID. Returns -1 if the index ID is not available (e.g. the index\n     * has not yet been persisted).\n     */\n    readonly indexId: number,\n    /** The collection ID this index applies to. */\n    readonly collectionGroup: string,\n    /** The field segments for this index. */\n    readonly fields: IndexSegment[],\n    /** Shows how up-to-date the index is for the current user. */\n    readonly indexState: IndexState\n  ) {}\n}\n\n/** Returns the ArrayContains/ArrayContainsAny segment for this index. */\nexport function fieldIndexGetArraySegment(\n  fieldIndex: FieldIndex\n): IndexSegment | undefined {\n  return fieldIndex.fields.find(s => s.kind === IndexKind.CONTAINS);\n}\n\n/** Returns all directional (ascending/descending) segments for this index. */\nexport function fieldIndexGetDirectionalSegments(\n  fieldIndex: FieldIndex\n): IndexSegment[] {\n  return fieldIndex.fields.filter(s => s.kind !== IndexKind.CONTAINS);\n}\n\n/**\n * Returns the order of the document key component for the given index.\n *\n * PORTING NOTE: This is only used in the Web IndexedDb implementation.\n */\nexport function fieldIndexGetKeyOrder(fieldIndex: FieldIndex): IndexKind {\n  const directionalSegments = fieldIndexGetDirectionalSegments(fieldIndex);\n  return directionalSegments.length === 0\n    ? IndexKind.ASCENDING\n    : directionalSegments[directionalSegments.length - 1].kind;\n}\n\n/**\n * Compares indexes by collection group and segments. Ignores update time and\n * index ID.\n */\nexport function fieldIndexSemanticComparator(\n  left: FieldIndex,\n  right: FieldIndex\n): number {\n  let cmp = primitiveComparator(left.collectionGroup, right.collectionGroup);\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  for (let i = 0; i < Math.min(left.fields.length, right.fields.length); ++i) {\n    cmp = indexSegmentComparator(left.fields[i], right.fields[i]);\n    if (cmp !== 0) {\n      return cmp;\n    }\n  }\n  return primitiveComparator(left.fields.length, right.fields.length);\n}\n\n/** Returns a debug representation of the field index */\nexport function fieldIndexToString(fieldIndex: FieldIndex): string {\n  return `id=${fieldIndex.indexId}|cg=${\n    fieldIndex.collectionGroup\n  }|f=${fieldIndex.fields.map(f => `${f.fieldPath}:${f.kind}`).join(',')}`;\n}\n\n/** The type of the index, e.g. for which type of query it can be used. */\nexport const enum IndexKind {\n  // Note: The order of these values cannot be changed as the enum values are\n  // stored in IndexedDb.\n  /**\n   * Ordered index. Can be used for <, <=, ==, >=, >, !=, IN and NOT IN queries.\n   */\n  ASCENDING,\n  /**\n   * Ordered index. Can be used for <, <=, ==, >=, >, !=, IN and NOT IN queries.\n   */\n  DESCENDING,\n  /** Contains index. Can be used for ArrayContains and ArrayContainsAny. */\n  CONTAINS\n}\n\n/** An index component consisting of field path and index type.  */\nexport class IndexSegment {\n  constructor(\n    /** The field path of the component. */\n    readonly fieldPath: FieldPath,\n    /** The fields sorting order. */\n    readonly kind: IndexKind\n  ) {}\n}\n\nfunction indexSegmentComparator(\n  left: IndexSegment,\n  right: IndexSegment\n): number {\n  const cmp = FieldPath.comparator(left.fieldPath, right.fieldPath);\n  if (cmp !== 0) {\n    return cmp;\n  }\n  return primitiveComparator(left.kind, right.kind);\n}\n\n/**\n * Stores the \"high water mark\" that indicates how updated the Index is for the\n * current user.\n */\nexport class IndexState {\n  constructor(\n    /**\n     * Indicates when the index was last updated (relative to other indexes).\n     */\n    readonly sequenceNumber: number,\n    /** The the latest indexed read time, document and batch id. */\n    readonly offset: IndexOffset\n  ) {}\n\n  /** The state of an index that has not yet been backfilled. */\n  static empty(): IndexState {\n    return new IndexState(INITIAL_SEQUENCE_NUMBER, IndexOffset.min());\n  }\n}\n\n/**\n * Creates an offset that matches all documents with a read time higher than\n * `readTime`.\n */\nexport function newIndexOffsetSuccessorFromReadTime(\n  readTime: SnapshotVersion,\n  largestBatchId: number\n): IndexOffset {\n  // We want to create an offset that matches all documents with a read time\n  // greater than the provided read time. To do so, we technically need to\n  // create an offset for `(readTime, MAX_DOCUMENT_KEY)`. While we could use\n  // Unicode codepoints to generate MAX_DOCUMENT_KEY, it is much easier to use\n  // `(readTime + 1, DocumentKey.empty())` since `> DocumentKey.empty()` matches\n  // all valid document IDs.\n  const successorSeconds = readTime.toTimestamp().seconds;\n  const successorNanos = readTime.toTimestamp().nanoseconds + 1;\n  const successor = SnapshotVersion.fromTimestamp(\n    successorNanos === 1e9\n      ? new Timestamp(successorSeconds + 1, 0)\n      : new Timestamp(successorSeconds, successorNanos)\n  );\n  return new IndexOffset(successor, DocumentKey.empty(), largestBatchId);\n}\n\n/** Creates a new offset based on the provided document. */\nexport function newIndexOffsetFromDocument(document: Document): IndexOffset {\n  return new IndexOffset(\n    document.readTime,\n    document.key,\n    INITIAL_LARGEST_BATCH_ID\n  );\n}\n\n/**\n * Stores the latest read time, document and batch ID that were processed for an\n * index.\n */\nexport class IndexOffset {\n  constructor(\n    /**\n     * The latest read time version that has been indexed by Firestore for this\n     * field index.\n     */\n    readonly readTime: SnapshotVersion,\n\n    /**\n     * The key of the last document that was indexed for this query. Use\n     * `DocumentKey.empty()` if no document has been indexed.\n     */\n    readonly documentKey: DocumentKey,\n\n    /*\n     * The largest mutation batch id that's been processed by Firestore.\n     */\n    readonly largestBatchId: number\n  ) {}\n\n  /** Returns an offset that sorts before all regular offsets. */\n  static min(): IndexOffset {\n    return new IndexOffset(\n      SnapshotVersion.min(),\n      DocumentKey.empty(),\n      INITIAL_LARGEST_BATCH_ID\n    );\n  }\n\n  /** Returns an offset that sorts after all regular offsets. */\n  static max(): IndexOffset {\n    return new IndexOffset(\n      SnapshotVersion.max(),\n      DocumentKey.empty(),\n      INITIAL_LARGEST_BATCH_ID\n    );\n  }\n}\n\nexport function indexOffsetComparator(\n  left: IndexOffset,\n  right: IndexOffset\n): number {\n  let cmp = left.readTime.compareTo(right.readTime);\n  if (cmp !== 0) {\n    return cmp;\n  }\n  cmp = DocumentKey.comparator(left.documentKey, right.documentKey);\n  if (cmp !== 0) {\n    return cmp;\n  }\n  return primitiveComparator(left.largestBatchId, right.largestBatchId);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ListenSequenceNumber } from '../core/types';\nexport const PRIMARY_LEASE_LOST_ERROR_MSG =\n  'The current tab is not in the required state to perform this operation. ' +\n  'It might be necessary to refresh the browser tab.';\n\n/** The different modes supported by `Persistence.runTransaction()`. */\nexport type PersistenceTransactionMode =\n  | 'readonly'\n  | 'readwrite'\n  | 'readwrite-primary';\n\n/**\n * A base class representing a persistence transaction, encapsulating both the\n * transaction's sequence numbers as well as a list of onCommitted listeners.\n *\n * When you call Persistence.runTransaction(), it will create a transaction and\n * pass it to your callback. You then pass it to any method that operates\n * on persistence.\n */\nexport abstract class PersistenceTransaction {\n  private readonly onCommittedListeners: Array<() => void> = [];\n\n  abstract readonly currentSequenceNumber: ListenSequenceNumber;\n\n  addOnCommittedListener(listener: () => void): void {\n    this.onCommittedListeners.push(listener);\n  }\n\n  raiseOnCommittedEvent(): void {\n    this.onCommittedListeners.forEach(listener => listener());\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Code, FirestoreError } from '../util/error';\nimport { logDebug } from '../util/log';\n\nimport { IndexManager } from './index_manager';\nimport { LocalDocumentsView } from './local_documents_view';\nimport { LruGarbageCollector, LruResults } from './lru_garbage_collector';\nimport { PRIMARY_LEASE_LOST_ERROR_MSG } from './persistence_transaction';\n\nexport interface LocalStore {\n  collectGarbage(garbageCollector: LruGarbageCollector): Promise<LruResults>;\n\n  /** Manages the list of active field and collection indices. */\n  indexManager: IndexManager;\n\n  /**\n   * The \"local\" view of all documents (layering mutationQueue on top of\n   * remoteDocumentCache).\n   */\n  localDocuments: LocalDocumentsView;\n}\n\n/**\n * Verifies the error thrown by a LocalStore operation. If a LocalStore\n * operation fails because the primary lease has been taken by another client,\n * we ignore the error (the persistence layer will immediately call\n * `applyPrimaryLease` to propagate the primary state change). All other errors\n * are re-thrown.\n *\n * @param err - An error returned by a LocalStore operation.\n * @returns A Promise that resolves after we recovered, or the original error.\n */\nexport async function ignoreIfPrimaryLeaseLoss(\n  err: FirestoreError\n): Promise<void> {\n  if (\n    err.code === Code.FAILED_PRECONDITION &&\n    err.message === PRIMARY_LEASE_LOST_ERROR_MSG\n  ) {\n    logDebug('LocalStore', 'Unexpectedly lost primary lease');\n  } else {\n    throw err;\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { fail } from '../util/assert';\n\nexport type FulfilledHandler<T, R> =\n  | ((result: T) => R | PersistencePromise<R>)\n  | null;\nexport type RejectedHandler<R> =\n  | ((reason: Error) => R | PersistencePromise<R>)\n  | null;\nexport type Resolver<T> = (value?: T) => void;\nexport type Rejector = (error: Error) => void;\n\n/**\n * PersistencePromise is essentially a re-implementation of Promise except\n * it has a .next() method instead of .then() and .next() and .catch() callbacks\n * are executed synchronously when a PersistencePromise resolves rather than\n * asynchronously (Promise implementations use setImmediate() or similar).\n *\n * This is necessary to interoperate with IndexedDB which will automatically\n * commit transactions if control is returned to the event loop without\n * synchronously initiating another operation on the transaction.\n *\n * NOTE: .then() and .catch() only allow a single consumer, unlike normal\n * Promises.\n */\nexport class PersistencePromise<T> {\n  // NOTE: next/catchCallback will always point to our own wrapper functions,\n  // not the user's raw next() or catch() callbacks.\n  private nextCallback: FulfilledHandler<T, unknown> = null;\n  private catchCallback: RejectedHandler<unknown> = null;\n\n  // When the operation resolves, we'll set result or error and mark isDone.\n  private result: T | undefined = undefined;\n  private error: Error | undefined = undefined;\n  private isDone = false;\n\n  // Set to true when .then() or .catch() are called and prevents additional\n  // chaining.\n  private callbackAttached = false;\n\n  constructor(callback: (resolve: Resolver<T>, reject: Rejector) => void) {\n    callback(\n      value => {\n        this.isDone = true;\n        this.result = value;\n        if (this.nextCallback) {\n          // value should be defined unless T is Void, but we can't express\n          // that in the type system.\n          this.nextCallback(value!);\n        }\n      },\n      error => {\n        this.isDone = true;\n        this.error = error;\n        if (this.catchCallback) {\n          this.catchCallback(error);\n        }\n      }\n    );\n  }\n\n  catch<R>(\n    fn: (error: Error) => R | PersistencePromise<R>\n  ): PersistencePromise<R> {\n    return this.next(undefined, fn);\n  }\n\n  next<R>(\n    nextFn?: FulfilledHandler<T, R>,\n    catchFn?: RejectedHandler<R>\n  ): PersistencePromise<R> {\n    if (this.callbackAttached) {\n      fail('Called next() or catch() twice for PersistencePromise');\n    }\n    this.callbackAttached = true;\n    if (this.isDone) {\n      if (!this.error) {\n        return this.wrapSuccess(nextFn, this.result!);\n      } else {\n        return this.wrapFailure(catchFn, this.error);\n      }\n    } else {\n      return new PersistencePromise<R>((resolve, reject) => {\n        this.nextCallback = (value: T) => {\n          this.wrapSuccess(nextFn, value).next(resolve, reject);\n        };\n        this.catchCallback = (error: Error) => {\n          this.wrapFailure(catchFn, error).next(resolve, reject);\n        };\n      });\n    }\n  }\n\n  toPromise(): Promise<T> {\n    return new Promise((resolve, reject) => {\n      this.next(resolve, reject);\n    });\n  }\n\n  private wrapUserFunction<R>(\n    fn: () => R | PersistencePromise<R>\n  ): PersistencePromise<R> {\n    try {\n      const result = fn();\n      if (result instanceof PersistencePromise) {\n        return result;\n      } else {\n        return PersistencePromise.resolve(result);\n      }\n    } catch (e) {\n      return PersistencePromise.reject<R>(e as Error);\n    }\n  }\n\n  private wrapSuccess<R>(\n    nextFn: FulfilledHandler<T, R> | undefined,\n    value: T\n  ): PersistencePromise<R> {\n    if (nextFn) {\n      return this.wrapUserFunction(() => nextFn(value));\n    } else {\n      // If there's no nextFn, then R must be the same as T\n      return PersistencePromise.resolve<R>(value as unknown as R);\n    }\n  }\n\n  private wrapFailure<R>(\n    catchFn: RejectedHandler<R> | undefined,\n    error: Error\n  ): PersistencePromise<R> {\n    if (catchFn) {\n      return this.wrapUserFunction(() => catchFn(error));\n    } else {\n      return PersistencePromise.reject<R>(error);\n    }\n  }\n\n  static resolve(): PersistencePromise<void>;\n  static resolve<R>(result: R): PersistencePromise<R>;\n  static resolve<R>(result?: R): PersistencePromise<R | void> {\n    return new PersistencePromise<R | void>((resolve, reject) => {\n      resolve(result);\n    });\n  }\n\n  static reject<R>(error: Error): PersistencePromise<R> {\n    return new PersistencePromise<R>((resolve, reject) => {\n      reject(error);\n    });\n  }\n\n  static waitFor(\n    // Accept all Promise types in waitFor().\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    all: { forEach: (cb: (el: PersistencePromise<any>) => void) => void }\n  ): PersistencePromise<void> {\n    return new PersistencePromise<void>((resolve, reject) => {\n      let expectedCount = 0;\n      let resolvedCount = 0;\n      let done = false;\n\n      all.forEach(element => {\n        ++expectedCount;\n        element.next(\n          () => {\n            ++resolvedCount;\n            if (done && resolvedCount === expectedCount) {\n              resolve();\n            }\n          },\n          err => reject(err)\n        );\n      });\n\n      done = true;\n      if (resolvedCount === expectedCount) {\n        resolve();\n      }\n    });\n  }\n\n  /**\n   * Given an array of predicate functions that asynchronously evaluate to a\n   * boolean, implements a short-circuiting `or` between the results. Predicates\n   * will be evaluated until one of them returns `true`, then stop. The final\n   * result will be whether any of them returned `true`.\n   */\n  static or(\n    predicates: Array<() => PersistencePromise<boolean>>\n  ): PersistencePromise<boolean> {\n    let p: PersistencePromise<boolean> =\n      PersistencePromise.resolve<boolean>(false);\n    for (const predicate of predicates) {\n      p = p.next(isTrue => {\n        if (isTrue) {\n          return PersistencePromise.resolve<boolean>(isTrue);\n        } else {\n          return predicate();\n        }\n      });\n    }\n    return p;\n  }\n\n  /**\n   * Given an iterable, call the given function on each element in the\n   * collection and wait for all of the resulting concurrent PersistencePromises\n   * to resolve.\n   */\n  static forEach<R, S>(\n    collection: { forEach: (cb: (r: R, s: S) => void) => void },\n    f:\n      | ((r: R, s: S) => PersistencePromise<void>)\n      | ((r: R) => PersistencePromise<void>)\n  ): PersistencePromise<void>;\n  static forEach<R>(\n    collection: { forEach: (cb: (r: R) => void) => void },\n    f: (r: R) => PersistencePromise<void>\n  ): PersistencePromise<void>;\n  static forEach<R, S>(\n    collection: { forEach: (cb: (r: R, s?: S) => void) => void },\n    f: (r: R, s?: S) => PersistencePromise<void>\n  ): PersistencePromise<void> {\n    const promises: Array<PersistencePromise<void>> = [];\n    collection.forEach((r, s) => {\n      promises.push(f.call(this, r, s));\n    });\n    return this.waitFor(promises);\n  }\n\n  /**\n   * Concurrently map all array elements through asynchronous function.\n   */\n  static mapArray<T, U>(\n    array: T[],\n    f: (t: T) => PersistencePromise<U>\n  ): PersistencePromise<U[]> {\n    return new PersistencePromise<U[]>((resolve, reject) => {\n      const expectedCount = array.length;\n      const results: U[] = new Array(expectedCount);\n      let resolvedCount = 0;\n      for (let i = 0; i < expectedCount; i++) {\n        const current = i;\n        f(array[current]).next(\n          result => {\n            results[current] = result;\n            ++resolvedCount;\n            if (resolvedCount === expectedCount) {\n              resolve(results);\n            }\n          },\n          err => reject(err)\n        );\n      }\n    });\n  }\n\n  /**\n   * An alternative to recursive PersistencePromise calls, that avoids\n   * potential memory problems from unbounded chains of promises.\n   *\n   * The `action` will be called repeatedly while `condition` is true.\n   */\n  static doWhile(\n    condition: () => boolean,\n    action: () => PersistencePromise<void>\n  ): PersistencePromise<void> {\n    return new PersistencePromise<void>((resolve, reject) => {\n      const process = (): void => {\n        if (condition() === true) {\n          action().next(() => {\n            process();\n          }, reject);\n        } else {\n          resolve();\n        }\n      };\n      process();\n    });\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getUA, isIndexedDBAvailable } from '@firebase/util';\n\nimport { debugAssert } from '../util/assert';\nimport { Code, FirestoreError } from '../util/error';\nimport { logDebug, logError } from '../util/log';\nimport { Deferred } from '../util/promise';\n\nimport { PersistencePromise } from './persistence_promise';\n\n// References to `window` are guarded by SimpleDb.isAvailable()\n/* eslint-disable no-restricted-globals */\n\nconst LOG_TAG = 'SimpleDb';\n\n/**\n * The maximum number of retry attempts for an IndexedDb transaction that fails\n * with a DOMException.\n */\nconst TRANSACTION_RETRY_COUNT = 3;\n\n// The different modes supported by `SimpleDb.runTransaction()`\ntype SimpleDbTransactionMode = 'readonly' | 'readwrite';\n\nexport interface SimpleDbSchemaConverter {\n  createOrUpgrade(\n    db: IDBDatabase,\n    txn: IDBTransaction,\n    fromVersion: number,\n    toVersion: number\n  ): PersistencePromise<void>;\n}\n\n/**\n * Wraps an IDBTransaction and exposes a store() method to get a handle to a\n * specific object store.\n */\nexport class SimpleDbTransaction {\n  private aborted = false;\n\n  /**\n   * A `Promise` that resolves with the result of the IndexedDb transaction.\n   */\n  private readonly completionDeferred = new Deferred<void>();\n\n  static open(\n    db: IDBDatabase,\n    action: string,\n    mode: IDBTransactionMode,\n    objectStoreNames: string[]\n  ): SimpleDbTransaction {\n    try {\n      return new SimpleDbTransaction(\n        action,\n        db.transaction(objectStoreNames, mode)\n      );\n    } catch (e) {\n      throw new IndexedDbTransactionError(action, e as Error);\n    }\n  }\n\n  constructor(\n    private readonly action: string,\n    private readonly transaction: IDBTransaction\n  ) {\n    this.transaction.oncomplete = () => {\n      this.completionDeferred.resolve();\n    };\n    this.transaction.onabort = () => {\n      if (transaction.error) {\n        this.completionDeferred.reject(\n          new IndexedDbTransactionError(action, transaction.error)\n        );\n      } else {\n        this.completionDeferred.resolve();\n      }\n    };\n    this.transaction.onerror = (event: Event) => {\n      const error = checkForAndReportiOSError(\n        (event.target as IDBRequest).error!\n      );\n      this.completionDeferred.reject(\n        new IndexedDbTransactionError(action, error)\n      );\n    };\n  }\n\n  get completionPromise(): Promise<void> {\n    return this.completionDeferred.promise;\n  }\n\n  abort(error?: Error): void {\n    if (error) {\n      this.completionDeferred.reject(error);\n    }\n\n    if (!this.aborted) {\n      logDebug(\n        LOG_TAG,\n        'Aborting transaction:',\n        error ? error.message : 'Client-initiated abort'\n      );\n      this.aborted = true;\n      this.transaction.abort();\n    }\n  }\n\n  maybeCommit(): void {\n    // If the browser supports V3 IndexedDB, we invoke commit() explicitly to\n    // speed up index DB processing if the event loop remains blocks.\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    const maybeV3IndexedDb = this.transaction as any;\n    if (!this.aborted && typeof maybeV3IndexedDb.commit === 'function') {\n      maybeV3IndexedDb.commit();\n    }\n  }\n\n  /**\n   * Returns a SimpleDbStore<KeyType, ValueType> for the specified store. All\n   * operations performed on the SimpleDbStore happen within the context of this\n   * transaction and it cannot be used anymore once the transaction is\n   * completed.\n   *\n   * Note that we can't actually enforce that the KeyType and ValueType are\n   * correct, but they allow type safety through the rest of the consuming code.\n   */\n  store<KeyType extends IDBValidKey, ValueType extends unknown>(\n    storeName: string\n  ): SimpleDbStore<KeyType, ValueType> {\n    const store = this.transaction.objectStore(storeName);\n    debugAssert(!!store, 'Object store not part of transaction: ' + storeName);\n    return new SimpleDbStore<KeyType, ValueType>(store);\n  }\n}\n\n/**\n * Provides a wrapper around IndexedDb with a simplified interface that uses\n * Promise-like return values to chain operations. Real promises cannot be used\n * since .then() continuations are executed asynchronously (e.g. via\n * .setImmediate), which would cause IndexedDB to end the transaction.\n * See PersistencePromise for more details.\n */\nexport class SimpleDb {\n  private db?: IDBDatabase;\n  private versionchangelistener?: (event: IDBVersionChangeEvent) => void;\n\n  /** Deletes the specified database. */\n  static delete(name: string): Promise<void> {\n    logDebug(LOG_TAG, 'Removing database:', name);\n    return wrapRequest<void>(window.indexedDB.deleteDatabase(name)).toPromise();\n  }\n\n  /** Returns true if IndexedDB is available in the current environment. */\n  static isAvailable(): boolean {\n    if (!isIndexedDBAvailable()) {\n      return false;\n    }\n\n    if (SimpleDb.isMockPersistence()) {\n      return true;\n    }\n\n    // We extensively use indexed array values and compound keys,\n    // which IE and Edge do not support. However, they still have indexedDB\n    // defined on the window, so we need to check for them here and make sure\n    // to return that persistence is not enabled for those browsers.\n    // For tracking support of this feature, see here:\n    // https://developer.microsoft.com/en-us/microsoft-edge/platform/status/indexeddbarraysandmultientrysupport/\n\n    // Check the UA string to find out the browser.\n    const ua = getUA();\n\n    // IE 10\n    // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n\n    // IE 11\n    // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n\n    // Edge\n    // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,\n    // like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n\n    // iOS Safari: Disable for users running iOS version < 10.\n    const iOSVersion = SimpleDb.getIOSVersion(ua);\n    const isUnsupportedIOS = 0 < iOSVersion && iOSVersion < 10;\n\n    // Android browser: Disable for userse running version < 4.5.\n    const androidVersion = getAndroidVersion(ua);\n    const isUnsupportedAndroid = 0 < androidVersion && androidVersion < 4.5;\n\n    if (\n      ua.indexOf('MSIE ') > 0 ||\n      ua.indexOf('Trident/') > 0 ||\n      ua.indexOf('Edge/') > 0 ||\n      isUnsupportedIOS ||\n      isUnsupportedAndroid\n    ) {\n      return false;\n    } else {\n      return true;\n    }\n  }\n\n  /**\n   * Returns true if the backing IndexedDB store is the Node IndexedDBShim\n   * (see https://github.com/axemclion/IndexedDBShim).\n   */\n  static isMockPersistence(): boolean {\n    return (\n      typeof process !== 'undefined' &&\n      process.env?.USE_MOCK_PERSISTENCE === 'YES'\n    );\n  }\n\n  /** Helper to get a typed SimpleDbStore from a transaction. */\n  static getStore<KeyType extends IDBValidKey, ValueType extends unknown>(\n    txn: SimpleDbTransaction,\n    store: string\n  ): SimpleDbStore<KeyType, ValueType> {\n    return txn.store<KeyType, ValueType>(store);\n  }\n\n  // visible for testing\n  /** Parse User Agent to determine iOS version. Returns -1 if not found. */\n  static getIOSVersion(ua: string): number {\n    const iOSVersionRegex = ua.match(/i(?:phone|pad|pod) os ([\\d_]+)/i);\n    const version = iOSVersionRegex\n      ? iOSVersionRegex[1].split('_').slice(0, 2).join('.')\n      : '-1';\n    return Number(version);\n  }\n\n  /*\n   * Creates a new SimpleDb wrapper for IndexedDb database `name`.\n   *\n   * Note that `version` must not be a downgrade. IndexedDB does not support\n   * downgrading the schema version. We currently do not support any way to do\n   * versioning outside of IndexedDB's versioning mechanism, as only\n   * version-upgrade transactions are allowed to do things like create\n   * objectstores.\n   */\n  constructor(\n    private readonly name: string,\n    private readonly version: number,\n    private readonly schemaConverter: SimpleDbSchemaConverter\n  ) {\n    debugAssert(\n      SimpleDb.isAvailable(),\n      'IndexedDB not supported in current environment.'\n    );\n\n    const iOSVersion = SimpleDb.getIOSVersion(getUA());\n    // NOTE: According to https://bugs.webkit.org/show_bug.cgi?id=197050, the\n    // bug we're checking for should exist in iOS >= 12.2 and < 13, but for\n    // whatever reason it's much harder to hit after 12.2 so we only proactively\n    // log on 12.2.\n    if (iOSVersion === 12.2) {\n      logError(\n        'Firestore persistence suffers from a bug in iOS 12.2 ' +\n          'Safari that may cause your app to stop working. See ' +\n          'https://stackoverflow.com/q/56496296/110915 for details ' +\n          'and a potential workaround.'\n      );\n    }\n  }\n\n  /**\n   * Opens the specified database, creating or upgrading it if necessary.\n   */\n  async ensureDb(action: string): Promise<IDBDatabase> {\n    if (!this.db) {\n      logDebug(LOG_TAG, 'Opening database:', this.name);\n      this.db = await new Promise<IDBDatabase>((resolve, reject) => {\n        // TODO(mikelehen): Investigate browser compatibility.\n        // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB\n        // suggests IE9 and older WebKit browsers handle upgrade\n        // differently. They expect setVersion, as described here:\n        // https://developer.mozilla.org/en-US/docs/Web/API/IDBVersionChangeRequest/setVersion\n        const request = indexedDB.open(this.name, this.version);\n\n        request.onsuccess = (event: Event) => {\n          const db = (event.target as IDBOpenDBRequest).result;\n          resolve(db);\n        };\n\n        request.onblocked = () => {\n          reject(\n            new IndexedDbTransactionError(\n              action,\n              'Cannot upgrade IndexedDB schema while another tab is open. ' +\n                'Close all tabs that access Firestore and reload this page to proceed.'\n            )\n          );\n        };\n\n        request.onerror = (event: Event) => {\n          const error: DOMException = (event.target as IDBOpenDBRequest).error!;\n          if (error.name === 'VersionError') {\n            reject(\n              new FirestoreError(\n                Code.FAILED_PRECONDITION,\n                'A newer version of the Firestore SDK was previously used and so the persisted ' +\n                  'data is not compatible with the version of the SDK you are now using. The SDK ' +\n                  'will operate with persistence disabled. If you need persistence, please ' +\n                  're-upgrade to a newer version of the SDK or else clear the persisted IndexedDB ' +\n                  'data for your app to start fresh.'\n              )\n            );\n          } else if (error.name === 'InvalidStateError') {\n            reject(\n              new FirestoreError(\n                Code.FAILED_PRECONDITION,\n                'Unable to open an IndexedDB connection. This could be due to running in a ' +\n                  'private browsing session on a browser whose private browsing sessions do not ' +\n                  'support IndexedDB: ' +\n                  error\n              )\n            );\n          } else {\n            reject(new IndexedDbTransactionError(action, error));\n          }\n        };\n\n        request.onupgradeneeded = (event: IDBVersionChangeEvent) => {\n          logDebug(\n            LOG_TAG,\n            'Database \"' + this.name + '\" requires upgrade from version:',\n            event.oldVersion\n          );\n          const db = (event.target as IDBOpenDBRequest).result;\n          this.schemaConverter\n            .createOrUpgrade(\n              db,\n              request.transaction!,\n              event.oldVersion,\n              this.version\n            )\n            .next(() => {\n              logDebug(\n                LOG_TAG,\n                'Database upgrade to version ' + this.version + ' complete'\n              );\n            });\n        };\n      });\n    }\n\n    if (this.versionchangelistener) {\n      this.db.onversionchange = event => this.versionchangelistener!(event);\n    }\n    return this.db;\n  }\n\n  setVersionChangeListener(\n    versionChangeListener: (event: IDBVersionChangeEvent) => void\n  ): void {\n    this.versionchangelistener = versionChangeListener;\n    if (this.db) {\n      this.db.onversionchange = (event: IDBVersionChangeEvent) => {\n        return versionChangeListener(event);\n      };\n    }\n  }\n\n  async runTransaction<T>(\n    action: string,\n    mode: SimpleDbTransactionMode,\n    objectStores: string[],\n    transactionFn: (transaction: SimpleDbTransaction) => PersistencePromise<T>\n  ): Promise<T> {\n    const readonly = mode === 'readonly';\n    let attemptNumber = 0;\n\n    while (true) {\n      ++attemptNumber;\n\n      try {\n        this.db = await this.ensureDb(action);\n\n        const transaction = SimpleDbTransaction.open(\n          this.db,\n          action,\n          readonly ? 'readonly' : 'readwrite',\n          objectStores\n        );\n        const transactionFnResult = transactionFn(transaction)\n          .next(result => {\n            transaction.maybeCommit();\n            return result;\n          })\n          .catch(error => {\n            // Abort the transaction if there was an error.\n            transaction.abort(error);\n            // We cannot actually recover, and calling `abort()` will cause the transaction's\n            // completion promise to be rejected. This in turn means that we won't use\n            // `transactionFnResult` below. We return a rejection here so that we don't add the\n            // possibility of returning `void` to the type of `transactionFnResult`.\n            return PersistencePromise.reject<T>(error);\n          })\n          .toPromise();\n\n        // As noted above, errors are propagated by aborting the transaction. So\n        // we swallow any error here to avoid the browser logging it as unhandled.\n        transactionFnResult.catch(() => {});\n\n        // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to\n        // fire), but still return the original transactionFnResult back to the\n        // caller.\n        await transaction.completionPromise;\n        return transactionFnResult;\n      } catch (e) {\n        const error = e as Error;\n        // TODO(schmidt-sebastian): We could probably be smarter about this and\n        // not retry exceptions that are likely unrecoverable (such as quota\n        // exceeded errors).\n\n        // Note: We cannot use an instanceof check for FirestoreException, since the\n        // exception is wrapped in a generic error by our async/await handling.\n        const retryable =\n          error.name !== 'FirebaseError' &&\n          attemptNumber < TRANSACTION_RETRY_COUNT;\n        logDebug(\n          LOG_TAG,\n          'Transaction failed with error:',\n          error.message,\n          'Retrying:',\n          retryable\n        );\n\n        this.close();\n\n        if (!retryable) {\n          return Promise.reject(error);\n        }\n      }\n    }\n  }\n\n  close(): void {\n    if (this.db) {\n      this.db.close();\n    }\n    this.db = undefined;\n  }\n}\n\n/** Parse User Agent to determine Android version. Returns -1 if not found. */\nexport function getAndroidVersion(ua: string): number {\n  const androidVersionRegex = ua.match(/Android ([\\d.]+)/i);\n  const version = androidVersionRegex\n    ? androidVersionRegex[1].split('.').slice(0, 2).join('.')\n    : '-1';\n  return Number(version);\n}\n\n/**\n * A controller for iterating over a key range or index. It allows an iterate\n * callback to delete the currently-referenced object, or jump to a new key\n * within the key range or index.\n */\nexport class IterationController {\n  private shouldStop = false;\n  private nextKey: IDBValidKey | null = null;\n\n  constructor(private dbCursor: IDBCursorWithValue) {}\n\n  get isDone(): boolean {\n    return this.shouldStop;\n  }\n\n  get skipToKey(): IDBValidKey | null {\n    return this.nextKey;\n  }\n\n  set cursor(value: IDBCursorWithValue) {\n    this.dbCursor = value;\n  }\n\n  /**\n   * This function can be called to stop iteration at any point.\n   */\n  done(): void {\n    this.shouldStop = true;\n  }\n\n  /**\n   * This function can be called to skip to that next key, which could be\n   * an index or a primary key.\n   */\n  skip(key: IDBValidKey): void {\n    this.nextKey = key;\n  }\n\n  /**\n   * Delete the current cursor value from the object store.\n   *\n   * NOTE: You CANNOT do this with a keysOnly query.\n   */\n  delete(): PersistencePromise<void> {\n    return wrapRequest<void>(this.dbCursor.delete());\n  }\n}\n\n/**\n * Callback used with iterate() method.\n */\nexport type IterateCallback<KeyType, ValueType> = (\n  key: KeyType,\n  value: ValueType,\n  control: IterationController\n) => void | PersistencePromise<void>;\n\n/** Options available to the iterate() method. */\nexport interface IterateOptions {\n  /** Index to iterate over (else primary keys will be iterated) */\n  index?: string;\n\n  /** IndxedDB Range to iterate over (else entire store will be iterated) */\n  range?: IDBKeyRange;\n\n  /** If true, values aren't read while iterating. */\n  keysOnly?: boolean;\n\n  /** If true, iterate over the store in reverse. */\n  reverse?: boolean;\n}\n\n/** An error that wraps exceptions that thrown during IndexedDB execution. */\nexport class IndexedDbTransactionError extends FirestoreError {\n  name = 'IndexedDbTransactionError';\n\n  constructor(actionName: string, cause: Error | string) {\n    super(\n      Code.UNAVAILABLE,\n      `IndexedDB transaction '${actionName}' failed: ${cause}`\n    );\n  }\n}\n\n/** Verifies whether `e` is an IndexedDbTransactionError. */\nexport function isIndexedDbTransactionError(e: Error): boolean {\n  // Use name equality, as instanceof checks on errors don't work with errors\n  // that wrap other errors.\n  return e.name === 'IndexedDbTransactionError';\n}\n\n/**\n * A wrapper around an IDBObjectStore providing an API that:\n *\n * 1) Has generic KeyType / ValueType parameters to provide strongly-typed\n * methods for acting against the object store.\n * 2) Deals with IndexedDB's onsuccess / onerror event callbacks, making every\n * method return a PersistencePromise instead.\n * 3) Provides a higher-level API to avoid needing to do excessive wrapping of\n * intermediate IndexedDB types (IDBCursorWithValue, etc.)\n */\nexport class SimpleDbStore<\n  KeyType extends IDBValidKey,\n  ValueType extends unknown\n> {\n  constructor(private store: IDBObjectStore) {}\n\n  /**\n   * Writes a value into the Object Store.\n   *\n   * @param key - Optional explicit key to use when writing the object, else the\n   * key will be auto-assigned (e.g. via the defined keyPath for the store).\n   * @param value - The object to write.\n   */\n  put(value: ValueType): PersistencePromise<void>;\n  put(key: KeyType, value: ValueType): PersistencePromise<void>;\n  put(\n    keyOrValue: KeyType | ValueType,\n    value?: ValueType\n  ): PersistencePromise<void> {\n    let request;\n    if (value !== undefined) {\n      logDebug(LOG_TAG, 'PUT', this.store.name, keyOrValue, value);\n      request = this.store.put(value, keyOrValue as KeyType);\n    } else {\n      logDebug(LOG_TAG, 'PUT', this.store.name, '<auto-key>', keyOrValue);\n      request = this.store.put(keyOrValue as ValueType);\n    }\n    return wrapRequest<void>(request);\n  }\n\n  /**\n   * Adds a new value into an Object Store and returns the new key. Similar to\n   * IndexedDb's `add()`, this method will fail on primary key collisions.\n   *\n   * @param value - The object to write.\n   * @returns The key of the value to add.\n   */\n  add(value: ValueType): PersistencePromise<KeyType> {\n    logDebug(LOG_TAG, 'ADD', this.store.name, value, value);\n    const request = this.store.add(value as ValueType);\n    return wrapRequest<KeyType>(request);\n  }\n\n  /**\n   * Gets the object with the specified key from the specified store, or null\n   * if no object exists with the specified key.\n   *\n   * @key The key of the object to get.\n   * @returns The object with the specified key or null if no object exists.\n   */\n  get(key: KeyType): PersistencePromise<ValueType | null> {\n    const request = this.store.get(key);\n    // We're doing an unsafe cast to ValueType.\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    return wrapRequest<any>(request).next(result => {\n      // Normalize nonexistence to null.\n      if (result === undefined) {\n        result = null;\n      }\n      logDebug(LOG_TAG, 'GET', this.store.name, key, result);\n      return result;\n    });\n  }\n\n  delete(key: KeyType | IDBKeyRange): PersistencePromise<void> {\n    logDebug(LOG_TAG, 'DELETE', this.store.name, key);\n    const request = this.store.delete(key);\n    return wrapRequest<void>(request);\n  }\n\n  /**\n   * If we ever need more of the count variants, we can add overloads. For now,\n   * all we need is to count everything in a store.\n   *\n   * Returns the number of rows in the store.\n   */\n  count(): PersistencePromise<number> {\n    logDebug(LOG_TAG, 'COUNT', this.store.name);\n    const request = this.store.count();\n    return wrapRequest<number>(request);\n  }\n\n  /** Loads all elements from the object store. */\n  loadAll(): PersistencePromise<ValueType[]>;\n  /** Loads all elements for the index range from the object store. */\n  loadAll(range: IDBKeyRange): PersistencePromise<ValueType[]>;\n  /** Loads all elements ordered by the given index. */\n  loadAll(index: string): PersistencePromise<ValueType[]>;\n  /**\n   * Loads all elements from the object store that fall into the provided in the\n   * index range for the given index.\n   */\n  loadAll(index: string, range: IDBKeyRange): PersistencePromise<ValueType[]>;\n  loadAll(\n    indexOrRange?: string | IDBKeyRange,\n    range?: IDBKeyRange\n  ): PersistencePromise<ValueType[]> {\n    const iterateOptions = this.options(indexOrRange, range);\n    // Use `getAll()` if the browser supports IndexedDB v3, as it is roughly\n    // 20% faster.\n    const store = iterateOptions.index\n      ? this.store.index(iterateOptions.index)\n      : this.store;\n    if (typeof store.getAll === 'function') {\n      const request = store.getAll(iterateOptions.range);\n      return new PersistencePromise((resolve, reject) => {\n        request.onerror = (event: Event) => {\n          reject((event.target as IDBRequest).error!);\n        };\n        request.onsuccess = (event: Event) => {\n          resolve((event.target as IDBRequest).result);\n        };\n      });\n    } else {\n      const cursor = this.cursor(iterateOptions);\n      const results: ValueType[] = [];\n      return this.iterateCursor(cursor, (key, value) => {\n        results.push(value);\n      }).next(() => {\n        return results;\n      });\n    }\n  }\n\n  /**\n   * Loads the first `count` elements from the provided index range. Loads all\n   * elements if no limit is provided.\n   */\n  loadFirst(\n    range: IDBKeyRange,\n    count: number | null\n  ): PersistencePromise<ValueType[]> {\n    const request = this.store.getAll(\n      range,\n      count === null ? undefined : count\n    );\n    return new PersistencePromise((resolve, reject) => {\n      request.onerror = (event: Event) => {\n        reject((event.target as IDBRequest).error!);\n      };\n      request.onsuccess = (event: Event) => {\n        resolve((event.target as IDBRequest).result);\n      };\n    });\n  }\n\n  deleteAll(): PersistencePromise<void>;\n  deleteAll(range: IDBKeyRange): PersistencePromise<void>;\n  deleteAll(index: string, range: IDBKeyRange): PersistencePromise<void>;\n  deleteAll(\n    indexOrRange?: string | IDBKeyRange,\n    range?: IDBKeyRange\n  ): PersistencePromise<void> {\n    logDebug(LOG_TAG, 'DELETE ALL', this.store.name);\n    const options = this.options(indexOrRange, range);\n    options.keysOnly = false;\n    const cursor = this.cursor(options);\n    return this.iterateCursor(cursor, (key, value, control) => {\n      // NOTE: Calling delete() on a cursor is documented as more efficient than\n      // calling delete() on an object store with a single key\n      // (https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/delete),\n      // however, this requires us *not* to use a keysOnly cursor\n      // (https://developer.mozilla.org/en-US/docs/Web/API/IDBCursor/delete). We\n      // may want to compare the performance of each method.\n      return control.delete();\n    });\n  }\n\n  /**\n   * Iterates over keys and values in an object store.\n   *\n   * @param options - Options specifying how to iterate the objects in the\n   * store.\n   * @param callback - will be called for each iterated object. Iteration can be\n   * canceled at any point by calling the doneFn passed to the callback.\n   * The callback can return a PersistencePromise if it performs async\n   * operations but note that iteration will continue without waiting for them\n   * to complete.\n   * @returns A PersistencePromise that resolves once all PersistencePromises\n   * returned by callbacks resolve.\n   */\n  iterate(\n    callback: IterateCallback<KeyType, ValueType>\n  ): PersistencePromise<void>;\n  iterate(\n    options: IterateOptions,\n    callback: IterateCallback<KeyType, ValueType>\n  ): PersistencePromise<void>;\n  iterate(\n    optionsOrCallback: IterateOptions | IterateCallback<KeyType, ValueType>,\n    callback?: IterateCallback<KeyType, ValueType>\n  ): PersistencePromise<void> {\n    let options;\n    if (!callback) {\n      options = {};\n      callback = optionsOrCallback as IterateCallback<KeyType, ValueType>;\n    } else {\n      options = optionsOrCallback as IterateOptions;\n    }\n    const cursor = this.cursor(options);\n    return this.iterateCursor(cursor, callback);\n  }\n\n  /**\n   * Iterates over a store, but waits for the given callback to complete for\n   * each entry before iterating the next entry. This allows the callback to do\n   * asynchronous work to determine if this iteration should continue.\n   *\n   * The provided callback should return `true` to continue iteration, and\n   * `false` otherwise.\n   */\n  iterateSerial(\n    callback: (k: KeyType, v: ValueType) => PersistencePromise<boolean>\n  ): PersistencePromise<void> {\n    const cursorRequest = this.cursor({});\n    return new PersistencePromise((resolve, reject) => {\n      cursorRequest.onerror = (event: Event) => {\n        const error = checkForAndReportiOSError(\n          (event.target as IDBRequest).error!\n        );\n        reject(error);\n      };\n      cursorRequest.onsuccess = (event: Event) => {\n        const cursor: IDBCursorWithValue = (event.target as IDBRequest).result;\n        if (!cursor) {\n          resolve();\n          return;\n        }\n\n        callback(cursor.primaryKey as KeyType, cursor.value).next(\n          shouldContinue => {\n            if (shouldContinue) {\n              cursor.continue();\n            } else {\n              resolve();\n            }\n          }\n        );\n      };\n    });\n  }\n\n  private iterateCursor(\n    cursorRequest: IDBRequest,\n    fn: IterateCallback<KeyType, ValueType>\n  ): PersistencePromise<void> {\n    const results: Array<PersistencePromise<void>> = [];\n    return new PersistencePromise((resolve, reject) => {\n      cursorRequest.onerror = (event: Event) => {\n        reject((event.target as IDBRequest).error!);\n      };\n      cursorRequest.onsuccess = (event: Event) => {\n        const cursor: IDBCursorWithValue = (event.target as IDBRequest).result;\n        if (!cursor) {\n          resolve();\n          return;\n        }\n        const controller = new IterationController(cursor);\n        const userResult = fn(\n          cursor.primaryKey as KeyType,\n          cursor.value,\n          controller\n        );\n        if (userResult instanceof PersistencePromise) {\n          const userPromise: PersistencePromise<void> = userResult.catch(\n            err => {\n              controller.done();\n              return PersistencePromise.reject(err);\n            }\n          );\n          results.push(userPromise);\n        }\n        if (controller.isDone) {\n          resolve();\n        } else if (controller.skipToKey === null) {\n          cursor.continue();\n        } else {\n          cursor.continue(controller.skipToKey);\n        }\n      };\n    }).next(() => PersistencePromise.waitFor(results));\n  }\n\n  private options(\n    indexOrRange?: string | IDBKeyRange,\n    range?: IDBKeyRange\n  ): IterateOptions {\n    let indexName: string | undefined = undefined;\n    if (indexOrRange !== undefined) {\n      if (typeof indexOrRange === 'string') {\n        indexName = indexOrRange;\n      } else {\n        debugAssert(\n          range === undefined,\n          '3rd argument must not be defined if 2nd is a range.'\n        );\n        range = indexOrRange;\n      }\n    }\n    return { index: indexName, range };\n  }\n\n  private cursor(options: IterateOptions): IDBRequest {\n    let direction: IDBCursorDirection = 'next';\n    if (options.reverse) {\n      direction = 'prev';\n    }\n    if (options.index) {\n      const index = this.store.index(options.index);\n      if (options.keysOnly) {\n        return index.openKeyCursor(options.range, direction);\n      } else {\n        return index.openCursor(options.range, direction);\n      }\n    } else {\n      return this.store.openCursor(options.range, direction);\n    }\n  }\n}\n\n/**\n * Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror\n * handlers to resolve / reject the PersistencePromise as appropriate.\n */\nfunction wrapRequest<R>(request: IDBRequest): PersistencePromise<R> {\n  return new PersistencePromise<R>((resolve, reject) => {\n    request.onsuccess = (event: Event) => {\n      const result = (event.target as IDBRequest).result;\n      resolve(result);\n    };\n\n    request.onerror = (event: Event) => {\n      const error = checkForAndReportiOSError(\n        (event.target as IDBRequest).error!\n      );\n      reject(error);\n    };\n  });\n}\n\n// Guard so we only report the error once.\nlet reportedIOSError = false;\nfunction checkForAndReportiOSError(error: DOMException): Error {\n  const iOSVersion = SimpleDb.getIOSVersion(getUA());\n  if (iOSVersion >= 12.2 && iOSVersion < 13) {\n    const IOS_ERROR =\n      'An internal error was encountered in the Indexed Database server';\n    if (error.message.indexOf(IOS_ERROR) >= 0) {\n      // Wrap error in a more descriptive one.\n      const newError = new FirestoreError(\n        'internal',\n        `IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${IOS_ERROR}'. This is likely ` +\n          `due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 ` +\n          `for details and a potential workaround.`\n      );\n      if (!reportedIOSError) {\n        reportedIOSError = true;\n        // Throw a global exception outside of this promise chain, for the user to\n        // potentially catch.\n        setTimeout(() => {\n          throw newError;\n        }, 0);\n      }\n      return newError;\n    }\n  }\n  return error;\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { FirestoreError } from '../api';\nimport { DocumentMap } from '../model/collections';\nimport {\n  IndexOffset,\n  indexOffsetComparator,\n  newIndexOffsetFromDocument\n} from '../model/field_index';\nimport { debugAssert } from '../util/assert';\nimport { AsyncQueue, DelayedOperation, TimerId } from '../util/async_queue';\nimport { logDebug } from '../util/log';\n\nimport { ignoreIfPrimaryLeaseLoss, LocalStore } from './local_store';\nimport { LocalWriteResult } from './local_store_impl';\nimport { Persistence, Scheduler } from './persistence';\nimport { PersistencePromise } from './persistence_promise';\nimport { PersistenceTransaction } from './persistence_transaction';\nimport { isIndexedDbTransactionError } from './simple_db';\n\nconst LOG_TAG = 'IndexBackfiller';\n\n/** How long we wait to try running index backfill after SDK initialization. */\nconst INITIAL_BACKFILL_DELAY_MS = 15 * 1000;\n\n/** Minimum amount of time between backfill checks, after the first one. */\nconst REGULAR_BACKFILL_DELAY_MS = 60 * 1000;\n\n/** The maximum number of documents to process each time backfill() is called. */\nconst MAX_DOCUMENTS_TO_PROCESS = 50;\n\n/** This class is responsible for the scheduling of Index Backfiller. */\nexport class IndexBackfillerScheduler implements Scheduler {\n  private task: DelayedOperation<void> | null;\n\n  constructor(\n    private readonly asyncQueue: AsyncQueue,\n    private readonly backfiller: IndexBackfiller\n  ) {\n    this.task = null;\n  }\n\n  start(): void {\n    debugAssert(\n      this.task === null,\n      'Cannot start an already started IndexBackfillerScheduler'\n    );\n    this.schedule(INITIAL_BACKFILL_DELAY_MS);\n  }\n\n  stop(): void {\n    if (this.task) {\n      this.task.cancel();\n      this.task = null;\n    }\n  }\n\n  get started(): boolean {\n    return this.task !== null;\n  }\n\n  private schedule(delay: number): void {\n    debugAssert(\n      this.task === null,\n      'Cannot schedule IndexBackfiller while a task is pending'\n    );\n    logDebug(LOG_TAG, `Scheduled in ${delay}ms`);\n    this.task = this.asyncQueue.enqueueAfterDelay(\n      TimerId.IndexBackfill,\n      delay,\n      async () => {\n        this.task = null;\n        try {\n          const documentsProcessed = await this.backfiller.backfill();\n          logDebug(LOG_TAG, `Documents written: ${documentsProcessed}`);\n        } catch (e) {\n          if (isIndexedDbTransactionError(e as Error)) {\n            logDebug(\n              LOG_TAG,\n              'Ignoring IndexedDB error during index backfill: ',\n              e\n            );\n          } else {\n            await ignoreIfPrimaryLeaseLoss(e as FirestoreError);\n          }\n        }\n        await this.schedule(REGULAR_BACKFILL_DELAY_MS);\n      }\n    );\n  }\n}\n\n/** Implements the steps for backfilling indexes. */\nexport class IndexBackfiller {\n  constructor(\n    /**\n     * LocalStore provides access to IndexManager and LocalDocumentView.\n     * These properties will update when the user changes. Consequently,\n     * making a local copy of IndexManager and LocalDocumentView will require\n     * updates over time. The simpler solution is to rely on LocalStore to have\n     * an up-to-date references to IndexManager and LocalDocumentStore.\n     */\n    private readonly localStore: LocalStore,\n    private readonly persistence: Persistence\n  ) {}\n\n  async backfill(\n    maxDocumentsToProcess: number = MAX_DOCUMENTS_TO_PROCESS\n  ): Promise<number> {\n    return this.persistence.runTransaction(\n      'Backfill Indexes',\n      'readwrite-primary',\n      txn => this.writeIndexEntries(txn, maxDocumentsToProcess)\n    );\n  }\n\n  /** Writes index entries until the cap is reached. Returns the number of documents processed. */\n  private writeIndexEntries(\n    transation: PersistenceTransaction,\n    maxDocumentsToProcess: number\n  ): PersistencePromise<number> {\n    const processedCollectionGroups = new Set<string>();\n    let documentsRemaining = maxDocumentsToProcess;\n    let continueLoop = true;\n    return PersistencePromise.doWhile(\n      () => continueLoop === true && documentsRemaining > 0,\n      () => {\n        return this.localStore.indexManager\n          .getNextCollectionGroupToUpdate(transation)\n          .next((collectionGroup: string | null) => {\n            if (\n              collectionGroup === null ||\n              processedCollectionGroups.has(collectionGroup)\n            ) {\n              continueLoop = false;\n            } else {\n              logDebug(LOG_TAG, `Processing collection: ${collectionGroup}`);\n              return this.writeEntriesForCollectionGroup(\n                transation,\n                collectionGroup,\n                documentsRemaining\n              ).next(documentsProcessed => {\n                documentsRemaining -= documentsProcessed;\n                processedCollectionGroups.add(collectionGroup);\n              });\n            }\n          });\n      }\n    ).next(() => maxDocumentsToProcess - documentsRemaining);\n  }\n\n  /**\n   * Writes entries for the provided collection group. Returns the number of documents processed.\n   */\n  private writeEntriesForCollectionGroup(\n    transaction: PersistenceTransaction,\n    collectionGroup: string,\n    documentsRemainingUnderCap: number\n  ): PersistencePromise<number> {\n    // Use the earliest offset of all field indexes to query the local cache.\n    return this.localStore.indexManager\n      .getMinOffsetFromCollectionGroup(transaction, collectionGroup)\n      .next(existingOffset =>\n        this.localStore.localDocuments\n          .getNextDocuments(\n            transaction,\n            collectionGroup,\n            existingOffset,\n            documentsRemainingUnderCap\n          )\n          .next(nextBatch => {\n            const docs: DocumentMap = nextBatch.changes;\n            return this.localStore.indexManager\n              .updateIndexEntries(transaction, docs)\n              .next(() => this.getNewOffset(existingOffset, nextBatch))\n              .next(newOffset => {\n                logDebug(LOG_TAG, `Updating offset: ${newOffset}`);\n                return this.localStore.indexManager.updateCollectionGroup(\n                  transaction,\n                  collectionGroup,\n                  newOffset\n                );\n              })\n              .next(() => docs.size);\n          })\n      );\n  }\n\n  /** Returns the next offset based on the provided documents. */\n  private getNewOffset(\n    existingOffset: IndexOffset,\n    lookupResult: LocalWriteResult\n  ): IndexOffset {\n    let maxOffset: IndexOffset = existingOffset;\n    lookupResult.changes.forEach((key, document) => {\n      const newOffset: IndexOffset = newIndexOffsetFromDocument(document);\n      if (indexOffsetComparator(newOffset, maxOffset) > 0) {\n        maxOffset = newOffset;\n      }\n    });\n    return new IndexOffset(\n      maxOffset.readTime,\n      maxOffset.documentKey,\n      Math.max(lookupResult.batchId, existingOffset.largestBatchId)\n    );\n  }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ListenSequenceNumber } from './types';\n\n/**\n * `SequenceNumberSyncer` defines the methods required to keep multiple instances of a\n * `ListenSequence` in sync.\n */\nexport interface SequenceNumberSyncer {\n  // Notify the syncer that a new sequence number has been used.\n  writeSequenceNumber(sequenceNumber: ListenSequenceNumber): void;\n  // Setting this property allows the syncer to notify when a sequence number has been used, and\n  // and lets the ListenSequence adjust its internal previous value accordingly.\n  sequenceNumberHandler:\n    | ((sequenceNumber: ListenSequenceNumber) => void)\n    | null;\n}\n\n/**\n * `ListenSequence` is a monotonic sequence. It is initialized with a minimum value to\n * exceed. All subsequent calls to next will return increasing values. If provided with a\n * `SequenceNumberSyncer`, it will additionally bump its next value when told of a new value, as\n * well as write out sequence numbers that it produces via `next()`.\n */\nexport class ListenSequence {\n  static readonly INVALID: ListenSequenceNumber = -1;\n\n  private writeNewSequenceNumber?: (\n    newSequenceNumber: ListenSequenceNumber\n  ) => void;\n\n  constructor(\n    private previousValue: ListenSequenceNumber,\n    sequenceNumberSyncer?: SequenceNumberSyncer\n  ) {\n    if (sequenceNumberSyncer) {\n      sequenceNumberSyncer.sequenceNumberHandler = sequenceNumber =>\n        this.setPreviousValue(sequenceNumber);\n      this.writeNewSequenceNumber = sequenceNumber =>\n        sequenceNumberSyncer.writeSequenceNumber(sequenceNumber);\n    }\n  }\n\n  private setPreviousValue(\n    externalPreviousValue: ListenSequenceNumber\n  ): ListenSequenceNumber {\n    this.previousValue = Math.max(externalPreviousValue, this.previousValue);\n    return this.previousValue;\n  }\n\n  next(): ListenSequenceNumber {\n    const nextValue = ++this.previousValue;\n    if (this.writeNewSequenceNumber) {\n      this.writeNewSequenceNumber(nextValue);\n    }\n    return nextValue;\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** Sentinel value that sorts before any Mutation Batch ID. */\nexport const BATCHID_UNKNOWN = -1;\n\n// An Object whose keys and values are strings.\nexport interface StringMap {\n  [key: string]: string;\n}\n\n/**\n * Returns whether a variable is either undefined or null.\n */\nexport function isNullOrUndefined(value: unknown): value is null | undefined {\n  return value === null || value === undefined;\n}\n\n/** Returns whether the value represents -0. */\nexport function isNegativeZero(value: number): boolean {\n  // Detect if the value is -0.0. Based on polyfill from\n  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n  return value === 0 && 1 / value === 1 / -0;\n}\n\n/**\n * Returns whether a value is an integer and in the safe integer range\n * @param value - The value to test for being an integer and in the safe range\n */\nexport function isSafeInteger(value: unknown): boolean {\n  return (\n    typeof value === 'number' &&\n    Number.isInteger(value) &&\n    !isNegativeZero(value) &&\n    value <= Number.MAX_SAFE_INTEGER &&\n    value >= Number.MIN_SAFE_INTEGER\n  );\n}\n\n/** The subset of the browser's Window interface used by the SDK. */\nexport interface WindowLike {\n  readonly localStorage: Storage;\n  readonly indexedDB: IDBFactory | null;\n  addEventListener(type: string, listener: EventListener): void;\n  removeEventListener(type: string, listener: EventListener): void;\n}\n\n/** The subset of the browser's Document interface used by the SDK. */\nexport interface DocumentLike {\n  readonly visibilityState: DocumentVisibilityState;\n  addEventListener(type: string, listener: EventListener): void;\n  removeEventListener(type: string, listener: EventListener): void;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ResourcePath } from '../model/path';\nimport { fail, hardAssert } from '../util/assert';\n\n/**\n * Helpers for dealing with resource paths stored in IndexedDB.\n *\n * Resource paths in their canonical string form do not sort as the server\n * sorts them. Specifically the server splits paths into segments first and then\n * sorts, putting end-of-segment before any character. In a UTF-8 string\n * encoding the slash ('/') that denotes the end-of-segment naturally comes\n * after other characters so the intent here is to encode the path delimiters in\n * such a way that the resulting strings sort naturally.\n *\n * Resource paths are also used for prefix scans so it's important to\n * distinguish whole segments from any longer segments of which they might be a\n * prefix. For example, it's important to make it possible to scan documents in\n * a collection \"foo\" without encountering documents in a collection \"foobar\".\n *\n * Separate from the concerns about resource path ordering and separation,\n * On Android, SQLite imposes additional restrictions since it does not handle\n * keys with embedded NUL bytes particularly well. Rather than change the\n * implementation we keep the encoding identical to keep the ports similar.\n *\n * Taken together this means resource paths when encoded for storage in\n * IndexedDB have the following characteristics:\n *\n *   * Segment separators (\"/\") sort before everything else.\n *   * All paths have a trailing separator.\n *   * NUL bytes do not exist in the output, since IndexedDB doesn't treat them\n * well.\n *\n * Therefore resource paths are encoded into string form using the following\n * rules:\n *\n *   * '\\x01' is used as an escape character.\n *   * Path separators are encoded as \"\\x01\\x01\"\n *   * NUL bytes are encoded as \"\\x01\\x10\"\n *   * '\\x01' is encoded as \"\\x01\\x11\"\n *\n * This encoding leaves some room between path separators and the NUL byte\n * just in case we decide to support integer document ids after all.\n *\n * Note that characters treated specially by the backend ('.', '/', and '~')\n * are not treated specially here. This class assumes that any unescaping of\n * resource path strings into actual ResourcePath objects will handle these\n * characters there.\n */\nexport type EncodedResourcePath = string;\n\nconst escapeChar = '\\u0001';\nconst encodedSeparatorChar = '\\u0001';\nconst encodedNul = '\\u0010';\nconst encodedEscape = '\\u0011';\n\n/**\n * Encodes a resource path into a IndexedDb-compatible string form.\n */\nexport function encodeResourcePath(path: ResourcePath): EncodedResourcePath {\n  let result = '';\n  for (let i = 0; i < path.length; i++) {\n    if (result.length > 0) {\n      result = encodeSeparator(result);\n    }\n    result = encodeSegment(path.get(i), result);\n  }\n  return encodeSeparator(result);\n}\n\n/** Encodes a single segment of a resource path into the given result */\nfunction encodeSegment(segment: string, resultBuf: string): string {\n  let result = resultBuf;\n  const length = segment.length;\n  for (let i = 0; i < length; i++) {\n    const c = segment.charAt(i);\n    switch (c) {\n      case '\\0':\n        result += escapeChar + encodedNul;\n        break;\n      case escapeChar:\n        result += escapeChar + encodedEscape;\n        break;\n      default:\n        result += c;\n    }\n  }\n  return result;\n}\n\n/** Encodes a path separator into the given result */\nfunction encodeSeparator(result: string): string {\n  return result + escapeChar + encodedSeparatorChar;\n}\n\n/**\n * Decodes the given IndexedDb-compatible string form of a resource path into\n * a ResourcePath instance. Note that this method is not suitable for use with\n * decoding resource names from the server; those are One Platform format\n * strings.\n */\nexport function decodeResourcePath(path: EncodedResourcePath): ResourcePath {\n  // Event the empty path must encode as a path of at least length 2. A path\n  // with exactly 2 must be the empty path.\n  const length = path.length;\n  hardAssert(length >= 2, 'Invalid path ' + path);\n  if (length === 2) {\n    hardAssert(\n      path.charAt(0) === escapeChar && path.charAt(1) === encodedSeparatorChar,\n      'Non-empty path ' + path + ' had length 2'\n    );\n    return ResourcePath.emptyPath();\n  }\n\n  // Escape characters cannot exist past the second-to-last position in the\n  // source value.\n  const lastReasonableEscapeIndex = length - 2;\n\n  const segments: string[] = [];\n  let segmentBuilder = '';\n\n  for (let start = 0; start < length; ) {\n    // The last two characters of a valid encoded path must be a separator, so\n    // there must be an end to this segment.\n    const end = path.indexOf(escapeChar, start);\n    if (end < 0 || end > lastReasonableEscapeIndex) {\n      fail('Invalid encoded resource path: \"' + path + '\"');\n    }\n\n    const next = path.charAt(end + 1);\n    switch (next) {\n      case encodedSeparatorChar:\n        const currentPiece = path.substring(start, end);\n        let segment;\n        if (segmentBuilder.length === 0) {\n          // Avoid copying for the common case of a segment that excludes \\0\n          // and \\001\n          segment = currentPiece;\n        } else {\n          segmentBuilder += currentPiece;\n          segment = segmentBuilder;\n          segmentBuilder = '';\n        }\n        segments.push(segment);\n        break;\n      case encodedNul:\n        segmentBuilder += path.substring(start, end);\n        segmentBuilder += '\\0';\n        break;\n      case encodedEscape:\n        // The escape character can be used in the output to encode itself.\n        segmentBuilder += path.substring(start, end + 1);\n        break;\n      default:\n        fail('Invalid encoded resource path: \"' + path + '\"');\n    }\n\n    start = end + 2;\n  }\n\n  return new ResourcePath(segments);\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BatchId, TargetId } from '../core/types';\nimport { ResourcePath } from '../model/path';\nimport { fail } from '../util/assert';\n\nimport {\n  EncodedResourcePath,\n  encodeResourcePath\n} from './encoded_resource_path';\nimport { DbDocumentMutation } from './indexeddb_schema';\nimport { DbRemoteDocumentStore as DbRemoteDocumentStoreLegacy } from './indexeddb_schema_legacy';\n\n// This file contains static constants and helper functions for IndexedDB.\n// It is split from indexeddb_schema to allow for minification.\n\n/** A timestamp type that can be used in IndexedDb keys. */\nexport type DbTimestampKey = [/* seconds */ number, /* nanos */ number];\n\n// The key for the singleton object in the DbPrimaryClient is a single string.\nexport type DbPrimaryClientKey = typeof DbPrimaryClientKey;\n\n/**\n * Name of the IndexedDb object store.\n *\n * Note that the name 'owner' is chosen to ensure backwards compatibility with\n * older clients that only supported single locked access to the persistence\n * layer.\n */\nexport const DbPrimaryClientStore = 'owner';\n\n/**\n * The key string used for the single object that exists in the\n * DbPrimaryClient store.\n */\n\nexport const DbPrimaryClientKey = 'owner';\n\n/** Object keys in the 'mutationQueues' store are userId strings. */\nexport type DbMutationQueueKey = string;\n\n/** Name of the IndexedDb object store.  */\nexport const DbMutationQueueStore = 'mutationQueues';\n\n/** Keys are automatically assigned via the userId property. */\nexport const DbMutationQueueKeyPath = 'userId';\n\n/** The 'mutations' store  is keyed by batch ID. */\nexport type DbMutationBatchKey = BatchId;\n\n/** Name of the IndexedDb object store.  */\nexport const DbMutationBatchStore = 'mutations';\n\n/** Keys are automatically assigned via the userId, batchId properties. */\nexport const DbMutationBatchKeyPath = 'batchId';\n\n/** The index name for lookup of mutations by user. */\n\nexport const DbMutationBatchUserMutationsIndex = 'userMutationsIndex';\n\n/** The user mutations index is keyed by [userId, batchId] pairs. */\nexport const DbMutationBatchUserMutationsKeyPath = ['userId', 'batchId'];\n\n/**\n * The key for a db document mutation, which is made up of a userID, path, and\n * batchId. Note that the path must be serialized into a form that indexedDB can\n * sort.\n */\nexport type DbDocumentMutationKey = [string, EncodedResourcePath, BatchId];\n\n/**\n * Creates a [userId] key for use in the DbDocumentMutations index to iterate\n * over all of a user's document mutations.\n */\nexport function newDbDocumentMutationPrefixForUser(userId: string): [string] {\n  return [userId];\n}\n\n/**\n * Creates a [userId, encodedPath] key for use in the DbDocumentMutations\n * index to iterate over all at document mutations for a given path or lower.\n */\nexport function newDbDocumentMutationPrefixForPath(\n  userId: string,\n  path: ResourcePath\n): [string, EncodedResourcePath] {\n  return [userId, encodeResourcePath(path)];\n}\n\n/**\n * Creates a full index key of [userId, encodedPath, batchId] for inserting\n * and deleting into the DbDocumentMutations index.\n */\nexport function newDbDocumentMutationKey(\n  userId: string,\n  path: ResourcePath,\n  batchId: BatchId\n): DbDocumentMutationKey {\n  return [userId, encodeResourcePath(path), batchId];\n}\n\n/**\n * Because we store all the useful information for this store in the key,\n * there is no useful information to store as the value. The raw (unencoded)\n * path cannot be stored because IndexedDb doesn't store prototype\n * information.\n */\nexport const DbDocumentMutationPlaceholder: DbDocumentMutation = {};\n\nexport const DbDocumentMutationStore = 'documentMutations';\n\nexport const DbRemoteDocumentStore = 'remoteDocumentsV14';\n\n/**\n * A key in the 'remoteDocumentsV14' object store is an array containing the\n * collection path, the collection group, the read time and the document id.\n */\nexport type DbRemoteDocumentKey = [\n  /** path to collection */ string[],\n  /** collection group */ string,\n  /** read time */ DbTimestampKey,\n  /** document ID */ string\n];\n\n/**\n * The primary key of the remote documents store, which allows for efficient\n * access by collection path and read time.\n */\nexport const DbRemoteDocumentKeyPath = [\n  'prefixPath',\n  'collectionGroup',\n  'readTime',\n  'documentId'\n];\n\n/** An index that provides access to documents by key. */\nexport const DbRemoteDocumentDocumentKeyIndex = 'documentKeyIndex';\n\nexport const DbRemoteDocumentDocumentKeyIndexPath = [\n  'prefixPath',\n  'collectionGroup',\n  'documentId'\n];\n\n/**\n * An index that provides access to documents by collection group and read\n * time.\n *\n * This index is used by the index backfiller.\n */\nexport const DbRemoteDocumentCollectionGroupIndex = 'collectionGroupIndex';\n\nexport const DbRemoteDocumentCollectionGroupIndexPath = [\n  'collectionGroup',\n  'readTime',\n  'prefixPath',\n  'documentId'\n];\n\nexport const DbRemoteDocumentGlobalStore = 'remoteDocumentGlobal';\n\nexport const DbRemoteDocumentGlobalKey = 'remoteDocumentGlobalKey';\n\nexport type DbRemoteDocumentGlobalKey = typeof DbRemoteDocumentGlobalKey;\n\n/**\n * A key in the 'targets' object store is a targetId of the query.\n */\nexport type DbTargetKey = TargetId;\n\nexport const DbTargetStore = 'targets';\n\n/** Keys are automatically assigned via the targetId property. */\nexport const DbTargetKeyPath = 'targetId';\n\n/** The name of the queryTargets index. */\nexport const DbTargetQueryTargetsIndexName = 'queryTargetsIndex';\n\n/**\n * The index of all canonicalIds to the targets that they match. This is not\n * a unique mapping because canonicalId does not promise a unique name for all\n * possible queries, so we append the targetId to make the mapping unique.\n */\nexport const DbTargetQueryTargetsKeyPath = ['canonicalId', 'targetId'];\n\n/**\n * The key for a DbTargetDocument, containing a targetId and an encoded resource\n * path.\n */\nexport type DbTargetDocumentKey = [TargetId, EncodedResourcePath];\n\n/** Name of the IndexedDb object store.  */\nexport const DbTargetDocumentStore = 'targetDocuments';\n\n/** Keys are automatically assigned via the targetId, path properties. */\nexport const DbTargetDocumentKeyPath = ['targetId', 'path'];\n\n/** The index name for the reverse index. */\nexport const DbTargetDocumentDocumentTargetsIndex = 'documentTargetsIndex';\n\n/** We also need to create the reverse index for these properties. */\nexport const DbTargetDocumentDocumentTargetsKeyPath = ['path', 'targetId'];\n\n/**\n * The type to represent the single allowed key for the DbTargetGlobal store.\n */\nexport type DbTargetGlobalKey = typeof DbTargetGlobalKey;\n/**\n * The key string used for the single object that exists in the\n * DbTargetGlobal store.\n */\nexport const DbTargetGlobalKey = 'targetGlobalKey';\n\nexport const DbTargetGlobalStore = 'targetGlobal';\n\n/**\n * The key for a DbCollectionParent entry, containing the collection ID\n * and the parent path that contains it. Note that the parent path will be an\n * empty path in the case of root-level collections.\n */\nexport type DbCollectionParentKey = [string, EncodedResourcePath];\n\n/** Name of the IndexedDb object store. */\nexport const DbCollectionParentStore = 'collectionParents';\n\n/** Keys are automatically assigned via the collectionId, parent properties. */\nexport const DbCollectionParentKeyPath = ['collectionId', 'parent'];\n\n/** Name of the IndexedDb object store. */\nexport const DbClientMetadataStore = 'clientMetadata';\n\n/** Keys are automatically assigned via the clientId properties. */\nexport const DbClientMetadataKeyPath = 'clientId';\n\n/** Object keys in the 'clientMetadata' store are clientId strings. */\nexport type DbClientMetadataKey = string;\n\nexport type DbBundlesKey = string;\n\n/** Name of the IndexedDb object store. */\nexport const DbBundleStore = 'bundles';\n\nexport const DbBundleKeyPath = 'bundleId';\n\nexport type DbNamedQueriesKey = string;\n\n/** Name of the IndexedDb object store. */\nexport const DbNamedQueryStore = 'namedQueries';\n\nexport const DbNamedQueryKeyPath = 'name';\n\n/** The key for each index consisting of just the index id. */\nexport type DbIndexConfigurationKey = number;\n\n/** Name of the IndexedDb object store. */\nexport const DbIndexConfigurationStore = 'indexConfiguration';\n\nexport const DbIndexConfigurationKeyPath = 'indexId';\n\n/**\n * An index that provides access to the index configurations by collection\n * group.\n *\n * PORTING NOTE: iOS and Android maintain this index in-memory, but this is\n * not possible here as the Web client supports concurrent access to\n * persistence via multi-tab.\n */\nexport const DbIndexConfigurationCollectionGroupIndex = 'collectionGroupIndex';\n\nexport const DbIndexConfigurationCollectionGroupIndexPath = 'collectionGroup';\n\n/** The key for each index state consisting of the index id and its user id. */\nexport type DbIndexStateKey = [number, string];\n\n/** Name of the IndexedDb object store. */\nexport const DbIndexStateStore = 'indexState';\n\nexport const DbIndexStateKeyPath = ['indexId', 'uid'];\n\n/**\n * An index that provides access to documents in a collection sorted by last\n * update time. Used by the backfiller.\n *\n * PORTING NOTE: iOS and Android maintain this index in-memory, but this is\n * not possible here as the Web client supports concurrent access to\n * persistence via multi-tab.\n */\nexport const DbIndexStateSequenceNumberIndex = 'sequenceNumberIndex';\n\nexport const DbIndexStateSequenceNumberIndexPath = ['uid', 'sequenceNumber'];\n\n/**\n * The key for each index entry consists of the index id and its user id,\n * the encoded array and directional value for the indexed fields as well as\n * an ordered and an encoded document path for the indexed document.\n */\nexport type DbIndexEntryKey = [\n  number,\n  string,\n  Uint8Array,\n  Uint8Array,\n  Uint8Array,\n  string[]\n];\n\n/** Name of the IndexedDb object store. */\nexport const DbIndexEntryStore = 'indexEntries';\n\nexport const DbIndexEntryKeyPath = [\n  'indexId',\n  'uid',\n  'arrayValue',\n  'directionalValue',\n  'orderedDocumentKey',\n  'documentKey'\n];\n\nexport const DbIndexEntryDocumentKeyIndex = 'documentKeyIndex';\n\nexport const DbIndexEntryDocumentKeyIndexPath = [\n  'indexId',\n  'uid',\n  'orderedDocumentKey'\n];\n\nexport type DbDocumentOverlayKey = [\n  /* userId */ string,\n  /* collectionPath */ string,\n  /* documentId */ string\n];\n\n/** Name of the IndexedDb object store. */\nexport const DbDocumentOverlayStore = 'documentOverlays';\n\nexport const DbDocumentOverlayKeyPath = [\n  'userId',\n  'collectionPath',\n  'documentId'\n];\n\nexport const DbDocumentOverlayCollectionPathOverlayIndex =\n  'collectionPathOverlayIndex';\n\nexport const DbDocumentOverlayCollectionPathOverlayIndexPath = [\n  'userId',\n  'collectionPath',\n  'largestBatchId'\n];\n\nexport const DbDocumentOverlayCollectionGroupOverlayIndex =\n  'collectionGroupOverlayIndex';\n\nexport const DbDocumentOverlayCollectionGroupOverlayIndexPath = [\n  'userId',\n  'collectionGroup',\n  'largestBatchId'\n];\n\n// Visible for testing\nexport const V1_STORES = [\n  DbMutationQueueStore,\n  DbMutationBatchStore,\n  DbDocumentMutationStore,\n  DbRemoteDocumentStoreLegacy,\n  DbTargetStore,\n  DbPrimaryClientStore,\n  DbTargetGlobalStore,\n  DbTargetDocumentStore\n];\n\n// Visible for testing\nexport const V3_STORES = V1_STORES;\n// Note: DbRemoteDocumentChanges is no longer used and dropped with v9.\nexport const V4_STORES = [...V3_STORES, DbClientMetadataStore];\nexport const V6_STORES = [...V4_STORES, DbRemoteDocumentGlobalStore];\nexport const V8_STORES = [...V6_STORES, DbCollectionParentStore];\nexport const V11_STORES = [...V8_STORES, DbBundleStore, DbNamedQueryStore];\nexport const V12_STORES = [...V11_STORES, DbDocumentOverlayStore];\nexport const V13_STORES = [\n  DbMutationQueueStore,\n  DbMutationBatchStore,\n  DbDocumentMutationStore,\n  DbRemoteDocumentStore,\n  DbTargetStore,\n  DbPrimaryClientStore,\n  DbTargetGlobalStore,\n  DbTargetDocumentStore,\n  DbClientMetadataStore,\n  DbRemoteDocumentGlobalStore,\n  DbCollectionParentStore,\n  DbBundleStore,\n  DbNamedQueryStore,\n  DbDocumentOverlayStore\n];\nexport const V14_STORES = V13_STORES;\nexport const V15_STORES = [\n  ...V14_STORES,\n  DbIndexConfigurationStore,\n  DbIndexStateStore,\n  DbIndexEntryStore\n];\nexport const V16_STORES = V15_STORES;\n\n/**\n * The list of all default IndexedDB stores used throughout the SDK. This is\n * used when creating transactions so that access across all stores is done\n * atomically.\n */\nexport const ALL_STORES = V12_STORES;\n\n/** Returns the object stores for the provided schema. */\nexport function getObjectStores(schemaVersion: number): string[] {\n  if (schemaVersion === 16) {\n    return V16_STORES;\n  } else if (schemaVersion === 15) {\n    return V15_STORES;\n  } else if (schemaVersion === 14) {\n    return V14_STORES;\n  } else if (schemaVersion === 13) {\n    return V13_STORES;\n  } else if (schemaVersion === 12) {\n    return V12_STORES;\n  } else if (schemaVersion === 11) {\n    return V11_STORES;\n  } else {\n    fail('Only schema version 11 and 12 and 13 are supported');\n  }\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Document as ProtoDocument } from '../protos/firestore_proto_api';\n\nimport { DbNoDocument, DbUnknownDocument } from './indexeddb_schema';\nimport { DbTimestampKey } from './indexeddb_sentinels';\n\n// This file contains older schema definitions for object stores that were\n// migrated to newer schema versions. These object stores should only be used\n// during schema migrations.\n\nexport interface DbRemoteDocument {\n  unknownDocument?: DbUnknownDocument;\n  noDocument?: DbNoDocument;\n  document?: ProtoDocument;\n  hasCommittedMutations?: boolean;\n  readTime?: DbTimestampKey;\n  parentPath?: string[];\n}\n\nexport type DbRemoteDocumentKey = string[];\nexport const DbRemoteDocumentStore = 'remoteDocuments';\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ListenSequenceNumber } from '../core/types';\nimport { debugCast } from '../util/assert';\n\nimport { PersistenceTransaction } from './persistence_transaction';\nimport { SimpleDb, SimpleDbStore, SimpleDbTransaction } from './simple_db';\n\nexport class IndexedDbTransaction extends PersistenceTransaction {\n  constructor(\n    readonly simpleDbTransaction: SimpleDbTransaction,\n    readonly currentSequenceNumber: ListenSequenceNumber\n  ) {\n    super();\n  }\n}\n\nexport function getStore<Key extends IDBValidKey, Value>(\n  txn: PersistenceTransaction,\n  store: string\n): SimpleDbStore<Key, Value> {\n  const indexedDbTransaction = debugCast(txn, IndexedDbTransaction);\n  return SimpleDb.getStore<Key, Value>(\n    indexedDbTransaction.simpleDbTransaction,\n    store\n  );\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { debugAssert } from './assert';\n\nexport interface Dict<V> {\n  [stringKey: string]: V;\n}\n\nexport function objectSize(obj: object): number {\n  let count = 0;\n  for (const key in obj) {\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\n      count++;\n    }\n  }\n  return count;\n}\n\nexport function forEach<V>(\n  obj: Dict<V> | undefined,\n  fn: (key: string, val: V) => void\n): void {\n  for (const key in obj) {\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\n      fn(key, obj[key]);\n    }\n  }\n}\n\nexport function mapToArray<V, R>(\n  obj: Dict<V>,\n  fn: (element: V, key: string, obj: Dict<V>) => R\n): R[] {\n  const result: R[] = [];\n  for (const key in obj) {\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\n      result.push(fn(obj[key], key, obj));\n    }\n  }\n  return result;\n}\n\nexport function isEmpty<V>(obj: Dict<V>): boolean {\n  debugAssert(\n    obj != null && typeof obj === 'object',\n    'isEmpty() expects object parameter.'\n  );\n  for (const key in obj) {\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\n      return false;\n    }\n  }\n  return true;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { debugAssert, fail } from './assert';\n\n/*\n * Implementation of an immutable SortedMap using a Left-leaning\n * Red-Black Tree, adapted from the implementation in Mugs\n * (http://mads379.github.com/mugs/) by Mads Hartmann Jensen\n * (mads379@gmail.com).\n *\n * Original paper on Left-leaning Red-Black Trees:\n *   http://www.cs.princeton.edu/~rs/talks/LLRB/LLRB.pdf\n *\n * Invariant 1: No red node has a red child\n * Invariant 2: Every leaf path has the same number of black nodes\n * Invariant 3: Only the left child can be red (left leaning)\n */\n\nexport type Comparator<K> = (key1: K, key2: K) => number;\n\nexport interface Entry<K, V> {\n  key: K;\n  value: V;\n}\n\n// An immutable sorted map implementation, based on a Left-leaning Red-Black\n// tree.\nexport class SortedMap<K, V> {\n  // visible for testing\n  root: LLRBNode<K, V> | LLRBEmptyNode<K, V>;\n\n  constructor(\n    public comparator: Comparator<K>,\n    root?: LLRBNode<K, V> | LLRBEmptyNode<K, V>\n  ) {\n    this.root = root ? root : LLRBNode.EMPTY;\n  }\n\n  // Returns a copy of the map, with the specified key/value added or replaced.\n  insert(key: K, value: V): SortedMap<K, V> {\n    return new SortedMap<K, V>(\n      this.comparator,\n      this.root\n        .insert(key, value, this.comparator)\n        .copy(null, null, LLRBNode.BLACK, null, null)\n    );\n  }\n\n  // Returns a copy of the map, with the specified key removed.\n  remove(key: K): SortedMap<K, V> {\n    return new SortedMap<K, V>(\n      this.comparator,\n      this.root\n        .remove(key, this.comparator)\n        .copy(null, null, LLRBNode.BLACK, null, null)\n    );\n  }\n\n  // Returns the value of the node with the given key, or null.\n  get(key: K): V | null {\n    let node = this.root;\n    while (!node.isEmpty()) {\n      const cmp = this.comparator(key, node.key);\n      if (cmp === 0) {\n        return node.value;\n      } else if (cmp < 0) {\n        node = node.left;\n      } else if (cmp > 0) {\n        node = node.right;\n      }\n    }\n    return null;\n  }\n\n  // Returns the index of the element in this sorted map, or -1 if it doesn't\n  // exist.\n  indexOf(key: K): number {\n    // Number of nodes that were pruned when descending right\n    let prunedNodes = 0;\n    let node = this.root;\n    while (!node.isEmpty()) {\n      const cmp = this.comparator(key, node.key);\n      if (cmp === 0) {\n        return prunedNodes + node.left.size;\n      } else if (cmp < 0) {\n        node = node.left;\n      } else {\n        // Count all nodes left of the node plus the node itself\n        prunedNodes += node.left.size + 1;\n        node = node.right;\n      }\n    }\n    // Node not found\n    return -1;\n  }\n\n  isEmpty(): boolean {\n    return this.root.isEmpty();\n  }\n\n  // Returns the total number of nodes in the map.\n  get size(): number {\n    return this.root.size;\n  }\n\n  // Returns the minimum key in the map.\n  minKey(): K | null {\n    return this.root.minKey();\n  }\n\n  // Returns the maximum key in the map.\n  maxKey(): K | null {\n    return this.root.maxKey();\n  }\n\n  // Traverses the map in key order and calls the specified action function\n  // for each key/value pair. If action returns true, traversal is aborted.\n  // Returns the first truthy value returned by action, or the last falsey\n  // value returned by action.\n  inorderTraversal<T>(action: (k: K, v: V) => T): T {\n    return (this.root as LLRBNode<K, V>).inorderTraversal(action);\n  }\n\n  forEach(fn: (k: K, v: V) => void): void {\n    this.inorderTraversal((k, v) => {\n      fn(k, v);\n      return false;\n    });\n  }\n\n  toString(): string {\n    const descriptions: string[] = [];\n    this.inorderTraversal((k, v) => {\n      descriptions.push(`${k}:${v}`);\n      return false;\n    });\n    return `{${descriptions.join(', ')}}`;\n  }\n\n  // Traverses the map in reverse key order and calls the specified action\n  // function for each key/value pair. If action returns true, traversal is\n  // aborted.\n  // Returns the first truthy value returned by action, or the last falsey\n  // value returned by action.\n  reverseTraversal<T>(action: (k: K, v: V) => T): T {\n    return (this.root as LLRBNode<K, V>).reverseTraversal(action);\n  }\n\n  // Returns an iterator over the SortedMap.\n  getIterator(): SortedMapIterator<K, V> {\n    return new SortedMapIterator<K, V>(this.root, null, this.comparator, false);\n  }\n\n  getIteratorFrom(key: K): SortedMapIterator<K, V> {\n    return new SortedMapIterator<K, V>(this.root, key, this.comparator, false);\n  }\n\n  getReverseIterator(): SortedMapIterator<K, V> {\n    return new SortedMapIterator<K, V>(this.root, null, this.comparator, true);\n  }\n\n  getReverseIteratorFrom(key: K): SortedMapIterator<K, V> {\n    return new SortedMapIterator<K, V>(this.root, key, this.comparator, true);\n  }\n} // end SortedMap\n\n// An iterator over an LLRBNode.\nexport class SortedMapIterator<K, V> {\n  private isReverse: boolean;\n  private nodeStack: Array<LLRBNode<K, V> | LLRBEmptyNode<K, V>>;\n\n  constructor(\n    node: LLRBNode<K, V> | LLRBEmptyNode<K, V>,\n    startKey: K | null,\n    comparator: Comparator<K>,\n    isReverse: boolean\n  ) {\n    this.isReverse = isReverse;\n    this.nodeStack = [];\n\n    let cmp = 1;\n    while (!node.isEmpty()) {\n      cmp = startKey ? comparator(node.key, startKey) : 1;\n      // flip the comparison if we're going in reverse\n      if (startKey && isReverse) {\n        cmp *= -1;\n      }\n\n      if (cmp < 0) {\n        // This node is less than our start key. ignore it\n        if (this.isReverse) {\n          node = node.left;\n        } else {\n          node = node.right;\n        }\n      } else if (cmp === 0) {\n        // This node is exactly equal to our start key. Push it on the stack,\n        // but stop iterating;\n        this.nodeStack.push(node);\n        break;\n      } else {\n        // This node is greater than our start key, add it to the stack and move\n        // to the next one\n        this.nodeStack.push(node);\n        if (this.isReverse) {\n          node = node.right;\n        } else {\n          node = node.left;\n        }\n      }\n    }\n  }\n\n  getNext(): Entry<K, V> {\n    debugAssert(\n      this.nodeStack.length > 0,\n      'getNext() called on iterator when hasNext() is false.'\n    );\n\n    let node = this.nodeStack.pop()!;\n    const result = { key: node.key, value: node.value };\n\n    if (this.isReverse) {\n      node = node.left;\n      while (!node.isEmpty()) {\n        this.nodeStack.push(node);\n        node = node.right;\n      }\n    } else {\n      node = node.right;\n      while (!node.isEmpty()) {\n        this.nodeStack.push(node);\n        node = node.left;\n      }\n    }\n\n    return result;\n  }\n\n  hasNext(): boolean {\n    return this.nodeStack.length > 0;\n  }\n\n  peek(): Entry<K, V> | null {\n    if (this.nodeStack.length === 0) {\n      return null;\n    }\n\n    const node = this.nodeStack[this.nodeStack.length - 1];\n    return { key: node.key, value: node.value };\n  }\n} // end SortedMapIterator\n\n// Represents a node in a Left-leaning Red-Black tree.\nexport class LLRBNode<K, V> {\n  readonly color: boolean;\n  readonly left: LLRBNode<K, V> | LLRBEmptyNode<K, V>;\n  readonly right: LLRBNode<K, V> | LLRBEmptyNode<K, V>;\n  readonly size: number;\n\n  // Empty node is shared between all LLRB trees.\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  static EMPTY: LLRBEmptyNode<any, any> = null as any;\n\n  static RED = true;\n  static BLACK = false;\n\n  constructor(\n    public key: K,\n    public value: V,\n    color?: boolean,\n    left?: LLRBNode<K, V> | LLRBEmptyNode<K, V>,\n    right?: LLRBNode<K, V> | LLRBEmptyNode<K, V>\n  ) {\n    this.color = color != null ? color : LLRBNode.RED;\n    this.left = left != null ? left : LLRBNode.EMPTY;\n    this.right = right != null ? right : LLRBNode.EMPTY;\n    this.size = this.left.size + 1 + this.right.size;\n  }\n\n  // Returns a copy of the current node, optionally replacing pieces of it.\n  copy(\n    key: K | null,\n    value: V | null,\n    color: boolean | null,\n    left: LLRBNode<K, V> | LLRBEmptyNode<K, V> | null,\n    right: LLRBNode<K, V> | LLRBEmptyNode<K, V> | null\n  ): LLRBNode<K, V> {\n    return new LLRBNode<K, V>(\n      key != null ? key : this.key,\n      value != null ? value : this.value,\n      color != null ? color : this.color,\n      left != null ? left : this.left,\n      right != null ? right : this.right\n    );\n  }\n\n  isEmpty(): boolean {\n    return false;\n  }\n\n  // Traverses the tree in key order and calls the specified action function\n  // for each node. If action returns true, traversal is aborted.\n  // Returns the first truthy value returned by action, or the last falsey\n  // value returned by action.\n  inorderTraversal<T>(action: (k: K, v: V) => T): T {\n    return (\n      (this.left as LLRBNode<K, V>).inorderTraversal(action) ||\n      action(this.key, this.value) ||\n      (this.right as LLRBNode<K, V>).inorderTraversal(action)\n    );\n  }\n\n  // Traverses the tree in reverse key order and calls the specified action\n  // function for each node. If action returns true, traversal is aborted.\n  // Returns the first truthy value returned by action, or the last falsey\n  // value returned by action.\n  reverseTraversal<T>(action: (k: K, v: V) => T): T {\n    return (\n      (this.right as LLRBNode<K, V>).reverseTraversal(action) ||\n      action(this.key, this.value) ||\n      (this.left as LLRBNode<K, V>).reverseTraversal(action)\n    );\n  }\n\n  // Returns the minimum node in the tree.\n  private min(): LLRBNode<K, V> {\n    if (this.left.isEmpty()) {\n      return this;\n    } else {\n      return (this.left as LLRBNode<K, V>).min();\n    }\n  }\n\n  // Returns the maximum key in the tree.\n  minKey(): K | null {\n    return this.min().key;\n  }\n\n  // Returns the maximum key in the tree.\n  maxKey(): K | null {\n    if (this.right.isEmpty()) {\n      return this.key;\n    } else {\n      return this.right.maxKey();\n    }\n  }\n\n  // Returns new tree, with the key/value added.\n  insert(key: K, value: V, comparator: Comparator<K>): LLRBNode<K, V> {\n    let n: LLRBNode<K, V> = this;\n    const cmp = comparator(key, n.key);\n    if (cmp < 0) {\n      n = n.copy(null, null, null, n.left.insert(key, value, comparator), null);\n    } else if (cmp === 0) {\n      n = n.copy(null, value, null, null, null);\n    } else {\n      n = n.copy(\n        null,\n        null,\n        null,\n        null,\n        n.right.insert(key, value, comparator)\n      );\n    }\n    return n.fixUp();\n  }\n\n  private removeMin(): LLRBNode<K, V> | LLRBEmptyNode<K, V> {\n    if (this.left.isEmpty()) {\n      return LLRBNode.EMPTY;\n    }\n    let n: LLRBNode<K, V> = this;\n    if (!n.left.isRed() && !n.left.left.isRed()) {\n      n = n.moveRedLeft();\n    }\n    n = n.copy(null, null, null, (n.left as LLRBNode<K, V>).removeMin(), null);\n    return n.fixUp();\n  }\n\n  // Returns new tree, with the specified item removed.\n  remove(\n    key: K,\n    comparator: Comparator<K>\n  ): LLRBNode<K, V> | LLRBEmptyNode<K, V> {\n    let smallest: LLRBNode<K, V>;\n    let n: LLRBNode<K, V> = this;\n    if (comparator(key, n.key) < 0) {\n      if (!n.left.isEmpty() && !n.left.isRed() && !n.left.left.isRed()) {\n        n = n.moveRedLeft();\n      }\n      n = n.copy(null, null, null, n.left.remove(key, comparator), null);\n    } else {\n      if (n.left.isRed()) {\n        n = n.rotateRight();\n      }\n      if (!n.right.isEmpty() && !n.right.isRed() && !n.right.left.isRed()) {\n        n = n.moveRedRight();\n      }\n      if (comparator(key, n.key) === 0) {\n        if (n.right.isEmpty()) {\n          return LLRBNode.EMPTY;\n        } else {\n          smallest = (n.right as LLRBNode<K, V>).min();\n          n = n.copy(\n            smallest.key,\n            smallest.value,\n            null,\n            null,\n            (n.right as LLRBNode<K, V>).removeMin()\n          );\n        }\n      }\n      n = n.copy(null, null, null, null, n.right.remove(key, comparator));\n    }\n    return n.fixUp();\n  }\n\n  isRed(): boolean {\n    return this.color;\n  }\n\n  // Returns new tree after performing any needed rotations.\n  private fixUp(): LLRBNode<K, V> {\n    let n: LLRBNode<K, V> = this;\n    if (n.right.isRed() && !n.left.isRed()) {\n      n = n.rotateLeft();\n    }\n    if (n.left.isRed() && n.left.left.isRed()) {\n      n = n.rotateRight();\n    }\n    if (n.left.isRed() && n.right.isRed()) {\n      n = n.colorFlip();\n    }\n    return n;\n  }\n\n  private moveRedLeft(): LLRBNode<K, V> {\n    let n = this.colorFlip();\n    if (n.right.left.isRed()) {\n      n = n.copy(\n        null,\n        null,\n        null,\n        null,\n        (n.right as LLRBNode<K, V>).rotateRight()\n      );\n      n = n.rotateLeft();\n      n = n.colorFlip();\n    }\n    return n;\n  }\n\n  private moveRedRight(): LLRBNode<K, V> {\n    let n = this.colorFlip();\n    if (n.left.left.isRed()) {\n      n = n.rotateRight();\n      n = n.colorFlip();\n    }\n    return n;\n  }\n\n  private rotateLeft(): LLRBNode<K, V> {\n    const nl = this.copy(null, null, LLRBNode.RED, null, this.right.left);\n    return (this.right as LLRBNode<K, V>).copy(\n      null,\n      null,\n      this.color,\n      nl,\n      null\n    );\n  }\n\n  private rotateRight(): LLRBNode<K, V> {\n    const nr = this.copy(null, null, LLRBNode.RED, this.left.right, null);\n    return (this.left as LLRBNode<K, V>).copy(null, null, this.color, null, nr);\n  }\n\n  private colorFlip(): LLRBNode<K, V> {\n    const left = this.left.copy(null, null, !this.left.color, null, null);\n    const right = this.right.copy(null, null, !this.right.color, null, null);\n    return this.copy(null, null, !this.color, left, right);\n  }\n\n  // For testing.\n  checkMaxDepth(): boolean {\n    const blackDepth = this.check();\n    if (Math.pow(2.0, blackDepth) <= this.size + 1) {\n      return true;\n    } else {\n      return false;\n    }\n  }\n\n  // In a balanced RB tree, the black-depth (number of black nodes) from root to\n  // leaves is equal on both sides.  This function verifies that or asserts.\n  protected check(): number {\n    if (this.isRed() && this.left.isRed()) {\n      throw fail('Red node has red child(' + this.key + ',' + this.value + ')');\n    }\n    if (this.right.isRed()) {\n      throw fail('Right child of (' + this.key + ',' + this.value + ') is red');\n    }\n    const blackDepth = (this.left as LLRBNode<K, V>).check();\n    if (blackDepth !== (this.right as LLRBNode<K, V>).check()) {\n      throw fail('Black depths differ');\n    } else {\n      return blackDepth + (this.isRed() ? 0 : 1);\n    }\n  }\n} // end LLRBNode\n\n// Represents an empty node (a leaf node in the Red-Black Tree).\nexport class LLRBEmptyNode<K, V> {\n  get key(): never {\n    throw fail('LLRBEmptyNode has no key.');\n  }\n  get value(): never {\n    throw fail('LLRBEmptyNode has no value.');\n  }\n  get color(): never {\n    throw fail('LLRBEmptyNode has no color.');\n  }\n  get left(): never {\n    throw fail('LLRBEmptyNode has no left child.');\n  }\n  get right(): never {\n    throw fail('LLRBEmptyNode has no right child.');\n  }\n  size = 0;\n\n  // Returns a copy of the current node.\n  copy(\n    key: K | null,\n    value: V | null,\n    color: boolean | null,\n    left: LLRBNode<K, V> | LLRBEmptyNode<K, V> | null,\n    right: LLRBNode<K, V> | LLRBEmptyNode<K, V> | null\n  ): LLRBEmptyNode<K, V> {\n    return this;\n  }\n\n  // Returns a copy of the tree, with the specified key/value added.\n  insert(key: K, value: V, comparator: Comparator<K>): LLRBNode<K, V> {\n    return new LLRBNode<K, V>(key, value);\n  }\n\n  // Returns a copy of the tree, with the specified key removed.\n  remove(key: K, comparator: Comparator<K>): LLRBEmptyNode<K, V> {\n    return this;\n  }\n\n  isEmpty(): boolean {\n    return true;\n  }\n\n  inorderTraversal(action: (k: K, v: V) => boolean): boolean {\n    return false;\n  }\n\n  reverseTraversal(action: (k: K, v: V) => boolean): boolean {\n    return false;\n  }\n\n  minKey(): K | null {\n    return null;\n  }\n\n  maxKey(): K | null {\n    return null;\n  }\n\n  isRed(): boolean {\n    return false;\n  }\n\n  // For testing.\n  checkMaxDepth(): boolean {\n    return true;\n  }\n\n  protected check(): 0 {\n    return 0;\n  }\n} // end LLRBEmptyNode\n\nLLRBNode.EMPTY = new LLRBEmptyNode<unknown, unknown>();\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SortedMap, SortedMapIterator } from './sorted_map';\n\n/**\n * SortedSet is an immutable (copy-on-write) collection that holds elements\n * in order specified by the provided comparator.\n *\n * NOTE: if provided comparator returns 0 for two elements, we consider them to\n * be equal!\n */\nexport class SortedSet<T> {\n  private data: SortedMap<T, boolean>;\n\n  constructor(private comparator: (left: T, right: T) => number) {\n    this.data = new SortedMap<T, boolean>(this.comparator);\n  }\n\n  has(elem: T): boolean {\n    return this.data.get(elem) !== null;\n  }\n\n  first(): T | null {\n    return this.data.minKey();\n  }\n\n  last(): T | null {\n    return this.data.maxKey();\n  }\n\n  get size(): number {\n    return this.data.size;\n  }\n\n  indexOf(elem: T): number {\n    return this.data.indexOf(elem);\n  }\n\n  /** Iterates elements in order defined by \"comparator\" */\n  forEach(cb: (elem: T) => void): void {\n    this.data.inorderTraversal((k: T, v: boolean) => {\n      cb(k);\n      return false;\n    });\n  }\n\n  /** Iterates over `elem`s such that: range[0] &lt;= elem &lt; range[1]. */\n  forEachInRange(range: [T, T], cb: (elem: T) => void): void {\n    const iter = this.data.getIteratorFrom(range[0]);\n    while (iter.hasNext()) {\n      const elem = iter.getNext();\n      if (this.comparator(elem.key, range[1]) >= 0) {\n        return;\n      }\n      cb(elem.key);\n    }\n  }\n\n  /**\n   * Iterates over `elem`s such that: start &lt;= elem until false is returned.\n   */\n  forEachWhile(cb: (elem: T) => boolean, start?: T): void {\n    let iter: SortedMapIterator<T, boolean>;\n    if (start !== undefined) {\n      iter = this.data.getIteratorFrom(start);\n    } else {\n      iter = this.data.getIterator();\n    }\n    while (iter.hasNext()) {\n      const elem = iter.getNext();\n      const result = cb(elem.key);\n      if (!result) {\n        return;\n      }\n    }\n  }\n\n  /** Finds the least element greater than or equal to `elem`. */\n  firstAfterOrEqual(elem: T): T | null {\n    const iter = this.data.getIteratorFrom(elem);\n    return iter.hasNext() ? iter.getNext().key : null;\n  }\n\n  getIterator(): SortedSetIterator<T> {\n    return new SortedSetIterator<T>(this.data.getIterator());\n  }\n\n  getIteratorFrom(key: T): SortedSetIterator<T> {\n    return new SortedSetIterator<T>(this.data.getIteratorFrom(key));\n  }\n\n  /** Inserts or updates an element */\n  add(elem: T): SortedSet<T> {\n    return this.copy(this.data.remove(elem).insert(elem, true));\n  }\n\n  /** Deletes an element */\n  delete(elem: T): SortedSet<T> {\n    if (!this.has(elem)) {\n      return this;\n    }\n    return this.copy(this.data.remove(elem));\n  }\n\n  isEmpty(): boolean {\n    return this.data.isEmpty();\n  }\n\n  unionWith(other: SortedSet<T>): SortedSet<T> {\n    let result: SortedSet<T> = this;\n\n    // Make sure `result` always refers to the larger one of the two sets.\n    if (result.size < other.size) {\n      result = other;\n      other = this;\n    }\n\n    other.forEach(elem => {\n      result = result.add(elem);\n    });\n    return result;\n  }\n\n  isEqual(other: SortedSet<T>): boolean {\n    if (!(other instanceof SortedSet)) {\n      return false;\n    }\n    if (this.size !== other.size) {\n      return false;\n    }\n\n    const thisIt = this.data.getIterator();\n    const otherIt = other.data.getIterator();\n    while (thisIt.hasNext()) {\n      const thisElem = thisIt.getNext().key;\n      const otherElem = otherIt.getNext().key;\n      if (this.comparator(thisElem, otherElem) !== 0) {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  toArray(): T[] {\n    const res: T[] = [];\n    this.forEach(targetId => {\n      res.push(targetId);\n    });\n    return res;\n  }\n\n  toString(): string {\n    const result: T[] = [];\n    this.forEach(elem => result.push(elem));\n    return 'SortedSet(' + result.toString() + ')';\n  }\n\n  private copy(data: SortedMap<T, boolean>): SortedSet<T> {\n    const result = new SortedSet(this.comparator);\n    result.data = data;\n    return result;\n  }\n}\n\nexport class SortedSetIterator<T> {\n  constructor(private iter: SortedMapIterator<T, boolean>) {}\n\n  getNext(): T {\n    return this.iter.getNext().key;\n  }\n\n  hasNext(): boolean {\n    return this.iter.hasNext();\n  }\n}\n\n/**\n * Compares two sorted sets for equality using their natural ordering. The\n * method computes the intersection and invokes `onAdd` for every element that\n * is in `after` but not `before`. `onRemove` is invoked for every element in\n * `before` but missing from `after`.\n *\n * The method creates a copy of both `before` and `after` and runs in O(n log\n * n), where n is the size of the two lists.\n *\n * @param before - The elements that exist in the original set.\n * @param after - The elements to diff against the original set.\n * @param comparator - The comparator for the elements in before and after.\n * @param onAdd - A function to invoke for every element that is part of `\n * after` but not `before`.\n * @param onRemove - A function to invoke for every element that is part of\n * `before` but not `after`.\n */\nexport function diffSortedSets<T>(\n  before: SortedSet<T>,\n  after: SortedSet<T>,\n  comparator: (l: T, r: T) => number,\n  onAdd: (entry: T) => void,\n  onRemove: (entry: T) => void\n): void {\n  const beforeIt = before.getIterator();\n  const afterIt = after.getIterator();\n\n  let beforeValue = advanceIterator(beforeIt);\n  let afterValue = advanceIterator(afterIt);\n\n  // Walk through the two sets at the same time, using the ordering defined by\n  // `comparator`.\n  while (beforeValue || afterValue) {\n    let added = false;\n    let removed = false;\n\n    if (beforeValue && afterValue) {\n      const cmp = comparator(beforeValue, afterValue);\n      if (cmp < 0) {\n        // The element was removed if the next element in our ordered\n        // walkthrough is only in `before`.\n        removed = true;\n      } else if (cmp > 0) {\n        // The element was added if the next element in our ordered walkthrough\n        // is only in `after`.\n        added = true;\n      }\n    } else if (beforeValue != null) {\n      removed = true;\n    } else {\n      added = true;\n    }\n\n    if (added) {\n      onAdd(afterValue!);\n      afterValue = advanceIterator(afterIt);\n    } else if (removed) {\n      onRemove(beforeValue!);\n      beforeValue = advanceIterator(beforeIt);\n    } else {\n      beforeValue = advanceIterator(beforeIt);\n      afterValue = advanceIterator(afterIt);\n    }\n  }\n}\n\n/**\n * Returns the next element from the iterator or `undefined` if none available.\n */\nfunction advanceIterator<T>(it: SortedSetIterator<T>): T | undefined {\n  return it.hasNext() ? it.getNext() : undefined;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { debugAssert } from '../util/assert';\nimport { arrayEquals } from '../util/misc';\nimport { SortedSet } from '../util/sorted_set';\n\nimport { FieldPath } from './path';\n\n/**\n * Provides a set of fields that can be used to partially patch a document.\n * FieldMask is used in conjunction with ObjectValue.\n * Examples:\n *   foo - Overwrites foo entirely with the provided value. If foo is not\n *         present in the companion ObjectValue, the field is deleted.\n *   foo.bar - Overwrites only the field bar of the object foo.\n *             If foo is not an object, foo is replaced with an object\n *             containing foo\n */\nexport class FieldMask {\n  constructor(readonly fields: FieldPath[]) {\n    // TODO(dimond): validation of FieldMask\n    // Sort the field mask to support `FieldMask.isEqual()` and assert below.\n    fields.sort(FieldPath.comparator);\n    debugAssert(\n      !fields.some((v, i) => i !== 0 && v.isEqual(fields[i - 1])),\n      'FieldMask contains field that is not unique: ' +\n        fields.find((v, i) => i !== 0 && v.isEqual(fields[i - 1]))!\n    );\n  }\n\n  static empty(): FieldMask {\n    return new FieldMask([]);\n  }\n\n  /**\n   * Returns a new FieldMask object that is the result of adding all the given\n   * fields paths to this field mask.\n   */\n  unionWith(extraFields: FieldPath[]): FieldMask {\n    let mergedMaskSet = new SortedSet<FieldPath>(FieldPath.comparator);\n    for (const fieldPath of this.fields) {\n      mergedMaskSet = mergedMaskSet.add(fieldPath);\n    }\n    for (const fieldPath of extraFields) {\n      mergedMaskSet = mergedMaskSet.add(fieldPath);\n    }\n    return new FieldMask(mergedMaskSet.toArray());\n  }\n\n  /**\n   * Verifies that `fieldPath` is included by at least one field in this field\n   * mask.\n   *\n   * This is an O(n) operation, where `n` is the size of the field mask.\n   */\n  covers(fieldPath: FieldPath): boolean {\n    for (const fieldMaskPath of this.fields) {\n      if (fieldMaskPath.isPrefixOf(fieldPath)) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  isEqual(other: FieldMask): boolean {\n    return arrayEquals(this.fields, other.fields, (l, r) => l.isEqual(r));\n  }\n}\n","/**\n * @license\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * An error encountered while decoding base64 string.\n */\nexport class Base64DecodeError extends Error {\n  readonly name = 'Base64DecodeError';\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { decodeBase64, encodeBase64 } from '../platform/base64';\n\nimport { primitiveComparator } from './misc';\n\n/**\n * Immutable class that represents a \"proto\" byte string.\n *\n * Proto byte strings can either be Base64-encoded strings or Uint8Arrays when\n * sent on the wire. This class abstracts away this differentiation by holding\n * the proto byte string in a common class that must be converted into a string\n * before being sent as a proto.\n * @internal\n */\nexport class ByteString {\n  static readonly EMPTY_BYTE_STRING = new ByteString('');\n\n  private constructor(private readonly binaryString: string) {}\n\n  static fromBase64String(base64: string): ByteString {\n    const binaryString = decodeBase64(base64);\n    return new ByteString(binaryString);\n  }\n\n  static fromUint8Array(array: Uint8Array): ByteString {\n    // TODO(indexing); Remove the copy of the byte string here as this method\n    // is frequently called during indexing.\n    const binaryString = binaryStringFromUint8Array(array);\n    return new ByteString(binaryString);\n  }\n\n  [Symbol.iterator](): Iterator<number> {\n    let i = 0;\n    return {\n      next: () => {\n        if (i < this.binaryString.length) {\n          return { value: this.binaryString.charCodeAt(i++), done: false };\n        } else {\n          return { value: undefined, done: true };\n        }\n      }\n    };\n  }\n\n  toBase64(): string {\n    return encodeBase64(this.binaryString);\n  }\n\n  toUint8Array(): Uint8Array {\n    return uint8ArrayFromBinaryString(this.binaryString);\n  }\n\n  approximateByteSize(): number {\n    return this.binaryString.length * 2;\n  }\n\n  compareTo(other: ByteString): number {\n    return primitiveComparator(this.binaryString, other.binaryString);\n  }\n\n  isEqual(other: ByteString): boolean {\n    return this.binaryString === other.binaryString;\n  }\n}\n\n/**\n * Helper function to convert an Uint8array to a binary string.\n */\nexport function binaryStringFromUint8Array(array: Uint8Array): string {\n  let binaryString = '';\n  for (let i = 0; i < array.length; ++i) {\n    binaryString += String.fromCharCode(array[i]);\n  }\n  return binaryString;\n}\n\n/**\n * Helper function to convert a binary string to an Uint8Array.\n */\nexport function uint8ArrayFromBinaryString(binaryString: string): Uint8Array {\n  const buffer = new Uint8Array(binaryString.length);\n  for (let i = 0; i < binaryString.length; i++) {\n    buffer[i] = binaryString.charCodeAt(i);\n  }\n  return buffer;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Base64DecodeError } from '../../util/base64_decode_error';\n\n/** Converts a Base64 encoded string to a binary string. */\nexport function decodeBase64(encoded: string): string {\n  try {\n    return atob(encoded);\n  } catch (e) {\n    // Check that `DOMException` is defined before using it to avoid\n    // \"ReferenceError: Property 'DOMException' doesn't exist\" in react-native.\n    // (https://github.com/firebase/firebase-js-sdk/issues/7115)\n    if (typeof DOMException !== 'undefined' && e instanceof DOMException) {\n      throw new Base64DecodeError('Invalid base64 string: ' + e);\n    } else {\n      throw e;\n    }\n  }\n}\n\n/** Converts a binary string to a Base64 encoded string. */\nexport function encodeBase64(raw: string): string {\n  return btoa(raw);\n}\n\n/** True if and only if the Base64 conversion functions are available. */\nexport function isBase64Available(): boolean {\n  return typeof atob !== 'undefined';\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Timestamp } from '../protos/firestore_proto_api';\nimport { hardAssert } from '../util/assert';\nimport { ByteString } from '../util/byte_string';\n\n// A RegExp matching ISO 8601 UTC timestamps with optional fraction.\nconst ISO_TIMESTAMP_REG_EXP = new RegExp(\n  /^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d(?:\\.(\\d+))?Z$/\n);\n\n/**\n * Converts the possible Proto values for a timestamp value into a \"seconds and\n * nanos\" representation.\n */\nexport function normalizeTimestamp(date: Timestamp): {\n  seconds: number;\n  nanos: number;\n} {\n  hardAssert(!!date, 'Cannot normalize null or undefined timestamp.');\n\n  // The json interface (for the browser) will return an iso timestamp string,\n  // while the proto js library (for node) will return a\n  // google.protobuf.Timestamp instance.\n  if (typeof date === 'string') {\n    // The date string can have higher precision (nanos) than the Date class\n    // (millis), so we do some custom parsing here.\n\n    // Parse the nanos right out of the string.\n    let nanos = 0;\n    const fraction = ISO_TIMESTAMP_REG_EXP.exec(date);\n    hardAssert(!!fraction, 'invalid timestamp: ' + date);\n    if (fraction[1]) {\n      // Pad the fraction out to 9 digits (nanos).\n      let nanoStr = fraction[1];\n      nanoStr = (nanoStr + '000000000').substr(0, 9);\n      nanos = Number(nanoStr);\n    }\n\n    // Parse the date to get the seconds.\n    const parsedDate = new Date(date);\n    const seconds = Math.floor(parsedDate.getTime() / 1000);\n\n    return { seconds, nanos };\n  } else {\n    // TODO(b/37282237): Use strings for Proto3 timestamps\n    // assert(!this.options.useProto3Json,\n    //   'The timestamp instance format requires Proto JS.');\n    const seconds = normalizeNumber(date.seconds);\n    const nanos = normalizeNumber(date.nanos);\n    return { seconds, nanos };\n  }\n}\n\n/**\n * Converts the possible Proto types for numbers into a JavaScript number.\n * Returns 0 if the value is not numeric.\n */\nexport function normalizeNumber(value: number | string | undefined): number {\n  // TODO(bjornick): Handle int64 greater than 53 bits.\n  if (typeof value === 'number') {\n    return value;\n  } else if (typeof value === 'string') {\n    return Number(value);\n  } else {\n    return 0;\n  }\n}\n\n/** Converts the possible Proto types for Blobs into a ByteString. */\nexport function normalizeByteString(blob: string | Uint8Array): ByteString {\n  if (typeof blob === 'string') {\n    return ByteString.fromBase64String(blob);\n  } else {\n    return ByteString.fromUint8Array(blob);\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Timestamp } from '../lite-api/timestamp';\nimport {\n  Value as ProtoValue,\n  MapValue as ProtoMapValue\n} from '../protos/firestore_proto_api';\n\nimport { normalizeTimestamp } from './normalize';\n\n/**\n * Represents a locally-applied ServerTimestamp.\n *\n * Server Timestamps are backed by MapValues that contain an internal field\n * `__type__` with a value of `server_timestamp`. The previous value and local\n * write time are stored in its `__previous_value__` and `__local_write_time__`\n * fields respectively.\n *\n * Notes:\n * - ServerTimestampValue instances are created as the result of applying a\n *   transform. They can only exist in the local view of a document. Therefore\n *   they do not need to be parsed or serialized.\n * - When evaluated locally (e.g. for snapshot.data()), they by default\n *   evaluate to `null`. This behavior can be configured by passing custom\n *   FieldValueOptions to value().\n * - With respect to other ServerTimestampValues, they sort by their\n *   localWriteTime.\n */\n\nconst SERVER_TIMESTAMP_SENTINEL = 'server_timestamp';\nconst TYPE_KEY = '__type__';\nconst PREVIOUS_VALUE_KEY = '__previous_value__';\nconst LOCAL_WRITE_TIME_KEY = '__local_write_time__';\n\nexport function isServerTimestamp(value: ProtoValue | null): boolean {\n  const type = (value?.mapValue?.fields || {})[TYPE_KEY]?.stringValue;\n  return type === SERVER_TIMESTAMP_SENTINEL;\n}\n\n/**\n * Creates a new ServerTimestamp proto value (using the internal format).\n */\nexport function serverTimestamp(\n  localWriteTime: Timestamp,\n  previousValue: ProtoValue | null\n): ProtoValue {\n  const mapValue: ProtoMapValue = {\n    fields: {\n      [TYPE_KEY]: {\n        stringValue: SERVER_TIMESTAMP_SENTINEL\n      },\n      [LOCAL_WRITE_TIME_KEY]: {\n        timestampValue: {\n          seconds: localWriteTime.seconds,\n          nanos: localWriteTime.nanoseconds\n        }\n      }\n    }\n  };\n\n  // We should avoid storing deeply nested server timestamp map values\n  // because we never use the intermediate \"previous values\".\n  // For example:\n  // previous: 42L, add: t1, result: t1 -> 42L\n  // previous: t1,  add: t2, result: t2 -> 42L (NOT t2 -> t1 -> 42L)\n  // previous: t2,  add: t3, result: t3 -> 42L (NOT t3 -> t2 -> t1 -> 42L)\n  // `getPreviousValue` recursively traverses server timestamps to find the\n  // least recent Value.\n  if (previousValue && isServerTimestamp(previousValue)) {\n    previousValue = getPreviousValue(previousValue);\n  }\n  if (previousValue) {\n    mapValue.fields![PREVIOUS_VALUE_KEY] = previousValue;\n  }\n\n  return { mapValue };\n}\n\n/**\n * Returns the value of the field before this ServerTimestamp was set.\n *\n * Preserving the previous values allows the user to display the last resoled\n * value until the backend responds with the timestamp.\n */\nexport function getPreviousValue(value: ProtoValue): ProtoValue | null {\n  const previousValue = value.mapValue!.fields![PREVIOUS_VALUE_KEY];\n\n  if (isServerTimestamp(previousValue)) {\n    return getPreviousValue(previousValue);\n  }\n  return previousValue;\n}\n\n/**\n * Returns the local time at which this timestamp was first set.\n */\nexport function getLocalWriteTime(value: ProtoValue): Timestamp {\n  const localWriteTime = normalizeTimestamp(\n    value.mapValue!.fields![LOCAL_WRITE_TIME_KEY].timestampValue!\n  );\n  return new Timestamp(localWriteTime.seconds, localWriteTime.nanos);\n}\n","import { FirebaseApp } from '@firebase/app';\n\nimport { ExperimentalLongPollingOptions } from '../api/long_polling_options';\nimport { Code, FirestoreError } from '../util/error';\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport class DatabaseInfo {\n  /**\n   * Constructs a DatabaseInfo using the provided host, databaseId and\n   * persistenceKey.\n   *\n   * @param databaseId - The database to use.\n   * @param appId - The Firebase App Id.\n   * @param persistenceKey - A unique identifier for this Firestore's local\n   * storage (used in conjunction with the databaseId).\n   * @param host - The Firestore backend host to connect to.\n   * @param ssl - Whether to use SSL when connecting.\n   * @param forceLongPolling - Whether to use the forceLongPolling option\n   * when using WebChannel as the network transport.\n   * @param autoDetectLongPolling - Whether to use the detectBufferingProxy\n   * option when using WebChannel as the network transport.\n   * @param longPollingOptions Options that configure long-polling.\n   * @param useFetchStreams Whether to use the Fetch API instead of\n   * XMLHTTPRequest\n   */\n  constructor(\n    readonly databaseId: DatabaseId,\n    readonly appId: string,\n    readonly persistenceKey: string,\n    readonly host: string,\n    readonly ssl: boolean,\n    readonly forceLongPolling: boolean,\n    readonly autoDetectLongPolling: boolean,\n    readonly longPollingOptions: ExperimentalLongPollingOptions,\n    readonly useFetchStreams: boolean\n  ) {}\n}\n\n/** The default database name for a project. */\nexport const DEFAULT_DATABASE_NAME = '(default)';\n\n/**\n * Represents the database ID a Firestore client is associated with.\n * @internal\n */\nexport class DatabaseId {\n  readonly database: string;\n  constructor(readonly projectId: string, database?: string) {\n    this.database = database ? database : DEFAULT_DATABASE_NAME;\n  }\n\n  static empty(): DatabaseId {\n    return new DatabaseId('', '');\n  }\n\n  get isDefaultDatabase(): boolean {\n    return this.database === DEFAULT_DATABASE_NAME;\n  }\n\n  isEqual(other: {}): boolean {\n    return (\n      other instanceof DatabaseId &&\n      other.projectId === this.projectId &&\n      other.database === this.database\n    );\n  }\n}\n\nexport function databaseIdFromApp(\n  app: FirebaseApp,\n  database?: string\n): DatabaseId {\n  if (!Object.prototype.hasOwnProperty.apply(app.options, ['projectId'])) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      '\"projectId\" not provided in firebase.initializeApp.'\n    );\n  }\n\n  return new DatabaseId(app.options.projectId!, database);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DatabaseId } from '../core/database_info';\nimport {\n  ArrayValue,\n  LatLng,\n  MapValue,\n  Timestamp,\n  Value\n} from '../protos/firestore_proto_api';\nimport { fail } from '../util/assert';\nimport { arrayEquals, primitiveComparator } from '../util/misc';\nimport { forEach, objectSize } from '../util/obj';\nimport { isNegativeZero } from '../util/types';\n\nimport { DocumentKey } from './document_key';\nimport {\n  normalizeByteString,\n  normalizeNumber,\n  normalizeTimestamp\n} from './normalize';\nimport {\n  getLocalWriteTime,\n  getPreviousValue,\n  isServerTimestamp\n} from './server_timestamps';\nimport { TypeOrder } from './type_order';\n\nconst MAX_VALUE_TYPE = '__max__';\nexport const MAX_VALUE: Value = {\n  mapValue: {\n    fields: {\n      '__type__': { stringValue: MAX_VALUE_TYPE }\n    }\n  }\n};\n\nexport const MIN_VALUE: Value = {\n  nullValue: 'NULL_VALUE'\n};\n\n/** Extracts the backend's type order for the provided value. */\nexport function typeOrder(value: Value): TypeOrder {\n  if ('nullValue' in value) {\n    return TypeOrder.NullValue;\n  } else if ('booleanValue' in value) {\n    return TypeOrder.BooleanValue;\n  } else if ('integerValue' in value || 'doubleValue' in value) {\n    return TypeOrder.NumberValue;\n  } else if ('timestampValue' in value) {\n    return TypeOrder.TimestampValue;\n  } else if ('stringValue' in value) {\n    return TypeOrder.StringValue;\n  } else if ('bytesValue' in value) {\n    return TypeOrder.BlobValue;\n  } else if ('referenceValue' in value) {\n    return TypeOrder.RefValue;\n  } else if ('geoPointValue' in value) {\n    return TypeOrder.GeoPointValue;\n  } else if ('arrayValue' in value) {\n    return TypeOrder.ArrayValue;\n  } else if ('mapValue' in value) {\n    if (isServerTimestamp(value)) {\n      return TypeOrder.ServerTimestampValue;\n    } else if (isMaxValue(value)) {\n      return TypeOrder.MaxValue;\n    }\n    return TypeOrder.ObjectValue;\n  } else {\n    return fail('Invalid value type: ' + JSON.stringify(value));\n  }\n}\n\n/** Tests `left` and `right` for equality based on the backend semantics. */\nexport function valueEquals(left: Value, right: Value): boolean {\n  if (left === right) {\n    return true;\n  }\n\n  const leftType = typeOrder(left);\n  const rightType = typeOrder(right);\n  if (leftType !== rightType) {\n    return false;\n  }\n\n  switch (leftType) {\n    case TypeOrder.NullValue:\n      return true;\n    case TypeOrder.BooleanValue:\n      return left.booleanValue === right.booleanValue;\n    case TypeOrder.ServerTimestampValue:\n      return getLocalWriteTime(left).isEqual(getLocalWriteTime(right));\n    case TypeOrder.TimestampValue:\n      return timestampEquals(left, right);\n    case TypeOrder.StringValue:\n      return left.stringValue === right.stringValue;\n    case TypeOrder.BlobValue:\n      return blobEquals(left, right);\n    case TypeOrder.RefValue:\n      return left.referenceValue === right.referenceValue;\n    case TypeOrder.GeoPointValue:\n      return geoPointEquals(left, right);\n    case TypeOrder.NumberValue:\n      return numberEquals(left, right);\n    case TypeOrder.ArrayValue:\n      return arrayEquals(\n        left.arrayValue!.values || [],\n        right.arrayValue!.values || [],\n        valueEquals\n      );\n    case TypeOrder.ObjectValue:\n      return objectEquals(left, right);\n    case TypeOrder.MaxValue:\n      return true;\n    default:\n      return fail('Unexpected value type: ' + JSON.stringify(left));\n  }\n}\n\nfunction timestampEquals(left: Value, right: Value): boolean {\n  if (\n    typeof left.timestampValue === 'string' &&\n    typeof right.timestampValue === 'string' &&\n    left.timestampValue.length === right.timestampValue.length\n  ) {\n    // Use string equality for ISO 8601 timestamps\n    return left.timestampValue === right.timestampValue;\n  }\n\n  const leftTimestamp = normalizeTimestamp(left.timestampValue!);\n  const rightTimestamp = normalizeTimestamp(right.timestampValue!);\n  return (\n    leftTimestamp.seconds === rightTimestamp.seconds &&\n    leftTimestamp.nanos === rightTimestamp.nanos\n  );\n}\n\nfunction geoPointEquals(left: Value, right: Value): boolean {\n  return (\n    normalizeNumber(left.geoPointValue!.latitude) ===\n      normalizeNumber(right.geoPointValue!.latitude) &&\n    normalizeNumber(left.geoPointValue!.longitude) ===\n      normalizeNumber(right.geoPointValue!.longitude)\n  );\n}\n\nfunction blobEquals(left: Value, right: Value): boolean {\n  return normalizeByteString(left.bytesValue!).isEqual(\n    normalizeByteString(right.bytesValue!)\n  );\n}\n\nexport function numberEquals(left: Value, right: Value): boolean {\n  if ('integerValue' in left && 'integerValue' in right) {\n    return (\n      normalizeNumber(left.integerValue) === normalizeNumber(right.integerValue)\n    );\n  } else if ('doubleValue' in left && 'doubleValue' in right) {\n    const n1 = normalizeNumber(left.doubleValue!);\n    const n2 = normalizeNumber(right.doubleValue!);\n\n    if (n1 === n2) {\n      return isNegativeZero(n1) === isNegativeZero(n2);\n    } else {\n      return isNaN(n1) && isNaN(n2);\n    }\n  }\n\n  return false;\n}\n\nfunction objectEquals(left: Value, right: Value): boolean {\n  const leftMap = left.mapValue!.fields || {};\n  const rightMap = right.mapValue!.fields || {};\n\n  if (objectSize(leftMap) !== objectSize(rightMap)) {\n    return false;\n  }\n\n  for (const key in leftMap) {\n    if (leftMap.hasOwnProperty(key)) {\n      if (\n        rightMap[key] === undefined ||\n        !valueEquals(leftMap[key], rightMap[key])\n      ) {\n        return false;\n      }\n    }\n  }\n  return true;\n}\n\n/** Returns true if the ArrayValue contains the specified element. */\nexport function arrayValueContains(\n  haystack: ArrayValue,\n  needle: Value\n): boolean {\n  return (\n    (haystack.values || []).find(v => valueEquals(v, needle)) !== undefined\n  );\n}\n\nexport function valueCompare(left: Value, right: Value): number {\n  if (left === right) {\n    return 0;\n  }\n\n  const leftType = typeOrder(left);\n  const rightType = typeOrder(right);\n\n  if (leftType !== rightType) {\n    return primitiveComparator(leftType, rightType);\n  }\n\n  switch (leftType) {\n    case TypeOrder.NullValue:\n    case TypeOrder.MaxValue:\n      return 0;\n    case TypeOrder.BooleanValue:\n      return primitiveComparator(left.booleanValue!, right.booleanValue!);\n    case TypeOrder.NumberValue:\n      return compareNumbers(left, right);\n    case TypeOrder.TimestampValue:\n      return compareTimestamps(left.timestampValue!, right.timestampValue!);\n    case TypeOrder.ServerTimestampValue:\n      return compareTimestamps(\n        getLocalWriteTime(left),\n        getLocalWriteTime(right)\n      );\n    case TypeOrder.StringValue:\n      return primitiveComparator(left.stringValue!, right.stringValue!);\n    case TypeOrder.BlobValue:\n      return compareBlobs(left.bytesValue!, right.bytesValue!);\n    case TypeOrder.RefValue:\n      return compareReferences(left.referenceValue!, right.referenceValue!);\n    case TypeOrder.GeoPointValue:\n      return compareGeoPoints(left.geoPointValue!, right.geoPointValue!);\n    case TypeOrder.ArrayValue:\n      return compareArrays(left.arrayValue!, right.arrayValue!);\n    case TypeOrder.ObjectValue:\n      return compareMaps(left.mapValue!, right.mapValue!);\n    default:\n      throw fail('Invalid value type: ' + leftType);\n  }\n}\n\nfunction compareNumbers(left: Value, right: Value): number {\n  const leftNumber = normalizeNumber(left.integerValue || left.doubleValue);\n  const rightNumber = normalizeNumber(right.integerValue || right.doubleValue);\n\n  if (leftNumber < rightNumber) {\n    return -1;\n  } else if (leftNumber > rightNumber) {\n    return 1;\n  } else if (leftNumber === rightNumber) {\n    return 0;\n  } else {\n    // one or both are NaN.\n    if (isNaN(leftNumber)) {\n      return isNaN(rightNumber) ? 0 : -1;\n    } else {\n      return 1;\n    }\n  }\n}\n\nfunction compareTimestamps(left: Timestamp, right: Timestamp): number {\n  if (\n    typeof left === 'string' &&\n    typeof right === 'string' &&\n    left.length === right.length\n  ) {\n    return primitiveComparator(left, right);\n  }\n\n  const leftTimestamp = normalizeTimestamp(left);\n  const rightTimestamp = normalizeTimestamp(right);\n\n  const comparison = primitiveComparator(\n    leftTimestamp.seconds,\n    rightTimestamp.seconds\n  );\n  if (comparison !== 0) {\n    return comparison;\n  }\n  return primitiveComparator(leftTimestamp.nanos, rightTimestamp.nanos);\n}\n\nfunction compareReferences(leftPath: string, rightPath: string): number {\n  const leftSegments = leftPath.split('/');\n  const rightSegments = rightPath.split('/');\n  for (let i = 0; i < leftSegments.length && i < rightSegments.length; i++) {\n    const comparison = primitiveComparator(leftSegments[i], rightSegments[i]);\n    if (comparison !== 0) {\n      return comparison;\n    }\n  }\n  return primitiveComparator(leftSegments.length, rightSegments.length);\n}\n\nfunction compareGeoPoints(left: LatLng, right: LatLng): number {\n  const comparison = primitiveComparator(\n    normalizeNumber(left.latitude),\n    normalizeNumber(right.latitude)\n  );\n  if (comparison !== 0) {\n    return comparison;\n  }\n  return primitiveComparator(\n    normalizeNumber(left.longitude),\n    normalizeNumber(right.longitude)\n  );\n}\n\nfunction compareBlobs(\n  left: string | Uint8Array,\n  right: string | Uint8Array\n): number {\n  const leftBytes = normalizeByteString(left);\n  const rightBytes = normalizeByteString(right);\n  return leftBytes.compareTo(rightBytes);\n}\n\nfunction compareArrays(left: ArrayValue, right: ArrayValue): number {\n  const leftArray = left.values || [];\n  const rightArray = right.values || [];\n\n  for (let i = 0; i < leftArray.length && i < rightArray.length; ++i) {\n    const compare = valueCompare(leftArray[i], rightArray[i]);\n    if (compare) {\n      return compare;\n    }\n  }\n  return primitiveComparator(leftArray.length, rightArray.length);\n}\n\nfunction compareMaps(left: MapValue, right: MapValue): number {\n  if (left === MAX_VALUE.mapValue && right === MAX_VALUE.mapValue) {\n    return 0;\n  } else if (left === MAX_VALUE.mapValue) {\n    return 1;\n  } else if (right === MAX_VALUE.mapValue) {\n    return -1;\n  }\n\n  const leftMap = left.fields || {};\n  const leftKeys = Object.keys(leftMap);\n  const rightMap = right.fields || {};\n  const rightKeys = Object.keys(rightMap);\n\n  // Even though MapValues are likely sorted correctly based on their insertion\n  // order (e.g. when received from the backend), local modifications can bring\n  // elements out of order. We need to re-sort the elements to ensure that\n  // canonical IDs are independent of insertion order.\n  leftKeys.sort();\n  rightKeys.sort();\n\n  for (let i = 0; i < leftKeys.length && i < rightKeys.length; ++i) {\n    const keyCompare = primitiveComparator(leftKeys[i], rightKeys[i]);\n    if (keyCompare !== 0) {\n      return keyCompare;\n    }\n    const compare = valueCompare(leftMap[leftKeys[i]], rightMap[rightKeys[i]]);\n    if (compare !== 0) {\n      return compare;\n    }\n  }\n\n  return primitiveComparator(leftKeys.length, rightKeys.length);\n}\n\n/**\n * Generates the canonical ID for the provided field value (as used in Target\n * serialization).\n */\nexport function canonicalId(value: Value): string {\n  return canonifyValue(value);\n}\n\nfunction canonifyValue(value: Value): string {\n  if ('nullValue' in value) {\n    return 'null';\n  } else if ('booleanValue' in value) {\n    return '' + value.booleanValue!;\n  } else if ('integerValue' in value) {\n    return '' + value.integerValue!;\n  } else if ('doubleValue' in value) {\n    return '' + value.doubleValue!;\n  } else if ('timestampValue' in value) {\n    return canonifyTimestamp(value.timestampValue!);\n  } else if ('stringValue' in value) {\n    return value.stringValue!;\n  } else if ('bytesValue' in value) {\n    return canonifyByteString(value.bytesValue!);\n  } else if ('referenceValue' in value) {\n    return canonifyReference(value.referenceValue!);\n  } else if ('geoPointValue' in value) {\n    return canonifyGeoPoint(value.geoPointValue!);\n  } else if ('arrayValue' in value) {\n    return canonifyArray(value.arrayValue!);\n  } else if ('mapValue' in value) {\n    return canonifyMap(value.mapValue!);\n  } else {\n    return fail('Invalid value type: ' + JSON.stringify(value));\n  }\n}\n\nfunction canonifyByteString(byteString: string | Uint8Array): string {\n  return normalizeByteString(byteString).toBase64();\n}\n\nfunction canonifyTimestamp(timestamp: Timestamp): string {\n  const normalizedTimestamp = normalizeTimestamp(timestamp);\n  return `time(${normalizedTimestamp.seconds},${normalizedTimestamp.nanos})`;\n}\n\nfunction canonifyGeoPoint(geoPoint: LatLng): string {\n  return `geo(${geoPoint.latitude},${geoPoint.longitude})`;\n}\n\nfunction canonifyReference(referenceValue: string): string {\n  return DocumentKey.fromName(referenceValue).toString();\n}\n\nfunction canonifyMap(mapValue: MapValue): string {\n  // Iteration order in JavaScript is not guaranteed. To ensure that we generate\n  // matching canonical IDs for identical maps, we need to sort the keys.\n  const sortedKeys = Object.keys(mapValue.fields || {}).sort();\n\n  let result = '{';\n  let first = true;\n  for (const key of sortedKeys) {\n    if (!first) {\n      result += ',';\n    } else {\n      first = false;\n    }\n    result += `${key}:${canonifyValue(mapValue.fields![key])}`;\n  }\n  return result + '}';\n}\n\nfunction canonifyArray(arrayValue: ArrayValue): string {\n  let result = '[';\n  let first = true;\n  for (const value of arrayValue.values || []) {\n    if (!first) {\n      result += ',';\n    } else {\n      first = false;\n    }\n    result += canonifyValue(value);\n  }\n  return result + ']';\n}\n\n/**\n * Returns an approximate (and wildly inaccurate) in-memory size for the field\n * value.\n *\n * The memory size takes into account only the actual user data as it resides\n * in memory and ignores object overhead.\n */\nexport function estimateByteSize(value: Value): number {\n  switch (typeOrder(value)) {\n    case TypeOrder.NullValue:\n      return 4;\n    case TypeOrder.BooleanValue:\n      return 4;\n    case TypeOrder.NumberValue:\n      return 8;\n    case TypeOrder.TimestampValue:\n      // Timestamps are made up of two distinct numbers (seconds + nanoseconds)\n      return 16;\n    case TypeOrder.ServerTimestampValue:\n      const previousValue = getPreviousValue(value);\n      return previousValue ? 16 + estimateByteSize(previousValue) : 16;\n    case TypeOrder.StringValue:\n      // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures:\n      // \"JavaScript's String type is [...] a set of elements of 16-bit unsigned\n      // integer values\"\n      return value.stringValue!.length * 2;\n    case TypeOrder.BlobValue:\n      return normalizeByteString(value.bytesValue!).approximateByteSize();\n    case TypeOrder.RefValue:\n      return value.referenceValue!.length;\n    case TypeOrder.GeoPointValue:\n      // GeoPoints are made up of two distinct numbers (latitude + longitude)\n      return 16;\n    case TypeOrder.ArrayValue:\n      return estimateArrayByteSize(value.arrayValue!);\n    case TypeOrder.ObjectValue:\n      return estimateMapByteSize(value.mapValue!);\n    default:\n      throw fail('Invalid value type: ' + JSON.stringify(value));\n  }\n}\n\nfunction estimateMapByteSize(mapValue: MapValue): number {\n  let size = 0;\n  forEach(mapValue.fields, (key, val) => {\n    size += key.length + estimateByteSize(val);\n  });\n  return size;\n}\n\nfunction estimateArrayByteSize(arrayValue: ArrayValue): number {\n  return (arrayValue.values || []).reduce(\n    (previousSize, value) => previousSize + estimateByteSize(value),\n    0\n  );\n}\n\n/** Returns a reference value for the provided database and key. */\nexport function refValue(databaseId: DatabaseId, key: DocumentKey): Value {\n  return {\n    referenceValue: `projects/${databaseId.projectId}/databases/${\n      databaseId.database\n    }/documents/${key.path.canonicalString()}`\n  };\n}\n\n/** Returns true if `value` is an IntegerValue . */\nexport function isInteger(\n  value?: Value | null\n): value is { integerValue: string | number } {\n  return !!value && 'integerValue' in value;\n}\n\n/** Returns true if `value` is a DoubleValue. */\nexport function isDouble(\n  value?: Value | null\n): value is { doubleValue: string | number } {\n  return !!value && 'doubleValue' in value;\n}\n\n/** Returns true if `value` is either an IntegerValue or a DoubleValue. */\nexport function isNumber(value?: Value | null): boolean {\n  return isInteger(value) || isDouble(value);\n}\n\n/** Returns true if `value` is an ArrayValue. */\nexport function isArray(\n  value?: Value | null\n): value is { arrayValue: ArrayValue } {\n  return !!value && 'arrayValue' in value;\n}\n\n/** Returns true if `value` is a ReferenceValue. */\nexport function isReferenceValue(\n  value?: Value | null\n): value is { referenceValue: string } {\n  return !!value && 'referenceValue' in value;\n}\n\n/** Returns true if `value` is a NullValue. */\nexport function isNullValue(\n  value?: Value | null\n): value is { nullValue: 'NULL_VALUE' } {\n  return !!value && 'nullValue' in value;\n}\n\n/** Returns true if `value` is NaN. */\nexport function isNanValue(\n  value?: Value | null\n): value is { doubleValue: 'NaN' | number } {\n  return !!value && 'doubleValue' in value && isNaN(Number(value.doubleValue));\n}\n\n/** Returns true if `value` is a MapValue. */\nexport function isMapValue(\n  value?: Value | null\n): value is { mapValue: MapValue } {\n  return !!value && 'mapValue' in value;\n}\n\n/** Creates a deep copy of `source`. */\nexport function deepClone(source: Value): Value {\n  if (source.geoPointValue) {\n    return { geoPointValue: { ...source.geoPointValue } };\n  } else if (\n    source.timestampValue &&\n    typeof source.timestampValue === 'object'\n  ) {\n    return { timestampValue: { ...source.timestampValue } };\n  } else if (source.mapValue) {\n    const target: Value = { mapValue: { fields: {} } };\n    forEach(\n      source.mapValue.fields,\n      (key, val) => (target.mapValue!.fields![key] = deepClone(val))\n    );\n    return target;\n  } else if (source.arrayValue) {\n    const target: Value = { arrayValue: { values: [] } };\n    for (let i = 0; i < (source.arrayValue.values || []).length; ++i) {\n      target.arrayValue!.values![i] = deepClone(source.arrayValue.values![i]);\n    }\n    return target;\n  } else {\n    return { ...source };\n  }\n}\n\n/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */\nexport function isMaxValue(value: Value): boolean {\n  return (\n    (((value.mapValue || {}).fields || {})['__type__'] || {}).stringValue ===\n    MAX_VALUE_TYPE\n  );\n}\n\n/** Returns the lowest value for the given value type (inclusive). */\nexport function valuesGetLowerBound(value: Value): Value {\n  if ('nullValue' in value) {\n    return MIN_VALUE;\n  } else if ('booleanValue' in value) {\n    return { booleanValue: false };\n  } else if ('integerValue' in value || 'doubleValue' in value) {\n    return { doubleValue: NaN };\n  } else if ('timestampValue' in value) {\n    return { timestampValue: { seconds: Number.MIN_SAFE_INTEGER } };\n  } else if ('stringValue' in value) {\n    return { stringValue: '' };\n  } else if ('bytesValue' in value) {\n    return { bytesValue: '' };\n  } else if ('referenceValue' in value) {\n    return refValue(DatabaseId.empty(), DocumentKey.empty());\n  } else if ('geoPointValue' in value) {\n    return { geoPointValue: { latitude: -90, longitude: -180 } };\n  } else if ('arrayValue' in value) {\n    return { arrayValue: {} };\n  } else if ('mapValue' in value) {\n    return { mapValue: {} };\n  } else {\n    return fail('Invalid value type: ' + JSON.stringify(value));\n  }\n}\n\n/** Returns the largest value for the given value type (exclusive). */\nexport function valuesGetUpperBound(value: Value): Value {\n  if ('nullValue' in value) {\n    return { booleanValue: false };\n  } else if ('booleanValue' in value) {\n    return { doubleValue: NaN };\n  } else if ('integerValue' in value || 'doubleValue' in value) {\n    return { timestampValue: { seconds: Number.MIN_SAFE_INTEGER } };\n  } else if ('timestampValue' in value) {\n    return { stringValue: '' };\n  } else if ('stringValue' in value) {\n    return { bytesValue: '' };\n  } else if ('bytesValue' in value) {\n    return refValue(DatabaseId.empty(), DocumentKey.empty());\n  } else if ('referenceValue' in value) {\n    return { geoPointValue: { latitude: -90, longitude: -180 } };\n  } else if ('geoPointValue' in value) {\n    return { arrayValue: {} };\n  } else if ('arrayValue' in value) {\n    return { mapValue: {} };\n  } else if ('mapValue' in value) {\n    return MAX_VALUE;\n  } else {\n    return fail('Invalid value type: ' + JSON.stringify(value));\n  }\n}\n\nexport function lowerBoundCompare(\n  left: { value: Value; inclusive: boolean },\n  right: { value: Value; inclusive: boolean }\n): number {\n  const cmp = valueCompare(left.value, right.value);\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  if (left.inclusive && !right.inclusive) {\n    return -1;\n  } else if (!left.inclusive && right.inclusive) {\n    return 1;\n  }\n\n  return 0;\n}\n\nexport function upperBoundCompare(\n  left: { value: Value; inclusive: boolean },\n  right: { value: Value; inclusive: boolean }\n): number {\n  const cmp = valueCompare(left.value, right.value);\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  if (left.inclusive && !right.inclusive) {\n    return 1;\n  } else if (!left.inclusive && right.inclusive) {\n    return -1;\n  }\n\n  return 0;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  MapValue as ProtoMapValue,\n  Value as ProtoValue\n} from '../protos/firestore_proto_api';\nimport { debugAssert } from '../util/assert';\nimport { forEach } from '../util/obj';\n\nimport { FieldMask } from './field_mask';\nimport { FieldPath } from './path';\nimport { isServerTimestamp } from './server_timestamps';\nimport { deepClone, isMapValue, valueEquals } from './values';\n\nexport interface JsonObject<T> {\n  [name: string]: T;\n}\n/**\n * An ObjectValue represents a MapValue in the Firestore Proto and offers the\n * ability to add and remove fields (via the ObjectValueBuilder).\n */\nexport class ObjectValue {\n  constructor(readonly value: { mapValue: ProtoMapValue }) {\n    debugAssert(\n      !isServerTimestamp(value),\n      'ServerTimestamps should be converted to ServerTimestampValue'\n    );\n  }\n\n  static empty(): ObjectValue {\n    return new ObjectValue({ mapValue: {} });\n  }\n\n  /**\n   * Returns the value at the given path or null.\n   *\n   * @param path - the path to search\n   * @returns The value at the path or null if the path is not set.\n   */\n  field(path: FieldPath): ProtoValue | null {\n    if (path.isEmpty()) {\n      return this.value;\n    } else {\n      let currentLevel: ProtoValue = this.value;\n      for (let i = 0; i < path.length - 1; ++i) {\n        currentLevel = (currentLevel.mapValue!.fields || {})[path.get(i)];\n        if (!isMapValue(currentLevel)) {\n          return null;\n        }\n      }\n      currentLevel = (currentLevel.mapValue!.fields! || {})[path.lastSegment()];\n      return currentLevel || null;\n    }\n  }\n\n  /**\n   * Sets the field to the provided value.\n   *\n   * @param path - The field path to set.\n   * @param value - The value to set.\n   */\n  set(path: FieldPath, value: ProtoValue): void {\n    debugAssert(\n      !path.isEmpty(),\n      'Cannot set field for empty path on ObjectValue'\n    );\n    const fieldsMap = this.getFieldsMap(path.popLast());\n    fieldsMap[path.lastSegment()] = deepClone(value);\n  }\n\n  /**\n   * Sets the provided fields to the provided values.\n   *\n   * @param data - A map of fields to values (or null for deletes).\n   */\n  setAll(data: Map<FieldPath, ProtoValue | null>): void {\n    let parent = FieldPath.emptyPath();\n\n    let upserts: { [key: string]: ProtoValue } = {};\n    let deletes: string[] = [];\n\n    data.forEach((value, path) => {\n      if (!parent.isImmediateParentOf(path)) {\n        // Insert the accumulated changes at this parent location\n        const fieldsMap = this.getFieldsMap(parent);\n        this.applyChanges(fieldsMap, upserts, deletes);\n        upserts = {};\n        deletes = [];\n        parent = path.popLast();\n      }\n\n      if (value) {\n        upserts[path.lastSegment()] = deepClone(value);\n      } else {\n        deletes.push(path.lastSegment());\n      }\n    });\n\n    const fieldsMap = this.getFieldsMap(parent);\n    this.applyChanges(fieldsMap, upserts, deletes);\n  }\n\n  /**\n   * Removes the field at the specified path. If there is no field at the\n   * specified path, nothing is changed.\n   *\n   * @param path - The field path to remove.\n   */\n  delete(path: FieldPath): void {\n    debugAssert(\n      !path.isEmpty(),\n      'Cannot delete field for empty path on ObjectValue'\n    );\n    const nestedValue = this.field(path.popLast());\n    if (isMapValue(nestedValue) && nestedValue.mapValue.fields) {\n      delete nestedValue.mapValue.fields[path.lastSegment()];\n    }\n  }\n\n  isEqual(other: ObjectValue): boolean {\n    return valueEquals(this.value, other.value);\n  }\n\n  /**\n   * Returns the map that contains the leaf element of `path`. If the parent\n   * entry does not yet exist, or if it is not a map, a new map will be created.\n   */\n  private getFieldsMap(path: FieldPath): Record<string, ProtoValue> {\n    let current = this.value;\n\n    if (!current.mapValue!.fields) {\n      current.mapValue = { fields: {} };\n    }\n\n    for (let i = 0; i < path.length; ++i) {\n      let next = current.mapValue!.fields![path.get(i)];\n      if (!isMapValue(next) || !next.mapValue.fields) {\n        next = { mapValue: { fields: {} } };\n        current.mapValue!.fields![path.get(i)] = next;\n      }\n      current = next as { mapValue: ProtoMapValue };\n    }\n\n    return current.mapValue!.fields!;\n  }\n\n  /**\n   * Modifies `fieldsMap` by adding, replacing or deleting the specified\n   * entries.\n   */\n  private applyChanges(\n    fieldsMap: Record<string, ProtoValue>,\n    inserts: { [key: string]: ProtoValue },\n    deletes: string[]\n  ): void {\n    forEach(inserts, (key, val) => (fieldsMap[key] = val));\n    for (const field of deletes) {\n      delete fieldsMap[field];\n    }\n  }\n\n  clone(): ObjectValue {\n    return new ObjectValue(\n      deepClone(this.value) as { mapValue: ProtoMapValue }\n    );\n  }\n}\n\n/**\n * Returns a FieldMask built from all fields in a MapValue.\n */\nexport function extractFieldMask(value: ProtoMapValue): FieldMask {\n  const fields: FieldPath[] = [];\n  forEach(value!.fields, (key, value) => {\n    const currentPath = new FieldPath([key]);\n    if (isMapValue(value)) {\n      const nestedMask = extractFieldMask(value.mapValue!);\n      const nestedFields = nestedMask.fields;\n      if (nestedFields.length === 0) {\n        // Preserve the empty map by adding it to the FieldMask.\n        fields.push(currentPath);\n      } else {\n        // For nested and non-empty ObjectValues, add the FieldPath of the\n        // leaf nodes.\n        for (const nestedPath of nestedFields) {\n          fields.push(currentPath.child(nestedPath));\n        }\n      }\n    } else {\n      // For nested and non-empty ObjectValues, add the FieldPath of the leaf\n      // nodes.\n      fields.push(currentPath);\n    }\n  });\n  return new FieldMask(fields);\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport { debugAssert, fail } from '../util/assert';\n\nimport { DocumentKey } from './document_key';\nimport { ObjectValue } from './object_value';\nimport { FieldPath } from './path';\nimport { valueCompare } from './values';\n\n/**\n * Whether the document represents an existing document, a document that is\n * known to exist or a document whose state or existence is unknown.\n */\nconst enum DocumentType {\n  /**\n   * Represents the initial state of a MutableDocument when only the document\n   * key is known. Invalid documents transition to other states as mutations are\n   * applied. If a document remains invalid after applying mutations, it should\n   * be discarded.\n   *\n   * Invalid documents can have neither local nor committed mutations.\n   */\n  INVALID,\n  /**\n   * Represents a document in Firestore with a key, version, data and whether\n   * the data has local mutations applied to it.\n   *\n   * Found documents can be sycned or have or committed mutations applied.\n   */\n  FOUND_DOCUMENT,\n  /**\n   * Represents that no documents exists for the key at the given version.\n   *\n   * Documents that are deleted based on a local mutation do not raise snapshots\n   * with `hasPendingWrites`. As such, deleted documents never have\n   * `HAS_LOCAL_MUTATIONS` set. Once a delete is committed, we store them with\n   * `HAS_COMMITTED_MUTATIONS` until we received the delete from the Watch\n   * stream.\n   */\n  NO_DOCUMENT,\n  /**\n   * Represents an existing document whose data is unknown (e.g. a document that\n   * was updated without a known base document).\n   *\n   * An unknown document always has `HAS_COMMITTED_MUTATIONS` set, since unknown\n   * documents can only be generated by applying a patch mutation from a write\n   * acknowledgement.\n   */\n  UNKNOWN_DOCUMENT\n}\n\n/** Describes whether a document has latency-compensated edits applied. */\nconst enum DocumentState {\n  /** No mutations applied. Document was sent to us by Watch. */\n  SYNCED,\n  /**\n   * Local mutations applied via the mutation queue. Document is potentially\n   * inconsistent.\n   */\n  HAS_LOCAL_MUTATIONS,\n  /**\n   * Mutations applied based on a write acknowledgment. Document is potentially\n   * inconsistent.\n   */\n  HAS_COMMITTED_MUTATIONS\n}\n\n/**\n * Represents a document in Firestore with a key, version, data and whether the\n * data has local mutations applied to it.\n */\nexport interface Document {\n  /** The key for this document */\n  readonly key: DocumentKey;\n\n  /**\n   * The version of this document if it exists or a version at which this\n   * document was guaranteed to not exist.\n   */\n  readonly version: SnapshotVersion;\n\n  /**\n   * The timestamp at which this document was read from the remote server. Uses\n   * `SnapshotVersion.min()` for documents created by the user.\n   */\n  readonly readTime: SnapshotVersion;\n\n  /**\n   * The timestamp at which the document was created. This value increases\n   * monotonically when a document is deleted then recreated. It can also be\n   * compared to `createTime` of other documents and the `readTime` of a query.\n   */\n  readonly createTime: SnapshotVersion;\n\n  /** The underlying data of this document or an empty value if no data exists. */\n  readonly data: ObjectValue;\n\n  /** Returns whether local mutations were applied via the mutation queue. */\n  readonly hasLocalMutations: boolean;\n\n  /** Returns whether mutations were applied based on a write acknowledgment. */\n  readonly hasCommittedMutations: boolean;\n\n  /**\n   * Whether this document had a local mutation applied that has not yet been\n   * acknowledged by Watch.\n   */\n  readonly hasPendingWrites: boolean;\n\n  /**\n   * Returns whether this document is valid (i.e. it is an entry in the\n   * RemoteDocumentCache, was created by a mutation or read from the backend).\n   */\n  isValidDocument(): boolean;\n\n  /**\n   * Returns whether the document exists and its data is known at the current\n   * version.\n   */\n  isFoundDocument(): boolean;\n\n  /**\n   * Returns whether the document is known to not exist at the current version.\n   */\n  isNoDocument(): boolean;\n\n  /**\n   * Returns whether the document exists and its data is unknown at the current\n   * version.\n   */\n  isUnknownDocument(): boolean;\n\n  isEqual(other: Document | null | undefined): boolean;\n\n  /** Creates a mutable copy of this document. */\n  mutableCopy(): MutableDocument;\n\n  toString(): string;\n}\n\n/**\n * Represents a document in Firestore with a key, version, data and whether it\n * has local mutations applied to it.\n *\n * Documents can transition between states via `convertToFoundDocument()`,\n * `convertToNoDocument()` and `convertToUnknownDocument()`. If a document does\n * not transition to one of these states even after all mutations have been\n * applied, `isValidDocument()` returns false and the document should be removed\n * from all views.\n */\nexport class MutableDocument implements Document {\n  private constructor(\n    readonly key: DocumentKey,\n    private documentType: DocumentType,\n    public version: SnapshotVersion,\n    public readTime: SnapshotVersion,\n    public createTime: SnapshotVersion,\n    public data: ObjectValue,\n    private documentState: DocumentState\n  ) {}\n\n  /**\n   * Creates a document with no known version or data, but which can serve as\n   * base document for mutations.\n   */\n  static newInvalidDocument(documentKey: DocumentKey): MutableDocument {\n    return new MutableDocument(\n      documentKey,\n      DocumentType.INVALID,\n      /* version */ SnapshotVersion.min(),\n      /* readTime */ SnapshotVersion.min(),\n      /* createTime */ SnapshotVersion.min(),\n      ObjectValue.empty(),\n      DocumentState.SYNCED\n    );\n  }\n\n  /**\n   * Creates a new document that is known to exist with the given data at the\n   * given version.\n   */\n  static newFoundDocument(\n    documentKey: DocumentKey,\n    version: SnapshotVersion,\n    createTime: SnapshotVersion,\n    value: ObjectValue\n  ): MutableDocument {\n    return new MutableDocument(\n      documentKey,\n      DocumentType.FOUND_DOCUMENT,\n      /* version */ version,\n      /* readTime */ SnapshotVersion.min(),\n      /* createTime */ createTime,\n      value,\n      DocumentState.SYNCED\n    );\n  }\n\n  /** Creates a new document that is known to not exist at the given version. */\n  static newNoDocument(\n    documentKey: DocumentKey,\n    version: SnapshotVersion\n  ): MutableDocument {\n    return new MutableDocument(\n      documentKey,\n      DocumentType.NO_DOCUMENT,\n      /* version */ version,\n      /* readTime */ SnapshotVersion.min(),\n      /* createTime */ SnapshotVersion.min(),\n      ObjectValue.empty(),\n      DocumentState.SYNCED\n    );\n  }\n\n  /**\n   * Creates a new document that is known to exist at the given version but\n   * whose data is not known (e.g. a document that was updated without a known\n   * base document).\n   */\n  static newUnknownDocument(\n    documentKey: DocumentKey,\n    version: SnapshotVersion\n  ): MutableDocument {\n    return new MutableDocument(\n      documentKey,\n      DocumentType.UNKNOWN_DOCUMENT,\n      /* version */ version,\n      /* readTime */ SnapshotVersion.min(),\n      /* createTime */ SnapshotVersion.min(),\n      ObjectValue.empty(),\n      DocumentState.HAS_COMMITTED_MUTATIONS\n    );\n  }\n\n  /**\n   * Changes the document type to indicate that it exists and that its version\n   * and data are known.\n   */\n  convertToFoundDocument(\n    version: SnapshotVersion,\n    value: ObjectValue\n  ): MutableDocument {\n    // If a document is switching state from being an invalid or deleted\n    // document to a valid (FOUND_DOCUMENT) document, either due to receiving an\n    // update from Watch or due to applying a local set mutation on top\n    // of a deleted document, our best guess about its createTime would be the\n    // version at which the document transitioned to a FOUND_DOCUMENT.\n    if (\n      this.createTime.isEqual(SnapshotVersion.min()) &&\n      (this.documentType === DocumentType.NO_DOCUMENT ||\n        this.documentType === DocumentType.INVALID)\n    ) {\n      this.createTime = version;\n    }\n    this.version = version;\n    this.documentType = DocumentType.FOUND_DOCUMENT;\n    this.data = value;\n    this.documentState = DocumentState.SYNCED;\n    return this;\n  }\n\n  /**\n   * Changes the document type to indicate that it doesn't exist at the given\n   * version.\n   */\n  convertToNoDocument(version: SnapshotVersion): MutableDocument {\n    this.version = version;\n    this.documentType = DocumentType.NO_DOCUMENT;\n    this.data = ObjectValue.empty();\n    this.documentState = DocumentState.SYNCED;\n    return this;\n  }\n\n  /**\n   * Changes the document type to indicate that it exists at a given version but\n   * that its data is not known (e.g. a document that was updated without a known\n   * base document).\n   */\n  convertToUnknownDocument(version: SnapshotVersion): MutableDocument {\n    this.version = version;\n    this.documentType = DocumentType.UNKNOWN_DOCUMENT;\n    this.data = ObjectValue.empty();\n    this.documentState = DocumentState.HAS_COMMITTED_MUTATIONS;\n    return this;\n  }\n\n  setHasCommittedMutations(): MutableDocument {\n    debugAssert(\n      this.isValidDocument(),\n      'Invalid documents cannot have committed mutations'\n    );\n    this.documentState = DocumentState.HAS_COMMITTED_MUTATIONS;\n    return this;\n  }\n\n  setHasLocalMutations(): MutableDocument {\n    this.documentState = DocumentState.HAS_LOCAL_MUTATIONS;\n    this.version = SnapshotVersion.min();\n    return this;\n  }\n\n  setReadTime(readTime: SnapshotVersion): MutableDocument {\n    this.readTime = readTime;\n    return this;\n  }\n\n  get hasLocalMutations(): boolean {\n    return this.documentState === DocumentState.HAS_LOCAL_MUTATIONS;\n  }\n\n  get hasCommittedMutations(): boolean {\n    return this.documentState === DocumentState.HAS_COMMITTED_MUTATIONS;\n  }\n\n  get hasPendingWrites(): boolean {\n    return this.hasLocalMutations || this.hasCommittedMutations;\n  }\n\n  isValidDocument(): boolean {\n    return this.documentType !== DocumentType.INVALID;\n  }\n\n  isFoundDocument(): boolean {\n    return this.documentType === DocumentType.FOUND_DOCUMENT;\n  }\n\n  isNoDocument(): boolean {\n    return this.documentType === DocumentType.NO_DOCUMENT;\n  }\n\n  isUnknownDocument(): boolean {\n    return this.documentType === DocumentType.UNKNOWN_DOCUMENT;\n  }\n\n  isEqual(other: Document | null | undefined): boolean {\n    return (\n      other instanceof MutableDocument &&\n      this.key.isEqual(other.key) &&\n      this.version.isEqual(other.version) &&\n      this.documentType === other.documentType &&\n      this.documentState === other.documentState &&\n      this.data.isEqual(other.data)\n    );\n  }\n\n  mutableCopy(): MutableDocument {\n    return new MutableDocument(\n      this.key,\n      this.documentType,\n      this.version,\n      this.readTime,\n      this.createTime,\n      this.data.clone(),\n      this.documentState\n    );\n  }\n\n  toString(): string {\n    return (\n      `Document(${this.key}, ${this.version}, ${JSON.stringify(\n        this.data.value\n      )}, ` +\n      `{createTime: ${this.createTime}}), ` +\n      `{documentType: ${this.documentType}}), ` +\n      `{documentState: ${this.documentState}})`\n    );\n  }\n}\n\n/**\n * Compares the value for field `field` in the provided documents. Throws if\n * the field does not exist in both documents.\n */\nexport function compareDocumentsByField(\n  field: FieldPath,\n  d1: Document,\n  d2: Document\n): number {\n  const v1 = d1.data.field(field);\n  const v2 = d2.data.field(field);\n  if (v1 !== null && v2 !== null) {\n    return valueCompare(v1, v2);\n  } else {\n    return fail(\"Trying to compare documents on fields that don't exist\");\n  }\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Document } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport { isReferenceValue, valueCompare, valueEquals } from '../model/values';\nimport { Value as ProtoValue } from '../protos/firestore_proto_api';\nimport { debugAssert } from '../util/assert';\n\nimport { Direction, OrderBy } from './order_by';\n\n/**\n * Represents a bound of a query.\n *\n * The bound is specified with the given components representing a position and\n * whether it's just before or just after the position (relative to whatever the\n * query order is).\n *\n * The position represents a logical index position for a query. It's a prefix\n * of values for the (potentially implicit) order by clauses of a query.\n *\n * Bound provides a function to determine whether a document comes before or\n * after a bound. This is influenced by whether the position is just before or\n * just after the provided values.\n */\nexport class Bound {\n  constructor(readonly position: ProtoValue[], readonly inclusive: boolean) {}\n}\n\nfunction boundCompareToDocument(\n  bound: Bound,\n  orderBy: OrderBy[],\n  doc: Document\n): number {\n  debugAssert(\n    bound.position.length <= orderBy.length,\n    \"Bound has more components than query's orderBy\"\n  );\n  let comparison = 0;\n  for (let i = 0; i < bound.position.length; i++) {\n    const orderByComponent = orderBy[i];\n    const component = bound.position[i];\n    if (orderByComponent.field.isKeyField()) {\n      debugAssert(\n        isReferenceValue(component),\n        'Bound has a non-key value where the key path is being used.'\n      );\n      comparison = DocumentKey.comparator(\n        DocumentKey.fromName(component.referenceValue),\n        doc.key\n      );\n    } else {\n      const docValue = doc.data.field(orderByComponent.field);\n      debugAssert(\n        docValue !== null,\n        'Field should exist since document matched the orderBy already.'\n      );\n      comparison = valueCompare(component, docValue);\n    }\n    if (orderByComponent.dir === Direction.DESCENDING) {\n      comparison = comparison * -1;\n    }\n    if (comparison !== 0) {\n      break;\n    }\n  }\n  return comparison;\n}\n\n/**\n * Returns true if a document sorts after a bound using the provided sort\n * order.\n */\nexport function boundSortsAfterDocument(\n  bound: Bound,\n  orderBy: OrderBy[],\n  doc: Document\n): boolean {\n  const comparison = boundCompareToDocument(bound, orderBy, doc);\n  return bound.inclusive ? comparison >= 0 : comparison > 0;\n}\n\n/**\n * Returns true if a document sorts before a bound using the provided sort\n * order.\n */\nexport function boundSortsBeforeDocument(\n  bound: Bound,\n  orderBy: OrderBy[],\n  doc: Document\n): boolean {\n  const comparison = boundCompareToDocument(bound, orderBy, doc);\n  return bound.inclusive ? comparison <= 0 : comparison < 0;\n}\n\nexport function boundEquals(left: Bound | null, right: Bound | null): boolean {\n  if (left === null) {\n    return right === null;\n  } else if (right === null) {\n    return false;\n  }\n\n  if (\n    left.inclusive !== right.inclusive ||\n    left.position.length !== right.position.length\n  ) {\n    return false;\n  }\n  for (let i = 0; i < left.position.length; i++) {\n    const leftPosition = left.position[i];\n    const rightPosition = right.position[i];\n    if (!valueEquals(leftPosition, rightPosition)) {\n      return false;\n    }\n  }\n  return true;\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FieldPath } from '../model/path';\n\n/**\n * The direction of sorting in an order by.\n */\nexport const enum Direction {\n  ASCENDING = 'asc',\n  DESCENDING = 'desc'\n}\n\n/**\n * An ordering on a field, in some Direction. Direction defaults to ASCENDING.\n */\nexport class OrderBy {\n  constructor(\n    readonly field: FieldPath,\n    readonly dir: Direction = Direction.ASCENDING\n  ) {}\n}\n\nexport function canonifyOrderBy(orderBy: OrderBy): string {\n  // TODO(b/29183165): Make this collision robust.\n  return orderBy.field.canonicalString() + orderBy.dir;\n}\n\nexport function stringifyOrderBy(orderBy: OrderBy): string {\n  return `${orderBy.field.canonicalString()} (${orderBy.dir})`;\n}\n\nexport function orderByEquals(left: OrderBy, right: OrderBy): boolean {\n  return left.dir === right.dir && left.field.isEqual(right.field);\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Document } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport { FieldPath } from '../model/path';\nimport {\n  arrayValueContains,\n  canonicalId,\n  isArray,\n  isReferenceValue,\n  typeOrder,\n  valueCompare,\n  valueEquals\n} from '../model/values';\nimport { Value as ProtoValue } from '../protos/firestore_proto_api';\nimport { debugAssert, fail } from '../util/assert';\n\n// The operator of a FieldFilter\nexport const enum Operator {\n  LESS_THAN = '<',\n  LESS_THAN_OR_EQUAL = '<=',\n  EQUAL = '==',\n  NOT_EQUAL = '!=',\n  GREATER_THAN = '>',\n  GREATER_THAN_OR_EQUAL = '>=',\n  ARRAY_CONTAINS = 'array-contains',\n  IN = 'in',\n  NOT_IN = 'not-in',\n  ARRAY_CONTAINS_ANY = 'array-contains-any'\n}\n\n// The operator of a CompositeFilter\nexport const enum CompositeOperator {\n  OR = 'or',\n  AND = 'and'\n}\n\nexport abstract class Filter {\n  abstract matches(doc: Document): boolean;\n\n  abstract getFlattenedFilters(): readonly FieldFilter[];\n\n  abstract getFilters(): Filter[];\n}\n\nexport class FieldFilter extends Filter {\n  protected constructor(\n    public readonly field: FieldPath,\n    public readonly op: Operator,\n    public readonly value: ProtoValue\n  ) {\n    super();\n  }\n\n  /**\n   * Creates a filter based on the provided arguments.\n   */\n  static create(\n    field: FieldPath,\n    op: Operator,\n    value: ProtoValue\n  ): FieldFilter {\n    if (field.isKeyField()) {\n      if (op === Operator.IN || op === Operator.NOT_IN) {\n        return this.createKeyFieldInFilter(field, op, value);\n      } else {\n        debugAssert(\n          isReferenceValue(value),\n          'Comparing on key, but filter value not a RefValue'\n        );\n        debugAssert(\n          op !== Operator.ARRAY_CONTAINS && op !== Operator.ARRAY_CONTAINS_ANY,\n          `'${op.toString()}' queries don't make sense on document keys.`\n        );\n        return new KeyFieldFilter(field, op, value);\n      }\n    } else if (op === Operator.ARRAY_CONTAINS) {\n      return new ArrayContainsFilter(field, value);\n    } else if (op === Operator.IN) {\n      debugAssert(\n        isArray(value),\n        'IN filter has invalid value: ' + value.toString()\n      );\n      return new InFilter(field, value);\n    } else if (op === Operator.NOT_IN) {\n      debugAssert(\n        isArray(value),\n        'NOT_IN filter has invalid value: ' + value.toString()\n      );\n      return new NotInFilter(field, value);\n    } else if (op === Operator.ARRAY_CONTAINS_ANY) {\n      debugAssert(\n        isArray(value),\n        'ARRAY_CONTAINS_ANY filter has invalid value: ' + value.toString()\n      );\n      return new ArrayContainsAnyFilter(field, value);\n    } else {\n      return new FieldFilter(field, op, value);\n    }\n  }\n\n  private static createKeyFieldInFilter(\n    field: FieldPath,\n    op: Operator.IN | Operator.NOT_IN,\n    value: ProtoValue\n  ): FieldFilter {\n    debugAssert(\n      isArray(value),\n      `Comparing on key with ${op.toString()}` +\n        ', but filter value not an ArrayValue'\n    );\n    debugAssert(\n      (value.arrayValue.values || []).every(elem => isReferenceValue(elem)),\n      `Comparing on key with ${op.toString()}` +\n        ', but an array value was not a RefValue'\n    );\n\n    return op === Operator.IN\n      ? new KeyFieldInFilter(field, value)\n      : new KeyFieldNotInFilter(field, value);\n  }\n\n  matches(doc: Document): boolean {\n    const other = doc.data.field(this.field);\n    // Types do not have to match in NOT_EQUAL filters.\n    if (this.op === Operator.NOT_EQUAL) {\n      return (\n        other !== null &&\n        this.matchesComparison(valueCompare(other!, this.value))\n      );\n    }\n\n    // Only compare types with matching backend order (such as double and int).\n    return (\n      other !== null &&\n      typeOrder(this.value) === typeOrder(other) &&\n      this.matchesComparison(valueCompare(other, this.value))\n    );\n  }\n\n  protected matchesComparison(comparison: number): boolean {\n    switch (this.op) {\n      case Operator.LESS_THAN:\n        return comparison < 0;\n      case Operator.LESS_THAN_OR_EQUAL:\n        return comparison <= 0;\n      case Operator.EQUAL:\n        return comparison === 0;\n      case Operator.NOT_EQUAL:\n        return comparison !== 0;\n      case Operator.GREATER_THAN:\n        return comparison > 0;\n      case Operator.GREATER_THAN_OR_EQUAL:\n        return comparison >= 0;\n      default:\n        return fail('Unknown FieldFilter operator: ' + this.op);\n    }\n  }\n\n  isInequality(): boolean {\n    return (\n      [\n        Operator.LESS_THAN,\n        Operator.LESS_THAN_OR_EQUAL,\n        Operator.GREATER_THAN,\n        Operator.GREATER_THAN_OR_EQUAL,\n        Operator.NOT_EQUAL,\n        Operator.NOT_IN\n      ].indexOf(this.op) >= 0\n    );\n  }\n\n  getFlattenedFilters(): readonly FieldFilter[] {\n    return [this];\n  }\n\n  getFilters(): Filter[] {\n    return [this];\n  }\n}\n\nexport class CompositeFilter extends Filter {\n  private memoizedFlattenedFilters: FieldFilter[] | null = null;\n\n  protected constructor(\n    public readonly filters: readonly Filter[],\n    public readonly op: CompositeOperator\n  ) {\n    super();\n  }\n\n  /**\n   * Creates a filter based on the provided arguments.\n   */\n  static create(filters: Filter[], op: CompositeOperator): CompositeFilter {\n    return new CompositeFilter(filters, op);\n  }\n\n  matches(doc: Document): boolean {\n    if (compositeFilterIsConjunction(this)) {\n      // For conjunctions, all filters must match, so return false if any filter doesn't match.\n      return this.filters.find(filter => !filter.matches(doc)) === undefined;\n    } else {\n      // For disjunctions, at least one filter should match.\n      return this.filters.find(filter => filter.matches(doc)) !== undefined;\n    }\n  }\n\n  getFlattenedFilters(): readonly FieldFilter[] {\n    if (this.memoizedFlattenedFilters !== null) {\n      return this.memoizedFlattenedFilters;\n    }\n\n    this.memoizedFlattenedFilters = this.filters.reduce((result, subfilter) => {\n      return result.concat(subfilter.getFlattenedFilters());\n    }, [] as FieldFilter[]);\n\n    return this.memoizedFlattenedFilters;\n  }\n\n  // Returns a mutable copy of `this.filters`\n  getFilters(): Filter[] {\n    return Object.assign([], this.filters);\n  }\n}\n\nexport function compositeFilterIsConjunction(\n  compositeFilter: CompositeFilter\n): boolean {\n  return compositeFilter.op === CompositeOperator.AND;\n}\n\nexport function compositeFilterIsDisjunction(\n  compositeFilter: CompositeFilter\n): boolean {\n  return compositeFilter.op === CompositeOperator.OR;\n}\n\n/**\n * Returns true if this filter is a conjunction of field filters only. Returns false otherwise.\n */\nexport function compositeFilterIsFlatConjunction(\n  compositeFilter: CompositeFilter\n): boolean {\n  return (\n    compositeFilterIsFlat(compositeFilter) &&\n    compositeFilterIsConjunction(compositeFilter)\n  );\n}\n\n/**\n * Returns true if this filter does not contain any composite filters. Returns false otherwise.\n */\nexport function compositeFilterIsFlat(\n  compositeFilter: CompositeFilter\n): boolean {\n  for (const filter of compositeFilter.filters) {\n    if (filter instanceof CompositeFilter) {\n      return false;\n    }\n  }\n  return true;\n}\n\nexport function canonifyFilter(filter: Filter): string {\n  debugAssert(\n    filter instanceof FieldFilter || filter instanceof CompositeFilter,\n    'canonifyFilter() only supports FieldFilters and CompositeFilters'\n  );\n\n  if (filter instanceof FieldFilter) {\n    // TODO(b/29183165): Technically, this won't be unique if two values have\n    // the same description, such as the int 3 and the string \"3\". So we should\n    // add the types in here somehow, too.\n    return (\n      filter.field.canonicalString() +\n      filter.op.toString() +\n      canonicalId(filter.value)\n    );\n  } else if (compositeFilterIsFlatConjunction(filter)) {\n    // Older SDK versions use an implicit AND operation between their filters.\n    // In the new SDK versions, the developer may use an explicit AND filter.\n    // To stay consistent with the old usages, we add a special case to ensure\n    // the canonical ID for these two are the same. For example:\n    // `col.whereEquals(\"a\", 1).whereEquals(\"b\", 2)` should have the same\n    // canonical ID as `col.where(and(equals(\"a\",1), equals(\"b\",2)))`.\n    return filter.filters.map(filter => canonifyFilter(filter)).join(',');\n  } else {\n    // filter instanceof CompositeFilter\n    const canonicalIdsString = filter.filters\n      .map(filter => canonifyFilter(filter))\n      .join(',');\n    return `${filter.op}(${canonicalIdsString})`;\n  }\n}\n\nexport function filterEquals(f1: Filter, f2: Filter): boolean {\n  if (f1 instanceof FieldFilter) {\n    return fieldFilterEquals(f1, f2);\n  } else if (f1 instanceof CompositeFilter) {\n    return compositeFilterEquals(f1, f2);\n  } else {\n    fail('Only FieldFilters and CompositeFilters can be compared');\n  }\n}\n\nexport function fieldFilterEquals(f1: FieldFilter, f2: Filter): boolean {\n  return (\n    f2 instanceof FieldFilter &&\n    f1.op === f2.op &&\n    f1.field.isEqual(f2.field) &&\n    valueEquals(f1.value, f2.value)\n  );\n}\n\nexport function compositeFilterEquals(\n  f1: CompositeFilter,\n  f2: Filter\n): boolean {\n  if (\n    f2 instanceof CompositeFilter &&\n    f1.op === f2.op &&\n    f1.filters.length === f2.filters.length\n  ) {\n    const subFiltersMatch: boolean = f1.filters.reduce(\n      (result: boolean, f1Filter: Filter, index: number): boolean =>\n        result && filterEquals(f1Filter, f2.filters[index]),\n      true\n    );\n\n    return subFiltersMatch;\n  }\n\n  return false;\n}\n\n/**\n * Returns a new composite filter that contains all filter from\n * `compositeFilter` plus all the given filters in `otherFilters`.\n */\nexport function compositeFilterWithAddedFilters(\n  compositeFilter: CompositeFilter,\n  otherFilters: Filter[]\n): CompositeFilter {\n  const mergedFilters = compositeFilter.filters.concat(otherFilters);\n  return CompositeFilter.create(mergedFilters, compositeFilter.op);\n}\n\n/** Returns a debug description for `filter`. */\nexport function stringifyFilter(filter: Filter): string {\n  debugAssert(\n    filter instanceof FieldFilter || filter instanceof CompositeFilter,\n    'stringifyFilter() only supports FieldFilters and CompositeFilters'\n  );\n  if (filter instanceof FieldFilter) {\n    return stringifyFieldFilter(filter);\n  } else if (filter instanceof CompositeFilter) {\n    return stringifyCompositeFilter(filter);\n  } else {\n    return 'Filter';\n  }\n}\n\nexport function stringifyCompositeFilter(filter: CompositeFilter): string {\n  return (\n    filter.op.toString() +\n    ` {` +\n    filter.getFilters().map(stringifyFilter).join(' ,') +\n    '}'\n  );\n}\n\nexport function stringifyFieldFilter(filter: FieldFilter): string {\n  return `${filter.field.canonicalString()} ${filter.op} ${canonicalId(\n    filter.value\n  )}`;\n}\n\n/** Filter that matches on key fields (i.e. '__name__'). */\nexport class KeyFieldFilter extends FieldFilter {\n  private readonly key: DocumentKey;\n\n  constructor(field: FieldPath, op: Operator, value: ProtoValue) {\n    super(field, op, value);\n    debugAssert(\n      isReferenceValue(value),\n      'KeyFieldFilter expects a ReferenceValue'\n    );\n    this.key = DocumentKey.fromName(value.referenceValue);\n  }\n\n  matches(doc: Document): boolean {\n    const comparison = DocumentKey.comparator(doc.key, this.key);\n    return this.matchesComparison(comparison);\n  }\n}\n\n/** Filter that matches on key fields within an array. */\nexport class KeyFieldInFilter extends FieldFilter {\n  private readonly keys: DocumentKey[];\n\n  constructor(field: FieldPath, value: ProtoValue) {\n    super(field, Operator.IN, value);\n    this.keys = extractDocumentKeysFromArrayValue(Operator.IN, value);\n  }\n\n  matches(doc: Document): boolean {\n    return this.keys.some(key => key.isEqual(doc.key));\n  }\n}\n\n/** Filter that matches on key fields not present within an array. */\nexport class KeyFieldNotInFilter extends FieldFilter {\n  private readonly keys: DocumentKey[];\n\n  constructor(field: FieldPath, value: ProtoValue) {\n    super(field, Operator.NOT_IN, value);\n    this.keys = extractDocumentKeysFromArrayValue(Operator.NOT_IN, value);\n  }\n\n  matches(doc: Document): boolean {\n    return !this.keys.some(key => key.isEqual(doc.key));\n  }\n}\n\nfunction extractDocumentKeysFromArrayValue(\n  op: Operator.IN | Operator.NOT_IN,\n  value: ProtoValue\n): DocumentKey[] {\n  debugAssert(\n    isArray(value),\n    'KeyFieldInFilter/KeyFieldNotInFilter expects an ArrayValue'\n  );\n  return (value.arrayValue?.values || []).map(v => {\n    debugAssert(\n      isReferenceValue(v),\n      `Comparing on key with ${op.toString()}, but an array value was not ` +\n        `a ReferenceValue`\n    );\n    return DocumentKey.fromName(v.referenceValue);\n  });\n}\n\n/** A Filter that implements the array-contains operator. */\nexport class ArrayContainsFilter extends FieldFilter {\n  constructor(field: FieldPath, value: ProtoValue) {\n    super(field, Operator.ARRAY_CONTAINS, value);\n  }\n\n  matches(doc: Document): boolean {\n    const other = doc.data.field(this.field);\n    return isArray(other) && arrayValueContains(other.arrayValue, this.value);\n  }\n}\n\n/** A Filter that implements the IN operator. */\nexport class InFilter extends FieldFilter {\n  constructor(field: FieldPath, value: ProtoValue) {\n    super(field, Operator.IN, value);\n    debugAssert(isArray(value), 'InFilter expects an ArrayValue');\n  }\n\n  matches(doc: Document): boolean {\n    const other = doc.data.field(this.field);\n    return other !== null && arrayValueContains(this.value.arrayValue!, other);\n  }\n}\n\n/** A Filter that implements the not-in operator. */\nexport class NotInFilter extends FieldFilter {\n  constructor(field: FieldPath, value: ProtoValue) {\n    super(field, Operator.NOT_IN, value);\n    debugAssert(isArray(value), 'NotInFilter expects an ArrayValue');\n  }\n\n  matches(doc: Document): boolean {\n    if (\n      arrayValueContains(this.value.arrayValue!, { nullValue: 'NULL_VALUE' })\n    ) {\n      return false;\n    }\n    const other = doc.data.field(this.field);\n    return other !== null && !arrayValueContains(this.value.arrayValue!, other);\n  }\n}\n\n/** A Filter that implements the array-contains-any operator. */\nexport class ArrayContainsAnyFilter extends FieldFilter {\n  constructor(field: FieldPath, value: ProtoValue) {\n    super(field, Operator.ARRAY_CONTAINS_ANY, value);\n    debugAssert(isArray(value), 'ArrayContainsAnyFilter expects an ArrayValue');\n  }\n\n  matches(doc: Document): boolean {\n    const other = doc.data.field(this.field);\n    if (!isArray(other) || !other.arrayValue.values) {\n      return false;\n    }\n    return other.arrayValue.values.some(val =>\n      arrayValueContains(this.value.arrayValue!, val)\n    );\n  }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DocumentKey } from '../model/document_key';\nimport {\n  FieldIndex,\n  fieldIndexGetArraySegment,\n  fieldIndexGetDirectionalSegments,\n  IndexKind\n} from '../model/field_index';\nimport { FieldPath, ResourcePath } from '../model/path';\nimport {\n  canonicalId,\n  MAX_VALUE,\n  MIN_VALUE,\n  lowerBoundCompare,\n  upperBoundCompare,\n  valuesGetLowerBound,\n  valuesGetUpperBound\n} from '../model/values';\nimport { Value as ProtoValue } from '../protos/firestore_proto_api';\nimport { debugCast } from '../util/assert';\nimport { SortedSet } from '../util/sorted_set';\nimport { isNullOrUndefined } from '../util/types';\n\nimport { Bound, boundEquals } from './bound';\nimport {\n  Filter,\n  FieldFilter,\n  canonifyFilter,\n  stringifyFilter,\n  filterEquals,\n  Operator\n} from './filter';\nimport {\n  canonifyOrderBy,\n  OrderBy,\n  orderByEquals,\n  stringifyOrderBy\n} from './order_by';\n\n/**\n * A Target represents the WatchTarget representation of a Query, which is used\n * by the LocalStore and the RemoteStore to keep track of and to execute\n * backend queries. While a Query can represent multiple Targets, each Targets\n * maps to a single WatchTarget in RemoteStore and a single TargetData entry\n * in persistence.\n */\nexport interface Target {\n  readonly path: ResourcePath;\n  readonly collectionGroup: string | null;\n  readonly orderBy: OrderBy[];\n  readonly filters: Filter[];\n  readonly limit: number | null;\n  readonly startAt: Bound | null;\n  readonly endAt: Bound | null;\n}\n\n// Visible for testing\nexport class TargetImpl implements Target {\n  memoizedCanonicalId: string | null = null;\n  constructor(\n    readonly path: ResourcePath,\n    readonly collectionGroup: string | null = null,\n    readonly orderBy: OrderBy[] = [],\n    readonly filters: Filter[] = [],\n    readonly limit: number | null = null,\n    readonly startAt: Bound | null = null,\n    readonly endAt: Bound | null = null\n  ) {}\n}\n\n/**\n * Initializes a Target with a path and optional additional query constraints.\n * Path must currently be empty if this is a collection group query.\n *\n * NOTE: you should always construct `Target` from `Query.toTarget` instead of\n * using this factory method, because `Query` provides an implicit `orderBy`\n * property.\n */\nexport function newTarget(\n  path: ResourcePath,\n  collectionGroup: string | null = null,\n  orderBy: OrderBy[] = [],\n  filters: Filter[] = [],\n  limit: number | null = null,\n  startAt: Bound | null = null,\n  endAt: Bound | null = null\n): Target {\n  return new TargetImpl(\n    path,\n    collectionGroup,\n    orderBy,\n    filters,\n    limit,\n    startAt,\n    endAt\n  );\n}\n\nexport function canonifyTarget(target: Target): string {\n  const targetImpl = debugCast(target, TargetImpl);\n\n  if (targetImpl.memoizedCanonicalId === null) {\n    let str = targetImpl.path.canonicalString();\n    if (targetImpl.collectionGroup !== null) {\n      str += '|cg:' + targetImpl.collectionGroup;\n    }\n    str += '|f:';\n    str += targetImpl.filters.map(f => canonifyFilter(f)).join(',');\n    str += '|ob:';\n    str += targetImpl.orderBy.map(o => canonifyOrderBy(o)).join(',');\n\n    if (!isNullOrUndefined(targetImpl.limit)) {\n      str += '|l:';\n      str += targetImpl.limit!;\n    }\n    if (targetImpl.startAt) {\n      str += '|lb:';\n      str += targetImpl.startAt.inclusive ? 'b:' : 'a:';\n      str += targetImpl.startAt.position.map(p => canonicalId(p)).join(',');\n    }\n    if (targetImpl.endAt) {\n      str += '|ub:';\n      str += targetImpl.endAt.inclusive ? 'a:' : 'b:';\n      str += targetImpl.endAt.position.map(p => canonicalId(p)).join(',');\n    }\n    targetImpl.memoizedCanonicalId = str;\n  }\n  return targetImpl.memoizedCanonicalId;\n}\n\nexport function stringifyTarget(target: Target): string {\n  let str = target.path.canonicalString();\n  if (target.collectionGroup !== null) {\n    str += ' collectionGroup=' + target.collectionGroup;\n  }\n  if (target.filters.length > 0) {\n    str += `, filters: [${target.filters\n      .map(f => stringifyFilter(f))\n      .join(', ')}]`;\n  }\n  if (!isNullOrUndefined(target.limit)) {\n    str += ', limit: ' + target.limit;\n  }\n  if (target.orderBy.length > 0) {\n    str += `, orderBy: [${target.orderBy\n      .map(o => stringifyOrderBy(o))\n      .join(', ')}]`;\n  }\n  if (target.startAt) {\n    str += ', startAt: ';\n    str += target.startAt.inclusive ? 'b:' : 'a:';\n    str += target.startAt.position.map(p => canonicalId(p)).join(',');\n  }\n  if (target.endAt) {\n    str += ', endAt: ';\n    str += target.endAt.inclusive ? 'a:' : 'b:';\n    str += target.endAt.position.map(p => canonicalId(p)).join(',');\n  }\n  return `Target(${str})`;\n}\n\nexport function targetEquals(left: Target, right: Target): boolean {\n  if (left.limit !== right.limit) {\n    return false;\n  }\n\n  if (left.orderBy.length !== right.orderBy.length) {\n    return false;\n  }\n\n  for (let i = 0; i < left.orderBy.length; i++) {\n    if (!orderByEquals(left.orderBy[i], right.orderBy[i])) {\n      return false;\n    }\n  }\n\n  if (left.filters.length !== right.filters.length) {\n    return false;\n  }\n\n  for (let i = 0; i < left.filters.length; i++) {\n    if (!filterEquals(left.filters[i], right.filters[i])) {\n      return false;\n    }\n  }\n\n  if (left.collectionGroup !== right.collectionGroup) {\n    return false;\n  }\n\n  if (!left.path.isEqual(right.path)) {\n    return false;\n  }\n\n  if (!boundEquals(left.startAt, right.startAt)) {\n    return false;\n  }\n\n  return boundEquals(left.endAt, right.endAt);\n}\n\nexport function targetIsDocumentTarget(target: Target): boolean {\n  return (\n    DocumentKey.isDocumentKey(target.path) &&\n    target.collectionGroup === null &&\n    target.filters.length === 0\n  );\n}\n\n/** Returns the field filters that target the given field path. */\nexport function targetGetFieldFiltersForPath(\n  target: Target,\n  path: FieldPath\n): FieldFilter[] {\n  return target.filters.filter(\n    f => f instanceof FieldFilter && f.field.isEqual(path)\n  ) as FieldFilter[];\n}\n\n/**\n * Returns the values that are used in ARRAY_CONTAINS or ARRAY_CONTAINS_ANY\n * filters. Returns `null` if there are no such filters.\n */\nexport function targetGetArrayValues(\n  target: Target,\n  fieldIndex: FieldIndex\n): ProtoValue[] | null {\n  const segment = fieldIndexGetArraySegment(fieldIndex);\n  if (segment === undefined) {\n    return null;\n  }\n\n  for (const fieldFilter of targetGetFieldFiltersForPath(\n    target,\n    segment.fieldPath\n  )) {\n    switch (fieldFilter.op) {\n      case Operator.ARRAY_CONTAINS_ANY:\n        return fieldFilter.value.arrayValue!.values || [];\n      case Operator.ARRAY_CONTAINS:\n        return [fieldFilter.value];\n      default:\n      // Remaining filters are not array filters.\n    }\n  }\n  return null;\n}\n\n/**\n * Returns the list of values that are used in != or NOT_IN filters. Returns\n * `null` if there are no such filters.\n */\nexport function targetGetNotInValues(\n  target: Target,\n  fieldIndex: FieldIndex\n): ProtoValue[] | null {\n  const values = new Map</* fieldPath = */ string, ProtoValue>();\n\n  for (const segment of fieldIndexGetDirectionalSegments(fieldIndex)) {\n    for (const fieldFilter of targetGetFieldFiltersForPath(\n      target,\n      segment.fieldPath\n    )) {\n      switch (fieldFilter.op) {\n        case Operator.EQUAL:\n        case Operator.IN:\n          // Encode equality prefix, which is encoded in the index value before\n          // the inequality (e.g. `a == 'a' && b != 'b'` is encoded to\n          // `value != 'ab'`).\n          values.set(segment.fieldPath.canonicalString(), fieldFilter.value);\n          break;\n        case Operator.NOT_IN:\n        case Operator.NOT_EQUAL:\n          // NotIn/NotEqual is always a suffix. There cannot be any remaining\n          // segments and hence we can return early here.\n          values.set(segment.fieldPath.canonicalString(), fieldFilter.value);\n          return Array.from(values.values());\n        default:\n        // Remaining filters cannot be used as notIn bounds.\n      }\n    }\n  }\n\n  return null;\n}\n\n/**\n * Returns a lower bound of field values that can be used as a starting point to\n * scan the index defined by `fieldIndex`. Returns `MIN_VALUE` if no lower bound\n * exists.\n */\nexport function targetGetLowerBound(\n  target: Target,\n  fieldIndex: FieldIndex\n): Bound {\n  const values: ProtoValue[] = [];\n  let inclusive = true;\n\n  // For each segment, retrieve a lower bound if there is a suitable filter or\n  // startAt.\n  for (const segment of fieldIndexGetDirectionalSegments(fieldIndex)) {\n    const segmentBound =\n      segment.kind === IndexKind.ASCENDING\n        ? targetGetAscendingBound(target, segment.fieldPath, target.startAt)\n        : targetGetDescendingBound(target, segment.fieldPath, target.startAt);\n\n    values.push(segmentBound.value);\n    inclusive &&= segmentBound.inclusive;\n  }\n  return new Bound(values, inclusive);\n}\n\n/**\n * Returns an upper bound of field values that can be used as an ending point\n * when scanning the index defined by `fieldIndex`. Returns `MAX_VALUE` if no\n * upper bound exists.\n */\nexport function targetGetUpperBound(\n  target: Target,\n  fieldIndex: FieldIndex\n): Bound {\n  const values: ProtoValue[] = [];\n  let inclusive = true;\n\n  // For each segment, retrieve an upper bound if there is a suitable filter or\n  // endAt.\n  for (const segment of fieldIndexGetDirectionalSegments(fieldIndex)) {\n    const segmentBound =\n      segment.kind === IndexKind.ASCENDING\n        ? targetGetDescendingBound(target, segment.fieldPath, target.endAt)\n        : targetGetAscendingBound(target, segment.fieldPath, target.endAt);\n\n    values.push(segmentBound.value);\n    inclusive &&= segmentBound.inclusive;\n  }\n\n  return new Bound(values, inclusive);\n}\n\n/**\n * Returns the value to use as the lower bound for ascending index segment at\n * the provided `fieldPath` (or the upper bound for an descending segment).\n */\nfunction targetGetAscendingBound(\n  target: Target,\n  fieldPath: FieldPath,\n  bound: Bound | null\n): { value: ProtoValue; inclusive: boolean } {\n  let value: ProtoValue = MIN_VALUE;\n\n  let inclusive = true;\n\n  // Process all filters to find a value for the current field segment\n  for (const fieldFilter of targetGetFieldFiltersForPath(target, fieldPath)) {\n    let filterValue: ProtoValue = MIN_VALUE;\n    let filterInclusive = true;\n\n    switch (fieldFilter.op) {\n      case Operator.LESS_THAN:\n      case Operator.LESS_THAN_OR_EQUAL:\n        filterValue = valuesGetLowerBound(fieldFilter.value);\n        break;\n      case Operator.EQUAL:\n      case Operator.IN:\n      case Operator.GREATER_THAN_OR_EQUAL:\n        filterValue = fieldFilter.value;\n        break;\n      case Operator.GREATER_THAN:\n        filterValue = fieldFilter.value;\n        filterInclusive = false;\n        break;\n      case Operator.NOT_EQUAL:\n      case Operator.NOT_IN:\n        filterValue = MIN_VALUE;\n        break;\n      default:\n      // Remaining filters cannot be used as lower bounds.\n    }\n\n    if (\n      lowerBoundCompare(\n        { value, inclusive },\n        { value: filterValue, inclusive: filterInclusive }\n      ) < 0\n    ) {\n      value = filterValue;\n      inclusive = filterInclusive;\n    }\n  }\n\n  // If there is an additional bound, compare the values against the existing\n  // range to see if we can narrow the scope.\n  if (bound !== null) {\n    for (let i = 0; i < target.orderBy.length; ++i) {\n      const orderBy = target.orderBy[i];\n      if (orderBy.field.isEqual(fieldPath)) {\n        const cursorValue = bound.position[i];\n        if (\n          lowerBoundCompare(\n            { value, inclusive },\n            { value: cursorValue, inclusive: bound.inclusive }\n          ) < 0\n        ) {\n          value = cursorValue;\n          inclusive = bound.inclusive;\n        }\n        break;\n      }\n    }\n  }\n\n  return { value, inclusive };\n}\n\n/**\n * Returns the value to use as the upper bound for ascending index segment at\n * the provided `fieldPath` (or the lower bound for a descending segment).\n */\nfunction targetGetDescendingBound(\n  target: Target,\n  fieldPath: FieldPath,\n  bound: Bound | null\n): { value: ProtoValue; inclusive: boolean } {\n  let value: ProtoValue = MAX_VALUE;\n  let inclusive = true;\n\n  // Process all filters to find a value for the current field segment\n  for (const fieldFilter of targetGetFieldFiltersForPath(target, fieldPath)) {\n    let filterValue: ProtoValue = MAX_VALUE;\n    let filterInclusive = true;\n\n    switch (fieldFilter.op) {\n      case Operator.GREATER_THAN_OR_EQUAL:\n      case Operator.GREATER_THAN:\n        filterValue = valuesGetUpperBound(fieldFilter.value);\n        filterInclusive = false;\n        break;\n      case Operator.EQUAL:\n      case Operator.IN:\n      case Operator.LESS_THAN_OR_EQUAL:\n        filterValue = fieldFilter.value;\n        break;\n      case Operator.LESS_THAN:\n        filterValue = fieldFilter.value;\n        filterInclusive = false;\n        break;\n      case Operator.NOT_EQUAL:\n      case Operator.NOT_IN:\n        filterValue = MAX_VALUE;\n        break;\n      default:\n      // Remaining filters cannot be used as upper bounds.\n    }\n\n    if (\n      upperBoundCompare(\n        { value, inclusive },\n        { value: filterValue, inclusive: filterInclusive }\n      ) > 0\n    ) {\n      value = filterValue;\n      inclusive = filterInclusive;\n    }\n  }\n\n  // If there is an additional bound, compare the values against the existing\n  // range to see if we can narrow the scope.\n  if (bound !== null) {\n    for (let i = 0; i < target.orderBy.length; ++i) {\n      const orderBy = target.orderBy[i];\n      if (orderBy.field.isEqual(fieldPath)) {\n        const cursorValue = bound.position[i];\n        if (\n          upperBoundCompare(\n            { value, inclusive },\n            { value: cursorValue, inclusive: bound.inclusive }\n          ) > 0\n        ) {\n          value = cursorValue;\n          inclusive = bound.inclusive;\n        }\n        break;\n      }\n    }\n  }\n\n  return { value, inclusive };\n}\n\n/** Returns the number of segments of a perfect index for this target. */\nexport function targetGetSegmentCount(target: Target): number {\n  let fields = new SortedSet<FieldPath>(FieldPath.comparator);\n  let hasArraySegment = false;\n\n  for (const filter of target.filters) {\n    for (const subFilter of filter.getFlattenedFilters()) {\n      // __name__ is not an explicit segment of any index, so we don't need to\n      // count it.\n      if (subFilter.field.isKeyField()) {\n        continue;\n      }\n\n      // ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filters must be counted separately.\n      // For instance, it is possible to have an index for \"a ARRAY a ASC\". Even\n      // though these are on the same field, they should be counted as two\n      // separate segments in an index.\n      if (\n        subFilter.op === Operator.ARRAY_CONTAINS ||\n        subFilter.op === Operator.ARRAY_CONTAINS_ANY\n      ) {\n        hasArraySegment = true;\n      } else {\n        fields = fields.add(subFilter.field);\n      }\n    }\n  }\n\n  for (const orderBy of target.orderBy) {\n    // __name__ is not an explicit segment of any index, so we don't need to\n    // count it.\n    if (!orderBy.field.isKeyField()) {\n      fields = fields.add(orderBy.field);\n    }\n  }\n\n  return fields.size + (hasArraySegment ? 1 : 0);\n}\n\nexport function targetHasLimit(target: Target): boolean {\n  return target.limit !== null;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { compareDocumentsByField, Document } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport { FieldPath, ResourcePath } from '../model/path';\nimport { debugAssert, debugCast, fail } from '../util/assert';\nimport { SortedSet } from '../util/sorted_set';\n\nimport {\n  Bound,\n  boundSortsAfterDocument,\n  boundSortsBeforeDocument\n} from './bound';\nimport { FieldFilter, Filter } from './filter';\nimport { Direction, OrderBy } from './order_by';\nimport {\n  canonifyTarget,\n  newTarget,\n  stringifyTarget,\n  Target,\n  targetEquals\n} from './target';\n\nexport const enum LimitType {\n  First = 'F',\n  Last = 'L'\n}\n\n/**\n * The Query interface defines all external properties of a query.\n *\n * QueryImpl implements this interface to provide memoization for `queryNormalizedOrderBy`\n * and `queryToTarget`.\n */\nexport interface Query {\n  readonly path: ResourcePath;\n  readonly collectionGroup: string | null;\n  readonly explicitOrderBy: OrderBy[];\n  readonly filters: Filter[];\n  readonly limit: number | null;\n  readonly limitType: LimitType;\n  readonly startAt: Bound | null;\n  readonly endAt: Bound | null;\n}\n\n/**\n * Query encapsulates all the query attributes we support in the SDK. It can\n * be run against the LocalStore, as well as be converted to a `Target` to\n * query the RemoteStore results.\n *\n * Visible for testing.\n */\nexport class QueryImpl implements Query {\n  memoizedNormalizedOrderBy: OrderBy[] | null = null;\n\n  // The corresponding `Target` of this `Query` instance, for use with\n  // non-aggregate queries.\n  memoizedTarget: Target | null = null;\n\n  // The corresponding `Target` of this `Query` instance, for use with\n  // aggregate queries. Unlike targets for non-aggregate queries,\n  // aggregate query targets do not contain normalized order-bys, they only\n  // contain explicit order-bys.\n  memoizedAggregateTarget: Target | null = null;\n\n  /**\n   * Initializes a Query with a path and optional additional query constraints.\n   * Path must currently be empty if this is a collection group query.\n   */\n  constructor(\n    readonly path: ResourcePath,\n    readonly collectionGroup: string | null = null,\n    readonly explicitOrderBy: OrderBy[] = [],\n    readonly filters: Filter[] = [],\n    readonly limit: number | null = null,\n    readonly limitType: LimitType = LimitType.First,\n    readonly startAt: Bound | null = null,\n    readonly endAt: Bound | null = null\n  ) {\n    if (this.startAt) {\n      debugAssert(\n        this.startAt.position.length <= queryNormalizedOrderBy(this).length,\n        'Bound is longer than orderBy'\n      );\n    }\n    if (this.endAt) {\n      debugAssert(\n        this.endAt.position.length <= queryNormalizedOrderBy(this).length,\n        'Bound is longer than orderBy'\n      );\n    }\n  }\n}\n\n/** Creates a new Query instance with the options provided. */\nexport function newQuery(\n  path: ResourcePath,\n  collectionGroup: string | null,\n  explicitOrderBy: OrderBy[],\n  filters: Filter[],\n  limit: number | null,\n  limitType: LimitType,\n  startAt: Bound | null,\n  endAt: Bound | null\n): Query {\n  return new QueryImpl(\n    path,\n    collectionGroup,\n    explicitOrderBy,\n    filters,\n    limit,\n    limitType,\n    startAt,\n    endAt\n  );\n}\n\n/** Creates a new Query for a query that matches all documents at `path` */\nexport function newQueryForPath(path: ResourcePath): Query {\n  return new QueryImpl(path);\n}\n\n/**\n * Helper to convert a collection group query into a collection query at a\n * specific path. This is used when executing collection group queries, since\n * we have to split the query into a set of collection queries at multiple\n * paths.\n */\nexport function asCollectionQueryAtPath(\n  query: Query,\n  path: ResourcePath\n): Query {\n  return new QueryImpl(\n    path,\n    /*collectionGroup=*/ null,\n    query.explicitOrderBy.slice(),\n    query.filters.slice(),\n    query.limit,\n    query.limitType,\n    query.startAt,\n    query.endAt\n  );\n}\n\n/**\n * Returns true if this query does not specify any query constraints that\n * could remove results.\n */\nexport function queryMatchesAllDocuments(query: Query): boolean {\n  return (\n    query.filters.length === 0 &&\n    query.limit === null &&\n    query.startAt == null &&\n    query.endAt == null &&\n    (query.explicitOrderBy.length === 0 ||\n      (query.explicitOrderBy.length === 1 &&\n        query.explicitOrderBy[0].field.isKeyField()))\n  );\n}\n\n// Returns the sorted set of inequality filter fields used in this query.\nexport function getInequalityFilterFields(query: Query): SortedSet<FieldPath> {\n  let result = new SortedSet<FieldPath>(FieldPath.comparator);\n  query.filters.forEach((filter: Filter) => {\n    const subFilters = filter.getFlattenedFilters();\n    subFilters.forEach((filter: FieldFilter) => {\n      if (filter.isInequality()) {\n        result = result.add(filter.field);\n      }\n    });\n  });\n  return result;\n}\n\n/**\n * Creates a new Query for a collection group query that matches all documents\n * within the provided collection group.\n */\nexport function newQueryForCollectionGroup(collectionId: string): Query {\n  return new QueryImpl(ResourcePath.emptyPath(), collectionId);\n}\n\n/**\n * Returns whether the query matches a single document by path (rather than a\n * collection).\n */\nexport function isDocumentQuery(query: Query): boolean {\n  return (\n    DocumentKey.isDocumentKey(query.path) &&\n    query.collectionGroup === null &&\n    query.filters.length === 0\n  );\n}\n\n/**\n * Returns whether the query matches a collection group rather than a specific\n * collection.\n */\nexport function isCollectionGroupQuery(query: Query): boolean {\n  return query.collectionGroup !== null;\n}\n\n/**\n * Returns the normalized order-by constraint that is used to execute the Query,\n * which can be different from the order-by constraints the user provided (e.g.\n * the SDK and backend always orders by `__name__`). The normalized order-by\n * includes implicit order-bys in addition to the explicit user provided\n * order-bys.\n */\nexport function queryNormalizedOrderBy(query: Query): OrderBy[] {\n  const queryImpl = debugCast(query, QueryImpl);\n  if (queryImpl.memoizedNormalizedOrderBy === null) {\n    queryImpl.memoizedNormalizedOrderBy = [];\n    const fieldsNormalized = new Set<string>();\n\n    // Any explicit order by fields should be added as is.\n    for (const orderBy of queryImpl.explicitOrderBy) {\n      queryImpl.memoizedNormalizedOrderBy.push(orderBy);\n      fieldsNormalized.add(orderBy.field.canonicalString());\n    }\n\n    // The order of the implicit ordering always matches the last explicit order by.\n    const lastDirection =\n      queryImpl.explicitOrderBy.length > 0\n        ? queryImpl.explicitOrderBy[queryImpl.explicitOrderBy.length - 1].dir\n        : Direction.ASCENDING;\n\n    // Any inequality fields not explicitly ordered should be implicitly ordered in a lexicographical\n    // order. When there are multiple inequality filters on the same field, the field should be added\n    // only once.\n    // Note: `SortedSet<FieldPath>` sorts the key field before other fields. However, we want the key\n    // field to be sorted last.\n    const inequalityFields: SortedSet<FieldPath> =\n      getInequalityFilterFields(queryImpl);\n    inequalityFields.forEach(field => {\n      if (\n        !fieldsNormalized.has(field.canonicalString()) &&\n        !field.isKeyField()\n      ) {\n        queryImpl.memoizedNormalizedOrderBy!.push(\n          new OrderBy(field, lastDirection)\n        );\n      }\n    });\n\n    // Add the document key field to the last if it is not explicitly ordered.\n    if (!fieldsNormalized.has(FieldPath.keyField().canonicalString())) {\n      queryImpl.memoizedNormalizedOrderBy.push(\n        new OrderBy(FieldPath.keyField(), lastDirection)\n      );\n    }\n  }\n  return queryImpl.memoizedNormalizedOrderBy;\n}\n\n/**\n * Converts this `Query` instance to its corresponding `Target` representation.\n */\nexport function queryToTarget(query: Query): Target {\n  const queryImpl = debugCast(query, QueryImpl);\n  if (!queryImpl.memoizedTarget) {\n    queryImpl.memoizedTarget = _queryToTarget(\n      queryImpl,\n      queryNormalizedOrderBy(query)\n    );\n  }\n\n  return queryImpl.memoizedTarget;\n}\n\n/**\n * Converts this `Query` instance to its corresponding `Target` representation,\n * for use within an aggregate query. Unlike targets for non-aggregate queries,\n * aggregate query targets do not contain normalized order-bys, they only\n * contain explicit order-bys.\n */\nexport function queryToAggregateTarget(query: Query): Target {\n  const queryImpl = debugCast(query, QueryImpl);\n\n  if (!queryImpl.memoizedAggregateTarget) {\n    // Do not include implicit order-bys for aggregate queries.\n    queryImpl.memoizedAggregateTarget = _queryToTarget(\n      queryImpl,\n      query.explicitOrderBy\n    );\n  }\n\n  return queryImpl.memoizedAggregateTarget;\n}\n\nfunction _queryToTarget(queryImpl: QueryImpl, orderBys: OrderBy[]): Target {\n  if (queryImpl.limitType === LimitType.First) {\n    return newTarget(\n      queryImpl.path,\n      queryImpl.collectionGroup,\n      orderBys,\n      queryImpl.filters,\n      queryImpl.limit,\n      queryImpl.startAt,\n      queryImpl.endAt\n    );\n  } else {\n    // Flip the orderBy directions since we want the last results\n    orderBys = orderBys.map(orderBy => {\n      const dir =\n        orderBy.dir === Direction.DESCENDING\n          ? Direction.ASCENDING\n          : Direction.DESCENDING;\n      return new OrderBy(orderBy.field, dir);\n    });\n\n    // We need to swap the cursors to match the now-flipped query ordering.\n    const startAt = queryImpl.endAt\n      ? new Bound(queryImpl.endAt.position, queryImpl.endAt.inclusive)\n      : null;\n    const endAt = queryImpl.startAt\n      ? new Bound(queryImpl.startAt.position, queryImpl.startAt.inclusive)\n      : null;\n\n    // Now return as a LimitType.First query.\n    return newTarget(\n      queryImpl.path,\n      queryImpl.collectionGroup,\n      orderBys,\n      queryImpl.filters,\n      queryImpl.limit,\n      startAt,\n      endAt\n    );\n  }\n}\n\nexport function queryWithAddedFilter(query: Query, filter: Filter): Query {\n  debugAssert(\n    !isDocumentQuery(query),\n    'No filtering allowed for document query'\n  );\n\n  const newFilters = query.filters.concat([filter]);\n  return new QueryImpl(\n    query.path,\n    query.collectionGroup,\n    query.explicitOrderBy.slice(),\n    newFilters,\n    query.limit,\n    query.limitType,\n    query.startAt,\n    query.endAt\n  );\n}\n\nexport function queryWithAddedOrderBy(query: Query, orderBy: OrderBy): Query {\n  debugAssert(\n    !query.startAt && !query.endAt,\n    'Bounds must be set after orderBy'\n  );\n  // TODO(dimond): validate that orderBy does not list the same key twice.\n  const newOrderBy = query.explicitOrderBy.concat([orderBy]);\n  return new QueryImpl(\n    query.path,\n    query.collectionGroup,\n    newOrderBy,\n    query.filters.slice(),\n    query.limit,\n    query.limitType,\n    query.startAt,\n    query.endAt\n  );\n}\n\nexport function queryWithLimit(\n  query: Query,\n  limit: number | null,\n  limitType: LimitType\n): Query {\n  return new QueryImpl(\n    query.path,\n    query.collectionGroup,\n    query.explicitOrderBy.slice(),\n    query.filters.slice(),\n    limit,\n    limitType,\n    query.startAt,\n    query.endAt\n  );\n}\n\nexport function queryWithStartAt(query: Query, bound: Bound): Query {\n  return new QueryImpl(\n    query.path,\n    query.collectionGroup,\n    query.explicitOrderBy.slice(),\n    query.filters.slice(),\n    query.limit,\n    query.limitType,\n    bound,\n    query.endAt\n  );\n}\n\nexport function queryWithEndAt(query: Query, bound: Bound): Query {\n  return new QueryImpl(\n    query.path,\n    query.collectionGroup,\n    query.explicitOrderBy.slice(),\n    query.filters.slice(),\n    query.limit,\n    query.limitType,\n    query.startAt,\n    bound\n  );\n}\n\nexport function queryEquals(left: Query, right: Query): boolean {\n  return (\n    targetEquals(queryToTarget(left), queryToTarget(right)) &&\n    left.limitType === right.limitType\n  );\n}\n\n// TODO(b/29183165): This is used to get a unique string from a query to, for\n// example, use as a dictionary key, but the implementation is subject to\n// collisions. Make it collision-free.\nexport function canonifyQuery(query: Query): string {\n  return `${canonifyTarget(queryToTarget(query))}|lt:${query.limitType}`;\n}\n\nexport function stringifyQuery(query: Query): string {\n  return `Query(target=${stringifyTarget(queryToTarget(query))}; limitType=${\n    query.limitType\n  })`;\n}\n\n/** Returns whether `doc` matches the constraints of `query`. */\nexport function queryMatches(query: Query, doc: Document): boolean {\n  return (\n    doc.isFoundDocument() &&\n    queryMatchesPathAndCollectionGroup(query, doc) &&\n    queryMatchesOrderBy(query, doc) &&\n    queryMatchesFilters(query, doc) &&\n    queryMatchesBounds(query, doc)\n  );\n}\n\nfunction queryMatchesPathAndCollectionGroup(\n  query: Query,\n  doc: Document\n): boolean {\n  const docPath = doc.key.path;\n  if (query.collectionGroup !== null) {\n    // NOTE: this.path is currently always empty since we don't expose Collection\n    // Group queries rooted at a document path yet.\n    return (\n      doc.key.hasCollectionId(query.collectionGroup) &&\n      query.path.isPrefixOf(docPath)\n    );\n  } else if (DocumentKey.isDocumentKey(query.path)) {\n    // exact match for document queries\n    return query.path.isEqual(docPath);\n  } else {\n    // shallow ancestor queries by default\n    return query.path.isImmediateParentOf(docPath);\n  }\n}\n\n/**\n * A document must have a value for every ordering clause in order to show up\n * in the results.\n */\nfunction queryMatchesOrderBy(query: Query, doc: Document): boolean {\n  // We must use `queryNormalizedOrderBy()` to get the list of all orderBys (both implicit and explicit).\n  // Note that for OR queries, orderBy applies to all disjunction terms and implicit orderBys must\n  // be taken into account. For example, the query \"a > 1 || b==1\" has an implicit \"orderBy a\" due\n  // to the inequality, and is evaluated as \"a > 1 orderBy a || b==1 orderBy a\".\n  // A document with content of {b:1} matches the filters, but does not match the orderBy because\n  // it's missing the field 'a'.\n  for (const orderBy of queryNormalizedOrderBy(query)) {\n    // order-by key always matches\n    if (!orderBy.field.isKeyField() && doc.data.field(orderBy.field) === null) {\n      return false;\n    }\n  }\n  return true;\n}\n\nfunction queryMatchesFilters(query: Query, doc: Document): boolean {\n  for (const filter of query.filters) {\n    if (!filter.matches(doc)) {\n      return false;\n    }\n  }\n  return true;\n}\n\n/** Makes sure a document is within the bounds, if provided. */\nfunction queryMatchesBounds(query: Query, doc: Document): boolean {\n  if (\n    query.startAt &&\n    !boundSortsBeforeDocument(query.startAt, queryNormalizedOrderBy(query), doc)\n  ) {\n    return false;\n  }\n  if (\n    query.endAt &&\n    !boundSortsAfterDocument(query.endAt, queryNormalizedOrderBy(query), doc)\n  ) {\n    return false;\n  }\n  return true;\n}\n\n/**\n * Returns the collection group that this query targets.\n *\n * PORTING NOTE: This is only used in the Web SDK to facilitate multi-tab\n * synchronization for query results.\n */\nexport function queryCollectionGroup(query: Query): string {\n  return (\n    query.collectionGroup ||\n    (query.path.length % 2 === 1\n      ? query.path.lastSegment()\n      : query.path.get(query.path.length - 2))\n  );\n}\n\n/**\n * Returns a new comparator function that can be used to compare two documents\n * based on the Query's ordering constraint.\n */\nexport function newQueryComparator(\n  query: Query\n): (d1: Document, d2: Document) => number {\n  return (d1: Document, d2: Document): number => {\n    let comparedOnKeyField = false;\n    for (const orderBy of queryNormalizedOrderBy(query)) {\n      const comp = compareDocs(orderBy, d1, d2);\n      if (comp !== 0) {\n        return comp;\n      }\n      comparedOnKeyField = comparedOnKeyField || orderBy.field.isKeyField();\n    }\n    // Assert that we actually compared by key\n    debugAssert(\n      comparedOnKeyField,\n      \"orderBy used that doesn't compare on key field\"\n    );\n    return 0;\n  };\n}\n\nexport function compareDocs(\n  orderBy: OrderBy,\n  d1: Document,\n  d2: Document\n): number {\n  const comparison = orderBy.field.isKeyField()\n    ? DocumentKey.comparator(d1.key, d2.key)\n    : compareDocumentsByField(orderBy.field, d1, d2);\n  switch (orderBy.dir) {\n    case Direction.ASCENDING:\n      return comparison;\n    case Direction.DESCENDING:\n      return -1 * comparison;\n    default:\n      return fail('Unknown direction: ' + orderBy.dir);\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forEach, isEmpty } from './obj';\n\ntype Entry<K, V> = [K, V];\n\n/**\n * A map implementation that uses objects as keys. Objects must have an\n * associated equals function and must be immutable. Entries in the map are\n * stored together with the key being produced from the mapKeyFn. This map\n * automatically handles collisions of keys.\n */\nexport class ObjectMap<KeyType, ValueType> {\n  /**\n   * The inner map for a key/value pair. Due to the possibility of collisions we\n   * keep a list of entries that we do a linear search through to find an actual\n   * match. Note that collisions should be rare, so we still expect near\n   * constant time lookups in practice.\n   */\n  private inner: {\n    [canonicalId: string]: Array<Entry<KeyType, ValueType>>;\n  } = {};\n\n  /** The number of entries stored in the map */\n  private innerSize = 0;\n\n  constructor(\n    private mapKeyFn: (key: KeyType) => string,\n    private equalsFn: (l: KeyType, r: KeyType) => boolean\n  ) {}\n\n  /** Get a value for this key, or undefined if it does not exist. */\n  get(key: KeyType): ValueType | undefined {\n    const id = this.mapKeyFn(key);\n    const matches = this.inner[id];\n    if (matches === undefined) {\n      return undefined;\n    }\n    for (const [otherKey, value] of matches) {\n      if (this.equalsFn(otherKey, key)) {\n        return value;\n      }\n    }\n    return undefined;\n  }\n\n  has(key: KeyType): boolean {\n    return this.get(key) !== undefined;\n  }\n\n  /** Put this key and value in the map. */\n  set(key: KeyType, value: ValueType): void {\n    const id = this.mapKeyFn(key);\n    const matches = this.inner[id];\n    if (matches === undefined) {\n      this.inner[id] = [[key, value]];\n      this.innerSize++;\n      return;\n    }\n    for (let i = 0; i < matches.length; i++) {\n      if (this.equalsFn(matches[i][0], key)) {\n        // This is updating an existing entry and does not increase `innerSize`.\n        matches[i] = [key, value];\n        return;\n      }\n    }\n    matches.push([key, value]);\n    this.innerSize++;\n  }\n\n  /**\n   * Remove this key from the map. Returns a boolean if anything was deleted.\n   */\n  delete(key: KeyType): boolean {\n    const id = this.mapKeyFn(key);\n    const matches = this.inner[id];\n    if (matches === undefined) {\n      return false;\n    }\n    for (let i = 0; i < matches.length; i++) {\n      if (this.equalsFn(matches[i][0], key)) {\n        if (matches.length === 1) {\n          delete this.inner[id];\n        } else {\n          matches.splice(i, 1);\n        }\n        this.innerSize--;\n        return true;\n      }\n    }\n    return false;\n  }\n\n  forEach(fn: (key: KeyType, val: ValueType) => void): void {\n    forEach(this.inner, (_, entries) => {\n      for (const [k, v] of entries) {\n        fn(k, v);\n      }\n    });\n  }\n\n  isEmpty(): boolean {\n    return isEmpty(this.inner);\n  }\n\n  size(): number {\n    return this.innerSize;\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport { TargetId } from '../core/types';\nimport { OverlayedDocument } from '../local/overlayed_document';\nimport { primitiveComparator } from '../util/misc';\nimport { ObjectMap } from '../util/obj_map';\nimport { SortedMap } from '../util/sorted_map';\nimport { SortedSet } from '../util/sorted_set';\n\nimport { Document, MutableDocument } from './document';\nimport { DocumentKey } from './document_key';\nimport { Mutation } from './mutation';\nimport { Overlay } from './overlay';\n\n/** Miscellaneous collection types / constants. */\n\nexport type MutableDocumentMap = SortedMap<DocumentKey, MutableDocument>;\nconst EMPTY_MUTABLE_DOCUMENT_MAP = new SortedMap<DocumentKey, MutableDocument>(\n  DocumentKey.comparator\n);\nexport function mutableDocumentMap(): MutableDocumentMap {\n  return EMPTY_MUTABLE_DOCUMENT_MAP;\n}\n\nexport interface DocumentSizeEntries {\n  documents: MutableDocumentMap;\n  sizeMap: SortedMap<DocumentKey, number>;\n}\n\nexport type DocumentMap = SortedMap<DocumentKey, Document>;\nconst EMPTY_DOCUMENT_MAP = new SortedMap<DocumentKey, Document>(\n  DocumentKey.comparator\n);\nexport function documentMap(...docs: Document[]): DocumentMap {\n  let map = EMPTY_DOCUMENT_MAP;\n  for (const doc of docs) {\n    map = map.insert(doc.key, doc);\n  }\n  return map;\n}\n\nexport type OverlayedDocumentMap = DocumentKeyMap<OverlayedDocument>;\nexport function newOverlayedDocumentMap(): OverlayedDocumentMap {\n  return newDocumentKeyMap<OverlayedDocument>();\n}\n\nexport function convertOverlayedDocumentMapToDocumentMap(\n  collection: OverlayedDocumentMap\n): DocumentMap {\n  let documents = EMPTY_DOCUMENT_MAP;\n  collection.forEach(\n    (k, v) => (documents = documents.insert(k, v.overlayedDocument))\n  );\n  return documents;\n}\n\nexport type OverlayMap = DocumentKeyMap<Overlay>;\nexport function newOverlayMap(): OverlayMap {\n  return newDocumentKeyMap<Overlay>();\n}\n\nexport type MutationMap = DocumentKeyMap<Mutation>;\nexport function newMutationMap(): MutationMap {\n  return newDocumentKeyMap<Mutation>();\n}\n\nexport type DocumentKeyMap<T> = ObjectMap<DocumentKey, T>;\nexport function newDocumentKeyMap<T>(): DocumentKeyMap<T> {\n  return new ObjectMap<DocumentKey, T>(\n    key => key.toString(),\n    (l, r) => l.isEqual(r)\n  );\n}\n\nexport type DocumentVersionMap = SortedMap<DocumentKey, SnapshotVersion>;\nconst EMPTY_DOCUMENT_VERSION_MAP = new SortedMap<DocumentKey, SnapshotVersion>(\n  DocumentKey.comparator\n);\nexport function documentVersionMap(): DocumentVersionMap {\n  return EMPTY_DOCUMENT_VERSION_MAP;\n}\n\nexport type DocumentKeySet = SortedSet<DocumentKey>;\nconst EMPTY_DOCUMENT_KEY_SET = new SortedSet(DocumentKey.comparator);\nexport function documentKeySet(...keys: DocumentKey[]): DocumentKeySet {\n  let set = EMPTY_DOCUMENT_KEY_SET;\n  for (const key of keys) {\n    set = set.add(key);\n  }\n  return set;\n}\n\nexport type TargetIdSet = SortedSet<TargetId>;\nconst EMPTY_TARGET_ID_SET = new SortedSet<TargetId>(primitiveComparator);\nexport function targetIdSet(): SortedSet<TargetId> {\n  return EMPTY_TARGET_ID_SET;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Value as ProtoValue } from '../protos/firestore_proto_api';\nimport { isNegativeZero, isSafeInteger } from '../util/types';\n\n/** Base interface for the Serializer implementation. */\nexport interface Serializer {\n  readonly useProto3Json: boolean;\n}\n\n/**\n * Returns an DoubleValue for `value` that is encoded based the serializer's\n * `useProto3Json` setting.\n */\nexport function toDouble(serializer: Serializer, value: number): ProtoValue {\n  if (serializer.useProto3Json) {\n    if (isNaN(value)) {\n      return { doubleValue: 'NaN' };\n    } else if (value === Infinity) {\n      return { doubleValue: 'Infinity' };\n    } else if (value === -Infinity) {\n      return { doubleValue: '-Infinity' };\n    }\n  }\n  return { doubleValue: isNegativeZero(value) ? '-0' : value };\n}\n\n/**\n * Returns an IntegerValue for `value`.\n */\nexport function toInteger(value: number): ProtoValue {\n  return { integerValue: '' + value };\n}\n\n/**\n * Returns a value for a number that's appropriate to put into a proto.\n * The return value is an IntegerValue if it can safely represent the value,\n * otherwise a DoubleValue is returned.\n */\nexport function toNumber(serializer: Serializer, value: number): ProtoValue {\n  return isSafeInteger(value) ? toInteger(value) : toDouble(serializer, value);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Timestamp } from '../lite-api/timestamp';\nimport { Value as ProtoValue } from '../protos/firestore_proto_api';\nimport { Serializer, toDouble, toInteger } from '../remote/number_serializer';\nimport { debugAssert } from '../util/assert';\nimport { arrayEquals } from '../util/misc';\n\nimport { normalizeNumber } from './normalize';\nimport { serverTimestamp } from './server_timestamps';\nimport { isArray, isInteger, isNumber, valueEquals } from './values';\n\n/** Used to represent a field transform on a mutation. */\nexport class TransformOperation {\n  // Make sure that the structural type of `TransformOperation` is unique.\n  // See https://github.com/microsoft/TypeScript/issues/5451\n  private _ = undefined;\n}\n\n/**\n * Computes the local transform result against the provided `previousValue`,\n * optionally using the provided localWriteTime.\n */\nexport function applyTransformOperationToLocalView(\n  transform: TransformOperation,\n  previousValue: ProtoValue | null,\n  localWriteTime: Timestamp\n): ProtoValue {\n  if (transform instanceof ServerTimestampTransform) {\n    return serverTimestamp(localWriteTime, previousValue);\n  } else if (transform instanceof ArrayUnionTransformOperation) {\n    return applyArrayUnionTransformOperation(transform, previousValue);\n  } else if (transform instanceof ArrayRemoveTransformOperation) {\n    return applyArrayRemoveTransformOperation(transform, previousValue);\n  } else {\n    debugAssert(\n      transform instanceof NumericIncrementTransformOperation,\n      'Expected NumericIncrementTransformOperation but was: ' + transform\n    );\n    return applyNumericIncrementTransformOperationToLocalView(\n      transform,\n      previousValue\n    );\n  }\n}\n\n/**\n * Computes a final transform result after the transform has been acknowledged\n * by the server, potentially using the server-provided transformResult.\n */\nexport function applyTransformOperationToRemoteDocument(\n  transform: TransformOperation,\n  previousValue: ProtoValue | null,\n  transformResult: ProtoValue | null\n): ProtoValue {\n  // The server just sends null as the transform result for array operations,\n  // so we have to calculate a result the same as we do for local\n  // applications.\n  if (transform instanceof ArrayUnionTransformOperation) {\n    return applyArrayUnionTransformOperation(transform, previousValue);\n  } else if (transform instanceof ArrayRemoveTransformOperation) {\n    return applyArrayRemoveTransformOperation(transform, previousValue);\n  }\n\n  debugAssert(\n    transformResult !== null,\n    \"Didn't receive transformResult for non-array transform\"\n  );\n  return transformResult;\n}\n\n/**\n * If this transform operation is not idempotent, returns the base value to\n * persist for this transform. If a base value is returned, the transform\n * operation is always applied to this base value, even if document has\n * already been updated.\n *\n * Base values provide consistent behavior for non-idempotent transforms and\n * allow us to return the same latency-compensated value even if the backend\n * has already applied the transform operation. The base value is null for\n * idempotent transforms, as they can be re-played even if the backend has\n * already applied them.\n *\n * @returns a base value to store along with the mutation, or null for\n * idempotent transforms.\n */\nexport function computeTransformOperationBaseValue(\n  transform: TransformOperation,\n  previousValue: ProtoValue | null\n): ProtoValue | null {\n  if (transform instanceof NumericIncrementTransformOperation) {\n    return isNumber(previousValue) ? previousValue! : { integerValue: 0 };\n  }\n  return null;\n}\n\nexport function transformOperationEquals(\n  left: TransformOperation,\n  right: TransformOperation\n): boolean {\n  if (\n    left instanceof ArrayUnionTransformOperation &&\n    right instanceof ArrayUnionTransformOperation\n  ) {\n    return arrayEquals(left.elements, right.elements, valueEquals);\n  } else if (\n    left instanceof ArrayRemoveTransformOperation &&\n    right instanceof ArrayRemoveTransformOperation\n  ) {\n    return arrayEquals(left.elements, right.elements, valueEquals);\n  } else if (\n    left instanceof NumericIncrementTransformOperation &&\n    right instanceof NumericIncrementTransformOperation\n  ) {\n    return valueEquals(left.operand, right.operand);\n  }\n\n  return (\n    left instanceof ServerTimestampTransform &&\n    right instanceof ServerTimestampTransform\n  );\n}\n\n/** Transforms a value into a server-generated timestamp. */\nexport class ServerTimestampTransform extends TransformOperation {}\n\n/** Transforms an array value via a union operation. */\nexport class ArrayUnionTransformOperation extends TransformOperation {\n  constructor(readonly elements: ProtoValue[]) {\n    super();\n  }\n}\n\nfunction applyArrayUnionTransformOperation(\n  transform: ArrayUnionTransformOperation,\n  previousValue: ProtoValue | null\n): ProtoValue {\n  const values = coercedFieldValuesArray(previousValue);\n  for (const toUnion of transform.elements) {\n    if (!values.some(element => valueEquals(element, toUnion))) {\n      values.push(toUnion);\n    }\n  }\n  return { arrayValue: { values } };\n}\n\n/** Transforms an array value via a remove operation. */\nexport class ArrayRemoveTransformOperation extends TransformOperation {\n  constructor(readonly elements: ProtoValue[]) {\n    super();\n  }\n}\n\nfunction applyArrayRemoveTransformOperation(\n  transform: ArrayRemoveTransformOperation,\n  previousValue: ProtoValue | null\n): ProtoValue {\n  let values = coercedFieldValuesArray(previousValue);\n  for (const toRemove of transform.elements) {\n    values = values.filter(element => !valueEquals(element, toRemove));\n  }\n  return { arrayValue: { values } };\n}\n\n/**\n * Implements the backend semantics for locally computed NUMERIC_ADD (increment)\n * transforms. Converts all field values to integers or doubles, but unlike the\n * backend does not cap integer values at 2^63. Instead, JavaScript number\n * arithmetic is used and precision loss can occur for values greater than 2^53.\n */\nexport class NumericIncrementTransformOperation extends TransformOperation {\n  constructor(readonly serializer: Serializer, readonly operand: ProtoValue) {\n    super();\n    debugAssert(\n      isNumber(operand),\n      'NumericIncrementTransform transform requires a NumberValue'\n    );\n  }\n}\n\nexport function applyNumericIncrementTransformOperationToLocalView(\n  transform: NumericIncrementTransformOperation,\n  previousValue: ProtoValue | null\n): ProtoValue {\n  // PORTING NOTE: Since JavaScript's integer arithmetic is limited to 53 bit\n  // precision and resolves overflows by reducing precision, we do not\n  // manually cap overflows at 2^63.\n  const baseValue = computeTransformOperationBaseValue(\n    transform,\n    previousValue\n  )!;\n  const sum = asNumber(baseValue) + asNumber(transform.operand);\n  if (isInteger(baseValue) && isInteger(transform.operand)) {\n    return toInteger(sum);\n  } else {\n    return toDouble(transform.serializer, sum);\n  }\n}\n\nfunction asNumber(value: ProtoValue): number {\n  return normalizeNumber(value.integerValue || value.doubleValue);\n}\n\nfunction coercedFieldValuesArray(value: ProtoValue | null): ProtoValue[] {\n  return isArray(value) && value.arrayValue.values\n    ? value.arrayValue.values.slice()\n    : [];\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport { Timestamp } from '../lite-api/timestamp';\nimport { Value as ProtoValue } from '../protos/firestore_proto_api';\nimport { debugAssert, hardAssert } from '../util/assert';\nimport { arrayEquals } from '../util/misc';\nimport { SortedSet } from '../util/sorted_set';\n\nimport { Document, MutableDocument } from './document';\nimport { DocumentKey } from './document_key';\nimport { FieldMask } from './field_mask';\nimport { ObjectValue } from './object_value';\nimport { FieldPath } from './path';\nimport {\n  applyTransformOperationToLocalView,\n  applyTransformOperationToRemoteDocument,\n  computeTransformOperationBaseValue,\n  TransformOperation,\n  transformOperationEquals\n} from './transform_operation';\n\n/** A field path and the TransformOperation to perform upon it. */\nexport class FieldTransform {\n  constructor(\n    readonly field: FieldPath,\n    readonly transform: TransformOperation\n  ) {}\n}\n\nexport function fieldTransformEquals(\n  left: FieldTransform,\n  right: FieldTransform\n): boolean {\n  return (\n    left.field.isEqual(right.field) &&\n    transformOperationEquals(left.transform, right.transform)\n  );\n}\n\nexport function fieldTransformsAreEqual(\n  left?: FieldTransform[],\n  right?: FieldTransform[]\n): boolean {\n  if (left === undefined && right === undefined) {\n    return true;\n  }\n\n  if (left && right) {\n    return arrayEquals(left, right, (l, r) => fieldTransformEquals(l, r));\n  }\n\n  return false;\n}\n\n/** The result of successfully applying a mutation to the backend. */\nexport class MutationResult {\n  constructor(\n    /**\n     * The version at which the mutation was committed:\n     *\n     * - For most operations, this is the updateTime in the WriteResult.\n     * - For deletes, the commitTime of the WriteResponse (because deletes are\n     *   not stored and have no updateTime).\n     *\n     * Note that these versions can be different: No-op writes will not change\n     * the updateTime even though the commitTime advances.\n     */\n    readonly version: SnapshotVersion,\n    /**\n     * The resulting fields returned from the backend after a mutation\n     * containing field transforms has been committed. Contains one FieldValue\n     * for each FieldTransform that was in the mutation.\n     *\n     * Will be empty if the mutation did not contain any field transforms.\n     */\n    readonly transformResults: Array<ProtoValue | null>\n  ) {}\n}\n\nexport const enum MutationType {\n  Set,\n  Patch,\n  Delete,\n  Verify\n}\n\n/**\n * Encodes a precondition for a mutation. This follows the model that the\n * backend accepts with the special case of an explicit \"empty\" precondition\n * (meaning no precondition).\n */\nexport class Precondition {\n  private constructor(\n    readonly updateTime?: SnapshotVersion,\n    readonly exists?: boolean\n  ) {\n    debugAssert(\n      updateTime === undefined || exists === undefined,\n      'Precondition can specify \"exists\" or \"updateTime\" but not both'\n    );\n  }\n\n  /** Creates a new empty Precondition. */\n  static none(): Precondition {\n    return new Precondition();\n  }\n\n  /** Creates a new Precondition with an exists flag. */\n  static exists(exists: boolean): Precondition {\n    return new Precondition(undefined, exists);\n  }\n\n  /** Creates a new Precondition based on a version a document exists at. */\n  static updateTime(version: SnapshotVersion): Precondition {\n    return new Precondition(version);\n  }\n\n  /** Returns whether this Precondition is empty. */\n  get isNone(): boolean {\n    return this.updateTime === undefined && this.exists === undefined;\n  }\n\n  isEqual(other: Precondition): boolean {\n    return (\n      this.exists === other.exists &&\n      (this.updateTime\n        ? !!other.updateTime && this.updateTime.isEqual(other.updateTime)\n        : !other.updateTime)\n    );\n  }\n}\n\n/** Returns true if the preconditions is valid for the given document. */\nexport function preconditionIsValidForDocument(\n  precondition: Precondition,\n  document: MutableDocument\n): boolean {\n  if (precondition.updateTime !== undefined) {\n    return (\n      document.isFoundDocument() &&\n      document.version.isEqual(precondition.updateTime)\n    );\n  } else if (precondition.exists !== undefined) {\n    return precondition.exists === document.isFoundDocument();\n  } else {\n    debugAssert(precondition.isNone, 'Precondition should be empty');\n    return true;\n  }\n}\n\n/**\n * A mutation describes a self-contained change to a document. Mutations can\n * create, replace, delete, and update subsets of documents.\n *\n * Mutations not only act on the value of the document but also its version.\n *\n * For local mutations (mutations that haven't been committed yet), we preserve\n * the existing version for Set and Patch mutations. For Delete mutations, we\n * reset the version to 0.\n *\n * Here's the expected transition table.\n *\n * MUTATION           APPLIED TO            RESULTS IN\n *\n * SetMutation        Document(v3)          Document(v3)\n * SetMutation        NoDocument(v3)        Document(v0)\n * SetMutation        InvalidDocument(v0)   Document(v0)\n * PatchMutation      Document(v3)          Document(v3)\n * PatchMutation      NoDocument(v3)        NoDocument(v3)\n * PatchMutation      InvalidDocument(v0)   UnknownDocument(v3)\n * DeleteMutation     Document(v3)          NoDocument(v0)\n * DeleteMutation     NoDocument(v3)        NoDocument(v0)\n * DeleteMutation     InvalidDocument(v0)   NoDocument(v0)\n *\n * For acknowledged mutations, we use the updateTime of the WriteResponse as\n * the resulting version for Set and Patch mutations. As deletes have no\n * explicit update time, we use the commitTime of the WriteResponse for\n * Delete mutations.\n *\n * If a mutation is acknowledged by the backend but fails the precondition check\n * locally, we transition to an `UnknownDocument` and rely on Watch to send us\n * the updated version.\n *\n * Field transforms are used only with Patch and Set Mutations. We use the\n * `updateTransforms` message to store transforms, rather than the `transforms`s\n * messages.\n *\n * ## Subclassing Notes\n *\n * Every type of mutation needs to implement its own applyToRemoteDocument() and\n * applyToLocalView() to implement the actual behavior of applying the mutation\n * to some source document (see `setMutationApplyToRemoteDocument()` for an\n * example).\n */\nexport abstract class Mutation {\n  abstract readonly type: MutationType;\n  abstract readonly key: DocumentKey;\n  abstract readonly precondition: Precondition;\n  abstract readonly fieldTransforms: FieldTransform[];\n  /**\n   * Returns a `FieldMask` representing the fields that will be changed by\n   * applying this mutation. Returns `null` if the mutation will overwrite the\n   * entire document.\n   */\n  abstract getFieldMask(): FieldMask | null;\n}\n\n/**\n * A utility method to calculate a `Mutation` representing the overlay from the\n * final state of the document, and a `FieldMask` representing the fields that\n * are mutated by the local mutations.\n */\nexport function calculateOverlayMutation(\n  doc: MutableDocument,\n  mask: FieldMask | null\n): Mutation | null {\n  if (!doc.hasLocalMutations || (mask && mask!.fields.length === 0)) {\n    return null;\n  }\n\n  // mask is null when sets or deletes are applied to the current document.\n  if (mask === null) {\n    if (doc.isNoDocument()) {\n      return new DeleteMutation(doc.key, Precondition.none());\n    } else {\n      return new SetMutation(doc.key, doc.data, Precondition.none());\n    }\n  } else {\n    const docValue = doc.data;\n    const patchValue = ObjectValue.empty();\n    let maskSet = new SortedSet<FieldPath>(FieldPath.comparator);\n    for (let path of mask.fields) {\n      if (!maskSet.has(path)) {\n        let value = docValue.field(path);\n        // If we are deleting a nested field, we take the immediate parent as\n        // the mask used to construct the resulting mutation.\n        // Justification: Nested fields can create parent fields implicitly. If\n        // only a leaf entry is deleted in later mutations, the parent field\n        // should still remain, but we may have lost this information.\n        // Consider mutation (foo.bar 1), then mutation (foo.bar delete()).\n        // This leaves the final result (foo, {}). Despite the fact that `doc`\n        // has the correct result, `foo` is not in `mask`, and the resulting\n        // mutation would miss `foo`.\n        if (value === null && path.length > 1) {\n          path = path.popLast();\n          value = docValue.field(path);\n        }\n        if (value === null) {\n          patchValue.delete(path);\n        } else {\n          patchValue.set(path, value);\n        }\n        maskSet = maskSet.add(path);\n      }\n    }\n    return new PatchMutation(\n      doc.key,\n      patchValue,\n      new FieldMask(maskSet.toArray()),\n      Precondition.none()\n    );\n  }\n}\n\n/**\n * Applies this mutation to the given document for the purposes of computing a\n * new remote document. If the input document doesn't match the expected state\n * (e.g. it is invalid or outdated), the document type may transition to\n * unknown.\n *\n * @param mutation - The mutation to apply.\n * @param document - The document to mutate. The input document can be an\n *     invalid document if the client has no knowledge of the pre-mutation state\n *     of the document.\n * @param mutationResult - The result of applying the mutation from the backend.\n */\nexport function mutationApplyToRemoteDocument(\n  mutation: Mutation,\n  document: MutableDocument,\n  mutationResult: MutationResult\n): void {\n  mutationVerifyKeyMatches(mutation, document);\n  if (mutation instanceof SetMutation) {\n    setMutationApplyToRemoteDocument(mutation, document, mutationResult);\n  } else if (mutation instanceof PatchMutation) {\n    patchMutationApplyToRemoteDocument(mutation, document, mutationResult);\n  } else {\n    debugAssert(\n      mutation instanceof DeleteMutation,\n      'Unexpected mutation type: ' + mutation\n    );\n    deleteMutationApplyToRemoteDocument(mutation, document, mutationResult);\n  }\n}\n\n/**\n * Applies this mutation to the given document for the purposes of computing\n * the new local view of a document. If the input document doesn't match the\n * expected state, the document is not modified.\n *\n * @param mutation - The mutation to apply.\n * @param document - The document to mutate. The input document can be an\n *     invalid document if the client has no knowledge of the pre-mutation state\n *     of the document.\n * @param previousMask - The fields that have been updated before applying this mutation.\n * @param localWriteTime - A timestamp indicating the local write time of the\n *     batch this mutation is a part of.\n * @returns A `FieldMask` representing the fields that are changed by applying this mutation.\n */\nexport function mutationApplyToLocalView(\n  mutation: Mutation,\n  document: MutableDocument,\n  previousMask: FieldMask | null,\n  localWriteTime: Timestamp\n): FieldMask | null {\n  mutationVerifyKeyMatches(mutation, document);\n\n  if (mutation instanceof SetMutation) {\n    return setMutationApplyToLocalView(\n      mutation,\n      document,\n      previousMask,\n      localWriteTime\n    );\n  } else if (mutation instanceof PatchMutation) {\n    return patchMutationApplyToLocalView(\n      mutation,\n      document,\n      previousMask,\n      localWriteTime\n    );\n  } else {\n    debugAssert(\n      mutation instanceof DeleteMutation,\n      'Unexpected mutation type: ' + mutation\n    );\n    return deleteMutationApplyToLocalView(mutation, document, previousMask);\n  }\n}\n\n/**\n * If this mutation is not idempotent, returns the base value to persist with\n * this mutation. If a base value is returned, the mutation is always applied\n * to this base value, even if document has already been updated.\n *\n * The base value is a sparse object that consists of only the document\n * fields for which this mutation contains a non-idempotent transformation\n * (e.g. a numeric increment). The provided value guarantees consistent\n * behavior for non-idempotent transforms and allow us to return the same\n * latency-compensated value even if the backend has already applied the\n * mutation. The base value is null for idempotent mutations, as they can be\n * re-played even if the backend has already applied them.\n *\n * @returns a base value to store along with the mutation, or null for\n * idempotent mutations.\n */\nexport function mutationExtractBaseValue(\n  mutation: Mutation,\n  document: Document\n): ObjectValue | null {\n  let baseObject: ObjectValue | null = null;\n  for (const fieldTransform of mutation.fieldTransforms) {\n    const existingValue = document.data.field(fieldTransform.field);\n    const coercedValue = computeTransformOperationBaseValue(\n      fieldTransform.transform,\n      existingValue || null\n    );\n\n    if (coercedValue != null) {\n      if (baseObject === null) {\n        baseObject = ObjectValue.empty();\n      }\n      baseObject.set(fieldTransform.field, coercedValue);\n    }\n  }\n  return baseObject ? baseObject : null;\n}\n\nexport function mutationEquals(left: Mutation, right: Mutation): boolean {\n  if (left.type !== right.type) {\n    return false;\n  }\n\n  if (!left.key.isEqual(right.key)) {\n    return false;\n  }\n\n  if (!left.precondition.isEqual(right.precondition)) {\n    return false;\n  }\n\n  if (!fieldTransformsAreEqual(left.fieldTransforms, right.fieldTransforms)) {\n    return false;\n  }\n\n  if (left.type === MutationType.Set) {\n    return (left as SetMutation).value.isEqual((right as SetMutation).value);\n  }\n\n  if (left.type === MutationType.Patch) {\n    return (\n      (left as PatchMutation).data.isEqual((right as PatchMutation).data) &&\n      (left as PatchMutation).fieldMask.isEqual(\n        (right as PatchMutation).fieldMask\n      )\n    );\n  }\n\n  return true;\n}\n\nfunction mutationVerifyKeyMatches(\n  mutation: Mutation,\n  document: MutableDocument\n): void {\n  debugAssert(\n    document.key.isEqual(mutation.key),\n    'Can only apply a mutation to a document with the same key'\n  );\n}\n\n/**\n * A mutation that creates or replaces the document at the given key with the\n * object value contents.\n */\nexport class SetMutation extends Mutation {\n  constructor(\n    readonly key: DocumentKey,\n    readonly value: ObjectValue,\n    readonly precondition: Precondition,\n    readonly fieldTransforms: FieldTransform[] = []\n  ) {\n    super();\n  }\n\n  readonly type: MutationType = MutationType.Set;\n\n  getFieldMask(): FieldMask | null {\n    return null;\n  }\n}\n\nfunction setMutationApplyToRemoteDocument(\n  mutation: SetMutation,\n  document: MutableDocument,\n  mutationResult: MutationResult\n): void {\n  // Unlike setMutationApplyToLocalView, if we're applying a mutation to a\n  // remote document the server has accepted the mutation so the precondition\n  // must have held.\n  const newData = mutation.value.clone();\n  const transformResults = serverTransformResults(\n    mutation.fieldTransforms,\n    document,\n    mutationResult.transformResults\n  );\n  newData.setAll(transformResults);\n  document\n    .convertToFoundDocument(mutationResult.version, newData)\n    .setHasCommittedMutations();\n}\n\nfunction setMutationApplyToLocalView(\n  mutation: SetMutation,\n  document: MutableDocument,\n  previousMask: FieldMask | null,\n  localWriteTime: Timestamp\n): FieldMask | null {\n  if (!preconditionIsValidForDocument(mutation.precondition, document)) {\n    // The mutation failed to apply (e.g. a document ID created with add()\n    // caused a name collision).\n    return previousMask;\n  }\n\n  const newData = mutation.value.clone();\n  const transformResults = localTransformResults(\n    mutation.fieldTransforms,\n    localWriteTime,\n    document\n  );\n  newData.setAll(transformResults);\n  document\n    .convertToFoundDocument(document.version, newData)\n    .setHasLocalMutations();\n  return null; // SetMutation overwrites all fields.\n}\n\n/**\n * A mutation that modifies fields of the document at the given key with the\n * given values. The values are applied through a field mask:\n *\n *  * When a field is in both the mask and the values, the corresponding field\n *    is updated.\n *  * When a field is in neither the mask nor the values, the corresponding\n *    field is unmodified.\n *  * When a field is in the mask but not in the values, the corresponding field\n *    is deleted.\n *  * When a field is not in the mask but is in the values, the values map is\n *    ignored.\n */\nexport class PatchMutation extends Mutation {\n  constructor(\n    readonly key: DocumentKey,\n    readonly data: ObjectValue,\n    readonly fieldMask: FieldMask,\n    readonly precondition: Precondition,\n    readonly fieldTransforms: FieldTransform[] = []\n  ) {\n    super();\n  }\n\n  readonly type: MutationType = MutationType.Patch;\n\n  getFieldMask(): FieldMask | null {\n    return this.fieldMask;\n  }\n}\n\nfunction patchMutationApplyToRemoteDocument(\n  mutation: PatchMutation,\n  document: MutableDocument,\n  mutationResult: MutationResult\n): void {\n  if (!preconditionIsValidForDocument(mutation.precondition, document)) {\n    // Since the mutation was not rejected, we know that the precondition\n    // matched on the backend. We therefore must not have the expected version\n    // of the document in our cache and convert to an UnknownDocument with a\n    // known updateTime.\n    document.convertToUnknownDocument(mutationResult.version);\n    return;\n  }\n\n  const transformResults = serverTransformResults(\n    mutation.fieldTransforms,\n    document,\n    mutationResult.transformResults\n  );\n  const newData = document.data;\n  newData.setAll(getPatch(mutation));\n  newData.setAll(transformResults);\n  document\n    .convertToFoundDocument(mutationResult.version, newData)\n    .setHasCommittedMutations();\n}\n\nfunction patchMutationApplyToLocalView(\n  mutation: PatchMutation,\n  document: MutableDocument,\n  previousMask: FieldMask | null,\n  localWriteTime: Timestamp\n): FieldMask | null {\n  if (!preconditionIsValidForDocument(mutation.precondition, document)) {\n    return previousMask;\n  }\n\n  const transformResults = localTransformResults(\n    mutation.fieldTransforms,\n    localWriteTime,\n    document\n  );\n  const newData = document.data;\n  newData.setAll(getPatch(mutation));\n  newData.setAll(transformResults);\n  document\n    .convertToFoundDocument(document.version, newData)\n    .setHasLocalMutations();\n\n  if (previousMask === null) {\n    return null;\n  }\n\n  return previousMask\n    .unionWith(mutation.fieldMask.fields)\n    .unionWith(mutation.fieldTransforms.map(transform => transform.field));\n}\n\n/**\n * Returns a FieldPath/Value map with the content of the PatchMutation.\n */\nfunction getPatch(mutation: PatchMutation): Map<FieldPath, ProtoValue | null> {\n  const result = new Map<FieldPath, ProtoValue | null>();\n  mutation.fieldMask.fields.forEach(fieldPath => {\n    if (!fieldPath.isEmpty()) {\n      const newValue = mutation.data.field(fieldPath);\n      result.set(fieldPath, newValue);\n    }\n  });\n  return result;\n}\n\n/**\n * Creates a list of \"transform results\" (a transform result is a field value\n * representing the result of applying a transform) for use after a mutation\n * containing transforms has been acknowledged by the server.\n *\n * @param fieldTransforms - The field transforms to apply the result to.\n * @param mutableDocument - The current state of the document after applying all\n * previous mutations.\n * @param serverTransformResults - The transform results received by the server.\n * @returns The transform results list.\n */\nfunction serverTransformResults(\n  fieldTransforms: FieldTransform[],\n  mutableDocument: MutableDocument,\n  serverTransformResults: Array<ProtoValue | null>\n): Map<FieldPath, ProtoValue> {\n  const transformResults = new Map<FieldPath, ProtoValue>();\n  hardAssert(\n    fieldTransforms.length === serverTransformResults.length,\n    `server transform result count (${serverTransformResults.length}) ` +\n      `should match field transform count (${fieldTransforms.length})`\n  );\n\n  for (let i = 0; i < serverTransformResults.length; i++) {\n    const fieldTransform = fieldTransforms[i];\n    const transform = fieldTransform.transform;\n    const previousValue = mutableDocument.data.field(fieldTransform.field);\n    transformResults.set(\n      fieldTransform.field,\n      applyTransformOperationToRemoteDocument(\n        transform,\n        previousValue,\n        serverTransformResults[i]\n      )\n    );\n  }\n  return transformResults;\n}\n\n/**\n * Creates a list of \"transform results\" (a transform result is a field value\n * representing the result of applying a transform) for use when applying a\n * transform locally.\n *\n * @param fieldTransforms - The field transforms to apply the result to.\n * @param localWriteTime - The local time of the mutation (used to\n *     generate ServerTimestampValues).\n * @param mutableDocument - The document to apply transforms on.\n * @returns The transform results list.\n */\nfunction localTransformResults(\n  fieldTransforms: FieldTransform[],\n  localWriteTime: Timestamp,\n  mutableDocument: MutableDocument\n): Map<FieldPath, ProtoValue> {\n  const transformResults = new Map<FieldPath, ProtoValue>();\n  for (const fieldTransform of fieldTransforms) {\n    const transform = fieldTransform.transform;\n\n    const previousValue = mutableDocument.data.field(fieldTransform.field);\n    transformResults.set(\n      fieldTransform.field,\n      applyTransformOperationToLocalView(\n        transform,\n        previousValue,\n        localWriteTime\n      )\n    );\n  }\n  return transformResults;\n}\n\n/** A mutation that deletes the document at the given key. */\nexport class DeleteMutation extends Mutation {\n  constructor(readonly key: DocumentKey, readonly precondition: Precondition) {\n    super();\n  }\n\n  readonly type: MutationType = MutationType.Delete;\n  readonly fieldTransforms: FieldTransform[] = [];\n\n  getFieldMask(): FieldMask | null {\n    return null;\n  }\n}\n\nfunction deleteMutationApplyToRemoteDocument(\n  mutation: DeleteMutation,\n  document: MutableDocument,\n  mutationResult: MutationResult\n): void {\n  debugAssert(\n    mutationResult.transformResults.length === 0,\n    'Transform results received by DeleteMutation.'\n  );\n\n  // Unlike applyToLocalView, if we're applying a mutation to a remote\n  // document the server has accepted the mutation so the precondition must\n  // have held.\n  document\n    .convertToNoDocument(mutationResult.version)\n    .setHasCommittedMutations();\n}\n\nfunction deleteMutationApplyToLocalView(\n  mutation: DeleteMutation,\n  document: MutableDocument,\n  previousMask: FieldMask | null\n): FieldMask | null {\n  debugAssert(\n    document.key.isEqual(mutation.key),\n    'Can only apply mutation to document with same key'\n  );\n  if (preconditionIsValidForDocument(mutation.precondition, document)) {\n    document.convertToNoDocument(document.version).setHasLocalMutations();\n    return null;\n  }\n  return previousMask;\n}\n\n/**\n * A mutation that verifies the existence of the document at the given key with\n * the provided precondition.\n *\n * The `verify` operation is only used in Transactions, and this class serves\n * primarily to facilitate serialization into protos.\n */\nexport class VerifyMutation extends Mutation {\n  constructor(readonly key: DocumentKey, readonly precondition: Precondition) {\n    super();\n  }\n\n  readonly type: MutationType = MutationType.Verify;\n  readonly fieldTransforms: FieldTransform[] = [];\n\n  getFieldMask(): FieldMask | null {\n    return null;\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport { BatchId } from '../core/types';\nimport { Timestamp } from '../lite-api/timestamp';\nimport { debugAssert, hardAssert } from '../util/assert';\nimport { arrayEquals } from '../util/misc';\n\nimport {\n  documentKeySet,\n  DocumentKeySet,\n  MutationMap,\n  DocumentVersionMap,\n  documentVersionMap,\n  newMutationMap,\n  OverlayedDocumentMap\n} from './collections';\nimport { MutableDocument } from './document';\nimport { FieldMask } from './field_mask';\nimport {\n  calculateOverlayMutation,\n  Mutation,\n  mutationApplyToLocalView,\n  mutationApplyToRemoteDocument,\n  mutationEquals,\n  MutationResult\n} from './mutation';\n\n/**\n * A batch of mutations that will be sent as one unit to the backend.\n */\nexport class MutationBatch {\n  /**\n   * @param batchId - The unique ID of this mutation batch.\n   * @param localWriteTime - The original write time of this mutation.\n   * @param baseMutations - Mutations that are used to populate the base\n   * values when this mutation is applied locally. This can be used to locally\n   * overwrite values that are persisted in the remote document cache. Base\n   * mutations are never sent to the backend.\n   * @param mutations - The user-provided mutations in this mutation batch.\n   * User-provided mutations are applied both locally and remotely on the\n   * backend.\n   */\n  constructor(\n    public batchId: BatchId,\n    public localWriteTime: Timestamp,\n    public baseMutations: Mutation[],\n    public mutations: Mutation[]\n  ) {\n    debugAssert(mutations.length > 0, 'Cannot create an empty mutation batch');\n  }\n\n  /**\n   * Applies all the mutations in this MutationBatch to the specified document\n   * to compute the state of the remote document\n   *\n   * @param document - The document to apply mutations to.\n   * @param batchResult - The result of applying the MutationBatch to the\n   * backend.\n   */\n  applyToRemoteDocument(\n    document: MutableDocument,\n    batchResult: MutationBatchResult\n  ): void {\n    const mutationResults = batchResult.mutationResults;\n    debugAssert(\n      mutationResults.length === this.mutations.length,\n      `Mismatch between mutations length\n      (${this.mutations.length}) and mutation results length\n      (${mutationResults.length}).`\n    );\n\n    for (let i = 0; i < this.mutations.length; i++) {\n      const mutation = this.mutations[i];\n      if (mutation.key.isEqual(document.key)) {\n        const mutationResult = mutationResults[i];\n        mutationApplyToRemoteDocument(mutation, document, mutationResult);\n      }\n    }\n  }\n\n  /**\n   * Computes the local view of a document given all the mutations in this\n   * batch.\n   *\n   * @param document - The document to apply mutations to.\n   * @param mutatedFields - Fields that have been updated before applying this mutation batch.\n   * @returns A `FieldMask` representing all the fields that are mutated.\n   */\n  applyToLocalView(\n    document: MutableDocument,\n    mutatedFields: FieldMask | null\n  ): FieldMask | null {\n    // First, apply the base state. This allows us to apply non-idempotent\n    // transform against a consistent set of values.\n    for (const mutation of this.baseMutations) {\n      if (mutation.key.isEqual(document.key)) {\n        mutatedFields = mutationApplyToLocalView(\n          mutation,\n          document,\n          mutatedFields,\n          this.localWriteTime\n        );\n      }\n    }\n\n    // Second, apply all user-provided mutations.\n    for (const mutation of this.mutations) {\n      if (mutation.key.isEqual(document.key)) {\n        mutatedFields = mutationApplyToLocalView(\n          mutation,\n          document,\n          mutatedFields,\n          this.localWriteTime\n        );\n      }\n    }\n    return mutatedFields;\n  }\n\n  /**\n   * Computes the local view for all provided documents given the mutations in\n   * this batch. Returns a `DocumentKey` to `Mutation` map which can be used to\n   * replace all the mutation applications.\n   */\n  applyToLocalDocumentSet(\n    documentMap: OverlayedDocumentMap,\n    documentsWithoutRemoteVersion: DocumentKeySet\n  ): MutationMap {\n    // TODO(mrschmidt): This implementation is O(n^2). If we apply the mutations\n    // directly (as done in `applyToLocalView()`), we can reduce the complexity\n    // to O(n).\n    const overlays = newMutationMap();\n    this.mutations.forEach(m => {\n      const overlayedDocument = documentMap.get(m.key)!;\n      // TODO(mutabledocuments): This method should take a MutableDocumentMap\n      // and we should remove this cast.\n      const mutableDocument =\n        overlayedDocument.overlayedDocument as MutableDocument;\n      let mutatedFields = this.applyToLocalView(\n        mutableDocument,\n        overlayedDocument.mutatedFields\n      );\n      // Set mutatedFields to null if the document is only from local mutations.\n      // This creates a Set or Delete mutation, instead of trying to create a\n      // patch mutation as the overlay.\n      mutatedFields = documentsWithoutRemoteVersion.has(m.key)\n        ? null\n        : mutatedFields;\n      const overlay = calculateOverlayMutation(mutableDocument, mutatedFields);\n      if (overlay !== null) {\n        overlays.set(m.key, overlay);\n      }\n\n      if (!mutableDocument.isValidDocument()) {\n        mutableDocument.convertToNoDocument(SnapshotVersion.min());\n      }\n    });\n    return overlays;\n  }\n\n  keys(): DocumentKeySet {\n    return this.mutations.reduce(\n      (keys, m) => keys.add(m.key),\n      documentKeySet()\n    );\n  }\n\n  isEqual(other: MutationBatch): boolean {\n    return (\n      this.batchId === other.batchId &&\n      arrayEquals(this.mutations, other.mutations, (l, r) =>\n        mutationEquals(l, r)\n      ) &&\n      arrayEquals(this.baseMutations, other.baseMutations, (l, r) =>\n        mutationEquals(l, r)\n      )\n    );\n  }\n}\n\n/** The result of applying a mutation batch to the backend. */\nexport class MutationBatchResult {\n  private constructor(\n    readonly batch: MutationBatch,\n    readonly commitVersion: SnapshotVersion,\n    readonly mutationResults: MutationResult[],\n    /**\n     * A pre-computed mapping from each mutated document to the resulting\n     * version.\n     */\n    readonly docVersions: DocumentVersionMap\n  ) {}\n\n  /**\n   * Creates a new MutationBatchResult for the given batch and results. There\n   * must be one result for each mutation in the batch. This static factory\n   * caches a document=&gt;version mapping (docVersions).\n   */\n  static from(\n    batch: MutationBatch,\n    commitVersion: SnapshotVersion,\n    results: MutationResult[]\n  ): MutationBatchResult {\n    hardAssert(\n      batch.mutations.length === results.length,\n      'Mutations sent ' +\n        batch.mutations.length +\n        ' must equal results received ' +\n        results.length\n    );\n\n    let versionMap = documentVersionMap();\n    const mutations = batch.mutations;\n    for (let i = 0; i < mutations.length; i++) {\n      versionMap = versionMap.insert(mutations[i].key, results[i].version);\n    }\n\n    return new MutationBatchResult(batch, commitVersion, results, versionMap);\n  }\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DocumentKey } from './document_key';\nimport { Mutation } from './mutation';\n\n/**\n * Representation of an overlay computed by Firestore.\n *\n * Holds information about a mutation and the largest batch id in Firestore when\n * the mutation was created.\n */\nexport class Overlay {\n  constructor(readonly largestBatchId: number, readonly mutation: Mutation) {}\n\n  getKey(): DocumentKey {\n    return this.mutation.key;\n  }\n\n  isEqual(other: Overlay | null): boolean {\n    return other !== null && this.mutation === other.mutation;\n  }\n\n  toString(): string {\n    return `Overlay{\n      largestBatchId: ${this.largestBatchId},\n      mutation: ${this.mutation.toString()}\n    }`;\n  }\n}\n","/**\n * @license\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FieldPath } from '../model/path';\n\n/**\n * Union type representing the aggregate type to be performed.\n */\nexport type AggregateType = 'count' | 'avg' | 'sum';\n\n/**\n * Represents an Aggregate to be performed over a query result set.\n */\nexport interface Aggregate {\n  readonly fieldPath?: FieldPath;\n  readonly alias: string;\n  readonly aggregateType: AggregateType;\n}\n\n/**\n * Concrete implementation of the Aggregate type.\n */\nexport class AggregateImpl implements Aggregate {\n  constructor(\n    readonly alias: string,\n    readonly aggregateType: AggregateType,\n    readonly fieldPath?: FieldPath\n  ) {}\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BloomFilter as ProtoBloomFilter } from '../protos/firestore_proto_api';\n\nexport class ExistenceFilter {\n  constructor(public count: number, public unchangedNames?: ProtoBloomFilter) {}\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { fail } from '../util/assert';\nimport { Code } from '../util/error';\nimport { logError } from '../util/log';\n\n/**\n * Error Codes describing the different ways GRPC can fail. These are copied\n * directly from GRPC's sources here:\n *\n * https://github.com/grpc/grpc/blob/bceec94ea4fc5f0085d81235d8e1c06798dc341a/include/grpc%2B%2B/impl/codegen/status_code_enum.h\n *\n * Important! The names of these identifiers matter because the string forms\n * are used for reverse lookups from the webchannel stream. Do NOT change the\n * names of these identifiers or change this into a const enum.\n */\nenum RpcCode {\n  OK = 0,\n  CANCELLED = 1,\n  UNKNOWN = 2,\n  INVALID_ARGUMENT = 3,\n  DEADLINE_EXCEEDED = 4,\n  NOT_FOUND = 5,\n  ALREADY_EXISTS = 6,\n  PERMISSION_DENIED = 7,\n  UNAUTHENTICATED = 16,\n  RESOURCE_EXHAUSTED = 8,\n  FAILED_PRECONDITION = 9,\n  ABORTED = 10,\n  OUT_OF_RANGE = 11,\n  UNIMPLEMENTED = 12,\n  INTERNAL = 13,\n  UNAVAILABLE = 14,\n  DATA_LOSS = 15\n}\n\n/**\n * Determines whether an error code represents a permanent error when received\n * in response to a non-write operation.\n *\n * See isPermanentWriteError for classifying write errors.\n */\nexport function isPermanentError(code: Code): boolean {\n  switch (code) {\n    case Code.OK:\n      return fail('Treated status OK as error');\n    case Code.CANCELLED:\n    case Code.UNKNOWN:\n    case Code.DEADLINE_EXCEEDED:\n    case Code.RESOURCE_EXHAUSTED:\n    case Code.INTERNAL:\n    case Code.UNAVAILABLE:\n    // Unauthenticated means something went wrong with our token and we need\n    // to retry with new credentials which will happen automatically.\n    case Code.UNAUTHENTICATED:\n      return false;\n    case Code.INVALID_ARGUMENT:\n    case Code.NOT_FOUND:\n    case Code.ALREADY_EXISTS:\n    case Code.PERMISSION_DENIED:\n    case Code.FAILED_PRECONDITION:\n    // Aborted might be retried in some scenarios, but that is dependant on\n    // the context and should handled individually by the calling code.\n    // See https://cloud.google.com/apis/design/errors.\n    case Code.ABORTED:\n    case Code.OUT_OF_RANGE:\n    case Code.UNIMPLEMENTED:\n    case Code.DATA_LOSS:\n      return true;\n    default:\n      return fail('Unknown status code: ' + code);\n  }\n}\n\n/**\n * Determines whether an error code represents a permanent error when received\n * in response to a write operation.\n *\n * Write operations must be handled specially because as of b/119437764, ABORTED\n * errors on the write stream should be retried too (even though ABORTED errors\n * are not generally retryable).\n *\n * Note that during the initial handshake on the write stream an ABORTED error\n * signals that we should discard our stream token (i.e. it is permanent). This\n * means a handshake error should be classified with isPermanentError, above.\n */\nexport function isPermanentWriteError(code: Code): boolean {\n  return isPermanentError(code) && code !== Code.ABORTED;\n}\n\n/**\n * Maps an error Code from a GRPC status identifier like 'NOT_FOUND'.\n *\n * @returns The Code equivalent to the given status string or undefined if\n *     there is no match.\n */\nexport function mapCodeFromRpcStatus(status: string): Code | undefined {\n  // lookup by string\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const code: RpcCode = RpcCode[status as any] as any;\n  if (code === undefined) {\n    return undefined;\n  }\n\n  return mapCodeFromRpcCode(code);\n}\n\n/**\n * Maps an error Code from GRPC status code number, like 0, 1, or 14. These\n * are not the same as HTTP status codes.\n *\n * @returns The Code equivalent to the given GRPC status code. Fails if there\n *     is no match.\n */\nexport function mapCodeFromRpcCode(code: number | undefined): Code {\n  if (code === undefined) {\n    // This shouldn't normally happen, but in certain error cases (like trying\n    // to send invalid proto messages) we may get an error with no GRPC code.\n    logError('GRPC error has no .code');\n    return Code.UNKNOWN;\n  }\n\n  switch (code) {\n    case RpcCode.OK:\n      return Code.OK;\n    case RpcCode.CANCELLED:\n      return Code.CANCELLED;\n    case RpcCode.UNKNOWN:\n      return Code.UNKNOWN;\n    case RpcCode.DEADLINE_EXCEEDED:\n      return Code.DEADLINE_EXCEEDED;\n    case RpcCode.RESOURCE_EXHAUSTED:\n      return Code.RESOURCE_EXHAUSTED;\n    case RpcCode.INTERNAL:\n      return Code.INTERNAL;\n    case RpcCode.UNAVAILABLE:\n      return Code.UNAVAILABLE;\n    case RpcCode.UNAUTHENTICATED:\n      return Code.UNAUTHENTICATED;\n    case RpcCode.INVALID_ARGUMENT:\n      return Code.INVALID_ARGUMENT;\n    case RpcCode.NOT_FOUND:\n      return Code.NOT_FOUND;\n    case RpcCode.ALREADY_EXISTS:\n      return Code.ALREADY_EXISTS;\n    case RpcCode.PERMISSION_DENIED:\n      return Code.PERMISSION_DENIED;\n    case RpcCode.FAILED_PRECONDITION:\n      return Code.FAILED_PRECONDITION;\n    case RpcCode.ABORTED:\n      return Code.ABORTED;\n    case RpcCode.OUT_OF_RANGE:\n      return Code.OUT_OF_RANGE;\n    case RpcCode.UNIMPLEMENTED:\n      return Code.UNIMPLEMENTED;\n    case RpcCode.DATA_LOSS:\n      return Code.DATA_LOSS;\n    default:\n      return fail('Unknown status code: ' + code);\n  }\n}\n\n/**\n * Maps an RPC code from a Code. This is the reverse operation from\n * mapCodeFromRpcCode and should really only be used in tests.\n */\nexport function mapRpcCodeFromCode(code: Code | undefined): number {\n  if (code === undefined) {\n    return RpcCode.OK;\n  }\n\n  switch (code) {\n    case Code.OK:\n      return RpcCode.OK;\n    case Code.CANCELLED:\n      return RpcCode.CANCELLED;\n    case Code.UNKNOWN:\n      return RpcCode.UNKNOWN;\n    case Code.DEADLINE_EXCEEDED:\n      return RpcCode.DEADLINE_EXCEEDED;\n    case Code.RESOURCE_EXHAUSTED:\n      return RpcCode.RESOURCE_EXHAUSTED;\n    case Code.INTERNAL:\n      return RpcCode.INTERNAL;\n    case Code.UNAVAILABLE:\n      return RpcCode.UNAVAILABLE;\n    case Code.UNAUTHENTICATED:\n      return RpcCode.UNAUTHENTICATED;\n    case Code.INVALID_ARGUMENT:\n      return RpcCode.INVALID_ARGUMENT;\n    case Code.NOT_FOUND:\n      return RpcCode.NOT_FOUND;\n    case Code.ALREADY_EXISTS:\n      return RpcCode.ALREADY_EXISTS;\n    case Code.PERMISSION_DENIED:\n      return RpcCode.PERMISSION_DENIED;\n    case Code.FAILED_PRECONDITION:\n      return RpcCode.FAILED_PRECONDITION;\n    case Code.ABORTED:\n      return RpcCode.ABORTED;\n    case Code.OUT_OF_RANGE:\n      return RpcCode.OUT_OF_RANGE;\n    case Code.UNIMPLEMENTED:\n      return RpcCode.UNIMPLEMENTED;\n    case Code.DATA_LOSS:\n      return RpcCode.DATA_LOSS;\n    default:\n      return fail('Unknown status code: ' + code);\n  }\n}\n\n/**\n * Converts an HTTP Status Code to the equivalent error code.\n *\n * @param status - An HTTP Status Code, like 200, 404, 503, etc.\n * @returns The equivalent Code. Unknown status codes are mapped to\n *     Code.UNKNOWN.\n */\nexport function mapCodeFromHttpStatus(status?: number): Code {\n  if (status === undefined) {\n    logError('RPC_ERROR', 'HTTP error has no status');\n    return Code.UNKNOWN;\n  }\n\n  // The canonical error codes for Google APIs [1] specify mapping onto HTTP\n  // status codes but the mapping is not bijective. In each case of ambiguity\n  // this function chooses a primary error.\n  //\n  // [1]\n  // https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto\n  switch (status) {\n    case 200: // OK\n      return Code.OK;\n\n    case 400: // Bad Request\n      return Code.FAILED_PRECONDITION;\n    // Other possibilities based on the forward mapping\n    // return Code.INVALID_ARGUMENT;\n    // return Code.OUT_OF_RANGE;\n\n    case 401: // Unauthorized\n      return Code.UNAUTHENTICATED;\n\n    case 403: // Forbidden\n      return Code.PERMISSION_DENIED;\n\n    case 404: // Not Found\n      return Code.NOT_FOUND;\n\n    case 409: // Conflict\n      return Code.ABORTED;\n    // Other possibilities:\n    // return Code.ALREADY_EXISTS;\n\n    case 416: // Range Not Satisfiable\n      return Code.OUT_OF_RANGE;\n\n    case 429: // Too Many Requests\n      return Code.RESOURCE_EXHAUSTED;\n\n    case 499: // Client Closed Request\n      return Code.CANCELLED;\n\n    case 500: // Internal Server Error\n      return Code.UNKNOWN;\n    // Other possibilities:\n    // return Code.INTERNAL;\n    // return Code.DATA_LOSS;\n\n    case 501: // Unimplemented\n      return Code.UNIMPLEMENTED;\n\n    case 503: // Service Unavailable\n      return Code.UNAVAILABLE;\n\n    case 504: // Gateway Timeout\n      return Code.DEADLINE_EXCEEDED;\n\n    default:\n      if (status >= 200 && status < 300) {\n        return Code.OK;\n      }\n      if (status >= 400 && status < 500) {\n        return Code.FAILED_PRECONDITION;\n      }\n      if (status >= 500 && status < 600) {\n        return Code.INTERNAL;\n      }\n      return Code.UNKNOWN;\n  }\n}\n\n/**\n * Converts an HTTP response's error status to the equivalent error code.\n *\n * @param status - An HTTP error response status (\"FAILED_PRECONDITION\",\n * \"UNKNOWN\", etc.)\n * @returns The equivalent Code. Non-matching responses are mapped to\n *     Code.UNKNOWN.\n */\nexport function mapCodeFromHttpResponseErrorStatus(status: string): Code {\n  const serverError = status.toLowerCase().replace(/_/g, '-');\n  return Object.values(Code).indexOf(serverError as Code) >= 0\n    ? (serverError as Code)\n    : Code.UNKNOWN;\n}\n","/**\n * @license\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The global, singleton instance of TestingHooksSpi.\n *\n * This variable will be `null` in all cases _except_ when running from\n * integration tests that have registered callbacks to be notified of events\n * that happen during the test execution.\n */\nexport let testingHooksSpi: TestingHooksSpi | null = null;\n\n/**\n * Sets the value of the `testingHooksSpi` object.\n * @param instance the instance to set.\n */\nexport function setTestingHooksSpi(instance: TestingHooksSpi): void {\n  if (testingHooksSpi) {\n    throw new Error('a TestingHooksSpi instance is already set');\n  }\n  testingHooksSpi = instance;\n}\n\n/**\n * The \"service provider interface\" for the testing hooks.\n *\n * The implementation of this object will handle the callbacks made by the SDK\n * to be handled by the integration tests.\n *\n * This \"SPI\" is separated from the implementation to avoid import cycles and\n * to enable production builds to fully tree-shake away the testing hooks logic.\n */\nexport interface TestingHooksSpi {\n  /**\n   * Invokes all callbacks registered with\n   * `TestingHooks.onExistenceFilterMismatch()` with the given info.\n   */\n  notifyOnExistenceFilterMismatch(info: ExistenceFilterMismatchInfo): void;\n}\n\n/**\n * Information about an existence filter mismatch.\n * @internal\n */\nexport interface ExistenceFilterMismatchInfo {\n  /** The number of documents that matched the query in the local cache. */\n  localCacheCount: number;\n\n  /**\n   * The number of documents that matched the query on the server, as specified\n   * in the ExistenceFilter message's `count` field.\n   */\n  existenceFilterCount: number;\n\n  /**\n   * The projectId used when checking documents for membership in the bloom\n   * filter.\n   */\n  projectId: string;\n\n  /**\n   * The databaseId used when checking documents for membership in the bloom\n   * filter.\n   */\n  databaseId: string;\n\n  /**\n   * Information about the bloom filter provided by Watch in the ExistenceFilter\n   * message's `unchangedNames` field. If this property is omitted or undefined\n   * then that means that Watch did _not_ provide a bloom filter.\n   */\n  bloomFilter?: {\n    /**\n     * Whether a full requery was averted by using the bloom filter. If false,\n     * then something happened, such as a false positive, to prevent using the\n     * bloom filter to avoid a full requery.\n     */\n    applied: boolean;\n\n    /** The number of hash functions used in the bloom filter. */\n    hashCount: number;\n\n    /** The number of bytes in the bloom filter's bitmask. */\n    bitmapLength: number;\n\n    /** The number of bits of padding in the last byte of the bloom filter. */\n    padding: number;\n\n    /**\n     * Tests the given string for membership in the bloom filter created from\n     * the existence filter; will be undefined if creating the bloom filter\n     * failed.\n     */\n    mightContain?: (value: string) => boolean;\n  };\n}\n","/**\n * @license\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * An instance of the Platform's 'TextEncoder' implementation.\n */\nexport function newTextEncoder(): TextEncoder {\n  return new TextEncoder();\n}\n\n/**\n * An instance of the Platform's 'TextDecoder' implementation.\n */\nexport function newTextDecoder(): TextDecoder {\n  return new TextDecoder('utf-8');\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Md5, Integer } from '@firebase/webchannel-wrapper';\n\nimport { newTextEncoder } from '../platform/text_serializer';\n\nconst MAX_64_BIT_UNSIGNED_INTEGER = new Integer([0xffffffff, 0xffffffff], 0);\n\n// Hash a string using md5 hashing algorithm.\nfunction getMd5HashValue(value: string): Uint8Array {\n  const encodedValue = newTextEncoder().encode(value);\n  const md5 = new Md5();\n  md5.update(encodedValue);\n  return new Uint8Array(md5.digest());\n}\n\n// Interpret the 16 bytes array as two 64-bit unsigned integers, encoded using\n// 2’s complement using little endian.\nfunction get64BitUints(Bytes: Uint8Array): [Integer, Integer] {\n  const dataView = new DataView(Bytes.buffer);\n  const chunk1 = dataView.getUint32(0, /* littleEndian= */ true);\n  const chunk2 = dataView.getUint32(4, /* littleEndian= */ true);\n  const chunk3 = dataView.getUint32(8, /* littleEndian= */ true);\n  const chunk4 = dataView.getUint32(12, /* littleEndian= */ true);\n  const integer1 = new Integer([chunk1, chunk2], 0);\n  const integer2 = new Integer([chunk3, chunk4], 0);\n  return [integer1, integer2];\n}\n\nexport class BloomFilter {\n  readonly bitCount: number;\n  private readonly bitCountInInteger: Integer;\n\n  constructor(\n    readonly bitmap: Uint8Array,\n    readonly padding: number,\n    readonly hashCount: number\n  ) {\n    if (padding < 0 || padding >= 8) {\n      throw new BloomFilterError(`Invalid padding: ${padding}`);\n    }\n\n    if (hashCount < 0) {\n      throw new BloomFilterError(`Invalid hash count: ${hashCount}`);\n    }\n\n    if (bitmap.length > 0 && this.hashCount === 0) {\n      // Only empty bloom filter can have 0 hash count.\n      throw new BloomFilterError(`Invalid hash count: ${hashCount}`);\n    }\n\n    if (bitmap.length === 0 && padding !== 0) {\n      // Empty bloom filter should have 0 padding.\n      throw new BloomFilterError(\n        `Invalid padding when bitmap length is 0: ${padding}`\n      );\n    }\n\n    this.bitCount = bitmap.length * 8 - padding;\n    // Set the bit count in Integer to avoid repetition in mightContain().\n    this.bitCountInInteger = Integer.fromNumber(this.bitCount);\n  }\n\n  // Calculate the ith hash value based on the hashed 64bit integers,\n  // and calculate its corresponding bit index in the bitmap to be checked.\n  private getBitIndex(num1: Integer, num2: Integer, hashIndex: number): number {\n    // Calculate hashed value h(i) = h1 + (i * h2).\n    let hashValue = num1.add(num2.multiply(Integer.fromNumber(hashIndex)));\n    // Wrap if hash value overflow 64bit.\n    if (hashValue.compare(MAX_64_BIT_UNSIGNED_INTEGER) === 1) {\n      hashValue = new Integer([hashValue.getBits(0), hashValue.getBits(1)], 0);\n    }\n    return hashValue.modulo(this.bitCountInInteger).toNumber();\n  }\n\n  // Return whether the bit on the given index in the bitmap is set to 1.\n  private isBitSet(index: number): boolean {\n    // To retrieve bit n, calculate: (bitmap[n / 8] & (0x01 << (n % 8))).\n    const byte = this.bitmap[Math.floor(index / 8)];\n    const offset = index % 8;\n    return (byte & (0x01 << offset)) !== 0;\n  }\n\n  mightContain(value: string): boolean {\n    // Empty bitmap should always return false on membership check.\n    if (this.bitCount === 0) {\n      return false;\n    }\n    const md5HashedValue = getMd5HashValue(value);\n    const [hash1, hash2] = get64BitUints(md5HashedValue);\n    for (let i = 0; i < this.hashCount; i++) {\n      const index = this.getBitIndex(hash1, hash2, i);\n      if (!this.isBitSet(index)) {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  /** Create bloom filter for testing purposes only. */\n  static create(\n    bitCount: number,\n    hashCount: number,\n    contains: string[]\n  ): BloomFilter {\n    const padding = bitCount % 8 === 0 ? 0 : 8 - (bitCount % 8);\n    const bitmap = new Uint8Array(Math.ceil(bitCount / 8));\n    const bloomFilter = new BloomFilter(bitmap, padding, hashCount);\n    contains.forEach(item => bloomFilter.insert(item));\n    return bloomFilter;\n  }\n\n  private insert(value: string): void {\n    if (this.bitCount === 0) {\n      return;\n    }\n\n    const md5HashedValue = getMd5HashValue(value);\n    const [hash1, hash2] = get64BitUints(md5HashedValue);\n    for (let i = 0; i < this.hashCount; i++) {\n      const index = this.getBitIndex(hash1, hash2, i);\n      this.setBit(index);\n    }\n  }\n\n  private setBit(index: number): void {\n    const indexOfByte = Math.floor(index / 8);\n    const offset = index % 8;\n    this.bitmap[indexOfByte] |= 0x01 << offset;\n  }\n}\n\nexport class BloomFilterError extends Error {\n  readonly name = 'BloomFilterError';\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport { TargetId } from '../core/types';\nimport { TargetPurpose } from '../local/target_data';\nimport {\n  documentKeySet,\n  DocumentKeySet,\n  mutableDocumentMap,\n  MutableDocumentMap\n} from '../model/collections';\nimport { ByteString } from '../util/byte_string';\nimport { primitiveComparator } from '../util/misc';\nimport { SortedMap } from '../util/sorted_map';\n\n/**\n * An event from the RemoteStore. It is split into targetChanges (changes to the\n * state or the set of documents in our watched targets) and documentUpdates\n * (changes to the actual documents).\n */\nexport class RemoteEvent {\n  constructor(\n    /**\n     * The snapshot version this event brings us up to, or MIN if not set.\n     */\n    readonly snapshotVersion: SnapshotVersion,\n    /**\n     * A map from target to changes to the target. See TargetChange.\n     */\n    readonly targetChanges: Map<TargetId, TargetChange>,\n    /**\n     * A map of targets that is known to be inconsistent, and the purpose for\n     * re-listening. Listens for these targets should be re-established without\n     * resume tokens.\n     */\n    readonly targetMismatches: SortedMap<TargetId, TargetPurpose>,\n    /**\n     * A set of which documents have changed or been deleted, along with the\n     * doc's new values (if not deleted).\n     */\n    readonly documentUpdates: MutableDocumentMap,\n    /**\n     * A set of which document updates are due only to limbo resolution targets.\n     */\n    readonly resolvedLimboDocuments: DocumentKeySet\n  ) {}\n\n  /**\n   * HACK: Views require RemoteEvents in order to determine whether the view is\n   * CURRENT, but secondary tabs don't receive remote events. So this method is\n   * used to create a synthesized RemoteEvent that can be used to apply a\n   * CURRENT status change to a View, for queries executed in a different tab.\n   */\n  // PORTING NOTE: Multi-tab only\n  static createSynthesizedRemoteEventForCurrentChange(\n    targetId: TargetId,\n    current: boolean,\n    resumeToken: ByteString\n  ): RemoteEvent {\n    const targetChanges = new Map<TargetId, TargetChange>();\n    targetChanges.set(\n      targetId,\n      TargetChange.createSynthesizedTargetChangeForCurrentChange(\n        targetId,\n        current,\n        resumeToken\n      )\n    );\n    return new RemoteEvent(\n      SnapshotVersion.min(),\n      targetChanges,\n      new SortedMap<TargetId, TargetPurpose>(primitiveComparator),\n      mutableDocumentMap(),\n      documentKeySet()\n    );\n  }\n}\n\n/**\n * A TargetChange specifies the set of changes for a specific target as part of\n * a RemoteEvent. These changes track which documents are added, modified or\n * removed, as well as the target's resume token and whether the target is\n * marked CURRENT.\n * The actual changes *to* documents are not part of the TargetChange since\n * documents may be part of multiple targets.\n */\nexport class TargetChange {\n  constructor(\n    /**\n     * An opaque, server-assigned token that allows watching a query to be resumed\n     * after disconnecting without retransmitting all the data that matches the\n     * query. The resume token essentially identifies a point in time from which\n     * the server should resume sending results.\n     */\n    readonly resumeToken: ByteString,\n    /**\n     * The \"current\" (synced) status of this target. Note that \"current\"\n     * has special meaning in the RPC protocol that implies that a target is\n     * both up-to-date and consistent with the rest of the watch stream.\n     */\n    readonly current: boolean,\n    /**\n     * The set of documents that were newly assigned to this target as part of\n     * this remote event.\n     */\n    readonly addedDocuments: DocumentKeySet,\n    /**\n     * The set of documents that were already assigned to this target but received\n     * an update during this remote event.\n     */\n    readonly modifiedDocuments: DocumentKeySet,\n    /**\n     * The set of documents that were removed from this target as part of this\n     * remote event.\n     */\n    readonly removedDocuments: DocumentKeySet\n  ) {}\n\n  /**\n   * This method is used to create a synthesized TargetChanges that can be used to\n   * apply a CURRENT status change to a View (for queries executed in a different\n   * tab) or for new queries (to raise snapshots with correct CURRENT status).\n   */\n  static createSynthesizedTargetChangeForCurrentChange(\n    targetId: TargetId,\n    current: boolean,\n    resumeToken: ByteString\n  ): TargetChange {\n    return new TargetChange(\n      resumeToken,\n      current,\n      documentKeySet(),\n      documentKeySet(),\n      documentKeySet()\n    );\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DatabaseId } from '../core/database_info';\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport { targetIsDocumentTarget } from '../core/target';\nimport { TargetId } from '../core/types';\nimport { ChangeType } from '../core/view_snapshot';\nimport { TargetData, TargetPurpose } from '../local/target_data';\nimport {\n  documentKeySet,\n  DocumentKeySet,\n  mutableDocumentMap\n} from '../model/collections';\nimport { MutableDocument } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport { normalizeByteString } from '../model/normalize';\nimport { debugAssert, fail, hardAssert } from '../util/assert';\nimport { Base64DecodeError } from '../util/base64_decode_error';\nimport { ByteString } from '../util/byte_string';\nimport { FirestoreError } from '../util/error';\nimport { logDebug, logWarn } from '../util/log';\nimport { primitiveComparator } from '../util/misc';\nimport { SortedMap } from '../util/sorted_map';\nimport { SortedSet } from '../util/sorted_set';\nimport {\n  testingHooksSpi,\n  ExistenceFilterMismatchInfo as TestingHooksExistenceFilterMismatchInfo\n} from '../util/testing_hooks_spi';\n\nimport { BloomFilter, BloomFilterError } from './bloom_filter';\nimport { ExistenceFilter } from './existence_filter';\nimport { RemoteEvent, TargetChange } from './remote_event';\n\n/**\n * Internal representation of the watcher API protocol buffers.\n */\nexport type WatchChange =\n  | DocumentWatchChange\n  | WatchTargetChange\n  | ExistenceFilterChange;\n\n/**\n * Represents a changed document and a list of target ids to which this change\n * applies.\n *\n * If document has been deleted NoDocument will be provided.\n */\nexport class DocumentWatchChange {\n  constructor(\n    /** The new document applies to all of these targets. */\n    public updatedTargetIds: TargetId[],\n    /** The new document is removed from all of these targets. */\n    public removedTargetIds: TargetId[],\n    /** The key of the document for this change. */\n    public key: DocumentKey,\n    /**\n     * The new document or NoDocument if it was deleted. Is null if the\n     * document went out of view without the server sending a new document.\n     */\n    public newDoc: MutableDocument | null\n  ) {}\n}\n\nexport class ExistenceFilterChange {\n  constructor(\n    public targetId: TargetId,\n    public existenceFilter: ExistenceFilter\n  ) {}\n}\n\nexport const enum WatchTargetChangeState {\n  NoChange,\n  Added,\n  Removed,\n  Current,\n  Reset\n}\n\nconst enum BloomFilterApplicationStatus {\n  Success,\n  Skipped,\n  FalsePositive\n}\nexport class WatchTargetChange {\n  constructor(\n    /** What kind of change occurred to the watch target. */\n    public state: WatchTargetChangeState,\n    /** The target IDs that were added/removed/set. */\n    public targetIds: TargetId[],\n    /**\n     * An opaque, server-assigned token that allows watching a target to be\n     * resumed after disconnecting without retransmitting all the data that\n     * matches the target. The resume token essentially identifies a point in\n     * time from which the server should resume sending results.\n     */\n    public resumeToken: ByteString = ByteString.EMPTY_BYTE_STRING,\n    /** An RPC error indicating why the watch failed. */\n    public cause: FirestoreError | null = null\n  ) {}\n}\n\n/** Tracks the internal state of a Watch target. */\nclass TargetState {\n  /**\n   * The number of pending responses (adds or removes) that we are waiting on.\n   * We only consider targets active that have no pending responses.\n   */\n  private pendingResponses = 0;\n\n  /**\n   * Keeps track of the document changes since the last raised snapshot.\n   *\n   * These changes are continuously updated as we receive document updates and\n   * always reflect the current set of changes against the last issued snapshot.\n   */\n  private documentChanges: SortedMap<DocumentKey, ChangeType> =\n    snapshotChangesMap();\n\n  /** See public getters for explanations of these fields. */\n  private _resumeToken: ByteString = ByteString.EMPTY_BYTE_STRING;\n  private _current = false;\n\n  /**\n   * Whether this target state should be included in the next snapshot. We\n   * initialize to true so that newly-added targets are included in the next\n   * RemoteEvent.\n   */\n  private _hasPendingChanges = true;\n\n  /**\n   * Whether this target has been marked 'current'.\n   *\n   * 'Current' has special meaning in the RPC protocol: It implies that the\n   * Watch backend has sent us all changes up to the point at which the target\n   * was added and that the target is consistent with the rest of the watch\n   * stream.\n   */\n  get current(): boolean {\n    return this._current;\n  }\n\n  /** The last resume token sent to us for this target. */\n  get resumeToken(): ByteString {\n    return this._resumeToken;\n  }\n\n  /** Whether this target has pending target adds or target removes. */\n  get isPending(): boolean {\n    return this.pendingResponses !== 0;\n  }\n\n  /** Whether we have modified any state that should trigger a snapshot. */\n  get hasPendingChanges(): boolean {\n    return this._hasPendingChanges;\n  }\n\n  /**\n   * Applies the resume token to the TargetChange, but only when it has a new\n   * value. Empty resumeTokens are discarded.\n   */\n  updateResumeToken(resumeToken: ByteString): void {\n    if (resumeToken.approximateByteSize() > 0) {\n      this._hasPendingChanges = true;\n      this._resumeToken = resumeToken;\n    }\n  }\n\n  /**\n   * Creates a target change from the current set of changes.\n   *\n   * To reset the document changes after raising this snapshot, call\n   * `clearPendingChanges()`.\n   */\n  toTargetChange(): TargetChange {\n    let addedDocuments = documentKeySet();\n    let modifiedDocuments = documentKeySet();\n    let removedDocuments = documentKeySet();\n\n    this.documentChanges.forEach((key, changeType) => {\n      switch (changeType) {\n        case ChangeType.Added:\n          addedDocuments = addedDocuments.add(key);\n          break;\n        case ChangeType.Modified:\n          modifiedDocuments = modifiedDocuments.add(key);\n          break;\n        case ChangeType.Removed:\n          removedDocuments = removedDocuments.add(key);\n          break;\n        default:\n          fail('Encountered invalid change type: ' + changeType);\n      }\n    });\n\n    return new TargetChange(\n      this._resumeToken,\n      this._current,\n      addedDocuments,\n      modifiedDocuments,\n      removedDocuments\n    );\n  }\n\n  /**\n   * Resets the document changes and sets `hasPendingChanges` to false.\n   */\n  clearPendingChanges(): void {\n    this._hasPendingChanges = false;\n    this.documentChanges = snapshotChangesMap();\n  }\n\n  addDocumentChange(key: DocumentKey, changeType: ChangeType): void {\n    this._hasPendingChanges = true;\n    this.documentChanges = this.documentChanges.insert(key, changeType);\n  }\n\n  removeDocumentChange(key: DocumentKey): void {\n    this._hasPendingChanges = true;\n    this.documentChanges = this.documentChanges.remove(key);\n  }\n\n  recordPendingTargetRequest(): void {\n    this.pendingResponses += 1;\n  }\n\n  recordTargetResponse(): void {\n    this.pendingResponses -= 1;\n    hardAssert(\n      this.pendingResponses >= 0,\n      '`pendingResponses` is less than 0. Actual value: ' +\n        this.pendingResponses +\n        '. This indicates that the SDK received more target acks from the ' +\n        'server than expected. The SDK should not continue to operate.'\n    );\n  }\n\n  markCurrent(): void {\n    this._hasPendingChanges = true;\n    this._current = true;\n  }\n}\n\n/**\n * Interface implemented by RemoteStore to expose target metadata to the\n * WatchChangeAggregator.\n */\nexport interface TargetMetadataProvider {\n  /**\n   * Returns the set of remote document keys for the given target ID as of the\n   * last raised snapshot.\n   */\n  getRemoteKeysForTarget(targetId: TargetId): DocumentKeySet;\n\n  /**\n   * Returns the TargetData for an active target ID or 'null' if this target\n   * has become inactive\n   */\n  getTargetDataForTarget(targetId: TargetId): TargetData | null;\n\n  /**\n   * Returns the database ID of the Firestore instance.\n   */\n  getDatabaseId(): DatabaseId;\n}\n\nconst LOG_TAG = 'WatchChangeAggregator';\n\n/**\n * A helper class to accumulate watch changes into a RemoteEvent.\n */\nexport class WatchChangeAggregator {\n  constructor(private metadataProvider: TargetMetadataProvider) {}\n\n  /** The internal state of all tracked targets. */\n  private targetStates = new Map<TargetId, TargetState>();\n\n  /** Keeps track of the documents to update since the last raised snapshot. */\n  private pendingDocumentUpdates = mutableDocumentMap();\n\n  /** A mapping of document keys to their set of target IDs. */\n  private pendingDocumentTargetMapping = documentTargetMap();\n\n  /**\n   * A map of targets with existence filter mismatches. These targets are\n   * known to be inconsistent and their listens needs to be re-established by\n   * RemoteStore.\n   */\n  private pendingTargetResets = new SortedMap<TargetId, TargetPurpose>(\n    primitiveComparator\n  );\n\n  /**\n   * Processes and adds the DocumentWatchChange to the current set of changes.\n   */\n  handleDocumentChange(docChange: DocumentWatchChange): void {\n    for (const targetId of docChange.updatedTargetIds) {\n      if (docChange.newDoc && docChange.newDoc.isFoundDocument()) {\n        this.addDocumentToTarget(targetId, docChange.newDoc);\n      } else {\n        this.removeDocumentFromTarget(\n          targetId,\n          docChange.key,\n          docChange.newDoc\n        );\n      }\n    }\n\n    for (const targetId of docChange.removedTargetIds) {\n      this.removeDocumentFromTarget(targetId, docChange.key, docChange.newDoc);\n    }\n  }\n\n  /** Processes and adds the WatchTargetChange to the current set of changes. */\n  handleTargetChange(targetChange: WatchTargetChange): void {\n    this.forEachTarget(targetChange, targetId => {\n      const targetState = this.ensureTargetState(targetId);\n      switch (targetChange.state) {\n        case WatchTargetChangeState.NoChange:\n          if (this.isActiveTarget(targetId)) {\n            targetState.updateResumeToken(targetChange.resumeToken);\n          }\n          break;\n        case WatchTargetChangeState.Added:\n          // We need to decrement the number of pending acks needed from watch\n          // for this targetId.\n          targetState.recordTargetResponse();\n          if (!targetState.isPending) {\n            // We have a freshly added target, so we need to reset any state\n            // that we had previously. This can happen e.g. when remove and add\n            // back a target for existence filter mismatches.\n            targetState.clearPendingChanges();\n          }\n          targetState.updateResumeToken(targetChange.resumeToken);\n          break;\n        case WatchTargetChangeState.Removed:\n          // We need to keep track of removed targets to we can post-filter and\n          // remove any target changes.\n          // We need to decrement the number of pending acks needed from watch\n          // for this targetId.\n          targetState.recordTargetResponse();\n          if (!targetState.isPending) {\n            this.removeTarget(targetId);\n          }\n          debugAssert(\n            !targetChange.cause,\n            'WatchChangeAggregator does not handle errored targets'\n          );\n          break;\n        case WatchTargetChangeState.Current:\n          if (this.isActiveTarget(targetId)) {\n            targetState.markCurrent();\n            targetState.updateResumeToken(targetChange.resumeToken);\n          }\n          break;\n        case WatchTargetChangeState.Reset:\n          if (this.isActiveTarget(targetId)) {\n            // Reset the target and synthesizes removes for all existing\n            // documents. The backend will re-add any documents that still\n            // match the target before it sends the next global snapshot.\n            this.resetTarget(targetId);\n            targetState.updateResumeToken(targetChange.resumeToken);\n          }\n          break;\n        default:\n          fail('Unknown target watch change state: ' + targetChange.state);\n      }\n    });\n  }\n\n  /**\n   * Iterates over all targetIds that the watch change applies to: either the\n   * targetIds explicitly listed in the change or the targetIds of all currently\n   * active targets.\n   */\n  forEachTarget(\n    targetChange: WatchTargetChange,\n    fn: (targetId: TargetId) => void\n  ): void {\n    if (targetChange.targetIds.length > 0) {\n      targetChange.targetIds.forEach(fn);\n    } else {\n      this.targetStates.forEach((_, targetId) => {\n        if (this.isActiveTarget(targetId)) {\n          fn(targetId);\n        }\n      });\n    }\n  }\n\n  /**\n   * Handles existence filters and synthesizes deletes for filter mismatches.\n   * Targets that are invalidated by filter mismatches are added to\n   * `pendingTargetResets`.\n   */\n  handleExistenceFilter(watchChange: ExistenceFilterChange): void {\n    const targetId = watchChange.targetId;\n    const expectedCount = watchChange.existenceFilter.count;\n\n    const targetData = this.targetDataForActiveTarget(targetId);\n    if (targetData) {\n      const target = targetData.target;\n      if (targetIsDocumentTarget(target)) {\n        if (expectedCount === 0) {\n          // The existence filter told us the document does not exist. We deduce\n          // that this document does not exist and apply a deleted document to\n          // our updates. Without applying this deleted document there might be\n          // another query that will raise this document as part of a snapshot\n          // until it is resolved, essentially exposing inconsistency between\n          // queries.\n          const key = new DocumentKey(target.path);\n          this.removeDocumentFromTarget(\n            targetId,\n            key,\n            MutableDocument.newNoDocument(key, SnapshotVersion.min())\n          );\n        } else {\n          hardAssert(\n            expectedCount === 1,\n            'Single document existence filter with count: ' + expectedCount\n          );\n        }\n      } else {\n        const currentSize = this.getCurrentDocumentCountForTarget(targetId);\n        // Existence filter mismatch. Mark the documents as being in limbo, and\n        // raise a snapshot with `isFromCache:true`.\n        if (currentSize !== expectedCount) {\n          // Apply bloom filter to identify and mark removed documents.\n          const bloomFilter = this.parseBloomFilter(watchChange);\n          const status = bloomFilter\n            ? this.applyBloomFilter(bloomFilter, watchChange, currentSize)\n            : BloomFilterApplicationStatus.Skipped;\n\n          if (status !== BloomFilterApplicationStatus.Success) {\n            // If bloom filter application fails, we reset the mapping and\n            // trigger re-run of the query.\n            this.resetTarget(targetId);\n\n            const purpose: TargetPurpose =\n              status === BloomFilterApplicationStatus.FalsePositive\n                ? TargetPurpose.ExistenceFilterMismatchBloom\n                : TargetPurpose.ExistenceFilterMismatch;\n            this.pendingTargetResets = this.pendingTargetResets.insert(\n              targetId,\n              purpose\n            );\n          }\n          testingHooksSpi?.notifyOnExistenceFilterMismatch(\n            createExistenceFilterMismatchInfoForTestingHooks(\n              currentSize,\n              watchChange.existenceFilter,\n              this.metadataProvider.getDatabaseId(),\n              bloomFilter,\n              status\n            )\n          );\n        }\n      }\n    }\n  }\n\n  /**\n   * Parse the bloom filter from the \"unchanged_names\" field of an existence\n   * filter.\n   */\n  private parseBloomFilter(\n    watchChange: ExistenceFilterChange\n  ): BloomFilter | null {\n    const unchangedNames = watchChange.existenceFilter.unchangedNames;\n    if (!unchangedNames || !unchangedNames.bits) {\n      return null;\n    }\n\n    const {\n      bits: { bitmap = '', padding = 0 },\n      hashCount = 0\n    } = unchangedNames;\n\n    let normalizedBitmap: Uint8Array;\n    try {\n      normalizedBitmap = normalizeByteString(bitmap).toUint8Array();\n    } catch (err) {\n      if (err instanceof Base64DecodeError) {\n        logWarn(\n          'Decoding the base64 bloom filter in existence filter failed (' +\n            err.message +\n            '); ignoring the bloom filter and falling back to full re-query.'\n        );\n        return null;\n      } else {\n        throw err;\n      }\n    }\n\n    let bloomFilter: BloomFilter;\n    try {\n      // BloomFilter throws error if the inputs are invalid.\n      bloomFilter = new BloomFilter(normalizedBitmap, padding, hashCount);\n    } catch (err) {\n      if (err instanceof BloomFilterError) {\n        logWarn('BloomFilter error: ', err);\n      } else {\n        logWarn('Applying bloom filter failed: ', err);\n      }\n      return null;\n    }\n\n    if (bloomFilter.bitCount === 0) {\n      return null;\n    }\n\n    return bloomFilter;\n  }\n\n  /**\n   * Apply bloom filter to remove the deleted documents, and return the\n   * application status.\n   */\n  private applyBloomFilter(\n    bloomFilter: BloomFilter,\n    watchChange: ExistenceFilterChange,\n    currentCount: number\n  ): BloomFilterApplicationStatus {\n    const expectedCount = watchChange.existenceFilter.count;\n\n    const removedDocumentCount = this.filterRemovedDocuments(\n      bloomFilter,\n      watchChange.targetId\n    );\n\n    return expectedCount === currentCount - removedDocumentCount\n      ? BloomFilterApplicationStatus.Success\n      : BloomFilterApplicationStatus.FalsePositive;\n  }\n\n  /**\n   * Filter out removed documents based on bloom filter membership result and\n   * return number of documents removed.\n   */\n  private filterRemovedDocuments(\n    bloomFilter: BloomFilter,\n    targetId: number\n  ): number {\n    const existingKeys = this.metadataProvider.getRemoteKeysForTarget(targetId);\n    let removalCount = 0;\n\n    existingKeys.forEach(key => {\n      const databaseId = this.metadataProvider.getDatabaseId();\n      const documentPath =\n        `projects/${databaseId.projectId}` +\n        `/databases/${databaseId.database}` +\n        `/documents/${key.path.canonicalString()}`;\n\n      if (!bloomFilter.mightContain(documentPath)) {\n        this.removeDocumentFromTarget(targetId, key, /*updatedDocument=*/ null);\n        removalCount++;\n      }\n    });\n\n    return removalCount;\n  }\n\n  /**\n   * Converts the currently accumulated state into a remote event at the\n   * provided snapshot version. Resets the accumulated changes before returning.\n   */\n  createRemoteEvent(snapshotVersion: SnapshotVersion): RemoteEvent {\n    const targetChanges = new Map<TargetId, TargetChange>();\n\n    this.targetStates.forEach((targetState, targetId) => {\n      const targetData = this.targetDataForActiveTarget(targetId);\n      if (targetData) {\n        if (targetState.current && targetIsDocumentTarget(targetData.target)) {\n          // Document queries for document that don't exist can produce an empty\n          // result set. To update our local cache, we synthesize a document\n          // delete if we have not previously received the document. This\n          // resolves the limbo state of the document, removing it from\n          // limboDocumentRefs.\n          //\n          // TODO(dimond): Ideally we would have an explicit lookup target\n          // instead resulting in an explicit delete message and we could\n          // remove this special logic.\n          const key = new DocumentKey(targetData.target.path);\n          if (\n            this.pendingDocumentUpdates.get(key) === null &&\n            !this.targetContainsDocument(targetId, key)\n          ) {\n            this.removeDocumentFromTarget(\n              targetId,\n              key,\n              MutableDocument.newNoDocument(key, snapshotVersion)\n            );\n          }\n        }\n\n        if (targetState.hasPendingChanges) {\n          targetChanges.set(targetId, targetState.toTargetChange());\n          targetState.clearPendingChanges();\n        }\n      }\n    });\n\n    let resolvedLimboDocuments = documentKeySet();\n\n    // We extract the set of limbo-only document updates as the GC logic\n    // special-cases documents that do not appear in the target cache.\n    //\n    // TODO(gsoltis): Expand on this comment once GC is available in the JS\n    // client.\n    this.pendingDocumentTargetMapping.forEach((key, targets) => {\n      let isOnlyLimboTarget = true;\n\n      targets.forEachWhile(targetId => {\n        const targetData = this.targetDataForActiveTarget(targetId);\n        if (\n          targetData &&\n          targetData.purpose !== TargetPurpose.LimboResolution\n        ) {\n          isOnlyLimboTarget = false;\n          return false;\n        }\n\n        return true;\n      });\n\n      if (isOnlyLimboTarget) {\n        resolvedLimboDocuments = resolvedLimboDocuments.add(key);\n      }\n    });\n\n    this.pendingDocumentUpdates.forEach((_, doc) =>\n      doc.setReadTime(snapshotVersion)\n    );\n\n    const remoteEvent = new RemoteEvent(\n      snapshotVersion,\n      targetChanges,\n      this.pendingTargetResets,\n      this.pendingDocumentUpdates,\n      resolvedLimboDocuments\n    );\n\n    this.pendingDocumentUpdates = mutableDocumentMap();\n    this.pendingDocumentTargetMapping = documentTargetMap();\n    this.pendingTargetResets = new SortedMap<TargetId, TargetPurpose>(\n      primitiveComparator\n    );\n\n    return remoteEvent;\n  }\n\n  /**\n   * Adds the provided document to the internal list of document updates and\n   * its document key to the given target's mapping.\n   */\n  // Visible for testing.\n  addDocumentToTarget(targetId: TargetId, document: MutableDocument): void {\n    if (!this.isActiveTarget(targetId)) {\n      return;\n    }\n\n    const changeType = this.targetContainsDocument(targetId, document.key)\n      ? ChangeType.Modified\n      : ChangeType.Added;\n\n    const targetState = this.ensureTargetState(targetId);\n    targetState.addDocumentChange(document.key, changeType);\n\n    this.pendingDocumentUpdates = this.pendingDocumentUpdates.insert(\n      document.key,\n      document\n    );\n\n    this.pendingDocumentTargetMapping =\n      this.pendingDocumentTargetMapping.insert(\n        document.key,\n        this.ensureDocumentTargetMapping(document.key).add(targetId)\n      );\n  }\n\n  /**\n   * Removes the provided document from the target mapping. If the\n   * document no longer matches the target, but the document's state is still\n   * known (e.g. we know that the document was deleted or we received the change\n   * that caused the filter mismatch), the new document can be provided\n   * to update the remote document cache.\n   */\n  // Visible for testing.\n  removeDocumentFromTarget(\n    targetId: TargetId,\n    key: DocumentKey,\n    updatedDocument: MutableDocument | null\n  ): void {\n    if (!this.isActiveTarget(targetId)) {\n      return;\n    }\n\n    const targetState = this.ensureTargetState(targetId);\n    if (this.targetContainsDocument(targetId, key)) {\n      targetState.addDocumentChange(key, ChangeType.Removed);\n    } else {\n      // The document may have entered and left the target before we raised a\n      // snapshot, so we can just ignore the change.\n      targetState.removeDocumentChange(key);\n    }\n\n    this.pendingDocumentTargetMapping =\n      this.pendingDocumentTargetMapping.insert(\n        key,\n        this.ensureDocumentTargetMapping(key).delete(targetId)\n      );\n\n    if (updatedDocument) {\n      this.pendingDocumentUpdates = this.pendingDocumentUpdates.insert(\n        key,\n        updatedDocument\n      );\n    }\n  }\n\n  removeTarget(targetId: TargetId): void {\n    this.targetStates.delete(targetId);\n  }\n\n  /**\n   * Returns the current count of documents in the target. This includes both\n   * the number of documents that the LocalStore considers to be part of the\n   * target as well as any accumulated changes.\n   */\n  private getCurrentDocumentCountForTarget(targetId: TargetId): number {\n    const targetState = this.ensureTargetState(targetId);\n    const targetChange = targetState.toTargetChange();\n    return (\n      this.metadataProvider.getRemoteKeysForTarget(targetId).size +\n      targetChange.addedDocuments.size -\n      targetChange.removedDocuments.size\n    );\n  }\n\n  /**\n   * Increment the number of acks needed from watch before we can consider the\n   * server to be 'in-sync' with the client's active targets.\n   */\n  recordPendingTargetRequest(targetId: TargetId): void {\n    // For each request we get we need to record we need a response for it.\n    const targetState = this.ensureTargetState(targetId);\n    targetState.recordPendingTargetRequest();\n  }\n\n  private ensureTargetState(targetId: TargetId): TargetState {\n    let result = this.targetStates.get(targetId);\n    if (!result) {\n      result = new TargetState();\n      this.targetStates.set(targetId, result);\n    }\n    return result;\n  }\n\n  private ensureDocumentTargetMapping(key: DocumentKey): SortedSet<TargetId> {\n    let targetMapping = this.pendingDocumentTargetMapping.get(key);\n\n    if (!targetMapping) {\n      targetMapping = new SortedSet<TargetId>(primitiveComparator);\n      this.pendingDocumentTargetMapping =\n        this.pendingDocumentTargetMapping.insert(key, targetMapping);\n    }\n\n    return targetMapping;\n  }\n\n  /**\n   * Verifies that the user is still interested in this target (by calling\n   * `getTargetDataForTarget()`) and that we are not waiting for pending ADDs\n   * from watch.\n   */\n  protected isActiveTarget(targetId: TargetId): boolean {\n    const targetActive = this.targetDataForActiveTarget(targetId) !== null;\n    if (!targetActive) {\n      logDebug(LOG_TAG, 'Detected inactive target', targetId);\n    }\n    return targetActive;\n  }\n\n  /**\n   * Returns the TargetData for an active target (i.e. a target that the user\n   * is still interested in that has no outstanding target change requests).\n   */\n  protected targetDataForActiveTarget(targetId: TargetId): TargetData | null {\n    const targetState = this.targetStates.get(targetId);\n    return targetState && targetState.isPending\n      ? null\n      : this.metadataProvider.getTargetDataForTarget(targetId);\n  }\n\n  /**\n   * Resets the state of a Watch target to its initial state (e.g. sets\n   * 'current' to false, clears the resume token and removes its target mapping\n   * from all documents).\n   */\n  private resetTarget(targetId: TargetId): void {\n    debugAssert(\n      !this.targetStates.get(targetId)!.isPending,\n      'Should only reset active targets'\n    );\n    this.targetStates.set(targetId, new TargetState());\n\n    // Trigger removal for any documents currently mapped to this target.\n    // These removals will be part of the initial snapshot if Watch does not\n    // resend these documents.\n    const existingKeys = this.metadataProvider.getRemoteKeysForTarget(targetId);\n    existingKeys.forEach(key => {\n      this.removeDocumentFromTarget(targetId, key, /*updatedDocument=*/ null);\n    });\n  }\n  /**\n   * Returns whether the LocalStore considers the document to be part of the\n   * specified target.\n   */\n  private targetContainsDocument(\n    targetId: TargetId,\n    key: DocumentKey\n  ): boolean {\n    const existingKeys = this.metadataProvider.getRemoteKeysForTarget(targetId);\n    return existingKeys.has(key);\n  }\n}\n\nfunction documentTargetMap(): SortedMap<DocumentKey, SortedSet<TargetId>> {\n  return new SortedMap<DocumentKey, SortedSet<TargetId>>(\n    DocumentKey.comparator\n  );\n}\n\nfunction snapshotChangesMap(): SortedMap<DocumentKey, ChangeType> {\n  return new SortedMap<DocumentKey, ChangeType>(DocumentKey.comparator);\n}\n\nfunction createExistenceFilterMismatchInfoForTestingHooks(\n  localCacheCount: number,\n  existenceFilter: ExistenceFilter,\n  databaseId: DatabaseId,\n  bloomFilter: BloomFilter | null,\n  bloomFilterStatus: BloomFilterApplicationStatus\n): TestingHooksExistenceFilterMismatchInfo {\n  const result: TestingHooksExistenceFilterMismatchInfo = {\n    localCacheCount,\n    existenceFilterCount: existenceFilter.count,\n    databaseId: databaseId.database,\n    projectId: databaseId.projectId\n  };\n\n  const unchangedNames = existenceFilter.unchangedNames;\n  if (unchangedNames) {\n    result.bloomFilter = {\n      applied: bloomFilterStatus === BloomFilterApplicationStatus.Success,\n      hashCount: unchangedNames?.hashCount ?? 0,\n      bitmapLength: unchangedNames?.bits?.bitmap?.length ?? 0,\n      padding: unchangedNames?.bits?.padding ?? 0,\n      mightContain: (value: string): boolean =>\n        bloomFilter?.mightContain(value) ?? false\n    };\n  }\n\n  return result;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Aggregate } from '../core/aggregate';\nimport { Bound } from '../core/bound';\nimport { DatabaseId } from '../core/database_info';\nimport {\n  CompositeFilter,\n  compositeFilterIsFlatConjunction,\n  CompositeOperator,\n  FieldFilter,\n  Filter,\n  Operator\n} from '../core/filter';\nimport { Direction, OrderBy } from '../core/order_by';\nimport {\n  LimitType,\n  newQuery,\n  newQueryForPath,\n  Query,\n  queryToTarget\n} from '../core/query';\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport { targetIsDocumentTarget, Target } from '../core/target';\nimport { TargetId } from '../core/types';\nimport { Timestamp } from '../lite-api/timestamp';\nimport { TargetData, TargetPurpose } from '../local/target_data';\nimport { MutableDocument } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport { FieldMask } from '../model/field_mask';\nimport {\n  DeleteMutation,\n  FieldTransform,\n  Mutation,\n  MutationResult,\n  PatchMutation,\n  Precondition,\n  SetMutation,\n  VerifyMutation\n} from '../model/mutation';\nimport { normalizeTimestamp } from '../model/normalize';\nimport { ObjectValue } from '../model/object_value';\nimport { FieldPath, ResourcePath } from '../model/path';\nimport {\n  ArrayRemoveTransformOperation,\n  ArrayUnionTransformOperation,\n  NumericIncrementTransformOperation,\n  ServerTimestampTransform,\n  TransformOperation\n} from '../model/transform_operation';\nimport { isNanValue, isNullValue } from '../model/values';\nimport {\n  ApiClientObjectMap as ProtoApiClientObjectMap,\n  BatchGetDocumentsResponse as ProtoBatchGetDocumentsResponse,\n  CompositeFilterOp as ProtoCompositeFilterOp,\n  Cursor as ProtoCursor,\n  Document as ProtoDocument,\n  DocumentMask as ProtoDocumentMask,\n  DocumentsTarget as ProtoDocumentsTarget,\n  FieldFilterOp as ProtoFieldFilterOp,\n  FieldReference as ProtoFieldReference,\n  FieldTransform as ProtoFieldTransform,\n  Filter as ProtoFilter,\n  ListenResponse as ProtoListenResponse,\n  Order as ProtoOrder,\n  OrderDirection as ProtoOrderDirection,\n  Precondition as ProtoPrecondition,\n  QueryTarget as ProtoQueryTarget,\n  RunAggregationQueryRequest as ProtoRunAggregationQueryRequest,\n  Aggregation as ProtoAggregation,\n  Status as ProtoStatus,\n  Target as ProtoTarget,\n  TargetChangeTargetChangeType as ProtoTargetChangeTargetChangeType,\n  Timestamp as ProtoTimestamp,\n  Write as ProtoWrite,\n  WriteResult as ProtoWriteResult\n} from '../protos/firestore_proto_api';\nimport { debugAssert, fail, hardAssert } from '../util/assert';\nimport { ByteString } from '../util/byte_string';\nimport { Code, FirestoreError } from '../util/error';\nimport { isNullOrUndefined } from '../util/types';\n\nimport { ExistenceFilter } from './existence_filter';\nimport { Serializer } from './number_serializer';\nimport { mapCodeFromRpcCode } from './rpc_error';\nimport {\n  DocumentWatchChange,\n  ExistenceFilterChange,\n  WatchChange,\n  WatchTargetChange,\n  WatchTargetChangeState\n} from './watch_change';\n\nconst DIRECTIONS = (() => {\n  const dirs: { [dir: string]: ProtoOrderDirection } = {};\n  dirs[Direction.ASCENDING] = 'ASCENDING';\n  dirs[Direction.DESCENDING] = 'DESCENDING';\n  return dirs;\n})();\n\nconst OPERATORS = (() => {\n  const ops: { [op: string]: ProtoFieldFilterOp } = {};\n  ops[Operator.LESS_THAN] = 'LESS_THAN';\n  ops[Operator.LESS_THAN_OR_EQUAL] = 'LESS_THAN_OR_EQUAL';\n  ops[Operator.GREATER_THAN] = 'GREATER_THAN';\n  ops[Operator.GREATER_THAN_OR_EQUAL] = 'GREATER_THAN_OR_EQUAL';\n  ops[Operator.EQUAL] = 'EQUAL';\n  ops[Operator.NOT_EQUAL] = 'NOT_EQUAL';\n  ops[Operator.ARRAY_CONTAINS] = 'ARRAY_CONTAINS';\n  ops[Operator.IN] = 'IN';\n  ops[Operator.NOT_IN] = 'NOT_IN';\n  ops[Operator.ARRAY_CONTAINS_ANY] = 'ARRAY_CONTAINS_ANY';\n  return ops;\n})();\n\nconst COMPOSITE_OPERATORS = (() => {\n  const ops: { [op: string]: ProtoCompositeFilterOp } = {};\n  ops[CompositeOperator.AND] = 'AND';\n  ops[CompositeOperator.OR] = 'OR';\n  return ops;\n})();\n\nfunction assertPresent(value: unknown, description: string): asserts value {\n  debugAssert(!isNullOrUndefined(value), description + ' is missing');\n}\n\n/**\n * This class generates JsonObject values for the Datastore API suitable for\n * sending to either GRPC stub methods or via the JSON/HTTP REST API.\n *\n * The serializer supports both Protobuf.js and Proto3 JSON formats. By\n * setting `useProto3Json` to true, the serializer will use the Proto3 JSON\n * format.\n *\n * For a description of the Proto3 JSON format check\n * https://developers.google.com/protocol-buffers/docs/proto3#json\n *\n * TODO(klimt): We can remove the databaseId argument if we keep the full\n * resource name in documents.\n */\nexport class JsonProtoSerializer implements Serializer {\n  constructor(\n    readonly databaseId: DatabaseId,\n    readonly useProto3Json: boolean\n  ) {}\n}\n\nfunction fromRpcStatus(status: ProtoStatus): FirestoreError {\n  const code =\n    status.code === undefined ? Code.UNKNOWN : mapCodeFromRpcCode(status.code);\n  return new FirestoreError(code, status.message || '');\n}\n\n/**\n * Returns a value for a number (or null) that's appropriate to put into\n * a google.protobuf.Int32Value proto.\n * DO NOT USE THIS FOR ANYTHING ELSE.\n * This method cheats. It's typed as returning \"number\" because that's what\n * our generated proto interfaces say Int32Value must be. But GRPC actually\n * expects a { value: <number> } struct.\n */\nfunction toInt32Proto(\n  serializer: JsonProtoSerializer,\n  val: number | null\n): number | { value: number } | null {\n  if (serializer.useProto3Json || isNullOrUndefined(val)) {\n    return val;\n  } else {\n    return { value: val };\n  }\n}\n\n/**\n * Returns a number (or null) from a google.protobuf.Int32Value proto.\n */\nfunction fromInt32Proto(\n  val: number | { value: number } | undefined\n): number | null {\n  let result;\n  if (typeof val === 'object') {\n    result = val.value;\n  } else {\n    result = val;\n  }\n  return isNullOrUndefined(result) ? null : result;\n}\n\n/**\n * Returns a value for a Date that's appropriate to put into a proto.\n */\nexport function toTimestamp(\n  serializer: JsonProtoSerializer,\n  timestamp: Timestamp\n): ProtoTimestamp {\n  if (serializer.useProto3Json) {\n    // Serialize to ISO-8601 date format, but with full nano resolution.\n    // Since JS Date has only millis, let's only use it for the seconds and\n    // then manually add the fractions to the end.\n    const jsDateStr = new Date(timestamp.seconds * 1000).toISOString();\n    // Remove .xxx frac part and Z in the end.\n    const strUntilSeconds = jsDateStr.replace(/\\.\\d*/, '').replace('Z', '');\n    // Pad the fraction out to 9 digits (nanos).\n    const nanoStr = ('000000000' + timestamp.nanoseconds).slice(-9);\n\n    return `${strUntilSeconds}.${nanoStr}Z`;\n  } else {\n    return {\n      seconds: '' + timestamp.seconds,\n      nanos: timestamp.nanoseconds\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    } as any;\n  }\n}\n\nfunction fromTimestamp(date: ProtoTimestamp): Timestamp {\n  const timestamp = normalizeTimestamp(date);\n  return new Timestamp(timestamp.seconds, timestamp.nanos);\n}\n\n/**\n * Returns a value for bytes that's appropriate to put in a proto.\n *\n * Visible for testing.\n */\nexport function toBytes(\n  serializer: JsonProtoSerializer,\n  bytes: ByteString\n): string | Uint8Array {\n  if (serializer.useProto3Json) {\n    return bytes.toBase64();\n  } else {\n    return bytes.toUint8Array();\n  }\n}\n\n/**\n * Returns a ByteString based on the proto string value.\n */\nexport function fromBytes(\n  serializer: JsonProtoSerializer,\n  value: string | Uint8Array | undefined\n): ByteString {\n  if (serializer.useProto3Json) {\n    hardAssert(\n      value === undefined || typeof value === 'string',\n      'value must be undefined or a string when using proto3 Json'\n    );\n    return ByteString.fromBase64String(value ? value : '');\n  } else {\n    hardAssert(\n      value === undefined ||\n        // Check if the value is an instance of both Buffer and Uint8Array,\n        // despite the fact that Buffer extends Uint8Array. In some\n        // environments, such as jsdom, the prototype chain of Buffer\n        // does not indicate that it extends Uint8Array.\n        value instanceof Buffer ||\n        value instanceof Uint8Array,\n      'value must be undefined, Buffer, or Uint8Array'\n    );\n    return ByteString.fromUint8Array(value ? value : new Uint8Array());\n  }\n}\n\nexport function toVersion(\n  serializer: JsonProtoSerializer,\n  version: SnapshotVersion\n): ProtoTimestamp {\n  return toTimestamp(serializer, version.toTimestamp());\n}\n\nexport function fromVersion(version: ProtoTimestamp): SnapshotVersion {\n  hardAssert(!!version, \"Trying to deserialize version that isn't set\");\n  return SnapshotVersion.fromTimestamp(fromTimestamp(version));\n}\n\nexport function toResourceName(\n  databaseId: DatabaseId,\n  path: ResourcePath\n): string {\n  return toResourcePath(databaseId, path).canonicalString();\n}\n\nexport function toResourcePath(\n  databaseId: DatabaseId,\n  path?: ResourcePath\n): ResourcePath {\n  const resourcePath = fullyQualifiedPrefixPath(databaseId).child('documents');\n  return path === undefined ? resourcePath : resourcePath.child(path);\n}\n\nfunction fromResourceName(name: string): ResourcePath {\n  const resource = ResourcePath.fromString(name);\n  hardAssert(\n    isValidResourceName(resource),\n    'Tried to deserialize invalid key ' + resource.toString()\n  );\n  return resource;\n}\n\nexport function toName(\n  serializer: JsonProtoSerializer,\n  key: DocumentKey\n): string {\n  return toResourceName(serializer.databaseId, key.path);\n}\n\nexport function fromName(\n  serializer: JsonProtoSerializer,\n  name: string\n): DocumentKey {\n  const resource = fromResourceName(name);\n\n  if (resource.get(1) !== serializer.databaseId.projectId) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      'Tried to deserialize key from different project: ' +\n        resource.get(1) +\n        ' vs ' +\n        serializer.databaseId.projectId\n    );\n  }\n\n  if (resource.get(3) !== serializer.databaseId.database) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      'Tried to deserialize key from different database: ' +\n        resource.get(3) +\n        ' vs ' +\n        serializer.databaseId.database\n    );\n  }\n  return new DocumentKey(extractLocalPathFromResourceName(resource));\n}\n\nfunction toQueryPath(\n  serializer: JsonProtoSerializer,\n  path: ResourcePath\n): string {\n  return toResourceName(serializer.databaseId, path);\n}\n\nfunction fromQueryPath(name: string): ResourcePath {\n  const resourceName = fromResourceName(name);\n  // In v1beta1 queries for collections at the root did not have a trailing\n  // \"/documents\". In v1 all resource paths contain \"/documents\". Preserve the\n  // ability to read the v1beta1 form for compatibility with queries persisted\n  // in the local target cache.\n  if (resourceName.length === 4) {\n    return ResourcePath.emptyPath();\n  }\n  return extractLocalPathFromResourceName(resourceName);\n}\n\nexport function getEncodedDatabaseId(serializer: JsonProtoSerializer): string {\n  const path = new ResourcePath([\n    'projects',\n    serializer.databaseId.projectId,\n    'databases',\n    serializer.databaseId.database\n  ]);\n  return path.canonicalString();\n}\n\nfunction fullyQualifiedPrefixPath(databaseId: DatabaseId): ResourcePath {\n  return new ResourcePath([\n    'projects',\n    databaseId.projectId,\n    'databases',\n    databaseId.database\n  ]);\n}\n\nfunction extractLocalPathFromResourceName(\n  resourceName: ResourcePath\n): ResourcePath {\n  hardAssert(\n    resourceName.length > 4 && resourceName.get(4) === 'documents',\n    'tried to deserialize invalid key ' + resourceName.toString()\n  );\n  return resourceName.popFirst(5);\n}\n\n/** Creates a Document proto from key and fields (but no create/update time) */\nexport function toMutationDocument(\n  serializer: JsonProtoSerializer,\n  key: DocumentKey,\n  fields: ObjectValue\n): ProtoDocument {\n  return {\n    name: toName(serializer, key),\n    fields: fields.value.mapValue.fields\n  };\n}\n\nexport function toDocument(\n  serializer: JsonProtoSerializer,\n  document: MutableDocument\n): ProtoDocument {\n  debugAssert(\n    !document.hasLocalMutations,\n    \"Can't serialize documents with mutations.\"\n  );\n  return {\n    name: toName(serializer, document.key),\n    fields: document.data.value.mapValue.fields,\n    updateTime: toTimestamp(serializer, document.version.toTimestamp()),\n    createTime: toTimestamp(serializer, document.createTime.toTimestamp())\n  };\n}\n\nexport function fromDocument(\n  serializer: JsonProtoSerializer,\n  document: ProtoDocument,\n  hasCommittedMutations?: boolean\n): MutableDocument {\n  const key = fromName(serializer, document.name!);\n  const version = fromVersion(document.updateTime!);\n  // If we read a document from persistence that is missing createTime, it's due\n  // to older SDK versions not storing this information. In such cases, we'll\n  // set the createTime to zero. This can be removed in the long term.\n  const createTime = document.createTime\n    ? fromVersion(document.createTime)\n    : SnapshotVersion.min();\n  const data = new ObjectValue({ mapValue: { fields: document.fields } });\n  const result = MutableDocument.newFoundDocument(\n    key,\n    version,\n    createTime,\n    data\n  );\n  if (hasCommittedMutations) {\n    result.setHasCommittedMutations();\n  }\n  return hasCommittedMutations ? result.setHasCommittedMutations() : result;\n}\n\nfunction fromFound(\n  serializer: JsonProtoSerializer,\n  doc: ProtoBatchGetDocumentsResponse\n): MutableDocument {\n  hardAssert(\n    !!doc.found,\n    'Tried to deserialize a found document from a missing document.'\n  );\n  assertPresent(doc.found.name, 'doc.found.name');\n  assertPresent(doc.found.updateTime, 'doc.found.updateTime');\n  const key = fromName(serializer, doc.found.name);\n  const version = fromVersion(doc.found.updateTime);\n  const createTime = doc.found.createTime\n    ? fromVersion(doc.found.createTime)\n    : SnapshotVersion.min();\n  const data = new ObjectValue({ mapValue: { fields: doc.found.fields } });\n  return MutableDocument.newFoundDocument(key, version, createTime, data);\n}\n\nfunction fromMissing(\n  serializer: JsonProtoSerializer,\n  result: ProtoBatchGetDocumentsResponse\n): MutableDocument {\n  hardAssert(\n    !!result.missing,\n    'Tried to deserialize a missing document from a found document.'\n  );\n  hardAssert(\n    !!result.readTime,\n    'Tried to deserialize a missing document without a read time.'\n  );\n  const key = fromName(serializer, result.missing);\n  const version = fromVersion(result.readTime);\n  return MutableDocument.newNoDocument(key, version);\n}\n\nexport function fromBatchGetDocumentsResponse(\n  serializer: JsonProtoSerializer,\n  result: ProtoBatchGetDocumentsResponse\n): MutableDocument {\n  if ('found' in result) {\n    return fromFound(serializer, result);\n  } else if ('missing' in result) {\n    return fromMissing(serializer, result);\n  }\n  return fail('invalid batch get response: ' + JSON.stringify(result));\n}\n\nexport function fromWatchChange(\n  serializer: JsonProtoSerializer,\n  change: ProtoListenResponse\n): WatchChange {\n  let watchChange: WatchChange;\n  if ('targetChange' in change) {\n    assertPresent(change.targetChange, 'targetChange');\n    // proto3 default value is unset in JSON (undefined), so use 'NO_CHANGE'\n    // if unset\n    const state = fromWatchTargetChangeState(\n      change.targetChange.targetChangeType || 'NO_CHANGE'\n    );\n    const targetIds: TargetId[] = change.targetChange.targetIds || [];\n\n    const resumeToken = fromBytes(serializer, change.targetChange.resumeToken);\n    const causeProto = change.targetChange!.cause;\n    const cause = causeProto && fromRpcStatus(causeProto);\n    watchChange = new WatchTargetChange(\n      state,\n      targetIds,\n      resumeToken,\n      cause || null\n    );\n  } else if ('documentChange' in change) {\n    assertPresent(change.documentChange, 'documentChange');\n    const entityChange = change.documentChange;\n    assertPresent(entityChange.document, 'documentChange.name');\n    assertPresent(entityChange.document.name, 'documentChange.document.name');\n    assertPresent(\n      entityChange.document.updateTime,\n      'documentChange.document.updateTime'\n    );\n    const key = fromName(serializer, entityChange.document.name);\n    const version = fromVersion(entityChange.document.updateTime);\n    const createTime = entityChange.document.createTime\n      ? fromVersion(entityChange.document.createTime)\n      : SnapshotVersion.min();\n    const data = new ObjectValue({\n      mapValue: { fields: entityChange.document.fields }\n    });\n    const doc = MutableDocument.newFoundDocument(\n      key,\n      version,\n      createTime,\n      data\n    );\n    const updatedTargetIds = entityChange.targetIds || [];\n    const removedTargetIds = entityChange.removedTargetIds || [];\n    watchChange = new DocumentWatchChange(\n      updatedTargetIds,\n      removedTargetIds,\n      doc.key,\n      doc\n    );\n  } else if ('documentDelete' in change) {\n    assertPresent(change.documentDelete, 'documentDelete');\n    const docDelete = change.documentDelete;\n    assertPresent(docDelete.document, 'documentDelete.document');\n    const key = fromName(serializer, docDelete.document);\n    const version = docDelete.readTime\n      ? fromVersion(docDelete.readTime)\n      : SnapshotVersion.min();\n    const doc = MutableDocument.newNoDocument(key, version);\n    const removedTargetIds = docDelete.removedTargetIds || [];\n    watchChange = new DocumentWatchChange([], removedTargetIds, doc.key, doc);\n  } else if ('documentRemove' in change) {\n    assertPresent(change.documentRemove, 'documentRemove');\n    const docRemove = change.documentRemove;\n    assertPresent(docRemove.document, 'documentRemove');\n    const key = fromName(serializer, docRemove.document);\n    const removedTargetIds = docRemove.removedTargetIds || [];\n    watchChange = new DocumentWatchChange([], removedTargetIds, key, null);\n  } else if ('filter' in change) {\n    // TODO(dimond): implement existence filter parsing with strategy.\n    assertPresent(change.filter, 'filter');\n    const filter = change.filter;\n    assertPresent(filter.targetId, 'filter.targetId');\n    const { count = 0, unchangedNames } = filter;\n    const existenceFilter = new ExistenceFilter(count, unchangedNames);\n    const targetId = filter.targetId;\n    watchChange = new ExistenceFilterChange(targetId, existenceFilter);\n  } else {\n    return fail('Unknown change type ' + JSON.stringify(change));\n  }\n  return watchChange;\n}\n\nfunction fromWatchTargetChangeState(\n  state: ProtoTargetChangeTargetChangeType\n): WatchTargetChangeState {\n  if (state === 'NO_CHANGE') {\n    return WatchTargetChangeState.NoChange;\n  } else if (state === 'ADD') {\n    return WatchTargetChangeState.Added;\n  } else if (state === 'REMOVE') {\n    return WatchTargetChangeState.Removed;\n  } else if (state === 'CURRENT') {\n    return WatchTargetChangeState.Current;\n  } else if (state === 'RESET') {\n    return WatchTargetChangeState.Reset;\n  } else {\n    return fail('Got unexpected TargetChange.state: ' + state);\n  }\n}\n\nexport function versionFromListenResponse(\n  change: ProtoListenResponse\n): SnapshotVersion {\n  // We have only reached a consistent snapshot for the entire stream if there\n  // is a read_time set and it applies to all targets (i.e. the list of\n  // targets is empty). The backend is guaranteed to send such responses.\n  if (!('targetChange' in change)) {\n    return SnapshotVersion.min();\n  }\n  const targetChange = change.targetChange!;\n  if (targetChange.targetIds && targetChange.targetIds.length) {\n    return SnapshotVersion.min();\n  }\n  if (!targetChange.readTime) {\n    return SnapshotVersion.min();\n  }\n  return fromVersion(targetChange.readTime);\n}\n\nexport function toMutation(\n  serializer: JsonProtoSerializer,\n  mutation: Mutation\n): ProtoWrite {\n  let result: ProtoWrite;\n  if (mutation instanceof SetMutation) {\n    result = {\n      update: toMutationDocument(serializer, mutation.key, mutation.value)\n    };\n  } else if (mutation instanceof DeleteMutation) {\n    result = { delete: toName(serializer, mutation.key) };\n  } else if (mutation instanceof PatchMutation) {\n    result = {\n      update: toMutationDocument(serializer, mutation.key, mutation.data),\n      updateMask: toDocumentMask(mutation.fieldMask)\n    };\n  } else if (mutation instanceof VerifyMutation) {\n    result = {\n      verify: toName(serializer, mutation.key)\n    };\n  } else {\n    return fail('Unknown mutation type ' + mutation.type);\n  }\n\n  if (mutation.fieldTransforms.length > 0) {\n    result.updateTransforms = mutation.fieldTransforms.map(transform =>\n      toFieldTransform(serializer, transform)\n    );\n  }\n\n  if (!mutation.precondition.isNone) {\n    result.currentDocument = toPrecondition(serializer, mutation.precondition);\n  }\n\n  return result;\n}\n\nexport function fromMutation(\n  serializer: JsonProtoSerializer,\n  proto: ProtoWrite\n): Mutation {\n  const precondition = proto.currentDocument\n    ? fromPrecondition(proto.currentDocument)\n    : Precondition.none();\n\n  const fieldTransforms = proto.updateTransforms\n    ? proto.updateTransforms.map(transform =>\n        fromFieldTransform(serializer, transform)\n      )\n    : [];\n\n  if (proto.update) {\n    assertPresent(proto.update.name, 'name');\n    const key = fromName(serializer, proto.update.name);\n    const value = new ObjectValue({\n      mapValue: { fields: proto.update.fields }\n    });\n\n    if (proto.updateMask) {\n      const fieldMask = fromDocumentMask(proto.updateMask);\n      return new PatchMutation(\n        key,\n        value,\n        fieldMask,\n        precondition,\n        fieldTransforms\n      );\n    } else {\n      return new SetMutation(key, value, precondition, fieldTransforms);\n    }\n  } else if (proto.delete) {\n    const key = fromName(serializer, proto.delete);\n    return new DeleteMutation(key, precondition);\n  } else if (proto.verify) {\n    const key = fromName(serializer, proto.verify);\n    return new VerifyMutation(key, precondition);\n  } else {\n    return fail('unknown mutation proto: ' + JSON.stringify(proto));\n  }\n}\n\nfunction toPrecondition(\n  serializer: JsonProtoSerializer,\n  precondition: Precondition\n): ProtoPrecondition {\n  debugAssert(!precondition.isNone, \"Can't serialize an empty precondition\");\n  if (precondition.updateTime !== undefined) {\n    return {\n      updateTime: toVersion(serializer, precondition.updateTime)\n    };\n  } else if (precondition.exists !== undefined) {\n    return { exists: precondition.exists };\n  } else {\n    return fail('Unknown precondition');\n  }\n}\n\nfunction fromPrecondition(precondition: ProtoPrecondition): Precondition {\n  if (precondition.updateTime !== undefined) {\n    return Precondition.updateTime(fromVersion(precondition.updateTime));\n  } else if (precondition.exists !== undefined) {\n    return Precondition.exists(precondition.exists);\n  } else {\n    return Precondition.none();\n  }\n}\n\nfunction fromWriteResult(\n  proto: ProtoWriteResult,\n  commitTime: ProtoTimestamp\n): MutationResult {\n  // NOTE: Deletes don't have an updateTime.\n  let version = proto.updateTime\n    ? fromVersion(proto.updateTime)\n    : fromVersion(commitTime);\n\n  if (version.isEqual(SnapshotVersion.min())) {\n    // The Firestore Emulator currently returns an update time of 0 for\n    // deletes of non-existing documents (rather than null). This breaks the\n    // test \"get deleted doc while offline with source=cache\" as NoDocuments\n    // with version 0 are filtered by IndexedDb's RemoteDocumentCache.\n    // TODO(#2149): Remove this when Emulator is fixed\n    version = fromVersion(commitTime);\n  }\n\n  return new MutationResult(version, proto.transformResults || []);\n}\n\nexport function fromWriteResults(\n  protos: ProtoWriteResult[] | undefined,\n  commitTime?: ProtoTimestamp\n): MutationResult[] {\n  if (protos && protos.length > 0) {\n    hardAssert(\n      commitTime !== undefined,\n      'Received a write result without a commit time'\n    );\n    return protos.map(proto => fromWriteResult(proto, commitTime));\n  } else {\n    return [];\n  }\n}\n\nfunction toFieldTransform(\n  serializer: JsonProtoSerializer,\n  fieldTransform: FieldTransform\n): ProtoFieldTransform {\n  const transform = fieldTransform.transform;\n  if (transform instanceof ServerTimestampTransform) {\n    return {\n      fieldPath: fieldTransform.field.canonicalString(),\n      setToServerValue: 'REQUEST_TIME'\n    };\n  } else if (transform instanceof ArrayUnionTransformOperation) {\n    return {\n      fieldPath: fieldTransform.field.canonicalString(),\n      appendMissingElements: {\n        values: transform.elements\n      }\n    };\n  } else if (transform instanceof ArrayRemoveTransformOperation) {\n    return {\n      fieldPath: fieldTransform.field.canonicalString(),\n      removeAllFromArray: {\n        values: transform.elements\n      }\n    };\n  } else if (transform instanceof NumericIncrementTransformOperation) {\n    return {\n      fieldPath: fieldTransform.field.canonicalString(),\n      increment: transform.operand\n    };\n  } else {\n    throw fail('Unknown transform: ' + fieldTransform.transform);\n  }\n}\n\nfunction fromFieldTransform(\n  serializer: JsonProtoSerializer,\n  proto: ProtoFieldTransform\n): FieldTransform {\n  let transform: TransformOperation | null = null;\n  if ('setToServerValue' in proto) {\n    hardAssert(\n      proto.setToServerValue === 'REQUEST_TIME',\n      'Unknown server value transform proto: ' + JSON.stringify(proto)\n    );\n    transform = new ServerTimestampTransform();\n  } else if ('appendMissingElements' in proto) {\n    const values = proto.appendMissingElements!.values || [];\n    transform = new ArrayUnionTransformOperation(values);\n  } else if ('removeAllFromArray' in proto) {\n    const values = proto.removeAllFromArray!.values || [];\n    transform = new ArrayRemoveTransformOperation(values);\n  } else if ('increment' in proto) {\n    transform = new NumericIncrementTransformOperation(\n      serializer,\n      proto.increment!\n    );\n  } else {\n    fail('Unknown transform proto: ' + JSON.stringify(proto));\n  }\n  const fieldPath = FieldPath.fromServerFormat(proto.fieldPath!);\n  return new FieldTransform(fieldPath, transform!);\n}\n\nexport function toDocumentsTarget(\n  serializer: JsonProtoSerializer,\n  target: Target\n): ProtoDocumentsTarget {\n  return { documents: [toQueryPath(serializer, target.path)] };\n}\n\nexport function fromDocumentsTarget(\n  documentsTarget: ProtoDocumentsTarget\n): Target {\n  const count = documentsTarget.documents!.length;\n  hardAssert(\n    count === 1,\n    'DocumentsTarget contained other than 1 document: ' + count\n  );\n  const name = documentsTarget.documents![0];\n  return queryToTarget(newQueryForPath(fromQueryPath(name)));\n}\n\nexport function toQueryTarget(\n  serializer: JsonProtoSerializer,\n  target: Target\n): { queryTarget: ProtoQueryTarget; parent: ResourcePath } {\n  // Dissect the path into parent, collectionId, and optional key filter.\n  const queryTarget: ProtoQueryTarget = { structuredQuery: {} };\n  const path = target.path;\n  let parent: ResourcePath;\n  if (target.collectionGroup !== null) {\n    debugAssert(\n      path.length % 2 === 0,\n      'Collection Group queries should be within a document path or root.'\n    );\n    parent = path;\n    queryTarget.structuredQuery!.from = [\n      {\n        collectionId: target.collectionGroup,\n        allDescendants: true\n      }\n    ];\n  } else {\n    debugAssert(\n      path.length % 2 !== 0,\n      'Document queries with filters are not supported.'\n    );\n    parent = path.popLast();\n    queryTarget.structuredQuery!.from = [{ collectionId: path.lastSegment() }];\n  }\n  queryTarget.parent = toQueryPath(serializer, parent);\n\n  const where = toFilters(target.filters);\n  if (where) {\n    queryTarget.structuredQuery!.where = where;\n  }\n\n  const orderBy = toOrder(target.orderBy);\n  if (orderBy) {\n    queryTarget.structuredQuery!.orderBy = orderBy;\n  }\n\n  const limit = toInt32Proto(serializer, target.limit);\n  if (limit !== null) {\n    queryTarget.structuredQuery!.limit = limit;\n  }\n\n  if (target.startAt) {\n    queryTarget.structuredQuery!.startAt = toStartAtCursor(target.startAt);\n  }\n  if (target.endAt) {\n    queryTarget.structuredQuery!.endAt = toEndAtCursor(target.endAt);\n  }\n\n  return { queryTarget, parent };\n}\n\nexport function toRunAggregationQueryRequest(\n  serializer: JsonProtoSerializer,\n  target: Target,\n  aggregates: Aggregate[]\n): {\n  request: ProtoRunAggregationQueryRequest;\n  aliasMap: Record<string, string>;\n  parent: ResourcePath;\n} {\n  const { queryTarget, parent } = toQueryTarget(serializer, target);\n  const aliasMap: Record<string, string> = {};\n\n  const aggregations: ProtoAggregation[] = [];\n  let aggregationNum = 0;\n\n  aggregates.forEach(aggregate => {\n    // Map all client-side aliases to a unique short-form\n    // alias. This avoids issues with client-side aliases that\n    // exceed the 1500-byte string size limit.\n    const serverAlias = `aggregate_${aggregationNum++}`;\n    aliasMap[serverAlias] = aggregate.alias;\n\n    if (aggregate.aggregateType === 'count') {\n      aggregations.push({\n        alias: serverAlias,\n        count: {}\n      });\n    } else if (aggregate.aggregateType === 'avg') {\n      aggregations.push({\n        alias: serverAlias,\n        avg: {\n          field: toFieldPathReference(aggregate.fieldPath!)\n        }\n      });\n    } else if (aggregate.aggregateType === 'sum') {\n      aggregations.push({\n        alias: serverAlias,\n        sum: {\n          field: toFieldPathReference(aggregate.fieldPath!)\n        }\n      });\n    }\n  });\n\n  return {\n    request: {\n      structuredAggregationQuery: {\n        aggregations,\n        structuredQuery: queryTarget.structuredQuery\n      },\n      parent: queryTarget.parent\n    },\n    aliasMap,\n    parent\n  };\n}\n\nexport function convertQueryTargetToQuery(target: ProtoQueryTarget): Query {\n  let path = fromQueryPath(target.parent!);\n\n  const query = target.structuredQuery!;\n  const fromCount = query.from ? query.from.length : 0;\n  let collectionGroup: string | null = null;\n  if (fromCount > 0) {\n    hardAssert(\n      fromCount === 1,\n      'StructuredQuery.from with more than one collection is not supported.'\n    );\n    const from = query.from![0];\n    if (from.allDescendants) {\n      collectionGroup = from.collectionId!;\n    } else {\n      path = path.child(from.collectionId!);\n    }\n  }\n\n  let filterBy: Filter[] = [];\n  if (query.where) {\n    filterBy = fromFilters(query.where);\n  }\n\n  let orderBy: OrderBy[] = [];\n  if (query.orderBy) {\n    orderBy = fromOrder(query.orderBy);\n  }\n\n  let limit: number | null = null;\n  if (query.limit) {\n    limit = fromInt32Proto(query.limit);\n  }\n\n  let startAt: Bound | null = null;\n  if (query.startAt) {\n    startAt = fromStartAtCursor(query.startAt);\n  }\n\n  let endAt: Bound | null = null;\n  if (query.endAt) {\n    endAt = fromEndAtCursor(query.endAt);\n  }\n\n  return newQuery(\n    path,\n    collectionGroup,\n    orderBy,\n    filterBy,\n    limit,\n    LimitType.First,\n    startAt,\n    endAt\n  );\n}\n\nexport function fromQueryTarget(target: ProtoQueryTarget): Target {\n  return queryToTarget(convertQueryTargetToQuery(target));\n}\n\nexport function toListenRequestLabels(\n  serializer: JsonProtoSerializer,\n  targetData: TargetData\n): ProtoApiClientObjectMap<string> | null {\n  const value = toLabel(targetData.purpose);\n  if (value == null) {\n    return null;\n  } else {\n    return {\n      'goog-listen-tags': value\n    };\n  }\n}\n\nexport function toLabel(purpose: TargetPurpose): string | null {\n  switch (purpose) {\n    case TargetPurpose.Listen:\n      return null;\n    case TargetPurpose.ExistenceFilterMismatch:\n      return 'existence-filter-mismatch';\n    case TargetPurpose.ExistenceFilterMismatchBloom:\n      return 'existence-filter-mismatch-bloom';\n    case TargetPurpose.LimboResolution:\n      return 'limbo-document';\n    default:\n      return fail('Unrecognized query purpose: ' + purpose);\n  }\n}\n\nexport function toTarget(\n  serializer: JsonProtoSerializer,\n  targetData: TargetData\n): ProtoTarget {\n  let result: ProtoTarget;\n  const target = targetData.target;\n\n  if (targetIsDocumentTarget(target)) {\n    result = { documents: toDocumentsTarget(serializer, target) };\n  } else {\n    result = { query: toQueryTarget(serializer, target).queryTarget };\n  }\n\n  result.targetId = targetData.targetId;\n\n  if (targetData.resumeToken.approximateByteSize() > 0) {\n    result.resumeToken = toBytes(serializer, targetData.resumeToken);\n    const expectedCount = toInt32Proto(serializer, targetData.expectedCount);\n    if (expectedCount !== null) {\n      result.expectedCount = expectedCount;\n    }\n  } else if (targetData.snapshotVersion.compareTo(SnapshotVersion.min()) > 0) {\n    // TODO(wuandy): Consider removing above check because it is most likely true.\n    // Right now, many tests depend on this behaviour though (leaving min() out\n    // of serialization).\n    result.readTime = toTimestamp(\n      serializer,\n      targetData.snapshotVersion.toTimestamp()\n    );\n    const expectedCount = toInt32Proto(serializer, targetData.expectedCount);\n    if (expectedCount !== null) {\n      result.expectedCount = expectedCount;\n    }\n  }\n\n  return result;\n}\n\nfunction toFilters(filters: Filter[]): ProtoFilter | undefined {\n  if (filters.length === 0) {\n    return;\n  }\n\n  return toFilter(CompositeFilter.create(filters, CompositeOperator.AND));\n}\n\nfunction fromFilters(filter: ProtoFilter): Filter[] {\n  const result = fromFilter(filter);\n\n  if (\n    result instanceof CompositeFilter &&\n    compositeFilterIsFlatConjunction(result)\n  ) {\n    return result.getFilters();\n  }\n\n  return [result];\n}\n\nfunction fromFilter(filter: ProtoFilter): Filter {\n  if (filter.unaryFilter !== undefined) {\n    return fromUnaryFilter(filter);\n  } else if (filter.fieldFilter !== undefined) {\n    return fromFieldFilter(filter);\n  } else if (filter.compositeFilter !== undefined) {\n    return fromCompositeFilter(filter);\n  } else {\n    return fail('Unknown filter: ' + JSON.stringify(filter));\n  }\n}\n\nfunction toOrder(orderBys: OrderBy[]): ProtoOrder[] | undefined {\n  if (orderBys.length === 0) {\n    return;\n  }\n  return orderBys.map(order => toPropertyOrder(order));\n}\n\nfunction fromOrder(orderBys: ProtoOrder[]): OrderBy[] {\n  return orderBys.map(order => fromPropertyOrder(order));\n}\n\nfunction toStartAtCursor(cursor: Bound): ProtoCursor {\n  return {\n    before: cursor.inclusive,\n    values: cursor.position\n  };\n}\n\nfunction toEndAtCursor(cursor: Bound): ProtoCursor {\n  return {\n    before: !cursor.inclusive,\n    values: cursor.position\n  };\n}\n\nfunction fromStartAtCursor(cursor: ProtoCursor): Bound {\n  const inclusive = !!cursor.before;\n  const position = cursor.values || [];\n  return new Bound(position, inclusive);\n}\n\nfunction fromEndAtCursor(cursor: ProtoCursor): Bound {\n  const inclusive = !cursor.before;\n  const position = cursor.values || [];\n  return new Bound(position, inclusive);\n}\n\n// visible for testing\nexport function toDirection(dir: Direction): ProtoOrderDirection {\n  return DIRECTIONS[dir];\n}\n\n// visible for testing\nexport function fromDirection(\n  dir: ProtoOrderDirection | undefined\n): Direction | undefined {\n  switch (dir) {\n    case 'ASCENDING':\n      return Direction.ASCENDING;\n    case 'DESCENDING':\n      return Direction.DESCENDING;\n    default:\n      return undefined;\n  }\n}\n\n// visible for testing\nexport function toOperatorName(op: Operator): ProtoFieldFilterOp {\n  return OPERATORS[op];\n}\n\nexport function toCompositeOperatorName(\n  op: CompositeOperator\n): ProtoCompositeFilterOp {\n  return COMPOSITE_OPERATORS[op];\n}\n\nexport function fromOperatorName(op: ProtoFieldFilterOp): Operator {\n  switch (op) {\n    case 'EQUAL':\n      return Operator.EQUAL;\n    case 'NOT_EQUAL':\n      return Operator.NOT_EQUAL;\n    case 'GREATER_THAN':\n      return Operator.GREATER_THAN;\n    case 'GREATER_THAN_OR_EQUAL':\n      return Operator.GREATER_THAN_OR_EQUAL;\n    case 'LESS_THAN':\n      return Operator.LESS_THAN;\n    case 'LESS_THAN_OR_EQUAL':\n      return Operator.LESS_THAN_OR_EQUAL;\n    case 'ARRAY_CONTAINS':\n      return Operator.ARRAY_CONTAINS;\n    case 'IN':\n      return Operator.IN;\n    case 'NOT_IN':\n      return Operator.NOT_IN;\n    case 'ARRAY_CONTAINS_ANY':\n      return Operator.ARRAY_CONTAINS_ANY;\n    case 'OPERATOR_UNSPECIFIED':\n      return fail('Unspecified operator');\n    default:\n      return fail('Unknown operator');\n  }\n}\n\nexport function fromCompositeOperatorName(\n  op: ProtoCompositeFilterOp\n): CompositeOperator {\n  switch (op) {\n    case 'AND':\n      return CompositeOperator.AND;\n    case 'OR':\n      return CompositeOperator.OR;\n    default:\n      return fail('Unknown operator');\n  }\n}\n\nexport function toFieldPathReference(path: FieldPath): ProtoFieldReference {\n  return { fieldPath: path.canonicalString() };\n}\n\nexport function fromFieldPathReference(\n  fieldReference: ProtoFieldReference\n): FieldPath {\n  return FieldPath.fromServerFormat(fieldReference.fieldPath!);\n}\n\n// visible for testing\nexport function toPropertyOrder(orderBy: OrderBy): ProtoOrder {\n  return {\n    field: toFieldPathReference(orderBy.field),\n    direction: toDirection(orderBy.dir)\n  };\n}\n\nexport function fromPropertyOrder(orderBy: ProtoOrder): OrderBy {\n  return new OrderBy(\n    fromFieldPathReference(orderBy.field!),\n    fromDirection(orderBy.direction)\n  );\n}\n\n// visible for testing\nexport function toFilter(filter: Filter): ProtoFilter {\n  if (filter instanceof FieldFilter) {\n    return toUnaryOrFieldFilter(filter);\n  } else if (filter instanceof CompositeFilter) {\n    return toCompositeFilter(filter);\n  } else {\n    return fail('Unrecognized filter type ' + JSON.stringify(filter));\n  }\n}\n\nexport function toCompositeFilter(filter: CompositeFilter): ProtoFilter {\n  const protos = filter.getFilters().map(filter => toFilter(filter));\n\n  if (protos.length === 1) {\n    return protos[0];\n  }\n\n  return {\n    compositeFilter: {\n      op: toCompositeOperatorName(filter.op),\n      filters: protos\n    }\n  };\n}\n\nexport function toUnaryOrFieldFilter(filter: FieldFilter): ProtoFilter {\n  if (filter.op === Operator.EQUAL) {\n    if (isNanValue(filter.value)) {\n      return {\n        unaryFilter: {\n          field: toFieldPathReference(filter.field),\n          op: 'IS_NAN'\n        }\n      };\n    } else if (isNullValue(filter.value)) {\n      return {\n        unaryFilter: {\n          field: toFieldPathReference(filter.field),\n          op: 'IS_NULL'\n        }\n      };\n    }\n  } else if (filter.op === Operator.NOT_EQUAL) {\n    if (isNanValue(filter.value)) {\n      return {\n        unaryFilter: {\n          field: toFieldPathReference(filter.field),\n          op: 'IS_NOT_NAN'\n        }\n      };\n    } else if (isNullValue(filter.value)) {\n      return {\n        unaryFilter: {\n          field: toFieldPathReference(filter.field),\n          op: 'IS_NOT_NULL'\n        }\n      };\n    }\n  }\n  return {\n    fieldFilter: {\n      field: toFieldPathReference(filter.field),\n      op: toOperatorName(filter.op),\n      value: filter.value\n    }\n  };\n}\n\nexport function fromUnaryFilter(filter: ProtoFilter): Filter {\n  switch (filter.unaryFilter!.op!) {\n    case 'IS_NAN':\n      const nanField = fromFieldPathReference(filter.unaryFilter!.field!);\n      return FieldFilter.create(nanField, Operator.EQUAL, {\n        doubleValue: NaN\n      });\n    case 'IS_NULL':\n      const nullField = fromFieldPathReference(filter.unaryFilter!.field!);\n      return FieldFilter.create(nullField, Operator.EQUAL, {\n        nullValue: 'NULL_VALUE'\n      });\n    case 'IS_NOT_NAN':\n      const notNanField = fromFieldPathReference(filter.unaryFilter!.field!);\n      return FieldFilter.create(notNanField, Operator.NOT_EQUAL, {\n        doubleValue: NaN\n      });\n    case 'IS_NOT_NULL':\n      const notNullField = fromFieldPathReference(filter.unaryFilter!.field!);\n      return FieldFilter.create(notNullField, Operator.NOT_EQUAL, {\n        nullValue: 'NULL_VALUE'\n      });\n    case 'OPERATOR_UNSPECIFIED':\n      return fail('Unspecified filter');\n    default:\n      return fail('Unknown filter');\n  }\n}\n\nexport function fromFieldFilter(filter: ProtoFilter): FieldFilter {\n  return FieldFilter.create(\n    fromFieldPathReference(filter.fieldFilter!.field!),\n    fromOperatorName(filter.fieldFilter!.op!),\n    filter.fieldFilter!.value!\n  );\n}\n\nexport function fromCompositeFilter(filter: ProtoFilter): CompositeFilter {\n  return CompositeFilter.create(\n    filter.compositeFilter!.filters!.map(filter => fromFilter(filter)),\n    fromCompositeOperatorName(filter.compositeFilter!.op!)\n  );\n}\n\nexport function toDocumentMask(fieldMask: FieldMask): ProtoDocumentMask {\n  const canonicalFields: string[] = [];\n  fieldMask.fields.forEach(field =>\n    canonicalFields.push(field.canonicalString())\n  );\n  return {\n    fieldPaths: canonicalFields\n  };\n}\n\nexport function fromDocumentMask(proto: ProtoDocumentMask): FieldMask {\n  const paths = proto.fieldPaths || [];\n  return new FieldMask(paths.map(path => FieldPath.fromServerFormat(path)));\n}\n\nexport function isValidResourceName(path: ResourcePath): boolean {\n  // Resource names have at least 4 components (project ID, database ID)\n  return (\n    path.length >= 4 &&\n    path.get(0) === 'projects' &&\n    path.get(2) === 'databases'\n  );\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport { Target } from '../core/target';\nimport { ListenSequenceNumber, TargetId } from '../core/types';\nimport { ByteString } from '../util/byte_string';\n\n/** An enumeration of the different purposes we have for targets. */\nexport const enum TargetPurpose {\n  /** A regular, normal query target. */\n  Listen = 'TargetPurposeListen',\n\n  /**\n   * The query target was used to refill a query after an existence filter\n   * mismatch.\n   */\n  ExistenceFilterMismatch = 'TargetPurposeExistenceFilterMismatch',\n\n  /**\n   * The query target was used if the query is the result of a false positive in\n   * the bloom filter.\n   */\n  ExistenceFilterMismatchBloom = 'TargetPurposeExistenceFilterMismatchBloom',\n\n  /** The query target was used to resolve a limbo document. */\n  LimboResolution = 'TargetPurposeLimboResolution'\n}\n\n/**\n * An immutable set of metadata that the local store tracks for each target.\n */\nexport class TargetData {\n  constructor(\n    /** The target being listened to. */\n    readonly target: Target,\n    /**\n     * The target ID to which the target corresponds; Assigned by the\n     * LocalStore for user listens and by the SyncEngine for limbo watches.\n     */\n    readonly targetId: TargetId,\n    /** The purpose of the target. */\n    readonly purpose: TargetPurpose,\n    /**\n     * The sequence number of the last transaction during which this target data\n     * was modified.\n     */\n    readonly sequenceNumber: ListenSequenceNumber,\n    /** The latest snapshot version seen for this target. */\n    readonly snapshotVersion: SnapshotVersion = SnapshotVersion.min(),\n    /**\n     * The maximum snapshot version at which the associated view\n     * contained no limbo documents.\n     */\n    readonly lastLimboFreeSnapshotVersion: SnapshotVersion = SnapshotVersion.min(),\n    /**\n     * An opaque, server-assigned token that allows watching a target to be\n     * resumed after disconnecting without retransmitting all the data that\n     * matches the target. The resume token essentially identifies a point in\n     * time from which the server should resume sending results.\n     */\n    readonly resumeToken: ByteString = ByteString.EMPTY_BYTE_STRING,\n    /**\n     * The number of documents that last matched the query at the resume token or\n     * read time. Documents are counted only when making a listen request with\n     * resume token or read time, otherwise, keep it null.\n     */\n    readonly expectedCount: number | null = null\n  ) {}\n\n  /** Creates a new target data instance with an updated sequence number. */\n  withSequenceNumber(sequenceNumber: number): TargetData {\n    return new TargetData(\n      this.target,\n      this.targetId,\n      this.purpose,\n      sequenceNumber,\n      this.snapshotVersion,\n      this.lastLimboFreeSnapshotVersion,\n      this.resumeToken,\n      this.expectedCount\n    );\n  }\n\n  /**\n   * Creates a new target data instance with an updated resume token and\n   * snapshot version.\n   */\n  withResumeToken(\n    resumeToken: ByteString,\n    snapshotVersion: SnapshotVersion\n  ): TargetData {\n    return new TargetData(\n      this.target,\n      this.targetId,\n      this.purpose,\n      this.sequenceNumber,\n      snapshotVersion,\n      this.lastLimboFreeSnapshotVersion,\n      resumeToken,\n      /* expectedCount= */ null\n    );\n  }\n\n  /**\n   * Creates a new target data instance with an updated expected count.\n   */\n  withExpectedCount(expectedCount: number): TargetData {\n    return new TargetData(\n      this.target,\n      this.targetId,\n      this.purpose,\n      this.sequenceNumber,\n      this.snapshotVersion,\n      this.lastLimboFreeSnapshotVersion,\n      this.resumeToken,\n      expectedCount\n    );\n  }\n\n  /**\n   * Creates a new target data instance with an updated last limbo free\n   * snapshot version number.\n   */\n  withLastLimboFreeSnapshotVersion(\n    lastLimboFreeSnapshotVersion: SnapshotVersion\n  ): TargetData {\n    return new TargetData(\n      this.target,\n      this.targetId,\n      this.purpose,\n      this.sequenceNumber,\n      this.snapshotVersion,\n      lastLimboFreeSnapshotVersion,\n      this.resumeToken,\n      this.expectedCount\n    );\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Timestamp } from '../api/timestamp';\nimport { BundleMetadata, NamedQuery } from '../core/bundle';\nimport { LimitType, Query, queryWithLimit } from '../core/query';\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport { canonifyTarget, Target, targetIsDocumentTarget } from '../core/target';\nimport { MutableDocument } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport {\n  FieldIndex,\n  IndexOffset,\n  IndexSegment,\n  IndexState\n} from '../model/field_index';\nimport { MutationBatch } from '../model/mutation_batch';\nimport { Overlay } from '../model/overlay';\nimport { FieldPath } from '../model/path';\nimport {\n  BundledQuery as ProtoBundledQuery,\n  BundleMetadata as ProtoBundleMetadata,\n  NamedQuery as ProtoNamedQuery\n} from '../protos/firestore_bundle_proto';\nimport { DocumentsTarget as PublicDocumentsTarget } from '../protos/firestore_proto_api';\nimport {\n  convertQueryTargetToQuery,\n  fromDocument,\n  fromDocumentsTarget,\n  fromMutation,\n  fromQueryTarget,\n  fromVersion,\n  JsonProtoSerializer,\n  toDocument,\n  toDocumentsTarget,\n  toMutation,\n  toQueryTarget\n} from '../remote/serializer';\nimport { debugAssert, fail } from '../util/assert';\nimport { ByteString } from '../util/byte_string';\n\nimport {\n  decodeResourcePath,\n  encodeResourcePath\n} from './encoded_resource_path';\nimport {\n  DbBundle,\n  DbDocumentOverlay,\n  DbIndexConfiguration,\n  DbIndexState,\n  DbMutationBatch,\n  DbNamedQuery,\n  DbQuery,\n  DbRemoteDocument,\n  DbTarget,\n  DbTimestamp\n} from './indexeddb_schema';\nimport { DbDocumentOverlayKey, DbTimestampKey } from './indexeddb_sentinels';\nimport { TargetData, TargetPurpose } from './target_data';\n\n/** Serializer for values stored in the LocalStore. */\nexport class LocalSerializer {\n  constructor(readonly remoteSerializer: JsonProtoSerializer) {}\n}\n\n/** Decodes a remote document from storage locally to a Document. */\nexport function fromDbRemoteDocument(\n  localSerializer: LocalSerializer,\n  remoteDoc: DbRemoteDocument\n): MutableDocument {\n  let doc: MutableDocument;\n  if (remoteDoc.document) {\n    doc = fromDocument(\n      localSerializer.remoteSerializer,\n      remoteDoc.document,\n      !!remoteDoc.hasCommittedMutations\n    );\n  } else if (remoteDoc.noDocument) {\n    const key = DocumentKey.fromSegments(remoteDoc.noDocument.path);\n    const version = fromDbTimestamp(remoteDoc.noDocument.readTime);\n    doc = MutableDocument.newNoDocument(key, version);\n    if (remoteDoc.hasCommittedMutations) {\n      doc.setHasCommittedMutations();\n    }\n  } else if (remoteDoc.unknownDocument) {\n    const key = DocumentKey.fromSegments(remoteDoc.unknownDocument.path);\n    const version = fromDbTimestamp(remoteDoc.unknownDocument.version);\n    doc = MutableDocument.newUnknownDocument(key, version);\n  } else {\n    return fail('Unexpected DbRemoteDocument');\n  }\n\n  if (remoteDoc.readTime) {\n    doc.setReadTime(fromDbTimestampKey(remoteDoc.readTime));\n  }\n\n  return doc;\n}\n\n/** Encodes a document for storage locally. */\nexport function toDbRemoteDocument(\n  localSerializer: LocalSerializer,\n  document: MutableDocument\n): DbRemoteDocument {\n  const key = document.key;\n  const remoteDoc: DbRemoteDocument = {\n    prefixPath: key.getCollectionPath().popLast().toArray(),\n    collectionGroup: key.collectionGroup,\n    documentId: key.path.lastSegment(),\n    readTime: toDbTimestampKey(document.readTime),\n    hasCommittedMutations: document.hasCommittedMutations\n  };\n\n  if (document.isFoundDocument()) {\n    remoteDoc.document = toDocument(localSerializer.remoteSerializer, document);\n  } else if (document.isNoDocument()) {\n    remoteDoc.noDocument = {\n      path: key.path.toArray(),\n      readTime: toDbTimestamp(document.version)\n    };\n  } else if (document.isUnknownDocument()) {\n    remoteDoc.unknownDocument = {\n      path: key.path.toArray(),\n      version: toDbTimestamp(document.version)\n    };\n  } else {\n    return fail('Unexpected Document ' + document);\n  }\n  return remoteDoc;\n}\n\nexport function toDbTimestampKey(\n  snapshotVersion: SnapshotVersion\n): DbTimestampKey {\n  const timestamp = snapshotVersion.toTimestamp();\n  return [timestamp.seconds, timestamp.nanoseconds];\n}\n\nexport function fromDbTimestampKey(\n  dbTimestampKey: DbTimestampKey\n): SnapshotVersion {\n  const timestamp = new Timestamp(dbTimestampKey[0], dbTimestampKey[1]);\n  return SnapshotVersion.fromTimestamp(timestamp);\n}\n\nexport function toDbTimestamp(snapshotVersion: SnapshotVersion): DbTimestamp {\n  const timestamp = snapshotVersion.toTimestamp();\n  return { seconds: timestamp.seconds, nanoseconds: timestamp.nanoseconds };\n}\n\nfunction fromDbTimestamp(dbTimestamp: DbTimestamp): SnapshotVersion {\n  const timestamp = new Timestamp(dbTimestamp.seconds, dbTimestamp.nanoseconds);\n  return SnapshotVersion.fromTimestamp(timestamp);\n}\n\n/** Encodes a batch of mutations into a DbMutationBatch for local storage. */\nexport function toDbMutationBatch(\n  localSerializer: LocalSerializer,\n  userId: string,\n  batch: MutationBatch\n): DbMutationBatch {\n  const serializedBaseMutations = batch.baseMutations.map(m =>\n    toMutation(localSerializer.remoteSerializer, m)\n  );\n  const serializedMutations = batch.mutations.map(m =>\n    toMutation(localSerializer.remoteSerializer, m)\n  );\n  return {\n    userId,\n    batchId: batch.batchId,\n    localWriteTimeMs: batch.localWriteTime.toMillis(),\n    baseMutations: serializedBaseMutations,\n    mutations: serializedMutations\n  };\n}\n\n/** Decodes a DbMutationBatch into a MutationBatch */\nexport function fromDbMutationBatch(\n  localSerializer: LocalSerializer,\n  dbBatch: DbMutationBatch\n): MutationBatch {\n  const baseMutations = (dbBatch.baseMutations || []).map(m =>\n    fromMutation(localSerializer.remoteSerializer, m)\n  );\n\n  // Squash old transform mutations into existing patch or set mutations.\n  // The replacement of representing `transforms` with `update_transforms`\n  // on the SDK means that old `transform` mutations stored in IndexedDB need\n  // to be updated to `update_transforms`.\n  // TODO(b/174608374): Remove this code once we perform a schema migration.\n  for (let i = 0; i < dbBatch.mutations.length - 1; ++i) {\n    const currentMutation = dbBatch.mutations[i];\n    const hasTransform =\n      i + 1 < dbBatch.mutations.length &&\n      dbBatch.mutations[i + 1].transform !== undefined;\n    if (hasTransform) {\n      debugAssert(\n        dbBatch.mutations[i].transform === undefined &&\n          dbBatch.mutations[i].update !== undefined,\n        'TransformMutation should be preceded by a patch or set mutation'\n      );\n      const transformMutation = dbBatch.mutations[i + 1];\n      currentMutation.updateTransforms =\n        transformMutation.transform!.fieldTransforms;\n      dbBatch.mutations.splice(i + 1, 1);\n      ++i;\n    }\n  }\n\n  const mutations = dbBatch.mutations.map(m =>\n    fromMutation(localSerializer.remoteSerializer, m)\n  );\n  const timestamp = Timestamp.fromMillis(dbBatch.localWriteTimeMs);\n  return new MutationBatch(\n    dbBatch.batchId,\n    timestamp,\n    baseMutations,\n    mutations\n  );\n}\n\n/** Decodes a DbTarget into TargetData */\nexport function fromDbTarget(dbTarget: DbTarget): TargetData {\n  const version = fromDbTimestamp(dbTarget.readTime);\n  const lastLimboFreeSnapshotVersion =\n    dbTarget.lastLimboFreeSnapshotVersion !== undefined\n      ? fromDbTimestamp(dbTarget.lastLimboFreeSnapshotVersion)\n      : SnapshotVersion.min();\n\n  let target: Target;\n  if (isDocumentQuery(dbTarget.query)) {\n    target = fromDocumentsTarget(dbTarget.query);\n  } else {\n    target = fromQueryTarget(dbTarget.query);\n  }\n  return new TargetData(\n    target,\n    dbTarget.targetId,\n    TargetPurpose.Listen,\n    dbTarget.lastListenSequenceNumber,\n    version,\n    lastLimboFreeSnapshotVersion,\n    ByteString.fromBase64String(dbTarget.resumeToken)\n  );\n}\n\n/** Encodes TargetData into a DbTarget for storage locally. */\nexport function toDbTarget(\n  localSerializer: LocalSerializer,\n  targetData: TargetData\n): DbTarget {\n  debugAssert(\n    TargetPurpose.Listen === targetData.purpose,\n    'Only queries with purpose ' +\n      TargetPurpose.Listen +\n      ' may be stored, got ' +\n      targetData.purpose\n  );\n  const dbTimestamp = toDbTimestamp(targetData.snapshotVersion);\n  const dbLastLimboFreeTimestamp = toDbTimestamp(\n    targetData.lastLimboFreeSnapshotVersion\n  );\n  let queryProto: DbQuery;\n  if (targetIsDocumentTarget(targetData.target)) {\n    queryProto = toDocumentsTarget(\n      localSerializer.remoteSerializer,\n      targetData.target\n    );\n  } else {\n    queryProto = toQueryTarget(\n      localSerializer.remoteSerializer,\n      targetData.target\n    ).queryTarget;\n  }\n\n  // We can't store the resumeToken as a ByteString in IndexedDb, so we\n  // convert it to a base64 string for storage.\n  const resumeToken = targetData.resumeToken.toBase64();\n\n  // lastListenSequenceNumber is always 0 until we do real GC.\n  return {\n    targetId: targetData.targetId,\n    canonicalId: canonifyTarget(targetData.target),\n    readTime: dbTimestamp,\n    resumeToken,\n    lastListenSequenceNumber: targetData.sequenceNumber,\n    lastLimboFreeSnapshotVersion: dbLastLimboFreeTimestamp,\n    query: queryProto\n  };\n}\n\n/**\n * A helper function for figuring out what kind of query has been stored.\n */\nfunction isDocumentQuery(dbQuery: DbQuery): dbQuery is PublicDocumentsTarget {\n  return (dbQuery as PublicDocumentsTarget).documents !== undefined;\n}\n\n/** Encodes a DbBundle to a BundleMetadata object. */\nexport function fromDbBundle(dbBundle: DbBundle): BundleMetadata {\n  return {\n    id: dbBundle.bundleId,\n    createTime: fromDbTimestamp(dbBundle.createTime),\n    version: dbBundle.version\n  };\n}\n\n/** Encodes a BundleMetadata to a DbBundle. */\nexport function toDbBundle(metadata: ProtoBundleMetadata): DbBundle {\n  return {\n    bundleId: metadata.id!,\n    createTime: toDbTimestamp(fromVersion(metadata.createTime!)),\n    version: metadata.version!\n  };\n}\n\n/** Encodes a DbNamedQuery to a NamedQuery. */\nexport function fromDbNamedQuery(dbNamedQuery: DbNamedQuery): NamedQuery {\n  return {\n    name: dbNamedQuery.name,\n    query: fromBundledQuery(dbNamedQuery.bundledQuery),\n    readTime: fromDbTimestamp(dbNamedQuery.readTime)\n  };\n}\n\n/** Encodes a NamedQuery from a bundle proto to a DbNamedQuery. */\nexport function toDbNamedQuery(query: ProtoNamedQuery): DbNamedQuery {\n  return {\n    name: query.name!,\n    readTime: toDbTimestamp(fromVersion(query.readTime!)),\n    bundledQuery: query.bundledQuery!\n  };\n}\n\n/**\n * Encodes a `BundledQuery` from bundle proto to a Query object.\n *\n * This reconstructs the original query used to build the bundle being loaded,\n * including features exists only in SDKs (for example: limit-to-last).\n */\nexport function fromBundledQuery(bundledQuery: ProtoBundledQuery): Query {\n  const query = convertQueryTargetToQuery({\n    parent: bundledQuery.parent!,\n    structuredQuery: bundledQuery.structuredQuery!\n  });\n  if (bundledQuery.limitType === 'LAST') {\n    debugAssert(\n      !!query.limit,\n      'Bundled query has limitType LAST, but limit is null'\n    );\n    return queryWithLimit(query, query.limit, LimitType.Last);\n  }\n  return query;\n}\n\n/** Encodes a NamedQuery proto object to a NamedQuery model object. */\nexport function fromProtoNamedQuery(namedQuery: ProtoNamedQuery): NamedQuery {\n  return {\n    name: namedQuery.name!,\n    query: fromBundledQuery(namedQuery.bundledQuery!),\n    readTime: fromVersion(namedQuery.readTime!)\n  };\n}\n\n/** Decodes a BundleMetadata proto into a BundleMetadata object. */\nexport function fromBundleMetadata(\n  metadata: ProtoBundleMetadata\n): BundleMetadata {\n  return {\n    id: metadata.id!,\n    version: metadata.version!,\n    createTime: fromVersion(metadata.createTime!)\n  };\n}\n\n/** Encodes a DbDocumentOverlay object to an Overlay model object. */\nexport function fromDbDocumentOverlay(\n  localSerializer: LocalSerializer,\n  dbDocumentOverlay: DbDocumentOverlay\n): Overlay {\n  return new Overlay(\n    dbDocumentOverlay.largestBatchId,\n    fromMutation(\n      localSerializer.remoteSerializer,\n      dbDocumentOverlay.overlayMutation\n    )\n  );\n}\n\n/** Decodes an Overlay model object into a DbDocumentOverlay object. */\nexport function toDbDocumentOverlay(\n  localSerializer: LocalSerializer,\n  userId: string,\n  overlay: Overlay\n): DbDocumentOverlay {\n  const [_, collectionPath, documentId] = toDbDocumentOverlayKey(\n    userId,\n    overlay.mutation.key\n  );\n  return {\n    userId,\n    collectionPath,\n    documentId,\n    collectionGroup: overlay.mutation.key.getCollectionGroup(),\n    largestBatchId: overlay.largestBatchId,\n    overlayMutation: toMutation(\n      localSerializer.remoteSerializer,\n      overlay.mutation\n    )\n  };\n}\n\n/**\n * Returns the DbDocumentOverlayKey corresponding to the given user and\n * document key.\n */\nexport function toDbDocumentOverlayKey(\n  userId: string,\n  docKey: DocumentKey\n): DbDocumentOverlayKey {\n  const docId = docKey.path.lastSegment();\n  const collectionPath = encodeResourcePath(docKey.path.popLast());\n  return [userId, collectionPath, docId];\n}\n\nexport function toDbIndexConfiguration(\n  index: FieldIndex\n): DbIndexConfiguration {\n  return {\n    indexId: index.indexId,\n    collectionGroup: index.collectionGroup,\n    fields: index.fields.map(s => [s.fieldPath.canonicalString(), s.kind])\n  };\n}\n\nexport function fromDbIndexConfiguration(\n  index: DbIndexConfiguration,\n  state: DbIndexState | null\n): FieldIndex {\n  const decodedState = state\n    ? new IndexState(\n        state.sequenceNumber,\n        new IndexOffset(\n          fromDbTimestamp(state.readTime),\n          new DocumentKey(decodeResourcePath(state.documentKey)),\n          state.largestBatchId\n        )\n      )\n    : IndexState.empty();\n  const decodedSegments = index.fields.map(\n    ([fieldPath, kind]) =>\n      new IndexSegment(FieldPath.fromServerFormat(fieldPath), kind)\n  );\n  return new FieldIndex(\n    index.indexId!,\n    index.collectionGroup,\n    decodedSegments,\n    decodedState\n  );\n}\n\nexport function toDbIndexState(\n  indexId: number,\n  uid: string,\n  sequenceNumber: number,\n  offset: IndexOffset\n): DbIndexState {\n  return {\n    indexId,\n    uid,\n    sequenceNumber,\n    readTime: toDbTimestamp(offset.readTime),\n    documentKey: encodeResourcePath(offset.documentKey.path),\n    largestBatchId: offset.largestBatchId\n  };\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BundleMetadata, NamedQuery } from '../core/bundle';\nimport {\n  BundleMetadata as ProtoBundleMetadata,\n  NamedQuery as ProtoNamedQuery\n} from '../protos/firestore_bundle_proto';\n\nimport { BundleCache } from './bundle_cache';\nimport { DbBundle, DbNamedQuery } from './indexeddb_schema';\nimport {\n  DbBundlesKey,\n  DbBundleStore,\n  DbNamedQueriesKey,\n  DbNamedQueryStore\n} from './indexeddb_sentinels';\nimport { getStore } from './indexeddb_transaction';\nimport {\n  fromDbBundle,\n  fromDbNamedQuery,\n  toDbBundle,\n  toDbNamedQuery\n} from './local_serializer';\nimport { PersistencePromise } from './persistence_promise';\nimport { PersistenceTransaction } from './persistence_transaction';\nimport { SimpleDbStore } from './simple_db';\n\nexport class IndexedDbBundleCache implements BundleCache {\n  getBundleMetadata(\n    transaction: PersistenceTransaction,\n    bundleId: string\n  ): PersistencePromise<BundleMetadata | undefined> {\n    return bundlesStore(transaction)\n      .get(bundleId)\n      .next(bundle => {\n        if (bundle) {\n          return fromDbBundle(bundle);\n        }\n        return undefined;\n      });\n  }\n\n  saveBundleMetadata(\n    transaction: PersistenceTransaction,\n    bundleMetadata: ProtoBundleMetadata\n  ): PersistencePromise<void> {\n    return bundlesStore(transaction).put(toDbBundle(bundleMetadata));\n  }\n\n  getNamedQuery(\n    transaction: PersistenceTransaction,\n    queryName: string\n  ): PersistencePromise<NamedQuery | undefined> {\n    return namedQueriesStore(transaction)\n      .get(queryName)\n      .next(query => {\n        if (query) {\n          return fromDbNamedQuery(query);\n        }\n        return undefined;\n      });\n  }\n\n  saveNamedQuery(\n    transaction: PersistenceTransaction,\n    query: ProtoNamedQuery\n  ): PersistencePromise<void> {\n    return namedQueriesStore(transaction).put(toDbNamedQuery(query));\n  }\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the bundles object store.\n */\nfunction bundlesStore(\n  txn: PersistenceTransaction\n): SimpleDbStore<DbBundlesKey, DbBundle> {\n  return getStore<DbBundlesKey, DbBundle>(txn, DbBundleStore);\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the namedQueries object store.\n */\nfunction namedQueriesStore(\n  txn: PersistenceTransaction\n): SimpleDbStore<DbNamedQueriesKey, DbNamedQuery> {\n  return getStore<DbNamedQueriesKey, DbNamedQuery>(txn, DbNamedQueryStore);\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { User } from '../auth/user';\nimport {\n  DocumentKeySet,\n  MutationMap,\n  OverlayMap,\n  newOverlayMap\n} from '../model/collections';\nimport { DocumentKey } from '../model/document_key';\nimport { Overlay } from '../model/overlay';\nimport { ResourcePath } from '../model/path';\n\nimport { DocumentOverlayCache } from './document_overlay_cache';\nimport { encodeResourcePath } from './encoded_resource_path';\nimport { DbDocumentOverlay } from './indexeddb_schema';\nimport {\n  DbDocumentOverlayCollectionGroupOverlayIndex,\n  DbDocumentOverlayCollectionPathOverlayIndex,\n  DbDocumentOverlayKey,\n  DbDocumentOverlayStore\n} from './indexeddb_sentinels';\nimport { getStore } from './indexeddb_transaction';\nimport {\n  fromDbDocumentOverlay,\n  LocalSerializer,\n  toDbDocumentOverlay,\n  toDbDocumentOverlayKey\n} from './local_serializer';\nimport { PersistencePromise } from './persistence_promise';\nimport { PersistenceTransaction } from './persistence_transaction';\nimport { SimpleDbStore } from './simple_db';\n\n/**\n * Implementation of DocumentOverlayCache using IndexedDb.\n */\nexport class IndexedDbDocumentOverlayCache implements DocumentOverlayCache {\n  /**\n   * @param serializer - The document serializer.\n   * @param userId - The userId for which we are accessing overlays.\n   */\n  constructor(\n    private readonly serializer: LocalSerializer,\n    private readonly userId: string\n  ) {}\n\n  static forUser(\n    serializer: LocalSerializer,\n    user: User\n  ): IndexedDbDocumentOverlayCache {\n    const userId = user.uid || '';\n    return new IndexedDbDocumentOverlayCache(serializer, userId);\n  }\n\n  getOverlay(\n    transaction: PersistenceTransaction,\n    key: DocumentKey\n  ): PersistencePromise<Overlay | null> {\n    return documentOverlayStore(transaction)\n      .get(toDbDocumentOverlayKey(this.userId, key))\n      .next(dbOverlay => {\n        if (dbOverlay) {\n          return fromDbDocumentOverlay(this.serializer, dbOverlay);\n        }\n        return null;\n      });\n  }\n\n  getOverlays(\n    transaction: PersistenceTransaction,\n    keys: DocumentKey[]\n  ): PersistencePromise<OverlayMap> {\n    const result = newOverlayMap();\n    return PersistencePromise.forEach(keys, (key: DocumentKey) => {\n      return this.getOverlay(transaction, key).next(overlay => {\n        if (overlay !== null) {\n          result.set(key, overlay);\n        }\n      });\n    }).next(() => result);\n  }\n\n  saveOverlays(\n    transaction: PersistenceTransaction,\n    largestBatchId: number,\n    overlays: MutationMap\n  ): PersistencePromise<void> {\n    const promises: Array<PersistencePromise<void>> = [];\n    overlays.forEach((_, mutation) => {\n      const overlay = new Overlay(largestBatchId, mutation);\n      promises.push(this.saveOverlay(transaction, overlay));\n    });\n    return PersistencePromise.waitFor(promises);\n  }\n\n  removeOverlaysForBatchId(\n    transaction: PersistenceTransaction,\n    documentKeys: DocumentKeySet,\n    batchId: number\n  ): PersistencePromise<void> {\n    const collectionPaths = new Set<string>();\n\n    // Get the set of unique collection paths.\n    documentKeys.forEach(key =>\n      collectionPaths.add(encodeResourcePath(key.getCollectionPath()))\n    );\n\n    const promises: Array<PersistencePromise<void>> = [];\n    collectionPaths.forEach(collectionPath => {\n      const range = IDBKeyRange.bound(\n        [this.userId, collectionPath, batchId],\n        [this.userId, collectionPath, batchId + 1],\n        /*lowerOpen=*/ false,\n        /*upperOpen=*/ true\n      );\n      promises.push(\n        documentOverlayStore(transaction).deleteAll(\n          DbDocumentOverlayCollectionPathOverlayIndex,\n          range\n        )\n      );\n    });\n    return PersistencePromise.waitFor(promises);\n  }\n\n  getOverlaysForCollection(\n    transaction: PersistenceTransaction,\n    collection: ResourcePath,\n    sinceBatchId: number\n  ): PersistencePromise<OverlayMap> {\n    const result = newOverlayMap();\n    const collectionPath = encodeResourcePath(collection);\n    // We want batch IDs larger than `sinceBatchId`, and so the lower bound\n    // is not inclusive.\n    const range = IDBKeyRange.bound(\n      [this.userId, collectionPath, sinceBatchId],\n      [this.userId, collectionPath, Number.POSITIVE_INFINITY],\n      /*lowerOpen=*/ true\n    );\n    return documentOverlayStore(transaction)\n      .loadAll(DbDocumentOverlayCollectionPathOverlayIndex, range)\n      .next(dbOverlays => {\n        for (const dbOverlay of dbOverlays) {\n          const overlay = fromDbDocumentOverlay(this.serializer, dbOverlay);\n          result.set(overlay.getKey(), overlay);\n        }\n        return result;\n      });\n  }\n\n  getOverlaysForCollectionGroup(\n    transaction: PersistenceTransaction,\n    collectionGroup: string,\n    sinceBatchId: number,\n    count: number\n  ): PersistencePromise<OverlayMap> {\n    const result = newOverlayMap();\n    let currentBatchId: number | undefined = undefined;\n    // We want batch IDs larger than `sinceBatchId`, and so the lower bound\n    // is not inclusive.\n    const range = IDBKeyRange.bound(\n      [this.userId, collectionGroup, sinceBatchId],\n      [this.userId, collectionGroup, Number.POSITIVE_INFINITY],\n      /*lowerOpen=*/ true\n    );\n    return documentOverlayStore(transaction)\n      .iterate(\n        {\n          index: DbDocumentOverlayCollectionGroupOverlayIndex,\n          range\n        },\n        (_, dbOverlay, control) => {\n          // We do not want to return partial batch overlays, even if the size\n          // of the result set exceeds the given `count` argument. Therefore, we\n          // continue to aggregate results even after the result size exceeds\n          // `count` if there are more overlays from the `currentBatchId`.\n          const overlay = fromDbDocumentOverlay(this.serializer, dbOverlay);\n          if (\n            result.size() < count ||\n            overlay.largestBatchId === currentBatchId\n          ) {\n            result.set(overlay.getKey(), overlay);\n            currentBatchId = overlay.largestBatchId;\n          } else {\n            control.done();\n          }\n        }\n      )\n      .next(() => result);\n  }\n\n  private saveOverlay(\n    transaction: PersistenceTransaction,\n    overlay: Overlay\n  ): PersistencePromise<void> {\n    return documentOverlayStore(transaction).put(\n      toDbDocumentOverlay(this.serializer, this.userId, overlay)\n    );\n  }\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the document overlay object store.\n */\nfunction documentOverlayStore(\n  txn: PersistenceTransaction\n): SimpleDbStore<DbDocumentOverlayKey, DbDocumentOverlay> {\n  return getStore<DbDocumentOverlayKey, DbDocumentOverlay>(\n    txn,\n    DbDocumentOverlayStore\n  );\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DocumentKey } from '../model/document_key';\nimport {\n  normalizeByteString,\n  normalizeNumber,\n  normalizeTimestamp\n} from '../model/normalize';\nimport { isMaxValue } from '../model/values';\nimport { ArrayValue, MapValue, Value } from '../protos/firestore_proto_api';\nimport { fail } from '../util/assert';\nimport { isNegativeZero } from '../util/types';\n\nimport { DirectionalIndexByteEncoder } from './directional_index_byte_encoder';\n\n// Note: This code is copied from the backend. Code that is not used by\n// Firestore was removed.\n\nconst INDEX_TYPE_NULL = 5;\nconst INDEX_TYPE_BOOLEAN = 10;\nconst INDEX_TYPE_NAN = 13;\nconst INDEX_TYPE_NUMBER = 15;\nconst INDEX_TYPE_TIMESTAMP = 20;\nconst INDEX_TYPE_STRING = 25;\nconst INDEX_TYPE_BLOB = 30;\nconst INDEX_TYPE_REFERENCE = 37;\nconst INDEX_TYPE_GEOPOINT = 45;\nconst INDEX_TYPE_ARRAY = 50;\nconst INDEX_TYPE_MAP = 55;\nconst INDEX_TYPE_REFERENCE_SEGMENT = 60;\n\n// A terminator that indicates that a truncatable value was not truncated.\n// This must be smaller than all other type labels.\nconst NOT_TRUNCATED = 2;\n\n/** Firestore index value writer.  */\nexport class FirestoreIndexValueWriter {\n  static INSTANCE = new FirestoreIndexValueWriter();\n\n  private constructor() {}\n\n  // The write methods below short-circuit writing terminators for values\n  // containing a (terminating) truncated value.\n  //\n  // As an example, consider the resulting encoding for:\n  //\n  // [\"bar\", [2, \"foo\"]] -> (STRING, \"bar\", TERM, ARRAY, NUMBER, 2, STRING, \"foo\", TERM, TERM, TERM)\n  // [\"bar\", [2, truncated(\"foo\")]] -> (STRING, \"bar\", TERM, ARRAY, NUMBER, 2, STRING, \"foo\", TRUNC)\n  // [\"bar\", truncated([\"foo\"])] -> (STRING, \"bar\", TERM, ARRAY. STRING, \"foo\", TERM, TRUNC)\n\n  /** Writes an index value.  */\n  writeIndexValue(value: Value, encoder: DirectionalIndexByteEncoder): void {\n    this.writeIndexValueAux(value, encoder);\n    // Write separator to split index values\n    // (see go/firestore-storage-format#encodings).\n    encoder.writeInfinity();\n  }\n\n  private writeIndexValueAux(\n    indexValue: Value,\n    encoder: DirectionalIndexByteEncoder\n  ): void {\n    if ('nullValue' in indexValue) {\n      this.writeValueTypeLabel(encoder, INDEX_TYPE_NULL);\n    } else if ('booleanValue' in indexValue) {\n      this.writeValueTypeLabel(encoder, INDEX_TYPE_BOOLEAN);\n      encoder.writeNumber(indexValue.booleanValue ? 1 : 0);\n    } else if ('integerValue' in indexValue) {\n      this.writeValueTypeLabel(encoder, INDEX_TYPE_NUMBER);\n      encoder.writeNumber(normalizeNumber(indexValue.integerValue));\n    } else if ('doubleValue' in indexValue) {\n      const n = normalizeNumber(indexValue.doubleValue);\n      if (isNaN(n)) {\n        this.writeValueTypeLabel(encoder, INDEX_TYPE_NAN);\n      } else {\n        this.writeValueTypeLabel(encoder, INDEX_TYPE_NUMBER);\n        if (isNegativeZero(n)) {\n          // -0.0, 0 and 0.0 are all considered the same\n          encoder.writeNumber(0.0);\n        } else {\n          encoder.writeNumber(n);\n        }\n      }\n    } else if ('timestampValue' in indexValue) {\n      let timestamp = indexValue.timestampValue!;\n      this.writeValueTypeLabel(encoder, INDEX_TYPE_TIMESTAMP);\n      if (typeof timestamp === 'string') {\n        timestamp = normalizeTimestamp(timestamp);\n      }\n      encoder.writeString(`${timestamp.seconds || ''}`);\n      encoder.writeNumber(timestamp.nanos || 0);\n    } else if ('stringValue' in indexValue) {\n      this.writeIndexString(indexValue.stringValue!, encoder);\n      this.writeTruncationMarker(encoder);\n    } else if ('bytesValue' in indexValue) {\n      this.writeValueTypeLabel(encoder, INDEX_TYPE_BLOB);\n      encoder.writeBytes(normalizeByteString(indexValue.bytesValue!));\n      this.writeTruncationMarker(encoder);\n    } else if ('referenceValue' in indexValue) {\n      this.writeIndexEntityRef(indexValue.referenceValue!, encoder);\n    } else if ('geoPointValue' in indexValue) {\n      const geoPoint = indexValue.geoPointValue!;\n      this.writeValueTypeLabel(encoder, INDEX_TYPE_GEOPOINT);\n      encoder.writeNumber(geoPoint.latitude || 0);\n      encoder.writeNumber(geoPoint.longitude || 0);\n    } else if ('mapValue' in indexValue) {\n      if (isMaxValue(indexValue)) {\n        this.writeValueTypeLabel(encoder, Number.MAX_SAFE_INTEGER);\n      } else {\n        this.writeIndexMap(indexValue.mapValue!, encoder);\n        this.writeTruncationMarker(encoder);\n      }\n    } else if ('arrayValue' in indexValue) {\n      this.writeIndexArray(indexValue.arrayValue!, encoder);\n      this.writeTruncationMarker(encoder);\n    } else {\n      fail('unknown index value type ' + indexValue);\n    }\n  }\n\n  private writeIndexString(\n    stringIndexValue: string,\n    encoder: DirectionalIndexByteEncoder\n  ): void {\n    this.writeValueTypeLabel(encoder, INDEX_TYPE_STRING);\n    this.writeUnlabeledIndexString(stringIndexValue, encoder);\n  }\n\n  private writeUnlabeledIndexString(\n    stringIndexValue: string,\n    encoder: DirectionalIndexByteEncoder\n  ): void {\n    encoder.writeString(stringIndexValue);\n  }\n\n  private writeIndexMap(\n    mapIndexValue: MapValue,\n    encoder: DirectionalIndexByteEncoder\n  ): void {\n    const map = mapIndexValue.fields || {};\n    this.writeValueTypeLabel(encoder, INDEX_TYPE_MAP);\n    for (const key of Object.keys(map)) {\n      this.writeIndexString(key, encoder);\n      this.writeIndexValueAux(map[key], encoder);\n    }\n  }\n\n  private writeIndexArray(\n    arrayIndexValue: ArrayValue,\n    encoder: DirectionalIndexByteEncoder\n  ): void {\n    const values = arrayIndexValue.values || [];\n    this.writeValueTypeLabel(encoder, INDEX_TYPE_ARRAY);\n    for (const element of values) {\n      this.writeIndexValueAux(element, encoder);\n    }\n  }\n\n  private writeIndexEntityRef(\n    referenceValue: string,\n    encoder: DirectionalIndexByteEncoder\n  ): void {\n    this.writeValueTypeLabel(encoder, INDEX_TYPE_REFERENCE);\n    const path = DocumentKey.fromName(referenceValue).path;\n    path.forEach(segment => {\n      this.writeValueTypeLabel(encoder, INDEX_TYPE_REFERENCE_SEGMENT);\n      this.writeUnlabeledIndexString(segment, encoder);\n    });\n  }\n\n  private writeValueTypeLabel(\n    encoder: DirectionalIndexByteEncoder,\n    typeOrder: number\n  ): void {\n    encoder.writeNumber(typeOrder);\n  }\n\n  private writeTruncationMarker(encoder: DirectionalIndexByteEncoder): void {\n    // While the SDK does not implement truncation, the truncation marker is\n    // used to terminate all variable length values (which are strings, bytes,\n    // references, arrays and maps).\n    encoder.writeNumber(NOT_TRUNCATED);\n  }\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law | agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES | CONDITIONS OF ANY KIND, either express | implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { debugAssert } from '../util/assert';\nimport { ByteString } from '../util/byte_string';\n\n/** These constants are taken from the backend. */\nconst MIN_SURROGATE = '\\uD800';\nconst MAX_SURROGATE = '\\uDBFF';\n\nconst ESCAPE1 = 0x00;\nconst NULL_BYTE = 0xff; // Combined with ESCAPE1\nconst SEPARATOR = 0x01; // Combined with ESCAPE1\n\nconst ESCAPE2 = 0xff;\nconst INFINITY = 0xff; // Combined with ESCAPE2\nconst FF_BYTE = 0x00; // Combined with ESCAPE2\n\nconst LONG_SIZE = 64;\nconst BYTE_SIZE = 8;\n\n/**\n * The default size of the buffer. This is arbitrary, but likely larger than\n * most index values so that less copies of the underlying buffer will be made.\n * For large values, a single copy will made to double the buffer length.\n */\nconst DEFAULT_BUFFER_SIZE = 1024;\n\n/** Converts a JavaScript number to a byte array (using big endian encoding). */\nfunction doubleToLongBits(value: number): Uint8Array {\n  const dv = new DataView(new ArrayBuffer(8));\n  dv.setFloat64(0, value, /* littleEndian= */ false);\n  return new Uint8Array(dv.buffer);\n}\n\n/**\n * Counts the number of zeros in a byte.\n *\n * Visible for testing.\n */\nexport function numberOfLeadingZerosInByte(x: number): number {\n  debugAssert(x < 256, 'Provided value is not a byte: ' + x);\n  if (x === 0) {\n    return 8;\n  }\n\n  let zeros = 0;\n  if (x >> 4 === 0) {\n    // Test if the first four bits are zero.\n    zeros += 4;\n    x = x << 4;\n  }\n  if (x >> 6 === 0) {\n    // Test if the first two (or next two) bits are zero.\n    zeros += 2;\n    x = x << 2;\n  }\n  if (x >> 7 === 0) {\n    // Test if the remaining bit is zero.\n    zeros += 1;\n  }\n  return zeros;\n}\n\n/** Counts the number of leading zeros in the given byte array. */\nfunction numberOfLeadingZeros(bytes: Uint8Array): number {\n  debugAssert(\n    bytes.length === 8,\n    'Can only count leading zeros in 64-bit numbers'\n  );\n  let leadingZeros = 0;\n  for (let i = 0; i < 8; ++i) {\n    const zeros = numberOfLeadingZerosInByte(bytes[i] & 0xff);\n    leadingZeros += zeros;\n    if (zeros !== 8) {\n      break;\n    }\n  }\n  return leadingZeros;\n}\n\n/**\n * Returns the number of bytes required to store \"value\". Leading zero bytes\n * are skipped.\n */\nfunction unsignedNumLength(value: Uint8Array): number {\n  // This is just the number of bytes for the unsigned representation of the number.\n  const numBits = LONG_SIZE - numberOfLeadingZeros(value);\n  return Math.ceil(numBits / BYTE_SIZE);\n}\n\n/**\n * OrderedCodeWriter is a minimal-allocation implementation of the writing\n * behavior defined by the backend.\n *\n * The code is ported from its Java counterpart.\n */\nexport class OrderedCodeWriter {\n  buffer = new Uint8Array(DEFAULT_BUFFER_SIZE);\n  position = 0;\n\n  writeBytesAscending(value: ByteString): void {\n    const it = value[Symbol.iterator]();\n    let byte = it.next();\n    while (!byte.done) {\n      this.writeByteAscending(byte.value);\n      byte = it.next();\n    }\n    this.writeSeparatorAscending();\n  }\n\n  writeBytesDescending(value: ByteString): void {\n    const it = value[Symbol.iterator]();\n    let byte = it.next();\n    while (!byte.done) {\n      this.writeByteDescending(byte.value);\n      byte = it.next();\n    }\n    this.writeSeparatorDescending();\n  }\n\n  /** Writes utf8 bytes into this byte sequence, ascending. */\n  writeUtf8Ascending(sequence: string): void {\n    for (const c of sequence) {\n      const charCode = c.charCodeAt(0);\n      if (charCode < 0x80) {\n        this.writeByteAscending(charCode);\n      } else if (charCode < 0x800) {\n        this.writeByteAscending((0x0f << 6) | (charCode >>> 6));\n        this.writeByteAscending(0x80 | (0x3f & charCode));\n      } else if (c < MIN_SURROGATE || MAX_SURROGATE < c) {\n        this.writeByteAscending((0x0f << 5) | (charCode >>> 12));\n        this.writeByteAscending(0x80 | (0x3f & (charCode >>> 6)));\n        this.writeByteAscending(0x80 | (0x3f & charCode));\n      } else {\n        const codePoint = c.codePointAt(0)!;\n        this.writeByteAscending((0x0f << 4) | (codePoint >>> 18));\n        this.writeByteAscending(0x80 | (0x3f & (codePoint >>> 12)));\n        this.writeByteAscending(0x80 | (0x3f & (codePoint >>> 6)));\n        this.writeByteAscending(0x80 | (0x3f & codePoint));\n      }\n    }\n    this.writeSeparatorAscending();\n  }\n\n  /** Writes utf8 bytes into this byte sequence, descending */\n  writeUtf8Descending(sequence: string): void {\n    for (const c of sequence) {\n      const charCode = c.charCodeAt(0);\n      if (charCode < 0x80) {\n        this.writeByteDescending(charCode);\n      } else if (charCode < 0x800) {\n        this.writeByteDescending((0x0f << 6) | (charCode >>> 6));\n        this.writeByteDescending(0x80 | (0x3f & charCode));\n      } else if (c < MIN_SURROGATE || MAX_SURROGATE < c) {\n        this.writeByteDescending((0x0f << 5) | (charCode >>> 12));\n        this.writeByteDescending(0x80 | (0x3f & (charCode >>> 6)));\n        this.writeByteDescending(0x80 | (0x3f & charCode));\n      } else {\n        const codePoint = c.codePointAt(0)!;\n        this.writeByteDescending((0x0f << 4) | (codePoint >>> 18));\n        this.writeByteDescending(0x80 | (0x3f & (codePoint >>> 12)));\n        this.writeByteDescending(0x80 | (0x3f & (codePoint >>> 6)));\n        this.writeByteDescending(0x80 | (0x3f & codePoint));\n      }\n    }\n    this.writeSeparatorDescending();\n  }\n\n  writeNumberAscending(val: number): void {\n    // Values are encoded with a single byte length prefix, followed by the\n    // actual value in big-endian format with leading 0 bytes dropped.\n    const value = this.toOrderedBits(val);\n    const len = unsignedNumLength(value);\n    this.ensureAvailable(1 + len);\n    this.buffer[this.position++] = len & 0xff; // Write the length\n    for (let i = value.length - len; i < value.length; ++i) {\n      this.buffer[this.position++] = value[i] & 0xff;\n    }\n  }\n\n  writeNumberDescending(val: number): void {\n    // Values are encoded with a single byte length prefix, followed by the\n    // inverted value in big-endian format with leading 0 bytes dropped.\n    const value = this.toOrderedBits(val);\n    const len = unsignedNumLength(value);\n    this.ensureAvailable(1 + len);\n    this.buffer[this.position++] = ~(len & 0xff); // Write the length\n    for (let i = value.length - len; i < value.length; ++i) {\n      this.buffer[this.position++] = ~(value[i] & 0xff);\n    }\n  }\n\n  /**\n   * Writes the \"infinity\" byte sequence that sorts after all other byte\n   * sequences written in ascending order.\n   */\n  writeInfinityAscending(): void {\n    this.writeEscapedByteAscending(ESCAPE2);\n    this.writeEscapedByteAscending(INFINITY);\n  }\n\n  /**\n   * Writes the \"infinity\" byte sequence that sorts before all other byte\n   * sequences written in descending order.\n   */\n  writeInfinityDescending(): void {\n    this.writeEscapedByteDescending(ESCAPE2);\n    this.writeEscapedByteDescending(INFINITY);\n  }\n\n  /**\n   * Resets the buffer such that it is the same as when it was newly\n   * constructed.\n   */\n  reset(): void {\n    this.position = 0;\n  }\n\n  seed(encodedBytes: Uint8Array): void {\n    this.ensureAvailable(encodedBytes.length);\n    this.buffer.set(encodedBytes, this.position);\n    this.position += encodedBytes.length;\n  }\n\n  /** Makes a copy of the encoded bytes in this buffer.  */\n  encodedBytes(): Uint8Array {\n    return this.buffer.slice(0, this.position);\n  }\n\n  /**\n   * Encodes `val` into an encoding so that the order matches the IEEE 754\n   * floating-point comparison results with the following exceptions:\n   *   -0.0 < 0.0\n   *   all non-NaN < NaN\n   *   NaN = NaN\n   */\n  private toOrderedBits(val: number): Uint8Array {\n    const value = doubleToLongBits(val);\n    // Check if the first bit is set. We use a bit mask since value[0] is\n    // encoded as a number from 0 to 255.\n    const isNegative = (value[0] & 0x80) !== 0;\n\n    // Revert the two complement to get natural ordering\n    value[0] ^= isNegative ? 0xff : 0x80;\n    for (let i = 1; i < value.length; ++i) {\n      value[i] ^= isNegative ? 0xff : 0x00;\n    }\n    return value;\n  }\n\n  /** Writes a single byte ascending to the buffer. */\n  private writeByteAscending(b: number): void {\n    const masked = b & 0xff;\n    if (masked === ESCAPE1) {\n      this.writeEscapedByteAscending(ESCAPE1);\n      this.writeEscapedByteAscending(NULL_BYTE);\n    } else if (masked === ESCAPE2) {\n      this.writeEscapedByteAscending(ESCAPE2);\n      this.writeEscapedByteAscending(FF_BYTE);\n    } else {\n      this.writeEscapedByteAscending(masked);\n    }\n  }\n\n  /** Writes a single byte descending to the buffer.  */\n  private writeByteDescending(b: number): void {\n    const masked = b & 0xff;\n    if (masked === ESCAPE1) {\n      this.writeEscapedByteDescending(ESCAPE1);\n      this.writeEscapedByteDescending(NULL_BYTE);\n    } else if (masked === ESCAPE2) {\n      this.writeEscapedByteDescending(ESCAPE2);\n      this.writeEscapedByteDescending(FF_BYTE);\n    } else {\n      this.writeEscapedByteDescending(b);\n    }\n  }\n\n  private writeSeparatorAscending(): void {\n    this.writeEscapedByteAscending(ESCAPE1);\n    this.writeEscapedByteAscending(SEPARATOR);\n  }\n\n  private writeSeparatorDescending(): void {\n    this.writeEscapedByteDescending(ESCAPE1);\n    this.writeEscapedByteDescending(SEPARATOR);\n  }\n\n  private writeEscapedByteAscending(b: number): void {\n    this.ensureAvailable(1);\n    this.buffer[this.position++] = b;\n  }\n\n  private writeEscapedByteDescending(b: number): void {\n    this.ensureAvailable(1);\n    this.buffer[this.position++] = ~b;\n  }\n\n  private ensureAvailable(bytes: number): void {\n    const minCapacity = bytes + this.position;\n    if (minCapacity <= this.buffer.length) {\n      return;\n    }\n    // Try doubling.\n    let newLength = this.buffer.length * 2;\n    // Still not big enough? Just allocate the right size.\n    if (newLength < minCapacity) {\n      newLength = minCapacity;\n    }\n    // Create the new buffer.\n    const newBuffer = new Uint8Array(newLength);\n    newBuffer.set(this.buffer); // copy old data\n    this.buffer = newBuffer;\n  }\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { IndexKind } from '../model/field_index';\nimport { ByteString } from '../util/byte_string';\n\nimport { DirectionalIndexByteEncoder } from './directional_index_byte_encoder';\nimport { OrderedCodeWriter } from './ordered_code_writer';\n\nclass AscendingIndexByteEncoder implements DirectionalIndexByteEncoder {\n  constructor(private orderedCode: OrderedCodeWriter) {}\n  writeBytes(value: ByteString): void {\n    this.orderedCode.writeBytesAscending(value);\n  }\n\n  writeString(value: string): void {\n    this.orderedCode.writeUtf8Ascending(value);\n  }\n\n  writeNumber(value: number): void {\n    this.orderedCode.writeNumberAscending(value);\n  }\n\n  writeInfinity(): void {\n    this.orderedCode.writeInfinityAscending();\n  }\n}\n\nclass DescendingIndexByteEncoder implements DirectionalIndexByteEncoder {\n  constructor(private orderedCode: OrderedCodeWriter) {}\n  writeBytes(value: ByteString): void {\n    this.orderedCode.writeBytesDescending(value);\n  }\n\n  writeString(value: string): void {\n    this.orderedCode.writeUtf8Descending(value);\n  }\n\n  writeNumber(value: number): void {\n    this.orderedCode.writeNumberDescending(value);\n  }\n\n  writeInfinity(): void {\n    this.orderedCode.writeInfinityDescending();\n  }\n}\n/**\n * Implements `DirectionalIndexByteEncoder` using `OrderedCodeWriter` for the\n * actual encoding.\n */\nexport class IndexByteEncoder {\n  private orderedCode = new OrderedCodeWriter();\n  private ascending = new AscendingIndexByteEncoder(this.orderedCode);\n  private descending = new DescendingIndexByteEncoder(this.orderedCode);\n\n  seed(encodedBytes: Uint8Array): void {\n    this.orderedCode.seed(encodedBytes);\n  }\n\n  forKind(kind: IndexKind): DirectionalIndexByteEncoder {\n    return kind === IndexKind.ASCENDING ? this.ascending : this.descending;\n  }\n\n  encodedBytes(): Uint8Array {\n    return this.orderedCode.encodedBytes();\n  }\n\n  reset(): void {\n    this.orderedCode.reset();\n  }\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DocumentKey } from '../model/document_key';\n\n/** Represents an index entry saved by the SDK in persisted storage. */\nexport class IndexEntry {\n  constructor(\n    readonly indexId: number,\n    readonly documentKey: DocumentKey,\n    readonly arrayValue: Uint8Array,\n    readonly directionalValue: Uint8Array\n  ) {}\n\n  /**\n   * Returns an IndexEntry entry that sorts immediately after the current\n   * directional value.\n   */\n  successor(): IndexEntry {\n    const currentLength = this.directionalValue.length;\n    const newLength =\n      currentLength === 0 || this.directionalValue[currentLength - 1] === 255\n        ? currentLength + 1\n        : currentLength;\n\n    const successor = new Uint8Array(newLength);\n    successor.set(this.directionalValue, 0);\n    if (newLength !== currentLength) {\n      successor.set([0], this.directionalValue.length);\n    } else {\n      ++successor[successor.length - 1];\n    }\n\n    return new IndexEntry(\n      this.indexId,\n      this.documentKey,\n      this.arrayValue,\n      successor\n    );\n  }\n}\n\nexport function indexEntryComparator(\n  left: IndexEntry,\n  right: IndexEntry\n): number {\n  let cmp = left.indexId - right.indexId;\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  cmp = compareByteArrays(left.arrayValue, right.arrayValue);\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  cmp = compareByteArrays(left.directionalValue, right.directionalValue);\n  if (cmp !== 0) {\n    return cmp;\n  }\n\n  return DocumentKey.comparator(left.documentKey, right.documentKey);\n}\n\nexport function compareByteArrays(left: Uint8Array, right: Uint8Array): number {\n  for (let i = 0; i < left.length && i < right.length; ++i) {\n    const compare = left[i] - right[i];\n    if (compare !== 0) {\n      return compare;\n    }\n  }\n  return left.length - right.length;\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FieldFilter, Operator } from '../core/filter';\nimport { Direction, OrderBy } from '../core/order_by';\nimport { Target } from '../core/target';\nimport { hardAssert } from '../util/assert';\nimport { SortedSet } from '../util/sorted_set';\n\nimport {\n  FieldIndex,\n  fieldIndexGetArraySegment,\n  fieldIndexGetDirectionalSegments,\n  IndexKind,\n  IndexSegment,\n  IndexState\n} from './field_index';\nimport { FieldPath } from './path';\n\n/**\n * A light query planner for Firestore.\n *\n * This class matches a `FieldIndex` against a Firestore Query `Target`. It\n * determines whether a given index can be used to serve the specified target.\n *\n * The following table showcases some possible index configurations:\n *\n * Query                                               | Index\n * -----------------------------------------------------------------------------\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC, b DESC\n * where('a', '==', 'a').where('b', '==', 'b')         | a ASC\n * where('a', '==', 'a').where('b', '==', 'b')         | b DESC\n * where('a', '>=', 'a').orderBy('a')                  | a ASC\n * where('a', '>=', 'a').orderBy('a', 'desc')          | a DESC\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC, b ASC\n * where('a', '>=', 'a').orderBy('a').orderBy('b')     | a ASC\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS, b ASCENDING\n * where('a', 'array-contains', 'a').orderBy('b')      | a CONTAINS\n */\nexport class TargetIndexMatcher {\n  // The collection ID (or collection group) of the query target.\n  private readonly collectionId: string;\n  // The inequality filters of the target (if it exists).\n  // Note: The sort on FieldFilters is not required. Using SortedSet here just to utilize the custom\n  // comparator.\n  private inequalityFilters = new SortedSet<FieldFilter>((lhs, rhs) =>\n    FieldPath.comparator(lhs.field, rhs.field)\n  );\n\n  // The list of equality filters of the target.\n  private readonly equalityFilters: FieldFilter[];\n  // The list of orderBys of the target.\n  private readonly orderBys: OrderBy[];\n\n  constructor(target: Target) {\n    this.collectionId =\n      target.collectionGroup != null\n        ? target.collectionGroup\n        : target.path.lastSegment();\n    this.orderBys = target.orderBy;\n    this.equalityFilters = [];\n    for (const filter of target.filters) {\n      const fieldFilter = filter as FieldFilter;\n      if (fieldFilter.isInequality()) {\n        this.inequalityFilters = this.inequalityFilters.add(fieldFilter);\n      } else {\n        this.equalityFilters.push(fieldFilter);\n      }\n    }\n  }\n\n  get hasMultipleInequality(): boolean {\n    return this.inequalityFilters.size > 1;\n  }\n\n  /**\n   * Returns whether the index can be used to serve the TargetIndexMatcher's\n   * target.\n   *\n   * An index is considered capable of serving the target when:\n   * - The target uses all index segments for its filters and orderBy clauses.\n   *   The target can have additional filter and orderBy clauses, but not\n   *   fewer.\n   * - If an ArrayContains/ArrayContainsAnyfilter is used, the index must also\n   *   have a corresponding `CONTAINS` segment.\n   * - All directional index segments can be mapped to the target as a series of\n   *   equality filters, a single inequality filter and a series of orderBy\n   *   clauses.\n   * - The segments that represent the equality filters may appear out of order.\n   * - The optional segment for the inequality filter must appear after all\n   *   equality segments.\n   * - The segments that represent that orderBy clause of the target must appear\n   *   in order after all equality and inequality segments. Single orderBy\n   *   clauses cannot be skipped, but a continuous orderBy suffix may be\n   *   omitted.\n   */\n  servedByIndex(index: FieldIndex): boolean {\n    hardAssert(\n      index.collectionGroup === this.collectionId,\n      'Collection IDs do not match'\n    );\n\n    if (this.hasMultipleInequality) {\n      // Only single inequality is supported for now.\n      // TODO(Add support for multiple inequality query): b/298441043\n      return false;\n    }\n\n    // If there is an array element, find a matching filter.\n    const arraySegment = fieldIndexGetArraySegment(index);\n    if (\n      arraySegment !== undefined &&\n      !this.hasMatchingEqualityFilter(arraySegment)\n    ) {\n      return false;\n    }\n\n    const segments = fieldIndexGetDirectionalSegments(index);\n    let equalitySegments = new Set<string>();\n    let segmentIndex = 0;\n    let orderBysIndex = 0;\n\n    // Process all equalities first. Equalities can appear out of order.\n    for (; segmentIndex < segments.length; ++segmentIndex) {\n      // We attempt to greedily match all segments to equality filters. If a\n      // filter matches an index segment, we can mark the segment as used.\n      if (this.hasMatchingEqualityFilter(segments[segmentIndex])) {\n        equalitySegments = equalitySegments.add(\n          segments[segmentIndex].fieldPath.canonicalString()\n        );\n      } else {\n        // If we cannot find a matching filter, we need to verify whether the\n        // remaining segments map to the target's inequality and its orderBy\n        // clauses.\n        break;\n      }\n    }\n\n    // If we already have processed all segments, all segments are used to serve\n    // the equality filters and we do not need to map any segments to the\n    // target's inequality and orderBy clauses.\n    if (segmentIndex === segments.length) {\n      return true;\n    }\n\n    if (this.inequalityFilters.size > 0) {\n      // Only a single inequality is currently supported. Get the only entry in the set.\n      const inequalityFilter = this.inequalityFilters.getIterator().getNext();\n      // If there is an inequality filter and the field was not in one of the\n      // equality filters above, the next segment must match both the filter\n      // and the first orderBy clause.\n      if (!equalitySegments.has(inequalityFilter.field.canonicalString())) {\n        const segment = segments[segmentIndex];\n\n        if (\n          !this.matchesFilter(inequalityFilter, segment) ||\n          !this.matchesOrderBy(this.orderBys[orderBysIndex++], segment)\n        ) {\n          return false;\n        }\n      }\n\n      ++segmentIndex;\n    }\n\n    // All remaining segments need to represent the prefix of the target's\n    // orderBy.\n    for (; segmentIndex < segments.length; ++segmentIndex) {\n      const segment = segments[segmentIndex];\n      if (\n        orderBysIndex >= this.orderBys.length ||\n        !this.matchesOrderBy(this.orderBys[orderBysIndex++], segment)\n      ) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  /**\n   * Returns a full matched field index for this target. Currently multiple\n   * inequality query is not supported so function returns null.\n   */\n  buildTargetIndex(): FieldIndex | null {\n    if (this.hasMultipleInequality) {\n      return null;\n    }\n\n    // We want to make sure only one segment created for one field. For example,\n    // in case like a == 3 and a > 2, Index {a ASCENDING} will only be created\n    // once.\n    let uniqueFields = new SortedSet<FieldPath>(FieldPath.comparator);\n    const segments: IndexSegment[] = [];\n\n    for (const filter of this.equalityFilters) {\n      if (filter.field.isKeyField()) {\n        continue;\n      }\n      const isArrayOperator =\n        filter.op === Operator.ARRAY_CONTAINS ||\n        filter.op === Operator.ARRAY_CONTAINS_ANY;\n      if (isArrayOperator) {\n        segments.push(new IndexSegment(filter.field, IndexKind.CONTAINS));\n      } else {\n        if (uniqueFields.has(filter.field)) {\n          continue;\n        }\n        uniqueFields = uniqueFields.add(filter.field);\n        segments.push(new IndexSegment(filter.field, IndexKind.ASCENDING));\n      }\n    }\n\n    // Note: We do not explicitly check `this.inequalityFilter` but rather rely\n    // on the target defining an appropriate \"order by\" to ensure that the\n    // required index segment is added. The query engine would reject a query\n    // with an inequality filter that lacks the required order-by clause.\n    for (const orderBy of this.orderBys) {\n      // Stop adding more segments if we see a order-by on key. Typically this\n      // is the default implicit order-by which is covered in the index_entry\n      // table as a separate column. If it is not the default order-by, the\n      // generated index will be missing some segments optimized for order-bys,\n      // which is probably fine.\n      if (orderBy.field.isKeyField()) {\n        continue;\n      }\n\n      if (uniqueFields.has(orderBy.field)) {\n        continue;\n      }\n      uniqueFields = uniqueFields.add(orderBy.field);\n\n      segments.push(\n        new IndexSegment(\n          orderBy.field,\n          orderBy.dir === Direction.ASCENDING\n            ? IndexKind.ASCENDING\n            : IndexKind.DESCENDING\n        )\n      );\n    }\n\n    return new FieldIndex(\n      FieldIndex.UNKNOWN_ID,\n      this.collectionId,\n      segments,\n      IndexState.empty()\n    );\n  }\n\n  private hasMatchingEqualityFilter(segment: IndexSegment): boolean {\n    for (const filter of this.equalityFilters) {\n      if (this.matchesFilter(filter, segment)) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  private matchesFilter(\n    filter: FieldFilter | undefined,\n    segment: IndexSegment\n  ): boolean {\n    if (filter === undefined || !filter.field.isEqual(segment.fieldPath)) {\n      return false;\n    }\n    const isArrayOperator =\n      filter.op === Operator.ARRAY_CONTAINS ||\n      filter.op === Operator.ARRAY_CONTAINS_ANY;\n    return (segment.kind === IndexKind.CONTAINS) === isArrayOperator;\n  }\n\n  private matchesOrderBy(orderBy: OrderBy, segment: IndexSegment): boolean {\n    if (!orderBy.field.isEqual(segment.fieldPath)) {\n      return false;\n    }\n    return (\n      (segment.kind === IndexKind.ASCENDING &&\n        orderBy.dir === Direction.ASCENDING) ||\n      (segment.kind === IndexKind.DESCENDING &&\n        orderBy.dir === Direction.DESCENDING)\n    );\n  }\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  CompositeFilter,\n  compositeFilterIsConjunction,\n  compositeFilterIsDisjunction,\n  compositeFilterIsFlat,\n  compositeFilterIsFlatConjunction,\n  compositeFilterWithAddedFilters,\n  CompositeOperator,\n  FieldFilter,\n  Filter,\n  InFilter,\n  Operator\n} from '../core/filter';\n\nimport { hardAssert } from './assert';\n\n/**\n * Provides utility functions that help with boolean logic transformations needed for handling\n * complex filters used in queries.\n */\n\n/**\n * The `in` filter is only a syntactic sugar over a disjunction of equalities. For instance: `a in\n * [1,2,3]` is in fact `a==1 || a==2 || a==3`. This method expands any `in` filter in the given\n * input into a disjunction of equality filters and returns the expanded filter.\n */\nexport function computeInExpansion(filter: Filter): Filter {\n  hardAssert(\n    filter instanceof FieldFilter || filter instanceof CompositeFilter,\n    'Only field filters and composite filters are accepted.'\n  );\n\n  if (filter instanceof FieldFilter) {\n    if (filter instanceof InFilter) {\n      const expandedFilters =\n        filter.value.arrayValue?.values?.map(value =>\n          FieldFilter.create(filter.field, Operator.EQUAL, value)\n        ) || [];\n\n      return CompositeFilter.create(expandedFilters, CompositeOperator.OR);\n    } else {\n      // We have reached other kinds of field filters.\n      return filter;\n    }\n  }\n\n  // We have a composite filter.\n  const expandedFilters = filter.filters.map(subfilter =>\n    computeInExpansion(subfilter)\n  );\n  return CompositeFilter.create(expandedFilters, filter.op);\n}\n\n/**\n * Given a composite filter, returns the list of terms in its disjunctive normal form.\n *\n * <p>Each element in the return value is one term of the resulting DNF. For instance: For the\n * input: (A || B) && C, the DNF form is: (A && C) || (B && C), and the return value is a list\n * with two elements: a composite filter that performs (A && C), and a composite filter that\n * performs (B && C).\n *\n * @param filter the composite filter to calculate DNF transform for.\n * @return the terms in the DNF transform.\n */\nexport function getDnfTerms(filter: CompositeFilter): Filter[] {\n  if (filter.getFilters().length === 0) {\n    return [];\n  }\n\n  const result: Filter = computeDistributedNormalForm(\n    computeInExpansion(filter)\n  );\n\n  hardAssert(\n    isDisjunctiveNormalForm(result),\n    'computeDistributedNormalForm did not result in disjunctive normal form'\n  );\n\n  if (isSingleFieldFilter(result) || isFlatConjunction(result)) {\n    return [result];\n  }\n\n  return result.getFilters();\n}\n\n/** Returns true if the given filter is a single field filter. e.g. (a == 10). */\nfunction isSingleFieldFilter(filter: Filter): boolean {\n  return filter instanceof FieldFilter;\n}\n\n/**\n * Returns true if the given filter is the conjunction of one or more field filters. e.g. (a == 10\n * && b == 20)\n */\nfunction isFlatConjunction(filter: Filter): boolean {\n  return (\n    filter instanceof CompositeFilter &&\n    compositeFilterIsFlatConjunction(filter)\n  );\n}\n\n/**\n * Returns whether or not the given filter is in disjunctive normal form (DNF).\n *\n * <p>In boolean logic, a disjunctive normal form (DNF) is a canonical normal form of a logical\n * formula consisting of a disjunction of conjunctions; it can also be described as an OR of ANDs.\n *\n * <p>For more info, visit: https://en.wikipedia.org/wiki/Disjunctive_normal_form\n */\nfunction isDisjunctiveNormalForm(filter: Filter): boolean {\n  return (\n    isSingleFieldFilter(filter) ||\n    isFlatConjunction(filter) ||\n    isDisjunctionOfFieldFiltersAndFlatConjunctions(filter)\n  );\n}\n\n/**\n * Returns true if the given filter is the disjunction of one or more \"flat conjunctions\" and\n * field filters. e.g. (a == 10) || (b==20 && c==30)\n */\nfunction isDisjunctionOfFieldFiltersAndFlatConjunctions(\n  filter: Filter\n): boolean {\n  if (filter instanceof CompositeFilter) {\n    if (compositeFilterIsDisjunction(filter)) {\n      for (const subFilter of filter.getFilters()) {\n        if (!isSingleFieldFilter(subFilter) && !isFlatConjunction(subFilter)) {\n          return false;\n        }\n      }\n\n      return true;\n    }\n  }\n\n  return false;\n}\n\nexport function computeDistributedNormalForm(filter: Filter): Filter {\n  hardAssert(\n    filter instanceof FieldFilter || filter instanceof CompositeFilter,\n    'Only field filters and composite filters are accepted.'\n  );\n\n  if (filter instanceof FieldFilter) {\n    return filter;\n  }\n\n  if (filter.filters.length === 1) {\n    return computeDistributedNormalForm(filter.filters[0]);\n  }\n\n  // Compute DNF for each of the subfilters first\n  const result = filter.filters.map(subfilter =>\n    computeDistributedNormalForm(subfilter)\n  );\n\n  let newFilter: Filter = CompositeFilter.create(result, filter.op);\n  newFilter = applyAssociation(newFilter);\n\n  if (isDisjunctiveNormalForm(newFilter)) {\n    return newFilter;\n  }\n\n  hardAssert(\n    newFilter instanceof CompositeFilter,\n    'field filters are already in DNF form'\n  );\n  hardAssert(\n    compositeFilterIsConjunction(newFilter),\n    'Disjunction of filters all of which are already in DNF form is itself in DNF form.'\n  );\n  hardAssert(\n    newFilter.filters.length > 1,\n    'Single-filter composite filters are already in DNF form.'\n  );\n\n  return newFilter.filters.reduce((runningResult, filter) =>\n    applyDistribution(runningResult, filter)\n  );\n}\n\nexport function applyDistribution(lhs: Filter, rhs: Filter): Filter {\n  hardAssert(\n    lhs instanceof FieldFilter || lhs instanceof CompositeFilter,\n    'Only field filters and composite filters are accepted.'\n  );\n  hardAssert(\n    rhs instanceof FieldFilter || rhs instanceof CompositeFilter,\n    'Only field filters and composite filters are accepted.'\n  );\n\n  let result: Filter;\n\n  if (lhs instanceof FieldFilter) {\n    if (rhs instanceof FieldFilter) {\n      // FieldFilter FieldFilter\n      result = applyDistributionFieldFilters(lhs, rhs);\n    } else {\n      // FieldFilter CompositeFilter\n      result = applyDistributionFieldAndCompositeFilters(lhs, rhs);\n    }\n  } else {\n    if (rhs instanceof FieldFilter) {\n      // CompositeFilter FieldFilter\n      result = applyDistributionFieldAndCompositeFilters(rhs, lhs);\n    } else {\n      // CompositeFilter CompositeFilter\n      result = applyDistributionCompositeFilters(lhs, rhs);\n    }\n  }\n\n  return applyAssociation(result);\n}\n\nfunction applyDistributionFieldFilters(\n  lhs: FieldFilter,\n  rhs: FieldFilter\n): Filter {\n  // Conjunction distribution for two field filters is the conjunction of them.\n  return CompositeFilter.create([lhs, rhs], CompositeOperator.AND);\n}\n\nfunction applyDistributionCompositeFilters(\n  lhs: CompositeFilter,\n  rhs: CompositeFilter\n): Filter {\n  hardAssert(\n    lhs.filters.length > 0 && rhs.filters.length > 0,\n    'Found an empty composite filter'\n  );\n\n  // There are four cases:\n  // (A & B) & (C & D) --> (A & B & C & D)\n  // (A & B) & (C | D) --> (A & B & C) | (A & B & D)\n  // (A | B) & (C & D) --> (C & D & A) | (C & D & B)\n  // (A | B) & (C | D) --> (A & C) | (A & D) | (B & C) | (B & D)\n\n  // Case 1 is a merge.\n  if (compositeFilterIsConjunction(lhs) && compositeFilterIsConjunction(rhs)) {\n    return compositeFilterWithAddedFilters(lhs, rhs.getFilters());\n  }\n\n  // Case 2,3,4 all have at least one side (lhs or rhs) that is a disjunction. In all three cases\n  // we should take each element of the disjunction and distribute it over the other side, and\n  // return the disjunction of the distribution results.\n  const disjunctionSide = compositeFilterIsDisjunction(lhs) ? lhs : rhs;\n  const otherSide = compositeFilterIsDisjunction(lhs) ? rhs : lhs;\n  const results = disjunctionSide.filters.map(subfilter =>\n    applyDistribution(subfilter, otherSide)\n  );\n  return CompositeFilter.create(results, CompositeOperator.OR);\n}\n\nfunction applyDistributionFieldAndCompositeFilters(\n  fieldFilter: FieldFilter,\n  compositeFilter: CompositeFilter\n): Filter {\n  // There are two cases:\n  // A & (B & C) --> (A & B & C)\n  // A & (B | C) --> (A & B) | (A & C)\n  if (compositeFilterIsConjunction(compositeFilter)) {\n    // Case 1\n    return compositeFilterWithAddedFilters(\n      compositeFilter,\n      fieldFilter.getFilters()\n    );\n  } else {\n    // Case 2\n    const newFilters = compositeFilter.filters.map(subfilter =>\n      applyDistribution(fieldFilter, subfilter)\n    );\n\n    return CompositeFilter.create(newFilters, CompositeOperator.OR);\n  }\n}\n\n/**\n * Applies the associativity property to the given filter and returns the resulting filter.\n *\n * <ul>\n *   <li>A | (B | C) == (A | B) | C == (A | B | C)\n *   <li>A & (B & C) == (A & B) & C == (A & B & C)\n * </ul>\n *\n * <p>For more info, visit: https://en.wikipedia.org/wiki/Associative_property#Propositional_logic\n */\nexport function applyAssociation(filter: Filter): Filter {\n  hardAssert(\n    filter instanceof FieldFilter || filter instanceof CompositeFilter,\n    'Only field filters and composite filters are accepted.'\n  );\n\n  if (filter instanceof FieldFilter) {\n    return filter;\n  }\n\n  const filters = filter.getFilters();\n\n  // If the composite filter only contains 1 filter, apply associativity to it.\n  if (filters.length === 1) {\n    return applyAssociation(filters[0]);\n  }\n\n  // Associativity applied to a flat composite filter results is itself.\n  if (compositeFilterIsFlat(filter)) {\n    return filter;\n  }\n\n  // First apply associativity to all subfilters. This will in turn recursively apply\n  // associativity to all nested composite filters and field filters.\n  const updatedFilters = filters.map(subfilter => applyAssociation(subfilter));\n\n  // For composite subfilters that perform the same kind of logical operation as `compositeFilter`\n  // take out their filters and add them to `compositeFilter`. For example:\n  // compositeFilter = (A | (B | C | D))\n  // compositeSubfilter = (B | C | D)\n  // Result: (A | B | C | D)\n  // Note that the `compositeSubfilter` has been eliminated, and its filters (B, C, D) have been\n  // added to the top-level \"compositeFilter\".\n  const newSubfilters: Filter[] = [];\n  updatedFilters.forEach(subfilter => {\n    if (subfilter instanceof FieldFilter) {\n      newSubfilters.push(subfilter);\n    } else if (subfilter instanceof CompositeFilter) {\n      if (subfilter.op === filter.op) {\n        // compositeFilter: (A | (B | C))\n        // compositeSubfilter: (B | C)\n        // Result: (A | B | C)\n        newSubfilters.push(...subfilter.filters);\n      } else {\n        // compositeFilter: (A | (B & C))\n        // compositeSubfilter: (B & C)\n        // Result: (A | (B & C))\n        newSubfilters.push(subfilter);\n      }\n    }\n  });\n\n  if (newSubfilters.length === 1) {\n    return newSubfilters[0];\n  }\n\n  return CompositeFilter.create(newSubfilters, filter.op);\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Target } from '../core/target';\nimport { DocumentMap } from '../model/collections';\nimport { DocumentKey } from '../model/document_key';\nimport { FieldIndex, IndexOffset } from '../model/field_index';\nimport { ResourcePath } from '../model/path';\nimport { debugAssert } from '../util/assert';\nimport { SortedSet } from '../util/sorted_set';\n\nimport { IndexManager, IndexType } from './index_manager';\nimport { PersistencePromise } from './persistence_promise';\nimport { PersistenceTransaction } from './persistence_transaction';\n\n/**\n * An in-memory implementation of IndexManager.\n */\nexport class MemoryIndexManager implements IndexManager {\n  private collectionParentIndex = new MemoryCollectionParentIndex();\n\n  addToCollectionParentIndex(\n    transaction: PersistenceTransaction,\n    collectionPath: ResourcePath\n  ): PersistencePromise<void> {\n    this.collectionParentIndex.add(collectionPath);\n    return PersistencePromise.resolve();\n  }\n\n  getCollectionParents(\n    transaction: PersistenceTransaction,\n    collectionId: string\n  ): PersistencePromise<ResourcePath[]> {\n    return PersistencePromise.resolve(\n      this.collectionParentIndex.getEntries(collectionId)\n    );\n  }\n\n  addFieldIndex(\n    transaction: PersistenceTransaction,\n    index: FieldIndex\n  ): PersistencePromise<void> {\n    // Field indices are not supported with memory persistence.\n    return PersistencePromise.resolve();\n  }\n\n  deleteFieldIndex(\n    transaction: PersistenceTransaction,\n    index: FieldIndex\n  ): PersistencePromise<void> {\n    // Field indices are not supported with memory persistence.\n    return PersistencePromise.resolve();\n  }\n\n  deleteAllFieldIndexes(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<void> {\n    // Field indices are not supported with memory persistence.\n    return PersistencePromise.resolve();\n  }\n\n  createTargetIndexes(\n    transaction: PersistenceTransaction,\n    target: Target\n  ): PersistencePromise<void> {\n    // Field indices are not supported with memory persistence.\n    return PersistencePromise.resolve();\n  }\n\n  getDocumentsMatchingTarget(\n    transaction: PersistenceTransaction,\n    target: Target\n  ): PersistencePromise<DocumentKey[] | null> {\n    // Field indices are not supported with memory persistence.\n    return PersistencePromise.resolve<DocumentKey[] | null>(null);\n  }\n\n  getIndexType(\n    transaction: PersistenceTransaction,\n    target: Target\n  ): PersistencePromise<IndexType> {\n    // Field indices are not supported with memory persistence.\n    return PersistencePromise.resolve<IndexType>(IndexType.NONE);\n  }\n\n  getFieldIndexes(\n    transaction: PersistenceTransaction,\n    collectionGroup?: string\n  ): PersistencePromise<FieldIndex[]> {\n    // Field indices are not supported with memory persistence.\n    return PersistencePromise.resolve<FieldIndex[]>([]);\n  }\n\n  getNextCollectionGroupToUpdate(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<string | null> {\n    // Field indices are not supported with memory persistence.\n    return PersistencePromise.resolve<string | null>(null);\n  }\n\n  getMinOffset(\n    transaction: PersistenceTransaction,\n    target: Target\n  ): PersistencePromise<IndexOffset> {\n    return PersistencePromise.resolve(IndexOffset.min());\n  }\n\n  getMinOffsetFromCollectionGroup(\n    transaction: PersistenceTransaction,\n    collectionGroup: string\n  ): PersistencePromise<IndexOffset> {\n    return PersistencePromise.resolve(IndexOffset.min());\n  }\n\n  updateCollectionGroup(\n    transaction: PersistenceTransaction,\n    collectionGroup: string,\n    offset: IndexOffset\n  ): PersistencePromise<void> {\n    // Field indices are not supported with memory persistence.\n    return PersistencePromise.resolve();\n  }\n\n  updateIndexEntries(\n    transaction: PersistenceTransaction,\n    documents: DocumentMap\n  ): PersistencePromise<void> {\n    // Field indices are not supported with memory persistence.\n    return PersistencePromise.resolve();\n  }\n}\n\n/**\n * Internal implementation of the collection-parent index exposed by MemoryIndexManager.\n * Also used for in-memory caching by IndexedDbIndexManager and initial index population\n * in indexeddb_schema.ts\n */\nexport class MemoryCollectionParentIndex {\n  private index = {} as {\n    [collectionId: string]: SortedSet<ResourcePath>;\n  };\n\n  // Returns false if the entry already existed.\n  add(collectionPath: ResourcePath): boolean {\n    debugAssert(collectionPath.length % 2 === 1, 'Expected a collection path.');\n    const collectionId = collectionPath.lastSegment();\n    const parentPath = collectionPath.popLast();\n    const existingParents =\n      this.index[collectionId] ||\n      new SortedSet<ResourcePath>(ResourcePath.comparator);\n    const added = !existingParents.has(parentPath);\n    this.index[collectionId] = existingParents.add(parentPath);\n    return added;\n  }\n\n  has(collectionPath: ResourcePath): boolean {\n    const collectionId = collectionPath.lastSegment();\n    const parentPath = collectionPath.popLast();\n    const existingParents = this.index[collectionId];\n    return existingParents && existingParents.has(parentPath);\n  }\n\n  getEntries(collectionId: string): ResourcePath[] {\n    const parentPaths =\n      this.index[collectionId] ||\n      new SortedSet<ResourcePath>(ResourcePath.comparator);\n    return parentPaths.toArray();\n  }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { User } from '../auth/user';\nimport { Bound } from '../core/bound';\nimport { DatabaseId } from '../core/database_info';\nimport {\n  CompositeFilter,\n  CompositeOperator,\n  FieldFilter,\n  Filter,\n  Operator\n} from '../core/filter';\nimport {\n  canonifyTarget,\n  newTarget,\n  Target,\n  targetEquals,\n  targetGetArrayValues,\n  targetGetLowerBound,\n  targetGetNotInValues,\n  targetGetSegmentCount,\n  targetGetUpperBound,\n  targetHasLimit\n} from '../core/target';\nimport { FirestoreIndexValueWriter } from '../index/firestore_index_value_writer';\nimport { IndexByteEncoder } from '../index/index_byte_encoder';\nimport { IndexEntry, indexEntryComparator } from '../index/index_entry';\nimport { documentKeySet, DocumentMap } from '../model/collections';\nimport { Document } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport {\n  FieldIndex,\n  fieldIndexGetArraySegment,\n  fieldIndexGetDirectionalSegments,\n  fieldIndexGetKeyOrder,\n  fieldIndexToString,\n  IndexKind,\n  IndexOffset,\n  indexOffsetComparator,\n  IndexSegment\n} from '../model/field_index';\nimport { FieldPath, ResourcePath } from '../model/path';\nimport { TargetIndexMatcher } from '../model/target_index_matcher';\nimport { isArray, refValue } from '../model/values';\nimport { Value as ProtoValue } from '../protos/firestore_proto_api';\nimport { debugAssert, fail, hardAssert } from '../util/assert';\nimport { logDebug } from '../util/log';\nimport { getDnfTerms } from '../util/logic_utils';\nimport { immediateSuccessor, primitiveComparator } from '../util/misc';\nimport { ObjectMap } from '../util/obj_map';\nimport { diffSortedSets, SortedSet } from '../util/sorted_set';\n\nimport {\n  decodeResourcePath,\n  encodeResourcePath\n} from './encoded_resource_path';\nimport { IndexManager, IndexType } from './index_manager';\nimport {\n  DbCollectionParent,\n  DbIndexConfiguration,\n  DbIndexEntry,\n  DbIndexState\n} from './indexeddb_schema';\nimport {\n  DbCollectionParentKey,\n  DbCollectionParentStore,\n  DbIndexConfigurationCollectionGroupIndex,\n  DbIndexConfigurationKey,\n  DbIndexConfigurationStore,\n  DbIndexEntryDocumentKeyIndex,\n  DbIndexEntryKey,\n  DbIndexEntryStore,\n  DbIndexStateKey,\n  DbIndexStateSequenceNumberIndex,\n  DbIndexStateStore\n} from './indexeddb_sentinels';\nimport { getStore } from './indexeddb_transaction';\nimport {\n  fromDbIndexConfiguration,\n  toDbIndexConfiguration,\n  toDbIndexState\n} from './local_serializer';\nimport { MemoryCollectionParentIndex } from './memory_index_manager';\nimport { PersistencePromise } from './persistence_promise';\nimport { PersistenceTransaction } from './persistence_transaction';\nimport { SimpleDbStore } from './simple_db';\n\nconst LOG_TAG = 'IndexedDbIndexManager';\n\nconst EMPTY_VALUE = new Uint8Array(0);\n\n/**\n * A persisted implementation of IndexManager.\n *\n * PORTING NOTE: Unlike iOS and Android, the Web SDK does not memoize index\n * data as it supports multi-tab access.\n */\nexport class IndexedDbIndexManager implements IndexManager {\n  /**\n   * An in-memory copy of the index entries we've already written since the SDK\n   * launched. Used to avoid re-writing the same entry repeatedly.\n   *\n   * This is *NOT* a complete cache of what's in persistence and so can never be\n   * used to satisfy reads.\n   */\n  private collectionParentsCache = new MemoryCollectionParentIndex();\n\n  private readonly uid: string;\n\n  /**\n   * Maps from a target to its equivalent list of sub-targets. Each sub-target\n   * contains only one term from the target's disjunctive normal form (DNF).\n   */\n  private targetToDnfSubTargets = new ObjectMap<Target, Target[]>(\n    t => canonifyTarget(t),\n    (l, r) => targetEquals(l, r)\n  );\n\n  constructor(user: User, private readonly databaseId: DatabaseId) {\n    this.uid = user.uid || '';\n  }\n\n  /**\n   * Adds a new entry to the collection parent index.\n   *\n   * Repeated calls for the same collectionPath should be avoided within a\n   * transaction as IndexedDbIndexManager only caches writes once a transaction\n   * has been committed.\n   */\n  addToCollectionParentIndex(\n    transaction: PersistenceTransaction,\n    collectionPath: ResourcePath\n  ): PersistencePromise<void> {\n    debugAssert(collectionPath.length % 2 === 1, 'Expected a collection path.');\n    if (!this.collectionParentsCache.has(collectionPath)) {\n      const collectionId = collectionPath.lastSegment();\n      const parentPath = collectionPath.popLast();\n\n      transaction.addOnCommittedListener(() => {\n        // Add the collection to the in memory cache only if the transaction was\n        // successfully committed.\n        this.collectionParentsCache.add(collectionPath);\n      });\n\n      const collectionParent: DbCollectionParent = {\n        collectionId,\n        parent: encodeResourcePath(parentPath)\n      };\n      return collectionParentsStore(transaction).put(collectionParent);\n    }\n    return PersistencePromise.resolve();\n  }\n\n  getCollectionParents(\n    transaction: PersistenceTransaction,\n    collectionId: string\n  ): PersistencePromise<ResourcePath[]> {\n    const parentPaths = [] as ResourcePath[];\n    const range = IDBKeyRange.bound(\n      [collectionId, ''],\n      [immediateSuccessor(collectionId), ''],\n      /*lowerOpen=*/ false,\n      /*upperOpen=*/ true\n    );\n    return collectionParentsStore(transaction)\n      .loadAll(range)\n      .next(entries => {\n        for (const entry of entries) {\n          // This collectionId guard shouldn't be necessary (and isn't as long\n          // as we're running in a real browser), but there's a bug in\n          // indexeddbshim that breaks our range in our tests running in node:\n          // https://github.com/axemclion/IndexedDBShim/issues/334\n          if (entry.collectionId !== collectionId) {\n            break;\n          }\n          parentPaths.push(decodeResourcePath(entry.parent));\n        }\n        return parentPaths;\n      });\n  }\n\n  addFieldIndex(\n    transaction: PersistenceTransaction,\n    index: FieldIndex\n  ): PersistencePromise<void> {\n    // TODO(indexing): Verify that the auto-incrementing index ID works in\n    // Safari & Firefox.\n    const indexes = indexConfigurationStore(transaction);\n    const dbIndex = toDbIndexConfiguration(index);\n    delete dbIndex.indexId; // `indexId` is auto-populated by IndexedDb\n    const result = indexes.add(dbIndex);\n    if (index.indexState) {\n      const states = indexStateStore(transaction);\n      return result.next(indexId => {\n        states.put(\n          toDbIndexState(\n            indexId,\n            this.uid,\n            index.indexState.sequenceNumber,\n            index.indexState.offset\n          )\n        );\n      });\n    } else {\n      return result.next();\n    }\n  }\n\n  deleteFieldIndex(\n    transaction: PersistenceTransaction,\n    index: FieldIndex\n  ): PersistencePromise<void> {\n    const indexes = indexConfigurationStore(transaction);\n    const states = indexStateStore(transaction);\n    const entries = indexEntriesStore(transaction);\n    return indexes\n      .delete(index.indexId)\n      .next(() =>\n        states.delete(\n          IDBKeyRange.bound(\n            [index.indexId],\n            [index.indexId + 1],\n            /*lowerOpen=*/ false,\n            /*upperOpen=*/ true\n          )\n        )\n      )\n      .next(() =>\n        entries.delete(\n          IDBKeyRange.bound(\n            [index.indexId],\n            [index.indexId + 1],\n            /*lowerOpen=*/ false,\n            /*upperOpen=*/ true\n          )\n        )\n      );\n  }\n\n  deleteAllFieldIndexes(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<void> {\n    const indexes = indexConfigurationStore(transaction);\n    const entries = indexEntriesStore(transaction);\n    const states = indexStateStore(transaction);\n\n    return indexes\n      .deleteAll()\n      .next(() => entries.deleteAll())\n      .next(() => states.deleteAll());\n  }\n\n  createTargetIndexes(\n    transaction: PersistenceTransaction,\n    target: Target\n  ): PersistencePromise<void> {\n    return PersistencePromise.forEach(\n      this.getSubTargets(target),\n      (subTarget: Target) => {\n        return this.getIndexType(transaction, subTarget).next(type => {\n          if (type === IndexType.NONE || type === IndexType.PARTIAL) {\n            const targetIndexMatcher = new TargetIndexMatcher(subTarget);\n            const fieldIndex = targetIndexMatcher.buildTargetIndex();\n            if (fieldIndex != null) {\n              return this.addFieldIndex(transaction, fieldIndex);\n            }\n          }\n        });\n      }\n    );\n  }\n\n  getDocumentsMatchingTarget(\n    transaction: PersistenceTransaction,\n    target: Target\n  ): PersistencePromise<DocumentKey[] | null> {\n    const indexEntries = indexEntriesStore(transaction);\n\n    let canServeTarget = true;\n    const indexes = new Map<Target, FieldIndex | null>();\n\n    return PersistencePromise.forEach(\n      this.getSubTargets(target),\n      (subTarget: Target) => {\n        return this.getFieldIndex(transaction, subTarget).next(index => {\n          canServeTarget &&= !!index;\n          indexes.set(subTarget, index);\n        });\n      }\n    ).next(() => {\n      if (!canServeTarget) {\n        return PersistencePromise.resolve(null as DocumentKey[] | null);\n      } else {\n        let existingKeys = documentKeySet();\n        const result: DocumentKey[] = [];\n        return PersistencePromise.forEach(indexes, (index, subTarget) => {\n          logDebug(\n            LOG_TAG,\n            `Using index ${fieldIndexToString(\n              index!\n            )} to execute ${canonifyTarget(target)}`\n          );\n\n          const arrayValues = targetGetArrayValues(subTarget, index!);\n          const notInValues = targetGetNotInValues(subTarget, index!);\n          const lowerBound = targetGetLowerBound(subTarget, index!);\n          const upperBound = targetGetUpperBound(subTarget, index!);\n\n          const lowerBoundEncoded = this.encodeBound(\n            index!,\n            subTarget,\n            lowerBound\n          );\n          const upperBoundEncoded = this.encodeBound(\n            index!,\n            subTarget,\n            upperBound\n          );\n          const notInEncoded = this.encodeValues(\n            index!,\n            subTarget,\n            notInValues\n          );\n\n          const indexRanges = this.generateIndexRanges(\n            index!.indexId,\n            arrayValues,\n            lowerBoundEncoded,\n            lowerBound.inclusive,\n            upperBoundEncoded,\n            upperBound.inclusive,\n            notInEncoded\n          );\n          return PersistencePromise.forEach(\n            indexRanges,\n            (indexRange: IDBKeyRange) => {\n              return indexEntries\n                .loadFirst(indexRange, target.limit)\n                .next(entries => {\n                  entries.forEach(entry => {\n                    const documentKey = DocumentKey.fromSegments(\n                      entry.documentKey\n                    );\n                    if (!existingKeys.has(documentKey)) {\n                      existingKeys = existingKeys.add(documentKey);\n                      result.push(documentKey);\n                    }\n                  });\n                });\n            }\n          );\n        }).next(() => result as DocumentKey[] | null);\n      }\n    });\n  }\n\n  private getSubTargets(target: Target): Target[] {\n    let subTargets = this.targetToDnfSubTargets.get(target);\n    if (subTargets) {\n      return subTargets;\n    }\n\n    if (target.filters.length === 0) {\n      subTargets = [target];\n    } else {\n      // There is an implicit AND operation between all the filters stored in the target\n      const dnf: Filter[] = getDnfTerms(\n        CompositeFilter.create(target.filters, CompositeOperator.AND)\n      );\n\n      subTargets = dnf.map(term =>\n        newTarget(\n          target.path,\n          target.collectionGroup,\n          target.orderBy,\n          term.getFilters(),\n          target.limit,\n          target.startAt,\n          target.endAt\n        )\n      );\n    }\n\n    this.targetToDnfSubTargets.set(target, subTargets);\n    return subTargets;\n  }\n\n  /**\n   * Constructs a key range query on `DbIndexEntryStore` that unions all\n   * bounds.\n   */\n  private generateIndexRanges(\n    indexId: number,\n    arrayValues: ProtoValue[] | null,\n    lowerBounds: Uint8Array[],\n    lowerBoundInclusive: boolean,\n    upperBounds: Uint8Array[],\n    upperBoundInclusive: boolean,\n    notInValues: Uint8Array[]\n  ): IDBKeyRange[] {\n    // The number of total index scans we union together. This is similar to a\n    // distributed normal form, but adapted for array values. We create a single\n    // index range per value in an ARRAY_CONTAINS or ARRAY_CONTAINS_ANY filter\n    // combined with the values from the query bounds.\n    const totalScans =\n      (arrayValues != null ? arrayValues.length : 1) *\n      Math.max(lowerBounds.length, upperBounds.length);\n    const scansPerArrayElement =\n      totalScans / (arrayValues != null ? arrayValues.length : 1);\n\n    const indexRanges: IDBKeyRange[] = [];\n    for (let i = 0; i < totalScans; ++i) {\n      const arrayValue = arrayValues\n        ? this.encodeSingleElement(arrayValues[i / scansPerArrayElement])\n        : EMPTY_VALUE;\n\n      const lowerBound = this.generateLowerBound(\n        indexId,\n        arrayValue,\n        lowerBounds[i % scansPerArrayElement],\n        lowerBoundInclusive\n      );\n      const upperBound = this.generateUpperBound(\n        indexId,\n        arrayValue,\n        upperBounds[i % scansPerArrayElement],\n        upperBoundInclusive\n      );\n\n      const notInBound = notInValues.map(notIn =>\n        this.generateLowerBound(\n          indexId,\n          arrayValue,\n          notIn,\n          /* inclusive= */ true\n        )\n      );\n\n      indexRanges.push(...this.createRange(lowerBound, upperBound, notInBound));\n    }\n\n    return indexRanges;\n  }\n\n  /** Generates the lower bound for `arrayValue` and `directionalValue`. */\n  private generateLowerBound(\n    indexId: number,\n    arrayValue: Uint8Array,\n    directionalValue: Uint8Array,\n    inclusive: boolean\n  ): IndexEntry {\n    const entry = new IndexEntry(\n      indexId,\n      DocumentKey.empty(),\n      arrayValue,\n      directionalValue\n    );\n    return inclusive ? entry : entry.successor();\n  }\n\n  /** Generates the upper bound for `arrayValue` and `directionalValue`. */\n  private generateUpperBound(\n    indexId: number,\n    arrayValue: Uint8Array,\n    directionalValue: Uint8Array,\n    inclusive: boolean\n  ): IndexEntry {\n    const entry = new IndexEntry(\n      indexId,\n      DocumentKey.empty(),\n      arrayValue,\n      directionalValue\n    );\n    return inclusive ? entry.successor() : entry;\n  }\n\n  private getFieldIndex(\n    transaction: PersistenceTransaction,\n    target: Target\n  ): PersistencePromise<FieldIndex | null> {\n    const targetIndexMatcher = new TargetIndexMatcher(target);\n    const collectionGroup =\n      target.collectionGroup != null\n        ? target.collectionGroup\n        : target.path.lastSegment();\n\n    return this.getFieldIndexes(transaction, collectionGroup).next(indexes => {\n      // Return the index with the most number of segments.\n      let index: FieldIndex | null = null;\n      for (const candidate of indexes) {\n        const matches = targetIndexMatcher.servedByIndex(candidate);\n        if (\n          matches &&\n          (!index || candidate.fields.length > index.fields.length)\n        ) {\n          index = candidate;\n        }\n      }\n      return index;\n    });\n  }\n\n  getIndexType(\n    transaction: PersistenceTransaction,\n    target: Target\n  ): PersistencePromise<IndexType> {\n    let indexType = IndexType.FULL;\n    const subTargets = this.getSubTargets(target);\n    return PersistencePromise.forEach(subTargets, (target: Target) => {\n      return this.getFieldIndex(transaction, target).next(index => {\n        if (!index) {\n          indexType = IndexType.NONE;\n        } else if (\n          indexType !== IndexType.NONE &&\n          index.fields.length < targetGetSegmentCount(target)\n        ) {\n          indexType = IndexType.PARTIAL;\n        }\n      });\n    }).next(() => {\n      // OR queries have more than one sub-target (one sub-target per DNF term). We currently consider\n      // OR queries that have a `limit` to have a partial index. For such queries we perform sorting\n      // and apply the limit in memory as a post-processing step.\n      if (\n        targetHasLimit(target) &&\n        subTargets.length > 1 &&\n        indexType === IndexType.FULL\n      ) {\n        return IndexType.PARTIAL;\n      }\n\n      return indexType;\n    });\n  }\n\n  /**\n   * Returns the byte encoded form of the directional values in the field index.\n   * Returns `null` if the document does not have all fields specified in the\n   * index.\n   */\n  private encodeDirectionalElements(\n    fieldIndex: FieldIndex,\n    document: Document\n  ): Uint8Array | null {\n    const encoder = new IndexByteEncoder();\n    for (const segment of fieldIndexGetDirectionalSegments(fieldIndex)) {\n      const field = document.data.field(segment.fieldPath);\n      if (field == null) {\n        return null;\n      }\n      const directionalEncoder = encoder.forKind(segment.kind);\n      FirestoreIndexValueWriter.INSTANCE.writeIndexValue(\n        field,\n        directionalEncoder\n      );\n    }\n    return encoder.encodedBytes();\n  }\n\n  /** Encodes a single value to the ascending index format. */\n  private encodeSingleElement(value: ProtoValue): Uint8Array {\n    const encoder = new IndexByteEncoder();\n    FirestoreIndexValueWriter.INSTANCE.writeIndexValue(\n      value,\n      encoder.forKind(IndexKind.ASCENDING)\n    );\n    return encoder.encodedBytes();\n  }\n\n  /**\n   * Returns an encoded form of the document key that sorts based on the key\n   * ordering of the field index.\n   */\n  private encodeDirectionalKey(\n    fieldIndex: FieldIndex,\n    documentKey: DocumentKey\n  ): Uint8Array {\n    const encoder = new IndexByteEncoder();\n    FirestoreIndexValueWriter.INSTANCE.writeIndexValue(\n      refValue(this.databaseId, documentKey),\n      encoder.forKind(fieldIndexGetKeyOrder(fieldIndex))\n    );\n    return encoder.encodedBytes();\n  }\n\n  /**\n   * Encodes the given field values according to the specification in `target`.\n   * For IN queries, a list of possible values is returned.\n   */\n  private encodeValues(\n    fieldIndex: FieldIndex,\n    target: Target,\n    values: ProtoValue[] | null\n  ): Uint8Array[] {\n    if (values === null) {\n      return [];\n    }\n\n    let encoders: IndexByteEncoder[] = [];\n    encoders.push(new IndexByteEncoder());\n\n    let valueIdx = 0;\n    for (const segment of fieldIndexGetDirectionalSegments(fieldIndex)) {\n      const value = values[valueIdx++];\n      for (const encoder of encoders) {\n        if (this.isInFilter(target, segment.fieldPath) && isArray(value)) {\n          encoders = this.expandIndexValues(encoders, segment, value);\n        } else {\n          const directionalEncoder = encoder.forKind(segment.kind);\n          FirestoreIndexValueWriter.INSTANCE.writeIndexValue(\n            value,\n            directionalEncoder\n          );\n        }\n      }\n    }\n    return this.getEncodedBytes(encoders);\n  }\n\n  /**\n   * Encodes the given bounds according to the specification in `target`. For IN\n   * queries, a list of possible values is returned.\n   */\n  private encodeBound(\n    fieldIndex: FieldIndex,\n    target: Target,\n    bound: Bound\n  ): Uint8Array[] {\n    return this.encodeValues(fieldIndex, target, bound.position);\n  }\n\n  /** Returns the byte representation for the provided encoders. */\n  private getEncodedBytes(encoders: IndexByteEncoder[]): Uint8Array[] {\n    const result: Uint8Array[] = [];\n    for (let i = 0; i < encoders.length; ++i) {\n      result[i] = encoders[i].encodedBytes();\n    }\n    return result;\n  }\n\n  /**\n   * Creates a separate encoder for each element of an array.\n   *\n   * The method appends each value to all existing encoders (e.g. filter(\"a\",\n   * \"==\", \"a1\").filter(\"b\", \"in\", [\"b1\", \"b2\"]) becomes [\"a1,b1\", \"a1,b2\"]). A\n   * list of new encoders is returned.\n   */\n  private expandIndexValues(\n    encoders: IndexByteEncoder[],\n    segment: IndexSegment,\n    value: ProtoValue\n  ): IndexByteEncoder[] {\n    const prefixes = [...encoders];\n    const results: IndexByteEncoder[] = [];\n    for (const arrayElement of value.arrayValue!.values || []) {\n      for (const prefix of prefixes) {\n        const clonedEncoder = new IndexByteEncoder();\n        clonedEncoder.seed(prefix.encodedBytes());\n        FirestoreIndexValueWriter.INSTANCE.writeIndexValue(\n          arrayElement,\n          clonedEncoder.forKind(segment.kind)\n        );\n        results.push(clonedEncoder);\n      }\n    }\n    return results;\n  }\n\n  private isInFilter(target: Target, fieldPath: FieldPath): boolean {\n    return !!target.filters.find(\n      f =>\n        f instanceof FieldFilter &&\n        f.field.isEqual(fieldPath) &&\n        (f.op === Operator.IN || f.op === Operator.NOT_IN)\n    );\n  }\n\n  getFieldIndexes(\n    transaction: PersistenceTransaction,\n    collectionGroup?: string\n  ): PersistencePromise<FieldIndex[]> {\n    const indexes = indexConfigurationStore(transaction);\n    const states = indexStateStore(transaction);\n\n    return (\n      collectionGroup\n        ? indexes.loadAll(\n            DbIndexConfigurationCollectionGroupIndex,\n            IDBKeyRange.bound(collectionGroup, collectionGroup)\n          )\n        : indexes.loadAll()\n    ).next(indexConfigs => {\n      const result: FieldIndex[] = [];\n      return PersistencePromise.forEach(\n        indexConfigs,\n        (indexConfig: DbIndexConfiguration) => {\n          return states\n            .get([indexConfig.indexId!, this.uid])\n            .next(indexState => {\n              result.push(fromDbIndexConfiguration(indexConfig, indexState));\n            });\n        }\n      ).next(() => result);\n    });\n  }\n\n  getNextCollectionGroupToUpdate(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<string | null> {\n    return this.getFieldIndexes(transaction).next(indexes => {\n      if (indexes.length === 0) {\n        return null;\n      }\n      indexes.sort((l, r) => {\n        const cmp = l.indexState.sequenceNumber - r.indexState.sequenceNumber;\n        return cmp !== 0\n          ? cmp\n          : primitiveComparator(l.collectionGroup, r.collectionGroup);\n      });\n      return indexes[0].collectionGroup;\n    });\n  }\n\n  updateCollectionGroup(\n    transaction: PersistenceTransaction,\n    collectionGroup: string,\n    offset: IndexOffset\n  ): PersistencePromise<void> {\n    const indexes = indexConfigurationStore(transaction);\n    const states = indexStateStore(transaction);\n    return this.getNextSequenceNumber(transaction).next(nextSequenceNumber =>\n      indexes\n        .loadAll(\n          DbIndexConfigurationCollectionGroupIndex,\n          IDBKeyRange.bound(collectionGroup, collectionGroup)\n        )\n        .next(configs =>\n          PersistencePromise.forEach(configs, (config: DbIndexConfiguration) =>\n            states.put(\n              toDbIndexState(\n                config.indexId!,\n                this.uid,\n                nextSequenceNumber,\n                offset\n              )\n            )\n          )\n        )\n    );\n  }\n\n  updateIndexEntries(\n    transaction: PersistenceTransaction,\n    documents: DocumentMap\n  ): PersistencePromise<void> {\n    // Porting Note: `getFieldIndexes()` on Web does not cache index lookups as\n    // it could be used across different IndexedDB transactions. As any cached\n    // data might be invalidated by other multi-tab clients, we can only trust\n    // data within a single IndexedDB transaction. We therefore add a cache\n    // here.\n    const memoizedIndexes = new Map<string, FieldIndex[]>();\n    return PersistencePromise.forEach(documents, (key, doc) => {\n      const memoizedCollectionIndexes = memoizedIndexes.get(\n        key.collectionGroup\n      );\n      const fieldIndexes = memoizedCollectionIndexes\n        ? PersistencePromise.resolve(memoizedCollectionIndexes)\n        : this.getFieldIndexes(transaction, key.collectionGroup);\n\n      return fieldIndexes.next(fieldIndexes => {\n        memoizedIndexes.set(key.collectionGroup, fieldIndexes);\n        return PersistencePromise.forEach(\n          fieldIndexes,\n          (fieldIndex: FieldIndex) => {\n            return this.getExistingIndexEntries(\n              transaction,\n              key,\n              fieldIndex\n            ).next(existingEntries => {\n              const newEntries = this.computeIndexEntries(doc, fieldIndex);\n              if (!existingEntries.isEqual(newEntries)) {\n                return this.updateEntries(\n                  transaction,\n                  doc,\n                  fieldIndex,\n                  existingEntries,\n                  newEntries\n                );\n              }\n              return PersistencePromise.resolve();\n            });\n          }\n        );\n      });\n    });\n  }\n\n  private addIndexEntry(\n    transaction: PersistenceTransaction,\n    document: Document,\n    fieldIndex: FieldIndex,\n    indexEntry: IndexEntry\n  ): PersistencePromise<void> {\n    const indexEntries = indexEntriesStore(transaction);\n    return indexEntries.put({\n      indexId: indexEntry.indexId,\n      uid: this.uid,\n      arrayValue: indexEntry.arrayValue,\n      directionalValue: indexEntry.directionalValue,\n      orderedDocumentKey: this.encodeDirectionalKey(fieldIndex, document.key),\n      documentKey: document.key.path.toArray()\n    });\n  }\n\n  private deleteIndexEntry(\n    transaction: PersistenceTransaction,\n    document: Document,\n    fieldIndex: FieldIndex,\n    indexEntry: IndexEntry\n  ): PersistencePromise<void> {\n    const indexEntries = indexEntriesStore(transaction);\n    return indexEntries.delete([\n      indexEntry.indexId,\n      this.uid,\n      indexEntry.arrayValue,\n      indexEntry.directionalValue,\n      this.encodeDirectionalKey(fieldIndex, document.key),\n      document.key.path.toArray()\n    ]);\n  }\n\n  private getExistingIndexEntries(\n    transaction: PersistenceTransaction,\n    documentKey: DocumentKey,\n    fieldIndex: FieldIndex\n  ): PersistencePromise<SortedSet<IndexEntry>> {\n    const indexEntries = indexEntriesStore(transaction);\n    let results = new SortedSet<IndexEntry>(indexEntryComparator);\n    return indexEntries\n      .iterate(\n        {\n          index: DbIndexEntryDocumentKeyIndex,\n          range: IDBKeyRange.only([\n            fieldIndex.indexId,\n            this.uid,\n            this.encodeDirectionalKey(fieldIndex, documentKey)\n          ])\n        },\n        (_, entry) => {\n          results = results.add(\n            new IndexEntry(\n              fieldIndex.indexId,\n              documentKey,\n              entry.arrayValue,\n              entry.directionalValue\n            )\n          );\n        }\n      )\n      .next(() => results);\n  }\n\n  /** Creates the index entries for the given document. */\n  private computeIndexEntries(\n    document: Document,\n    fieldIndex: FieldIndex\n  ): SortedSet<IndexEntry> {\n    let results = new SortedSet<IndexEntry>(indexEntryComparator);\n\n    const directionalValue = this.encodeDirectionalElements(\n      fieldIndex,\n      document\n    );\n    if (directionalValue == null) {\n      return results;\n    }\n\n    const arraySegment = fieldIndexGetArraySegment(fieldIndex);\n    if (arraySegment != null) {\n      const value = document.data.field(arraySegment.fieldPath);\n      if (isArray(value)) {\n        for (const arrayValue of value.arrayValue!.values || []) {\n          results = results.add(\n            new IndexEntry(\n              fieldIndex.indexId,\n              document.key,\n              this.encodeSingleElement(arrayValue),\n              directionalValue\n            )\n          );\n        }\n      }\n    } else {\n      results = results.add(\n        new IndexEntry(\n          fieldIndex.indexId,\n          document.key,\n          EMPTY_VALUE,\n          directionalValue\n        )\n      );\n    }\n\n    return results;\n  }\n\n  /**\n   * Updates the index entries for the provided document by deleting entries\n   * that are no longer referenced in `newEntries` and adding all newly added\n   * entries.\n   */\n  private updateEntries(\n    transaction: PersistenceTransaction,\n    document: Document,\n    fieldIndex: FieldIndex,\n    existingEntries: SortedSet<IndexEntry>,\n    newEntries: SortedSet<IndexEntry>\n  ): PersistencePromise<void> {\n    logDebug(LOG_TAG, \"Updating index entries for document '%s'\", document.key);\n\n    const promises: Array<PersistencePromise<void>> = [];\n    diffSortedSets(\n      existingEntries,\n      newEntries,\n      indexEntryComparator,\n      /* onAdd= */ entry => {\n        promises.push(\n          this.addIndexEntry(transaction, document, fieldIndex, entry)\n        );\n      },\n      /* onRemove= */ entry => {\n        promises.push(\n          this.deleteIndexEntry(transaction, document, fieldIndex, entry)\n        );\n      }\n    );\n\n    return PersistencePromise.waitFor(promises);\n  }\n\n  private getNextSequenceNumber(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<number> {\n    let nextSequenceNumber = 1;\n    const states = indexStateStore(transaction);\n    return states\n      .iterate(\n        {\n          index: DbIndexStateSequenceNumberIndex,\n          reverse: true,\n          range: IDBKeyRange.upperBound([this.uid, Number.MAX_SAFE_INTEGER])\n        },\n        (_, state, controller) => {\n          controller.done();\n          nextSequenceNumber = state.sequenceNumber + 1;\n        }\n      )\n      .next(() => nextSequenceNumber);\n  }\n\n  /**\n   * Returns a new set of IDB ranges that splits the existing range and excludes\n   * any values that match the `notInValue` from these ranges. As an example,\n   * '[foo > 2 && foo != 3]` becomes  `[foo > 2 && < 3, foo > 3]`.\n   */\n  private createRange(\n    lower: IndexEntry,\n    upper: IndexEntry,\n    notInValues: IndexEntry[]\n  ): IDBKeyRange[] {\n    // The notIn values need to be sorted and unique so that we can return a\n    // sorted set of non-overlapping ranges.\n    notInValues = notInValues\n      .sort((l, r) => indexEntryComparator(l, r))\n      .filter(\n        (el, i, values) => !i || indexEntryComparator(el, values[i - 1]) !== 0\n      );\n\n    const bounds: IndexEntry[] = [];\n    bounds.push(lower);\n    for (const notInValue of notInValues) {\n      const cmpToLower = indexEntryComparator(notInValue, lower);\n      const cmpToUpper = indexEntryComparator(notInValue, upper);\n\n      if (cmpToLower === 0) {\n        // `notInValue` is the lower bound. We therefore need to raise the bound\n        // to the next value.\n        bounds[0] = lower.successor();\n      } else if (cmpToLower > 0 && cmpToUpper < 0) {\n        // `notInValue` is in the middle of the range\n        bounds.push(notInValue);\n        bounds.push(notInValue.successor());\n      } else if (cmpToUpper > 0) {\n        // `notInValue` (and all following values) are out of the range\n        break;\n      }\n    }\n    bounds.push(upper);\n\n    const ranges: IDBKeyRange[] = [];\n    for (let i = 0; i < bounds.length; i += 2) {\n      // If we encounter two bounds that will create an unmatchable key range,\n      // then we return an empty set of key ranges.\n      if (this.isRangeMatchable(bounds[i], bounds[i + 1])) {\n        return [];\n      }\n\n      const lowerBound = [\n        bounds[i].indexId,\n        this.uid,\n        bounds[i].arrayValue,\n        bounds[i].directionalValue,\n        EMPTY_VALUE,\n        []\n      ] as DbIndexEntryKey;\n\n      const upperBound = [\n        bounds[i + 1].indexId,\n        this.uid,\n        bounds[i + 1].arrayValue,\n        bounds[i + 1].directionalValue,\n        EMPTY_VALUE,\n        []\n      ] as DbIndexEntryKey;\n\n      ranges.push(IDBKeyRange.bound(lowerBound, upperBound));\n    }\n    return ranges;\n  }\n\n  isRangeMatchable(lowerBound: IndexEntry, upperBound: IndexEntry): boolean {\n    // If lower bound is greater than the upper bound, then the key\n    // range can never be matched.\n    return indexEntryComparator(lowerBound, upperBound) > 0;\n  }\n\n  getMinOffsetFromCollectionGroup(\n    transaction: PersistenceTransaction,\n    collectionGroup: string\n  ): PersistencePromise<IndexOffset> {\n    return this.getFieldIndexes(transaction, collectionGroup).next(\n      getMinOffsetFromFieldIndexes\n    );\n  }\n\n  getMinOffset(\n    transaction: PersistenceTransaction,\n    target: Target\n  ): PersistencePromise<IndexOffset> {\n    return PersistencePromise.mapArray(\n      this.getSubTargets(target),\n      (subTarget: Target) =>\n        this.getFieldIndex(transaction, subTarget).next(index =>\n          index ? index : fail('Target cannot be served from index')\n        )\n    ).next(getMinOffsetFromFieldIndexes);\n  }\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the collectionParents\n * document store.\n */\nfunction collectionParentsStore(\n  txn: PersistenceTransaction\n): SimpleDbStore<DbCollectionParentKey, DbCollectionParent> {\n  return getStore<DbCollectionParentKey, DbCollectionParent>(\n    txn,\n    DbCollectionParentStore\n  );\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the index entry object store.\n */\nfunction indexEntriesStore(\n  txn: PersistenceTransaction\n): SimpleDbStore<DbIndexEntryKey, DbIndexEntry> {\n  return getStore<DbIndexEntryKey, DbIndexEntry>(txn, DbIndexEntryStore);\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the index configuration object store.\n */\nfunction indexConfigurationStore(\n  txn: PersistenceTransaction\n): SimpleDbStore<DbIndexConfigurationKey, DbIndexConfiguration> {\n  return getStore<DbIndexConfigurationKey, DbIndexConfiguration>(\n    txn,\n    DbIndexConfigurationStore\n  );\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the index state object store.\n */\nfunction indexStateStore(\n  txn: PersistenceTransaction\n): SimpleDbStore<DbIndexStateKey, DbIndexState> {\n  return getStore<DbIndexStateKey, DbIndexState>(txn, DbIndexStateStore);\n}\n\nfunction getMinOffsetFromFieldIndexes(fieldIndexes: FieldIndex[]): IndexOffset {\n  hardAssert(\n    fieldIndexes.length !== 0,\n    'Found empty index group when looking for least recent index offset.'\n  );\n\n  let minOffset: IndexOffset = fieldIndexes[0].indexState.offset;\n  let maxBatchId: number = minOffset.largestBatchId;\n  for (let i = 1; i < fieldIndexes.length; i++) {\n    const newOffset: IndexOffset = fieldIndexes[i].indexState.offset;\n    if (indexOffsetComparator(newOffset, minOffset) < 0) {\n      minOffset = newOffset;\n    }\n    if (maxBatchId < newOffset.largestBatchId) {\n      maxBatchId = newOffset.largestBatchId;\n    }\n  }\n  return new IndexOffset(minOffset.readTime, minOffset.documentKey, maxBatchId);\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ListenSequenceNumber, TargetId } from '../core/types';\nimport { SortedMap } from '../util/sorted_map';\n\nimport { PersistencePromise } from './persistence_promise';\nimport { PersistenceTransaction } from './persistence_transaction';\nimport { TargetData } from './target_data';\n\n/**\n * Describes a map whose keys are active target ids. We do not care about the type of the\n * values.\n */\nexport type ActiveTargets = SortedMap<TargetId, unknown>;\n\nexport const GC_DID_NOT_RUN: LruResults = {\n  didRun: false,\n  sequenceNumbersCollected: 0,\n  targetsRemoved: 0,\n  documentsRemoved: 0\n};\n\nexport const LRU_COLLECTION_DISABLED = -1;\nexport const LRU_DEFAULT_CACHE_SIZE_BYTES = 40 * 1024 * 1024;\n\nexport class LruParams {\n  private static readonly DEFAULT_COLLECTION_PERCENTILE = 10;\n  private static readonly DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1000;\n\n  static withCacheSize(cacheSize: number): LruParams {\n    return new LruParams(\n      cacheSize,\n      LruParams.DEFAULT_COLLECTION_PERCENTILE,\n      LruParams.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT\n    );\n  }\n\n  static readonly DEFAULT: LruParams = new LruParams(\n    LRU_DEFAULT_CACHE_SIZE_BYTES,\n    LruParams.DEFAULT_COLLECTION_PERCENTILE,\n    LruParams.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT\n  );\n\n  static readonly DISABLED: LruParams = new LruParams(\n    LRU_COLLECTION_DISABLED,\n    0,\n    0\n  );\n\n  constructor(\n    // When we attempt to collect, we will only do so if the cache size is greater than this\n    // threshold. Passing `COLLECTION_DISABLED` here will cause collection to always be skipped.\n    readonly cacheSizeCollectionThreshold: number,\n    // The percentage of sequence numbers that we will attempt to collect\n    readonly percentileToCollect: number,\n    // A cap on the total number of sequence numbers that will be collected. This prevents\n    // us from collecting a huge number of sequence numbers if the cache has grown very large.\n    readonly maximumSequenceNumbersToCollect: number\n  ) {}\n}\n\nexport interface LruGarbageCollector {\n  readonly params: LruParams;\n\n  collect(\n    txn: PersistenceTransaction,\n    activeTargetIds: ActiveTargets\n  ): PersistencePromise<LruResults>;\n\n  /** Given a percentile of target to collect, returns the number of targets to collect. */\n  calculateTargetCount(\n    txn: PersistenceTransaction,\n    percentile: number\n  ): PersistencePromise<number>;\n\n  /** Returns the nth sequence number, counting in order from the smallest. */\n  nthSequenceNumber(\n    txn: PersistenceTransaction,\n    n: number\n  ): PersistencePromise<number>;\n\n  /**\n   * Removes documents that have a sequence number equal to or less than the\n   * upper bound and are not otherwise pinned.\n   */\n  removeOrphanedDocuments(\n    txn: PersistenceTransaction,\n    upperBound: ListenSequenceNumber\n  ): PersistencePromise<number>;\n\n  getCacheSize(txn: PersistenceTransaction): PersistencePromise<number>;\n\n  /**\n   * Removes targets with a sequence number equal to or less than the given\n   * upper bound, and removes document associations with those targets.\n   */\n  removeTargets(\n    txn: PersistenceTransaction,\n    upperBound: ListenSequenceNumber,\n    activeTargetIds: ActiveTargets\n  ): PersistencePromise<number>;\n}\n\n/**\n * Describes the results of a garbage collection run. `didRun` will be set to\n * `false` if collection was skipped (either it is disabled or the cache size\n * has not hit the threshold). If collection ran, the other fields will be\n * filled in with the details of the results.\n */\nexport interface LruResults {\n  readonly didRun: boolean;\n  readonly sequenceNumbersCollected: number;\n  readonly targetsRemoved: number;\n  readonly documentsRemoved: number;\n}\n\n/**\n * Persistence layers intending to use LRU Garbage collection should have\n * reference delegates that implement this interface. This interface defines the\n * operations that the LRU garbage collector needs from the persistence layer.\n */\nexport interface LruDelegate {\n  readonly garbageCollector: LruGarbageCollector;\n\n  /** Enumerates all the targets in the TargetCache. */\n  forEachTarget(\n    txn: PersistenceTransaction,\n    f: (target: TargetData) => void\n  ): PersistencePromise<void>;\n\n  getSequenceNumberCount(\n    txn: PersistenceTransaction\n  ): PersistencePromise<number>;\n\n  /**\n   * Enumerates sequence numbers for documents not associated with a target.\n   * Note that this may include duplicate sequence numbers.\n   */\n  forEachOrphanedDocumentSequenceNumber(\n    txn: PersistenceTransaction,\n    f: (sequenceNumber: ListenSequenceNumber) => void\n  ): PersistencePromise<void>;\n\n  /**\n   * Removes all targets that have a sequence number less than or equal to\n   * `upperBound`, and are not present in the `activeTargetIds` set.\n   *\n   * @returns the number of targets removed.\n   */\n  removeTargets(\n    txn: PersistenceTransaction,\n    upperBound: ListenSequenceNumber,\n    activeTargetIds: ActiveTargets\n  ): PersistencePromise<number>;\n\n  /**\n   * Removes all unreferenced documents from the cache that have a sequence\n   * number less than or equal to the given `upperBound`.\n   *\n   * @returns the number of documents removed.\n   */\n  removeOrphanedDocuments(\n    txn: PersistenceTransaction,\n    upperBound: ListenSequenceNumber\n  ): PersistencePromise<number>;\n\n  getCacheSize(txn: PersistenceTransaction): PersistencePromise<number>;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DocumentKey } from '../model/document_key';\nimport { fail, hardAssert } from '../util/assert';\n\nimport {\n  DbDocumentMutation,\n  DbMutationBatch,\n  DbRemoteDocument\n} from './indexeddb_schema';\nimport { DbRemoteDocument as DbRemoteDocumentLegacy } from './indexeddb_schema_legacy';\nimport {\n  DbDocumentMutationKey,\n  DbDocumentMutationStore,\n  DbMutationBatchKey,\n  DbMutationBatchStore,\n  newDbDocumentMutationKey\n} from './indexeddb_sentinels';\nimport { PersistencePromise } from './persistence_promise';\nimport { SimpleDbTransaction } from './simple_db';\n\n/**\n * Delete a mutation batch and the associated document mutations.\n * @returns A PersistencePromise of the document mutations that were removed.\n */\nexport function removeMutationBatch(\n  txn: SimpleDbTransaction,\n  userId: string,\n  batch: { batchId: number; mutations: Array<{ key: DocumentKey }> }\n): PersistencePromise<DocumentKey[]> {\n  const mutationStore = txn.store<DbMutationBatchKey, DbMutationBatch>(\n    DbMutationBatchStore\n  );\n  const indexTxn = txn.store<DbDocumentMutationKey, DbDocumentMutation>(\n    DbDocumentMutationStore\n  );\n  const promises: Array<PersistencePromise<void>> = [];\n\n  const range = IDBKeyRange.only(batch.batchId);\n  let numDeleted = 0;\n  const removePromise = mutationStore.iterate(\n    { range },\n    (key, value, control) => {\n      numDeleted++;\n      return control.delete();\n    }\n  );\n  promises.push(\n    removePromise.next(() => {\n      hardAssert(\n        numDeleted === 1,\n        'Dangling document-mutation reference found: Missing batch ' +\n          batch.batchId\n      );\n    })\n  );\n  const removedDocuments: DocumentKey[] = [];\n  for (const mutation of batch.mutations) {\n    const indexKey = newDbDocumentMutationKey(\n      userId,\n      mutation.key.path,\n      batch.batchId\n    );\n    promises.push(indexTxn.delete(indexKey));\n    removedDocuments.push(mutation.key);\n  }\n  return PersistencePromise.waitFor(promises).next(() => removedDocuments);\n}\n\n/**\n * Returns an approximate size for the given document.\n */\nexport function dbDocumentSize(\n  doc: DbRemoteDocument | DbRemoteDocumentLegacy | null\n): number {\n  if (!doc) {\n    return 0;\n  }\n\n  let value: unknown;\n  if (doc.document) {\n    value = doc.document;\n  } else if (doc.unknownDocument) {\n    value = doc.unknownDocument;\n  } else if (doc.noDocument) {\n    value = doc.noDocument;\n  } else {\n    throw fail('Unknown remote document type');\n  }\n  return JSON.stringify(value).length;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { User } from '../auth/user';\nimport { isCollectionGroupQuery, isDocumentQuery, Query } from '../core/query';\nimport { BatchId } from '../core/types';\nimport { Timestamp } from '../lite-api/timestamp';\nimport { DocumentKeySet } from '../model/collections';\nimport { DocumentKey } from '../model/document_key';\nimport { Mutation } from '../model/mutation';\nimport { MutationBatch } from '../model/mutation_batch';\nimport { ResourcePath } from '../model/path';\nimport { debugAssert, fail, hardAssert } from '../util/assert';\nimport { primitiveComparator } from '../util/misc';\nimport { SortedMap } from '../util/sorted_map';\nimport { SortedSet } from '../util/sorted_set';\nimport { BATCHID_UNKNOWN } from '../util/types';\n\nimport { decodeResourcePath } from './encoded_resource_path';\nimport { IndexManager } from './index_manager';\nimport { removeMutationBatch } from './indexeddb_mutation_batch_impl';\nimport {\n  DbDocumentMutation,\n  DbMutationBatch,\n  DbMutationQueue\n} from './indexeddb_schema';\nimport {\n  DbDocumentMutationKey,\n  DbDocumentMutationPlaceholder,\n  DbDocumentMutationStore,\n  DbMutationBatchKey,\n  DbMutationBatchStore,\n  DbMutationBatchUserMutationsIndex,\n  DbMutationQueueKey,\n  DbMutationQueueStore,\n  newDbDocumentMutationKey,\n  newDbDocumentMutationPrefixForPath,\n  newDbDocumentMutationPrefixForUser\n} from './indexeddb_sentinels';\nimport { IndexedDbTransaction, getStore } from './indexeddb_transaction';\nimport {\n  fromDbMutationBatch,\n  LocalSerializer,\n  toDbMutationBatch\n} from './local_serializer';\nimport { MutationQueue } from './mutation_queue';\nimport { ReferenceDelegate } from './persistence';\nimport { PersistencePromise } from './persistence_promise';\nimport { PersistenceTransaction } from './persistence_transaction';\nimport { SimpleDbStore } from './simple_db';\n\n/** A mutation queue for a specific user, backed by IndexedDB. */\nexport class IndexedDbMutationQueue implements MutationQueue {\n  /**\n   * Caches the document keys for pending mutation batches. If the mutation\n   * has been removed from IndexedDb, the cached value may continue to\n   * be used to retrieve the batch's document keys. To remove a cached value\n   * locally, `removeCachedMutationKeys()` should be invoked either directly\n   * or through `removeMutationBatches()`.\n   *\n   * With multi-tab, when the primary client acknowledges or rejects a mutation,\n   * this cache is used by secondary clients to invalidate the local\n   * view of the documents that were previously affected by the mutation.\n   */\n  // PORTING NOTE: Multi-tab only.\n  private documentKeysByBatchId = {} as { [batchId: number]: DocumentKeySet };\n\n  constructor(\n    /**\n     * The normalized userId (e.g. null UID => \"\" userId) used to store /\n     * retrieve mutations.\n     */\n    private userId: string,\n    private readonly serializer: LocalSerializer,\n    private readonly indexManager: IndexManager,\n    private readonly referenceDelegate: ReferenceDelegate\n  ) {}\n\n  /**\n   * Creates a new mutation queue for the given user.\n   * @param user - The user for which to create a mutation queue.\n   * @param serializer - The serializer to use when persisting to IndexedDb.\n   */\n  static forUser(\n    user: User,\n    serializer: LocalSerializer,\n    indexManager: IndexManager,\n    referenceDelegate: ReferenceDelegate\n  ): IndexedDbMutationQueue {\n    // TODO(mcg): Figure out what constraints there are on userIDs\n    // In particular, are there any reserved characters? are empty ids allowed?\n    // For the moment store these together in the same mutations table assuming\n    // that empty userIDs aren't allowed.\n    hardAssert(user.uid !== '', 'UserID must not be an empty string.');\n    const userId = user.isAuthenticated() ? user.uid! : '';\n    return new IndexedDbMutationQueue(\n      userId,\n      serializer,\n      indexManager,\n      referenceDelegate\n    );\n  }\n\n  checkEmpty(transaction: PersistenceTransaction): PersistencePromise<boolean> {\n    let empty = true;\n    const range = IDBKeyRange.bound(\n      [this.userId, Number.NEGATIVE_INFINITY],\n      [this.userId, Number.POSITIVE_INFINITY]\n    );\n    return mutationsStore(transaction)\n      .iterate(\n        { index: DbMutationBatchUserMutationsIndex, range },\n        (key, value, control) => {\n          empty = false;\n          control.done();\n        }\n      )\n      .next(() => empty);\n  }\n\n  addMutationBatch(\n    transaction: PersistenceTransaction,\n    localWriteTime: Timestamp,\n    baseMutations: Mutation[],\n    mutations: Mutation[]\n  ): PersistencePromise<MutationBatch> {\n    const documentStore = documentMutationsStore(transaction);\n    const mutationStore = mutationsStore(transaction);\n\n    // The IndexedDb implementation in Chrome (and Firefox) does not handle\n    // compound indices that include auto-generated keys correctly. To ensure\n    // that the index entry is added correctly in all browsers, we perform two\n    // writes: The first write is used to retrieve the next auto-generated Batch\n    // ID, and the second write populates the index and stores the actual\n    // mutation batch.\n    // See: https://bugs.chromium.org/p/chromium/issues/detail?id=701972\n\n    // We write an empty object to obtain key\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    return mutationStore.add({} as any).next(batchId => {\n      hardAssert(\n        typeof batchId === 'number',\n        'Auto-generated key is not a number'\n      );\n\n      const batch = new MutationBatch(\n        batchId,\n        localWriteTime,\n        baseMutations,\n        mutations\n      );\n      const dbBatch = toDbMutationBatch(this.serializer, this.userId, batch);\n\n      const promises: Array<PersistencePromise<void>> = [];\n      let collectionParents = new SortedSet<ResourcePath>((l, r) =>\n        primitiveComparator(l.canonicalString(), r.canonicalString())\n      );\n      for (const mutation of mutations) {\n        const indexKey = newDbDocumentMutationKey(\n          this.userId,\n          mutation.key.path,\n          batchId\n        );\n        collectionParents = collectionParents.add(mutation.key.path.popLast());\n        promises.push(mutationStore.put(dbBatch));\n        promises.push(\n          documentStore.put(indexKey, DbDocumentMutationPlaceholder)\n        );\n      }\n\n      collectionParents.forEach(parent => {\n        promises.push(\n          this.indexManager.addToCollectionParentIndex(transaction, parent)\n        );\n      });\n\n      transaction.addOnCommittedListener(() => {\n        this.documentKeysByBatchId[batchId] = batch.keys();\n      });\n\n      return PersistencePromise.waitFor(promises).next(() => batch);\n    });\n  }\n\n  lookupMutationBatch(\n    transaction: PersistenceTransaction,\n    batchId: BatchId\n  ): PersistencePromise<MutationBatch | null> {\n    return mutationsStore(transaction)\n      .get(batchId)\n      .next(dbBatch => {\n        if (dbBatch) {\n          hardAssert(\n            dbBatch.userId === this.userId,\n            `Unexpected user '${dbBatch.userId}' for mutation batch ${batchId}`\n          );\n          return fromDbMutationBatch(this.serializer, dbBatch);\n        }\n        return null;\n      });\n  }\n\n  /**\n   * Returns the document keys for the mutation batch with the given batchId.\n   * For primary clients, this method returns `null` after\n   * `removeMutationBatches()` has been called. Secondary clients return a\n   * cached result until `removeCachedMutationKeys()` is invoked.\n   */\n  // PORTING NOTE: Multi-tab only.\n  lookupMutationKeys(\n    transaction: PersistenceTransaction,\n    batchId: BatchId\n  ): PersistencePromise<DocumentKeySet | null> {\n    if (this.documentKeysByBatchId[batchId]) {\n      return PersistencePromise.resolve<DocumentKeySet | null>(\n        this.documentKeysByBatchId[batchId]\n      );\n    } else {\n      return this.lookupMutationBatch(transaction, batchId).next(batch => {\n        if (batch) {\n          const keys = batch.keys();\n          this.documentKeysByBatchId[batchId] = keys;\n          return keys;\n        } else {\n          return null;\n        }\n      });\n    }\n  }\n\n  getNextMutationBatchAfterBatchId(\n    transaction: PersistenceTransaction,\n    batchId: BatchId\n  ): PersistencePromise<MutationBatch | null> {\n    const nextBatchId = batchId + 1;\n\n    const range = IDBKeyRange.lowerBound([this.userId, nextBatchId]);\n    let foundBatch: MutationBatch | null = null;\n    return mutationsStore(transaction)\n      .iterate(\n        { index: DbMutationBatchUserMutationsIndex, range },\n        (key, dbBatch, control) => {\n          if (dbBatch.userId === this.userId) {\n            hardAssert(\n              dbBatch.batchId >= nextBatchId,\n              'Should have found mutation after ' + nextBatchId\n            );\n            foundBatch = fromDbMutationBatch(this.serializer, dbBatch);\n          }\n          control.done();\n        }\n      )\n      .next(() => foundBatch);\n  }\n\n  getHighestUnacknowledgedBatchId(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<BatchId> {\n    const range = IDBKeyRange.upperBound([\n      this.userId,\n      Number.POSITIVE_INFINITY\n    ]);\n\n    let batchId = BATCHID_UNKNOWN;\n    return mutationsStore(transaction)\n      .iterate(\n        { index: DbMutationBatchUserMutationsIndex, range, reverse: true },\n        (key, dbBatch, control) => {\n          batchId = dbBatch.batchId;\n          control.done();\n        }\n      )\n      .next(() => batchId);\n  }\n\n  getAllMutationBatches(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<MutationBatch[]> {\n    const range = IDBKeyRange.bound(\n      [this.userId, BATCHID_UNKNOWN],\n      [this.userId, Number.POSITIVE_INFINITY]\n    );\n    return mutationsStore(transaction)\n      .loadAll(DbMutationBatchUserMutationsIndex, range)\n      .next(dbBatches =>\n        dbBatches.map(dbBatch => fromDbMutationBatch(this.serializer, dbBatch))\n      );\n  }\n\n  getAllMutationBatchesAffectingDocumentKey(\n    transaction: PersistenceTransaction,\n    documentKey: DocumentKey\n  ): PersistencePromise<MutationBatch[]> {\n    // Scan the document-mutation index starting with a prefix starting with\n    // the given documentKey.\n    const indexPrefix = newDbDocumentMutationPrefixForPath(\n      this.userId,\n      documentKey.path\n    );\n    const indexStart = IDBKeyRange.lowerBound(indexPrefix);\n\n    const results: MutationBatch[] = [];\n    return documentMutationsStore(transaction)\n      .iterate({ range: indexStart }, (indexKey, _, control) => {\n        const [userID, encodedPath, batchId] = indexKey;\n\n        // Only consider rows matching exactly the specific key of\n        // interest. Note that because we order by path first, and we\n        // order terminators before path separators, we'll encounter all\n        // the index rows for documentKey contiguously. In particular, all\n        // the rows for documentKey will occur before any rows for\n        // documents nested in a subcollection beneath documentKey so we\n        // can stop as soon as we hit any such row.\n        const path = decodeResourcePath(encodedPath);\n        if (userID !== this.userId || !documentKey.path.isEqual(path)) {\n          control.done();\n          return;\n        }\n        // Look up the mutation batch in the store.\n        return mutationsStore(transaction)\n          .get(batchId)\n          .next(mutation => {\n            if (!mutation) {\n              throw fail(\n                'Dangling document-mutation reference found: ' +\n                  indexKey +\n                  ' which points to ' +\n                  batchId\n              );\n            }\n            hardAssert(\n              mutation.userId === this.userId,\n              `Unexpected user '${mutation.userId}' for mutation batch ${batchId}`\n            );\n            results.push(fromDbMutationBatch(this.serializer, mutation));\n          });\n      })\n      .next(() => results);\n  }\n\n  getAllMutationBatchesAffectingDocumentKeys(\n    transaction: PersistenceTransaction,\n    documentKeys: SortedMap<DocumentKey, unknown>\n  ): PersistencePromise<MutationBatch[]> {\n    let uniqueBatchIDs = new SortedSet<BatchId>(primitiveComparator);\n\n    const promises: Array<PersistencePromise<void>> = [];\n    documentKeys.forEach(documentKey => {\n      const indexStart = newDbDocumentMutationPrefixForPath(\n        this.userId,\n        documentKey.path\n      );\n      const range = IDBKeyRange.lowerBound(indexStart);\n\n      const promise = documentMutationsStore(transaction).iterate(\n        { range },\n        (indexKey, _, control) => {\n          const [userID, encodedPath, batchID] = indexKey;\n\n          // Only consider rows matching exactly the specific key of\n          // interest. Note that because we order by path first, and we\n          // order terminators before path separators, we'll encounter all\n          // the index rows for documentKey contiguously. In particular, all\n          // the rows for documentKey will occur before any rows for\n          // documents nested in a subcollection beneath documentKey so we\n          // can stop as soon as we hit any such row.\n          const path = decodeResourcePath(encodedPath);\n          if (userID !== this.userId || !documentKey.path.isEqual(path)) {\n            control.done();\n            return;\n          }\n\n          uniqueBatchIDs = uniqueBatchIDs.add(batchID);\n        }\n      );\n\n      promises.push(promise);\n    });\n\n    return PersistencePromise.waitFor(promises).next(() =>\n      this.lookupMutationBatches(transaction, uniqueBatchIDs)\n    );\n  }\n\n  getAllMutationBatchesAffectingQuery(\n    transaction: PersistenceTransaction,\n    query: Query\n  ): PersistencePromise<MutationBatch[]> {\n    debugAssert(\n      !isDocumentQuery(query),\n      \"Document queries shouldn't go down this path\"\n    );\n    debugAssert(\n      !isCollectionGroupQuery(query),\n      'CollectionGroup queries should be handled in LocalDocumentsView'\n    );\n\n    const queryPath = query.path;\n    const immediateChildrenLength = queryPath.length + 1;\n\n    // TODO(mcg): Actually implement a single-collection query\n    //\n    // This is actually executing an ancestor query, traversing the whole\n    // subtree below the collection which can be horrifically inefficient for\n    // some structures. The right way to solve this is to implement the full\n    // value index, but that's not in the cards in the near future so this is\n    // the best we can do for the moment.\n    //\n    // Since we don't yet index the actual properties in the mutations, our\n    // current approach is to just return all mutation batches that affect\n    // documents in the collection being queried.\n    const indexPrefix = newDbDocumentMutationPrefixForPath(\n      this.userId,\n      queryPath\n    );\n    const indexStart = IDBKeyRange.lowerBound(indexPrefix);\n\n    // Collect up unique batchIDs encountered during a scan of the index. Use a\n    // SortedSet to accumulate batch IDs so they can be traversed in order in a\n    // scan of the main table.\n    let uniqueBatchIDs = new SortedSet<BatchId>(primitiveComparator);\n    return documentMutationsStore(transaction)\n      .iterate({ range: indexStart }, (indexKey, _, control) => {\n        const [userID, encodedPath, batchID] = indexKey;\n        const path = decodeResourcePath(encodedPath);\n        if (userID !== this.userId || !queryPath.isPrefixOf(path)) {\n          control.done();\n          return;\n        }\n        // Rows with document keys more than one segment longer than the\n        // query path can't be matches. For example, a query on 'rooms'\n        // can't match the document /rooms/abc/messages/xyx.\n        // TODO(mcg): we'll need a different scanner when we implement\n        // ancestor queries.\n        if (path.length !== immediateChildrenLength) {\n          return;\n        }\n        uniqueBatchIDs = uniqueBatchIDs.add(batchID);\n      })\n      .next(() => this.lookupMutationBatches(transaction, uniqueBatchIDs));\n  }\n\n  private lookupMutationBatches(\n    transaction: PersistenceTransaction,\n    batchIDs: SortedSet<BatchId>\n  ): PersistencePromise<MutationBatch[]> {\n    const results: MutationBatch[] = [];\n    const promises: Array<PersistencePromise<void>> = [];\n    // TODO(rockwood): Implement this using iterate.\n    batchIDs.forEach(batchId => {\n      promises.push(\n        mutationsStore(transaction)\n          .get(batchId)\n          .next(mutation => {\n            if (mutation === null) {\n              throw fail(\n                'Dangling document-mutation reference found, ' +\n                  'which points to ' +\n                  batchId\n              );\n            }\n            hardAssert(\n              mutation.userId === this.userId,\n              `Unexpected user '${mutation.userId}' for mutation batch ${batchId}`\n            );\n            results.push(fromDbMutationBatch(this.serializer, mutation));\n          })\n      );\n    });\n    return PersistencePromise.waitFor(promises).next(() => results);\n  }\n\n  removeMutationBatch(\n    transaction: PersistenceTransaction,\n    batch: MutationBatch\n  ): PersistencePromise<void> {\n    return removeMutationBatch(\n      (transaction as IndexedDbTransaction).simpleDbTransaction,\n      this.userId,\n      batch\n    ).next(removedDocuments => {\n      transaction.addOnCommittedListener(() => {\n        this.removeCachedMutationKeys(batch.batchId);\n      });\n      return PersistencePromise.forEach(\n        removedDocuments,\n        (key: DocumentKey) => {\n          return this.referenceDelegate.markPotentiallyOrphaned(\n            transaction,\n            key\n          );\n        }\n      );\n    });\n  }\n\n  /**\n   * Clears the cached keys for a mutation batch. This method should be\n   * called by secondary clients after they process mutation updates.\n   *\n   * Note that this method does not have to be called from primary clients as\n   * the corresponding cache entries are cleared when an acknowledged or\n   * rejected batch is removed from the mutation queue.\n   */\n  // PORTING NOTE: Multi-tab only\n  removeCachedMutationKeys(batchId: BatchId): void {\n    delete this.documentKeysByBatchId[batchId];\n  }\n\n  performConsistencyCheck(\n    txn: PersistenceTransaction\n  ): PersistencePromise<void> {\n    return this.checkEmpty(txn).next(empty => {\n      if (!empty) {\n        return PersistencePromise.resolve();\n      }\n\n      // Verify that there are no entries in the documentMutations index if\n      // the queue is empty.\n      const startRange = IDBKeyRange.lowerBound(\n        newDbDocumentMutationPrefixForUser(this.userId)\n      );\n      const danglingMutationReferences: ResourcePath[] = [];\n      return documentMutationsStore(txn)\n        .iterate({ range: startRange }, (key, _, control) => {\n          const userID = key[0];\n          if (userID !== this.userId) {\n            control.done();\n            return;\n          } else {\n            const path = decodeResourcePath(key[1]);\n            danglingMutationReferences.push(path);\n          }\n        })\n        .next(() => {\n          hardAssert(\n            danglingMutationReferences.length === 0,\n            'Document leak -- detected dangling mutation references when queue is empty. ' +\n              'Dangling keys: ' +\n              danglingMutationReferences.map(p => p.canonicalString())\n          );\n        });\n    });\n  }\n\n  containsKey(\n    txn: PersistenceTransaction,\n    key: DocumentKey\n  ): PersistencePromise<boolean> {\n    return mutationQueueContainsKey(txn, this.userId, key);\n  }\n\n  // PORTING NOTE: Multi-tab only (state is held in memory in other clients).\n  /** Returns the mutation queue's metadata from IndexedDb. */\n  private getMutationQueueMetadata(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<DbMutationQueue> {\n    return mutationQueuesStore(transaction)\n      .get(this.userId)\n      .next((metadata: DbMutationQueue | null) => {\n        return (\n          metadata || {\n            userId: this.userId,\n            lastAcknowledgedBatchId: BATCHID_UNKNOWN,\n            lastStreamToken: ''\n          }\n        );\n      });\n  }\n}\n\n/**\n * @returns true if the mutation queue for the given user contains a pending\n *         mutation for the given key.\n */\nfunction mutationQueueContainsKey(\n  txn: PersistenceTransaction,\n  userId: string,\n  key: DocumentKey\n): PersistencePromise<boolean> {\n  const indexKey = newDbDocumentMutationPrefixForPath(userId, key.path);\n  const encodedPath = indexKey[1];\n  const startRange = IDBKeyRange.lowerBound(indexKey);\n  let containsKey = false;\n  return documentMutationsStore(txn)\n    .iterate({ range: startRange, keysOnly: true }, (key, value, control) => {\n      const [userID, keyPath, /*batchID*/ _] = key;\n      if (userID === userId && keyPath === encodedPath) {\n        containsKey = true;\n      }\n      control.done();\n    })\n    .next(() => containsKey);\n}\n\n/** Returns true if any mutation queue contains the given document. */\nexport function mutationQueuesContainKey(\n  txn: PersistenceTransaction,\n  docKey: DocumentKey\n): PersistencePromise<boolean> {\n  let found = false;\n  return mutationQueuesStore(txn)\n    .iterateSerial(userId => {\n      return mutationQueueContainsKey(txn, userId, docKey).next(containsKey => {\n        if (containsKey) {\n          found = true;\n        }\n        return PersistencePromise.resolve(!containsKey);\n      });\n    })\n    .next(() => found);\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the mutations object store.\n */\nfunction mutationsStore(\n  txn: PersistenceTransaction\n): SimpleDbStore<DbMutationBatchKey, DbMutationBatch> {\n  return getStore<DbMutationBatchKey, DbMutationBatch>(\n    txn,\n    DbMutationBatchStore\n  );\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\n */\nfunction documentMutationsStore(\n  txn: PersistenceTransaction\n): SimpleDbStore<DbDocumentMutationKey, DbDocumentMutation> {\n  return getStore<DbDocumentMutationKey, DbDocumentMutation>(\n    txn,\n    DbDocumentMutationStore\n  );\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the mutationQueues object store.\n */\nfunction mutationQueuesStore(\n  txn: PersistenceTransaction\n): SimpleDbStore<DbMutationQueueKey, DbMutationQueue> {\n  return getStore<DbMutationQueueKey, DbMutationQueue>(\n    txn,\n    DbMutationQueueStore\n  );\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TargetId } from './types';\n\n/** Offset to ensure non-overlapping target ids. */\nconst OFFSET = 2;\n\n/**\n * Generates monotonically increasing target IDs for sending targets to the\n * watch stream.\n *\n * The client constructs two generators, one for the target cache, and one for\n * for the sync engine (to generate limbo documents targets). These\n * generators produce non-overlapping IDs (by using even and odd IDs\n * respectively).\n *\n * By separating the target ID space, the query cache can generate target IDs\n * that persist across client restarts, while sync engine can independently\n * generate in-memory target IDs that are transient and can be reused after a\n * restart.\n */\nexport class TargetIdGenerator {\n  constructor(private lastId: number) {}\n\n  next(): TargetId {\n    this.lastId += OFFSET;\n    return this.lastId;\n  }\n\n  static forTargetCache(): TargetIdGenerator {\n    // The target cache generator must return '2' in its first call to `next()`\n    // as there is no differentiation in the protocol layer between an unset\n    // number and the number '0'. If we were to sent a target with target ID\n    // '0', the backend would consider it unset and replace it with its own ID.\n    return new TargetIdGenerator(2 - OFFSET);\n  }\n\n  static forSyncEngine(): TargetIdGenerator {\n    // Sync engine assigns target IDs for limbo document detection.\n    return new TargetIdGenerator(1 - OFFSET);\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport { canonifyTarget, Target, targetEquals } from '../core/target';\nimport { TargetIdGenerator } from '../core/target_id_generator';\nimport { ListenSequenceNumber, TargetId } from '../core/types';\nimport { Timestamp } from '../lite-api/timestamp';\nimport { DocumentKeySet, documentKeySet } from '../model/collections';\nimport { DocumentKey } from '../model/document_key';\nimport { hardAssert } from '../util/assert';\nimport { immediateSuccessor } from '../util/misc';\n\nimport {\n  decodeResourcePath,\n  encodeResourcePath\n} from './encoded_resource_path';\nimport { IndexedDbLruDelegate } from './indexeddb_lru_delegate';\nimport { DbTarget, DbTargetDocument, DbTargetGlobal } from './indexeddb_schema';\nimport {\n  DbTargetDocumentDocumentTargetsIndex,\n  DbTargetDocumentKey,\n  DbTargetDocumentStore,\n  DbTargetGlobalKey,\n  DbTargetGlobalStore,\n  DbTargetKey,\n  DbTargetQueryTargetsIndexName,\n  DbTargetStore\n} from './indexeddb_sentinels';\nimport { getStore } from './indexeddb_transaction';\nimport { fromDbTarget, LocalSerializer, toDbTarget } from './local_serializer';\nimport { ActiveTargets } from './lru_garbage_collector';\nimport { PersistencePromise } from './persistence_promise';\nimport { PersistenceTransaction } from './persistence_transaction';\nimport { SimpleDbStore } from './simple_db';\nimport { TargetCache } from './target_cache';\nimport { TargetData } from './target_data';\n\nexport class IndexedDbTargetCache implements TargetCache {\n  constructor(\n    private readonly referenceDelegate: IndexedDbLruDelegate,\n    private serializer: LocalSerializer\n  ) {}\n\n  // PORTING NOTE: We don't cache global metadata for the target cache, since\n  // some of it (in particular `highestTargetId`) can be modified by secondary\n  // tabs. We could perhaps be more granular (and e.g. still cache\n  // `lastRemoteSnapshotVersion` in memory) but for simplicity we currently go\n  // to IndexedDb whenever we need to read metadata. We can revisit if it turns\n  // out to have a meaningful performance impact.\n\n  allocateTargetId(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<TargetId> {\n    return this.retrieveMetadata(transaction).next(metadata => {\n      const targetIdGenerator = new TargetIdGenerator(metadata.highestTargetId);\n      metadata.highestTargetId = targetIdGenerator.next();\n      return this.saveMetadata(transaction, metadata).next(\n        () => metadata.highestTargetId\n      );\n    });\n  }\n\n  getLastRemoteSnapshotVersion(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<SnapshotVersion> {\n    return this.retrieveMetadata(transaction).next(metadata => {\n      return SnapshotVersion.fromTimestamp(\n        new Timestamp(\n          metadata.lastRemoteSnapshotVersion.seconds,\n          metadata.lastRemoteSnapshotVersion.nanoseconds\n        )\n      );\n    });\n  }\n\n  getHighestSequenceNumber(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<ListenSequenceNumber> {\n    return this.retrieveMetadata(transaction).next(\n      targetGlobal => targetGlobal.highestListenSequenceNumber\n    );\n  }\n\n  setTargetsMetadata(\n    transaction: PersistenceTransaction,\n    highestListenSequenceNumber: number,\n    lastRemoteSnapshotVersion?: SnapshotVersion\n  ): PersistencePromise<void> {\n    return this.retrieveMetadata(transaction).next(metadata => {\n      metadata.highestListenSequenceNumber = highestListenSequenceNumber;\n      if (lastRemoteSnapshotVersion) {\n        metadata.lastRemoteSnapshotVersion =\n          lastRemoteSnapshotVersion.toTimestamp();\n      }\n      if (highestListenSequenceNumber > metadata.highestListenSequenceNumber) {\n        metadata.highestListenSequenceNumber = highestListenSequenceNumber;\n      }\n      return this.saveMetadata(transaction, metadata);\n    });\n  }\n\n  addTargetData(\n    transaction: PersistenceTransaction,\n    targetData: TargetData\n  ): PersistencePromise<void> {\n    return this.saveTargetData(transaction, targetData).next(() => {\n      return this.retrieveMetadata(transaction).next(metadata => {\n        metadata.targetCount += 1;\n        this.updateMetadataFromTargetData(targetData, metadata);\n        return this.saveMetadata(transaction, metadata);\n      });\n    });\n  }\n\n  updateTargetData(\n    transaction: PersistenceTransaction,\n    targetData: TargetData\n  ): PersistencePromise<void> {\n    return this.saveTargetData(transaction, targetData);\n  }\n\n  removeTargetData(\n    transaction: PersistenceTransaction,\n    targetData: TargetData\n  ): PersistencePromise<void> {\n    return this.removeMatchingKeysForTargetId(transaction, targetData.targetId)\n      .next(() => targetsStore(transaction).delete(targetData.targetId))\n      .next(() => this.retrieveMetadata(transaction))\n      .next(metadata => {\n        hardAssert(\n          metadata.targetCount > 0,\n          'Removing from an empty target cache'\n        );\n        metadata.targetCount -= 1;\n        return this.saveMetadata(transaction, metadata);\n      });\n  }\n\n  /**\n   * Drops any targets with sequence number less than or equal to the upper bound, excepting those\n   * present in `activeTargetIds`. Document associations for the removed targets are also removed.\n   * Returns the number of targets removed.\n   */\n  removeTargets(\n    txn: PersistenceTransaction,\n    upperBound: ListenSequenceNumber,\n    activeTargetIds: ActiveTargets\n  ): PersistencePromise<number> {\n    let count = 0;\n    const promises: Array<PersistencePromise<void>> = [];\n    return targetsStore(txn)\n      .iterate((key, value) => {\n        const targetData = fromDbTarget(value);\n        if (\n          targetData.sequenceNumber <= upperBound &&\n          activeTargetIds.get(targetData.targetId) === null\n        ) {\n          count++;\n          promises.push(this.removeTargetData(txn, targetData));\n        }\n      })\n      .next(() => PersistencePromise.waitFor(promises))\n      .next(() => count);\n  }\n\n  /**\n   * Call provided function with each `TargetData` that we have cached.\n   */\n  forEachTarget(\n    txn: PersistenceTransaction,\n    f: (q: TargetData) => void\n  ): PersistencePromise<void> {\n    return targetsStore(txn).iterate((key, value) => {\n      const targetData = fromDbTarget(value);\n      f(targetData);\n    });\n  }\n\n  private retrieveMetadata(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<DbTargetGlobal> {\n    return globalTargetStore(transaction)\n      .get(DbTargetGlobalKey)\n      .next(metadata => {\n        hardAssert(metadata !== null, 'Missing metadata row.');\n        return metadata;\n      });\n  }\n\n  private saveMetadata(\n    transaction: PersistenceTransaction,\n    metadata: DbTargetGlobal\n  ): PersistencePromise<void> {\n    return globalTargetStore(transaction).put(DbTargetGlobalKey, metadata);\n  }\n\n  private saveTargetData(\n    transaction: PersistenceTransaction,\n    targetData: TargetData\n  ): PersistencePromise<void> {\n    return targetsStore(transaction).put(\n      toDbTarget(this.serializer, targetData)\n    );\n  }\n\n  /**\n   * In-place updates the provided metadata to account for values in the given\n   * TargetData. Saving is done separately. Returns true if there were any\n   * changes to the metadata.\n   */\n  private updateMetadataFromTargetData(\n    targetData: TargetData,\n    metadata: DbTargetGlobal\n  ): boolean {\n    let updated = false;\n    if (targetData.targetId > metadata.highestTargetId) {\n      metadata.highestTargetId = targetData.targetId;\n      updated = true;\n    }\n\n    if (targetData.sequenceNumber > metadata.highestListenSequenceNumber) {\n      metadata.highestListenSequenceNumber = targetData.sequenceNumber;\n      updated = true;\n    }\n    return updated;\n  }\n\n  getTargetCount(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<number> {\n    return this.retrieveMetadata(transaction).next(\n      metadata => metadata.targetCount\n    );\n  }\n\n  getTargetData(\n    transaction: PersistenceTransaction,\n    target: Target\n  ): PersistencePromise<TargetData | null> {\n    // Iterating by the canonicalId may yield more than one result because\n    // canonicalId values are not required to be unique per target. This query\n    // depends on the queryTargets index to be efficient.\n    const canonicalId = canonifyTarget(target);\n    const range = IDBKeyRange.bound(\n      [canonicalId, Number.NEGATIVE_INFINITY],\n      [canonicalId, Number.POSITIVE_INFINITY]\n    );\n    let result: TargetData | null = null;\n    return targetsStore(transaction)\n      .iterate(\n        { range, index: DbTargetQueryTargetsIndexName },\n        (key, value, control) => {\n          const found = fromDbTarget(value);\n          // After finding a potential match, check that the target is\n          // actually equal to the requested target.\n          if (targetEquals(target, found.target)) {\n            result = found;\n            control.done();\n          }\n        }\n      )\n      .next(() => result);\n  }\n\n  addMatchingKeys(\n    txn: PersistenceTransaction,\n    keys: DocumentKeySet,\n    targetId: TargetId\n  ): PersistencePromise<void> {\n    // PORTING NOTE: The reverse index (documentsTargets) is maintained by\n    // IndexedDb.\n    const promises: Array<PersistencePromise<void>> = [];\n    const store = documentTargetStore(txn);\n    keys.forEach(key => {\n      const path = encodeResourcePath(key.path);\n      promises.push(store.put({ targetId, path }));\n      promises.push(this.referenceDelegate.addReference(txn, targetId, key));\n    });\n    return PersistencePromise.waitFor(promises);\n  }\n\n  removeMatchingKeys(\n    txn: PersistenceTransaction,\n    keys: DocumentKeySet,\n    targetId: TargetId\n  ): PersistencePromise<void> {\n    // PORTING NOTE: The reverse index (documentsTargets) is maintained by\n    // IndexedDb.\n    const store = documentTargetStore(txn);\n    return PersistencePromise.forEach(keys, (key: DocumentKey) => {\n      const path = encodeResourcePath(key.path);\n      return PersistencePromise.waitFor([\n        store.delete([targetId, path]),\n        this.referenceDelegate.removeReference(txn, targetId, key)\n      ]);\n    });\n  }\n\n  removeMatchingKeysForTargetId(\n    txn: PersistenceTransaction,\n    targetId: TargetId\n  ): PersistencePromise<void> {\n    const store = documentTargetStore(txn);\n    const range = IDBKeyRange.bound(\n      [targetId],\n      [targetId + 1],\n      /*lowerOpen=*/ false,\n      /*upperOpen=*/ true\n    );\n    return store.delete(range);\n  }\n\n  getMatchingKeysForTargetId(\n    txn: PersistenceTransaction,\n    targetId: TargetId\n  ): PersistencePromise<DocumentKeySet> {\n    const range = IDBKeyRange.bound(\n      [targetId],\n      [targetId + 1],\n      /*lowerOpen=*/ false,\n      /*upperOpen=*/ true\n    );\n    const store = documentTargetStore(txn);\n    let result = documentKeySet();\n\n    return store\n      .iterate({ range, keysOnly: true }, (key, _, control) => {\n        const path = decodeResourcePath(key[1]);\n        const docKey = new DocumentKey(path);\n        result = result.add(docKey);\n      })\n      .next(() => result);\n  }\n\n  containsKey(\n    txn: PersistenceTransaction,\n    key: DocumentKey\n  ): PersistencePromise<boolean> {\n    const path = encodeResourcePath(key.path);\n    const range = IDBKeyRange.bound(\n      [path],\n      [immediateSuccessor(path)],\n      /*lowerOpen=*/ false,\n      /*upperOpen=*/ true\n    );\n    let count = 0;\n    return documentTargetStore(txn!)\n      .iterate(\n        {\n          index: DbTargetDocumentDocumentTargetsIndex,\n          keysOnly: true,\n          range\n        },\n        ([targetId, path], _, control) => {\n          // Having a sentinel row for a document does not count as containing that document;\n          // For the target cache, containing the document means the document is part of some\n          // target.\n          if (targetId !== 0) {\n            count++;\n            control.done();\n          }\n        }\n      )\n      .next(() => count > 0);\n  }\n\n  /**\n   * Looks up a TargetData entry by target ID.\n   *\n   * @param targetId - The target ID of the TargetData entry to look up.\n   * @returns The cached TargetData entry, or null if the cache has no entry for\n   * the target.\n   */\n  // PORTING NOTE: Multi-tab only.\n  getTargetDataForTarget(\n    transaction: PersistenceTransaction,\n    targetId: TargetId\n  ): PersistencePromise<TargetData | null> {\n    return targetsStore(transaction)\n      .get(targetId)\n      .next(found => {\n        if (found) {\n          return fromDbTarget(found);\n        } else {\n          return null;\n        }\n      });\n  }\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the queries object store.\n */\nfunction targetsStore(\n  txn: PersistenceTransaction\n): SimpleDbStore<DbTargetKey, DbTarget> {\n  return getStore<DbTargetKey, DbTarget>(txn, DbTargetStore);\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the target globals object store.\n */\nfunction globalTargetStore(\n  txn: PersistenceTransaction\n): SimpleDbStore<DbTargetGlobalKey, DbTargetGlobal> {\n  return getStore<DbTargetGlobalKey, DbTargetGlobal>(txn, DbTargetGlobalStore);\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the document target object store.\n */\nexport function documentTargetStore(\n  txn: PersistenceTransaction\n): SimpleDbStore<DbTargetDocumentKey, DbTargetDocument> {\n  return getStore<DbTargetDocumentKey, DbTargetDocument>(\n    txn,\n    DbTargetDocumentStore\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirestoreError } from '../api';\nimport { ListenSequence } from '../core/listen_sequence';\nimport { ListenSequenceNumber } from '../core/types';\nimport { debugAssert } from '../util/assert';\nimport { AsyncQueue, DelayedOperation, TimerId } from '../util/async_queue';\nimport { getLogLevel, logDebug, LogLevel } from '../util/log';\nimport { primitiveComparator } from '../util/misc';\nimport { SortedSet } from '../util/sorted_set';\n\nimport { ignoreIfPrimaryLeaseLoss, LocalStore } from './local_store';\nimport {\n  ActiveTargets,\n  GC_DID_NOT_RUN,\n  LRU_COLLECTION_DISABLED,\n  LruDelegate,\n  LruGarbageCollector,\n  LruParams,\n  LruResults\n} from './lru_garbage_collector';\nimport { Scheduler } from './persistence';\nimport { PersistencePromise } from './persistence_promise';\nimport { PersistenceTransaction } from './persistence_transaction';\nimport { isIndexedDbTransactionError } from './simple_db';\n\nconst LOG_TAG = 'LruGarbageCollector';\n\nexport const LRU_MINIMUM_CACHE_SIZE_BYTES = 1 * 1024 * 1024;\n\n/** How long we wait to try running LRU GC after SDK initialization. */\nconst INITIAL_GC_DELAY_MS = 1 * 60 * 1000;\n/** Minimum amount of time between GC checks, after the first one. */\nconst REGULAR_GC_DELAY_MS = 5 * 60 * 1000;\n\n// The type and comparator for the items contained in the SortedSet used in\n// place of a priority queue for the RollingSequenceNumberBuffer.\ntype BufferEntry = [ListenSequenceNumber, number];\n\nfunction bufferEntryComparator(\n  [aSequence, aIndex]: BufferEntry,\n  [bSequence, bIndex]: BufferEntry\n): number {\n  const seqCmp = primitiveComparator(aSequence, bSequence);\n  if (seqCmp === 0) {\n    // This order doesn't matter, but we can bias against churn by sorting\n    // entries created earlier as less than newer entries.\n    return primitiveComparator(aIndex, bIndex);\n  } else {\n    return seqCmp;\n  }\n}\n\n/**\n * Used to calculate the nth sequence number. Keeps a rolling buffer of the\n * lowest n values passed to `addElement`, and finally reports the largest of\n * them in `maxValue`.\n */\nclass RollingSequenceNumberBuffer {\n  private buffer: SortedSet<BufferEntry> = new SortedSet<BufferEntry>(\n    bufferEntryComparator\n  );\n\n  private previousIndex = 0;\n\n  constructor(private readonly maxElements: number) {}\n\n  private nextIndex(): number {\n    return ++this.previousIndex;\n  }\n\n  addElement(sequenceNumber: ListenSequenceNumber): void {\n    const entry: BufferEntry = [sequenceNumber, this.nextIndex()];\n    if (this.buffer.size < this.maxElements) {\n      this.buffer = this.buffer.add(entry);\n    } else {\n      const highestValue = this.buffer.last()!;\n      if (bufferEntryComparator(entry, highestValue) < 0) {\n        this.buffer = this.buffer.delete(highestValue).add(entry);\n      }\n    }\n  }\n\n  get maxValue(): ListenSequenceNumber {\n    // Guaranteed to be non-empty. If we decide we are not collecting any\n    // sequence numbers, nthSequenceNumber below short-circuits. If we have\n    // decided that we are collecting n sequence numbers, it's because n is some\n    // percentage of the existing sequence numbers. That means we should never\n    // be in a situation where we are collecting sequence numbers but don't\n    // actually have any.\n    return this.buffer.last()![0];\n  }\n}\n\n/**\n * This class is responsible for the scheduling of LRU garbage collection. It handles checking\n * whether or not GC is enabled, as well as which delay to use before the next run.\n */\nexport class LruScheduler implements Scheduler {\n  private gcTask: DelayedOperation<void> | null;\n\n  constructor(\n    private readonly garbageCollector: LruGarbageCollector,\n    private readonly asyncQueue: AsyncQueue,\n    private readonly localStore: LocalStore\n  ) {\n    this.gcTask = null;\n  }\n\n  start(): void {\n    debugAssert(\n      this.gcTask === null,\n      'Cannot start an already started LruScheduler'\n    );\n    if (\n      this.garbageCollector.params.cacheSizeCollectionThreshold !==\n      LRU_COLLECTION_DISABLED\n    ) {\n      this.scheduleGC(INITIAL_GC_DELAY_MS);\n    }\n  }\n\n  stop(): void {\n    if (this.gcTask) {\n      this.gcTask.cancel();\n      this.gcTask = null;\n    }\n  }\n\n  get started(): boolean {\n    return this.gcTask !== null;\n  }\n\n  private scheduleGC(delay: number): void {\n    debugAssert(\n      this.gcTask === null,\n      'Cannot schedule GC while a task is pending'\n    );\n    logDebug(LOG_TAG, `Garbage collection scheduled in ${delay}ms`);\n    this.gcTask = this.asyncQueue.enqueueAfterDelay(\n      TimerId.LruGarbageCollection,\n      delay,\n      async () => {\n        this.gcTask = null;\n        try {\n          await this.localStore.collectGarbage(this.garbageCollector);\n        } catch (e) {\n          if (isIndexedDbTransactionError(e as Error)) {\n            logDebug(\n              LOG_TAG,\n              'Ignoring IndexedDB error during garbage collection: ',\n              e\n            );\n          } else {\n            await ignoreIfPrimaryLeaseLoss(e as FirestoreError);\n          }\n        }\n        await this.scheduleGC(REGULAR_GC_DELAY_MS);\n      }\n    );\n  }\n}\n\n/**\n * Implements the steps for LRU garbage collection.\n */\nclass LruGarbageCollectorImpl implements LruGarbageCollector {\n  constructor(\n    private readonly delegate: LruDelegate,\n    readonly params: LruParams\n  ) {}\n\n  calculateTargetCount(\n    txn: PersistenceTransaction,\n    percentile: number\n  ): PersistencePromise<number> {\n    return this.delegate.getSequenceNumberCount(txn).next(targetCount => {\n      return Math.floor((percentile / 100.0) * targetCount);\n    });\n  }\n\n  nthSequenceNumber(\n    txn: PersistenceTransaction,\n    n: number\n  ): PersistencePromise<ListenSequenceNumber> {\n    if (n === 0) {\n      return PersistencePromise.resolve(ListenSequence.INVALID);\n    }\n\n    const buffer = new RollingSequenceNumberBuffer(n);\n    return this.delegate\n      .forEachTarget(txn, target => buffer.addElement(target.sequenceNumber))\n      .next(() => {\n        return this.delegate.forEachOrphanedDocumentSequenceNumber(\n          txn,\n          sequenceNumber => buffer.addElement(sequenceNumber)\n        );\n      })\n      .next(() => buffer.maxValue);\n  }\n\n  removeTargets(\n    txn: PersistenceTransaction,\n    upperBound: ListenSequenceNumber,\n    activeTargetIds: ActiveTargets\n  ): PersistencePromise<number> {\n    return this.delegate.removeTargets(txn, upperBound, activeTargetIds);\n  }\n\n  removeOrphanedDocuments(\n    txn: PersistenceTransaction,\n    upperBound: ListenSequenceNumber\n  ): PersistencePromise<number> {\n    return this.delegate.removeOrphanedDocuments(txn, upperBound);\n  }\n\n  collect(\n    txn: PersistenceTransaction,\n    activeTargetIds: ActiveTargets\n  ): PersistencePromise<LruResults> {\n    if (this.params.cacheSizeCollectionThreshold === LRU_COLLECTION_DISABLED) {\n      logDebug('LruGarbageCollector', 'Garbage collection skipped; disabled');\n      return PersistencePromise.resolve(GC_DID_NOT_RUN);\n    }\n\n    return this.getCacheSize(txn).next(cacheSize => {\n      if (cacheSize < this.params.cacheSizeCollectionThreshold) {\n        logDebug(\n          'LruGarbageCollector',\n          `Garbage collection skipped; Cache size ${cacheSize} ` +\n            `is lower than threshold ${this.params.cacheSizeCollectionThreshold}`\n        );\n        return GC_DID_NOT_RUN;\n      } else {\n        return this.runGarbageCollection(txn, activeTargetIds);\n      }\n    });\n  }\n\n  getCacheSize(txn: PersistenceTransaction): PersistencePromise<number> {\n    return this.delegate.getCacheSize(txn);\n  }\n\n  private runGarbageCollection(\n    txn: PersistenceTransaction,\n    activeTargetIds: ActiveTargets\n  ): PersistencePromise<LruResults> {\n    let upperBoundSequenceNumber: number;\n    let sequenceNumbersToCollect: number, targetsRemoved: number;\n    // Timestamps for various pieces of the process\n    let countedTargetsTs: number,\n      foundUpperBoundTs: number,\n      removedTargetsTs: number,\n      removedDocumentsTs: number;\n    const startTs = Date.now();\n    return this.calculateTargetCount(txn, this.params.percentileToCollect)\n      .next(sequenceNumbers => {\n        // Cap at the configured max\n        if (sequenceNumbers > this.params.maximumSequenceNumbersToCollect) {\n          logDebug(\n            'LruGarbageCollector',\n            'Capping sequence numbers to collect down ' +\n              `to the maximum of ${this.params.maximumSequenceNumbersToCollect} ` +\n              `from ${sequenceNumbers}`\n          );\n          sequenceNumbersToCollect =\n            this.params.maximumSequenceNumbersToCollect;\n        } else {\n          sequenceNumbersToCollect = sequenceNumbers;\n        }\n        countedTargetsTs = Date.now();\n\n        return this.nthSequenceNumber(txn, sequenceNumbersToCollect);\n      })\n      .next(upperBound => {\n        upperBoundSequenceNumber = upperBound;\n        foundUpperBoundTs = Date.now();\n\n        return this.removeTargets(\n          txn,\n          upperBoundSequenceNumber,\n          activeTargetIds\n        );\n      })\n      .next(numTargetsRemoved => {\n        targetsRemoved = numTargetsRemoved;\n        removedTargetsTs = Date.now();\n\n        return this.removeOrphanedDocuments(txn, upperBoundSequenceNumber);\n      })\n      .next(documentsRemoved => {\n        removedDocumentsTs = Date.now();\n\n        if (getLogLevel() <= LogLevel.DEBUG) {\n          const desc =\n            'LRU Garbage Collection\\n' +\n            `\\tCounted targets in ${countedTargetsTs - startTs}ms\\n` +\n            `\\tDetermined least recently used ${sequenceNumbersToCollect} in ` +\n            `${foundUpperBoundTs - countedTargetsTs}ms\\n` +\n            `\\tRemoved ${targetsRemoved} targets in ` +\n            `${removedTargetsTs - foundUpperBoundTs}ms\\n` +\n            `\\tRemoved ${documentsRemoved} documents in ` +\n            `${removedDocumentsTs - removedTargetsTs}ms\\n` +\n            `Total Duration: ${removedDocumentsTs - startTs}ms`;\n          logDebug('LruGarbageCollector', desc);\n        }\n\n        return PersistencePromise.resolve<LruResults>({\n          didRun: true,\n          sequenceNumbersCollected: sequenceNumbersToCollect,\n          targetsRemoved,\n          documentsRemoved\n        });\n      });\n  }\n}\n\nexport function newLruGarbageCollector(\n  delegate: LruDelegate,\n  params: LruParams\n): LruGarbageCollector {\n  return new LruGarbageCollectorImpl(delegate, params);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ListenSequence } from '../core/listen_sequence';\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport { ListenSequenceNumber, TargetId } from '../core/types';\nimport { DocumentKey } from '../model/document_key';\n\nimport {\n  decodeResourcePath,\n  EncodedResourcePath,\n  encodeResourcePath\n} from './encoded_resource_path';\nimport { IndexedDbLruDelegate } from './indexeddb_lru_delegate';\nimport { mutationQueuesContainKey } from './indexeddb_mutation_queue';\nimport { DbTargetDocument } from './indexeddb_schema';\nimport { DbTargetDocumentDocumentTargetsIndex } from './indexeddb_sentinels';\nimport {\n  documentTargetStore,\n  IndexedDbTargetCache\n} from './indexeddb_target_cache';\nimport {\n  ActiveTargets,\n  LruGarbageCollector,\n  LruParams\n} from './lru_garbage_collector';\nimport { newLruGarbageCollector } from './lru_garbage_collector_impl';\nimport { Persistence } from './persistence';\nimport { PersistencePromise } from './persistence_promise';\nimport { PersistenceTransaction } from './persistence_transaction';\nimport { TargetData } from './target_data';\n\n/** Provides LRU functionality for IndexedDB persistence. */\nexport class IndexedDbLruDelegateImpl implements IndexedDbLruDelegate {\n  readonly garbageCollector: LruGarbageCollector;\n\n  constructor(private readonly db: Persistence, params: LruParams) {\n    this.garbageCollector = newLruGarbageCollector(this, params);\n  }\n\n  getSequenceNumberCount(\n    txn: PersistenceTransaction\n  ): PersistencePromise<number> {\n    const docCountPromise = this.orphanedDocumentCount(txn);\n    const targetCountPromise = this.db.getTargetCache().getTargetCount(txn);\n    return targetCountPromise.next(targetCount =>\n      docCountPromise.next(docCount => targetCount + docCount)\n    );\n  }\n\n  private orphanedDocumentCount(\n    txn: PersistenceTransaction\n  ): PersistencePromise<number> {\n    let orphanedCount = 0;\n    return this.forEachOrphanedDocumentSequenceNumber(txn, _ => {\n      orphanedCount++;\n    }).next(() => orphanedCount);\n  }\n\n  forEachTarget(\n    txn: PersistenceTransaction,\n    f: (q: TargetData) => void\n  ): PersistencePromise<void> {\n    return this.db.getTargetCache().forEachTarget(txn, f);\n  }\n\n  forEachOrphanedDocumentSequenceNumber(\n    txn: PersistenceTransaction,\n    f: (sequenceNumber: ListenSequenceNumber) => void\n  ): PersistencePromise<void> {\n    return this.forEachOrphanedDocument(txn, (docKey, sequenceNumber) =>\n      f(sequenceNumber)\n    );\n  }\n\n  addReference(\n    txn: PersistenceTransaction,\n    targetId: TargetId,\n    key: DocumentKey\n  ): PersistencePromise<void> {\n    return writeSentinelKey(txn, key);\n  }\n\n  removeReference(\n    txn: PersistenceTransaction,\n    targetId: TargetId,\n    key: DocumentKey\n  ): PersistencePromise<void> {\n    return writeSentinelKey(txn, key);\n  }\n\n  removeTargets(\n    txn: PersistenceTransaction,\n    upperBound: ListenSequenceNumber,\n    activeTargetIds: ActiveTargets\n  ): PersistencePromise<number> {\n    return (this.db.getTargetCache() as IndexedDbTargetCache).removeTargets(\n      txn,\n      upperBound,\n      activeTargetIds\n    );\n  }\n\n  markPotentiallyOrphaned(\n    txn: PersistenceTransaction,\n    key: DocumentKey\n  ): PersistencePromise<void> {\n    return writeSentinelKey(txn, key);\n  }\n\n  /**\n   * Returns true if anything would prevent this document from being garbage\n   * collected, given that the document in question is not present in any\n   * targets and has a sequence number less than or equal to the upper bound for\n   * the collection run.\n   */\n  private isPinned(\n    txn: PersistenceTransaction,\n    docKey: DocumentKey\n  ): PersistencePromise<boolean> {\n    return mutationQueuesContainKey(txn, docKey);\n  }\n\n  removeOrphanedDocuments(\n    txn: PersistenceTransaction,\n    upperBound: ListenSequenceNumber\n  ): PersistencePromise<number> {\n    const documentCache = this.db.getRemoteDocumentCache();\n    const changeBuffer = documentCache.newChangeBuffer();\n\n    const promises: Array<PersistencePromise<void>> = [];\n    let documentCount = 0;\n\n    const iteration = this.forEachOrphanedDocument(\n      txn,\n      (docKey, sequenceNumber) => {\n        if (sequenceNumber <= upperBound) {\n          const p = this.isPinned(txn, docKey).next(isPinned => {\n            if (!isPinned) {\n              documentCount++;\n              // Our size accounting requires us to read all documents before\n              // removing them.\n              return changeBuffer.getEntry(txn, docKey).next(() => {\n                changeBuffer.removeEntry(docKey, SnapshotVersion.min());\n                return documentTargetStore(txn).delete(sentinelKey(docKey));\n              });\n            }\n          });\n          promises.push(p);\n        }\n      }\n    );\n\n    return iteration\n      .next(() => PersistencePromise.waitFor(promises))\n      .next(() => changeBuffer.apply(txn))\n      .next(() => documentCount);\n  }\n\n  removeTarget(\n    txn: PersistenceTransaction,\n    targetData: TargetData\n  ): PersistencePromise<void> {\n    const updated = targetData.withSequenceNumber(txn.currentSequenceNumber);\n    return this.db.getTargetCache().updateTargetData(txn, updated);\n  }\n\n  updateLimboDocument(\n    txn: PersistenceTransaction,\n    key: DocumentKey\n  ): PersistencePromise<void> {\n    return writeSentinelKey(txn, key);\n  }\n\n  /**\n   * Call provided function for each document in the cache that is 'orphaned'. Orphaned\n   * means not a part of any target, so the only entry in the target-document index for\n   * that document will be the sentinel row (targetId 0), which will also have the sequence\n   * number for the last time the document was accessed.\n   */\n  private forEachOrphanedDocument(\n    txn: PersistenceTransaction,\n    f: (docKey: DocumentKey, sequenceNumber: ListenSequenceNumber) => void\n  ): PersistencePromise<void> {\n    const store = documentTargetStore(txn);\n    let nextToReport: ListenSequenceNumber = ListenSequence.INVALID;\n    let nextPath: EncodedResourcePath;\n    return store\n      .iterate(\n        {\n          index: DbTargetDocumentDocumentTargetsIndex\n        },\n        ([targetId, docKey], { path, sequenceNumber }) => {\n          if (targetId === 0) {\n            // if nextToReport is valid, report it, this is a new key so the\n            // last one must not be a member of any targets.\n            if (nextToReport !== ListenSequence.INVALID) {\n              f(new DocumentKey(decodeResourcePath(nextPath)), nextToReport);\n            }\n            // set nextToReport to be this sequence number. It's the next one we\n            // might report, if we don't find any targets for this document.\n            // Note that the sequence number must be defined when the targetId\n            // is 0.\n            nextToReport = sequenceNumber!;\n            nextPath = path;\n          } else {\n            // set nextToReport to be invalid, we know we don't need to report\n            // this one since we found a target for it.\n            nextToReport = ListenSequence.INVALID;\n          }\n        }\n      )\n      .next(() => {\n        // Since we report sequence numbers after getting to the next key, we\n        // need to check if the last key we iterated over was an orphaned\n        // document and report it.\n        if (nextToReport !== ListenSequence.INVALID) {\n          f(new DocumentKey(decodeResourcePath(nextPath)), nextToReport);\n        }\n      });\n  }\n\n  getCacheSize(txn: PersistenceTransaction): PersistencePromise<number> {\n    return this.db.getRemoteDocumentCache().getSize(txn);\n  }\n}\n\nfunction sentinelKey(key: DocumentKey): [TargetId, EncodedResourcePath] {\n  return [0, encodeResourcePath(key.path)];\n}\n\n/**\n * @returns A value suitable for writing a sentinel row in the target-document\n * store.\n */\nfunction sentinelRow(\n  key: DocumentKey,\n  sequenceNumber: ListenSequenceNumber\n): DbTargetDocument {\n  return { targetId: 0, path: encodeResourcePath(key.path), sequenceNumber };\n}\n\nfunction writeSentinelKey(\n  txn: PersistenceTransaction,\n  key: DocumentKey\n): PersistencePromise<void> {\n  return documentTargetStore(txn).put(\n    sentinelRow(key, txn.currentSequenceNumber)\n  );\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport { DocumentKeySet, MutableDocumentMap } from '../model/collections';\nimport { MutableDocument } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport { debugAssert } from '../util/assert';\nimport { ObjectMap } from '../util/obj_map';\n\nimport { PersistencePromise } from './persistence_promise';\nimport { PersistenceTransaction } from './persistence_transaction';\n\n/**\n * An in-memory buffer of entries to be written to a RemoteDocumentCache.\n * It can be used to batch up a set of changes to be written to the cache, but\n * additionally supports reading entries back with the `getEntry()` method,\n * falling back to the underlying RemoteDocumentCache if no entry is\n * buffered.\n *\n * Entries added to the cache *must* be read first. This is to facilitate\n * calculating the size delta of the pending changes.\n *\n * PORTING NOTE: This class was implemented then removed from other platforms.\n * If byte-counting ends up being needed on the other platforms, consider\n * porting this class as part of that implementation work.\n */\nexport abstract class RemoteDocumentChangeBuffer {\n  // A mapping of document key to the new cache entry that should be written.\n  protected changes: ObjectMap<DocumentKey, MutableDocument> = new ObjectMap(\n    key => key.toString(),\n    (l, r) => l.isEqual(r)\n  );\n\n  private changesApplied = false;\n\n  protected abstract getFromCache(\n    transaction: PersistenceTransaction,\n    documentKey: DocumentKey\n  ): PersistencePromise<MutableDocument>;\n\n  protected abstract getAllFromCache(\n    transaction: PersistenceTransaction,\n    documentKeys: DocumentKeySet\n  ): PersistencePromise<MutableDocumentMap>;\n\n  protected abstract applyChanges(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<void>;\n\n  /**\n   * Buffers a `RemoteDocumentCache.addEntry()` call.\n   *\n   * You can only modify documents that have already been retrieved via\n   * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\n   */\n  addEntry(document: MutableDocument): void {\n    this.assertNotApplied();\n    this.changes.set(document.key, document);\n  }\n\n  /**\n   * Buffers a `RemoteDocumentCache.removeEntry()` call.\n   *\n   * You can only remove documents that have already been retrieved via\n   * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).\n   */\n  removeEntry(key: DocumentKey, readTime: SnapshotVersion): void {\n    this.assertNotApplied();\n    this.changes.set(\n      key,\n      MutableDocument.newInvalidDocument(key).setReadTime(readTime)\n    );\n  }\n\n  /**\n   * Looks up an entry in the cache. The buffered changes will first be checked,\n   * and if no buffered change applies, this will forward to\n   * `RemoteDocumentCache.getEntry()`.\n   *\n   * @param transaction - The transaction in which to perform any persistence\n   *     operations.\n   * @param documentKey - The key of the entry to look up.\n   * @returns The cached document or an invalid document if we have nothing\n   * cached.\n   */\n  getEntry(\n    transaction: PersistenceTransaction,\n    documentKey: DocumentKey\n  ): PersistencePromise<MutableDocument> {\n    this.assertNotApplied();\n    const bufferedEntry = this.changes.get(documentKey);\n    if (bufferedEntry !== undefined) {\n      return PersistencePromise.resolve(bufferedEntry);\n    } else {\n      return this.getFromCache(transaction, documentKey);\n    }\n  }\n\n  /**\n   * Looks up several entries in the cache, forwarding to\n   * `RemoteDocumentCache.getEntry()`.\n   *\n   * @param transaction - The transaction in which to perform any persistence\n   *     operations.\n   * @param documentKeys - The keys of the entries to look up.\n   * @returns A map of cached documents, indexed by key. If an entry cannot be\n   *     found, the corresponding key will be mapped to an invalid document.\n   */\n  getEntries(\n    transaction: PersistenceTransaction,\n    documentKeys: DocumentKeySet\n  ): PersistencePromise<MutableDocumentMap> {\n    return this.getAllFromCache(transaction, documentKeys);\n  }\n\n  /**\n   * Applies buffered changes to the underlying RemoteDocumentCache, using\n   * the provided transaction.\n   */\n  apply(transaction: PersistenceTransaction): PersistencePromise<void> {\n    this.assertNotApplied();\n    this.changesApplied = true;\n    return this.applyChanges(transaction);\n  }\n\n  /** Helper to assert this.changes is not null  */\n  protected assertNotApplied(): void {\n    debugAssert(!this.changesApplied, 'Changes have already been applied.');\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Query, queryMatches } from '../core/query';\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport {\n  DocumentKeySet,\n  DocumentSizeEntries,\n  MutableDocumentMap,\n  mutableDocumentMap,\n  OverlayMap\n} from '../model/collections';\nimport { MutableDocument } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport { IndexOffset } from '../model/field_index';\nimport { ResourcePath } from '../model/path';\nimport { debugAssert, hardAssert } from '../util/assert';\nimport { primitiveComparator } from '../util/misc';\nimport { ObjectMap } from '../util/obj_map';\nimport { SortedMap } from '../util/sorted_map';\nimport { SortedSet } from '../util/sorted_set';\n\nimport { IndexManager } from './index_manager';\nimport { dbDocumentSize } from './indexeddb_mutation_batch_impl';\nimport { DbRemoteDocument, DbRemoteDocumentGlobal } from './indexeddb_schema';\nimport {\n  DbRemoteDocumentCollectionGroupIndex,\n  DbRemoteDocumentDocumentKeyIndex,\n  DbRemoteDocumentGlobalKey,\n  DbRemoteDocumentGlobalStore,\n  DbRemoteDocumentKey,\n  DbRemoteDocumentStore,\n  DbTimestampKey\n} from './indexeddb_sentinels';\nimport { getStore } from './indexeddb_transaction';\nimport {\n  fromDbRemoteDocument,\n  LocalSerializer,\n  toDbRemoteDocument,\n  toDbTimestampKey\n} from './local_serializer';\nimport { PersistencePromise } from './persistence_promise';\nimport { PersistenceTransaction } from './persistence_transaction';\nimport { QueryContext } from './query_context';\nimport { RemoteDocumentCache } from './remote_document_cache';\nimport { RemoteDocumentChangeBuffer } from './remote_document_change_buffer';\nimport { SimpleDbStore } from './simple_db';\n\nexport interface DocumentSizeEntry {\n  document: MutableDocument;\n  size: number;\n}\n\nexport interface IndexedDbRemoteDocumentCache extends RemoteDocumentCache {\n  // The IndexedDbRemoteDocumentCache doesn't implement any methods on top\n  // of RemoteDocumentCache. This class exists for consistency.\n}\n\n/**\n * The RemoteDocumentCache for IndexedDb. To construct, invoke\n * `newIndexedDbRemoteDocumentCache()`.\n */\nclass IndexedDbRemoteDocumentCacheImpl implements IndexedDbRemoteDocumentCache {\n  indexManager!: IndexManager;\n\n  constructor(readonly serializer: LocalSerializer) {}\n\n  setIndexManager(indexManager: IndexManager): void {\n    this.indexManager = indexManager;\n  }\n\n  /**\n   * Adds the supplied entries to the cache.\n   *\n   * All calls of `addEntry` are required to go through the RemoteDocumentChangeBuffer\n   * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\n   */\n  addEntry(\n    transaction: PersistenceTransaction,\n    key: DocumentKey,\n    doc: DbRemoteDocument\n  ): PersistencePromise<void> {\n    const documentStore = remoteDocumentsStore(transaction);\n    return documentStore.put(doc);\n  }\n\n  /**\n   * Removes a document from the cache.\n   *\n   * All calls of `removeEntry`  are required to go through the RemoteDocumentChangeBuffer\n   * returned by `newChangeBuffer()` to ensure proper accounting of metadata.\n   */\n  removeEntry(\n    transaction: PersistenceTransaction,\n    documentKey: DocumentKey,\n    readTime: SnapshotVersion\n  ): PersistencePromise<void> {\n    const store = remoteDocumentsStore(transaction);\n    return store.delete(dbReadTimeKey(documentKey, readTime));\n  }\n\n  /**\n   * Updates the current cache size.\n   *\n   * Callers to `addEntry()` and `removeEntry()` *must* call this afterwards to update the\n   * cache's metadata.\n   */\n  updateMetadata(\n    transaction: PersistenceTransaction,\n    sizeDelta: number\n  ): PersistencePromise<void> {\n    return this.getMetadata(transaction).next(metadata => {\n      metadata.byteSize += sizeDelta;\n      return this.setMetadata(transaction, metadata);\n    });\n  }\n\n  getEntry(\n    transaction: PersistenceTransaction,\n    documentKey: DocumentKey\n  ): PersistencePromise<MutableDocument> {\n    let doc = MutableDocument.newInvalidDocument(documentKey);\n    return remoteDocumentsStore(transaction)\n      .iterate(\n        {\n          index: DbRemoteDocumentDocumentKeyIndex,\n          range: IDBKeyRange.only(dbKey(documentKey))\n        },\n        (_, dbRemoteDoc) => {\n          doc = this.maybeDecodeDocument(documentKey, dbRemoteDoc);\n        }\n      )\n      .next(() => doc);\n  }\n\n  /**\n   * Looks up an entry in the cache.\n   *\n   * @param documentKey - The key of the entry to look up.\n   * @returns The cached document entry and its size.\n   */\n  getSizedEntry(\n    transaction: PersistenceTransaction,\n    documentKey: DocumentKey\n  ): PersistencePromise<DocumentSizeEntry> {\n    let result = {\n      size: 0,\n      document: MutableDocument.newInvalidDocument(documentKey)\n    };\n    return remoteDocumentsStore(transaction)\n      .iterate(\n        {\n          index: DbRemoteDocumentDocumentKeyIndex,\n          range: IDBKeyRange.only(dbKey(documentKey))\n        },\n        (_, dbRemoteDoc) => {\n          result = {\n            document: this.maybeDecodeDocument(documentKey, dbRemoteDoc),\n            size: dbDocumentSize(dbRemoteDoc)\n          };\n        }\n      )\n      .next(() => result);\n  }\n\n  getEntries(\n    transaction: PersistenceTransaction,\n    documentKeys: DocumentKeySet\n  ): PersistencePromise<MutableDocumentMap> {\n    let results = mutableDocumentMap();\n    return this.forEachDbEntry(\n      transaction,\n      documentKeys,\n      (key, dbRemoteDoc) => {\n        const doc = this.maybeDecodeDocument(key, dbRemoteDoc);\n        results = results.insert(key, doc);\n      }\n    ).next(() => results);\n  }\n\n  /**\n   * Looks up several entries in the cache.\n   *\n   * @param documentKeys - The set of keys entries to look up.\n   * @returns A map of documents indexed by key and a map of sizes indexed by\n   *     key (zero if the document does not exist).\n   */\n  getSizedEntries(\n    transaction: PersistenceTransaction,\n    documentKeys: DocumentKeySet\n  ): PersistencePromise<DocumentSizeEntries> {\n    let results = mutableDocumentMap();\n    let sizeMap = new SortedMap<DocumentKey, number>(DocumentKey.comparator);\n    return this.forEachDbEntry(\n      transaction,\n      documentKeys,\n      (key, dbRemoteDoc) => {\n        const doc = this.maybeDecodeDocument(key, dbRemoteDoc);\n        results = results.insert(key, doc);\n        sizeMap = sizeMap.insert(key, dbDocumentSize(dbRemoteDoc));\n      }\n    ).next(() => {\n      return { documents: results, sizeMap };\n    });\n  }\n\n  private forEachDbEntry(\n    transaction: PersistenceTransaction,\n    documentKeys: DocumentKeySet,\n    callback: (key: DocumentKey, doc: DbRemoteDocument | null) => void\n  ): PersistencePromise<void> {\n    if (documentKeys.isEmpty()) {\n      return PersistencePromise.resolve();\n    }\n\n    let sortedKeys = new SortedSet<DocumentKey>(dbKeyComparator);\n    documentKeys.forEach(e => (sortedKeys = sortedKeys.add(e)));\n    const range = IDBKeyRange.bound(\n      dbKey(sortedKeys.first()!),\n      dbKey(sortedKeys.last()!)\n    );\n    const keyIter = sortedKeys.getIterator();\n    let nextKey: DocumentKey | null = keyIter.getNext();\n\n    return remoteDocumentsStore(transaction)\n      .iterate(\n        { index: DbRemoteDocumentDocumentKeyIndex, range },\n        (_, dbRemoteDoc, control) => {\n          const potentialKey = DocumentKey.fromSegments([\n            ...dbRemoteDoc.prefixPath,\n            dbRemoteDoc.collectionGroup,\n            dbRemoteDoc.documentId\n          ]);\n\n          // Go through keys not found in cache.\n          while (nextKey && dbKeyComparator(nextKey!, potentialKey) < 0) {\n            callback(nextKey!, null);\n            nextKey = keyIter.getNext();\n          }\n\n          if (nextKey && nextKey!.isEqual(potentialKey)) {\n            // Key found in cache.\n            callback(nextKey!, dbRemoteDoc);\n            nextKey = keyIter.hasNext() ? keyIter.getNext() : null;\n          }\n\n          // Skip to the next key (if there is one).\n          if (nextKey) {\n            control.skip(dbKey(nextKey));\n          } else {\n            control.done();\n          }\n        }\n      )\n      .next(() => {\n        // The rest of the keys are not in the cache. One case where `iterate`\n        // above won't go through them is when the cache is empty.\n        while (nextKey) {\n          callback(nextKey!, null);\n          nextKey = keyIter.hasNext() ? keyIter.getNext() : null;\n        }\n      });\n  }\n\n  getDocumentsMatchingQuery(\n    transaction: PersistenceTransaction,\n    query: Query,\n    offset: IndexOffset,\n    mutatedDocs: OverlayMap,\n    context?: QueryContext\n  ): PersistencePromise<MutableDocumentMap> {\n    const collection = query.path;\n    const startKey = [\n      collection.popLast().toArray(),\n      collection.lastSegment(),\n      toDbTimestampKey(offset.readTime),\n      offset.documentKey.path.isEmpty()\n        ? ''\n        : offset.documentKey.path.lastSegment()\n    ];\n    const endKey: DbRemoteDocumentKey = [\n      collection.popLast().toArray(),\n      collection.lastSegment(),\n      [Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],\n      ''\n    ];\n\n    return remoteDocumentsStore(transaction)\n      .loadAll(IDBKeyRange.bound(startKey, endKey, true))\n      .next(dbRemoteDocs => {\n        context?.incrementDocumentReadCount(dbRemoteDocs.length);\n        let results = mutableDocumentMap();\n        for (const dbRemoteDoc of dbRemoteDocs) {\n          const document = this.maybeDecodeDocument(\n            DocumentKey.fromSegments(\n              dbRemoteDoc.prefixPath.concat(\n                dbRemoteDoc.collectionGroup,\n                dbRemoteDoc.documentId\n              )\n            ),\n            dbRemoteDoc\n          );\n          if (\n            document.isFoundDocument() &&\n            (queryMatches(query, document) || mutatedDocs.has(document.key))\n          ) {\n            // Either the document matches the given query, or it is mutated.\n            results = results.insert(document.key, document);\n          }\n        }\n        return results;\n      });\n  }\n\n  getAllFromCollectionGroup(\n    transaction: PersistenceTransaction,\n    collectionGroup: string,\n    offset: IndexOffset,\n    limit: number\n  ): PersistencePromise<MutableDocumentMap> {\n    debugAssert(limit > 0, 'Limit should be at least 1');\n    let results = mutableDocumentMap();\n\n    const startKey = dbCollectionGroupKey(collectionGroup, offset);\n    const endKey = dbCollectionGroupKey(collectionGroup, IndexOffset.max());\n    return remoteDocumentsStore(transaction)\n      .iterate(\n        {\n          index: DbRemoteDocumentCollectionGroupIndex,\n          range: IDBKeyRange.bound(startKey, endKey, true)\n        },\n        (_, dbRemoteDoc, control) => {\n          const document = this.maybeDecodeDocument(\n            DocumentKey.fromSegments(\n              dbRemoteDoc.prefixPath.concat(\n                dbRemoteDoc.collectionGroup,\n                dbRemoteDoc.documentId\n              )\n            ),\n            dbRemoteDoc\n          );\n          results = results.insert(document.key, document);\n          if (results.size === limit) {\n            control.done();\n          }\n        }\n      )\n      .next(() => results);\n  }\n\n  newChangeBuffer(options?: {\n    trackRemovals: boolean;\n  }): RemoteDocumentChangeBuffer {\n    return new IndexedDbRemoteDocumentChangeBuffer(\n      this,\n      !!options && options.trackRemovals\n    );\n  }\n\n  getSize(txn: PersistenceTransaction): PersistencePromise<number> {\n    return this.getMetadata(txn).next(metadata => metadata.byteSize);\n  }\n\n  private getMetadata(\n    txn: PersistenceTransaction\n  ): PersistencePromise<DbRemoteDocumentGlobal> {\n    return documentGlobalStore(txn)\n      .get(DbRemoteDocumentGlobalKey)\n      .next(metadata => {\n        hardAssert(!!metadata, 'Missing document cache metadata');\n        return metadata!;\n      });\n  }\n\n  private setMetadata(\n    txn: PersistenceTransaction,\n    metadata: DbRemoteDocumentGlobal\n  ): PersistencePromise<void> {\n    return documentGlobalStore(txn).put(DbRemoteDocumentGlobalKey, metadata);\n  }\n\n  /**\n   * Decodes `dbRemoteDoc` and returns the document (or an invalid document if\n   * the document corresponds to the format used for sentinel deletes).\n   */\n  private maybeDecodeDocument(\n    documentKey: DocumentKey,\n    dbRemoteDoc: DbRemoteDocument | null\n  ): MutableDocument {\n    if (dbRemoteDoc) {\n      const doc = fromDbRemoteDocument(this.serializer, dbRemoteDoc);\n      // Whether the document is a sentinel removal and should only be used in the\n      // `getNewDocumentChanges()`\n      const isSentinelRemoval =\n        doc.isNoDocument() && doc.version.isEqual(SnapshotVersion.min());\n      if (!isSentinelRemoval) {\n        return doc;\n      }\n    }\n    return MutableDocument.newInvalidDocument(documentKey);\n  }\n}\n\n/** Creates a new IndexedDbRemoteDocumentCache. */\nexport function newIndexedDbRemoteDocumentCache(\n  serializer: LocalSerializer\n): IndexedDbRemoteDocumentCache {\n  return new IndexedDbRemoteDocumentCacheImpl(serializer);\n}\n\n/**\n * Handles the details of adding and updating documents in the IndexedDbRemoteDocumentCache.\n *\n * Unlike the MemoryRemoteDocumentChangeBuffer, the IndexedDb implementation computes the size\n * delta for all submitted changes. This avoids having to re-read all documents from IndexedDb\n * when we apply the changes.\n */\nclass IndexedDbRemoteDocumentChangeBuffer extends RemoteDocumentChangeBuffer {\n  // A map of document sizes and read times prior to applying the changes in\n  // this buffer.\n  protected documentStates: ObjectMap<\n    DocumentKey,\n    { size: number; readTime: SnapshotVersion }\n  > = new ObjectMap(\n    key => key.toString(),\n    (l, r) => l.isEqual(r)\n  );\n\n  /**\n   * @param documentCache - The IndexedDbRemoteDocumentCache to apply the changes to.\n   * @param trackRemovals - Whether to create sentinel deletes that can be tracked by\n   * `getNewDocumentChanges()`.\n   */\n  constructor(\n    private readonly documentCache: IndexedDbRemoteDocumentCacheImpl,\n    private readonly trackRemovals: boolean\n  ) {\n    super();\n  }\n\n  protected applyChanges(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<void> {\n    const promises: Array<PersistencePromise<void>> = [];\n\n    let sizeDelta = 0;\n\n    let collectionParents = new SortedSet<ResourcePath>((l, r) =>\n      primitiveComparator(l.canonicalString(), r.canonicalString())\n    );\n\n    this.changes.forEach((key, documentChange) => {\n      const previousDoc = this.documentStates.get(key);\n      debugAssert(\n        previousDoc !== undefined,\n        `Cannot modify a document that wasn't read (for ${key})`\n      );\n      promises.push(\n        this.documentCache.removeEntry(transaction, key, previousDoc.readTime)\n      );\n      if (documentChange.isValidDocument()) {\n        debugAssert(\n          !documentChange.readTime.isEqual(SnapshotVersion.min()),\n          'Cannot add a document with a read time of zero'\n        );\n        const doc = toDbRemoteDocument(\n          this.documentCache.serializer,\n          documentChange\n        );\n        collectionParents = collectionParents.add(key.path.popLast());\n\n        const size = dbDocumentSize(doc);\n        sizeDelta += size - previousDoc.size;\n        promises.push(this.documentCache.addEntry(transaction, key, doc));\n      } else {\n        sizeDelta -= previousDoc.size;\n        if (this.trackRemovals) {\n          // In order to track removals, we store a \"sentinel delete\" in the\n          // RemoteDocumentCache. This entry is represented by a NoDocument\n          // with a version of 0 and ignored by `maybeDecodeDocument()` but\n          // preserved in `getNewDocumentChanges()`.\n          const deletedDoc = toDbRemoteDocument(\n            this.documentCache.serializer,\n            documentChange.convertToNoDocument(SnapshotVersion.min())\n          );\n          promises.push(\n            this.documentCache.addEntry(transaction, key, deletedDoc)\n          );\n        }\n      }\n    });\n\n    collectionParents.forEach(parent => {\n      promises.push(\n        this.documentCache.indexManager.addToCollectionParentIndex(\n          transaction,\n          parent\n        )\n      );\n    });\n\n    promises.push(this.documentCache.updateMetadata(transaction, sizeDelta));\n\n    return PersistencePromise.waitFor(promises);\n  }\n\n  protected getFromCache(\n    transaction: PersistenceTransaction,\n    documentKey: DocumentKey\n  ): PersistencePromise<MutableDocument> {\n    // Record the size of everything we load from the cache so we can compute a delta later.\n    return this.documentCache\n      .getSizedEntry(transaction, documentKey)\n      .next(getResult => {\n        this.documentStates.set(documentKey, {\n          size: getResult.size,\n          readTime: getResult.document.readTime\n        });\n        return getResult.document;\n      });\n  }\n\n  protected getAllFromCache(\n    transaction: PersistenceTransaction,\n    documentKeys: DocumentKeySet\n  ): PersistencePromise<MutableDocumentMap> {\n    // Record the size of everything we load from the cache so we can compute\n    // a delta later.\n    return this.documentCache\n      .getSizedEntries(transaction, documentKeys)\n      .next(({ documents, sizeMap }) => {\n        // Note: `getAllFromCache` returns two maps instead of a single map from\n        // keys to `DocumentSizeEntry`s. This is to allow returning the\n        // `MutableDocumentMap` directly, without a conversion.\n        sizeMap.forEach((documentKey, size) => {\n          this.documentStates.set(documentKey, {\n            size,\n            readTime: documents.get(documentKey)!.readTime\n          });\n        });\n        return documents;\n      });\n  }\n}\n\nfunction documentGlobalStore(\n  txn: PersistenceTransaction\n): SimpleDbStore<DbRemoteDocumentGlobalKey, DbRemoteDocumentGlobal> {\n  return getStore<DbRemoteDocumentGlobalKey, DbRemoteDocumentGlobal>(\n    txn,\n    DbRemoteDocumentGlobalStore\n  );\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the remoteDocuments object store.\n */\nfunction remoteDocumentsStore(\n  txn: PersistenceTransaction\n): SimpleDbStore<DbRemoteDocumentKey, DbRemoteDocument> {\n  return getStore<DbRemoteDocumentKey, DbRemoteDocument>(\n    txn,\n    DbRemoteDocumentStore\n  );\n}\n\n/**\n * Returns a key that can be used for document lookups on the\n * `DbRemoteDocumentDocumentKeyIndex` index.\n */\nfunction dbKey(documentKey: DocumentKey): [string[], string, string] {\n  const path = documentKey.path.toArray();\n  return [\n    /* prefix path */ path.slice(0, path.length - 2),\n    /* collection id */ path[path.length - 2],\n    /* document id */ path[path.length - 1]\n  ];\n}\n\n/**\n * Returns a key that can be used for document lookups via the primary key of\n * the DbRemoteDocument object store.\n */\nfunction dbReadTimeKey(\n  documentKey: DocumentKey,\n  readTime: SnapshotVersion\n): DbRemoteDocumentKey {\n  const path = documentKey.path.toArray();\n  return [\n    /* prefix path */ path.slice(0, path.length - 2),\n    /* collection id */ path[path.length - 2],\n    toDbTimestampKey(readTime),\n    /* document id */ path[path.length - 1]\n  ];\n}\n\n/**\n * Returns a key that can be used for document lookups on the\n * `DbRemoteDocumentDocumentCollectionGroupIndex` index.\n */\nfunction dbCollectionGroupKey(\n  collectionGroup: string,\n  offset: IndexOffset\n): [string, DbTimestampKey, string[], string] {\n  const path = offset.documentKey.path.toArray();\n  return [\n    /* collection id */ collectionGroup,\n    toDbTimestampKey(offset.readTime),\n    /* prefix path */ path.slice(0, path.length - 2),\n    /* document id */ path.length > 0 ? path[path.length - 1] : ''\n  ];\n}\n\n/**\n * Comparator that compares document keys according to the primary key sorting\n * used by the `DbRemoteDocumentDocument` store (by prefix path, collection id\n * and then document ID).\n *\n * Visible for testing.\n */\nexport function dbKeyComparator(l: DocumentKey, r: DocumentKey): number {\n  const left = l.path.toArray();\n  const right = r.path.toArray();\n\n  // The ordering is based on https://chromium.googlesource.com/chromium/blink/+/fe5c21fef94dae71c1c3344775b8d8a7f7e6d9ec/Source/modules/indexeddb/IDBKey.cpp#74\n  let cmp = 0;\n  for (let i = 0; i < left.length - 2 && i < right.length - 2; ++i) {\n    cmp = primitiveComparator(left[i], right[i]);\n    if (cmp) {\n      return cmp;\n    }\n  }\n\n  cmp = primitiveComparator(left.length, right.length);\n  if (cmp) {\n    return cmp;\n  }\n\n  cmp = primitiveComparator(left[left.length - 2], right[right.length - 2]);\n  if (cmp) {\n    return cmp;\n  }\n\n  return primitiveComparator(left[left.length - 1], right[right.length - 1]);\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Document } from '../model/document';\nimport { FieldMask } from '../model/field_mask';\n\n/**\n * Represents a local view (overlay) of a document, and the fields that are\n * locally mutated.\n */\nexport class OverlayedDocument {\n  constructor(\n    readonly overlayedDocument: Document,\n\n    /**\n     * The fields that are locally mutated by patch mutations.\n     *\n     * If the overlayed\tdocument is from set or delete mutations, this is `null`.\n     * If there is no overlay (mutation) for the document, this is an empty `FieldMask`.\n     */\n    readonly mutatedFields: FieldMask | null\n  ) {}\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  asCollectionQueryAtPath,\n  isCollectionGroupQuery,\n  isDocumentQuery,\n  Query,\n  queryMatches\n} from '../core/query';\nimport { Timestamp } from '../lite-api/timestamp';\nimport {\n  DocumentKeySet,\n  OverlayMap,\n  DocumentMap,\n  MutableDocumentMap,\n  newDocumentKeyMap,\n  newMutationMap,\n  newOverlayMap,\n  documentMap,\n  mutableDocumentMap,\n  documentKeySet,\n  DocumentKeyMap,\n  convertOverlayedDocumentMapToDocumentMap,\n  OverlayedDocumentMap,\n  newOverlayedDocumentMap\n} from '../model/collections';\nimport { Document, MutableDocument } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport { IndexOffset, INITIAL_LARGEST_BATCH_ID } from '../model/field_index';\nimport { FieldMask } from '../model/field_mask';\nimport {\n  calculateOverlayMutation,\n  mutationApplyToLocalView,\n  PatchMutation\n} from '../model/mutation';\nimport { Overlay } from '../model/overlay';\nimport { ResourcePath } from '../model/path';\nimport { debugAssert } from '../util/assert';\nimport { SortedMap } from '../util/sorted_map';\n\nimport { DocumentOverlayCache } from './document_overlay_cache';\nimport { IndexManager } from './index_manager';\nimport { LocalWriteResult } from './local_store_impl';\nimport { MutationQueue } from './mutation_queue';\nimport { OverlayedDocument } from './overlayed_document';\nimport { PersistencePromise } from './persistence_promise';\nimport { PersistenceTransaction } from './persistence_transaction';\nimport { QueryContext } from './query_context';\nimport { RemoteDocumentCache } from './remote_document_cache';\n\n/**\n * A readonly view of the local state of all documents we're tracking (i.e. we\n * have a cached version in remoteDocumentCache or local mutations for the\n * document). The view is computed by applying the mutations in the\n * MutationQueue to the RemoteDocumentCache.\n */\nexport class LocalDocumentsView {\n  constructor(\n    readonly remoteDocumentCache: RemoteDocumentCache,\n    readonly mutationQueue: MutationQueue,\n    readonly documentOverlayCache: DocumentOverlayCache,\n    readonly indexManager: IndexManager\n  ) {}\n\n  /**\n   * Get the local view of the document identified by `key`.\n   *\n   * @returns Local view of the document or null if we don't have any cached\n   * state for it.\n   */\n  getDocument(\n    transaction: PersistenceTransaction,\n    key: DocumentKey\n  ): PersistencePromise<Document> {\n    let overlay: Overlay | null = null;\n    return this.documentOverlayCache\n      .getOverlay(transaction, key)\n      .next(value => {\n        overlay = value;\n        return this.remoteDocumentCache.getEntry(transaction, key);\n      })\n      .next(document => {\n        if (overlay !== null) {\n          mutationApplyToLocalView(\n            overlay.mutation,\n            document,\n            FieldMask.empty(),\n            Timestamp.now()\n          );\n        }\n        return document as Document;\n      });\n  }\n\n  /**\n   * Gets the local view of the documents identified by `keys`.\n   *\n   * If we don't have cached state for a document in `keys`, a NoDocument will\n   * be stored for that key in the resulting set.\n   */\n  getDocuments(\n    transaction: PersistenceTransaction,\n    keys: DocumentKeySet\n  ): PersistencePromise<DocumentMap> {\n    return this.remoteDocumentCache\n      .getEntries(transaction, keys)\n      .next(docs =>\n        this.getLocalViewOfDocuments(transaction, docs, documentKeySet()).next(\n          () => docs as DocumentMap\n        )\n      );\n  }\n\n  /**\n   * Similar to `getDocuments`, but creates the local view from the given\n   * `baseDocs` without retrieving documents from the local store.\n   *\n   * @param transaction - The transaction this operation is scoped to.\n   * @param docs - The documents to apply local mutations to get the local views.\n   * @param existenceStateChanged - The set of document keys whose existence state\n   *   is changed. This is useful to determine if some documents overlay needs\n   *   to be recalculated.\n   */\n  getLocalViewOfDocuments(\n    transaction: PersistenceTransaction,\n    docs: MutableDocumentMap,\n    existenceStateChanged: DocumentKeySet = documentKeySet()\n  ): PersistencePromise<DocumentMap> {\n    const overlays = newOverlayMap();\n    return this.populateOverlays(transaction, overlays, docs).next(() => {\n      return this.computeViews(\n        transaction,\n        docs,\n        overlays,\n        existenceStateChanged\n      ).next(computeViewsResult => {\n        let result = documentMap();\n        computeViewsResult.forEach((documentKey, overlayedDocument) => {\n          result = result.insert(\n            documentKey,\n            overlayedDocument.overlayedDocument\n          );\n        });\n        return result;\n      });\n    });\n  }\n\n  /**\n   * Gets the overlayed documents for the given document map, which will include\n   * the local view of those documents and a `FieldMask` indicating which fields\n   * are mutated locally, `null` if overlay is a Set or Delete mutation.\n   */\n  getOverlayedDocuments(\n    transaction: PersistenceTransaction,\n    docs: MutableDocumentMap\n  ): PersistencePromise<OverlayedDocumentMap> {\n    const overlays = newOverlayMap();\n    return this.populateOverlays(transaction, overlays, docs).next(() =>\n      this.computeViews(transaction, docs, overlays, documentKeySet())\n    );\n  }\n\n  /**\n   * Fetches the overlays for {@code docs} and adds them to provided overlay map\n   * if the map does not already contain an entry for the given document key.\n   */\n  private populateOverlays(\n    transaction: PersistenceTransaction,\n    overlays: OverlayMap,\n    docs: MutableDocumentMap\n  ): PersistencePromise<void> {\n    const missingOverlays: DocumentKey[] = [];\n    docs.forEach(key => {\n      if (!overlays.has(key)) {\n        missingOverlays.push(key);\n      }\n    });\n    return this.documentOverlayCache\n      .getOverlays(transaction, missingOverlays)\n      .next(result => {\n        result.forEach((key, val) => {\n          overlays.set(key, val);\n        });\n      });\n  }\n\n  /**\n   * Computes the local view for the given documents.\n   *\n   * @param docs - The documents to compute views for. It also has the base\n   *   version of the documents.\n   * @param overlays - The overlays that need to be applied to the given base\n   *   version of the documents.\n   * @param existenceStateChanged - A set of documents whose existence states\n   *   might have changed. This is used to determine if we need to re-calculate\n   *   overlays from mutation queues.\n   * @return A map represents the local documents view.\n   */\n  computeViews(\n    transaction: PersistenceTransaction,\n    docs: MutableDocumentMap,\n    overlays: OverlayMap,\n    existenceStateChanged: DocumentKeySet\n  ): PersistencePromise<OverlayedDocumentMap> {\n    let recalculateDocuments = mutableDocumentMap();\n    const mutatedFields = newDocumentKeyMap<FieldMask | null>();\n    const results = newOverlayedDocumentMap();\n    docs.forEach((_, doc) => {\n      const overlay = overlays.get(doc.key);\n      // Recalculate an overlay if the document's existence state changed due to\n      // a remote event *and* the overlay is a PatchMutation. This is because\n      // document existence state can change if some patch mutation's\n      // preconditions are met.\n      // NOTE: we recalculate when `overlay` is undefined as well, because there\n      // might be a patch mutation whose precondition does not match before the\n      // change (hence overlay is undefined), but would now match.\n      if (\n        existenceStateChanged.has(doc.key) &&\n        (overlay === undefined || overlay.mutation instanceof PatchMutation)\n      ) {\n        recalculateDocuments = recalculateDocuments.insert(doc.key, doc);\n      } else if (overlay !== undefined) {\n        mutatedFields.set(doc.key, overlay.mutation.getFieldMask());\n        mutationApplyToLocalView(\n          overlay.mutation,\n          doc,\n          overlay.mutation.getFieldMask(),\n          Timestamp.now()\n        );\n      } else {\n        // no overlay exists\n        // Using EMPTY to indicate there is no overlay for the document.\n        mutatedFields.set(doc.key, FieldMask.empty());\n      }\n    });\n\n    return this.recalculateAndSaveOverlays(\n      transaction,\n      recalculateDocuments\n    ).next(recalculatedFields => {\n      recalculatedFields.forEach((documentKey, mask) =>\n        mutatedFields.set(documentKey, mask)\n      );\n      docs.forEach((documentKey, document) =>\n        results.set(\n          documentKey,\n          new OverlayedDocument(\n            document,\n            mutatedFields.get(documentKey) ?? null\n          )\n        )\n      );\n      return results;\n    });\n  }\n\n  private recalculateAndSaveOverlays(\n    transaction: PersistenceTransaction,\n    docs: MutableDocumentMap\n  ): PersistencePromise<DocumentKeyMap<FieldMask | null>> {\n    const masks = newDocumentKeyMap<FieldMask | null>();\n    // A reverse lookup map from batch id to the documents within that batch.\n    let documentsByBatchId = new SortedMap<number, DocumentKeySet>(\n      (key1: number, key2: number) => key1 - key2\n    );\n    let processed = documentKeySet();\n    return this.mutationQueue\n      .getAllMutationBatchesAffectingDocumentKeys(transaction, docs)\n      .next(batches => {\n        for (const batch of batches) {\n          batch.keys().forEach(key => {\n            const baseDoc = docs.get(key);\n            if (baseDoc === null) {\n              return;\n            }\n            let mask: FieldMask | null = masks.get(key) || FieldMask.empty();\n            mask = batch.applyToLocalView(baseDoc, mask);\n            masks.set(key, mask);\n            const newSet = (\n              documentsByBatchId.get(batch.batchId) || documentKeySet()\n            ).add(key);\n            documentsByBatchId = documentsByBatchId.insert(\n              batch.batchId,\n              newSet\n            );\n          });\n        }\n      })\n      .next(() => {\n        const promises: Array<PersistencePromise<void>> = [];\n        // Iterate in descending order of batch IDs, and skip documents that are\n        // already saved.\n        const iter = documentsByBatchId.getReverseIterator();\n        while (iter.hasNext()) {\n          const entry = iter.getNext();\n          const batchId = entry.key;\n          const keys = entry.value;\n          const overlays = newMutationMap();\n          keys.forEach(key => {\n            if (!processed.has(key)) {\n              const overlayMutation = calculateOverlayMutation(\n                docs.get(key)!,\n                masks.get(key)!\n              );\n              if (overlayMutation !== null) {\n                overlays.set(key, overlayMutation);\n              }\n              processed = processed.add(key);\n            }\n          });\n          promises.push(\n            this.documentOverlayCache.saveOverlays(\n              transaction,\n              batchId,\n              overlays\n            )\n          );\n        }\n        return PersistencePromise.waitFor(promises);\n      })\n      .next(() => masks);\n  }\n\n  /**\n   * Recalculates overlays by reading the documents from remote document cache\n   * first, and saves them after they are calculated.\n   */\n  recalculateAndSaveOverlaysForDocumentKeys(\n    transaction: PersistenceTransaction,\n    documentKeys: DocumentKeySet\n  ): PersistencePromise<DocumentKeyMap<FieldMask | null>> {\n    return this.remoteDocumentCache\n      .getEntries(transaction, documentKeys)\n      .next(docs => this.recalculateAndSaveOverlays(transaction, docs));\n  }\n\n  /**\n   * Performs a query against the local view of all documents.\n   *\n   * @param transaction - The persistence transaction.\n   * @param query - The query to match documents against.\n   * @param offset - Read time and key to start scanning by (exclusive).\n   * @param context - A optional tracker to keep a record of important details\n   *   during database local query execution.\n   */\n  getDocumentsMatchingQuery(\n    transaction: PersistenceTransaction,\n    query: Query,\n    offset: IndexOffset,\n    context?: QueryContext\n  ): PersistencePromise<DocumentMap> {\n    if (isDocumentQuery(query)) {\n      return this.getDocumentsMatchingDocumentQuery(transaction, query.path);\n    } else if (isCollectionGroupQuery(query)) {\n      return this.getDocumentsMatchingCollectionGroupQuery(\n        transaction,\n        query,\n        offset,\n        context\n      );\n    } else {\n      return this.getDocumentsMatchingCollectionQuery(\n        transaction,\n        query,\n        offset,\n        context\n      );\n    }\n  }\n\n  /**\n   * Given a collection group, returns the next documents that follow the provided offset, along\n   * with an updated batch ID.\n   *\n   * <p>The documents returned by this method are ordered by remote version from the provided\n   * offset. If there are no more remote documents after the provided offset, documents with\n   * mutations in order of batch id from the offset are returned. Since all documents in a batch are\n   * returned together, the total number of documents returned can exceed {@code count}.\n   *\n   * @param transaction\n   * @param collectionGroup The collection group for the documents.\n   * @param offset The offset to index into.\n   * @param count The number of documents to return\n   * @return A LocalWriteResult with the documents that follow the provided offset and the last processed batch id.\n   */\n  getNextDocuments(\n    transaction: PersistenceTransaction,\n    collectionGroup: string,\n    offset: IndexOffset,\n    count: number\n  ): PersistencePromise<LocalWriteResult> {\n    return this.remoteDocumentCache\n      .getAllFromCollectionGroup(transaction, collectionGroup, offset, count)\n      .next((originalDocs: MutableDocumentMap) => {\n        const overlaysPromise: PersistencePromise<OverlayMap> =\n          count - originalDocs.size > 0\n            ? this.documentOverlayCache.getOverlaysForCollectionGroup(\n                transaction,\n                collectionGroup,\n                offset.largestBatchId,\n                count - originalDocs.size\n              )\n            : PersistencePromise.resolve(newOverlayMap());\n        // The callsite will use the largest batch ID together with the latest read time to create\n        // a new index offset. Since we only process batch IDs if all remote documents have been read,\n        // no overlay will increase the overall read time. This is why we only need to special case\n        // the batch id.\n        let largestBatchId = INITIAL_LARGEST_BATCH_ID;\n        let modifiedDocs = originalDocs;\n        return overlaysPromise.next(overlays => {\n          return PersistencePromise.forEach(\n            overlays,\n            (key: DocumentKey, overlay: Overlay) => {\n              if (largestBatchId < overlay.largestBatchId) {\n                largestBatchId = overlay.largestBatchId;\n              }\n              if (originalDocs.get(key)) {\n                return PersistencePromise.resolve();\n              }\n              return this.remoteDocumentCache\n                .getEntry(transaction, key)\n                .next(doc => {\n                  modifiedDocs = modifiedDocs.insert(key, doc);\n                });\n            }\n          )\n            .next(() =>\n              this.populateOverlays(transaction, overlays, originalDocs)\n            )\n            .next(() =>\n              this.computeViews(\n                transaction,\n                modifiedDocs,\n                overlays,\n                documentKeySet()\n              )\n            )\n            .next(localDocs => ({\n              batchId: largestBatchId,\n              changes: convertOverlayedDocumentMapToDocumentMap(localDocs)\n            }));\n        });\n      });\n  }\n\n  private getDocumentsMatchingDocumentQuery(\n    transaction: PersistenceTransaction,\n    docPath: ResourcePath\n  ): PersistencePromise<DocumentMap> {\n    // Just do a simple document lookup.\n    return this.getDocument(transaction, new DocumentKey(docPath)).next(\n      document => {\n        let result = documentMap();\n        if (document.isFoundDocument()) {\n          result = result.insert(document.key, document);\n        }\n        return result;\n      }\n    );\n  }\n\n  private getDocumentsMatchingCollectionGroupQuery(\n    transaction: PersistenceTransaction,\n    query: Query,\n    offset: IndexOffset,\n    context?: QueryContext\n  ): PersistencePromise<DocumentMap> {\n    debugAssert(\n      query.path.isEmpty(),\n      'Currently we only support collection group queries at the root.'\n    );\n    const collectionId = query.collectionGroup!;\n    let results = documentMap();\n    return this.indexManager\n      .getCollectionParents(transaction, collectionId)\n      .next(parents => {\n        // Perform a collection query against each parent that contains the\n        // collectionId and aggregate the results.\n        return PersistencePromise.forEach(parents, (parent: ResourcePath) => {\n          const collectionQuery = asCollectionQueryAtPath(\n            query,\n            parent.child(collectionId)\n          );\n          return this.getDocumentsMatchingCollectionQuery(\n            transaction,\n            collectionQuery,\n            offset,\n            context\n          ).next(r => {\n            r.forEach((key, doc) => {\n              results = results.insert(key, doc);\n            });\n          });\n        }).next(() => results);\n      });\n  }\n\n  private getDocumentsMatchingCollectionQuery(\n    transaction: PersistenceTransaction,\n    query: Query,\n    offset: IndexOffset,\n    context?: QueryContext\n  ): PersistencePromise<DocumentMap> {\n    // Query the remote documents and overlay mutations.\n    let overlays: OverlayMap;\n    return this.documentOverlayCache\n      .getOverlaysForCollection(transaction, query.path, offset.largestBatchId)\n      .next(result => {\n        overlays = result;\n        return this.remoteDocumentCache.getDocumentsMatchingQuery(\n          transaction,\n          query,\n          offset,\n          overlays,\n          context\n        );\n      })\n      .next(remoteDocuments => {\n        // As documents might match the query because of their overlay we need to\n        // include documents for all overlays in the initial document set.\n        overlays.forEach((_, overlay) => {\n          const key = overlay.getKey();\n          if (remoteDocuments.get(key) === null) {\n            remoteDocuments = remoteDocuments.insert(\n              key,\n              MutableDocument.newInvalidDocument(key)\n            );\n          }\n        });\n\n        // Apply the overlays and match against the query.\n        let results = documentMap();\n        remoteDocuments.forEach((key, document) => {\n          const overlay = overlays.get(key);\n          if (overlay !== undefined) {\n            mutationApplyToLocalView(\n              overlay.mutation,\n              document,\n              FieldMask.empty(),\n              Timestamp.now()\n            );\n          }\n          // Finally, insert the documents that still match the query\n          if (queryMatches(query, document)) {\n            results = results.insert(key, document);\n          }\n        });\n        return results;\n      });\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BundleMetadata, NamedQuery } from '../core/bundle';\nimport {\n  NamedQuery as ProtoNamedQuery,\n  BundleMetadata as ProtoBundleMetadata\n} from '../protos/firestore_bundle_proto';\n\nimport { BundleCache } from './bundle_cache';\nimport {\n  fromBundleMetadata,\n  fromProtoNamedQuery,\n  LocalSerializer\n} from './local_serializer';\nimport { PersistencePromise } from './persistence_promise';\nimport { PersistenceTransaction } from './persistence_transaction';\n\nexport class MemoryBundleCache implements BundleCache {\n  private bundles = new Map<string, BundleMetadata>();\n  private namedQueries = new Map<string, NamedQuery>();\n\n  constructor(private serializer: LocalSerializer) {}\n\n  getBundleMetadata(\n    transaction: PersistenceTransaction,\n    bundleId: string\n  ): PersistencePromise<BundleMetadata | undefined> {\n    return PersistencePromise.resolve(this.bundles.get(bundleId));\n  }\n\n  saveBundleMetadata(\n    transaction: PersistenceTransaction,\n    bundleMetadata: ProtoBundleMetadata\n  ): PersistencePromise<void> {\n    this.bundles.set(bundleMetadata.id!, fromBundleMetadata(bundleMetadata));\n    return PersistencePromise.resolve();\n  }\n\n  getNamedQuery(\n    transaction: PersistenceTransaction,\n    queryName: string\n  ): PersistencePromise<NamedQuery | undefined> {\n    return PersistencePromise.resolve(this.namedQueries.get(queryName));\n  }\n\n  saveNamedQuery(\n    transaction: PersistenceTransaction,\n    query: ProtoNamedQuery\n  ): PersistencePromise<void> {\n    this.namedQueries.set(query.name!, fromProtoNamedQuery(query));\n    return PersistencePromise.resolve();\n  }\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  documentKeySet,\n  DocumentKeySet,\n  MutationMap,\n  OverlayMap,\n  newOverlayMap\n} from '../model/collections';\nimport { DocumentKey } from '../model/document_key';\nimport { Mutation } from '../model/mutation';\nimport { Overlay } from '../model/overlay';\nimport { ResourcePath } from '../model/path';\nimport { SortedMap } from '../util/sorted_map';\n\nimport { DocumentOverlayCache } from './document_overlay_cache';\nimport { PersistencePromise } from './persistence_promise';\nimport { PersistenceTransaction } from './persistence_transaction';\n\n/**\n * An in-memory implementation of DocumentOverlayCache.\n */\nexport class MemoryDocumentOverlayCache implements DocumentOverlayCache {\n  // A map sorted by DocumentKey, whose value is a pair of the largest batch id\n  // for the overlay and the overlay itself.\n  private overlays = new SortedMap<DocumentKey, Overlay>(\n    DocumentKey.comparator\n  );\n  private overlayByBatchId = new Map<number, DocumentKeySet>();\n\n  getOverlay(\n    transaction: PersistenceTransaction,\n    key: DocumentKey\n  ): PersistencePromise<Overlay | null> {\n    return PersistencePromise.resolve(this.overlays.get(key));\n  }\n\n  getOverlays(\n    transaction: PersistenceTransaction,\n    keys: DocumentKey[]\n  ): PersistencePromise<OverlayMap> {\n    const result = newOverlayMap();\n    return PersistencePromise.forEach(keys, (key: DocumentKey) => {\n      return this.getOverlay(transaction, key).next(overlay => {\n        if (overlay !== null) {\n          result.set(key, overlay);\n        }\n      });\n    }).next(() => result);\n  }\n\n  saveOverlays(\n    transaction: PersistenceTransaction,\n    largestBatchId: number,\n    overlays: MutationMap\n  ): PersistencePromise<void> {\n    overlays.forEach((_, mutation) => {\n      this.saveOverlay(transaction, largestBatchId, mutation);\n    });\n    return PersistencePromise.resolve();\n  }\n\n  removeOverlaysForBatchId(\n    transaction: PersistenceTransaction,\n    documentKeys: DocumentKeySet,\n    batchId: number\n  ): PersistencePromise<void> {\n    const keys = this.overlayByBatchId.get(batchId);\n    if (keys !== undefined) {\n      keys.forEach(key => (this.overlays = this.overlays.remove(key)));\n      this.overlayByBatchId.delete(batchId);\n    }\n    return PersistencePromise.resolve();\n  }\n\n  getOverlaysForCollection(\n    transaction: PersistenceTransaction,\n    collection: ResourcePath,\n    sinceBatchId: number\n  ): PersistencePromise<OverlayMap> {\n    const result = newOverlayMap();\n\n    const immediateChildrenPathLength = collection.length + 1;\n    const prefix = new DocumentKey(collection.child(''));\n    const iter = this.overlays.getIteratorFrom(prefix);\n    while (iter.hasNext()) {\n      const entry = iter.getNext();\n      const overlay = entry.value;\n      const key = overlay.getKey();\n      if (!collection.isPrefixOf(key.path)) {\n        break;\n      }\n      // Documents from sub-collections\n      if (key.path.length !== immediateChildrenPathLength) {\n        continue;\n      }\n      if (overlay.largestBatchId > sinceBatchId) {\n        result.set(overlay.getKey(), overlay);\n      }\n    }\n\n    return PersistencePromise.resolve(result);\n  }\n\n  getOverlaysForCollectionGroup(\n    transaction: PersistenceTransaction,\n    collectionGroup: string,\n    sinceBatchId: number,\n    count: number\n  ): PersistencePromise<OverlayMap> {\n    let batchIdToOverlays = new SortedMap<number, OverlayMap>(\n      (key1: number, key2: number) => key1 - key2\n    );\n\n    const iter = this.overlays.getIterator();\n    while (iter.hasNext()) {\n      const entry = iter.getNext();\n      const overlay = entry.value;\n      const key = overlay.getKey();\n      if (key.getCollectionGroup() !== collectionGroup) {\n        continue;\n      }\n      if (overlay.largestBatchId > sinceBatchId) {\n        let overlaysForBatchId = batchIdToOverlays.get(overlay.largestBatchId);\n        if (overlaysForBatchId === null) {\n          overlaysForBatchId = newOverlayMap();\n          batchIdToOverlays = batchIdToOverlays.insert(\n            overlay.largestBatchId,\n            overlaysForBatchId\n          );\n        }\n        overlaysForBatchId.set(overlay.getKey(), overlay);\n      }\n    }\n\n    const result = newOverlayMap();\n    const batchIter = batchIdToOverlays.getIterator();\n    while (batchIter.hasNext()) {\n      const entry = batchIter.getNext();\n      const overlays = entry.value;\n      overlays.forEach((key, overlay) => result.set(key, overlay));\n      if (result.size() >= count) {\n        break;\n      }\n    }\n    return PersistencePromise.resolve(result);\n  }\n\n  private saveOverlay(\n    transaction: PersistenceTransaction,\n    largestBatchId: number,\n    mutation: Mutation\n  ): void {\n    // Remove the association of the overlay to its batch id.\n    const existing = this.overlays.get(mutation.key);\n    if (existing !== null) {\n      const newSet = this.overlayByBatchId\n        .get(existing.largestBatchId)!\n        .delete(mutation.key);\n      this.overlayByBatchId.set(existing.largestBatchId, newSet);\n    }\n\n    this.overlays = this.overlays.insert(\n      mutation.key,\n      new Overlay(largestBatchId, mutation)\n    );\n\n    // Create the association of this overlay to the given largestBatchId.\n    let batch = this.overlayByBatchId.get(largestBatchId);\n    if (batch === undefined) {\n      batch = documentKeySet();\n      this.overlayByBatchId.set(largestBatchId, batch);\n    }\n    this.overlayByBatchId.set(largestBatchId, batch.add(mutation.key));\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BatchId, TargetId } from '../core/types';\nimport { documentKeySet, DocumentKeySet } from '../model/collections';\nimport { DocumentKey } from '../model/document_key';\nimport { ResourcePath } from '../model/path';\nimport { primitiveComparator } from '../util/misc';\nimport { SortedSet } from '../util/sorted_set';\n\n/**\n * A collection of references to a document from some kind of numbered entity\n * (either a target ID or batch ID). As references are added to or removed from\n * the set corresponding events are emitted to a registered garbage collector.\n *\n * Each reference is represented by a DocumentReference object. Each of them\n * contains enough information to uniquely identify the reference. They are all\n * stored primarily in a set sorted by key. A document is considered garbage if\n * there's no references in that set (this can be efficiently checked thanks to\n * sorting by key).\n *\n * ReferenceSet also keeps a secondary set that contains references sorted by\n * IDs. This one is used to efficiently implement removal of all references by\n * some target ID.\n */\nexport class ReferenceSet {\n  // A set of outstanding references to a document sorted by key.\n  private refsByKey = new SortedSet(DocReference.compareByKey);\n\n  // A set of outstanding references to a document sorted by target id.\n  private refsByTarget = new SortedSet(DocReference.compareByTargetId);\n\n  /** Returns true if the reference set contains no references. */\n  isEmpty(): boolean {\n    return this.refsByKey.isEmpty();\n  }\n\n  /** Adds a reference to the given document key for the given ID. */\n  addReference(key: DocumentKey, id: TargetId | BatchId): void {\n    const ref = new DocReference(key, id);\n    this.refsByKey = this.refsByKey.add(ref);\n    this.refsByTarget = this.refsByTarget.add(ref);\n  }\n\n  /** Add references to the given document keys for the given ID. */\n  addReferences(keys: DocumentKeySet, id: TargetId | BatchId): void {\n    keys.forEach(key => this.addReference(key, id));\n  }\n\n  /**\n   * Removes a reference to the given document key for the given\n   * ID.\n   */\n  removeReference(key: DocumentKey, id: TargetId | BatchId): void {\n    this.removeRef(new DocReference(key, id));\n  }\n\n  removeReferences(keys: DocumentKeySet, id: TargetId | BatchId): void {\n    keys.forEach(key => this.removeReference(key, id));\n  }\n\n  /**\n   * Clears all references with a given ID. Calls removeRef() for each key\n   * removed.\n   */\n  removeReferencesForId(id: TargetId | BatchId): DocumentKey[] {\n    const emptyKey = new DocumentKey(new ResourcePath([]));\n    const startRef = new DocReference(emptyKey, id);\n    const endRef = new DocReference(emptyKey, id + 1);\n    const keys: DocumentKey[] = [];\n    this.refsByTarget.forEachInRange([startRef, endRef], ref => {\n      this.removeRef(ref);\n      keys.push(ref.key);\n    });\n    return keys;\n  }\n\n  removeAllReferences(): void {\n    this.refsByKey.forEach(ref => this.removeRef(ref));\n  }\n\n  private removeRef(ref: DocReference): void {\n    this.refsByKey = this.refsByKey.delete(ref);\n    this.refsByTarget = this.refsByTarget.delete(ref);\n  }\n\n  referencesForId(id: TargetId | BatchId): DocumentKeySet {\n    const emptyKey = new DocumentKey(new ResourcePath([]));\n    const startRef = new DocReference(emptyKey, id);\n    const endRef = new DocReference(emptyKey, id + 1);\n    let keys = documentKeySet();\n    this.refsByTarget.forEachInRange([startRef, endRef], ref => {\n      keys = keys.add(ref.key);\n    });\n    return keys;\n  }\n\n  containsKey(key: DocumentKey): boolean {\n    const ref = new DocReference(key, 0);\n    const firstRef = this.refsByKey.firstAfterOrEqual(ref);\n    return firstRef !== null && key.isEqual(firstRef.key);\n  }\n}\n\nexport class DocReference {\n  constructor(\n    public key: DocumentKey,\n    public targetOrBatchId: TargetId | BatchId\n  ) {}\n\n  /** Compare by key then by ID */\n  static compareByKey(left: DocReference, right: DocReference): number {\n    return (\n      DocumentKey.comparator(left.key, right.key) ||\n      primitiveComparator(left.targetOrBatchId, right.targetOrBatchId)\n    );\n  }\n\n  /** Compare by ID then by key */\n  static compareByTargetId(left: DocReference, right: DocReference): number {\n    return (\n      primitiveComparator(left.targetOrBatchId, right.targetOrBatchId) ||\n      DocumentKey.comparator(left.key, right.key)\n    );\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isCollectionGroupQuery, Query } from '../core/query';\nimport { BatchId } from '../core/types';\nimport { Timestamp } from '../lite-api/timestamp';\nimport { DocumentKey } from '../model/document_key';\nimport { Mutation } from '../model/mutation';\nimport { MutationBatch } from '../model/mutation_batch';\nimport { debugAssert, hardAssert } from '../util/assert';\nimport { primitiveComparator } from '../util/misc';\nimport { SortedMap } from '../util/sorted_map';\nimport { SortedSet } from '../util/sorted_set';\nimport { BATCHID_UNKNOWN } from '../util/types';\n\nimport { IndexManager } from './index_manager';\nimport { MutationQueue } from './mutation_queue';\nimport { ReferenceDelegate } from './persistence';\nimport { PersistencePromise } from './persistence_promise';\nimport { PersistenceTransaction } from './persistence_transaction';\nimport { DocReference } from './reference_set';\n\nexport class MemoryMutationQueue implements MutationQueue {\n  /**\n   * The set of all mutations that have been sent but not yet been applied to\n   * the backend.\n   */\n  private mutationQueue: MutationBatch[] = [];\n\n  /** Next value to use when assigning sequential IDs to each mutation batch. */\n  private nextBatchId: BatchId = 1;\n\n  /** An ordered mapping between documents and the mutations batch IDs. */\n  private batchesByDocumentKey = new SortedSet(DocReference.compareByKey);\n\n  constructor(\n    private readonly indexManager: IndexManager,\n    private readonly referenceDelegate: ReferenceDelegate\n  ) {}\n\n  checkEmpty(transaction: PersistenceTransaction): PersistencePromise<boolean> {\n    return PersistencePromise.resolve(this.mutationQueue.length === 0);\n  }\n\n  addMutationBatch(\n    transaction: PersistenceTransaction,\n    localWriteTime: Timestamp,\n    baseMutations: Mutation[],\n    mutations: Mutation[]\n  ): PersistencePromise<MutationBatch> {\n    debugAssert(mutations.length !== 0, 'Mutation batches should not be empty');\n\n    const batchId = this.nextBatchId;\n    this.nextBatchId++;\n\n    if (this.mutationQueue.length > 0) {\n      const prior = this.mutationQueue[this.mutationQueue.length - 1];\n      debugAssert(\n        prior.batchId < batchId,\n        'Mutation batchIDs must be monotonically increasing order'\n      );\n    }\n\n    const batch = new MutationBatch(\n      batchId,\n      localWriteTime,\n      baseMutations,\n      mutations\n    );\n    this.mutationQueue.push(batch);\n\n    // Track references by document key and index collection parents.\n    for (const mutation of mutations) {\n      this.batchesByDocumentKey = this.batchesByDocumentKey.add(\n        new DocReference(mutation.key, batchId)\n      );\n\n      this.indexManager.addToCollectionParentIndex(\n        transaction,\n        mutation.key.path.popLast()\n      );\n    }\n\n    return PersistencePromise.resolve(batch);\n  }\n\n  lookupMutationBatch(\n    transaction: PersistenceTransaction,\n    batchId: BatchId\n  ): PersistencePromise<MutationBatch | null> {\n    return PersistencePromise.resolve(this.findMutationBatch(batchId));\n  }\n\n  getNextMutationBatchAfterBatchId(\n    transaction: PersistenceTransaction,\n    batchId: BatchId\n  ): PersistencePromise<MutationBatch | null> {\n    const nextBatchId = batchId + 1;\n\n    // The requested batchId may still be out of range so normalize it to the\n    // start of the queue.\n    const rawIndex = this.indexOfBatchId(nextBatchId);\n    const index = rawIndex < 0 ? 0 : rawIndex;\n    return PersistencePromise.resolve(\n      this.mutationQueue.length > index ? this.mutationQueue[index] : null\n    );\n  }\n\n  getHighestUnacknowledgedBatchId(): PersistencePromise<BatchId> {\n    return PersistencePromise.resolve(\n      this.mutationQueue.length === 0 ? BATCHID_UNKNOWN : this.nextBatchId - 1\n    );\n  }\n\n  getAllMutationBatches(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<MutationBatch[]> {\n    return PersistencePromise.resolve(this.mutationQueue.slice());\n  }\n\n  getAllMutationBatchesAffectingDocumentKey(\n    transaction: PersistenceTransaction,\n    documentKey: DocumentKey\n  ): PersistencePromise<MutationBatch[]> {\n    const start = new DocReference(documentKey, 0);\n    const end = new DocReference(documentKey, Number.POSITIVE_INFINITY);\n    const result: MutationBatch[] = [];\n    this.batchesByDocumentKey.forEachInRange([start, end], ref => {\n      debugAssert(\n        documentKey.isEqual(ref.key),\n        \"Should only iterate over a single key's batches\"\n      );\n      const batch = this.findMutationBatch(ref.targetOrBatchId);\n      debugAssert(\n        batch !== null,\n        'Batches in the index must exist in the main table'\n      );\n      result.push(batch!);\n    });\n\n    return PersistencePromise.resolve(result);\n  }\n\n  getAllMutationBatchesAffectingDocumentKeys(\n    transaction: PersistenceTransaction,\n    documentKeys: SortedMap<DocumentKey, unknown>\n  ): PersistencePromise<MutationBatch[]> {\n    let uniqueBatchIDs = new SortedSet<number>(primitiveComparator);\n\n    documentKeys.forEach(documentKey => {\n      const start = new DocReference(documentKey, 0);\n      const end = new DocReference(documentKey, Number.POSITIVE_INFINITY);\n      this.batchesByDocumentKey.forEachInRange([start, end], ref => {\n        debugAssert(\n          documentKey.isEqual(ref.key),\n          \"For each key, should only iterate over a single key's batches\"\n        );\n\n        uniqueBatchIDs = uniqueBatchIDs.add(ref.targetOrBatchId);\n      });\n    });\n\n    return PersistencePromise.resolve(this.findMutationBatches(uniqueBatchIDs));\n  }\n\n  getAllMutationBatchesAffectingQuery(\n    transaction: PersistenceTransaction,\n    query: Query\n  ): PersistencePromise<MutationBatch[]> {\n    debugAssert(\n      !isCollectionGroupQuery(query),\n      'CollectionGroup queries should be handled in LocalDocumentsView'\n    );\n    // Use the query path as a prefix for testing if a document matches the\n    // query.\n    const prefix = query.path;\n    const immediateChildrenPathLength = prefix.length + 1;\n\n    // Construct a document reference for actually scanning the index. Unlike\n    // the prefix the document key in this reference must have an even number of\n    // segments. The empty segment can be used a suffix of the query path\n    // because it precedes all other segments in an ordered traversal.\n    let startPath = prefix;\n    if (!DocumentKey.isDocumentKey(startPath)) {\n      startPath = startPath.child('');\n    }\n\n    const start = new DocReference(new DocumentKey(startPath), 0);\n\n    // Find unique batchIDs referenced by all documents potentially matching the\n    // query.\n    let uniqueBatchIDs = new SortedSet<number>(primitiveComparator);\n\n    this.batchesByDocumentKey.forEachWhile(ref => {\n      const rowKeyPath = ref.key.path;\n      if (!prefix.isPrefixOf(rowKeyPath)) {\n        return false;\n      } else {\n        // Rows with document keys more than one segment longer than the query\n        // path can't be matches. For example, a query on 'rooms' can't match\n        // the document /rooms/abc/messages/xyx.\n        // TODO(mcg): we'll need a different scanner when we implement\n        // ancestor queries.\n        if (rowKeyPath.length === immediateChildrenPathLength) {\n          uniqueBatchIDs = uniqueBatchIDs.add(ref.targetOrBatchId);\n        }\n        return true;\n      }\n    }, start);\n\n    return PersistencePromise.resolve(this.findMutationBatches(uniqueBatchIDs));\n  }\n\n  private findMutationBatches(batchIDs: SortedSet<number>): MutationBatch[] {\n    // Construct an array of matching batches, sorted by batchID to ensure that\n    // multiple mutations affecting the same document key are applied in order.\n    const result: MutationBatch[] = [];\n    batchIDs.forEach(batchId => {\n      const batch = this.findMutationBatch(batchId);\n      if (batch !== null) {\n        result.push(batch);\n      }\n    });\n    return result;\n  }\n\n  removeMutationBatch(\n    transaction: PersistenceTransaction,\n    batch: MutationBatch\n  ): PersistencePromise<void> {\n    // Find the position of the first batch for removal.\n    const batchIndex = this.indexOfExistingBatchId(batch.batchId, 'removed');\n    hardAssert(\n      batchIndex === 0,\n      'Can only remove the first entry of the mutation queue'\n    );\n    this.mutationQueue.shift();\n\n    let references = this.batchesByDocumentKey;\n    return PersistencePromise.forEach(batch.mutations, (mutation: Mutation) => {\n      const ref = new DocReference(mutation.key, batch.batchId);\n      references = references.delete(ref);\n      return this.referenceDelegate.markPotentiallyOrphaned(\n        transaction,\n        mutation.key\n      );\n    }).next(() => {\n      this.batchesByDocumentKey = references;\n    });\n  }\n\n  removeCachedMutationKeys(batchId: BatchId): void {\n    // No-op since the memory mutation queue does not maintain a separate cache.\n  }\n\n  containsKey(\n    txn: PersistenceTransaction,\n    key: DocumentKey\n  ): PersistencePromise<boolean> {\n    const ref = new DocReference(key, 0);\n    const firstRef = this.batchesByDocumentKey.firstAfterOrEqual(ref);\n    return PersistencePromise.resolve(key.isEqual(firstRef && firstRef.key));\n  }\n\n  performConsistencyCheck(\n    txn: PersistenceTransaction\n  ): PersistencePromise<void> {\n    if (this.mutationQueue.length === 0) {\n      debugAssert(\n        this.batchesByDocumentKey.isEmpty(),\n        'Document leak -- detected dangling mutation references when queue is empty.'\n      );\n    }\n    return PersistencePromise.resolve();\n  }\n\n  /**\n   * Finds the index of the given batchId in the mutation queue and asserts that\n   * the resulting index is within the bounds of the queue.\n   *\n   * @param batchId - The batchId to search for\n   * @param action - A description of what the caller is doing, phrased in passive\n   * form (e.g. \"acknowledged\" in a routine that acknowledges batches).\n   */\n  private indexOfExistingBatchId(batchId: BatchId, action: string): number {\n    const index = this.indexOfBatchId(batchId);\n    debugAssert(\n      index >= 0 && index < this.mutationQueue.length,\n      'Batches must exist to be ' + action\n    );\n    return index;\n  }\n\n  /**\n   * Finds the index of the given batchId in the mutation queue. This operation\n   * is O(1).\n   *\n   * @returns The computed index of the batch with the given batchId, based on\n   * the state of the queue. Note this index can be negative if the requested\n   * batchId has already been remvoed from the queue or past the end of the\n   * queue if the batchId is larger than the last added batch.\n   */\n  private indexOfBatchId(batchId: BatchId): number {\n    if (this.mutationQueue.length === 0) {\n      // As an index this is past the end of the queue\n      return 0;\n    }\n\n    // Examine the front of the queue to figure out the difference between the\n    // batchId and indexes in the array. Note that since the queue is ordered\n    // by batchId, if the first batch has a larger batchId then the requested\n    // batchId doesn't exist in the queue.\n    const firstBatchId = this.mutationQueue[0].batchId;\n    return batchId - firstBatchId;\n  }\n\n  /**\n   * A version of lookupMutationBatch that doesn't return a promise, this makes\n   * other functions that uses this code easier to read and more efficent.\n   */\n  private findMutationBatch(batchId: BatchId): MutationBatch | null {\n    const index = this.indexOfBatchId(batchId);\n    if (index < 0 || index >= this.mutationQueue.length) {\n      return null;\n    }\n\n    const batch = this.mutationQueue[index];\n    debugAssert(batch.batchId === batchId, 'If found batch must match');\n    return batch;\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Query, queryMatches } from '../core/query';\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport {\n  DocumentKeySet,\n  MutableDocumentMap,\n  mutableDocumentMap,\n  OverlayMap\n} from '../model/collections';\nimport { Document, MutableDocument } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport {\n  IndexOffset,\n  indexOffsetComparator,\n  newIndexOffsetFromDocument\n} from '../model/field_index';\nimport { debugAssert, fail } from '../util/assert';\nimport { SortedMap } from '../util/sorted_map';\n\nimport { IndexManager } from './index_manager';\nimport { PersistencePromise } from './persistence_promise';\nimport { PersistenceTransaction } from './persistence_transaction';\nimport { RemoteDocumentCache } from './remote_document_cache';\nimport { RemoteDocumentChangeBuffer } from './remote_document_change_buffer';\n\nexport type DocumentSizer = (doc: Document) => number;\n\n/** Miscellaneous collection types / constants. */\ninterface MemoryRemoteDocumentCacheEntry {\n  document: Document;\n  size: number;\n}\n\ntype DocumentEntryMap = SortedMap<DocumentKey, MemoryRemoteDocumentCacheEntry>;\nfunction documentEntryMap(): DocumentEntryMap {\n  return new SortedMap<DocumentKey, MemoryRemoteDocumentCacheEntry>(\n    DocumentKey.comparator\n  );\n}\n\nexport interface MemoryRemoteDocumentCache extends RemoteDocumentCache {\n  forEachDocumentKey(\n    transaction: PersistenceTransaction,\n    f: (key: DocumentKey) => PersistencePromise<void>\n  ): PersistencePromise<void>;\n}\n\n/**\n * The memory-only RemoteDocumentCache for IndexedDb. To construct, invoke\n * `newMemoryRemoteDocumentCache()`.\n */\nclass MemoryRemoteDocumentCacheImpl implements MemoryRemoteDocumentCache {\n  /** Underlying cache of documents and their read times. */\n  private docs = documentEntryMap();\n  private indexManager!: IndexManager;\n\n  /** Size of all cached documents. */\n  private size = 0;\n\n  /**\n   * @param sizer - Used to assess the size of a document. For eager GC, this is\n   * expected to just return 0 to avoid unnecessarily doing the work of\n   * calculating the size.\n   */\n  constructor(private readonly sizer: DocumentSizer) {}\n\n  setIndexManager(indexManager: IndexManager): void {\n    this.indexManager = indexManager;\n  }\n\n  /**\n   * Adds the supplied entry to the cache and updates the cache size as appropriate.\n   *\n   * All calls of `addEntry`  are required to go through the RemoteDocumentChangeBuffer\n   * returned by `newChangeBuffer()`.\n   */\n  addEntry(\n    transaction: PersistenceTransaction,\n    doc: MutableDocument\n  ): PersistencePromise<void> {\n    debugAssert(\n      !doc.readTime.isEqual(SnapshotVersion.min()),\n      'Cannot add a document with a read time of zero'\n    );\n\n    const key = doc.key;\n    const entry = this.docs.get(key);\n    const previousSize = entry ? entry.size : 0;\n    const currentSize = this.sizer(doc);\n\n    this.docs = this.docs.insert(key, {\n      document: doc.mutableCopy(),\n      size: currentSize\n    });\n\n    this.size += currentSize - previousSize;\n\n    return this.indexManager.addToCollectionParentIndex(\n      transaction,\n      key.path.popLast()\n    );\n  }\n\n  /**\n   * Removes the specified entry from the cache and updates the cache size as appropriate.\n   *\n   * All calls of `removeEntry` are required to go through the RemoteDocumentChangeBuffer\n   * returned by `newChangeBuffer()`.\n   */\n  removeEntry(documentKey: DocumentKey): void {\n    const entry = this.docs.get(documentKey);\n    if (entry) {\n      this.docs = this.docs.remove(documentKey);\n      this.size -= entry.size;\n    }\n  }\n\n  getEntry(\n    transaction: PersistenceTransaction,\n    documentKey: DocumentKey\n  ): PersistencePromise<MutableDocument> {\n    const entry = this.docs.get(documentKey);\n    return PersistencePromise.resolve(\n      entry\n        ? entry.document.mutableCopy()\n        : MutableDocument.newInvalidDocument(documentKey)\n    );\n  }\n\n  getEntries(\n    transaction: PersistenceTransaction,\n    documentKeys: DocumentKeySet\n  ): PersistencePromise<MutableDocumentMap> {\n    let results = mutableDocumentMap();\n    documentKeys.forEach(documentKey => {\n      const entry = this.docs.get(documentKey);\n      results = results.insert(\n        documentKey,\n        entry\n          ? entry.document.mutableCopy()\n          : MutableDocument.newInvalidDocument(documentKey)\n      );\n    });\n    return PersistencePromise.resolve(results);\n  }\n\n  getDocumentsMatchingQuery(\n    transaction: PersistenceTransaction,\n    query: Query,\n    offset: IndexOffset,\n    mutatedDocs: OverlayMap\n  ): PersistencePromise<MutableDocumentMap> {\n    let results = mutableDocumentMap();\n\n    // Documents are ordered by key, so we can use a prefix scan to narrow down\n    // the documents we need to match the query against.\n    const collectionPath = query.path;\n    const prefix = new DocumentKey(collectionPath.child(''));\n    const iterator = this.docs.getIteratorFrom(prefix);\n    while (iterator.hasNext()) {\n      const {\n        key,\n        value: { document }\n      } = iterator.getNext();\n      if (!collectionPath.isPrefixOf(key.path)) {\n        break;\n      }\n      if (key.path.length > collectionPath.length + 1) {\n        // Exclude entries from subcollections.\n        continue;\n      }\n      if (\n        indexOffsetComparator(newIndexOffsetFromDocument(document), offset) <= 0\n      ) {\n        // The document sorts before the offset.\n        continue;\n      }\n      if (!mutatedDocs.has(document.key) && !queryMatches(query, document)) {\n        // The document cannot possibly match the query.\n        continue;\n      }\n\n      results = results.insert(document.key, document.mutableCopy());\n    }\n    return PersistencePromise.resolve(results);\n  }\n\n  getAllFromCollectionGroup(\n    transaction: PersistenceTransaction,\n    collectionGroup: string,\n    offset: IndexOffset,\n    limti: number\n  ): PersistencePromise<MutableDocumentMap> {\n    // This method should only be called from the IndexBackfiller if persistence\n    // is enabled.\n    fail('getAllFromCollectionGroup() is not supported.');\n  }\n\n  forEachDocumentKey(\n    transaction: PersistenceTransaction,\n    f: (key: DocumentKey) => PersistencePromise<void>\n  ): PersistencePromise<void> {\n    return PersistencePromise.forEach(this.docs, (key: DocumentKey) => f(key));\n  }\n\n  newChangeBuffer(options?: {\n    trackRemovals: boolean;\n  }): RemoteDocumentChangeBuffer {\n    // `trackRemovals` is ignores since the MemoryRemoteDocumentCache keeps\n    // a separate changelog and does not need special handling for removals.\n    return new MemoryRemoteDocumentChangeBuffer(this);\n  }\n\n  getSize(txn: PersistenceTransaction): PersistencePromise<number> {\n    return PersistencePromise.resolve(this.size);\n  }\n}\n\n/**\n * Creates a new memory-only RemoteDocumentCache.\n *\n * @param sizer - Used to assess the size of a document. For eager GC, this is\n * expected to just return 0 to avoid unnecessarily doing the work of\n * calculating the size.\n */\nexport function newMemoryRemoteDocumentCache(\n  sizer: DocumentSizer\n): MemoryRemoteDocumentCache {\n  return new MemoryRemoteDocumentCacheImpl(sizer);\n}\n\n/**\n * Handles the details of adding and updating documents in the MemoryRemoteDocumentCache.\n */\nclass MemoryRemoteDocumentChangeBuffer extends RemoteDocumentChangeBuffer {\n  constructor(private readonly documentCache: MemoryRemoteDocumentCacheImpl) {\n    super();\n  }\n\n  protected applyChanges(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<void> {\n    const promises: Array<PersistencePromise<void>> = [];\n    this.changes.forEach((key, doc) => {\n      if (doc.isValidDocument()) {\n        promises.push(this.documentCache.addEntry(transaction, doc));\n      } else {\n        this.documentCache.removeEntry(key);\n      }\n    });\n    return PersistencePromise.waitFor(promises);\n  }\n\n  protected getFromCache(\n    transaction: PersistenceTransaction,\n    documentKey: DocumentKey\n  ): PersistencePromise<MutableDocument> {\n    return this.documentCache.getEntry(transaction, documentKey);\n  }\n\n  protected getAllFromCache(\n    transaction: PersistenceTransaction,\n    documentKeys: DocumentKeySet\n  ): PersistencePromise<MutableDocumentMap> {\n    return this.documentCache.getEntries(transaction, documentKeys);\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport { canonifyTarget, Target, targetEquals } from '../core/target';\nimport { TargetIdGenerator } from '../core/target_id_generator';\nimport { ListenSequenceNumber, TargetId } from '../core/types';\nimport { DocumentKeySet } from '../model/collections';\nimport { DocumentKey } from '../model/document_key';\nimport { debugAssert } from '../util/assert';\nimport { ObjectMap } from '../util/obj_map';\n\nimport { ActiveTargets } from './lru_garbage_collector';\nimport { Persistence } from './persistence';\nimport { PersistencePromise } from './persistence_promise';\nimport { PersistenceTransaction } from './persistence_transaction';\nimport { ReferenceSet } from './reference_set';\nimport { TargetCache } from './target_cache';\nimport { TargetData } from './target_data';\n\nexport class MemoryTargetCache implements TargetCache {\n  /**\n   * Maps a target to the data about that target\n   */\n  private targets = new ObjectMap<Target, TargetData>(\n    t => canonifyTarget(t),\n    targetEquals\n  );\n\n  /** The last received snapshot version. */\n  private lastRemoteSnapshotVersion = SnapshotVersion.min();\n  /** The highest numbered target ID encountered. */\n  private highestTargetId: TargetId = 0;\n  /** The highest sequence number encountered. */\n  private highestSequenceNumber: ListenSequenceNumber = 0;\n  /**\n   * A ordered bidirectional mapping between documents and the remote target\n   * IDs.\n   */\n  private references = new ReferenceSet();\n\n  private targetCount = 0;\n\n  private targetIdGenerator = TargetIdGenerator.forTargetCache();\n\n  constructor(private readonly persistence: Persistence) {}\n\n  forEachTarget(\n    txn: PersistenceTransaction,\n    f: (q: TargetData) => void\n  ): PersistencePromise<void> {\n    this.targets.forEach((_, targetData) => f(targetData));\n    return PersistencePromise.resolve();\n  }\n\n  getLastRemoteSnapshotVersion(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<SnapshotVersion> {\n    return PersistencePromise.resolve(this.lastRemoteSnapshotVersion);\n  }\n\n  getHighestSequenceNumber(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<ListenSequenceNumber> {\n    return PersistencePromise.resolve(this.highestSequenceNumber);\n  }\n\n  allocateTargetId(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<TargetId> {\n    this.highestTargetId = this.targetIdGenerator.next();\n    return PersistencePromise.resolve(this.highestTargetId);\n  }\n\n  setTargetsMetadata(\n    transaction: PersistenceTransaction,\n    highestListenSequenceNumber: number,\n    lastRemoteSnapshotVersion?: SnapshotVersion\n  ): PersistencePromise<void> {\n    if (lastRemoteSnapshotVersion) {\n      this.lastRemoteSnapshotVersion = lastRemoteSnapshotVersion;\n    }\n    if (highestListenSequenceNumber > this.highestSequenceNumber) {\n      this.highestSequenceNumber = highestListenSequenceNumber;\n    }\n    return PersistencePromise.resolve();\n  }\n\n  private saveTargetData(targetData: TargetData): void {\n    this.targets.set(targetData.target, targetData);\n    const targetId = targetData.targetId;\n    if (targetId > this.highestTargetId) {\n      this.targetIdGenerator = new TargetIdGenerator(targetId);\n      this.highestTargetId = targetId;\n    }\n    if (targetData.sequenceNumber > this.highestSequenceNumber) {\n      this.highestSequenceNumber = targetData.sequenceNumber;\n    }\n  }\n\n  addTargetData(\n    transaction: PersistenceTransaction,\n    targetData: TargetData\n  ): PersistencePromise<void> {\n    debugAssert(\n      !this.targets.has(targetData.target),\n      'Adding a target that already exists'\n    );\n    this.saveTargetData(targetData);\n    this.targetCount += 1;\n    return PersistencePromise.resolve();\n  }\n\n  updateTargetData(\n    transaction: PersistenceTransaction,\n    targetData: TargetData\n  ): PersistencePromise<void> {\n    debugAssert(\n      this.targets.has(targetData.target),\n      'Updating a non-existent target'\n    );\n    this.saveTargetData(targetData);\n    return PersistencePromise.resolve();\n  }\n\n  removeTargetData(\n    transaction: PersistenceTransaction,\n    targetData: TargetData\n  ): PersistencePromise<void> {\n    debugAssert(this.targetCount > 0, 'Removing a target from an empty cache');\n    debugAssert(\n      this.targets.has(targetData.target),\n      'Removing a non-existent target from the cache'\n    );\n    this.targets.delete(targetData.target);\n    this.references.removeReferencesForId(targetData.targetId);\n    this.targetCount -= 1;\n    return PersistencePromise.resolve();\n  }\n\n  removeTargets(\n    transaction: PersistenceTransaction,\n    upperBound: ListenSequenceNumber,\n    activeTargetIds: ActiveTargets\n  ): PersistencePromise<number> {\n    let count = 0;\n    const removals: Array<PersistencePromise<void>> = [];\n    this.targets.forEach((key, targetData) => {\n      if (\n        targetData.sequenceNumber <= upperBound &&\n        activeTargetIds.get(targetData.targetId) === null\n      ) {\n        this.targets.delete(key);\n        removals.push(\n          this.removeMatchingKeysForTargetId(transaction, targetData.targetId)\n        );\n        count++;\n      }\n    });\n    return PersistencePromise.waitFor(removals).next(() => count);\n  }\n\n  getTargetCount(\n    transaction: PersistenceTransaction\n  ): PersistencePromise<number> {\n    return PersistencePromise.resolve(this.targetCount);\n  }\n\n  getTargetData(\n    transaction: PersistenceTransaction,\n    target: Target\n  ): PersistencePromise<TargetData | null> {\n    const targetData = this.targets.get(target) || null;\n    return PersistencePromise.resolve(targetData);\n  }\n\n  addMatchingKeys(\n    txn: PersistenceTransaction,\n    keys: DocumentKeySet,\n    targetId: TargetId\n  ): PersistencePromise<void> {\n    this.references.addReferences(keys, targetId);\n    return PersistencePromise.resolve();\n  }\n\n  removeMatchingKeys(\n    txn: PersistenceTransaction,\n    keys: DocumentKeySet,\n    targetId: TargetId\n  ): PersistencePromise<void> {\n    this.references.removeReferences(keys, targetId);\n    const referenceDelegate = this.persistence.referenceDelegate;\n    const promises: Array<PersistencePromise<void>> = [];\n    if (referenceDelegate) {\n      keys.forEach(key => {\n        promises.push(referenceDelegate.markPotentiallyOrphaned(txn, key));\n      });\n    }\n    return PersistencePromise.waitFor(promises);\n  }\n\n  removeMatchingKeysForTargetId(\n    txn: PersistenceTransaction,\n    targetId: TargetId\n  ): PersistencePromise<void> {\n    this.references.removeReferencesForId(targetId);\n    return PersistencePromise.resolve();\n  }\n\n  getMatchingKeysForTargetId(\n    txn: PersistenceTransaction,\n    targetId: TargetId\n  ): PersistencePromise<DocumentKeySet> {\n    const matchingKeys = this.references.referencesForId(targetId);\n    return PersistencePromise.resolve(matchingKeys);\n  }\n\n  containsKey(\n    txn: PersistenceTransaction,\n    key: DocumentKey\n  ): PersistencePromise<boolean> {\n    return PersistencePromise.resolve(this.references.containsKey(key));\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { User } from '../auth/user';\nimport { ListenSequence } from '../core/listen_sequence';\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport { ListenSequenceNumber, TargetId } from '../core/types';\nimport { Document } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport { estimateByteSize } from '../model/values';\nimport { JsonProtoSerializer } from '../remote/serializer';\nimport { fail } from '../util/assert';\nimport { logDebug } from '../util/log';\nimport { ObjectMap } from '../util/obj_map';\n\nimport { DocumentOverlayCache } from './document_overlay_cache';\nimport { encodeResourcePath } from './encoded_resource_path';\nimport { IndexManager } from './index_manager';\nimport { LocalSerializer } from './local_serializer';\nimport {\n  ActiveTargets,\n  LruDelegate,\n  LruGarbageCollector,\n  LruParams\n} from './lru_garbage_collector';\nimport { newLruGarbageCollector } from './lru_garbage_collector_impl';\nimport { MemoryBundleCache } from './memory_bundle_cache';\nimport { MemoryDocumentOverlayCache } from './memory_document_overlay_cache';\nimport { MemoryIndexManager } from './memory_index_manager';\nimport { MemoryMutationQueue } from './memory_mutation_queue';\nimport {\n  MemoryRemoteDocumentCache,\n  newMemoryRemoteDocumentCache\n} from './memory_remote_document_cache';\nimport { MemoryTargetCache } from './memory_target_cache';\nimport { MutationQueue } from './mutation_queue';\nimport { Persistence, ReferenceDelegate } from './persistence';\nimport { PersistencePromise } from './persistence_promise';\nimport {\n  PersistenceTransaction,\n  PersistenceTransactionMode\n} from './persistence_transaction';\nimport { ReferenceSet } from './reference_set';\nimport { TargetData } from './target_data';\n\nconst LOG_TAG = 'MemoryPersistence';\n/**\n * A memory-backed instance of Persistence. Data is stored only in RAM and\n * not persisted across sessions.\n */\nexport class MemoryPersistence implements Persistence {\n  /**\n   * Note that these are retained here to make it easier to write tests\n   * affecting both the in-memory and IndexedDB-backed persistence layers. Tests\n   * can create a new LocalStore wrapping this Persistence instance and this\n   * will make the in-memory persistence layer behave as if it were actually\n   * persisting values.\n   */\n  private readonly indexManager: MemoryIndexManager;\n  private mutationQueues: { [user: string]: MemoryMutationQueue } = {};\n  private overlays: { [user: string]: MemoryDocumentOverlayCache } = {};\n  private readonly remoteDocumentCache: MemoryRemoteDocumentCache;\n  private readonly targetCache: MemoryTargetCache;\n  private readonly bundleCache: MemoryBundleCache;\n  private readonly listenSequence = new ListenSequence(0);\n  private serializer: LocalSerializer;\n\n  private _started = false;\n\n  readonly referenceDelegate: MemoryReferenceDelegate;\n\n  /**\n   * The constructor accepts a factory for creating a reference delegate. This\n   * allows both the delegate and this instance to have strong references to\n   * each other without having nullable fields that would then need to be\n   * checked or asserted on every access.\n   */\n  constructor(\n    referenceDelegateFactory: (p: MemoryPersistence) => MemoryReferenceDelegate,\n    serializer: JsonProtoSerializer\n  ) {\n    this._started = true;\n    this.referenceDelegate = referenceDelegateFactory(this);\n    this.targetCache = new MemoryTargetCache(this);\n    const sizer = (doc: Document): number =>\n      this.referenceDelegate.documentSize(doc);\n    this.indexManager = new MemoryIndexManager();\n    this.remoteDocumentCache = newMemoryRemoteDocumentCache(sizer);\n    this.serializer = new LocalSerializer(serializer);\n    this.bundleCache = new MemoryBundleCache(this.serializer);\n  }\n\n  start(): Promise<void> {\n    return Promise.resolve();\n  }\n\n  shutdown(): Promise<void> {\n    // No durable state to ensure is closed on shutdown.\n    this._started = false;\n    return Promise.resolve();\n  }\n\n  get started(): boolean {\n    return this._started;\n  }\n\n  setDatabaseDeletedListener(): void {\n    // No op.\n  }\n\n  setNetworkEnabled(): void {\n    // No op.\n  }\n\n  getIndexManager(user: User): MemoryIndexManager {\n    // We do not currently support indices for memory persistence, so we can\n    // return the same shared instance of the memory index manager.\n    return this.indexManager;\n  }\n\n  getDocumentOverlayCache(user: User): DocumentOverlayCache {\n    let overlay = this.overlays[user.toKey()];\n    if (!overlay) {\n      overlay = new MemoryDocumentOverlayCache();\n      this.overlays[user.toKey()] = overlay;\n    }\n    return overlay;\n  }\n\n  getMutationQueue(user: User, indexManager: IndexManager): MutationQueue {\n    let queue = this.mutationQueues[user.toKey()];\n    if (!queue) {\n      queue = new MemoryMutationQueue(indexManager, this.referenceDelegate);\n      this.mutationQueues[user.toKey()] = queue;\n    }\n    return queue;\n  }\n\n  getTargetCache(): MemoryTargetCache {\n    return this.targetCache;\n  }\n\n  getRemoteDocumentCache(): MemoryRemoteDocumentCache {\n    return this.remoteDocumentCache;\n  }\n\n  getBundleCache(): MemoryBundleCache {\n    return this.bundleCache;\n  }\n\n  runTransaction<T>(\n    action: string,\n    mode: PersistenceTransactionMode,\n    transactionOperation: (\n      transaction: PersistenceTransaction\n    ) => PersistencePromise<T>\n  ): Promise<T> {\n    logDebug(LOG_TAG, 'Starting transaction:', action);\n    const txn = new MemoryTransaction(this.listenSequence.next());\n    this.referenceDelegate.onTransactionStarted();\n    return transactionOperation(txn)\n      .next(result => {\n        return this.referenceDelegate\n          .onTransactionCommitted(txn)\n          .next(() => result);\n      })\n      .toPromise()\n      .then(result => {\n        txn.raiseOnCommittedEvent();\n        return result;\n      });\n  }\n\n  mutationQueuesContainKey(\n    transaction: PersistenceTransaction,\n    key: DocumentKey\n  ): PersistencePromise<boolean> {\n    return PersistencePromise.or(\n      Object.values(this.mutationQueues).map(\n        queue => () => queue.containsKey(transaction, key)\n      )\n    );\n  }\n}\n\n/**\n * Memory persistence is not actually transactional, but future implementations\n * may have transaction-scoped state.\n */\nexport class MemoryTransaction extends PersistenceTransaction {\n  constructor(readonly currentSequenceNumber: ListenSequenceNumber) {\n    super();\n  }\n}\n\nexport interface MemoryReferenceDelegate extends ReferenceDelegate {\n  documentSize(doc: Document): number;\n  onTransactionStarted(): void;\n  onTransactionCommitted(txn: PersistenceTransaction): PersistencePromise<void>;\n}\n\nexport class MemoryEagerDelegate implements MemoryReferenceDelegate {\n  /** Tracks all documents that are active in Query views. */\n  private localViewReferences: ReferenceSet = new ReferenceSet();\n  /** The list of documents that are potentially GCed after each transaction. */\n  private _orphanedDocuments: Set</* path= */ string> | null = null;\n\n  private constructor(private readonly persistence: MemoryPersistence) {}\n\n  static factory(persistence: MemoryPersistence): MemoryEagerDelegate {\n    return new MemoryEagerDelegate(persistence);\n  }\n\n  private get orphanedDocuments(): Set<string> {\n    if (!this._orphanedDocuments) {\n      throw fail('orphanedDocuments is only valid during a transaction.');\n    } else {\n      return this._orphanedDocuments;\n    }\n  }\n\n  addReference(\n    txn: PersistenceTransaction,\n    targetId: TargetId,\n    key: DocumentKey\n  ): PersistencePromise<void> {\n    this.localViewReferences.addReference(key, targetId);\n    this.orphanedDocuments.delete(key.toString());\n    return PersistencePromise.resolve();\n  }\n\n  removeReference(\n    txn: PersistenceTransaction,\n    targetId: TargetId,\n    key: DocumentKey\n  ): PersistencePromise<void> {\n    this.localViewReferences.removeReference(key, targetId);\n    this.orphanedDocuments.add(key.toString());\n    return PersistencePromise.resolve();\n  }\n\n  markPotentiallyOrphaned(\n    txn: PersistenceTransaction,\n    key: DocumentKey\n  ): PersistencePromise<void> {\n    this.orphanedDocuments.add(key.toString());\n    return PersistencePromise.resolve();\n  }\n\n  removeTarget(\n    txn: PersistenceTransaction,\n    targetData: TargetData\n  ): PersistencePromise<void> {\n    const orphaned = this.localViewReferences.removeReferencesForId(\n      targetData.targetId\n    );\n    orphaned.forEach(key => this.orphanedDocuments.add(key.toString()));\n    const cache = this.persistence.getTargetCache();\n    return cache\n      .getMatchingKeysForTargetId(txn, targetData.targetId)\n      .next(keys => {\n        keys.forEach(key => this.orphanedDocuments.add(key.toString()));\n      })\n      .next(() => cache.removeTargetData(txn, targetData));\n  }\n\n  onTransactionStarted(): void {\n    this._orphanedDocuments = new Set<string>();\n  }\n\n  onTransactionCommitted(\n    txn: PersistenceTransaction\n  ): PersistencePromise<void> {\n    // Remove newly orphaned documents.\n    const cache = this.persistence.getRemoteDocumentCache();\n    const changeBuffer = cache.newChangeBuffer();\n    return PersistencePromise.forEach(\n      this.orphanedDocuments,\n      (path: string) => {\n        const key = DocumentKey.fromPath(path);\n        return this.isReferenced(txn, key).next(isReferenced => {\n          if (!isReferenced) {\n            changeBuffer.removeEntry(key, SnapshotVersion.min());\n          }\n        });\n      }\n    ).next(() => {\n      this._orphanedDocuments = null;\n      return changeBuffer.apply(txn);\n    });\n  }\n\n  updateLimboDocument(\n    txn: PersistenceTransaction,\n    key: DocumentKey\n  ): PersistencePromise<void> {\n    return this.isReferenced(txn, key).next(isReferenced => {\n      if (isReferenced) {\n        this.orphanedDocuments.delete(key.toString());\n      } else {\n        this.orphanedDocuments.add(key.toString());\n      }\n    });\n  }\n\n  documentSize(doc: Document): number {\n    // For eager GC, we don't care about the document size, there are no size thresholds.\n    return 0;\n  }\n\n  private isReferenced(\n    txn: PersistenceTransaction,\n    key: DocumentKey\n  ): PersistencePromise<boolean> {\n    return PersistencePromise.or([\n      () =>\n        PersistencePromise.resolve(this.localViewReferences.containsKey(key)),\n      () => this.persistence.getTargetCache().containsKey(txn, key),\n      () => this.persistence.mutationQueuesContainKey(txn, key)\n    ]);\n  }\n}\n\nexport class MemoryLruDelegate implements ReferenceDelegate, LruDelegate {\n  private orphanedSequenceNumbers: ObjectMap<\n    DocumentKey,\n    ListenSequenceNumber\n  > = new ObjectMap(\n    k => encodeResourcePath(k.path),\n    (l, r) => l.isEqual(r)\n  );\n\n  readonly garbageCollector: LruGarbageCollector;\n\n  constructor(\n    private readonly persistence: MemoryPersistence,\n    lruParams: LruParams\n  ) {\n    this.garbageCollector = newLruGarbageCollector(this, lruParams);\n  }\n\n  static factory(\n    persistence: MemoryPersistence,\n    lruParams: LruParams\n  ): MemoryLruDelegate {\n    return new MemoryLruDelegate(persistence, lruParams);\n  }\n\n  // No-ops, present so memory persistence doesn't have to care which delegate\n  // it has.\n  onTransactionStarted(): void {}\n\n  onTransactionCommitted(\n    txn: PersistenceTransaction\n  ): PersistencePromise<void> {\n    return PersistencePromise.resolve();\n  }\n\n  forEachTarget(\n    txn: PersistenceTransaction,\n    f: (q: TargetData) => void\n  ): PersistencePromise<void> {\n    return this.persistence.getTargetCache().forEachTarget(txn, f);\n  }\n\n  getSequenceNumberCount(\n    txn: PersistenceTransaction\n  ): PersistencePromise<number> {\n    const docCountPromise = this.orphanedDocumentCount(txn);\n    const targetCountPromise = this.persistence\n      .getTargetCache()\n      .getTargetCount(txn);\n    return targetCountPromise.next(targetCount =>\n      docCountPromise.next(docCount => targetCount + docCount)\n    );\n  }\n\n  private orphanedDocumentCount(\n    txn: PersistenceTransaction\n  ): PersistencePromise<number> {\n    let orphanedCount = 0;\n    return this.forEachOrphanedDocumentSequenceNumber(txn, _ => {\n      orphanedCount++;\n    }).next(() => orphanedCount);\n  }\n\n  forEachOrphanedDocumentSequenceNumber(\n    txn: PersistenceTransaction,\n    f: (sequenceNumber: ListenSequenceNumber) => void\n  ): PersistencePromise<void> {\n    return PersistencePromise.forEach(\n      this.orphanedSequenceNumbers,\n      (key, sequenceNumber) => {\n        // Pass in the exact sequence number as the upper bound so we know it won't be pinned by\n        // being too recent.\n        return this.isPinned(txn, key, sequenceNumber).next(isPinned => {\n          if (!isPinned) {\n            return f(sequenceNumber);\n          } else {\n            return PersistencePromise.resolve();\n          }\n        });\n      }\n    );\n  }\n\n  removeTargets(\n    txn: PersistenceTransaction,\n    upperBound: ListenSequenceNumber,\n    activeTargetIds: ActiveTargets\n  ): PersistencePromise<number> {\n    return this.persistence\n      .getTargetCache()\n      .removeTargets(txn, upperBound, activeTargetIds);\n  }\n\n  removeOrphanedDocuments(\n    txn: PersistenceTransaction,\n    upperBound: ListenSequenceNumber\n  ): PersistencePromise<number> {\n    let count = 0;\n    const cache = this.persistence.getRemoteDocumentCache();\n    const changeBuffer = cache.newChangeBuffer();\n    const p = cache.forEachDocumentKey(txn, key => {\n      return this.isPinned(txn, key, upperBound).next(isPinned => {\n        if (!isPinned) {\n          count++;\n          changeBuffer.removeEntry(key, SnapshotVersion.min());\n        }\n      });\n    });\n    return p.next(() => changeBuffer.apply(txn)).next(() => count);\n  }\n\n  markPotentiallyOrphaned(\n    txn: PersistenceTransaction,\n    key: DocumentKey\n  ): PersistencePromise<void> {\n    this.orphanedSequenceNumbers.set(key, txn.currentSequenceNumber);\n    return PersistencePromise.resolve();\n  }\n\n  removeTarget(\n    txn: PersistenceTransaction,\n    targetData: TargetData\n  ): PersistencePromise<void> {\n    const updated = targetData.withSequenceNumber(txn.currentSequenceNumber);\n    return this.persistence.getTargetCache().updateTargetData(txn, updated);\n  }\n\n  addReference(\n    txn: PersistenceTransaction,\n    targetId: TargetId,\n    key: DocumentKey\n  ): PersistencePromise<void> {\n    this.orphanedSequenceNumbers.set(key, txn.currentSequenceNumber);\n    return PersistencePromise.resolve();\n  }\n\n  removeReference(\n    txn: PersistenceTransaction,\n    targetId: TargetId,\n    key: DocumentKey\n  ): PersistencePromise<void> {\n    this.orphanedSequenceNumbers.set(key, txn.currentSequenceNumber);\n    return PersistencePromise.resolve();\n  }\n\n  updateLimboDocument(\n    txn: PersistenceTransaction,\n    key: DocumentKey\n  ): PersistencePromise<void> {\n    this.orphanedSequenceNumbers.set(key, txn.currentSequenceNumber);\n    return PersistencePromise.resolve();\n  }\n\n  documentSize(document: Document): number {\n    let documentSize = document.key.toString().length;\n    if (document.isFoundDocument()) {\n      documentSize += estimateByteSize(document.data.value);\n    }\n    return documentSize;\n  }\n\n  private isPinned(\n    txn: PersistenceTransaction,\n    key: DocumentKey,\n    upperBound: ListenSequenceNumber\n  ): PersistencePromise<boolean> {\n    return PersistencePromise.or([\n      () => this.persistence.mutationQueuesContainKey(txn, key),\n      () => this.persistence.getTargetCache().containsKey(txn, key),\n      () => {\n        const orphanedAt = this.orphanedSequenceNumbers.get(key);\n        return PersistencePromise.resolve(\n          orphanedAt !== undefined && orphanedAt > upperBound\n        );\n      }\n    ]);\n  }\n\n  getCacheSize(txn: PersistenceTransaction): PersistencePromise<number> {\n    return this.persistence.getRemoteDocumentCache().getSize(txn);\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { User } from '../auth/user';\nimport { ListenSequence } from '../core/listen_sequence';\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport { DocumentKeySet, documentKeySet } from '../model/collections';\nimport { DocumentKey } from '../model/document_key';\nimport { ResourcePath } from '../model/path';\nimport { debugAssert, fail, hardAssert } from '../util/assert';\nimport { BATCHID_UNKNOWN } from '../util/types';\n\nimport {\n  decodeResourcePath,\n  encodeResourcePath\n} from './encoded_resource_path';\nimport { IndexedDbDocumentOverlayCache } from './indexeddb_document_overlay_cache';\nimport {\n  dbDocumentSize,\n  removeMutationBatch\n} from './indexeddb_mutation_batch_impl';\nimport { IndexedDbMutationQueue } from './indexeddb_mutation_queue';\nimport { newIndexedDbRemoteDocumentCache } from './indexeddb_remote_document_cache';\nimport {\n  DbCollectionParent,\n  DbDocumentMutation,\n  DbMutationBatch,\n  DbMutationQueue,\n  DbRemoteDocument,\n  DbRemoteDocumentGlobal,\n  DbTarget,\n  DbTargetDocument,\n  DbTargetGlobal,\n  SCHEMA_VERSION\n} from './indexeddb_schema';\nimport {\n  DbRemoteDocument as DbRemoteDocumentLegacy,\n  DbRemoteDocumentStore as DbRemoteDocumentStoreLegacy,\n  DbRemoteDocumentKey as DbRemoteDocumentKeyLegacy\n} from './indexeddb_schema_legacy';\nimport {\n  DbBundleKeyPath,\n  DbBundleStore,\n  DbClientMetadataKeyPath,\n  DbClientMetadataStore,\n  DbCollectionParentKey,\n  DbCollectionParentKeyPath,\n  DbCollectionParentStore,\n  DbDocumentMutationKey,\n  DbDocumentMutationStore,\n  DbDocumentOverlayCollectionGroupOverlayIndex,\n  DbDocumentOverlayCollectionGroupOverlayIndexPath,\n  DbDocumentOverlayCollectionPathOverlayIndex,\n  DbDocumentOverlayCollectionPathOverlayIndexPath,\n  DbDocumentOverlayKeyPath,\n  DbDocumentOverlayStore,\n  DbIndexConfigurationCollectionGroupIndex,\n  DbIndexConfigurationCollectionGroupIndexPath,\n  DbIndexConfigurationKeyPath,\n  DbIndexConfigurationStore,\n  DbIndexEntryDocumentKeyIndex,\n  DbIndexEntryDocumentKeyIndexPath,\n  DbIndexEntryKeyPath,\n  DbIndexEntryStore,\n  DbIndexStateKeyPath,\n  DbIndexStateSequenceNumberIndex,\n  DbIndexStateSequenceNumberIndexPath,\n  DbIndexStateStore,\n  DbMutationBatchKey,\n  DbMutationBatchKeyPath,\n  DbMutationBatchStore,\n  DbMutationBatchUserMutationsIndex,\n  DbMutationBatchUserMutationsKeyPath,\n  DbMutationQueueKey,\n  DbMutationQueueKeyPath,\n  DbMutationQueueStore,\n  DbNamedQueryKeyPath,\n  DbNamedQueryStore,\n  DbPrimaryClientStore,\n  DbRemoteDocumentCollectionGroupIndex,\n  DbRemoteDocumentCollectionGroupIndexPath,\n  DbRemoteDocumentDocumentKeyIndex,\n  DbRemoteDocumentDocumentKeyIndexPath,\n  DbRemoteDocumentGlobalKey,\n  DbRemoteDocumentGlobalStore,\n  DbRemoteDocumentKey,\n  DbRemoteDocumentKeyPath,\n  DbRemoteDocumentStore,\n  DbTargetDocumentDocumentTargetsIndex,\n  DbTargetDocumentDocumentTargetsKeyPath,\n  DbTargetDocumentKey,\n  DbTargetDocumentKeyPath,\n  DbTargetDocumentStore,\n  DbTargetGlobalKey,\n  DbTargetGlobalStore,\n  DbTargetKey,\n  DbTargetKeyPath,\n  DbTargetQueryTargetsIndexName,\n  DbTargetQueryTargetsKeyPath,\n  DbTargetStore\n} from './indexeddb_sentinels';\nimport { IndexedDbTransaction } from './indexeddb_transaction';\nimport { LocalDocumentsView } from './local_documents_view';\nimport {\n  fromDbMutationBatch,\n  fromDbTarget,\n  LocalSerializer,\n  toDbTarget\n} from './local_serializer';\nimport { MemoryCollectionParentIndex } from './memory_index_manager';\nimport { MemoryEagerDelegate, MemoryPersistence } from './memory_persistence';\nimport { PersistencePromise } from './persistence_promise';\nimport { SimpleDbSchemaConverter, SimpleDbTransaction } from './simple_db';\n\n/** Performs database creation and schema upgrades. */\nexport class SchemaConverter implements SimpleDbSchemaConverter {\n  constructor(private readonly serializer: LocalSerializer) {}\n\n  /**\n   * Performs database creation and schema upgrades.\n   *\n   * Note that in production, this method is only ever used to upgrade the schema\n   * to SCHEMA_VERSION. Different values of toVersion are only used for testing\n   * and local feature development.\n   */\n  createOrUpgrade(\n    db: IDBDatabase,\n    txn: IDBTransaction,\n    fromVersion: number,\n    toVersion: number\n  ): PersistencePromise<void> {\n    debugAssert(\n      fromVersion < toVersion &&\n        fromVersion >= 0 &&\n        toVersion <= SCHEMA_VERSION,\n      `Unexpected schema upgrade from v${fromVersion} to v${toVersion}.`\n    );\n\n    const simpleDbTransaction = new SimpleDbTransaction('createOrUpgrade', txn);\n\n    if (fromVersion < 1 && toVersion >= 1) {\n      createPrimaryClientStore(db);\n      createMutationQueue(db);\n      createQueryCache(db);\n      createLegacyRemoteDocumentCache(db);\n    }\n\n    // Migration 2 to populate the targetGlobal object no longer needed since\n    // migration 3 unconditionally clears it.\n\n    let p = PersistencePromise.resolve();\n    if (fromVersion < 3 && toVersion >= 3) {\n      // Brand new clients don't need to drop and recreate--only clients that\n      // potentially have corrupt data.\n      if (fromVersion !== 0) {\n        dropQueryCache(db);\n        createQueryCache(db);\n      }\n      p = p.next(() => writeEmptyTargetGlobalEntry(simpleDbTransaction));\n    }\n\n    if (fromVersion < 4 && toVersion >= 4) {\n      if (fromVersion !== 0) {\n        // Schema version 3 uses auto-generated keys to generate globally unique\n        // mutation batch IDs (this was previously ensured internally by the\n        // client). To migrate to the new schema, we have to read all mutations\n        // and write them back out. We preserve the existing batch IDs to guarantee\n        // consistency with other object stores. Any further mutation batch IDs will\n        // be auto-generated.\n        p = p.next(() =>\n          upgradeMutationBatchSchemaAndMigrateData(db, simpleDbTransaction)\n        );\n      }\n\n      p = p.next(() => {\n        createClientMetadataStore(db);\n      });\n    }\n\n    if (fromVersion < 5 && toVersion >= 5) {\n      p = p.next(() => this.removeAcknowledgedMutations(simpleDbTransaction));\n    }\n\n    if (fromVersion < 6 && toVersion >= 6) {\n      p = p.next(() => {\n        createDocumentGlobalStore(db);\n        return this.addDocumentGlobal(simpleDbTransaction);\n      });\n    }\n\n    if (fromVersion < 7 && toVersion >= 7) {\n      p = p.next(() => this.ensureSequenceNumbers(simpleDbTransaction));\n    }\n\n    if (fromVersion < 8 && toVersion >= 8) {\n      p = p.next(() =>\n        this.createCollectionParentIndex(db, simpleDbTransaction)\n      );\n    }\n\n    if (fromVersion < 9 && toVersion >= 9) {\n      p = p.next(() => {\n        // Multi-Tab used to manage its own changelog, but this has been moved\n        // to the DbRemoteDocument object store itself. Since the previous change\n        // log only contained transient data, we can drop its object store.\n        dropRemoteDocumentChangesStore(db);\n\n        // Note: Schema version 9 used to create a read time index for the\n        // RemoteDocumentCache. This is now done with schema version 13.\n      });\n    }\n\n    if (fromVersion < 10 && toVersion >= 10) {\n      p = p.next(() => this.rewriteCanonicalIds(simpleDbTransaction));\n    }\n\n    if (fromVersion < 11 && toVersion >= 11) {\n      p = p.next(() => {\n        createBundlesStore(db);\n        createNamedQueriesStore(db);\n      });\n    }\n\n    if (fromVersion < 12 && toVersion >= 12) {\n      p = p.next(() => {\n        createDocumentOverlayStore(db);\n      });\n    }\n\n    if (fromVersion < 13 && toVersion >= 13) {\n      p = p\n        .next(() => createRemoteDocumentCache(db))\n        .next(() => this.rewriteRemoteDocumentCache(db, simpleDbTransaction))\n        .next(() => db.deleteObjectStore(DbRemoteDocumentStoreLegacy));\n    }\n\n    if (fromVersion < 14 && toVersion >= 14) {\n      p = p.next(() => this.runOverlayMigration(db, simpleDbTransaction));\n    }\n\n    if (fromVersion < 15 && toVersion >= 15) {\n      p = p.next(() => createFieldIndex(db));\n    }\n\n    if (fromVersion < 16 && toVersion >= 16) {\n      // Clear the object stores to remove possibly corrupted index entries\n      p = p\n        .next(() => {\n          const indexStateStore = txn.objectStore(DbIndexStateStore);\n          indexStateStore.clear();\n        })\n        .next(() => {\n          const indexEntryStore = txn.objectStore(DbIndexEntryStore);\n          indexEntryStore.clear();\n        });\n    }\n\n    return p;\n  }\n\n  private addDocumentGlobal(\n    txn: SimpleDbTransaction\n  ): PersistencePromise<void> {\n    let byteSize = 0;\n    return txn\n      .store<DbRemoteDocumentKeyLegacy, DbRemoteDocumentLegacy>(\n        DbRemoteDocumentStoreLegacy\n      )\n      .iterate((_, doc) => {\n        byteSize += dbDocumentSize(doc);\n      })\n      .next(() => {\n        const metadata: DbRemoteDocumentGlobal = { byteSize };\n        return txn\n          .store<DbRemoteDocumentGlobalKey, DbRemoteDocumentGlobal>(\n            DbRemoteDocumentGlobalStore\n          )\n          .put(DbRemoteDocumentGlobalKey, metadata);\n      });\n  }\n\n  private removeAcknowledgedMutations(\n    txn: SimpleDbTransaction\n  ): PersistencePromise<void> {\n    const queuesStore = txn.store<DbMutationQueueKey, DbMutationQueue>(\n      DbMutationQueueStore\n    );\n    const mutationsStore = txn.store<DbMutationBatchKey, DbMutationBatch>(\n      DbMutationBatchStore\n    );\n\n    return queuesStore.loadAll().next(queues => {\n      return PersistencePromise.forEach(queues, (queue: DbMutationQueue) => {\n        const range = IDBKeyRange.bound(\n          [queue.userId, BATCHID_UNKNOWN],\n          [queue.userId, queue.lastAcknowledgedBatchId]\n        );\n\n        return mutationsStore\n          .loadAll(DbMutationBatchUserMutationsIndex, range)\n          .next(dbBatches => {\n            return PersistencePromise.forEach(\n              dbBatches,\n              (dbBatch: DbMutationBatch) => {\n                hardAssert(\n                  dbBatch.userId === queue.userId,\n                  `Cannot process batch ${dbBatch.batchId} from unexpected user`\n                );\n                const batch = fromDbMutationBatch(this.serializer, dbBatch);\n\n                return removeMutationBatch(txn, queue.userId, batch).next(\n                  () => {}\n                );\n              }\n            );\n          });\n      });\n    });\n  }\n\n  /**\n   * Ensures that every document in the remote document cache has a corresponding sentinel row\n   * with a sequence number. Missing rows are given the most recently used sequence number.\n   */\n  private ensureSequenceNumbers(\n    txn: SimpleDbTransaction\n  ): PersistencePromise<void> {\n    const documentTargetStore = txn.store<\n      DbTargetDocumentKey,\n      DbTargetDocument\n    >(DbTargetDocumentStore);\n    const documentsStore = txn.store<\n      DbRemoteDocumentKeyLegacy,\n      DbRemoteDocumentKeyLegacy\n    >(DbRemoteDocumentStoreLegacy);\n    const globalTargetStore = txn.store<DbTargetGlobalKey, DbTargetGlobal>(\n      DbTargetGlobalStore\n    );\n\n    return globalTargetStore.get(DbTargetGlobalKey).next(metadata => {\n      debugAssert(\n        !!metadata,\n        'Metadata should have been written during the version 3 migration'\n      );\n      const writeSentinelKey = (\n        path: ResourcePath\n      ): PersistencePromise<void> => {\n        return documentTargetStore.put({\n          targetId: 0,\n          path: encodeResourcePath(path),\n          sequenceNumber: metadata!.highestListenSequenceNumber!\n        });\n      };\n\n      const promises: Array<PersistencePromise<void>> = [];\n      return documentsStore\n        .iterate((key, doc) => {\n          const path = new ResourcePath(key);\n          const docSentinelKey = sentinelKey(path);\n          promises.push(\n            documentTargetStore.get(docSentinelKey).next(maybeSentinel => {\n              if (!maybeSentinel) {\n                return writeSentinelKey(path);\n              } else {\n                return PersistencePromise.resolve();\n              }\n            })\n          );\n        })\n        .next(() => PersistencePromise.waitFor(promises));\n    });\n  }\n\n  private createCollectionParentIndex(\n    db: IDBDatabase,\n    txn: SimpleDbTransaction\n  ): PersistencePromise<void> {\n    // Create the index.\n    db.createObjectStore(DbCollectionParentStore, {\n      keyPath: DbCollectionParentKeyPath\n    });\n\n    const collectionParentsStore = txn.store<\n      DbCollectionParentKey,\n      DbCollectionParent\n    >(DbCollectionParentStore);\n\n    // Helper to add an index entry iff we haven't already written it.\n    const cache = new MemoryCollectionParentIndex();\n    const addEntry = (\n      collectionPath: ResourcePath\n    ): PersistencePromise<void> | undefined => {\n      if (cache.add(collectionPath)) {\n        const collectionId = collectionPath.lastSegment();\n        const parentPath = collectionPath.popLast();\n        return collectionParentsStore.put({\n          collectionId,\n          parent: encodeResourcePath(parentPath)\n        });\n      }\n    };\n\n    // Index existing remote documents.\n    return txn\n      .store<DbRemoteDocumentKeyLegacy, DbRemoteDocumentLegacy>(\n        DbRemoteDocumentStoreLegacy\n      )\n      .iterate({ keysOnly: true }, (pathSegments, _) => {\n        const path = new ResourcePath(pathSegments);\n        return addEntry(path.popLast());\n      })\n      .next(() => {\n        // Index existing mutations.\n        return txn\n          .store<DbDocumentMutationKey, DbDocumentMutation>(\n            DbDocumentMutationStore\n          )\n          .iterate({ keysOnly: true }, ([userID, encodedPath, batchId], _) => {\n            const path = decodeResourcePath(encodedPath);\n            return addEntry(path.popLast());\n          });\n      });\n  }\n\n  private rewriteCanonicalIds(\n    txn: SimpleDbTransaction\n  ): PersistencePromise<void> {\n    const targetStore = txn.store<DbTargetKey, DbTarget>(DbTargetStore);\n    return targetStore.iterate((key, originalDbTarget) => {\n      const originalTargetData = fromDbTarget(originalDbTarget);\n      const updatedDbTarget = toDbTarget(this.serializer, originalTargetData);\n      return targetStore.put(updatedDbTarget);\n    });\n  }\n\n  private rewriteRemoteDocumentCache(\n    db: IDBDatabase,\n    transaction: SimpleDbTransaction\n  ): PersistencePromise<void> {\n    const legacyRemoteDocumentStore = transaction.store<\n      DbRemoteDocumentKeyLegacy,\n      DbRemoteDocumentLegacy\n    >(DbRemoteDocumentStoreLegacy);\n\n    const writes: Array<PersistencePromise<void>> = [];\n    return legacyRemoteDocumentStore\n      .iterate((_, legacyDocument) => {\n        const remoteDocumentStore = transaction.store<\n          DbRemoteDocumentKey,\n          DbRemoteDocument\n        >(DbRemoteDocumentStore);\n\n        const path = extractKey(legacyDocument).path.toArray();\n        const dbRemoteDocument = {\n          prefixPath: path.slice(0, path.length - 2),\n          collectionGroup: path[path.length - 2],\n          documentId: path[path.length - 1],\n          readTime: legacyDocument.readTime || [0, 0],\n          unknownDocument: legacyDocument.unknownDocument,\n          noDocument: legacyDocument.noDocument,\n          document: legacyDocument.document,\n          hasCommittedMutations: !!legacyDocument.hasCommittedMutations\n        };\n        writes.push(remoteDocumentStore.put(dbRemoteDocument));\n      })\n      .next(() => PersistencePromise.waitFor(writes));\n  }\n\n  private runOverlayMigration(\n    db: IDBDatabase,\n    transaction: SimpleDbTransaction\n  ): PersistencePromise<void> {\n    const mutationsStore = transaction.store<\n      DbMutationBatchKey,\n      DbMutationBatch\n    >(DbMutationBatchStore);\n\n    const remoteDocumentCache = newIndexedDbRemoteDocumentCache(\n      this.serializer\n    );\n    const memoryPersistence = new MemoryPersistence(\n      MemoryEagerDelegate.factory,\n      this.serializer.remoteSerializer\n    );\n\n    return mutationsStore.loadAll().next(dbBatches => {\n      const userToDocumentSet = new Map<string, DocumentKeySet>();\n      dbBatches.forEach(dbBatch => {\n        let documentSet =\n          userToDocumentSet.get(dbBatch.userId) ?? documentKeySet();\n        const batch = fromDbMutationBatch(this.serializer, dbBatch);\n        batch.keys().forEach(key => (documentSet = documentSet.add(key)));\n        userToDocumentSet.set(dbBatch.userId, documentSet);\n      });\n      return PersistencePromise.forEach(\n        userToDocumentSet,\n        (allDocumentKeysForUser, userId) => {\n          const user = new User(userId);\n          const documentOverlayCache = IndexedDbDocumentOverlayCache.forUser(\n            this.serializer,\n            user\n          );\n          // NOTE: The index manager and the reference delegate are\n          // irrelevant for the purpose of recalculating and saving\n          // overlays. We can therefore simply use the memory\n          // implementation.\n          const indexManager = memoryPersistence.getIndexManager(user);\n          const mutationQueue = IndexedDbMutationQueue.forUser(\n            user,\n            this.serializer,\n            indexManager,\n            memoryPersistence.referenceDelegate\n          );\n          const localDocumentsView = new LocalDocumentsView(\n            remoteDocumentCache,\n            mutationQueue,\n            documentOverlayCache,\n            indexManager\n          );\n          return localDocumentsView\n            .recalculateAndSaveOverlaysForDocumentKeys(\n              new IndexedDbTransaction(transaction, ListenSequence.INVALID),\n              allDocumentKeysForUser\n            )\n            .next();\n        }\n      );\n    });\n  }\n}\n\nfunction sentinelKey(path: ResourcePath): DbTargetDocumentKey {\n  return [0, encodeResourcePath(path)];\n}\n\nfunction createPrimaryClientStore(db: IDBDatabase): void {\n  db.createObjectStore(DbPrimaryClientStore);\n}\n\nfunction createMutationQueue(db: IDBDatabase): void {\n  db.createObjectStore(DbMutationQueueStore, {\n    keyPath: DbMutationQueueKeyPath\n  });\n\n  const mutationBatchesStore = db.createObjectStore(DbMutationBatchStore, {\n    keyPath: DbMutationBatchKeyPath,\n    autoIncrement: true\n  });\n  mutationBatchesStore.createIndex(\n    DbMutationBatchUserMutationsIndex,\n    DbMutationBatchUserMutationsKeyPath,\n    { unique: true }\n  );\n\n  db.createObjectStore(DbDocumentMutationStore);\n}\n\n/**\n * Upgrade function to migrate the 'mutations' store from V1 to V3. Loads\n * and rewrites all data.\n */\nfunction upgradeMutationBatchSchemaAndMigrateData(\n  db: IDBDatabase,\n  txn: SimpleDbTransaction\n): PersistencePromise<void> {\n  const v1MutationsStore = txn.store<[string, number], DbMutationBatch>(\n    DbMutationBatchStore\n  );\n  return v1MutationsStore.loadAll().next(existingMutations => {\n    db.deleteObjectStore(DbMutationBatchStore);\n\n    const mutationsStore = db.createObjectStore(DbMutationBatchStore, {\n      keyPath: DbMutationBatchKeyPath,\n      autoIncrement: true\n    });\n    mutationsStore.createIndex(\n      DbMutationBatchUserMutationsIndex,\n      DbMutationBatchUserMutationsKeyPath,\n      { unique: true }\n    );\n\n    const v3MutationsStore = txn.store<DbMutationBatchKey, DbMutationBatch>(\n      DbMutationBatchStore\n    );\n    const writeAll = existingMutations.map(mutation =>\n      v3MutationsStore.put(mutation)\n    );\n\n    return PersistencePromise.waitFor(writeAll);\n  });\n}\n\nfunction createLegacyRemoteDocumentCache(db: IDBDatabase): void {\n  db.createObjectStore(DbRemoteDocumentStoreLegacy);\n}\n\nfunction createRemoteDocumentCache(db: IDBDatabase): void {\n  const remoteDocumentStore = db.createObjectStore(DbRemoteDocumentStore, {\n    keyPath: DbRemoteDocumentKeyPath\n  });\n  remoteDocumentStore.createIndex(\n    DbRemoteDocumentDocumentKeyIndex,\n    DbRemoteDocumentDocumentKeyIndexPath\n  );\n  remoteDocumentStore.createIndex(\n    DbRemoteDocumentCollectionGroupIndex,\n    DbRemoteDocumentCollectionGroupIndexPath\n  );\n}\n\nfunction createDocumentGlobalStore(db: IDBDatabase): void {\n  db.createObjectStore(DbRemoteDocumentGlobalStore);\n}\n\nfunction createQueryCache(db: IDBDatabase): void {\n  const targetDocumentsStore = db.createObjectStore(DbTargetDocumentStore, {\n    keyPath: DbTargetDocumentKeyPath\n  });\n  targetDocumentsStore.createIndex(\n    DbTargetDocumentDocumentTargetsIndex,\n    DbTargetDocumentDocumentTargetsKeyPath,\n    { unique: true }\n  );\n\n  const targetStore = db.createObjectStore(DbTargetStore, {\n    keyPath: DbTargetKeyPath\n  });\n\n  // NOTE: This is unique only because the TargetId is the suffix.\n  targetStore.createIndex(\n    DbTargetQueryTargetsIndexName,\n    DbTargetQueryTargetsKeyPath,\n    { unique: true }\n  );\n  db.createObjectStore(DbTargetGlobalStore);\n}\n\nfunction dropQueryCache(db: IDBDatabase): void {\n  db.deleteObjectStore(DbTargetDocumentStore);\n  db.deleteObjectStore(DbTargetStore);\n  db.deleteObjectStore(DbTargetGlobalStore);\n}\n\nfunction dropRemoteDocumentChangesStore(db: IDBDatabase): void {\n  if (db.objectStoreNames.contains('remoteDocumentChanges')) {\n    db.deleteObjectStore('remoteDocumentChanges');\n  }\n}\n\n/**\n * Creates the target global singleton row.\n *\n * @param txn - The version upgrade transaction for indexeddb\n */\nfunction writeEmptyTargetGlobalEntry(\n  txn: SimpleDbTransaction\n): PersistencePromise<void> {\n  const globalStore = txn.store<DbTargetGlobalKey, DbTargetGlobal>(\n    DbTargetGlobalStore\n  );\n  const metadata: DbTargetGlobal = {\n    highestTargetId: 0,\n    highestListenSequenceNumber: 0,\n    lastRemoteSnapshotVersion: SnapshotVersion.min().toTimestamp(),\n    targetCount: 0\n  };\n  return globalStore.put(DbTargetGlobalKey, metadata);\n}\n\nfunction createClientMetadataStore(db: IDBDatabase): void {\n  db.createObjectStore(DbClientMetadataStore, {\n    keyPath: DbClientMetadataKeyPath\n  });\n}\n\nfunction createBundlesStore(db: IDBDatabase): void {\n  db.createObjectStore(DbBundleStore, {\n    keyPath: DbBundleKeyPath\n  });\n}\n\nfunction createNamedQueriesStore(db: IDBDatabase): void {\n  db.createObjectStore(DbNamedQueryStore, {\n    keyPath: DbNamedQueryKeyPath\n  });\n}\n\nfunction createFieldIndex(db: IDBDatabase): void {\n  const indexConfigurationStore = db.createObjectStore(\n    DbIndexConfigurationStore,\n    {\n      keyPath: DbIndexConfigurationKeyPath,\n      autoIncrement: true\n    }\n  );\n  indexConfigurationStore.createIndex(\n    DbIndexConfigurationCollectionGroupIndex,\n    DbIndexConfigurationCollectionGroupIndexPath,\n    { unique: false }\n  );\n\n  const indexStateStore = db.createObjectStore(DbIndexStateStore, {\n    keyPath: DbIndexStateKeyPath\n  });\n  indexStateStore.createIndex(\n    DbIndexStateSequenceNumberIndex,\n    DbIndexStateSequenceNumberIndexPath,\n    { unique: false }\n  );\n\n  const indexEntryStore = db.createObjectStore(DbIndexEntryStore, {\n    keyPath: DbIndexEntryKeyPath\n  });\n  indexEntryStore.createIndex(\n    DbIndexEntryDocumentKeyIndex,\n    DbIndexEntryDocumentKeyIndexPath,\n    { unique: false }\n  );\n}\n\nfunction createDocumentOverlayStore(db: IDBDatabase): void {\n  const documentOverlayStore = db.createObjectStore(DbDocumentOverlayStore, {\n    keyPath: DbDocumentOverlayKeyPath\n  });\n  documentOverlayStore.createIndex(\n    DbDocumentOverlayCollectionPathOverlayIndex,\n    DbDocumentOverlayCollectionPathOverlayIndexPath,\n    { unique: false }\n  );\n  documentOverlayStore.createIndex(\n    DbDocumentOverlayCollectionGroupOverlayIndex,\n    DbDocumentOverlayCollectionGroupOverlayIndexPath,\n    { unique: false }\n  );\n}\n\nfunction extractKey(remoteDoc: DbRemoteDocumentLegacy): DocumentKey {\n  if (remoteDoc.document) {\n    return new DocumentKey(\n      ResourcePath.fromString(remoteDoc.document.name!).popFirst(5)\n    );\n  } else if (remoteDoc.noDocument) {\n    return DocumentKey.fromSegments(remoteDoc.noDocument.path);\n  } else if (remoteDoc.unknownDocument) {\n    return DocumentKey.fromSegments(remoteDoc.unknownDocument.path);\n  } else {\n    return fail('Unexpected DbRemoteDocument');\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isSafari } from '@firebase/util';\n\nimport { User } from '../auth/user';\nimport { DatabaseId } from '../core/database_info';\nimport { ListenSequence, SequenceNumberSyncer } from '../core/listen_sequence';\nimport { JsonProtoSerializer } from '../remote/serializer';\nimport { debugAssert } from '../util/assert';\nimport { AsyncQueue, DelayedOperation, TimerId } from '../util/async_queue';\nimport { Code, FirestoreError } from '../util/error';\nimport { logDebug, logError } from '../util/log';\nimport { DocumentLike, WindowLike } from '../util/types';\n\nimport { BundleCache } from './bundle_cache';\nimport { DocumentOverlayCache } from './document_overlay_cache';\nimport { IndexManager } from './index_manager';\nimport { IndexedDbBundleCache } from './indexeddb_bundle_cache';\nimport { IndexedDbDocumentOverlayCache } from './indexeddb_document_overlay_cache';\nimport { IndexedDbIndexManager } from './indexeddb_index_manager';\nimport { IndexedDbLruDelegateImpl } from './indexeddb_lru_delegate_impl';\nimport { IndexedDbMutationQueue } from './indexeddb_mutation_queue';\nimport {\n  IndexedDbRemoteDocumentCache,\n  newIndexedDbRemoteDocumentCache\n} from './indexeddb_remote_document_cache';\nimport {\n  DbClientMetadata,\n  DbPrimaryClient,\n  SCHEMA_VERSION\n} from './indexeddb_schema';\nimport { SchemaConverter } from './indexeddb_schema_converter';\nimport {\n  DbClientMetadataKey,\n  DbClientMetadataStore,\n  DbPrimaryClientKey,\n  DbPrimaryClientStore,\n  getObjectStores\n} from './indexeddb_sentinels';\nimport { IndexedDbTargetCache } from './indexeddb_target_cache';\nimport { getStore, IndexedDbTransaction } from './indexeddb_transaction';\nimport { LocalSerializer } from './local_serializer';\nimport { LruParams } from './lru_garbage_collector';\nimport { Persistence, PrimaryStateListener } from './persistence';\nimport { PersistencePromise } from './persistence_promise';\nimport {\n  PersistenceTransaction,\n  PersistenceTransactionMode,\n  PRIMARY_LEASE_LOST_ERROR_MSG\n} from './persistence_transaction';\nimport { ClientId } from './shared_client_state';\nimport {\n  isIndexedDbTransactionError,\n  SimpleDb,\n  SimpleDbStore\n} from './simple_db';\n\nconst LOG_TAG = 'IndexedDbPersistence';\n\n/**\n * Oldest acceptable age in milliseconds for client metadata before the client\n * is considered inactive and its associated data is garbage collected.\n */\nconst MAX_CLIENT_AGE_MS = 30 * 60 * 1000; // 30 minutes\n\n/**\n * Oldest acceptable metadata age for clients that may participate in the\n * primary lease election. Clients that have not updated their client metadata\n * within 5 seconds are not eligible to receive a primary lease.\n */\nconst MAX_PRIMARY_ELIGIBLE_AGE_MS = 5000;\n\n/**\n * The interval at which clients will update their metadata, including\n * refreshing their primary lease if held or potentially trying to acquire it if\n * not held.\n *\n * Primary clients may opportunistically refresh their metadata earlier\n * if they're already performing an IndexedDB operation.\n */\nconst CLIENT_METADATA_REFRESH_INTERVAL_MS = 4000;\n/** User-facing error when the primary lease is required but not available. */\nconst PRIMARY_LEASE_EXCLUSIVE_ERROR_MSG =\n  'Failed to obtain exclusive access to the persistence layer. To allow ' +\n  'shared access, multi-tab synchronization has to be enabled in all tabs. ' +\n  'If you are using `experimentalForceOwningTab:true`, make sure that only ' +\n  'one tab has persistence enabled at any given time.';\nconst UNSUPPORTED_PLATFORM_ERROR_MSG =\n  'This platform is either missing IndexedDB or is known to have ' +\n  'an incomplete implementation. Offline persistence has been disabled.';\n\n// The format of the LocalStorage key that stores zombied client is:\n//     firestore_zombie_<persistence_prefix>_<instance_key>\nconst ZOMBIED_CLIENTS_KEY_PREFIX = 'firestore_zombie';\n\n/**\n * The name of the main (and currently only) IndexedDB database. This name is\n * appended to the prefix provided to the IndexedDbPersistence constructor.\n */\nexport const MAIN_DATABASE = 'main';\n\n/**\n * An IndexedDB-backed instance of Persistence. Data is stored persistently\n * across sessions.\n *\n * On Web only, the Firestore SDKs support shared access to its persistence\n * layer. This allows multiple browser tabs to read and write to IndexedDb and\n * to synchronize state even without network connectivity. Shared access is\n * currently optional and not enabled unless all clients invoke\n * `enablePersistence()` with `{synchronizeTabs:true}`.\n *\n * In multi-tab mode, if multiple clients are active at the same time, the SDK\n * will designate one client as the “primary client”. An effort is made to pick\n * a visible, network-connected and active client, and this client is\n * responsible for letting other clients know about its presence. The primary\n * client writes a unique client-generated identifier (the client ID) to\n * IndexedDb’s “owner” store every 4 seconds. If the primary client fails to\n * update this entry, another client can acquire the lease and take over as\n * primary.\n *\n * Some persistence operations in the SDK are designated as primary-client only\n * operations. This includes the acknowledgment of mutations and all updates of\n * remote documents. The effects of these operations are written to persistence\n * and then broadcast to other tabs via LocalStorage (see\n * `WebStorageSharedClientState`), which then refresh their state from\n * persistence.\n *\n * Similarly, the primary client listens to notifications sent by secondary\n * clients to discover persistence changes written by secondary clients, such as\n * the addition of new mutations and query targets.\n *\n * If multi-tab is not enabled and another tab already obtained the primary\n * lease, IndexedDbPersistence enters a failed state and all subsequent\n * operations will automatically fail.\n *\n * Additionally, there is an optimization so that when a tab is closed, the\n * primary lease is released immediately (this is especially important to make\n * sure that a refreshed tab is able to immediately re-acquire the primary\n * lease). Unfortunately, IndexedDB cannot be reliably used in window.unload\n * since it is an asynchronous API. So in addition to attempting to give up the\n * lease, the leaseholder writes its client ID to a \"zombiedClient\" entry in\n * LocalStorage which acts as an indicator that another tab should go ahead and\n * take the primary lease immediately regardless of the current lease timestamp.\n *\n * TODO(b/114226234): Remove `synchronizeTabs` section when multi-tab is no\n * longer optional.\n */\nexport class IndexedDbPersistence implements Persistence {\n  private simpleDb: SimpleDb;\n\n  private listenSequence: ListenSequence | null = null;\n\n  private _started = false;\n  private isPrimary = false;\n  private networkEnabled = true;\n  private dbName: string;\n\n  /** Our window.unload handler, if registered. */\n  private windowUnloadHandler: (() => void) | null = null;\n  private inForeground = false;\n\n  private serializer: LocalSerializer;\n\n  /** Our 'visibilitychange' listener if registered. */\n  private documentVisibilityHandler: ((e?: Event) => void) | null = null;\n\n  /** The client metadata refresh task. */\n  private clientMetadataRefresher: DelayedOperation<void> | null = null;\n\n  /** The last time we garbage collected the client metadata object store. */\n  private lastGarbageCollectionTime = Number.NEGATIVE_INFINITY;\n\n  /** A listener to notify on primary state changes. */\n  private primaryStateListener: PrimaryStateListener = _ => Promise.resolve();\n\n  private readonly targetCache: IndexedDbTargetCache;\n  private readonly remoteDocumentCache: IndexedDbRemoteDocumentCache;\n  private readonly bundleCache: IndexedDbBundleCache;\n  private readonly webStorage: Storage | null;\n  readonly referenceDelegate: IndexedDbLruDelegateImpl;\n\n  constructor(\n    /**\n     * Whether to synchronize the in-memory state of multiple tabs and share\n     * access to local persistence.\n     */\n    private readonly allowTabSynchronization: boolean,\n\n    private readonly persistenceKey: string,\n    private readonly clientId: ClientId,\n    lruParams: LruParams,\n    private readonly queue: AsyncQueue,\n    private readonly window: WindowLike | null,\n    private readonly document: DocumentLike | null,\n    serializer: JsonProtoSerializer,\n    private readonly sequenceNumberSyncer: SequenceNumberSyncer,\n\n    /**\n     * If set to true, forcefully obtains database access. Existing tabs will\n     * no longer be able to access IndexedDB.\n     */\n    private readonly forceOwningTab: boolean,\n    private readonly schemaVersion = SCHEMA_VERSION\n  ) {\n    if (!IndexedDbPersistence.isAvailable()) {\n      throw new FirestoreError(\n        Code.UNIMPLEMENTED,\n        UNSUPPORTED_PLATFORM_ERROR_MSG\n      );\n    }\n\n    this.referenceDelegate = new IndexedDbLruDelegateImpl(this, lruParams);\n    this.dbName = persistenceKey + MAIN_DATABASE;\n    this.serializer = new LocalSerializer(serializer);\n    this.simpleDb = new SimpleDb(\n      this.dbName,\n      this.schemaVersion,\n      new SchemaConverter(this.serializer)\n    );\n    this.targetCache = new IndexedDbTargetCache(\n      this.referenceDelegate,\n      this.serializer\n    );\n    this.remoteDocumentCache = newIndexedDbRemoteDocumentCache(this.serializer);\n    this.bundleCache = new IndexedDbBundleCache();\n    if (this.window && this.window.localStorage) {\n      this.webStorage = this.window.localStorage;\n    } else {\n      this.webStorage = null;\n      if (forceOwningTab === false) {\n        logError(\n          LOG_TAG,\n          'LocalStorage is unavailable. As a result, persistence may not work ' +\n            'reliably. In particular enablePersistence() could fail immediately ' +\n            'after refreshing the page.'\n        );\n      }\n    }\n  }\n\n  /**\n   * Attempt to start IndexedDb persistence.\n   *\n   * @returns Whether persistence was enabled.\n   */\n  start(): Promise<void> {\n    debugAssert(!this.started, 'IndexedDbPersistence double-started!');\n    debugAssert(this.window !== null, \"Expected 'window' to be defined\");\n\n    // NOTE: This is expected to fail sometimes (in the case of another tab\n    // already having the persistence lock), so it's the first thing we should\n    // do.\n    return this.updateClientMetadataAndTryBecomePrimary()\n      .then(() => {\n        if (!this.isPrimary && !this.allowTabSynchronization) {\n          // Fail `start()` if `synchronizeTabs` is disabled and we cannot\n          // obtain the primary lease.\n          throw new FirestoreError(\n            Code.FAILED_PRECONDITION,\n            PRIMARY_LEASE_EXCLUSIVE_ERROR_MSG\n          );\n        }\n        this.attachVisibilityHandler();\n        this.attachWindowUnloadHook();\n\n        this.scheduleClientMetadataAndPrimaryLeaseRefreshes();\n\n        return this.runTransaction(\n          'getHighestListenSequenceNumber',\n          'readonly',\n          txn => this.targetCache.getHighestSequenceNumber(txn)\n        );\n      })\n      .then(highestListenSequenceNumber => {\n        this.listenSequence = new ListenSequence(\n          highestListenSequenceNumber,\n          this.sequenceNumberSyncer\n        );\n      })\n      .then(() => {\n        this._started = true;\n      })\n      .catch(reason => {\n        this.simpleDb && this.simpleDb.close();\n        return Promise.reject(reason);\n      });\n  }\n\n  /**\n   * Registers a listener that gets called when the primary state of the\n   * instance changes. Upon registering, this listener is invoked immediately\n   * with the current primary state.\n   *\n   * PORTING NOTE: This is only used for Web multi-tab.\n   */\n  setPrimaryStateListener(\n    primaryStateListener: PrimaryStateListener\n  ): Promise<void> {\n    this.primaryStateListener = async primaryState => {\n      if (this.started) {\n        return primaryStateListener(primaryState);\n      }\n    };\n    return primaryStateListener(this.isPrimary);\n  }\n\n  /**\n   * Registers a listener that gets called when the database receives a\n   * version change event indicating that it has deleted.\n   *\n   * PORTING NOTE: This is only used for Web multi-tab.\n   */\n  setDatabaseDeletedListener(\n    databaseDeletedListener: () => Promise<void>\n  ): void {\n    this.simpleDb.setVersionChangeListener(async event => {\n      // Check if an attempt is made to delete IndexedDB.\n      if (event.newVersion === null) {\n        await databaseDeletedListener();\n      }\n    });\n  }\n\n  /**\n   * Adjusts the current network state in the client's metadata, potentially\n   * affecting the primary lease.\n   *\n   * PORTING NOTE: This is only used for Web multi-tab.\n   */\n  setNetworkEnabled(networkEnabled: boolean): void {\n    if (this.networkEnabled !== networkEnabled) {\n      this.networkEnabled = networkEnabled;\n      // Schedule a primary lease refresh for immediate execution. The eventual\n      // lease update will be propagated via `primaryStateListener`.\n      this.queue.enqueueAndForget(async () => {\n        if (this.started) {\n          await this.updateClientMetadataAndTryBecomePrimary();\n        }\n      });\n    }\n  }\n\n  /**\n   * Updates the client metadata in IndexedDb and attempts to either obtain or\n   * extend the primary lease for the local client. Asynchronously notifies the\n   * primary state listener if the client either newly obtained or released its\n   * primary lease.\n   */\n  private updateClientMetadataAndTryBecomePrimary(): Promise<void> {\n    return this.runTransaction(\n      'updateClientMetadataAndTryBecomePrimary',\n      'readwrite',\n      txn => {\n        const metadataStore = clientMetadataStore(txn);\n        return metadataStore\n          .put({\n            clientId: this.clientId,\n            updateTimeMs: Date.now(),\n            networkEnabled: this.networkEnabled,\n            inForeground: this.inForeground\n          })\n          .next(() => {\n            if (this.isPrimary) {\n              return this.verifyPrimaryLease(txn).next(success => {\n                if (!success) {\n                  this.isPrimary = false;\n                  this.queue.enqueueRetryable(() =>\n                    this.primaryStateListener(false)\n                  );\n                }\n              });\n            }\n          })\n          .next(() => this.canActAsPrimary(txn))\n          .next(canActAsPrimary => {\n            if (this.isPrimary && !canActAsPrimary) {\n              return this.releasePrimaryLeaseIfHeld(txn).next(() => false);\n            } else if (canActAsPrimary) {\n              return this.acquireOrExtendPrimaryLease(txn).next(() => true);\n            } else {\n              return /* canActAsPrimary= */ false;\n            }\n          });\n      }\n    )\n      .catch(e => {\n        if (isIndexedDbTransactionError(e)) {\n          logDebug(LOG_TAG, 'Failed to extend owner lease: ', e);\n          // Proceed with the existing state. Any subsequent access to\n          // IndexedDB will verify the lease.\n          return this.isPrimary;\n        }\n\n        if (!this.allowTabSynchronization) {\n          throw e;\n        }\n\n        logDebug(\n          LOG_TAG,\n          'Releasing owner lease after error during lease refresh',\n          e\n        );\n        return /* isPrimary= */ false;\n      })\n      .then(isPrimary => {\n        if (this.isPrimary !== isPrimary) {\n          this.queue.enqueueRetryable(() =>\n            this.primaryStateListener(isPrimary)\n          );\n        }\n        this.isPrimary = isPrimary;\n      });\n  }\n\n  private verifyPrimaryLease(\n    txn: PersistenceTransaction\n  ): PersistencePromise<boolean> {\n    const store = primaryClientStore(txn);\n    return store.get(DbPrimaryClientKey).next(primaryClient => {\n      return PersistencePromise.resolve(this.isLocalClient(primaryClient));\n    });\n  }\n\n  private removeClientMetadata(\n    txn: PersistenceTransaction\n  ): PersistencePromise<void> {\n    const metadataStore = clientMetadataStore(txn);\n    return metadataStore.delete(this.clientId);\n  }\n\n  /**\n   * If the garbage collection threshold has passed, prunes the\n   * RemoteDocumentChanges and the ClientMetadata store based on the last update\n   * time of all clients.\n   */\n  private async maybeGarbageCollectMultiClientState(): Promise<void> {\n    if (\n      this.isPrimary &&\n      !this.isWithinAge(this.lastGarbageCollectionTime, MAX_CLIENT_AGE_MS)\n    ) {\n      this.lastGarbageCollectionTime = Date.now();\n\n      const inactiveClients = await this.runTransaction(\n        'maybeGarbageCollectMultiClientState',\n        'readwrite-primary',\n        txn => {\n          const metadataStore = getStore<DbClientMetadataKey, DbClientMetadata>(\n            txn,\n            DbClientMetadataStore\n          );\n\n          return metadataStore.loadAll().next(existingClients => {\n            const active = this.filterActiveClients(\n              existingClients,\n              MAX_CLIENT_AGE_MS\n            );\n            const inactive = existingClients.filter(\n              client => active.indexOf(client) === -1\n            );\n\n            // Delete metadata for clients that are no longer considered active.\n            return PersistencePromise.forEach(\n              inactive,\n              (inactiveClient: DbClientMetadata) =>\n                metadataStore.delete(inactiveClient.clientId)\n            ).next(() => inactive);\n          });\n        }\n      ).catch(() => {\n        // Ignore primary lease violations or any other type of error. The next\n        // primary will run `maybeGarbageCollectMultiClientState()` again.\n        // We don't use `ignoreIfPrimaryLeaseLoss()` since we don't want to depend\n        // on LocalStore.\n        return [];\n      });\n\n      // Delete potential leftover entries that may continue to mark the\n      // inactive clients as zombied in LocalStorage.\n      // Ideally we'd delete the IndexedDb and LocalStorage zombie entries for\n      // the client atomically, but we can't. So we opt to delete the IndexedDb\n      // entries first to avoid potentially reviving a zombied client.\n      if (this.webStorage) {\n        for (const inactiveClient of inactiveClients) {\n          this.webStorage.removeItem(\n            this.zombiedClientLocalStorageKey(inactiveClient.clientId)\n          );\n        }\n      }\n    }\n  }\n\n  /**\n   * Schedules a recurring timer to update the client metadata and to either\n   * extend or acquire the primary lease if the client is eligible.\n   */\n  private scheduleClientMetadataAndPrimaryLeaseRefreshes(): void {\n    this.clientMetadataRefresher = this.queue.enqueueAfterDelay(\n      TimerId.ClientMetadataRefresh,\n      CLIENT_METADATA_REFRESH_INTERVAL_MS,\n      () => {\n        return this.updateClientMetadataAndTryBecomePrimary()\n          .then(() => this.maybeGarbageCollectMultiClientState())\n          .then(() => this.scheduleClientMetadataAndPrimaryLeaseRefreshes());\n      }\n    );\n  }\n\n  /** Checks whether `client` is the local client. */\n  private isLocalClient(client: DbPrimaryClient | null): boolean {\n    return client ? client.ownerId === this.clientId : false;\n  }\n\n  /**\n   * Evaluate the state of all active clients and determine whether the local\n   * client is or can act as the holder of the primary lease. Returns whether\n   * the client is eligible for the lease, but does not actually acquire it.\n   * May return 'false' even if there is no active leaseholder and another\n   * (foreground) client should become leaseholder instead.\n   */\n  private canActAsPrimary(\n    txn: PersistenceTransaction\n  ): PersistencePromise<boolean> {\n    if (this.forceOwningTab) {\n      return PersistencePromise.resolve<boolean>(true);\n    }\n    const store = primaryClientStore(txn);\n    return store\n      .get(DbPrimaryClientKey)\n      .next(currentPrimary => {\n        const currentLeaseIsValid =\n          currentPrimary !== null &&\n          this.isWithinAge(\n            currentPrimary.leaseTimestampMs,\n            MAX_PRIMARY_ELIGIBLE_AGE_MS\n          ) &&\n          !this.isClientZombied(currentPrimary.ownerId);\n\n        // A client is eligible for the primary lease if:\n        // - its network is enabled and the client's tab is in the foreground.\n        // - its network is enabled and no other client's tab is in the\n        //   foreground.\n        // - every clients network is disabled and the client's tab is in the\n        //   foreground.\n        // - every clients network is disabled and no other client's tab is in\n        //   the foreground.\n        // - the `forceOwningTab` setting was passed in.\n        if (currentLeaseIsValid) {\n          if (this.isLocalClient(currentPrimary) && this.networkEnabled) {\n            return true;\n          }\n\n          if (!this.isLocalClient(currentPrimary)) {\n            if (!currentPrimary!.allowTabSynchronization) {\n              // Fail the `canActAsPrimary` check if the current leaseholder has\n              // not opted into multi-tab synchronization. If this happens at\n              // client startup, we reject the Promise returned by\n              // `enablePersistence()` and the user can continue to use Firestore\n              // with in-memory persistence.\n              // If this fails during a lease refresh, we will instead block the\n              // AsyncQueue from executing further operations. Note that this is\n              // acceptable since mixing & matching different `synchronizeTabs`\n              // settings is not supported.\n              //\n              // TODO(b/114226234): Remove this check when `synchronizeTabs` can\n              // no longer be turned off.\n              throw new FirestoreError(\n                Code.FAILED_PRECONDITION,\n                PRIMARY_LEASE_EXCLUSIVE_ERROR_MSG\n              );\n            }\n\n            return false;\n          }\n        }\n\n        if (this.networkEnabled && this.inForeground) {\n          return true;\n        }\n\n        return clientMetadataStore(txn)\n          .loadAll()\n          .next(existingClients => {\n            // Process all existing clients and determine whether at least one of\n            // them is better suited to obtain the primary lease.\n            const preferredCandidate = this.filterActiveClients(\n              existingClients,\n              MAX_PRIMARY_ELIGIBLE_AGE_MS\n            ).find(otherClient => {\n              if (this.clientId !== otherClient.clientId) {\n                const otherClientHasBetterNetworkState =\n                  !this.networkEnabled && otherClient.networkEnabled;\n                const otherClientHasBetterVisibility =\n                  !this.inForeground && otherClient.inForeground;\n                const otherClientHasSameNetworkState =\n                  this.networkEnabled === otherClient.networkEnabled;\n                if (\n                  otherClientHasBetterNetworkState ||\n                  (otherClientHasBetterVisibility &&\n                    otherClientHasSameNetworkState)\n                ) {\n                  return true;\n                }\n              }\n              return false;\n            });\n            return preferredCandidate === undefined;\n          });\n      })\n      .next(canActAsPrimary => {\n        if (this.isPrimary !== canActAsPrimary) {\n          logDebug(\n            LOG_TAG,\n            `Client ${\n              canActAsPrimary ? 'is' : 'is not'\n            } eligible for a primary lease.`\n          );\n        }\n        return canActAsPrimary;\n      });\n  }\n\n  async shutdown(): Promise<void> {\n    // The shutdown() operations are idempotent and can be called even when\n    // start() aborted (e.g. because it couldn't acquire the persistence lease).\n    this._started = false;\n\n    this.markClientZombied();\n    if (this.clientMetadataRefresher) {\n      this.clientMetadataRefresher.cancel();\n      this.clientMetadataRefresher = null;\n    }\n    this.detachVisibilityHandler();\n    this.detachWindowUnloadHook();\n\n    // Use `SimpleDb.runTransaction` directly to avoid failing if another tab\n    // has obtained the primary lease.\n    await this.simpleDb.runTransaction(\n      'shutdown',\n      'readwrite',\n      [DbPrimaryClientStore, DbClientMetadataStore],\n      simpleDbTxn => {\n        const persistenceTransaction = new IndexedDbTransaction(\n          simpleDbTxn,\n          ListenSequence.INVALID\n        );\n        return this.releasePrimaryLeaseIfHeld(persistenceTransaction).next(() =>\n          this.removeClientMetadata(persistenceTransaction)\n        );\n      }\n    );\n    this.simpleDb.close();\n\n    // Remove the entry marking the client as zombied from LocalStorage since\n    // we successfully deleted its metadata from IndexedDb.\n    this.removeClientZombiedEntry();\n  }\n\n  /**\n   * Returns clients that are not zombied and have an updateTime within the\n   * provided threshold.\n   */\n  private filterActiveClients(\n    clients: DbClientMetadata[],\n    activityThresholdMs: number\n  ): DbClientMetadata[] {\n    return clients.filter(\n      client =>\n        this.isWithinAge(client.updateTimeMs, activityThresholdMs) &&\n        !this.isClientZombied(client.clientId)\n    );\n  }\n\n  /**\n   * Returns the IDs of the clients that are currently active. If multi-tab\n   * is not supported, returns an array that only contains the local client's\n   * ID.\n   *\n   * PORTING NOTE: This is only used for Web multi-tab.\n   */\n  getActiveClients(): Promise<ClientId[]> {\n    return this.runTransaction('getActiveClients', 'readonly', txn => {\n      return clientMetadataStore(txn)\n        .loadAll()\n        .next(clients =>\n          this.filterActiveClients(clients, MAX_CLIENT_AGE_MS).map(\n            clientMetadata => clientMetadata.clientId\n          )\n        );\n    });\n  }\n\n  get started(): boolean {\n    return this._started;\n  }\n\n  getMutationQueue(\n    user: User,\n    indexManager: IndexManager\n  ): IndexedDbMutationQueue {\n    debugAssert(\n      this.started,\n      'Cannot initialize MutationQueue before persistence is started.'\n    );\n    return IndexedDbMutationQueue.forUser(\n      user,\n      this.serializer,\n      indexManager,\n      this.referenceDelegate\n    );\n  }\n\n  getTargetCache(): IndexedDbTargetCache {\n    debugAssert(\n      this.started,\n      'Cannot initialize TargetCache before persistence is started.'\n    );\n    return this.targetCache;\n  }\n\n  getRemoteDocumentCache(): IndexedDbRemoteDocumentCache {\n    debugAssert(\n      this.started,\n      'Cannot initialize RemoteDocumentCache before persistence is started.'\n    );\n    return this.remoteDocumentCache;\n  }\n\n  getIndexManager(user: User): IndexManager {\n    debugAssert(\n      this.started,\n      'Cannot initialize IndexManager before persistence is started.'\n    );\n    return new IndexedDbIndexManager(\n      user,\n      this.serializer.remoteSerializer.databaseId\n    );\n  }\n\n  getDocumentOverlayCache(user: User): DocumentOverlayCache {\n    debugAssert(\n      this.started,\n      'Cannot initialize IndexedDbDocumentOverlayCache before persistence is started.'\n    );\n    return IndexedDbDocumentOverlayCache.forUser(this.serializer, user);\n  }\n\n  getBundleCache(): BundleCache {\n    debugAssert(\n      this.started,\n      'Cannot initialize BundleCache before persistence is started.'\n    );\n    return this.bundleCache;\n  }\n\n  runTransaction<T>(\n    action: string,\n    mode: PersistenceTransactionMode,\n    transactionOperation: (\n      transaction: PersistenceTransaction\n    ) => PersistencePromise<T>\n  ): Promise<T> {\n    logDebug(LOG_TAG, 'Starting transaction:', action);\n\n    const simpleDbMode = mode === 'readonly' ? 'readonly' : 'readwrite';\n    const objectStores = getObjectStores(this.schemaVersion);\n\n    let persistenceTransaction: PersistenceTransaction;\n\n    // Do all transactions as readwrite against all object stores, since we\n    // are the only reader/writer.\n    return this.simpleDb\n      .runTransaction(action, simpleDbMode, objectStores, simpleDbTxn => {\n        persistenceTransaction = new IndexedDbTransaction(\n          simpleDbTxn,\n          this.listenSequence\n            ? this.listenSequence.next()\n            : ListenSequence.INVALID\n        );\n\n        if (mode === 'readwrite-primary') {\n          // While we merely verify that we have (or can acquire) the lease\n          // immediately, we wait to extend the primary lease until after\n          // executing transactionOperation(). This ensures that even if the\n          // transactionOperation takes a long time, we'll use a recent\n          // leaseTimestampMs in the extended (or newly acquired) lease.\n          return this.verifyPrimaryLease(persistenceTransaction)\n            .next(holdsPrimaryLease => {\n              if (holdsPrimaryLease) {\n                return /* holdsPrimaryLease= */ true;\n              }\n              return this.canActAsPrimary(persistenceTransaction);\n            })\n            .next(holdsPrimaryLease => {\n              if (!holdsPrimaryLease) {\n                logError(\n                  `Failed to obtain primary lease for action '${action}'.`\n                );\n                this.isPrimary = false;\n                this.queue.enqueueRetryable(() =>\n                  this.primaryStateListener(false)\n                );\n                throw new FirestoreError(\n                  Code.FAILED_PRECONDITION,\n                  PRIMARY_LEASE_LOST_ERROR_MSG\n                );\n              }\n              return transactionOperation(persistenceTransaction);\n            })\n            .next(result => {\n              return this.acquireOrExtendPrimaryLease(\n                persistenceTransaction\n              ).next(() => result);\n            });\n        } else {\n          return this.verifyAllowTabSynchronization(\n            persistenceTransaction\n          ).next(() => transactionOperation(persistenceTransaction));\n        }\n      })\n      .then(result => {\n        persistenceTransaction.raiseOnCommittedEvent();\n        return result;\n      });\n  }\n\n  /**\n   * Verifies that the current tab is the primary leaseholder or alternatively\n   * that the leaseholder has opted into multi-tab synchronization.\n   */\n  // TODO(b/114226234): Remove this check when `synchronizeTabs` can no longer\n  // be turned off.\n  private verifyAllowTabSynchronization(\n    txn: PersistenceTransaction\n  ): PersistencePromise<void> {\n    const store = primaryClientStore(txn);\n    return store.get(DbPrimaryClientKey).next(currentPrimary => {\n      const currentLeaseIsValid =\n        currentPrimary !== null &&\n        this.isWithinAge(\n          currentPrimary.leaseTimestampMs,\n          MAX_PRIMARY_ELIGIBLE_AGE_MS\n        ) &&\n        !this.isClientZombied(currentPrimary.ownerId);\n\n      if (currentLeaseIsValid && !this.isLocalClient(currentPrimary)) {\n        if (\n          !this.forceOwningTab &&\n          (!this.allowTabSynchronization ||\n            !currentPrimary!.allowTabSynchronization)\n        ) {\n          throw new FirestoreError(\n            Code.FAILED_PRECONDITION,\n            PRIMARY_LEASE_EXCLUSIVE_ERROR_MSG\n          );\n        }\n      }\n    });\n  }\n\n  /**\n   * Obtains or extends the new primary lease for the local client. This\n   * method does not verify that the client is eligible for this lease.\n   */\n  private acquireOrExtendPrimaryLease(\n    txn: PersistenceTransaction\n  ): PersistencePromise<void> {\n    const newPrimary: DbPrimaryClient = {\n      ownerId: this.clientId,\n      allowTabSynchronization: this.allowTabSynchronization,\n      leaseTimestampMs: Date.now()\n    };\n    return primaryClientStore(txn).put(DbPrimaryClientKey, newPrimary);\n  }\n\n  static isAvailable(): boolean {\n    return SimpleDb.isAvailable();\n  }\n\n  /** Checks the primary lease and removes it if we are the current primary. */\n  private releasePrimaryLeaseIfHeld(\n    txn: PersistenceTransaction\n  ): PersistencePromise<void> {\n    const store = primaryClientStore(txn);\n    return store.get(DbPrimaryClientKey).next(primaryClient => {\n      if (this.isLocalClient(primaryClient)) {\n        logDebug(LOG_TAG, 'Releasing primary lease.');\n        return store.delete(DbPrimaryClientKey);\n      } else {\n        return PersistencePromise.resolve();\n      }\n    });\n  }\n\n  /** Verifies that `updateTimeMs` is within `maxAgeMs`. */\n  private isWithinAge(updateTimeMs: number, maxAgeMs: number): boolean {\n    const now = Date.now();\n    const minAcceptable = now - maxAgeMs;\n    const maxAcceptable = now;\n    if (updateTimeMs < minAcceptable) {\n      return false;\n    } else if (updateTimeMs > maxAcceptable) {\n      logError(\n        `Detected an update time that is in the future: ${updateTimeMs} > ${maxAcceptable}`\n      );\n      return false;\n    }\n\n    return true;\n  }\n\n  private attachVisibilityHandler(): void {\n    if (\n      this.document !== null &&\n      typeof this.document.addEventListener === 'function'\n    ) {\n      this.documentVisibilityHandler = () => {\n        this.queue.enqueueAndForget(() => {\n          this.inForeground = this.document!.visibilityState === 'visible';\n          return this.updateClientMetadataAndTryBecomePrimary();\n        });\n      };\n\n      this.document.addEventListener(\n        'visibilitychange',\n        this.documentVisibilityHandler\n      );\n\n      this.inForeground = this.document.visibilityState === 'visible';\n    }\n  }\n\n  private detachVisibilityHandler(): void {\n    if (this.documentVisibilityHandler) {\n      debugAssert(\n        this.document !== null &&\n          typeof this.document.addEventListener === 'function',\n        \"Expected 'document.addEventListener' to be a function\"\n      );\n      this.document.removeEventListener(\n        'visibilitychange',\n        this.documentVisibilityHandler\n      );\n      this.documentVisibilityHandler = null;\n    }\n  }\n\n  /**\n   * Attaches a window.unload handler that will synchronously write our\n   * clientId to a \"zombie client id\" location in LocalStorage. This can be used\n   * by tabs trying to acquire the primary lease to determine that the lease\n   * is no longer valid even if the timestamp is recent. This is particularly\n   * important for the refresh case (so the tab correctly re-acquires the\n   * primary lease). LocalStorage is used for this rather than IndexedDb because\n   * it is a synchronous API and so can be used reliably from  an unload\n   * handler.\n   */\n  private attachWindowUnloadHook(): void {\n    if (typeof this.window?.addEventListener === 'function') {\n      this.windowUnloadHandler = () => {\n        // Note: In theory, this should be scheduled on the AsyncQueue since it\n        // accesses internal state. We execute this code directly during shutdown\n        // to make sure it gets a chance to run.\n        this.markClientZombied();\n\n        const safariIndexdbBugVersionRegex = /(?:Version|Mobile)\\/1[456]/;\n        if (\n          isSafari() &&\n          (navigator.appVersion.match(safariIndexdbBugVersionRegex) ||\n            navigator.userAgent.match(safariIndexdbBugVersionRegex))\n        ) {\n          // On Safari 14, 15, and 16, we do not run any cleanup actions as it might\n          // trigger a bug that prevents Safari from re-opening IndexedDB during\n          // the next page load.\n          // See https://bugs.webkit.org/show_bug.cgi?id=226547\n          this.queue.enterRestrictedMode(/* purgeExistingTasks= */ true);\n        }\n\n        this.queue.enqueueAndForget(() => {\n          // Attempt graceful shutdown (including releasing our primary lease),\n          // but there's no guarantee it will complete.\n          return this.shutdown();\n        });\n      };\n      this.window.addEventListener('pagehide', this.windowUnloadHandler);\n    }\n  }\n\n  private detachWindowUnloadHook(): void {\n    if (this.windowUnloadHandler) {\n      debugAssert(\n        typeof this.window?.removeEventListener === 'function',\n        \"Expected 'window.removeEventListener' to be a function\"\n      );\n      this.window!.removeEventListener('pagehide', this.windowUnloadHandler);\n      this.windowUnloadHandler = null;\n    }\n  }\n\n  /**\n   * Returns whether a client is \"zombied\" based on its LocalStorage entry.\n   * Clients become zombied when their tab closes without running all of the\n   * cleanup logic in `shutdown()`.\n   */\n  private isClientZombied(clientId: ClientId): boolean {\n    try {\n      const isZombied =\n        this.webStorage?.getItem(\n          this.zombiedClientLocalStorageKey(clientId)\n        ) !== null;\n      logDebug(\n        LOG_TAG,\n        `Client '${clientId}' ${\n          isZombied ? 'is' : 'is not'\n        } zombied in LocalStorage`\n      );\n      return isZombied;\n    } catch (e) {\n      // Gracefully handle if LocalStorage isn't working.\n      logError(LOG_TAG, 'Failed to get zombied client id.', e);\n      return false;\n    }\n  }\n\n  /**\n   * Record client as zombied (a client that had its tab closed). Zombied\n   * clients are ignored during primary tab selection.\n   */\n  private markClientZombied(): void {\n    if (!this.webStorage) {\n      return;\n    }\n    try {\n      this.webStorage.setItem(\n        this.zombiedClientLocalStorageKey(this.clientId),\n        String(Date.now())\n      );\n    } catch (e) {\n      // Gracefully handle if LocalStorage isn't available / working.\n      logError('Failed to set zombie client id.', e);\n    }\n  }\n\n  /** Removes the zombied client entry if it exists. */\n  private removeClientZombiedEntry(): void {\n    if (!this.webStorage) {\n      return;\n    }\n    try {\n      this.webStorage.removeItem(\n        this.zombiedClientLocalStorageKey(this.clientId)\n      );\n    } catch (e) {\n      // Ignore\n    }\n  }\n\n  private zombiedClientLocalStorageKey(clientId: ClientId): string {\n    return `${ZOMBIED_CLIENTS_KEY_PREFIX}_${this.persistenceKey}_${clientId}`;\n  }\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the primary client object store.\n */\nfunction primaryClientStore(\n  txn: PersistenceTransaction\n): SimpleDbStore<DbPrimaryClientKey, DbPrimaryClient> {\n  return getStore<DbPrimaryClientKey, DbPrimaryClient>(\n    txn,\n    DbPrimaryClientStore\n  );\n}\n\n/**\n * Helper to get a typed SimpleDbStore for the client metadata object store.\n */\nfunction clientMetadataStore(\n  txn: PersistenceTransaction\n): SimpleDbStore<DbClientMetadataKey, DbClientMetadata> {\n  return getStore<DbClientMetadataKey, DbClientMetadata>(\n    txn,\n    DbClientMetadataStore\n  );\n}\n\n/**\n * Generates a string used as a prefix when storing data in IndexedDB and\n * LocalStorage.\n */\nexport function indexedDbStoragePrefix(\n  databaseId: DatabaseId,\n  persistenceKey: string\n): string {\n  // Use two different prefix formats:\n  //\n  //   * firestore / persistenceKey / projectID . databaseID / ...\n  //   * firestore / persistenceKey / projectID / ...\n  //\n  // projectIDs are DNS-compatible names and cannot contain dots\n  // so there's no danger of collisions.\n  let database = databaseId.projectId;\n  if (!databaseId.isDefaultDatabase) {\n    database += '.' + databaseId.database;\n  }\n\n  return 'firestore/' + persistenceKey + '/' + database + '/';\n}\n\nexport async function indexedDbClearPersistence(\n  persistenceKey: string\n): Promise<void> {\n  if (!SimpleDb.isAvailable()) {\n    return Promise.resolve();\n  }\n  const dbName = persistenceKey + MAIN_DATABASE;\n  await SimpleDb.delete(dbName);\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BatchId, ListenSequenceNumber, TargetId } from '../core/types';\nimport { IndexKind } from '../model/field_index';\nimport { BundledQuery } from '../protos/firestore_bundle_proto';\nimport {\n  Document as ProtoDocument,\n  DocumentsTarget as ProtoDocumentsTarget,\n  QueryTarget as ProtoQueryTarget,\n  Write as ProtoWrite\n} from '../protos/firestore_proto_api';\n\nimport { EncodedResourcePath } from './encoded_resource_path';\nimport { DbTimestampKey } from './indexeddb_sentinels';\n\n/**\n * Schema Version for the Web client:\n * 1.  Initial version including Mutation Queue, Query Cache, and Remote\n *     Document Cache\n * 2.  Used to ensure a targetGlobal object exists and add targetCount to it. No\n *     longer required because migration 3 unconditionally clears it.\n * 3.  Dropped and re-created Query Cache to deal with cache corruption related\n *     to limbo resolution. Addresses\n *     https://github.com/firebase/firebase-ios-sdk/issues/1548\n * 4.  Multi-Tab Support.\n * 5.  Removal of held write acks.\n * 6.  Create document global for tracking document cache size.\n * 7.  Ensure every cached document has a sentinel row with a sequence number.\n * 8.  Add collection-parent index for Collection Group queries.\n * 9.  Change RemoteDocumentChanges store to be keyed by readTime rather than\n *     an auto-incrementing ID. This is required for Index-Free queries.\n * 10. Rewrite the canonical IDs to the explicit Protobuf-based format.\n * 11. Add bundles and named_queries for bundle support.\n * 12. Add document overlays.\n * 13. Rewrite the keys of the remote document cache to allow for efficient\n *     document lookup via `getAll()`.\n * 14. Add overlays.\n * 15. Add indexing support.\n * 16. Parse timestamp strings before creating index entries.\n */\n\nexport const SCHEMA_VERSION = 16;\n\n/**\n * Wrapper class to store timestamps (seconds and nanos) in IndexedDb objects.\n */\nexport interface DbTimestamp {\n  seconds: number;\n  nanoseconds: number;\n}\n\n/**\n * A singleton object to be stored in the 'owner' store in IndexedDb.\n *\n * A given database can have a single primary tab assigned at a given time. That\n * tab must validate that it is still holding the primary lease before every\n * operation that requires locked access. The primary tab should regularly\n * write an updated timestamp to this lease to prevent other tabs from\n * \"stealing\" the primary lease\n */\nexport interface DbPrimaryClient {\n  ownerId: string;\n  /** Whether to allow shared access from multiple tabs. */\n  allowTabSynchronization: boolean;\n  leaseTimestampMs: number;\n}\n\n/**\n * An object to be stored in the 'mutationQueues' store in IndexedDb.\n *\n * Each user gets a single queue of MutationBatches to apply to the server.\n * DbMutationQueue tracks the metadata about the queue.\n */\nexport interface DbMutationQueue {\n  /**\n   * The normalized user ID to which this queue belongs.\n   */\n  userId: string;\n  /**\n   * An identifier for the highest numbered batch that has been acknowledged\n   * by the server. All MutationBatches in this queue with batchIds less\n   * than or equal to this value are considered to have been acknowledged by\n   * the server.\n   *\n   * NOTE: this is deprecated and no longer used by the code.\n   */\n  lastAcknowledgedBatchId: number;\n  /**\n   * A stream token that was previously sent by the server.\n   *\n   * See StreamingWriteRequest in datastore.proto for more details about\n   * usage.\n   *\n   * After sending this token, earlier tokens may not be used anymore so\n   * only a single stream token is retained.\n   *\n   * NOTE: this is deprecated and no longer used by the code.\n   */\n  lastStreamToken: string;\n}\n\n/**\n * An object to be stored in the 'mutations' store in IndexedDb.\n *\n * Represents a batch of user-level mutations intended to be sent to the server\n * in a single write. Each user-level batch gets a separate DbMutationBatch\n * with a new batchId.\n */\nexport interface DbMutationBatch {\n  /**\n   * The normalized user ID to which this batch belongs.\n   */\n  userId: string;\n  /**\n   * An identifier for this batch, allocated using an auto-generated key.\n   */\n  batchId: BatchId;\n  /**\n   * The local write time of the batch, stored as milliseconds since the\n   * epoch.\n   */\n  localWriteTimeMs: number;\n  /**\n   * A list of \"mutations\" that represent a partial base state from when this\n   * write batch was initially created. During local application of the write\n   * batch, these baseMutations are applied prior to the real writes in order\n   * to override certain document fields from the remote document cache. This\n   * is necessary in the case of non-idempotent writes (e.g. `increment()`\n   * transforms) to make sure that the local view of the modified documents\n   * doesn't flicker if the remote document cache receives the result of the\n   * non-idempotent write before the write is removed from the queue.\n   *\n   * These mutations are never sent to the backend.\n   */\n  baseMutations?: ProtoWrite[];\n  /**\n   * A list of mutations to apply. All mutations will be applied atomically.\n   *\n   * Mutations are serialized via toMutation().\n   */\n  mutations: ProtoWrite[];\n}\n\n/**\n * An object to be stored in the 'documentMutations' store in IndexedDb.\n *\n * A manually maintained index of all the mutation batches that affect a given\n * document key. The rows in this table are references based on the contents of\n * DbMutationBatch.mutations.\n */\nexport interface DbDocumentMutation {}\n\n/**\n * Represents the known absence of a document at a particular version.\n * Stored in IndexedDb as part of a DbRemoteDocument object.\n */\nexport interface DbNoDocument {\n  path: string[];\n  readTime: DbTimestamp;\n}\n\n/**\n * Represents a document that is known to exist but whose data is unknown.\n * Stored in IndexedDb as part of a DbRemoteDocument object.\n */\nexport interface DbUnknownDocument {\n  path: string[];\n  version: DbTimestamp;\n}\n\n/**\n * An object to be stored in the 'remoteDocuments' store in IndexedDb.\n * It represents either:\n *\n * - A complete document.\n * - A \"no document\" representing a document that is known not to exist (at\n * some version).\n * - An \"unknown document\" representing a document that is known to exist (at\n * some version) but whose contents are unknown.\n *\n * The document key is split up across `prefixPath`, `collectionGroup` and\n * `documentId`.\n *\n * Note: This is the persisted equivalent of a MaybeDocument and could perhaps\n * be made more general if necessary.\n */\nexport interface DbRemoteDocument {\n  /** The path to the document's collection (excluding). */\n  prefixPath: string[];\n\n  /** The collection ID the document is direclty nested under. */\n  collectionGroup: string;\n\n  /** The document ID. */\n  documentId: string;\n\n  /** When the document was read from the backend. */\n  readTime: DbTimestampKey;\n\n  /**\n   * Set to an instance of DbUnknownDocument if the data for a document is\n   * not known, but it is known that a document exists at the specified\n   * version (e.g. it had a successful update applied to it)\n   */\n  unknownDocument?: DbUnknownDocument;\n  /**\n   * Set to an instance of a DbNoDocument if it is known that no document\n   * exists.\n   */\n  noDocument?: DbNoDocument;\n  /**\n   * Set to an instance of a Document if there's a cached version of the\n   * document.\n   */\n  document?: ProtoDocument;\n  /**\n   * Documents that were written to the remote document store based on\n   * a write acknowledgment are marked with `hasCommittedMutations`. These\n   * documents are potentially inconsistent with the backend's copy and use\n   * the write's commit version as their document version.\n   */\n  hasCommittedMutations: boolean;\n}\n\n/**\n * Contains a single entry that has metadata about the remote document cache.\n */\nexport interface DbRemoteDocumentGlobal {\n  /**\n   * Approximately the total size in bytes of all the\n   * documents in the document cache.\n   */\n  byteSize: number;\n}\n\n/**\n * The persisted type for a query nested with in the 'targets' store in\n * IndexedDb. We use the proto definitions for these two kinds of queries in\n * order to avoid writing extra serialization logic.\n */\nexport type DbQuery = ProtoQueryTarget | ProtoDocumentsTarget;\n\n/**\n * An object to be stored in the 'targets' store in IndexedDb.\n *\n * This is based on and should be kept in sync with the proto used in the iOS\n * client.\n *\n * Each query the client listens to against the server is tracked on disk so\n * that the query can be efficiently resumed on restart.\n */\nexport interface DbTarget {\n  /**\n   * An auto-generated sequential numeric identifier for the query.\n   *\n   * Queries are stored using their canonicalId as the key, but these\n   * canonicalIds can be quite long so we additionally assign a unique\n   * queryId which can be used by referenced data structures (e.g.\n   * indexes) to minimize the on-disk cost.\n   */\n  targetId: TargetId;\n  /**\n   * The canonical string representing this query. This is not unique.\n   */\n  canonicalId: string;\n  /**\n   * The last readTime received from the Watch Service for this query.\n   *\n   * This is the same value as TargetChange.read_time in the protos.\n   */\n  readTime: DbTimestamp;\n  /**\n   * An opaque, server-assigned token that allows watching a query to be\n   * resumed after disconnecting without retransmitting all the data\n   * that matches the query. The resume token essentially identifies a\n   * point in time from which the server should resume sending results.\n   *\n   * This is related to the snapshotVersion in that the resumeToken\n   * effectively also encodes that value, but the resumeToken is opaque\n   * and sometimes encodes additional information.\n   *\n   * A consequence of this is that the resumeToken should be used when\n   * asking the server to reason about where this client is in the watch\n   * stream, but the client should use the snapshotVersion for its own\n   * purposes.\n   *\n   * This is the same value as TargetChange.resume_token in the protos.\n   */\n  resumeToken: string;\n  /**\n   * A sequence number representing the last time this query was\n   * listened to, used for garbage collection purposes.\n   *\n   * Conventionally this would be a timestamp value, but device-local\n   * clocks are unreliable and they must be able to create new listens\n   * even while disconnected. Instead this should be a monotonically\n   * increasing number that's incremented on each listen call.\n   *\n   * This is different from the queryId since the queryId is an\n   * immutable identifier assigned to the Query on first use while\n   * lastListenSequenceNumber is updated every time the query is\n   * listened to.\n   */\n  lastListenSequenceNumber: number;\n  /**\n   * Denotes the maximum snapshot version at which the associated query view\n   * contained no limbo documents.  Undefined for data written prior to\n   * schema version 9.\n   */\n  lastLimboFreeSnapshotVersion?: DbTimestamp;\n  /**\n   * The query for this target.\n   *\n   * Because canonical ids are not unique we must store the actual query. We\n   * use the proto to have an object we can persist without having to\n   * duplicate translation logic to and from a `Query` object.\n   */\n  query: DbQuery;\n}\n\n/**\n * An object representing an association between a target and a document, or a\n * sentinel row marking the last sequence number at which a document was used.\n * Each document cached must have a corresponding sentinel row before lru\n * garbage collection is enabled.\n *\n * The target associations and sentinel rows are co-located so that orphaned\n * documents and their sequence numbers can be identified efficiently via a scan\n * of this store.\n */\nexport interface DbTargetDocument {\n  /**\n   * The targetId identifying a target or 0 for a sentinel row.\n   */\n  targetId: TargetId;\n  /**\n   * The path to the document, as encoded in the key.\n   */\n  path: EncodedResourcePath;\n  /**\n   * If this is a sentinel row, this should be the sequence number of the last\n   * time the document specified by `path` was used. Otherwise, it should be\n   * `undefined`.\n   */\n  sequenceNumber?: ListenSequenceNumber;\n}\n\n/**\n * A record of global state tracked across all Targets, tracked separately\n * to avoid the need for extra indexes.\n *\n * This should be kept in-sync with the proto used in the iOS client.\n */\nexport interface DbTargetGlobal {\n  /**\n   * The highest numbered target id across all targets.\n   *\n   * See DbTarget.targetId.\n   */\n  highestTargetId: TargetId;\n  /**\n   * The highest numbered lastListenSequenceNumber across all targets.\n   *\n   * See DbTarget.lastListenSequenceNumber.\n   */\n  highestListenSequenceNumber: number;\n  /**\n   * A global snapshot version representing the last consistent snapshot we\n   * received from the backend. This is monotonically increasing and any\n   * snapshots received from the backend prior to this version (e.g. for\n   * targets resumed with a resumeToken) should be suppressed (buffered)\n   * until the backend has caught up to this snapshot version again. This\n   * prevents our cache from ever going backwards in time.\n   */\n  lastRemoteSnapshotVersion: DbTimestamp;\n  /**\n   * The number of targets persisted.\n   */\n  targetCount: number;\n}\n\n/**\n * An object representing an association between a Collection id (e.g. 'messages')\n * to a parent path (e.g. '/chats/123') that contains it as a (sub)collection.\n * This is used to efficiently find all collections to query when performing\n * a Collection Group query.\n */\nexport interface DbCollectionParent {\n  /**\n   * The collectionId (e.g. 'messages')\n   */\n  collectionId: string;\n  /**\n   * The path to the parent (either a document location or an empty path for\n   * a root-level collection).\n   */\n  parent: EncodedResourcePath;\n}\n\n/**\n * A record of the metadata state of each client.\n *\n * PORTING NOTE: This is used to synchronize multi-tab state and does not need\n * to be ported to iOS or Android.\n */\nexport interface DbClientMetadata {\n  // Note: Previous schema versions included a field\n  // \"lastProcessedDocumentChangeId\". Don't use anymore.\n\n  /** The auto-generated client id assigned at client startup. */\n  clientId: string;\n  /** The last time this state was updated. */\n  updateTimeMs: number;\n  /** Whether the client's network connection is enabled. */\n  networkEnabled: boolean;\n  /** Whether this client is running in a foreground tab. */\n  inForeground: boolean;\n}\n\n/** An object representing a bundle loaded by the SDK. */\nexport interface DbBundle {\n  /** The ID of the loaded bundle. */\n  bundleId: string;\n  /** The create time of the loaded bundle. */\n  createTime: DbTimestamp;\n  /** The schema version of the loaded bundle. */\n  version: number;\n}\n\n/** An object representing a named query loaded by the SDK via a bundle. */\nexport interface DbNamedQuery {\n  /** The name of the query. */\n  name: string;\n  /** The read time of the results saved in the bundle from the named query. */\n  readTime: DbTimestamp;\n  /** The query saved in the bundle. */\n  bundledQuery: BundledQuery;\n}\n\n/** An object representing the global configuration for a field index. */\nexport interface DbIndexConfiguration {\n  /**\n   * The index id for this entry. Undefined for indexes that are not yet\n   * persisted.\n   */\n  indexId?: number;\n  /** The collection group this index belongs to. */\n  collectionGroup: string;\n  /** The fields to index for this index. */\n  fields: Array<[name: string, kind: IndexKind]>;\n}\n\n/**\n * An object describing how up-to-date the index backfill is for each user and\n * index.\n */\nexport interface DbIndexState {\n  /** The index id for this entry. */\n  indexId: number;\n  /** The user id for this entry. */\n  uid: string;\n  /**\n   * A number that indicates when the index was last updated (relative to\n   * other indexes).\n   */\n  sequenceNumber: number;\n  /**\n   * The latest read time that has been indexed by Firestore for this field\n   * index. Set to `{seconds: 0, nanos: 0}` if no documents have been indexed.\n   */\n  readTime: DbTimestamp;\n  /**\n   * The last document that has been indexed for this field index. Empty if\n   * no documents have been indexed.\n   */\n  documentKey: EncodedResourcePath;\n  /**\n   * The largest mutation batch id that has been processed for this index. -1\n   * if no mutations have been indexed.\n   */\n  largestBatchId: number;\n}\n\n/** An object that stores the encoded entries for all documents and fields. */\nexport interface DbIndexEntry {\n  // TODO(indexing): Consider just storing `orderedDocumentKey` and decoding\n  // the ordered key into a document key. This would reduce storage space on\n  // disk but require us to port parts of OrderedCodeReader.\n\n  /** The index id for this entry. */\n  indexId: number;\n  /** The user id for this entry. */\n  uid: string;\n  /** The encoded array index value for this entry. */\n  arrayValue: Uint8Array;\n  /** The encoded directional value for equality and inequality filters. */\n  directionalValue: Uint8Array;\n  /**\n   * The document key this entry points to. This entry is encoded by an ordered\n   * encoder to match the key order of the index.\n   */\n  orderedDocumentKey: Uint8Array;\n  /** The segments of the document key this entry points to. */\n  documentKey: string[];\n}\n\n/**\n * An object representing a document overlay.\n */\nexport interface DbDocumentOverlay {\n  /** The user ID to whom this overlay belongs. */\n  userId: string;\n  /** The path to the collection that contains the document. */\n  collectionPath: string;\n  /** The ID (key) of the document within the collection. */\n  documentId: string;\n  /** The collection group to which the document belongs. */\n  collectionGroup: string;\n  /** The largest batch ID that's been applied for this overlay. */\n  largestBatchId: number;\n  /** The overlay mutation. */\n  overlayMutation: ProtoWrite;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TargetId } from '../core/types';\nimport { ChangeType, ViewSnapshot } from '../core/view_snapshot';\nimport { documentKeySet, DocumentKeySet } from '../model/collections';\n\n/**\n * A set of changes to what documents are currently in view and out of view for\n * a given query. These changes are sent to the LocalStore by the View (via\n * the SyncEngine) and are used to pin / unpin documents as appropriate.\n */\nexport class LocalViewChanges {\n  constructor(\n    readonly targetId: TargetId,\n    readonly fromCache: boolean,\n    readonly addedKeys: DocumentKeySet,\n    readonly removedKeys: DocumentKeySet\n  ) {}\n\n  static fromSnapshot(\n    targetId: TargetId,\n    viewSnapshot: ViewSnapshot\n  ): LocalViewChanges {\n    let addedKeys = documentKeySet();\n    let removedKeys = documentKeySet();\n\n    for (const docChange of viewSnapshot.docChanges) {\n      switch (docChange.type) {\n        case ChangeType.Added:\n          addedKeys = addedKeys.add(docChange.doc.key);\n          break;\n        case ChangeType.Removed:\n          removedKeys = removedKeys.add(docChange.doc.key);\n          break;\n        default:\n        // do nothing\n      }\n    }\n\n    return new LocalViewChanges(\n      targetId,\n      viewSnapshot.fromCache,\n      addedKeys,\n      removedKeys\n    );\n  }\n}\n","/**\n * @license\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A tracker to keep a record of important details during database local query\n * execution.\n */\nexport class QueryContext {\n  /**\n   * Counts the number of documents passed through during local query execution.\n   */\n  private _documentReadCount = 0;\n\n  get documentReadCount(): number {\n    return this._documentReadCount;\n  }\n\n  incrementDocumentReadCount(amount: number): void {\n    this._documentReadCount += amount;\n  }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getUA, isSafari } from '@firebase/util';\n\nimport {\n  LimitType,\n  newQueryComparator,\n  Query,\n  queryMatches,\n  queryMatchesAllDocuments,\n  queryToTarget,\n  queryWithLimit,\n  stringifyQuery\n} from '../core/query';\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport {\n  documentKeySet,\n  DocumentKeySet,\n  DocumentMap\n} from '../model/collections';\nimport { Document } from '../model/document';\nimport {\n  IndexOffset,\n  INITIAL_LARGEST_BATCH_ID,\n  newIndexOffsetSuccessorFromReadTime\n} from '../model/field_index';\nimport { debugAssert } from '../util/assert';\nimport { getLogLevel, logDebug, LogLevel } from '../util/log';\nimport { Iterable } from '../util/misc';\nimport { SortedSet } from '../util/sorted_set';\n\nimport { IndexManager, IndexType } from './index_manager';\nimport { LocalDocumentsView } from './local_documents_view';\nimport { PersistencePromise } from './persistence_promise';\nimport { PersistenceTransaction } from './persistence_transaction';\nimport { QueryContext } from './query_context';\nimport { getAndroidVersion } from './simple_db';\n\nconst DEFAULT_INDEX_AUTO_CREATION_MIN_COLLECTION_SIZE = 100;\n\n/**\n * This cost represents the evaluation result of\n * (([index, docKey] + [docKey, docContent]) per document in the result set)\n * / ([docKey, docContent] per documents in full collection scan) coming from\n * experiment [enter PR experiment URL here].\n */\nfunction getDefaultRelativeIndexReadCostPerDocument(): number {\n  // These values were derived from an experiment where several members of the\n  // Firestore SDK team ran a performance test in various environments.\n  // Googlers can see b/299284287 for details.\n  if (isSafari()) {\n    return 8;\n  } else if (getAndroidVersion(getUA()) > 0) {\n    return 6;\n  } else {\n    return 4;\n  }\n}\n\n/**\n * The Firestore query engine.\n *\n * Firestore queries can be executed in three modes. The Query Engine determines\n * what mode to use based on what data is persisted. The mode only determines\n * the runtime complexity of the query - the result set is equivalent across all\n * implementations.\n *\n * The Query engine will use indexed-based execution if a user has configured\n * any index that can be used to execute query (via `setIndexConfiguration()`).\n * Otherwise, the engine will try to optimize the query by re-using a previously\n * persisted query result. If that is not possible, the query will be executed\n * via a full collection scan.\n *\n * Index-based execution is the default when available. The query engine\n * supports partial indexed execution and merges the result from the index\n * lookup with documents that have not yet been indexed. The index evaluation\n * matches the backend's format and as such, the SDK can use indexing for all\n * queries that the backend supports.\n *\n * If no index exists, the query engine tries to take advantage of the target\n * document mapping in the TargetCache. These mappings exists for all queries\n * that have been synced with the backend at least once and allow the query\n * engine to only read documents that previously matched a query plus any\n * documents that were edited after the query was last listened to.\n *\n * There are some cases when this optimization is not guaranteed to produce\n * the same results as full collection scans. In these cases, query\n * processing falls back to full scans. These cases are:\n *\n * - Limit queries where a document that matched the query previously no longer\n *   matches the query.\n *\n * - Limit queries where a document edit may cause the document to sort below\n *   another document that is in the local cache.\n *\n * - Queries that have never been CURRENT or free of limbo documents.\n */\nexport class QueryEngine {\n  private localDocumentsView!: LocalDocumentsView;\n  private indexManager!: IndexManager;\n  private initialized = false;\n\n  indexAutoCreationEnabled = false;\n\n  /**\n   * SDK only decides whether it should create index when collection size is\n   * larger than this.\n   */\n  indexAutoCreationMinCollectionSize =\n    DEFAULT_INDEX_AUTO_CREATION_MIN_COLLECTION_SIZE;\n\n  relativeIndexReadCostPerDocument =\n    getDefaultRelativeIndexReadCostPerDocument();\n\n  /** Sets the document view to query against. */\n  initialize(\n    localDocuments: LocalDocumentsView,\n    indexManager: IndexManager\n  ): void {\n    this.localDocumentsView = localDocuments;\n    this.indexManager = indexManager;\n    this.initialized = true;\n  }\n\n  /** Returns all local documents matching the specified query. */\n  getDocumentsMatchingQuery(\n    transaction: PersistenceTransaction,\n    query: Query,\n    lastLimboFreeSnapshotVersion: SnapshotVersion,\n    remoteKeys: DocumentKeySet\n  ): PersistencePromise<DocumentMap> {\n    debugAssert(this.initialized, 'initialize() not called');\n\n    // Stores the result from executing the query; using this object is more\n    // convenient than passing the result between steps of the persistence\n    // transaction and improves readability comparatively.\n    const queryResult: { result: DocumentMap | null } = { result: null };\n\n    return this.performQueryUsingIndex(transaction, query)\n      .next(result => {\n        queryResult.result = result;\n      })\n      .next(() => {\n        if (queryResult.result) {\n          return;\n        }\n        return this.performQueryUsingRemoteKeys(\n          transaction,\n          query,\n          remoteKeys,\n          lastLimboFreeSnapshotVersion\n        ).next(result => {\n          queryResult.result = result;\n        });\n      })\n      .next(() => {\n        if (queryResult.result) {\n          return;\n        }\n        const context = new QueryContext();\n        return this.executeFullCollectionScan(transaction, query, context).next(\n          result => {\n            queryResult.result = result;\n            if (this.indexAutoCreationEnabled) {\n              return this.createCacheIndexes(\n                transaction,\n                query,\n                context,\n                result.size\n              );\n            }\n          }\n        );\n      })\n      .next(() => queryResult.result!);\n  }\n\n  createCacheIndexes(\n    transaction: PersistenceTransaction,\n    query: Query,\n    context: QueryContext,\n    resultSize: number\n  ): PersistencePromise<void> {\n    if (context.documentReadCount < this.indexAutoCreationMinCollectionSize) {\n      if (getLogLevel() <= LogLevel.DEBUG) {\n        logDebug(\n          'QueryEngine',\n          'SDK will not create cache indexes for query:',\n          stringifyQuery(query),\n          'since it only creates cache indexes for collection contains',\n          'more than or equal to',\n          this.indexAutoCreationMinCollectionSize,\n          'documents'\n        );\n      }\n      return PersistencePromise.resolve();\n    }\n\n    if (getLogLevel() <= LogLevel.DEBUG) {\n      logDebug(\n        'QueryEngine',\n        'Query:',\n        stringifyQuery(query),\n        'scans',\n        context.documentReadCount,\n        'local documents and returns',\n        resultSize,\n        'documents as results.'\n      );\n    }\n\n    if (\n      context.documentReadCount >\n      this.relativeIndexReadCostPerDocument * resultSize\n    ) {\n      if (getLogLevel() <= LogLevel.DEBUG) {\n        logDebug(\n          'QueryEngine',\n          'The SDK decides to create cache indexes for query:',\n          stringifyQuery(query),\n          'as using cache indexes may help improve performance.'\n        );\n      }\n      return this.indexManager.createTargetIndexes(\n        transaction,\n        queryToTarget(query)\n      );\n    }\n\n    return PersistencePromise.resolve();\n  }\n\n  /**\n   * Performs an indexed query that evaluates the query based on a collection's\n   * persisted index values. Returns `null` if an index is not available.\n   */\n  private performQueryUsingIndex(\n    transaction: PersistenceTransaction,\n    query: Query\n  ): PersistencePromise<DocumentMap | null> {\n    if (queryMatchesAllDocuments(query)) {\n      // Queries that match all documents don't benefit from using\n      // key-based lookups. It is more efficient to scan all documents in a\n      // collection, rather than to perform individual lookups.\n      return PersistencePromise.resolve<DocumentMap | null>(null);\n    }\n\n    let target = queryToTarget(query);\n    return this.indexManager\n      .getIndexType(transaction, target)\n      .next(indexType => {\n        if (indexType === IndexType.NONE) {\n          // The target cannot be served from any index.\n          return null;\n        }\n\n        if (query.limit !== null && indexType === IndexType.PARTIAL) {\n          // We cannot apply a limit for targets that are served using a partial\n          // index. If a partial index will be used to serve the target, the\n          // query may return a superset of documents that match the target\n          // (e.g. if the index doesn't include all the target's filters), or\n          // may return the correct set of documents in the wrong order (e.g. if\n          // the index doesn't include a segment for one of the orderBys).\n          // Therefore, a limit should not be applied in such cases.\n          query = queryWithLimit(query, null, LimitType.First);\n          target = queryToTarget(query);\n        }\n\n        return this.indexManager\n          .getDocumentsMatchingTarget(transaction, target)\n          .next(keys => {\n            debugAssert(\n              !!keys,\n              'Index manager must return results for partial and full indexes.'\n            );\n            const sortedKeys = documentKeySet(...keys);\n            return this.localDocumentsView\n              .getDocuments(transaction, sortedKeys)\n              .next(indexedDocuments => {\n                return this.indexManager\n                  .getMinOffset(transaction, target)\n                  .next(offset => {\n                    const previousResults = this.applyQuery(\n                      query,\n                      indexedDocuments\n                    );\n\n                    if (\n                      this.needsRefill(\n                        query,\n                        previousResults,\n                        sortedKeys,\n                        offset.readTime\n                      )\n                    ) {\n                      // A limit query whose boundaries change due to local\n                      // edits can be re-run against the cache by excluding the\n                      // limit. This ensures that all documents that match the\n                      // query's filters are included in the result set. The SDK\n                      // can then apply the limit once all local edits are\n                      // incorporated.\n                      return this.performQueryUsingIndex(\n                        transaction,\n                        queryWithLimit(query, null, LimitType.First)\n                      );\n                    }\n\n                    return this.appendRemainingResults(\n                      transaction,\n                      previousResults,\n                      query,\n                      offset\n                    ) as PersistencePromise<DocumentMap | null>;\n                  });\n              });\n          });\n      });\n  }\n\n  /**\n   * Performs a query based on the target's persisted query mapping. Returns\n   * `null` if the mapping is not available or cannot be used.\n   */\n  private performQueryUsingRemoteKeys(\n    transaction: PersistenceTransaction,\n    query: Query,\n    remoteKeys: DocumentKeySet,\n    lastLimboFreeSnapshotVersion: SnapshotVersion\n  ): PersistencePromise<DocumentMap | null> {\n    if (queryMatchesAllDocuments(query)) {\n      // Queries that match all documents don't benefit from using\n      // key-based lookups. It is more efficient to scan all documents in a\n      // collection, rather than to perform individual lookups.\n      return PersistencePromise.resolve<DocumentMap | null>(null);\n    }\n\n    // Queries that have never seen a snapshot without limbo free documents\n    // should also be run as a full collection scan.\n    if (lastLimboFreeSnapshotVersion.isEqual(SnapshotVersion.min())) {\n      return PersistencePromise.resolve<DocumentMap | null>(null);\n    }\n\n    return this.localDocumentsView!.getDocuments(transaction, remoteKeys).next(\n      documents => {\n        const previousResults = this.applyQuery(query, documents);\n\n        if (\n          this.needsRefill(\n            query,\n            previousResults,\n            remoteKeys,\n            lastLimboFreeSnapshotVersion\n          )\n        ) {\n          return PersistencePromise.resolve<DocumentMap | null>(null);\n        }\n\n        if (getLogLevel() <= LogLevel.DEBUG) {\n          logDebug(\n            'QueryEngine',\n            'Re-using previous result from %s to execute query: %s',\n            lastLimboFreeSnapshotVersion.toString(),\n            stringifyQuery(query)\n          );\n        }\n\n        // Retrieve all results for documents that were updated since the last\n        // limbo-document free remote snapshot.\n        return this.appendRemainingResults(\n          transaction,\n          previousResults,\n          query,\n          newIndexOffsetSuccessorFromReadTime(\n            lastLimboFreeSnapshotVersion,\n            INITIAL_LARGEST_BATCH_ID\n          )\n        ).next<DocumentMap | null>(results => results);\n      }\n    );\n  }\n\n  /** Applies the query filter and sorting to the provided documents.  */\n  private applyQuery(\n    query: Query,\n    documents: DocumentMap\n  ): SortedSet<Document> {\n    // Sort the documents and re-apply the query filter since previously\n    // matching documents do not necessarily still match the query.\n    let queryResults = new SortedSet<Document>(newQueryComparator(query));\n    documents.forEach((_, maybeDoc) => {\n      if (queryMatches(query, maybeDoc)) {\n        queryResults = queryResults.add(maybeDoc);\n      }\n    });\n    return queryResults;\n  }\n\n  /**\n   * Determines if a limit query needs to be refilled from cache, making it\n   * ineligible for index-free execution.\n   *\n   * @param query - The query.\n   * @param sortedPreviousResults - The documents that matched the query when it\n   * was last synchronized, sorted by the query's comparator.\n   * @param remoteKeys - The document keys that matched the query at the last\n   * snapshot.\n   * @param limboFreeSnapshotVersion - The version of the snapshot when the\n   * query was last synchronized.\n   */\n  private needsRefill(\n    query: Query,\n    sortedPreviousResults: SortedSet<Document>,\n    remoteKeys: DocumentKeySet,\n    limboFreeSnapshotVersion: SnapshotVersion\n  ): boolean {\n    if (query.limit === null) {\n      // Queries without limits do not need to be refilled.\n      return false;\n    }\n\n    if (remoteKeys.size !== sortedPreviousResults.size) {\n      // The query needs to be refilled if a previously matching document no\n      // longer matches.\n      return true;\n    }\n\n    // Limit queries are not eligible for index-free query execution if there is\n    // a potential that an older document from cache now sorts before a document\n    // that was previously part of the limit. This, however, can only happen if\n    // the document at the edge of the limit goes out of limit.\n    // If a document that is not the limit boundary sorts differently,\n    // the boundary of the limit itself did not change and documents from cache\n    // will continue to be \"rejected\" by this boundary. Therefore, we can ignore\n    // any modifications that don't affect the last document.\n    const docAtLimitEdge =\n      query.limitType === LimitType.First\n        ? sortedPreviousResults.last()\n        : sortedPreviousResults.first();\n    if (!docAtLimitEdge) {\n      // We don't need to refill the query if there were already no documents.\n      return false;\n    }\n    return (\n      docAtLimitEdge.hasPendingWrites ||\n      docAtLimitEdge.version.compareTo(limboFreeSnapshotVersion) > 0\n    );\n  }\n\n  private executeFullCollectionScan(\n    transaction: PersistenceTransaction,\n    query: Query,\n    context: QueryContext\n  ): PersistencePromise<DocumentMap> {\n    if (getLogLevel() <= LogLevel.DEBUG) {\n      logDebug(\n        'QueryEngine',\n        'Using full collection scan to execute query:',\n        stringifyQuery(query)\n      );\n    }\n\n    return this.localDocumentsView!.getDocumentsMatchingQuery(\n      transaction,\n      query,\n      IndexOffset.min(),\n      context\n    );\n  }\n\n  /**\n   * Combines the results from an indexed execution with the remaining documents\n   * that have not yet been indexed.\n   */\n  private appendRemainingResults(\n    transaction: PersistenceTransaction,\n    indexedResults: Iterable<Document>,\n    query: Query,\n    offset: IndexOffset\n  ): PersistencePromise<DocumentMap> {\n    // Retrieve all results for documents that were updated since the offset.\n    return this.localDocumentsView\n      .getDocumentsMatchingQuery(transaction, query, offset)\n      .next(remainingResults => {\n        // Merge with existing results\n        indexedResults.forEach(d => {\n          remainingResults = remainingResults.insert(d.key, d);\n        });\n        return remainingResults;\n      });\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { User } from '../auth/user';\nimport { BundleConverter, BundledDocuments, NamedQuery } from '../core/bundle';\nimport {\n  newQueryForPath,\n  Query,\n  queryCollectionGroup,\n  queryToTarget\n} from '../core/query';\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport { canonifyTarget, Target, targetEquals } from '../core/target';\nimport { BatchId, TargetId } from '../core/types';\nimport { Timestamp } from '../lite-api/timestamp';\nimport {\n  convertOverlayedDocumentMapToDocumentMap,\n  documentKeySet,\n  DocumentKeySet,\n  DocumentMap,\n  mutableDocumentMap,\n  MutableDocumentMap,\n  OverlayedDocumentMap\n} from '../model/collections';\nimport { Document } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport {\n  FieldIndex,\n  fieldIndexSemanticComparator,\n  INITIAL_LARGEST_BATCH_ID,\n  newIndexOffsetSuccessorFromReadTime\n} from '../model/field_index';\nimport {\n  mutationExtractBaseValue,\n  Mutation,\n  PatchMutation,\n  Precondition\n} from '../model/mutation';\nimport { MutationBatch, MutationBatchResult } from '../model/mutation_batch';\nimport { extractFieldMask } from '../model/object_value';\nimport { ResourcePath } from '../model/path';\nimport {\n  BundleMetadata,\n  NamedQuery as ProtoNamedQuery\n} from '../protos/firestore_bundle_proto';\nimport { RemoteEvent, TargetChange } from '../remote/remote_event';\nimport { fromVersion, JsonProtoSerializer } from '../remote/serializer';\nimport { diffArrays } from '../util/array';\nimport { debugAssert, debugCast, hardAssert } from '../util/assert';\nimport { ByteString } from '../util/byte_string';\nimport { logDebug } from '../util/log';\nimport { primitiveComparator } from '../util/misc';\nimport { ObjectMap } from '../util/obj_map';\nimport { SortedMap } from '../util/sorted_map';\nimport { BATCHID_UNKNOWN } from '../util/types';\n\nimport { BundleCache } from './bundle_cache';\nimport { DocumentOverlayCache } from './document_overlay_cache';\nimport { IndexManager } from './index_manager';\nimport { IndexedDbMutationQueue } from './indexeddb_mutation_queue';\nimport { IndexedDbPersistence } from './indexeddb_persistence';\nimport { IndexedDbTargetCache } from './indexeddb_target_cache';\nimport { LocalDocumentsView } from './local_documents_view';\nimport { fromBundledQuery } from './local_serializer';\nimport { LocalStore } from './local_store';\nimport { LocalViewChanges } from './local_view_changes';\nimport { LruGarbageCollector, LruResults } from './lru_garbage_collector';\nimport { MutationQueue } from './mutation_queue';\nimport { Persistence } from './persistence';\nimport { PersistencePromise } from './persistence_promise';\nimport { PersistenceTransaction } from './persistence_transaction';\nimport { QueryEngine } from './query_engine';\nimport { RemoteDocumentCache } from './remote_document_cache';\nimport { RemoteDocumentChangeBuffer } from './remote_document_change_buffer';\nimport { ClientId } from './shared_client_state';\nimport { isIndexedDbTransactionError } from './simple_db';\nimport { TargetCache } from './target_cache';\nimport { TargetData, TargetPurpose } from './target_data';\n\nexport const LOG_TAG = 'LocalStore';\n\n/**\n * The maximum time to leave a resume token buffered without writing it out.\n * This value is arbitrary: it's long enough to avoid several writes\n * (possibly indefinitely if updates come more frequently than this) but\n * short enough that restarting after crashing will still have a pretty\n * recent resume token.\n */\nconst RESUME_TOKEN_MAX_AGE_MICROS = 5 * 60 * 1e6;\n\n/** The result of a write to the local store. */\nexport interface LocalWriteResult {\n  batchId: BatchId;\n  changes: DocumentMap;\n}\n\n/** The result of a user-change operation in the local store. */\nexport interface UserChangeResult {\n  readonly affectedDocuments: DocumentMap;\n  readonly removedBatchIds: BatchId[];\n  readonly addedBatchIds: BatchId[];\n}\n\n/** The result of executing a query against the local store. */\nexport interface QueryResult {\n  readonly documents: DocumentMap;\n  readonly remoteKeys: DocumentKeySet;\n}\n\n/**\n * Implements `LocalStore` interface.\n *\n * Note: some field defined in this class might have public access level, but\n * the class is not exported so they are only accessible from this module.\n * This is useful to implement optional features (like bundles) in free\n * functions, such that they are tree-shakeable.\n */\nclass LocalStoreImpl implements LocalStore {\n  /**\n   * The set of all mutations that have been sent but not yet been applied to\n   * the backend.\n   */\n  mutationQueue!: MutationQueue;\n\n  /**\n   * The overlays that can be used to short circuit applying all mutations from\n   * mutation queue.\n   */\n  documentOverlayCache!: DocumentOverlayCache;\n\n  /** The set of all cached remote documents. */\n  remoteDocuments: RemoteDocumentCache;\n\n  /**\n   * The \"local\" view of all documents (layering mutationQueue on top of\n   * remoteDocumentCache).\n   */\n  localDocuments!: LocalDocumentsView;\n\n  /** Manages the list of active field and collection indices. */\n  indexManager!: IndexManager;\n\n  /** The set of all cached bundle metadata and named queries. */\n  bundleCache: BundleCache;\n\n  /** Maps a target to its `TargetData`. */\n  targetCache: TargetCache;\n\n  /**\n   * Maps a targetID to data about its target.\n   *\n   * PORTING NOTE: We are using an immutable data structure on Web to make re-runs\n   * of `applyRemoteEvent()` idempotent.\n   */\n  targetDataByTarget = new SortedMap<TargetId, TargetData>(primitiveComparator);\n\n  /** Maps a target to its targetID. */\n  // TODO(wuandy): Evaluate if TargetId can be part of Target.\n  targetIdByTarget = new ObjectMap<Target, TargetId>(\n    t => canonifyTarget(t),\n    targetEquals\n  );\n\n  /**\n   * A per collection group index of the last read time processed by\n   * `getNewDocumentChanges()`.\n   *\n   * PORTING NOTE: This is only used for multi-tab synchronization.\n   */\n  collectionGroupReadTime = new Map<string, SnapshotVersion>();\n\n  constructor(\n    /** Manages our in-memory or durable persistence. */\n    readonly persistence: Persistence,\n    readonly queryEngine: QueryEngine,\n    initialUser: User,\n    readonly serializer: JsonProtoSerializer\n  ) {\n    debugAssert(\n      persistence.started,\n      'LocalStore was passed an unstarted persistence implementation'\n    );\n    this.remoteDocuments = persistence.getRemoteDocumentCache();\n    this.targetCache = persistence.getTargetCache();\n    this.bundleCache = persistence.getBundleCache();\n\n    this.initializeUserComponents(initialUser);\n  }\n\n  initializeUserComponents(user: User): void {\n    // TODO(indexing): Add spec tests that test these components change after a\n    // user change\n    this.documentOverlayCache = this.persistence.getDocumentOverlayCache(user);\n    this.indexManager = this.persistence.getIndexManager(user);\n    this.mutationQueue = this.persistence.getMutationQueue(\n      user,\n      this.indexManager\n    );\n    this.localDocuments = new LocalDocumentsView(\n      this.remoteDocuments,\n      this.mutationQueue,\n      this.documentOverlayCache,\n      this.indexManager\n    );\n    this.remoteDocuments.setIndexManager(this.indexManager);\n    this.queryEngine.initialize(this.localDocuments, this.indexManager);\n  }\n\n  collectGarbage(garbageCollector: LruGarbageCollector): Promise<LruResults> {\n    return this.persistence.runTransaction(\n      'Collect garbage',\n      'readwrite-primary',\n      txn => garbageCollector.collect(txn, this.targetDataByTarget)\n    );\n  }\n}\n\ninterface DocumentChangeResult {\n  changedDocuments: MutableDocumentMap;\n  existenceChangedKeys: DocumentKeySet;\n}\n\nexport function newLocalStore(\n  /** Manages our in-memory or durable persistence. */\n  persistence: Persistence,\n  queryEngine: QueryEngine,\n  initialUser: User,\n  serializer: JsonProtoSerializer\n): LocalStore {\n  return new LocalStoreImpl(persistence, queryEngine, initialUser, serializer);\n}\n\n/**\n * Tells the LocalStore that the currently authenticated user has changed.\n *\n * In response the local store switches the mutation queue to the new user and\n * returns any resulting document changes.\n */\n// PORTING NOTE: Android and iOS only return the documents affected by the\n// change.\nexport async function localStoreHandleUserChange(\n  localStore: LocalStore,\n  user: User\n): Promise<UserChangeResult> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n\n  const result = await localStoreImpl.persistence.runTransaction(\n    'Handle user change',\n    'readonly',\n    txn => {\n      // Swap out the mutation queue, grabbing the pending mutation batches\n      // before and after.\n      let oldBatches: MutationBatch[];\n      return localStoreImpl.mutationQueue\n        .getAllMutationBatches(txn)\n        .next(promisedOldBatches => {\n          oldBatches = promisedOldBatches;\n          localStoreImpl.initializeUserComponents(user);\n          return localStoreImpl.mutationQueue.getAllMutationBatches(txn);\n        })\n        .next(newBatches => {\n          const removedBatchIds: BatchId[] = [];\n          const addedBatchIds: BatchId[] = [];\n\n          // Union the old/new changed keys.\n          let changedKeys = documentKeySet();\n\n          for (const batch of oldBatches) {\n            removedBatchIds.push(batch.batchId);\n            for (const mutation of batch.mutations) {\n              changedKeys = changedKeys.add(mutation.key);\n            }\n          }\n\n          for (const batch of newBatches) {\n            addedBatchIds.push(batch.batchId);\n            for (const mutation of batch.mutations) {\n              changedKeys = changedKeys.add(mutation.key);\n            }\n          }\n\n          // Return the set of all (potentially) changed documents and the list\n          // of mutation batch IDs that were affected by change.\n          return localStoreImpl.localDocuments\n            .getDocuments(txn, changedKeys)\n            .next(affectedDocuments => {\n              return {\n                affectedDocuments,\n                removedBatchIds,\n                addedBatchIds\n              };\n            });\n        });\n    }\n  );\n\n  return result;\n}\n\n/* Accepts locally generated Mutations and commit them to storage. */\nexport function localStoreWriteLocally(\n  localStore: LocalStore,\n  mutations: Mutation[]\n): Promise<LocalWriteResult> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  const localWriteTime = Timestamp.now();\n  const keys = mutations.reduce((keys, m) => keys.add(m.key), documentKeySet());\n\n  let overlayedDocuments: OverlayedDocumentMap;\n  let mutationBatch: MutationBatch;\n\n  return localStoreImpl.persistence\n    .runTransaction('Locally write mutations', 'readwrite', txn => {\n      // Figure out which keys do not have a remote version in the cache, this\n      // is needed to create the right overlay mutation: if no remote version\n      // presents, we do not need to create overlays as patch mutations.\n      // TODO(Overlay): Is there a better way to determine this? Using the\n      //  document version does not work because local mutations set them back\n      //  to 0.\n      let remoteDocs = mutableDocumentMap();\n      let docsWithoutRemoteVersion = documentKeySet();\n      return localStoreImpl.remoteDocuments\n        .getEntries(txn, keys)\n        .next(docs => {\n          remoteDocs = docs;\n          remoteDocs.forEach((key, doc) => {\n            if (!doc.isValidDocument()) {\n              docsWithoutRemoteVersion = docsWithoutRemoteVersion.add(key);\n            }\n          });\n        })\n        .next(() => {\n          // Load and apply all existing mutations. This lets us compute the\n          // current base state for all non-idempotent transforms before applying\n          // any additional user-provided writes.\n          return localStoreImpl.localDocuments.getOverlayedDocuments(\n            txn,\n            remoteDocs\n          );\n        })\n        .next((docs: OverlayedDocumentMap) => {\n          overlayedDocuments = docs;\n\n          // For non-idempotent mutations (such as `FieldValue.increment()`),\n          // we record the base state in a separate patch mutation. This is\n          // later used to guarantee consistent values and prevents flicker\n          // even if the backend sends us an update that already includes our\n          // transform.\n          const baseMutations: Mutation[] = [];\n\n          for (const mutation of mutations) {\n            const baseValue = mutationExtractBaseValue(\n              mutation,\n              overlayedDocuments.get(mutation.key)!.overlayedDocument\n            );\n            if (baseValue != null) {\n              // NOTE: The base state should only be applied if there's some\n              // existing document to override, so use a Precondition of\n              // exists=true\n              baseMutations.push(\n                new PatchMutation(\n                  mutation.key,\n                  baseValue,\n                  extractFieldMask(baseValue.value.mapValue),\n                  Precondition.exists(true)\n                )\n              );\n            }\n          }\n\n          return localStoreImpl.mutationQueue.addMutationBatch(\n            txn,\n            localWriteTime,\n            baseMutations,\n            mutations\n          );\n        })\n        .next(batch => {\n          mutationBatch = batch;\n          const overlays = batch.applyToLocalDocumentSet(\n            overlayedDocuments,\n            docsWithoutRemoteVersion\n          );\n          return localStoreImpl.documentOverlayCache.saveOverlays(\n            txn,\n            batch.batchId,\n            overlays\n          );\n        });\n    })\n    .then(() => ({\n      batchId: mutationBatch.batchId,\n      changes: convertOverlayedDocumentMapToDocumentMap(overlayedDocuments)\n    }));\n}\n\n/**\n * Acknowledges the given batch.\n *\n * On the happy path when a batch is acknowledged, the local store will\n *\n *  + remove the batch from the mutation queue;\n *  + apply the changes to the remote document cache;\n *  + recalculate the latency compensated view implied by those changes (there\n *    may be mutations in the queue that affect the documents but haven't been\n *    acknowledged yet); and\n *  + give the changed documents back the sync engine\n *\n * @returns The resulting (modified) documents.\n */\nexport function localStoreAcknowledgeBatch(\n  localStore: LocalStore,\n  batchResult: MutationBatchResult\n): Promise<DocumentMap> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  return localStoreImpl.persistence.runTransaction(\n    'Acknowledge batch',\n    'readwrite-primary',\n    txn => {\n      const affected = batchResult.batch.keys();\n      const documentBuffer = localStoreImpl.remoteDocuments.newChangeBuffer({\n        trackRemovals: true // Make sure document removals show up in `getNewDocumentChanges()`\n      });\n      return applyWriteToRemoteDocuments(\n        localStoreImpl,\n        txn,\n        batchResult,\n        documentBuffer\n      )\n        .next(() => documentBuffer.apply(txn))\n        .next(() => localStoreImpl.mutationQueue.performConsistencyCheck(txn))\n        .next(() =>\n          localStoreImpl.documentOverlayCache.removeOverlaysForBatchId(\n            txn,\n            affected,\n            batchResult.batch.batchId\n          )\n        )\n        .next(() =>\n          localStoreImpl.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(\n            txn,\n            getKeysWithTransformResults(batchResult)\n          )\n        )\n        .next(() => localStoreImpl.localDocuments.getDocuments(txn, affected));\n    }\n  );\n}\n\nfunction getKeysWithTransformResults(\n  batchResult: MutationBatchResult\n): DocumentKeySet {\n  let result = documentKeySet();\n\n  for (let i = 0; i < batchResult.mutationResults.length; ++i) {\n    const mutationResult = batchResult.mutationResults[i];\n    if (mutationResult.transformResults.length > 0) {\n      result = result.add(batchResult.batch.mutations[i].key);\n    }\n  }\n  return result;\n}\n\n/**\n * Removes mutations from the MutationQueue for the specified batch;\n * LocalDocuments will be recalculated.\n *\n * @returns The resulting modified documents.\n */\nexport function localStoreRejectBatch(\n  localStore: LocalStore,\n  batchId: BatchId\n): Promise<DocumentMap> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  return localStoreImpl.persistence.runTransaction(\n    'Reject batch',\n    'readwrite-primary',\n    txn => {\n      let affectedKeys: DocumentKeySet;\n      return localStoreImpl.mutationQueue\n        .lookupMutationBatch(txn, batchId)\n        .next((batch: MutationBatch | null) => {\n          hardAssert(batch !== null, 'Attempt to reject nonexistent batch!');\n          affectedKeys = batch.keys();\n          return localStoreImpl.mutationQueue.removeMutationBatch(txn, batch);\n        })\n        .next(() => localStoreImpl.mutationQueue.performConsistencyCheck(txn))\n        .next(() =>\n          localStoreImpl.documentOverlayCache.removeOverlaysForBatchId(\n            txn,\n            affectedKeys,\n            batchId\n          )\n        )\n        .next(() =>\n          localStoreImpl.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(\n            txn,\n            affectedKeys\n          )\n        )\n        .next(() =>\n          localStoreImpl.localDocuments.getDocuments(txn, affectedKeys)\n        );\n    }\n  );\n}\n\n/**\n * Returns the largest (latest) batch id in mutation queue that is pending\n * server response.\n *\n * Returns `BATCHID_UNKNOWN` if the queue is empty.\n */\nexport function localStoreGetHighestUnacknowledgedBatchId(\n  localStore: LocalStore\n): Promise<BatchId> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  return localStoreImpl.persistence.runTransaction(\n    'Get highest unacknowledged batch id',\n    'readonly',\n    txn => localStoreImpl.mutationQueue.getHighestUnacknowledgedBatchId(txn)\n  );\n}\n\n/**\n * Returns the last consistent snapshot processed (used by the RemoteStore to\n * determine whether to buffer incoming snapshots from the backend).\n */\nexport function localStoreGetLastRemoteSnapshotVersion(\n  localStore: LocalStore\n): Promise<SnapshotVersion> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  return localStoreImpl.persistence.runTransaction(\n    'Get last remote snapshot version',\n    'readonly',\n    txn => localStoreImpl.targetCache.getLastRemoteSnapshotVersion(txn)\n  );\n}\n\n/**\n * Updates the \"ground-state\" (remote) documents. We assume that the remote\n * event reflects any write batches that have been acknowledged or rejected\n * (i.e. we do not re-apply local mutations to updates from this event).\n *\n * LocalDocuments are re-calculated if there are remaining mutations in the\n * queue.\n */\nexport function localStoreApplyRemoteEventToLocalCache(\n  localStore: LocalStore,\n  remoteEvent: RemoteEvent\n): Promise<DocumentMap> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  const remoteVersion = remoteEvent.snapshotVersion;\n  let newTargetDataByTargetMap = localStoreImpl.targetDataByTarget;\n\n  return localStoreImpl.persistence\n    .runTransaction('Apply remote event', 'readwrite-primary', txn => {\n      const documentBuffer = localStoreImpl.remoteDocuments.newChangeBuffer({\n        trackRemovals: true // Make sure document removals show up in `getNewDocumentChanges()`\n      });\n\n      // Reset newTargetDataByTargetMap in case this transaction gets re-run.\n      newTargetDataByTargetMap = localStoreImpl.targetDataByTarget;\n\n      const promises = [] as Array<PersistencePromise<void>>;\n      remoteEvent.targetChanges.forEach((change, targetId) => {\n        const oldTargetData = newTargetDataByTargetMap.get(targetId);\n        if (!oldTargetData) {\n          return;\n        }\n\n        // Only update the remote keys if the target is still active. This\n        // ensures that we can persist the updated target data along with\n        // the updated assignment.\n        promises.push(\n          localStoreImpl.targetCache\n            .removeMatchingKeys(txn, change.removedDocuments, targetId)\n            .next(() => {\n              return localStoreImpl.targetCache.addMatchingKeys(\n                txn,\n                change.addedDocuments,\n                targetId\n              );\n            })\n        );\n\n        let newTargetData = oldTargetData.withSequenceNumber(\n          txn.currentSequenceNumber\n        );\n        if (remoteEvent.targetMismatches.get(targetId) !== null) {\n          newTargetData = newTargetData\n            .withResumeToken(\n              ByteString.EMPTY_BYTE_STRING,\n              SnapshotVersion.min()\n            )\n            .withLastLimboFreeSnapshotVersion(SnapshotVersion.min());\n        } else if (change.resumeToken.approximateByteSize() > 0) {\n          newTargetData = newTargetData.withResumeToken(\n            change.resumeToken,\n            remoteVersion\n          );\n        }\n\n        newTargetDataByTargetMap = newTargetDataByTargetMap.insert(\n          targetId,\n          newTargetData\n        );\n\n        // Update the target data if there are target changes (or if\n        // sufficient time has passed since the last update).\n        if (shouldPersistTargetData(oldTargetData, newTargetData, change)) {\n          promises.push(\n            localStoreImpl.targetCache.updateTargetData(txn, newTargetData)\n          );\n        }\n      });\n\n      let changedDocs = mutableDocumentMap();\n      let existenceChangedKeys = documentKeySet();\n      remoteEvent.documentUpdates.forEach(key => {\n        if (remoteEvent.resolvedLimboDocuments.has(key)) {\n          promises.push(\n            localStoreImpl.persistence.referenceDelegate.updateLimboDocument(\n              txn,\n              key\n            )\n          );\n        }\n      });\n\n      // Each loop iteration only affects its \"own\" doc, so it's safe to get all\n      // the remote documents in advance in a single call.\n      promises.push(\n        populateDocumentChangeBuffer(\n          txn,\n          documentBuffer,\n          remoteEvent.documentUpdates\n        ).next(result => {\n          changedDocs = result.changedDocuments;\n          existenceChangedKeys = result.existenceChangedKeys;\n        })\n      );\n\n      // HACK: The only reason we allow a null snapshot version is so that we\n      // can synthesize remote events when we get permission denied errors while\n      // trying to resolve the state of a locally cached document that is in\n      // limbo.\n      if (!remoteVersion.isEqual(SnapshotVersion.min())) {\n        const updateRemoteVersion = localStoreImpl.targetCache\n          .getLastRemoteSnapshotVersion(txn)\n          .next(lastRemoteSnapshotVersion => {\n            debugAssert(\n              remoteVersion.compareTo(lastRemoteSnapshotVersion) >= 0,\n              'Watch stream reverted to previous snapshot?? ' +\n                remoteVersion +\n                ' < ' +\n                lastRemoteSnapshotVersion\n            );\n            return localStoreImpl.targetCache.setTargetsMetadata(\n              txn,\n              txn.currentSequenceNumber,\n              remoteVersion\n            );\n          });\n        promises.push(updateRemoteVersion);\n      }\n\n      return PersistencePromise.waitFor(promises)\n        .next(() => documentBuffer.apply(txn))\n        .next(() =>\n          localStoreImpl.localDocuments.getLocalViewOfDocuments(\n            txn,\n            changedDocs,\n            existenceChangedKeys\n          )\n        )\n        .next(() => changedDocs);\n    })\n    .then(changedDocs => {\n      localStoreImpl.targetDataByTarget = newTargetDataByTargetMap;\n      return changedDocs;\n    });\n}\n\n/**\n * Populates document change buffer with documents from backend or a bundle.\n * Returns the document changes resulting from applying those documents, and\n * also a set of documents whose existence state are changed as a result.\n *\n * @param txn - Transaction to use to read existing documents from storage.\n * @param documentBuffer - Document buffer to collect the resulted changes to be\n *        applied to storage.\n * @param documents - Documents to be applied.\n */\nfunction populateDocumentChangeBuffer(\n  txn: PersistenceTransaction,\n  documentBuffer: RemoteDocumentChangeBuffer,\n  documents: MutableDocumentMap\n): PersistencePromise<DocumentChangeResult> {\n  let updatedKeys = documentKeySet();\n  let existenceChangedKeys = documentKeySet();\n  documents.forEach(k => (updatedKeys = updatedKeys.add(k)));\n  return documentBuffer.getEntries(txn, updatedKeys).next(existingDocs => {\n    let changedDocuments = mutableDocumentMap();\n    documents.forEach((key, doc) => {\n      const existingDoc = existingDocs.get(key)!;\n\n      // Check if see if there is a existence state change for this document.\n      if (doc.isFoundDocument() !== existingDoc.isFoundDocument()) {\n        existenceChangedKeys = existenceChangedKeys.add(key);\n      }\n\n      // Note: The order of the steps below is important, since we want\n      // to ensure that rejected limbo resolutions (which fabricate\n      // NoDocuments with SnapshotVersion.min()) never add documents to\n      // cache.\n      if (doc.isNoDocument() && doc.version.isEqual(SnapshotVersion.min())) {\n        // NoDocuments with SnapshotVersion.min() are used in manufactured\n        // events. We remove these documents from cache since we lost\n        // access.\n        documentBuffer.removeEntry(key, doc.readTime);\n        changedDocuments = changedDocuments.insert(key, doc);\n      } else if (\n        !existingDoc.isValidDocument() ||\n        doc.version.compareTo(existingDoc.version) > 0 ||\n        (doc.version.compareTo(existingDoc.version) === 0 &&\n          existingDoc.hasPendingWrites)\n      ) {\n        debugAssert(\n          !SnapshotVersion.min().isEqual(doc.readTime),\n          'Cannot add a document when the remote version is zero'\n        );\n        documentBuffer.addEntry(doc);\n        changedDocuments = changedDocuments.insert(key, doc);\n      } else {\n        logDebug(\n          LOG_TAG,\n          'Ignoring outdated watch update for ',\n          key,\n          '. Current version:',\n          existingDoc.version,\n          ' Watch version:',\n          doc.version\n        );\n      }\n    });\n    return { changedDocuments, existenceChangedKeys };\n  });\n}\n\n/**\n * Returns true if the newTargetData should be persisted during an update of\n * an active target. TargetData should always be persisted when a target is\n * being released and should not call this function.\n *\n * While the target is active, TargetData updates can be omitted when nothing\n * about the target has changed except metadata like the resume token or\n * snapshot version. Occasionally it's worth the extra write to prevent these\n * values from getting too stale after a crash, but this doesn't have to be\n * too frequent.\n */\nfunction shouldPersistTargetData(\n  oldTargetData: TargetData,\n  newTargetData: TargetData,\n  change: TargetChange\n): boolean {\n  // Always persist target data if we don't already have a resume token.\n  if (oldTargetData.resumeToken.approximateByteSize() === 0) {\n    return true;\n  }\n\n  // Don't allow resume token changes to be buffered indefinitely. This\n  // allows us to be reasonably up-to-date after a crash and avoids needing\n  // to loop over all active queries on shutdown. Especially in the browser\n  // we may not get time to do anything interesting while the current tab is\n  // closing.\n  const timeDelta =\n    newTargetData.snapshotVersion.toMicroseconds() -\n    oldTargetData.snapshotVersion.toMicroseconds();\n  if (timeDelta >= RESUME_TOKEN_MAX_AGE_MICROS) {\n    return true;\n  }\n\n  // Otherwise if the only thing that has changed about a target is its resume\n  // token it's not worth persisting. Note that the RemoteStore keeps an\n  // in-memory view of the currently active targets which includes the current\n  // resume token, so stream failure or user changes will still use an\n  // up-to-date resume token regardless of what we do here.\n  const changes =\n    change.addedDocuments.size +\n    change.modifiedDocuments.size +\n    change.removedDocuments.size;\n  return changes > 0;\n}\n\n/**\n * Notifies local store of the changed views to locally pin documents.\n */\nexport async function localStoreNotifyLocalViewChanges(\n  localStore: LocalStore,\n  viewChanges: LocalViewChanges[]\n): Promise<void> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  try {\n    await localStoreImpl.persistence.runTransaction(\n      'notifyLocalViewChanges',\n      'readwrite',\n      txn => {\n        return PersistencePromise.forEach(\n          viewChanges,\n          (viewChange: LocalViewChanges) => {\n            return PersistencePromise.forEach(\n              viewChange.addedKeys,\n              (key: DocumentKey) =>\n                localStoreImpl.persistence.referenceDelegate.addReference(\n                  txn,\n                  viewChange.targetId,\n                  key\n                )\n            ).next(() =>\n              PersistencePromise.forEach(\n                viewChange.removedKeys,\n                (key: DocumentKey) =>\n                  localStoreImpl.persistence.referenceDelegate.removeReference(\n                    txn,\n                    viewChange.targetId,\n                    key\n                  )\n              )\n            );\n          }\n        );\n      }\n    );\n  } catch (e) {\n    if (isIndexedDbTransactionError(e as Error)) {\n      // If `notifyLocalViewChanges` fails, we did not advance the sequence\n      // number for the documents that were included in this transaction.\n      // This might trigger them to be deleted earlier than they otherwise\n      // would have, but it should not invalidate the integrity of the data.\n      logDebug(LOG_TAG, 'Failed to update sequence numbers: ' + e);\n    } else {\n      throw e;\n    }\n  }\n\n  for (const viewChange of viewChanges) {\n    const targetId = viewChange.targetId;\n\n    if (!viewChange.fromCache) {\n      const targetData = localStoreImpl.targetDataByTarget.get(targetId);\n      debugAssert(\n        targetData !== null,\n        `Can't set limbo-free snapshot version for unknown target: ${targetId}`\n      );\n\n      // Advance the last limbo free snapshot version\n      const lastLimboFreeSnapshotVersion = targetData.snapshotVersion;\n      const updatedTargetData = targetData.withLastLimboFreeSnapshotVersion(\n        lastLimboFreeSnapshotVersion\n      );\n      localStoreImpl.targetDataByTarget =\n        localStoreImpl.targetDataByTarget.insert(targetId, updatedTargetData);\n\n      // TODO(b/272564316): Apply the optimization done on other platforms.\n      // This is a problem for web because saving the updated targetData from\n      // non-primary client conflicts with what primary client saved.\n    }\n  }\n}\n\n/**\n * Gets the mutation batch after the passed in batchId in the mutation queue\n * or null if empty.\n * @param afterBatchId - If provided, the batch to search after.\n * @returns The next mutation or null if there wasn't one.\n */\nexport function localStoreGetNextMutationBatch(\n  localStore: LocalStore,\n  afterBatchId?: BatchId\n): Promise<MutationBatch | null> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  return localStoreImpl.persistence.runTransaction(\n    'Get next mutation batch',\n    'readonly',\n    txn => {\n      if (afterBatchId === undefined) {\n        afterBatchId = BATCHID_UNKNOWN;\n      }\n      return localStoreImpl.mutationQueue.getNextMutationBatchAfterBatchId(\n        txn,\n        afterBatchId\n      );\n    }\n  );\n}\n\n/**\n * Reads the current value of a Document with a given key or null if not\n * found - used for testing.\n */\nexport function localStoreReadDocument(\n  localStore: LocalStore,\n  key: DocumentKey\n): Promise<Document> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  return localStoreImpl.persistence.runTransaction(\n    'read document',\n    'readonly',\n    txn => localStoreImpl.localDocuments.getDocument(txn, key)\n  );\n}\n\n/**\n * Assigns the given target an internal ID so that its results can be pinned so\n * they don't get GC'd. A target must be allocated in the local store before\n * the store can be used to manage its view.\n *\n * Allocating an already allocated `Target` will return the existing `TargetData`\n * for that `Target`.\n */\nexport function localStoreAllocateTarget(\n  localStore: LocalStore,\n  target: Target\n): Promise<TargetData> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  return localStoreImpl.persistence\n    .runTransaction('Allocate target', 'readwrite', txn => {\n      let targetData: TargetData;\n      return localStoreImpl.targetCache\n        .getTargetData(txn, target)\n        .next((cached: TargetData | null) => {\n          if (cached) {\n            // This target has been listened to previously, so reuse the\n            // previous targetID.\n            // TODO(mcg): freshen last accessed date?\n            targetData = cached;\n            return PersistencePromise.resolve(targetData);\n          } else {\n            return localStoreImpl.targetCache\n              .allocateTargetId(txn)\n              .next(targetId => {\n                targetData = new TargetData(\n                  target,\n                  targetId,\n                  TargetPurpose.Listen,\n                  txn.currentSequenceNumber\n                );\n                return localStoreImpl.targetCache\n                  .addTargetData(txn, targetData)\n                  .next(() => targetData);\n              });\n          }\n        });\n    })\n    .then(targetData => {\n      // If Multi-Tab is enabled, the existing target data may be newer than\n      // the in-memory data\n      const cachedTargetData = localStoreImpl.targetDataByTarget.get(\n        targetData.targetId\n      );\n      if (\n        cachedTargetData === null ||\n        targetData.snapshotVersion.compareTo(cachedTargetData.snapshotVersion) >\n          0\n      ) {\n        localStoreImpl.targetDataByTarget =\n          localStoreImpl.targetDataByTarget.insert(\n            targetData.targetId,\n            targetData\n          );\n        localStoreImpl.targetIdByTarget.set(target, targetData.targetId);\n      }\n      return targetData;\n    });\n}\n\n/**\n * Returns the TargetData as seen by the LocalStore, including updates that may\n * have not yet been persisted to the TargetCache.\n */\n// Visible for testing.\nexport function localStoreGetTargetData(\n  localStore: LocalStore,\n  transaction: PersistenceTransaction,\n  target: Target\n): PersistencePromise<TargetData | null> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  const targetId = localStoreImpl.targetIdByTarget.get(target);\n  if (targetId !== undefined) {\n    return PersistencePromise.resolve<TargetData | null>(\n      localStoreImpl.targetDataByTarget.get(targetId)\n    );\n  } else {\n    return localStoreImpl.targetCache.getTargetData(transaction, target);\n  }\n}\n\n/**\n * Unpins all the documents associated with the given target. If\n * `keepPersistedTargetData` is set to false and Eager GC enabled, the method\n * directly removes the associated target data from the target cache.\n *\n * Releasing a non-existing `Target` is a no-op.\n */\n// PORTING NOTE: `keepPersistedTargetData` is multi-tab only.\nexport async function localStoreReleaseTarget(\n  localStore: LocalStore,\n  targetId: number,\n  keepPersistedTargetData: boolean\n): Promise<void> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  const targetData = localStoreImpl.targetDataByTarget.get(targetId);\n  debugAssert(\n    targetData !== null,\n    `Tried to release nonexistent target: ${targetId}`\n  );\n\n  const mode = keepPersistedTargetData ? 'readwrite' : 'readwrite-primary';\n\n  try {\n    if (!keepPersistedTargetData) {\n      await localStoreImpl.persistence.runTransaction(\n        'Release target',\n        mode,\n        txn => {\n          return localStoreImpl.persistence.referenceDelegate.removeTarget(\n            txn,\n            targetData!\n          );\n        }\n      );\n    }\n  } catch (e) {\n    if (isIndexedDbTransactionError(e as Error)) {\n      // All `releaseTarget` does is record the final metadata state for the\n      // target, but we've been recording this periodically during target\n      // activity. If we lose this write this could cause a very slight\n      // difference in the order of target deletion during GC, but we\n      // don't define exact LRU semantics so this is acceptable.\n      logDebug(\n        LOG_TAG,\n        `Failed to update sequence numbers for target ${targetId}: ${e}`\n      );\n    } else {\n      throw e;\n    }\n  }\n\n  localStoreImpl.targetDataByTarget =\n    localStoreImpl.targetDataByTarget.remove(targetId);\n  localStoreImpl.targetIdByTarget.delete(targetData!.target);\n}\n\n/**\n * Runs the specified query against the local store and returns the results,\n * potentially taking advantage of query data from previous executions (such\n * as the set of remote keys).\n *\n * @param usePreviousResults - Whether results from previous executions can\n * be used to optimize this query execution.\n */\nexport function localStoreExecuteQuery(\n  localStore: LocalStore,\n  query: Query,\n  usePreviousResults: boolean\n): Promise<QueryResult> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  let lastLimboFreeSnapshotVersion = SnapshotVersion.min();\n  let remoteKeys = documentKeySet();\n\n  return localStoreImpl.persistence.runTransaction(\n    'Execute query',\n    'readwrite', // Use readwrite instead of readonly so indexes can be created\n    txn => {\n      return localStoreGetTargetData(localStoreImpl, txn, queryToTarget(query))\n        .next(targetData => {\n          if (targetData) {\n            lastLimboFreeSnapshotVersion =\n              targetData.lastLimboFreeSnapshotVersion;\n            return localStoreImpl.targetCache\n              .getMatchingKeysForTargetId(txn, targetData.targetId)\n              .next(result => {\n                remoteKeys = result;\n              });\n          }\n        })\n        .next(() =>\n          localStoreImpl.queryEngine.getDocumentsMatchingQuery(\n            txn,\n            query,\n            usePreviousResults\n              ? lastLimboFreeSnapshotVersion\n              : SnapshotVersion.min(),\n            usePreviousResults ? remoteKeys : documentKeySet()\n          )\n        )\n        .next(documents => {\n          setMaxReadTime(\n            localStoreImpl,\n            queryCollectionGroup(query),\n            documents\n          );\n          return { documents, remoteKeys };\n        });\n    }\n  );\n}\n\nfunction applyWriteToRemoteDocuments(\n  localStoreImpl: LocalStoreImpl,\n  txn: PersistenceTransaction,\n  batchResult: MutationBatchResult,\n  documentBuffer: RemoteDocumentChangeBuffer\n): PersistencePromise<void> {\n  const batch = batchResult.batch;\n  const docKeys = batch.keys();\n  let promiseChain = PersistencePromise.resolve();\n  docKeys.forEach(docKey => {\n    promiseChain = promiseChain\n      .next(() => documentBuffer.getEntry(txn, docKey))\n      .next(doc => {\n        const ackVersion = batchResult.docVersions.get(docKey);\n        hardAssert(\n          ackVersion !== null,\n          'ackVersions should contain every doc in the write.'\n        );\n        if (doc.version.compareTo(ackVersion!) < 0) {\n          batch.applyToRemoteDocument(doc, batchResult);\n          if (doc.isValidDocument()) {\n            // We use the commitVersion as the readTime rather than the\n            // document's updateTime since the updateTime is not advanced\n            // for updates that do not modify the underlying document.\n            doc.setReadTime(batchResult.commitVersion);\n            documentBuffer.addEntry(doc);\n          }\n        }\n      });\n  });\n  return promiseChain.next(() =>\n    localStoreImpl.mutationQueue.removeMutationBatch(txn, batch)\n  );\n}\n\n/** Returns the local view of the documents affected by a mutation batch. */\n// PORTING NOTE: Multi-Tab only.\nexport function localStoreLookupMutationDocuments(\n  localStore: LocalStore,\n  batchId: BatchId\n): Promise<DocumentMap | null> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  const mutationQueueImpl = debugCast(\n    localStoreImpl.mutationQueue,\n    IndexedDbMutationQueue // We only support IndexedDb in multi-tab mode.\n  );\n  return localStoreImpl.persistence.runTransaction(\n    'Lookup mutation documents',\n    'readonly',\n    txn => {\n      return mutationQueueImpl.lookupMutationKeys(txn, batchId).next(keys => {\n        if (keys) {\n          return localStoreImpl.localDocuments.getDocuments(\n            txn,\n            keys\n          ) as PersistencePromise<DocumentMap | null>;\n        } else {\n          return PersistencePromise.resolve<DocumentMap | null>(null);\n        }\n      });\n    }\n  );\n}\n\n// PORTING NOTE: Multi-Tab only.\nexport function localStoreRemoveCachedMutationBatchMetadata(\n  localStore: LocalStore,\n  batchId: BatchId\n): void {\n  const mutationQueueImpl = debugCast(\n    debugCast(localStore, LocalStoreImpl).mutationQueue,\n    IndexedDbMutationQueue // We only support IndexedDb in multi-tab mode.\n  );\n  mutationQueueImpl.removeCachedMutationKeys(batchId);\n}\n\n// PORTING NOTE: Multi-Tab only.\nexport function localStoreGetActiveClients(\n  localStore: LocalStore\n): Promise<ClientId[]> {\n  const persistenceImpl = debugCast(\n    debugCast(localStore, LocalStoreImpl).persistence,\n    IndexedDbPersistence // We only support IndexedDb in multi-tab mode.\n  );\n  return persistenceImpl.getActiveClients();\n}\n\n// PORTING NOTE: Multi-Tab only.\nexport function localStoreGetCachedTarget(\n  localStore: LocalStore,\n  targetId: TargetId\n): Promise<Target | null> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  const targetCacheImpl = debugCast(\n    localStoreImpl.targetCache,\n    IndexedDbTargetCache // We only support IndexedDb in multi-tab mode.\n  );\n  const cachedTargetData = localStoreImpl.targetDataByTarget.get(targetId);\n  if (cachedTargetData) {\n    return Promise.resolve(cachedTargetData.target);\n  } else {\n    return localStoreImpl.persistence.runTransaction(\n      'Get target data',\n      'readonly',\n      txn => {\n        return targetCacheImpl\n          .getTargetDataForTarget(txn, targetId)\n          .next(targetData => (targetData ? targetData.target : null));\n      }\n    );\n  }\n}\n\n/**\n * Returns the set of documents that have been updated since the last call.\n * If this is the first call, returns the set of changes since client\n * initialization. Further invocations will return document that have changed\n * since the prior call.\n */\n// PORTING NOTE: Multi-Tab only.\nexport function localStoreGetNewDocumentChanges(\n  localStore: LocalStore,\n  collectionGroup: string\n): Promise<DocumentMap> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n\n  // Get the current maximum read time for the collection. This should always\n  // exist, but to reduce the chance for regressions we default to\n  // SnapshotVersion.Min()\n  // TODO(indexing): Consider removing the default value.\n  const readTime =\n    localStoreImpl.collectionGroupReadTime.get(collectionGroup) ||\n    SnapshotVersion.min();\n\n  return localStoreImpl.persistence\n    .runTransaction('Get new document changes', 'readonly', txn =>\n      localStoreImpl.remoteDocuments.getAllFromCollectionGroup(\n        txn,\n        collectionGroup,\n        newIndexOffsetSuccessorFromReadTime(readTime, INITIAL_LARGEST_BATCH_ID),\n        /* limit= */ Number.MAX_SAFE_INTEGER\n      )\n    )\n    .then(changedDocs => {\n      setMaxReadTime(localStoreImpl, collectionGroup, changedDocs);\n      return changedDocs;\n    });\n}\n\n/** Sets the collection group's maximum read time from the given documents. */\n// PORTING NOTE: Multi-Tab only.\nfunction setMaxReadTime(\n  localStoreImpl: LocalStoreImpl,\n  collectionGroup: string,\n  changedDocs: SortedMap<DocumentKey, Document>\n): void {\n  let readTime =\n    localStoreImpl.collectionGroupReadTime.get(collectionGroup) ||\n    SnapshotVersion.min();\n  changedDocs.forEach((_, doc) => {\n    if (doc.readTime.compareTo(readTime) > 0) {\n      readTime = doc.readTime;\n    }\n  });\n  localStoreImpl.collectionGroupReadTime.set(collectionGroup, readTime);\n}\n\n/**\n * Creates a new target using the given bundle name, which will be used to\n * hold the keys of all documents from the bundle in query-document mappings.\n * This ensures that the loaded documents do not get garbage collected\n * right away.\n */\nfunction umbrellaTarget(bundleName: string): Target {\n  // It is OK that the path used for the query is not valid, because this will\n  // not be read and queried.\n  return queryToTarget(\n    newQueryForPath(ResourcePath.fromString(`__bundle__/docs/${bundleName}`))\n  );\n}\n\n/**\n * Applies the documents from a bundle to the \"ground-state\" (remote)\n * documents.\n *\n * LocalDocuments are re-calculated if there are remaining mutations in the\n * queue.\n */\nexport async function localStoreApplyBundledDocuments(\n  localStore: LocalStore,\n  bundleConverter: BundleConverter,\n  documents: BundledDocuments,\n  bundleName: string\n): Promise<DocumentMap> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  let documentKeys = documentKeySet();\n  let documentMap = mutableDocumentMap();\n  for (const bundleDoc of documents) {\n    const documentKey = bundleConverter.toDocumentKey(bundleDoc.metadata.name!);\n    if (bundleDoc.document) {\n      documentKeys = documentKeys.add(documentKey);\n    }\n    const doc = bundleConverter.toMutableDocument(bundleDoc);\n    doc.setReadTime(\n      bundleConverter.toSnapshotVersion(bundleDoc.metadata.readTime!)\n    );\n    documentMap = documentMap.insert(documentKey, doc);\n  }\n\n  const documentBuffer = localStoreImpl.remoteDocuments.newChangeBuffer({\n    trackRemovals: true // Make sure document removals show up in `getNewDocumentChanges()`\n  });\n\n  // Allocates a target to hold all document keys from the bundle, such that\n  // they will not get garbage collected right away.\n  const umbrellaTargetData = await localStoreAllocateTarget(\n    localStoreImpl,\n    umbrellaTarget(bundleName)\n  );\n  return localStoreImpl.persistence.runTransaction(\n    'Apply bundle documents',\n    'readwrite',\n    txn => {\n      return populateDocumentChangeBuffer(txn, documentBuffer, documentMap)\n        .next(documentChangeResult => {\n          documentBuffer.apply(txn);\n          return documentChangeResult;\n        })\n        .next(documentChangeResult => {\n          return localStoreImpl.targetCache\n            .removeMatchingKeysForTargetId(txn, umbrellaTargetData.targetId)\n            .next(() =>\n              localStoreImpl.targetCache.addMatchingKeys(\n                txn,\n                documentKeys,\n                umbrellaTargetData.targetId\n              )\n            )\n            .next(() =>\n              localStoreImpl.localDocuments.getLocalViewOfDocuments(\n                txn,\n                documentChangeResult.changedDocuments,\n                documentChangeResult.existenceChangedKeys\n              )\n            )\n            .next(() => documentChangeResult.changedDocuments);\n        });\n    }\n  );\n}\n\n/**\n * Returns a promise of a boolean to indicate if the given bundle has already\n * been loaded and the create time is newer than the current loading bundle.\n */\nexport function localStoreHasNewerBundle(\n  localStore: LocalStore,\n  bundleMetadata: BundleMetadata\n): Promise<boolean> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  const currentReadTime = fromVersion(bundleMetadata.createTime!);\n  return localStoreImpl.persistence\n    .runTransaction('hasNewerBundle', 'readonly', transaction => {\n      return localStoreImpl.bundleCache.getBundleMetadata(\n        transaction,\n        bundleMetadata.id!\n      );\n    })\n    .then(cached => {\n      return !!cached && cached.createTime!.compareTo(currentReadTime) >= 0;\n    });\n}\n\n/**\n * Saves the given `BundleMetadata` to local persistence.\n */\nexport function localStoreSaveBundle(\n  localStore: LocalStore,\n  bundleMetadata: BundleMetadata\n): Promise<void> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  return localStoreImpl.persistence.runTransaction(\n    'Save bundle',\n    'readwrite',\n    transaction => {\n      return localStoreImpl.bundleCache.saveBundleMetadata(\n        transaction,\n        bundleMetadata\n      );\n    }\n  );\n}\n\n/**\n * Returns a promise of a `NamedQuery` associated with given query name. Promise\n * resolves to undefined if no persisted data can be found.\n */\nexport function localStoreGetNamedQuery(\n  localStore: LocalStore,\n  queryName: string\n): Promise<NamedQuery | undefined> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  return localStoreImpl.persistence.runTransaction(\n    'Get named query',\n    'readonly',\n    transaction =>\n      localStoreImpl.bundleCache.getNamedQuery(transaction, queryName)\n  );\n}\n\n/**\n * Saves the given `NamedQuery` to local persistence.\n */\nexport async function localStoreSaveNamedQuery(\n  localStore: LocalStore,\n  query: ProtoNamedQuery,\n  documents: DocumentKeySet = documentKeySet()\n): Promise<void> {\n  // Allocate a target for the named query such that it can be resumed\n  // from associated read time if users use it to listen.\n  // NOTE: this also means if no corresponding target exists, the new target\n  // will remain active and will not get collected, unless users happen to\n  // unlisten the query somehow.\n  const allocated = await localStoreAllocateTarget(\n    localStore,\n    queryToTarget(fromBundledQuery(query.bundledQuery!))\n  );\n\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  return localStoreImpl.persistence.runTransaction(\n    'Save named query',\n    'readwrite',\n    transaction => {\n      const readTime = fromVersion(query.readTime!);\n      // Simply save the query itself if it is older than what the SDK already\n      // has.\n      if (allocated.snapshotVersion.compareTo(readTime) >= 0) {\n        return localStoreImpl.bundleCache.saveNamedQuery(transaction, query);\n      }\n\n      // Update existing target data because the query from the bundle is newer.\n      const newTargetData = allocated.withResumeToken(\n        ByteString.EMPTY_BYTE_STRING,\n        readTime\n      );\n      localStoreImpl.targetDataByTarget =\n        localStoreImpl.targetDataByTarget.insert(\n          newTargetData.targetId,\n          newTargetData\n        );\n      return localStoreImpl.targetCache\n        .updateTargetData(transaction, newTargetData)\n        .next(() =>\n          localStoreImpl.targetCache.removeMatchingKeysForTargetId(\n            transaction,\n            allocated.targetId\n          )\n        )\n        .next(() =>\n          localStoreImpl.targetCache.addMatchingKeys(\n            transaction,\n            documents,\n            allocated.targetId\n          )\n        )\n        .next(() =>\n          localStoreImpl.bundleCache.saveNamedQuery(transaction, query)\n        );\n    }\n  );\n}\n\nexport async function localStoreConfigureFieldIndexes(\n  localStore: LocalStore,\n  newFieldIndexes: FieldIndex[]\n): Promise<void> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  const indexManager = localStoreImpl.indexManager;\n  const promises: Array<PersistencePromise<void>> = [];\n  return localStoreImpl.persistence.runTransaction(\n    'Configure indexes',\n    'readwrite',\n    transaction =>\n      indexManager\n        .getFieldIndexes(transaction)\n        .next(oldFieldIndexes =>\n          diffArrays(\n            oldFieldIndexes,\n            newFieldIndexes,\n            fieldIndexSemanticComparator,\n            fieldIndex => {\n              promises.push(\n                indexManager.addFieldIndex(transaction, fieldIndex)\n              );\n            },\n            fieldIndex => {\n              promises.push(\n                indexManager.deleteFieldIndex(transaction, fieldIndex)\n              );\n            }\n          )\n        )\n        .next(() => PersistencePromise.waitFor(promises))\n  );\n}\n\nexport function localStoreSetIndexAutoCreationEnabled(\n  localStore: LocalStore,\n  isEnabled: boolean\n): void {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  localStoreImpl.queryEngine.indexAutoCreationEnabled = isEnabled;\n}\n\nexport function localStoreDeleteAllFieldIndexes(\n  localStore: LocalStore\n): Promise<void> {\n  const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n  const indexManager = localStoreImpl.indexManager;\n  return localStoreImpl.persistence.runTransaction(\n    'Delete All Indexes',\n    'readwrite',\n    transaction => indexManager.deleteAllFieldIndexes(transaction)\n  );\n}\n\n/**\n * Test-only hooks into the SDK for use exclusively by tests.\n */\nexport class TestingHooks {\n  private constructor() {\n    throw new Error('creating instances is not supported');\n  }\n\n  static setIndexAutoCreationSettings(\n    localStore: LocalStore,\n    settings: {\n      indexAutoCreationMinCollectionSize?: number;\n      relativeIndexReadCostPerDocument?: number;\n    }\n  ): void {\n    const localStoreImpl = debugCast(localStore, LocalStoreImpl);\n    if (settings.indexAutoCreationMinCollectionSize !== undefined) {\n      localStoreImpl.queryEngine.indexAutoCreationMinCollectionSize =\n        settings.indexAutoCreationMinCollectionSize;\n    }\n    if (settings.relativeIndexReadCostPerDocument !== undefined) {\n      localStoreImpl.queryEngine.relativeIndexReadCostPerDocument =\n        settings.relativeIndexReadCostPerDocument;\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { User } from '../auth/user';\nimport { BatchId, MutationBatchState, TargetId } from '../core/types';\nimport { debugAssert } from '../util/assert';\n\nimport { ClientId } from './shared_client_state';\nimport { QueryTargetState } from './shared_client_state_syncer';\n\n// The format of the LocalStorage key that stores the client state is:\n//     firestore_clients_<persistence_prefix>_<instance_key>\nexport const CLIENT_STATE_KEY_PREFIX = 'firestore_clients';\n\n/** Assembles the key for a client state in WebStorage */\nexport function createWebStorageClientStateKey(\n  persistenceKey: string,\n  clientId: ClientId\n): string {\n  debugAssert(\n    clientId.indexOf('_') === -1,\n    `Client key cannot contain '_', but was '${clientId}'`\n  );\n\n  return `${CLIENT_STATE_KEY_PREFIX}_${persistenceKey}_${clientId}`;\n}\n\n/**\n * The JSON representation of a clients's metadata as used during WebStorage\n * serialization. The ClientId is omitted here as it is encoded as part of the\n * key.\n */\nexport interface ClientStateSchema {\n  activeTargetIds: number[];\n  updateTimeMs: number;\n}\n\n// The format of the WebStorage key that stores the mutation state is:\n//     firestore_mutations_<persistence_prefix>_<batch_id>\n//     (for unauthenticated users)\n// or: firestore_mutations_<persistence_prefix>_<batch_id>_<user_uid>\n//\n// 'user_uid' is last to avoid needing to escape '_' characters that it might\n// contain.\nexport const MUTATION_BATCH_KEY_PREFIX = 'firestore_mutations';\n\n/** Assembles the key for a mutation batch in WebStorage */\nexport function createWebStorageMutationBatchKey(\n  persistenceKey: string,\n  user: User,\n  batchId: BatchId\n): string {\n  let mutationKey = `${MUTATION_BATCH_KEY_PREFIX}_${persistenceKey}_${batchId}`;\n\n  if (user.isAuthenticated()) {\n    mutationKey += `_${user.uid}`;\n  }\n\n  return mutationKey;\n}\n\n/**\n * The JSON representation of a mutation batch's metadata as used during\n * WebStorage serialization. The UserId and BatchId is omitted as it is\n * encoded as part of the key.\n */\nexport interface MutationMetadataSchema {\n  state: MutationBatchState;\n  error?: { code: string; message: string }; // Only set when state === 'rejected'\n  updateTimeMs: number;\n}\n\n// The format of the WebStorage key that stores a query target's metadata is:\n//     firestore_targets_<persistence_prefix>_<target_id>\nexport const QUERY_TARGET_KEY_PREFIX = 'firestore_targets';\n\n/** Assembles the key for a query state in WebStorage */\nexport function createWebStorageQueryTargetMetadataKey(\n  persistenceKey: string,\n  targetId: TargetId\n): string {\n  return `${QUERY_TARGET_KEY_PREFIX}_${persistenceKey}_${targetId}`;\n}\n\n/**\n * The JSON representation of a query target's state as used during WebStorage\n * serialization. The TargetId is omitted as it is encoded as part of the key.\n */\nexport interface QueryTargetStateSchema {\n  state: QueryTargetState;\n  error?: { code: string; message: string }; // Only set when state === 'rejected'\n  updateTimeMs: number;\n}\n\n// The WebStorage prefix that stores the primary tab's online state. The\n// format of the key is:\n//     firestore_online_state_<persistence_prefix>\nexport const ONLINE_STATE_KEY_PREFIX = 'firestore_online_state';\n\n/** Assembles the key for the online state of the primary tab. */\nexport function createWebStorageOnlineStateKey(persistenceKey: string): string {\n  return `${ONLINE_STATE_KEY_PREFIX}_${persistenceKey}`;\n}\n\n// The WebStorage prefix that plays as a event to indicate the remote documents\n// might have changed due to some secondary tabs loading a bundle.\n// format of the key is:\n//     firestore_bundle_loaded_v2_<persistenceKey>\n// The version ending with \"v2\" stores the list of modified collection groups.\nexport const BUNDLE_LOADED_KEY_PREFIX = 'firestore_bundle_loaded_v2';\nexport function createBundleLoadedKey(persistenceKey: string): string {\n  return `${BUNDLE_LOADED_KEY_PREFIX}_${persistenceKey}`;\n}\n\n/**\n * The JSON representation of the system's online state, as written by the\n * primary client.\n */\nexport interface SharedOnlineStateSchema {\n  /**\n   * The clientId of the client that wrote this onlineState value. Tracked so\n   * that on startup, clients can check if this client is still active when\n   * determining whether to apply this value or not.\n   */\n  readonly clientId: string;\n  readonly onlineState: string;\n}\n\n// The WebStorage key prefix for the key that stores the last sequence number allocated. The key\n// looks like 'firestore_sequence_number_<persistence_prefix>'.\nexport const SEQUENCE_NUMBER_KEY_PREFIX = 'firestore_sequence_number';\n\n/** Assembles the key for the current sequence number. */\nexport function createWebStorageSequenceNumberKey(\n  persistenceKey: string\n): string {\n  return `${SEQUENCE_NUMBER_KEY_PREFIX}_${persistenceKey}`;\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { User } from '../auth/user';\nimport { ListenSequence } from '../core/listen_sequence';\nimport {\n  BatchId,\n  ListenSequenceNumber,\n  MutationBatchState,\n  OnlineState,\n  TargetId\n} from '../core/types';\nimport { TargetIdSet, targetIdSet } from '../model/collections';\nimport { hardAssert, debugAssert } from '../util/assert';\nimport { AsyncQueue } from '../util/async_queue';\nimport { Code, FirestoreError } from '../util/error';\nimport { logError, logDebug } from '../util/log';\nimport { primitiveComparator } from '../util/misc';\nimport { SortedMap } from '../util/sorted_map';\nimport { SortedSet } from '../util/sorted_set';\nimport { isSafeInteger, WindowLike } from '../util/types';\n\nimport {\n  CLIENT_STATE_KEY_PREFIX,\n  ClientStateSchema,\n  createBundleLoadedKey,\n  createWebStorageClientStateKey,\n  createWebStorageMutationBatchKey,\n  createWebStorageOnlineStateKey,\n  createWebStorageQueryTargetMetadataKey,\n  createWebStorageSequenceNumberKey,\n  MUTATION_BATCH_KEY_PREFIX,\n  MutationMetadataSchema,\n  QUERY_TARGET_KEY_PREFIX,\n  QueryTargetStateSchema,\n  SharedOnlineStateSchema\n} from './shared_client_state_schema';\nimport {\n  QueryTargetState,\n  SharedClientStateSyncer\n} from './shared_client_state_syncer';\n\nconst LOG_TAG = 'SharedClientState';\n\n/**\n * A randomly-generated key assigned to each Firestore instance at startup.\n */\nexport type ClientId = string;\n\n/**\n * A `SharedClientState` keeps track of the global state of the mutations\n * and query targets for all active clients with the same persistence key (i.e.\n * project ID and FirebaseApp name). It relays local changes to other clients\n * and updates its local state as new state is observed.\n *\n * `SharedClientState` is primarily used for synchronization in Multi-Tab\n * environments. Each tab is responsible for registering its active query\n * targets and mutations. `SharedClientState` will then notify the listener\n * assigned to `.syncEngine` for updates to mutations and queries that\n * originated in other clients.\n *\n * To receive notifications, `.syncEngine` and `.onlineStateHandler` has to be\n * assigned before calling `start()`.\n */\nexport interface SharedClientState {\n  onlineStateHandler: ((onlineState: OnlineState) => void) | null;\n  sequenceNumberHandler:\n    | ((sequenceNumber: ListenSequenceNumber) => void)\n    | null;\n\n  /** Registers the Mutation Batch ID of a newly pending mutation. */\n  addPendingMutation(batchId: BatchId): void;\n\n  /**\n   * Records that a pending mutation has been acknowledged or rejected.\n   * Called by the primary client to notify secondary clients of mutation\n   * results as they come back from the backend.\n   */\n  updateMutationState(\n    batchId: BatchId,\n    state: 'acknowledged' | 'rejected',\n    error?: FirestoreError\n  ): void;\n\n  /**\n   * Associates a new Query Target ID with the local Firestore client. Returns\n   * the new query state for the query (which can be 'current' if the query is\n   * already associated with another tab).\n   *\n   * If the target id is already associated with local client, the method simply\n   * returns its `QueryTargetState`.\n   */\n  addLocalQueryTarget(targetId: TargetId): QueryTargetState;\n\n  /** Removes the Query Target ID association from the local client. */\n  removeLocalQueryTarget(targetId: TargetId): void;\n\n  /** Checks whether the target is associated with the local client. */\n  isLocalQueryTarget(targetId: TargetId): boolean;\n\n  /**\n   * Processes an update to a query target.\n   *\n   * Called by the primary client to notify secondary clients of document\n   * changes or state transitions that affect the provided query target.\n   */\n  updateQueryState(\n    targetId: TargetId,\n    state: QueryTargetState,\n    error?: FirestoreError\n  ): void;\n\n  /**\n   * Removes the target's metadata entry.\n   *\n   * Called by the primary client when all clients stopped listening to a query\n   * target.\n   */\n  clearQueryState(targetId: TargetId): void;\n\n  /**\n   * Gets the active Query Targets IDs for all active clients.\n   *\n   * The implementation for this may require O(n) runtime, where 'n' is the size\n   * of the result set.\n   */\n  // Visible for testing\n  getAllActiveQueryTargets(): SortedSet<TargetId>;\n\n  /**\n   * Checks whether the provided target ID is currently being listened to by\n   * any of the active clients.\n   *\n   * The implementation may require O(n*log m) runtime, where 'n' is the number\n   * of clients and 'm' the number of targets.\n   */\n  isActiveQueryTarget(targetId: TargetId): boolean;\n\n  /**\n   * Starts the SharedClientState, reads existing client data and registers\n   * listeners for updates to new and existing clients.\n   */\n  start(): Promise<void>;\n\n  /** Shuts down the `SharedClientState` and its listeners. */\n  shutdown(): void;\n\n  /**\n   * Changes the active user and removes all existing user-specific data. The\n   * user change does not call back into SyncEngine (for example, no mutations\n   * will be marked as removed).\n   */\n  handleUserChange(\n    user: User,\n    removedBatchIds: BatchId[],\n    addedBatchIds: BatchId[]\n  ): void;\n\n  /** Changes the shared online state of all clients. */\n  setOnlineState(onlineState: OnlineState): void;\n\n  writeSequenceNumber(sequenceNumber: ListenSequenceNumber): void;\n\n  /**\n   * Notifies other clients when remote documents have changed due to loading\n   * a bundle.\n   *\n   * @param collectionGroups The collection groups affected by this bundle.\n   */\n  notifyBundleLoaded(collectionGroups: Set<string>): void;\n}\n\n/**\n * Holds the state of a mutation batch, including its user ID, batch ID and\n * whether the batch is 'pending', 'acknowledged' or 'rejected'.\n */\n// Visible for testing\nexport class MutationMetadata {\n  constructor(\n    readonly user: User,\n    readonly batchId: BatchId,\n    readonly state: MutationBatchState,\n    readonly error?: FirestoreError\n  ) {\n    debugAssert(\n      (error !== undefined) === (state === 'rejected'),\n      `MutationMetadata must contain an error iff state is 'rejected'`\n    );\n  }\n\n  /**\n   * Parses a MutationMetadata from its JSON representation in WebStorage.\n   * Logs a warning and returns null if the format of the data is not valid.\n   */\n  static fromWebStorageEntry(\n    user: User,\n    batchId: BatchId,\n    value: string\n  ): MutationMetadata | null {\n    const mutationBatch = JSON.parse(value) as MutationMetadataSchema;\n\n    let validData =\n      typeof mutationBatch === 'object' &&\n      ['pending', 'acknowledged', 'rejected'].indexOf(mutationBatch.state) !==\n        -1 &&\n      (mutationBatch.error === undefined ||\n        typeof mutationBatch.error === 'object');\n\n    let firestoreError: FirestoreError | undefined = undefined;\n\n    if (validData && mutationBatch.error) {\n      validData =\n        typeof mutationBatch.error.message === 'string' &&\n        typeof mutationBatch.error.code === 'string';\n      if (validData) {\n        firestoreError = new FirestoreError(\n          mutationBatch.error.code as Code,\n          mutationBatch.error.message\n        );\n      }\n    }\n\n    if (validData) {\n      return new MutationMetadata(\n        user,\n        batchId,\n        mutationBatch.state,\n        firestoreError\n      );\n    } else {\n      logError(\n        LOG_TAG,\n        `Failed to parse mutation state for ID '${batchId}': ${value}`\n      );\n      return null;\n    }\n  }\n\n  toWebStorageJSON(): string {\n    const batchMetadata: MutationMetadataSchema = {\n      state: this.state,\n      updateTimeMs: Date.now() // Modify the existing value to trigger update.\n    };\n\n    if (this.error) {\n      batchMetadata.error = {\n        code: this.error.code,\n        message: this.error.message\n      };\n    }\n\n    return JSON.stringify(batchMetadata);\n  }\n}\n\n/**\n * Holds the state of a query target, including its target ID and whether the\n * target is 'not-current', 'current' or 'rejected'.\n */\n// Visible for testing\nexport class QueryTargetMetadata {\n  constructor(\n    readonly targetId: TargetId,\n    readonly state: QueryTargetState,\n    readonly error?: FirestoreError\n  ) {\n    debugAssert(\n      (error !== undefined) === (state === 'rejected'),\n      `QueryTargetMetadata must contain an error iff state is 'rejected'`\n    );\n  }\n\n  /**\n   * Parses a QueryTargetMetadata from its JSON representation in WebStorage.\n   * Logs a warning and returns null if the format of the data is not valid.\n   */\n  static fromWebStorageEntry(\n    targetId: TargetId,\n    value: string\n  ): QueryTargetMetadata | null {\n    const targetState = JSON.parse(value) as QueryTargetStateSchema;\n\n    let validData =\n      typeof targetState === 'object' &&\n      ['not-current', 'current', 'rejected'].indexOf(targetState.state) !==\n        -1 &&\n      (targetState.error === undefined ||\n        typeof targetState.error === 'object');\n\n    let firestoreError: FirestoreError | undefined = undefined;\n\n    if (validData && targetState.error) {\n      validData =\n        typeof targetState.error.message === 'string' &&\n        typeof targetState.error.code === 'string';\n      if (validData) {\n        firestoreError = new FirestoreError(\n          targetState.error.code as Code,\n          targetState.error.message\n        );\n      }\n    }\n\n    if (validData) {\n      return new QueryTargetMetadata(\n        targetId,\n        targetState.state,\n        firestoreError\n      );\n    } else {\n      logError(\n        LOG_TAG,\n        `Failed to parse target state for ID '${targetId}': ${value}`\n      );\n      return null;\n    }\n  }\n\n  toWebStorageJSON(): string {\n    const targetState: QueryTargetStateSchema = {\n      state: this.state,\n      updateTimeMs: Date.now() // Modify the existing value to trigger update.\n    };\n\n    if (this.error) {\n      targetState.error = {\n        code: this.error.code,\n        message: this.error.message\n      };\n    }\n\n    return JSON.stringify(targetState);\n  }\n}\n\n/**\n * Metadata state of a single client denoting the query targets it is actively\n * listening to the watch.\n */\n// Visible for testing.\nexport interface ClientState {\n  readonly activeTargetIds: TargetIdSet;\n}\n\n/**\n * This class represents the immutable ClientState for a client read from\n * WebStorage, containing the list of active query targets.\n */\nclass RemoteClientState implements ClientState {\n  private constructor(\n    readonly clientId: ClientId,\n    readonly activeTargetIds: TargetIdSet\n  ) {}\n\n  /**\n   * Parses a RemoteClientState from the JSON representation in WebStorage.\n   * Logs a warning and returns null if the format of the data is not valid.\n   */\n  static fromWebStorageEntry(\n    clientId: ClientId,\n    value: string\n  ): RemoteClientState | null {\n    const clientState = JSON.parse(value) as ClientStateSchema;\n\n    let validData =\n      typeof clientState === 'object' &&\n      clientState.activeTargetIds instanceof Array;\n\n    let activeTargetIdsSet = targetIdSet();\n\n    for (let i = 0; validData && i < clientState.activeTargetIds.length; ++i) {\n      validData = isSafeInteger(clientState.activeTargetIds[i]);\n      activeTargetIdsSet = activeTargetIdsSet.add(\n        clientState.activeTargetIds[i]\n      );\n    }\n\n    if (validData) {\n      return new RemoteClientState(clientId, activeTargetIdsSet);\n    } else {\n      logError(\n        LOG_TAG,\n        `Failed to parse client data for instance '${clientId}': ${value}`\n      );\n      return null;\n    }\n  }\n}\n\n/**\n * This class represents the online state for all clients participating in\n * multi-tab. The online state is only written to by the primary client, and\n * used in secondary clients to update their query views.\n */\nexport class SharedOnlineState {\n  constructor(readonly clientId: string, readonly onlineState: OnlineState) {}\n\n  /**\n   * Parses a SharedOnlineState from its JSON representation in WebStorage.\n   * Logs a warning and returns null if the format of the data is not valid.\n   */\n  static fromWebStorageEntry(value: string): SharedOnlineState | null {\n    const onlineState = JSON.parse(value) as SharedOnlineStateSchema;\n\n    const validData =\n      typeof onlineState === 'object' &&\n      ['Unknown', 'Online', 'Offline'].indexOf(onlineState.onlineState) !==\n        -1 &&\n      typeof onlineState.clientId === 'string';\n\n    if (validData) {\n      return new SharedOnlineState(\n        onlineState.clientId,\n        onlineState.onlineState as OnlineState\n      );\n    } else {\n      logError(LOG_TAG, `Failed to parse online state: ${value}`);\n      return null;\n    }\n  }\n}\n\n/**\n * Metadata state of the local client. Unlike `RemoteClientState`, this class is\n * mutable and keeps track of all pending mutations, which allows us to\n * update the range of pending mutation batch IDs as new mutations are added or\n * removed.\n *\n * The data in `LocalClientState` is not read from WebStorage and instead\n * updated via its instance methods. The updated state can be serialized via\n * `toWebStorageJSON()`.\n */\n// Visible for testing.\nexport class LocalClientState implements ClientState {\n  activeTargetIds = targetIdSet();\n\n  addQueryTarget(targetId: TargetId): void {\n    this.activeTargetIds = this.activeTargetIds.add(targetId);\n  }\n\n  removeQueryTarget(targetId: TargetId): void {\n    this.activeTargetIds = this.activeTargetIds.delete(targetId);\n  }\n\n  /**\n   * Converts this entry into a JSON-encoded format we can use for WebStorage.\n   * Does not encode `clientId` as it is part of the key in WebStorage.\n   */\n  toWebStorageJSON(): string {\n    const data: ClientStateSchema = {\n      activeTargetIds: this.activeTargetIds.toArray(),\n      updateTimeMs: Date.now() // Modify the existing value to trigger update.\n    };\n    return JSON.stringify(data);\n  }\n}\n\n/**\n * `WebStorageSharedClientState` uses WebStorage (window.localStorage) as the\n * backing store for the SharedClientState. It keeps track of all active\n * clients and supports modifications of the local client's data.\n */\nexport class WebStorageSharedClientState implements SharedClientState {\n  syncEngine: SharedClientStateSyncer | null = null;\n  onlineStateHandler: ((onlineState: OnlineState) => void) | null = null;\n  sequenceNumberHandler:\n    | ((sequenceNumber: ListenSequenceNumber) => void)\n    | null = null;\n\n  private readonly storage: Storage;\n  private readonly localClientStorageKey: string;\n  private readonly sequenceNumberKey: string;\n  private readonly storageListener = this.handleWebStorageEvent.bind(this);\n  private readonly onlineStateKey: string;\n  private readonly bundleLoadedKey: string;\n  private readonly clientStateKeyRe: RegExp;\n  private readonly mutationBatchKeyRe: RegExp;\n  private readonly queryTargetKeyRe: RegExp;\n  private activeClients = new SortedMap<string, ClientState>(\n    primitiveComparator\n  );\n  private started = false;\n  private currentUser: User;\n\n  /**\n   * Captures WebStorage events that occur before `start()` is called. These\n   * events are replayed once `WebStorageSharedClientState` is started.\n   */\n  private earlyEvents: StorageEvent[] = [];\n\n  constructor(\n    private readonly window: WindowLike,\n    private readonly queue: AsyncQueue,\n    private readonly persistenceKey: string,\n    private readonly localClientId: ClientId,\n    initialUser: User\n  ) {\n    // Escape the special characters mentioned here:\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\n    const escapedPersistenceKey = persistenceKey.replace(\n      /[.*+?^${}()|[\\]\\\\]/g,\n      '\\\\$&'\n    );\n\n    this.storage = this.window.localStorage;\n    this.currentUser = initialUser;\n    this.localClientStorageKey = createWebStorageClientStateKey(\n      this.persistenceKey,\n      this.localClientId\n    );\n    this.sequenceNumberKey = createWebStorageSequenceNumberKey(\n      this.persistenceKey\n    );\n    this.activeClients = this.activeClients.insert(\n      this.localClientId,\n      new LocalClientState()\n    );\n\n    this.clientStateKeyRe = new RegExp(\n      `^${CLIENT_STATE_KEY_PREFIX}_${escapedPersistenceKey}_([^_]*)$`\n    );\n    this.mutationBatchKeyRe = new RegExp(\n      `^${MUTATION_BATCH_KEY_PREFIX}_${escapedPersistenceKey}_(\\\\d+)(?:_(.*))?$`\n    );\n    this.queryTargetKeyRe = new RegExp(\n      `^${QUERY_TARGET_KEY_PREFIX}_${escapedPersistenceKey}_(\\\\d+)$`\n    );\n\n    this.onlineStateKey = createWebStorageOnlineStateKey(this.persistenceKey);\n\n    this.bundleLoadedKey = createBundleLoadedKey(this.persistenceKey);\n\n    // Rather than adding the storage observer during start(), we add the\n    // storage observer during initialization. This ensures that we collect\n    // events before other components populate their initial state (during their\n    // respective start() calls). Otherwise, we might for example miss a\n    // mutation that is added after LocalStore's start() processed the existing\n    // mutations but before we observe WebStorage events.\n    this.window.addEventListener('storage', this.storageListener);\n  }\n\n  /** Returns 'true' if WebStorage is available in the current environment. */\n  static isAvailable(window: WindowLike | null): window is WindowLike {\n    return !!(window && window.localStorage);\n  }\n\n  async start(): Promise<void> {\n    debugAssert(!this.started, 'WebStorageSharedClientState already started');\n    debugAssert(\n      this.syncEngine !== null,\n      'syncEngine property must be set before calling start()'\n    );\n    debugAssert(\n      this.onlineStateHandler !== null,\n      'onlineStateHandler property must be set before calling start()'\n    );\n\n    // Retrieve the list of existing clients to backfill the data in\n    // SharedClientState.\n    const existingClients = await this.syncEngine!.getActiveClients();\n\n    for (const clientId of existingClients) {\n      if (clientId === this.localClientId) {\n        continue;\n      }\n\n      const storageItem = this.getItem(\n        createWebStorageClientStateKey(this.persistenceKey, clientId)\n      );\n      if (storageItem) {\n        const clientState = RemoteClientState.fromWebStorageEntry(\n          clientId,\n          storageItem\n        );\n        if (clientState) {\n          this.activeClients = this.activeClients.insert(\n            clientState.clientId,\n            clientState\n          );\n        }\n      }\n    }\n\n    this.persistClientState();\n\n    // Check if there is an existing online state and call the callback handler\n    // if applicable.\n    const onlineStateJSON = this.storage.getItem(this.onlineStateKey);\n    if (onlineStateJSON) {\n      const onlineState = this.fromWebStorageOnlineState(onlineStateJSON);\n      if (onlineState) {\n        this.handleOnlineStateEvent(onlineState);\n      }\n    }\n\n    for (const event of this.earlyEvents) {\n      this.handleWebStorageEvent(event);\n    }\n\n    this.earlyEvents = [];\n\n    // Register a window unload hook to remove the client metadata entry from\n    // WebStorage even if `shutdown()` was not called.\n    this.window.addEventListener('pagehide', () => this.shutdown());\n\n    this.started = true;\n  }\n\n  writeSequenceNumber(sequenceNumber: ListenSequenceNumber): void {\n    this.setItem(this.sequenceNumberKey, JSON.stringify(sequenceNumber));\n  }\n\n  getAllActiveQueryTargets(): TargetIdSet {\n    return this.extractActiveQueryTargets(this.activeClients);\n  }\n\n  isActiveQueryTarget(targetId: TargetId): boolean {\n    let found = false;\n    this.activeClients.forEach((key, value) => {\n      if (value.activeTargetIds.has(targetId)) {\n        found = true;\n      }\n    });\n    return found;\n  }\n\n  addPendingMutation(batchId: BatchId): void {\n    this.persistMutationState(batchId, 'pending');\n  }\n\n  updateMutationState(\n    batchId: BatchId,\n    state: 'acknowledged' | 'rejected',\n    error?: FirestoreError\n  ): void {\n    this.persistMutationState(batchId, state, error);\n\n    // Once a final mutation result is observed by other clients, they no longer\n    // access the mutation's metadata entry. Since WebStorage replays events\n    // in order, it is safe to delete the entry right after updating it.\n    this.removeMutationState(batchId);\n  }\n\n  addLocalQueryTarget(targetId: TargetId): QueryTargetState {\n    let queryState: QueryTargetState = 'not-current';\n\n    // Lookup an existing query state if the target ID was already registered\n    // by another tab\n    if (this.isActiveQueryTarget(targetId)) {\n      const storageItem = this.storage.getItem(\n        createWebStorageQueryTargetMetadataKey(this.persistenceKey, targetId)\n      );\n\n      if (storageItem) {\n        const metadata = QueryTargetMetadata.fromWebStorageEntry(\n          targetId,\n          storageItem\n        );\n        if (metadata) {\n          queryState = metadata.state;\n        }\n      }\n    }\n\n    this.localClientState.addQueryTarget(targetId);\n    this.persistClientState();\n\n    return queryState;\n  }\n\n  removeLocalQueryTarget(targetId: TargetId): void {\n    this.localClientState.removeQueryTarget(targetId);\n    this.persistClientState();\n  }\n\n  isLocalQueryTarget(targetId: TargetId): boolean {\n    return this.localClientState.activeTargetIds.has(targetId);\n  }\n\n  clearQueryState(targetId: TargetId): void {\n    this.removeItem(\n      createWebStorageQueryTargetMetadataKey(this.persistenceKey, targetId)\n    );\n  }\n\n  updateQueryState(\n    targetId: TargetId,\n    state: QueryTargetState,\n    error?: FirestoreError\n  ): void {\n    this.persistQueryTargetState(targetId, state, error);\n  }\n\n  handleUserChange(\n    user: User,\n    removedBatchIds: BatchId[],\n    addedBatchIds: BatchId[]\n  ): void {\n    removedBatchIds.forEach(batchId => {\n      this.removeMutationState(batchId);\n    });\n    this.currentUser = user;\n    addedBatchIds.forEach(batchId => {\n      this.addPendingMutation(batchId);\n    });\n  }\n\n  setOnlineState(onlineState: OnlineState): void {\n    this.persistOnlineState(onlineState);\n  }\n\n  notifyBundleLoaded(collectionGroups: Set<string>): void {\n    this.persistBundleLoadedState(collectionGroups);\n  }\n\n  shutdown(): void {\n    if (this.started) {\n      this.window.removeEventListener('storage', this.storageListener);\n      this.removeItem(this.localClientStorageKey);\n      this.started = false;\n    }\n  }\n\n  private getItem(key: string): string | null {\n    const value = this.storage.getItem(key);\n    logDebug(LOG_TAG, 'READ', key, value);\n    return value;\n  }\n\n  private setItem(key: string, value: string): void {\n    logDebug(LOG_TAG, 'SET', key, value);\n    this.storage.setItem(key, value);\n  }\n\n  private removeItem(key: string): void {\n    logDebug(LOG_TAG, 'REMOVE', key);\n    this.storage.removeItem(key);\n  }\n\n  private handleWebStorageEvent(event: Event): void {\n    // Note: The function is typed to take Event to be interface-compatible with\n    // `Window.addEventListener`.\n    const storageEvent = event as StorageEvent;\n    if (storageEvent.storageArea === this.storage) {\n      logDebug(LOG_TAG, 'EVENT', storageEvent.key, storageEvent.newValue);\n\n      if (storageEvent.key === this.localClientStorageKey) {\n        logError(\n          'Received WebStorage notification for local change. Another client might have ' +\n            'garbage-collected our state'\n        );\n        return;\n      }\n\n      this.queue.enqueueRetryable(async () => {\n        if (!this.started) {\n          this.earlyEvents.push(storageEvent);\n          return;\n        }\n\n        if (storageEvent.key === null) {\n          return;\n        }\n\n        if (this.clientStateKeyRe.test(storageEvent.key)) {\n          if (storageEvent.newValue != null) {\n            const clientState = this.fromWebStorageClientState(\n              storageEvent.key,\n              storageEvent.newValue\n            );\n            if (clientState) {\n              return this.handleClientStateEvent(\n                clientState.clientId,\n                clientState\n              );\n            }\n          } else {\n            const clientId = this.fromWebStorageClientStateKey(\n              storageEvent.key\n            )!;\n            return this.handleClientStateEvent(clientId, null);\n          }\n        } else if (this.mutationBatchKeyRe.test(storageEvent.key)) {\n          if (storageEvent.newValue !== null) {\n            const mutationMetadata = this.fromWebStorageMutationMetadata(\n              storageEvent.key,\n              storageEvent.newValue\n            );\n            if (mutationMetadata) {\n              return this.handleMutationBatchEvent(mutationMetadata);\n            }\n          }\n        } else if (this.queryTargetKeyRe.test(storageEvent.key)) {\n          if (storageEvent.newValue !== null) {\n            const queryTargetMetadata = this.fromWebStorageQueryTargetMetadata(\n              storageEvent.key,\n              storageEvent.newValue\n            );\n            if (queryTargetMetadata) {\n              return this.handleQueryTargetEvent(queryTargetMetadata);\n            }\n          }\n        } else if (storageEvent.key === this.onlineStateKey) {\n          if (storageEvent.newValue !== null) {\n            const onlineState = this.fromWebStorageOnlineState(\n              storageEvent.newValue\n            );\n            if (onlineState) {\n              return this.handleOnlineStateEvent(onlineState);\n            }\n          }\n        } else if (storageEvent.key === this.sequenceNumberKey) {\n          debugAssert(\n            !!this.sequenceNumberHandler,\n            'Missing sequenceNumberHandler'\n          );\n          const sequenceNumber = fromWebStorageSequenceNumber(\n            storageEvent.newValue\n          );\n          if (sequenceNumber !== ListenSequence.INVALID) {\n            this.sequenceNumberHandler!(sequenceNumber);\n          }\n        } else if (storageEvent.key === this.bundleLoadedKey) {\n          const collectionGroups = this.fromWebStoreBundleLoadedState(\n            storageEvent.newValue!\n          );\n          await Promise.all(\n            collectionGroups.map(cg =>\n              this.syncEngine!.synchronizeWithChangedDocuments(cg)\n            )\n          );\n        }\n      });\n    }\n  }\n\n  private get localClientState(): LocalClientState {\n    return this.activeClients.get(this.localClientId) as LocalClientState;\n  }\n\n  private persistClientState(): void {\n    this.setItem(\n      this.localClientStorageKey,\n      this.localClientState.toWebStorageJSON()\n    );\n  }\n\n  private persistMutationState(\n    batchId: BatchId,\n    state: MutationBatchState,\n    error?: FirestoreError\n  ): void {\n    const mutationState = new MutationMetadata(\n      this.currentUser,\n      batchId,\n      state,\n      error\n    );\n    const mutationKey = createWebStorageMutationBatchKey(\n      this.persistenceKey,\n      this.currentUser,\n      batchId\n    );\n    this.setItem(mutationKey, mutationState.toWebStorageJSON());\n  }\n\n  private removeMutationState(batchId: BatchId): void {\n    const mutationKey = createWebStorageMutationBatchKey(\n      this.persistenceKey,\n      this.currentUser,\n      batchId\n    );\n    this.removeItem(mutationKey);\n  }\n\n  private persistOnlineState(onlineState: OnlineState): void {\n    const entry: SharedOnlineStateSchema = {\n      clientId: this.localClientId,\n      onlineState\n    };\n    this.storage.setItem(this.onlineStateKey, JSON.stringify(entry));\n  }\n\n  private persistQueryTargetState(\n    targetId: TargetId,\n    state: QueryTargetState,\n    error?: FirestoreError\n  ): void {\n    const targetKey = createWebStorageQueryTargetMetadataKey(\n      this.persistenceKey,\n      targetId\n    );\n    const targetMetadata = new QueryTargetMetadata(targetId, state, error);\n    this.setItem(targetKey, targetMetadata.toWebStorageJSON());\n  }\n\n  private persistBundleLoadedState(collectionGroups: Set<string>): void {\n    const json = JSON.stringify(Array.from(collectionGroups));\n    this.setItem(this.bundleLoadedKey, json);\n  }\n\n  /**\n   * Parses a client state key in WebStorage. Returns null if the key does not\n   * match the expected key format.\n   */\n  private fromWebStorageClientStateKey(key: string): ClientId | null {\n    const match = this.clientStateKeyRe.exec(key);\n    return match ? match[1] : null;\n  }\n\n  /**\n   * Parses a client state in WebStorage. Returns 'null' if the value could not\n   * be parsed.\n   */\n  private fromWebStorageClientState(\n    key: string,\n    value: string\n  ): RemoteClientState | null {\n    const clientId = this.fromWebStorageClientStateKey(key);\n    debugAssert(clientId !== null, `Cannot parse client state key '${key}'`);\n    return RemoteClientState.fromWebStorageEntry(clientId, value);\n  }\n\n  /**\n   * Parses a mutation batch state in WebStorage. Returns 'null' if the value\n   * could not be parsed.\n   */\n  private fromWebStorageMutationMetadata(\n    key: string,\n    value: string\n  ): MutationMetadata | null {\n    const match = this.mutationBatchKeyRe.exec(key);\n    debugAssert(match !== null, `Cannot parse mutation batch key '${key}'`);\n\n    const batchId = Number(match[1]);\n    const userId = match[2] !== undefined ? match[2] : null;\n    return MutationMetadata.fromWebStorageEntry(\n      new User(userId),\n      batchId,\n      value\n    );\n  }\n\n  /**\n   * Parses a query target state from WebStorage. Returns 'null' if the value\n   * could not be parsed.\n   */\n  private fromWebStorageQueryTargetMetadata(\n    key: string,\n    value: string\n  ): QueryTargetMetadata | null {\n    const match = this.queryTargetKeyRe.exec(key);\n    debugAssert(match !== null, `Cannot parse query target key '${key}'`);\n\n    const targetId = Number(match[1]);\n    return QueryTargetMetadata.fromWebStorageEntry(targetId, value);\n  }\n\n  /**\n   * Parses an online state from WebStorage. Returns 'null' if the value\n   * could not be parsed.\n   */\n  private fromWebStorageOnlineState(value: string): SharedOnlineState | null {\n    return SharedOnlineState.fromWebStorageEntry(value);\n  }\n\n  private fromWebStoreBundleLoadedState(value: string): string[] {\n    return JSON.parse(value) as string[];\n  }\n\n  private async handleMutationBatchEvent(\n    mutationBatch: MutationMetadata\n  ): Promise<void> {\n    if (mutationBatch.user.uid !== this.currentUser.uid) {\n      logDebug(\n        LOG_TAG,\n        `Ignoring mutation for non-active user ${mutationBatch.user.uid}`\n      );\n      return;\n    }\n\n    return this.syncEngine!.applyBatchState(\n      mutationBatch.batchId,\n      mutationBatch.state,\n      mutationBatch.error\n    );\n  }\n\n  private handleQueryTargetEvent(\n    targetMetadata: QueryTargetMetadata\n  ): Promise<void> {\n    return this.syncEngine!.applyTargetState(\n      targetMetadata.targetId,\n      targetMetadata.state,\n      targetMetadata.error\n    );\n  }\n\n  private handleClientStateEvent(\n    clientId: ClientId,\n    clientState: RemoteClientState | null\n  ): Promise<void> {\n    const updatedClients = clientState\n      ? this.activeClients.insert(clientId, clientState)\n      : this.activeClients.remove(clientId);\n\n    const existingTargets = this.extractActiveQueryTargets(this.activeClients);\n    const newTargets = this.extractActiveQueryTargets(updatedClients);\n\n    const addedTargets: TargetId[] = [];\n    const removedTargets: TargetId[] = [];\n\n    newTargets.forEach(targetId => {\n      if (!existingTargets.has(targetId)) {\n        addedTargets.push(targetId);\n      }\n    });\n\n    existingTargets.forEach(targetId => {\n      if (!newTargets.has(targetId)) {\n        removedTargets.push(targetId);\n      }\n    });\n\n    return this.syncEngine!.applyActiveTargetsChange(\n      addedTargets,\n      removedTargets\n    ).then(() => {\n      this.activeClients = updatedClients;\n    });\n  }\n\n  private handleOnlineStateEvent(onlineState: SharedOnlineState): void {\n    // We check whether the client that wrote this online state is still active\n    // by comparing its client ID to the list of clients kept active in\n    // IndexedDb. If a client does not update their IndexedDb client state\n    // within 5 seconds, it is considered inactive and we don't emit an online\n    // state event.\n    if (this.activeClients.get(onlineState.clientId)) {\n      this.onlineStateHandler!(onlineState.onlineState);\n    }\n  }\n\n  private extractActiveQueryTargets(\n    clients: SortedMap<string, ClientState>\n  ): SortedSet<TargetId> {\n    let activeTargets = targetIdSet();\n    clients.forEach((kev, value) => {\n      activeTargets = activeTargets.unionWith(value.activeTargetIds);\n    });\n    return activeTargets;\n  }\n}\n\nfunction fromWebStorageSequenceNumber(\n  seqString: string | null\n): ListenSequenceNumber {\n  let sequenceNumber = ListenSequence.INVALID;\n  if (seqString != null) {\n    try {\n      const parsed = JSON.parse(seqString);\n      hardAssert(\n        typeof parsed === 'number',\n        'Found non-numeric sequence number'\n      );\n      sequenceNumber = parsed;\n    } catch (e) {\n      logError(LOG_TAG, 'Failed to read sequence number from WebStorage', e);\n    }\n  }\n  return sequenceNumber;\n}\n\n/**\n * `MemorySharedClientState` is a simple implementation of SharedClientState for\n * clients using memory persistence. The state in this class remains fully\n * isolated and no synchronization is performed.\n */\nexport class MemorySharedClientState implements SharedClientState {\n  private localState = new LocalClientState();\n  private queryState: { [targetId: number]: QueryTargetState } = {};\n  onlineStateHandler: ((onlineState: OnlineState) => void) | null = null;\n  sequenceNumberHandler:\n    | ((sequenceNumber: ListenSequenceNumber) => void)\n    | null = null;\n\n  addPendingMutation(batchId: BatchId): void {\n    // No op.\n  }\n\n  updateMutationState(\n    batchId: BatchId,\n    state: 'acknowledged' | 'rejected',\n    error?: FirestoreError\n  ): void {\n    // No op.\n  }\n\n  addLocalQueryTarget(targetId: TargetId): QueryTargetState {\n    this.localState.addQueryTarget(targetId);\n    return this.queryState[targetId] || 'not-current';\n  }\n\n  updateQueryState(\n    targetId: TargetId,\n    state: QueryTargetState,\n    error?: FirestoreError\n  ): void {\n    this.queryState[targetId] = state;\n  }\n\n  removeLocalQueryTarget(targetId: TargetId): void {\n    this.localState.removeQueryTarget(targetId);\n  }\n\n  isLocalQueryTarget(targetId: TargetId): boolean {\n    return this.localState.activeTargetIds.has(targetId);\n  }\n\n  clearQueryState(targetId: TargetId): void {\n    delete this.queryState[targetId];\n  }\n\n  getAllActiveQueryTargets(): TargetIdSet {\n    return this.localState.activeTargetIds;\n  }\n\n  isActiveQueryTarget(targetId: TargetId): boolean {\n    return this.localState.activeTargetIds.has(targetId);\n  }\n\n  start(): Promise<void> {\n    this.localState = new LocalClientState();\n    return Promise.resolve();\n  }\n\n  handleUserChange(\n    user: User,\n    removedBatchIds: BatchId[],\n    addedBatchIds: BatchId[]\n  ): void {\n    // No op.\n  }\n\n  setOnlineState(onlineState: OnlineState): void {\n    // No op.\n  }\n\n  shutdown(): void {}\n\n  writeSequenceNumber(sequenceNumber: ListenSequenceNumber): void {}\n\n  notifyBundleLoaded(collectionGroups: Set<string>): void {\n    // No op.\n  }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ConnectivityMonitor, NetworkStatus } from './connectivity_monitor';\n\nexport class NoopConnectivityMonitor implements ConnectivityMonitor {\n  addCallback(callback: (status: NetworkStatus) => void): void {\n    // No-op.\n  }\n\n  shutdown(): void {\n    // No-op.\n  }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  ConnectivityMonitor,\n  ConnectivityMonitorCallback,\n  NetworkStatus\n} from '../../remote/connectivity_monitor';\nimport { logDebug } from '../../util/log';\n\n// References to `window` are guarded by BrowserConnectivityMonitor.isAvailable()\n/* eslint-disable no-restricted-globals */\n\nconst LOG_TAG = 'ConnectivityMonitor';\n\n/**\n * Browser implementation of ConnectivityMonitor.\n */\nexport class BrowserConnectivityMonitor implements ConnectivityMonitor {\n  private readonly networkAvailableListener = (): void =>\n    this.onNetworkAvailable();\n  private readonly networkUnavailableListener = (): void =>\n    this.onNetworkUnavailable();\n  private callbacks: ConnectivityMonitorCallback[] = [];\n\n  constructor() {\n    this.configureNetworkMonitoring();\n  }\n\n  addCallback(callback: (status: NetworkStatus) => void): void {\n    this.callbacks.push(callback);\n  }\n\n  shutdown(): void {\n    window.removeEventListener('online', this.networkAvailableListener);\n    window.removeEventListener('offline', this.networkUnavailableListener);\n  }\n\n  private configureNetworkMonitoring(): void {\n    window.addEventListener('online', this.networkAvailableListener);\n    window.addEventListener('offline', this.networkUnavailableListener);\n  }\n\n  private onNetworkAvailable(): void {\n    logDebug(LOG_TAG, 'Network connectivity changed: AVAILABLE');\n    for (const callback of this.callbacks) {\n      callback(NetworkStatus.AVAILABLE);\n    }\n  }\n\n  private onNetworkUnavailable(): void {\n    logDebug(LOG_TAG, 'Network connectivity changed: UNAVAILABLE');\n    for (const callback of this.callbacks) {\n      callback(NetworkStatus.UNAVAILABLE);\n    }\n  }\n\n  // TODO(chenbrian): Consider passing in window either into this component or\n  // here for testing via FakeWindow.\n  /** Checks that all used attributes of window are available. */\n  static isAvailable(): boolean {\n    return (\n      typeof window !== 'undefined' &&\n      window.addEventListener !== undefined &&\n      window.removeEventListener !== undefined\n    );\n  }\n}\n","/**\n * @license\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The value returned from the most recent invocation of\n * `generateUniqueDebugId()`, or null if it has never been invoked.\n */\nlet lastUniqueDebugId: number | null = null;\n\n/**\n * Generates and returns an initial value for `lastUniqueDebugId`.\n *\n * The returned value is randomly selected from a range of integers that are\n * represented as 8 hexadecimal digits. This means that (within reason) any\n * numbers generated by incrementing the returned number by 1 will also be\n * represented by 8 hexadecimal digits. This leads to all \"IDs\" having the same\n * length when converted to a hexadecimal string, making reading logs containing\n * these IDs easier to follow. And since the return value is randomly selected\n * it will help to differentiate between logs from different executions.\n */\nfunction generateInitialUniqueDebugId(): number {\n  const minResult = 0x10000000;\n  const maxResult = 0x90000000;\n  const resultRange = maxResult - minResult;\n  const resultOffset = Math.round(resultRange * Math.random());\n  return minResult + resultOffset;\n}\n\n/**\n * Generates and returns a unique ID as a hexadecimal string.\n *\n * The returned ID is intended to be used in debug logging messages to help\n * correlate log messages that may be spatially separated in the logs, but\n * logically related. For example, a network connection could include the same\n * \"debug ID\" string in all of its log messages to help trace a specific\n * connection over time.\n *\n * @return the 10-character generated ID (e.g. \"0xa1b2c3d4\").\n */\nexport function generateUniqueDebugId(): string {\n  if (lastUniqueDebugId === null) {\n    lastUniqueDebugId = generateInitialUniqueDebugId();\n  } else {\n    lastUniqueDebugId++;\n  }\n  return '0x' + lastUniqueDebugId.toString(16);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SDK_VERSION } from '../../src/core/version';\nimport { Token } from '../api/credentials';\nimport {\n  DatabaseId,\n  DatabaseInfo,\n  DEFAULT_DATABASE_NAME\n} from '../core/database_info';\nimport { ResourcePath } from '../model/path';\nimport { debugAssert } from '../util/assert';\nimport { generateUniqueDebugId } from '../util/debug_uid';\nimport { FirestoreError } from '../util/error';\nimport { logDebug, logWarn } from '../util/log';\nimport { StringMap } from '../util/types';\n\nimport { Connection, Stream } from './connection';\n\nconst LOG_TAG = 'RestConnection';\n\n/**\n * Maps RPC names to the corresponding REST endpoint name.\n *\n * We use array notation to avoid mangling.\n */\nconst RPC_NAME_URL_MAPPING: StringMap = {};\n\nRPC_NAME_URL_MAPPING['BatchGetDocuments'] = 'batchGet';\nRPC_NAME_URL_MAPPING['Commit'] = 'commit';\nRPC_NAME_URL_MAPPING['RunQuery'] = 'runQuery';\nRPC_NAME_URL_MAPPING['RunAggregationQuery'] = 'runAggregationQuery';\n\nconst RPC_URL_VERSION = 'v1';\n\n// SDK_VERSION is updated to different value at runtime depending on the entry point,\n// so we need to get its value when we need it in a function.\nfunction getGoogApiClientValue(): string {\n  return 'gl-js/ fire/' + SDK_VERSION;\n}\n/**\n * Base class for all Rest-based connections to the backend (WebChannel and\n * HTTP).\n */\nexport abstract class RestConnection implements Connection {\n  protected readonly databaseId: DatabaseId;\n  protected readonly baseUrl: string;\n  private readonly databasePath: string;\n  private readonly requestParams: string;\n\n  get shouldResourcePathBeIncludedInRequest(): boolean {\n    // Both `invokeRPC()` and `invokeStreamingRPC()` use their `path` arguments to determine\n    // where to run the query, and expect the `request` to NOT specify the \"path\".\n    return false;\n  }\n\n  constructor(private readonly databaseInfo: DatabaseInfo) {\n    this.databaseId = databaseInfo.databaseId;\n    const proto = databaseInfo.ssl ? 'https' : 'http';\n    const projectId = encodeURIComponent(this.databaseId.projectId);\n    const databaseId = encodeURIComponent(this.databaseId.database);\n    this.baseUrl = proto + '://' + databaseInfo.host;\n    this.databasePath = `projects/${projectId}/databases/${databaseId}`;\n    this.requestParams =\n      this.databaseId.database === DEFAULT_DATABASE_NAME\n        ? `project_id=${projectId}`\n        : `project_id=${projectId}&database_id=${databaseId}`;\n  }\n\n  invokeRPC<Req, Resp>(\n    rpcName: string,\n    path: ResourcePath,\n    req: Req,\n    authToken: Token | null,\n    appCheckToken: Token | null\n  ): Promise<Resp> {\n    const streamId = generateUniqueDebugId();\n    const url = this.makeUrl(rpcName, path.toUriEncodedString());\n    logDebug(LOG_TAG, `Sending RPC '${rpcName}' ${streamId}:`, url, req);\n\n    const headers: StringMap = {\n      'google-cloud-resource-prefix': this.databasePath,\n      'x-goog-request-params': this.requestParams\n    };\n    this.modifyHeadersForRequest(headers, authToken, appCheckToken);\n\n    return this.performRPCRequest<Req, Resp>(rpcName, url, headers, req).then(\n      response => {\n        logDebug(LOG_TAG, `Received RPC '${rpcName}' ${streamId}: `, response);\n        return response;\n      },\n      (err: FirestoreError) => {\n        logWarn(\n          LOG_TAG,\n          `RPC '${rpcName}' ${streamId} failed with error: `,\n          err,\n          'url: ',\n          url,\n          'request:',\n          req\n        );\n        throw err;\n      }\n    );\n  }\n\n  invokeStreamingRPC<Req, Resp>(\n    rpcName: string,\n    path: ResourcePath,\n    request: Req,\n    authToken: Token | null,\n    appCheckToken: Token | null,\n    expectedResponseCount?: number\n  ): Promise<Resp[]> {\n    // The REST API automatically aggregates all of the streamed results, so we\n    // can just use the normal invoke() method.\n    return this.invokeRPC<Req, Resp[]>(\n      rpcName,\n      path,\n      request,\n      authToken,\n      appCheckToken\n    );\n  }\n\n  abstract openStream<Req, Resp>(\n    rpcName: string,\n    authToken: Token | null,\n    appCheckToken: Token | null\n  ): Stream<Req, Resp>;\n\n  /**\n   * Modifies the headers for a request, adding any authorization token if\n   * present and any additional headers for the request.\n   */\n  protected modifyHeadersForRequest(\n    headers: StringMap,\n    authToken: Token | null,\n    appCheckToken: Token | null\n  ): void {\n    headers['X-Goog-Api-Client'] = getGoogApiClientValue();\n\n    // Content-Type: text/plain will avoid preflight requests which might\n    // mess with CORS and redirects by proxies. If we add custom headers\n    // we will need to change this code to potentially use the $httpOverwrite\n    // parameter supported by ESF to avoid triggering preflight requests.\n    headers['Content-Type'] = 'text/plain';\n\n    if (this.databaseInfo.appId) {\n      headers['X-Firebase-GMPID'] = this.databaseInfo.appId;\n    }\n\n    if (authToken) {\n      authToken.headers.forEach((value, key) => (headers[key] = value));\n    }\n    if (appCheckToken) {\n      appCheckToken.headers.forEach((value, key) => (headers[key] = value));\n    }\n  }\n\n  /**\n   * Performs an RPC request using an implementation specific networking layer.\n   */\n  protected abstract performRPCRequest<Req, Resp>(\n    rpcName: string,\n    url: string,\n    headers: StringMap,\n    body: Req\n  ): Promise<Resp>;\n\n  private makeUrl(rpcName: string, path: string): string {\n    const urlRpcName = RPC_NAME_URL_MAPPING[rpcName];\n    debugAssert(\n      urlRpcName !== undefined,\n      'Unknown REST mapping for: ' + rpcName\n    );\n    return `${this.baseUrl}/${RPC_URL_VERSION}/${path}:${urlRpcName}`;\n  }\n\n  /**\n   * Closes and cleans up any resources associated with the connection. This\n   * implementation is a no-op because there are no resources associated\n   * with the RestConnection that need to be cleaned up.\n   */\n  terminate(): void {\n    // No-op\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { debugAssert } from '../util/assert';\nimport { FirestoreError } from '../util/error';\n\nimport { Stream } from './connection';\n\n/**\n * Provides a simple helper class that implements the Stream interface to\n * bridge to other implementations that are streams but do not implement the\n * interface. The stream callbacks are invoked with the callOn... methods.\n */\nexport class StreamBridge<I, O> implements Stream<I, O> {\n  private wrappedOnConnected: (() => void) | undefined;\n  private wrappedOnOpen: (() => void) | undefined;\n  private wrappedOnClose: ((err?: FirestoreError) => void) | undefined;\n  private wrappedOnMessage: ((msg: O) => void) | undefined;\n\n  private sendFn: (msg: I) => void;\n  private closeFn: () => void;\n\n  constructor(args: { sendFn: (msg: I) => void; closeFn: () => void }) {\n    this.sendFn = args.sendFn;\n    this.closeFn = args.closeFn;\n  }\n\n  onConnected(callback: () => void): void {\n    debugAssert(\n      !this.wrappedOnConnected,\n      'Called onConnected on stream twice!'\n    );\n    this.wrappedOnConnected = callback;\n  }\n\n  onOpen(callback: () => void): void {\n    debugAssert(!this.wrappedOnOpen, 'Called onOpen on stream twice!');\n    this.wrappedOnOpen = callback;\n  }\n\n  onClose(callback: (err?: FirestoreError) => void): void {\n    debugAssert(!this.wrappedOnClose, 'Called onClose on stream twice!');\n    this.wrappedOnClose = callback;\n  }\n\n  onMessage(callback: (msg: O) => void): void {\n    debugAssert(!this.wrappedOnMessage, 'Called onMessage on stream twice!');\n    this.wrappedOnMessage = callback;\n  }\n\n  close(): void {\n    this.closeFn();\n  }\n\n  send(msg: I): void {\n    this.sendFn(msg);\n  }\n\n  callOnConnected(): void {\n    debugAssert(\n      this.wrappedOnConnected !== undefined,\n      'Cannot call onConnected because no callback was set'\n    );\n    this.wrappedOnConnected();\n  }\n\n  callOnOpen(): void {\n    debugAssert(\n      this.wrappedOnOpen !== undefined,\n      'Cannot call onOpen because no callback was set'\n    );\n    this.wrappedOnOpen();\n  }\n\n  callOnClose(err?: FirestoreError): void {\n    debugAssert(\n      this.wrappedOnClose !== undefined,\n      'Cannot call onClose because no callback was set'\n    );\n    this.wrappedOnClose(err);\n  }\n\n  callOnMessage(msg: O): void {\n    debugAssert(\n      this.wrappedOnMessage !== undefined,\n      'Cannot call onMessage because no callback was set'\n    );\n    this.wrappedOnMessage(msg);\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  createWebChannelTransport,\n  ErrorCode,\n  EventType,\n  WebChannel,\n  WebChannelError,\n  WebChannelOptions,\n  XhrIo,\n  getStatEventTarget,\n  EventTarget,\n  StatEvent,\n  Event,\n  Stat,\n  FetchXmlHttpFactory\n} from '@firebase/webchannel-wrapper';\n\nimport { Token } from '../../api/credentials';\nimport { ExperimentalLongPollingOptions } from '../../api/long_polling_options';\nimport { DatabaseInfo } from '../../core/database_info';\nimport { Stream } from '../../remote/connection';\nimport { RestConnection } from '../../remote/rest_connection';\nimport {\n  mapCodeFromRpcStatus,\n  mapCodeFromHttpResponseErrorStatus\n} from '../../remote/rpc_error';\nimport { StreamBridge } from '../../remote/stream_bridge';\nimport { fail, hardAssert } from '../../util/assert';\nimport { generateUniqueDebugId } from '../../util/debug_uid';\nimport { Code, FirestoreError } from '../../util/error';\nimport { logDebug, logWarn } from '../../util/log';\nimport { Rejecter, Resolver } from '../../util/promise';\nimport { StringMap } from '../../util/types';\n\nconst LOG_TAG = 'WebChannelConnection';\n\nconst RPC_STREAM_SERVICE = 'google.firestore.v1.Firestore';\n\nconst XHR_TIMEOUT_SECS = 15;\n\nexport class WebChannelConnection extends RestConnection {\n  private readonly forceLongPolling: boolean;\n  private readonly autoDetectLongPolling: boolean;\n  private readonly useFetchStreams: boolean;\n  private readonly longPollingOptions: ExperimentalLongPollingOptions;\n\n  constructor(info: DatabaseInfo) {\n    super(info);\n    this.forceLongPolling = info.forceLongPolling;\n    this.autoDetectLongPolling = info.autoDetectLongPolling;\n    this.useFetchStreams = info.useFetchStreams;\n    this.longPollingOptions = info.longPollingOptions;\n  }\n\n  protected performRPCRequest<Req, Resp>(\n    rpcName: string,\n    url: string,\n    headers: StringMap,\n    body: Req\n  ): Promise<Resp> {\n    const streamId = generateUniqueDebugId();\n    return new Promise((resolve: Resolver<Resp>, reject: Rejecter) => {\n      const xhr = new XhrIo();\n      xhr.setWithCredentials(true);\n      xhr.listenOnce(EventType.COMPLETE, () => {\n        try {\n          switch (xhr.getLastErrorCode()) {\n            case ErrorCode.NO_ERROR:\n              const json = xhr.getResponseJson() as Resp;\n              logDebug(\n                LOG_TAG,\n                `XHR for RPC '${rpcName}' ${streamId} received:`,\n                JSON.stringify(json)\n              );\n              resolve(json);\n              break;\n            case ErrorCode.TIMEOUT:\n              logDebug(LOG_TAG, `RPC '${rpcName}' ${streamId} timed out`);\n              reject(\n                new FirestoreError(Code.DEADLINE_EXCEEDED, 'Request time out')\n              );\n              break;\n            case ErrorCode.HTTP_ERROR:\n              const status = xhr.getStatus();\n              logDebug(\n                LOG_TAG,\n                `RPC '${rpcName}' ${streamId} failed with status:`,\n                status,\n                'response text:',\n                xhr.getResponseText()\n              );\n              if (status > 0) {\n                let response = xhr.getResponseJson();\n                if (Array.isArray(response)) {\n                  response = response[0];\n                }\n                const responseError = (response as WebChannelError)?.error;\n                if (\n                  !!responseError &&\n                  !!responseError.status &&\n                  !!responseError.message\n                ) {\n                  const firestoreErrorCode = mapCodeFromHttpResponseErrorStatus(\n                    responseError.status\n                  );\n                  reject(\n                    new FirestoreError(\n                      firestoreErrorCode,\n                      responseError.message\n                    )\n                  );\n                } else {\n                  reject(\n                    new FirestoreError(\n                      Code.UNKNOWN,\n                      'Server responded with status ' + xhr.getStatus()\n                    )\n                  );\n                }\n              } else {\n                // If we received an HTTP_ERROR but there's no status code,\n                // it's most probably a connection issue\n                reject(\n                  new FirestoreError(Code.UNAVAILABLE, 'Connection failed.')\n                );\n              }\n              break;\n            default:\n              fail(\n                `RPC '${rpcName}' ${streamId} ` +\n                  'failed with unanticipated webchannel error: ' +\n                  xhr.getLastErrorCode() +\n                  ': ' +\n                  xhr.getLastError() +\n                  ', giving up.'\n              );\n          }\n        } finally {\n          logDebug(LOG_TAG, `RPC '${rpcName}' ${streamId} completed.`);\n        }\n      });\n\n      const requestString = JSON.stringify(body);\n      logDebug(LOG_TAG, `RPC '${rpcName}' ${streamId} sending request:`, body);\n      xhr.send(url, 'POST', requestString, headers, XHR_TIMEOUT_SECS);\n    });\n  }\n\n  openStream<Req, Resp>(\n    rpcName: string,\n    authToken: Token | null,\n    appCheckToken: Token | null\n  ): Stream<Req, Resp> {\n    const streamId = generateUniqueDebugId();\n    const urlParts = [\n      this.baseUrl,\n      '/',\n      RPC_STREAM_SERVICE,\n      '/',\n      rpcName,\n      '/channel'\n    ];\n    const webchannelTransport = createWebChannelTransport();\n    const requestStats = getStatEventTarget();\n    const request: WebChannelOptions = {\n      // Required for backend stickiness, routing behavior is based on this\n      // parameter.\n      httpSessionIdParam: 'gsessionid',\n      initMessageHeaders: {},\n      messageUrlParams: {\n        // This param is used to improve routing and project isolation by the\n        // backend and must be included in every request.\n        database: `projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`\n      },\n      sendRawJson: true,\n      supportsCrossDomainXhr: true,\n      internalChannelParams: {\n        // Override the default timeout (randomized between 10-20 seconds) since\n        // a large write batch on a slow internet connection may take a long\n        // time to send to the backend. Rather than have WebChannel impose a\n        // tight timeout which could lead to infinite timeouts and retries, we\n        // set it very large (5-10 minutes) and rely on the browser's builtin\n        // timeouts to kick in if the request isn't working.\n        forwardChannelRequestTimeoutMs: 10 * 60 * 1000\n      },\n      forceLongPolling: this.forceLongPolling,\n      detectBufferingProxy: this.autoDetectLongPolling\n    };\n\n    const longPollingTimeoutSeconds = this.longPollingOptions.timeoutSeconds;\n    if (longPollingTimeoutSeconds !== undefined) {\n      request.longPollingTimeout = Math.round(longPollingTimeoutSeconds * 1000);\n    }\n\n    if (this.useFetchStreams) {\n      request.xmlHttpFactory = new FetchXmlHttpFactory({});\n    }\n\n    this.modifyHeadersForRequest(\n      request.initMessageHeaders!,\n      authToken,\n      appCheckToken\n    );\n\n    // Sending the custom headers we just added to request.initMessageHeaders\n    // (Authorization, etc.) will trigger the browser to make a CORS preflight\n    // request because the XHR will no longer meet the criteria for a \"simple\"\n    // CORS request:\n    // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests\n    //\n    // Therefore to avoid the CORS preflight request (an extra network\n    // roundtrip), we use the encodeInitMessageHeaders option to specify that\n    // the headers should instead be encoded in the request's POST payload,\n    // which is recognized by the webchannel backend.\n    request.encodeInitMessageHeaders = true;\n\n    const url = urlParts.join('');\n    logDebug(\n      LOG_TAG,\n      `Creating RPC '${rpcName}' stream ${streamId}: ${url}`,\n      request\n    );\n    const channel = webchannelTransport.createWebChannel(url, request);\n\n    // WebChannel supports sending the first message with the handshake - saving\n    // a network round trip. However, it will have to call send in the same\n    // JS event loop as open. In order to enforce this, we delay actually\n    // opening the WebChannel until send is called. Whether we have called\n    // open is tracked with this variable.\n    let opened = false;\n\n    // A flag to determine whether the stream was closed (by us or through an\n    // error/close event) to avoid delivering multiple close events or sending\n    // on a closed stream\n    let closed = false;\n\n    const streamBridge = new StreamBridge<Req, Resp>({\n      sendFn: (msg: Req) => {\n        if (!closed) {\n          if (!opened) {\n            logDebug(\n              LOG_TAG,\n              `Opening RPC '${rpcName}' stream ${streamId} transport.`\n            );\n            channel.open();\n            opened = true;\n          }\n          logDebug(\n            LOG_TAG,\n            `RPC '${rpcName}' stream ${streamId} sending:`,\n            msg\n          );\n          channel.send(msg);\n        } else {\n          logDebug(\n            LOG_TAG,\n            `Not sending because RPC '${rpcName}' stream ${streamId} ` +\n              'is closed:',\n            msg\n          );\n        }\n      },\n      closeFn: () => channel.close()\n    });\n\n    // Closure events are guarded and exceptions are swallowed, so catch any\n    // exception and rethrow using a setTimeout so they become visible again.\n    // Note that eventually this function could go away if we are confident\n    // enough the code is exception free.\n    const unguardedEventListen = <T>(\n      target: EventTarget,\n      type: string | number,\n      fn: (param: T) => void\n    ): void => {\n      // TODO(dimond): closure typing seems broken because WebChannel does\n      // not implement goog.events.Listenable\n      target.listen(type, (param: unknown) => {\n        try {\n          fn(param as T);\n        } catch (e) {\n          setTimeout(() => {\n            throw e;\n          }, 0);\n        }\n      });\n    };\n\n    unguardedEventListen(channel, WebChannel.EventType.OPEN, () => {\n      if (!closed) {\n        logDebug(\n          LOG_TAG,\n          `RPC '${rpcName}' stream ${streamId} transport opened.`\n        );\n        streamBridge.callOnConnected();\n      }\n    });\n\n    unguardedEventListen(channel, WebChannel.EventType.CLOSE, () => {\n      if (!closed) {\n        closed = true;\n        logDebug(\n          LOG_TAG,\n          `RPC '${rpcName}' stream ${streamId} transport closed`\n        );\n        streamBridge.callOnClose();\n      }\n    });\n\n    unguardedEventListen<Error>(channel, WebChannel.EventType.ERROR, err => {\n      if (!closed) {\n        closed = true;\n        logWarn(\n          LOG_TAG,\n          `RPC '${rpcName}' stream ${streamId} transport errored:`,\n          err\n        );\n        streamBridge.callOnClose(\n          new FirestoreError(\n            Code.UNAVAILABLE,\n            'The operation could not be completed'\n          )\n        );\n      }\n    });\n\n    // WebChannel delivers message events as array. If batching is not enabled\n    // (it's off by default) each message will be delivered alone, resulting in\n    // a single element array.\n    interface WebChannelResponse {\n      data: Resp[];\n    }\n\n    unguardedEventListen<WebChannelResponse>(\n      channel,\n      WebChannel.EventType.MESSAGE,\n      msg => {\n        if (!closed) {\n          const msgData = msg.data[0];\n          hardAssert(!!msgData, 'Got a webchannel message without data.');\n          // TODO(b/35143891): There is a bug in One Platform that caused errors\n          // (and only errors) to be wrapped in an extra array. To be forward\n          // compatible with the bug we need to check either condition. The latter\n          // can be removed once the fix has been rolled out.\n          // Use any because msgData.error is not typed.\n          const msgDataOrError: WebChannelError | object = msgData;\n          const error =\n            msgDataOrError.error ||\n            (msgDataOrError as WebChannelError[])[0]?.error;\n          if (error) {\n            logDebug(\n              LOG_TAG,\n              `RPC '${rpcName}' stream ${streamId} received error:`,\n              error\n            );\n            // error.status will be a string like 'OK' or 'NOT_FOUND'.\n            const status: string = error.status;\n            let code = mapCodeFromRpcStatus(status);\n            let message = error.message;\n            if (code === undefined) {\n              code = Code.INTERNAL;\n              message =\n                'Unknown error status: ' +\n                status +\n                ' with message ' +\n                error.message;\n            }\n            // Mark closed so no further events are propagated\n            closed = true;\n            streamBridge.callOnClose(new FirestoreError(code, message));\n            channel.close();\n          } else {\n            logDebug(\n              LOG_TAG,\n              `RPC '${rpcName}' stream ${streamId} received:`,\n              msgData\n            );\n            streamBridge.callOnMessage(msgData);\n          }\n        }\n      }\n    );\n\n    unguardedEventListen<StatEvent>(requestStats, Event.STAT_EVENT, event => {\n      if (event.stat === Stat.PROXY) {\n        logDebug(\n          LOG_TAG,\n          `RPC '${rpcName}' stream ${streamId} detected buffering proxy`\n        );\n      } else if (event.stat === Stat.NOPROXY) {\n        logDebug(\n          LOG_TAG,\n          `RPC '${rpcName}' stream ${streamId} detected no buffering proxy`\n        );\n      }\n    });\n\n    setTimeout(() => {\n      // Technically we could/should wait for the WebChannel opened event,\n      // but because we want to send the first message with the WebChannel\n      // handshake we pretend the channel opened here (asynchronously), and\n      // then delay the actual open until the first message is sent.\n      streamBridge.callOnOpen();\n    }, 0);\n    return streamBridge;\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** The Platform's 'window' implementation or null if not available. */\nexport function getWindow(): Window | null {\n  // `window` is not always available, e.g. in ReactNative and WebWorkers.\n  // eslint-disable-next-line no-restricted-globals\n  return typeof window !== 'undefined' ? window : null;\n}\n\n/** The Platform's 'document' implementation or null if not available. */\nexport function getDocument(): Document | null {\n  // `document` is not always available, e.g. in ReactNative and WebWorkers.\n  // eslint-disable-next-line no-restricted-globals\n  return typeof document !== 'undefined' ? document : null;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** Return the Platform-specific serializer monitor. */\nimport { DatabaseId } from '../../core/database_info';\nimport { JsonProtoSerializer } from '../../remote/serializer';\n\nexport function newSerializer(databaseId: DatabaseId): JsonProtoSerializer {\n  return new JsonProtoSerializer(databaseId, /* useProto3Json= */ true);\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AsyncQueue, DelayedOperation, TimerId } from '../util/async_queue';\nimport { logDebug } from '../util/log';\n\nconst LOG_TAG = 'ExponentialBackoff';\n\n/**\n * Initial backoff time in milliseconds after an error.\n * Set to 1s according to https://cloud.google.com/apis/design/errors.\n */\nconst DEFAULT_BACKOFF_INITIAL_DELAY_MS = 1000;\n\nconst DEFAULT_BACKOFF_FACTOR = 1.5;\n\n/** Maximum backoff time in milliseconds */\nconst DEFAULT_BACKOFF_MAX_DELAY_MS = 60 * 1000;\n\n/**\n * A helper for running delayed tasks following an exponential backoff curve\n * between attempts.\n *\n * Each delay is made up of a \"base\" delay which follows the exponential\n * backoff curve, and a +/- 50% \"jitter\" that is calculated and added to the\n * base delay. This prevents clients from accidentally synchronizing their\n * delays causing spikes of load to the backend.\n */\nexport class ExponentialBackoff {\n  private currentBaseMs: number = 0;\n  private timerPromise: DelayedOperation<void> | null = null;\n  /** The last backoff attempt, as epoch milliseconds. */\n  private lastAttemptTime = Date.now();\n\n  constructor(\n    /**\n     * The AsyncQueue to run backoff operations on.\n     */\n    private readonly queue: AsyncQueue,\n    /**\n     * The ID to use when scheduling backoff operations on the AsyncQueue.\n     */\n    private readonly timerId: TimerId,\n    /**\n     * The initial delay (used as the base delay on the first retry attempt).\n     * Note that jitter will still be applied, so the actual delay could be as\n     * little as 0.5*initialDelayMs.\n     */\n    private readonly initialDelayMs: number = DEFAULT_BACKOFF_INITIAL_DELAY_MS,\n    /**\n     * The multiplier to use to determine the extended base delay after each\n     * attempt.\n     */\n    private readonly backoffFactor: number = DEFAULT_BACKOFF_FACTOR,\n    /**\n     * The maximum base delay after which no further backoff is performed.\n     * Note that jitter will still be applied, so the actual delay could be as\n     * much as 1.5*maxDelayMs.\n     */\n    private readonly maxDelayMs: number = DEFAULT_BACKOFF_MAX_DELAY_MS\n  ) {\n    this.reset();\n  }\n\n  /**\n   * Resets the backoff delay.\n   *\n   * The very next backoffAndWait() will have no delay. If it is called again\n   * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and\n   * subsequent ones will increase according to the backoffFactor.\n   */\n  reset(): void {\n    this.currentBaseMs = 0;\n  }\n\n  /**\n   * Resets the backoff delay to the maximum delay (e.g. for use after a\n   * RESOURCE_EXHAUSTED error).\n   */\n  resetToMax(): void {\n    this.currentBaseMs = this.maxDelayMs;\n  }\n\n  /**\n   * Returns a promise that resolves after currentDelayMs, and increases the\n   * delay for any subsequent attempts. If there was a pending backoff operation\n   * already, it will be canceled.\n   */\n  backoffAndRun(op: () => Promise<void>): void {\n    // Cancel any pending backoff operation.\n    this.cancel();\n\n    // First schedule using the current base (which may be 0 and should be\n    // honored as such).\n    const desiredDelayWithJitterMs = Math.floor(\n      this.currentBaseMs + this.jitterDelayMs()\n    );\n\n    // Guard against lastAttemptTime being in the future due to a clock change.\n    const delaySoFarMs = Math.max(0, Date.now() - this.lastAttemptTime);\n\n    // Guard against the backoff delay already being past.\n    const remainingDelayMs = Math.max(\n      0,\n      desiredDelayWithJitterMs - delaySoFarMs\n    );\n\n    if (remainingDelayMs > 0) {\n      logDebug(\n        LOG_TAG,\n        `Backing off for ${remainingDelayMs} ms ` +\n          `(base delay: ${this.currentBaseMs} ms, ` +\n          `delay with jitter: ${desiredDelayWithJitterMs} ms, ` +\n          `last attempt: ${delaySoFarMs} ms ago)`\n      );\n    }\n\n    this.timerPromise = this.queue.enqueueAfterDelay(\n      this.timerId,\n      remainingDelayMs,\n      () => {\n        this.lastAttemptTime = Date.now();\n        return op();\n      }\n    );\n\n    // Apply backoff factor to determine next delay and ensure it is within\n    // bounds.\n    this.currentBaseMs *= this.backoffFactor;\n    if (this.currentBaseMs < this.initialDelayMs) {\n      this.currentBaseMs = this.initialDelayMs;\n    }\n    if (this.currentBaseMs > this.maxDelayMs) {\n      this.currentBaseMs = this.maxDelayMs;\n    }\n  }\n\n  skipBackoff(): void {\n    if (this.timerPromise !== null) {\n      this.timerPromise.skipDelay();\n      this.timerPromise = null;\n    }\n  }\n\n  cancel(): void {\n    if (this.timerPromise !== null) {\n      this.timerPromise.cancel();\n      this.timerPromise = null;\n    }\n  }\n\n  /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */\n  private jitterDelayMs(): number {\n    return (Math.random() - 0.5) * this.currentBaseMs;\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CredentialsProvider, Token } from '../api/credentials';\nimport { User } from '../auth/user';\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport { TargetId } from '../core/types';\nimport { TargetData } from '../local/target_data';\nimport { Mutation, MutationResult } from '../model/mutation';\nimport {\n  ListenRequest as ProtoListenRequest,\n  ListenResponse as ProtoListenResponse,\n  WriteRequest as ProtoWriteRequest,\n  WriteResponse as ProtoWriteResponse\n} from '../protos/firestore_proto_api';\nimport { debugAssert, hardAssert } from '../util/assert';\nimport { AsyncQueue, DelayedOperation, TimerId } from '../util/async_queue';\nimport { Code, FirestoreError } from '../util/error';\nimport { logDebug, logError } from '../util/log';\nimport { isNullOrUndefined } from '../util/types';\n\nimport { ExponentialBackoff } from './backoff';\nimport { Connection, Stream } from './connection';\nimport {\n  fromVersion,\n  fromWatchChange,\n  fromWriteResults,\n  getEncodedDatabaseId,\n  JsonProtoSerializer,\n  toListenRequestLabels,\n  toMutation,\n  toTarget,\n  versionFromListenResponse\n} from './serializer';\nimport { WatchChange } from './watch_change';\n\nconst LOG_TAG = 'PersistentStream';\n\n// The generated proto interfaces for these class are missing the database\n// field. So we add it here.\n// TODO(b/36015800): Remove this once the api generator is fixed.\ninterface ListenRequest extends ProtoListenRequest {\n  database?: string;\n}\nexport interface WriteRequest extends ProtoWriteRequest {\n  database?: string;\n}\n/**\n * PersistentStream can be in one of 5 states (each described in detail below)\n * based on the following state transition diagram:\n *\n *          start() called             auth & connection succeeded\n * INITIAL ----------------> STARTING -----------------------------> OPEN\n *                             ^  |                                   |\n *                             |  |                    error occurred |\n *                             |  \\-----------------------------v-----/\n *                             |                                |\n *                    backoff  |                                |\n *                    elapsed  |              start() called    |\n *                             \\--- BACKOFF <---------------- ERROR\n *\n * [any state] --------------------------> INITIAL\n *               stop() called or\n *               idle timer expired\n */\nconst enum PersistentStreamState {\n  /**\n   * The streaming RPC is not yet running and there's no error condition.\n   * Calling start() will start the stream immediately without backoff.\n   * While in this state isStarted() will return false.\n   */\n  Initial,\n\n  /**\n   * The stream is starting, either waiting for an auth token or for the stream\n   * to successfully open. While in this state, isStarted() will return true but\n   * isOpen() will return false.\n   */\n  Starting,\n\n  /**\n   * The streaming RPC is up and running. Requests and responses can flow\n   * freely. Both isStarted() and isOpen() will return true.\n   */\n  Open,\n\n  /**\n   * The stream is healthy and has been connected for more than 10 seconds. We\n   * therefore assume that the credentials we passed were valid. Both\n   * isStarted() and isOpen() will return true.\n   */\n  Healthy,\n\n  /**\n   * The stream encountered an error. The next start attempt will back off.\n   * While in this state isStarted() will return false.\n   */\n  Error,\n\n  /**\n   * An in-between state after an error where the stream is waiting before\n   * re-starting. After waiting is complete, the stream will try to open.\n   * While in this state isStarted() will return true but isOpen() will return\n   * false.\n   */\n  Backoff\n}\n\n/**\n * Provides a common interface that is shared by the listeners for stream\n * events by the concrete implementation classes.\n */\nexport interface PersistentStreamListener {\n  /**\n   * Called after receiving an acknowledgement from the server, confirming that\n   * we are able to connect to it.\n   */\n  onConnected: () => Promise<void>;\n  /**\n   * Called after the stream was established and can accept outgoing\n   * messages\n   */\n  onOpen: () => Promise<void>;\n  /**\n   * Called after the stream has closed. If there was an error, the\n   * FirestoreError will be set.\n   */\n  onClose: (err?: FirestoreError) => Promise<void>;\n}\n\n/** The time a stream stays open after it is marked idle. */\nconst IDLE_TIMEOUT_MS = 60 * 1000;\n\n/** The time a stream stays open until we consider it healthy. */\nconst HEALTHY_TIMEOUT_MS = 10 * 1000;\n\n/**\n * A PersistentStream is an abstract base class that represents a streaming RPC\n * to the Firestore backend. It's built on top of the connections own support\n * for streaming RPCs, and adds several critical features for our clients:\n *\n *   - Exponential backoff on failure\n *   - Authentication via CredentialsProvider\n *   - Dispatching all callbacks into the shared worker queue\n *   - Closing idle streams after 60 seconds of inactivity\n *\n * Subclasses of PersistentStream implement serialization of models to and\n * from the JSON representation of the protocol buffers for a specific\n * streaming RPC.\n *\n * ## Starting and Stopping\n *\n * Streaming RPCs are stateful and need to be start()ed before messages can\n * be sent and received. The PersistentStream will call the onOpen() function\n * of the listener once the stream is ready to accept requests.\n *\n * Should a start() fail, PersistentStream will call the registered onClose()\n * listener with a FirestoreError indicating what went wrong.\n *\n * A PersistentStream can be started and stopped repeatedly.\n *\n * Generic types:\n *  SendType: The type of the outgoing message of the underlying\n *    connection stream\n *  ReceiveType: The type of the incoming message of the underlying\n *    connection stream\n *  ListenerType: The type of the listener that will be used for callbacks\n */\nexport abstract class PersistentStream<\n  SendType,\n  ReceiveType,\n  ListenerType extends PersistentStreamListener\n> {\n  private state = PersistentStreamState.Initial;\n  /**\n   * A close count that's incremented every time the stream is closed; used by\n   * getCloseGuardedDispatcher() to invalidate callbacks that happen after\n   * close.\n   */\n  private closeCount = 0;\n\n  private idleTimer: DelayedOperation<void> | null = null;\n  private healthCheck: DelayedOperation<void> | null = null;\n  private stream: Stream<SendType, ReceiveType> | null = null;\n\n  protected backoff: ExponentialBackoff;\n\n  constructor(\n    private queue: AsyncQueue,\n    connectionTimerId: TimerId,\n    private idleTimerId: TimerId,\n    private healthTimerId: TimerId,\n    protected connection: Connection,\n    private authCredentialsProvider: CredentialsProvider<User>,\n    private appCheckCredentialsProvider: CredentialsProvider<string>,\n    protected listener: ListenerType\n  ) {\n    this.backoff = new ExponentialBackoff(queue, connectionTimerId);\n  }\n\n  /**\n   * Returns true if start() has been called and no error has occurred. True\n   * indicates the stream is open or in the process of opening (which\n   * encompasses respecting backoff, getting auth tokens, and starting the\n   * actual RPC). Use isOpen() to determine if the stream is open and ready for\n   * outbound requests.\n   */\n  isStarted(): boolean {\n    return (\n      this.state === PersistentStreamState.Starting ||\n      this.state === PersistentStreamState.Backoff ||\n      this.isOpen()\n    );\n  }\n\n  /**\n   * Returns true if the underlying RPC is open (the onOpen() listener has been\n   * called) and the stream is ready for outbound requests.\n   */\n  isOpen(): boolean {\n    return (\n      this.state === PersistentStreamState.Open ||\n      this.state === PersistentStreamState.Healthy\n    );\n  }\n\n  /**\n   * Starts the RPC. Only allowed if isStarted() returns false. The stream is\n   * not immediately ready for use: onOpen() will be invoked when the RPC is\n   * ready for outbound requests, at which point isOpen() will return true.\n   *\n   * When start returns, isStarted() will return true.\n   */\n  start(): void {\n    if (this.state === PersistentStreamState.Error) {\n      this.performBackoff();\n      return;\n    }\n\n    debugAssert(\n      this.state === PersistentStreamState.Initial,\n      'Already started'\n    );\n    this.auth();\n  }\n\n  /**\n   * Stops the RPC. This call is idempotent and allowed regardless of the\n   * current isStarted() state.\n   *\n   * When stop returns, isStarted() and isOpen() will both return false.\n   */\n  async stop(): Promise<void> {\n    if (this.isStarted()) {\n      await this.close(PersistentStreamState.Initial);\n    }\n  }\n\n  /**\n   * After an error the stream will usually back off on the next attempt to\n   * start it. If the error warrants an immediate restart of the stream, the\n   * sender can use this to indicate that the receiver should not back off.\n   *\n   * Each error will call the onClose() listener. That function can decide to\n   * inhibit backoff if required.\n   */\n  inhibitBackoff(): void {\n    debugAssert(\n      !this.isStarted(),\n      'Can only inhibit backoff in a stopped state'\n    );\n\n    this.state = PersistentStreamState.Initial;\n    this.backoff.reset();\n  }\n\n  /**\n   * Marks this stream as idle. If no further actions are performed on the\n   * stream for one minute, the stream will automatically close itself and\n   * notify the stream's onClose() handler with Status.OK. The stream will then\n   * be in a !isStarted() state, requiring the caller to start the stream again\n   * before further use.\n   *\n   * Only streams that are in state 'Open' can be marked idle, as all other\n   * states imply pending network operations.\n   */\n  markIdle(): void {\n    // Starts the idle time if we are in state 'Open' and are not yet already\n    // running a timer (in which case the previous idle timeout still applies).\n    if (this.isOpen() && this.idleTimer === null) {\n      this.idleTimer = this.queue.enqueueAfterDelay(\n        this.idleTimerId,\n        IDLE_TIMEOUT_MS,\n        () => this.handleIdleCloseTimer()\n      );\n    }\n  }\n\n  /** Sends a message to the underlying stream. */\n  protected sendRequest(msg: SendType): void {\n    this.cancelIdleCheck();\n    this.stream!.send(msg);\n  }\n\n  /** Called by the idle timer when the stream should close due to inactivity. */\n  private async handleIdleCloseTimer(): Promise<void> {\n    if (this.isOpen()) {\n      // When timing out an idle stream there's no reason to force the stream into backoff when\n      // it restarts so set the stream state to Initial instead of Error.\n      return this.close(PersistentStreamState.Initial);\n    }\n  }\n\n  /** Marks the stream as active again. */\n  private cancelIdleCheck(): void {\n    if (this.idleTimer) {\n      this.idleTimer.cancel();\n      this.idleTimer = null;\n    }\n  }\n\n  /** Cancels the health check delayed operation. */\n  private cancelHealthCheck(): void {\n    if (this.healthCheck) {\n      this.healthCheck.cancel();\n      this.healthCheck = null;\n    }\n  }\n\n  /**\n   * Closes the stream and cleans up as necessary:\n   *\n   * * closes the underlying GRPC stream;\n   * * calls the onClose handler with the given 'error';\n   * * sets internal stream state to 'finalState';\n   * * adjusts the backoff timer based on the error\n   *\n   * A new stream can be opened by calling start().\n   *\n   * @param finalState - the intended state of the stream after closing.\n   * @param error - the error the connection was closed with.\n   */\n  private async close(\n    finalState: PersistentStreamState,\n    error?: FirestoreError\n  ): Promise<void> {\n    debugAssert(this.isStarted(), 'Only started streams should be closed.');\n    debugAssert(\n      finalState === PersistentStreamState.Error || isNullOrUndefined(error),\n      \"Can't provide an error when not in an error state.\"\n    );\n\n    // Cancel any outstanding timers (they're guaranteed not to execute).\n    this.cancelIdleCheck();\n    this.cancelHealthCheck();\n    this.backoff.cancel();\n\n    // Invalidates any stream-related callbacks (e.g. from auth or the\n    // underlying stream), guaranteeing they won't execute.\n    this.closeCount++;\n\n    if (finalState !== PersistentStreamState.Error) {\n      // If this is an intentional close ensure we don't delay our next connection attempt.\n      this.backoff.reset();\n    } else if (error && error.code === Code.RESOURCE_EXHAUSTED) {\n      // Log the error. (Probably either 'quota exceeded' or 'max queue length reached'.)\n      logError(error.toString());\n      logError(\n        'Using maximum backoff delay to prevent overloading the backend.'\n      );\n      this.backoff.resetToMax();\n    } else if (\n      error &&\n      error.code === Code.UNAUTHENTICATED &&\n      this.state !== PersistentStreamState.Healthy\n    ) {\n      // \"unauthenticated\" error means the token was rejected. This should rarely\n      // happen since both Auth and AppCheck ensure a sufficient TTL when we\n      // request a token. If a user manually resets their system clock this can\n      // fail, however. In this case, we should get a Code.UNAUTHENTICATED error\n      // before we received the first message and we need to invalidate the token\n      // to ensure that we fetch a new token.\n      this.authCredentialsProvider.invalidateToken();\n      this.appCheckCredentialsProvider.invalidateToken();\n    }\n\n    // Clean up the underlying stream because we are no longer interested in events.\n    if (this.stream !== null) {\n      this.tearDown();\n      this.stream.close();\n      this.stream = null;\n    }\n\n    // This state must be assigned before calling onClose() to allow the callback to\n    // inhibit backoff or otherwise manipulate the state in its non-started state.\n    this.state = finalState;\n\n    // Notify the listener that the stream closed.\n    await this.listener.onClose(error);\n  }\n\n  /**\n   * Can be overridden to perform additional cleanup before the stream is closed.\n   * Calling super.tearDown() is not required.\n   */\n  protected tearDown(): void {}\n\n  /**\n   * Used by subclasses to start the concrete RPC and return the underlying\n   * connection stream.\n   */\n  protected abstract startRpc(\n    authToken: Token | null,\n    appCheckToken: Token | null\n  ): Stream<SendType, ReceiveType>;\n\n  /**\n   * Called after the stream has received a message. The function will be\n   * called on the right queue and must return a Promise.\n   * @param message - The message received from the stream.\n   */\n  protected abstract onMessage(message: ReceiveType): Promise<void>;\n\n  private auth(): void {\n    debugAssert(\n      this.state === PersistentStreamState.Initial,\n      'Must be in initial state to auth'\n    );\n\n    this.state = PersistentStreamState.Starting;\n\n    const dispatchIfNotClosed = this.getCloseGuardedDispatcher(this.closeCount);\n\n    // TODO(mikelehen): Just use dispatchIfNotClosed, but see TODO below.\n    const closeCount = this.closeCount;\n\n    Promise.all([\n      this.authCredentialsProvider.getToken(),\n      this.appCheckCredentialsProvider.getToken()\n    ]).then(\n      ([authToken, appCheckToken]) => {\n        // Stream can be stopped while waiting for authentication.\n        // TODO(mikelehen): We really should just use dispatchIfNotClosed\n        // and let this dispatch onto the queue, but that opened a spec test can\n        // of worms that I don't want to deal with in this PR.\n        if (this.closeCount === closeCount) {\n          // Normally we'd have to schedule the callback on the AsyncQueue.\n          // However, the following calls are safe to be called outside the\n          // AsyncQueue since they don't chain asynchronous calls\n          this.startStream(authToken, appCheckToken);\n        }\n      },\n      (error: Error) => {\n        dispatchIfNotClosed(() => {\n          const rpcError = new FirestoreError(\n            Code.UNKNOWN,\n            'Fetching auth token failed: ' + error.message\n          );\n          return this.handleStreamClose(rpcError);\n        });\n      }\n    );\n  }\n\n  private startStream(\n    authToken: Token | null,\n    appCheckToken: Token | null\n  ): void {\n    debugAssert(\n      this.state === PersistentStreamState.Starting,\n      'Trying to start stream in a non-starting state'\n    );\n\n    const dispatchIfNotClosed = this.getCloseGuardedDispatcher(this.closeCount);\n\n    this.stream = this.startRpc(authToken, appCheckToken);\n    this.stream.onConnected(() => {\n      dispatchIfNotClosed(() => this.listener!.onConnected());\n    });\n    this.stream.onOpen(() => {\n      dispatchIfNotClosed(() => {\n        debugAssert(\n          this.state === PersistentStreamState.Starting,\n          'Expected stream to be in state Starting, but was ' + this.state\n        );\n        this.state = PersistentStreamState.Open;\n        debugAssert(\n          this.healthCheck === null,\n          'Expected healthCheck to be null'\n        );\n        this.healthCheck = this.queue.enqueueAfterDelay(\n          this.healthTimerId,\n          HEALTHY_TIMEOUT_MS,\n          () => {\n            if (this.isOpen()) {\n              this.state = PersistentStreamState.Healthy;\n            }\n            return Promise.resolve();\n          }\n        );\n        return this.listener!.onOpen();\n      });\n    });\n    this.stream.onClose((error?: FirestoreError) => {\n      dispatchIfNotClosed(() => {\n        return this.handleStreamClose(error);\n      });\n    });\n    this.stream.onMessage((msg: ReceiveType) => {\n      dispatchIfNotClosed(() => {\n        return this.onMessage(msg);\n      });\n    });\n  }\n\n  private performBackoff(): void {\n    debugAssert(\n      this.state === PersistentStreamState.Error,\n      'Should only perform backoff when in Error state'\n    );\n    this.state = PersistentStreamState.Backoff;\n\n    this.backoff.backoffAndRun(async () => {\n      debugAssert(\n        this.state === PersistentStreamState.Backoff,\n        'Backoff elapsed but state is now: ' + this.state\n      );\n\n      this.state = PersistentStreamState.Initial;\n      this.start();\n      debugAssert(this.isStarted(), 'PersistentStream should have started');\n    });\n  }\n\n  // Visible for tests\n  handleStreamClose(error?: FirestoreError): Promise<void> {\n    debugAssert(\n      this.isStarted(),\n      \"Can't handle server close on non-started stream\"\n    );\n    logDebug(LOG_TAG, `close with error: ${error}`);\n\n    this.stream = null;\n\n    // In theory the stream could close cleanly, however, in our current model\n    // we never expect this to happen because if we stop a stream ourselves,\n    // this callback will never be called. To prevent cases where we retry\n    // without a backoff accidentally, we set the stream to error in all cases.\n    return this.close(PersistentStreamState.Error, error);\n  }\n\n  /**\n   * Returns a \"dispatcher\" function that dispatches operations onto the\n   * AsyncQueue but only runs them if closeCount remains unchanged. This allows\n   * us to turn auth / stream callbacks into no-ops if the stream is closed /\n   * re-opened, etc.\n   */\n  private getCloseGuardedDispatcher(\n    startCloseCount: number\n  ): (fn: () => Promise<void>) => void {\n    return (fn: () => Promise<void>): void => {\n      this.queue.enqueueAndForget(() => {\n        if (this.closeCount === startCloseCount) {\n          return fn();\n        } else {\n          logDebug(\n            LOG_TAG,\n            'stream callback skipped by getCloseGuardedDispatcher.'\n          );\n          return Promise.resolve();\n        }\n      });\n    };\n  }\n}\n\n/** Listener for the PersistentWatchStream */\nexport interface WatchStreamListener extends PersistentStreamListener {\n  /**\n   * Called on a watchChange. The snapshot parameter will be MIN if the watch\n   * change did not have a snapshot associated with it.\n   */\n  onWatchChange: (\n    watchChange: WatchChange,\n    snapshot: SnapshotVersion\n  ) => Promise<void>;\n}\n\n/**\n * A PersistentStream that implements the Listen RPC.\n *\n * Once the Listen stream has called the onOpen() listener, any number of\n * listen() and unlisten() calls can be made to control what changes will be\n * sent from the server for ListenResponses.\n */\nexport class PersistentListenStream extends PersistentStream<\n  ProtoListenRequest,\n  ProtoListenResponse,\n  WatchStreamListener\n> {\n  constructor(\n    queue: AsyncQueue,\n    connection: Connection,\n    authCredentials: CredentialsProvider<User>,\n    appCheckCredentials: CredentialsProvider<string>,\n    private serializer: JsonProtoSerializer,\n    listener: WatchStreamListener\n  ) {\n    super(\n      queue,\n      TimerId.ListenStreamConnectionBackoff,\n      TimerId.ListenStreamIdle,\n      TimerId.HealthCheckTimeout,\n      connection,\n      authCredentials,\n      appCheckCredentials,\n      listener\n    );\n  }\n\n  protected startRpc(\n    authToken: Token | null,\n    appCheckToken: Token | null\n  ): Stream<ProtoListenRequest, ProtoListenResponse> {\n    return this.connection.openStream<ProtoListenRequest, ProtoListenResponse>(\n      'Listen',\n      authToken,\n      appCheckToken\n    );\n  }\n\n  protected onMessage(watchChangeProto: ProtoListenResponse): Promise<void> {\n    // A successful response means the stream is healthy\n    this.backoff.reset();\n\n    const watchChange = fromWatchChange(this.serializer, watchChangeProto);\n    const snapshot = versionFromListenResponse(watchChangeProto);\n    return this.listener!.onWatchChange(watchChange, snapshot);\n  }\n\n  /**\n   * Registers interest in the results of the given target. If the target\n   * includes a resumeToken it will be included in the request. Results that\n   * affect the target will be streamed back as WatchChange messages that\n   * reference the targetId.\n   */\n  watch(targetData: TargetData): void {\n    const request: ListenRequest = {};\n    request.database = getEncodedDatabaseId(this.serializer);\n    request.addTarget = toTarget(this.serializer, targetData);\n\n    const labels = toListenRequestLabels(this.serializer, targetData);\n    if (labels) {\n      request.labels = labels;\n    }\n\n    this.sendRequest(request);\n  }\n\n  /**\n   * Unregisters interest in the results of the target associated with the\n   * given targetId.\n   */\n  unwatch(targetId: TargetId): void {\n    const request: ListenRequest = {};\n    request.database = getEncodedDatabaseId(this.serializer);\n    request.removeTarget = targetId;\n    this.sendRequest(request);\n  }\n}\n\n/** Listener for the PersistentWriteStream */\nexport interface WriteStreamListener extends PersistentStreamListener {\n  /**\n   * Called by the PersistentWriteStream upon a successful handshake response\n   * from the server, which is the receiver's cue to send any pending writes.\n   */\n  onHandshakeComplete: () => Promise<void>;\n\n  /**\n   * Called by the PersistentWriteStream upon receiving a StreamingWriteResponse\n   * from the server that contains a mutation result.\n   */\n  onMutationResult: (\n    commitVersion: SnapshotVersion,\n    results: MutationResult[]\n  ) => Promise<void>;\n}\n\n/**\n * A Stream that implements the Write RPC.\n *\n * The Write RPC requires the caller to maintain special streamToken\n * state in between calls, to help the server understand which responses the\n * client has processed by the time the next request is made. Every response\n * will contain a streamToken; this value must be passed to the next\n * request.\n *\n * After calling start() on this stream, the next request must be a handshake,\n * containing whatever streamToken is on hand. Once a response to this\n * request is received, all pending mutations may be submitted. When\n * submitting multiple batches of mutations at the same time, it's\n * okay to use the same streamToken for the calls to writeMutations.\n *\n * TODO(b/33271235): Use proto types\n */\nexport class PersistentWriteStream extends PersistentStream<\n  ProtoWriteRequest,\n  ProtoWriteResponse,\n  WriteStreamListener\n> {\n  private handshakeComplete_ = false;\n\n  constructor(\n    queue: AsyncQueue,\n    connection: Connection,\n    authCredentials: CredentialsProvider<User>,\n    appCheckCredentials: CredentialsProvider<string>,\n    private serializer: JsonProtoSerializer,\n    listener: WriteStreamListener\n  ) {\n    super(\n      queue,\n      TimerId.WriteStreamConnectionBackoff,\n      TimerId.WriteStreamIdle,\n      TimerId.HealthCheckTimeout,\n      connection,\n      authCredentials,\n      appCheckCredentials,\n      listener\n    );\n  }\n\n  /**\n   * The last received stream token from the server, used to acknowledge which\n   * responses the client has processed. Stream tokens are opaque checkpoint\n   * markers whose only real value is their inclusion in the next request.\n   *\n   * PersistentWriteStream manages propagating this value from responses to the\n   * next request.\n   */\n  private lastStreamToken: string | Uint8Array | undefined;\n\n  /**\n   * Tracks whether or not a handshake has been successfully exchanged and\n   * the stream is ready to accept mutations.\n   */\n  get handshakeComplete(): boolean {\n    return this.handshakeComplete_;\n  }\n\n  // Override of PersistentStream.start\n  start(): void {\n    this.handshakeComplete_ = false;\n    this.lastStreamToken = undefined;\n    super.start();\n  }\n\n  protected tearDown(): void {\n    if (this.handshakeComplete_) {\n      this.writeMutations([]);\n    }\n  }\n\n  protected startRpc(\n    authToken: Token | null,\n    appCheckToken: Token | null\n  ): Stream<ProtoWriteRequest, ProtoWriteResponse> {\n    return this.connection.openStream<ProtoWriteRequest, ProtoWriteResponse>(\n      'Write',\n      authToken,\n      appCheckToken\n    );\n  }\n\n  protected onMessage(responseProto: ProtoWriteResponse): Promise<void> {\n    // Always capture the last stream token.\n    hardAssert(\n      !!responseProto.streamToken,\n      'Got a write response without a stream token'\n    );\n    this.lastStreamToken = responseProto.streamToken;\n\n    if (!this.handshakeComplete_) {\n      // The first response is always the handshake response\n      hardAssert(\n        !responseProto.writeResults || responseProto.writeResults.length === 0,\n        'Got mutation results for handshake'\n      );\n      this.handshakeComplete_ = true;\n      return this.listener!.onHandshakeComplete();\n    } else {\n      // A successful first write response means the stream is healthy,\n      // Note, that we could consider a successful handshake healthy, however,\n      // the write itself might be causing an error we want to back off from.\n      this.backoff.reset();\n\n      const results = fromWriteResults(\n        responseProto.writeResults,\n        responseProto.commitTime\n      );\n      const commitVersion = fromVersion(responseProto.commitTime!);\n      return this.listener!.onMutationResult(commitVersion, results);\n    }\n  }\n\n  /**\n   * Sends an initial streamToken to the server, performing the handshake\n   * required to make the StreamingWrite RPC work. Subsequent\n   * calls should wait until onHandshakeComplete was called.\n   */\n  writeHandshake(): void {\n    debugAssert(this.isOpen(), 'Writing handshake requires an opened stream');\n    debugAssert(!this.handshakeComplete_, 'Handshake already completed');\n    debugAssert(\n      !this.lastStreamToken,\n      'Stream token should be empty during handshake'\n    );\n    // TODO(dimond): Support stream resumption. We intentionally do not set the\n    // stream token on the handshake, ignoring any stream token we might have.\n    const request: WriteRequest = {};\n    request.database = getEncodedDatabaseId(this.serializer);\n    this.sendRequest(request);\n  }\n\n  /** Sends a group of mutations to the Firestore backend to apply. */\n  writeMutations(mutations: Mutation[]): void {\n    debugAssert(this.isOpen(), 'Writing mutations requires an opened stream');\n    debugAssert(\n      this.handshakeComplete_,\n      'Handshake must be complete before writing mutations'\n    );\n    debugAssert(\n      !!this.lastStreamToken,\n      'Trying to write mutation without a token'\n    );\n\n    const request: WriteRequest = {\n      streamToken: this.lastStreamToken,\n      writes: mutations.map(mutation => toMutation(this.serializer, mutation))\n    };\n\n    this.sendRequest(request);\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CredentialsProvider } from '../api/credentials';\nimport { User } from '../auth/user';\nimport { Aggregate } from '../core/aggregate';\nimport { DatabaseId } from '../core/database_info';\nimport { queryToAggregateTarget, Query, queryToTarget } from '../core/query';\nimport { Document } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport { Mutation } from '../model/mutation';\nimport { ResourcePath } from '../model/path';\nimport {\n  ApiClientObjectMap,\n  BatchGetDocumentsRequest as ProtoBatchGetDocumentsRequest,\n  BatchGetDocumentsResponse as ProtoBatchGetDocumentsResponse,\n  RunAggregationQueryRequest as ProtoRunAggregationQueryRequest,\n  RunAggregationQueryResponse as ProtoRunAggregationQueryResponse,\n  RunQueryRequest as ProtoRunQueryRequest,\n  RunQueryResponse as ProtoRunQueryResponse,\n  Value\n} from '../protos/firestore_proto_api';\nimport { debugAssert, debugCast, hardAssert } from '../util/assert';\nimport { AsyncQueue } from '../util/async_queue';\nimport { Code, FirestoreError } from '../util/error';\nimport { isNullOrUndefined } from '../util/types';\n\nimport { Connection } from './connection';\nimport {\n  PersistentListenStream,\n  PersistentWriteStream,\n  WatchStreamListener,\n  WriteStreamListener\n} from './persistent_stream';\nimport {\n  fromDocument,\n  fromBatchGetDocumentsResponse,\n  JsonProtoSerializer,\n  toMutation,\n  toName,\n  toQueryTarget,\n  toResourcePath,\n  toRunAggregationQueryRequest\n} from './serializer';\n\n/**\n * Datastore and its related methods are a wrapper around the external Google\n * Cloud Datastore grpc API, which provides an interface that is more convenient\n * for the rest of the client SDK architecture to consume.\n */\nexport abstract class Datastore {\n  abstract terminate(): void;\n  abstract serializer: JsonProtoSerializer;\n}\n\n/**\n * An implementation of Datastore that exposes additional state for internal\n * consumption.\n */\nclass DatastoreImpl extends Datastore {\n  terminated = false;\n\n  constructor(\n    readonly authCredentials: CredentialsProvider<User>,\n    readonly appCheckCredentials: CredentialsProvider<string>,\n    readonly connection: Connection,\n    readonly serializer: JsonProtoSerializer\n  ) {\n    super();\n  }\n\n  verifyInitialized(): void {\n    debugAssert(!!this.connection, 'Datastore.start() not called');\n    if (this.terminated) {\n      throw new FirestoreError(\n        Code.FAILED_PRECONDITION,\n        'The client has already been terminated.'\n      );\n    }\n  }\n\n  /** Invokes the provided RPC with auth and AppCheck tokens. */\n  invokeRPC<Req, Resp>(\n    rpcName: string,\n    databaseId: DatabaseId,\n    resourcePath: ResourcePath,\n    request: Req\n  ): Promise<Resp> {\n    this.verifyInitialized();\n    return Promise.all([\n      this.authCredentials.getToken(),\n      this.appCheckCredentials.getToken()\n    ])\n      .then(([authToken, appCheckToken]) => {\n        return this.connection.invokeRPC<Req, Resp>(\n          rpcName,\n          toResourcePath(databaseId, resourcePath),\n          request,\n          authToken,\n          appCheckToken\n        );\n      })\n      .catch((error: FirestoreError) => {\n        if (error.name === 'FirebaseError') {\n          if (error.code === Code.UNAUTHENTICATED) {\n            this.authCredentials.invalidateToken();\n            this.appCheckCredentials.invalidateToken();\n          }\n          throw error;\n        } else {\n          throw new FirestoreError(Code.UNKNOWN, error.toString());\n        }\n      });\n  }\n\n  /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */\n  invokeStreamingRPC<Req, Resp>(\n    rpcName: string,\n    databaseId: DatabaseId,\n    resourcePath: ResourcePath,\n    request: Req,\n    expectedResponseCount?: number\n  ): Promise<Resp[]> {\n    this.verifyInitialized();\n    return Promise.all([\n      this.authCredentials.getToken(),\n      this.appCheckCredentials.getToken()\n    ])\n      .then(([authToken, appCheckToken]) => {\n        return this.connection.invokeStreamingRPC<Req, Resp>(\n          rpcName,\n          toResourcePath(databaseId, resourcePath),\n          request,\n          authToken,\n          appCheckToken,\n          expectedResponseCount\n        );\n      })\n      .catch((error: FirestoreError) => {\n        if (error.name === 'FirebaseError') {\n          if (error.code === Code.UNAUTHENTICATED) {\n            this.authCredentials.invalidateToken();\n            this.appCheckCredentials.invalidateToken();\n          }\n          throw error;\n        } else {\n          throw new FirestoreError(Code.UNKNOWN, error.toString());\n        }\n      });\n  }\n\n  terminate(): void {\n    this.terminated = true;\n    this.connection.terminate();\n  }\n}\n\n// TODO(firestorexp): Make sure there is only one Datastore instance per\n// firestore-exp client.\nexport function newDatastore(\n  authCredentials: CredentialsProvider<User>,\n  appCheckCredentials: CredentialsProvider<string>,\n  connection: Connection,\n  serializer: JsonProtoSerializer\n): Datastore {\n  return new DatastoreImpl(\n    authCredentials,\n    appCheckCredentials,\n    connection,\n    serializer\n  );\n}\n\nexport async function invokeCommitRpc(\n  datastore: Datastore,\n  mutations: Mutation[]\n): Promise<void> {\n  const datastoreImpl = debugCast(datastore, DatastoreImpl);\n  const request = {\n    writes: mutations.map(m => toMutation(datastoreImpl.serializer, m))\n  };\n  await datastoreImpl.invokeRPC(\n    'Commit',\n    datastoreImpl.serializer.databaseId,\n    ResourcePath.emptyPath(),\n    request\n  );\n}\n\nexport async function invokeBatchGetDocumentsRpc(\n  datastore: Datastore,\n  keys: DocumentKey[]\n): Promise<Document[]> {\n  const datastoreImpl = debugCast(datastore, DatastoreImpl);\n  const request = {\n    documents: keys.map(k => toName(datastoreImpl.serializer, k))\n  };\n  const response = await datastoreImpl.invokeStreamingRPC<\n    ProtoBatchGetDocumentsRequest,\n    ProtoBatchGetDocumentsResponse\n  >(\n    'BatchGetDocuments',\n    datastoreImpl.serializer.databaseId,\n    ResourcePath.emptyPath(),\n    request,\n    keys.length\n  );\n\n  const docs = new Map<string, Document>();\n  response.forEach(proto => {\n    const doc = fromBatchGetDocumentsResponse(datastoreImpl.serializer, proto);\n    docs.set(doc.key.toString(), doc);\n  });\n  const result: Document[] = [];\n  keys.forEach(key => {\n    const doc = docs.get(key.toString());\n    hardAssert(!!doc, 'Missing entity in write response for ' + key);\n    result.push(doc);\n  });\n  return result;\n}\n\nexport async function invokeRunQueryRpc(\n  datastore: Datastore,\n  query: Query\n): Promise<Document[]> {\n  const datastoreImpl = debugCast(datastore, DatastoreImpl);\n  const { queryTarget, parent } = toQueryTarget(\n    datastoreImpl.serializer,\n    queryToTarget(query)\n  );\n  const response = await datastoreImpl.invokeStreamingRPC<\n    ProtoRunQueryRequest,\n    ProtoRunQueryResponse\n  >('RunQuery', datastoreImpl.serializer.databaseId, parent, {\n    structuredQuery: queryTarget.structuredQuery\n  });\n  return (\n    response\n      // Omit RunQueryResponses that only contain readTimes.\n      .filter(proto => !!proto.document)\n      .map(proto =>\n        fromDocument(datastoreImpl.serializer, proto.document!, undefined)\n      )\n  );\n}\n\nexport async function invokeRunAggregationQueryRpc(\n  datastore: Datastore,\n  query: Query,\n  aggregates: Aggregate[]\n): Promise<ApiClientObjectMap<Value>> {\n  const datastoreImpl = debugCast(datastore, DatastoreImpl);\n  const { request, aliasMap, parent } = toRunAggregationQueryRequest(\n    datastoreImpl.serializer,\n    queryToAggregateTarget(query),\n    aggregates\n  );\n\n  if (!datastoreImpl.connection.shouldResourcePathBeIncludedInRequest) {\n    delete request.parent;\n  }\n  const response = await datastoreImpl.invokeStreamingRPC<\n    ProtoRunAggregationQueryRequest,\n    ProtoRunAggregationQueryResponse\n  >(\n    'RunAggregationQuery',\n    datastoreImpl.serializer.databaseId,\n    parent,\n    request,\n    /*expectedResponseCount=*/ 1\n  );\n\n  // Omit RunAggregationQueryResponse that only contain readTimes.\n  const filteredResult = response.filter(proto => !!proto.result);\n\n  hardAssert(\n    filteredResult.length === 1,\n    'Aggregation fields are missing from result.'\n  );\n  debugAssert(\n    !isNullOrUndefined(filteredResult[0].result),\n    'aggregationQueryResponse.result'\n  );\n  debugAssert(\n    !isNullOrUndefined(filteredResult[0].result.aggregateFields),\n    'aggregationQueryResponse.result.aggregateFields'\n  );\n\n  // Remap the short-form aliases that were sent to the server\n  // to the client-side aliases. Users will access the results\n  // using the client-side alias.\n  const unmappedAggregateFields = filteredResult[0].result?.aggregateFields;\n  const remappedFields = Object.keys(unmappedAggregateFields).reduce<\n    ApiClientObjectMap<Value>\n  >((accumulator, key) => {\n    debugAssert(\n      !isNullOrUndefined(aliasMap[key]),\n      `'${key}' not present in aliasMap result`\n    );\n    accumulator[aliasMap[key]] = unmappedAggregateFields[key]!;\n    return accumulator;\n  }, {});\n\n  return remappedFields;\n}\n\nexport function newPersistentWriteStream(\n  datastore: Datastore,\n  queue: AsyncQueue,\n  listener: WriteStreamListener\n): PersistentWriteStream {\n  const datastoreImpl = debugCast(datastore, DatastoreImpl);\n  datastoreImpl.verifyInitialized();\n  return new PersistentWriteStream(\n    queue,\n    datastoreImpl.connection,\n    datastoreImpl.authCredentials,\n    datastoreImpl.appCheckCredentials,\n    datastoreImpl.serializer,\n    listener\n  );\n}\n\nexport function newPersistentWatchStream(\n  datastore: Datastore,\n  queue: AsyncQueue,\n  listener: WatchStreamListener\n): PersistentListenStream {\n  const datastoreImpl = debugCast(datastore, DatastoreImpl);\n  datastoreImpl.verifyInitialized();\n  return new PersistentListenStream(\n    queue,\n    datastoreImpl.connection,\n    datastoreImpl.authCredentials,\n    datastoreImpl.appCheckCredentials,\n    datastoreImpl.serializer,\n    listener\n  );\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OnlineState } from '../core/types';\nimport { debugAssert } from '../util/assert';\nimport { AsyncQueue, DelayedOperation, TimerId } from '../util/async_queue';\nimport { FirestoreError } from '../util/error';\nimport { logError, logDebug } from '../util/log';\n\nconst LOG_TAG = 'OnlineStateTracker';\n\n// To deal with transient failures, we allow multiple stream attempts before\n// giving up and transitioning from OnlineState.Unknown to Offline.\n// TODO(mikelehen): This used to be set to 2 as a mitigation for b/66228394.\n// @jdimond thinks that bug is sufficiently fixed so that we can set this back\n// to 1. If that works okay, we could potentially remove this logic entirely.\nconst MAX_WATCH_STREAM_FAILURES = 1;\n\n// To deal with stream attempts that don't succeed or fail in a timely manner,\n// we have a timeout for OnlineState to reach Online or Offline.\n// If the timeout is reached, we transition to Offline rather than waiting\n// indefinitely.\nconst ONLINE_STATE_TIMEOUT_MS = 10 * 1000;\n\n/**\n * A component used by the RemoteStore to track the OnlineState (that is,\n * whether or not the client as a whole should be considered to be online or\n * offline), implementing the appropriate heuristics.\n *\n * In particular, when the client is trying to connect to the backend, we\n * allow up to MAX_WATCH_STREAM_FAILURES within ONLINE_STATE_TIMEOUT_MS for\n * a connection to succeed. If we have too many failures or the timeout elapses,\n * then we set the OnlineState to Offline, and the client will behave as if\n * it is offline (get()s will return cached data, etc.).\n */\nexport class OnlineStateTracker {\n  /** The current OnlineState. */\n  private state = OnlineState.Unknown;\n\n  /**\n   * A count of consecutive failures to open the stream. If it reaches the\n   * maximum defined by MAX_WATCH_STREAM_FAILURES, we'll set the OnlineState to\n   * Offline.\n   */\n  private watchStreamFailures = 0;\n\n  /**\n   * A timer that elapses after ONLINE_STATE_TIMEOUT_MS, at which point we\n   * transition from OnlineState.Unknown to OnlineState.Offline without waiting\n   * for the stream to actually fail (MAX_WATCH_STREAM_FAILURES times).\n   */\n  private onlineStateTimer: DelayedOperation<void> | null = null;\n\n  /**\n   * Whether the client should log a warning message if it fails to connect to\n   * the backend (initially true, cleared after a successful stream, or if we've\n   * logged the message already).\n   */\n  private shouldWarnClientIsOffline = true;\n\n  constructor(\n    private asyncQueue: AsyncQueue,\n    private onlineStateHandler: (onlineState: OnlineState) => void\n  ) {}\n\n  /**\n   * Called by RemoteStore when a watch stream is started (including on each\n   * backoff attempt).\n   *\n   * If this is the first attempt, it sets the OnlineState to Unknown and starts\n   * the onlineStateTimer.\n   */\n  handleWatchStreamStart(): void {\n    if (this.watchStreamFailures === 0) {\n      this.setAndBroadcast(OnlineState.Unknown);\n\n      debugAssert(\n        this.onlineStateTimer === null,\n        `onlineStateTimer shouldn't be started yet`\n      );\n      this.onlineStateTimer = this.asyncQueue.enqueueAfterDelay(\n        TimerId.OnlineStateTimeout,\n        ONLINE_STATE_TIMEOUT_MS,\n        () => {\n          this.onlineStateTimer = null;\n          debugAssert(\n            this.state === OnlineState.Unknown,\n            'Timer should be canceled if we transitioned to a different state.'\n          );\n          this.logClientOfflineWarningIfNecessary(\n            `Backend didn't respond within ${ONLINE_STATE_TIMEOUT_MS / 1000} ` +\n              `seconds.`\n          );\n          this.setAndBroadcast(OnlineState.Offline);\n\n          // NOTE: handleWatchStreamFailure() will continue to increment\n          // watchStreamFailures even though we are already marked Offline,\n          // but this is non-harmful.\n\n          return Promise.resolve();\n        }\n      );\n    }\n  }\n\n  /**\n   * Updates our OnlineState as appropriate after the watch stream reports a\n   * failure. The first failure moves us to the 'Unknown' state. We then may\n   * allow multiple failures (based on MAX_WATCH_STREAM_FAILURES) before we\n   * actually transition to the 'Offline' state.\n   */\n  handleWatchStreamFailure(error: FirestoreError): void {\n    if (this.state === OnlineState.Online) {\n      this.setAndBroadcast(OnlineState.Unknown);\n\n      // To get to OnlineState.Online, set() must have been called which would\n      // have reset our heuristics.\n      debugAssert(\n        this.watchStreamFailures === 0,\n        'watchStreamFailures must be 0'\n      );\n      debugAssert(\n        this.onlineStateTimer === null,\n        'onlineStateTimer must be null'\n      );\n    } else {\n      this.watchStreamFailures++;\n      if (this.watchStreamFailures >= MAX_WATCH_STREAM_FAILURES) {\n        this.clearOnlineStateTimer();\n\n        this.logClientOfflineWarningIfNecessary(\n          `Connection failed ${MAX_WATCH_STREAM_FAILURES} ` +\n            `times. Most recent error: ${error.toString()}`\n        );\n\n        this.setAndBroadcast(OnlineState.Offline);\n      }\n    }\n  }\n\n  /**\n   * Explicitly sets the OnlineState to the specified state.\n   *\n   * Note that this resets our timers / failure counters, etc. used by our\n   * Offline heuristics, so must not be used in place of\n   * handleWatchStreamStart() and handleWatchStreamFailure().\n   */\n  set(newState: OnlineState): void {\n    this.clearOnlineStateTimer();\n    this.watchStreamFailures = 0;\n\n    if (newState === OnlineState.Online) {\n      // We've connected to watch at least once. Don't warn the developer\n      // about being offline going forward.\n      this.shouldWarnClientIsOffline = false;\n    }\n\n    this.setAndBroadcast(newState);\n  }\n\n  private setAndBroadcast(newState: OnlineState): void {\n    if (newState !== this.state) {\n      this.state = newState;\n      this.onlineStateHandler(newState);\n    }\n  }\n\n  private logClientOfflineWarningIfNecessary(details: string): void {\n    const message =\n      `Could not reach Cloud Firestore backend. ${details}\\n` +\n      `This typically indicates that your device does not have a healthy ` +\n      `Internet connection at the moment. The client will operate in offline ` +\n      `mode until it is able to successfully connect to the backend.`;\n    if (this.shouldWarnClientIsOffline) {\n      logError(message);\n      this.shouldWarnClientIsOffline = false;\n    } else {\n      logDebug(LOG_TAG, message);\n    }\n  }\n\n  private clearOnlineStateTimer(): void {\n    if (this.onlineStateTimer !== null) {\n      this.onlineStateTimer.cancel();\n      this.onlineStateTimer = null;\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { User } from '../auth/user';\nimport { SnapshotVersion } from '../core/snapshot_version';\nimport { OnlineState, TargetId } from '../core/types';\nimport { LocalStore } from '../local/local_store';\nimport {\n  localStoreGetLastRemoteSnapshotVersion,\n  localStoreGetNextMutationBatch\n} from '../local/local_store_impl';\nimport { isIndexedDbTransactionError } from '../local/simple_db';\nimport { TargetData } from '../local/target_data';\nimport { MutationResult } from '../model/mutation';\nimport { MutationBatch, MutationBatchResult } from '../model/mutation_batch';\nimport { debugAssert, debugCast } from '../util/assert';\nimport { AsyncQueue } from '../util/async_queue';\nimport { ByteString } from '../util/byte_string';\nimport { FirestoreError } from '../util/error';\nimport { logDebug } from '../util/log';\nimport { BATCHID_UNKNOWN } from '../util/types';\n\nimport { ConnectivityMonitor, NetworkStatus } from './connectivity_monitor';\nimport {\n  Datastore,\n  newPersistentWatchStream,\n  newPersistentWriteStream\n} from './datastore';\nimport { OnlineStateTracker } from './online_state_tracker';\nimport {\n  PersistentListenStream,\n  PersistentWriteStream\n} from './persistent_stream';\nimport { RemoteSyncer } from './remote_syncer';\nimport { isPermanentWriteError } from './rpc_error';\nimport {\n  DocumentWatchChange,\n  ExistenceFilterChange,\n  WatchChange,\n  WatchChangeAggregator,\n  WatchTargetChange,\n  WatchTargetChangeState\n} from './watch_change';\n\nconst LOG_TAG = 'RemoteStore';\n\n// TODO(b/35853402): Negotiate this with the stream.\nconst MAX_PENDING_WRITES = 10;\n\n/** Reasons for why the RemoteStore may be offline. */\nconst enum OfflineCause {\n  /** The user has explicitly disabled the network (via `disableNetwork()`). */\n  UserDisabled,\n  /** An IndexedDb failure occurred while persisting a stream update. */\n  IndexedDbFailed,\n  /** The tab is not the primary tab (only relevant with multi-tab). */\n  IsSecondary,\n  /** We are restarting the streams due to an Auth credential change. */\n  CredentialChange,\n  /** The connectivity state of the environment has changed. */\n  ConnectivityChange,\n  /** The RemoteStore has been shut down. */\n  Shutdown\n}\n\n/**\n * RemoteStore - An interface to remotely stored data, basically providing a\n * wrapper around the Datastore that is more reliable for the rest of the\n * system.\n *\n * RemoteStore is responsible for maintaining the connection to the server.\n * - maintaining a list of active listens.\n * - reconnecting when the connection is dropped.\n * - resuming all the active listens on reconnect.\n *\n * RemoteStore handles all incoming events from the Datastore.\n * - listening to the watch stream and repackaging the events as RemoteEvents\n * - notifying SyncEngine of any changes to the active listens.\n *\n * RemoteStore takes writes from other components and handles them reliably.\n * - pulling pending mutations from LocalStore and sending them to Datastore.\n * - retrying mutations that failed because of network problems.\n * - acking mutations to the SyncEngine once they are accepted or rejected.\n */\nexport interface RemoteStore {\n  /**\n   * SyncEngine to notify of watch and write events. This must be set\n   * immediately after construction.\n   */\n  remoteSyncer: RemoteSyncer;\n}\n\nclass RemoteStoreImpl implements RemoteStore {\n  remoteSyncer: RemoteSyncer = {};\n\n  /**\n   * A list of up to MAX_PENDING_WRITES writes that we have fetched from the\n   * LocalStore via fillWritePipeline() and have or will send to the write\n   * stream.\n   *\n   * Whenever writePipeline.length > 0 the RemoteStore will attempt to start or\n   * restart the write stream. When the stream is established the writes in the\n   * pipeline will be sent in order.\n   *\n   * Writes remain in writePipeline until they are acknowledged by the backend\n   * and thus will automatically be re-sent if the stream is interrupted /\n   * restarted before they're acknowledged.\n   *\n   * Write responses from the backend are linked to their originating request\n   * purely based on order, and so we can just shift() writes from the front of\n   * the writePipeline as we receive responses.\n   */\n  writePipeline: MutationBatch[] = [];\n\n  /**\n   * A mapping of watched targets that the client cares about tracking and the\n   * user has explicitly called a 'listen' for this target.\n   *\n   * These targets may or may not have been sent to or acknowledged by the\n   * server. On re-establishing the listen stream, these targets should be sent\n   * to the server. The targets removed with unlistens are removed eagerly\n   * without waiting for confirmation from the listen stream.\n   */\n  listenTargets = new Map<TargetId, TargetData>();\n\n  connectivityMonitor: ConnectivityMonitor;\n  watchStream?: PersistentListenStream;\n  writeStream?: PersistentWriteStream;\n  watchChangeAggregator?: WatchChangeAggregator;\n\n  /**\n   * A set of reasons for why the RemoteStore may be offline. If empty, the\n   * RemoteStore may start its network connections.\n   */\n  offlineCauses = new Set<OfflineCause>();\n\n  /**\n   * Event handlers that get called when the network is disabled or enabled.\n   *\n   * PORTING NOTE: These functions are used on the Web client to create the\n   * underlying streams (to support tree-shakeable streams). On Android and iOS,\n   * the streams are created during construction of RemoteStore.\n   */\n  onNetworkStatusChange: Array<(enabled: boolean) => Promise<void>> = [];\n\n  onlineStateTracker: OnlineStateTracker;\n\n  constructor(\n    /**\n     * The local store, used to fill the write pipeline with outbound mutations.\n     */\n    readonly localStore: LocalStore,\n    /** The client-side proxy for interacting with the backend. */\n    readonly datastore: Datastore,\n    readonly asyncQueue: AsyncQueue,\n    onlineStateHandler: (onlineState: OnlineState) => void,\n    connectivityMonitor: ConnectivityMonitor\n  ) {\n    this.connectivityMonitor = connectivityMonitor;\n    this.connectivityMonitor.addCallback((_: NetworkStatus) => {\n      asyncQueue.enqueueAndForget(async () => {\n        // Porting Note: Unlike iOS, `restartNetwork()` is called even when the\n        // network becomes unreachable as we don't have any other way to tear\n        // down our streams.\n        if (canUseNetwork(this)) {\n          logDebug(\n            LOG_TAG,\n            'Restarting streams for network reachability change.'\n          );\n          await restartNetwork(this);\n        }\n      });\n    });\n\n    this.onlineStateTracker = new OnlineStateTracker(\n      asyncQueue,\n      onlineStateHandler\n    );\n  }\n}\n\nexport function newRemoteStore(\n  localStore: LocalStore,\n  datastore: Datastore,\n  asyncQueue: AsyncQueue,\n  onlineStateHandler: (onlineState: OnlineState) => void,\n  connectivityMonitor: ConnectivityMonitor\n): RemoteStore {\n  return new RemoteStoreImpl(\n    localStore,\n    datastore,\n    asyncQueue,\n    onlineStateHandler,\n    connectivityMonitor\n  );\n}\n\n/** Re-enables the network. Idempotent. */\nexport function remoteStoreEnableNetwork(\n  remoteStore: RemoteStore\n): Promise<void> {\n  const remoteStoreImpl = debugCast(remoteStore, RemoteStoreImpl);\n  remoteStoreImpl.offlineCauses.delete(OfflineCause.UserDisabled);\n  return enableNetworkInternal(remoteStoreImpl);\n}\n\nasync function enableNetworkInternal(\n  remoteStoreImpl: RemoteStoreImpl\n): Promise<void> {\n  if (canUseNetwork(remoteStoreImpl)) {\n    for (const networkStatusHandler of remoteStoreImpl.onNetworkStatusChange) {\n      await networkStatusHandler(/* enabled= */ true);\n    }\n  }\n}\n\n/**\n * Temporarily disables the network. The network can be re-enabled using\n * enableNetwork().\n */\nexport async function remoteStoreDisableNetwork(\n  remoteStore: RemoteStore\n): Promise<void> {\n  const remoteStoreImpl = debugCast(remoteStore, RemoteStoreImpl);\n  remoteStoreImpl.offlineCauses.add(OfflineCause.UserDisabled);\n  await disableNetworkInternal(remoteStoreImpl);\n\n  // Set the OnlineState to Offline so get()s return from cache, etc.\n  remoteStoreImpl.onlineStateTracker.set(OnlineState.Offline);\n}\n\nasync function disableNetworkInternal(\n  remoteStoreImpl: RemoteStoreImpl\n): Promise<void> {\n  for (const networkStatusHandler of remoteStoreImpl.onNetworkStatusChange) {\n    await networkStatusHandler(/* enabled= */ false);\n  }\n}\n\nexport async function remoteStoreShutdown(\n  remoteStore: RemoteStore\n): Promise<void> {\n  const remoteStoreImpl = debugCast(remoteStore, RemoteStoreImpl);\n  logDebug(LOG_TAG, 'RemoteStore shutting down.');\n  remoteStoreImpl.offlineCauses.add(OfflineCause.Shutdown);\n  await disableNetworkInternal(remoteStoreImpl);\n  remoteStoreImpl.connectivityMonitor.shutdown();\n\n  // Set the OnlineState to Unknown (rather than Offline) to avoid potentially\n  // triggering spurious listener events with cached data, etc.\n  remoteStoreImpl.onlineStateTracker.set(OnlineState.Unknown);\n}\n\n/**\n * Starts new listen for the given target. Uses resume token if provided. It\n * is a no-op if the target of given `TargetData` is already being listened to.\n */\nexport function remoteStoreListen(\n  remoteStore: RemoteStore,\n  targetData: TargetData\n): void {\n  const remoteStoreImpl = debugCast(remoteStore, RemoteStoreImpl);\n\n  if (remoteStoreImpl.listenTargets.has(targetData.targetId)) {\n    return;\n  }\n\n  // Mark this as something the client is currently listening for.\n  remoteStoreImpl.listenTargets.set(targetData.targetId, targetData);\n\n  if (shouldStartWatchStream(remoteStoreImpl)) {\n    // The listen will be sent in onWatchStreamOpen\n    startWatchStream(remoteStoreImpl);\n  } else if (ensureWatchStream(remoteStoreImpl).isOpen()) {\n    sendWatchRequest(remoteStoreImpl, targetData);\n  }\n}\n\n/**\n * Removes the listen from server. It is a no-op if the given target id is\n * not being listened to.\n */\nexport function remoteStoreUnlisten(\n  remoteStore: RemoteStore,\n  targetId: TargetId\n): void {\n  const remoteStoreImpl = debugCast(remoteStore, RemoteStoreImpl);\n  const watchStream = ensureWatchStream(remoteStoreImpl);\n\n  debugAssert(\n    remoteStoreImpl.listenTargets.has(targetId),\n    `unlisten called on target no currently watched: ${targetId}`\n  );\n\n  remoteStoreImpl.listenTargets.delete(targetId);\n  if (watchStream.isOpen()) {\n    sendUnwatchRequest(remoteStoreImpl, targetId);\n  }\n\n  if (remoteStoreImpl.listenTargets.size === 0) {\n    if (watchStream.isOpen()) {\n      watchStream.markIdle();\n    } else if (canUseNetwork(remoteStoreImpl)) {\n      // Revert to OnlineState.Unknown if the watch stream is not open and we\n      // have no listeners, since without any listens to send we cannot\n      // confirm if the stream is healthy and upgrade to OnlineState.Online.\n      remoteStoreImpl.onlineStateTracker.set(OnlineState.Unknown);\n    }\n  }\n}\n\n/**\n * We need to increment the the expected number of pending responses we're due\n * from watch so we wait for the ack to process any messages from this target.\n */\nfunction sendWatchRequest(\n  remoteStoreImpl: RemoteStoreImpl,\n  targetData: TargetData\n): void {\n  remoteStoreImpl.watchChangeAggregator!.recordPendingTargetRequest(\n    targetData.targetId\n  );\n\n  if (\n    targetData.resumeToken.approximateByteSize() > 0 ||\n    targetData.snapshotVersion.compareTo(SnapshotVersion.min()) > 0\n  ) {\n    const expectedCount = remoteStoreImpl.remoteSyncer.getRemoteKeysForTarget!(\n      targetData.targetId\n    ).size;\n    targetData = targetData.withExpectedCount(expectedCount);\n  }\n\n  ensureWatchStream(remoteStoreImpl).watch(targetData);\n}\n\n/**\n * We need to increment the expected number of pending responses we're due\n * from watch so we wait for the removal on the server before we process any\n * messages from this target.\n */\nfunction sendUnwatchRequest(\n  remoteStoreImpl: RemoteStoreImpl,\n  targetId: TargetId\n): void {\n  remoteStoreImpl.watchChangeAggregator!.recordPendingTargetRequest(targetId);\n  ensureWatchStream(remoteStoreImpl).unwatch(targetId);\n}\n\nfunction startWatchStream(remoteStoreImpl: RemoteStoreImpl): void {\n  debugAssert(\n    shouldStartWatchStream(remoteStoreImpl),\n    'startWatchStream() called when shouldStartWatchStream() is false.'\n  );\n  debugAssert(\n    !!remoteStoreImpl.remoteSyncer.getRemoteKeysForTarget,\n    'getRemoteKeysForTarget() not set'\n  );\n\n  remoteStoreImpl.watchChangeAggregator = new WatchChangeAggregator({\n    getRemoteKeysForTarget: targetId =>\n      remoteStoreImpl.remoteSyncer.getRemoteKeysForTarget!(targetId),\n    getTargetDataForTarget: targetId =>\n      remoteStoreImpl.listenTargets.get(targetId) || null,\n    getDatabaseId: () => remoteStoreImpl.datastore.serializer.databaseId\n  });\n  ensureWatchStream(remoteStoreImpl).start();\n  remoteStoreImpl.onlineStateTracker.handleWatchStreamStart();\n}\n\n/**\n * Returns whether the watch stream should be started because it's necessary\n * and has not yet been started.\n */\nfunction shouldStartWatchStream(remoteStoreImpl: RemoteStoreImpl): boolean {\n  return (\n    canUseNetwork(remoteStoreImpl) &&\n    !ensureWatchStream(remoteStoreImpl).isStarted() &&\n    remoteStoreImpl.listenTargets.size > 0\n  );\n}\n\nexport function canUseNetwork(remoteStore: RemoteStore): boolean {\n  const remoteStoreImpl = debugCast(remoteStore, RemoteStoreImpl);\n  return remoteStoreImpl.offlineCauses.size === 0;\n}\n\nfunction cleanUpWatchStreamState(remoteStoreImpl: RemoteStoreImpl): void {\n  remoteStoreImpl.watchChangeAggregator = undefined;\n}\n\nasync function onWatchStreamConnected(\n  remoteStoreImpl: RemoteStoreImpl\n): Promise<void> {\n  // Mark the client as online since we got a \"connected\" notification.\n  remoteStoreImpl.onlineStateTracker.set(OnlineState.Online);\n}\n\nasync function onWatchStreamOpen(\n  remoteStoreImpl: RemoteStoreImpl\n): Promise<void> {\n  remoteStoreImpl.listenTargets.forEach((targetData, targetId) => {\n    sendWatchRequest(remoteStoreImpl, targetData);\n  });\n}\n\nasync function onWatchStreamClose(\n  remoteStoreImpl: RemoteStoreImpl,\n  error?: FirestoreError\n): Promise<void> {\n  if (error === undefined) {\n    // Graceful stop (due to stop() or idle timeout). Make sure that's\n    // desirable.\n    debugAssert(\n      !shouldStartWatchStream(remoteStoreImpl),\n      'Watch stream was stopped gracefully while still needed.'\n    );\n  }\n\n  cleanUpWatchStreamState(remoteStoreImpl);\n\n  // If we still need the watch stream, retry the connection.\n  if (shouldStartWatchStream(remoteStoreImpl)) {\n    remoteStoreImpl.onlineStateTracker.handleWatchStreamFailure(error!);\n\n    startWatchStream(remoteStoreImpl);\n  } else {\n    // No need to restart watch stream because there are no active targets.\n    // The online state is set to unknown because there is no active attempt\n    // at establishing a connection\n    remoteStoreImpl.onlineStateTracker.set(OnlineState.Unknown);\n  }\n}\n\nasync function onWatchStreamChange(\n  remoteStoreImpl: RemoteStoreImpl,\n  watchChange: WatchChange,\n  snapshotVersion: SnapshotVersion\n): Promise<void> {\n  // Mark the client as online since we got a message from the server\n  remoteStoreImpl.onlineStateTracker.set(OnlineState.Online);\n\n  if (\n    watchChange instanceof WatchTargetChange &&\n    watchChange.state === WatchTargetChangeState.Removed &&\n    watchChange.cause\n  ) {\n    // There was an error on a target, don't wait for a consistent snapshot\n    // to raise events\n    try {\n      await handleTargetError(remoteStoreImpl, watchChange);\n    } catch (e) {\n      logDebug(\n        LOG_TAG,\n        'Failed to remove targets %s: %s ',\n        watchChange.targetIds.join(','),\n        e\n      );\n      await disableNetworkUntilRecovery(remoteStoreImpl, e as FirestoreError);\n    }\n    return;\n  }\n\n  if (watchChange instanceof DocumentWatchChange) {\n    remoteStoreImpl.watchChangeAggregator!.handleDocumentChange(watchChange);\n  } else if (watchChange instanceof ExistenceFilterChange) {\n    remoteStoreImpl.watchChangeAggregator!.handleExistenceFilter(watchChange);\n  } else {\n    debugAssert(\n      watchChange instanceof WatchTargetChange,\n      'Expected watchChange to be an instance of WatchTargetChange'\n    );\n    remoteStoreImpl.watchChangeAggregator!.handleTargetChange(watchChange);\n  }\n\n  if (!snapshotVersion.isEqual(SnapshotVersion.min())) {\n    try {\n      const lastRemoteSnapshotVersion =\n        await localStoreGetLastRemoteSnapshotVersion(\n          remoteStoreImpl.localStore\n        );\n      if (snapshotVersion.compareTo(lastRemoteSnapshotVersion) >= 0) {\n        // We have received a target change with a global snapshot if the snapshot\n        // version is not equal to SnapshotVersion.min().\n        await raiseWatchSnapshot(remoteStoreImpl, snapshotVersion);\n      }\n    } catch (e) {\n      logDebug(LOG_TAG, 'Failed to raise snapshot:', e);\n      await disableNetworkUntilRecovery(remoteStoreImpl, e as FirestoreError);\n    }\n  }\n}\n\n/**\n * Recovery logic for IndexedDB errors that takes the network offline until\n * `op` succeeds. Retries are scheduled with backoff using\n * `enqueueRetryable()`. If `op()` is not provided, IndexedDB access is\n * validated via a generic operation.\n *\n * The returned Promise is resolved once the network is disabled and before\n * any retry attempt.\n */\nasync function disableNetworkUntilRecovery(\n  remoteStoreImpl: RemoteStoreImpl,\n  e: FirestoreError,\n  op?: () => Promise<unknown>\n): Promise<void> {\n  if (isIndexedDbTransactionError(e)) {\n    debugAssert(\n      !remoteStoreImpl.offlineCauses.has(OfflineCause.IndexedDbFailed),\n      'Unexpected network event when IndexedDB was marked failed.'\n    );\n    remoteStoreImpl.offlineCauses.add(OfflineCause.IndexedDbFailed);\n\n    // Disable network and raise offline snapshots\n    await disableNetworkInternal(remoteStoreImpl);\n    remoteStoreImpl.onlineStateTracker.set(OnlineState.Offline);\n\n    if (!op) {\n      // Use a simple read operation to determine if IndexedDB recovered.\n      // Ideally, we would expose a health check directly on SimpleDb, but\n      // RemoteStore only has access to persistence through LocalStore.\n      op = () =>\n        localStoreGetLastRemoteSnapshotVersion(remoteStoreImpl.localStore);\n    }\n\n    // Probe IndexedDB periodically and re-enable network\n    remoteStoreImpl.asyncQueue.enqueueRetryable(async () => {\n      logDebug(LOG_TAG, 'Retrying IndexedDB access');\n      await op!();\n      remoteStoreImpl.offlineCauses.delete(OfflineCause.IndexedDbFailed);\n      await enableNetworkInternal(remoteStoreImpl);\n    });\n  } else {\n    throw e;\n  }\n}\n\n/**\n * Executes `op`. If `op` fails, takes the network offline until `op`\n * succeeds. Returns after the first attempt.\n */\nfunction executeWithRecovery(\n  remoteStoreImpl: RemoteStoreImpl,\n  op: () => Promise<void>\n): Promise<void> {\n  return op().catch(e => disableNetworkUntilRecovery(remoteStoreImpl, e, op));\n}\n\n/**\n * Takes a batch of changes from the Datastore, repackages them as a\n * RemoteEvent, and passes that on to the listener, which is typically the\n * SyncEngine.\n */\nfunction raiseWatchSnapshot(\n  remoteStoreImpl: RemoteStoreImpl,\n  snapshotVersion: SnapshotVersion\n): Promise<void> {\n  debugAssert(\n    !snapshotVersion.isEqual(SnapshotVersion.min()),\n    \"Can't raise event for unknown SnapshotVersion\"\n  );\n  const remoteEvent =\n    remoteStoreImpl.watchChangeAggregator!.createRemoteEvent(snapshotVersion);\n\n  // Update in-memory resume tokens. LocalStore will update the\n  // persistent view of these when applying the completed RemoteEvent.\n  remoteEvent.targetChanges.forEach((change, targetId) => {\n    if (change.resumeToken.approximateByteSize() > 0) {\n      const targetData = remoteStoreImpl.listenTargets.get(targetId);\n      // A watched target might have been removed already.\n      if (targetData) {\n        remoteStoreImpl.listenTargets.set(\n          targetId,\n          targetData.withResumeToken(change.resumeToken, snapshotVersion)\n        );\n      }\n    }\n  });\n\n  // Re-establish listens for the targets that have been invalidated by\n  // existence filter mismatches.\n  remoteEvent.targetMismatches.forEach((targetId, targetPurpose) => {\n    const targetData = remoteStoreImpl.listenTargets.get(targetId);\n    if (!targetData) {\n      // A watched target might have been removed already.\n      return;\n    }\n\n    // Clear the resume token for the target, since we're in a known mismatch\n    // state.\n    remoteStoreImpl.listenTargets.set(\n      targetId,\n      targetData.withResumeToken(\n        ByteString.EMPTY_BYTE_STRING,\n        targetData.snapshotVersion\n      )\n    );\n\n    // Cause a hard reset by unwatching and rewatching immediately, but\n    // deliberately don't send a resume token so that we get a full update.\n    sendUnwatchRequest(remoteStoreImpl, targetId);\n\n    // Mark the target we send as being on behalf of an existence filter\n    // mismatch, but don't actually retain that in listenTargets. This ensures\n    // that we flag the first re-listen this way without impacting future\n    // listens of this target (that might happen e.g. on reconnect).\n    const requestTargetData = new TargetData(\n      targetData.target,\n      targetId,\n      targetPurpose,\n      targetData.sequenceNumber\n    );\n    sendWatchRequest(remoteStoreImpl, requestTargetData);\n  });\n\n  // Finally raise remote event\n  debugAssert(\n    !!remoteStoreImpl.remoteSyncer.applyRemoteEvent,\n    'applyRemoteEvent() not set'\n  );\n  return remoteStoreImpl.remoteSyncer.applyRemoteEvent(remoteEvent);\n}\n\n/** Handles an error on a target */\nasync function handleTargetError(\n  remoteStoreImpl: RemoteStoreImpl,\n  watchChange: WatchTargetChange\n): Promise<void> {\n  debugAssert(\n    !!remoteStoreImpl.remoteSyncer.rejectListen,\n    'rejectListen() not set'\n  );\n  debugAssert(!!watchChange.cause, 'Handling target error without a cause');\n  const error = watchChange.cause!;\n  for (const targetId of watchChange.targetIds) {\n    // A watched target might have been removed already.\n    if (remoteStoreImpl.listenTargets.has(targetId)) {\n      await remoteStoreImpl.remoteSyncer.rejectListen(targetId, error);\n      remoteStoreImpl.listenTargets.delete(targetId);\n      remoteStoreImpl.watchChangeAggregator!.removeTarget(targetId);\n    }\n  }\n}\n\n/**\n * Attempts to fill our write pipeline with writes from the LocalStore.\n *\n * Called internally to bootstrap or refill the write pipeline and by\n * SyncEngine whenever there are new mutations to process.\n *\n * Starts the write stream if necessary.\n */\nexport async function fillWritePipeline(\n  remoteStore: RemoteStore\n): Promise<void> {\n  const remoteStoreImpl = debugCast(remoteStore, RemoteStoreImpl);\n  const writeStream = ensureWriteStream(remoteStoreImpl);\n\n  let lastBatchIdRetrieved =\n    remoteStoreImpl.writePipeline.length > 0\n      ? remoteStoreImpl.writePipeline[remoteStoreImpl.writePipeline.length - 1]\n          .batchId\n      : BATCHID_UNKNOWN;\n\n  while (canAddToWritePipeline(remoteStoreImpl)) {\n    try {\n      const batch = await localStoreGetNextMutationBatch(\n        remoteStoreImpl.localStore,\n        lastBatchIdRetrieved\n      );\n\n      if (batch === null) {\n        if (remoteStoreImpl.writePipeline.length === 0) {\n          writeStream.markIdle();\n        }\n        break;\n      } else {\n        lastBatchIdRetrieved = batch.batchId;\n        addToWritePipeline(remoteStoreImpl, batch);\n      }\n    } catch (e) {\n      await disableNetworkUntilRecovery(remoteStoreImpl, e as FirestoreError);\n    }\n  }\n\n  if (shouldStartWriteStream(remoteStoreImpl)) {\n    startWriteStream(remoteStoreImpl);\n  }\n}\n\n/**\n * Returns true if we can add to the write pipeline (i.e. the network is\n * enabled and the write pipeline is not full).\n */\nfunction canAddToWritePipeline(remoteStoreImpl: RemoteStoreImpl): boolean {\n  return (\n    canUseNetwork(remoteStoreImpl) &&\n    remoteStoreImpl.writePipeline.length < MAX_PENDING_WRITES\n  );\n}\n\n// For testing\nexport function outstandingWrites(remoteStore: RemoteStore): number {\n  const remoteStoreImpl = debugCast(remoteStore, RemoteStoreImpl);\n  return remoteStoreImpl.writePipeline.length;\n}\n\n/**\n * Queues additional writes to be sent to the write stream, sending them\n * immediately if the write stream is established.\n */\nfunction addToWritePipeline(\n  remoteStoreImpl: RemoteStoreImpl,\n  batch: MutationBatch\n): void {\n  debugAssert(\n    canAddToWritePipeline(remoteStoreImpl),\n    'addToWritePipeline called when pipeline is full'\n  );\n  remoteStoreImpl.writePipeline.push(batch);\n\n  const writeStream = ensureWriteStream(remoteStoreImpl);\n  if (writeStream.isOpen() && writeStream.handshakeComplete) {\n    writeStream.writeMutations(batch.mutations);\n  }\n}\n\nfunction shouldStartWriteStream(remoteStoreImpl: RemoteStoreImpl): boolean {\n  return (\n    canUseNetwork(remoteStoreImpl) &&\n    !ensureWriteStream(remoteStoreImpl).isStarted() &&\n    remoteStoreImpl.writePipeline.length > 0\n  );\n}\n\nfunction startWriteStream(remoteStoreImpl: RemoteStoreImpl): void {\n  debugAssert(\n    shouldStartWriteStream(remoteStoreImpl),\n    'startWriteStream() called when shouldStartWriteStream() is false.'\n  );\n  ensureWriteStream(remoteStoreImpl).start();\n}\n\nasync function onWriteStreamOpen(\n  remoteStoreImpl: RemoteStoreImpl\n): Promise<void> {\n  ensureWriteStream(remoteStoreImpl).writeHandshake();\n}\n\nasync function onWriteHandshakeComplete(\n  remoteStoreImpl: RemoteStoreImpl\n): Promise<void> {\n  const writeStream = ensureWriteStream(remoteStoreImpl);\n  // Send the write pipeline now that the stream is established.\n  for (const batch of remoteStoreImpl.writePipeline) {\n    writeStream.writeMutations(batch.mutations);\n  }\n}\n\nasync function onMutationResult(\n  remoteStoreImpl: RemoteStoreImpl,\n  commitVersion: SnapshotVersion,\n  results: MutationResult[]\n): Promise<void> {\n  // This is a response to a write containing mutations and should be\n  // correlated to the first write in our write pipeline.\n  debugAssert(\n    remoteStoreImpl.writePipeline.length > 0,\n    'Got result for empty write pipeline'\n  );\n  const batch = remoteStoreImpl.writePipeline.shift()!;\n  const success = MutationBatchResult.from(batch, commitVersion, results);\n\n  debugAssert(\n    !!remoteStoreImpl.remoteSyncer.applySuccessfulWrite,\n    'applySuccessfulWrite() not set'\n  );\n  await executeWithRecovery(remoteStoreImpl, () =>\n    remoteStoreImpl.remoteSyncer.applySuccessfulWrite!(success)\n  );\n\n  // It's possible that with the completion of this mutation another\n  // slot has freed up.\n  await fillWritePipeline(remoteStoreImpl);\n}\n\nasync function onWriteStreamClose(\n  remoteStoreImpl: RemoteStoreImpl,\n  error?: FirestoreError\n): Promise<void> {\n  if (error === undefined) {\n    // Graceful stop (due to stop() or idle timeout). Make sure that's\n    // desirable.\n    debugAssert(\n      !shouldStartWriteStream(remoteStoreImpl),\n      'Write stream was stopped gracefully while still needed.'\n    );\n  }\n\n  // If the write stream closed after the write handshake completes, a write\n  // operation failed and we fail the pending operation.\n  if (error && ensureWriteStream(remoteStoreImpl).handshakeComplete) {\n    // This error affects the actual write.\n    await handleWriteError(remoteStoreImpl, error!);\n  }\n\n  // The write stream might have been started by refilling the write\n  // pipeline for failed writes\n  if (shouldStartWriteStream(remoteStoreImpl)) {\n    startWriteStream(remoteStoreImpl);\n  }\n}\n\nasync function handleWriteError(\n  remoteStoreImpl: RemoteStoreImpl,\n  error: FirestoreError\n): Promise<void> {\n  // Only handle permanent errors here. If it's transient, just let the retry\n  // logic kick in.\n  if (isPermanentWriteError(error.code)) {\n    // This was a permanent error, the request itself was the problem\n    // so it's not going to succeed if we resend it.\n    const batch = remoteStoreImpl.writePipeline.shift()!;\n\n    // In this case it's also unlikely that the server itself is melting\n    // down -- this was just a bad request so inhibit backoff on the next\n    // restart.\n    ensureWriteStream(remoteStoreImpl).inhibitBackoff();\n\n    debugAssert(\n      !!remoteStoreImpl.remoteSyncer.rejectFailedWrite,\n      'rejectFailedWrite() not set'\n    );\n    await executeWithRecovery(remoteStoreImpl, () =>\n      remoteStoreImpl.remoteSyncer.rejectFailedWrite!(batch.batchId, error)\n    );\n\n    // It's possible that with the completion of this mutation\n    // another slot has freed up.\n    await fillWritePipeline(remoteStoreImpl);\n  } else {\n    // Transient error, just let the retry logic kick in.\n  }\n}\n\nasync function restartNetwork(remoteStore: RemoteStore): Promise<void> {\n  const remoteStoreImpl = debugCast(remoteStore, RemoteStoreImpl);\n  remoteStoreImpl.offlineCauses.add(OfflineCause.ConnectivityChange);\n  await disableNetworkInternal(remoteStoreImpl);\n  remoteStoreImpl.onlineStateTracker.set(OnlineState.Unknown);\n  remoteStoreImpl.offlineCauses.delete(OfflineCause.ConnectivityChange);\n  await enableNetworkInternal(remoteStoreImpl);\n}\n\nexport async function remoteStoreHandleCredentialChange(\n  remoteStore: RemoteStore,\n  user: User\n): Promise<void> {\n  const remoteStoreImpl = debugCast(remoteStore, RemoteStoreImpl);\n  remoteStoreImpl.asyncQueue.verifyOperationInProgress();\n  debugAssert(\n    !!remoteStoreImpl.remoteSyncer.handleCredentialChange,\n    'handleCredentialChange() not set'\n  );\n\n  logDebug(LOG_TAG, 'RemoteStore received new credentials');\n  const usesNetwork = canUseNetwork(remoteStoreImpl);\n\n  // Tear down and re-create our network streams. This will ensure we get a\n  // fresh auth token for the new user and re-fill the write pipeline with\n  // new mutations from the LocalStore (since mutations are per-user).\n  remoteStoreImpl.offlineCauses.add(OfflineCause.CredentialChange);\n  await disableNetworkInternal(remoteStoreImpl);\n  if (usesNetwork) {\n    // Don't set the network status to Unknown if we are offline.\n    remoteStoreImpl.onlineStateTracker.set(OnlineState.Unknown);\n  }\n  await remoteStoreImpl.remoteSyncer.handleCredentialChange(user);\n  remoteStoreImpl.offlineCauses.delete(OfflineCause.CredentialChange);\n  await enableNetworkInternal(remoteStoreImpl);\n}\n\n/**\n * Toggles the network state when the client gains or loses its primary lease.\n */\nexport async function remoteStoreApplyPrimaryState(\n  remoteStore: RemoteStore,\n  isPrimary: boolean\n): Promise<void> {\n  const remoteStoreImpl = debugCast(remoteStore, RemoteStoreImpl);\n  if (isPrimary) {\n    remoteStoreImpl.offlineCauses.delete(OfflineCause.IsSecondary);\n    await enableNetworkInternal(remoteStoreImpl);\n  } else if (!isPrimary) {\n    remoteStoreImpl.offlineCauses.add(OfflineCause.IsSecondary);\n    await disableNetworkInternal(remoteStoreImpl);\n    remoteStoreImpl.onlineStateTracker.set(OnlineState.Unknown);\n  }\n}\n\n/**\n * If not yet initialized, registers the WatchStream and its network state\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\n * already available.\n *\n * PORTING NOTE: On iOS and Android, the WatchStream gets registered on startup.\n * This is not done on Web to allow it to be tree-shaken.\n */\nfunction ensureWatchStream(\n  remoteStoreImpl: RemoteStoreImpl\n): PersistentListenStream {\n  if (!remoteStoreImpl.watchStream) {\n    // Create stream (but note that it is not started yet).\n    remoteStoreImpl.watchStream = newPersistentWatchStream(\n      remoteStoreImpl.datastore,\n      remoteStoreImpl.asyncQueue,\n      {\n        onConnected: onWatchStreamConnected.bind(null, remoteStoreImpl),\n        onOpen: onWatchStreamOpen.bind(null, remoteStoreImpl),\n        onClose: onWatchStreamClose.bind(null, remoteStoreImpl),\n        onWatchChange: onWatchStreamChange.bind(null, remoteStoreImpl)\n      }\n    );\n\n    remoteStoreImpl.onNetworkStatusChange.push(async enabled => {\n      if (enabled) {\n        remoteStoreImpl.watchStream!.inhibitBackoff();\n        if (shouldStartWatchStream(remoteStoreImpl)) {\n          startWatchStream(remoteStoreImpl);\n        } else {\n          remoteStoreImpl.onlineStateTracker.set(OnlineState.Unknown);\n        }\n      } else {\n        await remoteStoreImpl.watchStream!.stop();\n        cleanUpWatchStreamState(remoteStoreImpl);\n      }\n    });\n  }\n\n  return remoteStoreImpl.watchStream;\n}\n\n/**\n * If not yet initialized, registers the WriteStream and its network state\n * callback with `remoteStoreImpl`. Returns the existing stream if one is\n * already available.\n *\n * PORTING NOTE: On iOS and Android, the WriteStream gets registered on startup.\n * This is not done on Web to allow it to be tree-shaken.\n */\nfunction ensureWriteStream(\n  remoteStoreImpl: RemoteStoreImpl\n): PersistentWriteStream {\n  if (!remoteStoreImpl.writeStream) {\n    debugAssert(\n      remoteStoreImpl.writePipeline.length === 0,\n      'Should not issue writes before WriteStream is enabled'\n    );\n\n    // Create stream (but note that it is not started yet).\n    remoteStoreImpl.writeStream = newPersistentWriteStream(\n      remoteStoreImpl.datastore,\n      remoteStoreImpl.asyncQueue,\n      {\n        onConnected: () => Promise.resolve(),\n        onOpen: onWriteStreamOpen.bind(null, remoteStoreImpl),\n        onClose: onWriteStreamClose.bind(null, remoteStoreImpl),\n        onHandshakeComplete: onWriteHandshakeComplete.bind(\n          null,\n          remoteStoreImpl\n        ),\n        onMutationResult: onMutationResult.bind(null, remoteStoreImpl)\n      }\n    );\n\n    remoteStoreImpl.onNetworkStatusChange.push(async enabled => {\n      if (enabled) {\n        remoteStoreImpl.writeStream!.inhibitBackoff();\n\n        // This will start the write stream if necessary.\n        await fillWritePipeline(remoteStoreImpl);\n      } else {\n        await remoteStoreImpl.writeStream!.stop();\n\n        if (remoteStoreImpl.writePipeline.length > 0) {\n          logDebug(\n            LOG_TAG,\n            `Stopping write stream with ${remoteStoreImpl.writePipeline.length} pending writes`\n          );\n          remoteStoreImpl.writePipeline = [];\n        }\n      }\n    });\n  }\n\n  return remoteStoreImpl.writeStream;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isIndexedDbTransactionError } from '../local/simple_db';\n\nimport { Code, FirestoreError } from './error';\nimport { logError } from './log';\nimport { Deferred } from './promise';\n\nconst LOG_TAG = 'AsyncQueue';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype TimerHandle = any;\n\n/**\n * Wellknown \"timer\" IDs used when scheduling delayed operations on the\n * AsyncQueue. These IDs can then be used from tests to check for the presence\n * of operations or to run them early.\n *\n * The string values are used when encoding these timer IDs in JSON spec tests.\n */\nexport const enum TimerId {\n  /** All can be used with runDelayedOperationsEarly() to run all timers. */\n  All = 'all',\n\n  /**\n   * The following 5 timers are used in persistent_stream.ts for the listen and\n   * write streams. The \"Idle\" timer is used to close the stream due to\n   * inactivity. The \"ConnectionBackoff\" timer is used to restart a stream once\n   * the appropriate backoff delay has elapsed. The health check is used to mark\n   * a stream healthy if it has not received an error during its initial setup.\n   */\n  ListenStreamIdle = 'listen_stream_idle',\n  ListenStreamConnectionBackoff = 'listen_stream_connection_backoff',\n  WriteStreamIdle = 'write_stream_idle',\n  WriteStreamConnectionBackoff = 'write_stream_connection_backoff',\n  HealthCheckTimeout = 'health_check_timeout',\n\n  /**\n   * A timer used in online_state_tracker.ts to transition from\n   * OnlineState.Unknown to Offline after a set timeout, rather than waiting\n   * indefinitely for success or failure.\n   */\n  OnlineStateTimeout = 'online_state_timeout',\n\n  /**\n   * A timer used to update the client metadata in IndexedDb, which is used\n   * to determine the primary leaseholder.\n   */\n  ClientMetadataRefresh = 'client_metadata_refresh',\n\n  /** A timer used to periodically attempt LRU Garbage collection */\n  LruGarbageCollection = 'lru_garbage_collection',\n\n  /**\n   * A timer used to retry transactions. Since there can be multiple concurrent\n   * transactions, multiple of these may be in the queue at a given time.\n   */\n  TransactionRetry = 'transaction_retry',\n\n  /**\n   * A timer used to retry operations scheduled via retryable AsyncQueue\n   * operations.\n   */\n  AsyncQueueRetry = 'async_queue_retry',\n\n  /**\n   *  A timer used to periodically attempt index backfill.\n   */\n  IndexBackfill = 'index_backfill'\n}\n\n/**\n * Represents an operation scheduled to be run in the future on an AsyncQueue.\n *\n * It is created via DelayedOperation.createAndSchedule().\n *\n * Supports cancellation (via cancel()) and early execution (via skipDelay()).\n *\n * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type\n * in newer versions of TypeScript defines `finally`, which is not available in\n * IE.\n */\nexport class DelayedOperation<T extends unknown> implements PromiseLike<T> {\n  // handle for use with clearTimeout(), or null if the operation has been\n  // executed or canceled already.\n  private timerHandle: TimerHandle | null;\n\n  private readonly deferred = new Deferred<T>();\n\n  private constructor(\n    private readonly asyncQueue: AsyncQueue,\n    readonly timerId: TimerId,\n    readonly targetTimeMs: number,\n    private readonly op: () => Promise<T>,\n    private readonly removalCallback: (op: DelayedOperation<T>) => void\n  ) {\n    // It's normal for the deferred promise to be canceled (due to cancellation)\n    // and so we attach a dummy catch callback to avoid\n    // 'UnhandledPromiseRejectionWarning' log spam.\n    this.deferred.promise.catch(err => {});\n  }\n\n  get promise(): Promise<T> {\n    return this.deferred.promise;\n  }\n\n  /**\n   * Creates and returns a DelayedOperation that has been scheduled to be\n   * executed on the provided asyncQueue after the provided delayMs.\n   *\n   * @param asyncQueue - The queue to schedule the operation on.\n   * @param id - A Timer ID identifying the type of operation this is.\n   * @param delayMs - The delay (ms) before the operation should be scheduled.\n   * @param op - The operation to run.\n   * @param removalCallback - A callback to be called synchronously once the\n   *   operation is executed or canceled, notifying the AsyncQueue to remove it\n   *   from its delayedOperations list.\n   *   PORTING NOTE: This exists to prevent making removeDelayedOperation() and\n   *   the DelayedOperation class public.\n   */\n  static createAndSchedule<R extends unknown>(\n    asyncQueue: AsyncQueue,\n    timerId: TimerId,\n    delayMs: number,\n    op: () => Promise<R>,\n    removalCallback: (op: DelayedOperation<R>) => void\n  ): DelayedOperation<R> {\n    const targetTime = Date.now() + delayMs;\n    const delayedOp = new DelayedOperation(\n      asyncQueue,\n      timerId,\n      targetTime,\n      op,\n      removalCallback\n    );\n    delayedOp.start(delayMs);\n    return delayedOp;\n  }\n\n  /**\n   * Starts the timer. This is called immediately after construction by\n   * createAndSchedule().\n   */\n  private start(delayMs: number): void {\n    this.timerHandle = setTimeout(() => this.handleDelayElapsed(), delayMs);\n  }\n\n  /**\n   * Queues the operation to run immediately (if it hasn't already been run or\n   * canceled).\n   */\n  skipDelay(): void {\n    return this.handleDelayElapsed();\n  }\n\n  /**\n   * Cancels the operation if it hasn't already been executed or canceled. The\n   * promise will be rejected.\n   *\n   * As long as the operation has not yet been run, calling cancel() provides a\n   * guarantee that the operation will not be run.\n   */\n  cancel(reason?: string): void {\n    if (this.timerHandle !== null) {\n      this.clearTimeout();\n      this.deferred.reject(\n        new FirestoreError(\n          Code.CANCELLED,\n          'Operation cancelled' + (reason ? ': ' + reason : '')\n        )\n      );\n    }\n  }\n\n  then = this.deferred.promise.then.bind(this.deferred.promise);\n\n  private handleDelayElapsed(): void {\n    this.asyncQueue.enqueueAndForget(() => {\n      if (this.timerHandle !== null) {\n        this.clearTimeout();\n        return this.op().then(result => {\n          return this.deferred.resolve(result);\n        });\n      } else {\n        return Promise.resolve();\n      }\n    });\n  }\n\n  private clearTimeout(): void {\n    if (this.timerHandle !== null) {\n      this.removalCallback(this);\n      clearTimeout(this.timerHandle);\n      this.timerHandle = null;\n    }\n  }\n}\n\nexport interface AsyncQueue {\n  // Is this AsyncQueue being shut down? If true, this instance will not enqueue\n  // any new operations, Promises from enqueue requests will not resolve.\n  readonly isShuttingDown: boolean;\n\n  /**\n   * Adds a new operation to the queue without waiting for it to complete (i.e.\n   * we ignore the Promise result).\n   */\n  enqueueAndForget<T extends unknown>(op: () => Promise<T>): void;\n\n  /**\n   * Regardless if the queue has initialized shutdown, adds a new operation to the\n   * queue without waiting for it to complete (i.e. we ignore the Promise result).\n   */\n  enqueueAndForgetEvenWhileRestricted<T extends unknown>(\n    op: () => Promise<T>\n  ): void;\n\n  /**\n   * Initialize the shutdown of this queue. Once this method is called, the\n   * only possible way to request running an operation is through\n   * `enqueueEvenWhileRestricted()`.\n   *\n   * @param purgeExistingTasks Whether already enqueued tasked should be\n   * rejected (unless enqueued wih `enqueueEvenWhileRestricted()`). Defaults\n   * to false.\n   */\n  enterRestrictedMode(purgeExistingTasks?: boolean): void;\n\n  /**\n   * Adds a new operation to the queue. Returns a promise that will be resolved\n   * when the promise returned by the new operation is (with its value).\n   */\n  enqueue<T extends unknown>(op: () => Promise<T>): Promise<T>;\n\n  /**\n   * Enqueue a retryable operation.\n   *\n   * A retryable operation is rescheduled with backoff if it fails with a\n   * IndexedDbTransactionError (the error type used by SimpleDb). All\n   * retryable operations are executed in order and only run if all prior\n   * operations were retried successfully.\n   */\n  enqueueRetryable(op: () => Promise<void>): void;\n\n  /**\n   * Schedules an operation to be queued on the AsyncQueue once the specified\n   * `delayMs` has elapsed. The returned DelayedOperation can be used to cancel\n   * or fast-forward the operation prior to its running.\n   */\n  enqueueAfterDelay<T extends unknown>(\n    timerId: TimerId,\n    delayMs: number,\n    op: () => Promise<T>\n  ): DelayedOperation<T>;\n\n  /**\n   * Verifies there's an operation currently in-progress on the AsyncQueue.\n   * Unfortunately we can't verify that the running code is in the promise chain\n   * of that operation, so this isn't a foolproof check, but it should be enough\n   * to catch some bugs.\n   */\n  verifyOperationInProgress(): void;\n}\n\n/**\n * Returns a FirestoreError that can be surfaced to the user if the provided\n * error is an IndexedDbTransactionError. Re-throws the error otherwise.\n */\nexport function wrapInUserErrorIfRecoverable(\n  e: Error,\n  msg: string\n): FirestoreError {\n  logError(LOG_TAG, `${msg}: ${e}`);\n  if (isIndexedDbTransactionError(e)) {\n    return new FirestoreError(Code.UNAVAILABLE, `${msg}: ${e}`);\n  } else {\n    throw e;\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SortedMap } from '../util/sorted_map';\n\nimport { documentMap } from './collections';\nimport { Document } from './document';\nimport { DocumentComparator } from './document_comparator';\nimport { DocumentKey } from './document_key';\n\n/**\n * DocumentSet is an immutable (copy-on-write) collection that holds documents\n * in order specified by the provided comparator. We always add a document key\n * comparator on top of what is provided to guarantee document equality based on\n * the key.\n */\n\nexport class DocumentSet {\n  /**\n   * Returns an empty copy of the existing DocumentSet, using the same\n   * comparator.\n   */\n  static emptySet(oldSet: DocumentSet): DocumentSet {\n    return new DocumentSet(oldSet.comparator);\n  }\n\n  private comparator: DocumentComparator;\n  private keyedMap: SortedMap<DocumentKey, Document>;\n  private sortedSet: SortedMap<Document, null>;\n\n  /** The default ordering is by key if the comparator is omitted */\n  constructor(comp?: DocumentComparator) {\n    // We are adding document key comparator to the end as it's the only\n    // guaranteed unique property of a document.\n    if (comp) {\n      this.comparator = (d1: Document, d2: Document) =>\n        comp(d1, d2) || DocumentKey.comparator(d1.key, d2.key);\n    } else {\n      this.comparator = (d1: Document, d2: Document) =>\n        DocumentKey.comparator(d1.key, d2.key);\n    }\n\n    this.keyedMap = documentMap();\n    this.sortedSet = new SortedMap<Document, null>(this.comparator);\n  }\n\n  has(key: DocumentKey): boolean {\n    return this.keyedMap.get(key) != null;\n  }\n\n  get(key: DocumentKey): Document | null {\n    return this.keyedMap.get(key);\n  }\n\n  first(): Document | null {\n    return this.sortedSet.minKey();\n  }\n\n  last(): Document | null {\n    return this.sortedSet.maxKey();\n  }\n\n  isEmpty(): boolean {\n    return this.sortedSet.isEmpty();\n  }\n\n  /**\n   * Returns the index of the provided key in the document set, or -1 if the\n   * document key is not present in the set;\n   */\n  indexOf(key: DocumentKey): number {\n    const doc = this.keyedMap.get(key);\n    return doc ? this.sortedSet.indexOf(doc) : -1;\n  }\n\n  get size(): number {\n    return this.sortedSet.size;\n  }\n\n  /** Iterates documents in order defined by \"comparator\" */\n  forEach(cb: (doc: Document) => void): void {\n    this.sortedSet.inorderTraversal((k, v) => {\n      cb(k);\n      return false;\n    });\n  }\n\n  /** Inserts or updates a document with the same key */\n  add(doc: Document): DocumentSet {\n    // First remove the element if we have it.\n    const set = this.delete(doc.key);\n    return set.copy(\n      set.keyedMap.insert(doc.key, doc),\n      set.sortedSet.insert(doc, null)\n    );\n  }\n\n  /** Deletes a document with a given key */\n  delete(key: DocumentKey): DocumentSet {\n    const doc = this.get(key);\n    if (!doc) {\n      return this;\n    }\n\n    return this.copy(this.keyedMap.remove(key), this.sortedSet.remove(doc));\n  }\n\n  isEqual(other: DocumentSet | null | undefined): boolean {\n    if (!(other instanceof DocumentSet)) {\n      return false;\n    }\n    if (this.size !== other.size) {\n      return false;\n    }\n\n    const thisIt = this.sortedSet.getIterator();\n    const otherIt = other.sortedSet.getIterator();\n    while (thisIt.hasNext()) {\n      const thisDoc = thisIt.getNext().key;\n      const otherDoc = otherIt.getNext().key;\n      if (!thisDoc.isEqual(otherDoc)) {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  toString(): string {\n    const docStrings: string[] = [];\n    this.forEach(doc => {\n      docStrings.push(doc.toString());\n    });\n    if (docStrings.length === 0) {\n      return 'DocumentSet ()';\n    } else {\n      return 'DocumentSet (\\n  ' + docStrings.join('  \\n') + '\\n)';\n    }\n  }\n\n  private copy(\n    keyedMap: SortedMap<DocumentKey, Document>,\n    sortedSet: SortedMap<Document, null>\n  ): DocumentSet {\n    const newSet = new DocumentSet();\n    newSet.comparator = this.comparator;\n    newSet.keyedMap = keyedMap;\n    newSet.sortedSet = sortedSet;\n    return newSet;\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DocumentKeySet } from '../model/collections';\nimport { Document } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport { DocumentSet } from '../model/document_set';\nimport { fail } from '../util/assert';\nimport { SortedMap } from '../util/sorted_map';\n\nimport { Query, queryEquals } from './query';\n\nexport const enum ChangeType {\n  Added,\n  Removed,\n  Modified,\n  Metadata\n}\n\nexport interface DocumentViewChange {\n  type: ChangeType;\n  doc: Document;\n}\n\nexport const enum SyncState {\n  Local,\n  Synced\n}\n\n/**\n * DocumentChangeSet keeps track of a set of changes to docs in a query, merging\n * duplicate events for the same doc.\n */\nexport class DocumentChangeSet {\n  private changeMap = new SortedMap<DocumentKey, DocumentViewChange>(\n    DocumentKey.comparator\n  );\n\n  track(change: DocumentViewChange): void {\n    const key = change.doc.key;\n    const oldChange = this.changeMap.get(key);\n    if (!oldChange) {\n      this.changeMap = this.changeMap.insert(key, change);\n      return;\n    }\n\n    // Merge the new change with the existing change.\n    if (\n      change.type !== ChangeType.Added &&\n      oldChange.type === ChangeType.Metadata\n    ) {\n      this.changeMap = this.changeMap.insert(key, change);\n    } else if (\n      change.type === ChangeType.Metadata &&\n      oldChange.type !== ChangeType.Removed\n    ) {\n      this.changeMap = this.changeMap.insert(key, {\n        type: oldChange.type,\n        doc: change.doc\n      });\n    } else if (\n      change.type === ChangeType.Modified &&\n      oldChange.type === ChangeType.Modified\n    ) {\n      this.changeMap = this.changeMap.insert(key, {\n        type: ChangeType.Modified,\n        doc: change.doc\n      });\n    } else if (\n      change.type === ChangeType.Modified &&\n      oldChange.type === ChangeType.Added\n    ) {\n      this.changeMap = this.changeMap.insert(key, {\n        type: ChangeType.Added,\n        doc: change.doc\n      });\n    } else if (\n      change.type === ChangeType.Removed &&\n      oldChange.type === ChangeType.Added\n    ) {\n      this.changeMap = this.changeMap.remove(key);\n    } else if (\n      change.type === ChangeType.Removed &&\n      oldChange.type === ChangeType.Modified\n    ) {\n      this.changeMap = this.changeMap.insert(key, {\n        type: ChangeType.Removed,\n        doc: oldChange.doc\n      });\n    } else if (\n      change.type === ChangeType.Added &&\n      oldChange.type === ChangeType.Removed\n    ) {\n      this.changeMap = this.changeMap.insert(key, {\n        type: ChangeType.Modified,\n        doc: change.doc\n      });\n    } else {\n      // This includes these cases, which don't make sense:\n      // Added->Added\n      // Removed->Removed\n      // Modified->Added\n      // Removed->Modified\n      // Metadata->Added\n      // Removed->Metadata\n      fail(\n        'unsupported combination of changes: ' +\n          JSON.stringify(change) +\n          ' after ' +\n          JSON.stringify(oldChange)\n      );\n    }\n  }\n\n  getChanges(): DocumentViewChange[] {\n    const changes: DocumentViewChange[] = [];\n    this.changeMap.inorderTraversal(\n      (key: DocumentKey, change: DocumentViewChange) => {\n        changes.push(change);\n      }\n    );\n    return changes;\n  }\n}\n\nexport class ViewSnapshot {\n  constructor(\n    readonly query: Query,\n    readonly docs: DocumentSet,\n    readonly oldDocs: DocumentSet,\n    readonly docChanges: DocumentViewChange[],\n    readonly mutatedKeys: DocumentKeySet,\n    readonly fromCache: boolean,\n    readonly syncStateChanged: boolean,\n    readonly excludesMetadataChanges: boolean,\n    readonly hasCachedResults: boolean\n  ) {}\n\n  /** Returns a view snapshot as if all documents in the snapshot were added. */\n  static fromInitialDocuments(\n    query: Query,\n    documents: DocumentSet,\n    mutatedKeys: DocumentKeySet,\n    fromCache: boolean,\n    hasCachedResults: boolean\n  ): ViewSnapshot {\n    const changes: DocumentViewChange[] = [];\n    documents.forEach(doc => {\n      changes.push({ type: ChangeType.Added, doc });\n    });\n\n    return new ViewSnapshot(\n      query,\n      documents,\n      DocumentSet.emptySet(documents),\n      changes,\n      mutatedKeys,\n      fromCache,\n      /* syncStateChanged= */ true,\n      /* excludesMetadataChanges= */ false,\n      hasCachedResults\n    );\n  }\n\n  get hasPendingWrites(): boolean {\n    return !this.mutatedKeys.isEmpty();\n  }\n\n  isEqual(other: ViewSnapshot): boolean {\n    if (\n      this.fromCache !== other.fromCache ||\n      this.hasCachedResults !== other.hasCachedResults ||\n      this.syncStateChanged !== other.syncStateChanged ||\n      !this.mutatedKeys.isEqual(other.mutatedKeys) ||\n      !queryEquals(this.query, other.query) ||\n      !this.docs.isEqual(other.docs) ||\n      !this.oldDocs.isEqual(other.oldDocs)\n    ) {\n      return false;\n    }\n    const changes: DocumentViewChange[] = this.docChanges;\n    const otherChanges: DocumentViewChange[] = other.docChanges;\n    if (changes.length !== otherChanges.length) {\n      return false;\n    }\n    for (let i = 0; i < changes.length; i++) {\n      if (\n        changes[i].type !== otherChanges[i].type ||\n        !changes[i].doc.isEqual(otherChanges[i].doc)\n      ) {\n        return false;\n      }\n    }\n    return true;\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { debugAssert, debugCast } from '../util/assert';\nimport { wrapInUserErrorIfRecoverable } from '../util/async_queue';\nimport { FirestoreError } from '../util/error';\nimport { EventHandler } from '../util/misc';\nimport { ObjectMap } from '../util/obj_map';\n\nimport { canonifyQuery, Query, queryEquals, stringifyQuery } from './query';\nimport { OnlineState } from './types';\nimport { ChangeType, DocumentViewChange, ViewSnapshot } from './view_snapshot';\n\n/**\n * Holds the listeners and the last received ViewSnapshot for a query being\n * tracked by EventManager.\n */\nclass QueryListenersInfo {\n  viewSnap: ViewSnapshot | undefined = undefined;\n  listeners: QueryListener[] = [];\n\n  // Helper methods that checks if the query has listeners that listening to remote store\n  hasRemoteListeners(): boolean {\n    return this.listeners.some(listener => listener.listensToRemoteStore());\n  }\n}\n\n/**\n * Interface for handling events from the EventManager.\n */\nexport interface Observer<T> {\n  next: EventHandler<T>;\n  error: EventHandler<FirestoreError>;\n}\n\n/**\n * EventManager is responsible for mapping queries to query event emitters.\n * It handles \"fan-out\". -- Identical queries will re-use the same watch on the\n * backend.\n *\n * PORTING NOTE: On Web, EventManager `onListen` and `onUnlisten` need to be\n * assigned to SyncEngine's `listen()` and `unlisten()` API before usage. This\n * allows users to tree-shake the Watch logic.\n */\nexport interface EventManager {\n  onListen?: (\n    query: Query,\n    enableRemoteListen: boolean\n  ) => Promise<ViewSnapshot>;\n  onUnlisten?: (query: Query, disableRemoteListen: boolean) => Promise<void>;\n  onFirstRemoteStoreListen?: (query: Query) => Promise<void>;\n  onLastRemoteStoreUnlisten?: (query: Query) => Promise<void>;\n}\n\nexport function newEventManager(): EventManager {\n  return new EventManagerImpl();\n}\n\nexport class EventManagerImpl implements EventManager {\n  queries = new ObjectMap<Query, QueryListenersInfo>(\n    q => canonifyQuery(q),\n    queryEquals\n  );\n\n  onlineState = OnlineState.Unknown;\n\n  snapshotsInSyncListeners: Set<Observer<void>> = new Set();\n\n  /** Callback invoked when a Query is first listen to. */\n  onListen?: (\n    query: Query,\n    enableRemoteListen: boolean\n  ) => Promise<ViewSnapshot>;\n  /** Callback invoked once all listeners to a Query are removed. */\n  onUnlisten?: (query: Query, disableRemoteListen: boolean) => Promise<void>;\n\n  /**\n   * Callback invoked when a Query starts listening to the remote store, while\n   * already listening to the cache.\n   */\n  onFirstRemoteStoreListen?: (query: Query) => Promise<void>;\n  /**\n   * Callback invoked when a Query stops listening to the remote store, while\n   * still listening to the cache.\n   */\n  onLastRemoteStoreUnlisten?: (query: Query) => Promise<void>;\n}\n\nfunction validateEventManager(eventManagerImpl: EventManagerImpl): void {\n  debugAssert(!!eventManagerImpl.onListen, 'onListen not set');\n  debugAssert(\n    !!eventManagerImpl.onFirstRemoteStoreListen,\n    'onFirstRemoteStoreListen not set'\n  );\n  debugAssert(!!eventManagerImpl.onUnlisten, 'onUnlisten not set');\n  debugAssert(\n    !!eventManagerImpl.onLastRemoteStoreUnlisten,\n    'onLastRemoteStoreUnlisten not set'\n  );\n}\n\nconst enum ListenerSetupAction {\n  InitializeLocalListenAndRequireWatchConnection,\n  InitializeLocalListenOnly,\n  RequireWatchConnectionOnly,\n  NoActionRequired\n}\n\nconst enum ListenerRemovalAction {\n  TerminateLocalListenAndRequireWatchDisconnection,\n  TerminateLocalListenOnly,\n  RequireWatchDisconnectionOnly,\n  NoActionRequired\n}\n\nexport async function eventManagerListen(\n  eventManager: EventManager,\n  listener: QueryListener\n): Promise<void> {\n  const eventManagerImpl = debugCast(eventManager, EventManagerImpl);\n  validateEventManager(eventManagerImpl);\n\n  let listenerAction = ListenerSetupAction.NoActionRequired;\n\n  const query = listener.query;\n\n  let queryInfo = eventManagerImpl.queries.get(query);\n  if (!queryInfo) {\n    queryInfo = new QueryListenersInfo();\n    listenerAction = listener.listensToRemoteStore()\n      ? ListenerSetupAction.InitializeLocalListenAndRequireWatchConnection\n      : ListenerSetupAction.InitializeLocalListenOnly;\n  } else if (\n    !queryInfo.hasRemoteListeners() &&\n    listener.listensToRemoteStore()\n  ) {\n    // Query has been listening to local cache, and tries to add a new listener sourced from watch.\n    listenerAction = ListenerSetupAction.RequireWatchConnectionOnly;\n  }\n\n  try {\n    switch (listenerAction) {\n      case ListenerSetupAction.InitializeLocalListenAndRequireWatchConnection:\n        queryInfo.viewSnap = await eventManagerImpl.onListen!(\n          query,\n          /** enableRemoteListen= */ true\n        );\n        break;\n      case ListenerSetupAction.InitializeLocalListenOnly:\n        queryInfo.viewSnap = await eventManagerImpl.onListen!(\n          query,\n          /** enableRemoteListen= */ false\n        );\n        break;\n      case ListenerSetupAction.RequireWatchConnectionOnly:\n        await eventManagerImpl.onFirstRemoteStoreListen!(query);\n        break;\n      default:\n        break;\n    }\n  } catch (e) {\n    const firestoreError = wrapInUserErrorIfRecoverable(\n      e as Error,\n      `Initialization of query '${stringifyQuery(listener.query)}' failed`\n    );\n    listener.onError(firestoreError);\n    return;\n  }\n\n  eventManagerImpl.queries.set(query, queryInfo);\n  queryInfo.listeners.push(listener);\n\n  // Run global snapshot listeners if a consistent snapshot has been emitted.\n  const raisedEvent = listener.applyOnlineStateChange(\n    eventManagerImpl.onlineState\n  );\n  debugAssert(\n    !raisedEvent,\n    \"applyOnlineStateChange() shouldn't raise an event for brand-new listeners.\"\n  );\n\n  if (queryInfo.viewSnap) {\n    const raisedEvent = listener.onViewSnapshot(queryInfo.viewSnap);\n    if (raisedEvent) {\n      raiseSnapshotsInSyncEvent(eventManagerImpl);\n    }\n  }\n}\n\nexport async function eventManagerUnlisten(\n  eventManager: EventManager,\n  listener: QueryListener\n): Promise<void> {\n  const eventManagerImpl = debugCast(eventManager, EventManagerImpl);\n  validateEventManager(eventManagerImpl);\n\n  const query = listener.query;\n  let listenerAction = ListenerRemovalAction.NoActionRequired;\n\n  const queryInfo = eventManagerImpl.queries.get(query);\n  if (queryInfo) {\n    const i = queryInfo.listeners.indexOf(listener);\n    if (i >= 0) {\n      queryInfo.listeners.splice(i, 1);\n\n      if (queryInfo.listeners.length === 0) {\n        listenerAction = listener.listensToRemoteStore()\n          ? ListenerRemovalAction.TerminateLocalListenAndRequireWatchDisconnection\n          : ListenerRemovalAction.TerminateLocalListenOnly;\n      } else if (\n        !queryInfo.hasRemoteListeners() &&\n        listener.listensToRemoteStore()\n      ) {\n        // The removed listener is the last one that sourced from watch.\n        listenerAction = ListenerRemovalAction.RequireWatchDisconnectionOnly;\n      }\n    }\n  }\n  switch (listenerAction) {\n    case ListenerRemovalAction.TerminateLocalListenAndRequireWatchDisconnection:\n      eventManagerImpl.queries.delete(query);\n      return eventManagerImpl.onUnlisten!(\n        query,\n        /** disableRemoteListen= */ true\n      );\n    case ListenerRemovalAction.TerminateLocalListenOnly:\n      eventManagerImpl.queries.delete(query);\n      return eventManagerImpl.onUnlisten!(\n        query,\n        /** disableRemoteListen= */ false\n      );\n    case ListenerRemovalAction.RequireWatchDisconnectionOnly:\n      return eventManagerImpl.onLastRemoteStoreUnlisten!(query);\n    default:\n      return;\n  }\n}\n\nexport function eventManagerOnWatchChange(\n  eventManager: EventManager,\n  viewSnaps: ViewSnapshot[]\n): void {\n  const eventManagerImpl = debugCast(eventManager, EventManagerImpl);\n\n  let raisedEvent = false;\n  for (const viewSnap of viewSnaps) {\n    const query = viewSnap.query;\n    const queryInfo = eventManagerImpl.queries.get(query);\n    if (queryInfo) {\n      for (const listener of queryInfo.listeners) {\n        if (listener.onViewSnapshot(viewSnap)) {\n          raisedEvent = true;\n        }\n      }\n      queryInfo.viewSnap = viewSnap;\n    }\n  }\n  if (raisedEvent) {\n    raiseSnapshotsInSyncEvent(eventManagerImpl);\n  }\n}\n\nexport function eventManagerOnWatchError(\n  eventManager: EventManager,\n  query: Query,\n  error: FirestoreError\n): void {\n  const eventManagerImpl = debugCast(eventManager, EventManagerImpl);\n\n  const queryInfo = eventManagerImpl.queries.get(query);\n  if (queryInfo) {\n    for (const listener of queryInfo.listeners) {\n      listener.onError(error);\n    }\n  }\n\n  // Remove all listeners. NOTE: We don't need to call syncEngine.unlisten()\n  // after an error.\n  eventManagerImpl.queries.delete(query);\n}\n\nexport function eventManagerOnOnlineStateChange(\n  eventManager: EventManager,\n  onlineState: OnlineState\n): void {\n  const eventManagerImpl = debugCast(eventManager, EventManagerImpl);\n\n  eventManagerImpl.onlineState = onlineState;\n  let raisedEvent = false;\n  eventManagerImpl.queries.forEach((_, queryInfo) => {\n    for (const listener of queryInfo.listeners) {\n      // Run global snapshot listeners if a consistent snapshot has been emitted.\n      if (listener.applyOnlineStateChange(onlineState)) {\n        raisedEvent = true;\n      }\n    }\n  });\n  if (raisedEvent) {\n    raiseSnapshotsInSyncEvent(eventManagerImpl);\n  }\n}\n\nexport function addSnapshotsInSyncListener(\n  eventManager: EventManager,\n  observer: Observer<void>\n): void {\n  const eventManagerImpl = debugCast(eventManager, EventManagerImpl);\n\n  eventManagerImpl.snapshotsInSyncListeners.add(observer);\n  // Immediately fire an initial event, indicating all existing listeners\n  // are in-sync.\n  observer.next();\n}\n\nexport function removeSnapshotsInSyncListener(\n  eventManager: EventManager,\n  observer: Observer<void>\n): void {\n  const eventManagerImpl = debugCast(eventManager, EventManagerImpl);\n  eventManagerImpl.snapshotsInSyncListeners.delete(observer);\n}\n\n// Call all global snapshot listeners that have been set.\nfunction raiseSnapshotsInSyncEvent(eventManagerImpl: EventManagerImpl): void {\n  eventManagerImpl.snapshotsInSyncListeners.forEach(observer => {\n    observer.next();\n  });\n}\n\nexport enum ListenerDataSource {\n  /** Listen to both cache and server changes */\n  Default = 'default',\n\n  /** Listen to changes in cache only */\n  Cache = 'cache'\n}\n\nexport interface ListenOptions {\n  /** Raise events even when only the metadata changes */\n  readonly includeMetadataChanges?: boolean;\n\n  /**\n   * Wait for a sync with the server when online, but still raise events while\n   * offline.\n   */\n  readonly waitForSyncWhenOnline?: boolean;\n\n  /** Set the source events raised from. */\n  readonly source?: ListenerDataSource;\n}\n\n/**\n * QueryListener takes a series of internal view snapshots and determines\n * when to raise the event.\n *\n * It uses an Observer to dispatch events.\n */\nexport class QueryListener {\n  /**\n   * Initial snapshots (e.g. from cache) may not be propagated to the wrapped\n   * observer. This flag is set to true once we've actually raised an event.\n   */\n  private raisedInitialEvent = false;\n\n  private options: ListenOptions;\n\n  private snap: ViewSnapshot | null = null;\n\n  private onlineState = OnlineState.Unknown;\n\n  constructor(\n    readonly query: Query,\n    private queryObserver: Observer<ViewSnapshot>,\n    options?: ListenOptions\n  ) {\n    this.options = options || {};\n  }\n\n  /**\n   * Applies the new ViewSnapshot to this listener, raising a user-facing event\n   * if applicable (depending on what changed, whether the user has opted into\n   * metadata-only changes, etc.). Returns true if a user-facing event was\n   * indeed raised.\n   */\n  onViewSnapshot(snap: ViewSnapshot): boolean {\n    debugAssert(\n      snap.docChanges.length > 0 || snap.syncStateChanged,\n      'We got a new snapshot with no changes?'\n    );\n\n    if (!this.options.includeMetadataChanges) {\n      // Remove the metadata only changes.\n      const docChanges: DocumentViewChange[] = [];\n      for (const docChange of snap.docChanges) {\n        if (docChange.type !== ChangeType.Metadata) {\n          docChanges.push(docChange);\n        }\n      }\n      snap = new ViewSnapshot(\n        snap.query,\n        snap.docs,\n        snap.oldDocs,\n        docChanges,\n        snap.mutatedKeys,\n        snap.fromCache,\n        snap.syncStateChanged,\n        /* excludesMetadataChanges= */ true,\n        snap.hasCachedResults\n      );\n    }\n    let raisedEvent = false;\n    if (!this.raisedInitialEvent) {\n      if (this.shouldRaiseInitialEvent(snap, this.onlineState)) {\n        this.raiseInitialEvent(snap);\n        raisedEvent = true;\n      }\n    } else if (this.shouldRaiseEvent(snap)) {\n      this.queryObserver.next(snap);\n      raisedEvent = true;\n    }\n\n    this.snap = snap;\n    return raisedEvent;\n  }\n\n  onError(error: FirestoreError): void {\n    this.queryObserver.error(error);\n  }\n\n  /** Returns whether a snapshot was raised. */\n  applyOnlineStateChange(onlineState: OnlineState): boolean {\n    this.onlineState = onlineState;\n    let raisedEvent = false;\n    if (\n      this.snap &&\n      !this.raisedInitialEvent &&\n      this.shouldRaiseInitialEvent(this.snap, onlineState)\n    ) {\n      this.raiseInitialEvent(this.snap);\n      raisedEvent = true;\n    }\n    return raisedEvent;\n  }\n\n  private shouldRaiseInitialEvent(\n    snap: ViewSnapshot,\n    onlineState: OnlineState\n  ): boolean {\n    debugAssert(\n      !this.raisedInitialEvent,\n      'Determining whether to raise first event but already had first event'\n    );\n\n    // Always raise the first event when we're synced\n    if (!snap.fromCache) {\n      return true;\n    }\n\n    // Always raise event if listening to cache\n    if (!this.listensToRemoteStore()) {\n      return true;\n    }\n\n    // NOTE: We consider OnlineState.Unknown as online (it should become Offline\n    // or Online if we wait long enough).\n    const maybeOnline = onlineState !== OnlineState.Offline;\n    // Don't raise the event if we're online, aren't synced yet (checked\n    // above) and are waiting for a sync.\n    if (this.options.waitForSyncWhenOnline && maybeOnline) {\n      debugAssert(\n        snap.fromCache,\n        'Waiting for sync, but snapshot is not from cache'\n      );\n      return false;\n    }\n\n    // Raise data from cache if we have any documents, have cached results before,\n    // or we are offline.\n    return (\n      !snap.docs.isEmpty() ||\n      snap.hasCachedResults ||\n      onlineState === OnlineState.Offline\n    );\n  }\n\n  private shouldRaiseEvent(snap: ViewSnapshot): boolean {\n    // We don't need to handle includeDocumentMetadataChanges here because\n    // the Metadata only changes have already been stripped out if needed.\n    // At this point the only changes we will see are the ones we should\n    // propagate.\n    if (snap.docChanges.length > 0) {\n      return true;\n    }\n\n    const hasPendingWritesChanged =\n      this.snap && this.snap.hasPendingWrites !== snap.hasPendingWrites;\n    if (snap.syncStateChanged || hasPendingWritesChanged) {\n      return this.options.includeMetadataChanges === true;\n    }\n\n    // Generally we should have hit one of the cases above, but it's possible\n    // to get here if there were only metadata docChanges and they got\n    // stripped out.\n    return false;\n  }\n\n  private raiseInitialEvent(snap: ViewSnapshot): void {\n    debugAssert(\n      !this.raisedInitialEvent,\n      'Trying to raise initial events for second time'\n    );\n    snap = ViewSnapshot.fromInitialDocuments(\n      snap.query,\n      snap.docs,\n      snap.mutatedKeys,\n      snap.fromCache,\n      snap.hasCachedResults\n    );\n    this.raisedInitialEvent = true;\n    this.queryObserver.next(snap);\n  }\n\n  listensToRemoteStore(): boolean {\n    return this.options.source !== ListenerDataSource.Cache;\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  BundleElement,\n  BundleMetadata\n} from '../protos/firestore_bundle_proto';\nimport { JsonProtoSerializer } from '../remote/serializer';\n\n/**\n * A complete element in the bundle stream, together with the byte length it\n * occupies in the stream.\n */\nexport class SizedBundleElement {\n  constructor(\n    public readonly payload: BundleElement,\n    // How many bytes this element takes to store in the bundle.\n    public readonly byteLength: number\n  ) {}\n\n  isBundleMetadata(): boolean {\n    return 'metadata' in this.payload;\n  }\n}\n\nexport type BundleSource =\n  | ReadableStream<Uint8Array>\n  | ArrayBuffer\n  | Uint8Array;\n\n/**\n * A class representing a bundle.\n *\n * Takes a bundle stream or buffer, and presents abstractions to read bundled\n * elements out of the underlying content.\n */\nexport interface BundleReader {\n  serializer: JsonProtoSerializer;\n\n  close(): Promise<void>;\n\n  /**\n   * Returns the metadata of the bundle.\n   */\n  getMetadata(): Promise<BundleMetadata>;\n\n  /**\n   * Returns the next BundleElement (together with its byte size in the bundle)\n   * that has not been read from underlying ReadableStream. Returns null if we\n   * have reached the end of the stream.\n   */\n  nextElement(): Promise<SizedBundleElement | null>;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { LoadBundleTaskProgress } from '@firebase/firestore-types';\n\nimport { LocalStore } from '../local/local_store';\nimport {\n  localStoreApplyBundledDocuments,\n  localStoreSaveNamedQuery\n} from '../local/local_store_impl';\nimport { documentKeySet, DocumentKeySet } from '../model/collections';\nimport { MutableDocument } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport { ResourcePath } from '../model/path';\nimport {\n  BundleMetadata as ProtoBundleMetadata,\n  NamedQuery as ProtoNamedQuery\n} from '../protos/firestore_bundle_proto';\nimport { Timestamp as ApiTimestamp } from '../protos/firestore_proto_api';\nimport {\n  fromDocument,\n  fromName,\n  fromVersion,\n  JsonProtoSerializer\n} from '../remote/serializer';\nimport { debugAssert } from '../util/assert';\nimport { SizedBundleElement } from '../util/bundle_reader';\n\nimport {\n  BundleConverter,\n  BundledDocument,\n  BundledDocuments,\n  BundleLoadResult\n} from './bundle';\nimport { SnapshotVersion } from './snapshot_version';\n\n/**\n * Helper to convert objects from bundles to model objects in the SDK.\n */\nexport class BundleConverterImpl implements BundleConverter {\n  constructor(private readonly serializer: JsonProtoSerializer) {}\n\n  toDocumentKey(name: string): DocumentKey {\n    return fromName(this.serializer, name);\n  }\n\n  /**\n   * Converts a BundleDocument to a MutableDocument.\n   */\n  toMutableDocument(bundledDoc: BundledDocument): MutableDocument {\n    if (bundledDoc.metadata.exists) {\n      debugAssert(\n        !!bundledDoc.document,\n        'Document is undefined when metadata.exist is true.'\n      );\n      return fromDocument(this.serializer, bundledDoc.document!, false);\n    } else {\n      return MutableDocument.newNoDocument(\n        this.toDocumentKey(bundledDoc.metadata.name!),\n        this.toSnapshotVersion(bundledDoc.metadata.readTime!)\n      );\n    }\n  }\n\n  toSnapshotVersion(time: ApiTimestamp): SnapshotVersion {\n    return fromVersion(time);\n  }\n}\n\n/**\n * A class to process the elements from a bundle, load them into local\n * storage and provide progress update while loading.\n */\nexport class BundleLoader {\n  /** The current progress of loading */\n  private progress: LoadBundleTaskProgress;\n  /** Batched queries to be saved into storage */\n  private queries: ProtoNamedQuery[] = [];\n  /** Batched documents to be saved into storage */\n  private documents: BundledDocuments = [];\n  /** The collection groups affected by this bundle. */\n  private collectionGroups = new Set<string>();\n\n  constructor(\n    private bundleMetadata: ProtoBundleMetadata,\n    private localStore: LocalStore,\n    private serializer: JsonProtoSerializer\n  ) {\n    this.progress = bundleInitialProgress(bundleMetadata);\n  }\n\n  /**\n   * Adds an element from the bundle to the loader.\n   *\n   * Returns a new progress if adding the element leads to a new progress,\n   * otherwise returns null.\n   */\n  addSizedElement(element: SizedBundleElement): LoadBundleTaskProgress | null {\n    debugAssert(!element.isBundleMetadata(), 'Unexpected bundle metadata.');\n\n    this.progress.bytesLoaded += element.byteLength;\n\n    let documentsLoaded = this.progress.documentsLoaded;\n\n    if (element.payload.namedQuery) {\n      this.queries.push(element.payload.namedQuery);\n    } else if (element.payload.documentMetadata) {\n      this.documents.push({ metadata: element.payload.documentMetadata });\n      if (!element.payload.documentMetadata.exists) {\n        ++documentsLoaded;\n      }\n      const path = ResourcePath.fromString(\n        element.payload.documentMetadata.name!\n      );\n      debugAssert(\n        path.length >= 2,\n        'The document name does not point to a document.'\n      );\n      this.collectionGroups.add(path.get(path.length - 2));\n    } else if (element.payload.document) {\n      debugAssert(\n        this.documents.length > 0 &&\n          this.documents[this.documents.length - 1].metadata.name ===\n            element.payload.document.name,\n        'The document being added does not match the stored metadata.'\n      );\n      this.documents[this.documents.length - 1].document =\n        element.payload.document;\n      ++documentsLoaded;\n    }\n\n    if (documentsLoaded !== this.progress.documentsLoaded) {\n      this.progress.documentsLoaded = documentsLoaded;\n      return { ...this.progress };\n    }\n\n    return null;\n  }\n\n  private getQueryDocumentMapping(\n    documents: BundledDocuments\n  ): Map<string, DocumentKeySet> {\n    const queryDocumentMap = new Map<string, DocumentKeySet>();\n    const bundleConverter = new BundleConverterImpl(this.serializer);\n    for (const bundleDoc of documents) {\n      if (bundleDoc.metadata.queries) {\n        const documentKey = bundleConverter.toDocumentKey(\n          bundleDoc.metadata.name!\n        );\n        for (const queryName of bundleDoc.metadata.queries) {\n          const documentKeys = (\n            queryDocumentMap.get(queryName) || documentKeySet()\n          ).add(documentKey);\n          queryDocumentMap.set(queryName, documentKeys);\n        }\n      }\n    }\n\n    return queryDocumentMap;\n  }\n\n  /**\n   * Update the progress to 'Success' and return the updated progress.\n   */\n  async complete(): Promise<BundleLoadResult> {\n    debugAssert(\n      this.documents[this.documents.length - 1]?.metadata.exists !== true ||\n        !!this.documents[this.documents.length - 1].document,\n      'Bundled documents end with a document metadata element instead of a document.'\n    );\n    debugAssert(!!this.bundleMetadata.id, 'Bundle ID must be set.');\n\n    const changedDocs = await localStoreApplyBundledDocuments(\n      this.localStore,\n      new BundleConverterImpl(this.serializer),\n      this.documents,\n      this.bundleMetadata.id!\n    );\n\n    const queryDocumentMap = this.getQueryDocumentMapping(this.documents);\n\n    for (const q of this.queries) {\n      await localStoreSaveNamedQuery(\n        this.localStore,\n        q,\n        queryDocumentMap.get(q.name!)\n      );\n    }\n\n    this.progress.taskState = 'Success';\n    return {\n      progress: this.progress,\n      changedCollectionGroups: this.collectionGroups,\n      changedDocs\n    };\n  }\n}\n\n/**\n * Returns a `LoadBundleTaskProgress` representing the initial progress of\n * loading a bundle.\n */\nexport function bundleInitialProgress(\n  metadata: ProtoBundleMetadata\n): LoadBundleTaskProgress {\n  return {\n    taskState: 'Running',\n    documentsLoaded: 0,\n    bytesLoaded: 0,\n    totalDocuments: metadata.totalDocuments!,\n    totalBytes: metadata.totalBytes!\n  };\n}\n\n/**\n * Returns a `LoadBundleTaskProgress` representing the progress that the loading\n * has succeeded.\n */\nexport function bundleSuccessProgress(\n  metadata: ProtoBundleMetadata\n): LoadBundleTaskProgress {\n  return {\n    taskState: 'Success',\n    documentsLoaded: metadata.totalDocuments!,\n    bytesLoaded: metadata.totalBytes!,\n    totalDocuments: metadata.totalDocuments!,\n    totalBytes: metadata.totalBytes!\n  };\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { QueryResult } from '../local/local_store_impl';\nimport {\n  documentKeySet,\n  DocumentKeySet,\n  DocumentMap\n} from '../model/collections';\nimport { Document } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport { DocumentSet } from '../model/document_set';\nimport { TargetChange } from '../remote/remote_event';\nimport { debugAssert, fail } from '../util/assert';\n\nimport { LimitType, newQueryComparator, Query, queryMatches } from './query';\nimport { OnlineState } from './types';\nimport {\n  ChangeType,\n  DocumentChangeSet,\n  SyncState,\n  ViewSnapshot\n} from './view_snapshot';\n\nexport type LimboDocumentChange = AddedLimboDocument | RemovedLimboDocument;\nexport class AddedLimboDocument {\n  constructor(public key: DocumentKey) {}\n}\nexport class RemovedLimboDocument {\n  constructor(public key: DocumentKey) {}\n}\n\n/** The result of applying a set of doc changes to a view. */\nexport interface ViewDocumentChanges {\n  /** The new set of docs that should be in the view. */\n  documentSet: DocumentSet;\n  /** The diff of these docs with the previous set of docs. */\n  changeSet: DocumentChangeSet;\n  /**\n   * Whether the set of documents passed in was not sufficient to calculate the\n   * new state of the view and there needs to be another pass based on the\n   * local cache.\n   */\n  needsRefill: boolean;\n\n  mutatedKeys: DocumentKeySet;\n}\n\nexport interface ViewChange {\n  snapshot?: ViewSnapshot;\n  limboChanges: LimboDocumentChange[];\n}\n\n/**\n * View is responsible for computing the final merged truth of what docs are in\n * a query. It gets notified of local and remote changes to docs, and applies\n * the query filters and limits to determine the most correct possible results.\n */\nexport class View {\n  private syncState: SyncState | null = null;\n  private hasCachedResults: boolean = false;\n  /**\n   * A flag whether the view is current with the backend. A view is considered\n   * current after it has seen the current flag from the backend and did not\n   * lose consistency within the watch stream (e.g. because of an existence\n   * filter mismatch).\n   */\n  private current = false;\n  private documentSet: DocumentSet;\n  /** Documents in the view but not in the remote target */\n  private limboDocuments = documentKeySet();\n  /** Document Keys that have local changes */\n  private mutatedKeys = documentKeySet();\n  /** Query comparator that defines the document order in this view. */\n  private docComparator: (d1: Document, d2: Document) => number;\n\n  constructor(\n    private query: Query,\n    /** Documents included in the remote target */\n    private _syncedDocuments: DocumentKeySet\n  ) {\n    this.docComparator = newQueryComparator(query);\n    this.documentSet = new DocumentSet(this.docComparator);\n  }\n\n  /**\n   * The set of remote documents that the server has told us belongs to the target associated with\n   * this view.\n   */\n  get syncedDocuments(): DocumentKeySet {\n    return this._syncedDocuments;\n  }\n\n  /**\n   * Iterates over a set of doc changes, applies the query limit, and computes\n   * what the new results should be, what the changes were, and whether we may\n   * need to go back to the local cache for more results. Does not make any\n   * changes to the view.\n   * @param docChanges - The doc changes to apply to this view.\n   * @param previousChanges - If this is being called with a refill, then start\n   *        with this set of docs and changes instead of the current view.\n   * @returns a new set of docs, changes, and refill flag.\n   */\n  computeDocChanges(\n    docChanges: DocumentMap,\n    previousChanges?: ViewDocumentChanges\n  ): ViewDocumentChanges {\n    const changeSet = previousChanges\n      ? previousChanges.changeSet\n      : new DocumentChangeSet();\n    const oldDocumentSet = previousChanges\n      ? previousChanges.documentSet\n      : this.documentSet;\n    let newMutatedKeys = previousChanges\n      ? previousChanges.mutatedKeys\n      : this.mutatedKeys;\n    let newDocumentSet = oldDocumentSet;\n    let needsRefill = false;\n\n    // Track the last doc in a (full) limit. This is necessary, because some\n    // update (a delete, or an update moving a doc past the old limit) might\n    // mean there is some other document in the local cache that either should\n    // come (1) between the old last limit doc and the new last document, in the\n    // case of updates, or (2) after the new last document, in the case of\n    // deletes. So we keep this doc at the old limit to compare the updates to.\n    //\n    // Note that this should never get used in a refill (when previousChanges is\n    // set), because there will only be adds -- no deletes or updates.\n    const lastDocInLimit =\n      this.query.limitType === LimitType.First &&\n      oldDocumentSet.size === this.query.limit\n        ? oldDocumentSet.last()\n        : null;\n    const firstDocInLimit =\n      this.query.limitType === LimitType.Last &&\n      oldDocumentSet.size === this.query.limit\n        ? oldDocumentSet.first()\n        : null;\n\n    docChanges.inorderTraversal((key, entry) => {\n      const oldDoc = oldDocumentSet.get(key);\n      const newDoc = queryMatches(this.query, entry) ? entry : null;\n\n      const oldDocHadPendingMutations = oldDoc\n        ? this.mutatedKeys.has(oldDoc.key)\n        : false;\n      const newDocHasPendingMutations = newDoc\n        ? newDoc.hasLocalMutations ||\n          // We only consider committed mutations for documents that were\n          // mutated during the lifetime of the view.\n          (this.mutatedKeys.has(newDoc.key) && newDoc.hasCommittedMutations)\n        : false;\n\n      let changeApplied = false;\n\n      // Calculate change\n      if (oldDoc && newDoc) {\n        const docsEqual = oldDoc.data.isEqual(newDoc.data);\n        if (!docsEqual) {\n          if (!this.shouldWaitForSyncedDocument(oldDoc, newDoc)) {\n            changeSet.track({\n              type: ChangeType.Modified,\n              doc: newDoc\n            });\n            changeApplied = true;\n\n            if (\n              (lastDocInLimit &&\n                this.docComparator(newDoc, lastDocInLimit) > 0) ||\n              (firstDocInLimit &&\n                this.docComparator(newDoc, firstDocInLimit) < 0)\n            ) {\n              // This doc moved from inside the limit to outside the limit.\n              // That means there may be some other doc in the local cache\n              // that should be included instead.\n              needsRefill = true;\n            }\n          }\n        } else if (oldDocHadPendingMutations !== newDocHasPendingMutations) {\n          changeSet.track({ type: ChangeType.Metadata, doc: newDoc });\n          changeApplied = true;\n        }\n      } else if (!oldDoc && newDoc) {\n        changeSet.track({ type: ChangeType.Added, doc: newDoc });\n        changeApplied = true;\n      } else if (oldDoc && !newDoc) {\n        changeSet.track({ type: ChangeType.Removed, doc: oldDoc });\n        changeApplied = true;\n\n        if (lastDocInLimit || firstDocInLimit) {\n          // A doc was removed from a full limit query. We'll need to\n          // requery from the local cache to see if we know about some other\n          // doc that should be in the results.\n          needsRefill = true;\n        }\n      }\n\n      if (changeApplied) {\n        if (newDoc) {\n          newDocumentSet = newDocumentSet.add(newDoc);\n          if (newDocHasPendingMutations) {\n            newMutatedKeys = newMutatedKeys.add(key);\n          } else {\n            newMutatedKeys = newMutatedKeys.delete(key);\n          }\n        } else {\n          newDocumentSet = newDocumentSet.delete(key);\n          newMutatedKeys = newMutatedKeys.delete(key);\n        }\n      }\n    });\n\n    // Drop documents out to meet limit/limitToLast requirement.\n    if (this.query.limit !== null) {\n      while (newDocumentSet.size > this.query.limit!) {\n        const oldDoc =\n          this.query.limitType === LimitType.First\n            ? newDocumentSet.last()\n            : newDocumentSet.first();\n        newDocumentSet = newDocumentSet.delete(oldDoc!.key);\n        newMutatedKeys = newMutatedKeys.delete(oldDoc!.key);\n        changeSet.track({ type: ChangeType.Removed, doc: oldDoc! });\n      }\n    }\n\n    debugAssert(\n      !needsRefill || !previousChanges,\n      'View was refilled using docs that themselves needed refilling.'\n    );\n    return {\n      documentSet: newDocumentSet,\n      changeSet,\n      needsRefill,\n      mutatedKeys: newMutatedKeys\n    };\n  }\n\n  private shouldWaitForSyncedDocument(\n    oldDoc: Document,\n    newDoc: Document\n  ): boolean {\n    // We suppress the initial change event for documents that were modified as\n    // part of a write acknowledgment (e.g. when the value of a server transform\n    // is applied) as Watch will send us the same document again.\n    // By suppressing the event, we only raise two user visible events (one with\n    // `hasPendingWrites` and the final state of the document) instead of three\n    // (one with `hasPendingWrites`, the modified document with\n    // `hasPendingWrites` and the final state of the document).\n    return (\n      oldDoc.hasLocalMutations &&\n      newDoc.hasCommittedMutations &&\n      !newDoc.hasLocalMutations\n    );\n  }\n\n  /**\n   * Updates the view with the given ViewDocumentChanges and optionally updates\n   * limbo docs and sync state from the provided target change.\n   * @param docChanges - The set of changes to make to the view's docs.\n   * @param limboResolutionEnabled - Whether to update limbo documents based on\n   *        this change.\n   * @param targetChange - A target change to apply for computing limbo docs and\n   *        sync state.\n   * @param targetIsPendingReset - Whether the target is pending to reset due to\n   *        existence filter mismatch. If not explicitly specified, it is treated\n   *        equivalently to `false`.\n   * @returns A new ViewChange with the given docs, changes, and sync state.\n   */\n  // PORTING NOTE: The iOS/Android clients always compute limbo document changes.\n  applyChanges(\n    docChanges: ViewDocumentChanges,\n    limboResolutionEnabled: boolean,\n    targetChange?: TargetChange,\n    targetIsPendingReset?: boolean\n  ): ViewChange {\n    debugAssert(\n      !docChanges.needsRefill,\n      'Cannot apply changes that need a refill'\n    );\n    const oldDocs = this.documentSet;\n    this.documentSet = docChanges.documentSet;\n    this.mutatedKeys = docChanges.mutatedKeys;\n    // Sort changes based on type and query comparator\n    const changes = docChanges.changeSet.getChanges();\n    changes.sort((c1, c2) => {\n      return (\n        compareChangeType(c1.type, c2.type) ||\n        this.docComparator(c1.doc, c2.doc)\n      );\n    });\n\n    this.applyTargetChange(targetChange);\n\n    targetIsPendingReset = targetIsPendingReset ?? false;\n    const limboChanges =\n      limboResolutionEnabled && !targetIsPendingReset\n        ? this.updateLimboDocuments()\n        : [];\n\n    // We are at synced state if there is no limbo docs are waiting to be resolved, view is current\n    // with the backend, and the query is not pending to reset due to existence filter mismatch.\n    const synced =\n      this.limboDocuments.size === 0 && this.current && !targetIsPendingReset;\n\n    const newSyncState = synced ? SyncState.Synced : SyncState.Local;\n    const syncStateChanged = newSyncState !== this.syncState;\n    this.syncState = newSyncState;\n\n    if (changes.length === 0 && !syncStateChanged) {\n      // no changes\n      return { limboChanges };\n    } else {\n      const snap: ViewSnapshot = new ViewSnapshot(\n        this.query,\n        docChanges.documentSet,\n        oldDocs,\n        changes,\n        docChanges.mutatedKeys,\n        newSyncState === SyncState.Local,\n        syncStateChanged,\n        /* excludesMetadataChanges= */ false,\n        targetChange\n          ? targetChange.resumeToken.approximateByteSize() > 0\n          : false\n      );\n      return {\n        snapshot: snap,\n        limboChanges\n      };\n    }\n  }\n\n  /**\n   * Applies an OnlineState change to the view, potentially generating a\n   * ViewChange if the view's syncState changes as a result.\n   */\n  applyOnlineStateChange(onlineState: OnlineState): ViewChange {\n    if (this.current && onlineState === OnlineState.Offline) {\n      // If we're offline, set `current` to false and then call applyChanges()\n      // to refresh our syncState and generate a ViewChange as appropriate. We\n      // are guaranteed to get a new TargetChange that sets `current` back to\n      // true once the client is back online.\n      this.current = false;\n      return this.applyChanges(\n        {\n          documentSet: this.documentSet,\n          changeSet: new DocumentChangeSet(),\n          mutatedKeys: this.mutatedKeys,\n          needsRefill: false\n        },\n        /* limboResolutionEnabled= */ false\n      );\n    } else {\n      // No effect, just return a no-op ViewChange.\n      return { limboChanges: [] };\n    }\n  }\n\n  /**\n   * Returns whether the doc for the given key should be in limbo.\n   */\n  private shouldBeInLimbo(key: DocumentKey): boolean {\n    // If the remote end says it's part of this query, it's not in limbo.\n    if (this._syncedDocuments.has(key)) {\n      return false;\n    }\n    // The local store doesn't think it's a result, so it shouldn't be in limbo.\n    if (!this.documentSet.has(key)) {\n      return false;\n    }\n    // If there are local changes to the doc, they might explain why the server\n    // doesn't know that it's part of the query. So don't put it in limbo.\n    // TODO(klimt): Ideally, we would only consider changes that might actually\n    // affect this specific query.\n    if (this.documentSet.get(key)!.hasLocalMutations) {\n      return false;\n    }\n    // Everything else is in limbo.\n    return true;\n  }\n\n  /**\n   * Updates syncedDocuments, current, and limbo docs based on the given change.\n   * Returns the list of changes to which docs are in limbo.\n   */\n  private applyTargetChange(targetChange?: TargetChange): void {\n    if (targetChange) {\n      targetChange.addedDocuments.forEach(\n        key => (this._syncedDocuments = this._syncedDocuments.add(key))\n      );\n      targetChange.modifiedDocuments.forEach(key => {\n        debugAssert(\n          this._syncedDocuments.has(key),\n          `Modified document ${key} not found in view.`\n        );\n      });\n      targetChange.removedDocuments.forEach(\n        key => (this._syncedDocuments = this._syncedDocuments.delete(key))\n      );\n      this.current = targetChange.current;\n    }\n  }\n\n  private updateLimboDocuments(): LimboDocumentChange[] {\n    // We can only determine limbo documents when we're in-sync with the server.\n    if (!this.current) {\n      return [];\n    }\n\n    // TODO(klimt): Do this incrementally so that it's not quadratic when\n    // updating many documents.\n    const oldLimboDocuments = this.limboDocuments;\n    this.limboDocuments = documentKeySet();\n    this.documentSet.forEach(doc => {\n      if (this.shouldBeInLimbo(doc.key)) {\n        this.limboDocuments = this.limboDocuments.add(doc.key);\n      }\n    });\n\n    // Diff the new limbo docs with the old limbo docs.\n    const changes: LimboDocumentChange[] = [];\n    oldLimboDocuments.forEach(key => {\n      if (!this.limboDocuments.has(key)) {\n        changes.push(new RemovedLimboDocument(key));\n      }\n    });\n    this.limboDocuments.forEach(key => {\n      if (!oldLimboDocuments.has(key)) {\n        changes.push(new AddedLimboDocument(key));\n      }\n    });\n    return changes;\n  }\n\n  /**\n   * Update the in-memory state of the current view with the state read from\n   * persistence.\n   *\n   * We update the query view whenever a client's primary status changes:\n   * - When a client transitions from primary to secondary, it can miss\n   *   LocalStorage updates and its query views may temporarily not be\n   *   synchronized with the state on disk.\n   * - For secondary to primary transitions, the client needs to update the list\n   *   of `syncedDocuments` since secondary clients update their query views\n   *   based purely on synthesized RemoteEvents.\n   *\n   * @param queryResult.documents - The documents that match the query according\n   * to the LocalStore.\n   * @param queryResult.remoteKeys - The keys of the documents that match the\n   * query according to the backend.\n   *\n   * @returns The ViewChange that resulted from this synchronization.\n   */\n  // PORTING NOTE: Multi-tab only.\n  synchronizeWithPersistedState(queryResult: QueryResult): ViewChange {\n    this._syncedDocuments = queryResult.remoteKeys;\n    this.limboDocuments = documentKeySet();\n    const docChanges = this.computeDocChanges(queryResult.documents);\n    return this.applyChanges(docChanges, /* limboResolutionEnabled= */ true);\n  }\n\n  /**\n   * Returns a view snapshot as if this query was just listened to. Contains\n   * a document add for every existing document and the `fromCache` and\n   * `hasPendingWrites` status of the already established view.\n   */\n  // PORTING NOTE: Multi-tab only.\n  computeInitialSnapshot(): ViewSnapshot {\n    return ViewSnapshot.fromInitialDocuments(\n      this.query,\n      this.documentSet,\n      this.mutatedKeys,\n      this.syncState === SyncState.Local,\n      this.hasCachedResults\n    );\n  }\n}\n\nfunction compareChangeType(c1: ChangeType, c2: ChangeType): number {\n  const order = (change: ChangeType): 0 | 1 | 2 => {\n    switch (change) {\n      case ChangeType.Added:\n        return 1;\n      case ChangeType.Modified:\n        return 2;\n      case ChangeType.Metadata:\n        // A metadata change is converted to a modified change at the public\n        // api layer.  Since we sort by document key and then change type,\n        // metadata and modified changes must be sorted equivalently.\n        return 2;\n      case ChangeType.Removed:\n        return 0;\n      default:\n        return fail('Unknown ChangeType: ' + change);\n    }\n  };\n\n  return order(c1) - order(c2);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { LoadBundleTask } from '../api/bundle';\nimport { User } from '../auth/user';\nimport { ignoreIfPrimaryLeaseLoss, LocalStore } from '../local/local_store';\nimport {\n  localStoreAcknowledgeBatch,\n  localStoreAllocateTarget,\n  localStoreApplyRemoteEventToLocalCache,\n  localStoreExecuteQuery,\n  localStoreGetActiveClients,\n  localStoreGetCachedTarget,\n  localStoreGetHighestUnacknowledgedBatchId,\n  localStoreGetNewDocumentChanges,\n  localStoreHandleUserChange,\n  localStoreHasNewerBundle,\n  localStoreLookupMutationDocuments,\n  localStoreNotifyLocalViewChanges,\n  localStoreRejectBatch,\n  localStoreReleaseTarget,\n  localStoreRemoveCachedMutationBatchMetadata,\n  localStoreSaveBundle,\n  localStoreWriteLocally\n} from '../local/local_store_impl';\nimport { LocalViewChanges } from '../local/local_view_changes';\nimport { ReferenceSet } from '../local/reference_set';\nimport { ClientId, SharedClientState } from '../local/shared_client_state';\nimport { QueryTargetState } from '../local/shared_client_state_syncer';\nimport { TargetData, TargetPurpose } from '../local/target_data';\nimport {\n  DocumentKeySet,\n  documentKeySet,\n  DocumentMap\n} from '../model/collections';\nimport { MutableDocument } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport { Mutation } from '../model/mutation';\nimport { MutationBatchResult } from '../model/mutation_batch';\nimport { ResourcePath } from '../model/path';\nimport { RemoteEvent, TargetChange } from '../remote/remote_event';\nimport {\n  canUseNetwork,\n  fillWritePipeline,\n  RemoteStore,\n  remoteStoreApplyPrimaryState,\n  remoteStoreListen,\n  remoteStoreUnlisten\n} from '../remote/remote_store';\nimport { debugAssert, debugCast, fail, hardAssert } from '../util/assert';\nimport { wrapInUserErrorIfRecoverable } from '../util/async_queue';\nimport { BundleReader } from '../util/bundle_reader';\nimport { ByteString } from '../util/byte_string';\nimport { Code, FirestoreError } from '../util/error';\nimport { logDebug, logWarn } from '../util/log';\nimport { primitiveComparator } from '../util/misc';\nimport { ObjectMap } from '../util/obj_map';\nimport { Deferred } from '../util/promise';\nimport { SortedMap } from '../util/sorted_map';\nimport { BATCHID_UNKNOWN } from '../util/types';\n\nimport {\n  bundleInitialProgress,\n  BundleLoader,\n  bundleSuccessProgress\n} from './bundle_impl';\nimport {\n  EventManager,\n  eventManagerOnOnlineStateChange,\n  eventManagerOnWatchChange,\n  eventManagerOnWatchError\n} from './event_manager';\nimport { ListenSequence } from './listen_sequence';\nimport {\n  canonifyQuery,\n  LimitType,\n  newQuery,\n  newQueryForPath,\n  Query,\n  queryEquals,\n  queryCollectionGroup,\n  queryToTarget,\n  stringifyQuery\n} from './query';\nimport { SnapshotVersion } from './snapshot_version';\nimport { SyncEngine } from './sync_engine';\nimport { Target } from './target';\nimport { TargetIdGenerator } from './target_id_generator';\nimport {\n  BatchId,\n  MutationBatchState,\n  OnlineState,\n  OnlineStateSource,\n  TargetId\n} from './types';\nimport {\n  AddedLimboDocument,\n  LimboDocumentChange,\n  RemovedLimboDocument,\n  View,\n  ViewChange\n} from './view';\nimport { ViewSnapshot } from './view_snapshot';\n\nconst LOG_TAG = 'SyncEngine';\n\n/**\n * QueryView contains all of the data that SyncEngine needs to keep track of for\n * a particular query.\n */\nclass QueryView {\n  constructor(\n    /**\n     * The query itself.\n     */\n    public query: Query,\n    /**\n     * The target number created by the client that is used in the watch\n     * stream to identify this query.\n     */\n    public targetId: TargetId,\n    /**\n     * The view is responsible for computing the final merged truth of what\n     * docs are in the query. It gets notified of local and remote changes,\n     * and applies the query filters and limits to determine the most correct\n     * possible results.\n     */\n    public view: View\n  ) {}\n}\n\n/** Tracks a limbo resolution. */\nclass LimboResolution {\n  constructor(public key: DocumentKey) {}\n\n  /**\n   * Set to true once we've received a document. This is used in\n   * getRemoteKeysForTarget() and ultimately used by WatchChangeAggregator to\n   * decide whether it needs to manufacture a delete event for the target once\n   * the target is CURRENT.\n   */\n  receivedDocument: boolean = false;\n}\n\n/**\n * A function that updates a QueryView with a set of document changes (and a\n * remote event if applicable).\n */\ntype ApplyDocChangesHandler = (\n  queryView: QueryView,\n  changes: DocumentMap,\n  remoteEvent?: RemoteEvent\n) => Promise<ViewSnapshot | undefined>;\n\n/**\n * Callbacks implemented by EventManager to handle notifications from\n * SyncEngine.\n */\ninterface SyncEngineListener {\n  /** Handles new view snapshots. */\n  onWatchChange?(snapshots: ViewSnapshot[]): void;\n\n  /** Handles the failure of a query. */\n  onWatchError?(query: Query, error: FirestoreError): void;\n}\n\n/**\n * An implementation of `SyncEngine` coordinating with other parts of SDK.\n *\n * The parts of SyncEngine that act as a callback to RemoteStore need to be\n * registered individually. This is done in `syncEngineWrite()` and\n * `syncEngineListen()` (as well as `applyPrimaryState()`) as these methods\n * serve as entry points to RemoteStore's functionality.\n *\n * Note: some field defined in this class might have public access level, but\n * the class is not exported so they are only accessible from this module.\n * This is useful to implement optional features (like bundles) in free\n * functions, such that they are tree-shakeable.\n */\nclass SyncEngineImpl implements SyncEngine {\n  syncEngineListener: SyncEngineListener = {};\n\n  /**\n   * A callback that updates the QueryView based on the provided change.\n   *\n   * PORTING NOTE: On other platforms, this logic lives in\n   * `emitNewSnapshotsAndNotifyLocalStore()`, but on Web it is extracted to\n   *  ensure that all view logic only exists in bundles that include views.\n   */\n  applyDocChanges?: ApplyDocChangesHandler;\n\n  queryViewsByQuery = new ObjectMap<Query, QueryView>(\n    q => canonifyQuery(q),\n    queryEquals\n  );\n  queriesByTarget = new Map<TargetId, Query[]>();\n  /**\n   * The keys of documents that are in limbo for which we haven't yet started a\n   * limbo resolution query. The strings in this set are the result of calling\n   * `key.path.canonicalString()` where `key` is a `DocumentKey` object.\n   *\n   * The `Set` type was chosen because it provides efficient lookup and removal\n   * of arbitrary elements and it also maintains insertion order, providing the\n   * desired queue-like FIFO semantics.\n   */\n  enqueuedLimboResolutions = new Set<string>();\n  /**\n   * Keeps track of the target ID for each document that is in limbo with an\n   * active target.\n   */\n  activeLimboTargetsByKey = new SortedMap<DocumentKey, TargetId>(\n    DocumentKey.comparator\n  );\n  /**\n   * Keeps track of the information about an active limbo resolution for each\n   * active target ID that was started for the purpose of limbo resolution.\n   */\n  activeLimboResolutionsByTarget = new Map<TargetId, LimboResolution>();\n  limboDocumentRefs = new ReferenceSet();\n  /** Stores user completion handlers, indexed by User and BatchId. */\n  mutationUserCallbacks = {} as {\n    [uidKey: string]: SortedMap<BatchId, Deferred<void>>;\n  };\n  /** Stores user callbacks waiting for all pending writes to be acknowledged. */\n  pendingWritesCallbacks = new Map<BatchId, Array<Deferred<void>>>();\n  limboTargetIdGenerator = TargetIdGenerator.forSyncEngine();\n\n  onlineState = OnlineState.Unknown;\n\n  // The primary state is set to `true` or `false` immediately after Firestore\n  // startup. In the interim, a client should only be considered primary if\n  // `isPrimary` is true.\n  _isPrimaryClient: undefined | boolean = undefined;\n\n  constructor(\n    readonly localStore: LocalStore,\n    readonly remoteStore: RemoteStore,\n    readonly eventManager: EventManager,\n    // PORTING NOTE: Manages state synchronization in multi-tab environments.\n    readonly sharedClientState: SharedClientState,\n    public currentUser: User,\n    readonly maxConcurrentLimboResolutions: number\n  ) {}\n\n  get isPrimaryClient(): boolean {\n    return this._isPrimaryClient === true;\n  }\n}\n\nexport function newSyncEngine(\n  localStore: LocalStore,\n  remoteStore: RemoteStore,\n  eventManager: EventManager,\n  // PORTING NOTE: Manages state synchronization in multi-tab environments.\n  sharedClientState: SharedClientState,\n  currentUser: User,\n  maxConcurrentLimboResolutions: number,\n  isPrimary: boolean\n): SyncEngine {\n  const syncEngine = new SyncEngineImpl(\n    localStore,\n    remoteStore,\n    eventManager,\n    sharedClientState,\n    currentUser,\n    maxConcurrentLimboResolutions\n  );\n  if (isPrimary) {\n    syncEngine._isPrimaryClient = true;\n  }\n  return syncEngine;\n}\n\n/**\n * Initiates the new listen, resolves promise when listen enqueued to the\n * server. All the subsequent view snapshots or errors are sent to the\n * subscribed handlers. Returns the initial snapshot.\n */\nexport async function syncEngineListen(\n  syncEngine: SyncEngine,\n  query: Query,\n  shouldListenToRemote: boolean = true\n): Promise<ViewSnapshot> {\n  const syncEngineImpl = ensureWatchCallbacks(syncEngine);\n\n  let viewSnapshot;\n\n  const queryView = syncEngineImpl.queryViewsByQuery.get(query);\n  if (queryView) {\n    // PORTING NOTE: With Multi-Tab Web, it is possible that a query view\n    // already exists when EventManager calls us for the first time. This\n    // happens when the primary tab is already listening to this query on\n    // behalf of another tab and the user of the primary also starts listening\n    // to the query. EventManager will not have an assigned target ID in this\n    // case and calls `listen` to obtain this ID.\n    syncEngineImpl.sharedClientState.addLocalQueryTarget(queryView.targetId);\n    viewSnapshot = queryView.view.computeInitialSnapshot();\n  } else {\n    viewSnapshot = await allocateTargetAndMaybeListen(\n      syncEngineImpl,\n      query,\n      shouldListenToRemote,\n      /** shouldInitializeView= */ true\n    );\n    debugAssert(!!viewSnapshot, 'viewSnapshot is not initialized');\n  }\n\n  return viewSnapshot;\n}\n\n/** Query has been listening to the cache, and tries to initiate the remote store listen */\nexport async function triggerRemoteStoreListen(\n  syncEngine: SyncEngine,\n  query: Query\n): Promise<void> {\n  const syncEngineImpl = ensureWatchCallbacks(syncEngine);\n  await allocateTargetAndMaybeListen(\n    syncEngineImpl,\n    query,\n    /** shouldListenToRemote= */ true,\n    /** shouldInitializeView= */ false\n  );\n}\n\nasync function allocateTargetAndMaybeListen(\n  syncEngineImpl: SyncEngineImpl,\n  query: Query,\n  shouldListenToRemote: boolean,\n  shouldInitializeView: boolean\n): Promise<ViewSnapshot | undefined> {\n  const targetData = await localStoreAllocateTarget(\n    syncEngineImpl.localStore,\n    queryToTarget(query)\n  );\n\n  const targetId = targetData.targetId;\n\n  // PORTING NOTE: When the query is listening to cache only, we skip sending it over to Watch by\n  // not registering it in shared client state, and directly calculate initial snapshots and\n  // subsequent updates from cache. Otherwise, register the target ID with local Firestore client\n  // as active watch target.\n  const status: QueryTargetState = shouldListenToRemote\n    ? syncEngineImpl.sharedClientState.addLocalQueryTarget(targetId)\n    : 'not-current';\n\n  let viewSnapshot;\n  if (shouldInitializeView) {\n    viewSnapshot = await initializeViewAndComputeSnapshot(\n      syncEngineImpl,\n      query,\n      targetId,\n      status === 'current',\n      targetData.resumeToken\n    );\n  }\n\n  if (syncEngineImpl.isPrimaryClient && shouldListenToRemote) {\n    remoteStoreListen(syncEngineImpl.remoteStore, targetData);\n  }\n\n  return viewSnapshot;\n}\n\n/**\n * Registers a view for a previously unknown query and computes its initial\n * snapshot.\n */\nasync function initializeViewAndComputeSnapshot(\n  syncEngineImpl: SyncEngineImpl,\n  query: Query,\n  targetId: TargetId,\n  current: boolean,\n  resumeToken: ByteString\n): Promise<ViewSnapshot> {\n  // PORTING NOTE: On Web only, we inject the code that registers new Limbo\n  // targets based on view changes. This allows us to only depend on Limbo\n  // changes when user code includes queries.\n  syncEngineImpl.applyDocChanges = (queryView, changes, remoteEvent) =>\n    applyDocChanges(syncEngineImpl, queryView, changes, remoteEvent);\n\n  const queryResult = await localStoreExecuteQuery(\n    syncEngineImpl.localStore,\n    query,\n    /* usePreviousResults= */ true\n  );\n  const view = new View(query, queryResult.remoteKeys);\n  const viewDocChanges = view.computeDocChanges(queryResult.documents);\n  const synthesizedTargetChange =\n    TargetChange.createSynthesizedTargetChangeForCurrentChange(\n      targetId,\n      current && syncEngineImpl.onlineState !== OnlineState.Offline,\n      resumeToken\n    );\n  const viewChange = view.applyChanges(\n    viewDocChanges,\n    /* limboResolutionEnabled= */ syncEngineImpl.isPrimaryClient,\n    synthesizedTargetChange\n  );\n  updateTrackedLimbos(syncEngineImpl, targetId, viewChange.limboChanges);\n\n  debugAssert(\n    !!viewChange.snapshot,\n    'applyChanges for new view should always return a snapshot'\n  );\n\n  const data = new QueryView(query, targetId, view);\n\n  syncEngineImpl.queryViewsByQuery.set(query, data);\n  if (syncEngineImpl.queriesByTarget.has(targetId)) {\n    syncEngineImpl.queriesByTarget.get(targetId)!.push(query);\n  } else {\n    syncEngineImpl.queriesByTarget.set(targetId, [query]);\n  }\n\n  return viewChange.snapshot;\n}\n\n/** Stops listening to the query. */\nexport async function syncEngineUnlisten(\n  syncEngine: SyncEngine,\n  query: Query,\n  shouldUnlistenToRemote: boolean\n): Promise<void> {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n  const queryView = syncEngineImpl.queryViewsByQuery.get(query)!;\n  debugAssert(\n    !!queryView,\n    'Trying to unlisten on query not found:' + stringifyQuery(query)\n  );\n\n  // Only clean up the query view and target if this is the only query mapped\n  // to the target.\n  const queries = syncEngineImpl.queriesByTarget.get(queryView.targetId)!;\n  if (queries.length > 1) {\n    syncEngineImpl.queriesByTarget.set(\n      queryView.targetId,\n      queries.filter(q => !queryEquals(q, query))\n    );\n    syncEngineImpl.queryViewsByQuery.delete(query);\n    return;\n  }\n\n  // No other queries are mapped to the target, clean up the query and the target.\n  if (syncEngineImpl.isPrimaryClient) {\n    // We need to remove the local query target first to allow us to verify\n    // whether any other client is still interested in this target.\n    syncEngineImpl.sharedClientState.removeLocalQueryTarget(queryView.targetId);\n    const targetRemainsActive =\n      syncEngineImpl.sharedClientState.isActiveQueryTarget(queryView.targetId);\n\n    if (!targetRemainsActive) {\n      await localStoreReleaseTarget(\n        syncEngineImpl.localStore,\n        queryView.targetId,\n        /*keepPersistedTargetData=*/ false\n      )\n        .then(() => {\n          syncEngineImpl.sharedClientState.clearQueryState(queryView.targetId);\n          if (shouldUnlistenToRemote) {\n            remoteStoreUnlisten(syncEngineImpl.remoteStore, queryView.targetId);\n          }\n          removeAndCleanupTarget(syncEngineImpl, queryView.targetId);\n        })\n        .catch(ignoreIfPrimaryLeaseLoss);\n    }\n  } else {\n    removeAndCleanupTarget(syncEngineImpl, queryView.targetId);\n    await localStoreReleaseTarget(\n      syncEngineImpl.localStore,\n      queryView.targetId,\n      /*keepPersistedTargetData=*/ true\n    );\n  }\n}\n\n/** Unlistens to the remote store while still listening to the cache. */\nexport async function triggerRemoteStoreUnlisten(\n  syncEngine: SyncEngine,\n  query: Query\n): Promise<void> {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n  const queryView = syncEngineImpl.queryViewsByQuery.get(query)!;\n  debugAssert(\n    !!queryView,\n    'Trying to unlisten on query not found:' + stringifyQuery(query)\n  );\n  const queries = syncEngineImpl.queriesByTarget.get(queryView.targetId)!;\n\n  if (syncEngineImpl.isPrimaryClient && queries.length === 1) {\n    // PORTING NOTE: Unregister the target ID with local Firestore client as\n    // watch target.\n    syncEngineImpl.sharedClientState.removeLocalQueryTarget(queryView.targetId);\n\n    remoteStoreUnlisten(syncEngineImpl.remoteStore, queryView.targetId);\n  }\n}\n\n/**\n * Initiates the write of local mutation batch which involves adding the\n * writes to the mutation queue, notifying the remote store about new\n * mutations and raising events for any changes this write caused.\n *\n * The promise returned by this call is resolved when the above steps\n * have completed, *not* when the write was acked by the backend. The\n * userCallback is resolved once the write was acked/rejected by the\n * backend (or failed locally for any other reason).\n */\nexport async function syncEngineWrite(\n  syncEngine: SyncEngine,\n  batch: Mutation[],\n  userCallback: Deferred<void>\n): Promise<void> {\n  const syncEngineImpl = syncEngineEnsureWriteCallbacks(syncEngine);\n\n  try {\n    const result = await localStoreWriteLocally(\n      syncEngineImpl.localStore,\n      batch\n    );\n    syncEngineImpl.sharedClientState.addPendingMutation(result.batchId);\n    addMutationCallback(syncEngineImpl, result.batchId, userCallback);\n    await syncEngineEmitNewSnapsAndNotifyLocalStore(\n      syncEngineImpl,\n      result.changes\n    );\n    await fillWritePipeline(syncEngineImpl.remoteStore);\n  } catch (e) {\n    // If we can't persist the mutation, we reject the user callback and\n    // don't send the mutation. The user can then retry the write.\n    const error = wrapInUserErrorIfRecoverable(\n      e as Error,\n      `Failed to persist write`\n    );\n    userCallback.reject(error);\n  }\n}\n\n/**\n * Applies one remote event to the sync engine, notifying any views of the\n * changes, and releasing any pending mutation batches that would become\n * visible because of the snapshot version the remote event contains.\n */\nexport async function syncEngineApplyRemoteEvent(\n  syncEngine: SyncEngine,\n  remoteEvent: RemoteEvent\n): Promise<void> {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n\n  try {\n    const changes = await localStoreApplyRemoteEventToLocalCache(\n      syncEngineImpl.localStore,\n      remoteEvent\n    );\n    // Update `receivedDocument` as appropriate for any limbo targets.\n    remoteEvent.targetChanges.forEach((targetChange, targetId) => {\n      const limboResolution =\n        syncEngineImpl.activeLimboResolutionsByTarget.get(targetId);\n      if (limboResolution) {\n        // Since this is a limbo resolution lookup, it's for a single document\n        // and it could be added, modified, or removed, but not a combination.\n        hardAssert(\n          targetChange.addedDocuments.size +\n            targetChange.modifiedDocuments.size +\n            targetChange.removedDocuments.size <=\n            1,\n          'Limbo resolution for single document contains multiple changes.'\n        );\n        if (targetChange.addedDocuments.size > 0) {\n          limboResolution.receivedDocument = true;\n        } else if (targetChange.modifiedDocuments.size > 0) {\n          hardAssert(\n            limboResolution.receivedDocument,\n            'Received change for limbo target document without add.'\n          );\n        } else if (targetChange.removedDocuments.size > 0) {\n          hardAssert(\n            limboResolution.receivedDocument,\n            'Received remove for limbo target document without add.'\n          );\n          limboResolution.receivedDocument = false;\n        } else {\n          // This was probably just a CURRENT targetChange or similar.\n        }\n      }\n    });\n    await syncEngineEmitNewSnapsAndNotifyLocalStore(\n      syncEngineImpl,\n      changes,\n      remoteEvent\n    );\n  } catch (error) {\n    await ignoreIfPrimaryLeaseLoss(error as FirestoreError);\n  }\n}\n\n/**\n * Applies an OnlineState change to the sync engine and notifies any views of\n * the change.\n */\nexport function syncEngineApplyOnlineStateChange(\n  syncEngine: SyncEngine,\n  onlineState: OnlineState,\n  source: OnlineStateSource\n): void {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n  // If we are the secondary client, we explicitly ignore the remote store's\n  // online state (the local client may go offline, even though the primary\n  // tab remains online) and only apply the primary tab's online state from\n  // SharedClientState.\n  if (\n    (syncEngineImpl.isPrimaryClient &&\n      source === OnlineStateSource.RemoteStore) ||\n    (!syncEngineImpl.isPrimaryClient &&\n      source === OnlineStateSource.SharedClientState)\n  ) {\n    const newViewSnapshots = [] as ViewSnapshot[];\n    syncEngineImpl.queryViewsByQuery.forEach((query, queryView) => {\n      const viewChange = queryView.view.applyOnlineStateChange(onlineState);\n      debugAssert(\n        viewChange.limboChanges.length === 0,\n        'OnlineState should not affect limbo documents.'\n      );\n      if (viewChange.snapshot) {\n        newViewSnapshots.push(viewChange.snapshot);\n      }\n    });\n\n    eventManagerOnOnlineStateChange(syncEngineImpl.eventManager, onlineState);\n\n    if (newViewSnapshots.length) {\n      debugAssert(\n        !!syncEngineImpl.syncEngineListener.onWatchChange,\n        'Active views but EventManager callbacks are not assigned'\n      );\n      syncEngineImpl.syncEngineListener.onWatchChange(newViewSnapshots);\n    }\n\n    syncEngineImpl.onlineState = onlineState;\n    if (syncEngineImpl.isPrimaryClient) {\n      syncEngineImpl.sharedClientState.setOnlineState(onlineState);\n    }\n  }\n}\n\n/**\n * Rejects the listen for the given targetID. This can be triggered by the\n * backend for any active target.\n *\n * @param syncEngine - The sync engine implementation.\n * @param targetId - The targetID corresponds to one previously initiated by the\n * user as part of TargetData passed to listen() on RemoteStore.\n * @param err - A description of the condition that has forced the rejection.\n * Nearly always this will be an indication that the user is no longer\n * authorized to see the data matching the target.\n */\nexport async function syncEngineRejectListen(\n  syncEngine: SyncEngine,\n  targetId: TargetId,\n  err: FirestoreError\n): Promise<void> {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n\n  // PORTING NOTE: Multi-tab only.\n  syncEngineImpl.sharedClientState.updateQueryState(targetId, 'rejected', err);\n\n  const limboResolution =\n    syncEngineImpl.activeLimboResolutionsByTarget.get(targetId);\n  const limboKey = limboResolution && limboResolution.key;\n  if (limboKey) {\n    // TODO(klimt): We really only should do the following on permission\n    // denied errors, but we don't have the cause code here.\n\n    // It's a limbo doc. Create a synthetic event saying it was deleted.\n    // This is kind of a hack. Ideally, we would have a method in the local\n    // store to purge a document. However, it would be tricky to keep all of\n    // the local store's invariants with another method.\n    let documentUpdates = new SortedMap<DocumentKey, MutableDocument>(\n      DocumentKey.comparator\n    );\n    // TODO(b/217189216): This limbo document should ideally have a read time,\n    // so that it is picked up by any read-time based scans. The backend,\n    // however, does not send a read time for target removals.\n    documentUpdates = documentUpdates.insert(\n      limboKey,\n      MutableDocument.newNoDocument(limboKey, SnapshotVersion.min())\n    );\n    const resolvedLimboDocuments = documentKeySet().add(limboKey);\n    const event = new RemoteEvent(\n      SnapshotVersion.min(),\n      /* targetChanges= */ new Map<TargetId, TargetChange>(),\n      /* targetMismatches= */ new SortedMap<TargetId, TargetPurpose>(\n        primitiveComparator\n      ),\n      documentUpdates,\n      resolvedLimboDocuments\n    );\n\n    await syncEngineApplyRemoteEvent(syncEngineImpl, event);\n\n    // Since this query failed, we won't want to manually unlisten to it.\n    // We only remove it from bookkeeping after we successfully applied the\n    // RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to\n    // this query when the RemoteStore restarts the Watch stream, which should\n    // re-trigger the target failure.\n    syncEngineImpl.activeLimboTargetsByKey =\n      syncEngineImpl.activeLimboTargetsByKey.remove(limboKey);\n    syncEngineImpl.activeLimboResolutionsByTarget.delete(targetId);\n    pumpEnqueuedLimboResolutions(syncEngineImpl);\n  } else {\n    await localStoreReleaseTarget(\n      syncEngineImpl.localStore,\n      targetId,\n      /* keepPersistedTargetData */ false\n    )\n      .then(() => removeAndCleanupTarget(syncEngineImpl, targetId, err))\n      .catch(ignoreIfPrimaryLeaseLoss);\n  }\n}\n\nexport async function syncEngineApplySuccessfulWrite(\n  syncEngine: SyncEngine,\n  mutationBatchResult: MutationBatchResult\n): Promise<void> {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n  const batchId = mutationBatchResult.batch.batchId;\n\n  try {\n    const changes = await localStoreAcknowledgeBatch(\n      syncEngineImpl.localStore,\n      mutationBatchResult\n    );\n\n    // The local store may or may not be able to apply the write result and\n    // raise events immediately (depending on whether the watcher is caught\n    // up), so we raise user callbacks first so that they consistently happen\n    // before listen events.\n    processUserCallback(syncEngineImpl, batchId, /*error=*/ null);\n    triggerPendingWritesCallbacks(syncEngineImpl, batchId);\n\n    syncEngineImpl.sharedClientState.updateMutationState(\n      batchId,\n      'acknowledged'\n    );\n    await syncEngineEmitNewSnapsAndNotifyLocalStore(syncEngineImpl, changes);\n  } catch (error) {\n    await ignoreIfPrimaryLeaseLoss(error as FirestoreError);\n  }\n}\n\nexport async function syncEngineRejectFailedWrite(\n  syncEngine: SyncEngine,\n  batchId: BatchId,\n  error: FirestoreError\n): Promise<void> {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n\n  try {\n    const changes = await localStoreRejectBatch(\n      syncEngineImpl.localStore,\n      batchId\n    );\n\n    // The local store may or may not be able to apply the write result and\n    // raise events immediately (depending on whether the watcher is caught up),\n    // so we raise user callbacks first so that they consistently happen before\n    // listen events.\n    processUserCallback(syncEngineImpl, batchId, error);\n    triggerPendingWritesCallbacks(syncEngineImpl, batchId);\n\n    syncEngineImpl.sharedClientState.updateMutationState(\n      batchId,\n      'rejected',\n      error\n    );\n    await syncEngineEmitNewSnapsAndNotifyLocalStore(syncEngineImpl, changes);\n  } catch (error) {\n    await ignoreIfPrimaryLeaseLoss(error as FirestoreError);\n  }\n}\n\n/**\n * Registers a user callback that resolves when all pending mutations at the moment of calling\n * are acknowledged .\n */\nexport async function syncEngineRegisterPendingWritesCallback(\n  syncEngine: SyncEngine,\n  callback: Deferred<void>\n): Promise<void> {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n  if (!canUseNetwork(syncEngineImpl.remoteStore)) {\n    logDebug(\n      LOG_TAG,\n      'The network is disabled. The task returned by ' +\n        \"'awaitPendingWrites()' will not complete until the network is enabled.\"\n    );\n  }\n\n  try {\n    const highestBatchId = await localStoreGetHighestUnacknowledgedBatchId(\n      syncEngineImpl.localStore\n    );\n    if (highestBatchId === BATCHID_UNKNOWN) {\n      // Trigger the callback right away if there is no pending writes at the moment.\n      callback.resolve();\n      return;\n    }\n\n    const callbacks =\n      syncEngineImpl.pendingWritesCallbacks.get(highestBatchId) || [];\n    callbacks.push(callback);\n    syncEngineImpl.pendingWritesCallbacks.set(highestBatchId, callbacks);\n  } catch (e) {\n    const firestoreError = wrapInUserErrorIfRecoverable(\n      e as Error,\n      'Initialization of waitForPendingWrites() operation failed'\n    );\n    callback.reject(firestoreError);\n  }\n}\n\n/**\n * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,\n * if there are any.\n */\nfunction triggerPendingWritesCallbacks(\n  syncEngineImpl: SyncEngineImpl,\n  batchId: BatchId\n): void {\n  (syncEngineImpl.pendingWritesCallbacks.get(batchId) || []).forEach(\n    callback => {\n      callback.resolve();\n    }\n  );\n\n  syncEngineImpl.pendingWritesCallbacks.delete(batchId);\n}\n\n/** Reject all outstanding callbacks waiting for pending writes to complete. */\nfunction rejectOutstandingPendingWritesCallbacks(\n  syncEngineImpl: SyncEngineImpl,\n  errorMessage: string\n): void {\n  syncEngineImpl.pendingWritesCallbacks.forEach(callbacks => {\n    callbacks.forEach(callback => {\n      callback.reject(new FirestoreError(Code.CANCELLED, errorMessage));\n    });\n  });\n\n  syncEngineImpl.pendingWritesCallbacks.clear();\n}\n\nfunction addMutationCallback(\n  syncEngineImpl: SyncEngineImpl,\n  batchId: BatchId,\n  callback: Deferred<void>\n): void {\n  let newCallbacks =\n    syncEngineImpl.mutationUserCallbacks[syncEngineImpl.currentUser.toKey()];\n  if (!newCallbacks) {\n    newCallbacks = new SortedMap<BatchId, Deferred<void>>(primitiveComparator);\n  }\n  newCallbacks = newCallbacks.insert(batchId, callback);\n  syncEngineImpl.mutationUserCallbacks[syncEngineImpl.currentUser.toKey()] =\n    newCallbacks;\n}\n\n/**\n * Resolves or rejects the user callback for the given batch and then discards\n * it.\n */\nfunction processUserCallback(\n  syncEngine: SyncEngine,\n  batchId: BatchId,\n  error: FirestoreError | null\n): void {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n  let newCallbacks =\n    syncEngineImpl.mutationUserCallbacks[syncEngineImpl.currentUser.toKey()];\n\n  // NOTE: Mutations restored from persistence won't have callbacks, so it's\n  // okay for there to be no callback for this ID.\n  if (newCallbacks) {\n    const callback = newCallbacks.get(batchId);\n    if (callback) {\n      debugAssert(\n        batchId === newCallbacks.minKey(),\n        'Mutation callbacks processed out-of-order?'\n      );\n      if (error) {\n        callback.reject(error);\n      } else {\n        callback.resolve();\n      }\n      newCallbacks = newCallbacks.remove(batchId);\n    }\n    syncEngineImpl.mutationUserCallbacks[syncEngineImpl.currentUser.toKey()] =\n      newCallbacks;\n  }\n}\n\nfunction removeAndCleanupTarget(\n  syncEngineImpl: SyncEngineImpl,\n  targetId: number,\n  error: FirestoreError | null = null\n): void {\n  syncEngineImpl.sharedClientState.removeLocalQueryTarget(targetId);\n\n  debugAssert(\n    syncEngineImpl.queriesByTarget.has(targetId) &&\n      syncEngineImpl.queriesByTarget.get(targetId)!.length !== 0,\n    `There are no queries mapped to target id ${targetId}`\n  );\n\n  for (const query of syncEngineImpl.queriesByTarget.get(targetId)!) {\n    syncEngineImpl.queryViewsByQuery.delete(query);\n    if (error) {\n      syncEngineImpl.syncEngineListener.onWatchError!(query, error);\n    }\n  }\n\n  syncEngineImpl.queriesByTarget.delete(targetId);\n\n  if (syncEngineImpl.isPrimaryClient) {\n    const limboKeys =\n      syncEngineImpl.limboDocumentRefs.removeReferencesForId(targetId);\n    limboKeys.forEach(limboKey => {\n      const isReferenced =\n        syncEngineImpl.limboDocumentRefs.containsKey(limboKey);\n      if (!isReferenced) {\n        // We removed the last reference for this key\n        removeLimboTarget(syncEngineImpl, limboKey);\n      }\n    });\n  }\n}\n\nfunction removeLimboTarget(\n  syncEngineImpl: SyncEngineImpl,\n  key: DocumentKey\n): void {\n  syncEngineImpl.enqueuedLimboResolutions.delete(key.path.canonicalString());\n\n  // It's possible that the target already got removed because the query failed. In that case,\n  // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.\n  const limboTargetId = syncEngineImpl.activeLimboTargetsByKey.get(key);\n  if (limboTargetId === null) {\n    // This target already got removed, because the query failed.\n    return;\n  }\n\n  remoteStoreUnlisten(syncEngineImpl.remoteStore, limboTargetId);\n  syncEngineImpl.activeLimboTargetsByKey =\n    syncEngineImpl.activeLimboTargetsByKey.remove(key);\n  syncEngineImpl.activeLimboResolutionsByTarget.delete(limboTargetId);\n  pumpEnqueuedLimboResolutions(syncEngineImpl);\n}\n\nfunction updateTrackedLimbos(\n  syncEngineImpl: SyncEngineImpl,\n  targetId: TargetId,\n  limboChanges: LimboDocumentChange[]\n): void {\n  for (const limboChange of limboChanges) {\n    if (limboChange instanceof AddedLimboDocument) {\n      syncEngineImpl.limboDocumentRefs.addReference(limboChange.key, targetId);\n      trackLimboChange(syncEngineImpl, limboChange);\n    } else if (limboChange instanceof RemovedLimboDocument) {\n      logDebug(LOG_TAG, 'Document no longer in limbo: ' + limboChange.key);\n      syncEngineImpl.limboDocumentRefs.removeReference(\n        limboChange.key,\n        targetId\n      );\n      const isReferenced = syncEngineImpl.limboDocumentRefs.containsKey(\n        limboChange.key\n      );\n      if (!isReferenced) {\n        // We removed the last reference for this key\n        removeLimboTarget(syncEngineImpl, limboChange.key);\n      }\n    } else {\n      fail('Unknown limbo change: ' + JSON.stringify(limboChange));\n    }\n  }\n}\n\nfunction trackLimboChange(\n  syncEngineImpl: SyncEngineImpl,\n  limboChange: AddedLimboDocument\n): void {\n  const key = limboChange.key;\n  const keyString = key.path.canonicalString();\n  if (\n    !syncEngineImpl.activeLimboTargetsByKey.get(key) &&\n    !syncEngineImpl.enqueuedLimboResolutions.has(keyString)\n  ) {\n    logDebug(LOG_TAG, 'New document in limbo: ' + key);\n    syncEngineImpl.enqueuedLimboResolutions.add(keyString);\n    pumpEnqueuedLimboResolutions(syncEngineImpl);\n  }\n}\n\n/**\n * Starts listens for documents in limbo that are enqueued for resolution,\n * subject to a maximum number of concurrent resolutions.\n *\n * Without bounding the number of concurrent resolutions, the server can fail\n * with \"resource exhausted\" errors which can lead to pathological client\n * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683.\n */\nfunction pumpEnqueuedLimboResolutions(syncEngineImpl: SyncEngineImpl): void {\n  while (\n    syncEngineImpl.enqueuedLimboResolutions.size > 0 &&\n    syncEngineImpl.activeLimboTargetsByKey.size <\n      syncEngineImpl.maxConcurrentLimboResolutions\n  ) {\n    const keyString = syncEngineImpl.enqueuedLimboResolutions\n      .values()\n      .next().value;\n    syncEngineImpl.enqueuedLimboResolutions.delete(keyString);\n    const key = new DocumentKey(ResourcePath.fromString(keyString));\n    const limboTargetId = syncEngineImpl.limboTargetIdGenerator.next();\n    syncEngineImpl.activeLimboResolutionsByTarget.set(\n      limboTargetId,\n      new LimboResolution(key)\n    );\n    syncEngineImpl.activeLimboTargetsByKey =\n      syncEngineImpl.activeLimboTargetsByKey.insert(key, limboTargetId);\n    remoteStoreListen(\n      syncEngineImpl.remoteStore,\n      new TargetData(\n        queryToTarget(newQueryForPath(key.path)),\n        limboTargetId,\n        TargetPurpose.LimboResolution,\n        ListenSequence.INVALID\n      )\n    );\n  }\n}\n\n// Visible for testing\nexport function syncEngineGetActiveLimboDocumentResolutions(\n  syncEngine: SyncEngine\n): SortedMap<DocumentKey, TargetId> {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n  return syncEngineImpl.activeLimboTargetsByKey;\n}\n\n// Visible for testing\nexport function syncEngineGetEnqueuedLimboDocumentResolutions(\n  syncEngine: SyncEngine\n): Set<string> {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n  return syncEngineImpl.enqueuedLimboResolutions;\n}\n\nexport async function syncEngineEmitNewSnapsAndNotifyLocalStore(\n  syncEngine: SyncEngine,\n  changes: DocumentMap,\n  remoteEvent?: RemoteEvent\n): Promise<void> {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n  const newSnaps: ViewSnapshot[] = [];\n  const docChangesInAllViews: LocalViewChanges[] = [];\n  const queriesProcessed: Array<Promise<void>> = [];\n\n  if (syncEngineImpl.queryViewsByQuery.isEmpty()) {\n    // Return early since `onWatchChange()` might not have been assigned yet.\n    return;\n  }\n\n  syncEngineImpl.queryViewsByQuery.forEach((_, queryView) => {\n    debugAssert(\n      !!syncEngineImpl.applyDocChanges,\n      'ApplyDocChangesHandler not set'\n    );\n    queriesProcessed.push(\n      syncEngineImpl\n        .applyDocChanges(queryView, changes, remoteEvent)\n        .then(viewSnapshot => {\n          // If there are changes, or we are handling a global snapshot, notify\n          // secondary clients to update query state.\n          if (viewSnapshot || remoteEvent) {\n            if (syncEngineImpl.isPrimaryClient) {\n              syncEngineImpl.sharedClientState.updateQueryState(\n                queryView.targetId,\n                viewSnapshot?.fromCache ? 'not-current' : 'current'\n              );\n            }\n          }\n\n          // Update views if there are actual changes.\n          if (!!viewSnapshot) {\n            newSnaps.push(viewSnapshot);\n            const docChanges = LocalViewChanges.fromSnapshot(\n              queryView.targetId,\n              viewSnapshot\n            );\n            docChangesInAllViews.push(docChanges);\n          }\n        })\n    );\n  });\n\n  await Promise.all(queriesProcessed);\n  syncEngineImpl.syncEngineListener.onWatchChange!(newSnaps);\n  await localStoreNotifyLocalViewChanges(\n    syncEngineImpl.localStore,\n    docChangesInAllViews\n  );\n}\n\nasync function applyDocChanges(\n  syncEngineImpl: SyncEngineImpl,\n  queryView: QueryView,\n  changes: DocumentMap,\n  remoteEvent?: RemoteEvent\n): Promise<ViewSnapshot | undefined> {\n  let viewDocChanges = queryView.view.computeDocChanges(changes);\n  if (viewDocChanges.needsRefill) {\n    // The query has a limit and some docs were removed, so we need\n    // to re-run the query against the local store to make sure we\n    // didn't lose any good docs that had been past the limit.\n    viewDocChanges = await localStoreExecuteQuery(\n      syncEngineImpl.localStore,\n      queryView.query,\n      /* usePreviousResults= */ false\n    ).then(({ documents }) => {\n      return queryView.view.computeDocChanges(documents, viewDocChanges);\n    });\n  }\n\n  const targetChange =\n    remoteEvent && remoteEvent.targetChanges.get(queryView.targetId);\n  const targetIsPendingReset =\n    remoteEvent && remoteEvent.targetMismatches.get(queryView.targetId) != null;\n  const viewChange = queryView.view.applyChanges(\n    viewDocChanges,\n    /* limboResolutionEnabled= */ syncEngineImpl.isPrimaryClient,\n    targetChange,\n    targetIsPendingReset\n  );\n  updateTrackedLimbos(\n    syncEngineImpl,\n    queryView.targetId,\n    viewChange.limboChanges\n  );\n  return viewChange.snapshot;\n}\n\nexport async function syncEngineHandleCredentialChange(\n  syncEngine: SyncEngine,\n  user: User\n): Promise<void> {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n  const userChanged = !syncEngineImpl.currentUser.isEqual(user);\n\n  if (userChanged) {\n    logDebug(LOG_TAG, 'User change. New user:', user.toKey());\n\n    const result = await localStoreHandleUserChange(\n      syncEngineImpl.localStore,\n      user\n    );\n    syncEngineImpl.currentUser = user;\n\n    // Fails tasks waiting for pending writes requested by previous user.\n    rejectOutstandingPendingWritesCallbacks(\n      syncEngineImpl,\n      \"'waitForPendingWrites' promise is rejected due to a user change.\"\n    );\n    // TODO(b/114226417): Consider calling this only in the primary tab.\n    syncEngineImpl.sharedClientState.handleUserChange(\n      user,\n      result.removedBatchIds,\n      result.addedBatchIds\n    );\n    await syncEngineEmitNewSnapsAndNotifyLocalStore(\n      syncEngineImpl,\n      result.affectedDocuments\n    );\n  }\n}\n\nexport function syncEngineGetRemoteKeysForTarget(\n  syncEngine: SyncEngine,\n  targetId: TargetId\n): DocumentKeySet {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n  const limboResolution =\n    syncEngineImpl.activeLimboResolutionsByTarget.get(targetId);\n  if (limboResolution && limboResolution.receivedDocument) {\n    return documentKeySet().add(limboResolution.key);\n  } else {\n    let keySet = documentKeySet();\n    const queries = syncEngineImpl.queriesByTarget.get(targetId);\n    if (!queries) {\n      return keySet;\n    }\n    for (const query of queries) {\n      const queryView = syncEngineImpl.queryViewsByQuery.get(query);\n      debugAssert(\n        !!queryView,\n        `No query view found for ${stringifyQuery(query)}`\n      );\n      keySet = keySet.unionWith(queryView.view.syncedDocuments);\n    }\n    return keySet;\n  }\n}\n\n/**\n * Reconcile the list of synced documents in an existing view with those\n * from persistence.\n */\nasync function synchronizeViewAndComputeSnapshot(\n  syncEngine: SyncEngine,\n  queryView: QueryView\n): Promise<ViewChange> {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n  const queryResult = await localStoreExecuteQuery(\n    syncEngineImpl.localStore,\n    queryView.query,\n    /* usePreviousResults= */ true\n  );\n  const viewSnapshot =\n    queryView.view.synchronizeWithPersistedState(queryResult);\n  if (syncEngineImpl.isPrimaryClient) {\n    updateTrackedLimbos(\n      syncEngineImpl,\n      queryView.targetId,\n      viewSnapshot.limboChanges\n    );\n  }\n  return viewSnapshot;\n}\n\n/**\n * Retrieves newly changed documents from remote document cache and raises\n * snapshots if needed.\n */\n// PORTING NOTE: Multi-Tab only.\nexport async function syncEngineSynchronizeWithChangedDocuments(\n  syncEngine: SyncEngine,\n  collectionGroup: string\n): Promise<void> {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n\n  return localStoreGetNewDocumentChanges(\n    syncEngineImpl.localStore,\n    collectionGroup\n  ).then(changes =>\n    syncEngineEmitNewSnapsAndNotifyLocalStore(syncEngineImpl, changes)\n  );\n}\n\n/** Applies a mutation state to an existing batch.  */\n// PORTING NOTE: Multi-Tab only.\nexport async function syncEngineApplyBatchState(\n  syncEngine: SyncEngine,\n  batchId: BatchId,\n  batchState: MutationBatchState,\n  error?: FirestoreError\n): Promise<void> {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n  const documents = await localStoreLookupMutationDocuments(\n    syncEngineImpl.localStore,\n    batchId\n  );\n\n  if (documents === null) {\n    // A throttled tab may not have seen the mutation before it was completed\n    // and removed from the mutation queue, in which case we won't have cached\n    // the affected documents. In this case we can safely ignore the update\n    // since that means we didn't apply the mutation locally at all (if we\n    // had, we would have cached the affected documents), and so we will just\n    // see any resulting document changes via normal remote document updates\n    // as applicable.\n    logDebug(LOG_TAG, 'Cannot apply mutation batch with id: ' + batchId);\n    return;\n  }\n\n  if (batchState === 'pending') {\n    // If we are the primary client, we need to send this write to the\n    // backend. Secondary clients will ignore these writes since their remote\n    // connection is disabled.\n    await fillWritePipeline(syncEngineImpl.remoteStore);\n  } else if (batchState === 'acknowledged' || batchState === 'rejected') {\n    // NOTE: Both these methods are no-ops for batches that originated from\n    // other clients.\n    processUserCallback(syncEngineImpl, batchId, error ? error : null);\n    triggerPendingWritesCallbacks(syncEngineImpl, batchId);\n    localStoreRemoveCachedMutationBatchMetadata(\n      syncEngineImpl.localStore,\n      batchId\n    );\n  } else {\n    fail(`Unknown batchState: ${batchState}`);\n  }\n\n  await syncEngineEmitNewSnapsAndNotifyLocalStore(syncEngineImpl, documents);\n}\n\n/** Applies a query target change from a different tab. */\n// PORTING NOTE: Multi-Tab only.\nexport async function syncEngineApplyPrimaryState(\n  syncEngine: SyncEngine,\n  isPrimary: boolean\n): Promise<void> {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n  ensureWatchCallbacks(syncEngineImpl);\n  syncEngineEnsureWriteCallbacks(syncEngineImpl);\n  if (isPrimary === true && syncEngineImpl._isPrimaryClient !== true) {\n    // Secondary tabs only maintain Views for their local listeners and the\n    // Views internal state may not be 100% populated (in particular\n    // secondary tabs don't track syncedDocuments, the set of documents the\n    // server considers to be in the target). So when a secondary becomes\n    // primary, we need to need to make sure that all views for all targets\n    // match the state on disk.\n    const activeTargets =\n      syncEngineImpl.sharedClientState.getAllActiveQueryTargets();\n    const activeQueries = await synchronizeQueryViewsAndRaiseSnapshots(\n      syncEngineImpl,\n      activeTargets.toArray(),\n      /*transitionToPrimary=*/ true\n    );\n    syncEngineImpl._isPrimaryClient = true;\n    await remoteStoreApplyPrimaryState(syncEngineImpl.remoteStore, true);\n    for (const targetData of activeQueries) {\n      remoteStoreListen(syncEngineImpl.remoteStore, targetData);\n    }\n  } else if (isPrimary === false && syncEngineImpl._isPrimaryClient !== false) {\n    const activeTargets: TargetId[] = [];\n\n    let p = Promise.resolve();\n    syncEngineImpl.queriesByTarget.forEach((_, targetId) => {\n      if (syncEngineImpl.sharedClientState.isLocalQueryTarget(targetId)) {\n        activeTargets.push(targetId);\n      } else {\n        p = p.then(() => {\n          removeAndCleanupTarget(syncEngineImpl, targetId);\n          return localStoreReleaseTarget(\n            syncEngineImpl.localStore,\n            targetId,\n            /*keepPersistedTargetData=*/ true\n          );\n        });\n      }\n      remoteStoreUnlisten(syncEngineImpl.remoteStore, targetId);\n    });\n    await p;\n\n    await synchronizeQueryViewsAndRaiseSnapshots(\n      syncEngineImpl,\n      activeTargets,\n      /*transitionToPrimary=*/ false\n    );\n    resetLimboDocuments(syncEngineImpl);\n    syncEngineImpl._isPrimaryClient = false;\n    await remoteStoreApplyPrimaryState(syncEngineImpl.remoteStore, false);\n  }\n}\n\n// PORTING NOTE: Multi-Tab only.\nfunction resetLimboDocuments(syncEngine: SyncEngine): void {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n  syncEngineImpl.activeLimboResolutionsByTarget.forEach((_, targetId) => {\n    remoteStoreUnlisten(syncEngineImpl.remoteStore, targetId);\n  });\n  syncEngineImpl.limboDocumentRefs.removeAllReferences();\n  syncEngineImpl.activeLimboResolutionsByTarget = new Map<\n    TargetId,\n    LimboResolution\n  >();\n  syncEngineImpl.activeLimboTargetsByKey = new SortedMap<DocumentKey, TargetId>(\n    DocumentKey.comparator\n  );\n}\n\n/**\n * Reconcile the query views of the provided query targets with the state from\n * persistence. Raises snapshots for any changes that affect the local\n * client and returns the updated state of all target's query data.\n *\n * @param syncEngine - The sync engine implementation\n * @param targets - the list of targets with views that need to be recomputed\n * @param transitionToPrimary - `true` iff the tab transitions from a secondary\n * tab to a primary tab\n */\n// PORTING NOTE: Multi-Tab only.\nasync function synchronizeQueryViewsAndRaiseSnapshots(\n  syncEngine: SyncEngine,\n  targets: TargetId[],\n  transitionToPrimary: boolean\n): Promise<TargetData[]> {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n  const activeQueries: TargetData[] = [];\n  const newViewSnapshots: ViewSnapshot[] = [];\n  for (const targetId of targets) {\n    let targetData: TargetData;\n    const queries = syncEngineImpl.queriesByTarget.get(targetId);\n\n    if (queries && queries.length !== 0) {\n      // For queries that have a local View, we fetch their current state\n      // from LocalStore (as the resume token and the snapshot version\n      // might have changed) and reconcile their views with the persisted\n      // state (the list of syncedDocuments may have gotten out of sync).\n      targetData = await localStoreAllocateTarget(\n        syncEngineImpl.localStore,\n        queryToTarget(queries[0])\n      );\n\n      for (const query of queries) {\n        const queryView = syncEngineImpl.queryViewsByQuery.get(query);\n        debugAssert(\n          !!queryView,\n          `No query view found for ${stringifyQuery(query)}`\n        );\n\n        const viewChange = await synchronizeViewAndComputeSnapshot(\n          syncEngineImpl,\n          queryView\n        );\n        if (viewChange.snapshot) {\n          newViewSnapshots.push(viewChange.snapshot);\n        }\n      }\n    } else {\n      debugAssert(\n        transitionToPrimary,\n        'A secondary tab should never have an active view without an active target.'\n      );\n      // For queries that never executed on this client, we need to\n      // allocate the target in LocalStore and initialize a new View.\n      const target = await localStoreGetCachedTarget(\n        syncEngineImpl.localStore,\n        targetId\n      );\n      debugAssert(!!target, `Target for id ${targetId} not found`);\n      targetData = await localStoreAllocateTarget(\n        syncEngineImpl.localStore,\n        target\n      );\n      await initializeViewAndComputeSnapshot(\n        syncEngineImpl,\n        synthesizeTargetToQuery(target!),\n        targetId,\n        /*current=*/ false,\n        targetData.resumeToken\n      );\n    }\n\n    activeQueries.push(targetData!);\n  }\n\n  syncEngineImpl.syncEngineListener.onWatchChange!(newViewSnapshots);\n  return activeQueries;\n}\n\n/**\n * Creates a `Query` object from the specified `Target`. There is no way to\n * obtain the original `Query`, so we synthesize a `Query` from the `Target`\n * object.\n *\n * The synthesized result might be different from the original `Query`, but\n * since the synthesized `Query` should return the same results as the\n * original one (only the presentation of results might differ), the potential\n * difference will not cause issues.\n */\n// PORTING NOTE: Multi-Tab only.\nfunction synthesizeTargetToQuery(target: Target): Query {\n  return newQuery(\n    target.path,\n    target.collectionGroup,\n    target.orderBy,\n    target.filters,\n    target.limit,\n    LimitType.First,\n    target.startAt,\n    target.endAt\n  );\n}\n\n/** Returns the IDs of the clients that are currently active. */\n// PORTING NOTE: Multi-Tab only.\nexport function syncEngineGetActiveClients(\n  syncEngine: SyncEngine\n): Promise<ClientId[]> {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n  return localStoreGetActiveClients(syncEngineImpl.localStore);\n}\n\n/** Applies a query target change from a different tab. */\n// PORTING NOTE: Multi-Tab only.\nexport async function syncEngineApplyTargetState(\n  syncEngine: SyncEngine,\n  targetId: TargetId,\n  state: QueryTargetState,\n  error?: FirestoreError\n): Promise<void> {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n  if (syncEngineImpl._isPrimaryClient) {\n    // If we receive a target state notification via WebStorage, we are\n    // either already secondary or another tab has taken the primary lease.\n    logDebug(LOG_TAG, 'Ignoring unexpected query state notification.');\n    return;\n  }\n\n  const query = syncEngineImpl.queriesByTarget.get(targetId);\n  if (query && query.length > 0) {\n    switch (state) {\n      case 'current':\n      case 'not-current': {\n        const changes = await localStoreGetNewDocumentChanges(\n          syncEngineImpl.localStore,\n          queryCollectionGroup(query[0])\n        );\n        const synthesizedRemoteEvent =\n          RemoteEvent.createSynthesizedRemoteEventForCurrentChange(\n            targetId,\n            state === 'current',\n            ByteString.EMPTY_BYTE_STRING\n          );\n        await syncEngineEmitNewSnapsAndNotifyLocalStore(\n          syncEngineImpl,\n          changes,\n          synthesizedRemoteEvent\n        );\n        break;\n      }\n      case 'rejected': {\n        await localStoreReleaseTarget(\n          syncEngineImpl.localStore,\n          targetId,\n          /* keepPersistedTargetData */ true\n        );\n        removeAndCleanupTarget(syncEngineImpl, targetId, error);\n        break;\n      }\n      default:\n        fail('Unexpected target state: ' + state);\n    }\n  }\n}\n\n/** Adds or removes Watch targets for queries from different tabs. */\nexport async function syncEngineApplyActiveTargetsChange(\n  syncEngine: SyncEngine,\n  added: TargetId[],\n  removed: TargetId[]\n): Promise<void> {\n  const syncEngineImpl = ensureWatchCallbacks(syncEngine);\n  if (!syncEngineImpl._isPrimaryClient) {\n    return;\n  }\n\n  for (const targetId of added) {\n    // A target is already listening to remote store if it is already registered to\n    // sharedClientState.\n    const targetAlreadyListeningToRemoteStore =\n      syncEngineImpl.queriesByTarget.has(targetId) &&\n      syncEngineImpl.sharedClientState.isActiveQueryTarget(targetId);\n    if (targetAlreadyListeningToRemoteStore) {\n      logDebug(LOG_TAG, 'Adding an already active target ' + targetId);\n      continue;\n    }\n\n    const target = await localStoreGetCachedTarget(\n      syncEngineImpl.localStore,\n      targetId\n    );\n    debugAssert(!!target, `Query data for active target ${targetId} not found`);\n    const targetData = await localStoreAllocateTarget(\n      syncEngineImpl.localStore,\n      target\n    );\n    await initializeViewAndComputeSnapshot(\n      syncEngineImpl,\n      synthesizeTargetToQuery(target),\n      targetData.targetId,\n      /*current=*/ false,\n      targetData.resumeToken\n    );\n    remoteStoreListen(syncEngineImpl.remoteStore, targetData);\n  }\n\n  for (const targetId of removed) {\n    // Check that the target is still active since the target might have been\n    // removed if it has been rejected by the backend.\n    if (!syncEngineImpl.queriesByTarget.has(targetId)) {\n      continue;\n    }\n\n    // Release queries that are still active.\n    await localStoreReleaseTarget(\n      syncEngineImpl.localStore,\n      targetId,\n      /* keepPersistedTargetData */ false\n    )\n      .then(() => {\n        remoteStoreUnlisten(syncEngineImpl.remoteStore, targetId);\n        removeAndCleanupTarget(syncEngineImpl, targetId);\n      })\n      .catch(ignoreIfPrimaryLeaseLoss);\n  }\n}\n\nfunction ensureWatchCallbacks(syncEngine: SyncEngine): SyncEngineImpl {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n  syncEngineImpl.remoteStore.remoteSyncer.applyRemoteEvent =\n    syncEngineApplyRemoteEvent.bind(null, syncEngineImpl);\n  syncEngineImpl.remoteStore.remoteSyncer.getRemoteKeysForTarget =\n    syncEngineGetRemoteKeysForTarget.bind(null, syncEngineImpl);\n  syncEngineImpl.remoteStore.remoteSyncer.rejectListen =\n    syncEngineRejectListen.bind(null, syncEngineImpl);\n  syncEngineImpl.syncEngineListener.onWatchChange =\n    eventManagerOnWatchChange.bind(null, syncEngineImpl.eventManager);\n  syncEngineImpl.syncEngineListener.onWatchError =\n    eventManagerOnWatchError.bind(null, syncEngineImpl.eventManager);\n  return syncEngineImpl;\n}\n\nexport function syncEngineEnsureWriteCallbacks(\n  syncEngine: SyncEngine\n): SyncEngineImpl {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n  syncEngineImpl.remoteStore.remoteSyncer.applySuccessfulWrite =\n    syncEngineApplySuccessfulWrite.bind(null, syncEngineImpl);\n  syncEngineImpl.remoteStore.remoteSyncer.rejectFailedWrite =\n    syncEngineRejectFailedWrite.bind(null, syncEngineImpl);\n  return syncEngineImpl;\n}\n\n/**\n * Loads a Firestore bundle into the SDK. The returned promise resolves when\n * the bundle finished loading.\n *\n * @param syncEngine - SyncEngine to use.\n * @param bundleReader - Bundle to load into the SDK.\n * @param task - LoadBundleTask used to update the loading progress to public API.\n */\nexport function syncEngineLoadBundle(\n  syncEngine: SyncEngine,\n  bundleReader: BundleReader,\n  task: LoadBundleTask\n): void {\n  const syncEngineImpl = debugCast(syncEngine, SyncEngineImpl);\n\n  // eslint-disable-next-line @typescript-eslint/no-floating-promises\n  loadBundleImpl(syncEngineImpl, bundleReader, task).then(collectionGroups => {\n    syncEngineImpl.sharedClientState.notifyBundleLoaded(collectionGroups);\n  });\n}\n\n/** Loads a bundle and returns the list of affected collection groups. */\nasync function loadBundleImpl(\n  syncEngine: SyncEngineImpl,\n  reader: BundleReader,\n  task: LoadBundleTask\n): Promise<Set<string>> {\n  try {\n    const metadata = await reader.getMetadata();\n    const skip = await localStoreHasNewerBundle(\n      syncEngine.localStore,\n      metadata\n    );\n    if (skip) {\n      await reader.close();\n      task._completeWith(bundleSuccessProgress(metadata));\n      return Promise.resolve(new Set<string>());\n    }\n\n    task._updateProgress(bundleInitialProgress(metadata));\n\n    const loader = new BundleLoader(\n      metadata,\n      syncEngine.localStore,\n      reader.serializer\n    );\n    let element = await reader.nextElement();\n    while (element) {\n      debugAssert(\n        !element.payload.metadata,\n        'Unexpected BundleMetadata element.'\n      );\n      const progress = await loader.addSizedElement(element);\n      if (progress) {\n        task._updateProgress(progress);\n      }\n\n      element = await reader.nextElement();\n    }\n\n    const result = await loader.complete();\n    await syncEngineEmitNewSnapsAndNotifyLocalStore(\n      syncEngine,\n      result.changedDocs,\n      /* remoteEvent */ undefined\n    );\n\n    // Save metadata, so loading the same bundle will skip.\n    await localStoreSaveBundle(syncEngine.localStore, metadata);\n    task._completeWith(result.progress);\n    return Promise.resolve(result.changedCollectionGroups);\n  } catch (e) {\n    logWarn(LOG_TAG, `Loading bundle failed with ${e}`);\n    task._failWith(e as FirestoreError);\n    return Promise.resolve(new Set<string>());\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CredentialsProvider } from '../api/credentials';\nimport { User } from '../auth/user';\nimport {\n  IndexBackfiller,\n  IndexBackfillerScheduler\n} from '../local/index_backfiller';\nimport {\n  indexedDbStoragePrefix,\n  IndexedDbPersistence\n} from '../local/indexeddb_persistence';\nimport { LocalStore } from '../local/local_store';\nimport { newLocalStore } from '../local/local_store_impl';\nimport { LruParams } from '../local/lru_garbage_collector';\nimport { LruScheduler } from '../local/lru_garbage_collector_impl';\nimport {\n  MemoryEagerDelegate,\n  MemoryLruDelegate,\n  MemoryPersistence\n} from '../local/memory_persistence';\nimport { Scheduler, Persistence } from '../local/persistence';\nimport { QueryEngine } from '../local/query_engine';\nimport {\n  ClientId,\n  MemorySharedClientState,\n  SharedClientState,\n  WebStorageSharedClientState\n} from '../local/shared_client_state';\nimport { newConnection, newConnectivityMonitor } from '../platform/connection';\nimport { getDocument, getWindow } from '../platform/dom';\nimport { newSerializer } from '../platform/serializer';\nimport { Datastore, newDatastore } from '../remote/datastore';\nimport {\n  fillWritePipeline,\n  newRemoteStore,\n  RemoteStore,\n  remoteStoreApplyPrimaryState,\n  remoteStoreShutdown\n} from '../remote/remote_store';\nimport { JsonProtoSerializer } from '../remote/serializer';\nimport { hardAssert } from '../util/assert';\nimport { AsyncQueue } from '../util/async_queue';\nimport { Code, FirestoreError } from '../util/error';\n\nimport { DatabaseInfo } from './database_info';\nimport { EventManager, newEventManager } from './event_manager';\nimport { SyncEngine } from './sync_engine';\nimport {\n  newSyncEngine,\n  syncEngineApplyActiveTargetsChange,\n  syncEngineApplyBatchState,\n  syncEngineApplyOnlineStateChange,\n  syncEngineApplyPrimaryState,\n  syncEngineApplyTargetState,\n  syncEngineEnsureWriteCallbacks,\n  syncEngineGetActiveClients,\n  syncEngineHandleCredentialChange,\n  syncEngineSynchronizeWithChangedDocuments\n} from './sync_engine_impl';\nimport { OnlineStateSource } from './types';\n\nexport interface ComponentConfiguration {\n  asyncQueue: AsyncQueue;\n  databaseInfo: DatabaseInfo;\n  authCredentials: CredentialsProvider<User>;\n  appCheckCredentials: CredentialsProvider<string>;\n  clientId: ClientId;\n  initialUser: User;\n  maxConcurrentLimboResolutions: number;\n}\n\n/**\n * Initializes and wires components that are needed to interface with the local\n * cache. Implementations override `initialize()` to provide all components.\n */\nexport interface OfflineComponentProvider {\n  persistence: Persistence;\n  sharedClientState: SharedClientState;\n  localStore: LocalStore;\n  gcScheduler: Scheduler | null;\n  indexBackfillerScheduler: Scheduler | null;\n  synchronizeTabs: boolean;\n\n  initialize(cfg: ComponentConfiguration): Promise<void>;\n\n  terminate(): Promise<void>;\n}\n\n/**\n * Provides all components needed for Firestore with in-memory persistence.\n * Uses EagerGC garbage collection.\n */\nexport class MemoryOfflineComponentProvider\n  implements OfflineComponentProvider\n{\n  persistence!: Persistence;\n  sharedClientState!: SharedClientState;\n  localStore!: LocalStore;\n  gcScheduler!: Scheduler | null;\n  indexBackfillerScheduler!: Scheduler | null;\n  synchronizeTabs = false;\n\n  serializer!: JsonProtoSerializer;\n\n  async initialize(cfg: ComponentConfiguration): Promise<void> {\n    this.serializer = newSerializer(cfg.databaseInfo.databaseId);\n    this.sharedClientState = this.createSharedClientState(cfg);\n    this.persistence = this.createPersistence(cfg);\n    await this.persistence.start();\n    this.localStore = this.createLocalStore(cfg);\n    this.gcScheduler = this.createGarbageCollectionScheduler(\n      cfg,\n      this.localStore\n    );\n    this.indexBackfillerScheduler = this.createIndexBackfillerScheduler(\n      cfg,\n      this.localStore\n    );\n  }\n\n  createGarbageCollectionScheduler(\n    cfg: ComponentConfiguration,\n    localStore: LocalStore\n  ): Scheduler | null {\n    return null;\n  }\n\n  createIndexBackfillerScheduler(\n    cfg: ComponentConfiguration,\n    localStore: LocalStore\n  ): Scheduler | null {\n    return null;\n  }\n\n  createLocalStore(cfg: ComponentConfiguration): LocalStore {\n    return newLocalStore(\n      this.persistence,\n      new QueryEngine(),\n      cfg.initialUser,\n      this.serializer\n    );\n  }\n\n  createPersistence(cfg: ComponentConfiguration): Persistence {\n    return new MemoryPersistence(MemoryEagerDelegate.factory, this.serializer);\n  }\n\n  createSharedClientState(cfg: ComponentConfiguration): SharedClientState {\n    return new MemorySharedClientState();\n  }\n\n  async terminate(): Promise<void> {\n    this.gcScheduler?.stop();\n    this.indexBackfillerScheduler?.stop();\n    this.sharedClientState.shutdown();\n    await this.persistence.shutdown();\n  }\n}\n\nexport class LruGcMemoryOfflineComponentProvider extends MemoryOfflineComponentProvider {\n  constructor(protected readonly cacheSizeBytes: number | undefined) {\n    super();\n  }\n\n  createGarbageCollectionScheduler(\n    cfg: ComponentConfiguration,\n    localStore: LocalStore\n  ): Scheduler | null {\n    hardAssert(\n      this.persistence.referenceDelegate instanceof MemoryLruDelegate,\n      'referenceDelegate is expected to be an instance of MemoryLruDelegate.'\n    );\n\n    const garbageCollector =\n      this.persistence.referenceDelegate.garbageCollector;\n    return new LruScheduler(garbageCollector, cfg.asyncQueue, localStore);\n  }\n\n  createPersistence(cfg: ComponentConfiguration): Persistence {\n    const lruParams =\n      this.cacheSizeBytes !== undefined\n        ? LruParams.withCacheSize(this.cacheSizeBytes)\n        : LruParams.DEFAULT;\n    return new MemoryPersistence(\n      p => MemoryLruDelegate.factory(p, lruParams),\n      this.serializer\n    );\n  }\n}\n\n/**\n * Provides all components needed for Firestore with IndexedDB persistence.\n */\nexport class IndexedDbOfflineComponentProvider extends MemoryOfflineComponentProvider {\n  persistence!: IndexedDbPersistence;\n  sharedClientState!: SharedClientState;\n  localStore!: LocalStore;\n  gcScheduler!: Scheduler | null;\n  indexBackfillerScheduler!: Scheduler | null;\n  synchronizeTabs = false;\n\n  constructor(\n    protected readonly onlineComponentProvider: OnlineComponentProvider,\n    protected readonly cacheSizeBytes: number | undefined,\n    protected readonly forceOwnership: boolean | undefined\n  ) {\n    super();\n  }\n\n  async initialize(cfg: ComponentConfiguration): Promise<void> {\n    await super.initialize(cfg);\n\n    await this.onlineComponentProvider.initialize(this, cfg);\n\n    // Enqueue writes from a previous session\n    await syncEngineEnsureWriteCallbacks(\n      this.onlineComponentProvider.syncEngine\n    );\n    await fillWritePipeline(this.onlineComponentProvider.remoteStore);\n\n    // NOTE: This will immediately call the listener, so we make sure to\n    // set it after localStore / remoteStore are started.\n    await this.persistence.setPrimaryStateListener(() => {\n      if (this.gcScheduler && !this.gcScheduler.started) {\n        this.gcScheduler.start();\n      }\n      if (\n        this.indexBackfillerScheduler &&\n        !this.indexBackfillerScheduler.started\n      ) {\n        this.indexBackfillerScheduler.start();\n      }\n      return Promise.resolve();\n    });\n  }\n\n  createLocalStore(cfg: ComponentConfiguration): LocalStore {\n    return newLocalStore(\n      this.persistence,\n      new QueryEngine(),\n      cfg.initialUser,\n      this.serializer\n    );\n  }\n\n  createGarbageCollectionScheduler(\n    cfg: ComponentConfiguration,\n    localStore: LocalStore\n  ): Scheduler | null {\n    const garbageCollector =\n      this.persistence.referenceDelegate.garbageCollector;\n    return new LruScheduler(garbageCollector, cfg.asyncQueue, localStore);\n  }\n\n  createIndexBackfillerScheduler(\n    cfg: ComponentConfiguration,\n    localStore: LocalStore\n  ): Scheduler | null {\n    const indexBackfiller = new IndexBackfiller(localStore, this.persistence);\n    return new IndexBackfillerScheduler(cfg.asyncQueue, indexBackfiller);\n  }\n\n  createPersistence(cfg: ComponentConfiguration): IndexedDbPersistence {\n    const persistenceKey = indexedDbStoragePrefix(\n      cfg.databaseInfo.databaseId,\n      cfg.databaseInfo.persistenceKey\n    );\n    const lruParams =\n      this.cacheSizeBytes !== undefined\n        ? LruParams.withCacheSize(this.cacheSizeBytes)\n        : LruParams.DEFAULT;\n\n    return new IndexedDbPersistence(\n      this.synchronizeTabs,\n      persistenceKey,\n      cfg.clientId,\n      lruParams,\n      cfg.asyncQueue,\n      getWindow(),\n      getDocument(),\n      this.serializer,\n      this.sharedClientState,\n      !!this.forceOwnership\n    );\n  }\n\n  createSharedClientState(cfg: ComponentConfiguration): SharedClientState {\n    return new MemorySharedClientState();\n  }\n}\n\n/**\n * Provides all components needed for Firestore with multi-tab IndexedDB\n * persistence.\n *\n * In the legacy client, this provider is used to provide both multi-tab and\n * non-multi-tab persistence since we cannot tell at build time whether\n * `synchronizeTabs` will be enabled.\n */\nexport class MultiTabOfflineComponentProvider extends IndexedDbOfflineComponentProvider {\n  synchronizeTabs = true;\n\n  constructor(\n    protected readonly onlineComponentProvider: OnlineComponentProvider,\n    protected readonly cacheSizeBytes: number | undefined\n  ) {\n    super(onlineComponentProvider, cacheSizeBytes, /* forceOwnership= */ false);\n  }\n\n  async initialize(cfg: ComponentConfiguration): Promise<void> {\n    await super.initialize(cfg);\n\n    const syncEngine = this.onlineComponentProvider.syncEngine;\n\n    if (this.sharedClientState instanceof WebStorageSharedClientState) {\n      this.sharedClientState.syncEngine = {\n        applyBatchState: syncEngineApplyBatchState.bind(null, syncEngine),\n        applyTargetState: syncEngineApplyTargetState.bind(null, syncEngine),\n        applyActiveTargetsChange: syncEngineApplyActiveTargetsChange.bind(\n          null,\n          syncEngine\n        ),\n        getActiveClients: syncEngineGetActiveClients.bind(null, syncEngine),\n        synchronizeWithChangedDocuments:\n          syncEngineSynchronizeWithChangedDocuments.bind(null, syncEngine)\n      };\n      await this.sharedClientState.start();\n    }\n\n    // NOTE: This will immediately call the listener, so we make sure to\n    // set it after localStore / remoteStore are started.\n    await this.persistence.setPrimaryStateListener(async isPrimary => {\n      await syncEngineApplyPrimaryState(\n        this.onlineComponentProvider.syncEngine,\n        isPrimary\n      );\n      if (this.gcScheduler) {\n        if (isPrimary && !this.gcScheduler.started) {\n          this.gcScheduler.start();\n        } else if (!isPrimary) {\n          this.gcScheduler.stop();\n        }\n      }\n      if (this.indexBackfillerScheduler) {\n        if (isPrimary && !this.indexBackfillerScheduler.started) {\n          this.indexBackfillerScheduler.start();\n        } else if (!isPrimary) {\n          this.indexBackfillerScheduler.stop();\n        }\n      }\n    });\n  }\n\n  createSharedClientState(cfg: ComponentConfiguration): SharedClientState {\n    const window = getWindow();\n    if (!WebStorageSharedClientState.isAvailable(window)) {\n      throw new FirestoreError(\n        Code.UNIMPLEMENTED,\n        'IndexedDB persistence is only available on platforms that support LocalStorage.'\n      );\n    }\n    const persistenceKey = indexedDbStoragePrefix(\n      cfg.databaseInfo.databaseId,\n      cfg.databaseInfo.persistenceKey\n    );\n    return new WebStorageSharedClientState(\n      window,\n      cfg.asyncQueue,\n      persistenceKey,\n      cfg.clientId,\n      cfg.initialUser\n    );\n  }\n}\n\n/**\n * Initializes and wires the components that are needed to interface with the\n * network.\n */\nexport class OnlineComponentProvider {\n  protected localStore!: LocalStore;\n  protected sharedClientState!: SharedClientState;\n  datastore!: Datastore;\n  eventManager!: EventManager;\n  remoteStore!: RemoteStore;\n  syncEngine!: SyncEngine;\n\n  async initialize(\n    offlineComponentProvider: OfflineComponentProvider,\n    cfg: ComponentConfiguration\n  ): Promise<void> {\n    if (this.localStore) {\n      // OnlineComponentProvider may get initialized multiple times if\n      // multi-tab persistence is used.\n      return;\n    }\n\n    this.localStore = offlineComponentProvider.localStore;\n    this.sharedClientState = offlineComponentProvider.sharedClientState;\n    this.datastore = this.createDatastore(cfg);\n    this.remoteStore = this.createRemoteStore(cfg);\n    this.eventManager = this.createEventManager(cfg);\n    this.syncEngine = this.createSyncEngine(\n      cfg,\n      /* startAsPrimary=*/ !offlineComponentProvider.synchronizeTabs\n    );\n\n    this.sharedClientState.onlineStateHandler = onlineState =>\n      syncEngineApplyOnlineStateChange(\n        this.syncEngine,\n        onlineState,\n        OnlineStateSource.SharedClientState\n      );\n\n    this.remoteStore.remoteSyncer.handleCredentialChange =\n      syncEngineHandleCredentialChange.bind(null, this.syncEngine);\n\n    await remoteStoreApplyPrimaryState(\n      this.remoteStore,\n      this.syncEngine.isPrimaryClient\n    );\n  }\n\n  createEventManager(cfg: ComponentConfiguration): EventManager {\n    return newEventManager();\n  }\n\n  createDatastore(cfg: ComponentConfiguration): Datastore {\n    const serializer = newSerializer(cfg.databaseInfo.databaseId);\n    const connection = newConnection(cfg.databaseInfo);\n    return newDatastore(\n      cfg.authCredentials,\n      cfg.appCheckCredentials,\n      connection,\n      serializer\n    );\n  }\n\n  createRemoteStore(cfg: ComponentConfiguration): RemoteStore {\n    return newRemoteStore(\n      this.localStore,\n      this.datastore,\n      cfg.asyncQueue,\n      onlineState =>\n        syncEngineApplyOnlineStateChange(\n          this.syncEngine,\n          onlineState,\n          OnlineStateSource.RemoteStore\n        ),\n      newConnectivityMonitor()\n    );\n  }\n\n  createSyncEngine(\n    cfg: ComponentConfiguration,\n    startAsPrimary: boolean\n  ): SyncEngine {\n    return newSyncEngine(\n      this.localStore,\n      this.remoteStore,\n      this.eventManager,\n      this.sharedClientState,\n      cfg.initialUser,\n      cfg.maxConcurrentLimboResolutions,\n      startAsPrimary\n    );\n  }\n\n  async terminate(): Promise<void> {\n    await remoteStoreShutdown(this.remoteStore);\n    this.datastore?.terminate();\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DatabaseInfo } from '../../core/database_info';\nimport { Connection } from '../../remote/connection';\nimport { ConnectivityMonitor } from '../../remote/connectivity_monitor';\nimport { NoopConnectivityMonitor } from '../../remote/connectivity_monitor_noop';\n\nimport { BrowserConnectivityMonitor } from './connectivity_monitor';\nimport { WebChannelConnection } from './webchannel_connection';\n\n/** Initializes the WebChannelConnection for the browser. */\nexport function newConnection(databaseInfo: DatabaseInfo): Connection {\n  return new WebChannelConnection(databaseInfo);\n}\n\n/** Return the Platform-specific connectivity monitor. */\nexport function newConnectivityMonitor(): ConnectivityMonitor {\n  if (BrowserConnectivityMonitor.isAvailable()) {\n    return new BrowserConnectivityMonitor();\n  } else {\n    return new NoopConnectivityMonitor();\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { debugAssert } from './assert';\n\n/**\n * How many bytes to read each time when `ReadableStreamReader.read()` is\n * called. Only applicable for byte streams that we control (e.g. those backed\n * by an UInt8Array).\n */\nexport const DEFAULT_BYTES_PER_READ = 10240;\n\n/**\n * Builds a `ByteStreamReader` from a UInt8Array.\n * @param source - The data source to use.\n * @param bytesPerRead - How many bytes each `read()` from the returned reader\n *        will read.\n */\nexport function toByteStreamReaderHelper(\n  source: Uint8Array,\n  bytesPerRead: number = DEFAULT_BYTES_PER_READ\n): ReadableStreamReader<Uint8Array> {\n  debugAssert(\n    bytesPerRead > 0,\n    `toByteStreamReader expects positive bytesPerRead, but got ${bytesPerRead}`\n  );\n  let readFrom = 0;\n  // The TypeScript definition for ReadableStreamReader changed. We use\n  // `any` here to allow this code to compile with different versions.\n  // See https://github.com/microsoft/TypeScript/issues/42970\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const reader: any = {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    async read(): Promise<any> {\n      if (readFrom < source.byteLength) {\n        const result = {\n          value: source.slice(readFrom, readFrom + bytesPerRead),\n          done: false\n        } as const;\n        readFrom += bytesPerRead;\n        return result;\n      }\n\n      return { done: true };\n    },\n    async cancel(): Promise<void> {},\n    releaseLock() {},\n    closed: Promise.resolve()\n  };\n  return reader;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Observer } from '../core/event_manager';\n\nimport { FirestoreError } from './error';\nimport { logError } from './log';\nimport { EventHandler } from './misc';\n\n/*\n * A wrapper implementation of Observer<T> that will dispatch events\n * asynchronously. To allow immediate silencing, a mute call is added which\n * causes events scheduled to no longer be raised.\n */\nexport class AsyncObserver<T> implements Observer<T> {\n  /**\n   * When set to true, will not raise future events. Necessary to deal with\n   * async detachment of listener.\n   */\n  private muted = false;\n\n  constructor(private observer: Partial<Observer<T>>) {}\n\n  next(value: T): void {\n    if (this.observer.next) {\n      this.scheduleEvent(this.observer.next, value);\n    }\n  }\n\n  error(error: FirestoreError): void {\n    if (this.observer.error) {\n      this.scheduleEvent(this.observer.error, error);\n    } else {\n      logError('Uncaught Error in snapshot listener:', error.toString());\n    }\n  }\n\n  mute(): void {\n    this.muted = true;\n  }\n\n  private scheduleEvent<E>(eventHandler: EventHandler<E>, event: E): void {\n    if (!this.muted) {\n      setTimeout(() => {\n        if (!this.muted) {\n          eventHandler(event);\n        }\n      }, 0);\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { newTextDecoder } from '../platform/text_serializer';\nimport { BundleMetadata } from '../protos/firestore_bundle_proto';\nimport { JsonProtoSerializer } from '../remote/serializer';\n\nimport { debugAssert } from './assert';\nimport { BundleReader, SizedBundleElement } from './bundle_reader';\nimport { Deferred } from './promise';\n\n/**\n * A class representing a bundle.\n *\n * Takes a bundle stream or buffer, and presents abstractions to read bundled\n * elements out of the underlying content.\n */\nclass BundleReaderImpl implements BundleReader {\n  /** Cached bundle metadata. */\n  private metadata: Deferred<BundleMetadata> = new Deferred<BundleMetadata>();\n  /**\n   * Internal buffer to hold bundle content, accumulating incomplete element\n   * content.\n   */\n  private buffer: Uint8Array = new Uint8Array();\n  /** The decoder used to parse binary data into strings. */\n  private textDecoder: TextDecoder;\n\n  constructor(\n    /** The reader to read from underlying binary bundle data source. */\n    private reader: ReadableStreamReader<Uint8Array>,\n    readonly serializer: JsonProtoSerializer\n  ) {\n    this.textDecoder = newTextDecoder();\n    // Read the metadata (which is the first element).\n    this.nextElementImpl().then(\n      element => {\n        if (element && element.isBundleMetadata()) {\n          this.metadata.resolve(element.payload.metadata!);\n        } else {\n          this.metadata.reject(\n            new Error(`The first element of the bundle is not a metadata, it is\n             ${JSON.stringify(element?.payload)}`)\n          );\n        }\n      },\n      error => this.metadata.reject(error)\n    );\n  }\n\n  close(): Promise<void> {\n    return this.reader.cancel();\n  }\n\n  async getMetadata(): Promise<BundleMetadata> {\n    return this.metadata.promise;\n  }\n\n  async nextElement(): Promise<SizedBundleElement | null> {\n    // Makes sure metadata is read before proceeding.\n    await this.getMetadata();\n    return this.nextElementImpl();\n  }\n\n  /**\n   * Reads from the head of internal buffer, and pulling more data from\n   * underlying stream if a complete element cannot be found, until an\n   * element(including the prefixed length and the JSON string) is found.\n   *\n   * Once a complete element is read, it is dropped from internal buffer.\n   *\n   * Returns either the bundled element, or null if we have reached the end of\n   * the stream.\n   */\n  private async nextElementImpl(): Promise<SizedBundleElement | null> {\n    const lengthBuffer = await this.readLength();\n    if (lengthBuffer === null) {\n      return null;\n    }\n\n    const lengthString = this.textDecoder.decode(lengthBuffer);\n    const length = Number(lengthString);\n    if (isNaN(length)) {\n      this.raiseError(`length string (${lengthString}) is not valid number`);\n    }\n\n    const jsonString = await this.readJsonString(length);\n\n    return new SizedBundleElement(\n      JSON.parse(jsonString),\n      lengthBuffer.length + length\n    );\n  }\n\n  /** First index of '{' from the underlying buffer. */\n  private indexOfOpenBracket(): number {\n    return this.buffer.findIndex(v => v === '{'.charCodeAt(0));\n  }\n\n  /**\n   * Reads from the beginning of the internal buffer, until the first '{', and\n   * return the content.\n   *\n   * If reached end of the stream, returns a null.\n   */\n  private async readLength(): Promise<Uint8Array | null> {\n    while (this.indexOfOpenBracket() < 0) {\n      const done = await this.pullMoreDataToBuffer();\n      if (done) {\n        break;\n      }\n    }\n\n    // Broke out of the loop because underlying stream is closed, and there\n    // happens to be no more data to process.\n    if (this.buffer.length === 0) {\n      return null;\n    }\n\n    const position = this.indexOfOpenBracket();\n    // Broke out of the loop because underlying stream is closed, but still\n    // cannot find an open bracket.\n    if (position < 0) {\n      this.raiseError(\n        'Reached the end of bundle when a length string is expected.'\n      );\n    }\n\n    const result = this.buffer.slice(0, position);\n    // Update the internal buffer to drop the read length.\n    this.buffer = this.buffer.slice(position);\n    return result;\n  }\n\n  /**\n   * Reads from a specified position from the internal buffer, for a specified\n   * number of bytes, pulling more data from the underlying stream if needed.\n   *\n   * Returns a string decoded from the read bytes.\n   */\n  private async readJsonString(length: number): Promise<string> {\n    while (this.buffer.length < length) {\n      const done = await this.pullMoreDataToBuffer();\n      if (done) {\n        this.raiseError('Reached the end of bundle when more is expected.');\n      }\n    }\n\n    const result = this.textDecoder.decode(this.buffer.slice(0, length));\n    // Update the internal buffer to drop the read json string.\n    this.buffer = this.buffer.slice(length);\n    return result;\n  }\n\n  private raiseError(message: string): void {\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\n    this.reader.cancel();\n    throw new Error(`Invalid bundle format: ${message}`);\n  }\n\n  /**\n   * Pulls more data from underlying stream to internal buffer.\n   * Returns a boolean indicating whether the stream is finished.\n   */\n  private async pullMoreDataToBuffer(): Promise<boolean> {\n    const result = await this.reader.read();\n    if (!result.done) {\n      debugAssert(!!result.value, 'Read undefined when \"done\" is false.');\n      const newBuffer = new Uint8Array(\n        this.buffer.length + result.value!.length\n      );\n      newBuffer.set(this.buffer);\n      newBuffer.set(result.value!, this.buffer.length);\n      this.buffer = newBuffer;\n    }\n    return result.done;\n  }\n}\n\nexport function newBundleReader(\n  reader: ReadableStreamReader<Uint8Array>,\n  serializer: JsonProtoSerializer\n): BundleReader {\n  return new BundleReaderImpl(reader, serializer);\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ParsedSetData, ParsedUpdateData } from '../lite-api/user_data_reader';\nimport { Document } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport {\n  DeleteMutation,\n  Mutation,\n  Precondition,\n  VerifyMutation\n} from '../model/mutation';\nimport {\n  Datastore,\n  invokeBatchGetDocumentsRpc,\n  invokeCommitRpc\n} from '../remote/datastore';\nimport { fail, debugAssert } from '../util/assert';\nimport { Code, FirestoreError } from '../util/error';\n\nimport { SnapshotVersion } from './snapshot_version';\n\n/**\n * Internal transaction object responsible for accumulating the mutations to\n * perform and the base versions for any documents read.\n */\nexport class Transaction {\n  // The version of each document that was read during this transaction.\n  private readVersions = new Map</* path */ string, SnapshotVersion>();\n  private mutations: Mutation[] = [];\n  private committed = false;\n\n  /**\n   * A deferred usage error that occurred previously in this transaction that\n   * will cause the transaction to fail once it actually commits.\n   */\n  private lastTransactionError: FirestoreError | null = null;\n\n  /**\n   * Set of documents that have been written in the transaction.\n   *\n   * When there's more than one write to the same key in a transaction, any\n   * writes after the first are handled differently.\n   */\n  private writtenDocs: Set</* path= */ string> = new Set();\n\n  constructor(private datastore: Datastore) {}\n\n  async lookup(keys: DocumentKey[]): Promise<Document[]> {\n    this.ensureCommitNotCalled();\n\n    if (this.mutations.length > 0) {\n      this.lastTransactionError = new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        'Firestore transactions require all reads to be executed before all writes.'\n      );\n      throw this.lastTransactionError;\n    }\n    const docs = await invokeBatchGetDocumentsRpc(this.datastore, keys);\n    docs.forEach(doc => this.recordVersion(doc));\n    return docs;\n  }\n\n  set(key: DocumentKey, data: ParsedSetData): void {\n    this.write(data.toMutation(key, this.precondition(key)));\n    this.writtenDocs.add(key.toString());\n  }\n\n  update(key: DocumentKey, data: ParsedUpdateData): void {\n    try {\n      this.write(data.toMutation(key, this.preconditionForUpdate(key)));\n    } catch (e) {\n      this.lastTransactionError = e as FirestoreError | null;\n    }\n    this.writtenDocs.add(key.toString());\n  }\n\n  delete(key: DocumentKey): void {\n    this.write(new DeleteMutation(key, this.precondition(key)));\n    this.writtenDocs.add(key.toString());\n  }\n\n  async commit(): Promise<void> {\n    this.ensureCommitNotCalled();\n\n    if (this.lastTransactionError) {\n      throw this.lastTransactionError;\n    }\n    const unwritten = this.readVersions;\n    // For each mutation, note that the doc was written.\n    this.mutations.forEach(mutation => {\n      unwritten.delete(mutation.key.toString());\n    });\n    // For each document that was read but not written to, we want to perform\n    // a `verify` operation.\n    unwritten.forEach((_, path) => {\n      const key = DocumentKey.fromPath(path);\n      this.mutations.push(new VerifyMutation(key, this.precondition(key)));\n    });\n    await invokeCommitRpc(this.datastore, this.mutations);\n    this.committed = true;\n  }\n\n  private recordVersion(doc: Document): void {\n    let docVersion: SnapshotVersion;\n\n    if (doc.isFoundDocument()) {\n      docVersion = doc.version;\n    } else if (doc.isNoDocument()) {\n      // Represent a deleted doc using SnapshotVersion.min().\n      docVersion = SnapshotVersion.min();\n    } else {\n      throw fail('Document in a transaction was a ' + doc.constructor.name);\n    }\n\n    const existingVersion = this.readVersions.get(doc.key.toString());\n    if (existingVersion) {\n      if (!docVersion.isEqual(existingVersion)) {\n        // This transaction will fail no matter what.\n        throw new FirestoreError(\n          Code.ABORTED,\n          'Document version changed between two reads.'\n        );\n      }\n    } else {\n      this.readVersions.set(doc.key.toString(), docVersion);\n    }\n  }\n\n  /**\n   * Returns the version of this document when it was read in this transaction,\n   * as a precondition, or no precondition if it was not read.\n   */\n  private precondition(key: DocumentKey): Precondition {\n    const version = this.readVersions.get(key.toString());\n    if (!this.writtenDocs.has(key.toString()) && version) {\n      if (version.isEqual(SnapshotVersion.min())) {\n        return Precondition.exists(false);\n      } else {\n        return Precondition.updateTime(version);\n      }\n    } else {\n      return Precondition.none();\n    }\n  }\n\n  /**\n   * Returns the precondition for a document if the operation is an update.\n   */\n  private preconditionForUpdate(key: DocumentKey): Precondition {\n    const version = this.readVersions.get(key.toString());\n    // The first time a document is written, we want to take into account the\n    // read time and existence\n    if (!this.writtenDocs.has(key.toString()) && version) {\n      if (version.isEqual(SnapshotVersion.min())) {\n        // The document doesn't exist, so fail the transaction.\n\n        // This has to be validated locally because you can't send a\n        // precondition that a document does not exist without changing the\n        // semantics of the backend write to be an insert. This is the reverse\n        // of what we want, since we want to assert that the document doesn't\n        // exist but then send the update and have it fail. Since we can't\n        // express that to the backend, we have to validate locally.\n\n        // Note: this can change once we can send separate verify writes in the\n        // transaction.\n        throw new FirestoreError(\n          Code.INVALID_ARGUMENT,\n          \"Can't update a document that doesn't exist.\"\n        );\n      }\n      // Document exists, base precondition on document update time.\n      return Precondition.updateTime(version);\n    } else {\n      // Document was not read, so we just use the preconditions for a blind\n      // update.\n      return Precondition.exists(true);\n    }\n  }\n\n  private write(mutation: Mutation): void {\n    this.ensureCommitNotCalled();\n    this.mutations.push(mutation);\n  }\n\n  private ensureCommitNotCalled(): void {\n    debugAssert(\n      !this.committed,\n      'A transaction object cannot be used after its update callback has been invoked.'\n    );\n  }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ExponentialBackoff } from '../remote/backoff';\nimport { Datastore } from '../remote/datastore';\nimport { isPermanentError } from '../remote/rpc_error';\nimport { AsyncQueue, TimerId } from '../util/async_queue';\nimport { FirestoreError } from '../util/error';\nimport { Deferred } from '../util/promise';\nimport { isNullOrUndefined } from '../util/types';\n\nimport { Transaction } from './transaction';\nimport { TransactionOptions } from './transaction_options';\n\n/**\n * TransactionRunner encapsulates the logic needed to run and retry transactions\n * with backoff.\n */\nexport class TransactionRunner<T> {\n  private attemptsRemaining: number;\n  private backoff: ExponentialBackoff;\n\n  constructor(\n    private readonly asyncQueue: AsyncQueue,\n    private readonly datastore: Datastore,\n    private readonly options: TransactionOptions,\n    private readonly updateFunction: (transaction: Transaction) => Promise<T>,\n    private readonly deferred: Deferred<T>\n  ) {\n    this.attemptsRemaining = options.maxAttempts;\n    this.backoff = new ExponentialBackoff(\n      this.asyncQueue,\n      TimerId.TransactionRetry\n    );\n  }\n\n  /** Runs the transaction and sets the result on deferred. */\n  run(): void {\n    this.attemptsRemaining -= 1;\n    this.runWithBackOff();\n  }\n\n  private runWithBackOff(): void {\n    this.backoff.backoffAndRun(async () => {\n      const transaction = new Transaction(this.datastore);\n      const userPromise = this.tryRunUpdateFunction(transaction);\n      if (userPromise) {\n        userPromise\n          .then(result => {\n            this.asyncQueue.enqueueAndForget(() => {\n              return transaction\n                .commit()\n                .then(() => {\n                  this.deferred.resolve(result);\n                })\n                .catch(commitError => {\n                  this.handleTransactionError(commitError);\n                });\n            });\n          })\n          .catch(userPromiseError => {\n            this.handleTransactionError(userPromiseError);\n          });\n      }\n    });\n  }\n\n  private tryRunUpdateFunction(transaction: Transaction): Promise<T> | null {\n    try {\n      const userPromise = this.updateFunction(transaction);\n      if (\n        isNullOrUndefined(userPromise) ||\n        !userPromise.catch ||\n        !userPromise.then\n      ) {\n        this.deferred.reject(\n          Error('Transaction callback must return a Promise')\n        );\n        return null;\n      }\n      return userPromise;\n    } catch (error) {\n      // Do not retry errors thrown by user provided updateFunction.\n      this.deferred.reject(error as Error);\n      return null;\n    }\n  }\n\n  private handleTransactionError(error: Error): void {\n    if (this.attemptsRemaining > 0 && this.isRetryableTransactionError(error)) {\n      this.attemptsRemaining -= 1;\n      this.asyncQueue.enqueueAndForget(() => {\n        this.runWithBackOff();\n        return Promise.resolve();\n      });\n    } else {\n      this.deferred.reject(error);\n    }\n  }\n\n  private isRetryableTransactionError(error: Error): boolean {\n    if (error.name === 'FirebaseError') {\n      // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and\n      // non-matching document versions with ABORTED. These errors should be retried.\n      const code = (error as FirestoreError).code;\n      return (\n        code === 'aborted' ||\n        code === 'failed-precondition' ||\n        code === 'already-exists' ||\n        !isPermanentError(code)\n      );\n    }\n    return false;\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { GetOptions } from '@firebase/firestore-types';\n\nimport { LoadBundleTask } from '../api/bundle';\nimport {\n  CredentialChangeListener,\n  CredentialsProvider\n} from '../api/credentials';\nimport { User } from '../auth/user';\nimport { LocalStore } from '../local/local_store';\nimport {\n  localStoreConfigureFieldIndexes,\n  localStoreDeleteAllFieldIndexes,\n  localStoreExecuteQuery,\n  localStoreGetNamedQuery,\n  localStoreHandleUserChange,\n  localStoreReadDocument,\n  localStoreSetIndexAutoCreationEnabled\n} from '../local/local_store_impl';\nimport { Persistence } from '../local/persistence';\nimport { Document } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport { FieldIndex } from '../model/field_index';\nimport { Mutation } from '../model/mutation';\nimport { toByteStreamReader } from '../platform/byte_stream_reader';\nimport { newSerializer } from '../platform/serializer';\nimport { newTextEncoder } from '../platform/text_serializer';\nimport { ApiClientObjectMap, Value } from '../protos/firestore_proto_api';\nimport { Datastore, invokeRunAggregationQueryRpc } from '../remote/datastore';\nimport {\n  RemoteStore,\n  remoteStoreDisableNetwork,\n  remoteStoreEnableNetwork,\n  remoteStoreHandleCredentialChange\n} from '../remote/remote_store';\nimport { JsonProtoSerializer } from '../remote/serializer';\nimport { debugAssert } from '../util/assert';\nimport { AsyncObserver } from '../util/async_observer';\nimport { AsyncQueue, wrapInUserErrorIfRecoverable } from '../util/async_queue';\nimport { BundleReader } from '../util/bundle_reader';\nimport { newBundleReader } from '../util/bundle_reader_impl';\nimport { Code, FirestoreError } from '../util/error';\nimport { logDebug, logWarn } from '../util/log';\nimport { AutoId } from '../util/misc';\nimport { Deferred } from '../util/promise';\n\nimport { Aggregate } from './aggregate';\nimport { NamedQuery } from './bundle';\nimport {\n  ComponentConfiguration,\n  MemoryOfflineComponentProvider,\n  OfflineComponentProvider,\n  OnlineComponentProvider\n} from './component_provider';\nimport { DatabaseId, DatabaseInfo } from './database_info';\nimport {\n  addSnapshotsInSyncListener,\n  EventManager,\n  eventManagerListen,\n  eventManagerUnlisten,\n  ListenOptions,\n  Observer,\n  QueryListener,\n  removeSnapshotsInSyncListener\n} from './event_manager';\nimport { newQueryForPath, Query } from './query';\nimport { SyncEngine } from './sync_engine';\nimport {\n  syncEngineListen,\n  syncEngineLoadBundle,\n  syncEngineRegisterPendingWritesCallback,\n  syncEngineUnlisten,\n  syncEngineWrite,\n  triggerRemoteStoreListen,\n  triggerRemoteStoreUnlisten\n} from './sync_engine_impl';\nimport { Transaction } from './transaction';\nimport { TransactionOptions } from './transaction_options';\nimport { TransactionRunner } from './transaction_runner';\nimport { View } from './view';\nimport { ViewSnapshot } from './view_snapshot';\n\nconst LOG_TAG = 'FirestoreClient';\nexport const MAX_CONCURRENT_LIMBO_RESOLUTIONS = 100;\n\n/** DOMException error code constants. */\nconst DOM_EXCEPTION_INVALID_STATE = 11;\nconst DOM_EXCEPTION_ABORTED = 20;\nconst DOM_EXCEPTION_QUOTA_EXCEEDED = 22;\n\n/**\n * FirestoreClient is a top-level class that constructs and owns all of the //\n * pieces of the client SDK architecture. It is responsible for creating the //\n * async queue that is shared by all of the other components in the system. //\n */\nexport class FirestoreClient {\n  private user = User.UNAUTHENTICATED;\n  private readonly clientId = AutoId.newId();\n  private authCredentialListener: CredentialChangeListener<User> = () =>\n    Promise.resolve();\n  private appCheckCredentialListener: (\n    appCheckToken: string,\n    user: User\n  ) => Promise<void> = () => Promise.resolve();\n  _uninitializedComponentsProvider?: {\n    _offline: OfflineComponentProvider;\n    _offlineKind: 'memory' | 'persistent';\n    _online: OnlineComponentProvider;\n  };\n\n  _offlineComponents?: OfflineComponentProvider;\n  _onlineComponents?: OnlineComponentProvider;\n\n  constructor(\n    private authCredentials: CredentialsProvider<User>,\n    private appCheckCredentials: CredentialsProvider<string>,\n    /**\n     * Asynchronous queue responsible for all of our internal processing. When\n     * we get incoming work from the user (via public API) or the network\n     * (incoming GRPC messages), we should always schedule onto this queue.\n     * This ensures all of our work is properly serialized (e.g. we don't\n     * start processing a new operation while the previous one is waiting for\n     * an async I/O to complete).\n     */\n    public asyncQueue: AsyncQueue,\n    private databaseInfo: DatabaseInfo\n  ) {\n    this.authCredentials.start(asyncQueue, async user => {\n      logDebug(LOG_TAG, 'Received user=', user.uid);\n      await this.authCredentialListener(user);\n      this.user = user;\n    });\n    this.appCheckCredentials.start(asyncQueue, newAppCheckToken => {\n      logDebug(LOG_TAG, 'Received new app check token=', newAppCheckToken);\n      return this.appCheckCredentialListener(newAppCheckToken, this.user);\n    });\n  }\n\n  get configuration(): ComponentConfiguration {\n    return {\n      asyncQueue: this.asyncQueue,\n      databaseInfo: this.databaseInfo,\n      clientId: this.clientId,\n      authCredentials: this.authCredentials,\n      appCheckCredentials: this.appCheckCredentials,\n      initialUser: this.user,\n      maxConcurrentLimboResolutions: MAX_CONCURRENT_LIMBO_RESOLUTIONS\n    };\n  }\n\n  setCredentialChangeListener(listener: (user: User) => Promise<void>): void {\n    this.authCredentialListener = listener;\n  }\n\n  setAppCheckTokenChangeListener(\n    listener: (appCheckToken: string, user: User) => Promise<void>\n  ): void {\n    this.appCheckCredentialListener = listener;\n  }\n\n  /**\n   * Checks that the client has not been terminated. Ensures that other methods on //\n   * this class cannot be called after the client is terminated. //\n   */\n  verifyNotTerminated(): void {\n    if (this.asyncQueue.isShuttingDown) {\n      throw new FirestoreError(\n        Code.FAILED_PRECONDITION,\n        'The client has already been terminated.'\n      );\n    }\n  }\n\n  terminate(): Promise<void> {\n    this.asyncQueue.enterRestrictedMode();\n    const deferred = new Deferred();\n    this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async () => {\n      try {\n        if (this._onlineComponents) {\n          await this._onlineComponents.terminate();\n        }\n        if (this._offlineComponents) {\n          await this._offlineComponents.terminate();\n        }\n\n        // The credentials provider must be terminated after shutting down the\n        // RemoteStore as it will prevent the RemoteStore from retrieving auth\n        // tokens.\n        this.authCredentials.shutdown();\n        this.appCheckCredentials.shutdown();\n        deferred.resolve();\n      } catch (e) {\n        const firestoreError = wrapInUserErrorIfRecoverable(\n          e as Error,\n          `Failed to shutdown persistence`\n        );\n        deferred.reject(firestoreError);\n      }\n    });\n    return deferred.promise;\n  }\n}\n\nexport async function setOfflineComponentProvider(\n  client: FirestoreClient,\n  offlineComponentProvider: OfflineComponentProvider\n): Promise<void> {\n  client.asyncQueue.verifyOperationInProgress();\n\n  logDebug(LOG_TAG, 'Initializing OfflineComponentProvider');\n  const configuration = client.configuration;\n  await offlineComponentProvider.initialize(configuration);\n\n  let currentUser = configuration.initialUser;\n  client.setCredentialChangeListener(async user => {\n    if (!currentUser.isEqual(user)) {\n      await localStoreHandleUserChange(\n        offlineComponentProvider.localStore,\n        user\n      );\n      currentUser = user;\n    }\n  });\n\n  // When a user calls clearPersistence() in one client, all other clients\n  // need to be terminated to allow the delete to succeed.\n  offlineComponentProvider.persistence.setDatabaseDeletedListener(() =>\n    client.terminate()\n  );\n\n  client._offlineComponents = offlineComponentProvider;\n}\n\nexport async function setOnlineComponentProvider(\n  client: FirestoreClient,\n  onlineComponentProvider: OnlineComponentProvider\n): Promise<void> {\n  client.asyncQueue.verifyOperationInProgress();\n\n  const offlineComponentProvider = await ensureOfflineComponents(client);\n\n  logDebug(LOG_TAG, 'Initializing OnlineComponentProvider');\n  await onlineComponentProvider.initialize(\n    offlineComponentProvider,\n    client.configuration\n  );\n  // The CredentialChangeListener of the online component provider takes\n  // precedence over the offline component provider.\n  client.setCredentialChangeListener(user =>\n    remoteStoreHandleCredentialChange(onlineComponentProvider.remoteStore, user)\n  );\n  client.setAppCheckTokenChangeListener((_, user) =>\n    remoteStoreHandleCredentialChange(onlineComponentProvider.remoteStore, user)\n  );\n  client._onlineComponents = onlineComponentProvider;\n}\n\n/**\n * Decides whether the provided error allows us to gracefully disable\n * persistence (as opposed to crashing the client).\n */\nexport function canFallbackFromIndexedDbError(\n  error: FirestoreError | DOMException\n): boolean {\n  if (error.name === 'FirebaseError') {\n    return (\n      error.code === Code.FAILED_PRECONDITION ||\n      error.code === Code.UNIMPLEMENTED\n    );\n  } else if (\n    typeof DOMException !== 'undefined' &&\n    error instanceof DOMException\n  ) {\n    // There are a few known circumstances where we can open IndexedDb but\n    // trying to read/write will fail (e.g. quota exceeded). For\n    // well-understood cases, we attempt to detect these and then gracefully\n    // fall back to memory persistence.\n    // NOTE: Rather than continue to add to this list, we could decide to\n    // always fall back, with the risk that we might accidentally hide errors\n    // representing actual SDK bugs.\n    return (\n      // When the browser is out of quota we could get either quota exceeded\n      // or an aborted error depending on whether the error happened during\n      // schema migration.\n      error.code === DOM_EXCEPTION_QUOTA_EXCEEDED ||\n      error.code === DOM_EXCEPTION_ABORTED ||\n      // Firefox Private Browsing mode disables IndexedDb and returns\n      // INVALID_STATE for any usage.\n      error.code === DOM_EXCEPTION_INVALID_STATE\n    );\n  }\n\n  return true;\n}\n\nasync function ensureOfflineComponents(\n  client: FirestoreClient\n): Promise<OfflineComponentProvider> {\n  if (!client._offlineComponents) {\n    if (client._uninitializedComponentsProvider) {\n      logDebug(LOG_TAG, 'Using user provided OfflineComponentProvider');\n      try {\n        await setOfflineComponentProvider(\n          client,\n          client._uninitializedComponentsProvider._offline\n        );\n      } catch (e) {\n        const error = e as FirestoreError | DOMException;\n        if (!canFallbackFromIndexedDbError(error)) {\n          throw error;\n        }\n        logWarn(\n          'Error using user provided cache. Falling back to ' +\n            'memory cache: ' +\n            error\n        );\n        await setOfflineComponentProvider(\n          client,\n          new MemoryOfflineComponentProvider()\n        );\n      }\n    } else {\n      logDebug(LOG_TAG, 'Using default OfflineComponentProvider');\n      await setOfflineComponentProvider(\n        client,\n        new MemoryOfflineComponentProvider()\n      );\n    }\n  }\n\n  return client._offlineComponents!;\n}\n\nasync function ensureOnlineComponents(\n  client: FirestoreClient\n): Promise<OnlineComponentProvider> {\n  if (!client._onlineComponents) {\n    if (client._uninitializedComponentsProvider) {\n      logDebug(LOG_TAG, 'Using user provided OnlineComponentProvider');\n      await setOnlineComponentProvider(\n        client,\n        client._uninitializedComponentsProvider._online\n      );\n    } else {\n      logDebug(LOG_TAG, 'Using default OnlineComponentProvider');\n      await setOnlineComponentProvider(client, new OnlineComponentProvider());\n    }\n  }\n\n  return client._onlineComponents!;\n}\n\nfunction getPersistence(client: FirestoreClient): Promise<Persistence> {\n  return ensureOfflineComponents(client).then(c => c.persistence);\n}\n\nexport function getLocalStore(client: FirestoreClient): Promise<LocalStore> {\n  return ensureOfflineComponents(client).then(c => c.localStore);\n}\n\nfunction getRemoteStore(client: FirestoreClient): Promise<RemoteStore> {\n  return ensureOnlineComponents(client).then(c => c.remoteStore);\n}\n\nexport function getSyncEngine(client: FirestoreClient): Promise<SyncEngine> {\n  return ensureOnlineComponents(client).then(c => c.syncEngine);\n}\n\nfunction getDatastore(client: FirestoreClient): Promise<Datastore> {\n  return ensureOnlineComponents(client).then(c => c.datastore);\n}\n\nexport async function getEventManager(\n  client: FirestoreClient\n): Promise<EventManager> {\n  const onlineComponentProvider = await ensureOnlineComponents(client);\n  const eventManager = onlineComponentProvider.eventManager;\n  eventManager.onListen = syncEngineListen.bind(\n    null,\n    onlineComponentProvider.syncEngine\n  );\n  eventManager.onUnlisten = syncEngineUnlisten.bind(\n    null,\n    onlineComponentProvider.syncEngine\n  );\n  eventManager.onFirstRemoteStoreListen = triggerRemoteStoreListen.bind(\n    null,\n    onlineComponentProvider.syncEngine\n  );\n  eventManager.onLastRemoteStoreUnlisten = triggerRemoteStoreUnlisten.bind(\n    null,\n    onlineComponentProvider.syncEngine\n  );\n  return eventManager;\n}\n\n/** Enables the network connection and re-enqueues all pending operations. */\nexport function firestoreClientEnableNetwork(\n  client: FirestoreClient\n): Promise<void> {\n  return client.asyncQueue.enqueue(async () => {\n    const persistence = await getPersistence(client);\n    const remoteStore = await getRemoteStore(client);\n    persistence.setNetworkEnabled(true);\n    return remoteStoreEnableNetwork(remoteStore);\n  });\n}\n\n/** Disables the network connection. Pending operations will not complete. */\nexport function firestoreClientDisableNetwork(\n  client: FirestoreClient\n): Promise<void> {\n  return client.asyncQueue.enqueue(async () => {\n    const persistence = await getPersistence(client);\n    const remoteStore = await getRemoteStore(client);\n    persistence.setNetworkEnabled(false);\n    return remoteStoreDisableNetwork(remoteStore);\n  });\n}\n\n/**\n * Returns a Promise that resolves when all writes that were pending at the time\n * this method was called received server acknowledgement. An acknowledgement\n * can be either acceptance or rejection.\n */\nexport function firestoreClientWaitForPendingWrites(\n  client: FirestoreClient\n): Promise<void> {\n  const deferred = new Deferred<void>();\n  client.asyncQueue.enqueueAndForget(async () => {\n    const syncEngine = await getSyncEngine(client);\n    return syncEngineRegisterPendingWritesCallback(syncEngine, deferred);\n  });\n  return deferred.promise;\n}\n\nexport function firestoreClientListen(\n  client: FirestoreClient,\n  query: Query,\n  options: ListenOptions,\n  observer: Partial<Observer<ViewSnapshot>>\n): () => void {\n  const wrappedObserver = new AsyncObserver(observer);\n  const listener = new QueryListener(query, wrappedObserver, options);\n  client.asyncQueue.enqueueAndForget(async () => {\n    const eventManager = await getEventManager(client);\n    return eventManagerListen(eventManager, listener);\n  });\n  return () => {\n    wrappedObserver.mute();\n    client.asyncQueue.enqueueAndForget(async () => {\n      const eventManager = await getEventManager(client);\n      return eventManagerUnlisten(eventManager, listener);\n    });\n  };\n}\n\nexport function firestoreClientGetDocumentFromLocalCache(\n  client: FirestoreClient,\n  docKey: DocumentKey\n): Promise<Document | null> {\n  const deferred = new Deferred<Document | null>();\n  client.asyncQueue.enqueueAndForget(async () => {\n    const localStore = await getLocalStore(client);\n    return readDocumentFromCache(localStore, docKey, deferred);\n  });\n  return deferred.promise;\n}\n\nexport function firestoreClientGetDocumentViaSnapshotListener(\n  client: FirestoreClient,\n  key: DocumentKey,\n  options: GetOptions = {}\n): Promise<ViewSnapshot> {\n  const deferred = new Deferred<ViewSnapshot>();\n  client.asyncQueue.enqueueAndForget(async () => {\n    const eventManager = await getEventManager(client);\n    return readDocumentViaSnapshotListener(\n      eventManager,\n      client.asyncQueue,\n      key,\n      options,\n      deferred\n    );\n  });\n  return deferred.promise;\n}\n\nexport function firestoreClientGetDocumentsFromLocalCache(\n  client: FirestoreClient,\n  query: Query\n): Promise<ViewSnapshot> {\n  const deferred = new Deferred<ViewSnapshot>();\n  client.asyncQueue.enqueueAndForget(async () => {\n    const localStore = await getLocalStore(client);\n    return executeQueryFromCache(localStore, query, deferred);\n  });\n  return deferred.promise;\n}\n\nexport function firestoreClientGetDocumentsViaSnapshotListener(\n  client: FirestoreClient,\n  query: Query,\n  options: GetOptions = {}\n): Promise<ViewSnapshot> {\n  const deferred = new Deferred<ViewSnapshot>();\n  client.asyncQueue.enqueueAndForget(async () => {\n    const eventManager = await getEventManager(client);\n    return executeQueryViaSnapshotListener(\n      eventManager,\n      client.asyncQueue,\n      query,\n      options,\n      deferred\n    );\n  });\n  return deferred.promise;\n}\n\nexport function firestoreClientRunAggregateQuery(\n  client: FirestoreClient,\n  query: Query,\n  aggregates: Aggregate[]\n): Promise<ApiClientObjectMap<Value>> {\n  const deferred = new Deferred<ApiClientObjectMap<Value>>();\n\n  client.asyncQueue.enqueueAndForget(async () => {\n    // Implement and call executeAggregateQueryViaSnapshotListener, similar\n    // to the implementation in firestoreClientGetDocumentsViaSnapshotListener\n    // above\n    try {\n      // TODO(b/277628384): check `canUseNetwork()` and handle multi-tab.\n      const datastore = await getDatastore(client);\n      deferred.resolve(\n        invokeRunAggregationQueryRpc(datastore, query, aggregates)\n      );\n    } catch (e) {\n      deferred.reject(e as Error);\n    }\n  });\n  return deferred.promise;\n}\n\nexport function firestoreClientWrite(\n  client: FirestoreClient,\n  mutations: Mutation[]\n): Promise<void> {\n  const deferred = new Deferred<void>();\n  client.asyncQueue.enqueueAndForget(async () => {\n    const syncEngine = await getSyncEngine(client);\n    return syncEngineWrite(syncEngine, mutations, deferred);\n  });\n  return deferred.promise;\n}\n\nexport function firestoreClientAddSnapshotsInSyncListener(\n  client: FirestoreClient,\n  observer: Partial<Observer<void>>\n): () => void {\n  const wrappedObserver = new AsyncObserver(observer);\n  client.asyncQueue.enqueueAndForget(async () => {\n    const eventManager = await getEventManager(client);\n    return addSnapshotsInSyncListener(eventManager, wrappedObserver);\n  });\n  return () => {\n    wrappedObserver.mute();\n    client.asyncQueue.enqueueAndForget(async () => {\n      const eventManager = await getEventManager(client);\n      return removeSnapshotsInSyncListener(eventManager, wrappedObserver);\n    });\n  };\n}\n\n/**\n * Takes an updateFunction in which a set of reads and writes can be performed\n * atomically. In the updateFunction, the client can read and write values\n * using the supplied transaction object. After the updateFunction, all\n * changes will be committed. If a retryable error occurs (ex: some other\n * client has changed any of the data referenced), then the updateFunction\n * will be called again after a backoff. If the updateFunction still fails\n * after all retries, then the transaction will be rejected.\n *\n * The transaction object passed to the updateFunction contains methods for\n * accessing documents and collections. Unlike other datastore access, data\n * accessed with the transaction will not reflect local changes that have not\n * been committed. For this reason, it is required that all reads are\n * performed before any writes. Transactions must be performed while online.\n */\nexport function firestoreClientTransaction<T>(\n  client: FirestoreClient,\n  updateFunction: (transaction: Transaction) => Promise<T>,\n  options: TransactionOptions\n): Promise<T> {\n  const deferred = new Deferred<T>();\n  client.asyncQueue.enqueueAndForget(async () => {\n    const datastore = await getDatastore(client);\n    new TransactionRunner<T>(\n      client.asyncQueue,\n      datastore,\n      options,\n      updateFunction,\n      deferred\n    ).run();\n  });\n  return deferred.promise;\n}\n\nasync function readDocumentFromCache(\n  localStore: LocalStore,\n  docKey: DocumentKey,\n  result: Deferred<Document | null>\n): Promise<void> {\n  try {\n    const document = await localStoreReadDocument(localStore, docKey);\n    if (document.isFoundDocument()) {\n      result.resolve(document);\n    } else if (document.isNoDocument()) {\n      result.resolve(null);\n    } else {\n      result.reject(\n        new FirestoreError(\n          Code.UNAVAILABLE,\n          'Failed to get document from cache. (However, this document may ' +\n            \"exist on the server. Run again without setting 'source' in \" +\n            'the GetOptions to attempt to retrieve the document from the ' +\n            'server.)'\n        )\n      );\n    }\n  } catch (e) {\n    const firestoreError = wrapInUserErrorIfRecoverable(\n      e as Error,\n      `Failed to get document '${docKey} from cache`\n    );\n    result.reject(firestoreError);\n  }\n}\n\n/**\n * Retrieves a latency-compensated document from the backend via a\n * SnapshotListener.\n */\nfunction readDocumentViaSnapshotListener(\n  eventManager: EventManager,\n  asyncQueue: AsyncQueue,\n  key: DocumentKey,\n  options: GetOptions,\n  result: Deferred<ViewSnapshot>\n): Promise<void> {\n  const wrappedObserver = new AsyncObserver({\n    next: (snap: ViewSnapshot) => {\n      // Remove query first before passing event to user to avoid\n      // user actions affecting the now stale query.\n      asyncQueue.enqueueAndForget(() =>\n        eventManagerUnlisten(eventManager, listener)\n      );\n\n      const exists = snap.docs.has(key);\n      if (!exists && snap.fromCache) {\n        // TODO(dimond): If we're online and the document doesn't\n        // exist then we resolve with a doc.exists set to false. If\n        // we're offline however, we reject the Promise in this\n        // case. Two options: 1) Cache the negative response from\n        // the server so we can deliver that even when you're\n        // offline 2) Actually reject the Promise in the online case\n        // if the document doesn't exist.\n        result.reject(\n          new FirestoreError(\n            Code.UNAVAILABLE,\n            'Failed to get document because the client is offline.'\n          )\n        );\n      } else if (\n        exists &&\n        snap.fromCache &&\n        options &&\n        options.source === 'server'\n      ) {\n        result.reject(\n          new FirestoreError(\n            Code.UNAVAILABLE,\n            'Failed to get document from server. (However, this ' +\n              'document does exist in the local cache. Run again ' +\n              'without setting source to \"server\" to ' +\n              'retrieve the cached document.)'\n          )\n        );\n      } else {\n        debugAssert(\n          snap.docs.size <= 1,\n          'Expected zero or a single result on a document-only query'\n        );\n        result.resolve(snap);\n      }\n    },\n    error: e => result.reject(e)\n  });\n\n  const listener = new QueryListener(\n    newQueryForPath(key.path),\n    wrappedObserver,\n    {\n      includeMetadataChanges: true,\n      waitForSyncWhenOnline: true\n    }\n  );\n  return eventManagerListen(eventManager, listener);\n}\n\nasync function executeQueryFromCache(\n  localStore: LocalStore,\n  query: Query,\n  result: Deferred<ViewSnapshot>\n): Promise<void> {\n  try {\n    const queryResult = await localStoreExecuteQuery(\n      localStore,\n      query,\n      /* usePreviousResults= */ true\n    );\n    const view = new View(query, queryResult.remoteKeys);\n    const viewDocChanges = view.computeDocChanges(queryResult.documents);\n    const viewChange = view.applyChanges(\n      viewDocChanges,\n      /* limboResolutionEnabled= */ false\n    );\n    result.resolve(viewChange.snapshot!);\n  } catch (e) {\n    const firestoreError = wrapInUserErrorIfRecoverable(\n      e as Error,\n      `Failed to execute query '${query} against cache`\n    );\n    result.reject(firestoreError);\n  }\n}\n\n/**\n * Retrieves a latency-compensated query snapshot from the backend via a\n * SnapshotListener.\n */\nfunction executeQueryViaSnapshotListener(\n  eventManager: EventManager,\n  asyncQueue: AsyncQueue,\n  query: Query,\n  options: GetOptions,\n  result: Deferred<ViewSnapshot>\n): Promise<void> {\n  const wrappedObserver = new AsyncObserver<ViewSnapshot>({\n    next: snapshot => {\n      // Remove query first before passing event to user to avoid\n      // user actions affecting the now stale query.\n      asyncQueue.enqueueAndForget(() =>\n        eventManagerUnlisten(eventManager, listener)\n      );\n\n      if (snapshot.fromCache && options.source === 'server') {\n        result.reject(\n          new FirestoreError(\n            Code.UNAVAILABLE,\n            'Failed to get documents from server. (However, these ' +\n              'documents may exist in the local cache. Run again ' +\n              'without setting source to \"server\" to ' +\n              'retrieve the cached documents.)'\n          )\n        );\n      } else {\n        result.resolve(snapshot);\n      }\n    },\n    error: e => result.reject(e)\n  });\n\n  const listener = new QueryListener(query, wrappedObserver, {\n    includeMetadataChanges: true,\n    waitForSyncWhenOnline: true\n  });\n  return eventManagerListen(eventManager, listener);\n}\n\nexport function firestoreClientLoadBundle(\n  client: FirestoreClient,\n  databaseId: DatabaseId,\n  data: ReadableStream<Uint8Array> | ArrayBuffer | string,\n  resultTask: LoadBundleTask\n): void {\n  const reader = createBundleReader(data, newSerializer(databaseId));\n  client.asyncQueue.enqueueAndForget(async () => {\n    syncEngineLoadBundle(await getSyncEngine(client), reader, resultTask);\n  });\n}\n\nexport function firestoreClientGetNamedQuery(\n  client: FirestoreClient,\n  queryName: string\n): Promise<NamedQuery | undefined> {\n  return client.asyncQueue.enqueue(async () =>\n    localStoreGetNamedQuery(await getLocalStore(client), queryName)\n  );\n}\n\nfunction createBundleReader(\n  data: ReadableStream<Uint8Array> | ArrayBuffer | string,\n  serializer: JsonProtoSerializer\n): BundleReader {\n  let content: ReadableStream<Uint8Array> | ArrayBuffer;\n  if (typeof data === 'string') {\n    content = newTextEncoder().encode(data);\n  } else {\n    content = data;\n  }\n  return newBundleReader(toByteStreamReader(content), serializer);\n}\n\nexport function firestoreClientSetIndexConfiguration(\n  client: FirestoreClient,\n  indexes: FieldIndex[]\n): Promise<void> {\n  return client.asyncQueue.enqueue(async () => {\n    return localStoreConfigureFieldIndexes(\n      await getLocalStore(client),\n      indexes\n    );\n  });\n}\n\nexport function firestoreClientSetPersistentCacheIndexAutoCreationEnabled(\n  client: FirestoreClient,\n  isEnabled: boolean\n): Promise<void> {\n  return client.asyncQueue.enqueue(async () => {\n    return localStoreSetIndexAutoCreationEnabled(\n      await getLocalStore(client),\n      isEnabled\n    );\n  });\n}\n\nexport function firestoreClientDeleteAllFieldIndexes(\n  client: FirestoreClient\n): Promise<void> {\n  return client.asyncQueue.enqueue(async () => {\n    return localStoreDeleteAllFieldIndexes(await getLocalStore(client));\n  });\n}\n","/**\n * @license\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Options that configure the SDK’s underlying network transport (WebChannel)\n * when long-polling is used.\n *\n * Note: This interface is \"experimental\" and is subject to change.\n *\n * See `FirestoreSettings.experimentalAutoDetectLongPolling`,\n * `FirestoreSettings.experimentalForceLongPolling`, and\n * `FirestoreSettings.experimentalLongPollingOptions`.\n */\nexport interface ExperimentalLongPollingOptions {\n  /**\n   * The desired maximum timeout interval, in seconds, to complete a\n   * long-polling GET response. Valid values are between 5 and 30, inclusive.\n   * Floating point values are allowed and will be rounded to the nearest\n   * millisecond.\n   *\n   * By default, when long-polling is used the \"hanging GET\" request sent by\n   * the client times out after 30 seconds. To request a different timeout\n   * from the server, set this setting with the desired timeout.\n   *\n   * Changing the default timeout may be useful, for example, if the buffering\n   * proxy that necessitated enabling long-polling in the first place has a\n   * shorter timeout for hanging GET requests, in which case setting the\n   * long-polling timeout to a shorter value, such as 25 seconds, may fix\n   * prematurely-closed hanging GET requests.\n   * For example, see https://github.com/firebase/firebase-js-sdk/issues/6987.\n   */\n  timeoutSeconds?: number;\n}\n\n/**\n * Compares two `ExperimentalLongPollingOptions` objects for equality.\n */\nexport function longPollingOptionsEqual(\n  options1: ExperimentalLongPollingOptions,\n  options2: ExperimentalLongPollingOptions\n): boolean {\n  return options1.timeoutSeconds === options2.timeoutSeconds;\n}\n\n/**\n * Creates and returns a new `ExperimentalLongPollingOptions` with the same\n * option values as the given instance.\n */\nexport function cloneLongPollingOptions(\n  options: ExperimentalLongPollingOptions\n): ExperimentalLongPollingOptions {\n  const clone: ExperimentalLongPollingOptions = {};\n\n  if (options.timeoutSeconds !== undefined) {\n    clone.timeoutSeconds = options.timeoutSeconds;\n  }\n\n  return clone;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { _FirebaseService } from '@firebase/app';\n\nimport { CredentialsProvider } from '../api/credentials';\nimport { cloneLongPollingOptions } from '../api/long_polling_options';\nimport { User } from '../auth/user';\nimport { DatabaseId, DatabaseInfo } from '../core/database_info';\nimport { newConnection } from '../platform/connection';\nimport { newSerializer } from '../platform/serializer';\nimport { Datastore, newDatastore } from '../remote/datastore';\nimport { Code, FirestoreError } from '../util/error';\nimport { logDebug } from '../util/log';\n\nimport { FirestoreSettingsImpl } from './settings';\n\nexport const LOG_TAG = 'ComponentProvider';\n\n// The components module manages the lifetime of dependencies of the Firestore\n// client. Dependencies can be lazily constructed and only one exists per\n// Firestore instance.\n\n/**\n * An interface implemented by FirebaseFirestore that provides compatibility\n * with the usage in this file.\n *\n * This interface mainly exists to remove a cyclic dependency.\n */\nexport interface FirestoreService extends _FirebaseService {\n  _authCredentials: CredentialsProvider<User>;\n  _appCheckCredentials: CredentialsProvider<string>;\n  _persistenceKey: string;\n  _databaseId: DatabaseId;\n  _terminated: boolean;\n\n  _freezeSettings(): FirestoreSettingsImpl;\n}\n/**\n * An instance map that ensures only one Datastore exists per Firestore\n * instance.\n */\nconst datastoreInstances = new Map<FirestoreService, Datastore>();\n\n/**\n * Returns an initialized and started Datastore for the given Firestore\n * instance. Callers must invoke removeComponents() when the Firestore\n * instance is terminated.\n */\nexport function getDatastore(firestore: FirestoreService): Datastore {\n  if (firestore._terminated) {\n    throw new FirestoreError(\n      Code.FAILED_PRECONDITION,\n      'The client has already been terminated.'\n    );\n  }\n  if (!datastoreInstances.has(firestore)) {\n    logDebug(LOG_TAG, 'Initializing Datastore');\n    const databaseInfo = makeDatabaseInfo(\n      firestore._databaseId,\n      firestore.app.options.appId || '',\n      firestore._persistenceKey,\n      firestore._freezeSettings()\n    );\n    const connection = newConnection(databaseInfo);\n    const serializer = newSerializer(firestore._databaseId);\n    const datastore = newDatastore(\n      firestore._authCredentials,\n      firestore._appCheckCredentials,\n      connection,\n      serializer\n    );\n\n    datastoreInstances.set(firestore, datastore);\n  }\n  return datastoreInstances.get(firestore)!;\n}\n\n/**\n * Removes all components associated with the provided instance. Must be called\n * when the `Firestore` instance is terminated.\n */\nexport function removeComponents(firestore: FirestoreService): void {\n  const datastore = datastoreInstances.get(firestore);\n  if (datastore) {\n    logDebug(LOG_TAG, 'Removing Datastore');\n    datastoreInstances.delete(firestore);\n    datastore.terminate();\n  }\n}\n\nexport function makeDatabaseInfo(\n  databaseId: DatabaseId,\n  appId: string,\n  persistenceKey: string,\n  settings: FirestoreSettingsImpl\n): DatabaseInfo {\n  return new DatabaseInfo(\n    databaseId,\n    appId,\n    persistenceKey,\n    settings.host,\n    settings.ssl,\n    settings.experimentalForceLongPolling,\n    settings.experimentalAutoDetectLongPolling,\n    cloneLongPollingOptions(settings.experimentalLongPollingOptions),\n    settings.useFetchStreams\n  );\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DocumentKey } from '../model/document_key';\nimport { ResourcePath } from '../model/path';\n\nimport { fail } from './assert';\nimport { Code, FirestoreError } from './error';\n\n/** Types accepted by validateType() and related methods for validation. */\nexport type ValidationType =\n  | 'undefined'\n  | 'object'\n  | 'function'\n  | 'boolean'\n  | 'number'\n  | 'string'\n  | 'non-empty string';\n\nexport function validateNonEmptyArgument(\n  functionName: string,\n  argumentName: string,\n  argument?: string\n): asserts argument is string {\n  if (!argument) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      `Function ${functionName}() cannot be called with an empty ${argumentName}.`\n    );\n  }\n}\n\n/**\n * Validates that two boolean options are not set at the same time.\n * @internal\n */\nexport function validateIsNotUsedTogether(\n  optionName1: string,\n  argument1: boolean | undefined,\n  optionName2: string,\n  argument2: boolean | undefined\n): void {\n  if (argument1 === true && argument2 === true) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      `${optionName1} and ${optionName2} cannot be used together.`\n    );\n  }\n}\n\n/**\n * Validates that `path` refers to a document (indicated by the fact it contains\n * an even numbers of segments).\n */\nexport function validateDocumentPath(path: ResourcePath): void {\n  if (!DocumentKey.isDocumentKey(path)) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      `Invalid document reference. Document references must have an even number of segments, but ${path} has ${path.length}.`\n    );\n  }\n}\n\n/**\n * Validates that `path` refers to a collection (indicated by the fact it\n * contains an odd numbers of segments).\n */\nexport function validateCollectionPath(path: ResourcePath): void {\n  if (DocumentKey.isDocumentKey(path)) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      `Invalid collection reference. Collection references must have an odd number of segments, but ${path} has ${path.length}.`\n    );\n  }\n}\n\n/**\n * Returns true if it's a non-null object without a custom prototype\n * (i.e. excludes Array, Date, etc.).\n */\nexport function isPlainObject(input: unknown): boolean {\n  return (\n    typeof input === 'object' &&\n    input !== null &&\n    (Object.getPrototypeOf(input) === Object.prototype ||\n      Object.getPrototypeOf(input) === null)\n  );\n}\n\n/** Returns a string describing the type / value of the provided input. */\nexport function valueDescription(input: unknown): string {\n  if (input === undefined) {\n    return 'undefined';\n  } else if (input === null) {\n    return 'null';\n  } else if (typeof input === 'string') {\n    if (input.length > 20) {\n      input = `${input.substring(0, 20)}...`;\n    }\n    return JSON.stringify(input);\n  } else if (typeof input === 'number' || typeof input === 'boolean') {\n    return '' + input;\n  } else if (typeof input === 'object') {\n    if (input instanceof Array) {\n      return 'an array';\n    } else {\n      const customObjectName = tryGetCustomObjectType(input!);\n      if (customObjectName) {\n        return `a custom ${customObjectName} object`;\n      } else {\n        return 'an object';\n      }\n    }\n  } else if (typeof input === 'function') {\n    return 'a function';\n  } else {\n    return fail('Unknown wrong type: ' + typeof input);\n  }\n}\n\n/** try to get the constructor name for an object. */\nexport function tryGetCustomObjectType(input: object): string | null {\n  if (input.constructor) {\n    return input.constructor.name;\n  }\n  return null;\n}\n\n/**\n * Casts `obj` to `T`, optionally unwrapping Compat types to expose the\n * underlying instance. Throws if  `obj` is not an instance of `T`.\n *\n * This cast is used in the Lite and Full SDK to verify instance types for\n * arguments passed to the public API.\n * @internal\n */\nexport function cast<T>(\n  obj: object,\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  constructor: { new (...args: any[]): T }\n): T | never {\n  if ('_delegate' in obj) {\n    // Unwrap Compat types\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    obj = (obj as any)._delegate;\n  }\n\n  if (!(obj instanceof constructor)) {\n    if (constructor.name === obj.constructor.name) {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        'Type does not match the expected instance. Did you pass a ' +\n          `reference from a different Firestore SDK?`\n      );\n    } else {\n      const description = valueDescription(obj);\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        `Expected type '${constructor.name}', but it was: ${description}`\n      );\n    }\n  }\n  return obj as T;\n}\n\nexport function validatePositiveNumber(functionName: string, n: number): void {\n  if (n <= 0) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      `Function ${functionName}() requires a positive number, but it was: ${n}.`\n    );\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirestoreLocalCache } from '../api/cache_config';\nimport { CredentialsSettings } from '../api/credentials';\nimport {\n  ExperimentalLongPollingOptions,\n  cloneLongPollingOptions,\n  longPollingOptionsEqual\n} from '../api/long_polling_options';\nimport {\n  LRU_COLLECTION_DISABLED,\n  LRU_DEFAULT_CACHE_SIZE_BYTES\n} from '../local/lru_garbage_collector';\nimport { LRU_MINIMUM_CACHE_SIZE_BYTES } from '../local/lru_garbage_collector_impl';\nimport { Code, FirestoreError } from '../util/error';\nimport { validateIsNotUsedTogether } from '../util/input_validation';\n\n// settings() defaults:\nexport const DEFAULT_HOST = 'firestore.googleapis.com';\nexport const DEFAULT_SSL = true;\n\n// The minimum long-polling timeout is hardcoded on the server. The value here\n// should be kept in sync with the value used by the server, as the server will\n// silently ignore a value below the minimum and fall back to the default.\n// Googlers see b/266868871 for relevant discussion.\nconst MIN_LONG_POLLING_TIMEOUT_SECONDS = 5;\n\n// No maximum long-polling timeout is configured in the server, and defaults to\n// 30 seconds, which is what Watch appears to use.\n// Googlers see b/266868871 for relevant discussion.\nconst MAX_LONG_POLLING_TIMEOUT_SECONDS = 30;\n\n// Whether long-polling auto-detected is enabled by default.\nconst DEFAULT_AUTO_DETECT_LONG_POLLING = true;\n\n/**\n * Specifies custom configurations for your Cloud Firestore instance.\n * You must set these before invoking any other methods.\n */\nexport interface FirestoreSettings {\n  /** The hostname to connect to. */\n  host?: string;\n\n  /** Whether to use SSL when connecting. */\n  ssl?: boolean;\n\n  /**\n   * Whether to skip nested properties that are set to `undefined` during\n   * object serialization. If set to `true`, these properties are skipped\n   * and not written to Firestore. If set to `false` or omitted, the SDK\n   * throws an exception when it encounters properties of type `undefined`.\n   */\n  ignoreUndefinedProperties?: boolean;\n}\n\n/**\n * @internal\n * Undocumented, private additional settings not exposed in our public API.\n */\nexport interface PrivateSettings extends FirestoreSettings {\n  // Can be a google-auth-library or gapi client.\n  credentials?: CredentialsSettings;\n  cacheSizeBytes?: number;\n  experimentalForceLongPolling?: boolean;\n  experimentalAutoDetectLongPolling?: boolean;\n  experimentalLongPollingOptions?: ExperimentalLongPollingOptions;\n  useFetchStreams?: boolean;\n\n  localCache?: FirestoreLocalCache;\n}\n\n/**\n * A concrete type describing all the values that can be applied via a\n * user-supplied `FirestoreSettings` object. This is a separate type so that\n * defaults can be supplied and the value can be checked for equality.\n */\nexport class FirestoreSettingsImpl {\n  /** The hostname to connect to. */\n  readonly host: string;\n\n  /** Whether to use SSL when connecting. */\n  readonly ssl: boolean;\n\n  readonly cacheSizeBytes: number;\n\n  readonly experimentalForceLongPolling: boolean;\n\n  readonly experimentalAutoDetectLongPolling: boolean;\n\n  readonly experimentalLongPollingOptions: ExperimentalLongPollingOptions;\n\n  readonly ignoreUndefinedProperties: boolean;\n\n  readonly useFetchStreams: boolean;\n  readonly localCache?: FirestoreLocalCache;\n\n  // Can be a google-auth-library or gapi client.\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  credentials?: any;\n\n  constructor(settings: PrivateSettings) {\n    if (settings.host === undefined) {\n      if (settings.ssl !== undefined) {\n        throw new FirestoreError(\n          Code.INVALID_ARGUMENT,\n          \"Can't provide ssl option if host option is not set\"\n        );\n      }\n      this.host = DEFAULT_HOST;\n      this.ssl = DEFAULT_SSL;\n    } else {\n      this.host = settings.host;\n      this.ssl = settings.ssl ?? DEFAULT_SSL;\n    }\n\n    this.credentials = settings.credentials;\n    this.ignoreUndefinedProperties = !!settings.ignoreUndefinedProperties;\n    this.localCache = settings.localCache;\n\n    if (settings.cacheSizeBytes === undefined) {\n      this.cacheSizeBytes = LRU_DEFAULT_CACHE_SIZE_BYTES;\n    } else {\n      if (\n        settings.cacheSizeBytes !== LRU_COLLECTION_DISABLED &&\n        settings.cacheSizeBytes < LRU_MINIMUM_CACHE_SIZE_BYTES\n      ) {\n        throw new FirestoreError(\n          Code.INVALID_ARGUMENT,\n          `cacheSizeBytes must be at least ${LRU_MINIMUM_CACHE_SIZE_BYTES}`\n        );\n      } else {\n        this.cacheSizeBytes = settings.cacheSizeBytes;\n      }\n    }\n\n    validateIsNotUsedTogether(\n      'experimentalForceLongPolling',\n      settings.experimentalForceLongPolling,\n      'experimentalAutoDetectLongPolling',\n      settings.experimentalAutoDetectLongPolling\n    );\n\n    this.experimentalForceLongPolling = !!settings.experimentalForceLongPolling;\n\n    if (this.experimentalForceLongPolling) {\n      this.experimentalAutoDetectLongPolling = false;\n    } else if (settings.experimentalAutoDetectLongPolling === undefined) {\n      this.experimentalAutoDetectLongPolling = DEFAULT_AUTO_DETECT_LONG_POLLING;\n    } else {\n      // For backwards compatibility, coerce the value to boolean even though\n      // the TypeScript compiler has narrowed the type to boolean already.\n      // noinspection PointlessBooleanExpressionJS\n      this.experimentalAutoDetectLongPolling =\n        !!settings.experimentalAutoDetectLongPolling;\n    }\n\n    this.experimentalLongPollingOptions = cloneLongPollingOptions(\n      settings.experimentalLongPollingOptions ?? {}\n    );\n    validateLongPollingOptions(this.experimentalLongPollingOptions);\n\n    this.useFetchStreams = !!settings.useFetchStreams;\n  }\n\n  isEqual(other: FirestoreSettingsImpl): boolean {\n    return (\n      this.host === other.host &&\n      this.ssl === other.ssl &&\n      this.credentials === other.credentials &&\n      this.cacheSizeBytes === other.cacheSizeBytes &&\n      this.experimentalForceLongPolling ===\n        other.experimentalForceLongPolling &&\n      this.experimentalAutoDetectLongPolling ===\n        other.experimentalAutoDetectLongPolling &&\n      longPollingOptionsEqual(\n        this.experimentalLongPollingOptions,\n        other.experimentalLongPollingOptions\n      ) &&\n      this.ignoreUndefinedProperties === other.ignoreUndefinedProperties &&\n      this.useFetchStreams === other.useFetchStreams\n    );\n  }\n}\n\nfunction validateLongPollingOptions(\n  options: ExperimentalLongPollingOptions\n): void {\n  if (options.timeoutSeconds !== undefined) {\n    if (isNaN(options.timeoutSeconds)) {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        `invalid long polling timeout: ` +\n          `${options.timeoutSeconds} (must not be NaN)`\n      );\n    }\n    if (options.timeoutSeconds < MIN_LONG_POLLING_TIMEOUT_SECONDS) {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        `invalid long polling timeout: ${options.timeoutSeconds} ` +\n          `(minimum allowed value is ${MIN_LONG_POLLING_TIMEOUT_SECONDS})`\n      );\n    }\n    if (options.timeoutSeconds > MAX_LONG_POLLING_TIMEOUT_SECONDS) {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        `invalid long polling timeout: ${options.timeoutSeconds} ` +\n          `(maximum allowed value is ${MAX_LONG_POLLING_TIMEOUT_SECONDS})`\n      );\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport {\n  _getProvider,\n  _removeServiceInstance,\n  FirebaseApp,\n  getApp\n} from '@firebase/app';\nimport {\n  createMockUserToken,\n  EmulatorMockTokenOptions,\n  getDefaultEmulatorHostnameAndPort\n} from '@firebase/util';\n\nimport {\n  CredentialsProvider,\n  EmulatorAuthCredentialsProvider,\n  makeAuthCredentialsProvider,\n  OAuthToken\n} from '../api/credentials';\nimport { User } from '../auth/user';\nimport { DatabaseId, DEFAULT_DATABASE_NAME } from '../core/database_info';\nimport { Code, FirestoreError } from '../util/error';\nimport { cast } from '../util/input_validation';\nimport { logWarn } from '../util/log';\n\nimport { FirestoreService, removeComponents } from './components';\nimport {\n  DEFAULT_HOST,\n  FirestoreSettingsImpl,\n  PrivateSettings,\n  FirestoreSettings\n} from './settings';\n\nexport { EmulatorMockTokenOptions } from '@firebase/util';\n\ndeclare module '@firebase/component' {\n  interface NameServiceMapping {\n    'firestore/lite': Firestore;\n  }\n}\n\n/**\n * The Cloud Firestore service interface.\n *\n * Do not call this constructor directly. Instead, use {@link (getFirestore:1)}.\n */\nexport class Firestore implements FirestoreService {\n  /**\n   * Whether it's a Firestore or Firestore Lite instance.\n   */\n  type: 'firestore-lite' | 'firestore' = 'firestore-lite';\n\n  readonly _persistenceKey: string = '(lite)';\n\n  private _settings = new FirestoreSettingsImpl({});\n  private _settingsFrozen = false;\n\n  // A task that is assigned when the terminate() is invoked and resolved when\n  // all components have shut down.\n  private _terminateTask?: Promise<void>;\n\n  /** @hideconstructor */\n  constructor(\n    public _authCredentials: CredentialsProvider<User>,\n    public _appCheckCredentials: CredentialsProvider<string>,\n    readonly _databaseId: DatabaseId,\n    readonly _app?: FirebaseApp\n  ) {}\n\n  /**\n   * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service\n   * instance.\n   */\n  get app(): FirebaseApp {\n    if (!this._app) {\n      throw new FirestoreError(\n        Code.FAILED_PRECONDITION,\n        \"Firestore was not initialized using the Firebase SDK. 'app' is \" +\n          'not available'\n      );\n    }\n    return this._app;\n  }\n\n  get _initialized(): boolean {\n    return this._settingsFrozen;\n  }\n\n  get _terminated(): boolean {\n    return this._terminateTask !== undefined;\n  }\n\n  _setSettings(settings: PrivateSettings): void {\n    if (this._settingsFrozen) {\n      throw new FirestoreError(\n        Code.FAILED_PRECONDITION,\n        'Firestore has already been started and its settings can no longer ' +\n          'be changed. You can only modify settings before calling any other ' +\n          'methods on a Firestore object.'\n      );\n    }\n    this._settings = new FirestoreSettingsImpl(settings);\n    if (settings.credentials !== undefined) {\n      this._authCredentials = makeAuthCredentialsProvider(settings.credentials);\n    }\n  }\n\n  _getSettings(): FirestoreSettingsImpl {\n    return this._settings;\n  }\n\n  _freezeSettings(): FirestoreSettingsImpl {\n    this._settingsFrozen = true;\n    return this._settings;\n  }\n\n  _delete(): Promise<void> {\n    if (!this._terminateTask) {\n      this._terminateTask = this._terminate();\n    }\n    return this._terminateTask;\n  }\n\n  /** Returns a JSON-serializable representation of this `Firestore` instance. */\n  toJSON(): object {\n    return {\n      app: this._app,\n      databaseId: this._databaseId,\n      settings: this._settings\n    };\n  }\n\n  /**\n   * Terminates all components used by this client. Subclasses can override\n   * this method to clean up their own dependencies, but must also call this\n   * method.\n   *\n   * Only ever called once.\n   */\n  protected _terminate(): Promise<void> {\n    removeComponents(this);\n    return Promise.resolve();\n  }\n}\n\n/**\n * Initializes a new instance of Cloud Firestore with the provided settings.\n * Can only be called before any other functions, including\n * {@link (getFirestore:1)}. If the custom settings are empty, this function is\n * equivalent to calling {@link (getFirestore:1)}.\n *\n * @param app - The {@link @firebase/app#FirebaseApp} with which the `Firestore` instance will\n * be associated.\n * @param settings - A settings object to configure the `Firestore` instance.\n * @returns A newly initialized `Firestore` instance.\n */\nexport function initializeFirestore(\n  app: FirebaseApp,\n  settings: FirestoreSettings\n): Firestore;\n/**\n * Initializes a new instance of Cloud Firestore with the provided settings.\n * Can only be called before any other functions, including\n * {@link (getFirestore:1)}. If the custom settings are empty, this function is\n * equivalent to calling {@link (getFirestore:1)}.\n *\n * @param app - The {@link @firebase/app#FirebaseApp} with which the `Firestore` instance will\n * be associated.\n * @param settings - A settings object to configure the `Firestore` instance.\n * @param databaseId - The name of the database.\n * @returns A newly initialized `Firestore` instance.\n * @beta\n */\nexport function initializeFirestore(\n  app: FirebaseApp,\n  settings: FirestoreSettings,\n  databaseId?: string\n): Firestore;\nexport function initializeFirestore(\n  app: FirebaseApp,\n  settings: FirestoreSettings,\n  databaseId?: string\n): Firestore {\n  if (!databaseId) {\n    databaseId = DEFAULT_DATABASE_NAME;\n  }\n  const provider = _getProvider(app, 'firestore/lite');\n\n  if (provider.isInitialized(databaseId)) {\n    throw new FirestoreError(\n      Code.FAILED_PRECONDITION,\n      'Firestore can only be initialized once per app.'\n    );\n  }\n\n  return provider.initialize({\n    options: settings,\n    instanceIdentifier: databaseId\n  });\n}\n\n/**\n * Returns the existing default {@link Firestore} instance that is associated with the\n * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\n * instance with default settings.\n *\n * @returns The {@link Firestore} instance of the provided app.\n */\nexport function getFirestore(): Firestore;\n/**\n * Returns the existing default {@link Firestore} instance that is associated with the\n * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\n * instance with default settings.\n *\n * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}\n * instance is associated with.\n * @returns The {@link Firestore} instance of the provided app.\n */\nexport function getFirestore(app: FirebaseApp): Firestore;\n/**\n * Returns the existing {@link Firestore} instance that is associated with the\n * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\n * instance with default settings.\n *\n * @param databaseId - The name of the database.\n * @returns The {@link Firestore} instance of the provided app.\n * @beta\n */\nexport function getFirestore(databaseId: string): Firestore;\n/**\n * Returns the existing {@link Firestore} instance that is associated with the\n * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\n * instance with default settings.\n *\n * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}\n * instance is associated with.\n * @param databaseId - The name of the database.\n * @returns The {@link Firestore} instance of the provided app.\n * @beta\n */\nexport function getFirestore(app: FirebaseApp, databaseId: string): Firestore;\nexport function getFirestore(\n  appOrDatabaseId?: FirebaseApp | string,\n  optionalDatabaseId?: string\n): Firestore {\n  const app: FirebaseApp =\n    typeof appOrDatabaseId === 'object' ? appOrDatabaseId : getApp();\n  const databaseId =\n    typeof appOrDatabaseId === 'string'\n      ? appOrDatabaseId\n      : optionalDatabaseId || '(default)';\n  const db = _getProvider(app, 'firestore/lite').getImmediate({\n    identifier: databaseId\n  }) as Firestore;\n  if (!db._initialized) {\n    const emulator = getDefaultEmulatorHostnameAndPort('firestore');\n    if (emulator) {\n      connectFirestoreEmulator(db, ...emulator);\n    }\n  }\n  return db;\n}\n\n/**\n * Modify this instance to communicate with the Cloud Firestore emulator.\n *\n * Note: This must be called before this instance has been used to do any\n * operations.\n *\n * @param firestore - The `Firestore` instance to configure to connect to the\n * emulator.\n * @param host - the emulator host (ex: localhost).\n * @param port - the emulator port (ex: 9000).\n * @param options.mockUserToken - the mock auth token to use for unit testing\n * Security Rules.\n */\nexport function connectFirestoreEmulator(\n  firestore: Firestore,\n  host: string,\n  port: number,\n  options: {\n    mockUserToken?: EmulatorMockTokenOptions | string;\n  } = {}\n): void {\n  firestore = cast(firestore, Firestore);\n  const settings = firestore._getSettings();\n  const newHostSetting = `${host}:${port}`;\n\n  if (settings.host !== DEFAULT_HOST && settings.host !== newHostSetting) {\n    logWarn(\n      'Host has been set in both settings() and connectFirestoreEmulator(), emulator host ' +\n        'will be used.'\n    );\n  }\n\n  firestore._setSettings({\n    ...settings,\n    host: newHostSetting,\n    ssl: false\n  });\n\n  if (options.mockUserToken) {\n    let token: string;\n    let user: User;\n    if (typeof options.mockUserToken === 'string') {\n      token = options.mockUserToken;\n      user = User.MOCK_USER;\n    } else {\n      // Let createMockUserToken validate first (catches common mistakes like\n      // invalid field \"uid\" and missing field \"sub\" / \"user_id\".)\n      token = createMockUserToken(\n        options.mockUserToken,\n        firestore._app?.options.projectId\n      );\n      const uid = options.mockUserToken.sub || options.mockUserToken.user_id;\n      if (!uid) {\n        throw new FirestoreError(\n          Code.INVALID_ARGUMENT,\n          \"mockUserToken must contain 'sub' or 'user_id' field!\"\n        );\n      }\n      user = new User(uid);\n    }\n\n    firestore._authCredentials = new EmulatorAuthCredentialsProvider(\n      new OAuthToken(token, user)\n    );\n  }\n}\n\n/**\n * Terminates the provided `Firestore` instance.\n *\n * After calling `terminate()` only the `clearIndexedDbPersistence()` functions\n * may be used. Any other function will throw a `FirestoreError`. Termination\n * does not cancel any pending writes, and any promises that are awaiting a\n * response from the server will not be resolved.\n *\n * To restart after termination, create a new instance of `Firestore` with\n * {@link (getFirestore:1)}.\n *\n * Note: Under normal circumstances, calling `terminate()` is not required. This\n * function is useful only when you want to force this instance to release all of\n * its resources or in combination with {@link clearIndexedDbPersistence} to\n * ensure that all local state is destroyed between test runs.\n *\n * @param firestore - The `Firestore` instance to terminate.\n * @returns A `Promise` that is resolved when the instance has been successfully\n * terminated.\n */\nexport function terminate(firestore: Firestore): Promise<void> {\n  firestore = cast(firestore, Firestore);\n  _removeServiceInstance(firestore.app, 'firestore/lite');\n  return firestore._delete();\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getModularInstance } from '@firebase/util';\n\nimport {\n  newQueryForCollectionGroup,\n  newQueryForPath,\n  Query as InternalQuery,\n  queryEquals\n} from '../core/query';\nimport { DocumentKey } from '../model/document_key';\nimport { ResourcePath } from '../model/path';\nimport { Code, FirestoreError } from '../util/error';\nimport {\n  cast,\n  validateCollectionPath,\n  validateDocumentPath,\n  validateNonEmptyArgument\n} from '../util/input_validation';\nimport { AutoId } from '../util/misc';\n\nimport { Firestore } from './database';\nimport { FieldPath } from './field_path';\nimport { FieldValue } from './field_value';\nimport { FirestoreDataConverter } from './snapshot';\nimport { NestedUpdateFields, Primitive } from './types';\n\n/**\n * Document data (for use with {@link @firebase/firestore/lite#(setDoc:1)}) consists of fields mapped to\n * values.\n */\nexport interface DocumentData {\n  /** A mapping between a field and its value. */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  [field: string]: any;\n}\n\n/**\n * Similar to Typescript's `Partial<T>`, but allows nested fields to be\n * omitted and FieldValues to be passed in as property values.\n */\nexport type PartialWithFieldValue<T> =\n  | Partial<T>\n  | (T extends Primitive\n      ? T\n      : T extends {}\n      ? { [K in keyof T]?: PartialWithFieldValue<T[K]> | FieldValue }\n      : never);\n\n/**\n * Allows FieldValues to be passed in as a property value while maintaining\n * type safety.\n */\nexport type WithFieldValue<T> =\n  | T\n  | (T extends Primitive\n      ? T\n      : T extends {}\n      ? { [K in keyof T]: WithFieldValue<T[K]> | FieldValue }\n      : never);\n\n/**\n * Update data (for use with {@link (updateDoc:1)}) that consists of field paths\n * (e.g. 'foo' or 'foo.baz') mapped to values. Fields that contain dots\n * reference nested fields within the document. FieldValues can be passed in\n * as property values.\n */\nexport type UpdateData<T> = T extends Primitive\n  ? T\n  : T extends {}\n  ? { [K in keyof T]?: UpdateData<T[K]> | FieldValue } & NestedUpdateFields<T>\n  : Partial<T>;\n/**\n * An options object that configures the behavior of {@link @firebase/firestore/lite#(setDoc:1)}, {@link\n * @firebase/firestore/lite#(WriteBatch.set:1)} and {@link @firebase/firestore/lite#(Transaction.set:1)} calls. These calls can be\n * configured to perform granular merges instead of overwriting the target\n * documents in their entirety by providing a `SetOptions` with `merge: true`.\n *\n * @param merge - Changes the behavior of a `setDoc()` call to only replace the\n * values specified in its data argument. Fields omitted from the `setDoc()`\n * call remain untouched. If your input sets any field to an empty map, all\n * nested fields are overwritten.\n * @param mergeFields - Changes the behavior of `setDoc()` calls to only replace\n * the specified field paths. Any field path that is not specified is ignored\n * and remains untouched. If your input sets any field to an empty map, all\n * nested fields are overwritten.\n */\nexport type SetOptions =\n  | {\n      readonly merge?: boolean;\n    }\n  | {\n      readonly mergeFields?: Array<string | FieldPath>;\n    };\n\n/**\n * A `Query` refers to a query which you can read or listen to. You can also\n * construct refined `Query` objects by adding filters and ordering.\n */\nexport class Query<\n  AppModelType = DocumentData,\n  DbModelType extends DocumentData = DocumentData\n> {\n  /** The type of this Firestore reference. */\n  readonly type: 'query' | 'collection' = 'query';\n\n  /**\n   * The `Firestore` instance for the Firestore database (useful for performing\n   * transactions, etc.).\n   */\n  readonly firestore: Firestore;\n\n  // This is the lite version of the Query class in the main SDK.\n\n  /** @hideconstructor protected */\n  constructor(\n    firestore: Firestore,\n    /**\n     * If provided, the `FirestoreDataConverter` associated with this instance.\n     */\n    readonly converter: FirestoreDataConverter<\n      AppModelType,\n      DbModelType\n    > | null,\n    readonly _query: InternalQuery\n  ) {\n    this.firestore = firestore;\n  }\n\n  /**\n   * Removes the current converter.\n   *\n   * @param converter - `null` removes the current converter.\n   * @returns A `Query<DocumentData, DocumentData>` that does not use a\n   * converter.\n   */\n  withConverter(converter: null): Query<DocumentData, DocumentData>;\n  /**\n   * Applies a custom data converter to this query, allowing you to use your own\n   * custom model objects with Firestore. When you call {@link getDocs} with\n   * the returned query, the provided converter will convert between Firestore\n   * data of type `NewDbModelType` and your custom type `NewAppModelType`.\n   *\n   * @param converter - Converts objects to and from Firestore.\n   * @returns A `Query` that uses the provided converter.\n   */\n  withConverter<\n    NewAppModelType,\n    NewDbModelType extends DocumentData = DocumentData\n  >(\n    converter: FirestoreDataConverter<NewAppModelType, NewDbModelType>\n  ): Query<NewAppModelType, NewDbModelType>;\n  withConverter<\n    NewAppModelType,\n    NewDbModelType extends DocumentData = DocumentData\n  >(\n    converter: FirestoreDataConverter<NewAppModelType, NewDbModelType> | null\n  ): Query<NewAppModelType, NewDbModelType> {\n    return new Query<NewAppModelType, NewDbModelType>(\n      this.firestore,\n      converter,\n      this._query\n    );\n  }\n}\n\n/**\n * A `DocumentReference` refers to a document location in a Firestore database\n * and can be used to write, read, or listen to the location. The document at\n * the referenced location may or may not exist.\n */\nexport class DocumentReference<\n  AppModelType = DocumentData,\n  DbModelType extends DocumentData = DocumentData\n> {\n  /** The type of this Firestore reference. */\n  readonly type = 'document';\n\n  /**\n   * The {@link Firestore} instance the document is in.\n   * This is useful for performing transactions, for example.\n   */\n  readonly firestore: Firestore;\n\n  /** @hideconstructor */\n  constructor(\n    firestore: Firestore,\n    /**\n     * If provided, the `FirestoreDataConverter` associated with this instance.\n     */\n    readonly converter: FirestoreDataConverter<\n      AppModelType,\n      DbModelType\n    > | null,\n    readonly _key: DocumentKey\n  ) {\n    this.firestore = firestore;\n  }\n\n  get _path(): ResourcePath {\n    return this._key.path;\n  }\n\n  /**\n   * The document's identifier within its collection.\n   */\n  get id(): string {\n    return this._key.path.lastSegment();\n  }\n\n  /**\n   * A string representing the path of the referenced document (relative\n   * to the root of the database).\n   */\n  get path(): string {\n    return this._key.path.canonicalString();\n  }\n\n  /**\n   * The collection this `DocumentReference` belongs to.\n   */\n  get parent(): CollectionReference<AppModelType, DbModelType> {\n    return new CollectionReference<AppModelType, DbModelType>(\n      this.firestore,\n      this.converter,\n      this._key.path.popLast()\n    );\n  }\n\n  /**\n   * Applies a custom data converter to this `DocumentReference`, allowing you\n   * to use your own custom model objects with Firestore. When you call {@link\n   * @firebase/firestore/lite#(setDoc:1)}, {@link @firebase/firestore/lite#getDoc}, etc. with the returned `DocumentReference`\n   * instance, the provided converter will convert between Firestore data of\n   * type `NewDbModelType` and your custom type `NewAppModelType`.\n   *\n   * @param converter - Converts objects to and from Firestore.\n   * @returns A `DocumentReference` that uses the provided converter.\n   */\n  withConverter<\n    NewAppModelType,\n    NewDbModelType extends DocumentData = DocumentData\n  >(\n    converter: FirestoreDataConverter<NewAppModelType, NewDbModelType>\n  ): DocumentReference<NewAppModelType, NewDbModelType>;\n  /**\n   * Removes the current converter.\n   *\n   * @param converter - `null` removes the current converter.\n   * @returns A `DocumentReference<DocumentData, DocumentData>` that does not\n   * use a converter.\n   */\n  withConverter(converter: null): DocumentReference<DocumentData, DocumentData>;\n  withConverter<\n    NewAppModelType,\n    NewDbModelType extends DocumentData = DocumentData\n  >(\n    converter: FirestoreDataConverter<NewAppModelType, NewDbModelType> | null\n  ): DocumentReference<NewAppModelType, NewDbModelType> {\n    return new DocumentReference<NewAppModelType, NewDbModelType>(\n      this.firestore,\n      converter,\n      this._key\n    );\n  }\n}\n\n/**\n * A `CollectionReference` object can be used for adding documents, getting\n * document references, and querying for documents (using {@link (query:1)}).\n */\nexport class CollectionReference<\n  AppModelType = DocumentData,\n  DbModelType extends DocumentData = DocumentData\n> extends Query<AppModelType, DbModelType> {\n  /** The type of this Firestore reference. */\n  readonly type = 'collection';\n\n  /** @hideconstructor */\n  constructor(\n    firestore: Firestore,\n    converter: FirestoreDataConverter<AppModelType, DbModelType> | null,\n    readonly _path: ResourcePath\n  ) {\n    super(firestore, converter, newQueryForPath(_path));\n  }\n\n  /** The collection's identifier. */\n  get id(): string {\n    return this._query.path.lastSegment();\n  }\n\n  /**\n   * A string representing the path of the referenced collection (relative\n   * to the root of the database).\n   */\n  get path(): string {\n    return this._query.path.canonicalString();\n  }\n\n  /**\n   * A reference to the containing `DocumentReference` if this is a\n   * subcollection. If this isn't a subcollection, the reference is null.\n   */\n  get parent(): DocumentReference<DocumentData, DocumentData> | null {\n    const parentPath = this._path.popLast();\n    if (parentPath.isEmpty()) {\n      return null;\n    } else {\n      return new DocumentReference(\n        this.firestore,\n        /* converter= */ null,\n        new DocumentKey(parentPath)\n      );\n    }\n  }\n\n  /**\n   * Applies a custom data converter to this `CollectionReference`, allowing you\n   * to use your own custom model objects with Firestore. When you call {@link\n   * addDoc} with the returned `CollectionReference` instance, the provided\n   * converter will convert between Firestore data of type `NewDbModelType` and\n   * your custom type `NewAppModelType`.\n   *\n   * @param converter - Converts objects to and from Firestore.\n   * @returns A `CollectionReference` that uses the provided converter.\n   */\n  withConverter<\n    NewAppModelType,\n    NewDbModelType extends DocumentData = DocumentData\n  >(\n    converter: FirestoreDataConverter<NewAppModelType, NewDbModelType>\n  ): CollectionReference<NewAppModelType, NewDbModelType>;\n  /**\n   * Removes the current converter.\n   *\n   * @param converter - `null` removes the current converter.\n   * @returns A `CollectionReference<DocumentData, DocumentData>` that does not\n   * use a converter.\n   */\n  withConverter(\n    converter: null\n  ): CollectionReference<DocumentData, DocumentData>;\n  withConverter<\n    NewAppModelType,\n    NewDbModelType extends DocumentData = DocumentData\n  >(\n    converter: FirestoreDataConverter<NewAppModelType, NewDbModelType> | null\n  ): CollectionReference<NewAppModelType, NewDbModelType> {\n    return new CollectionReference<NewAppModelType, NewDbModelType>(\n      this.firestore,\n      converter,\n      this._path\n    );\n  }\n}\n\n/**\n * Gets a `CollectionReference` instance that refers to the collection at\n * the specified absolute path.\n *\n * @param firestore - A reference to the root `Firestore` instance.\n * @param path - A slash-separated path to a collection.\n * @param pathSegments - Additional path segments to apply relative to the first\n * argument.\n * @throws If the final path has an even number of segments and does not point\n * to a collection.\n * @returns The `CollectionReference` instance.\n */\nexport function collection(\n  firestore: Firestore,\n  path: string,\n  ...pathSegments: string[]\n): CollectionReference<DocumentData, DocumentData>;\n/**\n * Gets a `CollectionReference` instance that refers to a subcollection of\n * `reference` at the the specified relative path.\n *\n * @param reference - A reference to a collection.\n * @param path - A slash-separated path to a collection.\n * @param pathSegments - Additional path segments to apply relative to the first\n * argument.\n * @throws If the final path has an even number of segments and does not point\n * to a collection.\n * @returns The `CollectionReference` instance.\n */\nexport function collection<AppModelType, DbModelType extends DocumentData>(\n  reference: CollectionReference<AppModelType, DbModelType>,\n  path: string,\n  ...pathSegments: string[]\n): CollectionReference<DocumentData, DocumentData>;\n/**\n * Gets a `CollectionReference` instance that refers to a subcollection of\n * `reference` at the the specified relative path.\n *\n * @param reference - A reference to a Firestore document.\n * @param path - A slash-separated path to a collection.\n * @param pathSegments - Additional path segments that will be applied relative\n * to the first argument.\n * @throws If the final path has an even number of segments and does not point\n * to a collection.\n * @returns The `CollectionReference` instance.\n */\nexport function collection<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>,\n  path: string,\n  ...pathSegments: string[]\n): CollectionReference<DocumentData, DocumentData>;\nexport function collection<AppModelType, DbModelType extends DocumentData>(\n  parent:\n    | Firestore\n    | DocumentReference<AppModelType, DbModelType>\n    | CollectionReference<AppModelType, DbModelType>,\n  path: string,\n  ...pathSegments: string[]\n): CollectionReference<DocumentData, DocumentData> {\n  parent = getModularInstance(parent);\n\n  validateNonEmptyArgument('collection', 'path', path);\n  if (parent instanceof Firestore) {\n    const absolutePath = ResourcePath.fromString(path, ...pathSegments);\n    validateCollectionPath(absolutePath);\n    return new CollectionReference(parent, /* converter= */ null, absolutePath);\n  } else {\n    if (\n      !(parent instanceof DocumentReference) &&\n      !(parent instanceof CollectionReference)\n    ) {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        'Expected first argument to collection() to be a CollectionReference, ' +\n          'a DocumentReference or FirebaseFirestore'\n      );\n    }\n    const absolutePath = parent._path.child(\n      ResourcePath.fromString(path, ...pathSegments)\n    );\n    validateCollectionPath(absolutePath);\n    return new CollectionReference(\n      parent.firestore,\n      /* converter= */ null,\n      absolutePath\n    );\n  }\n}\n\n// TODO(firestorelite): Consider using ErrorFactory -\n// https://github.com/firebase/firebase-js-sdk/blob/0131e1f/packages/util/src/errors.ts#L106\n\n/**\n * Creates and returns a new `Query` instance that includes all documents in the\n * database that are contained in a collection or subcollection with the\n * given `collectionId`.\n *\n * @param firestore - A reference to the root `Firestore` instance.\n * @param collectionId - Identifies the collections to query over. Every\n * collection or subcollection with this ID as the last segment of its path\n * will be included. Cannot contain a slash.\n * @returns The created `Query`.\n */\nexport function collectionGroup(\n  firestore: Firestore,\n  collectionId: string\n): Query<DocumentData, DocumentData> {\n  firestore = cast(firestore, Firestore);\n\n  validateNonEmptyArgument('collectionGroup', 'collection id', collectionId);\n  if (collectionId.indexOf('/') >= 0) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      `Invalid collection ID '${collectionId}' passed to function ` +\n        `collectionGroup(). Collection IDs must not contain '/'.`\n    );\n  }\n\n  return new Query(\n    firestore,\n    /* converter= */ null,\n    newQueryForCollectionGroup(collectionId)\n  );\n}\n\n/**\n * Gets a `DocumentReference` instance that refers to the document at the\n * specified absolute path.\n *\n * @param firestore - A reference to the root `Firestore` instance.\n * @param path - A slash-separated path to a document.\n * @param pathSegments - Additional path segments that will be applied relative\n * to the first argument.\n * @throws If the final path has an odd number of segments and does not point to\n * a document.\n * @returns The `DocumentReference` instance.\n */\nexport function doc(\n  firestore: Firestore,\n  path: string,\n  ...pathSegments: string[]\n): DocumentReference<DocumentData, DocumentData>;\n/**\n * Gets a `DocumentReference` instance that refers to a document within\n * `reference` at the specified relative path. If no path is specified, an\n * automatically-generated unique ID will be used for the returned\n * `DocumentReference`.\n *\n * @param reference - A reference to a collection.\n * @param path - A slash-separated path to a document. Has to be omitted to use\n * auto-genrated IDs.\n * @param pathSegments - Additional path segments that will be applied relative\n * to the first argument.\n * @throws If the final path has an odd number of segments and does not point to\n * a document.\n * @returns The `DocumentReference` instance.\n */\nexport function doc<AppModelType, DbModelType extends DocumentData>(\n  reference: CollectionReference<AppModelType, DbModelType>,\n  path?: string,\n  ...pathSegments: string[]\n): DocumentReference<AppModelType, DbModelType>;\n/**\n * Gets a `DocumentReference` instance that refers to a document within\n * `reference` at the specified relative path.\n *\n * @param reference - A reference to a Firestore document.\n * @param path - A slash-separated path to a document.\n * @param pathSegments - Additional path segments that will be applied relative\n * to the first argument.\n * @throws If the final path has an odd number of segments and does not point to\n * a document.\n * @returns The `DocumentReference` instance.\n */\nexport function doc<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>,\n  path: string,\n  ...pathSegments: string[]\n): DocumentReference<DocumentData, DocumentData>;\nexport function doc<AppModelType, DbModelType extends DocumentData>(\n  parent:\n    | Firestore\n    | CollectionReference<AppModelType, DbModelType>\n    | DocumentReference<AppModelType, DbModelType>,\n  path?: string,\n  ...pathSegments: string[]\n): DocumentReference<AppModelType, DbModelType> {\n  parent = getModularInstance(parent);\n\n  // We allow omission of 'pathString' but explicitly prohibit passing in both\n  // 'undefined' and 'null'.\n  if (arguments.length === 1) {\n    path = AutoId.newId();\n  }\n  validateNonEmptyArgument('doc', 'path', path);\n\n  if (parent instanceof Firestore) {\n    const absolutePath = ResourcePath.fromString(path, ...pathSegments);\n    validateDocumentPath(absolutePath);\n    return new DocumentReference(\n      parent,\n      /* converter= */ null,\n      new DocumentKey(absolutePath)\n    );\n  } else {\n    if (\n      !(parent instanceof DocumentReference) &&\n      !(parent instanceof CollectionReference)\n    ) {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        'Expected first argument to collection() to be a CollectionReference, ' +\n          'a DocumentReference or FirebaseFirestore'\n      );\n    }\n    const absolutePath = parent._path.child(\n      ResourcePath.fromString(path, ...pathSegments)\n    );\n    validateDocumentPath(absolutePath);\n    return new DocumentReference<AppModelType, DbModelType>(\n      parent.firestore,\n      parent instanceof CollectionReference ? parent.converter : null,\n      new DocumentKey(absolutePath)\n    );\n  }\n}\n\n/**\n * Returns true if the provided references are equal.\n *\n * @param left - A reference to compare.\n * @param right - A reference to compare.\n * @returns true if the references point to the same location in the same\n * Firestore database.\n */\nexport function refEqual<AppModelType, DbModelType extends DocumentData>(\n  left:\n    | DocumentReference<AppModelType, DbModelType>\n    | CollectionReference<AppModelType, DbModelType>,\n  right:\n    | DocumentReference<AppModelType, DbModelType>\n    | CollectionReference<AppModelType, DbModelType>\n): boolean {\n  left = getModularInstance(left);\n  right = getModularInstance(right);\n\n  if (\n    (left instanceof DocumentReference ||\n      left instanceof CollectionReference) &&\n    (right instanceof DocumentReference || right instanceof CollectionReference)\n  ) {\n    return (\n      left.firestore === right.firestore &&\n      left.path === right.path &&\n      left.converter === right.converter\n    );\n  }\n  return false;\n}\n\n/**\n * Returns true if the provided queries point to the same collection and apply\n * the same constraints.\n *\n * @param left - A `Query` to compare.\n * @param right - A `Query` to compare.\n * @returns true if the references point to the same location in the same\n * Firestore database.\n */\nexport function queryEqual<AppModelType, DbModelType extends DocumentData>(\n  left: Query<AppModelType, DbModelType>,\n  right: Query<AppModelType, DbModelType>\n): boolean {\n  left = getModularInstance(left);\n  right = getModularInstance(right);\n\n  if (left instanceof Query && right instanceof Query) {\n    return (\n      left.firestore === right.firestore &&\n      queryEquals(left._query, right._query) &&\n      left.converter === right.converter\n    );\n  }\n  return false;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isIndexedDbTransactionError } from '../local/simple_db';\nimport { getDocument } from '../platform/dom';\nimport { ExponentialBackoff } from '../remote/backoff';\n\nimport { debugAssert, fail } from './assert';\nimport { AsyncQueue, DelayedOperation, TimerId } from './async_queue';\nimport { FirestoreError } from './error';\nimport { logDebug, logError } from './log';\nimport { Deferred } from './promise';\n\nconst LOG_TAG = 'AsyncQueue';\n\nexport class AsyncQueueImpl implements AsyncQueue {\n  // The last promise in the queue.\n  private tail: Promise<unknown> = Promise.resolve();\n\n  // A list of retryable operations. Retryable operations are run in order and\n  // retried with backoff.\n  private retryableOps: Array<() => Promise<void>> = [];\n\n  // Is this AsyncQueue being shut down? Once it is set to true, it will not\n  // be changed again.\n  private _isShuttingDown: boolean = false;\n\n  // Operations scheduled to be queued in the future. Operations are\n  // automatically removed after they are run or canceled.\n  private delayedOperations: Array<DelayedOperation<unknown>> = [];\n\n  // visible for testing\n  failure: FirestoreError | null = null;\n\n  // Flag set while there's an outstanding AsyncQueue operation, used for\n  // assertion sanity-checks.\n  private operationInProgress = false;\n\n  // Enabled during shutdown on Safari to prevent future access to IndexedDB.\n  private skipNonRestrictedTasks = false;\n\n  // List of TimerIds to fast-forward delays for.\n  private timerIdsToSkip: TimerId[] = [];\n\n  // Backoff timer used to schedule retries for retryable operations\n  private backoff = new ExponentialBackoff(this, TimerId.AsyncQueueRetry);\n\n  // Visibility handler that triggers an immediate retry of all retryable\n  // operations. Meant to speed up recovery when we regain file system access\n  // after page comes into foreground.\n  private visibilityHandler: () => void = () => {\n    const document = getDocument();\n    if (document) {\n      logDebug(\n        LOG_TAG,\n        'Visibility state changed to ' + document.visibilityState\n      );\n    }\n    this.backoff.skipBackoff();\n  };\n\n  constructor() {\n    const document = getDocument();\n    if (document && typeof document.addEventListener === 'function') {\n      document.addEventListener('visibilitychange', this.visibilityHandler);\n    }\n  }\n\n  get isShuttingDown(): boolean {\n    return this._isShuttingDown;\n  }\n\n  /**\n   * Adds a new operation to the queue without waiting for it to complete (i.e.\n   * we ignore the Promise result).\n   */\n  enqueueAndForget<T extends unknown>(op: () => Promise<T>): void {\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\n    this.enqueue(op);\n  }\n\n  enqueueAndForgetEvenWhileRestricted<T extends unknown>(\n    op: () => Promise<T>\n  ): void {\n    this.verifyNotFailed();\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\n    this.enqueueInternal(op);\n  }\n\n  enterRestrictedMode(purgeExistingTasks?: boolean): void {\n    if (!this._isShuttingDown) {\n      this._isShuttingDown = true;\n      this.skipNonRestrictedTasks = purgeExistingTasks || false;\n      const document = getDocument();\n      if (document && typeof document.removeEventListener === 'function') {\n        document.removeEventListener(\n          'visibilitychange',\n          this.visibilityHandler\n        );\n      }\n    }\n  }\n\n  enqueue<T extends unknown>(op: () => Promise<T>): Promise<T> {\n    this.verifyNotFailed();\n    if (this._isShuttingDown) {\n      // Return a Promise which never resolves.\n      return new Promise<T>(() => {});\n    }\n\n    // Create a deferred Promise that we can return to the callee. This\n    // allows us to return a \"hanging Promise\" only to the callee and still\n    // advance the queue even when the operation is not run.\n    const task = new Deferred<T>();\n    return this.enqueueInternal<unknown>(() => {\n      if (this._isShuttingDown && this.skipNonRestrictedTasks) {\n        // We do not resolve 'task'\n        return Promise.resolve();\n      }\n\n      op().then(task.resolve, task.reject);\n      return task.promise;\n    }).then(() => task.promise);\n  }\n\n  enqueueRetryable(op: () => Promise<void>): void {\n    this.enqueueAndForget(() => {\n      this.retryableOps.push(op);\n      return this.retryNextOp();\n    });\n  }\n\n  /**\n   * Runs the next operation from the retryable queue. If the operation fails,\n   * reschedules with backoff.\n   */\n  private async retryNextOp(): Promise<void> {\n    if (this.retryableOps.length === 0) {\n      return;\n    }\n\n    try {\n      await this.retryableOps[0]();\n      this.retryableOps.shift();\n      this.backoff.reset();\n    } catch (e) {\n      if (isIndexedDbTransactionError(e as Error)) {\n        logDebug(LOG_TAG, 'Operation failed with retryable error: ' + e);\n      } else {\n        throw e; // Failure will be handled by AsyncQueue\n      }\n    }\n\n    if (this.retryableOps.length > 0) {\n      // If there are additional operations, we re-schedule `retryNextOp()`.\n      // This is necessary to run retryable operations that failed during\n      // their initial attempt since we don't know whether they are already\n      // enqueued. If, for example, `op1`, `op2`, `op3` are enqueued and `op1`\n      // needs to  be re-run, we will run `op1`, `op1`, `op2` using the\n      // already enqueued calls to `retryNextOp()`. `op3()` will then run in the\n      // call scheduled here.\n      // Since `backoffAndRun()` cancels an existing backoff and schedules a\n      // new backoff on every call, there is only ever a single additional\n      // operation in the queue.\n      this.backoff.backoffAndRun(() => this.retryNextOp());\n    }\n  }\n\n  private enqueueInternal<T extends unknown>(op: () => Promise<T>): Promise<T> {\n    const newTail = this.tail.then(() => {\n      this.operationInProgress = true;\n      return op()\n        .catch((error: FirestoreError) => {\n          this.failure = error;\n          this.operationInProgress = false;\n          const message = getMessageOrStack(error);\n          logError('INTERNAL UNHANDLED ERROR: ', message);\n\n          // Re-throw the error so that this.tail becomes a rejected Promise and\n          // all further attempts to chain (via .then) will just short-circuit\n          // and return the rejected Promise.\n          throw error;\n        })\n        .then(result => {\n          this.operationInProgress = false;\n          return result;\n        });\n    });\n    this.tail = newTail;\n    return newTail;\n  }\n\n  enqueueAfterDelay<T extends unknown>(\n    timerId: TimerId,\n    delayMs: number,\n    op: () => Promise<T>\n  ): DelayedOperation<T> {\n    this.verifyNotFailed();\n\n    debugAssert(\n      delayMs >= 0,\n      `Attempted to schedule an operation with a negative delay of ${delayMs}`\n    );\n\n    // Fast-forward delays for timerIds that have been overriden.\n    if (this.timerIdsToSkip.indexOf(timerId) > -1) {\n      delayMs = 0;\n    }\n\n    const delayedOp = DelayedOperation.createAndSchedule<T>(\n      this,\n      timerId,\n      delayMs,\n      op,\n      removedOp =>\n        this.removeDelayedOperation(removedOp as DelayedOperation<unknown>)\n    );\n    this.delayedOperations.push(delayedOp as DelayedOperation<unknown>);\n    return delayedOp;\n  }\n\n  private verifyNotFailed(): void {\n    if (this.failure) {\n      fail('AsyncQueue is already failed: ' + getMessageOrStack(this.failure));\n    }\n  }\n\n  verifyOperationInProgress(): void {\n    debugAssert(\n      this.operationInProgress,\n      'verifyOpInProgress() called when no op in progress on this queue.'\n    );\n  }\n\n  /**\n   * Waits until all currently queued tasks are finished executing. Delayed\n   * operations are not run.\n   */\n  async drain(): Promise<void> {\n    // Operations in the queue prior to draining may have enqueued additional\n    // operations. Keep draining the queue until the tail is no longer advanced,\n    // which indicates that no more new operations were enqueued and that all\n    // operations were executed.\n    let currentTail: Promise<unknown>;\n    do {\n      currentTail = this.tail;\n      await currentTail;\n    } while (currentTail !== this.tail);\n  }\n\n  /**\n   * For Tests: Determine if a delayed operation with a particular TimerId\n   * exists.\n   */\n  containsDelayedOperation(timerId: TimerId): boolean {\n    for (const op of this.delayedOperations) {\n      if (op.timerId === timerId) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  /**\n   * For Tests: Runs some or all delayed operations early.\n   *\n   * @param lastTimerId - Delayed operations up to and including this TimerId\n   * will be drained. Pass TimerId.All to run all delayed operations.\n   * @returns a Promise that resolves once all operations have been run.\n   */\n  runAllDelayedOperationsUntil(lastTimerId: TimerId): Promise<void> {\n    // Note that draining may generate more delayed ops, so we do that first.\n    return this.drain().then(() => {\n      // Run ops in the same order they'd run if they ran naturally.\n      this.delayedOperations.sort((a, b) => a.targetTimeMs - b.targetTimeMs);\n\n      for (const op of this.delayedOperations) {\n        op.skipDelay();\n        if (lastTimerId !== TimerId.All && op.timerId === lastTimerId) {\n          break;\n        }\n      }\n\n      return this.drain();\n    });\n  }\n\n  /**\n   * For Tests: Skip all subsequent delays for a timer id.\n   */\n  skipDelaysForTimerId(timerId: TimerId): void {\n    this.timerIdsToSkip.push(timerId);\n  }\n\n  /** Called once a DelayedOperation is run or canceled. */\n  private removeDelayedOperation(op: DelayedOperation<unknown>): void {\n    // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.\n    const index = this.delayedOperations.indexOf(op);\n    debugAssert(index >= 0, 'Delayed operation not found.');\n    this.delayedOperations.splice(index, 1);\n  }\n}\n\nexport function newAsyncQueue(): AsyncQueue {\n  return new AsyncQueueImpl();\n}\n\n/**\n * Chrome includes Error.message in Error.stack. Other browsers do not.\n * This returns expected output of message + stack when available.\n * @param error - Error or FirestoreError\n */\nfunction getMessageOrStack(error: Error): string {\n  let message = error.message || '';\n  if (error.stack) {\n    if (error.stack.includes(error.message)) {\n      message = error.stack;\n    } else {\n      message = error.message + '\\n' + error.stack;\n    }\n  }\n  return message;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { JsonObject } from '../model/object_value';\nimport { FirestoreError } from '../util/error';\n\n/**\n * Observer/Subscribe interfaces.\n */\nexport type NextFn<T> = (value: T) => void;\nexport type ErrorFn = (error: FirestoreError) => void;\nexport type CompleteFn = () => void;\n\n// Allow for any of the Observer methods to be undefined.\nexport interface PartialObserver<T> {\n  next?: NextFn<T>;\n  error?: ErrorFn;\n  complete?: CompleteFn;\n}\n\nexport function isPartialObserver<T>(obj: unknown): obj is PartialObserver<T> {\n  return implementsAnyMethods(obj, ['next', 'error', 'complete']);\n}\n\n/**\n * Returns true if obj is an object and contains at least one of the specified\n * methods.\n */\nfunction implementsAnyMethods(obj: unknown, methods: string[]): boolean {\n  if (typeof obj !== 'object' || obj === null) {\n    return false;\n  }\n\n  const object = obj as JsonObject<unknown>;\n  for (const method of methods) {\n    if (method in object && typeof object[method] === 'function') {\n      return true;\n    }\n  }\n  return false;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { PartialObserver } from '../api/observer';\nimport { debugAssert } from '../util/assert';\nimport { FirestoreError } from '../util/error';\nimport { Deferred } from '../util/promise';\n\n/**\n * Represents the state of bundle loading tasks.\n *\n * Both 'Error' and 'Success' are sinking state: task will abort or complete and there will\n * be no more updates after they are reported.\n */\nexport type TaskState = 'Error' | 'Running' | 'Success';\n\n/**\n * Represents a progress update or a final state from loading bundles.\n */\nexport interface LoadBundleTaskProgress {\n  /** How many documents have been loaded. */\n  documentsLoaded: number;\n  /** How many documents are in the bundle being loaded. */\n  totalDocuments: number;\n  /** How many bytes have been loaded. */\n  bytesLoaded: number;\n  /** How many bytes are in the bundle being loaded. */\n  totalBytes: number;\n  /** Current task state. */\n  taskState: TaskState;\n}\n\n/**\n * Represents the task of loading a Firestore bundle. It provides progress of bundle\n * loading, as well as task completion and error events.\n *\n * The API is compatible with `Promise<LoadBundleTaskProgress>`.\n */\nexport class LoadBundleTask implements PromiseLike<LoadBundleTaskProgress> {\n  private _progressObserver: PartialObserver<LoadBundleTaskProgress> = {};\n  private _taskCompletionResolver = new Deferred<LoadBundleTaskProgress>();\n\n  private _lastProgress: LoadBundleTaskProgress = {\n    taskState: 'Running',\n    totalBytes: 0,\n    totalDocuments: 0,\n    bytesLoaded: 0,\n    documentsLoaded: 0\n  };\n\n  /**\n   * Registers functions to listen to bundle loading progress events.\n   * @param next - Called when there is a progress update from bundle loading. Typically `next` calls occur\n   *   each time a Firestore document is loaded from the bundle.\n   * @param error - Called when an error occurs during bundle loading. The task aborts after reporting the\n   *   error, and there should be no more updates after this.\n   * @param complete - Called when the loading task is complete.\n   */\n  onProgress(\n    next?: (progress: LoadBundleTaskProgress) => unknown,\n    error?: (err: Error) => unknown,\n    complete?: () => void\n  ): void {\n    this._progressObserver = {\n      next,\n      error,\n      complete\n    };\n  }\n\n  /**\n   * Implements the `Promise<LoadBundleTaskProgress>.catch` interface.\n   *\n   * @param onRejected - Called when an error occurs during bundle loading.\n   */\n  catch<R>(\n    onRejected: (a: Error) => R | PromiseLike<R>\n  ): Promise<R | LoadBundleTaskProgress> {\n    return this._taskCompletionResolver.promise.catch(onRejected);\n  }\n\n  /**\n   * Implements the `Promise<LoadBundleTaskProgress>.then` interface.\n   *\n   * @param onFulfilled - Called on the completion of the loading task with a final `LoadBundleTaskProgress` update.\n   *   The update will always have its `taskState` set to `\"Success\"`.\n   * @param onRejected - Called when an error occurs during bundle loading.\n   */\n  then<T, R>(\n    onFulfilled?: (a: LoadBundleTaskProgress) => T | PromiseLike<T>,\n    onRejected?: (a: Error) => R | PromiseLike<R>\n  ): Promise<T | R> {\n    return this._taskCompletionResolver.promise.then(onFulfilled, onRejected);\n  }\n\n  /**\n   * Notifies all observers that bundle loading has completed, with a provided\n   * `LoadBundleTaskProgress` object.\n   *\n   * @private\n   */\n  _completeWith(progress: LoadBundleTaskProgress): void {\n    debugAssert(\n      progress.taskState === 'Success',\n      'Task is not completed with Success.'\n    );\n    this._updateProgress(progress);\n    if (this._progressObserver.complete) {\n      this._progressObserver.complete();\n    }\n\n    this._taskCompletionResolver.resolve(progress);\n  }\n\n  /**\n   * Notifies all observers that bundle loading has failed, with a provided\n   * `Error` as the reason.\n   *\n   * @private\n   */\n  _failWith(error: FirestoreError): void {\n    this._lastProgress.taskState = 'Error';\n\n    if (this._progressObserver.next) {\n      this._progressObserver.next(this._lastProgress);\n    }\n\n    if (this._progressObserver.error) {\n      this._progressObserver.error(error);\n    }\n\n    this._taskCompletionResolver.reject(error);\n  }\n\n  /**\n   * Notifies a progress update of loading a bundle.\n   * @param progress - The new progress.\n   *\n   * @private\n   */\n  _updateProgress(progress: LoadBundleTaskProgress): void {\n    debugAssert(\n      this._lastProgress.taskState === 'Running',\n      'Cannot update progress on a completed or failed task'\n    );\n\n    this._lastProgress = progress;\n    if (this._progressObserver.next) {\n      this._progressObserver.next(progress);\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  _getProvider,\n  _removeServiceInstance,\n  FirebaseApp,\n  getApp\n} from '@firebase/app';\nimport { deepEqual, getDefaultEmulatorHostnameAndPort } from '@firebase/util';\n\nimport { User } from '../auth/user';\nimport {\n  IndexedDbOfflineComponentProvider,\n  MultiTabOfflineComponentProvider,\n  OfflineComponentProvider,\n  OnlineComponentProvider\n} from '../core/component_provider';\nimport { DatabaseId, DEFAULT_DATABASE_NAME } from '../core/database_info';\nimport {\n  canFallbackFromIndexedDbError,\n  FirestoreClient,\n  firestoreClientDisableNetwork,\n  firestoreClientEnableNetwork,\n  firestoreClientGetNamedQuery,\n  firestoreClientLoadBundle,\n  firestoreClientWaitForPendingWrites,\n  setOfflineComponentProvider,\n  setOnlineComponentProvider\n} from '../core/firestore_client';\nimport { makeDatabaseInfo } from '../lite-api/components';\nimport {\n  Firestore as LiteFirestore,\n  connectFirestoreEmulator\n} from '../lite-api/database';\nimport { Query } from '../lite-api/reference';\nimport {\n  indexedDbClearPersistence,\n  indexedDbStoragePrefix\n} from '../local/indexeddb_persistence';\nimport { LRU_COLLECTION_DISABLED } from '../local/lru_garbage_collector';\nimport { LRU_MINIMUM_CACHE_SIZE_BYTES } from '../local/lru_garbage_collector_impl';\nimport { debugAssert } from '../util/assert';\nimport { AsyncQueue } from '../util/async_queue';\nimport { newAsyncQueue } from '../util/async_queue_impl';\nimport { Code, FirestoreError } from '../util/error';\nimport { cast } from '../util/input_validation';\nimport { logWarn } from '../util/log';\nimport { Deferred } from '../util/promise';\n\nimport { LoadBundleTask } from './bundle';\nimport { CredentialsProvider } from './credentials';\nimport { PersistenceSettings, FirestoreSettings } from './settings';\nexport {\n  connectFirestoreEmulator,\n  EmulatorMockTokenOptions\n} from '../lite-api/database';\n\ndeclare module '@firebase/component' {\n  interface NameServiceMapping {\n    'firestore': Firestore;\n  }\n}\n\n/**\n * Constant used to indicate the LRU garbage collection should be disabled.\n * Set this value as the `cacheSizeBytes` on the settings passed to the\n * {@link Firestore} instance.\n */\nexport const CACHE_SIZE_UNLIMITED = LRU_COLLECTION_DISABLED;\n\n/**\n * The Cloud Firestore service interface.\n *\n * Do not call this constructor directly. Instead, use {@link (getFirestore:1)}.\n */\nexport class Firestore extends LiteFirestore {\n  /**\n   * Whether it's a {@link Firestore} or Firestore Lite instance.\n   */\n  type: 'firestore-lite' | 'firestore' = 'firestore';\n\n  readonly _queue: AsyncQueue = newAsyncQueue();\n  readonly _persistenceKey: string;\n\n  _firestoreClient: FirestoreClient | undefined;\n\n  /** @hideconstructor */\n  constructor(\n    authCredentialsProvider: CredentialsProvider<User>,\n    appCheckCredentialsProvider: CredentialsProvider<string>,\n    databaseId: DatabaseId,\n    app?: FirebaseApp\n  ) {\n    super(\n      authCredentialsProvider,\n      appCheckCredentialsProvider,\n      databaseId,\n      app\n    );\n    this._persistenceKey = app?.name || '[DEFAULT]';\n  }\n\n  _terminate(): Promise<void> {\n    if (!this._firestoreClient) {\n      // The client must be initialized to ensure that all subsequent API\n      // usage throws an exception.\n      configureFirestore(this);\n    }\n    return this._firestoreClient!.terminate();\n  }\n}\n\n/**\n * Initializes a new instance of {@link Firestore} with the provided settings.\n * Can only be called before any other function, including\n * {@link (getFirestore:1)}. If the custom settings are empty, this function is\n * equivalent to calling {@link (getFirestore:1)}.\n *\n * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will\n * be associated.\n * @param settings - A settings object to configure the {@link Firestore} instance.\n * @param databaseId - The name of the database.\n * @returns A newly initialized {@link Firestore} instance.\n */\nexport function initializeFirestore(\n  app: FirebaseApp,\n  settings: FirestoreSettings,\n  databaseId?: string\n): Firestore {\n  if (!databaseId) {\n    databaseId = DEFAULT_DATABASE_NAME;\n  }\n  const provider = _getProvider(app, 'firestore');\n\n  if (provider.isInitialized(databaseId)) {\n    const existingInstance = provider.getImmediate({\n      identifier: databaseId\n    });\n    const initialSettings = provider.getOptions(\n      databaseId\n    ) as FirestoreSettings;\n    if (deepEqual(initialSettings, settings)) {\n      return existingInstance;\n    } else {\n      throw new FirestoreError(\n        Code.FAILED_PRECONDITION,\n        'initializeFirestore() has already been called with ' +\n          'different options. To avoid this error, call initializeFirestore() with the ' +\n          'same options as when it was originally called, or call getFirestore() to return the' +\n          ' already initialized instance.'\n      );\n    }\n  }\n\n  if (\n    settings.cacheSizeBytes !== undefined &&\n    settings.localCache !== undefined\n  ) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      `cache and cacheSizeBytes cannot be specified at the same time as cacheSizeBytes will` +\n        `be deprecated. Instead, specify the cache size in the cache object`\n    );\n  }\n\n  if (\n    settings.cacheSizeBytes !== undefined &&\n    settings.cacheSizeBytes !== CACHE_SIZE_UNLIMITED &&\n    settings.cacheSizeBytes < LRU_MINIMUM_CACHE_SIZE_BYTES\n  ) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      `cacheSizeBytes must be at least ${LRU_MINIMUM_CACHE_SIZE_BYTES}`\n    );\n  }\n\n  return provider.initialize({\n    options: settings,\n    instanceIdentifier: databaseId\n  });\n}\n\n/**\n * Returns the existing default {@link Firestore} instance that is associated with the\n * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\n * instance with default settings.\n *\n * @returns The default {@link Firestore} instance of the default app.\n */\nexport function getFirestore(): Firestore;\n/**\n * Returns the existing default {@link Firestore} instance that is associated with the\n * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\n * instance with default settings.\n *\n * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}\n * instance is associated with.\n * @returns The default {@link Firestore} instance of the provided app.\n */\nexport function getFirestore(app: FirebaseApp): Firestore;\n/**\n * Returns the existing named {@link Firestore} instance that is associated with the\n * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\n * instance with default settings.\n *\n * @param databaseId - The name of the database.\n * @returns The named {@link Firestore} instance of the default app.\n * @beta\n */\nexport function getFirestore(databaseId: string): Firestore;\n/**\n * Returns the existing named {@link Firestore} instance that is associated with the\n * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new\n * instance with default settings.\n *\n * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}\n * instance is associated with.\n * @param databaseId - The name of the database.\n * @returns The named {@link Firestore} instance of the provided app.\n * @beta\n */\nexport function getFirestore(app: FirebaseApp, databaseId: string): Firestore;\nexport function getFirestore(\n  appOrDatabaseId?: FirebaseApp | string,\n  optionalDatabaseId?: string\n): Firestore {\n  const app: FirebaseApp =\n    typeof appOrDatabaseId === 'object' ? appOrDatabaseId : getApp();\n  const databaseId =\n    typeof appOrDatabaseId === 'string'\n      ? appOrDatabaseId\n      : optionalDatabaseId || DEFAULT_DATABASE_NAME;\n  const db = _getProvider(app, 'firestore').getImmediate({\n    identifier: databaseId\n  }) as Firestore;\n  if (!db._initialized) {\n    const emulator = getDefaultEmulatorHostnameAndPort('firestore');\n    if (emulator) {\n      connectFirestoreEmulator(db, ...emulator);\n    }\n  }\n  return db;\n}\n\n/**\n * @internal\n */\nexport function ensureFirestoreConfigured(\n  firestore: Firestore\n): FirestoreClient {\n  if (!firestore._firestoreClient) {\n    configureFirestore(firestore);\n  }\n  firestore._firestoreClient!.verifyNotTerminated();\n  return firestore._firestoreClient as FirestoreClient;\n}\n\nexport function configureFirestore(firestore: Firestore): void {\n  const settings = firestore._freezeSettings();\n  debugAssert(!!settings.host, 'FirestoreSettings.host is not set');\n  debugAssert(\n    !firestore._firestoreClient,\n    'configureFirestore() called multiple times'\n  );\n\n  const databaseInfo = makeDatabaseInfo(\n    firestore._databaseId,\n    firestore._app?.options.appId || '',\n    firestore._persistenceKey,\n    settings\n  );\n  firestore._firestoreClient = new FirestoreClient(\n    firestore._authCredentials,\n    firestore._appCheckCredentials,\n    firestore._queue,\n    databaseInfo\n  );\n  if (\n    settings.localCache?._offlineComponentProvider &&\n    settings.localCache?._onlineComponentProvider\n  ) {\n    firestore._firestoreClient._uninitializedComponentsProvider = {\n      _offlineKind: settings.localCache.kind,\n      _offline: settings.localCache._offlineComponentProvider,\n      _online: settings.localCache._onlineComponentProvider\n    };\n  }\n}\n\n/**\n * Attempts to enable persistent storage, if possible.\n *\n * On failure, `enableIndexedDbPersistence()` will reject the promise or\n * throw an exception. There are several reasons why this can fail, which can be\n * identified by the `code` on the error.\n *\n *   * failed-precondition: The app is already open in another browser tab.\n *   * unimplemented: The browser is incompatible with the offline persistence\n *     implementation.\n *\n * Note that even after a failure, the {@link Firestore} instance will remain\n * usable, however offline persistence will be disabled.\n *\n * Note: `enableIndexedDbPersistence()` must be called before any other functions\n * (other than {@link initializeFirestore}, {@link (getFirestore:1)} or\n * {@link clearIndexedDbPersistence}.\n *\n * Persistence cannot be used in a Node.js environment.\n *\n * @param firestore - The {@link Firestore} instance to enable persistence for.\n * @param persistenceSettings - Optional settings object to configure\n * persistence.\n * @returns A `Promise` that represents successfully enabling persistent storage.\n * @deprecated This function will be removed in a future major release. Instead, set\n * `FirestoreSettings.localCache` to an instance of `PersistentLocalCache` to\n * turn on IndexedDb cache. Calling this function when `FirestoreSettings.localCache`\n * is already specified will throw an exception.\n */\nexport function enableIndexedDbPersistence(\n  firestore: Firestore,\n  persistenceSettings?: PersistenceSettings\n): Promise<void> {\n  firestore = cast(firestore, Firestore);\n  verifyNotInitialized(firestore);\n\n  const client = ensureFirestoreConfigured(firestore);\n  if (client._uninitializedComponentsProvider) {\n    throw new FirestoreError(\n      Code.FAILED_PRECONDITION,\n      'SDK cache is already specified.'\n    );\n  }\n\n  logWarn(\n    'enableIndexedDbPersistence() will be deprecated in the future, ' +\n      'you can use `FirestoreSettings.cache` instead.'\n  );\n  const settings = firestore._freezeSettings();\n\n  const onlineComponentProvider = new OnlineComponentProvider();\n  const offlineComponentProvider = new IndexedDbOfflineComponentProvider(\n    onlineComponentProvider,\n    settings.cacheSizeBytes,\n    persistenceSettings?.forceOwnership\n  );\n  return setPersistenceProviders(\n    client,\n    onlineComponentProvider,\n    offlineComponentProvider\n  );\n}\n\n/**\n * Attempts to enable multi-tab persistent storage, if possible. If enabled\n * across all tabs, all operations share access to local persistence, including\n * shared execution of queries and latency-compensated local document updates\n * across all connected instances.\n *\n * On failure, `enableMultiTabIndexedDbPersistence()` will reject the promise or\n * throw an exception. There are several reasons why this can fail, which can be\n * identified by the `code` on the error.\n *\n *   * failed-precondition: The app is already open in another browser tab and\n *     multi-tab is not enabled.\n *   * unimplemented: The browser is incompatible with the offline persistence\n *     implementation.\n *\n * Note that even after a failure, the {@link Firestore} instance will remain\n * usable, however offline persistence will be disabled.\n *\n * @param firestore - The {@link Firestore} instance to enable persistence for.\n * @returns A `Promise` that represents successfully enabling persistent\n * storage.\n * @deprecated This function will be removed in a future major release. Instead, set\n * `FirestoreSettings.localCache` to an instance of `PersistentLocalCache` to\n * turn on indexeddb cache. Calling this function when `FirestoreSettings.localCache`\n * is already specified will throw an exception.\n */\nexport function enableMultiTabIndexedDbPersistence(\n  firestore: Firestore\n): Promise<void> {\n  firestore = cast(firestore, Firestore);\n  verifyNotInitialized(firestore);\n\n  const client = ensureFirestoreConfigured(firestore);\n  if (client._uninitializedComponentsProvider) {\n    throw new FirestoreError(\n      Code.FAILED_PRECONDITION,\n      'SDK cache is already specified.'\n    );\n  }\n\n  logWarn(\n    'enableMultiTabIndexedDbPersistence() will be deprecated in the future, ' +\n      'you can use `FirestoreSettings.cache` instead.'\n  );\n  const settings = firestore._freezeSettings();\n\n  const onlineComponentProvider = new OnlineComponentProvider();\n  const offlineComponentProvider = new MultiTabOfflineComponentProvider(\n    onlineComponentProvider,\n    settings.cacheSizeBytes\n  );\n  return setPersistenceProviders(\n    client,\n    onlineComponentProvider,\n    offlineComponentProvider\n  );\n}\n\n/**\n * Registers both the `OfflineComponentProvider` and `OnlineComponentProvider`.\n * If the operation fails with a recoverable error (see\n * `canRecoverFromIndexedDbError()` below), the returned Promise is rejected\n * but the client remains usable.\n */\nfunction setPersistenceProviders(\n  client: FirestoreClient,\n  onlineComponentProvider: OnlineComponentProvider,\n  offlineComponentProvider: OfflineComponentProvider\n): Promise<void> {\n  const persistenceResult = new Deferred();\n  return client.asyncQueue\n    .enqueue(async () => {\n      try {\n        await setOfflineComponentProvider(client, offlineComponentProvider);\n        await setOnlineComponentProvider(client, onlineComponentProvider);\n        persistenceResult.resolve();\n      } catch (e) {\n        const error = e as FirestoreError | DOMException;\n        if (!canFallbackFromIndexedDbError(error)) {\n          throw error;\n        }\n        logWarn(\n          'Error enabling indexeddb cache. Falling back to ' +\n            'memory cache: ' +\n            error\n        );\n        persistenceResult.reject(error);\n      }\n    })\n    .then(() => persistenceResult.promise);\n}\n\n/**\n * Clears the persistent storage. This includes pending writes and cached\n * documents.\n *\n * Must be called while the {@link Firestore} instance is not started (after the app is\n * terminated or when the app is first initialized). On startup, this function\n * must be called before other functions (other than {@link\n * initializeFirestore} or {@link (getFirestore:1)})). If the {@link Firestore}\n * instance is still running, the promise will be rejected with the error code\n * of `failed-precondition`.\n *\n * Note: `clearIndexedDbPersistence()` is primarily intended to help write\n * reliable tests that use Cloud Firestore. It uses an efficient mechanism for\n * dropping existing data but does not attempt to securely overwrite or\n * otherwise make cached data unrecoverable. For applications that are sensitive\n * to the disclosure of cached data in between user sessions, we strongly\n * recommend not enabling persistence at all.\n *\n * @param firestore - The {@link Firestore} instance to clear persistence for.\n * @returns A `Promise` that is resolved when the persistent storage is\n * cleared. Otherwise, the promise is rejected with an error.\n */\nexport function clearIndexedDbPersistence(firestore: Firestore): Promise<void> {\n  if (firestore._initialized && !firestore._terminated) {\n    throw new FirestoreError(\n      Code.FAILED_PRECONDITION,\n      'Persistence can only be cleared before a Firestore instance is ' +\n        'initialized or after it is terminated.'\n    );\n  }\n\n  const deferred = new Deferred<void>();\n  firestore._queue.enqueueAndForgetEvenWhileRestricted(async () => {\n    try {\n      await indexedDbClearPersistence(\n        indexedDbStoragePrefix(firestore._databaseId, firestore._persistenceKey)\n      );\n      deferred.resolve();\n    } catch (e) {\n      deferred.reject(e as Error | undefined);\n    }\n  });\n  return deferred.promise;\n}\n\n/**\n * Waits until all currently pending writes for the active user have been\n * acknowledged by the backend.\n *\n * The returned promise resolves immediately if there are no outstanding writes.\n * Otherwise, the promise waits for all previously issued writes (including\n * those written in a previous app session), but it does not wait for writes\n * that were added after the function is called. If you want to wait for\n * additional writes, call `waitForPendingWrites()` again.\n *\n * Any outstanding `waitForPendingWrites()` promises are rejected during user\n * changes.\n *\n * @returns A `Promise` which resolves when all currently pending writes have been\n * acknowledged by the backend.\n */\nexport function waitForPendingWrites(firestore: Firestore): Promise<void> {\n  firestore = cast(firestore, Firestore);\n  const client = ensureFirestoreConfigured(firestore);\n  return firestoreClientWaitForPendingWrites(client);\n}\n\n/**\n * Re-enables use of the network for this {@link Firestore} instance after a prior\n * call to {@link disableNetwork}.\n *\n * @returns A `Promise` that is resolved once the network has been enabled.\n */\nexport function enableNetwork(firestore: Firestore): Promise<void> {\n  firestore = cast(firestore, Firestore);\n  const client = ensureFirestoreConfigured(firestore);\n  return firestoreClientEnableNetwork(client);\n}\n\n/**\n * Disables network usage for this instance. It can be re-enabled via {@link\n * enableNetwork}. While the network is disabled, any snapshot listeners,\n * `getDoc()` or `getDocs()` calls will return results from cache, and any write\n * operations will be queued until the network is restored.\n *\n * @returns A `Promise` that is resolved once the network has been disabled.\n */\nexport function disableNetwork(firestore: Firestore): Promise<void> {\n  firestore = cast(firestore, Firestore);\n  const client = ensureFirestoreConfigured(firestore);\n  return firestoreClientDisableNetwork(client);\n}\n\n/**\n * Terminates the provided {@link Firestore} instance.\n *\n * After calling `terminate()` only the `clearIndexedDbPersistence()` function\n * may be used. Any other function will throw a `FirestoreError`.\n *\n * To restart after termination, create a new instance of FirebaseFirestore with\n * {@link (getFirestore:1)}.\n *\n * Termination does not cancel any pending writes, and any promises that are\n * awaiting a response from the server will not be resolved. If you have\n * persistence enabled, the next time you start this instance, it will resume\n * sending these writes to the server.\n *\n * Note: Under normal circumstances, calling `terminate()` is not required. This\n * function is useful only when you want to force this instance to release all\n * of its resources or in combination with `clearIndexedDbPersistence()` to\n * ensure that all local state is destroyed between test runs.\n *\n * @returns A `Promise` that is resolved when the instance has been successfully\n * terminated.\n */\nexport function terminate(firestore: Firestore): Promise<void> {\n  _removeServiceInstance(\n    firestore.app,\n    'firestore',\n    firestore._databaseId.database\n  );\n  return firestore._delete();\n}\n\n/**\n * Loads a Firestore bundle into the local cache.\n *\n * @param firestore - The {@link Firestore} instance to load bundles for.\n * @param bundleData - An object representing the bundle to be loaded. Valid\n * objects are `ArrayBuffer`, `ReadableStream<Uint8Array>` or `string`.\n *\n * @returns A `LoadBundleTask` object, which notifies callers with progress\n * updates, and completion or error events. It can be used as a\n * `Promise<LoadBundleTaskProgress>`.\n */\nexport function loadBundle(\n  firestore: Firestore,\n  bundleData: ReadableStream<Uint8Array> | ArrayBuffer | string\n): LoadBundleTask {\n  firestore = cast(firestore, Firestore);\n  const client = ensureFirestoreConfigured(firestore);\n  const resultTask = new LoadBundleTask();\n  firestoreClientLoadBundle(\n    client,\n    firestore._databaseId,\n    bundleData,\n    resultTask\n  );\n  return resultTask;\n}\n\n/**\n * Reads a Firestore {@link Query} from local cache, identified by the given\n * name.\n *\n * The named queries are packaged  into bundles on the server side (along\n * with resulting documents), and loaded to local cache using `loadBundle`. Once\n * in local cache, use this method to extract a {@link Query} by name.\n *\n * @param firestore - The {@link Firestore} instance to read the query from.\n * @param name - The name of the query.\n * @returns A `Promise` that is resolved with the Query or `null`.\n */\nexport function namedQuery(\n  firestore: Firestore,\n  name: string\n): Promise<Query | null> {\n  firestore = cast(firestore, Firestore);\n  const client = ensureFirestoreConfigured(firestore);\n  return firestoreClientGetNamedQuery(client, name).then(namedQuery => {\n    if (!namedQuery) {\n      return null;\n    }\n\n    return new Query(firestore, null, namedQuery.query);\n  });\n}\n\nfunction verifyNotInitialized(firestore: Firestore): void {\n  if (firestore._initialized || firestore._terminated) {\n    throw new FirestoreError(\n      Code.FAILED_PRECONDITION,\n      'Firestore has already been started and persistence can no longer be ' +\n        'enabled. You can only enable persistence before calling any other ' +\n        'methods on a Firestore object.'\n    );\n  }\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AggregateType } from '../core/aggregate';\nimport { FieldPath as InternalFieldPath } from '../model/path';\nimport { ApiClientObjectMap, Value } from '../protos/firestore_proto_api';\n\nimport { average, count, sum } from './aggregate';\nimport { DocumentData, Query } from './reference';\nimport { AbstractUserDataWriter } from './user_data_writer';\n\nexport { AggregateType };\n\n/**\n * Represents an aggregation that can be performed by Firestore.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport class AggregateField<T> {\n  /** A type string to uniquely identify instances of this class. */\n  readonly type = 'AggregateField';\n\n  /** Indicates the aggregation operation of this AggregateField. */\n  readonly aggregateType: AggregateType;\n\n  /**\n   * Create a new AggregateField<T>\n   * @param aggregateType Specifies the type of aggregation operation to perform.\n   * @param _internalFieldPath Optionally specifies the field that is aggregated.\n   * @internal\n   */\n  constructor(\n    aggregateType: AggregateType = 'count',\n    readonly _internalFieldPath?: InternalFieldPath\n  ) {\n    this.aggregateType = aggregateType;\n  }\n}\n\n/**\n * The union of all `AggregateField` types that are supported by Firestore.\n */\nexport type AggregateFieldType =\n  | ReturnType<typeof sum>\n  | ReturnType<typeof average>\n  | ReturnType<typeof count>;\n\n/**\n * Specifies a set of aggregations and their aliases.\n */\nexport interface AggregateSpec {\n  [field: string]: AggregateFieldType;\n}\n\n/**\n * A type whose keys are taken from an `AggregateSpec`, and whose values are the\n * result of the aggregation performed by the corresponding `AggregateField`\n * from the input `AggregateSpec`.\n */\nexport type AggregateSpecData<T extends AggregateSpec> = {\n  [P in keyof T]: T[P] extends AggregateField<infer U> ? U : never;\n};\n\n/**\n * The results of executing an aggregation query.\n */\nexport class AggregateQuerySnapshot<\n  AggregateSpecType extends AggregateSpec,\n  AppModelType = DocumentData,\n  DbModelType extends DocumentData = DocumentData\n> {\n  /** A type string to uniquely identify instances of this class. */\n  readonly type = 'AggregateQuerySnapshot';\n\n  /**\n   * The underlying query over which the aggregations recorded in this\n   * `AggregateQuerySnapshot` were performed.\n   */\n  readonly query: Query<AppModelType, DbModelType>;\n\n  /** @hideconstructor */\n  constructor(\n    query: Query<AppModelType, DbModelType>,\n    private readonly _userDataWriter: AbstractUserDataWriter,\n    private readonly _data: ApiClientObjectMap<Value>\n  ) {\n    this.query = query;\n  }\n\n  /**\n   * Returns the results of the aggregations performed over the underlying\n   * query.\n   *\n   * The keys of the returned object will be the same as those of the\n   * `AggregateSpec` object specified to the aggregation method, and the values\n   * will be the corresponding aggregation result.\n   *\n   * @returns The results of the aggregations performed over the underlying\n   * query.\n   */\n  data(): AggregateSpecData<AggregateSpecType> {\n    return this._userDataWriter.convertObjectMap(\n      this._data\n    ) as AggregateSpecData<AggregateSpecType>;\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ByteString } from '../util/byte_string';\nimport { Code, FirestoreError } from '../util/error';\n\n/**\n * An immutable object representing an array of bytes.\n */\nexport class Bytes {\n  _byteString: ByteString;\n\n  /** @hideconstructor */\n  constructor(byteString: ByteString) {\n    this._byteString = byteString;\n  }\n\n  /**\n   * Creates a new `Bytes` object from the given Base64 string, converting it to\n   * bytes.\n   *\n   * @param base64 - The Base64 string used to create the `Bytes` object.\n   */\n  static fromBase64String(base64: string): Bytes {\n    try {\n      return new Bytes(ByteString.fromBase64String(base64));\n    } catch (e) {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        'Failed to construct data from Base64 string: ' + e\n      );\n    }\n  }\n\n  /**\n   * Creates a new `Bytes` object from the given Uint8Array.\n   *\n   * @param array - The Uint8Array used to create the `Bytes` object.\n   */\n  static fromUint8Array(array: Uint8Array): Bytes {\n    return new Bytes(ByteString.fromUint8Array(array));\n  }\n\n  /**\n   * Returns the underlying bytes as a Base64-encoded string.\n   *\n   * @returns The Base64-encoded string created from the `Bytes` object.\n   */\n  toBase64(): string {\n    return this._byteString.toBase64();\n  }\n\n  /**\n   * Returns the underlying bytes in a new `Uint8Array`.\n   *\n   * @returns The Uint8Array created from the `Bytes` object.\n   */\n  toUint8Array(): Uint8Array {\n    return this._byteString.toUint8Array();\n  }\n\n  /**\n   * Returns a string representation of the `Bytes` object.\n   *\n   * @returns A string representation of the `Bytes` object.\n   */\n  toString(): string {\n    return 'Bytes(base64: ' + this.toBase64() + ')';\n  }\n\n  /**\n   * Returns true if this `Bytes` object is equal to the provided one.\n   *\n   * @param other - The `Bytes` object to compare against.\n   * @returns true if this `Bytes` object is equal to the provided one.\n   */\n  isEqual(other: Bytes): boolean {\n    return this._byteString.isEqual(other._byteString);\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  DOCUMENT_KEY_NAME,\n  FieldPath as InternalFieldPath\n} from '../model/path';\nimport { Code, FirestoreError } from '../util/error';\n\n/**\n * A `FieldPath` refers to a field in a document. The path may consist of a\n * single field name (referring to a top-level field in the document), or a\n * list of field names (referring to a nested field in the document).\n *\n * Create a `FieldPath` by providing field names. If more than one field\n * name is provided, the path will point to a nested field in a document.\n */\nexport class FieldPath {\n  /** Internal representation of a Firestore field path. */\n  readonly _internalPath: InternalFieldPath;\n\n  /**\n   * Creates a `FieldPath` from the provided field names. If more than one field\n   * name is provided, the path will point to a nested field in a document.\n   *\n   * @param fieldNames - A list of field names.\n   */\n  constructor(...fieldNames: string[]) {\n    for (let i = 0; i < fieldNames.length; ++i) {\n      if (fieldNames[i].length === 0) {\n        throw new FirestoreError(\n          Code.INVALID_ARGUMENT,\n          `Invalid field name at argument $(i + 1). ` +\n            'Field names must not be empty.'\n        );\n      }\n    }\n\n    this._internalPath = new InternalFieldPath(fieldNames);\n  }\n\n  /**\n   * Returns true if this `FieldPath` is equal to the provided one.\n   *\n   * @param other - The `FieldPath` to compare against.\n   * @returns true if this `FieldPath` is equal to the provided one.\n   */\n  isEqual(other: FieldPath): boolean {\n    return this._internalPath.isEqual(other._internalPath);\n  }\n}\n\n/**\n * Returns a special sentinel `FieldPath` to refer to the ID of a document.\n * It can be used in queries to sort or filter by the document ID.\n */\nexport function documentId(): FieldPath {\n  return new FieldPath(DOCUMENT_KEY_NAME);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ParseContext } from '../api/parse_context';\nimport { FieldTransform } from '../model/mutation';\n\n/**\n * Sentinel values that can be used when writing document fields with `set()`\n * or `update()`.\n */\nexport abstract class FieldValue {\n  /**\n   * @param _methodName - The public API endpoint that returns this class.\n   * @hideconstructor\n   */\n  constructor(public _methodName: string) {}\n\n  /** Compares `FieldValue`s for equality. */\n  abstract isEqual(other: FieldValue): boolean;\n  abstract _toFieldTransform(context: ParseContext): FieldTransform | null;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Code, FirestoreError } from '../util/error';\nimport { primitiveComparator } from '../util/misc';\n\n/**\n * An immutable object representing a geographic location in Firestore. The\n * location is represented as latitude/longitude pair.\n *\n * Latitude values are in the range of [-90, 90].\n * Longitude values are in the range of [-180, 180].\n */\nexport class GeoPoint {\n  // Prefix with underscore to signal this is a private variable in JS and\n  // prevent it showing up for autocompletion when typing latitude or longitude.\n  private _lat: number;\n  private _long: number;\n\n  /**\n   * Creates a new immutable `GeoPoint` object with the provided latitude and\n   * longitude values.\n   * @param latitude - The latitude as number between -90 and 90.\n   * @param longitude - The longitude as number between -180 and 180.\n   */\n  constructor(latitude: number, longitude: number) {\n    if (!isFinite(latitude) || latitude < -90 || latitude > 90) {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        'Latitude must be a number between -90 and 90, but was: ' + latitude\n      );\n    }\n    if (!isFinite(longitude) || longitude < -180 || longitude > 180) {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        'Longitude must be a number between -180 and 180, but was: ' + longitude\n      );\n    }\n\n    this._lat = latitude;\n    this._long = longitude;\n  }\n\n  /**\n   * The latitude of this `GeoPoint` instance.\n   */\n  get latitude(): number {\n    return this._lat;\n  }\n\n  /**\n   * The longitude of this `GeoPoint` instance.\n   */\n  get longitude(): number {\n    return this._long;\n  }\n\n  /**\n   * Returns true if this `GeoPoint` is equal to the provided one.\n   *\n   * @param other - The `GeoPoint` to compare against.\n   * @returns true if this `GeoPoint` is equal to the provided one.\n   */\n  isEqual(other: GeoPoint): boolean {\n    return this._lat === other._lat && this._long === other._long;\n  }\n\n  /** Returns a JSON-serializable representation of this GeoPoint. */\n  toJSON(): { latitude: number; longitude: number } {\n    return { latitude: this._lat, longitude: this._long };\n  }\n\n  /**\n   * Actually private to JS consumers of our API, so this function is prefixed\n   * with an underscore.\n   */\n  _compareTo(other: GeoPoint): number {\n    return (\n      primitiveComparator(this._lat, other._lat) ||\n      primitiveComparator(this._long, other._long)\n    );\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  DocumentData,\n  FieldPath as PublicFieldPath,\n  SetOptions\n} from '@firebase/firestore-types';\nimport { Compat, deepEqual, getModularInstance } from '@firebase/util';\n\nimport { ParseContext } from '../api/parse_context';\nimport { DatabaseId } from '../core/database_info';\nimport { DocumentKey } from '../model/document_key';\nimport { FieldMask } from '../model/field_mask';\nimport {\n  FieldTransform,\n  Mutation,\n  PatchMutation,\n  Precondition,\n  SetMutation\n} from '../model/mutation';\nimport { ObjectValue } from '../model/object_value';\nimport { FieldPath as InternalFieldPath } from '../model/path';\nimport {\n  ArrayRemoveTransformOperation,\n  ArrayUnionTransformOperation,\n  NumericIncrementTransformOperation,\n  ServerTimestampTransform\n} from '../model/transform_operation';\nimport { newSerializer } from '../platform/serializer';\nimport {\n  MapValue as ProtoMapValue,\n  Value as ProtoValue\n} from '../protos/firestore_proto_api';\nimport { toNumber } from '../remote/number_serializer';\nimport {\n  JsonProtoSerializer,\n  toBytes,\n  toResourceName,\n  toTimestamp\n} from '../remote/serializer';\nimport { debugAssert, fail } from '../util/assert';\nimport { Code, FirestoreError } from '../util/error';\nimport { isPlainObject, valueDescription } from '../util/input_validation';\nimport { Dict, forEach, isEmpty } from '../util/obj';\n\nimport { Bytes } from './bytes';\nimport { Firestore } from './database';\nimport { FieldPath } from './field_path';\nimport { FieldValue } from './field_value';\nimport { GeoPoint } from './geo_point';\nimport {\n  DocumentReference,\n  PartialWithFieldValue,\n  WithFieldValue\n} from './reference';\nimport { Timestamp } from './timestamp';\n\nconst RESERVED_FIELD_REGEX = /^__.*__$/;\n\n/**\n * An untyped Firestore Data Converter interface that is shared between the\n * lite, firestore-exp and classic SDK.\n */\nexport interface UntypedFirestoreDataConverter<\n  AppModelType,\n  DbModelType extends DocumentData = DocumentData\n> {\n  toFirestore(\n    modelObject: WithFieldValue<AppModelType>\n  ): WithFieldValue<DbModelType>;\n  toFirestore(\n    modelObject: PartialWithFieldValue<AppModelType>,\n    options: SetOptions\n  ): PartialWithFieldValue<DbModelType>;\n  fromFirestore(snapshot: unknown, options?: unknown): AppModelType;\n}\n\n/** The result of parsing document data (e.g. for a setData call). */\nexport class ParsedSetData {\n  constructor(\n    readonly data: ObjectValue,\n    readonly fieldMask: FieldMask | null,\n    readonly fieldTransforms: FieldTransform[]\n  ) {}\n\n  toMutation(key: DocumentKey, precondition: Precondition): Mutation {\n    if (this.fieldMask !== null) {\n      return new PatchMutation(\n        key,\n        this.data,\n        this.fieldMask,\n        precondition,\n        this.fieldTransforms\n      );\n    } else {\n      return new SetMutation(\n        key,\n        this.data,\n        precondition,\n        this.fieldTransforms\n      );\n    }\n  }\n}\n\n/** The result of parsing \"update\" data (i.e. for an updateData call). */\nexport class ParsedUpdateData {\n  constructor(\n    readonly data: ObjectValue,\n    // The fieldMask does not include document transforms.\n    readonly fieldMask: FieldMask,\n    readonly fieldTransforms: FieldTransform[]\n  ) {}\n\n  toMutation(key: DocumentKey, precondition: Precondition): Mutation {\n    return new PatchMutation(\n      key,\n      this.data,\n      this.fieldMask,\n      precondition,\n      this.fieldTransforms\n    );\n  }\n}\n\n/*\n * Represents what type of API method provided the data being parsed; useful\n * for determining which error conditions apply during parsing and providing\n * better error messages.\n */\nexport const enum UserDataSource {\n  Set,\n  Update,\n  MergeSet,\n  /**\n   * Indicates the source is a where clause, cursor bound, arrayUnion()\n   * element, etc. Of note, isWrite(source) will return false.\n   */\n  Argument,\n  /**\n   * Indicates that the source is an Argument that may directly contain nested\n   * arrays (e.g. the operand of an `in` query).\n   */\n  ArrayArgument\n}\n\nfunction isWrite(dataSource: UserDataSource): boolean {\n  switch (dataSource) {\n    case UserDataSource.Set: // fall through\n    case UserDataSource.MergeSet: // fall through\n    case UserDataSource.Update:\n      return true;\n    case UserDataSource.Argument:\n    case UserDataSource.ArrayArgument:\n      return false;\n    default:\n      throw fail(`Unexpected case for UserDataSource: ${dataSource}`);\n  }\n}\n\n/** Contains the settings that are mutated as we parse user data. */\ninterface ContextSettings {\n  /** Indicates what kind of API method this data came from. */\n  readonly dataSource: UserDataSource;\n  /** The name of the method the user called to create the ParseContext. */\n  readonly methodName: string;\n  /** The document the user is attempting to modify, if that applies. */\n  readonly targetDoc?: DocumentKey;\n  /**\n   * A path within the object being parsed. This could be an empty path (in\n   * which case the context represents the root of the data being parsed), or a\n   * nonempty path (indicating the context represents a nested location within\n   * the data).\n   */\n  readonly path?: InternalFieldPath;\n  /**\n   * Whether or not this context corresponds to an element of an array.\n   * If not set, elements are treated as if they were outside of arrays.\n   */\n  readonly arrayElement?: boolean;\n  /**\n   * Whether or not a converter was specified in this context. If true, error\n   * messages will reference the converter when invalid data is provided.\n   */\n  readonly hasConverter?: boolean;\n}\n\n/** A \"context\" object passed around while parsing user data. */\nclass ParseContextImpl implements ParseContext {\n  readonly fieldTransforms: FieldTransform[];\n  readonly fieldMask: InternalFieldPath[];\n  /**\n   * Initializes a ParseContext with the given source and path.\n   *\n   * @param settings - The settings for the parser.\n   * @param databaseId - The database ID of the Firestore instance.\n   * @param serializer - The serializer to use to generate the Value proto.\n   * @param ignoreUndefinedProperties - Whether to ignore undefined properties\n   * rather than throw.\n   * @param fieldTransforms - A mutable list of field transforms encountered\n   * while parsing the data.\n   * @param fieldMask - A mutable list of field paths encountered while parsing\n   * the data.\n   *\n   * TODO(b/34871131): We don't support array paths right now, so path can be\n   * null to indicate the context represents any location within an array (in\n   * which case certain features will not work and errors will be somewhat\n   * compromised).\n   */\n  constructor(\n    readonly settings: ContextSettings,\n    readonly databaseId: DatabaseId,\n    readonly serializer: JsonProtoSerializer,\n    readonly ignoreUndefinedProperties: boolean,\n    fieldTransforms?: FieldTransform[],\n    fieldMask?: InternalFieldPath[]\n  ) {\n    // Minor hack: If fieldTransforms is undefined, we assume this is an\n    // external call and we need to validate the entire path.\n    if (fieldTransforms === undefined) {\n      this.validatePath();\n    }\n    this.fieldTransforms = fieldTransforms || [];\n    this.fieldMask = fieldMask || [];\n  }\n\n  get path(): InternalFieldPath | undefined {\n    return this.settings.path;\n  }\n\n  get dataSource(): UserDataSource {\n    return this.settings.dataSource;\n  }\n\n  /** Returns a new context with the specified settings overwritten. */\n  contextWith(configuration: Partial<ContextSettings>): ParseContextImpl {\n    return new ParseContextImpl(\n      { ...this.settings, ...configuration },\n      this.databaseId,\n      this.serializer,\n      this.ignoreUndefinedProperties,\n      this.fieldTransforms,\n      this.fieldMask\n    );\n  }\n\n  childContextForField(field: string): ParseContextImpl {\n    const childPath = this.path?.child(field);\n    const context = this.contextWith({ path: childPath, arrayElement: false });\n    context.validatePathSegment(field);\n    return context;\n  }\n\n  childContextForFieldPath(field: InternalFieldPath): ParseContextImpl {\n    const childPath = this.path?.child(field);\n    const context = this.contextWith({ path: childPath, arrayElement: false });\n    context.validatePath();\n    return context;\n  }\n\n  childContextForArray(index: number): ParseContextImpl {\n    // TODO(b/34871131): We don't support array paths right now; so make path\n    // undefined.\n    return this.contextWith({ path: undefined, arrayElement: true });\n  }\n\n  createError(reason: string): FirestoreError {\n    return createError(\n      reason,\n      this.settings.methodName,\n      this.settings.hasConverter || false,\n      this.path,\n      this.settings.targetDoc\n    );\n  }\n\n  /** Returns 'true' if 'fieldPath' was traversed when creating this context. */\n  contains(fieldPath: InternalFieldPath): boolean {\n    return (\n      this.fieldMask.find(field => fieldPath.isPrefixOf(field)) !== undefined ||\n      this.fieldTransforms.find(transform =>\n        fieldPath.isPrefixOf(transform.field)\n      ) !== undefined\n    );\n  }\n\n  private validatePath(): void {\n    // TODO(b/34871131): Remove null check once we have proper paths for fields\n    // within arrays.\n    if (!this.path) {\n      return;\n    }\n    for (let i = 0; i < this.path.length; i++) {\n      this.validatePathSegment(this.path.get(i));\n    }\n  }\n\n  private validatePathSegment(segment: string): void {\n    if (segment.length === 0) {\n      throw this.createError('Document fields must not be empty');\n    }\n    if (isWrite(this.dataSource) && RESERVED_FIELD_REGEX.test(segment)) {\n      throw this.createError('Document fields cannot begin and end with \"__\"');\n    }\n  }\n}\n\n/**\n * Helper for parsing raw user input (provided via the API) into internal model\n * classes.\n */\nexport class UserDataReader {\n  private readonly serializer: JsonProtoSerializer;\n\n  constructor(\n    private readonly databaseId: DatabaseId,\n    private readonly ignoreUndefinedProperties: boolean,\n    serializer?: JsonProtoSerializer\n  ) {\n    this.serializer = serializer || newSerializer(databaseId);\n  }\n\n  /** Creates a new top-level parse context. */\n  createContext(\n    dataSource: UserDataSource,\n    methodName: string,\n    targetDoc?: DocumentKey,\n    hasConverter = false\n  ): ParseContextImpl {\n    return new ParseContextImpl(\n      {\n        dataSource,\n        methodName,\n        targetDoc,\n        path: InternalFieldPath.emptyPath(),\n        arrayElement: false,\n        hasConverter\n      },\n      this.databaseId,\n      this.serializer,\n      this.ignoreUndefinedProperties\n    );\n  }\n}\n\nexport function newUserDataReader(firestore: Firestore): UserDataReader {\n  const settings = firestore._freezeSettings();\n  const serializer = newSerializer(firestore._databaseId);\n  return new UserDataReader(\n    firestore._databaseId,\n    !!settings.ignoreUndefinedProperties,\n    serializer\n  );\n}\n\n/** Parse document data from a set() call. */\nexport function parseSetData(\n  userDataReader: UserDataReader,\n  methodName: string,\n  targetDoc: DocumentKey,\n  input: unknown,\n  hasConverter: boolean,\n  options: SetOptions = {}\n): ParsedSetData {\n  const context = userDataReader.createContext(\n    options.merge || options.mergeFields\n      ? UserDataSource.MergeSet\n      : UserDataSource.Set,\n    methodName,\n    targetDoc,\n    hasConverter\n  );\n  validatePlainObject('Data must be an object, but it was:', context, input);\n  const updateData = parseObject(input, context)!;\n\n  let fieldMask: FieldMask | null;\n  let fieldTransforms: FieldTransform[];\n\n  if (options.merge) {\n    fieldMask = new FieldMask(context.fieldMask);\n    fieldTransforms = context.fieldTransforms;\n  } else if (options.mergeFields) {\n    const validatedFieldPaths: InternalFieldPath[] = [];\n\n    for (const stringOrFieldPath of options.mergeFields) {\n      const fieldPath = fieldPathFromArgument(\n        methodName,\n        stringOrFieldPath,\n        targetDoc\n      );\n      if (!context.contains(fieldPath)) {\n        throw new FirestoreError(\n          Code.INVALID_ARGUMENT,\n          `Field '${fieldPath}' is specified in your field mask but missing from your input data.`\n        );\n      }\n\n      if (!fieldMaskContains(validatedFieldPaths, fieldPath)) {\n        validatedFieldPaths.push(fieldPath);\n      }\n    }\n\n    fieldMask = new FieldMask(validatedFieldPaths);\n    fieldTransforms = context.fieldTransforms.filter(transform =>\n      fieldMask!.covers(transform.field)\n    );\n  } else {\n    fieldMask = null;\n    fieldTransforms = context.fieldTransforms;\n  }\n\n  return new ParsedSetData(\n    new ObjectValue(updateData),\n    fieldMask,\n    fieldTransforms\n  );\n}\n\nexport class DeleteFieldValueImpl extends FieldValue {\n  _toFieldTransform(context: ParseContextImpl): null {\n    if (context.dataSource === UserDataSource.MergeSet) {\n      // No transform to add for a delete, but we need to add it to our\n      // fieldMask so it gets deleted.\n      context.fieldMask.push(context.path!);\n    } else if (context.dataSource === UserDataSource.Update) {\n      debugAssert(\n        context.path!.length > 0,\n        `${this._methodName}() at the top level should have already ` +\n          'been handled.'\n      );\n      throw context.createError(\n        `${this._methodName}() can only appear at the top level ` +\n          'of your update data'\n      );\n    } else {\n      // We shouldn't encounter delete sentinels for queries or non-merge set() calls.\n      throw context.createError(\n        `${this._methodName}() cannot be used with set() unless you pass ` +\n          '{merge:true}'\n      );\n    }\n    return null;\n  }\n\n  isEqual(other: FieldValue): boolean {\n    return other instanceof DeleteFieldValueImpl;\n  }\n}\n\n/**\n * Creates a child context for parsing SerializableFieldValues.\n *\n * This is different than calling `ParseContext.contextWith` because it keeps\n * the fieldTransforms and fieldMask separate.\n *\n * The created context has its `dataSource` set to `UserDataSource.Argument`.\n * Although these values are used with writes, any elements in these FieldValues\n * are not considered writes since they cannot contain any FieldValue sentinels,\n * etc.\n *\n * @param fieldValue - The sentinel FieldValue for which to create a child\n *     context.\n * @param context - The parent context.\n * @param arrayElement - Whether or not the FieldValue has an array.\n */\nfunction createSentinelChildContext(\n  fieldValue: FieldValue,\n  context: ParseContextImpl,\n  arrayElement: boolean\n): ParseContextImpl {\n  return new ParseContextImpl(\n    {\n      dataSource: UserDataSource.Argument,\n      targetDoc: context.settings.targetDoc,\n      methodName: fieldValue._methodName,\n      arrayElement\n    },\n    context.databaseId,\n    context.serializer,\n    context.ignoreUndefinedProperties\n  );\n}\n\nexport class ServerTimestampFieldValueImpl extends FieldValue {\n  _toFieldTransform(context: ParseContextImpl): FieldTransform {\n    return new FieldTransform(context.path!, new ServerTimestampTransform());\n  }\n\n  isEqual(other: FieldValue): boolean {\n    return other instanceof ServerTimestampFieldValueImpl;\n  }\n}\n\nexport class ArrayUnionFieldValueImpl extends FieldValue {\n  constructor(methodName: string, private readonly _elements: unknown[]) {\n    super(methodName);\n  }\n\n  _toFieldTransform(context: ParseContextImpl): FieldTransform {\n    const parseContext = createSentinelChildContext(\n      this,\n      context,\n      /*array=*/ true\n    );\n    const parsedElements = this._elements.map(\n      element => parseData(element, parseContext)!\n    );\n    const arrayUnion = new ArrayUnionTransformOperation(parsedElements);\n    return new FieldTransform(context.path!, arrayUnion);\n  }\n\n  isEqual(other: FieldValue): boolean {\n    return (\n      other instanceof ArrayUnionFieldValueImpl &&\n      deepEqual(this._elements, other._elements)\n    );\n  }\n}\n\nexport class ArrayRemoveFieldValueImpl extends FieldValue {\n  constructor(methodName: string, private readonly _elements: unknown[]) {\n    super(methodName);\n  }\n\n  _toFieldTransform(context: ParseContextImpl): FieldTransform {\n    const parseContext = createSentinelChildContext(\n      this,\n      context,\n      /*array=*/ true\n    );\n    const parsedElements = this._elements.map(\n      element => parseData(element, parseContext)!\n    );\n    const arrayUnion = new ArrayRemoveTransformOperation(parsedElements);\n    return new FieldTransform(context.path!, arrayUnion);\n  }\n\n  isEqual(other: FieldValue): boolean {\n    return (\n      other instanceof ArrayRemoveFieldValueImpl &&\n      deepEqual(this._elements, other._elements)\n    );\n  }\n}\n\nexport class NumericIncrementFieldValueImpl extends FieldValue {\n  constructor(methodName: string, private readonly _operand: number) {\n    super(methodName);\n  }\n\n  _toFieldTransform(context: ParseContextImpl): FieldTransform {\n    const numericIncrement = new NumericIncrementTransformOperation(\n      context.serializer,\n      toNumber(context.serializer, this._operand)\n    );\n    return new FieldTransform(context.path!, numericIncrement);\n  }\n\n  isEqual(other: FieldValue): boolean {\n    return (\n      other instanceof NumericIncrementFieldValueImpl &&\n      this._operand === other._operand\n    );\n  }\n}\n\n/** Parse update data from an update() call. */\nexport function parseUpdateData(\n  userDataReader: UserDataReader,\n  methodName: string,\n  targetDoc: DocumentKey,\n  input: unknown\n): ParsedUpdateData {\n  const context = userDataReader.createContext(\n    UserDataSource.Update,\n    methodName,\n    targetDoc\n  );\n  validatePlainObject('Data must be an object, but it was:', context, input);\n\n  const fieldMaskPaths: InternalFieldPath[] = [];\n  const updateData = ObjectValue.empty();\n  forEach(input as Dict<unknown>, (key, value) => {\n    const path = fieldPathFromDotSeparatedString(methodName, key, targetDoc);\n\n    // For Compat types, we have to \"extract\" the underlying types before\n    // performing validation.\n    value = getModularInstance(value);\n\n    const childContext = context.childContextForFieldPath(path);\n    if (value instanceof DeleteFieldValueImpl) {\n      // Add it to the field mask, but don't add anything to updateData.\n      fieldMaskPaths.push(path);\n    } else {\n      const parsedValue = parseData(value, childContext);\n      if (parsedValue != null) {\n        fieldMaskPaths.push(path);\n        updateData.set(path, parsedValue);\n      }\n    }\n  });\n\n  const mask = new FieldMask(fieldMaskPaths);\n  return new ParsedUpdateData(updateData, mask, context.fieldTransforms);\n}\n\n/** Parse update data from a list of field/value arguments. */\nexport function parseUpdateVarargs(\n  userDataReader: UserDataReader,\n  methodName: string,\n  targetDoc: DocumentKey,\n  field: string | PublicFieldPath | Compat<PublicFieldPath>,\n  value: unknown,\n  moreFieldsAndValues: unknown[]\n): ParsedUpdateData {\n  const context = userDataReader.createContext(\n    UserDataSource.Update,\n    methodName,\n    targetDoc\n  );\n  const keys = [fieldPathFromArgument(methodName, field, targetDoc)];\n  const values = [value];\n\n  if (moreFieldsAndValues.length % 2 !== 0) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      `Function ${methodName}() needs to be called with an even number ` +\n        'of arguments that alternate between field names and values.'\n    );\n  }\n\n  for (let i = 0; i < moreFieldsAndValues.length; i += 2) {\n    keys.push(\n      fieldPathFromArgument(\n        methodName,\n        moreFieldsAndValues[i] as string | PublicFieldPath\n      )\n    );\n    values.push(moreFieldsAndValues[i + 1]);\n  }\n\n  const fieldMaskPaths: InternalFieldPath[] = [];\n  const updateData = ObjectValue.empty();\n\n  // We iterate in reverse order to pick the last value for a field if the\n  // user specified the field multiple times.\n  for (let i = keys.length - 1; i >= 0; --i) {\n    if (!fieldMaskContains(fieldMaskPaths, keys[i])) {\n      const path = keys[i];\n      let value = values[i];\n\n      // For Compat types, we have to \"extract\" the underlying types before\n      // performing validation.\n      value = getModularInstance(value);\n\n      const childContext = context.childContextForFieldPath(path);\n      if (value instanceof DeleteFieldValueImpl) {\n        // Add it to the field mask, but don't add anything to updateData.\n        fieldMaskPaths.push(path);\n      } else {\n        const parsedValue = parseData(value, childContext);\n        if (parsedValue != null) {\n          fieldMaskPaths.push(path);\n          updateData.set(path, parsedValue);\n        }\n      }\n    }\n  }\n\n  const mask = new FieldMask(fieldMaskPaths);\n  return new ParsedUpdateData(updateData, mask, context.fieldTransforms);\n}\n\n/**\n * Parse a \"query value\" (e.g. value in a where filter or a value in a cursor\n * bound).\n *\n * @param allowArrays - Whether the query value is an array that may directly\n * contain additional arrays (e.g. the operand of an `in` query).\n */\nexport function parseQueryValue(\n  userDataReader: UserDataReader,\n  methodName: string,\n  input: unknown,\n  allowArrays = false\n): ProtoValue {\n  const context = userDataReader.createContext(\n    allowArrays ? UserDataSource.ArrayArgument : UserDataSource.Argument,\n    methodName\n  );\n  const parsed = parseData(input, context);\n  debugAssert(parsed != null, 'Parsed data should not be null.');\n  debugAssert(\n    context.fieldTransforms.length === 0,\n    'Field transforms should have been disallowed.'\n  );\n  return parsed;\n}\n\n/**\n * Parses user data to Protobuf Values.\n *\n * @param input - Data to be parsed.\n * @param context - A context object representing the current path being parsed,\n * the source of the data being parsed, etc.\n * @returns The parsed value, or null if the value was a FieldValue sentinel\n * that should not be included in the resulting parsed data.\n */\nexport function parseData(\n  input: unknown,\n  context: ParseContextImpl\n): ProtoValue | null {\n  // Unwrap the API type from the Compat SDK. This will return the API type\n  // from firestore-exp.\n  input = getModularInstance(input);\n\n  if (looksLikeJsonObject(input)) {\n    validatePlainObject('Unsupported field value:', context, input);\n    return parseObject(input, context);\n  } else if (input instanceof FieldValue) {\n    // FieldValues usually parse into transforms (except deleteField())\n    // in which case we do not want to include this field in our parsed data\n    // (as doing so will overwrite the field directly prior to the transform\n    // trying to transform it). So we don't add this location to\n    // context.fieldMask and we return null as our parsing result.\n    parseSentinelFieldValue(input, context);\n    return null;\n  } else if (input === undefined && context.ignoreUndefinedProperties) {\n    // If the input is undefined it can never participate in the fieldMask, so\n    // don't handle this below. If `ignoreUndefinedProperties` is false,\n    // `parseScalarValue` will reject an undefined value.\n    return null;\n  } else {\n    // If context.path is null we are inside an array and we don't support\n    // field mask paths more granular than the top-level array.\n    if (context.path) {\n      context.fieldMask.push(context.path);\n    }\n\n    if (input instanceof Array) {\n      // TODO(b/34871131): Include the path containing the array in the error\n      // message.\n      // In the case of IN queries, the parsed data is an array (representing\n      // the set of values to be included for the IN query) that may directly\n      // contain additional arrays (each representing an individual field\n      // value), so we disable this validation.\n      if (\n        context.settings.arrayElement &&\n        context.dataSource !== UserDataSource.ArrayArgument\n      ) {\n        throw context.createError('Nested arrays are not supported');\n      }\n      return parseArray(input as unknown[], context);\n    } else {\n      return parseScalarValue(input, context);\n    }\n  }\n}\n\nfunction parseObject(\n  obj: Dict<unknown>,\n  context: ParseContextImpl\n): { mapValue: ProtoMapValue } {\n  const fields: Dict<ProtoValue> = {};\n\n  if (isEmpty(obj)) {\n    // If we encounter an empty object, we explicitly add it to the update\n    // mask to ensure that the server creates a map entry.\n    if (context.path && context.path.length > 0) {\n      context.fieldMask.push(context.path);\n    }\n  } else {\n    forEach(obj, (key: string, val: unknown) => {\n      const parsedValue = parseData(val, context.childContextForField(key));\n      if (parsedValue != null) {\n        fields[key] = parsedValue;\n      }\n    });\n  }\n\n  return { mapValue: { fields } };\n}\n\nfunction parseArray(array: unknown[], context: ParseContextImpl): ProtoValue {\n  const values: ProtoValue[] = [];\n  let entryIndex = 0;\n  for (const entry of array) {\n    let parsedEntry = parseData(\n      entry,\n      context.childContextForArray(entryIndex)\n    );\n    if (parsedEntry == null) {\n      // Just include nulls in the array for fields being replaced with a\n      // sentinel.\n      parsedEntry = { nullValue: 'NULL_VALUE' };\n    }\n    values.push(parsedEntry);\n    entryIndex++;\n  }\n  return { arrayValue: { values } };\n}\n\n/**\n * \"Parses\" the provided FieldValueImpl, adding any necessary transforms to\n * context.fieldTransforms.\n */\nfunction parseSentinelFieldValue(\n  value: FieldValue,\n  context: ParseContextImpl\n): void {\n  // Sentinels are only supported with writes, and not within arrays.\n  if (!isWrite(context.dataSource)) {\n    throw context.createError(\n      `${value._methodName}() can only be used with update() and set()`\n    );\n  }\n  if (!context.path) {\n    throw context.createError(\n      `${value._methodName}() is not currently supported inside arrays`\n    );\n  }\n\n  const fieldTransform = value._toFieldTransform(context);\n  if (fieldTransform) {\n    context.fieldTransforms.push(fieldTransform);\n  }\n}\n\n/**\n * Helper to parse a scalar value (i.e. not an Object, Array, or FieldValue)\n *\n * @returns The parsed value\n */\nfunction parseScalarValue(\n  value: unknown,\n  context: ParseContextImpl\n): ProtoValue | null {\n  value = getModularInstance(value);\n\n  if (value === null) {\n    return { nullValue: 'NULL_VALUE' };\n  } else if (typeof value === 'number') {\n    return toNumber(context.serializer, value);\n  } else if (typeof value === 'boolean') {\n    return { booleanValue: value };\n  } else if (typeof value === 'string') {\n    return { stringValue: value };\n  } else if (value instanceof Date) {\n    const timestamp = Timestamp.fromDate(value);\n    return {\n      timestampValue: toTimestamp(context.serializer, timestamp)\n    };\n  } else if (value instanceof Timestamp) {\n    // Firestore backend truncates precision down to microseconds. To ensure\n    // offline mode works the same with regards to truncation, perform the\n    // truncation immediately without waiting for the backend to do that.\n    const timestamp = new Timestamp(\n      value.seconds,\n      Math.floor(value.nanoseconds / 1000) * 1000\n    );\n    return {\n      timestampValue: toTimestamp(context.serializer, timestamp)\n    };\n  } else if (value instanceof GeoPoint) {\n    return {\n      geoPointValue: {\n        latitude: value.latitude,\n        longitude: value.longitude\n      }\n    };\n  } else if (value instanceof Bytes) {\n    return { bytesValue: toBytes(context.serializer, value._byteString) };\n  } else if (value instanceof DocumentReference) {\n    const thisDb = context.databaseId;\n    const otherDb = value.firestore._databaseId;\n    if (!otherDb.isEqual(thisDb)) {\n      throw context.createError(\n        'Document reference is for database ' +\n          `${otherDb.projectId}/${otherDb.database} but should be ` +\n          `for database ${thisDb.projectId}/${thisDb.database}`\n      );\n    }\n    return {\n      referenceValue: toResourceName(\n        value.firestore._databaseId || context.databaseId,\n        value._key.path\n      )\n    };\n  } else {\n    throw context.createError(\n      `Unsupported field value: ${valueDescription(value)}`\n    );\n  }\n}\n\n/**\n * Checks whether an object looks like a JSON object that should be converted\n * into a struct. Normal class/prototype instances are considered to look like\n * JSON objects since they should be converted to a struct value. Arrays, Dates,\n * GeoPoints, etc. are not considered to look like JSON objects since they map\n * to specific FieldValue types other than ObjectValue.\n */\nfunction looksLikeJsonObject(input: unknown): boolean {\n  return (\n    typeof input === 'object' &&\n    input !== null &&\n    !(input instanceof Array) &&\n    !(input instanceof Date) &&\n    !(input instanceof Timestamp) &&\n    !(input instanceof GeoPoint) &&\n    !(input instanceof Bytes) &&\n    !(input instanceof DocumentReference) &&\n    !(input instanceof FieldValue)\n  );\n}\n\nfunction validatePlainObject(\n  message: string,\n  context: ParseContextImpl,\n  input: unknown\n): asserts input is Dict<unknown> {\n  if (!looksLikeJsonObject(input) || !isPlainObject(input)) {\n    const description = valueDescription(input);\n    if (description === 'an object') {\n      // Massage the error if it was an object.\n      throw context.createError(message + ' a custom object');\n    } else {\n      throw context.createError(message + ' ' + description);\n    }\n  }\n}\n\n/**\n * Helper that calls fromDotSeparatedString() but wraps any error thrown.\n */\nexport function fieldPathFromArgument(\n  methodName: string,\n  path: string | PublicFieldPath | Compat<PublicFieldPath>,\n  targetDoc?: DocumentKey\n): InternalFieldPath {\n  // If required, replace the FieldPath Compat class with with the firestore-exp\n  // FieldPath.\n  path = getModularInstance(path);\n\n  if (path instanceof FieldPath) {\n    return path._internalPath;\n  } else if (typeof path === 'string') {\n    return fieldPathFromDotSeparatedString(methodName, path);\n  } else {\n    const message = 'Field path arguments must be of type string or ';\n    throw createError(\n      message,\n      methodName,\n      /* hasConverter= */ false,\n      /* path= */ undefined,\n      targetDoc\n    );\n  }\n}\n\n/**\n * Matches any characters in a field path string that are reserved.\n */\nconst FIELD_PATH_RESERVED = new RegExp('[~\\\\*/\\\\[\\\\]]');\n\n/**\n * Wraps fromDotSeparatedString with an error message about the method that\n * was thrown.\n * @param methodName - The publicly visible method name\n * @param path - The dot-separated string form of a field path which will be\n * split on dots.\n * @param targetDoc - The document against which the field path will be\n * evaluated.\n */\nexport function fieldPathFromDotSeparatedString(\n  methodName: string,\n  path: string,\n  targetDoc?: DocumentKey\n): InternalFieldPath {\n  const found = path.search(FIELD_PATH_RESERVED);\n  if (found >= 0) {\n    throw createError(\n      `Invalid field path (${path}). Paths must not contain ` +\n        `'~', '*', '/', '[', or ']'`,\n      methodName,\n      /* hasConverter= */ false,\n      /* path= */ undefined,\n      targetDoc\n    );\n  }\n\n  try {\n    return new FieldPath(...path.split('.'))._internalPath;\n  } catch (e) {\n    throw createError(\n      `Invalid field path (${path}). Paths must not be empty, ` +\n        `begin with '.', end with '.', or contain '..'`,\n      methodName,\n      /* hasConverter= */ false,\n      /* path= */ undefined,\n      targetDoc\n    );\n  }\n}\n\nfunction createError(\n  reason: string,\n  methodName: string,\n  hasConverter: boolean,\n  path?: InternalFieldPath,\n  targetDoc?: DocumentKey\n): FirestoreError {\n  const hasPath = path && !path.isEmpty();\n  const hasDocument = targetDoc !== undefined;\n  let message = `Function ${methodName}() called with invalid data`;\n  if (hasConverter) {\n    message += ' (via `toFirestore()`)';\n  }\n  message += '. ';\n\n  let description = '';\n  if (hasPath || hasDocument) {\n    description += ' (found';\n\n    if (hasPath) {\n      description += ` in field ${path}`;\n    }\n    if (hasDocument) {\n      description += ` in document ${targetDoc}`;\n    }\n    description += ')';\n  }\n\n  return new FirestoreError(\n    Code.INVALID_ARGUMENT,\n    message + reason + description\n  );\n}\n\n/** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */\nfunction fieldMaskContains(\n  haystack: InternalFieldPath[],\n  needle: InternalFieldPath\n): boolean {\n  return haystack.some(v => v.isEqual(needle));\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Compat, getModularInstance } from '@firebase/util';\n\nimport { Document } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport { FieldPath as InternalFieldPath } from '../model/path';\nimport { arrayEquals } from '../util/misc';\n\nimport { Firestore } from './database';\nimport { FieldPath } from './field_path';\nimport {\n  DocumentData,\n  DocumentReference,\n  PartialWithFieldValue,\n  Query,\n  queryEqual,\n  SetOptions,\n  WithFieldValue\n} from './reference';\nimport {\n  fieldPathFromDotSeparatedString,\n  UntypedFirestoreDataConverter\n} from './user_data_reader';\nimport { AbstractUserDataWriter } from './user_data_writer';\n\n/**\n * Converter used by `withConverter()` to transform user objects of type\n * `AppModelType` into Firestore data of type `DbModelType`.\n *\n * Using the converter allows you to specify generic type arguments when\n * storing and retrieving objects from Firestore.\n *\n * In this context, an \"AppModel\" is a class that is used in an application to\n * package together related information and functionality. Such a class could,\n * for example, have properties with complex, nested data types, properties used\n * for memoization, properties of types not supported by Firestore (such as\n * `symbol` and `bigint`), and helper functions that perform compound\n * operations. Such classes are not suitable and/or possible to store into a\n * Firestore database. Instead, instances of such classes need to be converted\n * to \"plain old JavaScript objects\" (POJOs) with exclusively primitive\n * properties, potentially nested inside other POJOs or arrays of POJOs. In this\n * context, this type is referred to as the \"DbModel\" and would be an object\n * suitable for persisting into Firestore. For convenience, applications can\n * implement `FirestoreDataConverter` and register the converter with Firestore\n * objects, such as `DocumentReference` or `Query`, to automatically convert\n * `AppModel` to `DbModel` when storing into Firestore, and convert `DbModel`\n * to `AppModel` when retrieving from Firestore.\n *\n * @example\n *\n * Simple Example\n *\n * ```typescript\n * const numberConverter = {\n *     toFirestore(value: WithFieldValue<number>) {\n *         return { value };\n *     },\n *     fromFirestore(snapshot: QueryDocumentSnapshot, options: SnapshotOptions) {\n *         return snapshot.data(options).value as number;\n *     }\n * };\n *\n * async function simpleDemo(db: Firestore): Promise<void> {\n *     const documentRef = doc(db, 'values/value123').withConverter(numberConverter);\n *\n *     // converters are used with `setDoc`, `addDoc`, and `getDoc`\n *     await setDoc(documentRef, 42);\n *     const snapshot1 = await getDoc(documentRef);\n *     assertEqual(snapshot1.data(), 42);\n *\n *     // converters are not used when writing data with `updateDoc`\n *     await updateDoc(documentRef, { value: 999 });\n *     const snapshot2 = await getDoc(documentRef);\n *     assertEqual(snapshot2.data(), 999);\n * }\n * ```\n *\n * Advanced Example\n *\n * ```typescript\n * // The Post class is a model that is used by our application.\n * // This class may have properties and methods that are specific\n * // to our application execution, which do not need to be persisted\n * // to Firestore.\n * class Post {\n *     constructor(\n *         readonly title: string,\n *         readonly author: string,\n *         readonly lastUpdatedMillis: number\n *     ) {}\n *     toString(): string {\n *         return `${this.title} by ${this.author}`;\n *     }\n * }\n *\n * // The PostDbModel represents how we want our posts to be stored\n * // in Firestore. This DbModel has different properties (`ttl`,\n * // `aut`, and `lut`) from the Post class we use in our application.\n * interface PostDbModel {\n *     ttl: string;\n *     aut: { firstName: string; lastName: string };\n *     lut: Timestamp;\n * }\n *\n * // The `PostConverter` implements `FirestoreDataConverter` and specifies\n * // how the Firestore SDK can convert `Post` objects to `PostDbModel`\n * // objects and vice versa.\n * class PostConverter implements FirestoreDataConverter<Post, PostDbModel> {\n *     toFirestore(post: WithFieldValue<Post>): WithFieldValue<PostDbModel> {\n *         return {\n *             ttl: post.title,\n *             aut: this._autFromAuthor(post.author),\n *             lut: this._lutFromLastUpdatedMillis(post.lastUpdatedMillis)\n *         };\n *     }\n *\n *     fromFirestore(snapshot: QueryDocumentSnapshot, options: SnapshotOptions): Post {\n *         const data = snapshot.data(options) as PostDbModel;\n *         const author = `${data.aut.firstName} ${data.aut.lastName}`;\n *         return new Post(data.ttl, author, data.lut.toMillis());\n *     }\n *\n *     _autFromAuthor(\n *         author: string | FieldValue\n *     ): { firstName: string; lastName: string } | FieldValue {\n *         if (typeof author !== 'string') {\n *             // `author` is a FieldValue, so just return it.\n *             return author;\n *         }\n *         const [firstName, lastName] = author.split(' ');\n *         return {firstName, lastName};\n *     }\n *\n *     _lutFromLastUpdatedMillis(\n *         lastUpdatedMillis: number | FieldValue\n *     ): Timestamp | FieldValue {\n *         if (typeof lastUpdatedMillis !== 'number') {\n *             // `lastUpdatedMillis` must be a FieldValue, so just return it.\n *             return lastUpdatedMillis;\n *         }\n *         return Timestamp.fromMillis(lastUpdatedMillis);\n *     }\n * }\n *\n * async function advancedDemo(db: Firestore): Promise<void> {\n *     // Create a `DocumentReference` with a `FirestoreDataConverter`.\n *     const documentRef = doc(db, 'posts/post123').withConverter(new PostConverter());\n *\n *     // The `data` argument specified to `setDoc()` is type checked by the\n *     // TypeScript compiler to be compatible with `Post`. Since the `data`\n *     // argument is typed as `WithFieldValue<Post>` rather than just `Post`,\n *     // this allows properties of the `data` argument to also be special\n *     // Firestore values that perform server-side mutations, such as\n *     // `arrayRemove()`, `deleteField()`, and `serverTimestamp()`.\n *     await setDoc(documentRef, {\n *         title: 'My Life',\n *         author: 'Foo Bar',\n *         lastUpdatedMillis: serverTimestamp()\n *     });\n *\n *     // The TypeScript compiler will fail to compile if the `data` argument to\n *     // `setDoc()` is _not_ compatible with `WithFieldValue<Post>`. This\n *     // type checking prevents the caller from specifying objects with incorrect\n *     // properties or property values.\n *     // @ts-expect-error \"Argument of type { ttl: string; } is not assignable\n *     // to parameter of type WithFieldValue<Post>\"\n *     await setDoc(documentRef, { ttl: 'The Title' });\n *\n *     // When retrieving a document with `getDoc()` the `DocumentSnapshot`\n *     // object's `data()` method returns a `Post`, rather than a generic object,\n *     // which would have been returned if the `DocumentReference` did _not_ have a\n *     // `FirestoreDataConverter` attached to it.\n *     const snapshot1: DocumentSnapshot<Post> = await getDoc(documentRef);\n *     const post1: Post = snapshot1.data()!;\n *     if (post1) {\n *         assertEqual(post1.title, 'My Life');\n *         assertEqual(post1.author, 'Foo Bar');\n *     }\n *\n *     // The `data` argument specified to `updateDoc()` is type checked by the\n *     // TypeScript compiler to be compatible with `PostDbModel`. Note that\n *     // unlike `setDoc()`, whose `data` argument must be compatible with `Post`,\n *     // the `data` argument to `updateDoc()` must be compatible with\n *     // `PostDbModel`. Similar to `setDoc()`, since the `data` argument is typed\n *     // as `WithFieldValue<PostDbModel>` rather than just `PostDbModel`, this\n *     // allows properties of the `data` argument to also be those special\n *     // Firestore values, like `arrayRemove()`, `deleteField()`, and\n *     // `serverTimestamp()`.\n *     await updateDoc(documentRef, {\n *         'aut.firstName': 'NewFirstName',\n *         lut: serverTimestamp()\n *     });\n *\n *     // The TypeScript compiler will fail to compile if the `data` argument to\n *     // `updateDoc()` is _not_ compatible with `WithFieldValue<PostDbModel>`.\n *     // This type checking prevents the caller from specifying objects with\n *     // incorrect properties or property values.\n *     // @ts-expect-error \"Argument of type { title: string; } is not assignable\n *     // to parameter of type WithFieldValue<PostDbModel>\"\n *     await updateDoc(documentRef, { title: 'New Title' });\n *     const snapshot2: DocumentSnapshot<Post> = await getDoc(documentRef);\n *     const post2: Post = snapshot2.data()!;\n *     if (post2) {\n *         assertEqual(post2.title, 'My Life');\n *         assertEqual(post2.author, 'NewFirstName Bar');\n *     }\n * }\n * ```\n */\nexport interface FirestoreDataConverter<\n  AppModelType,\n  DbModelType extends DocumentData = DocumentData\n> {\n  /**\n   * Called by the Firestore SDK to convert a custom model object of type\n   * `AppModelType` into a plain Javascript object (suitable for writing\n   * directly to the Firestore database) of type `DbModelType`. Used with\n   * {@link @firebase/firestore/lite#(setDoc:1)},\n   * {@link @firebase/firestore/lite#(WriteBatch.set:1)} and\n   * {@link @firebase/firestore/lite#(Transaction.set:1)}.\n   *\n   * The `WithFieldValue<T>` type extends `T` to also allow FieldValues such as\n   * {@link (deleteField:1)} to be used as property values.\n   */\n  toFirestore(\n    modelObject: WithFieldValue<AppModelType>\n  ): WithFieldValue<DbModelType>;\n\n  /**\n   * Called by the Firestore SDK to convert a custom model object of type\n   * `AppModelType` into a plain Javascript object (suitable for writing\n   * directly to the Firestore database) of type `DbModelType`. Used with\n   * {@link @firebase/firestore/lite#(setDoc:1)},\n   * {@link @firebase/firestore/lite#(WriteBatch.set:1)} and\n   * {@link @firebase/firestore/lite#(Transaction.set:1)} with `merge:true`\n   * or `mergeFields`.\n   *\n   * The `PartialWithFieldValue<T>` type extends `Partial<T>` to allow\n   * FieldValues such as {@link (arrayUnion:1)} to be used as property values.\n   * It also supports nested `Partial` by allowing nested fields to be\n   * omitted.\n   */\n  toFirestore(\n    modelObject: PartialWithFieldValue<AppModelType>,\n    options: SetOptions\n  ): PartialWithFieldValue<DbModelType>;\n\n  /**\n   * Called by the Firestore SDK to convert Firestore data into an object of\n   * type `AppModelType`. You can access your data by calling:\n   * `snapshot.data()`.\n   *\n   *\n   * Generally, the data returned from `snapshot.data()` can be cast to\n   * `DbModelType`; however, this is not guaranteed because Firestore does not\n   * enforce a schema on the database. For example, writes from a previous\n   * version of the application or writes from another client that did not use a\n   * type converter could have written data with different properties and/or\n   * property types. The implementation will need to choose whether to\n   * gracefully recover from non-conforming data or throw an error.\n   *\n   * @param snapshot - A `QueryDocumentSnapshot` containing your data and\n   * metadata.\n   */\n  fromFirestore(\n    snapshot: QueryDocumentSnapshot<DocumentData, DocumentData>\n  ): AppModelType;\n}\n\n/**\n * A `DocumentSnapshot` contains data read from a document in your Firestore\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\n * get a specific field.\n *\n * For a `DocumentSnapshot` that points to a non-existing document, any data\n * access will return 'undefined'. You can use the `exists()` method to\n * explicitly verify a document's existence.\n */\nexport class DocumentSnapshot<\n  AppModelType = DocumentData,\n  DbModelType extends DocumentData = DocumentData\n> {\n  // Note: This class is stripped down version of the DocumentSnapshot in\n  // the legacy SDK. The changes are:\n  // - No support for SnapshotMetadata.\n  // - No support for SnapshotOptions.\n\n  /** @hideconstructor protected */\n  constructor(\n    public _firestore: Firestore,\n    public _userDataWriter: AbstractUserDataWriter,\n    public _key: DocumentKey,\n    public _document: Document | null,\n    public _converter: UntypedFirestoreDataConverter<\n      AppModelType,\n      DbModelType\n    > | null\n  ) {}\n\n  /** Property of the `DocumentSnapshot` that provides the document's ID. */\n  get id(): string {\n    return this._key.path.lastSegment();\n  }\n\n  /**\n   * The `DocumentReference` for the document included in the `DocumentSnapshot`.\n   */\n  get ref(): DocumentReference<AppModelType, DbModelType> {\n    return new DocumentReference<AppModelType, DbModelType>(\n      this._firestore,\n      this._converter,\n      this._key\n    );\n  }\n\n  /**\n   * Signals whether or not the document at the snapshot's location exists.\n   *\n   * @returns true if the document exists.\n   */\n  exists(): this is QueryDocumentSnapshot<AppModelType, DbModelType> {\n    return this._document !== null;\n  }\n\n  /**\n   * Retrieves all fields in the document as an `Object`. Returns `undefined` if\n   * the document doesn't exist.\n   *\n   * @returns An `Object` containing all fields in the document or `undefined`\n   * if the document doesn't exist.\n   */\n  data(): AppModelType | undefined {\n    if (!this._document) {\n      return undefined;\n    } else if (this._converter) {\n      // We only want to use the converter and create a new DocumentSnapshot\n      // if a converter has been provided.\n      const snapshot = new QueryDocumentSnapshot(\n        this._firestore,\n        this._userDataWriter,\n        this._key,\n        this._document,\n        /* converter= */ null\n      );\n      return this._converter.fromFirestore(snapshot);\n    } else {\n      return this._userDataWriter.convertValue(\n        this._document.data.value\n      ) as AppModelType;\n    }\n  }\n\n  /**\n   * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\n   * document or field doesn't exist.\n   *\n   * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\n   * field.\n   * @returns The data at the specified field location or undefined if no such\n   * field exists in the document.\n   */\n  // We are using `any` here to avoid an explicit cast by our users.\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  get(fieldPath: string | FieldPath): any {\n    if (this._document) {\n      const value = this._document.data.field(\n        fieldPathFromArgument('DocumentSnapshot.get', fieldPath)\n      );\n      if (value !== null) {\n        return this._userDataWriter.convertValue(value);\n      }\n    }\n    return undefined;\n  }\n}\n\n/**\n * A `QueryDocumentSnapshot` contains data read from a document in your\n * Firestore database as part of a query. The document is guaranteed to exist\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\n * specific field.\n *\n * A `QueryDocumentSnapshot` offers the same API surface as a\n * `DocumentSnapshot`. Since query results contain only existing documents, the\n * `exists` property will always be true and `data()` will never return\n * 'undefined'.\n */\nexport class QueryDocumentSnapshot<\n  AppModelType = DocumentData,\n  DbModelType extends DocumentData = DocumentData\n> extends DocumentSnapshot<AppModelType, DbModelType> {\n  /**\n   * Retrieves all fields in the document as an `Object`.\n   *\n   * @override\n   * @returns An `Object` containing all fields in the document.\n   */\n  data(): AppModelType {\n    return super.data() as AppModelType;\n  }\n}\n\n/**\n * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects\n * representing the results of a query. The documents can be accessed as an\n * array via the `docs` property or enumerated using the `forEach` method. The\n * number of documents can be determined via the `empty` and `size`\n * properties.\n */\nexport class QuerySnapshot<\n  AppModelType = DocumentData,\n  DbModelType extends DocumentData = DocumentData\n> {\n  /**\n   * The query on which you called {@link getDocs} in order to get this\n   * `QuerySnapshot`.\n   */\n  readonly query: Query<AppModelType, DbModelType>;\n\n  /** @hideconstructor */\n  constructor(\n    _query: Query<AppModelType, DbModelType>,\n    readonly _docs: Array<QueryDocumentSnapshot<AppModelType, DbModelType>>\n  ) {\n    this.query = _query;\n  }\n\n  /** An array of all the documents in the `QuerySnapshot`. */\n  get docs(): Array<QueryDocumentSnapshot<AppModelType, DbModelType>> {\n    return [...this._docs];\n  }\n\n  /** The number of documents in the `QuerySnapshot`. */\n  get size(): number {\n    return this.docs.length;\n  }\n\n  /** True if there are no documents in the `QuerySnapshot`. */\n  get empty(): boolean {\n    return this.docs.length === 0;\n  }\n\n  /**\n   * Enumerates all of the documents in the `QuerySnapshot`.\n   *\n   * @param callback - A callback to be called with a `QueryDocumentSnapshot` for\n   * each document in the snapshot.\n   * @param thisArg - The `this` binding for the callback.\n   */\n  forEach(\n    callback: (\n      result: QueryDocumentSnapshot<AppModelType, DbModelType>\n    ) => void,\n    thisArg?: unknown\n  ): void {\n    this._docs.forEach(callback, thisArg);\n  }\n}\n\n/**\n * Returns true if the provided snapshots are equal.\n *\n * @param left - A snapshot to compare.\n * @param right - A snapshot to compare.\n * @returns true if the snapshots are equal.\n */\nexport function snapshotEqual<AppModelType, DbModelType extends DocumentData>(\n  left:\n    | DocumentSnapshot<AppModelType, DbModelType>\n    | QuerySnapshot<AppModelType, DbModelType>,\n  right:\n    | DocumentSnapshot<AppModelType, DbModelType>\n    | QuerySnapshot<AppModelType, DbModelType>\n): boolean {\n  left = getModularInstance(left);\n  right = getModularInstance(right);\n\n  if (left instanceof DocumentSnapshot && right instanceof DocumentSnapshot) {\n    return (\n      left._firestore === right._firestore &&\n      left._key.isEqual(right._key) &&\n      (left._document === null\n        ? right._document === null\n        : left._document.isEqual(right._document)) &&\n      left._converter === right._converter\n    );\n  } else if (left instanceof QuerySnapshot && right instanceof QuerySnapshot) {\n    return (\n      queryEqual(left.query, right.query) &&\n      arrayEquals(left.docs, right.docs, snapshotEqual)\n    );\n  }\n\n  return false;\n}\n\n/**\n * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.\n */\nexport function fieldPathFromArgument(\n  methodName: string,\n  arg: string | FieldPath | Compat<FieldPath>\n): InternalFieldPath {\n  if (typeof arg === 'string') {\n    return fieldPathFromDotSeparatedString(methodName, arg);\n  } else if (arg instanceof FieldPath) {\n    return arg._internalPath;\n  } else {\n    return arg._delegate._internalPath;\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getModularInstance } from '@firebase/util';\n\nimport { Bound } from '../core/bound';\nimport { DatabaseId } from '../core/database_info';\nimport {\n  CompositeFilter,\n  CompositeOperator,\n  FieldFilter,\n  Filter,\n  Operator\n} from '../core/filter';\nimport { Direction, OrderBy } from '../core/order_by';\nimport {\n  isCollectionGroupQuery,\n  LimitType,\n  Query as InternalQuery,\n  queryNormalizedOrderBy,\n  queryWithAddedFilter,\n  queryWithAddedOrderBy,\n  queryWithEndAt,\n  queryWithLimit,\n  queryWithStartAt\n} from '../core/query';\nimport { Document } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport { FieldPath as InternalFieldPath, ResourcePath } from '../model/path';\nimport { isServerTimestamp } from '../model/server_timestamps';\nimport { refValue } from '../model/values';\nimport { Value as ProtoValue } from '../protos/firestore_proto_api';\nimport { Code, FirestoreError } from '../util/error';\nimport {\n  validatePositiveNumber,\n  valueDescription\n} from '../util/input_validation';\n\nimport { FieldPath } from './field_path';\nimport { DocumentData, DocumentReference, Query } from './reference';\nimport { DocumentSnapshot, fieldPathFromArgument } from './snapshot';\nimport {\n  newUserDataReader,\n  parseQueryValue,\n  UserDataReader\n} from './user_data_reader';\n\nexport function validateHasExplicitOrderByForLimitToLast(\n  query: InternalQuery\n): void {\n  if (\n    query.limitType === LimitType.Last &&\n    query.explicitOrderBy.length === 0\n  ) {\n    throw new FirestoreError(\n      Code.UNIMPLEMENTED,\n      'limitToLast() queries require specifying at least one orderBy() clause'\n    );\n  }\n}\n\n/** Describes the different query constraints available in this SDK. */\nexport type QueryConstraintType =\n  | 'where'\n  | 'orderBy'\n  | 'limit'\n  | 'limitToLast'\n  | 'startAt'\n  | 'startAfter'\n  | 'endAt'\n  | 'endBefore';\n\n/**\n * An `AppliableConstraint` is an abstraction of a constraint that can be applied\n * to a Firestore query.\n */\nexport abstract class AppliableConstraint {\n  /**\n   * Takes the provided {@link Query} and returns a copy of the {@link Query} with this\n   * {@link AppliableConstraint} applied.\n   */\n  abstract _apply<AppModelType, DbModelType extends DocumentData>(\n    query: Query<AppModelType, DbModelType>\n  ): Query<AppModelType, DbModelType>;\n}\n\n/**\n * A `QueryConstraint` is used to narrow the set of documents returned by a\n * Firestore query. `QueryConstraint`s are created by invoking {@link where},\n * {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link\n * (endBefore:1)}, {@link (endAt:1)}, {@link limit}, {@link limitToLast} and\n * can then be passed to {@link (query:1)} to create a new query instance that\n * also contains this `QueryConstraint`.\n */\nexport abstract class QueryConstraint extends AppliableConstraint {\n  /** The type of this query constraint */\n  abstract readonly type: QueryConstraintType;\n\n  /**\n   * Takes the provided {@link Query} and returns a copy of the {@link Query} with this\n   * {@link AppliableConstraint} applied.\n   */\n  abstract _apply<AppModelType, DbModelType extends DocumentData>(\n    query: Query<AppModelType, DbModelType>\n  ): Query<AppModelType, DbModelType>;\n}\n\n/**\n * Creates a new immutable instance of {@link Query} that is extended to also\n * include additional query constraints.\n *\n * @param query - The {@link Query} instance to use as a base for the new\n * constraints.\n * @param compositeFilter - The {@link QueryCompositeFilterConstraint} to\n * apply. Create {@link QueryCompositeFilterConstraint} using {@link and} or\n * {@link or}.\n * @param queryConstraints - Additional {@link QueryNonFilterConstraint}s to\n * apply (e.g. {@link orderBy}, {@link limit}).\n * @throws if any of the provided query constraints cannot be combined with the\n * existing or new constraints.\n */\nexport function query<AppModelType, DbModelType extends DocumentData>(\n  query: Query<AppModelType, DbModelType>,\n  compositeFilter: QueryCompositeFilterConstraint,\n  ...queryConstraints: QueryNonFilterConstraint[]\n): Query<AppModelType, DbModelType>;\n\n/**\n * Creates a new immutable instance of {@link Query} that is extended to also\n * include additional query constraints.\n *\n * @param query - The {@link Query} instance to use as a base for the new\n * constraints.\n * @param queryConstraints - The list of {@link QueryConstraint}s to apply.\n * @throws if any of the provided query constraints cannot be combined with the\n * existing or new constraints.\n */\nexport function query<AppModelType, DbModelType extends DocumentData>(\n  query: Query<AppModelType, DbModelType>,\n  ...queryConstraints: QueryConstraint[]\n): Query<AppModelType, DbModelType>;\n\nexport function query<AppModelType, DbModelType extends DocumentData>(\n  query: Query<AppModelType, DbModelType>,\n  queryConstraint: QueryCompositeFilterConstraint | QueryConstraint | undefined,\n  ...additionalQueryConstraints: Array<\n    QueryConstraint | QueryNonFilterConstraint\n  >\n): Query<AppModelType, DbModelType> {\n  let queryConstraints: AppliableConstraint[] = [];\n\n  if (queryConstraint instanceof AppliableConstraint) {\n    queryConstraints.push(queryConstraint);\n  }\n\n  queryConstraints = queryConstraints.concat(additionalQueryConstraints);\n\n  validateQueryConstraintArray(queryConstraints);\n\n  for (const constraint of queryConstraints) {\n    query = constraint._apply(query);\n  }\n  return query;\n}\n\n/**\n * A `QueryFieldFilterConstraint` is used to narrow the set of documents returned by\n * a Firestore query by filtering on one or more document fields.\n * `QueryFieldFilterConstraint`s are created by invoking {@link where} and can then\n * be passed to {@link (query:1)} to create a new query instance that also contains\n * this `QueryFieldFilterConstraint`.\n */\nexport class QueryFieldFilterConstraint extends QueryConstraint {\n  /** The type of this query constraint */\n  readonly type = 'where';\n\n  /**\n   * @internal\n   */\n  protected constructor(\n    private readonly _field: InternalFieldPath,\n    private _op: Operator,\n    private _value: unknown\n  ) {\n    super();\n  }\n\n  static _create(\n    _field: InternalFieldPath,\n    _op: Operator,\n    _value: unknown\n  ): QueryFieldFilterConstraint {\n    return new QueryFieldFilterConstraint(_field, _op, _value);\n  }\n\n  _apply<AppModelType, DbModelType extends DocumentData>(\n    query: Query<AppModelType, DbModelType>\n  ): Query<AppModelType, DbModelType> {\n    const filter = this._parse(query);\n    validateNewFieldFilter(query._query, filter);\n    return new Query(\n      query.firestore,\n      query.converter,\n      queryWithAddedFilter(query._query, filter)\n    );\n  }\n\n  _parse<AppModelType, DbModelType extends DocumentData>(\n    query: Query<AppModelType, DbModelType>\n  ): FieldFilter {\n    const reader = newUserDataReader(query.firestore);\n    const filter = newQueryFilter(\n      query._query,\n      'where',\n      reader,\n      query.firestore._databaseId,\n      this._field,\n      this._op,\n      this._value\n    );\n    return filter;\n  }\n}\n\n/**\n * Filter conditions in a {@link where} clause are specified using the\n * strings '&lt;', '&lt;=', '==', '!=', '&gt;=', '&gt;', 'array-contains', 'in',\n * 'array-contains-any', and 'not-in'.\n */\nexport type WhereFilterOp =\n  | '<'\n  | '<='\n  | '=='\n  | '!='\n  | '>='\n  | '>'\n  | 'array-contains'\n  | 'in'\n  | 'array-contains-any'\n  | 'not-in';\n\n/**\n * Creates a {@link QueryFieldFilterConstraint} that enforces that documents\n * must contain the specified field and that the value should satisfy the\n * relation constraint provided.\n *\n * @param fieldPath - The path to compare\n * @param opStr - The operation string (e.g \"&lt;\", \"&lt;=\", \"==\", \"&lt;\",\n *   \"&lt;=\", \"!=\").\n * @param value - The value for comparison\n * @returns The created {@link QueryFieldFilterConstraint}.\n */\nexport function where(\n  fieldPath: string | FieldPath,\n  opStr: WhereFilterOp,\n  value: unknown\n): QueryFieldFilterConstraint {\n  const op = opStr as Operator;\n  const field = fieldPathFromArgument('where', fieldPath);\n  return QueryFieldFilterConstraint._create(field, op, value);\n}\n\n/**\n * A `QueryCompositeFilterConstraint` is used to narrow the set of documents\n * returned by a Firestore query by performing the logical OR or AND of multiple\n * {@link QueryFieldFilterConstraint}s or {@link QueryCompositeFilterConstraint}s.\n * `QueryCompositeFilterConstraint`s are created by invoking {@link or} or\n * {@link and} and can then be passed to {@link (query:1)} to create a new query\n * instance that also contains the `QueryCompositeFilterConstraint`.\n */\nexport class QueryCompositeFilterConstraint extends AppliableConstraint {\n  /**\n   * @internal\n   */\n  protected constructor(\n    /** The type of this query constraint */\n    readonly type: 'or' | 'and',\n    private readonly _queryConstraints: QueryFilterConstraint[]\n  ) {\n    super();\n  }\n\n  static _create(\n    type: 'or' | 'and',\n    _queryConstraints: QueryFilterConstraint[]\n  ): QueryCompositeFilterConstraint {\n    return new QueryCompositeFilterConstraint(type, _queryConstraints);\n  }\n\n  _parse<AppModelType, DbModelType extends DocumentData>(\n    query: Query<AppModelType, DbModelType>\n  ): Filter {\n    const parsedFilters = this._queryConstraints\n      .map(queryConstraint => {\n        return queryConstraint._parse(query);\n      })\n      .filter(parsedFilter => parsedFilter.getFilters().length > 0);\n\n    if (parsedFilters.length === 1) {\n      return parsedFilters[0];\n    }\n\n    return CompositeFilter.create(parsedFilters, this._getOperator());\n  }\n\n  _apply<AppModelType, DbModelType extends DocumentData>(\n    query: Query<AppModelType, DbModelType>\n  ): Query<AppModelType, DbModelType> {\n    const parsedFilter = this._parse(query);\n    if (parsedFilter.getFilters().length === 0) {\n      // Return the existing query if not adding any more filters (e.g. an empty\n      // composite filter).\n      return query;\n    }\n    validateNewFilter(query._query, parsedFilter);\n\n    return new Query(\n      query.firestore,\n      query.converter,\n      queryWithAddedFilter(query._query, parsedFilter)\n    );\n  }\n\n  _getQueryConstraints(): readonly AppliableConstraint[] {\n    return this._queryConstraints;\n  }\n\n  _getOperator(): CompositeOperator {\n    return this.type === 'and' ? CompositeOperator.AND : CompositeOperator.OR;\n  }\n}\n\n/**\n * `QueryNonFilterConstraint` is a helper union type that represents\n * QueryConstraints which are used to narrow or order the set of documents,\n * but that do not explicitly filter on a document field.\n * `QueryNonFilterConstraint`s are created by invoking {@link orderBy},\n * {@link (startAt:1)}, {@link (startAfter:1)}, {@link (endBefore:1)}, {@link (endAt:1)},\n * {@link limit} or {@link limitToLast} and can then be passed to {@link (query:1)}\n * to create a new query instance that also contains the `QueryConstraint`.\n */\nexport type QueryNonFilterConstraint =\n  | QueryOrderByConstraint\n  | QueryLimitConstraint\n  | QueryStartAtConstraint\n  | QueryEndAtConstraint;\n\n/**\n * `QueryFilterConstraint` is a helper union type that represents\n * {@link QueryFieldFilterConstraint} and {@link QueryCompositeFilterConstraint}.\n */\nexport type QueryFilterConstraint =\n  | QueryFieldFilterConstraint\n  | QueryCompositeFilterConstraint;\n\n/**\n * Creates a new {@link QueryCompositeFilterConstraint} that is a disjunction of\n * the given filter constraints. A disjunction filter includes a document if it\n * satisfies any of the given filters.\n *\n * @param queryConstraints - Optional. The list of\n * {@link QueryFilterConstraint}s to perform a disjunction for. These must be\n * created with calls to {@link where}, {@link or}, or {@link and}.\n * @returns The newly created {@link QueryCompositeFilterConstraint}.\n */\nexport function or(\n  ...queryConstraints: QueryFilterConstraint[]\n): QueryCompositeFilterConstraint {\n  // Only support QueryFilterConstraints\n  queryConstraints.forEach(queryConstraint =>\n    validateQueryFilterConstraint('or', queryConstraint)\n  );\n\n  return QueryCompositeFilterConstraint._create(\n    CompositeOperator.OR,\n    queryConstraints as QueryFilterConstraint[]\n  );\n}\n\n/**\n * Creates a new {@link QueryCompositeFilterConstraint} that is a conjunction of\n * the given filter constraints. A conjunction filter includes a document if it\n * satisfies all of the given filters.\n *\n * @param queryConstraints - Optional. The list of\n * {@link QueryFilterConstraint}s to perform a conjunction for. These must be\n * created with calls to {@link where}, {@link or}, or {@link and}.\n * @returns The newly created {@link QueryCompositeFilterConstraint}.\n */\nexport function and(\n  ...queryConstraints: QueryFilterConstraint[]\n): QueryCompositeFilterConstraint {\n  // Only support QueryFilterConstraints\n  queryConstraints.forEach(queryConstraint =>\n    validateQueryFilterConstraint('and', queryConstraint)\n  );\n\n  return QueryCompositeFilterConstraint._create(\n    CompositeOperator.AND,\n    queryConstraints as QueryFilterConstraint[]\n  );\n}\n\n/**\n * A `QueryOrderByConstraint` is used to sort the set of documents returned by a\n * Firestore query. `QueryOrderByConstraint`s are created by invoking\n * {@link orderBy} and can then be passed to {@link (query:1)} to create a new query\n * instance that also contains this `QueryOrderByConstraint`.\n *\n * Note: Documents that do not contain the orderBy field will not be present in\n * the query result.\n */\nexport class QueryOrderByConstraint extends QueryConstraint {\n  /** The type of this query constraint */\n  readonly type = 'orderBy';\n\n  /**\n   * @internal\n   */\n  protected constructor(\n    private readonly _field: InternalFieldPath,\n    private _direction: Direction\n  ) {\n    super();\n  }\n\n  static _create(\n    _field: InternalFieldPath,\n    _direction: Direction\n  ): QueryOrderByConstraint {\n    return new QueryOrderByConstraint(_field, _direction);\n  }\n\n  _apply<AppModelType, DbModelType extends DocumentData>(\n    query: Query<AppModelType, DbModelType>\n  ): Query<AppModelType, DbModelType> {\n    const orderBy = newQueryOrderBy(query._query, this._field, this._direction);\n    return new Query(\n      query.firestore,\n      query.converter,\n      queryWithAddedOrderBy(query._query, orderBy)\n    );\n  }\n}\n\n/**\n * The direction of a {@link orderBy} clause is specified as 'desc' or 'asc'\n * (descending or ascending).\n */\nexport type OrderByDirection = 'desc' | 'asc';\n\n/**\n * Creates a {@link QueryOrderByConstraint} that sorts the query result by the\n * specified field, optionally in descending order instead of ascending.\n *\n * Note: Documents that do not contain the specified field will not be present\n * in the query result.\n *\n * @param fieldPath - The field to sort by.\n * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If\n * not specified, order will be ascending.\n * @returns The created {@link QueryOrderByConstraint}.\n */\nexport function orderBy(\n  fieldPath: string | FieldPath,\n  directionStr: OrderByDirection = 'asc'\n): QueryOrderByConstraint {\n  const direction = directionStr as Direction;\n  const path = fieldPathFromArgument('orderBy', fieldPath);\n  return QueryOrderByConstraint._create(path, direction);\n}\n\n/**\n * A `QueryLimitConstraint` is used to limit the number of documents returned by\n * a Firestore query.\n * `QueryLimitConstraint`s are created by invoking {@link limit} or\n * {@link limitToLast} and can then be passed to {@link (query:1)} to create a new\n * query instance that also contains this `QueryLimitConstraint`.\n */\nexport class QueryLimitConstraint extends QueryConstraint {\n  /**\n   * @internal\n   */\n  protected constructor(\n    /** The type of this query constraint */\n    readonly type: 'limit' | 'limitToLast',\n    private readonly _limit: number,\n    private readonly _limitType: LimitType\n  ) {\n    super();\n  }\n\n  static _create(\n    type: 'limit' | 'limitToLast',\n    _limit: number,\n    _limitType: LimitType\n  ): QueryLimitConstraint {\n    return new QueryLimitConstraint(type, _limit, _limitType);\n  }\n\n  _apply<AppModelType, DbModelType extends DocumentData>(\n    query: Query<AppModelType, DbModelType>\n  ): Query<AppModelType, DbModelType> {\n    return new Query(\n      query.firestore,\n      query.converter,\n      queryWithLimit(query._query, this._limit, this._limitType)\n    );\n  }\n}\n\n/**\n * Creates a {@link QueryLimitConstraint} that only returns the first matching\n * documents.\n *\n * @param limit - The maximum number of items to return.\n * @returns The created {@link QueryLimitConstraint}.\n */\nexport function limit(limit: number): QueryLimitConstraint {\n  validatePositiveNumber('limit', limit);\n  return QueryLimitConstraint._create('limit', limit, LimitType.First);\n}\n\n/**\n * Creates a {@link QueryLimitConstraint} that only returns the last matching\n * documents.\n *\n * You must specify at least one `orderBy` clause for `limitToLast` queries,\n * otherwise an exception will be thrown during execution.\n *\n * @param limit - The maximum number of items to return.\n * @returns The created {@link QueryLimitConstraint}.\n */\nexport function limitToLast(limit: number): QueryLimitConstraint {\n  validatePositiveNumber('limitToLast', limit);\n  return QueryLimitConstraint._create('limitToLast', limit, LimitType.Last);\n}\n\n/**\n * A `QueryStartAtConstraint` is used to exclude documents from the start of a\n * result set returned by a Firestore query.\n * `QueryStartAtConstraint`s are created by invoking {@link (startAt:1)} or\n * {@link (startAfter:1)} and can then be passed to {@link (query:1)} to create a\n * new query instance that also contains this `QueryStartAtConstraint`.\n */\nexport class QueryStartAtConstraint extends QueryConstraint {\n  /**\n   * @internal\n   */\n  protected constructor(\n    /** The type of this query constraint */\n    readonly type: 'startAt' | 'startAfter',\n    private readonly _docOrFields: Array<unknown | DocumentSnapshot<unknown>>,\n    private readonly _inclusive: boolean\n  ) {\n    super();\n  }\n\n  static _create(\n    type: 'startAt' | 'startAfter',\n    _docOrFields: Array<unknown | DocumentSnapshot<unknown>>,\n    _inclusive: boolean\n  ): QueryStartAtConstraint {\n    return new QueryStartAtConstraint(type, _docOrFields, _inclusive);\n  }\n\n  _apply<AppModelType, DbModelType extends DocumentData>(\n    query: Query<AppModelType, DbModelType>\n  ): Query<AppModelType, DbModelType> {\n    const bound = newQueryBoundFromDocOrFields(\n      query,\n      this.type,\n      this._docOrFields,\n      this._inclusive\n    );\n    return new Query<AppModelType, DbModelType>(\n      query.firestore,\n      query.converter,\n      queryWithStartAt(query._query, bound)\n    );\n  }\n}\n\n/**\n * Creates a {@link QueryStartAtConstraint} that modifies the result set to\n * start at the provided document (inclusive). The starting position is relative\n * to the order of the query. The document must contain all of the fields\n * provided in the `orderBy` of this query.\n *\n * @param snapshot - The snapshot of the document to start at.\n * @returns A {@link QueryStartAtConstraint} to pass to `query()`.\n */\nexport function startAt<AppModelType, DbModelType extends DocumentData>(\n  snapshot: DocumentSnapshot<AppModelType, DbModelType>\n): QueryStartAtConstraint;\n/**\n * Creates a {@link QueryStartAtConstraint} that modifies the result set to\n * start at the provided fields relative to the order of the query. The order of\n * the field values must match the order of the order by clauses of the query.\n *\n * @param fieldValues - The field values to start this query at, in order\n * of the query's order by.\n * @returns A {@link QueryStartAtConstraint} to pass to `query()`.\n */\nexport function startAt(...fieldValues: unknown[]): QueryStartAtConstraint;\nexport function startAt<AppModelType, DbModelType extends DocumentData>(\n  ...docOrFields: Array<unknown | DocumentSnapshot<AppModelType, DbModelType>>\n): QueryStartAtConstraint {\n  return QueryStartAtConstraint._create(\n    'startAt',\n    docOrFields,\n    /*inclusive=*/ true\n  );\n}\n\n/**\n * Creates a {@link QueryStartAtConstraint} that modifies the result set to\n * start after the provided document (exclusive). The starting position is\n * relative to the order of the query. The document must contain all of the\n * fields provided in the orderBy of the query.\n *\n * @param snapshot - The snapshot of the document to start after.\n * @returns A {@link QueryStartAtConstraint} to pass to `query()`\n */\nexport function startAfter<AppModelType, DbModelType extends DocumentData>(\n  snapshot: DocumentSnapshot<AppModelType, DbModelType>\n): QueryStartAtConstraint;\n/**\n * Creates a {@link QueryStartAtConstraint} that modifies the result set to\n * start after the provided fields relative to the order of the query. The order\n * of the field values must match the order of the order by clauses of the query.\n *\n * @param fieldValues - The field values to start this query after, in order\n * of the query's order by.\n * @returns A {@link QueryStartAtConstraint} to pass to `query()`\n */\nexport function startAfter(...fieldValues: unknown[]): QueryStartAtConstraint;\nexport function startAfter<AppModelType, DbModelType extends DocumentData>(\n  ...docOrFields: Array<unknown | DocumentSnapshot<AppModelType, DbModelType>>\n): QueryStartAtConstraint {\n  return QueryStartAtConstraint._create(\n    'startAfter',\n    docOrFields,\n    /*inclusive=*/ false\n  );\n}\n\n/**\n * A `QueryEndAtConstraint` is used to exclude documents from the end of a\n * result set returned by a Firestore query.\n * `QueryEndAtConstraint`s are created by invoking {@link (endAt:1)} or\n * {@link (endBefore:1)} and can then be passed to {@link (query:1)} to create a new\n * query instance that also contains this `QueryEndAtConstraint`.\n */\nexport class QueryEndAtConstraint extends QueryConstraint {\n  /**\n   * @internal\n   */\n  protected constructor(\n    /** The type of this query constraint */\n    readonly type: 'endBefore' | 'endAt',\n    private readonly _docOrFields: Array<unknown | DocumentSnapshot<unknown>>,\n    private readonly _inclusive: boolean\n  ) {\n    super();\n  }\n\n  static _create(\n    type: 'endBefore' | 'endAt',\n    _docOrFields: Array<unknown | DocumentSnapshot<unknown>>,\n    _inclusive: boolean\n  ): QueryEndAtConstraint {\n    return new QueryEndAtConstraint(type, _docOrFields, _inclusive);\n  }\n\n  _apply<AppModelType, DbModelType extends DocumentData>(\n    query: Query<AppModelType, DbModelType>\n  ): Query<AppModelType, DbModelType> {\n    const bound = newQueryBoundFromDocOrFields(\n      query,\n      this.type,\n      this._docOrFields,\n      this._inclusive\n    );\n    return new Query(\n      query.firestore,\n      query.converter,\n      queryWithEndAt(query._query, bound)\n    );\n  }\n}\n\n/**\n * Creates a {@link QueryEndAtConstraint} that modifies the result set to end\n * before the provided document (exclusive). The end position is relative to the\n * order of the query. The document must contain all of the fields provided in\n * the orderBy of the query.\n *\n * @param snapshot - The snapshot of the document to end before.\n * @returns A {@link QueryEndAtConstraint} to pass to `query()`\n */\nexport function endBefore<AppModelType, DbModelType extends DocumentData>(\n  snapshot: DocumentSnapshot<AppModelType, DbModelType>\n): QueryEndAtConstraint;\n/**\n * Creates a {@link QueryEndAtConstraint} that modifies the result set to end\n * before the provided fields relative to the order of the query. The order of\n * the field values must match the order of the order by clauses of the query.\n *\n * @param fieldValues - The field values to end this query before, in order\n * of the query's order by.\n * @returns A {@link QueryEndAtConstraint} to pass to `query()`\n */\nexport function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint;\nexport function endBefore<AppModelType, DbModelType extends DocumentData>(\n  ...docOrFields: Array<unknown | DocumentSnapshot<AppModelType, DbModelType>>\n): QueryEndAtConstraint {\n  return QueryEndAtConstraint._create(\n    'endBefore',\n    docOrFields,\n    /*inclusive=*/ false\n  );\n}\n\n/**\n * Creates a {@link QueryEndAtConstraint} that modifies the result set to end at\n * the provided document (inclusive). The end position is relative to the order\n * of the query. The document must contain all of the fields provided in the\n * orderBy of the query.\n *\n * @param snapshot - The snapshot of the document to end at.\n * @returns A {@link QueryEndAtConstraint} to pass to `query()`\n */\nexport function endAt<AppModelType, DbModelType extends DocumentData>(\n  snapshot: DocumentSnapshot<AppModelType, DbModelType>\n): QueryEndAtConstraint;\n/**\n * Creates a {@link QueryEndAtConstraint} that modifies the result set to end at\n * the provided fields relative to the order of the query. The order of the field\n * values must match the order of the order by clauses of the query.\n *\n * @param fieldValues - The field values to end this query at, in order\n * of the query's order by.\n * @returns A {@link QueryEndAtConstraint} to pass to `query()`\n */\nexport function endAt(...fieldValues: unknown[]): QueryEndAtConstraint;\nexport function endAt<AppModelType, DbModelType extends DocumentData>(\n  ...docOrFields: Array<unknown | DocumentSnapshot<AppModelType, DbModelType>>\n): QueryEndAtConstraint {\n  return QueryEndAtConstraint._create(\n    'endAt',\n    docOrFields,\n    /*inclusive=*/ true\n  );\n}\n\n/** Helper function to create a bound from a document or fields */\nfunction newQueryBoundFromDocOrFields<\n  AppModelType,\n  DbModelType extends DocumentData\n>(\n  query: Query<AppModelType, DbModelType>,\n  methodName: string,\n  docOrFields: Array<unknown | DocumentSnapshot<AppModelType, DbModelType>>,\n  inclusive: boolean\n): Bound {\n  docOrFields[0] = getModularInstance(docOrFields[0]);\n\n  if (docOrFields[0] instanceof DocumentSnapshot) {\n    return newQueryBoundFromDocument(\n      query._query,\n      query.firestore._databaseId,\n      methodName,\n      docOrFields[0]._document,\n      inclusive\n    );\n  } else {\n    const reader = newUserDataReader(query.firestore);\n    return newQueryBoundFromFields(\n      query._query,\n      query.firestore._databaseId,\n      reader,\n      methodName,\n      docOrFields,\n      inclusive\n    );\n  }\n}\n\nexport function newQueryFilter(\n  query: InternalQuery,\n  methodName: string,\n  dataReader: UserDataReader,\n  databaseId: DatabaseId,\n  fieldPath: InternalFieldPath,\n  op: Operator,\n  value: unknown\n): FieldFilter {\n  let fieldValue: ProtoValue;\n  if (fieldPath.isKeyField()) {\n    if (op === Operator.ARRAY_CONTAINS || op === Operator.ARRAY_CONTAINS_ANY) {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        `Invalid Query. You can't perform '${op}' queries on documentId().`\n      );\n    } else if (op === Operator.IN || op === Operator.NOT_IN) {\n      validateDisjunctiveFilterElements(value, op);\n      const referenceList: ProtoValue[] = [];\n      for (const arrayValue of value as ProtoValue[]) {\n        referenceList.push(parseDocumentIdValue(databaseId, query, arrayValue));\n      }\n      fieldValue = { arrayValue: { values: referenceList } };\n    } else {\n      fieldValue = parseDocumentIdValue(databaseId, query, value);\n    }\n  } else {\n    if (\n      op === Operator.IN ||\n      op === Operator.NOT_IN ||\n      op === Operator.ARRAY_CONTAINS_ANY\n    ) {\n      validateDisjunctiveFilterElements(value, op);\n    }\n    fieldValue = parseQueryValue(\n      dataReader,\n      methodName,\n      value,\n      /* allowArrays= */ op === Operator.IN || op === Operator.NOT_IN\n    );\n  }\n  const filter = FieldFilter.create(fieldPath, op, fieldValue);\n  return filter;\n}\n\nexport function newQueryOrderBy(\n  query: InternalQuery,\n  fieldPath: InternalFieldPath,\n  direction: Direction\n): OrderBy {\n  if (query.startAt !== null) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      'Invalid query. You must not call startAt() or startAfter() before ' +\n        'calling orderBy().'\n    );\n  }\n  if (query.endAt !== null) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      'Invalid query. You must not call endAt() or endBefore() before ' +\n        'calling orderBy().'\n    );\n  }\n  const orderBy = new OrderBy(fieldPath, direction);\n  return orderBy;\n}\n\n/**\n * Create a `Bound` from a query and a document.\n *\n * Note that the `Bound` will always include the key of the document\n * and so only the provided document will compare equal to the returned\n * position.\n *\n * Will throw if the document does not contain all fields of the order by\n * of the query or if any of the fields in the order by are an uncommitted\n * server timestamp.\n */\nexport function newQueryBoundFromDocument(\n  query: InternalQuery,\n  databaseId: DatabaseId,\n  methodName: string,\n  doc: Document | null,\n  inclusive: boolean\n): Bound {\n  if (!doc) {\n    throw new FirestoreError(\n      Code.NOT_FOUND,\n      `Can't use a DocumentSnapshot that doesn't exist for ` +\n        `${methodName}().`\n    );\n  }\n\n  const components: ProtoValue[] = [];\n\n  // Because people expect to continue/end a query at the exact document\n  // provided, we need to use the implicit sort order rather than the explicit\n  // sort order, because it's guaranteed to contain the document key. That way\n  // the position becomes unambiguous and the query continues/ends exactly at\n  // the provided document. Without the key (by using the explicit sort\n  // orders), multiple documents could match the position, yielding duplicate\n  // results.\n  for (const orderBy of queryNormalizedOrderBy(query)) {\n    if (orderBy.field.isKeyField()) {\n      components.push(refValue(databaseId, doc.key));\n    } else {\n      const value = doc.data.field(orderBy.field);\n      if (isServerTimestamp(value)) {\n        throw new FirestoreError(\n          Code.INVALID_ARGUMENT,\n          'Invalid query. You are trying to start or end a query using a ' +\n            'document for which the field \"' +\n            orderBy.field +\n            '\" is an uncommitted server timestamp. (Since the value of ' +\n            'this field is unknown, you cannot start/end a query with it.)'\n        );\n      } else if (value !== null) {\n        components.push(value);\n      } else {\n        const field = orderBy.field.canonicalString();\n        throw new FirestoreError(\n          Code.INVALID_ARGUMENT,\n          `Invalid query. You are trying to start or end a query using a ` +\n            `document for which the field '${field}' (used as the ` +\n            `orderBy) does not exist.`\n        );\n      }\n    }\n  }\n  return new Bound(components, inclusive);\n}\n\n/**\n * Converts a list of field values to a `Bound` for the given query.\n */\nexport function newQueryBoundFromFields(\n  query: InternalQuery,\n  databaseId: DatabaseId,\n  dataReader: UserDataReader,\n  methodName: string,\n  values: unknown[],\n  inclusive: boolean\n): Bound {\n  // Use explicit order by's because it has to match the query the user made\n  const orderBy = query.explicitOrderBy;\n  if (values.length > orderBy.length) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      `Too many arguments provided to ${methodName}(). ` +\n        `The number of arguments must be less than or equal to the ` +\n        `number of orderBy() clauses`\n    );\n  }\n\n  const components: ProtoValue[] = [];\n  for (let i = 0; i < values.length; i++) {\n    const rawValue = values[i];\n    const orderByComponent = orderBy[i];\n    if (orderByComponent.field.isKeyField()) {\n      if (typeof rawValue !== 'string') {\n        throw new FirestoreError(\n          Code.INVALID_ARGUMENT,\n          `Invalid query. Expected a string for document ID in ` +\n            `${methodName}(), but got a ${typeof rawValue}`\n        );\n      }\n      if (!isCollectionGroupQuery(query) && rawValue.indexOf('/') !== -1) {\n        throw new FirestoreError(\n          Code.INVALID_ARGUMENT,\n          `Invalid query. When querying a collection and ordering by documentId(), ` +\n            `the value passed to ${methodName}() must be a plain document ID, but ` +\n            `'${rawValue}' contains a slash.`\n        );\n      }\n      const path = query.path.child(ResourcePath.fromString(rawValue));\n      if (!DocumentKey.isDocumentKey(path)) {\n        throw new FirestoreError(\n          Code.INVALID_ARGUMENT,\n          `Invalid query. When querying a collection group and ordering by ` +\n            `documentId(), the value passed to ${methodName}() must result in a ` +\n            `valid document path, but '${path}' is not because it contains an odd number ` +\n            `of segments.`\n        );\n      }\n      const key = new DocumentKey(path);\n      components.push(refValue(databaseId, key));\n    } else {\n      const wrapped = parseQueryValue(dataReader, methodName, rawValue);\n      components.push(wrapped);\n    }\n  }\n\n  return new Bound(components, inclusive);\n}\n\n/**\n * Parses the given `documentIdValue` into a `ReferenceValue`, throwing\n * appropriate errors if the value is anything other than a `DocumentReference`\n * or `string`, or if the string is malformed.\n */\nfunction parseDocumentIdValue(\n  databaseId: DatabaseId,\n  query: InternalQuery,\n  documentIdValue: unknown\n): ProtoValue {\n  documentIdValue = getModularInstance(documentIdValue);\n\n  if (typeof documentIdValue === 'string') {\n    if (documentIdValue === '') {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        'Invalid query. When querying with documentId(), you ' +\n          'must provide a valid document ID, but it was an empty string.'\n      );\n    }\n    if (!isCollectionGroupQuery(query) && documentIdValue.indexOf('/') !== -1) {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        `Invalid query. When querying a collection by ` +\n          `documentId(), you must provide a plain document ID, but ` +\n          `'${documentIdValue}' contains a '/' character.`\n      );\n    }\n    const path = query.path.child(ResourcePath.fromString(documentIdValue));\n    if (!DocumentKey.isDocumentKey(path)) {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        `Invalid query. When querying a collection group by ` +\n          `documentId(), the value provided must result in a valid document path, ` +\n          `but '${path}' is not because it has an odd number of segments (${path.length}).`\n      );\n    }\n    return refValue(databaseId, new DocumentKey(path));\n  } else if (documentIdValue instanceof DocumentReference) {\n    return refValue(databaseId, documentIdValue._key);\n  } else {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      `Invalid query. When querying with documentId(), you must provide a valid ` +\n        `string or a DocumentReference, but it was: ` +\n        `${valueDescription(documentIdValue)}.`\n    );\n  }\n}\n\n/**\n * Validates that the value passed into a disjunctive filter satisfies all\n * array requirements.\n */\nfunction validateDisjunctiveFilterElements(\n  value: unknown,\n  operator: Operator\n): void {\n  if (!Array.isArray(value) || value.length === 0) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      'Invalid Query. A non-empty array is required for ' +\n        `'${operator.toString()}' filters.`\n    );\n  }\n}\n\n/**\n * Given an operator, returns the set of operators that cannot be used with it.\n *\n * This is not a comprehensive check, and this function should be removed in the\n * long term. Validations should occur in the Firestore backend.\n *\n * Operators in a query must adhere to the following set of rules:\n * 1. Only one inequality per query.\n * 2. `NOT_IN` cannot be used with array, disjunctive, or `NOT_EQUAL` operators.\n */\nfunction conflictingOps(op: Operator): Operator[] {\n  switch (op) {\n    case Operator.NOT_EQUAL:\n      return [Operator.NOT_EQUAL, Operator.NOT_IN];\n    case Operator.ARRAY_CONTAINS_ANY:\n    case Operator.IN:\n      return [Operator.NOT_IN];\n    case Operator.NOT_IN:\n      return [\n        Operator.ARRAY_CONTAINS_ANY,\n        Operator.IN,\n        Operator.NOT_IN,\n        Operator.NOT_EQUAL\n      ];\n    default:\n      return [];\n  }\n}\n\nfunction validateNewFieldFilter(\n  query: InternalQuery,\n  fieldFilter: FieldFilter\n): void {\n  const conflictingOp = findOpInsideFilters(\n    query.filters,\n    conflictingOps(fieldFilter.op)\n  );\n  if (conflictingOp !== null) {\n    // Special case when it's a duplicate op to give a slightly clearer error message.\n    if (conflictingOp === fieldFilter.op) {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        'Invalid query. You cannot use more than one ' +\n          `'${fieldFilter.op.toString()}' filter.`\n      );\n    } else {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        `Invalid query. You cannot use '${fieldFilter.op.toString()}' filters ` +\n          `with '${conflictingOp.toString()}' filters.`\n      );\n    }\n  }\n}\n\nfunction validateNewFilter(query: InternalQuery, filter: Filter): void {\n  let testQuery = query;\n  const subFilters = filter.getFlattenedFilters();\n  for (const subFilter of subFilters) {\n    validateNewFieldFilter(testQuery, subFilter);\n    testQuery = queryWithAddedFilter(testQuery, subFilter);\n  }\n}\n\n// Checks if any of the provided filter operators are included in the given list of filters and\n// returns the first one that is, or null if none are.\nfunction findOpInsideFilters(\n  filters: Filter[],\n  operators: Operator[]\n): Operator | null {\n  for (const filter of filters) {\n    for (const fieldFilter of filter.getFlattenedFilters()) {\n      if (operators.indexOf(fieldFilter.op) >= 0) {\n        return fieldFilter.op;\n      }\n    }\n  }\n  return null;\n}\n\nexport function validateQueryFilterConstraint(\n  functionName: string,\n  queryConstraint: AppliableConstraint\n): void {\n  if (\n    !(queryConstraint instanceof QueryFieldFilterConstraint) &&\n    !(queryConstraint instanceof QueryCompositeFilterConstraint)\n  ) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      `Function ${functionName}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`\n    );\n  }\n}\n\nfunction validateQueryConstraintArray(\n  queryConstraint: AppliableConstraint[]\n): void {\n  const compositeFilterCount = queryConstraint.filter(\n    filter => filter instanceof QueryCompositeFilterConstraint\n  ).length;\n  const fieldFilterCount = queryConstraint.filter(\n    filter => filter instanceof QueryFieldFilterConstraint\n  ).length;\n\n  if (\n    compositeFilterCount > 1 ||\n    (compositeFilterCount > 0 && fieldFilterCount > 0)\n  ) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      'InvalidQuery. When using composite filters, you cannot use ' +\n        'more than one filter at the top level. Consider nesting the multiple ' +\n        'filters within an `and(...)` statement. For example: ' +\n        'change `query(query, where(...), or(...))` to ' +\n        '`query(query, and(where(...), or(...)))`.'\n    );\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DocumentData } from '@firebase/firestore-types';\n\nimport { DatabaseId } from '../core/database_info';\nimport { DocumentKey } from '../model/document_key';\nimport {\n  normalizeByteString,\n  normalizeNumber,\n  normalizeTimestamp\n} from '../model/normalize';\nimport { ResourcePath } from '../model/path';\nimport {\n  getLocalWriteTime,\n  getPreviousValue\n} from '../model/server_timestamps';\nimport { TypeOrder } from '../model/type_order';\nimport { typeOrder } from '../model/values';\nimport {\n  ApiClientObjectMap,\n  ArrayValue as ProtoArrayValue,\n  LatLng as ProtoLatLng,\n  MapValue as ProtoMapValue,\n  Timestamp as ProtoTimestamp,\n  Value,\n  Value as ProtoValue\n} from '../protos/firestore_proto_api';\nimport { isValidResourceName } from '../remote/serializer';\nimport { fail, hardAssert } from '../util/assert';\nimport { ByteString } from '../util/byte_string';\nimport { logError } from '../util/log';\nimport { forEach } from '../util/obj';\n\nimport { GeoPoint } from './geo_point';\nimport { Timestamp } from './timestamp';\n\nexport type ServerTimestampBehavior = 'estimate' | 'previous' | 'none';\n\n/**\n * Converts Firestore's internal types to the JavaScript types that we expose\n * to the user.\n *\n * @internal\n */\nexport abstract class AbstractUserDataWriter {\n  convertValue(\n    value: ProtoValue,\n    serverTimestampBehavior: ServerTimestampBehavior = 'none'\n  ): unknown {\n    switch (typeOrder(value)) {\n      case TypeOrder.NullValue:\n        return null;\n      case TypeOrder.BooleanValue:\n        return value.booleanValue!;\n      case TypeOrder.NumberValue:\n        return normalizeNumber(value.integerValue || value.doubleValue);\n      case TypeOrder.TimestampValue:\n        return this.convertTimestamp(value.timestampValue!);\n      case TypeOrder.ServerTimestampValue:\n        return this.convertServerTimestamp(value, serverTimestampBehavior);\n      case TypeOrder.StringValue:\n        return value.stringValue!;\n      case TypeOrder.BlobValue:\n        return this.convertBytes(normalizeByteString(value.bytesValue!));\n      case TypeOrder.RefValue:\n        return this.convertReference(value.referenceValue!);\n      case TypeOrder.GeoPointValue:\n        return this.convertGeoPoint(value.geoPointValue!);\n      case TypeOrder.ArrayValue:\n        return this.convertArray(value.arrayValue!, serverTimestampBehavior);\n      case TypeOrder.ObjectValue:\n        return this.convertObject(value.mapValue!, serverTimestampBehavior);\n      default:\n        throw fail('Invalid value type: ' + JSON.stringify(value));\n    }\n  }\n\n  private convertObject(\n    mapValue: ProtoMapValue,\n    serverTimestampBehavior: ServerTimestampBehavior\n  ): DocumentData {\n    return this.convertObjectMap(mapValue.fields, serverTimestampBehavior);\n  }\n\n  /**\n   * @internal\n   */\n  convertObjectMap(\n    fields: ApiClientObjectMap<Value> | undefined,\n    serverTimestampBehavior: ServerTimestampBehavior = 'none'\n  ): DocumentData {\n    const result: DocumentData = {};\n    forEach(fields, (key, value) => {\n      result[key] = this.convertValue(value, serverTimestampBehavior);\n    });\n    return result;\n  }\n\n  private convertGeoPoint(value: ProtoLatLng): GeoPoint {\n    return new GeoPoint(\n      normalizeNumber(value.latitude),\n      normalizeNumber(value.longitude)\n    );\n  }\n\n  private convertArray(\n    arrayValue: ProtoArrayValue,\n    serverTimestampBehavior: ServerTimestampBehavior\n  ): unknown[] {\n    return (arrayValue.values || []).map(value =>\n      this.convertValue(value, serverTimestampBehavior)\n    );\n  }\n\n  private convertServerTimestamp(\n    value: ProtoValue,\n    serverTimestampBehavior: ServerTimestampBehavior\n  ): unknown {\n    switch (serverTimestampBehavior) {\n      case 'previous':\n        const previousValue = getPreviousValue(value);\n        if (previousValue == null) {\n          return null;\n        }\n        return this.convertValue(previousValue, serverTimestampBehavior);\n      case 'estimate':\n        return this.convertTimestamp(getLocalWriteTime(value));\n      default:\n        return null;\n    }\n  }\n\n  private convertTimestamp(value: ProtoTimestamp): Timestamp {\n    const normalizedValue = normalizeTimestamp(value);\n    return new Timestamp(normalizedValue.seconds, normalizedValue.nanos);\n  }\n\n  protected convertDocumentKey(\n    name: string,\n    expectedDatabaseId: DatabaseId\n  ): DocumentKey {\n    const resourcePath = ResourcePath.fromString(name);\n    hardAssert(\n      isValidResourceName(resourcePath),\n      'ReferenceValue is not valid ' + name\n    );\n    const databaseId = new DatabaseId(resourcePath.get(1), resourcePath.get(3));\n    const key = new DocumentKey(resourcePath.popFirst(5));\n\n    if (!databaseId.isEqual(expectedDatabaseId)) {\n      // TODO(b/64130202): Somehow support foreign references.\n      logError(\n        `Document ${key} contains a document ` +\n          `reference within a different database (` +\n          `${databaseId.projectId}/${databaseId.database}) which is not ` +\n          `supported. It will be treated as a reference in the current ` +\n          `database (${expectedDatabaseId.projectId}/${expectedDatabaseId.database}) ` +\n          `instead.`\n      );\n    }\n    return key;\n  }\n\n  protected abstract convertReference(name: string): unknown;\n\n  protected abstract convertBytes(bytes: ByteString): unknown;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  DocumentData as PublicDocumentData,\n  SetOptions as PublicSetOptions\n} from '@firebase/firestore-types';\nimport { getModularInstance } from '@firebase/util';\n\nimport { LimitType } from '../core/query';\nimport { DeleteMutation, Precondition } from '../model/mutation';\nimport {\n  invokeBatchGetDocumentsRpc,\n  invokeCommitRpc,\n  invokeRunQueryRpc\n} from '../remote/datastore';\nimport { hardAssert } from '../util/assert';\nimport { ByteString } from '../util/byte_string';\nimport { cast } from '../util/input_validation';\n\nimport { Bytes } from './bytes';\nimport { getDatastore } from './components';\nimport { Firestore } from './database';\nimport { FieldPath } from './field_path';\nimport { validateHasExplicitOrderByForLimitToLast } from './query';\nimport {\n  CollectionReference,\n  doc,\n  DocumentData,\n  DocumentReference,\n  PartialWithFieldValue,\n  Query,\n  SetOptions,\n  UpdateData,\n  WithFieldValue\n} from './reference';\nimport {\n  DocumentSnapshot,\n  QueryDocumentSnapshot,\n  QuerySnapshot\n} from './snapshot';\nimport {\n  newUserDataReader,\n  ParsedUpdateData,\n  parseSetData,\n  parseUpdateData,\n  parseUpdateVarargs,\n  UntypedFirestoreDataConverter\n} from './user_data_reader';\nimport { AbstractUserDataWriter } from './user_data_writer';\n\n/**\n * Converts custom model object of type T into `DocumentData` by applying the\n * converter if it exists.\n *\n * This function is used when converting user objects to `DocumentData`\n * because we want to provide the user with a more specific error message if\n * their `set()` or fails due to invalid data originating from a `toFirestore()`\n * call.\n */\nexport function applyFirestoreDataConverter<T>(\n  converter: UntypedFirestoreDataConverter<T> | null,\n  value: WithFieldValue<T> | PartialWithFieldValue<T>,\n  options?: PublicSetOptions\n): PublicDocumentData {\n  let convertedValue;\n  if (converter) {\n    if (options && (options.merge || options.mergeFields)) {\n      // Cast to `any` in order to satisfy the union type constraint on\n      // toFirestore().\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      convertedValue = (converter as any).toFirestore(value, options);\n    } else {\n      convertedValue = converter.toFirestore(value as WithFieldValue<T>);\n    }\n  } else {\n    convertedValue = value as PublicDocumentData;\n  }\n  return convertedValue;\n}\n\nexport class LiteUserDataWriter extends AbstractUserDataWriter {\n  constructor(protected firestore: Firestore) {\n    super();\n  }\n\n  protected convertBytes(bytes: ByteString): Bytes {\n    return new Bytes(bytes);\n  }\n\n  protected convertReference(name: string): DocumentReference {\n    const key = this.convertDocumentKey(name, this.firestore._databaseId);\n    return new DocumentReference(this.firestore, /* converter= */ null, key);\n  }\n}\n\n/**\n * Reads the document referred to by the specified document reference.\n *\n * All documents are directly fetched from the server, even if the document was\n * previously read or modified. Recent modifications are only reflected in the\n * retrieved `DocumentSnapshot` if they have already been applied by the\n * backend. If the client is offline, the read fails. If you like to use\n * caching or see local modifications, please use the full Firestore SDK.\n *\n * @param reference - The reference of the document to fetch.\n * @returns A Promise resolved with a `DocumentSnapshot` containing the current\n * document contents.\n */\nexport function getDoc<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>\n): Promise<DocumentSnapshot<AppModelType, DbModelType>> {\n  reference = cast<DocumentReference<AppModelType, DbModelType>>(\n    reference,\n    DocumentReference\n  );\n  const datastore = getDatastore(reference.firestore);\n  const userDataWriter = new LiteUserDataWriter(reference.firestore);\n\n  return invokeBatchGetDocumentsRpc(datastore, [reference._key]).then(\n    result => {\n      hardAssert(result.length === 1, 'Expected a single document result');\n      const document = result[0];\n      return new DocumentSnapshot<AppModelType, DbModelType>(\n        reference.firestore,\n        userDataWriter,\n        reference._key,\n        document.isFoundDocument() ? document : null,\n        reference.converter\n      );\n    }\n  );\n}\n\n/**\n * Executes the query and returns the results as a {@link QuerySnapshot}.\n *\n * All queries are executed directly by the server, even if the the query was\n * previously executed. Recent modifications are only reflected in the retrieved\n * results if they have already been applied by the backend. If the client is\n * offline, the operation fails. To see previously cached result and local\n * modifications, use the full Firestore SDK.\n *\n * @param query - The `Query` to execute.\n * @returns A Promise that will be resolved with the results of the query.\n */\nexport function getDocs<AppModelType, DbModelType extends DocumentData>(\n  query: Query<AppModelType, DbModelType>\n): Promise<QuerySnapshot<AppModelType, DbModelType>> {\n  query = cast<Query<AppModelType, DbModelType>>(query, Query);\n  validateHasExplicitOrderByForLimitToLast(query._query);\n\n  const datastore = getDatastore(query.firestore);\n  const userDataWriter = new LiteUserDataWriter(query.firestore);\n  return invokeRunQueryRpc(datastore, query._query).then(result => {\n    const docs = result.map(\n      doc =>\n        new QueryDocumentSnapshot<AppModelType, DbModelType>(\n          query.firestore,\n          userDataWriter,\n          doc.key,\n          doc,\n          query.converter\n        )\n    );\n\n    if (query._query.limitType === LimitType.Last) {\n      // Limit to last queries reverse the orderBy constraint that was\n      // specified by the user. As such, we need to reverse the order of the\n      // results to return the documents in the expected order.\n      docs.reverse();\n    }\n\n    return new QuerySnapshot<AppModelType, DbModelType>(query, docs);\n  });\n}\n\n/**\n * Writes to the document referred to by the specified `DocumentReference`. If\n * the document does not yet exist, it will be created.\n *\n * The result of this write will only be reflected in document reads that occur\n * after the returned promise resolves. If the client is offline, the\n * write fails. If you would like to see local modifications or buffer writes\n * until the client is online, use the full Firestore SDK.\n *\n * @param reference - A reference to the document to write.\n * @param data - A map of the fields and values for the document.\n * @throws Error - If the provided input is not a valid Firestore document.\n * @returns A `Promise` resolved once the data has been successfully written\n * to the backend.\n */\nexport function setDoc<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>,\n  data: WithFieldValue<AppModelType>\n): Promise<void>;\n/**\n * Writes to the document referred to by the specified `DocumentReference`. If\n * the document does not yet exist, it will be created. If you provide `merge`\n * or `mergeFields`, the provided data can be merged into an existing document.\n *\n * The result of this write will only be reflected in document reads that occur\n * after the returned promise resolves. If the client is offline, the\n * write fails. If you would like to see local modifications or buffer writes\n * until the client is online, use the full Firestore SDK.\n *\n * @param reference - A reference to the document to write.\n * @param data - A map of the fields and values for the document.\n * @param options - An object to configure the set behavior.\n * @throws Error - If the provided input is not a valid Firestore document.\n * @returns A `Promise` resolved once the data has been successfully written\n * to the backend.\n */\nexport function setDoc<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>,\n  data: PartialWithFieldValue<AppModelType>,\n  options: SetOptions\n): Promise<void>;\nexport function setDoc<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>,\n  data: PartialWithFieldValue<AppModelType>,\n  options?: SetOptions\n): Promise<void> {\n  reference = cast<DocumentReference<AppModelType, DbModelType>>(\n    reference,\n    DocumentReference\n  );\n  const convertedValue = applyFirestoreDataConverter(\n    reference.converter,\n    data,\n    options\n  );\n  const dataReader = newUserDataReader(reference.firestore);\n  const parsed = parseSetData(\n    dataReader,\n    'setDoc',\n    reference._key,\n    convertedValue,\n    reference.converter !== null,\n    options\n  );\n\n  const datastore = getDatastore(reference.firestore);\n  return invokeCommitRpc(datastore, [\n    parsed.toMutation(reference._key, Precondition.none())\n  ]);\n}\n\n/**\n * Updates fields in the document referred to by the specified\n * `DocumentReference`. The update will fail if applied to a document that does\n * not exist.\n *\n * The result of this update will only be reflected in document reads that occur\n * after the returned promise resolves. If the client is offline, the\n * update fails. If you would like to see local modifications or buffer writes\n * until the client is online, use the full Firestore SDK.\n *\n * @param reference - A reference to the document to update.\n * @param data - An object containing the fields and values with which to\n * update the document. Fields can contain dots to reference nested fields\n * within the document.\n * @throws Error - If the provided input is not valid Firestore data.\n * @returns A `Promise` resolved once the data has been successfully written\n * to the backend.\n */\nexport function updateDoc<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>,\n  data: UpdateData<DbModelType>\n): Promise<void>;\n/**\n * Updates fields in the document referred to by the specified\n * `DocumentReference` The update will fail if applied to a document that does\n * not exist.\n *\n * Nested fields can be updated by providing dot-separated field path\n * strings or by providing `FieldPath` objects.\n *\n * The result of this update will only be reflected in document reads that occur\n * after the returned promise resolves. If the client is offline, the\n * update fails. If you would like to see local modifications or buffer writes\n * until the client is online, use the full Firestore SDK.\n *\n * @param reference - A reference to the document to update.\n * @param field - The first field to update.\n * @param value - The first value.\n * @param moreFieldsAndValues - Additional key value pairs.\n * @throws Error - If the provided input is not valid Firestore data.\n * @returns A `Promise` resolved once the data has been successfully written\n * to the backend.\n */\nexport function updateDoc<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>,\n  field: string | FieldPath,\n  value: unknown,\n  ...moreFieldsAndValues: unknown[]\n): Promise<void>;\nexport function updateDoc<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>,\n  fieldOrUpdateData: string | FieldPath | UpdateData<DbModelType>,\n  value?: unknown,\n  ...moreFieldsAndValues: unknown[]\n): Promise<void> {\n  reference = cast<DocumentReference<AppModelType, DbModelType>>(\n    reference,\n    DocumentReference\n  );\n  const dataReader = newUserDataReader(reference.firestore);\n\n  // For Compat types, we have to \"extract\" the underlying types before\n  // performing validation.\n  fieldOrUpdateData = getModularInstance(fieldOrUpdateData);\n\n  let parsed: ParsedUpdateData;\n  if (\n    typeof fieldOrUpdateData === 'string' ||\n    fieldOrUpdateData instanceof FieldPath\n  ) {\n    parsed = parseUpdateVarargs(\n      dataReader,\n      'updateDoc',\n      reference._key,\n      fieldOrUpdateData,\n      value,\n      moreFieldsAndValues\n    );\n  } else {\n    parsed = parseUpdateData(\n      dataReader,\n      'updateDoc',\n      reference._key,\n      fieldOrUpdateData\n    );\n  }\n\n  const datastore = getDatastore(reference.firestore);\n  return invokeCommitRpc(datastore, [\n    parsed.toMutation(reference._key, Precondition.exists(true))\n  ]);\n}\n\n/**\n * Deletes the document referred to by the specified `DocumentReference`.\n *\n * The deletion will only be reflected in document reads that occur after the\n * returned promise resolves. If the client is offline, the\n * delete fails. If you would like to see local modifications or buffer writes\n * until the client is online, use the full Firestore SDK.\n *\n * @param reference - A reference to the document to delete.\n * @returns A `Promise` resolved once the document has been successfully\n * deleted from the backend.\n */\nexport function deleteDoc<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>\n): Promise<void> {\n  reference = cast<DocumentReference<AppModelType, DbModelType>>(\n    reference,\n    DocumentReference\n  );\n  const datastore = getDatastore(reference.firestore);\n  return invokeCommitRpc(datastore, [\n    new DeleteMutation(reference._key, Precondition.none())\n  ]);\n}\n\n/**\n * Add a new document to specified `CollectionReference` with the given data,\n * assigning it a document ID automatically.\n *\n * The result of this write will only be reflected in document reads that occur\n * after the returned promise resolves. If the client is offline, the\n * write fails. If you would like to see local modifications or buffer writes\n * until the client is online, use the full Firestore SDK.\n *\n * @param reference - A reference to the collection to add this document to.\n * @param data - An Object containing the data for the new document.\n * @throws Error - If the provided input is not a valid Firestore document.\n * @returns A `Promise` resolved with a `DocumentReference` pointing to the\n * newly created document after it has been written to the backend.\n */\nexport function addDoc<AppModelType, DbModelType extends DocumentData>(\n  reference: CollectionReference<AppModelType, DbModelType>,\n  data: WithFieldValue<AppModelType>\n): Promise<DocumentReference<AppModelType, DbModelType>> {\n  reference = cast<CollectionReference<AppModelType, DbModelType>>(\n    reference,\n    CollectionReference\n  );\n  const docRef = doc(reference);\n\n  const convertedValue = applyFirestoreDataConverter(\n    reference.converter,\n    data as PartialWithFieldValue<AppModelType>\n  );\n\n  const dataReader = newUserDataReader(reference.firestore);\n  const parsed = parseSetData(\n    dataReader,\n    'addDoc',\n    docRef._key,\n    convertedValue,\n    docRef.converter !== null,\n    {}\n  );\n\n  const datastore = getDatastore(reference.firestore);\n  return invokeCommitRpc(datastore, [\n    parsed.toMutation(docRef._key, Precondition.exists(false))\n  ]).then(() => docRef);\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { deepEqual } from '@firebase/util';\n\nimport { AggregateImpl } from '../core/aggregate';\nimport { ApiClientObjectMap, Value } from '../protos/firestore_proto_api';\nimport { invokeRunAggregationQueryRpc } from '../remote/datastore';\nimport { cast } from '../util/input_validation';\nimport { mapToArray } from '../util/obj';\n\nimport {\n  AggregateField,\n  AggregateQuerySnapshot,\n  AggregateSpec\n} from './aggregate_types';\nimport { getDatastore } from './components';\nimport { Firestore } from './database';\nimport { FieldPath } from './field_path';\nimport { DocumentData, Query, queryEqual } from './reference';\nimport { LiteUserDataWriter } from './reference_impl';\nimport { fieldPathFromArgument } from './user_data_reader';\n\n/**\n * Calculates the number of documents in the result set of the given query\n * without actually downloading the documents.\n *\n * Using this function to count the documents is efficient because only the\n * final count, not the documents' data, is downloaded. This function can\n * count the documents in cases where the result set is prohibitively large to\n * download entirely (thousands of documents).\n *\n * @param query The query whose result set size is calculated.\n * @returns A Promise that will be resolved with the count; the count can be\n * retrieved from `snapshot.data().count`, where `snapshot` is the\n * `AggregateQuerySnapshot` to which the returned Promise resolves.\n */\nexport function getCount<AppModelType, DbModelType extends DocumentData>(\n  query: Query<AppModelType, DbModelType>\n): Promise<\n  AggregateQuerySnapshot<\n    { count: AggregateField<number> },\n    AppModelType,\n    DbModelType\n  >\n> {\n  const countQuerySpec: { count: AggregateField<number> } = {\n    count: count()\n  };\n\n  return getAggregate(query, countQuerySpec);\n}\n\n/**\n * Calculates the specified aggregations over the documents in the result\n * set of the given query without actually downloading the documents.\n *\n * Using this function to perform aggregations is efficient because only the\n * final aggregation values, not the documents' data, are downloaded. This\n * function can perform aggregations of the documents in cases where the result\n * set is prohibitively large to download entirely (thousands of documents).\n *\n * @param query The query whose result set is aggregated over.\n * @param aggregateSpec An `AggregateSpec` object that specifies the aggregates\n * to perform over the result set. The AggregateSpec specifies aliases for each\n * aggregate, which can be used to retrieve the aggregate result.\n * @example\n * ```typescript\n * const aggregateSnapshot = await getAggregate(query, {\n *   countOfDocs: count(),\n *   totalHours: sum('hours'),\n *   averageScore: average('score')\n * });\n *\n * const countOfDocs: number = aggregateSnapshot.data().countOfDocs;\n * const totalHours: number = aggregateSnapshot.data().totalHours;\n * const averageScore: number | null = aggregateSnapshot.data().averageScore;\n * ```\n */\nexport function getAggregate<\n  AggregateSpecType extends AggregateSpec,\n  AppModelType,\n  DbModelType extends DocumentData\n>(\n  query: Query<AppModelType, DbModelType>,\n  aggregateSpec: AggregateSpecType\n): Promise<\n  AggregateQuerySnapshot<AggregateSpecType, AppModelType, DbModelType>\n> {\n  const firestore = cast(query.firestore, Firestore);\n  const datastore = getDatastore(firestore);\n\n  const internalAggregates = mapToArray(aggregateSpec, (aggregate, alias) => {\n    return new AggregateImpl(\n      alias,\n      aggregate.aggregateType,\n      aggregate._internalFieldPath\n    );\n  });\n\n  // Run the aggregation and convert the results\n  return invokeRunAggregationQueryRpc(\n    datastore,\n    query._query,\n    internalAggregates\n  ).then(aggregateResult =>\n    convertToAggregateQuerySnapshot(firestore, query, aggregateResult)\n  );\n}\n\nfunction convertToAggregateQuerySnapshot<\n  AggregateSpecType extends AggregateSpec,\n  AppModelType,\n  DbModelType extends DocumentData\n>(\n  firestore: Firestore,\n  query: Query<AppModelType, DbModelType>,\n  aggregateResult: ApiClientObjectMap<Value>\n): AggregateQuerySnapshot<AggregateSpecType, AppModelType, DbModelType> {\n  const userDataWriter = new LiteUserDataWriter(firestore);\n  const querySnapshot = new AggregateQuerySnapshot<\n    AggregateSpecType,\n    AppModelType,\n    DbModelType\n  >(query, userDataWriter, aggregateResult);\n  return querySnapshot;\n}\n\n/**\n * Create an AggregateField object that can be used to compute the sum of\n * a specified field over a range of documents in the result set of a query.\n * @param field Specifies the field to sum across the result set.\n */\nexport function sum(field: string | FieldPath): AggregateField<number> {\n  return new AggregateField('sum', fieldPathFromArgument('sum', field));\n}\n\n/**\n * Create an AggregateField object that can be used to compute the average of\n * a specified field over a range of documents in the result set of a query.\n * @param field Specifies the field to average across the result set.\n */\nexport function average(\n  field: string | FieldPath\n): AggregateField<number | null> {\n  return new AggregateField('avg', fieldPathFromArgument('average', field));\n}\n\n/**\n * Create an AggregateField object that can be used to compute the count of\n * documents in the result set of a query.\n */\nexport function count(): AggregateField<number> {\n  return new AggregateField('count');\n}\n\n/**\n * Compares two 'AggregateField` instances for equality.\n *\n * @param left Compare this AggregateField to the `right`.\n * @param right Compare this AggregateField to the `left`.\n */\nexport function aggregateFieldEqual(\n  left: AggregateField<unknown>,\n  right: AggregateField<unknown>\n): boolean {\n  return (\n    left instanceof AggregateField &&\n    right instanceof AggregateField &&\n    left.aggregateType === right.aggregateType &&\n    left._internalFieldPath?.canonicalString() ===\n      right._internalFieldPath?.canonicalString()\n  );\n}\n\n/**\n * Compares two `AggregateQuerySnapshot` instances for equality.\n *\n * Two `AggregateQuerySnapshot` instances are considered \"equal\" if they have\n * underlying queries that compare equal, and the same data.\n *\n * @param left - The first `AggregateQuerySnapshot` to compare.\n * @param right - The second `AggregateQuerySnapshot` to compare.\n *\n * @returns `true` if the objects are \"equal\", as defined above, or `false`\n * otherwise.\n */\nexport function aggregateQuerySnapshotEqual<\n  AggregateSpecType extends AggregateSpec,\n  AppModelType,\n  DbModelType extends DocumentData\n>(\n  left: AggregateQuerySnapshot<AggregateSpecType, AppModelType, DbModelType>,\n  right: AggregateQuerySnapshot<AggregateSpecType, AppModelType, DbModelType>\n): boolean {\n  return (\n    queryEqual(left.query, right.query) && deepEqual(left.data(), right.data())\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { newQueryComparator } from '../core/query';\nimport { ChangeType, ViewSnapshot } from '../core/view_snapshot';\nimport { FieldPath } from '../lite-api/field_path';\nimport {\n  DocumentData,\n  PartialWithFieldValue,\n  Query,\n  queryEqual,\n  SetOptions,\n  WithFieldValue\n} from '../lite-api/reference';\nimport {\n  DocumentSnapshot as LiteDocumentSnapshot,\n  fieldPathFromArgument,\n  FirestoreDataConverter as LiteFirestoreDataConverter\n} from '../lite-api/snapshot';\nimport { UntypedFirestoreDataConverter } from '../lite-api/user_data_reader';\nimport { AbstractUserDataWriter } from '../lite-api/user_data_writer';\nimport { Document } from '../model/document';\nimport { DocumentKey } from '../model/document_key';\nimport { debugAssert, fail } from '../util/assert';\nimport { Code, FirestoreError } from '../util/error';\n\nimport { Firestore } from './database';\nimport { SnapshotListenOptions } from './reference_impl';\n\n/**\n * Converter used by `withConverter()` to transform user objects of type\n * `AppModelType` into Firestore data of type `DbModelType`.\n *\n * Using the converter allows you to specify generic type arguments when\n * storing and retrieving objects from Firestore.\n *\n * In this context, an \"AppModel\" is a class that is used in an application to\n * package together related information and functionality. Such a class could,\n * for example, have properties with complex, nested data types, properties used\n * for memoization, properties of types not supported by Firestore (such as\n * `symbol` and `bigint`), and helper functions that perform compound\n * operations. Such classes are not suitable and/or possible to store into a\n * Firestore database. Instead, instances of such classes need to be converted\n * to \"plain old JavaScript objects\" (POJOs) with exclusively primitive\n * properties, potentially nested inside other POJOs or arrays of POJOs. In this\n * context, this type is referred to as the \"DbModel\" and would be an object\n * suitable for persisting into Firestore. For convenience, applications can\n * implement `FirestoreDataConverter` and register the converter with Firestore\n * objects, such as `DocumentReference` or `Query`, to automatically convert\n * `AppModel` to `DbModel` when storing into Firestore, and convert `DbModel`\n * to `AppModel` when retrieving from Firestore.\n *\n * @example\n *\n * Simple Example\n *\n * ```typescript\n * const numberConverter = {\n *     toFirestore(value: WithFieldValue<number>) {\n *         return { value };\n *     },\n *     fromFirestore(snapshot: QueryDocumentSnapshot, options: SnapshotOptions) {\n *         return snapshot.data(options).value as number;\n *     }\n * };\n *\n * async function simpleDemo(db: Firestore): Promise<void> {\n *     const documentRef = doc(db, 'values/value123').withConverter(numberConverter);\n *\n *     // converters are used with `setDoc`, `addDoc`, and `getDoc`\n *     await setDoc(documentRef, 42);\n *     const snapshot1 = await getDoc(documentRef);\n *     assertEqual(snapshot1.data(), 42);\n *\n *     // converters are not used when writing data with `updateDoc`\n *     await updateDoc(documentRef, { value: 999 });\n *     const snapshot2 = await getDoc(documentRef);\n *     assertEqual(snapshot2.data(), 999);\n * }\n * ```\n *\n * Advanced Example\n *\n * ```typescript\n * // The Post class is a model that is used by our application.\n * // This class may have properties and methods that are specific\n * // to our application execution, which do not need to be persisted\n * // to Firestore.\n * class Post {\n *     constructor(\n *         readonly title: string,\n *         readonly author: string,\n *         readonly lastUpdatedMillis: number\n *     ) {}\n *     toString(): string {\n *         return `${this.title} by ${this.author}`;\n *     }\n * }\n *\n * // The PostDbModel represents how we want our posts to be stored\n * // in Firestore. This DbModel has different properties (`ttl`,\n * // `aut`, and `lut`) from the Post class we use in our application.\n * interface PostDbModel {\n *     ttl: string;\n *     aut: { firstName: string; lastName: string };\n *     lut: Timestamp;\n * }\n *\n * // The `PostConverter` implements `FirestoreDataConverter` and specifies\n * // how the Firestore SDK can convert `Post` objects to `PostDbModel`\n * // objects and vice versa.\n * class PostConverter implements FirestoreDataConverter<Post, PostDbModel> {\n *     toFirestore(post: WithFieldValue<Post>): WithFieldValue<PostDbModel> {\n *         return {\n *             ttl: post.title,\n *             aut: this._autFromAuthor(post.author),\n *             lut: this._lutFromLastUpdatedMillis(post.lastUpdatedMillis)\n *         };\n *     }\n *\n *     fromFirestore(snapshot: QueryDocumentSnapshot, options: SnapshotOptions): Post {\n *         const data = snapshot.data(options) as PostDbModel;\n *         const author = `${data.aut.firstName} ${data.aut.lastName}`;\n *         return new Post(data.ttl, author, data.lut.toMillis());\n *     }\n *\n *     _autFromAuthor(\n *         author: string | FieldValue\n *     ): { firstName: string; lastName: string } | FieldValue {\n *         if (typeof author !== 'string') {\n *             // `author` is a FieldValue, so just return it.\n *             return author;\n *         }\n *         const [firstName, lastName] = author.split(' ');\n *         return {firstName, lastName};\n *     }\n *\n *     _lutFromLastUpdatedMillis(\n *         lastUpdatedMillis: number | FieldValue\n *     ): Timestamp | FieldValue {\n *         if (typeof lastUpdatedMillis !== 'number') {\n *             // `lastUpdatedMillis` must be a FieldValue, so just return it.\n *             return lastUpdatedMillis;\n *         }\n *         return Timestamp.fromMillis(lastUpdatedMillis);\n *     }\n * }\n *\n * async function advancedDemo(db: Firestore): Promise<void> {\n *     // Create a `DocumentReference` with a `FirestoreDataConverter`.\n *     const documentRef = doc(db, 'posts/post123').withConverter(new PostConverter());\n *\n *     // The `data` argument specified to `setDoc()` is type checked by the\n *     // TypeScript compiler to be compatible with `Post`. Since the `data`\n *     // argument is typed as `WithFieldValue<Post>` rather than just `Post`,\n *     // this allows properties of the `data` argument to also be special\n *     // Firestore values that perform server-side mutations, such as\n *     // `arrayRemove()`, `deleteField()`, and `serverTimestamp()`.\n *     await setDoc(documentRef, {\n *         title: 'My Life',\n *         author: 'Foo Bar',\n *         lastUpdatedMillis: serverTimestamp()\n *     });\n *\n *     // The TypeScript compiler will fail to compile if the `data` argument to\n *     // `setDoc()` is _not_ compatible with `WithFieldValue<Post>`. This\n *     // type checking prevents the caller from specifying objects with incorrect\n *     // properties or property values.\n *     // @ts-expect-error \"Argument of type { ttl: string; } is not assignable\n *     // to parameter of type WithFieldValue<Post>\"\n *     await setDoc(documentRef, { ttl: 'The Title' });\n *\n *     // When retrieving a document with `getDoc()` the `DocumentSnapshot`\n *     // object's `data()` method returns a `Post`, rather than a generic object,\n *     // which would have been returned if the `DocumentReference` did _not_ have a\n *     // `FirestoreDataConverter` attached to it.\n *     const snapshot1: DocumentSnapshot<Post> = await getDoc(documentRef);\n *     const post1: Post = snapshot1.data()!;\n *     if (post1) {\n *         assertEqual(post1.title, 'My Life');\n *         assertEqual(post1.author, 'Foo Bar');\n *     }\n *\n *     // The `data` argument specified to `updateDoc()` is type checked by the\n *     // TypeScript compiler to be compatible with `PostDbModel`. Note that\n *     // unlike `setDoc()`, whose `data` argument must be compatible with `Post`,\n *     // the `data` argument to `updateDoc()` must be compatible with\n *     // `PostDbModel`. Similar to `setDoc()`, since the `data` argument is typed\n *     // as `WithFieldValue<PostDbModel>` rather than just `PostDbModel`, this\n *     // allows properties of the `data` argument to also be those special\n *     // Firestore values, like `arrayRemove()`, `deleteField()`, and\n *     // `serverTimestamp()`.\n *     await updateDoc(documentRef, {\n *         'aut.firstName': 'NewFirstName',\n *         lut: serverTimestamp()\n *     });\n *\n *     // The TypeScript compiler will fail to compile if the `data` argument to\n *     // `updateDoc()` is _not_ compatible with `WithFieldValue<PostDbModel>`.\n *     // This type checking prevents the caller from specifying objects with\n *     // incorrect properties or property values.\n *     // @ts-expect-error \"Argument of type { title: string; } is not assignable\n *     // to parameter of type WithFieldValue<PostDbModel>\"\n *     await updateDoc(documentRef, { title: 'New Title' });\n *     const snapshot2: DocumentSnapshot<Post> = await getDoc(documentRef);\n *     const post2: Post = snapshot2.data()!;\n *     if (post2) {\n *         assertEqual(post2.title, 'My Life');\n *         assertEqual(post2.author, 'NewFirstName Bar');\n *     }\n * }\n * ```\n */\nexport interface FirestoreDataConverter<\n  AppModelType,\n  DbModelType extends DocumentData = DocumentData\n> extends LiteFirestoreDataConverter<AppModelType, DbModelType> {\n  /**\n   * Called by the Firestore SDK to convert a custom model object of type\n   * `AppModelType` into a plain JavaScript object (suitable for writing\n   * directly to the Firestore database) of type `DbModelType`. To use `set()`\n   * with `merge` and `mergeFields`, `toFirestore()` must be defined with\n   * `PartialWithFieldValue<AppModelType>`.\n   *\n   * The `WithFieldValue<T>` type extends `T` to also allow FieldValues such as\n   * {@link (deleteField:1)} to be used as property values.\n   */\n  toFirestore(\n    modelObject: WithFieldValue<AppModelType>\n  ): WithFieldValue<DbModelType>;\n\n  /**\n   * Called by the Firestore SDK to convert a custom model object of type\n   * `AppModelType` into a plain JavaScript object (suitable for writing\n   * directly to the Firestore database) of type `DbModelType`. Used with\n   * {@link (setDoc:1)}, {@link (WriteBatch.set:1)} and\n   * {@link (Transaction.set:1)} with `merge:true` or `mergeFields`.\n   *\n   * The `PartialWithFieldValue<T>` type extends `Partial<T>` to allow\n   * FieldValues such as {@link (arrayUnion:1)} to be used as property values.\n   * It also supports nested `Partial` by allowing nested fields to be\n   * omitted.\n   */\n  toFirestore(\n    modelObject: PartialWithFieldValue<AppModelType>,\n    options: SetOptions\n  ): PartialWithFieldValue<DbModelType>;\n\n  /**\n   * Called by the Firestore SDK to convert Firestore data into an object of\n   * type `AppModelType`. You can access your data by calling:\n   * `snapshot.data(options)`.\n   *\n   * Generally, the data returned from `snapshot.data()` can be cast to\n   * `DbModelType`; however, this is not guaranteed because Firestore does not\n   * enforce a schema on the database. For example, writes from a previous\n   * version of the application or writes from another client that did not use a\n   * type converter could have written data with different properties and/or\n   * property types. The implementation will need to choose whether to\n   * gracefully recover from non-conforming data or throw an error.\n   *\n   * To override this method, see {@link (FirestoreDataConverter.fromFirestore:1)}.\n   *\n   * @param snapshot - A `QueryDocumentSnapshot` containing your data and metadata.\n   * @param options - The `SnapshotOptions` from the initial call to `data()`.\n   */\n  fromFirestore(\n    snapshot: QueryDocumentSnapshot<DocumentData, DocumentData>,\n    options?: SnapshotOptions\n  ): AppModelType;\n}\n\n/**\n * Options that configure how data is retrieved from a `DocumentSnapshot` (for\n * example the desired behavior for server timestamps that have not yet been set\n * to their final value).\n */\nexport interface SnapshotOptions {\n  /**\n   * If set, controls the return value for server timestamps that have not yet\n   * been set to their final value.\n   *\n   * By specifying 'estimate', pending server timestamps return an estimate\n   * based on the local clock. This estimate will differ from the final value\n   * and cause these values to change once the server result becomes available.\n   *\n   * By specifying 'previous', pending timestamps will be ignored and return\n   * their previous value instead.\n   *\n   * If omitted or set to 'none', `null` will be returned by default until the\n   * server value becomes available.\n   */\n  readonly serverTimestamps?: 'estimate' | 'previous' | 'none';\n}\n\n/**\n * Metadata about a snapshot, describing the state of the snapshot.\n */\nexport class SnapshotMetadata {\n  /**\n   * True if the snapshot contains the result of local writes (for example\n   * `set()` or `update()` calls) that have not yet been committed to the\n   * backend. If your listener has opted into metadata updates (via\n   * `SnapshotListenOptions`) you will receive another snapshot with\n   * `hasPendingWrites` equal to false once the writes have been committed to\n   * the backend.\n   */\n  readonly hasPendingWrites: boolean;\n\n  /**\n   * True if the snapshot was created from cached data rather than guaranteed\n   * up-to-date server data. If your listener has opted into metadata updates\n   * (via `SnapshotListenOptions`) you will receive another snapshot with\n   * `fromCache` set to false once the client has received up-to-date data from\n   * the backend.\n   */\n  readonly fromCache: boolean;\n\n  /** @hideconstructor */\n  constructor(hasPendingWrites: boolean, fromCache: boolean) {\n    this.hasPendingWrites = hasPendingWrites;\n    this.fromCache = fromCache;\n  }\n\n  /**\n   * Returns true if this `SnapshotMetadata` is equal to the provided one.\n   *\n   * @param other - The `SnapshotMetadata` to compare against.\n   * @returns true if this `SnapshotMetadata` is equal to the provided one.\n   */\n  isEqual(other: SnapshotMetadata): boolean {\n    return (\n      this.hasPendingWrites === other.hasPendingWrites &&\n      this.fromCache === other.fromCache\n    );\n  }\n}\n\n/**\n * The type of a `DocumentChange` may be 'added', 'removed', or 'modified'.\n */\nexport type DocumentChangeType = 'added' | 'removed' | 'modified';\n\n/**\n * A `DocumentChange` represents a change to the documents matching a query.\n * It contains the document affected and the type of change that occurred.\n */\nexport interface DocumentChange<\n  AppModelType = DocumentData,\n  DbModelType extends DocumentData = DocumentData\n> {\n  /** The type of change ('added', 'modified', or 'removed'). */\n  readonly type: DocumentChangeType;\n\n  /** The document affected by this change. */\n  readonly doc: QueryDocumentSnapshot<AppModelType, DbModelType>;\n\n  /**\n   * The index of the changed document in the result set immediately prior to\n   * this `DocumentChange` (i.e. supposing that all prior `DocumentChange` objects\n   * have been applied). Is `-1` for 'added' events.\n   */\n  readonly oldIndex: number;\n\n  /**\n   * The index of the changed document in the result set immediately after\n   * this `DocumentChange` (i.e. supposing that all prior `DocumentChange`\n   * objects and the current `DocumentChange` object have been applied).\n   * Is -1 for 'removed' events.\n   */\n  readonly newIndex: number;\n}\n\n/**\n * A `DocumentSnapshot` contains data read from a document in your Firestore\n * database. The data can be extracted with `.data()` or `.get(<field>)` to\n * get a specific field.\n *\n * For a `DocumentSnapshot` that points to a non-existing document, any data\n * access will return 'undefined'. You can use the `exists()` method to\n * explicitly verify a document's existence.\n */\nexport class DocumentSnapshot<\n  AppModelType = DocumentData,\n  DbModelType extends DocumentData = DocumentData\n> extends LiteDocumentSnapshot<AppModelType, DbModelType> {\n  private readonly _firestoreImpl: Firestore;\n\n  /**\n   *  Metadata about the `DocumentSnapshot`, including information about its\n   *  source and local modifications.\n   */\n  readonly metadata: SnapshotMetadata;\n\n  /** @hideconstructor protected */\n  constructor(\n    readonly _firestore: Firestore,\n    userDataWriter: AbstractUserDataWriter,\n    key: DocumentKey,\n    document: Document | null,\n    metadata: SnapshotMetadata,\n    converter: UntypedFirestoreDataConverter<AppModelType, DbModelType> | null\n  ) {\n    super(_firestore, userDataWriter, key, document, converter);\n    this._firestoreImpl = _firestore;\n    this.metadata = metadata;\n  }\n\n  /**\n   * Returns whether or not the data exists. True if the document exists.\n   */\n  exists(): this is QueryDocumentSnapshot<AppModelType, DbModelType> {\n    return super.exists();\n  }\n\n  /**\n   * Retrieves all fields in the document as an `Object`. Returns `undefined` if\n   * the document doesn't exist.\n   *\n   * By default, `serverTimestamp()` values that have not yet been\n   * set to their final value will be returned as `null`. You can override\n   * this by passing an options object.\n   *\n   * @param options - An options object to configure how data is retrieved from\n   * the snapshot (for example the desired behavior for server timestamps that\n   * have not yet been set to their final value).\n   * @returns An `Object` containing all fields in the document or `undefined` if\n   * the document doesn't exist.\n   */\n  data(options: SnapshotOptions = {}): AppModelType | undefined {\n    if (!this._document) {\n      return undefined;\n    } else if (this._converter) {\n      // We only want to use the converter and create a new DocumentSnapshot\n      // if a converter has been provided.\n      const snapshot = new QueryDocumentSnapshot(\n        this._firestore,\n        this._userDataWriter,\n        this._key,\n        this._document,\n        this.metadata,\n        /* converter= */ null\n      );\n      return this._converter.fromFirestore(snapshot, options);\n    } else {\n      return this._userDataWriter.convertValue(\n        this._document.data.value,\n        options.serverTimestamps\n      ) as AppModelType;\n    }\n  }\n\n  /**\n   * Retrieves the field specified by `fieldPath`. Returns `undefined` if the\n   * document or field doesn't exist.\n   *\n   * By default, a `serverTimestamp()` that has not yet been set to\n   * its final value will be returned as `null`. You can override this by\n   * passing an options object.\n   *\n   * @param fieldPath - The path (for example 'foo' or 'foo.bar') to a specific\n   * field.\n   * @param options - An options object to configure how the field is retrieved\n   * from the snapshot (for example the desired behavior for server timestamps\n   * that have not yet been set to their final value).\n   * @returns The data at the specified field location or undefined if no such\n   * field exists in the document.\n   */\n  // We are using `any` here to avoid an explicit cast by our users.\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  get(fieldPath: string | FieldPath, options: SnapshotOptions = {}): any {\n    if (this._document) {\n      const value = this._document.data.field(\n        fieldPathFromArgument('DocumentSnapshot.get', fieldPath)\n      );\n      if (value !== null) {\n        return this._userDataWriter.convertValue(\n          value,\n          options.serverTimestamps\n        );\n      }\n    }\n    return undefined;\n  }\n}\n\n/**\n * A `QueryDocumentSnapshot` contains data read from a document in your\n * Firestore database as part of a query. The document is guaranteed to exist\n * and its data can be extracted with `.data()` or `.get(<field>)` to get a\n * specific field.\n *\n * A `QueryDocumentSnapshot` offers the same API surface as a\n * `DocumentSnapshot`. Since query results contain only existing documents, the\n * `exists` property will always be true and `data()` will never return\n * 'undefined'.\n */\nexport class QueryDocumentSnapshot<\n  AppModelType = DocumentData,\n  DbModelType extends DocumentData = DocumentData\n> extends DocumentSnapshot<AppModelType, DbModelType> {\n  /**\n   * Retrieves all fields in the document as an `Object`.\n   *\n   * By default, `serverTimestamp()` values that have not yet been\n   * set to their final value will be returned as `null`. You can override\n   * this by passing an options object.\n   *\n   * @override\n   * @param options - An options object to configure how data is retrieved from\n   * the snapshot (for example the desired behavior for server timestamps that\n   * have not yet been set to their final value).\n   * @returns An `Object` containing all fields in the document.\n   */\n  data(options: SnapshotOptions = {}): AppModelType {\n    return super.data(options) as AppModelType;\n  }\n}\n\n/**\n * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects\n * representing the results of a query. The documents can be accessed as an\n * array via the `docs` property or enumerated using the `forEach` method. The\n * number of documents can be determined via the `empty` and `size`\n * properties.\n */\nexport class QuerySnapshot<\n  AppModelType = DocumentData,\n  DbModelType extends DocumentData = DocumentData\n> {\n  /**\n   * Metadata about this snapshot, concerning its source and if it has local\n   * modifications.\n   */\n  readonly metadata: SnapshotMetadata;\n\n  /**\n   * The query on which you called `get` or `onSnapshot` in order to get this\n   * `QuerySnapshot`.\n   */\n  readonly query: Query<AppModelType, DbModelType>;\n\n  private _cachedChanges?: Array<DocumentChange<AppModelType, DbModelType>>;\n  private _cachedChangesIncludeMetadataChanges?: boolean;\n\n  /** @hideconstructor */\n  constructor(\n    readonly _firestore: Firestore,\n    readonly _userDataWriter: AbstractUserDataWriter,\n    query: Query<AppModelType, DbModelType>,\n    readonly _snapshot: ViewSnapshot\n  ) {\n    this.metadata = new SnapshotMetadata(\n      _snapshot.hasPendingWrites,\n      _snapshot.fromCache\n    );\n    this.query = query;\n  }\n\n  /** An array of all the documents in the `QuerySnapshot`. */\n  get docs(): Array<QueryDocumentSnapshot<AppModelType, DbModelType>> {\n    const result: Array<QueryDocumentSnapshot<AppModelType, DbModelType>> = [];\n    this.forEach(doc => result.push(doc));\n    return result;\n  }\n\n  /** The number of documents in the `QuerySnapshot`. */\n  get size(): number {\n    return this._snapshot.docs.size;\n  }\n\n  /** True if there are no documents in the `QuerySnapshot`. */\n  get empty(): boolean {\n    return this.size === 0;\n  }\n\n  /**\n   * Enumerates all of the documents in the `QuerySnapshot`.\n   *\n   * @param callback - A callback to be called with a `QueryDocumentSnapshot` for\n   * each document in the snapshot.\n   * @param thisArg - The `this` binding for the callback.\n   */\n  forEach(\n    callback: (\n      result: QueryDocumentSnapshot<AppModelType, DbModelType>\n    ) => void,\n    thisArg?: unknown\n  ): void {\n    this._snapshot.docs.forEach(doc => {\n      callback.call(\n        thisArg,\n        new QueryDocumentSnapshot<AppModelType, DbModelType>(\n          this._firestore,\n          this._userDataWriter,\n          doc.key,\n          doc,\n          new SnapshotMetadata(\n            this._snapshot.mutatedKeys.has(doc.key),\n            this._snapshot.fromCache\n          ),\n          this.query.converter\n        )\n      );\n    });\n  }\n\n  /**\n   * Returns an array of the documents changes since the last snapshot. If this\n   * is the first snapshot, all documents will be in the list as 'added'\n   * changes.\n   *\n   * @param options - `SnapshotListenOptions` that control whether metadata-only\n   * changes (i.e. only `DocumentSnapshot.metadata` changed) should trigger\n   * snapshot events.\n   */\n  docChanges(\n    options: SnapshotListenOptions = {}\n  ): Array<DocumentChange<AppModelType, DbModelType>> {\n    const includeMetadataChanges = !!options.includeMetadataChanges;\n\n    if (includeMetadataChanges && this._snapshot.excludesMetadataChanges) {\n      throw new FirestoreError(\n        Code.INVALID_ARGUMENT,\n        'To include metadata changes with your document changes, you must ' +\n          'also pass { includeMetadataChanges:true } to onSnapshot().'\n      );\n    }\n\n    if (\n      !this._cachedChanges ||\n      this._cachedChangesIncludeMetadataChanges !== includeMetadataChanges\n    ) {\n      this._cachedChanges = changesFromSnapshot(this, includeMetadataChanges);\n      this._cachedChangesIncludeMetadataChanges = includeMetadataChanges;\n    }\n\n    return this._cachedChanges;\n  }\n}\n\n/** Calculates the array of `DocumentChange`s for a given `ViewSnapshot`. */\nexport function changesFromSnapshot<\n  AppModelType,\n  DbModelType extends DocumentData\n>(\n  querySnapshot: QuerySnapshot<AppModelType, DbModelType>,\n  includeMetadataChanges: boolean\n): Array<DocumentChange<AppModelType, DbModelType>> {\n  if (querySnapshot._snapshot.oldDocs.isEmpty()) {\n    // Special case the first snapshot because index calculation is easy and\n    // fast\n    let lastDoc: Document;\n    let index = 0;\n    return querySnapshot._snapshot.docChanges.map(change => {\n      debugAssert(\n        change.type === ChangeType.Added,\n        'Invalid event type for first snapshot'\n      );\n      debugAssert(\n        !lastDoc ||\n          newQueryComparator(querySnapshot._snapshot.query)(\n            lastDoc,\n            change.doc\n          ) < 0,\n        'Got added events in wrong order'\n      );\n      const doc = new QueryDocumentSnapshot<AppModelType, DbModelType>(\n        querySnapshot._firestore,\n        querySnapshot._userDataWriter,\n        change.doc.key,\n        change.doc,\n        new SnapshotMetadata(\n          querySnapshot._snapshot.mutatedKeys.has(change.doc.key),\n          querySnapshot._snapshot.fromCache\n        ),\n        querySnapshot.query.converter\n      );\n      lastDoc = change.doc;\n      return {\n        type: 'added' as DocumentChangeType,\n        doc,\n        oldIndex: -1,\n        newIndex: index++\n      };\n    });\n  } else {\n    // A `DocumentSet` that is updated incrementally as changes are applied to use\n    // to lookup the index of a document.\n    let indexTracker = querySnapshot._snapshot.oldDocs;\n    return querySnapshot._snapshot.docChanges\n      .filter(\n        change => includeMetadataChanges || change.type !== ChangeType.Metadata\n      )\n      .map(change => {\n        const doc = new QueryDocumentSnapshot<AppModelType, DbModelType>(\n          querySnapshot._firestore,\n          querySnapshot._userDataWriter,\n          change.doc.key,\n          change.doc,\n          new SnapshotMetadata(\n            querySnapshot._snapshot.mutatedKeys.has(change.doc.key),\n            querySnapshot._snapshot.fromCache\n          ),\n          querySnapshot.query.converter\n        );\n        let oldIndex = -1;\n        let newIndex = -1;\n        if (change.type !== ChangeType.Added) {\n          oldIndex = indexTracker.indexOf(change.doc.key);\n          debugAssert(oldIndex >= 0, 'Index for document not found');\n          indexTracker = indexTracker.delete(change.doc.key);\n        }\n        if (change.type !== ChangeType.Removed) {\n          indexTracker = indexTracker.add(change.doc);\n          newIndex = indexTracker.indexOf(change.doc.key);\n        }\n        return {\n          type: resultChangeType(change.type),\n          doc,\n          oldIndex,\n          newIndex\n        };\n      });\n  }\n}\n\nexport function resultChangeType(type: ChangeType): DocumentChangeType {\n  switch (type) {\n    case ChangeType.Added:\n      return 'added';\n    case ChangeType.Modified:\n    case ChangeType.Metadata:\n      return 'modified';\n    case ChangeType.Removed:\n      return 'removed';\n    default:\n      return fail('Unknown change type: ' + type);\n  }\n}\n\n// TODO(firestoreexp): Add tests for snapshotEqual with different snapshot\n// metadata\n/**\n * Returns true if the provided snapshots are equal.\n *\n * @param left - A snapshot to compare.\n * @param right - A snapshot to compare.\n * @returns true if the snapshots are equal.\n */\nexport function snapshotEqual<AppModelType, DbModelType extends DocumentData>(\n  left:\n    | DocumentSnapshot<AppModelType, DbModelType>\n    | QuerySnapshot<AppModelType, DbModelType>,\n  right:\n    | DocumentSnapshot<AppModelType, DbModelType>\n    | QuerySnapshot<AppModelType, DbModelType>\n): boolean {\n  if (left instanceof DocumentSnapshot && right instanceof DocumentSnapshot) {\n    return (\n      left._firestore === right._firestore &&\n      left._key.isEqual(right._key) &&\n      (left._document === null\n        ? right._document === null\n        : left._document.isEqual(right._document)) &&\n      left._converter === right._converter\n    );\n  } else if (left instanceof QuerySnapshot && right instanceof QuerySnapshot) {\n    return (\n      left._firestore === right._firestore &&\n      queryEqual(left.query, right.query) &&\n      left.metadata.isEqual(right.metadata) &&\n      left._snapshot.isEqual(right._snapshot)\n    );\n  }\n\n  return false;\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getModularInstance } from '@firebase/util';\n\nimport {\n  CompleteFn,\n  ErrorFn,\n  isPartialObserver,\n  NextFn,\n  PartialObserver\n} from '../api/observer';\nimport { ListenerDataSource } from '../core/event_manager';\nimport {\n  firestoreClientAddSnapshotsInSyncListener,\n  firestoreClientGetDocumentFromLocalCache,\n  firestoreClientGetDocumentsFromLocalCache,\n  firestoreClientGetDocumentsViaSnapshotListener,\n  firestoreClientGetDocumentViaSnapshotListener,\n  firestoreClientListen,\n  firestoreClientWrite\n} from '../core/firestore_client';\nimport { newQueryForPath, Query as InternalQuery } from '../core/query';\nimport { ViewSnapshot } from '../core/view_snapshot';\nimport { Bytes } from '../lite-api/bytes';\nimport { FieldPath } from '../lite-api/field_path';\nimport { validateHasExplicitOrderByForLimitToLast } from '../lite-api/query';\nimport {\n  CollectionReference,\n  doc,\n  DocumentData,\n  DocumentReference,\n  PartialWithFieldValue,\n  Query,\n  SetOptions,\n  UpdateData,\n  WithFieldValue\n} from '../lite-api/reference';\nimport { applyFirestoreDataConverter } from '../lite-api/reference_impl';\nimport {\n  newUserDataReader,\n  ParsedUpdateData,\n  parseSetData,\n  parseUpdateData,\n  parseUpdateVarargs\n} from '../lite-api/user_data_reader';\nimport { AbstractUserDataWriter } from '../lite-api/user_data_writer';\nimport { DeleteMutation, Mutation, Precondition } from '../model/mutation';\nimport { debugAssert } from '../util/assert';\nimport { ByteString } from '../util/byte_string';\nimport { FirestoreError } from '../util/error';\nimport { cast } from '../util/input_validation';\n\nimport { ensureFirestoreConfigured, Firestore } from './database';\nimport { DocumentSnapshot, QuerySnapshot, SnapshotMetadata } from './snapshot';\n\n/**\n * An options object that can be passed to {@link (onSnapshot:1)} and {@link\n * QuerySnapshot.docChanges} to control which types of changes to include in the\n * result set.\n */\nexport interface SnapshotListenOptions {\n  /**\n   * Include a change even if only the metadata of the query or of a document\n   * changed. Default is false.\n   */\n  readonly includeMetadataChanges?: boolean;\n\n  /**\n   * Set the source the query listens to. Default to \"default\", which\n   * listens to both cache and server.\n   */\n  readonly source?: ListenSource;\n}\n\n/**\n * Describe the source a query listens to.\n *\n * Set to `default` to listen to both cache and server changes. Set to `cache`\n * to listen to changes in cache only.\n */\nexport type ListenSource = 'default' | 'cache';\n\n/**\n * Reads the document referred to by this `DocumentReference`.\n *\n * Note: `getDoc()` attempts to provide up-to-date data when possible by waiting\n * for data from the server, but it may return cached data or fail if you are\n * offline and the server cannot be reached. To specify this behavior, invoke\n * {@link getDocFromCache} or {@link getDocFromServer}.\n *\n * @param reference - The reference of the document to fetch.\n * @returns A Promise resolved with a `DocumentSnapshot` containing the\n * current document contents.\n */\nexport function getDoc<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>\n): Promise<DocumentSnapshot<AppModelType, DbModelType>> {\n  reference = cast<DocumentReference<AppModelType, DbModelType>>(\n    reference,\n    DocumentReference\n  );\n  const firestore = cast(reference.firestore, Firestore);\n  const client = ensureFirestoreConfigured(firestore);\n\n  return firestoreClientGetDocumentViaSnapshotListener(\n    client,\n    reference._key\n  ).then(snapshot => convertToDocSnapshot(firestore, reference, snapshot));\n}\n\nexport class ExpUserDataWriter extends AbstractUserDataWriter {\n  constructor(protected firestore: Firestore) {\n    super();\n  }\n\n  protected convertBytes(bytes: ByteString): Bytes {\n    return new Bytes(bytes);\n  }\n\n  protected convertReference(name: string): DocumentReference {\n    const key = this.convertDocumentKey(name, this.firestore._databaseId);\n    return new DocumentReference(this.firestore, /* converter= */ null, key);\n  }\n}\n\n/**\n * Reads the document referred to by this `DocumentReference` from cache.\n * Returns an error if the document is not currently cached.\n *\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\n * current document contents.\n */\nexport function getDocFromCache<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>\n): Promise<DocumentSnapshot<AppModelType, DbModelType>> {\n  reference = cast<DocumentReference<AppModelType, DbModelType>>(\n    reference,\n    DocumentReference\n  );\n  const firestore = cast(reference.firestore, Firestore);\n  const client = ensureFirestoreConfigured(firestore);\n  const userDataWriter = new ExpUserDataWriter(firestore);\n\n  return firestoreClientGetDocumentFromLocalCache(client, reference._key).then(\n    doc =>\n      new DocumentSnapshot<AppModelType, DbModelType>(\n        firestore,\n        userDataWriter,\n        reference._key,\n        doc,\n        new SnapshotMetadata(\n          doc !== null && doc.hasLocalMutations,\n          /* fromCache= */ true\n        ),\n        reference.converter\n      )\n  );\n}\n\n/**\n * Reads the document referred to by this `DocumentReference` from the server.\n * Returns an error if the network is not available.\n *\n * @returns A `Promise` resolved with a `DocumentSnapshot` containing the\n * current document contents.\n */\nexport function getDocFromServer<\n  AppModelType,\n  DbModelType extends DocumentData\n>(\n  reference: DocumentReference<AppModelType, DbModelType>\n): Promise<DocumentSnapshot<AppModelType, DbModelType>> {\n  reference = cast<DocumentReference<AppModelType, DbModelType>>(\n    reference,\n    DocumentReference\n  );\n  const firestore = cast(reference.firestore, Firestore);\n  const client = ensureFirestoreConfigured(firestore);\n\n  return firestoreClientGetDocumentViaSnapshotListener(client, reference._key, {\n    source: 'server'\n  }).then(snapshot => convertToDocSnapshot(firestore, reference, snapshot));\n}\n\n/**\n * Executes the query and returns the results as a `QuerySnapshot`.\n *\n * Note: `getDocs()` attempts to provide up-to-date data when possible by\n * waiting for data from the server, but it may return cached data or fail if\n * you are offline and the server cannot be reached. To specify this behavior,\n * invoke {@link getDocsFromCache} or {@link getDocsFromServer}.\n *\n * @returns A `Promise` that will be resolved with the results of the query.\n */\nexport function getDocs<AppModelType, DbModelType extends DocumentData>(\n  query: Query<AppModelType, DbModelType>\n): Promise<QuerySnapshot<AppModelType, DbModelType>> {\n  query = cast<Query<AppModelType, DbModelType>>(query, Query);\n  const firestore = cast(query.firestore, Firestore);\n  const client = ensureFirestoreConfigured(firestore);\n  const userDataWriter = new ExpUserDataWriter(firestore);\n\n  validateHasExplicitOrderByForLimitToLast(query._query);\n  return firestoreClientGetDocumentsViaSnapshotListener(\n    client,\n    query._query\n  ).then(\n    snapshot =>\n      new QuerySnapshot<AppModelType, DbModelType>(\n        firestore,\n        userDataWriter,\n        query,\n        snapshot\n      )\n  );\n}\n\n/**\n * Executes the query and returns the results as a `QuerySnapshot` from cache.\n * Returns an empty result set if no documents matching the query are currently\n * cached.\n *\n * @returns A `Promise` that will be resolved with the results of the query.\n */\nexport function getDocsFromCache<\n  AppModelType,\n  DbModelType extends DocumentData\n>(\n  query: Query<AppModelType, DbModelType>\n): Promise<QuerySnapshot<AppModelType, DbModelType>> {\n  query = cast<Query<AppModelType, DbModelType>>(query, Query);\n  const firestore = cast(query.firestore, Firestore);\n  const client = ensureFirestoreConfigured(firestore);\n  const userDataWriter = new ExpUserDataWriter(firestore);\n\n  return firestoreClientGetDocumentsFromLocalCache(client, query._query).then(\n    snapshot =>\n      new QuerySnapshot<AppModelType, DbModelType>(\n        firestore,\n        userDataWriter,\n        query,\n        snapshot\n      )\n  );\n}\n\n/**\n * Executes the query and returns the results as a `QuerySnapshot` from the\n * server. Returns an error if the network is not available.\n *\n * @returns A `Promise` that will be resolved with the results of the query.\n */\nexport function getDocsFromServer<\n  AppModelType,\n  DbModelType extends DocumentData\n>(\n  query: Query<AppModelType, DbModelType>\n): Promise<QuerySnapshot<AppModelType, DbModelType>> {\n  query = cast<Query<AppModelType, DbModelType>>(query, Query);\n  const firestore = cast(query.firestore, Firestore);\n  const client = ensureFirestoreConfigured(firestore);\n  const userDataWriter = new ExpUserDataWriter(firestore);\n\n  return firestoreClientGetDocumentsViaSnapshotListener(client, query._query, {\n    source: 'server'\n  }).then(\n    snapshot => new QuerySnapshot(firestore, userDataWriter, query, snapshot)\n  );\n}\n\n/**\n * Writes to the document referred to by this `DocumentReference`. If the\n * document does not yet exist, it will be created.\n *\n * @param reference - A reference to the document to write.\n * @param data - A map of the fields and values for the document.\n * @returns A `Promise` resolved once the data has been successfully written\n * to the backend (note that it won't resolve while you're offline).\n */\nexport function setDoc<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>,\n  data: WithFieldValue<AppModelType>\n): Promise<void>;\n/**\n * Writes to the document referred to by the specified `DocumentReference`. If\n * the document does not yet exist, it will be created. If you provide `merge`\n * or `mergeFields`, the provided data can be merged into an existing document.\n *\n * @param reference - A reference to the document to write.\n * @param data - A map of the fields and values for the document.\n * @param options - An object to configure the set behavior.\n * @returns A Promise resolved once the data has been successfully written\n * to the backend (note that it won't resolve while you're offline).\n */\nexport function setDoc<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>,\n  data: PartialWithFieldValue<AppModelType>,\n  options: SetOptions\n): Promise<void>;\nexport function setDoc<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>,\n  data: PartialWithFieldValue<AppModelType>,\n  options?: SetOptions\n): Promise<void> {\n  reference = cast<DocumentReference<AppModelType, DbModelType>>(\n    reference,\n    DocumentReference\n  );\n  const firestore = cast(reference.firestore, Firestore);\n\n  const convertedValue = applyFirestoreDataConverter(\n    reference.converter,\n    data as WithFieldValue<AppModelType>,\n    options\n  );\n  const dataReader = newUserDataReader(firestore);\n  const parsed = parseSetData(\n    dataReader,\n    'setDoc',\n    reference._key,\n    convertedValue,\n    reference.converter !== null,\n    options\n  );\n\n  const mutation = parsed.toMutation(reference._key, Precondition.none());\n  return executeWrite(firestore, [mutation]);\n}\n\n/**\n * Updates fields in the document referred to by the specified\n * `DocumentReference`. The update will fail if applied to a document that does\n * not exist.\n *\n * @param reference - A reference to the document to update.\n * @param data - An object containing the fields and values with which to\n * update the document. Fields can contain dots to reference nested fields\n * within the document.\n * @returns A `Promise` resolved once the data has been successfully written\n * to the backend (note that it won't resolve while you're offline).\n */\nexport function updateDoc<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>,\n  data: UpdateData<DbModelType>\n): Promise<void>;\n/**\n * Updates fields in the document referred to by the specified\n * `DocumentReference` The update will fail if applied to a document that does\n * not exist.\n *\n * Nested fields can be updated by providing dot-separated field path\n * strings or by providing `FieldPath` objects.\n *\n * @param reference - A reference to the document to update.\n * @param field - The first field to update.\n * @param value - The first value.\n * @param moreFieldsAndValues - Additional key value pairs.\n * @returns A `Promise` resolved once the data has been successfully written\n * to the backend (note that it won't resolve while you're offline).\n */\nexport function updateDoc<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>,\n  field: string | FieldPath,\n  value: unknown,\n  ...moreFieldsAndValues: unknown[]\n): Promise<void>;\nexport function updateDoc<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<unknown>,\n  fieldOrUpdateData: string | FieldPath | UpdateData<DbModelType>,\n  value?: unknown,\n  ...moreFieldsAndValues: unknown[]\n): Promise<void> {\n  reference = cast<DocumentReference<AppModelType, DbModelType>>(\n    reference,\n    DocumentReference\n  );\n  const firestore = cast(reference.firestore, Firestore);\n\n  const dataReader = newUserDataReader(firestore);\n\n  // For Compat types, we have to \"extract\" the underlying types before\n  // performing validation.\n  fieldOrUpdateData = getModularInstance(fieldOrUpdateData);\n\n  let parsed: ParsedUpdateData;\n  if (\n    typeof fieldOrUpdateData === 'string' ||\n    fieldOrUpdateData instanceof FieldPath\n  ) {\n    parsed = parseUpdateVarargs(\n      dataReader,\n      'updateDoc',\n      reference._key,\n      fieldOrUpdateData,\n      value,\n      moreFieldsAndValues\n    );\n  } else {\n    parsed = parseUpdateData(\n      dataReader,\n      'updateDoc',\n      reference._key,\n      fieldOrUpdateData\n    );\n  }\n\n  const mutation = parsed.toMutation(reference._key, Precondition.exists(true));\n  return executeWrite(firestore, [mutation]);\n}\n\n/**\n * Deletes the document referred to by the specified `DocumentReference`.\n *\n * @param reference - A reference to the document to delete.\n * @returns A Promise resolved once the document has been successfully\n * deleted from the backend (note that it won't resolve while you're offline).\n */\nexport function deleteDoc<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>\n): Promise<void> {\n  const firestore = cast(reference.firestore, Firestore);\n  const mutations = [new DeleteMutation(reference._key, Precondition.none())];\n  return executeWrite(firestore, mutations);\n}\n\n/**\n * Add a new document to specified `CollectionReference` with the given data,\n * assigning it a document ID automatically.\n *\n * @param reference - A reference to the collection to add this document to.\n * @param data - An Object containing the data for the new document.\n * @returns A `Promise` resolved with a `DocumentReference` pointing to the\n * newly created document after it has been written to the backend (Note that it\n * won't resolve while you're offline).\n */\nexport function addDoc<AppModelType, DbModelType extends DocumentData>(\n  reference: CollectionReference<AppModelType, DbModelType>,\n  data: WithFieldValue<AppModelType>\n): Promise<DocumentReference<AppModelType, DbModelType>> {\n  const firestore = cast(reference.firestore, Firestore);\n\n  const docRef = doc(reference);\n  const convertedValue = applyFirestoreDataConverter(reference.converter, data);\n\n  const dataReader = newUserDataReader(reference.firestore);\n  const parsed = parseSetData(\n    dataReader,\n    'addDoc',\n    docRef._key,\n    convertedValue,\n    reference.converter !== null,\n    {}\n  );\n\n  const mutation = parsed.toMutation(docRef._key, Precondition.exists(false));\n  return executeWrite(firestore, [mutation]).then(() => docRef);\n}\n\n/**\n * A function returned by `onSnapshot()` that removes the listener when invoked.\n */\nexport interface Unsubscribe {\n  /** Removes the listener when invoked. */\n  (): void;\n}\n\n// TODO(firestorexp): Make sure these overloads are tested via the Firestore\n// integration tests\n\n/**\n * Attaches a listener for `DocumentSnapshot` events. You may either pass\n * individual `onNext` and `onError` callbacks or pass a single observer\n * object with `next` and `error` callbacks.\n *\n * NOTE: Although an `onCompletion` callback can be provided, it will\n * never be called because the snapshot stream is never-ending.\n *\n * @param reference - A reference to the document to listen to.\n * @param observer - A single object containing `next` and `error` callbacks.\n * @returns An unsubscribe function that can be called to cancel\n * the snapshot listener.\n */\nexport function onSnapshot<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>,\n  observer: {\n    next?: (snapshot: DocumentSnapshot<AppModelType, DbModelType>) => void;\n    error?: (error: FirestoreError) => void;\n    complete?: () => void;\n  }\n): Unsubscribe;\n/**\n * Attaches a listener for `DocumentSnapshot` events. You may either pass\n * individual `onNext` and `onError` callbacks or pass a single observer\n * object with `next` and `error` callbacks.\n *\n * NOTE: Although an `onCompletion` callback can be provided, it will\n * never be called because the snapshot stream is never-ending.\n *\n * @param reference - A reference to the document to listen to.\n * @param options - Options controlling the listen behavior.\n * @param observer - A single object containing `next` and `error` callbacks.\n * @returns An unsubscribe function that can be called to cancel\n * the snapshot listener.\n */\nexport function onSnapshot<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>,\n  options: SnapshotListenOptions,\n  observer: {\n    next?: (snapshot: DocumentSnapshot<AppModelType, DbModelType>) => void;\n    error?: (error: FirestoreError) => void;\n    complete?: () => void;\n  }\n): Unsubscribe;\n/**\n * Attaches a listener for `DocumentSnapshot` events. You may either pass\n * individual `onNext` and `onError` callbacks or pass a single observer\n * object with `next` and `error` callbacks.\n *\n * NOTE: Although an `onCompletion` callback can be provided, it will\n * never be called because the snapshot stream is never-ending.\n *\n * @param reference - A reference to the document to listen to.\n * @param onNext - A callback to be called every time a new `DocumentSnapshot`\n * is available.\n * @param onError - A callback to be called if the listen fails or is\n * cancelled. No further callbacks will occur.\n * @param onCompletion - Can be provided, but will not be called since streams are\n * never ending.\n * @returns An unsubscribe function that can be called to cancel\n * the snapshot listener.\n */\nexport function onSnapshot<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>,\n  onNext: (snapshot: DocumentSnapshot<AppModelType, DbModelType>) => void,\n  onError?: (error: FirestoreError) => void,\n  onCompletion?: () => void\n): Unsubscribe;\n/**\n * Attaches a listener for `DocumentSnapshot` events. You may either pass\n * individual `onNext` and `onError` callbacks or pass a single observer\n * object with `next` and `error` callbacks.\n *\n * NOTE: Although an `onCompletion` callback can be provided, it will\n * never be called because the snapshot stream is never-ending.\n *\n * @param reference - A reference to the document to listen to.\n * @param options - Options controlling the listen behavior.\n * @param onNext - A callback to be called every time a new `DocumentSnapshot`\n * is available.\n * @param onError - A callback to be called if the listen fails or is\n * cancelled. No further callbacks will occur.\n * @param onCompletion - Can be provided, but will not be called since streams are\n * never ending.\n * @returns An unsubscribe function that can be called to cancel\n * the snapshot listener.\n */\nexport function onSnapshot<AppModelType, DbModelType extends DocumentData>(\n  reference: DocumentReference<AppModelType, DbModelType>,\n  options: SnapshotListenOptions,\n  onNext: (snapshot: DocumentSnapshot<AppModelType, DbModelType>) => void,\n  onError?: (error: FirestoreError) => void,\n  onCompletion?: () => void\n): Unsubscribe;\n/**\n * Attaches a listener for `QuerySnapshot` events. You may either pass\n * individual `onNext` and `onError` callbacks or pass a single observer\n * object with `next` and `error` callbacks. The listener can be cancelled by\n * calling the function that is returned when `onSnapshot` is called.\n *\n * NOTE: Although an `onCompletion` callback can be provided, it will\n * never be called because the snapshot stream is never-ending.\n *\n * @param query - The query to listen to.\n * @param observer - A single object containing `next` and `error` callbacks.\n * @returns An unsubscribe function that can be called to cancel\n * the snapshot listener.\n */\nexport function onSnapshot<AppModelType, DbModelType extends DocumentData>(\n  query: Query<AppModelType, DbModelType>,\n  observer: {\n    next?: (snapshot: QuerySnapshot<AppModelType, DbModelType>) => void;\n    error?: (error: FirestoreError) => void;\n    complete?: () => void;\n  }\n): Unsubscribe;\n/**\n * Attaches a listener for `QuerySnapshot` events. You may either pass\n * individual `onNext` and `onError` callbacks or pass a single observer\n * object with `next` and `error` callbacks. The listener can be cancelled by\n * calling the function that is returned when `onSnapshot` is called.\n *\n * NOTE: Although an `onCompletion` callback can be provided, it will\n * never be called because the snapshot stream is never-ending.\n *\n * @param query - The query to listen to.\n * @param options - Options controlling the listen behavior.\n * @param observer - A single object containing `next` and `error` callbacks.\n * @returns An unsubscribe function that can be called to cancel\n * the snapshot listener.\n */\nexport function onSnapshot<AppModelType, DbModelType extends DocumentData>(\n  query: Query<AppModelType, DbModelType>,\n  options: SnapshotListenOptions,\n  observer: {\n    next?: (snapshot: QuerySnapshot<AppModelType, DbModelType>) => void;\n    error?: (error: FirestoreError) => void;\n    complete?: () => void;\n  }\n): Unsubscribe;\n/**\n * Attaches a listener for `QuerySnapshot` events. You may either pass\n * individual `onNext` and `onError` callbacks or pass a single observer\n * object with `next` and `error` callbacks. The listener can be cancelled by\n * calling the function that is returned when `onSnapshot` is called.\n *\n * NOTE: Although an `onCompletion` callback can be provided, it will\n * never be called because the snapshot stream is never-ending.\n *\n * @param query - The query to listen to.\n * @param onNext - A callback to be called every time a new `QuerySnapshot`\n * is available.\n * @param onCompletion - Can be provided, but will not be called since streams are\n * never ending.\n * @param onError - A callback to be called if the listen fails or is\n * cancelled. No further callbacks will occur.\n * @returns An unsubscribe function that can be called to cancel\n * the snapshot listener.\n */\nexport function onSnapshot<AppModelType, DbModelType extends DocumentData>(\n  query: Query<AppModelType, DbModelType>,\n  onNext: (snapshot: QuerySnapshot<AppModelType, DbModelType>) => void,\n  onError?: (error: FirestoreError) => void,\n  onCompletion?: () => void\n): Unsubscribe;\n/**\n * Attaches a listener for `QuerySnapshot` events. You may either pass\n * individual `onNext` and `onError` callbacks or pass a single observer\n * object with `next` and `error` callbacks. The listener can be cancelled by\n * calling the function that is returned when `onSnapshot` is called.\n *\n * NOTE: Although an `onCompletion` callback can be provided, it will\n * never be called because the snapshot stream is never-ending.\n *\n * @param query - The query to listen to.\n * @param options - Options controlling the listen behavior.\n * @param onNext - A callback to be called every time a new `QuerySnapshot`\n * is available.\n * @param onCompletion - Can be provided, but will not be called since streams are\n * never ending.\n * @param onError - A callback to be called if the listen fails or is\n * cancelled. No further callbacks will occur.\n * @returns An unsubscribe function that can be called to cancel\n * the snapshot listener.\n */\nexport function onSnapshot<AppModelType, DbModelType extends DocumentData>(\n  query: Query<AppModelType, DbModelType>,\n  options: SnapshotListenOptions,\n  onNext: (snapshot: QuerySnapshot<AppModelType, DbModelType>) => void,\n  onError?: (error: FirestoreError) => void,\n  onCompletion?: () => void\n): Unsubscribe;\nexport function onSnapshot<AppModelType, DbModelType extends DocumentData>(\n  reference:\n    | Query<AppModelType, DbModelType>\n    | DocumentReference<AppModelType, DbModelType>,\n  ...args: unknown[]\n): Unsubscribe {\n  reference = getModularInstance(reference);\n\n  let options: SnapshotListenOptions = {\n    includeMetadataChanges: false,\n    source: 'default'\n  };\n  let currArg = 0;\n  if (typeof args[currArg] === 'object' && !isPartialObserver(args[currArg])) {\n    options = args[currArg] as SnapshotListenOptions;\n    currArg++;\n  }\n\n  const internalOptions = {\n    includeMetadataChanges: options.includeMetadataChanges,\n    source: options.source as ListenerDataSource\n  };\n\n  if (isPartialObserver(args[currArg])) {\n    const userObserver = args[currArg] as PartialObserver<\n      QuerySnapshot<AppModelType, DbModelType>\n    >;\n    args[currArg] = userObserver.next?.bind(userObserver);\n    args[currArg + 1] = userObserver.error?.bind(userObserver);\n    args[currArg + 2] = userObserver.complete?.bind(userObserver);\n  }\n\n  let observer: PartialObserver<ViewSnapshot>;\n  let firestore: Firestore;\n  let internalQuery: InternalQuery;\n\n  if (reference instanceof DocumentReference) {\n    firestore = cast(reference.firestore, Firestore);\n    internalQuery = newQueryForPath(reference._key.path);\n\n    observer = {\n      next: snapshot => {\n        if (args[currArg]) {\n          (\n            args[currArg] as NextFn<DocumentSnapshot<AppModelType, DbModelType>>\n          )(\n            convertToDocSnapshot(\n              firestore,\n              reference as DocumentReference<AppModelType, DbModelType>,\n              snapshot\n            )\n          );\n        }\n      },\n      error: args[currArg + 1] as ErrorFn,\n      complete: args[currArg + 2] as CompleteFn\n    };\n  } else {\n    const query = cast<Query<AppModelType, DbModelType>>(reference, Query);\n    firestore = cast(query.firestore, Firestore);\n    internalQuery = query._query;\n    const userDataWriter = new ExpUserDataWriter(firestore);\n\n    observer = {\n      next: snapshot => {\n        if (args[currArg]) {\n          (args[currArg] as NextFn<QuerySnapshot<AppModelType, DbModelType>>)(\n            new QuerySnapshot(firestore, userDataWriter, query, snapshot)\n          );\n        }\n      },\n      error: args[currArg + 1] as ErrorFn,\n      complete: args[currArg + 2] as CompleteFn\n    };\n\n    validateHasExplicitOrderByForLimitToLast(reference._query);\n  }\n\n  const client = ensureFirestoreConfigured(firestore);\n  return firestoreClientListen(\n    client,\n    internalQuery,\n    internalOptions,\n    observer\n  );\n}\n\n// TODO(firestorexp): Make sure these overloads are tested via the Firestore\n// integration tests\n\n/**\n * Attaches a listener for a snapshots-in-sync event. The snapshots-in-sync\n * event indicates that all listeners affected by a given change have fired,\n * even if a single server-generated change affects multiple listeners.\n *\n * NOTE: The snapshots-in-sync event only indicates that listeners are in sync\n * with each other, but does not relate to whether those snapshots are in sync\n * with the server. Use SnapshotMetadata in the individual listeners to\n * determine if a snapshot is from the cache or the server.\n *\n * @param firestore - The instance of Firestore for synchronizing snapshots.\n * @param observer - A single object containing `next` and `error` callbacks.\n * @returns An unsubscribe function that can be called to cancel the snapshot\n * listener.\n */\nexport function onSnapshotsInSync(\n  firestore: Firestore,\n  observer: {\n    next?: (value: void) => void;\n    error?: (error: FirestoreError) => void;\n    complete?: () => void;\n  }\n): Unsubscribe;\n/**\n * Attaches a listener for a snapshots-in-sync event. The snapshots-in-sync\n * event indicates that all listeners affected by a given change have fired,\n * even if a single server-generated change affects multiple listeners.\n *\n * NOTE: The snapshots-in-sync event only indicates that listeners are in sync\n * with each other, but does not relate to whether those snapshots are in sync\n * with the server. Use `SnapshotMetadata` in the individual listeners to\n * determine if a snapshot is from the cache or the server.\n *\n * @param firestore - The `Firestore` instance for synchronizing snapshots.\n * @param onSync - A callback to be called every time all snapshot listeners are\n * in sync with each other.\n * @returns An unsubscribe function that can be called to cancel the snapshot\n * listener.\n */\nexport function onSnapshotsInSync(\n  firestore: Firestore,\n  onSync: () => void\n): Unsubscribe;\nexport function onSnapshotsInSync(\n  firestore: Firestore,\n  arg: unknown\n): Unsubscribe {\n  firestore = cast(firestore, Firestore);\n  const client = ensureFirestoreConfigured(firestore);\n  const observer = isPartialObserver(arg)\n    ? (arg as PartialObserver<void>)\n    : {\n        next: arg as () => void\n      };\n\n  return firestoreClientAddSnapshotsInSyncListener(client, observer);\n}\n\n/**\n * Locally writes `mutations` on the async queue.\n * @internal\n */\nexport function executeWrite(\n  firestore: Firestore,\n  mutations: Mutation[]\n): Promise<void> {\n  const client = ensureFirestoreConfigured(firestore);\n  return firestoreClientWrite(client, mutations);\n}\n\n/**\n * Converts a {@link ViewSnapshot} that contains the single document specified by `ref`\n * to a {@link DocumentSnapshot}.\n */\nfunction convertToDocSnapshot<AppModelType, DbModelType extends DocumentData>(\n  firestore: Firestore,\n  ref: DocumentReference<AppModelType, DbModelType>,\n  snapshot: ViewSnapshot\n): DocumentSnapshot<AppModelType, DbModelType> {\n  debugAssert(\n    snapshot.docs.size <= 1,\n    'Expected zero or a single result on a document-only query'\n  );\n  const doc = snapshot.docs.get(ref._key);\n\n  const userDataWriter = new ExpUserDataWriter(firestore);\n  return new DocumentSnapshot<AppModelType, DbModelType>(\n    firestore,\n    userDataWriter,\n    ref._key,\n    doc,\n    new SnapshotMetadata(snapshot.hasPendingWrites, snapshot.fromCache),\n    ref.converter\n  );\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AggregateField, AggregateSpec, DocumentData, Query } from '../api';\nimport { AggregateImpl } from '../core/aggregate';\nimport { firestoreClientRunAggregateQuery } from '../core/firestore_client';\nimport { count } from '../lite-api/aggregate';\nimport { AggregateQuerySnapshot } from '../lite-api/aggregate_types';\nimport { ApiClientObjectMap, Value } from '../protos/firestore_proto_api';\nimport { cast } from '../util/input_validation';\nimport { mapToArray } from '../util/obj';\n\nimport { ensureFirestoreConfigured, Firestore } from './database';\nimport { ExpUserDataWriter } from './reference_impl';\n\nexport {\n  aggregateQuerySnapshotEqual,\n  count,\n  sum,\n  average,\n  aggregateFieldEqual\n} from '../lite-api/aggregate';\n\n/**\n * Calculates the number of documents in the result set of the given query\n * without actually downloading the documents.\n *\n * Using this function to count the documents is efficient because only the\n * final count, not the documents' data, is downloaded. This function can\n * count the documents in cases where the result set is prohibitively large to\n * download entirely (thousands of documents).\n *\n * The result received from the server is presented, unaltered, without\n * considering any local state. That is, documents in the local cache are not\n * taken into consideration, neither are local modifications not yet\n * synchronized with the server. Previously-downloaded results, if any, are not\n * used. Every invocation of this function necessarily involves a round trip to\n * the server.\n *\n * @param query The query whose result set size is calculated.\n * @returns A Promise that will be resolved with the count; the count can be\n * retrieved from `snapshot.data().count`, where `snapshot` is the\n * `AggregateQuerySnapshot` to which the returned Promise resolves.\n */\nexport function getCountFromServer<\n  AppModelType,\n  DbModelType extends DocumentData\n>(\n  query: Query<AppModelType, DbModelType>\n): Promise<\n  AggregateQuerySnapshot<\n    { count: AggregateField<number> },\n    AppModelType,\n    DbModelType\n  >\n> {\n  const countQuerySpec: { count: AggregateField<number> } = {\n    count: count()\n  };\n\n  return getAggregateFromServer(query, countQuerySpec);\n}\n\n/**\n * Calculates the specified aggregations over the documents in the result\n * set of the given query without actually downloading the documents.\n *\n * Using this function to perform aggregations is efficient because only the\n * final aggregation values, not the documents' data, are downloaded. This\n * function can perform aggregations of the documents in cases where the result\n * set is prohibitively large to download entirely (thousands of documents).\n *\n * The result received from the server is presented, unaltered, without\n * considering any local state. That is, documents in the local cache are not\n * taken into consideration, neither are local modifications not yet\n * synchronized with the server. Previously-downloaded results, if any, are not\n * used. Every invocation of this function necessarily involves a round trip to\n * the server.\n *\n * @param query The query whose result set is aggregated over.\n * @param aggregateSpec An `AggregateSpec` object that specifies the aggregates\n * to perform over the result set. The AggregateSpec specifies aliases for each\n * aggregate, which can be used to retrieve the aggregate result.\n * @example\n * ```typescript\n * const aggregateSnapshot = await getAggregateFromServer(query, {\n *   countOfDocs: count(),\n *   totalHours: sum('hours'),\n *   averageScore: average('score')\n * });\n *\n * const countOfDocs: number = aggregateSnapshot.data().countOfDocs;\n * const totalHours: number = aggregateSnapshot.data().totalHours;\n * const averageScore: number | null = aggregateSnapshot.data().averageScore;\n * ```\n */\nexport function getAggregateFromServer<\n  AggregateSpecType extends AggregateSpec,\n  AppModelType,\n  DbModelType extends DocumentData\n>(\n  query: Query<AppModelType, DbModelType>,\n  aggregateSpec: AggregateSpecType\n): Promise<\n  AggregateQuerySnapshot<AggregateSpecType, AppModelType, DbModelType>\n> {\n  const firestore = cast(query.firestore, Firestore);\n  const client = ensureFirestoreConfigured(firestore);\n\n  const internalAggregates = mapToArray(aggregateSpec, (aggregate, alias) => {\n    return new AggregateImpl(\n      alias,\n      aggregate.aggregateType,\n      aggregate._internalFieldPath\n    );\n  });\n\n  // Run the aggregation and convert the results\n  return firestoreClientRunAggregateQuery(\n    client,\n    query._query,\n    internalAggregates\n  ).then(aggregateResult =>\n    convertToAggregateQuerySnapshot(firestore, query, aggregateResult)\n  );\n}\n\n/**\n * Converts the core aggregration result to an `AggregateQuerySnapshot`\n * that can be returned to the consumer.\n * @param query\n * @param aggregateResult Core aggregation result\n * @internal\n */\nfunction convertToAggregateQuerySnapshot<\n  AggregateSpecType extends AggregateSpec,\n  AppModelType,\n  DbModelType extends DocumentData\n>(\n  firestore: Firestore,\n  query: Query<AppModelType, DbModelType>,\n  aggregateResult: ApiClientObjectMap<Value>\n): AggregateQuerySnapshot<AggregateSpecType, AppModelType, DbModelType> {\n  const userDataWriter = new ExpUserDataWriter(firestore);\n  const querySnapshot = new AggregateQuerySnapshot<\n    AggregateSpecType,\n    AppModelType,\n    DbModelType\n  >(query, userDataWriter, aggregateResult);\n  return querySnapshot;\n}\n","/**\n * @license\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  IndexedDbOfflineComponentProvider,\n  LruGcMemoryOfflineComponentProvider,\n  MemoryOfflineComponentProvider,\n  MultiTabOfflineComponentProvider,\n  OfflineComponentProvider,\n  OnlineComponentProvider\n} from '../core/component_provider';\n\n/* eslint @typescript-eslint/consistent-type-definitions: [\"error\", \"type\"] */\n/**\n * Provides an in-memory cache to the SDK. This is the default cache unless explicitly\n * configured otherwise.\n *\n * To use, create an instance using the factory function {@link memoryLocalCache()}, then\n * set the instance to `FirestoreSettings.cache` and call `initializeFirestore` using\n * the settings object.\n */\nexport type MemoryLocalCache = {\n  kind: 'memory';\n  /**\n   * @internal\n   */\n  _onlineComponentProvider: OnlineComponentProvider;\n  /**\n   * @internal\n   */\n  _offlineComponentProvider: MemoryOfflineComponentProvider;\n};\n\nclass MemoryLocalCacheImpl implements MemoryLocalCache {\n  kind: 'memory' = 'memory';\n  /**\n   * @internal\n   */\n  _onlineComponentProvider: OnlineComponentProvider;\n  /**\n   * @internal\n   */\n  _offlineComponentProvider: MemoryOfflineComponentProvider;\n\n  constructor(settings?: MemoryCacheSettings) {\n    this._onlineComponentProvider = new OnlineComponentProvider();\n    if (settings?.garbageCollector) {\n      this._offlineComponentProvider =\n        settings.garbageCollector._offlineComponentProvider;\n    } else {\n      this._offlineComponentProvider = new MemoryOfflineComponentProvider();\n    }\n  }\n\n  toJSON(): {} {\n    return { kind: this.kind };\n  }\n}\n\n/**\n * Provides a persistent cache backed by IndexedDb to the SDK.\n *\n * To use, create an instance using the factory function {@link persistentLocalCache()}, then\n * set the instance to `FirestoreSettings.cache` and call `initializeFirestore` using\n * the settings object.\n */\nexport type PersistentLocalCache = {\n  kind: 'persistent';\n  /**\n   * @internal\n   */\n  _onlineComponentProvider: OnlineComponentProvider;\n  /**\n   * @internal\n   */\n  _offlineComponentProvider: OfflineComponentProvider;\n};\n\nclass PersistentLocalCacheImpl implements PersistentLocalCache {\n  kind: 'persistent' = 'persistent';\n  /**\n   * @internal\n   */\n  _onlineComponentProvider: OnlineComponentProvider;\n  /**\n   * @internal\n   */\n  _offlineComponentProvider: OfflineComponentProvider;\n\n  constructor(settings: PersistentCacheSettings | undefined) {\n    let tabManager: PersistentTabManager;\n    if (settings?.tabManager) {\n      settings.tabManager._initialize(settings);\n      tabManager = settings.tabManager;\n    } else {\n      tabManager = persistentSingleTabManager(undefined);\n      tabManager._initialize(settings);\n    }\n    this._onlineComponentProvider = tabManager._onlineComponentProvider!;\n    this._offlineComponentProvider = tabManager._offlineComponentProvider!;\n  }\n\n  toJSON(): {} {\n    return { kind: this.kind };\n  }\n}\n\n/**\n * Union type from all supported SDK cache layer.\n */\nexport type FirestoreLocalCache = MemoryLocalCache | PersistentLocalCache;\n\n/**\n * Union type from all support gabage collectors for memory local cache.\n */\nexport type MemoryGarbageCollector =\n  | MemoryEagerGarbageCollector\n  | MemoryLruGarbageCollector;\n\n/**\n * A garbage collector deletes documents whenever they are not part of any\n * active queries, and have no local mutations attached to them.\n *\n * This collector tries to ensure lowest memory footprints from the SDK,\n * at the risk of documents not being cached for offline queries or for\n * direct queries to the cache.\n *\n * Use factory function {@link memoryEagerGarbageCollector()} to create an\n * instance of this collector.\n */\nexport type MemoryEagerGarbageCollector = {\n  kind: 'memoryEager';\n  /**\n   * @internal\n   */\n  _offlineComponentProvider: MemoryOfflineComponentProvider;\n};\n\n/**\n * A garbage collector deletes Least-Recently-Used documents in multiple\n * batches.\n *\n * This collector is configured with a target size, and will only perform\n * collection when the cached documents exceed the target size. It avoids\n * querying backend repeated for the same query or document, at the risk\n * of having a larger memory footprint.\n *\n * Use factory function {@link memoryLruGarbageCollector()} to create a\n * instance of this collector.\n */\nexport type MemoryLruGarbageCollector = {\n  kind: 'memoryLru';\n  /**\n   * @internal\n   */\n  _offlineComponentProvider: MemoryOfflineComponentProvider;\n};\n\nclass MemoryEagerGabageCollectorImpl implements MemoryEagerGarbageCollector {\n  kind: 'memoryEager' = 'memoryEager';\n  /**\n   * @internal\n   */\n  _offlineComponentProvider: MemoryOfflineComponentProvider;\n\n  constructor() {\n    this._offlineComponentProvider = new MemoryOfflineComponentProvider();\n  }\n\n  toJSON(): {} {\n    return { kind: this.kind };\n  }\n}\n\nclass MemoryLruGabageCollectorImpl implements MemoryLruGarbageCollector {\n  kind: 'memoryLru' = 'memoryLru';\n  /**\n   * @internal\n   */\n  _offlineComponentProvider: MemoryOfflineComponentProvider;\n\n  constructor(cacheSize?: number) {\n    this._offlineComponentProvider = new LruGcMemoryOfflineComponentProvider(\n      cacheSize\n    );\n  }\n\n  toJSON(): {} {\n    return { kind: this.kind };\n  }\n}\n\n/**\n * Creates an instance of `MemoryEagerGarbageCollector`. This is also the\n * default garbage collector unless it is explicitly specified otherwise.\n */\nexport function memoryEagerGarbageCollector(): MemoryEagerGarbageCollector {\n  return new MemoryEagerGabageCollectorImpl();\n}\n\n/**\n * Creates an instance of `MemoryLruGarbageCollector`.\n *\n * A target size can be specified as part of the setting parameter. The\n * collector will start deleting documents once the cache size exceeds\n * the given size. The default cache size is 40MB (40 * 1024 * 1024 bytes).\n */\nexport function memoryLruGarbageCollector(settings?: {\n  cacheSizeBytes?: number;\n}): MemoryLruGarbageCollector {\n  return new MemoryLruGabageCollectorImpl(settings?.cacheSizeBytes);\n}\n\n/**\n * An settings object to configure an `MemoryLocalCache` instance.\n */\nexport type MemoryCacheSettings = {\n  /**\n   * The garbage collector to use, for the memory cache layer.\n   * A `MemoryEagerGarbageCollector` is used when this is undefined.\n   */\n  garbageCollector?: MemoryGarbageCollector;\n};\n\n/**\n * Creates an instance of `MemoryLocalCache`. The instance can be set to\n * `FirestoreSettings.cache` to tell the SDK which cache layer to use.\n */\nexport function memoryLocalCache(\n  settings?: MemoryCacheSettings\n): MemoryLocalCache {\n  return new MemoryLocalCacheImpl(settings);\n}\n\n/**\n * An settings object to configure an `PersistentLocalCache` instance.\n *\n * Persistent cache cannot be used in a Node.js environment.\n */\nexport type PersistentCacheSettings = {\n  /**\n   * An approximate cache size threshold for the on-disk data. If the cache\n   * grows beyond this size, Firestore will start removing data that hasn't been\n   * recently used. The SDK does not guarantee that the cache will stay below\n   * that size, only that if the cache exceeds the given size, cleanup will be\n   * attempted.\n   *\n   * The default value is 40 MB. The threshold must be set to at least 1 MB, and\n   * can be set to `CACHE_SIZE_UNLIMITED` to disable garbage collection.\n   */\n  cacheSizeBytes?: number;\n\n  /**\n   * Specifies how multiple tabs/windows will be managed by the SDK.\n   */\n  tabManager?: PersistentTabManager;\n};\n\n/**\n * Creates an instance of `PersistentLocalCache`. The instance can be set to\n * `FirestoreSettings.cache` to tell the SDK which cache layer to use.\n *\n * Persistent cache cannot be used in a Node.js environment.\n */\nexport function persistentLocalCache(\n  settings?: PersistentCacheSettings\n): PersistentLocalCache {\n  return new PersistentLocalCacheImpl(settings);\n}\n\n/**\n * A tab manager supportting only one tab, no synchronization will be\n * performed across tabs.\n */\nexport type PersistentSingleTabManager = {\n  kind: 'persistentSingleTab';\n  /**\n   * @internal\n   */\n  _initialize: (\n    settings: Omit<PersistentCacheSettings, 'tabManager'> | undefined\n  ) => void;\n  /**\n   * @internal\n   */\n  _onlineComponentProvider?: OnlineComponentProvider;\n  /**\n   * @internal\n   */\n  _offlineComponentProvider?: OfflineComponentProvider;\n};\n\nclass SingleTabManagerImpl implements PersistentSingleTabManager {\n  kind: 'persistentSingleTab' = 'persistentSingleTab';\n\n  /**\n   * @internal\n   */\n  _onlineComponentProvider?: OnlineComponentProvider;\n  /**\n   * @internal\n   */\n  _offlineComponentProvider?: OfflineComponentProvider;\n\n  constructor(private forceOwnership?: boolean) {}\n\n  toJSON(): {} {\n    return { kind: this.kind };\n  }\n\n  /**\n   * @internal\n   */\n  _initialize(\n    settings: Omit<PersistentCacheSettings, 'tabManager'> | undefined\n  ): void {\n    this._onlineComponentProvider = new OnlineComponentProvider();\n    this._offlineComponentProvider = new IndexedDbOfflineComponentProvider(\n      this._onlineComponentProvider,\n      settings?.cacheSizeBytes,\n      this.forceOwnership\n    );\n  }\n}\n\n/**\n * A tab manager supporting multiple tabs. SDK will synchronize queries and\n * mutations done across all tabs using the SDK.\n */\nexport type PersistentMultipleTabManager = {\n  kind: 'PersistentMultipleTab';\n  /**\n   * @internal\n   */\n  _initialize: (settings: Omit<PersistentCacheSettings, 'tabManager'>) => void;\n  /**\n   * @internal\n   */\n  _onlineComponentProvider?: OnlineComponentProvider;\n  /**\n   * @internal\n   */\n\n  _offlineComponentProvider?: OfflineComponentProvider;\n};\n\nclass MultiTabManagerImpl implements PersistentMultipleTabManager {\n  kind: 'PersistentMultipleTab' = 'PersistentMultipleTab';\n\n  /**\n   * @internal\n   */\n  _onlineComponentProvider?: OnlineComponentProvider;\n  /**\n   * @internal\n   */\n  _offlineComponentProvider?: OfflineComponentProvider;\n\n  toJSON(): {} {\n    return { kind: this.kind };\n  }\n\n  /**\n   * @internal\n   */\n  _initialize(\n    settings: Omit<PersistentCacheSettings, 'tabManager'> | undefined\n  ): void {\n    this._onlineComponentProvider = new OnlineComponentProvider();\n    this._offlineComponentProvider = new MultiTabOfflineComponentProvider(\n      this._onlineComponentProvider,\n      settings?.cacheSizeBytes\n    );\n  }\n}\n\n/**\n * A union of all available tab managers.\n */\nexport type PersistentTabManager =\n  | PersistentSingleTabManager\n  | PersistentMultipleTabManager;\n\n/**\n * Type to configure an `PersistentSingleTabManager` instance.\n */\nexport type PersistentSingleTabManagerSettings = {\n  /**\n   * Whether to force-enable persistent (IndexedDB) cache for the client. This\n   * cannot be used with multi-tab synchronization and is primarily intended for\n   * use with Web Workers. Setting this to `true` will enable IndexedDB, but cause\n   * other tabs using IndexedDB cache to fail.\n   */\n  forceOwnership?: boolean;\n};\n/**\n * Creates an instance of `PersistentSingleTabManager`.\n *\n * @param settings Configures the created tab manager.\n */\nexport function persistentSingleTabManager(\n  settings: PersistentSingleTabManagerSettings | undefined\n): PersistentSingleTabManager {\n  return new SingleTabManagerImpl(settings?.forceOwnership);\n}\n\n/**\n * Creates an instance of `PersistentMultipleTabManager`.\n */\nexport function persistentMultipleTabManager(): PersistentMultipleTabManager {\n  return new MultiTabManagerImpl();\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Code, FirestoreError } from '../util/error';\n\nexport const DEFAULT_TRANSACTION_OPTIONS: TransactionOptions = {\n  maxAttempts: 5\n};\n\n/**\n * Options to customize transaction behavior.\n */\nexport declare interface TransactionOptions {\n  /** Maximum number of attempts to commit, after which transaction fails. Default is 5. */\n  readonly maxAttempts: number;\n}\n\nexport function validateTransactionOptions(options: TransactionOptions): void {\n  if (options.maxAttempts < 1) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      'Max attempts must be at least 1'\n    );\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Compat, getModularInstance } from '@firebase/util';\n\nimport { DeleteMutation, Mutation, Precondition } from '../model/mutation';\nimport { invokeCommitRpc } from '../remote/datastore';\nimport { Code, FirestoreError } from '../util/error';\nimport { cast } from '../util/input_validation';\n\nimport { getDatastore } from './components';\nimport { Firestore } from './database';\nimport { FieldPath } from './field_path';\nimport {\n  DocumentData,\n  DocumentReference,\n  PartialWithFieldValue,\n  SetOptions,\n  UpdateData,\n  WithFieldValue\n} from './reference';\nimport { applyFirestoreDataConverter } from './reference_impl';\nimport {\n  newUserDataReader,\n  parseSetData,\n  parseUpdateData,\n  parseUpdateVarargs,\n  UserDataReader\n} from './user_data_reader';\n\n/**\n * A write batch, used to perform multiple writes as a single atomic unit.\n *\n * A `WriteBatch` object can be acquired by calling {@link writeBatch}. It\n * provides methods for adding writes to the write batch. None of the writes\n * will be committed (or visible locally) until {@link WriteBatch.commit} is\n * called.\n */\nexport class WriteBatch {\n  // This is the lite version of the WriteBatch API used in the legacy SDK. The\n  // class is a close copy but takes different input types.\n\n  private readonly _dataReader: UserDataReader;\n  private _mutations = [] as Mutation[];\n  private _committed = false;\n\n  /** @hideconstructor */\n  constructor(\n    private readonly _firestore: Firestore,\n    private readonly _commitHandler: (m: Mutation[]) => Promise<void>\n  ) {\n    this._dataReader = newUserDataReader(_firestore);\n  }\n\n  /**\n   * Writes to the document referred to by the provided {@link\n   * DocumentReference}. If the document does not exist yet, it will be created.\n   *\n   * @param documentRef - A reference to the document to be set.\n   * @param data - An object of the fields and values for the document.\n   * @returns This `WriteBatch` instance. Used for chaining method calls.\n   */\n  set<AppModelType, DbModelType extends DocumentData>(\n    documentRef: DocumentReference<AppModelType, DbModelType>,\n    data: WithFieldValue<AppModelType>\n  ): WriteBatch;\n  /**\n   * Writes to the document referred to by the provided {@link\n   * DocumentReference}. If the document does not exist yet, it will be created.\n   * If you provide `merge` or `mergeFields`, the provided data can be merged\n   * into an existing document.\n   *\n   * @param documentRef - A reference to the document to be set.\n   * @param data - An object of the fields and values for the document.\n   * @param options - An object to configure the set behavior.\n   * @throws Error - If the provided input is not a valid Firestore document.\n   * @returns This `WriteBatch` instance. Used for chaining method calls.\n   */\n  set<AppModelType, DbModelType extends DocumentData>(\n    documentRef: DocumentReference<AppModelType, DbModelType>,\n    data: PartialWithFieldValue<AppModelType>,\n    options: SetOptions\n  ): WriteBatch;\n  set<AppModelType, DbModelType extends DocumentData>(\n    documentRef: DocumentReference<AppModelType, DbModelType>,\n    data: WithFieldValue<AppModelType> | PartialWithFieldValue<AppModelType>,\n    options?: SetOptions\n  ): WriteBatch {\n    this._verifyNotCommitted();\n    const ref = validateReference(documentRef, this._firestore);\n\n    const convertedValue = applyFirestoreDataConverter(\n      ref.converter,\n      data,\n      options\n    );\n    const parsed = parseSetData(\n      this._dataReader,\n      'WriteBatch.set',\n      ref._key,\n      convertedValue,\n      ref.converter !== null,\n      options\n    );\n    this._mutations.push(parsed.toMutation(ref._key, Precondition.none()));\n    return this;\n  }\n\n  /**\n   * Updates fields in the document referred to by the provided {@link\n   * DocumentReference}. The update will fail if applied to a document that does\n   * not exist.\n   *\n   * @param documentRef - A reference to the document to be updated.\n   * @param data - An object containing the fields and values with which to\n   * update the document. Fields can contain dots to reference nested fields\n   * within the document.\n   * @throws Error - If the provided input is not valid Firestore data.\n   * @returns This `WriteBatch` instance. Used for chaining method calls.\n   */\n  update<AppModelType, DbModelType extends DocumentData>(\n    documentRef: DocumentReference<AppModelType, DbModelType>,\n    data: UpdateData<DbModelType>\n  ): WriteBatch;\n  /**\n   * Updates fields in the document referred to by this {@link\n   * DocumentReference}. The update will fail if applied to a document that does\n   * not exist.\n   *\n   * Nested fields can be update by providing dot-separated field path strings\n   * or by providing `FieldPath` objects.\n   *\n   * @param documentRef - A reference to the document to be updated.\n   * @param field - The first field to update.\n   * @param value - The first value.\n   * @param moreFieldsAndValues - Additional key value pairs.\n   * @throws Error - If the provided input is not valid Firestore data.\n   * @returns This `WriteBatch` instance. Used for chaining method calls.\n   */\n  update<AppModelType, DbModelType extends DocumentData>(\n    documentRef: DocumentReference<AppModelType, DbModelType>,\n    field: string | FieldPath,\n    value: unknown,\n    ...moreFieldsAndValues: unknown[]\n  ): WriteBatch;\n  update<AppModelType, DbModelType extends DocumentData>(\n    documentRef: DocumentReference<AppModelType, DbModelType>,\n    fieldOrUpdateData: string | FieldPath | UpdateData<DbModelType>,\n    value?: unknown,\n    ...moreFieldsAndValues: unknown[]\n  ): WriteBatch {\n    this._verifyNotCommitted();\n    const ref = validateReference(documentRef, this._firestore);\n\n    // For Compat types, we have to \"extract\" the underlying types before\n    // performing validation.\n    fieldOrUpdateData = getModularInstance(fieldOrUpdateData);\n\n    let parsed;\n    if (\n      typeof fieldOrUpdateData === 'string' ||\n      fieldOrUpdateData instanceof FieldPath\n    ) {\n      parsed = parseUpdateVarargs(\n        this._dataReader,\n        'WriteBatch.update',\n        ref._key,\n        fieldOrUpdateData,\n        value,\n        moreFieldsAndValues\n      );\n    } else {\n      parsed = parseUpdateData(\n        this._dataReader,\n        'WriteBatch.update',\n        ref._key,\n        fieldOrUpdateData\n      );\n    }\n\n    this._mutations.push(\n      parsed.toMutation(ref._key, Precondition.exists(true))\n    );\n    return this;\n  }\n\n  /**\n   * Deletes the document referred to by the provided {@link DocumentReference}.\n   *\n   * @param documentRef - A reference to the document to be deleted.\n   * @returns This `WriteBatch` instance. Used for chaining method calls.\n   */\n  delete<AppModelType, DbModelType extends DocumentData>(\n    documentRef: DocumentReference<AppModelType, DbModelType>\n  ): WriteBatch {\n    this._verifyNotCommitted();\n    const ref = validateReference(documentRef, this._firestore);\n    this._mutations = this._mutations.concat(\n      new DeleteMutation(ref._key, Precondition.none())\n    );\n    return this;\n  }\n\n  /**\n   * Commits all of the writes in this write batch as a single atomic unit.\n   *\n   * The result of these writes will only be reflected in document reads that\n   * occur after the returned promise resolves. If the client is offline, the\n   * write fails. If you would like to see local modifications or buffer writes\n   * until the client is online, use the full Firestore SDK.\n   *\n   * @returns A `Promise` resolved once all of the writes in the batch have been\n   * successfully written to the backend as an atomic unit (note that it won't\n   * resolve while you're offline).\n   */\n  commit(): Promise<void> {\n    this._verifyNotCommitted();\n    this._committed = true;\n    if (this._mutations.length > 0) {\n      return this._commitHandler(this._mutations);\n    }\n\n    return Promise.resolve();\n  }\n\n  private _verifyNotCommitted(): void {\n    if (this._committed) {\n      throw new FirestoreError(\n        Code.FAILED_PRECONDITION,\n        'A write batch can no longer be used after commit() ' +\n          'has been called.'\n      );\n    }\n  }\n}\n\nexport function validateReference<\n  AppModelType,\n  DbModelType extends DocumentData\n>(\n  documentRef:\n    | DocumentReference<AppModelType, DbModelType>\n    | Compat<DocumentReference<AppModelType, DbModelType>>,\n  firestore: Firestore\n): DocumentReference<AppModelType, DbModelType> {\n  documentRef = getModularInstance(documentRef);\n\n  if (documentRef.firestore !== firestore) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      'Provided document reference is from a different Firestore instance.'\n    );\n  } else {\n    return documentRef as DocumentReference<AppModelType, DbModelType>;\n  }\n}\n\n/**\n * Creates a write batch, used for performing multiple writes as a single\n * atomic operation. The maximum number of writes allowed in a single WriteBatch\n * is 500.\n *\n * The result of these writes will only be reflected in document reads that\n * occur after the returned promise resolves. If the client is offline, the\n * write fails. If you would like to see local modifications or buffer writes\n * until the client is online, use the full Firestore SDK.\n *\n * @returns A `WriteBatch` that can be used to atomically execute multiple\n * writes.\n */\nexport function writeBatch(firestore: Firestore): WriteBatch {\n  firestore = cast(firestore, Firestore);\n  const datastore = getDatastore(firestore);\n  return new WriteBatch(firestore, writes =>\n    invokeCommitRpc(datastore, writes)\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { firestoreClientTransaction } from '../core/firestore_client';\nimport { Transaction as InternalTransaction } from '../core/transaction';\nimport {\n  TransactionOptions as TranasactionOptionsInternal,\n  DEFAULT_TRANSACTION_OPTIONS,\n  validateTransactionOptions\n} from '../core/transaction_options';\nimport { DocumentData, DocumentReference } from '../lite-api/reference';\nimport { Transaction as LiteTransaction } from '../lite-api/transaction';\nimport { validateReference } from '../lite-api/write_batch';\nimport { cast } from '../util/input_validation';\n\nimport { ensureFirestoreConfigured, Firestore } from './database';\nimport { ExpUserDataWriter } from './reference_impl';\nimport { DocumentSnapshot, SnapshotMetadata } from './snapshot';\nimport { TransactionOptions } from './transaction_options';\n\n/**\n * A reference to a transaction.\n *\n * The `Transaction` object passed to a transaction's `updateFunction` provides\n * the methods to read and write data within the transaction context. See\n * {@link runTransaction}.\n */\nexport class Transaction extends LiteTransaction {\n  // This class implements the same logic as the Transaction API in the Lite SDK\n  // but is subclassed in order to return its own DocumentSnapshot types.\n\n  /** @hideconstructor */\n  constructor(\n    protected readonly _firestore: Firestore,\n    _transaction: InternalTransaction\n  ) {\n    super(_firestore, _transaction);\n  }\n\n  /**\n   * Reads the document referenced by the provided {@link DocumentReference}.\n   *\n   * @param documentRef - A reference to the document to be read.\n   * @returns A `DocumentSnapshot` with the read data.\n   */\n  get<AppModelType, DbModelType extends DocumentData>(\n    documentRef: DocumentReference<AppModelType, DbModelType>\n  ): Promise<DocumentSnapshot<AppModelType, DbModelType>> {\n    const ref = validateReference(documentRef, this._firestore);\n    const userDataWriter = new ExpUserDataWriter(this._firestore);\n    return super\n      .get(documentRef)\n      .then(\n        liteDocumentSnapshot =>\n          new DocumentSnapshot(\n            this._firestore,\n            userDataWriter,\n            ref._key,\n            liteDocumentSnapshot._document,\n            new SnapshotMetadata(\n              /* hasPendingWrites= */ false,\n              /* fromCache= */ false\n            ),\n            ref.converter\n          )\n      );\n  }\n}\n\n/**\n * Executes the given `updateFunction` and then attempts to commit the changes\n * applied within the transaction. If any document read within the transaction\n * has changed, Cloud Firestore retries the `updateFunction`. If it fails to\n * commit after 5 attempts, the transaction fails.\n *\n * The maximum number of writes allowed in a single transaction is 500.\n *\n * @param firestore - A reference to the Firestore database to run this\n * transaction against.\n * @param updateFunction - The function to execute within the transaction\n * context.\n * @param options - An options object to configure maximum number of attempts to\n * commit.\n * @returns If the transaction completed successfully or was explicitly aborted\n * (the `updateFunction` returned a failed promise), the promise returned by the\n * `updateFunction `is returned here. Otherwise, if the transaction failed, a\n * rejected promise with the corresponding failure error is returned.\n */\nexport function runTransaction<T>(\n  firestore: Firestore,\n  updateFunction: (transaction: Transaction) => Promise<T>,\n  options?: TransactionOptions\n): Promise<T> {\n  firestore = cast(firestore, Firestore);\n  const optionsWithDefaults: TranasactionOptionsInternal = {\n    ...DEFAULT_TRANSACTION_OPTIONS,\n    ...options\n  };\n  validateTransactionOptions(optionsWithDefaults);\n  const client = ensureFirestoreConfigured(firestore);\n  return firestoreClientTransaction(\n    client,\n    internalTransaction =>\n      updateFunction(new Transaction(firestore, internalTransaction)),\n    optionsWithDefaults\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getModularInstance } from '@firebase/util';\n\nimport { Transaction as InternalTransaction } from '../core/transaction';\nimport {\n  DEFAULT_TRANSACTION_OPTIONS,\n  TransactionOptions as TranasactionOptionsInternal,\n  validateTransactionOptions\n} from '../core/transaction_options';\nimport { TransactionRunner } from '../core/transaction_runner';\nimport { fail } from '../util/assert';\nimport { newAsyncQueue } from '../util/async_queue_impl';\nimport { cast } from '../util/input_validation';\nimport { Deferred } from '../util/promise';\n\nimport { getDatastore } from './components';\nimport { Firestore } from './database';\nimport { FieldPath } from './field_path';\nimport {\n  DocumentData,\n  DocumentReference,\n  PartialWithFieldValue,\n  SetOptions,\n  UpdateData,\n  WithFieldValue\n} from './reference';\nimport {\n  applyFirestoreDataConverter,\n  LiteUserDataWriter\n} from './reference_impl';\nimport { DocumentSnapshot } from './snapshot';\nimport { TransactionOptions } from './transaction_options';\nimport {\n  newUserDataReader,\n  parseSetData,\n  parseUpdateData,\n  parseUpdateVarargs,\n  UserDataReader\n} from './user_data_reader';\nimport { validateReference } from './write_batch';\n\n// TODO(mrschmidt) Consider using `BaseTransaction` as the base class in the\n// legacy SDK.\n\n/**\n * A reference to a transaction.\n *\n * The `Transaction` object passed to a transaction's `updateFunction` provides\n * the methods to read and write data within the transaction context. See\n * {@link runTransaction}.\n */\nexport class Transaction {\n  // This is the tree-shakeable version of the Transaction class used in the\n  // legacy SDK. The class is a close copy but takes different input and output\n  // types. The firestore-exp SDK further extends this class to return its API\n  // type.\n\n  private readonly _dataReader: UserDataReader;\n\n  /** @hideconstructor */\n  constructor(\n    protected readonly _firestore: Firestore,\n    private readonly _transaction: InternalTransaction\n  ) {\n    this._dataReader = newUserDataReader(_firestore);\n  }\n\n  /**\n   * Reads the document referenced by the provided {@link DocumentReference}.\n   *\n   * @param documentRef - A reference to the document to be read.\n   * @returns A `DocumentSnapshot` with the read data.\n   */\n  get<AppModelType, DbModelType extends DocumentData>(\n    documentRef: DocumentReference<AppModelType, DbModelType>\n  ): Promise<DocumentSnapshot<AppModelType, DbModelType>> {\n    const ref = validateReference(documentRef, this._firestore);\n    const userDataWriter = new LiteUserDataWriter(this._firestore);\n    return this._transaction.lookup([ref._key]).then(docs => {\n      if (!docs || docs.length !== 1) {\n        return fail('Mismatch in docs returned from document lookup.');\n      }\n      const doc = docs[0];\n      if (doc.isFoundDocument()) {\n        return new DocumentSnapshot<AppModelType, DbModelType>(\n          this._firestore,\n          userDataWriter,\n          doc.key,\n          doc,\n          ref.converter\n        );\n      } else if (doc.isNoDocument()) {\n        return new DocumentSnapshot<AppModelType, DbModelType>(\n          this._firestore,\n          userDataWriter,\n          ref._key,\n          null,\n          ref.converter\n        );\n      } else {\n        throw fail(\n          `BatchGetDocumentsRequest returned unexpected document: ${doc}`\n        );\n      }\n    });\n  }\n\n  /**\n   * Writes to the document referred to by the provided {@link\n   * DocumentReference}. If the document does not exist yet, it will be created.\n   *\n   * @param documentRef - A reference to the document to be set.\n   * @param data - An object of the fields and values for the document.\n   * @throws Error - If the provided input is not a valid Firestore document.\n   * @returns This `Transaction` instance. Used for chaining method calls.\n   */\n  set<AppModelType, DbModelType extends DocumentData>(\n    documentRef: DocumentReference<AppModelType, DbModelType>,\n    data: WithFieldValue<AppModelType>\n  ): this;\n  /**\n   * Writes to the document referred to by the provided {@link\n   * DocumentReference}. If the document does not exist yet, it will be created.\n   * If you provide `merge` or `mergeFields`, the provided data can be merged\n   * into an existing document.\n   *\n   * @param documentRef - A reference to the document to be set.\n   * @param data - An object of the fields and values for the document.\n   * @param options - An object to configure the set behavior.\n   * @throws Error - If the provided input is not a valid Firestore document.\n   * @returns This `Transaction` instance. Used for chaining method calls.\n   */\n  set<AppModelType, DbModelType extends DocumentData>(\n    documentRef: DocumentReference<AppModelType, DbModelType>,\n    data: PartialWithFieldValue<AppModelType>,\n    options: SetOptions\n  ): this;\n  set<AppModelType, DbModelType extends DocumentData>(\n    documentRef: DocumentReference<AppModelType, DbModelType>,\n    value: PartialWithFieldValue<AppModelType>,\n    options?: SetOptions\n  ): this {\n    const ref = validateReference(documentRef, this._firestore);\n    const convertedValue = applyFirestoreDataConverter(\n      ref.converter,\n      value,\n      options\n    );\n    const parsed = parseSetData(\n      this._dataReader,\n      'Transaction.set',\n      ref._key,\n      convertedValue,\n      ref.converter !== null,\n      options\n    );\n    this._transaction.set(ref._key, parsed);\n    return this;\n  }\n\n  /**\n   * Updates fields in the document referred to by the provided {@link\n   * DocumentReference}. The update will fail if applied to a document that does\n   * not exist.\n   *\n   * @param documentRef - A reference to the document to be updated.\n   * @param data - An object containing the fields and values with which to\n   * update the document. Fields can contain dots to reference nested fields\n   * within the document.\n   * @throws Error - If the provided input is not valid Firestore data.\n   * @returns This `Transaction` instance. Used for chaining method calls.\n   */\n  update<AppModelType, DbModelType extends DocumentData>(\n    documentRef: DocumentReference<AppModelType, DbModelType>,\n    data: UpdateData<DbModelType>\n  ): this;\n  /**\n   * Updates fields in the document referred to by the provided {@link\n   * DocumentReference}. The update will fail if applied to a document that does\n   * not exist.\n   *\n   * Nested fields can be updated by providing dot-separated field path\n   * strings or by providing `FieldPath` objects.\n   *\n   * @param documentRef - A reference to the document to be updated.\n   * @param field - The first field to update.\n   * @param value - The first value.\n   * @param moreFieldsAndValues - Additional key/value pairs.\n   * @throws Error - If the provided input is not valid Firestore data.\n   * @returns This `Transaction` instance. Used for chaining method calls.\n   */\n  update<AppModelType, DbModelType extends DocumentData>(\n    documentRef: DocumentReference<AppModelType, DbModelType>,\n    field: string | FieldPath,\n    value: unknown,\n    ...moreFieldsAndValues: unknown[]\n  ): this;\n  update<AppModelType, DbModelType extends DocumentData>(\n    documentRef: DocumentReference<AppModelType, DbModelType>,\n    fieldOrUpdateData: string | FieldPath | UpdateData<DbModelType>,\n    value?: unknown,\n    ...moreFieldsAndValues: unknown[]\n  ): this {\n    const ref = validateReference(documentRef, this._firestore);\n\n    // For Compat types, we have to \"extract\" the underlying types before\n    // performing validation.\n    fieldOrUpdateData = getModularInstance(fieldOrUpdateData);\n\n    let parsed;\n    if (\n      typeof fieldOrUpdateData === 'string' ||\n      fieldOrUpdateData instanceof FieldPath\n    ) {\n      parsed = parseUpdateVarargs(\n        this._dataReader,\n        'Transaction.update',\n        ref._key,\n        fieldOrUpdateData,\n        value,\n        moreFieldsAndValues\n      );\n    } else {\n      parsed = parseUpdateData(\n        this._dataReader,\n        'Transaction.update',\n        ref._key,\n        fieldOrUpdateData\n      );\n    }\n\n    this._transaction.update(ref._key, parsed);\n    return this;\n  }\n\n  /**\n   * Deletes the document referred to by the provided {@link DocumentReference}.\n   *\n   * @param documentRef - A reference to the document to be deleted.\n   * @returns This `Transaction` instance. Used for chaining method calls.\n   */\n  delete<AppModelType, DbModelType extends DocumentData>(\n    documentRef: DocumentReference<AppModelType, DbModelType>\n  ): this {\n    const ref = validateReference(documentRef, this._firestore);\n    this._transaction.delete(ref._key);\n    return this;\n  }\n}\n\n/**\n * Executes the given `updateFunction` and then attempts to commit the changes\n * applied within the transaction. If any document read within the transaction\n * has changed, Cloud Firestore retries the `updateFunction`. If it fails to\n * commit after 5 attempts, the transaction fails.\n *\n * The maximum number of writes allowed in a single transaction is 500.\n *\n * @param firestore - A reference to the Firestore database to run this\n * transaction against.\n * @param updateFunction - The function to execute within the transaction\n * context.\n * @param options - An options object to configure maximum number of attempts to\n * commit.\n * @returns If the transaction completed successfully or was explicitly aborted\n * (the `updateFunction` returned a failed promise), the promise returned by the\n * `updateFunction `is returned here. Otherwise, if the transaction failed, a\n * rejected promise with the corresponding failure error is returned.\n */\nexport function runTransaction<T>(\n  firestore: Firestore,\n  updateFunction: (transaction: Transaction) => Promise<T>,\n  options?: TransactionOptions\n): Promise<T> {\n  firestore = cast(firestore, Firestore);\n  const datastore = getDatastore(firestore);\n  const optionsWithDefaults: TranasactionOptionsInternal = {\n    ...DEFAULT_TRANSACTION_OPTIONS,\n    ...options\n  };\n  validateTransactionOptions(optionsWithDefaults);\n  const deferred = new Deferred<T>();\n  new TransactionRunner<T>(\n    newAsyncQueue(),\n    datastore,\n    optionsWithDefaults,\n    internalTransaction =>\n      updateFunction(new Transaction(firestore, internalTransaction)),\n    deferred\n  ).run();\n  return deferred.promise;\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { firestoreClientSetIndexConfiguration } from '../core/firestore_client';\nimport { fieldPathFromDotSeparatedString } from '../lite-api/user_data_reader';\nimport {\n  FieldIndex,\n  IndexKind,\n  IndexSegment,\n  IndexState\n} from '../model/field_index';\nimport { Code, FirestoreError } from '../util/error';\nimport { cast } from '../util/input_validation';\nimport { logWarn } from '../util/log';\n\nimport { ensureFirestoreConfigured, Firestore } from './database';\n\nexport {\n  connectFirestoreEmulator,\n  EmulatorMockTokenOptions\n} from '../lite-api/database';\n\n/**\n * A single field element in an index configuration.\n *\n * @deprecated Instead of creating cache indexes manually, consider using\n * `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to\n * create cache indexes for queries running locally.\n *\n * @beta\n */\nexport interface IndexField {\n  /** The field path to index. */\n  readonly fieldPath: string;\n  /**\n   * What type of array index to create. Set to `CONTAINS` for `array-contains`\n   * and `array-contains-any` indexes.\n   *\n   * Only one of `arrayConfig` or `order` should be set;\n   */\n  readonly arrayConfig?: 'CONTAINS';\n  /**\n   * What type of array index to create. Set to `ASCENDING` or 'DESCENDING` for\n   * `==`, `!=`, `<=`, `<=`, `in` and `not-in` filters.\n   *\n   * Only one of `arrayConfig` or `order` should be set.\n   */\n  readonly order?: 'ASCENDING' | 'DESCENDING';\n\n  [key: string]: unknown;\n}\n\n/**\n * The SDK definition of a Firestore index.\n *\n * @deprecated Instead of creating cache indexes manually, consider using\n * `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to\n * create cache indexes for queries running locally.\n *\n * @beta\n */\nexport interface Index {\n  /** The ID of the collection to index. */\n  readonly collectionGroup: string;\n  /** A list of fields to index. */\n  readonly fields?: IndexField[];\n\n  [key: string]: unknown;\n}\n\n/**\n * A list of Firestore indexes to speed up local query execution.\n *\n * See {@link https://firebase.google.com/docs/reference/firestore/indexes/#json_format | JSON Format}\n * for a description of the format of the index definition.\n *\n * @deprecated Instead of creating cache indexes manually, consider using\n * `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to\n * create cache indexes for queries running locally.\n *\n * @beta\n */\nexport interface IndexConfiguration {\n  /** A list of all Firestore indexes. */\n  readonly indexes?: Index[];\n\n  [key: string]: unknown;\n}\n\n/**\n * Configures indexing for local query execution. Any previous index\n * configuration is overridden. The `Promise` resolves once the index\n * configuration has been persisted.\n *\n * The index entries themselves are created asynchronously. You can continue to\n * use queries that require indexing even if the indices are not yet available.\n * Query execution will automatically start using the index once the index\n * entries have been written.\n *\n * Indexes are only supported with IndexedDb persistence. If IndexedDb is not\n * enabled, any index configuration is ignored.\n *\n * @param firestore - The {@link Firestore} instance to configure indexes for.\n * @param configuration -The index definition.\n * @throws FirestoreError if the JSON format is invalid.\n * @returns A `Promise` that resolves once all indices are successfully\n * configured.\n *\n * @deprecated Instead of creating cache indexes manually, consider using\n * `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to\n * create cache indexes for queries running locally.\n *\n * @beta\n */\nexport function setIndexConfiguration(\n  firestore: Firestore,\n  configuration: IndexConfiguration\n): Promise<void>;\n\n/**\n * Configures indexing for local query execution. Any previous index\n * configuration is overridden. The `Promise` resolves once the index\n * configuration has been persisted.\n *\n * The index entries themselves are created asynchronously. You can continue to\n * use queries that require indexing even if the indices are not yet available.\n * Query execution will automatically start using the index once the index\n * entries have been written.\n *\n * Indexes are only supported with IndexedDb persistence. Invoke either\n * `enableIndexedDbPersistence()` or `enableMultiTabIndexedDbPersistence()`\n * before setting an index configuration. If IndexedDb is not enabled, any\n * index configuration is ignored.\n *\n * The method accepts the JSON format exported by the Firebase CLI (`firebase\n * firestore:indexes`). If the JSON format is invalid, this method throws an\n * error.\n *\n * @param firestore - The {@link Firestore} instance to configure indexes for.\n * @param json -The JSON format exported by the Firebase CLI.\n * @throws FirestoreError if the JSON format is invalid.\n * @returns A `Promise` that resolves once all indices are successfully\n * configured.\n *\n * @deprecated Instead of creating cache indexes manually, consider using\n * `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to\n * create cache indexes for queries running locally.\n *\n * @beta\n */\nexport function setIndexConfiguration(\n  firestore: Firestore,\n  json: string\n): Promise<void>;\n\nexport function setIndexConfiguration(\n  firestore: Firestore,\n  jsonOrConfiguration: string | IndexConfiguration\n): Promise<void> {\n  firestore = cast(firestore, Firestore);\n  const client = ensureFirestoreConfigured(firestore);\n  if (\n    !client._uninitializedComponentsProvider ||\n    client._uninitializedComponentsProvider?._offlineKind === 'memory'\n  ) {\n    // PORTING NOTE: We don't return an error if the user has not enabled\n    // persistence since `enableIndexeddbPersistence()` can fail on the Web.\n    logWarn('Cannot enable indexes when persistence is disabled');\n    return Promise.resolve();\n  }\n  const parsedIndexes = parseIndexes(jsonOrConfiguration);\n  return firestoreClientSetIndexConfiguration(client, parsedIndexes);\n}\n\nexport function parseIndexes(\n  jsonOrConfiguration: string | IndexConfiguration\n): FieldIndex[] {\n  const indexConfiguration =\n    typeof jsonOrConfiguration === 'string'\n      ? (tryParseJson(jsonOrConfiguration) as IndexConfiguration)\n      : jsonOrConfiguration;\n  const parsedIndexes: FieldIndex[] = [];\n\n  if (Array.isArray(indexConfiguration.indexes)) {\n    for (const index of indexConfiguration.indexes) {\n      const collectionGroup = tryGetString(index, 'collectionGroup');\n\n      const segments: IndexSegment[] = [];\n      if (Array.isArray(index.fields)) {\n        for (const field of index.fields) {\n          const fieldPathString = tryGetString(field, 'fieldPath');\n          const fieldPath = fieldPathFromDotSeparatedString(\n            'setIndexConfiguration',\n            fieldPathString\n          );\n\n          if (field.arrayConfig === 'CONTAINS') {\n            segments.push(new IndexSegment(fieldPath, IndexKind.CONTAINS));\n          } else if (field.order === 'ASCENDING') {\n            segments.push(new IndexSegment(fieldPath, IndexKind.ASCENDING));\n          } else if (field.order === 'DESCENDING') {\n            segments.push(new IndexSegment(fieldPath, IndexKind.DESCENDING));\n          }\n        }\n      }\n\n      parsedIndexes.push(\n        new FieldIndex(\n          FieldIndex.UNKNOWN_ID,\n          collectionGroup,\n          segments,\n          IndexState.empty()\n        )\n      );\n    }\n  }\n  return parsedIndexes;\n}\n\nfunction tryParseJson(json: string): Record<string, unknown> {\n  try {\n    return JSON.parse(json);\n  } catch (e) {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      'Failed to parse JSON: ' + (e as Error)?.message\n    );\n  }\n}\n\nfunction tryGetString(data: Record<string, unknown>, property: string): string {\n  if (typeof data[property] !== 'string') {\n    throw new FirestoreError(\n      Code.INVALID_ARGUMENT,\n      'Missing string value for: ' + property\n    );\n  }\n  return data[property] as string;\n}\n","/**\n * @license\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  firestoreClientDeleteAllFieldIndexes,\n  firestoreClientSetPersistentCacheIndexAutoCreationEnabled,\n  FirestoreClient\n} from '../core/firestore_client';\nimport { cast } from '../util/input_validation';\nimport { logDebug, logWarn } from '../util/log';\n\nimport { ensureFirestoreConfigured, Firestore } from './database';\n\n/**\n * A `PersistentCacheIndexManager` for configuring persistent cache indexes used\n * for local query execution.\n *\n * To use, call `getPersistentCacheIndexManager()` to get an instance.\n */\nexport class PersistentCacheIndexManager {\n  /** A type string to uniquely identify instances of this class. */\n  readonly type: 'PersistentCacheIndexManager' = 'PersistentCacheIndexManager';\n\n  /** @hideconstructor */\n  constructor(readonly _client: FirestoreClient) {}\n}\n\n/**\n * Returns the PersistentCache Index Manager used by the given `Firestore`\n * object.\n *\n * @return The `PersistentCacheIndexManager` instance, or `null` if local\n * persistent storage is not in use.\n */\nexport function getPersistentCacheIndexManager(\n  firestore: Firestore\n): PersistentCacheIndexManager | null {\n  firestore = cast(firestore, Firestore);\n\n  const cachedInstance = persistentCacheIndexManagerByFirestore.get(firestore);\n  if (cachedInstance) {\n    return cachedInstance;\n  }\n\n  const client = ensureFirestoreConfigured(firestore);\n  if (client._uninitializedComponentsProvider?._offlineKind !== 'persistent') {\n    return null;\n  }\n\n  const instance = new PersistentCacheIndexManager(client);\n  persistentCacheIndexManagerByFirestore.set(firestore, instance);\n  return instance;\n}\n\n/**\n * Enables the SDK to create persistent cache indexes automatically for local\n * query execution when the SDK believes cache indexes can help improve\n * performance.\n *\n * This feature is disabled by default.\n */\nexport function enablePersistentCacheIndexAutoCreation(\n  indexManager: PersistentCacheIndexManager\n): void {\n  setPersistentCacheIndexAutoCreationEnabled(indexManager, true);\n}\n\n/**\n * Stops creating persistent cache indexes automatically for local query\n * execution. The indexes which have been created by calling\n * `enablePersistentCacheIndexAutoCreation()` still take effect.\n */\nexport function disablePersistentCacheIndexAutoCreation(\n  indexManager: PersistentCacheIndexManager\n): void {\n  setPersistentCacheIndexAutoCreationEnabled(indexManager, false);\n}\n\n/**\n * Removes all persistent cache indexes.\n *\n * Please note this function will also deletes indexes generated by\n * `setIndexConfiguration()`, which is deprecated.\n */\nexport function deleteAllPersistentCacheIndexes(\n  indexManager: PersistentCacheIndexManager\n): void {\n  indexManager._client.verifyNotTerminated();\n\n  const promise = firestoreClientDeleteAllFieldIndexes(indexManager._client);\n\n  promise\n    .then(_ => logDebug('deleting all persistent cache indexes succeeded'))\n    .catch(error =>\n      logWarn('deleting all persistent cache indexes failed', error)\n    );\n}\n\nfunction setPersistentCacheIndexAutoCreationEnabled(\n  indexManager: PersistentCacheIndexManager,\n  isEnabled: boolean\n): void {\n  indexManager._client.verifyNotTerminated();\n\n  const promise = firestoreClientSetPersistentCacheIndexAutoCreationEnabled(\n    indexManager._client,\n    isEnabled\n  );\n\n  promise\n    .then(_ =>\n      logDebug(\n        `setting persistent cache index auto creation ` +\n          `isEnabled=${isEnabled} succeeded`\n      )\n    )\n    .catch(error =>\n      logWarn(\n        `setting persistent cache index auto creation ` +\n          `isEnabled=${isEnabled} failed`,\n        error\n      )\n    );\n}\n\n/**\n * Maps `Firestore` instances to their corresponding\n * `PersistentCacheIndexManager` instances.\n *\n * Use a `WeakMap` so that the mapping will be automatically dropped when the\n * `Firestore` instance is garbage collected. This emulates a private member\n * as described in https://goo.gle/454yvug.\n */\nconst persistentCacheIndexManagerByFirestore = new WeakMap<\n  Firestore,\n  PersistentCacheIndexManager\n>();\n","/**\n * @license\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Unsubscribe } from '../api/reference_impl';\n\nimport {\n  setTestingHooksSpi,\n  ExistenceFilterMismatchInfo,\n  TestingHooksSpi\n} from './testing_hooks_spi';\n\n/**\n * Testing hooks for use by Firestore's integration test suite to reach into the\n * SDK internals to validate logic and behavior that is not visible from the\n * public API surface.\n *\n * @internal\n */\nexport class TestingHooks {\n  private constructor() {\n    throw new Error('instances of this class should not be created');\n  }\n\n  /**\n   * Registers a callback to be notified when an existence filter mismatch\n   * occurs in the Watch listen stream.\n   *\n   * The relative order in which callbacks are notified is unspecified; do not\n   * rely on any particular ordering. If a given callback is registered multiple\n   * times then it will be notified multiple times, once per registration.\n   *\n   * @param callback the callback to invoke upon existence filter mismatch.\n   *\n   * @return a function that, when called, unregisters the given callback; only\n   * the first invocation of the returned function does anything; all subsequent\n   * invocations do nothing.\n   */\n  static onExistenceFilterMismatch(\n    callback: ExistenceFilterMismatchCallback\n  ): Unsubscribe {\n    return TestingHooksSpiImpl.instance.onExistenceFilterMismatch(callback);\n  }\n}\n\n/**\n * The signature of callbacks registered with\n * `TestingUtils.onExistenceFilterMismatch()`.\n *\n * The return value, if any, is ignored.\n *\n * @internal\n */\nexport type ExistenceFilterMismatchCallback = (\n  info: ExistenceFilterMismatchInfo\n) => unknown;\n\n/**\n * The implementation of `TestingHooksSpi`.\n */\nclass TestingHooksSpiImpl implements TestingHooksSpi {\n  private readonly existenceFilterMismatchCallbacksById = new Map<\n    Symbol,\n    ExistenceFilterMismatchCallback\n  >();\n\n  private constructor() {}\n\n  static get instance(): TestingHooksSpiImpl {\n    if (!testingHooksSpiImplInstance) {\n      testingHooksSpiImplInstance = new TestingHooksSpiImpl();\n      setTestingHooksSpi(testingHooksSpiImplInstance);\n    }\n    return testingHooksSpiImplInstance;\n  }\n\n  notifyOnExistenceFilterMismatch(info: ExistenceFilterMismatchInfo): void {\n    this.existenceFilterMismatchCallbacksById.forEach(callback =>\n      callback(info)\n    );\n  }\n\n  onExistenceFilterMismatch(\n    callback: ExistenceFilterMismatchCallback\n  ): Unsubscribe {\n    const id = Symbol();\n    const callbacks = this.existenceFilterMismatchCallbacksById;\n    callbacks.set(id, callback);\n    return () => callbacks.delete(id);\n  }\n}\n\nlet testingHooksSpiImplInstance: TestingHooksSpiImpl | null = null;\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  _registerComponent,\n  registerVersion,\n  SDK_VERSION\n} from '@firebase/app';\nimport { Component, ComponentType } from '@firebase/component';\n\nimport { name, version } from '../package.json';\nimport {\n  FirebaseAppCheckTokenProvider,\n  FirebaseAuthCredentialsProvider\n} from '../src/api/credentials';\nimport { setSDKVersion } from '../src/core/version';\n\nimport { Firestore } from './api/database';\nimport { databaseIdFromApp } from './core/database_info';\n\nexport function registerFirestore(\n  variant?: string,\n  useFetchStreams = true\n): void {\n  setSDKVersion(SDK_VERSION);\n  _registerComponent(\n    new Component(\n      'firestore',\n      (container, { instanceIdentifier: databaseId, options: settings }) => {\n        const app = container.getProvider('app').getImmediate()!;\n        const firestoreInstance = new Firestore(\n          new FirebaseAuthCredentialsProvider(\n            container.getProvider('auth-internal')\n          ),\n          new FirebaseAppCheckTokenProvider(\n            container.getProvider('app-check-internal')\n          ),\n          databaseIdFromApp(app, databaseId),\n          app\n        );\n        settings = { useFetchStreams, ...settings };\n        firestoreInstance._setSettings(settings);\n        return firestoreInstance;\n      },\n      'PUBLIC' as ComponentType.PUBLIC\n    ).setMultipleInstances(true)\n  );\n  registerVersion(name, version, variant);\n  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation\n  registerVersion(name, version, '__BUILD_TARGET__');\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FieldValue } from './field_value';\nimport {\n  ArrayRemoveFieldValueImpl,\n  ArrayUnionFieldValueImpl,\n  DeleteFieldValueImpl,\n  NumericIncrementFieldValueImpl,\n  ServerTimestampFieldValueImpl\n} from './user_data_reader';\n\n/**\n * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or\n * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.\n */\nexport function deleteField(): FieldValue {\n  return new DeleteFieldValueImpl('deleteField');\n}\n\n/**\n * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to\n * include a server-generated timestamp in the written data.\n */\nexport function serverTimestamp(): FieldValue {\n  return new ServerTimestampFieldValueImpl('serverTimestamp');\n}\n\n/**\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to union the given elements with any array\n * value that already exists on the server. Each specified element that doesn't\n * already exist in the array will be added to the end. If the field being\n * modified is not already an array it will be overwritten with an array\n * containing exactly the specified elements.\n *\n * @param elements - The elements to union into the array.\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\n * `updateDoc()`.\n */\nexport function arrayUnion(...elements: unknown[]): FieldValue {\n  // NOTE: We don't actually parse the data until it's used in set() or\n  // update() since we'd need the Firestore instance to do this.\n  return new ArrayUnionFieldValueImpl('arrayUnion', elements);\n}\n\n/**\n * Returns a special value that can be used with {@link (setDoc:1)} or {@link\n * updateDoc:1} that tells the server to remove the given elements from any\n * array value that already exists on the server. All instances of each element\n * specified will be removed from the array. If the field being modified is not\n * already an array it will be overwritten with an empty array.\n *\n * @param elements - The elements to remove from the array.\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\n * `updateDoc()`\n */\nexport function arrayRemove(...elements: unknown[]): FieldValue {\n  // NOTE: We don't actually parse the data until it's used in set() or\n  // update() since we'd need the Firestore instance to do this.\n  return new ArrayRemoveFieldValueImpl('arrayRemove', elements);\n}\n\n/**\n * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link\n * @firebase/firestore/lite#(updateDoc:1)} that tells the server to increment the field's current value by\n * the given value.\n *\n * If either the operand or the current field value uses floating point\n * precision, all arithmetic follows IEEE 754 semantics. If both values are\n * integers, values outside of JavaScript's safe number range\n * (`Number.MIN_SAFE_INTEGER` to `Number.MAX_SAFE_INTEGER`) are also subject to\n * precision loss. Furthermore, once processed by the Firestore backend, all\n * integer operations are capped between -2^63 and 2^63-1.\n *\n * If the current field value is not of type `number`, or if the field does not\n * yet exist, the transformation sets the field to the given value.\n *\n * @param n - The value to increment by.\n * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or\n * `updateDoc()`\n */\nexport function increment(n: number): FieldValue {\n  return new NumericIncrementFieldValueImpl('increment', n);\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BundleSource } from '../../util/bundle_reader';\nimport { toByteStreamReaderHelper } from '../../util/byte_stream';\n\n/**\n * On web, a `ReadableStream` is wrapped around by a `ByteStreamReader`.\n */\nexport function toByteStreamReader(\n  source: BundleSource,\n  bytesPerRead: number\n): ReadableStreamReader<Uint8Array> {\n  if (source instanceof Uint8Array) {\n    return toByteStreamReaderHelper(source, bytesPerRead);\n  }\n  if (source instanceof ArrayBuffer) {\n    return toByteStreamReaderHelper(new Uint8Array(source), bytesPerRead);\n  }\n  if (source instanceof ReadableStream) {\n    return source.getReader();\n  }\n  throw new Error(\n    'Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream'\n  );\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Returns true iff the array contains the value using strong equality.\n */\nexport function includes<T>(array: T[], value: T): boolean {\n  for (let i = 0; i < array.length; i++) {\n    if (array[i] === value) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * Returns true iff the array contains any value mathching the predicate\n */\nexport function some<T>(array: T[], predicate: (t: T) => boolean): boolean {\n  for (let i = 0; i < array.length; i++) {\n    if (predicate(array[i])) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * Calls predicate function for each item in the array until the predicate\n * returns true, at which point the index of that item is returned.  If the\n * predicate does not return true for any item, null is returned.\n */\nexport function findIndex<A>(\n  array: A[],\n  predicate: (value: A) => boolean\n): number | null {\n  for (let i = 0; i < array.length; i++) {\n    if (predicate(array[i])) {\n      return i;\n    }\n  }\n  return null;\n}\n\n/**\n * Compares two array for equality using comparator. The method computes the\n * intersection and invokes `onAdd` for every element that is in `after` but not\n * `before`. `onRemove` is invoked for every element in `before` but missing\n * from `after`.\n *\n * The method creates a copy of both `before` and `after` and runs in O(n log\n * n), where n is the size of the two lists.\n *\n * @param before - The elements that exist in the original array.\n * @param after - The elements to diff against the original array.\n * @param comparator - The comparator for the elements in before and after.\n * @param onAdd - A function to invoke for every element that is part of `\n * after` but not `before`.\n * @param onRemove - A function to invoke for every element that is part of\n * `before` but not `after`.\n */\nexport function diffArrays<T>(\n  before: T[],\n  after: T[],\n  comparator: (l: T, r: T) => number,\n  onAdd: (entry: T) => void,\n  onRemove: (entry: T) => void\n): void {\n  before = [...before];\n  after = [...after];\n  before.sort(comparator);\n  after.sort(comparator);\n\n  const bLen = before.length;\n  const aLen = after.length;\n  let a = 0;\n  let b = 0;\n  while (a < aLen && b < bLen) {\n    const cmp = comparator(before[b], after[a]);\n    if (cmp < 0) {\n      // The element was removed if the next element in our ordered\n      // walkthrough is only in `before`.\n      onRemove(before[b++]);\n    } else if (cmp > 0) {\n      // The element was added if the next element in our ordered walkthrough\n      // is only in `after`.\n      onAdd(after[a++]);\n    } else {\n      a++;\n      b++;\n    }\n  }\n  while (a < aLen) {\n    onAdd(after[a++]);\n  }\n  while (b < bLen) {\n    onRemove(before[b++]);\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WriteBatch } from '../lite-api/write_batch';\nimport { cast } from '../util/input_validation';\n\nimport { ensureFirestoreConfigured, Firestore } from './database';\nimport { executeWrite } from './reference_impl';\n\nexport { WriteBatch };\n\n/**\n * Creates a write batch, used for performing multiple writes as a single\n * atomic operation. The maximum number of writes allowed in a single {@link WriteBatch}\n * is 500.\n *\n * Unlike transactions, write batches are persisted offline and therefore are\n * preferable when you don't need to condition your writes on read data.\n *\n * @returns A {@link WriteBatch} that can be used to atomically execute multiple\n * writes.\n */\nexport function writeBatch(firestore: Firestore): WriteBatch {\n  firestore = cast(firestore, Firestore);\n  ensureFirestoreConfigured(firestore);\n  return new WriteBatch(firestore, mutations =>\n    executeWrite(firestore, mutations)\n  );\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CONSTANTS } from './constants';\n\n/**\n * Throws an error if the provided assertion is falsy\n */\nexport const assert = function (assertion: unknown, message: string): void {\n  if (!assertion) {\n    throw assertionError(message);\n  }\n};\n\n/**\n * Returns an Error object suitable for throwing.\n */\nexport const assertionError = function (message: string): Error {\n  return new Error(\n    'Firebase Database (' +\n      CONSTANTS.SDK_VERSION +\n      ') INTERNAL ASSERT FAILED: ' +\n      message\n  );\n};\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst stringToByteArray = function (str: string): number[] {\n  // TODO(user): Use native implementations if/when available\n  const out: number[] = [];\n  let p = 0;\n  for (let i = 0; i < str.length; i++) {\n    let c = str.charCodeAt(i);\n    if (c < 128) {\n      out[p++] = c;\n    } else if (c < 2048) {\n      out[p++] = (c >> 6) | 192;\n      out[p++] = (c & 63) | 128;\n    } else if (\n      (c & 0xfc00) === 0xd800 &&\n      i + 1 < str.length &&\n      (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00\n    ) {\n      // Surrogate Pair\n      c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff);\n      out[p++] = (c >> 18) | 240;\n      out[p++] = ((c >> 12) & 63) | 128;\n      out[p++] = ((c >> 6) & 63) | 128;\n      out[p++] = (c & 63) | 128;\n    } else {\n      out[p++] = (c >> 12) | 224;\n      out[p++] = ((c >> 6) & 63) | 128;\n      out[p++] = (c & 63) | 128;\n    }\n  }\n  return out;\n};\n\n/**\n * Turns an array of numbers into the string given by the concatenation of the\n * characters to which the numbers correspond.\n * @param bytes Array of numbers representing characters.\n * @return Stringification of the array.\n */\nconst byteArrayToString = function (bytes: number[]): string {\n  // TODO(user): Use native implementations if/when available\n  const out: string[] = [];\n  let pos = 0,\n    c = 0;\n  while (pos < bytes.length) {\n    const c1 = bytes[pos++];\n    if (c1 < 128) {\n      out[c++] = String.fromCharCode(c1);\n    } else if (c1 > 191 && c1 < 224) {\n      const c2 = bytes[pos++];\n      out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\n    } else if (c1 > 239 && c1 < 365) {\n      // Surrogate Pair\n      const c2 = bytes[pos++];\n      const c3 = bytes[pos++];\n      const c4 = bytes[pos++];\n      const u =\n        (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) -\n        0x10000;\n      out[c++] = String.fromCharCode(0xd800 + (u >> 10));\n      out[c++] = String.fromCharCode(0xdc00 + (u & 1023));\n    } else {\n      const c2 = bytes[pos++];\n      const c3 = bytes[pos++];\n      out[c++] = String.fromCharCode(\n        ((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)\n      );\n    }\n  }\n  return out.join('');\n};\n\ninterface Base64 {\n  byteToCharMap_: { [key: number]: string } | null;\n  charToByteMap_: { [key: string]: number } | null;\n  byteToCharMapWebSafe_: { [key: number]: string } | null;\n  charToByteMapWebSafe_: { [key: string]: number } | null;\n  ENCODED_VALS_BASE: string;\n  readonly ENCODED_VALS: string;\n  readonly ENCODED_VALS_WEBSAFE: string;\n  HAS_NATIVE_SUPPORT: boolean;\n  encodeByteArray(input: number[] | Uint8Array, webSafe?: boolean): string;\n  encodeString(input: string, webSafe?: boolean): string;\n  decodeString(input: string, webSafe: boolean): string;\n  decodeStringToByteArray(input: string, webSafe: boolean): number[];\n  init_(): void;\n}\n\n// We define it as an object literal instead of a class because a class compiled down to es5 can't\n// be treeshaked. https://github.com/rollup/rollup/issues/1691\n// Static lookup maps, lazily populated by init_()\nexport const base64: Base64 = {\n  /**\n   * Maps bytes to characters.\n   */\n  byteToCharMap_: null,\n\n  /**\n   * Maps characters to bytes.\n   */\n  charToByteMap_: null,\n\n  /**\n   * Maps bytes to websafe characters.\n   * @private\n   */\n  byteToCharMapWebSafe_: null,\n\n  /**\n   * Maps websafe characters to bytes.\n   * @private\n   */\n  charToByteMapWebSafe_: null,\n\n  /**\n   * Our default alphabet, shared between\n   * ENCODED_VALS and ENCODED_VALS_WEBSAFE\n   */\n  ENCODED_VALS_BASE:\n    'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789',\n\n  /**\n   * Our default alphabet. Value 64 (=) is special; it means \"nothing.\"\n   */\n  get ENCODED_VALS() {\n    return this.ENCODED_VALS_BASE + '+/=';\n  },\n\n  /**\n   * Our websafe alphabet.\n   */\n  get ENCODED_VALS_WEBSAFE() {\n    return this.ENCODED_VALS_BASE + '-_.';\n  },\n\n  /**\n   * Whether this browser supports the atob and btoa functions. This extension\n   * started at Mozilla but is now implemented by many browsers. We use the\n   * ASSUME_* variables to avoid pulling in the full useragent detection library\n   * but still allowing the standard per-browser compilations.\n   *\n   */\n  HAS_NATIVE_SUPPORT: typeof atob === 'function',\n\n  /**\n   * Base64-encode an array of bytes.\n   *\n   * @param input An array of bytes (numbers with\n   *     value in [0, 255]) to encode.\n   * @param webSafe Boolean indicating we should use the\n   *     alternative alphabet.\n   * @return The base64 encoded string.\n   */\n  encodeByteArray(input: number[] | Uint8Array, webSafe?: boolean): string {\n    if (!Array.isArray(input)) {\n      throw Error('encodeByteArray takes an array as a parameter');\n    }\n\n    this.init_();\n\n    const byteToCharMap = webSafe\n      ? this.byteToCharMapWebSafe_!\n      : this.byteToCharMap_!;\n\n    const output = [];\n\n    for (let i = 0; i < input.length; i += 3) {\n      const byte1 = input[i];\n      const haveByte2 = i + 1 < input.length;\n      const byte2 = haveByte2 ? input[i + 1] : 0;\n      const haveByte3 = i + 2 < input.length;\n      const byte3 = haveByte3 ? input[i + 2] : 0;\n\n      const outByte1 = byte1 >> 2;\n      const outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4);\n      let outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6);\n      let outByte4 = byte3 & 0x3f;\n\n      if (!haveByte3) {\n        outByte4 = 64;\n\n        if (!haveByte2) {\n          outByte3 = 64;\n        }\n      }\n\n      output.push(\n        byteToCharMap[outByte1],\n        byteToCharMap[outByte2],\n        byteToCharMap[outByte3],\n        byteToCharMap[outByte4]\n      );\n    }\n\n    return output.join('');\n  },\n\n  /**\n   * Base64-encode a string.\n   *\n   * @param input A string to encode.\n   * @param webSafe If true, we should use the\n   *     alternative alphabet.\n   * @return The base64 encoded string.\n   */\n  encodeString(input: string, webSafe?: boolean): string {\n    // Shortcut for Mozilla browsers that implement\n    // a native base64 encoder in the form of \"btoa/atob\"\n    if (this.HAS_NATIVE_SUPPORT && !webSafe) {\n      return btoa(input);\n    }\n    return this.encodeByteArray(stringToByteArray(input), webSafe);\n  },\n\n  /**\n   * Base64-decode a string.\n   *\n   * @param input to decode.\n   * @param webSafe True if we should use the\n   *     alternative alphabet.\n   * @return string representing the decoded value.\n   */\n  decodeString(input: string, webSafe: boolean): string {\n    // Shortcut for Mozilla browsers that implement\n    // a native base64 encoder in the form of \"btoa/atob\"\n    if (this.HAS_NATIVE_SUPPORT && !webSafe) {\n      return atob(input);\n    }\n    return byteArrayToString(this.decodeStringToByteArray(input, webSafe));\n  },\n\n  /**\n   * Base64-decode a string.\n   *\n   * In base-64 decoding, groups of four characters are converted into three\n   * bytes.  If the encoder did not apply padding, the input length may not\n   * be a multiple of 4.\n   *\n   * In this case, the last group will have fewer than 4 characters, and\n   * padding will be inferred.  If the group has one or two characters, it decodes\n   * to one byte.  If the group has three characters, it decodes to two bytes.\n   *\n   * @param input Input to decode.\n   * @param webSafe True if we should use the web-safe alphabet.\n   * @return bytes representing the decoded value.\n   */\n  decodeStringToByteArray(input: string, webSafe: boolean): number[] {\n    this.init_();\n\n    const charToByteMap = webSafe\n      ? this.charToByteMapWebSafe_!\n      : this.charToByteMap_!;\n\n    const output: number[] = [];\n\n    for (let i = 0; i < input.length; ) {\n      const byte1 = charToByteMap[input.charAt(i++)];\n\n      const haveByte2 = i < input.length;\n      const byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;\n      ++i;\n\n      const haveByte3 = i < input.length;\n      const byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;\n      ++i;\n\n      const haveByte4 = i < input.length;\n      const byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;\n      ++i;\n\n      if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {\n        throw new DecodeBase64StringError();\n      }\n\n      const outByte1 = (byte1 << 2) | (byte2 >> 4);\n      output.push(outByte1);\n\n      if (byte3 !== 64) {\n        const outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2);\n        output.push(outByte2);\n\n        if (byte4 !== 64) {\n          const outByte3 = ((byte3 << 6) & 0xc0) | byte4;\n          output.push(outByte3);\n        }\n      }\n    }\n\n    return output;\n  },\n\n  /**\n   * Lazy static initialization function. Called before\n   * accessing any of the static map variables.\n   * @private\n   */\n  init_() {\n    if (!this.byteToCharMap_) {\n      this.byteToCharMap_ = {};\n      this.charToByteMap_ = {};\n      this.byteToCharMapWebSafe_ = {};\n      this.charToByteMapWebSafe_ = {};\n\n      // We want quick mappings back and forth, so we precompute two maps.\n      for (let i = 0; i < this.ENCODED_VALS.length; i++) {\n        this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i);\n        this.charToByteMap_[this.byteToCharMap_[i]] = i;\n        this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i);\n        this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i;\n\n        // Be forgiving when decoding and correctly decode both encodings.\n        if (i >= this.ENCODED_VALS_BASE.length) {\n          this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i;\n          this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i;\n        }\n      }\n    }\n  }\n};\n\n/**\n * An error encountered while decoding base64 string.\n */\nexport class DecodeBase64StringError extends Error {\n  readonly name = 'DecodeBase64StringError';\n}\n\n/**\n * URL-safe base64 encoding\n */\nexport const base64Encode = function (str: string): string {\n  const utf8Bytes = stringToByteArray(str);\n  return base64.encodeByteArray(utf8Bytes, true);\n};\n\n/**\n * URL-safe base64 encoding (without \".\" padding in the end).\n * e.g. Used in JSON Web Token (JWT) parts.\n */\nexport const base64urlEncodeWithoutPadding = function (str: string): string {\n  // Use base64url encoding and remove padding in the end (dot characters).\n  return base64Encode(str).replace(/\\./g, '');\n};\n\n/**\n * URL-safe base64 decoding\n *\n * NOTE: DO NOT use the global atob() function - it does NOT support the\n * base64Url variant encoding.\n *\n * @param str To be decoded\n * @return Decoded result, if possible\n */\nexport const base64Decode = function (str: string): string | null {\n  try {\n    return base64.decodeString(str, true);\n  } catch (e) {\n    console.error('base64Decode failed: ', e);\n  }\n  return null;\n};\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Do a deep-copy of basic JavaScript Objects or Arrays.\n */\nexport function deepCopy<T>(value: T): T {\n  return deepExtend(undefined, value) as T;\n}\n\n/**\n * Copy properties from source to target (recursively allows extension\n * of Objects and Arrays).  Scalar values in the target are over-written.\n * If target is undefined, an object of the appropriate type will be created\n * (and returned).\n *\n * We recursively copy all child properties of plain Objects in the source- so\n * that namespace- like dictionaries are merged.\n *\n * Note that the target can be a function, in which case the properties in\n * the source Object are copied onto it as static properties of the Function.\n *\n * Note: we don't merge __proto__ to prevent prototype pollution\n */\nexport function deepExtend(target: unknown, source: unknown): unknown {\n  if (!(source instanceof Object)) {\n    return source;\n  }\n\n  switch (source.constructor) {\n    case Date:\n      // Treat Dates like scalars; if the target date object had any child\n      // properties - they will be lost!\n      const dateValue = source as Date;\n      return new Date(dateValue.getTime());\n\n    case Object:\n      if (target === undefined) {\n        target = {};\n      }\n      break;\n    case Array:\n      // Always copy the array source and overwrite the target.\n      target = [];\n      break;\n\n    default:\n      // Not a plain Object - treat it as a scalar.\n      return source;\n  }\n\n  for (const prop in source) {\n    // use isValidKey to guard against prototype pollution. See https://snyk.io/vuln/SNYK-JS-LODASH-450202\n    if (!source.hasOwnProperty(prop) || !isValidKey(prop)) {\n      continue;\n    }\n    (target as Record<string, unknown>)[prop] = deepExtend(\n      (target as Record<string, unknown>)[prop],\n      (source as Record<string, unknown>)[prop]\n    );\n  }\n\n  return target;\n}\n\nfunction isValidKey(key: string): boolean {\n  return key !== '__proto__';\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Polyfill for `globalThis` object.\n * @returns the `globalThis` object for the given environment.\n * @public\n */\nexport function getGlobal(): typeof globalThis {\n  if (typeof self !== 'undefined') {\n    return self;\n  }\n  if (typeof window !== 'undefined') {\n    return window;\n  }\n  if (typeof global !== 'undefined') {\n    return global;\n  }\n  throw new Error('Unable to locate global object.');\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { base64Decode } from './crypt';\nimport { getGlobal } from './global';\n\n/**\n * Keys for experimental properties on the `FirebaseDefaults` object.\n * @public\n */\nexport type ExperimentalKey = 'authTokenSyncURL' | 'authIdTokenMaxAge';\n\n/**\n * An object that can be injected into the environment as __FIREBASE_DEFAULTS__,\n * either as a property of globalThis, a shell environment variable, or a\n * cookie.\n *\n * This object can be used to automatically configure and initialize\n * a Firebase app as well as any emulators.\n *\n * @public\n */\nexport interface FirebaseDefaults {\n  config?: Record<string, string>;\n  emulatorHosts?: Record<string, string>;\n  _authTokenSyncURL?: string;\n  _authIdTokenMaxAge?: number;\n  /**\n   * Override Firebase's runtime environment detection and\n   * force the SDK to act as if it were in the specified environment.\n   */\n  forceEnvironment?: 'browser' | 'node';\n  [key: string]: unknown;\n}\n\ndeclare global {\n  // Need `var` for this to work.\n  // eslint-disable-next-line no-var\n  var __FIREBASE_DEFAULTS__: FirebaseDefaults | undefined;\n}\n\nconst getDefaultsFromGlobal = (): FirebaseDefaults | undefined =>\n  getGlobal().__FIREBASE_DEFAULTS__;\n\n/**\n * Attempt to read defaults from a JSON string provided to\n * process(.)env(.)__FIREBASE_DEFAULTS__ or a JSON file whose path is in\n * process(.)env(.)__FIREBASE_DEFAULTS_PATH__\n * The dots are in parens because certain compilers (Vite?) cannot\n * handle seeing that variable in comments.\n * See https://github.com/firebase/firebase-js-sdk/issues/6838\n */\nconst getDefaultsFromEnvVariable = (): FirebaseDefaults | undefined => {\n  if (typeof process === 'undefined' || typeof process.env === 'undefined') {\n    return;\n  }\n  const defaultsJsonString = process.env.__FIREBASE_DEFAULTS__;\n  if (defaultsJsonString) {\n    return JSON.parse(defaultsJsonString);\n  }\n};\n\nconst getDefaultsFromCookie = (): FirebaseDefaults | undefined => {\n  if (typeof document === 'undefined') {\n    return;\n  }\n  let match;\n  try {\n    match = document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/);\n  } catch (e) {\n    // Some environments such as Angular Universal SSR have a\n    // `document` object but error on accessing `document.cookie`.\n    return;\n  }\n  const decoded = match && base64Decode(match[1]);\n  return decoded && JSON.parse(decoded);\n};\n\n/**\n * Get the __FIREBASE_DEFAULTS__ object. It checks in order:\n * (1) if such an object exists as a property of `globalThis`\n * (2) if such an object was provided on a shell environment variable\n * (3) if such an object exists in a cookie\n * @public\n */\nexport const getDefaults = (): FirebaseDefaults | undefined => {\n  try {\n    return (\n      getDefaultsFromGlobal() ||\n      getDefaultsFromEnvVariable() ||\n      getDefaultsFromCookie()\n    );\n  } catch (e) {\n    /**\n     * Catch-all for being unable to get __FIREBASE_DEFAULTS__ due\n     * to any environment case we have not accounted for. Log to\n     * info instead of swallowing so we can find these unknown cases\n     * and add paths for them if needed.\n     */\n    console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);\n    return;\n  }\n};\n\n/**\n * Returns emulator host stored in the __FIREBASE_DEFAULTS__ object\n * for the given product.\n * @returns a URL host formatted like `127.0.0.1:9999` or `[::1]:4000` if available\n * @public\n */\nexport const getDefaultEmulatorHost = (\n  productName: string\n): string | undefined => getDefaults()?.emulatorHosts?.[productName];\n\n/**\n * Returns emulator hostname and port stored in the __FIREBASE_DEFAULTS__ object\n * for the given product.\n * @returns a pair of hostname and port like `[\"::1\", 4000]` if available\n * @public\n */\nexport const getDefaultEmulatorHostnameAndPort = (\n  productName: string\n): [hostname: string, port: number] | undefined => {\n  const host = getDefaultEmulatorHost(productName);\n  if (!host) {\n    return undefined;\n  }\n  const separatorIndex = host.lastIndexOf(':'); // Finding the last since IPv6 addr also has colons.\n  if (separatorIndex <= 0 || separatorIndex + 1 === host.length) {\n    throw new Error(`Invalid host ${host} with no separate hostname and port!`);\n  }\n  // eslint-disable-next-line no-restricted-globals\n  const port = parseInt(host.substring(separatorIndex + 1), 10);\n  if (host[0] === '[') {\n    // Bracket-quoted `[ipv6addr]:port` => return \"ipv6addr\" (without brackets).\n    return [host.substring(1, separatorIndex - 1), port];\n  } else {\n    return [host.substring(0, separatorIndex), port];\n  }\n};\n\n/**\n * Returns Firebase app config stored in the __FIREBASE_DEFAULTS__ object.\n * @public\n */\nexport const getDefaultAppConfig = (): Record<string, string> | undefined =>\n  getDefaults()?.config;\n\n/**\n * Returns an experimental setting on the __FIREBASE_DEFAULTS__ object (properties\n * prefixed by \"_\")\n * @public\n */\nexport const getExperimentalSetting = <T extends ExperimentalKey>(\n  name: T\n): FirebaseDefaults[`_${T}`] =>\n  getDefaults()?.[`_${name}`] as FirebaseDefaults[`_${T}`];\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport class Deferred<R> {\n  promise: Promise<R>;\n  reject: (value?: unknown) => void = () => {};\n  resolve: (value?: unknown) => void = () => {};\n  constructor() {\n    this.promise = new Promise((resolve, reject) => {\n      this.resolve = resolve as (value?: unknown) => void;\n      this.reject = reject as (value?: unknown) => void;\n    });\n  }\n\n  /**\n   * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around\n   * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback\n   * and returns a node-style callback which will resolve or reject the Deferred's promise.\n   */\n  wrapCallback(\n    callback?: (error?: unknown, value?: unknown) => void\n  ): (error: unknown, value?: unknown) => void {\n    return (error, value?) => {\n      if (error) {\n        this.reject(error);\n      } else {\n        this.resolve(value);\n      }\n      if (typeof callback === 'function') {\n        // Attaching noop handler just in case developer wasn't expecting\n        // promises\n        this.promise.catch(() => {});\n\n        // Some of our callbacks don't expect a value and our own tests\n        // assert that the parameter length is 1\n        if (callback.length === 1) {\n          callback(error);\n        } else {\n          callback(error, value);\n        }\n      }\n    };\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CONSTANTS } from './constants';\nimport { getDefaults } from './defaults';\n\n/**\n * Returns navigator.userAgent string or '' if it's not defined.\n * @return user agent string\n */\nexport function getUA(): string {\n  if (\n    typeof navigator !== 'undefined' &&\n    typeof navigator['userAgent'] === 'string'\n  ) {\n    return navigator['userAgent'];\n  } else {\n    return '';\n  }\n}\n\n/**\n * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.\n *\n * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap\n * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally\n * wait for a callback.\n */\nexport function isMobileCordova(): boolean {\n  return (\n    typeof window !== 'undefined' &&\n    // @ts-ignore Setting up an broadly applicable index signature for Window\n    // just to deal with this case would probably be a bad idea.\n    !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) &&\n    /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA())\n  );\n}\n\n/**\n * Detect Node.js.\n *\n * @return true if Node.js environment is detected or specified.\n */\n// Node detection logic from: https://github.com/iliakan/detect-node/\nexport function isNode(): boolean {\n  const forceEnvironment = getDefaults()?.forceEnvironment;\n  if (forceEnvironment === 'node') {\n    return true;\n  } else if (forceEnvironment === 'browser') {\n    return false;\n  }\n\n  try {\n    return (\n      Object.prototype.toString.call(global.process) === '[object process]'\n    );\n  } catch (e) {\n    return false;\n  }\n}\n\n/**\n * Detect Browser Environment\n */\nexport function isBrowser(): boolean {\n  return typeof self === 'object' && self.self === self;\n}\n\n/**\n * Detect browser extensions (Chrome and Firefox at least).\n */\ninterface BrowserRuntime {\n  id?: unknown;\n}\ndeclare const chrome: { runtime?: BrowserRuntime };\ndeclare const browser: { runtime?: BrowserRuntime };\nexport function isBrowserExtension(): boolean {\n  const runtime =\n    typeof chrome === 'object'\n      ? chrome.runtime\n      : typeof browser === 'object'\n      ? browser.runtime\n      : undefined;\n  return typeof runtime === 'object' && runtime.id !== undefined;\n}\n\n/**\n * Detect React Native.\n *\n * @return true if ReactNative environment is detected.\n */\nexport function isReactNative(): boolean {\n  return (\n    typeof navigator === 'object' && navigator['product'] === 'ReactNative'\n  );\n}\n\n/** Detects Electron apps. */\nexport function isElectron(): boolean {\n  return getUA().indexOf('Electron/') >= 0;\n}\n\n/** Detects Internet Explorer. */\nexport function isIE(): boolean {\n  const ua = getUA();\n  return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0;\n}\n\n/** Detects Universal Windows Platform apps. */\nexport function isUWP(): boolean {\n  return getUA().indexOf('MSAppHost/') >= 0;\n}\n\n/**\n * Detect whether the current SDK build is the Node version.\n *\n * @return true if it's the Node SDK build.\n */\nexport function isNodeSdk(): boolean {\n  return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true;\n}\n\n/** Returns true if we are running in Safari. */\nexport function isSafari(): boolean {\n  return (\n    !isNode() &&\n    !!navigator.userAgent &&\n    navigator.userAgent.includes('Safari') &&\n    !navigator.userAgent.includes('Chrome')\n  );\n}\n\n/**\n * This method checks if indexedDB is supported by current browser/service worker context\n * @return true if indexedDB is supported by current browser/service worker context\n */\nexport function isIndexedDBAvailable(): boolean {\n  try {\n    return typeof indexedDB === 'object';\n  } catch (e) {\n    return false;\n  }\n}\n\n/**\n * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject\n * if errors occur during the database open operation.\n *\n * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox\n * private browsing)\n */\nexport function validateIndexedDBOpenable(): Promise<boolean> {\n  return new Promise((resolve, reject) => {\n    try {\n      let preExist: boolean = true;\n      const DB_CHECK_NAME =\n        'validate-browser-context-for-indexeddb-analytics-module';\n      const request = self.indexedDB.open(DB_CHECK_NAME);\n      request.onsuccess = () => {\n        request.result.close();\n        // delete database only when it doesn't pre-exist\n        if (!preExist) {\n          self.indexedDB.deleteDatabase(DB_CHECK_NAME);\n        }\n        resolve(true);\n      };\n      request.onupgradeneeded = () => {\n        preExist = false;\n      };\n\n      request.onerror = () => {\n        reject(request.error?.message || '');\n      };\n    } catch (error) {\n      reject(error);\n    }\n  });\n}\n\n/**\n *\n * This method checks whether cookie is enabled within current browser\n * @return true if cookie is enabled within current browser\n */\nexport function areCookiesEnabled(): boolean {\n  if (typeof navigator === 'undefined' || !navigator.cookieEnabled) {\n    return false;\n  }\n  return true;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Evaluates a JSON string into a javascript object.\n *\n * @param {string} str A string containing JSON.\n * @return {*} The javascript object representing the specified JSON.\n */\nexport function jsonEval(str: string): unknown {\n  return JSON.parse(str);\n}\n\n/**\n * Returns JSON representing a javascript object.\n * @param {*} data Javascript object to be stringified.\n * @return {string} The JSON contents of the object.\n */\nexport function stringify(data: unknown): string {\n  return JSON.stringify(data);\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { base64Decode } from './crypt';\nimport { jsonEval } from './json';\n\ninterface Claims {\n  [key: string]: {};\n}\n\ninterface DecodedToken {\n  header: object;\n  claims: Claims;\n  data: object;\n  signature: string;\n}\n\n/**\n * Decodes a Firebase auth. token into constituent parts.\n *\n * Notes:\n * - May return with invalid / incomplete claims if there's no native base64 decoding support.\n * - Doesn't check if the token is actually valid.\n */\nexport const decode = function (token: string): DecodedToken {\n  let header = {},\n    claims: Claims = {},\n    data = {},\n    signature = '';\n\n  try {\n    const parts = token.split('.');\n    header = jsonEval(base64Decode(parts[0]) || '') as object;\n    claims = jsonEval(base64Decode(parts[1]) || '') as Claims;\n    signature = parts[2];\n    data = claims['d'] || {};\n    delete claims['d'];\n  } catch (e) {}\n\n  return {\n    header,\n    claims,\n    data,\n    signature\n  };\n};\n\ninterface DecodedToken {\n  header: object;\n  claims: Claims;\n  data: object;\n  signature: string;\n}\n\n/**\n * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the\n * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.\n *\n * Notes:\n * - May return a false negative if there's no native base64 decoding support.\n * - Doesn't check if the token is actually valid.\n */\nexport const isValidTimestamp = function (token: string): boolean {\n  const claims: Claims = decode(token).claims;\n  const now: number = Math.floor(new Date().getTime() / 1000);\n  let validSince: number = 0,\n    validUntil: number = 0;\n\n  if (typeof claims === 'object') {\n    if (claims.hasOwnProperty('nbf')) {\n      validSince = claims['nbf'] as number;\n    } else if (claims.hasOwnProperty('iat')) {\n      validSince = claims['iat'] as number;\n    }\n\n    if (claims.hasOwnProperty('exp')) {\n      validUntil = claims['exp'] as number;\n    } else {\n      // token will expire after 24h by default\n      validUntil = validSince + 86400;\n    }\n  }\n\n  return (\n    !!now &&\n    !!validSince &&\n    !!validUntil &&\n    now >= validSince &&\n    now <= validUntil\n  );\n};\n\n/**\n * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.\n *\n * Notes:\n * - May return null if there's no native base64 decoding support.\n * - Doesn't check if the token is actually valid.\n */\nexport const issuedAtTime = function (token: string): number | null {\n  const claims: Claims = decode(token).claims;\n  if (typeof claims === 'object' && claims.hasOwnProperty('iat')) {\n    return claims['iat'] as number;\n  }\n  return null;\n};\n\n/**\n * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.\n *\n * Notes:\n * - May return a false negative if there's no native base64 decoding support.\n * - Doesn't check if the token is actually valid.\n */\nexport const isValidFormat = function (token: string): boolean {\n  const decoded = decode(token),\n    claims = decoded.claims;\n\n  return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat');\n};\n\n/**\n * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.\n *\n * Notes:\n * - May return a false negative if there's no native base64 decoding support.\n * - Doesn't check if the token is actually valid.\n */\nexport const isAdmin = function (token: string): boolean {\n  const claims: Claims = decode(token).claims;\n  return typeof claims === 'object' && claims['admin'] === true;\n};\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function contains<T extends object>(obj: T, key: string): boolean {\n  return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport function safeGet<T extends object, K extends keyof T>(\n  obj: T,\n  key: K\n): T[K] | undefined {\n  if (Object.prototype.hasOwnProperty.call(obj, key)) {\n    return obj[key];\n  } else {\n    return undefined;\n  }\n}\n\nexport function isEmpty(obj: object): obj is {} {\n  for (const key in obj) {\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\n      return false;\n    }\n  }\n  return true;\n}\n\nexport function map<K extends string, V, U>(\n  obj: { [key in K]: V },\n  fn: (value: V, key: K, obj: { [key in K]: V }) => U,\n  contextObj?: unknown\n): { [key in K]: U } {\n  const res: Partial<{ [key in K]: U }> = {};\n  for (const key in obj) {\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\n      res[key] = fn.call(contextObj, obj[key], key, obj);\n    }\n  }\n  return res as { [key in K]: U };\n}\n\n/**\n * Deep equal two objects. Support Arrays and Objects.\n */\nexport function deepEqual(a: object, b: object): boolean {\n  if (a === b) {\n    return true;\n  }\n\n  const aKeys = Object.keys(a);\n  const bKeys = Object.keys(b);\n  for (const k of aKeys) {\n    if (!bKeys.includes(k)) {\n      return false;\n    }\n\n    const aProp = (a as Record<string, unknown>)[k];\n    const bProp = (b as Record<string, unknown>)[k];\n    if (isObject(aProp) && isObject(bProp)) {\n      if (!deepEqual(aProp, bProp)) {\n        return false;\n      }\n    } else if (aProp !== bProp) {\n      return false;\n    }\n  }\n\n  for (const k of bKeys) {\n    if (!aKeys.includes(k)) {\n      return false;\n    }\n  }\n  return true;\n}\n\nfunction isObject(thing: unknown): thing is object {\n  return thing !== null && typeof thing === 'object';\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport type NextFn<T> = (value: T) => void;\nexport type ErrorFn = (error: Error) => void;\nexport type CompleteFn = () => void;\n\nexport interface Observer<T> {\n  // Called once for each value in a stream of values.\n  next: NextFn<T>;\n\n  // A stream terminates by a single call to EITHER error() or complete().\n  error: ErrorFn;\n\n  // No events will be sent to next() once complete() is called.\n  complete: CompleteFn;\n}\n\nexport type PartialObserver<T> = Partial<Observer<T>>;\n\n// TODO: Support also Unsubscribe.unsubscribe?\nexport type Unsubscribe = () => void;\n\n/**\n * The Subscribe interface has two forms - passing the inline function\n * callbacks, or a object interface with callback properties.\n */\nexport interface Subscribe<T> {\n  (next?: NextFn<T>, error?: ErrorFn, complete?: CompleteFn): Unsubscribe;\n  (observer: PartialObserver<T>): Unsubscribe;\n}\n\nexport interface Observable<T> {\n  // Subscribe method\n  subscribe: Subscribe<T>;\n}\n\nexport type Executor<T> = (observer: Observer<T>) => void;\n\n/**\n * Helper to make a Subscribe function (just like Promise helps make a\n * Thenable).\n *\n * @param executor Function which can make calls to a single Observer\n *     as a proxy.\n * @param onNoObservers Callback when count of Observers goes to zero.\n */\nexport function createSubscribe<T>(\n  executor: Executor<T>,\n  onNoObservers?: Executor<T>\n): Subscribe<T> {\n  const proxy = new ObserverProxy<T>(executor, onNoObservers);\n  return proxy.subscribe.bind(proxy);\n}\n\n/**\n * Implement fan-out for any number of Observers attached via a subscribe\n * function.\n */\nclass ObserverProxy<T> implements Observer<T> {\n  private observers: Array<Observer<T>> | undefined = [];\n  private unsubscribes: Unsubscribe[] = [];\n  private onNoObservers: Executor<T> | undefined;\n  private observerCount = 0;\n  // Micro-task scheduling by calling task.then().\n  private task = Promise.resolve();\n  private finalized = false;\n  private finalError?: Error;\n\n  /**\n   * @param executor Function which can make calls to a single Observer\n   *     as a proxy.\n   * @param onNoObservers Callback when count of Observers goes to zero.\n   */\n  constructor(executor: Executor<T>, onNoObservers?: Executor<T>) {\n    this.onNoObservers = onNoObservers;\n    // Call the executor asynchronously so subscribers that are called\n    // synchronously after the creation of the subscribe function\n    // can still receive the very first value generated in the executor.\n    this.task\n      .then(() => {\n        executor(this);\n      })\n      .catch(e => {\n        this.error(e);\n      });\n  }\n\n  next(value: T): void {\n    this.forEachObserver((observer: Observer<T>) => {\n      observer.next(value);\n    });\n  }\n\n  error(error: Error): void {\n    this.forEachObserver((observer: Observer<T>) => {\n      observer.error(error);\n    });\n    this.close(error);\n  }\n\n  complete(): void {\n    this.forEachObserver((observer: Observer<T>) => {\n      observer.complete();\n    });\n    this.close();\n  }\n\n  /**\n   * Subscribe function that can be used to add an Observer to the fan-out list.\n   *\n   * - We require that no event is sent to a subscriber sychronously to their\n   *   call to subscribe().\n   */\n  subscribe(\n    nextOrObserver?: NextFn<T> | PartialObserver<T>,\n    error?: ErrorFn,\n    complete?: CompleteFn\n  ): Unsubscribe {\n    let observer: Observer<T>;\n\n    if (\n      nextOrObserver === undefined &&\n      error === undefined &&\n      complete === undefined\n    ) {\n      throw new Error('Missing Observer.');\n    }\n\n    // Assemble an Observer object when passed as callback functions.\n    if (\n      implementsAnyMethods(nextOrObserver as { [key: string]: unknown }, [\n        'next',\n        'error',\n        'complete'\n      ])\n    ) {\n      observer = nextOrObserver as Observer<T>;\n    } else {\n      observer = {\n        next: nextOrObserver as NextFn<T>,\n        error,\n        complete\n      } as Observer<T>;\n    }\n\n    if (observer.next === undefined) {\n      observer.next = noop as NextFn<T>;\n    }\n    if (observer.error === undefined) {\n      observer.error = noop as ErrorFn;\n    }\n    if (observer.complete === undefined) {\n      observer.complete = noop as CompleteFn;\n    }\n\n    const unsub = this.unsubscribeOne.bind(this, this.observers!.length);\n\n    // Attempt to subscribe to a terminated Observable - we\n    // just respond to the Observer with the final error or complete\n    // event.\n    if (this.finalized) {\n      // eslint-disable-next-line @typescript-eslint/no-floating-promises\n      this.task.then(() => {\n        try {\n          if (this.finalError) {\n            observer.error(this.finalError);\n          } else {\n            observer.complete();\n          }\n        } catch (e) {\n          // nothing\n        }\n        return;\n      });\n    }\n\n    this.observers!.push(observer as Observer<T>);\n\n    return unsub;\n  }\n\n  // Unsubscribe is synchronous - we guarantee that no events are sent to\n  // any unsubscribed Observer.\n  private unsubscribeOne(i: number): void {\n    if (this.observers === undefined || this.observers[i] === undefined) {\n      return;\n    }\n\n    delete this.observers[i];\n\n    this.observerCount -= 1;\n    if (this.observerCount === 0 && this.onNoObservers !== undefined) {\n      this.onNoObservers(this);\n    }\n  }\n\n  private forEachObserver(fn: (observer: Observer<T>) => void): void {\n    if (this.finalized) {\n      // Already closed by previous event....just eat the additional values.\n      return;\n    }\n\n    // Since sendOne calls asynchronously - there is no chance that\n    // this.observers will become undefined.\n    for (let i = 0; i < this.observers!.length; i++) {\n      this.sendOne(i, fn);\n    }\n  }\n\n  // Call the Observer via one of it's callback function. We are careful to\n  // confirm that the observe has not been unsubscribed since this asynchronous\n  // function had been queued.\n  private sendOne(i: number, fn: (observer: Observer<T>) => void): void {\n    // Execute the callback asynchronously\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\n    this.task.then(() => {\n      if (this.observers !== undefined && this.observers[i] !== undefined) {\n        try {\n          fn(this.observers[i]);\n        } catch (e) {\n          // Ignore exceptions raised in Observers or missing methods of an\n          // Observer.\n          // Log error to console. b/31404806\n          if (typeof console !== 'undefined' && console.error) {\n            console.error(e);\n          }\n        }\n      }\n    });\n  }\n\n  private close(err?: Error): void {\n    if (this.finalized) {\n      return;\n    }\n    this.finalized = true;\n    if (err !== undefined) {\n      this.finalError = err;\n    }\n    // Proxy is no longer needed - garbage collect references\n    // eslint-disable-next-line @typescript-eslint/no-floating-promises\n    this.task.then(() => {\n      this.observers = undefined;\n      this.onNoObservers = undefined;\n    });\n  }\n}\n\n/** Turn synchronous function into one called asynchronously. */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function async(fn: Function, onError?: ErrorFn): Function {\n  return (...args: unknown[]) => {\n    Promise.resolve(true)\n      .then(() => {\n        fn(...args);\n      })\n      .catch((error: Error) => {\n        if (onError) {\n          onError(error);\n        }\n      });\n  };\n}\n\n/**\n * Return true if the object passed in implements any of the named methods.\n */\nfunction implementsAnyMethods(\n  obj: { [key: string]: unknown },\n  methods: string[]\n): boolean {\n  if (typeof obj !== 'object' || obj === null) {\n    return false;\n  }\n\n  for (const method of methods) {\n    if (method in obj && typeof obj[method] === 'function') {\n      return true;\n    }\n  }\n\n  return false;\n}\n\nfunction noop(): void {\n  // do nothing\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Check to make sure the appropriate number of arguments are provided for a public function.\n * Throws an error if it fails.\n *\n * @param fnName The function name\n * @param minCount The minimum number of arguments to allow for the function call\n * @param maxCount The maximum number of argument to allow for the function call\n * @param argCount The actual number of arguments provided.\n */\nexport const validateArgCount = function (\n  fnName: string,\n  minCount: number,\n  maxCount: number,\n  argCount: number\n): void {\n  let argError;\n  if (argCount < minCount) {\n    argError = 'at least ' + minCount;\n  } else if (argCount > maxCount) {\n    argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount;\n  }\n  if (argError) {\n    const error =\n      fnName +\n      ' failed: Was called with ' +\n      argCount +\n      (argCount === 1 ? ' argument.' : ' arguments.') +\n      ' Expects ' +\n      argError +\n      '.';\n    throw new Error(error);\n  }\n};\n\n/**\n * Generates a string to prefix an error message about failed argument validation\n *\n * @param fnName The function name\n * @param argName The name of the argument\n * @return The prefix to add to the error thrown for validation.\n */\nexport function errorPrefix(fnName: string, argName: string): string {\n  return `${fnName} failed: ${argName} argument `;\n}\n\n/**\n * @param fnName\n * @param argumentNumber\n * @param namespace\n * @param optional\n */\nexport function validateNamespace(\n  fnName: string,\n  namespace: string,\n  optional: boolean\n): void {\n  if (optional && !namespace) {\n    return;\n  }\n  if (typeof namespace !== 'string') {\n    //TODO: I should do more validation here. We only allow certain chars in namespaces.\n    throw new Error(\n      errorPrefix(fnName, 'namespace') + 'must be a valid firebase namespace.'\n    );\n  }\n}\n\nexport function validateCallback(\n  fnName: string,\n  argumentName: string,\n  // eslint-disable-next-line @typescript-eslint/ban-types\n  callback: Function,\n  optional: boolean\n): void {\n  if (optional && !callback) {\n    return;\n  }\n  if (typeof callback !== 'function') {\n    throw new Error(\n      errorPrefix(fnName, argumentName) + 'must be a valid function.'\n    );\n  }\n}\n\nexport function validateContextObject(\n  fnName: string,\n  argumentName: string,\n  context: unknown,\n  optional: boolean\n): void {\n  if (optional && !context) {\n    return;\n  }\n  if (typeof context !== 'object' || context === null) {\n    throw new Error(\n      errorPrefix(fnName, argumentName) + 'must be a valid context object.'\n    );\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { assert } from './assert';\n\n// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they\n// automatically replaced '\\r\\n' with '\\n', and they didn't handle surrogate pairs,\n// so it's been modified.\n\n// Note that not all Unicode characters appear as single characters in JavaScript strings.\n// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters\n// use 2 characters in Javascript.  All 4-byte UTF-8 characters begin with a first\n// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate\n// pair).\n// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3\n\n/**\n * @param {string} str\n * @return {Array}\n */\nexport const stringToByteArray = function (str: string): number[] {\n  const out: number[] = [];\n  let p = 0;\n  for (let i = 0; i < str.length; i++) {\n    let c = str.charCodeAt(i);\n\n    // Is this the lead surrogate in a surrogate pair?\n    if (c >= 0xd800 && c <= 0xdbff) {\n      const high = c - 0xd800; // the high 10 bits.\n      i++;\n      assert(i < str.length, 'Surrogate pair missing trail surrogate.');\n      const low = str.charCodeAt(i) - 0xdc00; // the low 10 bits.\n      c = 0x10000 + (high << 10) + low;\n    }\n\n    if (c < 128) {\n      out[p++] = c;\n    } else if (c < 2048) {\n      out[p++] = (c >> 6) | 192;\n      out[p++] = (c & 63) | 128;\n    } else if (c < 65536) {\n      out[p++] = (c >> 12) | 224;\n      out[p++] = ((c >> 6) & 63) | 128;\n      out[p++] = (c & 63) | 128;\n    } else {\n      out[p++] = (c >> 18) | 240;\n      out[p++] = ((c >> 12) & 63) | 128;\n      out[p++] = ((c >> 6) & 63) | 128;\n      out[p++] = (c & 63) | 128;\n    }\n  }\n  return out;\n};\n\n/**\n * Calculate length without actually converting; useful for doing cheaper validation.\n * @param {string} str\n * @return {number}\n */\nexport const stringLength = function (str: string): number {\n  let p = 0;\n  for (let i = 0; i < str.length; i++) {\n    const c = str.charCodeAt(i);\n    if (c < 128) {\n      p++;\n    } else if (c < 2048) {\n      p += 2;\n    } else if (c >= 0xd800 && c <= 0xdbff) {\n      // Lead surrogate of a surrogate pair.  The pair together will take 4 bytes to represent.\n      p += 4;\n      i++; // skip trail surrogate.\n    } else {\n      p += 3;\n    }\n  }\n  return p;\n};\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The amount of milliseconds to exponentially increase.\n */\nconst DEFAULT_INTERVAL_MILLIS = 1000;\n\n/**\n * The factor to backoff by.\n * Should be a number greater than 1.\n */\nconst DEFAULT_BACKOFF_FACTOR = 2;\n\n/**\n * The maximum milliseconds to increase to.\n *\n * <p>Visible for testing\n */\nexport const MAX_VALUE_MILLIS = 4 * 60 * 60 * 1000; // Four hours, like iOS and Android.\n\n/**\n * The percentage of backoff time to randomize by.\n * See\n * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic\n * for context.\n *\n * <p>Visible for testing\n */\nexport const RANDOM_FACTOR = 0.5;\n\n/**\n * Based on the backoff method from\n * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js.\n * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around.\n */\nexport function calculateBackoffMillis(\n  backoffCount: number,\n  intervalMillis: number = DEFAULT_INTERVAL_MILLIS,\n  backoffFactor: number = DEFAULT_BACKOFF_FACTOR\n): number {\n  // Calculates an exponentially increasing value.\n  // Deviation: calculates value from count and a constant interval, so we only need to save value\n  // and count to restore state.\n  const currBaseValue = intervalMillis * Math.pow(backoffFactor, backoffCount);\n\n  // A random \"fuzz\" to avoid waves of retries.\n  // Deviation: randomFactor is required.\n  const randomWait = Math.round(\n    // A fraction of the backoff value to add/subtract.\n    // Deviation: changes multiplication order to improve readability.\n    RANDOM_FACTOR *\n      currBaseValue *\n      // A random float (rounded to int by Math.round above) in the range [-1, 1]. Determines\n      // if we add or subtract.\n      (Math.random() - 0.5) *\n      2\n  );\n\n  // Limits backoff to max to avoid effectively permanent backoff.\n  return Math.min(MAX_VALUE_MILLIS, currBaseValue + randomWait);\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface Compat<T> {\n  _delegate: T;\n}\n\nexport function getModularInstance<ExpService>(\n  service: Compat<ExpService> | ExpService\n): ExpService {\n  if (service && (service as Compat<ExpService>)._delegate) {\n    return (service as Compat<ExpService>)._delegate;\n  } else {\n    return service as ExpService;\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview SHA-1 cryptographic hash.\n * Variable names follow the notation in FIPS PUB 180-3:\n * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.\n *\n * Usage:\n *   var sha1 = new sha1();\n *   sha1.update(bytes);\n *   var hash = sha1.digest();\n *\n * Performance:\n *   Chrome 23:   ~400 Mbit/s\n *   Firefox 16:  ~250 Mbit/s\n *\n */\n\n/**\n * SHA-1 cryptographic hash constructor.\n *\n * The properties declared here are discussed in the above algorithm document.\n * @constructor\n * @final\n * @struct\n */\nexport class Sha1 {\n  /**\n   * Holds the previous values of accumulated variables a-e in the compress_\n   * function.\n   * @private\n   */\n  private chain_: number[] = [];\n\n  /**\n   * A buffer holding the partially computed hash result.\n   * @private\n   */\n  private buf_: number[] = [];\n\n  /**\n   * An array of 80 bytes, each a part of the message to be hashed.  Referred to\n   * as the message schedule in the docs.\n   * @private\n   */\n  private W_: number[] = [];\n\n  /**\n   * Contains data needed to pad messages less than 64 bytes.\n   * @private\n   */\n  private pad_: number[] = [];\n\n  /**\n   * @private {number}\n   */\n  private inbuf_: number = 0;\n\n  /**\n   * @private {number}\n   */\n  private total_: number = 0;\n\n  blockSize: number;\n\n  constructor() {\n    this.blockSize = 512 / 8;\n\n    this.pad_[0] = 128;\n    for (let i = 1; i < this.blockSize; ++i) {\n      this.pad_[i] = 0;\n    }\n\n    this.reset();\n  }\n\n  reset(): void {\n    this.chain_[0] = 0x67452301;\n    this.chain_[1] = 0xefcdab89;\n    this.chain_[2] = 0x98badcfe;\n    this.chain_[3] = 0x10325476;\n    this.chain_[4] = 0xc3d2e1f0;\n\n    this.inbuf_ = 0;\n    this.total_ = 0;\n  }\n\n  /**\n   * Internal compress helper function.\n   * @param buf Block to compress.\n   * @param offset Offset of the block in the buffer.\n   * @private\n   */\n  compress_(buf: number[] | Uint8Array | string, offset?: number): void {\n    if (!offset) {\n      offset = 0;\n    }\n\n    const W = this.W_;\n\n    // get 16 big endian words\n    if (typeof buf === 'string') {\n      for (let i = 0; i < 16; i++) {\n        // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS\n        // have a bug that turns the post-increment ++ operator into pre-increment\n        // during JIT compilation.  We have code that depends heavily on SHA-1 for\n        // correctness and which is affected by this bug, so I've removed all uses\n        // of post-increment ++ in which the result value is used.  We can revert\n        // this change once the Safari bug\n        // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and\n        // most clients have been updated.\n        W[i] =\n          (buf.charCodeAt(offset) << 24) |\n          (buf.charCodeAt(offset + 1) << 16) |\n          (buf.charCodeAt(offset + 2) << 8) |\n          buf.charCodeAt(offset + 3);\n        offset += 4;\n      }\n    } else {\n      for (let i = 0; i < 16; i++) {\n        W[i] =\n          (buf[offset] << 24) |\n          (buf[offset + 1] << 16) |\n          (buf[offset + 2] << 8) |\n          buf[offset + 3];\n        offset += 4;\n      }\n    }\n\n    // expand to 80 words\n    for (let i = 16; i < 80; i++) {\n      const t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\n      W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;\n    }\n\n    let a = this.chain_[0];\n    let b = this.chain_[1];\n    let c = this.chain_[2];\n    let d = this.chain_[3];\n    let e = this.chain_[4];\n    let f, k;\n\n    // TODO(user): Try to unroll this loop to speed up the computation.\n    for (let i = 0; i < 80; i++) {\n      if (i < 40) {\n        if (i < 20) {\n          f = d ^ (b & (c ^ d));\n          k = 0x5a827999;\n        } else {\n          f = b ^ c ^ d;\n          k = 0x6ed9eba1;\n        }\n      } else {\n        if (i < 60) {\n          f = (b & c) | (d & (b | c));\n          k = 0x8f1bbcdc;\n        } else {\n          f = b ^ c ^ d;\n          k = 0xca62c1d6;\n        }\n      }\n\n      const t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;\n      e = d;\n      d = c;\n      c = ((b << 30) | (b >>> 2)) & 0xffffffff;\n      b = a;\n      a = t;\n    }\n\n    this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;\n    this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;\n    this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;\n    this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;\n    this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;\n  }\n\n  update(bytes?: number[] | Uint8Array | string, length?: number): void {\n    // TODO(johnlenz): tighten the function signature and remove this check\n    if (bytes == null) {\n      return;\n    }\n\n    if (length === undefined) {\n      length = bytes.length;\n    }\n\n    const lengthMinusBlock = length - this.blockSize;\n    let n = 0;\n    // Using local instead of member variables gives ~5% speedup on Firefox 16.\n    const buf = this.buf_;\n    let inbuf = this.inbuf_;\n\n    // The outer while loop should execute at most twice.\n    while (n < length) {\n      // When we have no data in the block to top up, we can directly process the\n      // input buffer (assuming it contains sufficient data). This gives ~25%\n      // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that\n      // the data is provided in large chunks (or in multiples of 64 bytes).\n      if (inbuf === 0) {\n        while (n <= lengthMinusBlock) {\n          this.compress_(bytes, n);\n          n += this.blockSize;\n        }\n      }\n\n      if (typeof bytes === 'string') {\n        while (n < length) {\n          buf[inbuf] = bytes.charCodeAt(n);\n          ++inbuf;\n          ++n;\n          if (inbuf === this.blockSize) {\n            this.compress_(buf);\n            inbuf = 0;\n            // Jump to the outer loop so we use the full-block optimization.\n            break;\n          }\n        }\n      } else {\n        while (n < length) {\n          buf[inbuf] = bytes[n];\n          ++inbuf;\n          ++n;\n          if (inbuf === this.blockSize) {\n            this.compress_(buf);\n            inbuf = 0;\n            // Jump to the outer loop so we use the full-block optimization.\n            break;\n          }\n        }\n      }\n    }\n\n    this.inbuf_ = inbuf;\n    this.total_ += length;\n  }\n\n  /** @override */\n  digest(): number[] {\n    const digest: number[] = [];\n    let totalBits = this.total_ * 8;\n\n    // Add pad 0x80 0x00*.\n    if (this.inbuf_ < 56) {\n      this.update(this.pad_, 56 - this.inbuf_);\n    } else {\n      this.update(this.pad_, this.blockSize - (this.inbuf_ - 56));\n    }\n\n    // Add # bits.\n    for (let i = this.blockSize - 1; i >= 56; i--) {\n      this.buf_[i] = totalBits & 255;\n      totalBits /= 256; // Don't use bit-shifting here!\n    }\n\n    this.compress_(this.buf_);\n\n    let n = 0;\n    for (let i = 0; i < 5; i++) {\n      for (let j = 24; j >= 0; j -= 8) {\n        digest[n] = (this.chain_[i] >> j) & 255;\n        ++n;\n      }\n    }\n    return digest;\n  }\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { base64urlEncodeWithoutPadding } from './crypt';\n\n// Firebase Auth tokens contain snake_case claims following the JWT standard / convention.\n/* eslint-disable camelcase */\n\nexport type FirebaseSignInProvider =\n  | 'custom'\n  | 'email'\n  | 'password'\n  | 'phone'\n  | 'anonymous'\n  | 'google.com'\n  | 'facebook.com'\n  | 'github.com'\n  | 'twitter.com'\n  | 'microsoft.com'\n  | 'apple.com';\n\ninterface FirebaseIdToken {\n  // Always set to https://securetoken.google.com/PROJECT_ID\n  iss: string;\n\n  // Always set to PROJECT_ID\n  aud: string;\n\n  // The user's unique ID\n  sub: string;\n\n  // The token issue time, in seconds since epoch\n  iat: number;\n\n  // The token expiry time, normally 'iat' + 3600\n  exp: number;\n\n  // The user's unique ID. Must be equal to 'sub'\n  user_id: string;\n\n  // The time the user authenticated, normally 'iat'\n  auth_time: number;\n\n  // The sign in provider, only set when the provider is 'anonymous'\n  provider_id?: 'anonymous';\n\n  // The user's primary email\n  email?: string;\n\n  // The user's email verification status\n  email_verified?: boolean;\n\n  // The user's primary phone number\n  phone_number?: string;\n\n  // The user's display name\n  name?: string;\n\n  // The user's profile photo URL\n  picture?: string;\n\n  // Information on all identities linked to this user\n  firebase: {\n    // The primary sign-in provider\n    sign_in_provider: FirebaseSignInProvider;\n\n    // A map of providers to the user's list of unique identifiers from\n    // each provider\n    identities?: { [provider in FirebaseSignInProvider]?: string[] };\n  };\n\n  // Custom claims set by the developer\n  [claim: string]: unknown;\n\n  uid?: never; // Try to catch a common mistake of \"uid\" (should be \"sub\" instead).\n}\n\nexport type EmulatorMockTokenOptions = ({ user_id: string } | { sub: string }) &\n  Partial<FirebaseIdToken>;\n\nexport function createMockUserToken(\n  token: EmulatorMockTokenOptions,\n  projectId?: string\n): string {\n  if (token.uid) {\n    throw new Error(\n      'The \"uid\" field is no longer supported by mockUserToken. Please use \"sub\" instead for Firebase Auth User ID.'\n    );\n  }\n  // Unsecured JWTs use \"none\" as the algorithm.\n  const header = {\n    alg: 'none',\n    type: 'JWT'\n  };\n\n  const project = projectId || 'demo-project';\n  const iat = token.iat || 0;\n  const sub = token.sub || token.user_id;\n  if (!sub) {\n    throw new Error(\"mockUserToken must contain 'sub' or 'user_id' field!\");\n  }\n\n  const payload: FirebaseIdToken = {\n    // Set all required fields to decent defaults\n    iss: `https://securetoken.google.com/${project}`,\n    aud: project,\n    iat,\n    exp: iat + 3600,\n    auth_time: iat,\n    sub,\n    user_id: sub,\n    firebase: {\n      sign_in_provider: 'custom',\n      identities: {}\n    },\n\n    // Override with user options\n    ...token\n  };\n\n  // Unsecured JWTs use the empty string as a signature.\n  const signature = '';\n  return [\n    base64urlEncodeWithoutPadding(JSON.stringify(header)),\n    base64urlEncodeWithoutPadding(JSON.stringify(payload)),\n    signature\n  ].join('.');\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a\n * params object (e.g. {arg: 'val', arg2: 'val2'})\n * Note: You must prepend it with ? when adding it to a URL.\n */\nexport function querystring(querystringParams: {\n  [key: string]: string | number;\n}): string {\n  const params = [];\n  for (const [key, value] of Object.entries(querystringParams)) {\n    if (Array.isArray(value)) {\n      value.forEach(arrayVal => {\n        params.push(\n          encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal)\n        );\n      });\n    } else {\n      params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));\n    }\n  }\n  return params.length ? '&' + params.join('&') : '';\n}\n\n/**\n * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object\n * (e.g. {arg: 'val', arg2: 'val2'})\n */\nexport function querystringDecode(querystring: string): Record<string, string> {\n  const obj: Record<string, string> = {};\n  const tokens = querystring.replace(/^\\?/, '').split('&');\n\n  tokens.forEach(token => {\n    if (token) {\n      const [key, value] = token.split('=');\n      obj[decodeURIComponent(key)] = decodeURIComponent(value);\n    }\n  });\n  return obj;\n}\n\n/**\n * Extract the query string part of a URL, including the leading question mark (if present).\n */\nexport function extractQuerystring(url: string): string {\n  const queryStart = url.indexOf('?');\n  if (!queryStart) {\n    return '';\n  }\n  const fragmentStart = url.indexOf('#', queryStart);\n  return url.substring(\n    queryStart,\n    fragmentStart > 0 ? fragmentStart : undefined\n  );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Provide English ordinal letters after a number\n */\nexport function ordinal(i: number): string {\n  if (!Number.isFinite(i)) {\n    return `${i}`;\n  }\n  return i + indicator(i);\n}\n\nfunction indicator(i: number): string {\n  i = Math.abs(i);\n  const cent = i % 100;\n  if (cent >= 10 && cent <= 20) {\n    return 'th';\n  }\n  const dec = i % 10;\n  if (dec === 1) {\n    return 'st';\n  }\n  if (dec === 2) {\n    return 'nd';\n  }\n  if (dec === 3) {\n    return 'rd';\n  }\n  return 'th';\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Deferred } from './deferred';\n\n/**\n * Rejects if the given promise doesn't resolve in timeInMS milliseconds.\n * @internal\n */\nexport function promiseWithTimeout<T>(\n  promise: Promise<T>,\n  timeInMS = 2000\n): Promise<T> {\n  const deferredPromise = new Deferred<T>();\n  setTimeout(() => deferredPromise.reject('timeout!'), timeInMS);\n  promise.then(deferredPromise.resolve, deferredPromise.reject);\n  return deferredPromise.promise;\n}\n","/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Copied from https://stackoverflow.com/a/2117523\n * Generates a new uuid.\n * @public\n */\nexport const uuidv4 = function (): string {\n  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {\n    const r = (Math.random() * 16) | 0,\n      v = c === 'x' ? r : (r & 0x3) | 0x8;\n    return v.toString(16);\n  });\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Bootstrap for the Google JS Library (Closure).\n *\n * In uncompiled mode base.js will attempt to load Closure's deps file, unless\n * the global <code>CLOSURE_NO_DEPS</code> is set to true.  This allows projects\n * to include their own deps file(s) from different locations.\n *\n * Avoid including base.js more than once. This is strictly discouraged and not\n * supported. goog.require(...) won't work properly in that case.\n *\n * @suppress {deprecated} Users cannot remove deprecated uses here.\n * @provideGoog\n */\n\n\n/**\n * @define {boolean} Overridden to true by the compiler.\n */\nvar COMPILED = false;\n\n\n/**\n * Base namespace for the Closure library.  Checks to see goog is already\n * defined in the current scope before assigning to prevent clobbering if\n * base.js is loaded more than once.\n *\n * @const\n */\nvar goog = goog || {};\n\n/**\n * Reference to the global object.\n * https://www.ecma-international.org/ecma-262/9.0/index.html#sec-global-object\n *\n * More info on this implementation here:\n * https://docs.google.com/document/d/1NAeW4Wk7I7FV0Y2tcUFvQdGMc89k2vdgSXInw8_nvCI/edit\n *\n * @const\n * @suppress {undefinedVars} self won't be referenced unless `this` is falsy.\n * @type {!Global}\n */\ngoog.global =\n    // Check `this` first for backwards compatibility.\n    // Valid unless running as an ES module or in a function wrapper called\n    //   without setting `this` properly.\n    // Note that base.js can't usefully be imported as an ES module, but it may\n    // be compiled into bundles that are loadable as ES modules.\n    this ||\n    // https://developer.mozilla.org/en-US/docs/Web/API/Window/self\n    // For in-page browser environments and workers.\n    self;\n\n\n/**\n * A hook for overriding the define values in uncompiled mode.\n *\n * In uncompiled mode, `CLOSURE_UNCOMPILED_DEFINES` may be defined before\n * loading base.js.  If a key is defined in `CLOSURE_UNCOMPILED_DEFINES`,\n * `goog.define` will use the value instead of the default value.  This\n * allows flags to be overwritten without compilation (this is normally\n * accomplished with the compiler's \"define\" flag).\n *\n * Example:\n * <pre>\n *   var CLOSURE_UNCOMPILED_DEFINES = {'goog.DEBUG': false};\n * </pre>\n *\n * @type {Object<string, (string|number|boolean)>|undefined}\n */\ngoog.global.CLOSURE_UNCOMPILED_DEFINES;\n\n\n/**\n * A hook for overriding the define values in uncompiled or compiled mode,\n * like CLOSURE_UNCOMPILED_DEFINES but effective in compiled code.  In\n * uncompiled code CLOSURE_UNCOMPILED_DEFINES takes precedence.\n *\n * Also unlike CLOSURE_UNCOMPILED_DEFINES the values must be number, boolean or\n * string literals or the compiler will emit an error.\n *\n * While any @define value may be set, only those set with goog.define will be\n * effective for uncompiled code.\n *\n * Example:\n * <pre>\n *   var CLOSURE_DEFINES = {'goog.DEBUG': false} ;\n * </pre>\n *\n * Currently the Closure Compiler will only recognize very simple definitions of\n * this value when looking for values to apply to compiled code and ignore all\n * other references.  Specifically, it looks the value defined at the variable\n * declaration, as with the example above.\n *\n * TODO(user): Improve the recognized definitions.\n *\n * @type {!Object<string, (string|number|boolean)>|null|undefined}\n */\ngoog.global.CLOSURE_DEFINES;\n\n\n/**\n * Builds an object structure for the provided namespace path, ensuring that\n * names that already exist are not overwritten. For example:\n * \"a.b.c\" -> a = {};a.b={};a.b.c={};\n * Used by goog.provide and goog.exportSymbol.\n * @param {string} name The name of the object that this file defines.\n * @param {*=} object The object to expose at the end of the path.\n * @param {boolean=} overwriteImplicit If object is set and a previous call\n *     implicitly constructed the namespace given by name, this parameter\n *     controls whether object should overwrite the implicitly constructed\n *     namespace or be merged into it. Defaults to false.\n * @param {?Object=} objectToExportTo The object to add the path to; if this\n *     field is not specified, its value defaults to `goog.global`.\n * @private\n */\ngoog.exportPath_ = function(name, object, overwriteImplicit, objectToExportTo) {\n  var parts = name.split('.');\n  var cur = objectToExportTo || goog.global;\n\n  // Internet Explorer exhibits strange behavior when throwing errors from\n  // methods externed in this manner.  See the testExportSymbolExceptions in\n  // base_test.html for an example.\n  if (!(parts[0] in cur) && typeof cur.execScript != 'undefined') {\n    cur.execScript('var ' + parts[0]);\n  }\n\n  for (var part; parts.length && (part = parts.shift());) {\n    if (!parts.length && object !== undefined) {\n      if (!overwriteImplicit && goog.isObject(object) &&\n          goog.isObject(cur[part])) {\n        // Merge properties on object (the input parameter) with the existing\n        // implicitly defined namespace, so as to not clobber previously\n        // defined child namespaces.\n        for (var prop in object) {\n          if (object.hasOwnProperty(prop)) {\n            cur[part][prop] = object[prop];\n          }\n        }\n      } else {\n        // Either there is no existing implicit namespace, or overwriteImplicit\n        // is set to true, so directly assign object (the input parameter) to\n        // the namespace.\n        cur[part] = object;\n      }\n    } else if (cur[part] && cur[part] !== Object.prototype[part]) {\n      cur = cur[part];\n    } else {\n      cur = cur[part] = {};\n    }\n  }\n};\n\n\n/**\n * Defines a named value. In uncompiled mode, the value is retrieved from\n * CLOSURE_DEFINES or CLOSURE_UNCOMPILED_DEFINES if the object is defined and\n * has the property specified, and otherwise used the defined defaultValue.\n * When compiled the default can be overridden using the compiler options or the\n * value set in the CLOSURE_DEFINES object. Returns the defined value so that it\n * can be used safely in modules. Note that the value type MUST be either\n * boolean, number, or string.\n *\n * @param {string} name The distinguished name to provide.\n * @param {T} defaultValue\n * @return {T} The defined value.\n * @template T\n */\ngoog.define = function(name, defaultValue) {\n  var value = defaultValue;\n  if (!COMPILED) {\n    var uncompiledDefines = goog.global.CLOSURE_UNCOMPILED_DEFINES;\n    var defines = goog.global.CLOSURE_DEFINES;\n    if (uncompiledDefines &&\n        // Anti DOM-clobbering runtime check (b/37736576).\n        /** @type {?} */ (uncompiledDefines).nodeType === undefined &&\n        Object.prototype.hasOwnProperty.call(uncompiledDefines, name)) {\n      value = uncompiledDefines[name];\n    } else if (\n        defines &&\n        // Anti DOM-clobbering runtime check (b/37736576).\n        /** @type {?} */ (defines).nodeType === undefined &&\n        Object.prototype.hasOwnProperty.call(defines, name)) {\n      value = defines[name];\n    }\n  }\n  return value;\n};\n\n\n/**\n * @define {number} Integer year indicating the set of browser features that are\n * guaranteed to be present.  This is defined to include exactly features that\n * work correctly on all \"modern\" browsers that are stable on January 1 of the\n * specified year.  For example,\n * ```js\n * if (goog.FEATURESET_YEAR >= 2019) {\n *   // use APIs known to be available on all major stable browsers Jan 1, 2019\n * } else {\n *   // polyfill for older browsers\n * }\n * ```\n * This is intended to be the primary define for removing\n * unnecessary browser compatibility code (such as ponyfills and workarounds),\n * and should inform the default value for most other defines:\n * ```js\n * const ASSUME_NATIVE_PROMISE =\n *     goog.define('ASSUME_NATIVE_PROMISE', goog.FEATURESET_YEAR >= 2016);\n * ```\n *\n * The default assumption is that IE9 is the lowest supported browser, which was\n * first available Jan 1, 2012.\n *\n * TODO(user): Reference more thorough documentation when it's available.\n */\ngoog.FEATURESET_YEAR = goog.define('goog.FEATURESET_YEAR', 2012);\n\n\n/**\n * @define {boolean} DEBUG is provided as a convenience so that debugging code\n * that should not be included in a production. It can be easily stripped\n * by specifying --define goog.DEBUG=false to the Closure Compiler aka\n * JSCompiler. For example, most toString() methods should be declared inside an\n * \"if (goog.DEBUG)\" conditional because they are generally used for debugging\n * purposes and it is difficult for the JSCompiler to statically determine\n * whether they are used.\n */\ngoog.DEBUG = goog.define('goog.DEBUG', true);\n\n\n/**\n * @define {string} LOCALE defines the locale being used for compilation. It is\n * used to select locale specific data to be compiled in js binary. BUILD rule\n * can specify this value by \"--define goog.LOCALE=<locale_name>\" as a compiler\n * option.\n *\n * Take into account that the locale code format is important. You should use\n * the canonical Unicode format with hyphen as a delimiter. Language must be\n * lowercase, Language Script - Capitalized, Region - UPPERCASE.\n * There are few examples: pt-BR, en, en-US, sr-Latin-BO, zh-Hans-CN.\n *\n * See more info about locale codes here:\n * http://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers\n *\n * For language codes you should use values defined by ISO 693-1. See it here\n * http://www.w3.org/WAI/ER/IG/ert/iso639.htm. There is only one exception from\n * this rule: the Hebrew language. For legacy reasons the old code (iw) should\n * be used instead of the new code (he).\n *\n */\ngoog.LOCALE = goog.define('goog.LOCALE', 'en');  // default to en\n\n\n/**\n * @define {boolean} Whether this code is running on trusted sites.\n *\n * On untrusted sites, several native functions can be defined or overridden by\n * external libraries like Prototype, Datejs, and JQuery and setting this flag\n * to false forces closure to use its own implementations when possible.\n *\n * If your JavaScript can be loaded by a third party site and you are wary about\n * relying on non-standard implementations, specify\n * \"--define goog.TRUSTED_SITE=false\" to the compiler.\n */\ngoog.TRUSTED_SITE = goog.define('goog.TRUSTED_SITE', true);\n\n\n/**\n * @define {boolean} Whether code that calls {@link goog.setTestOnly} should\n *     be disallowed in the compilation unit.\n */\ngoog.DISALLOW_TEST_ONLY_CODE =\n    goog.define('goog.DISALLOW_TEST_ONLY_CODE', COMPILED && !goog.DEBUG);\n\n\n/**\n * @define {boolean} Whether to use a Chrome app CSP-compliant method for\n *     loading scripts via goog.require. @see appendScriptSrcNode_.\n */\ngoog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING =\n    goog.define('goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING', false);\n\n\n/**\n * Defines a namespace in Closure.\n *\n * A namespace may only be defined once in a codebase. It may be defined using\n * goog.provide() or goog.module().\n *\n * The presence of one or more goog.provide() calls in a file indicates\n * that the file defines the given objects/namespaces.\n * Provided symbols must not be null or undefined.\n *\n * In addition, goog.provide() creates the object stubs for a namespace\n * (for example, goog.provide(\"goog.foo.bar\") will create the object\n * goog.foo.bar if it does not already exist).\n *\n * Build tools also scan for provide/require/module statements\n * to discern dependencies, build dependency files (see deps.js), etc.\n *\n * @see goog.require\n * @see goog.module\n * @param {string} name Namespace provided by this file in the form\n *     \"goog.package.part\".\n * deprecated Use goog.module (see b/159289405)\n */\ngoog.provide = function(name) {\n  if (goog.isInModuleLoader_()) {\n    throw new Error('goog.provide cannot be used within a module.');\n  }\n  if (!COMPILED) {\n    // Ensure that the same namespace isn't provided twice.\n    // A goog.module/goog.provide maps a goog.require to a specific file\n    if (goog.isProvided_(name)) {\n      throw new Error('Namespace \"' + name + '\" already declared.');\n    }\n  }\n\n  goog.constructNamespace_(name);\n};\n\n\n/**\n * @param {string} name Namespace provided by this file in the form\n *     \"goog.package.part\".\n * @param {?Object=} object The object to embed in the namespace.\n * @param {boolean=} overwriteImplicit If object is set and a previous call\n *     implicitly constructed the namespace given by name, this parameter\n *     controls whether opt_obj should overwrite the implicitly constructed\n *     namespace or be merged into it. Defaults to false.\n * @private\n */\ngoog.constructNamespace_ = function(name, object, overwriteImplicit) {\n  if (!COMPILED) {\n    delete goog.implicitNamespaces_[name];\n\n    var namespace = name;\n    while ((namespace = namespace.substring(0, namespace.lastIndexOf('.')))) {\n      if (goog.getObjectByName(namespace)) {\n        break;\n      }\n      goog.implicitNamespaces_[namespace] = true;\n    }\n  }\n\n  goog.exportPath_(name, object, overwriteImplicit);\n};\n\n\n/**\n * According to the CSP3 spec a nonce must be a valid base64 string.\n * @see https://www.w3.org/TR/CSP3/#grammardef-base64-value\n * @private @const\n */\ngoog.NONCE_PATTERN_ = /^[\\w+/_-]+[=]{0,2}$/;\n\n\n/**\n * Returns CSP nonce, if set for any script tag.\n * @param {?Window=} opt_window The window context used to retrieve the nonce.\n *     Defaults to global context.\n * @return {string} CSP nonce or empty string if no nonce is present.\n * @private\n */\ngoog.getScriptNonce_ = function(opt_window) {\n  var doc = (opt_window || goog.global).document;\n  var script = doc.querySelector && doc.querySelector('script[nonce]');\n  if (script) {\n    // Try to get the nonce from the IDL property first, because browsers that\n    // implement additional nonce protection features (currently only Chrome) to\n    // prevent nonce stealing via CSS do not expose the nonce via attributes.\n    // See https://github.com/whatwg/html/issues/2369\n    var nonce = script['nonce'] || script.getAttribute('nonce');\n    if (nonce && goog.NONCE_PATTERN_.test(nonce)) {\n      return nonce;\n    }\n  }\n  return '';\n};\n\n\n/**\n * Module identifier validation regexp.\n * Note: This is a conservative check, it is very possible to be more lenient,\n *   the primary exclusion here is \"/\" and \"\\\" and a leading \".\", these\n *   restrictions are intended to leave the door open for using goog.require\n *   with relative file paths rather than module identifiers.\n * @private\n */\ngoog.VALID_MODULE_RE_ = /^[a-zA-Z_$][a-zA-Z0-9._$]*$/;\n\n\n/**\n * Defines a module in Closure.\n *\n * Marks that this file must be loaded as a module and claims the namespace.\n *\n * A namespace may only be defined once in a codebase. It may be defined using\n * goog.provide() or goog.module().\n *\n * goog.module() has three requirements:\n * - goog.module may not be used in the same file as goog.provide.\n * - goog.module must be the first statement in the file.\n * - only one goog.module is allowed per file.\n *\n * When a goog.module annotated file is loaded, it is enclosed in\n * a strict function closure. This means that:\n * - any variables declared in a goog.module file are private to the file\n * (not global), though the compiler is expected to inline the module.\n * - The code must obey all the rules of \"strict\" JavaScript.\n * - the file will be marked as \"use strict\"\n *\n * NOTE: unlike goog.provide, goog.module does not declare any symbols by\n * itself. If declared symbols are desired, use\n * goog.module.declareLegacyNamespace().\n *\n *\n * See the public goog.module proposal: http://goo.gl/Va1hin\n *\n * @param {string} name Namespace provided by this file in the form\n *     \"goog.package.part\", is expected but not required.\n * @return {void}\n */\ngoog.module = function(name) {\n  if (typeof name !== 'string' || !name ||\n      name.search(goog.VALID_MODULE_RE_) == -1) {\n    throw new Error('Invalid module identifier');\n  }\n  if (!goog.isInGoogModuleLoader_()) {\n    throw new Error(\n        'Module ' + name + ' has been loaded incorrectly. Note, ' +\n        'modules cannot be loaded as normal scripts. They require some kind of ' +\n        'pre-processing step. You\\'re likely trying to load a module via a ' +\n        'script tag or as a part of a concatenated bundle without rewriting the ' +\n        'module. For more info see: ' +\n        'https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.');\n  }\n  if (goog.moduleLoaderState_.moduleName) {\n    throw new Error('goog.module may only be called once per module.');\n  }\n\n  // Store the module name for the loader.\n  goog.moduleLoaderState_.moduleName = name;\n  if (!COMPILED) {\n    // Ensure that the same namespace isn't provided twice.\n    // A goog.module/goog.provide maps a goog.require to a specific file\n    if (goog.isProvided_(name)) {\n      throw new Error('Namespace \"' + name + '\" already declared.');\n    }\n    delete goog.implicitNamespaces_[name];\n  }\n};\n\n\n/**\n * @param {string} name The module identifier.\n * @return {?} The module exports for an already loaded module or null.\n *\n * Note: This is not an alternative to goog.require, it does not\n * indicate a hard dependency, instead it is used to indicate\n * an optional dependency or to access the exports of a module\n * that has already been loaded.\n * @suppress {missingProvide}\n */\ngoog.module.get = function(name) {\n  return goog.module.getInternal_(name);\n};\n\n\n/**\n * @param {string} name The module identifier.\n * @return {?} The module exports for an already loaded module or null.\n * @private\n */\ngoog.module.getInternal_ = function(name) {\n  if (!COMPILED) {\n    if (name in goog.loadedModules_) {\n      return goog.loadedModules_[name].exports;\n    } else if (!goog.implicitNamespaces_[name]) {\n      var ns = goog.getObjectByName(name);\n      return ns != null ? ns : null;\n    }\n  }\n  return null;\n};\n\n/**\n * Types of modules the debug loader can load.\n * @enum {string}\n */\ngoog.ModuleType = {\n  ES6: 'es6',\n  GOOG: 'goog'\n};\n\n\n/**\n * @private {?{\n *   moduleName: (string|undefined),\n *   declareLegacyNamespace:boolean,\n *   type: ?goog.ModuleType\n * }}\n */\ngoog.moduleLoaderState_ = null;\n\n\n/**\n * @private\n * @return {boolean} Whether a goog.module or an es6 module is currently being\n *     initialized.\n */\ngoog.isInModuleLoader_ = function() {\n  return goog.isInGoogModuleLoader_() || goog.isInEs6ModuleLoader_();\n};\n\n\n/**\n * @private\n * @return {boolean} Whether a goog.module is currently being initialized.\n */\ngoog.isInGoogModuleLoader_ = function() {\n  return !!goog.moduleLoaderState_ &&\n      goog.moduleLoaderState_.type == goog.ModuleType.GOOG;\n};\n\n\n/**\n * @private\n * @return {boolean} Whether an es6 module is currently being initialized.\n */\ngoog.isInEs6ModuleLoader_ = function() {\n  var inLoader = !!goog.moduleLoaderState_ &&\n      goog.moduleLoaderState_.type == goog.ModuleType.ES6;\n\n  if (inLoader) {\n    return true;\n  }\n\n  var jscomp = goog.global['$jscomp'];\n\n  if (jscomp) {\n    // jscomp may not have getCurrentModulePath if this is a compiled bundle\n    // that has some of the runtime, but not all of it. This can happen if\n    // optimizations are turned on so the unused runtime is removed but renaming\n    // and Closure pass are off (so $jscomp is still named $jscomp and the\n    // goog.provide/require calls still exist).\n    if (typeof jscomp.getCurrentModulePath != 'function') {\n      return false;\n    }\n\n    // Bundled ES6 module.\n    return !!jscomp.getCurrentModulePath();\n  }\n\n  return false;\n};\n\n\n/**\n * Provide the module's exports as a globally accessible object under the\n * module's declared name.  This is intended to ease migration to goog.module\n * for files that have existing usages.\n * @suppress {missingProvide}\n */\ngoog.module.declareLegacyNamespace = function() {\n  if (!COMPILED && !goog.isInGoogModuleLoader_()) {\n    throw new Error(\n        'goog.module.declareLegacyNamespace must be called from ' +\n        'within a goog.module');\n  }\n  if (!COMPILED && !goog.moduleLoaderState_.moduleName) {\n    throw new Error(\n        'goog.module must be called prior to ' +\n        'goog.module.declareLegacyNamespace.');\n  }\n  goog.moduleLoaderState_.declareLegacyNamespace = true;\n};\n\n\n/**\n * Associates an ES6 module with a Closure module ID so that is available via\n * goog.require. The associated ID  acts like a goog.module ID - it does not\n * create any global names, it is merely available via goog.require /\n * goog.module.get / goog.forwardDeclare / goog.requireType. goog.require and\n * goog.module.get will return the entire module as if it was import *'d. This\n * allows Closure files to reference ES6 modules for the sake of migration.\n *\n * @param {string} namespace\n * @suppress {missingProvide}\n */\ngoog.declareModuleId = function(namespace) {\n  if (!COMPILED) {\n    if (!goog.isInEs6ModuleLoader_()) {\n      throw new Error(\n          'goog.declareModuleId may only be called from ' +\n          'within an ES6 module');\n    }\n    if (goog.moduleLoaderState_ && goog.moduleLoaderState_.moduleName) {\n      throw new Error(\n          'goog.declareModuleId may only be called once per module.');\n    }\n    if (namespace in goog.loadedModules_) {\n      throw new Error(\n          'Module with namespace \"' + namespace + '\" already exists.');\n    }\n  }\n  if (goog.moduleLoaderState_) {\n    // Not bundled - debug loading.\n    goog.moduleLoaderState_.moduleName = namespace;\n  } else {\n    // Bundled - not debug loading, no module loader state.\n    var jscomp = goog.global['$jscomp'];\n    if (!jscomp || typeof jscomp.getCurrentModulePath != 'function') {\n      throw new Error(\n          'Module with namespace \"' + namespace +\n          '\" has been loaded incorrectly.');\n    }\n    var exports = jscomp.require(jscomp.getCurrentModulePath());\n    goog.loadedModules_[namespace] = {\n      exports: exports,\n      type: goog.ModuleType.ES6,\n      moduleId: namespace\n    };\n  }\n};\n\n\n/**\n * Marks that the current file should only be used for testing, and never for\n * live code in production.\n *\n * In the case of unit tests, the message may optionally be an exact namespace\n * for the test (e.g. 'goog.stringTest'). The linter will then ignore the extra\n * provide (if not explicitly defined in the code).\n *\n * @param {string=} opt_message Optional message to add to the error that's\n *     raised when used in production code.\n */\ngoog.setTestOnly = function(opt_message) {\n  if (goog.DISALLOW_TEST_ONLY_CODE) {\n    opt_message = opt_message || '';\n    throw new Error(\n        'Importing test-only code into non-debug environment' +\n        (opt_message ? ': ' + opt_message : '.'));\n  }\n};\n\n\n/**\n * Forward declares a symbol. This is an indication to the compiler that the\n * symbol may be used in the source yet is not required and may not be provided\n * in compilation.\n *\n * The most common usage of forward declaration is code that takes a type as a\n * function parameter but does not need to require it. By forward declaring\n * instead of requiring, no hard dependency is made, and (if not required\n * elsewhere) the namespace may never be required and thus, not be pulled\n * into the JavaScript binary. If it is required elsewhere, it will be type\n * checked as normal.\n *\n * Before using goog.forwardDeclare, please read the documentation at\n * https://github.com/google/closure-compiler/wiki/Bad-Type-Annotation to\n * understand the options and tradeoffs when working with forward declarations.\n *\n * @param {string} name The namespace to forward declare in the form of\n *     \"goog.package.part\".\n * @deprecated See go/noforwarddeclaration, Use `goog.requireType` instead.\n */\ngoog.forwardDeclare = function(name) {};\n\n\n/**\n * Forward declare type information. Used to assign types to goog.global\n * referenced object that would otherwise result in unknown type references\n * and thus block property disambiguation.\n */\ngoog.forwardDeclare('Document');\ngoog.forwardDeclare('HTMLScriptElement');\ngoog.forwardDeclare('XMLHttpRequest');\n\n\nif (!COMPILED) {\n  /**\n   * Check if the given name has been goog.provided. This will return false for\n   * names that are available only as implicit namespaces.\n   * @param {string} name name of the object to look for.\n   * @return {boolean} Whether the name has been provided.\n   * @private\n   */\n  goog.isProvided_ = function(name) {\n    return (name in goog.loadedModules_) ||\n        (!goog.implicitNamespaces_[name] && goog.getObjectByName(name) != null);\n  };\n\n  /**\n   * Namespaces implicitly defined by goog.provide. For example,\n   * goog.provide('goog.events.Event') implicitly declares that 'goog' and\n   * 'goog.events' must be namespaces.\n   *\n   * @type {!Object<string, (boolean|undefined)>}\n   * @private\n   */\n  goog.implicitNamespaces_ = {'goog.module': true};\n\n  // NOTE: We add goog.module as an implicit namespace as goog.module is defined\n  // here and because the existing module package has not been moved yet out of\n  // the goog.module namespace. This satisifies both the debug loader and\n  // ahead-of-time dependency management.\n}\n\n\n/**\n * Returns an object based on its fully qualified external name.  The object\n * is not found if null or undefined.  If you are using a compilation pass that\n * renames property names beware that using this function will not find renamed\n * properties.\n *\n * @param {string} name The fully qualified name.\n * @param {Object=} opt_obj The object within which to look; default is\n *     |goog.global|.\n * @return {?} The value (object or primitive) or, if not found, null.\n */\ngoog.getObjectByName = function(name, opt_obj) {\n  var parts = name.split('.');\n  var cur = opt_obj || goog.global;\n  for (var i = 0; i < parts.length; i++) {\n    cur = cur[parts[i]];\n    if (cur == null) {\n      return null;\n    }\n  }\n  return cur;\n};\n\n\n/**\n * Adds a dependency from a file to the files it requires.\n * @param {string} relPath The path to the js file.\n * @param {!Array<string>} provides An array of strings with\n *     the names of the objects this file provides.\n * @param {!Array<string>} requires An array of strings with\n *     the names of the objects this file requires.\n * @param {boolean|!Object<string>=} opt_loadFlags Parameters indicating\n *     how the file must be loaded.  The boolean 'true' is equivalent\n *     to {'module': 'goog'} for backwards-compatibility.  Valid properties\n *     and values include {'module': 'goog'} and {'lang': 'es6'}.\n */\ngoog.addDependency = function(relPath, provides, requires, opt_loadFlags) {\n  if (!COMPILED && goog.DEPENDENCIES_ENABLED) {\n    goog.debugLoader_.addDependency(relPath, provides, requires, opt_loadFlags);\n  }\n};\n\n\n// NOTE(nnaze): The debug DOM loader was included in base.js as an original way\n// to do \"debug-mode\" development.  The dependency system can sometimes be\n// confusing, as can the debug DOM loader's asynchronous nature.\n//\n// With the DOM loader, a call to goog.require() is not blocking -- the script\n// will not load until some point after the current script.  If a namespace is\n// needed at runtime, it needs to be defined in a previous script, or loaded via\n// require() with its registered dependencies.\n//\n// User-defined namespaces may need their own deps file. For a reference on\n// creating a deps file, see:\n// Externally: https://developers.google.com/closure/library/docs/depswriter\n//\n// Because of legacy clients, the DOM loader can't be easily removed from\n// base.js.  Work was done to make it disableable or replaceable for\n// different environments (DOM-less JavaScript interpreters like Rhino or V8,\n// for example). See bootstrap/ for more information.\n\n\n/**\n * @define {boolean} Whether to enable the debug loader.\n *\n * If enabled, a call to goog.require() will attempt to load the namespace by\n * appending a script tag to the DOM (if the namespace has been registered).\n *\n * If disabled, goog.require() will simply assert that the namespace has been\n * provided (and depend on the fact that some outside tool correctly ordered\n * the script).\n */\ngoog.ENABLE_DEBUG_LOADER = goog.define('goog.ENABLE_DEBUG_LOADER', false);\n\n\n/**\n * @param {string} msg\n * @private\n */\ngoog.logToConsole_ = function(msg) {\n  if (goog.global.console) {\n    goog.global.console['error'](msg);\n  }\n};\n\n\n/**\n * Implements a system for the dynamic resolution of dependencies that works in\n * parallel with the BUILD system.\n *\n * Note that all calls to goog.require will be stripped by the compiler.\n *\n * @see goog.provide\n * @param {string} namespace Namespace (as was given in goog.provide,\n *     goog.module, or goog.declareModuleId) in the form\n *     \"goog.package.part\".\n * @return {?} If called within a goog.module or ES6 module file, the associated\n *     namespace or module otherwise null.\n */\ngoog.require = function(namespace) {\n  if (!COMPILED) {\n    // Might need to lazy load on old IE.\n    if (goog.ENABLE_DEBUG_LOADER) {\n      goog.debugLoader_.requested(namespace);\n    }\n\n    // If the object already exists we do not need to do anything.\n    if (goog.isProvided_(namespace)) {\n      if (goog.isInModuleLoader_()) {\n        return goog.module.getInternal_(namespace);\n      }\n    } else if (goog.ENABLE_DEBUG_LOADER) {\n      var moduleLoaderState = goog.moduleLoaderState_;\n      goog.moduleLoaderState_ = null;\n      try {\n        goog.debugLoader_.load_(namespace);\n      } finally {\n        goog.moduleLoaderState_ = moduleLoaderState;\n      }\n    }\n\n    return null;\n  }\n};\n\n\n/**\n * Requires a symbol for its type information. This is an indication to the\n * compiler that the symbol may appear in type annotations, yet it is not\n * referenced at runtime.\n *\n * When called within a goog.module or ES6 module file, the return value may be\n * assigned to or destructured into a variable, but it may not be otherwise used\n * in code outside of a type annotation.\n *\n * Note that all calls to goog.requireType will be stripped by the compiler.\n *\n * @param {string} namespace Namespace (as was given in goog.provide,\n *     goog.module, or goog.declareModuleId) in the form\n *     \"goog.package.part\".\n * @return {?}\n */\ngoog.requireType = function(namespace) {\n  // Return an empty object so that single-level destructuring of the return\n  // value doesn't crash at runtime when using the debug loader. Multi-level\n  // destructuring isn't supported.\n  return {};\n};\n\n\n/**\n * Path for included scripts.\n * @type {string}\n */\ngoog.basePath = '';\n\n\n/**\n * A hook for overriding the base path.\n * @type {string|undefined}\n */\ngoog.global.CLOSURE_BASE_PATH;\n\n\n/**\n * Whether to attempt to load Closure's deps file. By default, when uncompiled,\n * deps files will attempt to be loaded.\n * @type {boolean|undefined}\n */\ngoog.global.CLOSURE_NO_DEPS;\n\n\n/**\n * A function to import a single script. This is meant to be overridden when\n * Closure is being run in non-HTML contexts, such as web workers. It's defined\n * in the global scope so that it can be set before base.js is loaded, which\n * allows deps.js to be imported properly.\n *\n * The first parameter the script source, which is a relative URI. The second,\n * optional parameter is the script contents, in the event the script needed\n * transformation. It should return true if the script was imported, false\n * otherwise.\n * @type {(function(string, string=): boolean)|undefined}\n */\ngoog.global.CLOSURE_IMPORT_SCRIPT;\n\n\n/**\n * When defining a class Foo with an abstract method bar(), you can do:\n * Foo.prototype.bar = goog.abstractMethod\n *\n * Now if a subclass of Foo fails to override bar(), an error will be thrown\n * when bar() is invoked.\n *\n * @type {!Function}\n * @throws {Error} when invoked to indicate the method should be overridden.\n * @deprecated Use \"@abstract\" annotation instead of goog.abstractMethod in new\n *     code. See\n *     https://github.com/google/closure-compiler/wiki/@abstract-classes-and-methods\n */\ngoog.abstractMethod = function() {\n  throw new Error('unimplemented abstract method');\n};\n\n\n/**\n * Adds a `getInstance` static method that always returns the same\n * instance object.\n * @param {!Function} ctor The constructor for the class to add the static\n *     method to.\n * @suppress {missingProperties} 'instance_' isn't a property on 'Function'\n *     but we don't have a better type to use here.\n */\ngoog.addSingletonGetter = function(ctor) {\n  // instance_ is immediately set to prevent issues with sealed constructors\n  // such as are encountered when a constructor is returned as the export object\n  // of a goog.module in unoptimized code.\n  // Delcare type to avoid conformance violations that ctor.instance_ is unknown\n  /** @type {undefined|!Object} @suppress {underscore} */\n  ctor.instance_ = undefined;\n  ctor.getInstance = function() {\n    if (ctor.instance_) {\n      return ctor.instance_;\n    }\n    if (goog.DEBUG) {\n      // NOTE: JSCompiler can't optimize away Array#push.\n      goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = ctor;\n    }\n    // Cast to avoid conformance violations that ctor.instance_ is unknown\n    return /** @type {!Object|undefined} */ (ctor.instance_) = new ctor;\n  };\n};\n\n\n/**\n * All singleton classes that have been instantiated, for testing. Don't read\n * it directly, use the `goog.testing.singleton` module. The compiler\n * removes this variable if unused.\n * @type {!Array<!Function>}\n * @private\n */\ngoog.instantiatedSingletons_ = [];\n\n\n/**\n * @define {boolean} Whether to load goog.modules using `eval` when using\n * the debug loader.  This provides a better debugging experience as the\n * source is unmodified and can be edited using Chrome Workspaces or similar.\n * However in some environments the use of `eval` is banned\n * so we provide an alternative.\n */\ngoog.LOAD_MODULE_USING_EVAL = goog.define('goog.LOAD_MODULE_USING_EVAL', true);\n\n\n/**\n * @define {boolean} Whether the exports of goog.modules should be sealed when\n * possible.\n */\ngoog.SEAL_MODULE_EXPORTS = goog.define('goog.SEAL_MODULE_EXPORTS', goog.DEBUG);\n\n\n/**\n * The registry of initialized modules:\n * The module identifier or path to module exports map.\n * @private @const {!Object<string, {exports:?,type:string,moduleId:string}>}\n */\ngoog.loadedModules_ = {};\n\n\n/**\n * True if the debug loader enabled and used.\n * @const {boolean}\n */\ngoog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER;\n\n\n/**\n * @define {string} How to decide whether to transpile.  Valid values\n * are 'always', 'never', and 'detect'.  The default ('detect') is to\n * use feature detection to determine which language levels need\n * transpilation.\n */\n// NOTE(sdh): we could expand this to accept a language level to bypass\n// detection: e.g. goog.TRANSPILE == 'es5' would transpile ES6 files but\n// would leave ES3 and ES5 files alone.\ngoog.TRANSPILE = goog.define('goog.TRANSPILE', 'detect');\n\n/**\n * @define {boolean} If true assume that ES modules have already been\n * transpiled by the jscompiler (in the same way that transpile.js would\n * transpile them - to jscomp modules). Useful only for servers that wish to use\n * the debug loader and transpile server side. Thus this is only respected if\n * goog.TRANSPILE is \"never\".\n */\ngoog.ASSUME_ES_MODULES_TRANSPILED =\n    goog.define('goog.ASSUME_ES_MODULES_TRANSPILED', false);\n\n\n/**\n * @define {string} Trusted Types policy name. If non-empty then Closure will\n * use Trusted Types.\n */\ngoog.TRUSTED_TYPES_POLICY_NAME =\n    goog.define('goog.TRUSTED_TYPES_POLICY_NAME', 'goog');\n\n\n/**\n * @package {?boolean}\n * Visible for testing.\n */\ngoog.hasBadLetScoping = null;\n\n\n/**\n * @param {function(?):?|string} moduleDef The module definition.\n */\ngoog.loadModule = function(moduleDef) {\n  // NOTE: we allow function definitions to be either in the from\n  // of a string to eval (which keeps the original source intact) or\n  // in a eval forbidden environment (CSP) we allow a function definition\n  // which in its body must call `goog.module`, and return the exports\n  // of the module.\n  var previousState = goog.moduleLoaderState_;\n  try {\n    goog.moduleLoaderState_ = {\n      moduleName: '',\n      declareLegacyNamespace: false,\n      type: goog.ModuleType.GOOG\n    };\n    var origExports = {};\n    var exports = origExports;\n    if (typeof moduleDef === 'function') {\n      exports = moduleDef.call(undefined, exports);\n    } else if (typeof moduleDef === 'string') {\n      exports = goog.loadModuleFromSource_.call(undefined, exports, moduleDef);\n    } else {\n      throw new Error('Invalid module definition');\n    }\n\n    var moduleName = goog.moduleLoaderState_.moduleName;\n    if (typeof moduleName === 'string' && moduleName) {\n      // Don't seal legacy namespaces as they may be used as a parent of\n      // another namespace\n      if (goog.moduleLoaderState_.declareLegacyNamespace) {\n        // Whether exports was overwritten via default export assignment.\n        // This is important for legacy namespaces as it dictates whether\n        // previously a previously loaded implicit namespace should be clobbered\n        // or not.\n        var isDefaultExport = origExports !== exports;\n        goog.constructNamespace_(moduleName, exports, isDefaultExport);\n      } else if (\n          goog.SEAL_MODULE_EXPORTS && Object.seal &&\n          typeof exports == 'object' && exports != null) {\n        Object.seal(exports);\n      }\n\n      var data = {\n        exports: exports,\n        type: goog.ModuleType.GOOG,\n        moduleId: goog.moduleLoaderState_.moduleName\n      };\n      goog.loadedModules_[moduleName] = data;\n    } else {\n      throw new Error('Invalid module name \\\"' + moduleName + '\\\"');\n    }\n  } finally {\n    goog.moduleLoaderState_ = previousState;\n  }\n};\n\n\n/**\n * @private @const\n */\ngoog.loadModuleFromSource_ =\n    /** @type {function(!Object, string):?} */ (function(exports) {\n      // NOTE: we avoid declaring parameters or local variables here to avoid\n      // masking globals or leaking values into the module definition.\n      'use strict';\n      eval(goog.CLOSURE_EVAL_PREFILTER_.createScript(arguments[1]));\n      return exports;\n    });\n\n\n/**\n * Normalize a file path by removing redundant \"..\" and extraneous \".\" file\n * path components.\n * @param {string} path\n * @return {string}\n * @private\n */\ngoog.normalizePath_ = function(path) {\n  var components = path.split('/');\n  var i = 0;\n  while (i < components.length) {\n    if (components[i] == '.') {\n      components.splice(i, 1);\n    } else if (\n        i && components[i] == '..' && components[i - 1] &&\n        components[i - 1] != '..') {\n      components.splice(--i, 2);\n    } else {\n      i++;\n    }\n  }\n  return components.join('/');\n};\n\n\n/**\n * Provides a hook for loading a file when using Closure's goog.require() API\n * with goog.modules.  In particular this hook is provided to support Node.js.\n *\n * @type {(function(string):string)|undefined}\n */\ngoog.global.CLOSURE_LOAD_FILE_SYNC;\n\n\n/**\n * Loads file by synchronous XHR. Should not be used in production environments.\n * @param {string} src Source URL.\n * @return {?string} File contents, or null if load failed.\n * @private\n */\ngoog.loadFileSync_ = function(src) {\n  if (goog.global.CLOSURE_LOAD_FILE_SYNC) {\n    return goog.global.CLOSURE_LOAD_FILE_SYNC(src);\n  } else {\n    try {\n      /** @type {XMLHttpRequest} */\n      var xhr = new goog.global['XMLHttpRequest']();\n      xhr.open('get', src, false);\n      xhr.send();\n      // NOTE: Successful http: requests have a status of 200, but successful\n      // file: requests may have a status of zero.  Any other status, or a\n      // thrown exception (particularly in case of file: requests) indicates\n      // some sort of error, which we treat as a missing or unavailable file.\n      return xhr.status == 0 || xhr.status == 200 ? xhr.responseText : null;\n    } catch (err) {\n      // No need to rethrow or log, since errors should show up on their own.\n      return null;\n    }\n  }\n};\n\n//==============================================================================\n// Language Enhancements\n//==============================================================================\n\n\n/**\n * This is a \"fixed\" version of the typeof operator.  It differs from the typeof\n * operator in such a way that null returns 'null' and arrays return 'array'.\n * @param {?} value The value to get the type of.\n * @return {string} The name of the type.\n */\ngoog.typeOf = function(value) {\n  var s = typeof value;\n\n  if (s != 'object') {\n    return s;\n  }\n\n  if (!value) {\n    return 'null';\n  }\n\n  if (Array.isArray(value)) {\n    return 'array';\n  }\n  return s;\n};\n\n\n/**\n * Returns true if the object looks like an array. To qualify as array like\n * the value needs to be either a NodeList or an object with a Number length\n * property. Note that for this function neither strings nor functions are\n * considered \"array-like\".\n *\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is an array.\n */\ngoog.isArrayLike = function(val) {\n  var type = goog.typeOf(val);\n  // We do not use goog.isObject here in order to exclude function values.\n  return type == 'array' || type == 'object' && typeof val.length == 'number';\n};\n\n\n/**\n * Returns true if the object looks like a Date. To qualify as Date-like the\n * value needs to be an object and have a getFullYear() function.\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is a like a Date.\n */\ngoog.isDateLike = function(val) {\n  return goog.isObject(val) && typeof val.getFullYear == 'function';\n};\n\n\n/**\n * Returns true if the specified value is an object.  This includes arrays and\n * functions.\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is an object.\n */\ngoog.isObject = function(val) {\n  var type = typeof val;\n  return type == 'object' && val != null || type == 'function';\n  // return Object(val) === val also works, but is slower, especially if val is\n  // not an object.\n};\n\n\n/**\n * Gets a unique ID for an object. This mutates the object so that further calls\n * with the same object as a parameter returns the same value. The unique ID is\n * guaranteed to be unique across the current session amongst objects that are\n * passed into `getUid`. There is no guarantee that the ID is unique or\n * consistent across sessions. It is unsafe to generate unique ID for function\n * prototypes.\n *\n * @param {Object} obj The object to get the unique ID for.\n * @return {number} The unique ID for the object.\n */\ngoog.getUid = function(obj) {\n  // TODO(arv): Make the type stricter, do not accept null.\n  return Object.prototype.hasOwnProperty.call(obj, goog.UID_PROPERTY_) &&\n      obj[goog.UID_PROPERTY_] ||\n      (obj[goog.UID_PROPERTY_] = ++goog.uidCounter_);\n};\n\n\n/**\n * Whether the given object is already assigned a unique ID.\n *\n * This does not modify the object.\n *\n * @param {!Object} obj The object to check.\n * @return {boolean} Whether there is an assigned unique id for the object.\n */\ngoog.hasUid = function(obj) {\n  return !!obj[goog.UID_PROPERTY_];\n};\n\n\n/**\n * Removes the unique ID from an object. This is useful if the object was\n * previously mutated using `goog.getUid` in which case the mutation is\n * undone.\n * @param {Object} obj The object to remove the unique ID field from.\n */\ngoog.removeUid = function(obj) {\n  // TODO(arv): Make the type stricter, do not accept null.\n\n  // In IE, DOM nodes are not instances of Object and throw an exception if we\n  // try to delete.  Instead we try to use removeAttribute.\n  if (obj !== null && 'removeAttribute' in obj) {\n    obj.removeAttribute(goog.UID_PROPERTY_);\n  }\n\n  try {\n    delete obj[goog.UID_PROPERTY_];\n  } catch (ex) {\n  }\n};\n\n\n/**\n * Name for unique ID property. Initialized in a way to help avoid collisions\n * with other closure JavaScript on the same page.\n * @type {string}\n * @private\n */\ngoog.UID_PROPERTY_ = 'closure_uid_' + ((Math.random() * 1e9) >>> 0);\n\n\n/**\n * Counter for UID.\n * @type {number}\n * @private\n */\ngoog.uidCounter_ = 0;\n\n\n/**\n * Clones a value. The input may be an Object, Array, or basic type. Objects and\n * arrays will be cloned recursively.\n *\n * WARNINGS:\n * <code>goog.cloneObject</code> does not detect reference loops. Objects that\n * refer to themselves will cause infinite recursion.\n *\n * <code>goog.cloneObject</code> is unaware of unique identifiers, and copies\n * UIDs created by <code>getUid</code> into cloned results.\n *\n * @param {*} obj The value to clone.\n * @return {*} A clone of the input value.\n * @deprecated goog.cloneObject is unsafe. Prefer the goog.object methods.\n */\ngoog.cloneObject = function(obj) {\n  var type = goog.typeOf(obj);\n  if (type == 'object' || type == 'array') {\n    if (typeof obj.clone === 'function') {\n      return obj.clone();\n    }\n    if (typeof Map !== 'undefined' && obj instanceof Map) {\n      return new Map(obj);\n    } else if (typeof Set !== 'undefined' && obj instanceof Set) {\n      return new Set(obj);\n    }\n    var clone = type == 'array' ? [] : {};\n    for (var key in obj) {\n      clone[key] = goog.cloneObject(obj[key]);\n    }\n    return clone;\n  }\n\n  return obj;\n};\n\n\n/**\n * A native implementation of goog.bind.\n * @param {?function(this:T, ...)} fn A function to partially apply.\n * @param {T} selfObj Specifies the object which this should point to when the\n *     function is run.\n * @param {...*} var_args Additional arguments that are partially applied to the\n *     function.\n * @return {!Function} A partially-applied form of the function goog.bind() was\n *     invoked as a method of.\n * @template T\n * @private\n */\ngoog.bindNative_ = function(fn, selfObj, var_args) {\n  return /** @type {!Function} */ (fn.call.apply(fn.bind, arguments));\n};\n\n\n/**\n * A pure-JS implementation of goog.bind.\n * @param {?function(this:T, ...)} fn A function to partially apply.\n * @param {T} selfObj Specifies the object which this should point to when the\n *     function is run.\n * @param {...*} var_args Additional arguments that are partially applied to the\n *     function.\n * @return {!Function} A partially-applied form of the function goog.bind() was\n *     invoked as a method of.\n * @template T\n * @private\n */\ngoog.bindJs_ = function(fn, selfObj, var_args) {\n  if (!fn) {\n    throw new Error();\n  }\n\n  if (arguments.length > 2) {\n    var boundArgs = Array.prototype.slice.call(arguments, 2);\n    return function() {\n      // Prepend the bound arguments to the current arguments.\n      var newArgs = Array.prototype.slice.call(arguments);\n      Array.prototype.unshift.apply(newArgs, boundArgs);\n      return fn.apply(selfObj, newArgs);\n    };\n\n  } else {\n    return function() {\n      return fn.apply(selfObj, arguments);\n    };\n  }\n};\n\n\n/**\n * Partially applies this function to a particular 'this object' and zero or\n * more arguments. The result is a new function with some arguments of the first\n * function pre-filled and the value of this 'pre-specified'.\n *\n * Remaining arguments specified at call-time are appended to the pre-specified\n * ones.\n *\n * Also see: {@link #partial}.\n *\n * Usage:\n * <pre>var barMethBound = goog.bind(myFunction, myObj, 'arg1', 'arg2');\n * barMethBound('arg3', 'arg4');</pre>\n *\n * @param {?function(this:T, ...)} fn A function to partially apply.\n * @param {T} selfObj Specifies the object which this should point to when the\n *     function is run.\n * @param {...*} var_args Additional arguments that are partially applied to the\n *     function.\n * @return {!Function} A partially-applied form of the function goog.bind() was\n *     invoked as a method of.\n * @template T\n * @suppress {deprecated} See above.\n * @deprecated use `=> {}` or Function.prototype.bind instead.\n */\ngoog.bind = function(fn, selfObj, var_args) {\n  // TODO(nicksantos): narrow the type signature.\n  if (Function.prototype.bind &&\n      // NOTE(nicksantos): Somebody pulled base.js into the default Chrome\n      // extension environment. This means that for Chrome extensions, they get\n      // the implementation of Function.prototype.bind that calls goog.bind\n      // instead of the native one. Even worse, we don't want to introduce a\n      // circular dependency between goog.bind and Function.prototype.bind, so\n      // we have to hack this to make sure it works correctly.\n      Function.prototype.bind.toString().indexOf('native code') != -1) {\n    goog.bind = goog.bindNative_;\n  } else {\n    goog.bind = goog.bindJs_;\n  }\n  return goog.bind.apply(null, arguments);\n};\n\n\n/**\n * Like goog.bind(), except that a 'this object' is not required. Useful when\n * the target function is already bound.\n *\n * Usage:\n * var g = goog.partial(f, arg1, arg2);\n * g(arg3, arg4);\n *\n * @param {Function} fn A function to partially apply.\n * @param {...*} var_args Additional arguments that are partially applied to fn.\n * @return {!Function} A partially-applied form of the function goog.partial()\n *     was invoked as a method of.\n */\ngoog.partial = function(fn, var_args) {\n  var args = Array.prototype.slice.call(arguments, 1);\n  return function() {\n    // Clone the array (with slice()) and append additional arguments\n    // to the existing arguments.\n    var newArgs = args.slice();\n    newArgs.push.apply(newArgs, arguments);\n    return fn.apply(/** @type {?} */ (this), newArgs);\n  };\n};\n\n\n/**\n * @return {number} An integer value representing the number of milliseconds\n *     between midnight, January 1, 1970 and the current time.\n * @deprecated Use Date.now\n */\ngoog.now = function() {\n  return Date.now();\n};\n\n\n/**\n * Evals JavaScript in the global scope.\n *\n * Throws an exception if neither execScript or eval is defined.\n * @param {string|!TrustedScript} script JavaScript string.\n */\ngoog.globalEval = function(script) {\n  (0, eval)(script);\n};\n\n\n/**\n * Optional map of CSS class names to obfuscated names used with\n * goog.getCssName().\n * @private {!Object<string, string>|undefined}\n * @see goog.setCssNameMapping\n */\ngoog.cssNameMapping_;\n\n\n/**\n * Optional obfuscation style for CSS class names. Should be set to either\n * 'BY_WHOLE' or 'BY_PART' if defined.\n * @type {string|undefined}\n * @private\n * @see goog.setCssNameMapping\n */\ngoog.cssNameMappingStyle_;\n\n\n\n/**\n * A hook for modifying the default behavior goog.getCssName. The function\n * if present, will receive the standard output of the goog.getCssName as\n * its input.\n *\n * @type {(function(string):string)|undefined}\n */\ngoog.global.CLOSURE_CSS_NAME_MAP_FN;\n\n\n/**\n * Handles strings that are intended to be used as CSS class names.\n *\n * This function works in tandem with @see goog.setCssNameMapping.\n *\n * Without any mapping set, the arguments are simple joined with a hyphen and\n * passed through unaltered.\n *\n * When there is a mapping, there are two possible styles in which these\n * mappings are used. In the BY_PART style, each part (i.e. in between hyphens)\n * of the passed in css name is rewritten according to the map. In the BY_WHOLE\n * style, the full css name is looked up in the map directly. If a rewrite is\n * not specified by the map, the compiler will output a warning.\n *\n * When the mapping is passed to the compiler, it will replace calls to\n * goog.getCssName with the strings from the mapping, e.g.\n *     var x = goog.getCssName('foo');\n *     var y = goog.getCssName(this.baseClass, 'active');\n *  becomes:\n *     var x = 'foo';\n *     var y = this.baseClass + '-active';\n *\n * If one argument is passed it will be processed, if two are passed only the\n * modifier will be processed, as it is assumed the first argument was generated\n * as a result of calling goog.getCssName.\n *\n * @param {string} className The class name.\n * @param {string=} opt_modifier A modifier to be appended to the class name.\n * @return {string} The class name or the concatenation of the class name and\n *     the modifier.\n */\ngoog.getCssName = function(className, opt_modifier) {\n  // String() is used for compatibility with compiled soy where the passed\n  // className can be non-string objects.\n  if (String(className).charAt(0) == '.') {\n    throw new Error(\n        'className passed in goog.getCssName must not start with \".\".' +\n        ' You passed: ' + className);\n  }\n\n  var getMapping = function(cssName) {\n    return goog.cssNameMapping_[cssName] || cssName;\n  };\n\n  var renameByParts = function(cssName) {\n    // Remap all the parts individually.\n    var parts = cssName.split('-');\n    var mapped = [];\n    for (var i = 0; i < parts.length; i++) {\n      mapped.push(getMapping(parts[i]));\n    }\n    return mapped.join('-');\n  };\n\n  var rename;\n  if (goog.cssNameMapping_) {\n    rename =\n        goog.cssNameMappingStyle_ == 'BY_WHOLE' ? getMapping : renameByParts;\n  } else {\n    rename = function(a) {\n      return a;\n    };\n  }\n\n  var result =\n      opt_modifier ? className + '-' + rename(opt_modifier) : rename(className);\n\n  // The special CLOSURE_CSS_NAME_MAP_FN allows users to specify further\n  // processing of the class name.\n  if (goog.global.CLOSURE_CSS_NAME_MAP_FN) {\n    return goog.global.CLOSURE_CSS_NAME_MAP_FN(result);\n  }\n\n  return result;\n};\n\n\n/**\n * Sets the map to check when returning a value from goog.getCssName(). Example:\n * <pre>\n * goog.setCssNameMapping({\n *   \"goog\": \"a\",\n *   \"disabled\": \"b\",\n * });\n *\n * var x = goog.getCssName('goog');\n * // The following evaluates to: \"a a-b\".\n * goog.getCssName('goog') + ' ' + goog.getCssName(x, 'disabled')\n * </pre>\n * When declared as a map of string literals to string literals, the JSCompiler\n * will replace all calls to goog.getCssName() using the supplied map if the\n * --process_closure_primitives flag is set.\n *\n * @param {!Object} mapping A map of strings to strings where keys are possible\n *     arguments to goog.getCssName() and values are the corresponding values\n *     that should be returned.\n * @param {string=} opt_style The style of css name mapping. There are two valid\n *     options: 'BY_PART', and 'BY_WHOLE'.\n * @see goog.getCssName for a description.\n */\ngoog.setCssNameMapping = function(mapping, opt_style) {\n  goog.cssNameMapping_ = mapping;\n  goog.cssNameMappingStyle_ = opt_style;\n};\n\n\n/**\n * To use CSS renaming in compiled mode, one of the input files should have a\n * call to goog.setCssNameMapping() with an object literal that the JSCompiler\n * can extract and use to replace all calls to goog.getCssName(). In uncompiled\n * mode, JavaScript code should be loaded before this base.js file that declares\n * a global variable, CLOSURE_CSS_NAME_MAPPING, which is used below. This is\n * to ensure that the mapping is loaded before any calls to goog.getCssName()\n * are made in uncompiled mode.\n *\n * A hook for overriding the CSS name mapping.\n * @type {!Object<string, string>|undefined}\n */\ngoog.global.CLOSURE_CSS_NAME_MAPPING;\n\n\nif (!COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING) {\n  // This does not call goog.setCssNameMapping() because the JSCompiler\n  // requires that goog.setCssNameMapping() be called with an object literal.\n  goog.cssNameMapping_ = goog.global.CLOSURE_CSS_NAME_MAPPING;\n}\n\n/**\n * Options bag type for `goog.getMsg()` third argument.\n *\n * It is important to note that these options need to be known at compile time,\n * so they must always be provided to `goog.getMsg()` as an actual object\n * literal in the function call. Otherwise, closure-compiler will report an\n * error.\n * @record\n */\ngoog.GetMsgOptions = function() {};\n\n/**\n * If `true`, escape '<' in the message string to '&lt;'.\n *\n * Used by Closure Templates where the generated code size and performance is\n * critical which is why {@link goog.html.SafeHtmlFormatter} is not used.\n * The value must be literal `true` or `false`.\n * @type {boolean|undefined}\n */\ngoog.GetMsgOptions.prototype.html;\n\n/**\n * If `true`, unescape common html entities: &gt;, &lt;, &apos;, &quot; and\n * &amp;.\n *\n * Used for messages not in HTML context, such as with the `textContent`\n * property.\n * The value must be literal `true` or `false`.\n * @type {boolean|undefined}\n */\ngoog.GetMsgOptions.prototype.unescapeHtmlEntities;\n\n/**\n * Associates placeholder names with strings showing how their values are\n * obtained.\n *\n * This field is intended for use in automatically generated JS code.\n * Human-written code should use meaningful placeholder names instead.\n *\n * closure-compiler uses this as the contents of the `<ph>` tag in the\n * XMB file it generates or defaults to `-` for historical reasons.\n *\n * Must be an object literal.\n * Ignored at runtime.\n * Keys are placeholder names.\n * Values are string literals indicating how the value is obtained.\n * Typically this is a snippet of source code.\n * @type {!Object<string, string>|undefined}\n */\ngoog.GetMsgOptions.prototype.original_code;\n\n/**\n * Associates placeholder names with example values.\n *\n * closure-compiler uses this as the contents of the `<ex>` tag in the\n * XMB file it generates or defaults to `-` for historical reasons.\n *\n * Must be an object literal.\n * Ignored at runtime.\n * Keys are placeholder names.\n * Values are string literals containing example placeholder values.\n * (e.g. \"George McFly\" for a name placeholder)\n * @type {!Object<string, string>|undefined}\n */\ngoog.GetMsgOptions.prototype.example;\n\n/**\n * Gets a localized message.\n *\n * This function is a compiler primitive. If you give the compiler a localized\n * message bundle, it will replace the string at compile-time with a localized\n * version, and expand goog.getMsg call to a concatenated string.\n *\n * Messages must be initialized in the form:\n * <code>\n * var MSG_NAME = goog.getMsg('Hello {$placeholder}', {'placeholder': 'world'});\n * </code>\n *\n * This function produces a string which should be treated as plain text. Use\n * {@link goog.html.SafeHtmlFormatter} in conjunction with goog.getMsg to\n * produce SafeHtml.\n *\n * @param {string} str Translatable string, places holders in the form {$foo}.\n * @param {!Object<string, string>=} opt_values Maps place holder name to value.\n * @param {!goog.GetMsgOptions=} opt_options see `goog.GetMsgOptions`\n * @return {string} message with placeholders filled.\n */\ngoog.getMsg = function(str, opt_values, opt_options) {\n  if (opt_options && opt_options.html) {\n    // Note that '&' is not replaced because the translation can contain HTML\n    // entities.\n    str = str.replace(/</g, '&lt;');\n  }\n  if (opt_options && opt_options.unescapeHtmlEntities) {\n    // Note that \"&amp;\" must be the last to avoid \"creating\" new entities.\n    str = str.replace(/&lt;/g, '<')\n              .replace(/&gt;/g, '>')\n              .replace(/&apos;/g, '\\'')\n              .replace(/&quot;/g, '\"')\n              .replace(/&amp;/g, '&');\n  }\n  if (opt_values) {\n    str = str.replace(/\\{\\$([^}]+)}/g, function(match, key) {\n      return (opt_values != null && key in opt_values) ? opt_values[key] :\n                                                         match;\n    });\n  }\n  return str;\n};\n\n\n/**\n * Gets a localized message. If the message does not have a translation, gives a\n * fallback message.\n *\n * This is useful when introducing a new message that has not yet been\n * translated into all languages.\n *\n * This function is a compiler primitive. Must be used in the form:\n * <code>var x = goog.getMsgWithFallback(MSG_A, MSG_B);</code>\n * where MSG_A and MSG_B were initialized with goog.getMsg.\n *\n * @param {string} a The preferred message.\n * @param {string} b The fallback message.\n * @return {string} The best translated message.\n */\ngoog.getMsgWithFallback = function(a, b) {\n  return a;\n};\n\n\n/**\n * Exposes an unobfuscated global namespace path for the given object.\n * Note that fields of the exported object *will* be obfuscated, unless they are\n * exported in turn via this function or goog.exportProperty.\n *\n * Also handy for making public items that are defined in anonymous closures.\n *\n * ex. goog.exportSymbol('public.path.Foo', Foo);\n *\n * ex. goog.exportSymbol('public.path.Foo.staticFunction', Foo.staticFunction);\n *     public.path.Foo.staticFunction();\n *\n * ex. goog.exportSymbol('public.path.Foo.prototype.myMethod',\n *                       Foo.prototype.myMethod);\n *     new public.path.Foo().myMethod();\n *\n * @param {string} publicPath Unobfuscated name to export.\n * @param {*} object Object the name should point to.\n * @param {?Object=} objectToExportTo The object to add the path to; default\n *     is goog.global.\n */\ngoog.exportSymbol = function(publicPath, object, objectToExportTo) {\n  goog.exportPath_(\n      publicPath, object, /* overwriteImplicit= */ true, objectToExportTo);\n};\n\n\n/**\n * Exports a property unobfuscated into the object's namespace.\n * ex. goog.exportProperty(Foo, 'staticFunction', Foo.staticFunction);\n * ex. goog.exportProperty(Foo.prototype, 'myMethod', Foo.prototype.myMethod);\n * @param {Object} object Object whose static property is being exported.\n * @param {string} publicName Unobfuscated name to export.\n * @param {*} symbol Object the name should point to.\n */\ngoog.exportProperty = function(object, publicName, symbol) {\n  object[publicName] = symbol;\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * Usage:\n * <pre>\n * function ParentClass(a, b) { }\n * ParentClass.prototype.foo = function(a) { };\n *\n * function ChildClass(a, b, c) {\n *   ChildClass.base(this, 'constructor', a, b);\n * }\n * goog.inherits(ChildClass, ParentClass);\n *\n * var child = new ChildClass('a', 'b', 'see');\n * child.foo(); // This works.\n * </pre>\n *\n * @param {!Function} childCtor Child class.\n * @param {!Function} parentCtor Parent class.\n * @suppress {strictMissingProperties} superClass_ and base is not defined on\n *    Function.\n * @deprecated Use ECMAScript class syntax instead.\n */\ngoog.inherits = function(childCtor, parentCtor) {\n  /** @constructor */\n  function tempCtor() {}\n  tempCtor.prototype = parentCtor.prototype;\n  childCtor.superClass_ = parentCtor.prototype;\n  childCtor.prototype = new tempCtor();\n  /** @override */\n  childCtor.prototype.constructor = childCtor;\n\n  /**\n   * Calls superclass constructor/method.\n   *\n   * This function is only available if you use goog.inherits to\n   * express inheritance relationships between classes.\n   *\n   * NOTE: This is a replacement for goog.base and for superClass_\n   * property defined in childCtor.\n   *\n   * @param {!Object} me Should always be \"this\".\n   * @param {string} methodName The method name to call. Calling\n   *     superclass constructor can be done with the special string\n   *     'constructor'.\n   * @param {...*} var_args The arguments to pass to superclass\n   *     method/constructor.\n   * @return {*} The return value of the superclass method/constructor.\n   */\n  childCtor.base = function(me, methodName, var_args) {\n    // Copying using loop to avoid deop due to passing arguments object to\n    // function. This is faster in many JS engines as of late 2014.\n    var args = new Array(arguments.length - 2);\n    for (var i = 2; i < arguments.length; i++) {\n      args[i - 2] = arguments[i];\n    }\n    return parentCtor.prototype[methodName].apply(me, args);\n  };\n};\n\n\n/**\n * Allow for aliasing within scope functions.  This function exists for\n * uncompiled code - in compiled code the calls will be inlined and the aliases\n * applied.  In uncompiled code the function is simply run since the aliases as\n * written are valid JavaScript.\n *\n *\n * @param {function()} fn Function to call.  This function can contain aliases\n *     to namespaces (e.g. \"var dom = goog.dom\") or classes\n *     (e.g. \"var Timer = goog.Timer\").\n * @deprecated Use goog.module instead.\n */\ngoog.scope = function(fn) {\n  if (goog.isInModuleLoader_()) {\n    throw new Error('goog.scope is not supported within a module.');\n  }\n  fn.call(goog.global);\n};\n\n\n/*\n * To support uncompiled, strict mode bundles that use eval to divide source\n * like so:\n *    eval('someSource;//# sourceUrl sourcefile.js');\n * We need to export the globally defined symbols \"goog\" and \"COMPILED\".\n * Exporting \"goog\" breaks the compiler optimizations, so we required that\n * be defined externally.\n * NOTE: We don't use goog.exportSymbol here because we don't want to trigger\n * extern generation when that compiler option is enabled.\n */\nif (!COMPILED) {\n  goog.global['COMPILED'] = COMPILED;\n}\n\n\n//==============================================================================\n// goog.defineClass implementation\n//==============================================================================\n\n\n/**\n * Creates a restricted form of a Closure \"class\":\n *   - from the compiler's perspective, the instance returned from the\n *     constructor is sealed (no new properties may be added).  This enables\n *     better checks.\n *   - the compiler will rewrite this definition to a form that is optimal\n *     for type checking and optimization (initially this will be a more\n *     traditional form).\n *\n * @param {Function} superClass The superclass, Object or null.\n * @param {goog.defineClass.ClassDescriptor} def\n *     An object literal describing\n *     the class.  It may have the following properties:\n *     \"constructor\": the constructor function\n *     \"statics\": an object literal containing methods to add to the constructor\n *        as \"static\" methods or a function that will receive the constructor\n *        function as its only parameter to which static properties can\n *        be added.\n *     all other properties are added to the prototype.\n * @return {!Function} The class constructor.\n * @deprecated Use ECMAScript class syntax instead.\n */\ngoog.defineClass = function(superClass, def) {\n  // TODO(johnlenz): consider making the superClass an optional parameter.\n  var constructor = def.constructor;\n  var statics = def.statics;\n  // Wrap the constructor prior to setting up the prototype and static methods.\n  if (!constructor || constructor == Object.prototype.constructor) {\n    constructor = function() {\n      throw new Error(\n          'cannot instantiate an interface (no constructor defined).');\n    };\n  }\n\n  var cls = goog.defineClass.createSealingConstructor_(constructor, superClass);\n  if (superClass) {\n    goog.inherits(cls, superClass);\n  }\n\n  // Remove all the properties that should not be copied to the prototype.\n  delete def.constructor;\n  delete def.statics;\n\n  goog.defineClass.applyProperties_(cls.prototype, def);\n  if (statics != null) {\n    if (statics instanceof Function) {\n      statics(cls);\n    } else {\n      goog.defineClass.applyProperties_(cls, statics);\n    }\n  }\n\n  return cls;\n};\n\n\n/**\n * @typedef {{\n *   constructor: (!Function|undefined),\n *   statics: (Object|undefined|function(Function):void)\n * }}\n */\ngoog.defineClass.ClassDescriptor;\n\n\n/**\n * @define {boolean} Whether the instances returned by goog.defineClass should\n *     be sealed when possible.\n *\n * When sealing is disabled the constructor function will not be wrapped by\n * goog.defineClass, making it incompatible with ES6 class methods.\n */\ngoog.defineClass.SEAL_CLASS_INSTANCES =\n    goog.define('goog.defineClass.SEAL_CLASS_INSTANCES', goog.DEBUG);\n\n\n/**\n * If goog.defineClass.SEAL_CLASS_INSTANCES is enabled and Object.seal is\n * defined, this function will wrap the constructor in a function that seals the\n * results of the provided constructor function.\n *\n * @param {!Function} ctr The constructor whose results maybe be sealed.\n * @param {Function} superClass The superclass constructor.\n * @return {!Function} The replacement constructor.\n * @private\n */\ngoog.defineClass.createSealingConstructor_ = function(ctr, superClass) {\n  if (!goog.defineClass.SEAL_CLASS_INSTANCES) {\n    // Do now wrap the constructor when sealing is disabled. Angular code\n    // depends on this for injection to work properly.\n    return ctr;\n  }\n\n  // NOTE: The sealing behavior has been removed\n\n  /**\n   * @this {Object}\n   * @return {?}\n   */\n  var wrappedCtr = function() {\n    // Don't seal an instance of a subclass when it calls the constructor of\n    // its super class as there is most likely still setup to do.\n    var instance = ctr.apply(this, arguments) || this;\n    instance[goog.UID_PROPERTY_] = instance[goog.UID_PROPERTY_];\n\n    return instance;\n  };\n\n  return wrappedCtr;\n};\n\n\n\n// TODO(johnlenz): share these values with the goog.object\n/**\n * The names of the fields that are defined on Object.prototype.\n * @type {!Array<string>}\n * @private\n * @const\n */\ngoog.defineClass.OBJECT_PROTOTYPE_FIELDS_ = [\n  'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable',\n  'toLocaleString', 'toString', 'valueOf'\n];\n\n\n// TODO(johnlenz): share this function with the goog.object\n/**\n * @param {!Object} target The object to add properties to.\n * @param {!Object} source The object to copy properties from.\n * @private\n */\ngoog.defineClass.applyProperties_ = function(target, source) {\n  // TODO(johnlenz): update this to support ES5 getters/setters\n\n  var key;\n  for (key in source) {\n    if (Object.prototype.hasOwnProperty.call(source, key)) {\n      target[key] = source[key];\n    }\n  }\n\n  // For IE the for-in-loop does not contain any properties that are not\n  // enumerable on the prototype object (for example isPrototypeOf from\n  // Object.prototype) and it will also not include 'replace' on objects that\n  // extend String and change 'replace' (not that it is common for anyone to\n  // extend anything except Object).\n  for (var i = 0; i < goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length; i++) {\n    key = goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[i];\n    if (Object.prototype.hasOwnProperty.call(source, key)) {\n      target[key] = source[key];\n    }\n  }\n};\n\n/**\n * Returns the parameter.\n * @param {string} s\n * @return {string}\n * @private\n */\ngoog.identity_ = function(s) {\n  return s;\n};\n\n\n/**\n * Creates Trusted Types policy if Trusted Types are supported by the browser.\n * The policy just blesses any string as a Trusted Type. It is not visibility\n * restricted because anyone can also call trustedTypes.createPolicy directly.\n * However, the allowed names should be restricted by a HTTP header and the\n * reference to the created policy should be visibility restricted.\n * @param {string} name\n * @return {?TrustedTypePolicy}\n */\ngoog.createTrustedTypesPolicy = function(name) {\n  var policy = null;\n  var policyFactory = goog.global.trustedTypes;\n  if (!policyFactory || !policyFactory.createPolicy) {\n    return policy;\n  }\n  // trustedTypes.createPolicy throws if called with a name that is already\n  // registered, even in report-only mode. Until the API changes, catch the\n  // error not to break the applications functionally. In such case, the code\n  // will fall back to using regular Safe Types.\n  // TODO(koto): Remove catching once createPolicy API stops throwing.\n  try {\n    policy = policyFactory.createPolicy(name, {\n      createHTML: goog.identity_,\n      createScript: goog.identity_,\n      createScriptURL: goog.identity_\n    });\n  } catch (e) {\n    goog.logToConsole_(e.message);\n  }\n  return policy;\n};\n\n// There's a bug in the compiler where without collapse properties the\n// Closure namespace defines do not guard code correctly. To help reduce code\n// size also check for !COMPILED even though it redundant until this is fixed.\nif (!COMPILED && goog.DEPENDENCIES_ENABLED) {\n\n\n  /**\n   * Tries to detect whether the current browser is Edge, based on the user\n   * agent. This matches only pre-Chromium Edge.\n   * @see https://docs.microsoft.com/en-us/microsoft-edge/web-platform/user-agent-string\n   * @return {boolean} True if the current browser is Edge.\n   * @private\n   */\n  goog.isEdge_ = function() {\n    var userAgent = goog.global.navigator && goog.global.navigator.userAgent ?\n        goog.global.navigator.userAgent :\n        '';\n    var edgeRe = /Edge\\/(\\d+)(\\.\\d)*/i;\n    return !!userAgent.match(edgeRe);\n  };\n\n\n  /**\n   * Tries to detect whether is in the context of an HTML document.\n   * @return {boolean} True if it looks like HTML document.\n   * @private\n   */\n  goog.inHtmlDocument_ = function() {\n    /** @type {!Document} */\n    var doc = goog.global.document;\n    return doc != null && 'write' in doc;  // XULDocument misses write.\n  };\n\n\n  /**\n   * We'd like to check for if the document readyState is 'loading'; however\n   * there are bugs on IE 10 and below where the readyState being anything other\n   * than 'complete' is not reliable.\n   * @return {boolean}\n   * @private\n   */\n  goog.isDocumentLoading_ = function() {\n    // attachEvent is available on IE 6 thru 10 only, and thus can be used to\n    // detect those browsers.\n    /** @type {!HTMLDocument} */\n    var doc = goog.global.document;\n    return doc.attachEvent ? doc.readyState != 'complete' :\n                             doc.readyState == 'loading';\n  };\n\n\n  /**\n   * Tries to detect the base path of base.js script that bootstraps Closure.\n   * @private\n   */\n  goog.findBasePath_ = function() {\n    if (goog.global.CLOSURE_BASE_PATH != undefined &&\n        // Anti DOM-clobbering runtime check (b/37736576).\n        typeof goog.global.CLOSURE_BASE_PATH === 'string') {\n      goog.basePath = goog.global.CLOSURE_BASE_PATH;\n      return;\n    } else if (!goog.inHtmlDocument_()) {\n      return;\n    }\n    /** @type {!Document} */\n    var doc = goog.global.document;\n    // If we have a currentScript available, use it exclusively.\n    var currentScript = doc.currentScript;\n    if (currentScript) {\n      var scripts = [currentScript];\n    } else {\n      var scripts = doc.getElementsByTagName('SCRIPT');\n    }\n    // Search backwards since the current script is in almost all cases the one\n    // that has base.js.\n    for (var i = scripts.length - 1; i >= 0; --i) {\n      var script = /** @type {!HTMLScriptElement} */ (scripts[i]);\n      var src = script.src;\n      var qmark = src.lastIndexOf('?');\n      var l = qmark == -1 ? src.length : qmark;\n      if (src.slice(l - 7, l) == 'base.js') {\n        goog.basePath = src.slice(0, l - 7);\n        return;\n      }\n    }\n  };\n\n  goog.findBasePath_();\n\n  /**\n   * Rewrites closing script tags in input to avoid ending an enclosing script\n   * tag.\n   *\n   * @param {string} str\n   * @return {string}\n   * @private\n   */\n  goog.protectScriptTag_ = function(str) {\n    return str.replace(/<\\/(SCRIPT)/ig, '\\\\x3c/$1');\n  };\n\n\n  /**\n   * A debug loader is responsible for downloading and executing javascript\n   * files in an unbundled, uncompiled environment.\n   *\n   * This can be custimized via the setDependencyFactory method, or by\n   * CLOSURE_IMPORT_SCRIPT/CLOSURE_LOAD_FILE_SYNC.\n   *\n   * @struct @constructor @final @private\n   */\n  goog.DebugLoader_ = function() {\n    /** @private @const {!Object<string, !goog.Dependency>} */\n    this.dependencies_ = {};\n    /** @private @const {!Object<string, string>} */\n    this.idToPath_ = {};\n    /** @private @const {!Object<string, boolean>} */\n    this.written_ = {};\n    /** @private @const {!Array<!goog.Dependency>} */\n    this.loadingDeps_ = [];\n    /** @private {!Array<!goog.Dependency>} */\n    this.depsToLoad_ = [];\n    /** @private {boolean} */\n    this.paused_ = false;\n    /** @private {!goog.DependencyFactory} */\n    this.factory_ = new goog.DependencyFactory();\n    /** @private @const {!Object<string, !Function>} */\n    this.deferredCallbacks_ = {};\n    /** @private @const {!Array<string>} */\n    this.deferredQueue_ = [];\n  };\n\n  /**\n   * @param {!Array<string>} namespaces\n   * @param {function(): undefined} callback Function to call once all the\n   *     namespaces have loaded.\n   */\n  goog.DebugLoader_.prototype.bootstrap = function(namespaces, callback) {\n    var cb = callback;\n    function resolve() {\n      if (cb) {\n        goog.global.setTimeout(cb, 0);\n        cb = null;\n      }\n    }\n\n    if (!namespaces.length) {\n      resolve();\n      return;\n    }\n\n    var deps = [];\n    for (var i = 0; i < namespaces.length; i++) {\n      var path = this.getPathFromDeps_(namespaces[i]);\n      if (!path) {\n        throw new Error('Unregonized namespace: ' + namespaces[i]);\n      }\n      deps.push(this.dependencies_[path]);\n    }\n\n    var require = goog.require;\n    var loaded = 0;\n    for (var i = 0; i < namespaces.length; i++) {\n      require(namespaces[i]);\n      deps[i].onLoad(function() {\n        if (++loaded == namespaces.length) {\n          resolve();\n        }\n      });\n    }\n  };\n\n\n  /**\n   * Loads the Closure Dependency file.\n   *\n   * Exposed a public function so CLOSURE_NO_DEPS can be set to false, base\n   * loaded, setDependencyFactory called, and then this called. i.e. allows\n   * custom loading of the deps file.\n   */\n  goog.DebugLoader_.prototype.loadClosureDeps = function() {\n    // Circumvent addDependency, which would try to transpile deps.js if\n    // transpile is set to always.\n    var relPath = 'deps.js';\n    this.depsToLoad_.push(this.factory_.createDependency(\n        goog.normalizePath_(goog.basePath + relPath), relPath, [], [], {}));\n    this.loadDeps_();\n  };\n\n\n  /**\n   * Notifies the debug loader when a dependency has been requested.\n   *\n   * @param {string} absPathOrId Path of the dependency or goog id.\n   * @param {boolean=} opt_force\n   */\n  goog.DebugLoader_.prototype.requested = function(absPathOrId, opt_force) {\n    var path = this.getPathFromDeps_(absPathOrId);\n    if (path &&\n        (opt_force || this.areDepsLoaded_(this.dependencies_[path].requires))) {\n      var callback = this.deferredCallbacks_[path];\n      if (callback) {\n        delete this.deferredCallbacks_[path];\n        callback();\n      }\n    }\n  };\n\n\n  /**\n   * Sets the dependency factory, which can be used to create custom\n   * goog.Dependency implementations to control how dependencies are loaded.\n   *\n   * @param {!goog.DependencyFactory} factory\n   */\n  goog.DebugLoader_.prototype.setDependencyFactory = function(factory) {\n    this.factory_ = factory;\n  };\n\n\n  /**\n   * Travserses the dependency graph and queues the given dependency, and all of\n   * its transitive dependencies, for loading and then starts loading if not\n   * paused.\n   *\n   * @param {string} namespace\n   * @private\n   */\n  goog.DebugLoader_.prototype.load_ = function(namespace) {\n    if (!this.getPathFromDeps_(namespace)) {\n      var errorMessage = 'goog.require could not find: ' + namespace;\n      goog.logToConsole_(errorMessage);\n    } else {\n      var loader = this;\n\n      var deps = [];\n\n      /** @param {string} namespace */\n      var visit = function(namespace) {\n        var path = loader.getPathFromDeps_(namespace);\n\n        if (!path) {\n          throw new Error('Bad dependency path or symbol: ' + namespace);\n        }\n\n        if (loader.written_[path]) {\n          return;\n        }\n\n        loader.written_[path] = true;\n\n        var dep = loader.dependencies_[path];\n        for (var i = 0; i < dep.requires.length; i++) {\n          if (!goog.isProvided_(dep.requires[i])) {\n            visit(dep.requires[i]);\n          }\n        }\n\n        deps.push(dep);\n      };\n\n      visit(namespace);\n\n      var wasLoading = !!this.depsToLoad_.length;\n      this.depsToLoad_ = this.depsToLoad_.concat(deps);\n\n      if (!this.paused_ && !wasLoading) {\n        this.loadDeps_();\n      }\n    }\n  };\n\n\n  /**\n   * Loads any queued dependencies until they are all loaded or paused.\n   *\n   * @private\n   */\n  goog.DebugLoader_.prototype.loadDeps_ = function() {\n    var loader = this;\n    var paused = this.paused_;\n\n    while (this.depsToLoad_.length && !paused) {\n      (function() {\n        var loadCallDone = false;\n        var dep = loader.depsToLoad_.shift();\n\n        var loaded = false;\n        loader.loading_(dep);\n\n        var controller = {\n          pause: function() {\n            if (loadCallDone) {\n              throw new Error('Cannot call pause after the call to load.');\n            } else {\n              paused = true;\n            }\n          },\n          resume: function() {\n            if (loadCallDone) {\n              loader.resume_();\n            } else {\n              // Some dep called pause and then resume in the same load call.\n              // Just keep running this same loop.\n              paused = false;\n            }\n          },\n          loaded: function() {\n            if (loaded) {\n              throw new Error('Double call to loaded.');\n            }\n\n            loaded = true;\n            loader.loaded_(dep);\n          },\n          pending: function() {\n            // Defensive copy.\n            var pending = [];\n            for (var i = 0; i < loader.loadingDeps_.length; i++) {\n              pending.push(loader.loadingDeps_[i]);\n            }\n            return pending;\n          },\n          /**\n           * @param {goog.ModuleType} type\n           */\n          setModuleState: function(type) {\n            goog.moduleLoaderState_ = {\n              type: type,\n              moduleName: '',\n              declareLegacyNamespace: false\n            };\n          },\n          /** @type {function(string, string, string=)} */\n          registerEs6ModuleExports: function(\n              path, exports, opt_closureNamespace) {\n            if (opt_closureNamespace) {\n              goog.loadedModules_[opt_closureNamespace] = {\n                exports: exports,\n                type: goog.ModuleType.ES6,\n                moduleId: opt_closureNamespace || ''\n              };\n            }\n          },\n          /** @type {function(string, ?)} */\n          registerGoogModuleExports: function(moduleId, exports) {\n            goog.loadedModules_[moduleId] = {\n              exports: exports,\n              type: goog.ModuleType.GOOG,\n              moduleId: moduleId\n            };\n          },\n          clearModuleState: function() {\n            goog.moduleLoaderState_ = null;\n          },\n          defer: function(callback) {\n            if (loadCallDone) {\n              throw new Error(\n                  'Cannot register with defer after the call to load.');\n            }\n            loader.defer_(dep, callback);\n          },\n          areDepsLoaded: function() {\n            return loader.areDepsLoaded_(dep.requires);\n          }\n        };\n\n        try {\n          dep.load(controller);\n        } finally {\n          loadCallDone = true;\n        }\n      })();\n    }\n\n    if (paused) {\n      this.pause_();\n    }\n  };\n\n\n  /** @private */\n  goog.DebugLoader_.prototype.pause_ = function() {\n    this.paused_ = true;\n  };\n\n\n  /** @private */\n  goog.DebugLoader_.prototype.resume_ = function() {\n    if (this.paused_) {\n      this.paused_ = false;\n      this.loadDeps_();\n    }\n  };\n\n\n  /**\n   * Marks the given dependency as loading (load has been called but it has not\n   * yet marked itself as finished). Useful for dependencies that want to know\n   * what else is loading. Example: goog.modules cannot eval if there are\n   * loading dependencies.\n   *\n   * @param {!goog.Dependency} dep\n   * @private\n   */\n  goog.DebugLoader_.prototype.loading_ = function(dep) {\n    this.loadingDeps_.push(dep);\n  };\n\n\n  /**\n   * Marks the given dependency as having finished loading and being available\n   * for require.\n   *\n   * @param {!goog.Dependency} dep\n   * @private\n   */\n  goog.DebugLoader_.prototype.loaded_ = function(dep) {\n    for (var i = 0; i < this.loadingDeps_.length; i++) {\n      if (this.loadingDeps_[i] == dep) {\n        this.loadingDeps_.splice(i, 1);\n        break;\n      }\n    }\n\n    for (var i = 0; i < this.deferredQueue_.length; i++) {\n      if (this.deferredQueue_[i] == dep.path) {\n        this.deferredQueue_.splice(i, 1);\n        break;\n      }\n    }\n\n    if (this.loadingDeps_.length == this.deferredQueue_.length &&\n        !this.depsToLoad_.length) {\n      // Something has asked to load these, but they may not be directly\n      // required again later, so load them now that we know we're done loading\n      // everything else. e.g. a goog module entry point.\n      while (this.deferredQueue_.length) {\n        this.requested(this.deferredQueue_.shift(), true);\n      }\n    }\n\n    dep.loaded();\n  };\n\n\n  /**\n   * @param {!Array<string>} pathsOrIds\n   * @return {boolean}\n   * @private\n   */\n  goog.DebugLoader_.prototype.areDepsLoaded_ = function(pathsOrIds) {\n    for (var i = 0; i < pathsOrIds.length; i++) {\n      var path = this.getPathFromDeps_(pathsOrIds[i]);\n      if (!path ||\n          (!(path in this.deferredCallbacks_) &&\n           !goog.isProvided_(pathsOrIds[i]))) {\n        return false;\n      }\n    }\n\n    return true;\n  };\n\n\n  /**\n   * @param {string} absPathOrId\n   * @return {?string}\n   * @private\n   */\n  goog.DebugLoader_.prototype.getPathFromDeps_ = function(absPathOrId) {\n    if (absPathOrId in this.idToPath_) {\n      return this.idToPath_[absPathOrId];\n    } else if (absPathOrId in this.dependencies_) {\n      return absPathOrId;\n    } else {\n      return null;\n    }\n  };\n\n\n  /**\n   * @param {!goog.Dependency} dependency\n   * @param {!Function} callback\n   * @private\n   */\n  goog.DebugLoader_.prototype.defer_ = function(dependency, callback) {\n    this.deferredCallbacks_[dependency.path] = callback;\n    this.deferredQueue_.push(dependency.path);\n  };\n\n\n  /**\n   * Interface for goog.Dependency implementations to have some control over\n   * loading of dependencies.\n   *\n   * @record\n   */\n  goog.LoadController = function() {};\n\n\n  /**\n   * Tells the controller to halt loading of more dependencies.\n   */\n  goog.LoadController.prototype.pause = function() {};\n\n\n  /**\n   * Tells the controller to resume loading of more dependencies if paused.\n   */\n  goog.LoadController.prototype.resume = function() {};\n\n\n  /**\n   * Tells the controller that this dependency has finished loading.\n   *\n   * This causes this to be removed from pending() and any load callbacks to\n   * fire.\n   */\n  goog.LoadController.prototype.loaded = function() {};\n\n\n  /**\n   * List of dependencies on which load has been called but which have not\n   * called loaded on their controller. This includes the current dependency.\n   *\n   * @return {!Array<!goog.Dependency>}\n   */\n  goog.LoadController.prototype.pending = function() {};\n\n\n  /**\n   * Registers an object as an ES6 module's exports so that goog.modules may\n   * require it by path.\n   *\n   * @param {string} path Full path of the module.\n   * @param {?} exports\n   * @param {string=} opt_closureNamespace Closure namespace to associate with\n   *     this module.\n   */\n  goog.LoadController.prototype.registerEs6ModuleExports = function(\n      path, exports, opt_closureNamespace) {};\n\n\n  /**\n   * Sets the current module state.\n   *\n   * @param {goog.ModuleType} type Type of module.\n   */\n  goog.LoadController.prototype.setModuleState = function(type) {};\n\n\n  /**\n   * Clears the current module state.\n   */\n  goog.LoadController.prototype.clearModuleState = function() {};\n\n\n  /**\n   * Registers a callback to call once the dependency is actually requested\n   * via goog.require + all of the immediate dependencies have been loaded or\n   * all other files have been loaded. Allows for lazy loading until\n   * require'd without pausing dependency loading, which is needed on old IE.\n   *\n   * @param {!Function} callback\n   */\n  goog.LoadController.prototype.defer = function(callback) {};\n\n\n  /**\n   * @return {boolean}\n   */\n  goog.LoadController.prototype.areDepsLoaded = function() {};\n\n\n  /**\n   * Basic super class for all dependencies Closure Library can load.\n   *\n   * This default implementation is designed to load untranspiled, non-module\n   * scripts in a web broswer.\n   *\n   * For goog.modules see {@see goog.GoogModuleDependency}.\n   * For untranspiled ES6 modules {@see goog.Es6ModuleDependency}.\n   *\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides goog.provided or goog.module symbols\n   *     in this file.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @struct @constructor\n   */\n  goog.Dependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    /** @const */\n    this.path = path;\n    /** @const */\n    this.relativePath = relativePath;\n    /** @const */\n    this.provides = provides;\n    /** @const */\n    this.requires = requires;\n    /** @const */\n    this.loadFlags = loadFlags;\n    /** @private {boolean} */\n    this.loaded_ = false;\n    /** @private {!Array<function()>} */\n    this.loadCallbacks_ = [];\n  };\n\n\n  /**\n   * @return {string} The pathname part of this dependency's path if it is a\n   *     URI.\n   */\n  goog.Dependency.prototype.getPathName = function() {\n    var pathName = this.path;\n    var protocolIndex = pathName.indexOf('://');\n    if (protocolIndex >= 0) {\n      pathName = pathName.substring(protocolIndex + 3);\n      var slashIndex = pathName.indexOf('/');\n      if (slashIndex >= 0) {\n        pathName = pathName.substring(slashIndex + 1);\n      }\n    }\n    return pathName;\n  };\n\n\n  /**\n   * @param {function()} callback Callback to fire as soon as this has loaded.\n   * @final\n   */\n  goog.Dependency.prototype.onLoad = function(callback) {\n    if (this.loaded_) {\n      callback();\n    } else {\n      this.loadCallbacks_.push(callback);\n    }\n  };\n\n\n  /**\n   * Marks this dependency as loaded and fires any callbacks registered with\n   * onLoad.\n   * @final\n   */\n  goog.Dependency.prototype.loaded = function() {\n    this.loaded_ = true;\n    var callbacks = this.loadCallbacks_;\n    this.loadCallbacks_ = [];\n    for (var i = 0; i < callbacks.length; i++) {\n      callbacks[i]();\n    }\n  };\n\n\n  /**\n   * Whether or not document.written / appended script tags should be deferred.\n   *\n   * @private {boolean}\n   */\n  goog.Dependency.defer_ = false;\n\n\n  /**\n   * Map of script ready / state change callbacks. Old IE cannot handle putting\n   * these properties on goog.global.\n   *\n   * @private @const {!Object<string, function(?):undefined>}\n   */\n  goog.Dependency.callbackMap_ = {};\n\n\n  /**\n   * @param {function(...?):?} callback\n   * @return {string}\n   * @private\n   */\n  goog.Dependency.registerCallback_ = function(callback) {\n    var key = Math.random().toString(32);\n    goog.Dependency.callbackMap_[key] = callback;\n    return key;\n  };\n\n\n  /**\n   * @param {string} key\n   * @private\n   */\n  goog.Dependency.unregisterCallback_ = function(key) {\n    delete goog.Dependency.callbackMap_[key];\n  };\n\n\n  /**\n   * @param {string} key\n   * @param {...?} var_args\n   * @private\n   * @suppress {unusedPrivateMembers}\n   */\n  goog.Dependency.callback_ = function(key, var_args) {\n    if (key in goog.Dependency.callbackMap_) {\n      var callback = goog.Dependency.callbackMap_[key];\n      var args = [];\n      for (var i = 1; i < arguments.length; i++) {\n        args.push(arguments[i]);\n      }\n      callback.apply(undefined, args);\n    } else {\n      var errorMessage = 'Callback key ' + key +\n          ' does not exist (was base.js loaded more than once?).';\n      throw Error(errorMessage);\n    }\n  };\n\n\n  /**\n   * Starts loading this dependency. This dependency can pause loading if it\n   * needs to and resume it later via the controller interface.\n   *\n   * When this is loaded it should call controller.loaded(). Note that this will\n   * end up calling the loaded method of this dependency; there is no need to\n   * call it explicitly.\n   *\n   * @param {!goog.LoadController} controller\n   */\n  goog.Dependency.prototype.load = function(controller) {\n    if (goog.global.CLOSURE_IMPORT_SCRIPT) {\n      if (goog.global.CLOSURE_IMPORT_SCRIPT(this.path)) {\n        controller.loaded();\n      } else {\n        controller.pause();\n      }\n      return;\n    }\n\n    if (!goog.inHtmlDocument_()) {\n      goog.logToConsole_(\n          'Cannot use default debug loader outside of HTML documents.');\n      if (this.relativePath == 'deps.js') {\n        // Some old code is relying on base.js auto loading deps.js failing with\n        // no error before later setting CLOSURE_IMPORT_SCRIPT.\n        // CLOSURE_IMPORT_SCRIPT should be set *before* base.js is loaded, or\n        // CLOSURE_NO_DEPS set to true.\n        goog.logToConsole_(\n            'Consider setting CLOSURE_IMPORT_SCRIPT before loading base.js, ' +\n            'or setting CLOSURE_NO_DEPS to true.');\n        controller.loaded();\n      } else {\n        controller.pause();\n      }\n      return;\n    }\n\n    /** @type {!HTMLDocument} */\n    var doc = goog.global.document;\n\n    // If the user tries to require a new symbol after document load,\n    // something has gone terribly wrong. Doing a document.write would\n    // wipe out the page. This does not apply to the CSP-compliant method\n    // of writing script tags.\n    if (doc.readyState == 'complete' &&\n        !goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING) {\n      // Certain test frameworks load base.js multiple times, which tries\n      // to write deps.js each time. If that happens, just fail silently.\n      // These frameworks wipe the page between each load of base.js, so this\n      // is OK.\n      var isDeps = /\\bdeps.js$/.test(this.path);\n      if (isDeps) {\n        controller.loaded();\n        return;\n      } else {\n        throw Error('Cannot write \"' + this.path + '\" after document load');\n      }\n    }\n\n    var nonce = goog.getScriptNonce_();\n    if (!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING &&\n        goog.isDocumentLoading_()) {\n      var key;\n      var callback = function(script) {\n        if (script.readyState && script.readyState != 'complete') {\n          script.onload = callback;\n          return;\n        }\n        goog.Dependency.unregisterCallback_(key);\n        controller.loaded();\n      };\n      key = goog.Dependency.registerCallback_(callback);\n\n      var defer = goog.Dependency.defer_ ? ' defer' : '';\n      var nonceAttr = nonce ? ' nonce=\"' + nonce + '\"' : '';\n      var script = '<script src=\"' + this.path + '\"' + nonceAttr + defer +\n          ' id=\"script-' + key + '\"><\\/script>';\n\n      script += '<script' + nonceAttr + '>';\n\n      if (goog.Dependency.defer_) {\n        script += 'document.getElementById(\\'script-' + key +\n            '\\').onload = function() {\\n' +\n            '  goog.Dependency.callback_(\\'' + key + '\\', this);\\n' +\n            '};\\n';\n      } else {\n        script += 'goog.Dependency.callback_(\\'' + key +\n            '\\', document.getElementById(\\'script-' + key + '\\'));';\n      }\n\n      script += '<\\/script>';\n\n      doc.write(\n          goog.TRUSTED_TYPES_POLICY_ ?\n              goog.TRUSTED_TYPES_POLICY_.createHTML(script) :\n              script);\n    } else {\n      var scriptEl =\n          /** @type {!HTMLScriptElement} */ (doc.createElement('script'));\n      scriptEl.defer = goog.Dependency.defer_;\n      scriptEl.async = false;\n\n      // If CSP nonces are used, propagate them to dynamically created scripts.\n      // This is necessary to allow nonce-based CSPs without 'strict-dynamic'.\n      if (nonce) {\n        scriptEl.nonce = nonce;\n      }\n\n      scriptEl.onload = function() {\n        scriptEl.onload = null;\n        controller.loaded();\n      };\n\n      scriptEl.src = goog.TRUSTED_TYPES_POLICY_ ?\n          goog.TRUSTED_TYPES_POLICY_.createScriptURL(this.path) :\n          this.path;\n      doc.head.appendChild(scriptEl);\n    }\n  };\n\n\n  /**\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides Should be an empty array.\n   *     TODO(johnplaisted) add support for adding closure namespaces to ES6\n   *     modules for interop purposes.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @struct @constructor\n   * @extends {goog.Dependency}\n   */\n  goog.Es6ModuleDependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    goog.Es6ModuleDependency.base(\n        this, 'constructor', path, relativePath, provides, requires, loadFlags);\n  };\n  goog.inherits(goog.Es6ModuleDependency, goog.Dependency);\n\n\n  /**\n   * @override\n   * @param {!goog.LoadController} controller\n   */\n  goog.Es6ModuleDependency.prototype.load = function(controller) {\n    if (goog.global.CLOSURE_IMPORT_SCRIPT) {\n      if (goog.global.CLOSURE_IMPORT_SCRIPT(this.path)) {\n        controller.loaded();\n      } else {\n        controller.pause();\n      }\n      return;\n    }\n\n    if (!goog.inHtmlDocument_()) {\n      goog.logToConsole_(\n          'Cannot use default debug loader outside of HTML documents.');\n      controller.pause();\n      return;\n    }\n\n    /** @type {!HTMLDocument} */\n    var doc = goog.global.document;\n\n    var dep = this;\n\n    // TODO(johnplaisted): Does document.writing really speed up anything? Any\n    // difference between this and just waiting for interactive mode and then\n    // appending?\n    function write(src, contents) {\n      var nonceAttr = '';\n      var nonce = goog.getScriptNonce_();\n      if (nonce) {\n        nonceAttr = ' nonce=\"' + nonce + '\"';\n      }\n\n      if (contents) {\n        var script = '<script type=\"module\" crossorigin' + nonceAttr + '>' +\n            contents + '</' +\n            'script>';\n        doc.write(\n            goog.TRUSTED_TYPES_POLICY_ ?\n                goog.TRUSTED_TYPES_POLICY_.createHTML(script) :\n                script);\n      } else {\n        var script = '<script type=\"module\" crossorigin src=\"' + src + '\"' +\n            nonceAttr + '></' +\n            'script>';\n        doc.write(\n            goog.TRUSTED_TYPES_POLICY_ ?\n                goog.TRUSTED_TYPES_POLICY_.createHTML(script) :\n                script);\n      }\n    }\n\n    function append(src, contents) {\n      var scriptEl =\n          /** @type {!HTMLScriptElement} */ (doc.createElement('script'));\n      scriptEl.defer = true;\n      scriptEl.async = false;\n      scriptEl.type = 'module';\n      scriptEl.setAttribute('crossorigin', true);\n\n      // If CSP nonces are used, propagate them to dynamically created scripts.\n      // This is necessary to allow nonce-based CSPs without 'strict-dynamic'.\n      var nonce = goog.getScriptNonce_();\n      if (nonce) {\n        scriptEl.nonce = nonce;\n      }\n\n      if (contents) {\n        scriptEl.text = goog.TRUSTED_TYPES_POLICY_ ?\n            goog.TRUSTED_TYPES_POLICY_.createScript(contents) :\n            contents;\n      } else {\n        scriptEl.src = goog.TRUSTED_TYPES_POLICY_ ?\n            goog.TRUSTED_TYPES_POLICY_.createScriptURL(src) :\n            src;\n      }\n\n      doc.head.appendChild(scriptEl);\n    }\n\n    var create;\n\n    if (goog.isDocumentLoading_()) {\n      create = write;\n      // We can ONLY call document.write if we are guaranteed that any\n      // non-module script tags document.written after this are deferred.\n      // Small optimization, in theory document.writing is faster.\n      goog.Dependency.defer_ = true;\n    } else {\n      create = append;\n    }\n\n    // Write 4 separate tags here:\n    // 1) Sets the module state at the correct time (just before execution).\n    // 2) A src node for this, which just hopefully lets the browser load it a\n    //    little early (no need to parse #3).\n    // 3) Import the module and register it.\n    // 4) Clear the module state at the correct time. Guaranteed to run even\n    //    if there is an error in the module (#3 will not run if there is an\n    //    error in the module).\n    var beforeKey = goog.Dependency.registerCallback_(function() {\n      goog.Dependency.unregisterCallback_(beforeKey);\n      controller.setModuleState(goog.ModuleType.ES6);\n    });\n    create(undefined, 'goog.Dependency.callback_(\"' + beforeKey + '\")');\n\n    // TODO(johnplaisted): Does this really speed up anything?\n    create(this.path, undefined);\n\n    var registerKey = goog.Dependency.registerCallback_(function(exports) {\n      goog.Dependency.unregisterCallback_(registerKey);\n      controller.registerEs6ModuleExports(\n          dep.path, exports, goog.moduleLoaderState_.moduleName);\n    });\n    create(\n        undefined,\n        'import * as m from \"' + this.path + '\"; goog.Dependency.callback_(\"' +\n            registerKey + '\", m)');\n\n    var afterKey = goog.Dependency.registerCallback_(function() {\n      goog.Dependency.unregisterCallback_(afterKey);\n      controller.clearModuleState();\n      controller.loaded();\n    });\n    create(undefined, 'goog.Dependency.callback_(\"' + afterKey + '\")');\n  };\n\n\n  /**\n   * Superclass of any dependency that needs to be loaded into memory,\n   * transformed, and then eval'd (goog.modules and transpiled files).\n   *\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides goog.provided or goog.module symbols\n   *     in this file.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @struct @constructor @abstract\n   * @extends {goog.Dependency}\n   */\n  goog.TransformedDependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    goog.TransformedDependency.base(\n        this, 'constructor', path, relativePath, provides, requires, loadFlags);\n    /** @private {?string} */\n    this.contents_ = null;\n\n    /**\n     * Whether to lazily make the synchronous XHR (when goog.require'd) or make\n     * the synchronous XHR when initially loading. On FireFox 61 there is a bug\n     * where an ES6 module cannot make a synchronous XHR (rather, it can, but if\n     * it does then no other ES6 modules will load after).\n     *\n     * tl;dr we lazy load due to bugs on older browsers and eager load due to\n     * bugs on newer ones.\n     *\n     * https://bugzilla.mozilla.org/show_bug.cgi?id=1477090\n     *\n     * @private @const {boolean}\n     */\n    this.lazyFetch_ = !goog.inHtmlDocument_() ||\n        !('noModule' in goog.global.document.createElement('script'));\n  };\n  goog.inherits(goog.TransformedDependency, goog.Dependency);\n\n\n  /**\n   * @override\n   * @param {!goog.LoadController} controller\n   */\n  goog.TransformedDependency.prototype.load = function(controller) {\n    var dep = this;\n\n    function fetch() {\n      dep.contents_ = goog.loadFileSync_(dep.path);\n\n      if (dep.contents_) {\n        dep.contents_ = dep.transform(dep.contents_);\n        if (dep.contents_) {\n          dep.contents_ += '\\n//# sourceURL=' + dep.path;\n        }\n      }\n    }\n\n    if (goog.global.CLOSURE_IMPORT_SCRIPT) {\n      fetch();\n      if (this.contents_ &&\n          goog.global.CLOSURE_IMPORT_SCRIPT('', this.contents_)) {\n        this.contents_ = null;\n        controller.loaded();\n      } else {\n        controller.pause();\n      }\n      return;\n    }\n\n\n    var isEs6 = this.loadFlags['module'] == goog.ModuleType.ES6;\n\n    if (!this.lazyFetch_) {\n      fetch();\n    }\n\n    function load() {\n      if (dep.lazyFetch_) {\n        fetch();\n      }\n\n      if (!dep.contents_) {\n        // loadFileSync_ or transform are responsible. Assume they logged an\n        // error.\n        return;\n      }\n\n      if (isEs6) {\n        controller.setModuleState(goog.ModuleType.ES6);\n      }\n\n      var namespace;\n\n      try {\n        var contents = dep.contents_;\n        dep.contents_ = null;\n        goog.globalEval(goog.CLOSURE_EVAL_PREFILTER_.createScript(contents));\n        if (isEs6) {\n          namespace = goog.moduleLoaderState_.moduleName;\n        }\n      } finally {\n        if (isEs6) {\n          controller.clearModuleState();\n        }\n      }\n\n      if (isEs6) {\n        // Due to circular dependencies this may not be available for require\n        // right now.\n        goog.global['$jscomp']['require']['ensure'](\n            [dep.getPathName()], function() {\n              controller.registerEs6ModuleExports(\n                  dep.path,\n                  goog.global['$jscomp']['require'](dep.getPathName()),\n                  namespace);\n            });\n      }\n\n      controller.loaded();\n    }\n\n    // Do not fetch now; in FireFox 47 the synchronous XHR doesn't block all\n    // events. If we fetched now and then document.write'd the contents the\n    // document.write would be an eval and would execute too soon! Instead write\n    // a script tag to fetch and eval synchronously at the correct time.\n    function fetchInOwnScriptThenLoad() {\n      /** @type {!HTMLDocument} */\n      var doc = goog.global.document;\n\n      var key = goog.Dependency.registerCallback_(function() {\n        goog.Dependency.unregisterCallback_(key);\n        load();\n      });\n\n      var nonce = goog.getScriptNonce_();\n      var nonceAttr = nonce ? ' nonce=\"' + nonce + '\"' : '';\n      var script = '<script' + nonceAttr + '>' +\n          goog.protectScriptTag_('goog.Dependency.callback_(\"' + key + '\");') +\n          '</' +\n          'script>';\n      doc.write(\n          goog.TRUSTED_TYPES_POLICY_ ?\n              goog.TRUSTED_TYPES_POLICY_.createHTML(script) :\n              script);\n    }\n\n    // If one thing is pending it is this.\n    var anythingElsePending = controller.pending().length > 1;\n\n    // Additionally if we are meant to defer scripts but the page is still\n    // loading (e.g. an ES6 module is loading) then also defer. Or if we are\n    // meant to defer and anything else is pending then defer (those may be\n    // scripts that did not need transformation and are just script tags with\n    // defer set to true, and we need to evaluate after that deferred script).\n    var needsAsyncLoading = goog.Dependency.defer_ &&\n        (anythingElsePending || goog.isDocumentLoading_());\n\n    if (needsAsyncLoading) {\n      // Note that we only defer when we have to rather than 100% of the time.\n      // Always defering would work, but then in theory the order of\n      // goog.require calls would then matter. We want to enforce that most of\n      // the time the order of the require calls does not matter.\n      controller.defer(function() {\n        load();\n      });\n      return;\n    }\n    // TODO(johnplaisted): Externs are missing onreadystatechange for\n    // HTMLDocument.\n    /** @type {?} */\n    var doc = goog.global.document;\n\n    var isInternetExplorerOrEdge = goog.inHtmlDocument_() &&\n        ('ActiveXObject' in goog.global || goog.isEdge_());\n\n    // Don't delay in any version of IE or pre-Chromium Edge. There's a bug\n    // around this that will cause out of order script execution. This means\n    // that on older IE ES6 modules will load too early (while the document is\n    // still loading + the dom is not available). The other option is to load\n    // too late (when the document is complete and the onload even will never\n    // fire). This seems to be the lesser of two evils as scripts already act\n    // like the former.\n    if (isEs6 && goog.inHtmlDocument_() && goog.isDocumentLoading_() &&\n        !isInternetExplorerOrEdge) {\n      goog.Dependency.defer_ = true;\n      // Transpiled ES6 modules still need to load like regular ES6 modules,\n      // aka only after the document is interactive.\n      controller.pause();\n      var oldCallback = doc.onreadystatechange;\n      doc.onreadystatechange = function() {\n        if (doc.readyState == 'interactive') {\n          doc.onreadystatechange = oldCallback;\n          load();\n          controller.resume();\n        }\n        if (typeof oldCallback === 'function') {\n          oldCallback.apply(undefined, arguments);\n        }\n      };\n    } else {\n      // Always eval on old IE.\n      if (!goog.inHtmlDocument_() || !goog.isDocumentLoading_()) {\n        load();\n      } else {\n        fetchInOwnScriptThenLoad();\n      }\n    }\n  };\n\n\n  /**\n   * @param {string} contents\n   * @return {string}\n   * @abstract\n   */\n  goog.TransformedDependency.prototype.transform = function(contents) {};\n\n\n  /**\n   * An ES6 module dependency that was transpiled to a jscomp module outside\n   * of the debug loader, e.g. server side.\n   *\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides goog.provided or goog.module symbols\n   *     in this file.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @struct @constructor\n   * @extends {goog.TransformedDependency}\n   */\n  goog.PreTranspiledEs6ModuleDependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    goog.PreTranspiledEs6ModuleDependency.base(\n        this, 'constructor', path, relativePath, provides, requires, loadFlags);\n  };\n  goog.inherits(\n      goog.PreTranspiledEs6ModuleDependency, goog.TransformedDependency);\n\n\n  /**\n   * @override\n   * @param {string} contents\n   * @return {string}\n   */\n  goog.PreTranspiledEs6ModuleDependency.prototype.transform = function(\n      contents) {\n    return contents;\n  };\n\n\n  /**\n   * A goog.module, transpiled or not. Will always perform some minimal\n   * transformation even when not transpiled to wrap in a goog.loadModule\n   * statement.\n   *\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides goog.provided or goog.module symbols\n   *     in this file.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @struct @constructor\n   * @extends {goog.TransformedDependency}\n   */\n  goog.GoogModuleDependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    goog.GoogModuleDependency.base(\n        this, 'constructor', path, relativePath, provides, requires, loadFlags);\n  };\n  goog.inherits(goog.GoogModuleDependency, goog.TransformedDependency);\n\n\n  /**\n   * @override\n   * @param {string} contents\n   * @return {string}\n   */\n  goog.GoogModuleDependency.prototype.transform = function(contents) {\n    if (!goog.LOAD_MODULE_USING_EVAL || goog.global.JSON === undefined) {\n      return '' +\n          'goog.loadModule(function(exports) {' +\n          '\"use strict\";' + contents +\n          '\\n' +  // terminate any trailing single line comment.\n          ';return exports' +\n          '});' +\n          '\\n//# sourceURL=' + this.path + '\\n';\n    } else {\n      return '' +\n          'goog.loadModule(' +\n          goog.global.JSON.stringify(\n              contents + '\\n//# sourceURL=' + this.path + '\\n') +\n          ');';\n    }\n  };\n\n\n  /**\n   * @param {string} relPath\n   * @param {!Array<string>|undefined} provides\n   * @param {!Array<string>} requires\n   * @param {boolean|!Object<string>=} opt_loadFlags\n   * @see goog.addDependency\n   */\n  goog.DebugLoader_.prototype.addDependency = function(\n      relPath, provides, requires, opt_loadFlags) {\n    provides = provides || [];\n    relPath = relPath.replace(/\\\\/g, '/');\n    var path = goog.normalizePath_(goog.basePath + relPath);\n    if (!opt_loadFlags || typeof opt_loadFlags === 'boolean') {\n      opt_loadFlags = opt_loadFlags ? {'module': goog.ModuleType.GOOG} : {};\n    }\n    var dep = this.factory_.createDependency(\n        path, relPath, provides, requires, opt_loadFlags);\n    this.dependencies_[path] = dep;\n    for (var i = 0; i < provides.length; i++) {\n      this.idToPath_[provides[i]] = path;\n    }\n    this.idToPath_[relPath] = path;\n  };\n\n\n  /**\n   * Creates goog.Dependency instances for the debug loader to load.\n   *\n   * Should be overridden to have the debug loader use custom subclasses of\n   * goog.Dependency.\n   *\n   * @struct @constructor\n   */\n  goog.DependencyFactory = function() {};\n\n\n  /**\n   * @param {string} path Absolute path of the file.\n   * @param {string} relativePath Path relative to closure’s base.js.\n   * @param {!Array<string>} provides Array of provided goog.provide/module ids.\n   * @param {!Array<string>} requires Array of required goog.provide/module /\n   *     relative ES6 module paths.\n   * @param {!Object<string, string>} loadFlags\n   * @return {!goog.Dependency}\n   */\n  goog.DependencyFactory.prototype.createDependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n\n    if (loadFlags['module'] == goog.ModuleType.GOOG) {\n      return new goog.GoogModuleDependency(\n          path, relativePath, provides, requires, loadFlags);\n    } else {\n      if (loadFlags['module'] == goog.ModuleType.ES6) {\n        if (goog.ASSUME_ES_MODULES_TRANSPILED) {\n          return new goog.PreTranspiledEs6ModuleDependency(\n              path, relativePath, provides, requires, loadFlags);\n        } else {\n          return new goog.Es6ModuleDependency(\n              path, relativePath, provides, requires, loadFlags);\n        }\n      } else {\n        return new goog.Dependency(\n            path, relativePath, provides, requires, loadFlags);\n      }\n    }\n  };\n\n\n  /** @private @const */\n  goog.debugLoader_ = new goog.DebugLoader_();\n\n\n  /**\n   * Loads the Closure Dependency file.\n   *\n   * Exposed a public function so CLOSURE_NO_DEPS can be set to false, base\n   * loaded, setDependencyFactory called, and then this called. i.e. allows\n   * custom loading of the deps file.\n   */\n  goog.loadClosureDeps = function() {\n    goog.debugLoader_.loadClosureDeps();\n  };\n\n\n  /**\n   * Sets the dependency factory, which can be used to create custom\n   * goog.Dependency implementations to control how dependencies are loaded.\n   *\n   * Note: if you wish to call this function and provide your own implemnetation\n   * it is a wise idea to set CLOSURE_NO_DEPS to true, otherwise the dependency\n   * file and all of its goog.addDependency calls will use the default factory.\n   * You can call goog.loadClosureDeps to load the Closure dependency file\n   * later, after your factory is injected.\n   *\n   * @param {!goog.DependencyFactory} factory\n   */\n  goog.setDependencyFactory = function(factory) {\n    goog.debugLoader_.setDependencyFactory(factory);\n  };\n\n\n  /**\n   * Trusted Types policy for the debug loader.\n   * @private @const {?TrustedTypePolicy}\n   */\n  goog.TRUSTED_TYPES_POLICY_ = goog.TRUSTED_TYPES_POLICY_NAME ?\n      goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME + '#base') :\n      null;\n\n  if (!goog.global.CLOSURE_NO_DEPS) {\n    goog.debugLoader_.loadClosureDeps();\n  }\n\n\n  /**\n   * Bootstraps the given namespaces and calls the callback once they are\n   * available either via goog.require. This is a replacement for using\n   * `goog.require` to bootstrap Closure JavaScript. Previously a `goog.require`\n   * in an HTML file would guarantee that the require'd namespace was available\n   * in the next immediate script tag. With ES6 modules this no longer a\n   * guarantee.\n   *\n   * @param {!Array<string>} namespaces\n   * @param {function(): ?} callback Function to call once all the namespaces\n   *     have loaded. Always called asynchronously.\n   */\n  goog.bootstrap = function(namespaces, callback) {\n    goog.debugLoader_.bootstrap(namespaces, callback);\n  };\n}\n\n\nif (!COMPILED) {\n  var isChrome87 = false;\n  // Cannot run check for Chrome <87 bug in case of strict CSP environments.\n  // TODO(user): Remove once Chrome <87 bug is no longer a problem.\n  try {\n    isChrome87 = eval(goog.global.trustedTypes.emptyScript) !==\n        goog.global.trustedTypes.emptyScript;\n  } catch (err) {\n  }\n\n  /**\n   * Trusted Types for running dev servers.\n   *\n   * @private @const\n   */\n  goog.CLOSURE_EVAL_PREFILTER_ =\n      // Detect Chrome <87 bug with TT and eval.\n      goog.global.trustedTypes && isChrome87 &&\n          goog.createTrustedTypesPolicy('goog#base#devonly#eval') ||\n      {createScript: goog.identity_};\n}\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Implements the disposable interface.\n */\n\ngoog.provide('goog.Disposable');\n\ngoog.require('goog.disposable.IDisposable');\ngoog.require('goog.dispose');\n/**\n * TODO(user): Remove this require.\n * @suppress {extraRequire}\n */\ngoog.require('goog.disposeAll');\n\n/**\n * Class that provides the basic implementation for disposable objects. If your\n * class holds references or resources that can't be collected by standard GC,\n * it should extend this class or implement the disposable interface (defined\n * in goog.disposable.IDisposable). See description of\n * goog.disposable.IDisposable for examples of cleanup.\n * @constructor\n * @implements {goog.disposable.IDisposable}\n */\ngoog.Disposable = function() {\n  'use strict';\n  /**\n   * If monitoring the goog.Disposable instances is enabled, stores the creation\n   * stack trace of the Disposable instance.\n   * @type {string|undefined}\n   */\n  this.creationStack;\n\n  if (goog.Disposable.MONITORING_MODE != goog.Disposable.MonitoringMode.OFF) {\n    if (goog.Disposable.INCLUDE_STACK_ON_CREATION) {\n      this.creationStack = new Error().stack;\n    }\n    goog.Disposable.instances_[goog.getUid(this)] = this;\n  }\n  // Support sealing\n  this.disposed_ = this.disposed_;\n  this.onDisposeCallbacks_ = this.onDisposeCallbacks_;\n};\n\n\n/**\n * @enum {number} Different monitoring modes for Disposable.\n */\ngoog.Disposable.MonitoringMode = {\n  /**\n   * No monitoring.\n   */\n  OFF: 0,\n  /**\n   * Creating and disposing the goog.Disposable instances is monitored. All\n   * disposable objects need to call the `goog.Disposable` base\n   * constructor. The PERMANENT mode must be switched on before creating any\n   * goog.Disposable instances.\n   */\n  PERMANENT: 1,\n  /**\n   * INTERACTIVE mode can be switched on and off on the fly without producing\n   * errors. It also doesn't warn if the disposable objects don't call the\n   * `goog.Disposable` base constructor.\n   */\n  INTERACTIVE: 2\n};\n\n\n/**\n * @define {number} The monitoring mode of the goog.Disposable\n *     instances. Default is OFF. Switching on the monitoring is only\n *     recommended for debugging because it has a significant impact on\n *     performance and memory usage. If switched off, the monitoring code\n *     compiles down to 0 bytes.\n */\ngoog.Disposable.MONITORING_MODE =\n    goog.define('goog.Disposable.MONITORING_MODE', 0);\n\n\n/**\n * @define {boolean} Whether to attach creation stack to each created disposable\n *     instance; This is only relevant for when MonitoringMode != OFF.\n */\ngoog.Disposable.INCLUDE_STACK_ON_CREATION =\n    goog.define('goog.Disposable.INCLUDE_STACK_ON_CREATION', true);\n\n\n/**\n * Maps the unique ID of every undisposed `goog.Disposable` object to\n * the object itself.\n * @type {!Object<number, !goog.Disposable>}\n * @private\n */\ngoog.Disposable.instances_ = {};\n\n\n/**\n * @return {!Array<!goog.Disposable>} All `goog.Disposable` objects that\n *     haven't been disposed of.\n */\ngoog.Disposable.getUndisposedObjects = function() {\n  'use strict';\n  var ret = [];\n  for (var id in goog.Disposable.instances_) {\n    if (goog.Disposable.instances_.hasOwnProperty(id)) {\n      ret.push(goog.Disposable.instances_[Number(id)]);\n    }\n  }\n  return ret;\n};\n\n\n/**\n * Clears the registry of undisposed objects but doesn't dispose of them.\n */\ngoog.Disposable.clearUndisposedObjects = function() {\n  'use strict';\n  goog.Disposable.instances_ = {};\n};\n\n\n/**\n * Whether the object has been disposed of.\n * @type {boolean}\n * @private\n */\ngoog.Disposable.prototype.disposed_ = false;\n\n\n/**\n * Callbacks to invoke when this object is disposed.\n * @type {Array<!Function>}\n * @private\n */\ngoog.Disposable.prototype.onDisposeCallbacks_;\n\n\n/**\n * @return {boolean} Whether the object has been disposed of.\n * @override\n */\ngoog.Disposable.prototype.isDisposed = function() {\n  'use strict';\n  return this.disposed_;\n};\n\n\n/**\n * @return {boolean} Whether the object has been disposed of.\n * @deprecated Use {@link #isDisposed} instead.\n */\ngoog.Disposable.prototype.getDisposed = goog.Disposable.prototype.isDisposed;\n\n\n/**\n * Disposes of the object. If the object hasn't already been disposed of, calls\n * {@link #disposeInternal}. Classes that extend `goog.Disposable` should\n * override {@link #disposeInternal} in order to cleanup references, resources\n * and other disposable objects. Reentrant.\n *\n * @return {void} Nothing.\n * @override\n */\ngoog.Disposable.prototype.dispose = function() {\n  'use strict';\n  if (!this.disposed_) {\n    // Set disposed_ to true first, in case during the chain of disposal this\n    // gets disposed recursively.\n    this.disposed_ = true;\n    this.disposeInternal();\n    if (goog.Disposable.MONITORING_MODE != goog.Disposable.MonitoringMode.OFF) {\n      var uid = goog.getUid(this);\n      if (goog.Disposable.MONITORING_MODE ==\n              goog.Disposable.MonitoringMode.PERMANENT &&\n          !goog.Disposable.instances_.hasOwnProperty(uid)) {\n        throw new Error(\n            this + ' did not call the goog.Disposable base ' +\n            'constructor or was disposed of after a clearUndisposedObjects ' +\n            'call');\n      }\n      if (goog.Disposable.MONITORING_MODE !=\n              goog.Disposable.MonitoringMode.OFF &&\n          this.onDisposeCallbacks_ && this.onDisposeCallbacks_.length > 0) {\n        throw new Error(\n            this + ' did not empty its onDisposeCallbacks queue. This ' +\n            'probably means it overrode dispose() or disposeInternal() ' +\n            'without calling the superclass\\' method.');\n      }\n      delete goog.Disposable.instances_[uid];\n    }\n  }\n};\n\n\n/**\n * Associates a disposable object with this object so that they will be disposed\n * together.\n * @param {goog.disposable.IDisposable} disposable that will be disposed when\n *     this object is disposed.\n */\ngoog.Disposable.prototype.registerDisposable = function(disposable) {\n  'use strict';\n  this.addOnDisposeCallback(goog.partial(goog.dispose, disposable));\n};\n\n\n/**\n * Invokes a callback function when this object is disposed. Callbacks are\n * invoked in the order in which they were added. If a callback is added to\n * an already disposed Disposable, it will be called immediately.\n * @param {function(this:T):?} callback The callback function.\n * @param {T=} opt_scope An optional scope to call the callback in.\n * @template T\n */\ngoog.Disposable.prototype.addOnDisposeCallback = function(callback, opt_scope) {\n  'use strict';\n  if (this.disposed_) {\n    opt_scope !== undefined ? callback.call(opt_scope) : callback();\n    return;\n  }\n  if (!this.onDisposeCallbacks_) {\n    this.onDisposeCallbacks_ = [];\n  }\n\n  this.onDisposeCallbacks_.push(\n      opt_scope !== undefined ? goog.bind(callback, opt_scope) : callback);\n};\n\n\n/**\n * Performs appropriate cleanup. See description of goog.disposable.IDisposable\n * for examples. Classes that extend `goog.Disposable` should override this\n * method. Not reentrant. To avoid calling it twice, it must only be called from\n * the subclass' `disposeInternal` method. Everywhere else the public `dispose`\n * method must be used. For example:\n *\n * <pre>\n * mypackage.MyClass = function() {\n * mypackage.MyClass.base(this, 'constructor');\n *     // Constructor logic specific to MyClass.\n *     ...\n *   };\n *   goog.inherits(mypackage.MyClass, goog.Disposable);\n *\n *   mypackage.MyClass.prototype.disposeInternal = function() {\n *     // Dispose logic specific to MyClass.\n *     ...\n *     // Call superclass's disposeInternal at the end of the subclass's, like\n *     // in C++, to avoid hard-to-catch issues.\n *     mypackage.MyClass.base(this, 'disposeInternal');\n *   };\n * </pre>\n *\n * @protected\n */\ngoog.Disposable.prototype.disposeInternal = function() {\n  'use strict';\n  if (this.onDisposeCallbacks_) {\n    while (this.onDisposeCallbacks_.length) {\n      this.onDisposeCallbacks_.shift()();\n    }\n  }\n};\n\n\n/**\n * Returns True if we can verify the object is disposed.\n * Calls `isDisposed` on the argument if it supports it.  If obj\n * is not an object with an isDisposed() method, return false.\n * @param {*} obj The object to investigate.\n * @return {boolean} True if we can verify the object is disposed.\n */\ngoog.Disposable.isDisposed = function(obj) {\n  'use strict';\n  if (obj && typeof obj.isDisposed == 'function') {\n    return obj.isDisposed();\n  }\n  return false;\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utilities for manipulating arrays.\n */\n\n\ngoog.module('goog.array');\ngoog.module.declareLegacyNamespace();\n\nconst asserts = goog.require('goog.asserts');\n\n\n/**\n * @define {boolean} NATIVE_ARRAY_PROTOTYPES indicates whether the code should\n * rely on Array.prototype functions, if available.\n *\n * The Array.prototype functions can be defined by external libraries like\n * Prototype and setting this flag to false forces closure to use its own\n * goog.array implementation.\n *\n * If your javascript can be loaded by a third party site and you are wary about\n * relying on the prototype functions, specify\n * \"--define goog.NATIVE_ARRAY_PROTOTYPES=false\" to the JSCompiler.\n *\n * Setting goog.TRUSTED_SITE to false will automatically set\n * NATIVE_ARRAY_PROTOTYPES to false.\n */\ngoog.NATIVE_ARRAY_PROTOTYPES =\n    goog.define('goog.NATIVE_ARRAY_PROTOTYPES', goog.TRUSTED_SITE);\n\n\n/**\n * @define {boolean} If true, JSCompiler will use the native implementation of\n * array functions where appropriate (e.g., `Array#filter`) and remove the\n * unused pure JS implementation.\n */\nconst ASSUME_NATIVE_FUNCTIONS = goog.define(\n    'goog.array.ASSUME_NATIVE_FUNCTIONS', goog.FEATURESET_YEAR > 2012);\nexports.ASSUME_NATIVE_FUNCTIONS = ASSUME_NATIVE_FUNCTIONS;\n\n\n/**\n * Returns the last element in an array without removing it.\n * Same as {@link goog.array.last}.\n * @param {IArrayLike<T>|string} array The array.\n * @return {T} Last item in array.\n * @template T\n */\nfunction peek(array) {\n  return array[array.length - 1];\n}\nexports.peek = peek;\n\n\n/**\n * Returns the last element in an array without removing it.\n * Same as {@link goog.array.peek}.\n * @param {IArrayLike<T>|string} array The array.\n * @return {T} Last item in array.\n * @template T\n */\nexports.last = peek;\n\n// NOTE(arv): Since most of the array functions are generic it allows you to\n// pass an array-like object. Strings have a length and are considered array-\n// like. However, the 'in' operator does not work on strings so we cannot just\n// use the array path even if the browser supports indexing into strings. We\n// therefore end up splitting the string.\n\n\n/**\n * Returns the index of the first element of an array with a specified value, or\n * -1 if the element is not present in the array.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-indexof}\n *\n * @param {IArrayLike<T>|string} arr The array to be searched.\n * @param {T} obj The object for which we are searching.\n * @param {number=} opt_fromIndex The index at which to start the search. If\n *     omitted the search starts at index 0.\n * @return {number} The index of the first matching array element.\n * @template T\n */\nconst indexOf = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.indexOf) ?\n    function(arr, obj, opt_fromIndex) {\n      asserts.assert(arr.length != null);\n\n      return Array.prototype.indexOf.call(arr, obj, opt_fromIndex);\n    } :\n    function(arr, obj, opt_fromIndex) {\n      const fromIndex = opt_fromIndex == null ?\n          0 :\n          (opt_fromIndex < 0 ? Math.max(0, arr.length + opt_fromIndex) :\n                               opt_fromIndex);\n\n      if (typeof arr === 'string') {\n        // Array.prototype.indexOf uses === so only strings should be found.\n        if (typeof obj !== 'string' || obj.length != 1) {\n          return -1;\n        }\n        return arr.indexOf(obj, fromIndex);\n      }\n\n      for (let i = fromIndex; i < arr.length; i++) {\n        if (i in arr && arr[i] === obj) return i;\n      }\n      return -1;\n    };\nexports.indexOf = indexOf;\n\n\n/**\n * Returns the index of the last element of an array with a specified value, or\n * -1 if the element is not present in the array.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-lastindexof}\n *\n * @param {!IArrayLike<T>|string} arr The array to be searched.\n * @param {T} obj The object for which we are searching.\n * @param {?number=} opt_fromIndex The index at which to start the search. If\n *     omitted the search starts at the end of the array.\n * @return {number} The index of the last matching array element.\n * @template T\n */\nconst lastIndexOf = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.lastIndexOf) ?\n    function(arr, obj, opt_fromIndex) {\n      asserts.assert(arr.length != null);\n\n      // Firefox treats undefined and null as 0 in the fromIndex argument which\n      // leads it to always return -1\n      const fromIndex = opt_fromIndex == null ? arr.length - 1 : opt_fromIndex;\n      return Array.prototype.lastIndexOf.call(arr, obj, fromIndex);\n    } :\n    function(arr, obj, opt_fromIndex) {\n      let fromIndex = opt_fromIndex == null ? arr.length - 1 : opt_fromIndex;\n\n      if (fromIndex < 0) {\n        fromIndex = Math.max(0, arr.length + fromIndex);\n      }\n\n      if (typeof arr === 'string') {\n        // Array.prototype.lastIndexOf uses === so only strings should be found.\n        if (typeof obj !== 'string' || obj.length != 1) {\n          return -1;\n        }\n        return arr.lastIndexOf(obj, fromIndex);\n      }\n\n      for (let i = fromIndex; i >= 0; i--) {\n        if (i in arr && arr[i] === obj) return i;\n      }\n      return -1;\n    };\nexports.lastIndexOf = lastIndexOf;\n\n\n/**\n * Calls a function for each element in an array. Skips holes in the array.\n * See {@link http://tinyurl.com/developer-mozilla-org-array-foreach}\n *\n * @param {IArrayLike<T>|string} arr Array or array like object over\n *     which to iterate.\n * @param {?function(this: S, T, number, ?): ?} f The function to call for every\n *     element. This function takes 3 arguments (the element, the index and the\n *     array). The return value is ignored.\n * @param {S=} opt_obj The object to be used as the value of 'this' within f.\n * @template T,S\n */\nconst forEach = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.forEach) ?\n    function(arr, f, opt_obj) {\n      asserts.assert(arr.length != null);\n\n      Array.prototype.forEach.call(arr, f, opt_obj);\n    } :\n    function(arr, f, opt_obj) {\n      const l = arr.length;  // must be fixed during loop... see docs\n      const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n      for (let i = 0; i < l; i++) {\n        if (i in arr2) {\n          f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr);\n        }\n      }\n    };\nexports.forEach = forEach;\n\n\n/**\n * Calls a function for each element in an array, starting from the last\n * element rather than the first.\n *\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this: S, T, number, ?): ?} f The function to call for every\n *     element. This function\n *     takes 3 arguments (the element, the index and the array). The return\n *     value is ignored.\n * @param {S=} opt_obj The object to be used as the value of 'this'\n *     within f.\n * @template T,S\n */\nfunction forEachRight(arr, f, opt_obj) {\n  const l = arr.length;  // must be fixed during loop... see docs\n  const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n  for (let i = l - 1; i >= 0; --i) {\n    if (i in arr2) {\n      f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr);\n    }\n  }\n}\nexports.forEachRight = forEachRight;\n\n\n/**\n * Calls a function for each element in an array, and if the function returns\n * true adds the element to a new array.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-filter}\n *\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?):boolean} f The function to call for\n *     every element. This function\n *     takes 3 arguments (the element, the index and the array) and must\n *     return a Boolean. If the return value is true the element is added to the\n *     result array. If it is false the element is not included.\n * @param {S=} opt_obj The object to be used as the value of 'this'\n *     within f.\n * @return {!Array<T>} a new array in which only elements that passed the test\n *     are present.\n * @template T,S\n */\nconst filter = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.filter) ?\n    function(arr, f, opt_obj) {\n      asserts.assert(arr.length != null);\n\n      return Array.prototype.filter.call(arr, f, opt_obj);\n    } :\n    function(arr, f, opt_obj) {\n      const l = arr.length;  // must be fixed during loop... see docs\n      const res = [];\n      let resLength = 0;\n      const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n      for (let i = 0; i < l; i++) {\n        if (i in arr2) {\n          const val = arr2[i];  // in case f mutates arr2\n          if (f.call(/** @type {?} */ (opt_obj), val, i, arr)) {\n            res[resLength++] = val;\n          }\n        }\n      }\n      return res;\n    };\nexports.filter = filter;\n\n\n/**\n * Calls a function for each element in an array and inserts the result into a\n * new array.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-map}\n *\n * @param {IArrayLike<VALUE>|string} arr Array or array like object\n *     over which to iterate.\n * @param {function(this:THIS, VALUE, number, ?): RESULT} f The function to call\n *     for every element. This function takes 3 arguments (the element,\n *     the index and the array) and should return something. The result will be\n *     inserted into a new array.\n * @param {THIS=} opt_obj The object to be used as the value of 'this' within f.\n * @return {!Array<RESULT>} a new array with the results from f.\n * @template THIS, VALUE, RESULT\n */\nconst map = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.map) ?\n    function(arr, f, opt_obj) {\n      asserts.assert(arr.length != null);\n\n      return Array.prototype.map.call(arr, f, opt_obj);\n    } :\n    function(arr, f, opt_obj) {\n      const l = arr.length;  // must be fixed during loop... see docs\n      const res = new Array(l);\n      const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n      for (let i = 0; i < l; i++) {\n        if (i in arr2) {\n          res[i] = f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr);\n        }\n      }\n      return res;\n    };\nexports.map = map;\n\n\n/**\n * Passes every element of an array into a function and accumulates the result.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-reduce}\n * Note that this implementation differs from the native Array.prototype.reduce\n * in that the initial value is assumed to be defined (the MDN docs linked above\n * recommend not omitting this parameter, although it is technically optional).\n *\n * For example:\n * var a = [1, 2, 3, 4];\n * reduce(a, function(r, v, i, arr) {return r + v;}, 0);\n * returns 10\n *\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {function(this:S, R, T, number, ?) : R} f The function to call for\n *     every element. This function\n *     takes 4 arguments (the function's previous result or the initial value,\n *     the value of the current array element, the current array index, and the\n *     array itself)\n *     function(previousValue, currentValue, index, array).\n * @param {?} val The initial value to pass into the function on the first call.\n * @param {S=} opt_obj  The object to be used as the value of 'this'\n *     within f.\n * @return {R} Result of evaluating f repeatedly across the values of the array.\n * @template T,S,R\n */\nconst reduce = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.reduce) ?\n    function(arr, f, val, opt_obj) {\n      asserts.assert(arr.length != null);\n      if (opt_obj) {\n        f = goog.bind(f, opt_obj);\n      }\n      return Array.prototype.reduce.call(arr, f, val);\n    } :\n    function(arr, f, val, opt_obj) {\n      let rval = val;\n      forEach(arr, function(val, index) {\n        rval = f.call(/** @type {?} */ (opt_obj), rval, val, index, arr);\n      });\n      return rval;\n    };\nexports.reduce = reduce;\n\n\n/**\n * Passes every element of an array into a function and accumulates the result,\n * starting from the last element and working towards the first.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-reduceright}\n *\n * For example:\n * var a = ['a', 'b', 'c'];\n * reduceRight(a, function(r, v, i, arr) {return r + v;}, '');\n * returns 'cba'\n *\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, R, T, number, ?) : R} f The function to call for\n *     every element. This function\n *     takes 4 arguments (the function's previous result or the initial value,\n *     the value of the current array element, the current array index, and the\n *     array itself)\n *     function(previousValue, currentValue, index, array).\n * @param {?} val The initial value to pass into the function on the first call.\n * @param {S=} opt_obj The object to be used as the value of 'this'\n *     within f.\n * @return {R} Object returned as a result of evaluating f repeatedly across the\n *     values of the array.\n * @template T,S,R\n */\nconst reduceRight = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.reduceRight) ?\n    function(arr, f, val, opt_obj) {\n      asserts.assert(arr.length != null);\n      asserts.assert(f != null);\n      if (opt_obj) {\n        f = goog.bind(f, opt_obj);\n      }\n      return Array.prototype.reduceRight.call(arr, f, val);\n    } :\n    function(arr, f, val, opt_obj) {\n      let rval = val;\n      forEachRight(arr, function(val, index) {\n        rval = f.call(/** @type {?} */ (opt_obj), rval, val, index, arr);\n      });\n      return rval;\n    };\nexports.reduceRight = reduceRight;\n\n\n/**\n * Calls f for each element of an array. If any call returns true, some()\n * returns true (without checking the remaining elements). If all calls\n * return false, some() returns false.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-some}\n *\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call for\n *     for every element. This function takes 3 arguments (the element, the\n *     index and the array) and should return a boolean.\n * @param {S=} opt_obj  The object to be used as the value of 'this'\n *     within f.\n * @return {boolean} true if any element passes the test.\n * @template T,S\n */\nconst some = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.some) ?\n    function(arr, f, opt_obj) {\n      asserts.assert(arr.length != null);\n\n      return Array.prototype.some.call(arr, f, opt_obj);\n    } :\n    function(arr, f, opt_obj) {\n      const l = arr.length;  // must be fixed during loop... see docs\n      const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n      for (let i = 0; i < l; i++) {\n        if (i in arr2 && f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr)) {\n          return true;\n        }\n      }\n      return false;\n    };\nexports.some = some;\n\n\n/**\n * Call f for each element of an array. If all calls return true, every()\n * returns true. If any call returns false, every() returns false and\n * does not continue to check the remaining elements.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-every}\n *\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call for\n *     for every element. This function takes 3 arguments (the element, the\n *     index and the array) and should return a boolean.\n * @param {S=} opt_obj The object to be used as the value of 'this'\n *     within f.\n * @return {boolean} false if any element fails the test.\n * @template T,S\n */\nconst every = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.every) ?\n    function(arr, f, opt_obj) {\n      asserts.assert(arr.length != null);\n\n      return Array.prototype.every.call(arr, f, opt_obj);\n    } :\n    function(arr, f, opt_obj) {\n      const l = arr.length;  // must be fixed during loop... see docs\n      const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n      for (let i = 0; i < l; i++) {\n        if (i in arr2 && !f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr)) {\n          return false;\n        }\n      }\n      return true;\n    };\nexports.every = every;\n\n\n/**\n * Counts the array elements that fulfill the predicate, i.e. for which the\n * callback function returns true. Skips holes in the array.\n *\n * @param {!IArrayLike<T>|string} arr Array or array like object\n *     over which to iterate.\n * @param {function(this: S, T, number, ?): boolean} f The function to call for\n *     every element. Takes 3 arguments (the element, the index and the array).\n * @param {S=} opt_obj The object to be used as the value of 'this' within f.\n * @return {number} The number of the matching elements.\n * @template T,S\n */\nfunction count(arr, f, opt_obj) {\n  let count = 0;\n  forEach(arr, function(element, index, arr) {\n    if (f.call(/** @type {?} */ (opt_obj), element, index, arr)) {\n      ++count;\n    }\n  }, opt_obj);\n  return count;\n}\nexports.count = count;\n\n\n/**\n * Search an array for the first element that satisfies a given condition and\n * return that element.\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call\n *     for every element. This function takes 3 arguments (the element, the\n *     index and the array) and should return a boolean.\n * @param {S=} opt_obj An optional \"this\" context for the function.\n * @return {T|null} The first array element that passes the test, or null if no\n *     element is found.\n * @template T,S\n */\nfunction find(arr, f, opt_obj) {\n  const i = findIndex(arr, f, opt_obj);\n  return i < 0 ? null : typeof arr === 'string' ? arr.charAt(i) : arr[i];\n}\nexports.find = find;\n\n\n/**\n * Search an array for the first element that satisfies a given condition and\n * return its index.\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call for\n *     every element. This function\n *     takes 3 arguments (the element, the index and the array) and should\n *     return a boolean.\n * @param {S=} opt_obj An optional \"this\" context for the function.\n * @return {number} The index of the first array element that passes the test,\n *     or -1 if no element is found.\n * @template T,S\n */\nfunction findIndex(arr, f, opt_obj) {\n  const l = arr.length;  // must be fixed during loop... see docs\n  const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n  for (let i = 0; i < l; i++) {\n    if (i in arr2 && f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr)) {\n      return i;\n    }\n  }\n  return -1;\n}\nexports.findIndex = findIndex;\n\n\n/**\n * Search an array (in reverse order) for the last element that satisfies a\n * given condition and return that element.\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call\n *     for every element. This function\n *     takes 3 arguments (the element, the index and the array) and should\n *     return a boolean.\n * @param {S=} opt_obj An optional \"this\" context for the function.\n * @return {T|null} The last array element that passes the test, or null if no\n *     element is found.\n * @template T,S\n */\nfunction findRight(arr, f, opt_obj) {\n  const i = findIndexRight(arr, f, opt_obj);\n  return i < 0 ? null : typeof arr === 'string' ? arr.charAt(i) : arr[i];\n}\nexports.findRight = findRight;\n\n\n/**\n * Search an array (in reverse order) for the last element that satisfies a\n * given condition and return its index.\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call\n *     for every element. This function\n *     takes 3 arguments (the element, the index and the array) and should\n *     return a boolean.\n * @param {S=} opt_obj An optional \"this\" context for the function.\n * @return {number} The index of the last array element that passes the test,\n *     or -1 if no element is found.\n * @template T,S\n */\nfunction findIndexRight(arr, f, opt_obj) {\n  const l = arr.length;  // must be fixed during loop... see docs\n  const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n  for (let i = l - 1; i >= 0; i--) {\n    if (i in arr2 && f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr)) {\n      return i;\n    }\n  }\n  return -1;\n}\nexports.findIndexRight = findIndexRight;\n\n\n/**\n * Whether the array contains the given object.\n * @param {IArrayLike<?>|string} arr The array to test for the presence of the\n *     element.\n * @param {*} obj The object for which to test.\n * @return {boolean} true if obj is present.\n */\nfunction contains(arr, obj) {\n  return indexOf(arr, obj) >= 0;\n}\nexports.contains = contains;\n\n\n/**\n * Whether the array is empty.\n * @param {IArrayLike<?>|string} arr The array to test.\n * @return {boolean} true if empty.\n */\nfunction isEmpty(arr) {\n  return arr.length == 0;\n}\nexports.isEmpty = isEmpty;\n\n\n/**\n * Clears the array.\n * @param {IArrayLike<?>} arr Array or array like object to clear.\n */\nfunction clear(arr) {\n  // For non real arrays we don't have the magic length so we delete the\n  // indices.\n  if (!Array.isArray(arr)) {\n    for (let i = arr.length - 1; i >= 0; i--) {\n      delete arr[i];\n    }\n  }\n  arr.length = 0;\n}\nexports.clear = clear;\n\n\n/**\n * Pushes an item into an array, if it's not already in the array.\n * @param {Array<T>} arr Array into which to insert the item.\n * @param {T} obj Value to add.\n * @template T\n */\nfunction insert(arr, obj) {\n  if (!contains(arr, obj)) {\n    arr.push(obj);\n  }\n}\nexports.insert = insert;\n\n\n/**\n * Inserts an object at the given index of the array.\n * @param {IArrayLike<?>} arr The array to modify.\n * @param {*} obj The object to insert.\n * @param {number=} opt_i The index at which to insert the object. If omitted,\n *      treated as 0. A negative index is counted from the end of the array.\n */\nfunction insertAt(arr, obj, opt_i) {\n  splice(arr, opt_i, 0, obj);\n}\nexports.insertAt = insertAt;\n\n\n/**\n * Inserts at the given index of the array, all elements of another array.\n * @param {IArrayLike<?>} arr The array to modify.\n * @param {IArrayLike<?>} elementsToAdd The array of elements to add.\n * @param {number=} opt_i The index at which to insert the object. If omitted,\n *      treated as 0. A negative index is counted from the end of the array.\n */\nfunction insertArrayAt(arr, elementsToAdd, opt_i) {\n  goog.partial(splice, arr, opt_i, 0).apply(null, elementsToAdd);\n}\nexports.insertArrayAt = insertArrayAt;\n\n\n/**\n * Inserts an object into an array before a specified object.\n * @param {Array<T>} arr The array to modify.\n * @param {T} obj The object to insert.\n * @param {T=} opt_obj2 The object before which obj should be inserted. If obj2\n *     is omitted or not found, obj is inserted at the end of the array.\n * @template T\n */\nfunction insertBefore(arr, obj, opt_obj2) {\n  let i;\n  if (arguments.length == 2 || (i = indexOf(arr, opt_obj2)) < 0) {\n    arr.push(obj);\n  } else {\n    insertAt(arr, obj, i);\n  }\n}\nexports.insertBefore = insertBefore;\n\n\n/**\n * Removes the first occurrence of a particular value from an array.\n * @param {IArrayLike<T>} arr Array from which to remove\n *     value.\n * @param {T} obj Object to remove.\n * @return {boolean} True if an element was removed.\n * @template T\n */\nfunction remove(arr, obj) {\n  const i = indexOf(arr, obj);\n  let rv;\n  if ((rv = i >= 0)) {\n    removeAt(arr, i);\n  }\n  return rv;\n}\nexports.remove = remove;\n\n\n/**\n * Removes the last occurrence of a particular value from an array.\n * @param {!IArrayLike<T>} arr Array from which to remove value.\n * @param {T} obj Object to remove.\n * @return {boolean} True if an element was removed.\n * @template T\n */\nfunction removeLast(arr, obj) {\n  const i = lastIndexOf(arr, obj);\n  if (i >= 0) {\n    removeAt(arr, i);\n    return true;\n  }\n  return false;\n}\nexports.removeLast = removeLast;\n\n\n/**\n * Removes from an array the element at index i\n * @param {IArrayLike<?>} arr Array or array like object from which to\n *     remove value.\n * @param {number} i The index to remove.\n * @return {boolean} True if an element was removed.\n */\nfunction removeAt(arr, i) {\n  asserts.assert(arr.length != null);\n\n  // use generic form of splice\n  // splice returns the removed items and if successful the length of that\n  // will be 1\n  return Array.prototype.splice.call(arr, i, 1).length == 1;\n}\nexports.removeAt = removeAt;\n\n\n/**\n * Removes the first value that satisfies the given condition.\n * @param {IArrayLike<T>} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call\n *     for every element. This function\n *     takes 3 arguments (the element, the index and the array) and should\n *     return a boolean.\n * @param {S=} opt_obj An optional \"this\" context for the function.\n * @return {boolean} True if an element was removed.\n * @template T,S\n */\nfunction removeIf(arr, f, opt_obj) {\n  const i = findIndex(arr, f, opt_obj);\n  if (i >= 0) {\n    removeAt(arr, i);\n    return true;\n  }\n  return false;\n}\nexports.removeIf = removeIf;\n\n\n/**\n * Removes all values that satisfy the given condition.\n * @param {IArrayLike<T>} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call\n *     for every element. This function\n *     takes 3 arguments (the element, the index and the array) and should\n *     return a boolean.\n * @param {S=} opt_obj An optional \"this\" context for the function.\n * @return {number} The number of items removed\n * @template T,S\n */\nfunction removeAllIf(arr, f, opt_obj) {\n  let removedCount = 0;\n  forEachRight(arr, function(val, index) {\n    if (f.call(/** @type {?} */ (opt_obj), val, index, arr)) {\n      if (removeAt(arr, index)) {\n        removedCount++;\n      }\n    }\n  });\n  return removedCount;\n}\nexports.removeAllIf = removeAllIf;\n\n\n/**\n * Returns a new array that is the result of joining the arguments.  If arrays\n * are passed then their items are added, however, if non-arrays are passed they\n * will be added to the return array as is.\n *\n * Note that ArrayLike objects will be added as is, rather than having their\n * items added.\n *\n * concat([1, 2], [3, 4]) -> [1, 2, 3, 4]\n * concat(0, [1, 2]) -> [0, 1, 2]\n * concat([1, 2], null) -> [1, 2, null]\n *\n * @param {...*} var_args Items to concatenate.  Arrays will have each item\n *     added, while primitives and objects will be added as is.\n * @return {!Array<?>} The new resultant array.\n */\nfunction concat(var_args) {\n  return Array.prototype.concat.apply([], arguments);\n}\nexports.concat = concat;\n\n\n/**\n * Returns a new array that contains the contents of all the arrays passed.\n * @param {...!Array<T>} var_args\n * @return {!Array<T>}\n * @template T\n */\nfunction join(var_args) {\n  return Array.prototype.concat.apply([], arguments);\n}\nexports.join = join;\n\n\n/**\n * Converts an object to an array.\n * @param {IArrayLike<T>|string} object  The object to convert to an\n *     array.\n * @return {!Array<T>} The object converted into an array. If object has a\n *     length property, every property indexed with a non-negative number\n *     less than length will be included in the result. If object does not\n *     have a length property, an empty array will be returned.\n * @template T\n */\nfunction toArray(object) {\n  const length = object.length;\n\n  // If length is not a number the following is false. This case is kept for\n  // backwards compatibility since there are callers that pass objects that are\n  // not array like.\n  if (length > 0) {\n    const rv = new Array(length);\n    for (let i = 0; i < length; i++) {\n      rv[i] = object[i];\n    }\n    return rv;\n  }\n  return [];\n}\nexports.toArray = toArray;\n\n\n/**\n * Does a shallow copy of an array.\n * @param {IArrayLike<T>|string} arr  Array or array-like object to\n *     clone.\n * @return {!Array<T>} Clone of the input array.\n * @template T\n */\nconst clone = toArray;\nexports.clone = clone;\n\n\n/**\n * Extends an array with another array, element, or \"array like\" object.\n * This function operates 'in-place', it does not create a new Array.\n *\n * Example:\n * var a = [];\n * extend(a, [0, 1]);\n * a; // [0, 1]\n * extend(a, 2);\n * a; // [0, 1, 2]\n *\n * @param {Array<VALUE>} arr1  The array to modify.\n * @param {...(IArrayLike<VALUE>|VALUE)} var_args The elements or arrays of\n *     elements to add to arr1.\n * @template VALUE\n */\nfunction extend(arr1, var_args) {\n  for (let i = 1; i < arguments.length; i++) {\n    const arr2 = arguments[i];\n    if (goog.isArrayLike(arr2)) {\n      const len1 = arr1.length || 0;\n      const len2 = arr2.length || 0;\n      arr1.length = len1 + len2;\n      for (let j = 0; j < len2; j++) {\n        arr1[len1 + j] = arr2[j];\n      }\n    } else {\n      arr1.push(arr2);\n    }\n  }\n}\nexports.extend = extend;\n\n\n/**\n * Adds or removes elements from an array. This is a generic version of Array\n * splice. This means that it might work on other objects similar to arrays,\n * such as the arguments object.\n *\n * @param {IArrayLike<T>} arr The array to modify.\n * @param {number|undefined} index The index at which to start changing the\n *     array. If not defined, treated as 0.\n * @param {number} howMany How many elements to remove (0 means no removal. A\n *     value below 0 is treated as zero and so is any other non number. Numbers\n *     are floored).\n * @param {...T} var_args Optional, additional elements to insert into the\n *     array.\n * @return {!Array<T>} the removed elements.\n * @template T\n */\nfunction splice(arr, index, howMany, var_args) {\n  asserts.assert(arr.length != null);\n\n  return Array.prototype.splice.apply(arr, slice(arguments, 1));\n}\nexports.splice = splice;\n\n\n/**\n * Returns a new array from a segment of an array. This is a generic version of\n * Array slice. This means that it might work on other objects similar to\n * arrays, such as the arguments object.\n *\n * @param {IArrayLike<T>|string} arr The array from\n * which to copy a segment.\n * @param {number} start The index of the first element to copy.\n * @param {number=} opt_end The index after the last element to copy.\n * @return {!Array<T>} A new array containing the specified segment of the\n *     original array.\n * @template T\n */\nfunction slice(arr, start, opt_end) {\n  asserts.assert(arr.length != null);\n\n  // passing 1 arg to slice is not the same as passing 2 where the second is\n  // null or undefined (in that case the second argument is treated as 0).\n  // we could use slice on the arguments object and then use apply instead of\n  // testing the length\n  if (arguments.length <= 2) {\n    return Array.prototype.slice.call(arr, start);\n  } else {\n    return Array.prototype.slice.call(arr, start, opt_end);\n  }\n}\nexports.slice = slice;\n\n\n/**\n * Removes all duplicates from an array (retaining only the first\n * occurrence of each array element).  This function modifies the\n * array in place and doesn't change the order of the non-duplicate items.\n *\n * For objects, duplicates are identified as having the same unique ID as\n * defined by {@link goog.getUid}.\n *\n * Alternatively you can specify a custom hash function that returns a unique\n * value for each item in the array it should consider unique.\n *\n * Runtime: N,\n * Worstcase space: 2N (no dupes)\n *\n * @param {IArrayLike<T>} arr The array from which to remove\n *     duplicates.\n * @param {Array=} opt_rv An optional array in which to return the results,\n *     instead of performing the removal inplace.  If specified, the original\n *     array will remain unchanged.\n * @param {function(T):string=} opt_hashFn An optional function to use to\n *     apply to every item in the array. This function should return a unique\n *     value for each item in the array it should consider unique.\n * @template T\n */\nfunction removeDuplicates(arr, opt_rv, opt_hashFn) {\n  const returnArray = opt_rv || arr;\n  const defaultHashFn = function(item) {\n    // Prefix each type with a single character representing the type to\n    // prevent conflicting keys (e.g. true and 'true').\n    return goog.isObject(item) ? 'o' + goog.getUid(item) :\n                                 (typeof item).charAt(0) + item;\n  };\n  const hashFn = opt_hashFn || defaultHashFn;\n\n  let cursorInsert = 0;\n  let cursorRead = 0;\n  const seen = {};\n\n  while (cursorRead < arr.length) {\n    const current = arr[cursorRead++];\n    const key = hashFn(current);\n    if (!Object.prototype.hasOwnProperty.call(seen, key)) {\n      seen[key] = true;\n      returnArray[cursorInsert++] = current;\n    }\n  }\n  returnArray.length = cursorInsert;\n}\nexports.removeDuplicates = removeDuplicates;\n\n\n/**\n * Searches the specified array for the specified target using the binary\n * search algorithm.  If no opt_compareFn is specified, elements are compared\n * using <code>defaultCompare</code>, which compares the elements\n * using the built in < and > operators.  This will produce the expected\n * behavior for homogeneous arrays of String(s) and Number(s). The array\n * specified <b>must</b> be sorted in ascending order (as defined by the\n * comparison function).  If the array is not sorted, results are undefined.\n * If the array contains multiple instances of the specified target value, the\n * left-most instance will be found.\n *\n * Runtime: O(log n)\n *\n * @param {IArrayLike<VALUE>} arr The array to be searched.\n * @param {TARGET} target The sought value.\n * @param {function(TARGET, VALUE): number=} opt_compareFn Optional comparison\n *     function by which the array is ordered. Should take 2 arguments to\n *     compare, the target value and an element from your array, and return a\n *     negative number, zero, or a positive number depending on whether the\n *     first argument is less than, equal to, or greater than the second.\n * @return {number} Lowest index of the target value if found, otherwise\n *     (-(insertion point) - 1). The insertion point is where the value should\n *     be inserted into arr to preserve the sorted property.  Return value >= 0\n *     iff target is found.\n * @template TARGET, VALUE\n */\nfunction binarySearch(arr, target, opt_compareFn) {\n  return binarySearch_(\n      arr, opt_compareFn || defaultCompare, false /* isEvaluator */, target);\n}\nexports.binarySearch = binarySearch;\n\n\n/**\n * Selects an index in the specified array using the binary search algorithm.\n * The evaluator receives an element and determines whether the desired index\n * is before, at, or after it.  The evaluator must be consistent (formally,\n * map(map(arr, evaluator, opt_obj), goog.math.sign)\n * must be monotonically non-increasing).\n *\n * Runtime: O(log n)\n *\n * @param {IArrayLike<VALUE>} arr The array to be searched.\n * @param {function(this:THIS, VALUE, number, ?): number} evaluator\n *     Evaluator function that receives 3 arguments (the element, the index and\n *     the array). Should return a negative number, zero, or a positive number\n *     depending on whether the desired index is before, at, or after the\n *     element passed to it.\n * @param {THIS=} opt_obj The object to be used as the value of 'this'\n *     within evaluator.\n * @return {number} Index of the leftmost element matched by the evaluator, if\n *     such exists; otherwise (-(insertion point) - 1). The insertion point is\n *     the index of the first element for which the evaluator returns negative,\n *     or arr.length if no such element exists. The return value is non-negative\n *     iff a match is found.\n * @template THIS, VALUE\n */\nfunction binarySelect(arr, evaluator, opt_obj) {\n  return binarySearch_(\n      arr, evaluator, true /* isEvaluator */, undefined /* opt_target */,\n      opt_obj);\n}\nexports.binarySelect = binarySelect;\n\n\n/**\n * Implementation of a binary search algorithm which knows how to use both\n * comparison functions and evaluators. If an evaluator is provided, will call\n * the evaluator with the given optional data object, conforming to the\n * interface defined in binarySelect. Otherwise, if a comparison function is\n * provided, will call the comparison function against the given data object.\n *\n * This implementation purposefully does not use goog.bind or goog.partial for\n * performance reasons.\n *\n * Runtime: O(log n)\n *\n * @param {IArrayLike<?>} arr The array to be searched.\n * @param {function(?, ?, ?): number | function(?, ?): number} compareFn\n *     Either an evaluator or a comparison function, as defined by binarySearch\n *     and binarySelect above.\n * @param {boolean} isEvaluator Whether the function is an evaluator or a\n *     comparison function.\n * @param {?=} opt_target If the function is a comparison function, then\n *     this is the target to binary search for.\n * @param {Object=} opt_selfObj If the function is an evaluator, this is an\n *     optional this object for the evaluator.\n * @return {number} Lowest index of the target value if found, otherwise\n *     (-(insertion point) - 1). The insertion point is where the value should\n *     be inserted into arr to preserve the sorted property.  Return value >= 0\n *     iff target is found.\n * @private\n */\nfunction binarySearch_(arr, compareFn, isEvaluator, opt_target, opt_selfObj) {\n  let left = 0;            // inclusive\n  let right = arr.length;  // exclusive\n  let found;\n  while (left < right) {\n    const middle = left + ((right - left) >>> 1);\n    let compareResult;\n    if (isEvaluator) {\n      compareResult = compareFn.call(opt_selfObj, arr[middle], middle, arr);\n    } else {\n      // NOTE(dimvar): To avoid this cast, we'd have to use function overloading\n      // for the type of binarySearch_, which the type system can't express yet.\n      compareResult = /** @type {function(?, ?): number} */ (compareFn)(\n          opt_target, arr[middle]);\n    }\n    if (compareResult > 0) {\n      left = middle + 1;\n    } else {\n      right = middle;\n      // We are looking for the lowest index so we can't return immediately.\n      found = !compareResult;\n    }\n  }\n  // left is the index if found, or the insertion point otherwise.\n  // Avoiding bitwise not operator, as that causes a loss in precision for array\n  // indexes outside the bounds of a 32-bit signed integer.  Array indexes have\n  // a maximum value of 2^32-2 https://tc39.es/ecma262/#array-index\n  return found ? left : -left - 1;\n}\n\n\n/**\n * Sorts the specified array into ascending order.  If no opt_compareFn is\n * specified, elements are compared using\n * <code>defaultCompare</code>, which compares the elements using\n * the built in < and > operators.  This will produce the expected behavior\n * for homogeneous arrays of String(s) and Number(s), unlike the native sort,\n * but will give unpredictable results for heterogeneous lists of strings and\n * numbers with different numbers of digits.\n *\n * This sort is not guaranteed to be stable.\n *\n * Runtime: Same as `Array.prototype.sort`\n *\n * @param {Array<T>} arr The array to be sorted.\n * @param {?function(T,T):number=} opt_compareFn Optional comparison\n *     function by which the\n *     array is to be ordered. Should take 2 arguments to compare, and return a\n *     negative number, zero, or a positive number depending on whether the\n *     first argument is less than, equal to, or greater than the second.\n * @template T\n */\nfunction sort(arr, opt_compareFn) {\n  // TODO(arv): Update type annotation since null is not accepted.\n  arr.sort(opt_compareFn || defaultCompare);\n}\nexports.sort = sort;\n\n\n/**\n * Sorts the specified array into ascending order in a stable way.  If no\n * opt_compareFn is specified, elements are compared using\n * <code>defaultCompare</code>, which compares the elements using\n * the built in < and > operators.  This will produce the expected behavior\n * for homogeneous arrays of String(s) and Number(s).\n *\n * Runtime: Same as `Array.prototype.sort`, plus an additional\n * O(n) overhead of copying the array twice.\n *\n * @param {Array<T>} arr The array to be sorted.\n * @param {?function(T, T): number=} opt_compareFn Optional comparison function\n *     by which the array is to be ordered. Should take 2 arguments to compare,\n *     and return a negative number, zero, or a positive number depending on\n *     whether the first argument is less than, equal to, or greater than the\n *     second.\n * @template T\n */\nfunction stableSort(arr, opt_compareFn) {\n  const compArr = new Array(arr.length);\n  for (let i = 0; i < arr.length; i++) {\n    compArr[i] = {index: i, value: arr[i]};\n  }\n  const valueCompareFn = opt_compareFn || defaultCompare;\n  function stableCompareFn(obj1, obj2) {\n    return valueCompareFn(obj1.value, obj2.value) || obj1.index - obj2.index;\n  }\n  sort(compArr, stableCompareFn);\n  for (let i = 0; i < arr.length; i++) {\n    arr[i] = compArr[i].value;\n  }\n}\nexports.stableSort = stableSort;\n\n\n/**\n * Sort the specified array into ascending order based on item keys\n * returned by the specified key function.\n * If no opt_compareFn is specified, the keys are compared in ascending order\n * using <code>defaultCompare</code>.\n *\n * Runtime: O(S(f(n)), where S is runtime of <code>sort</code>\n * and f(n) is runtime of the key function.\n *\n * @param {Array<T>} arr The array to be sorted.\n * @param {function(T): K} keyFn Function taking array element and returning\n *     a key used for sorting this element.\n * @param {?function(K, K): number=} opt_compareFn Optional comparison function\n *     by which the keys are to be ordered. Should take 2 arguments to compare,\n *     and return a negative number, zero, or a positive number depending on\n *     whether the first argument is less than, equal to, or greater than the\n *     second.\n * @template T,K\n */\nfunction sortByKey(arr, keyFn, opt_compareFn) {\n  const keyCompareFn = opt_compareFn || defaultCompare;\n  sort(arr, function(a, b) {\n    return keyCompareFn(keyFn(a), keyFn(b));\n  });\n}\nexports.sortByKey = sortByKey;\n\n\n/**\n * Sorts an array of objects by the specified object key and compare\n * function. If no compare function is provided, the key values are\n * compared in ascending order using <code>defaultCompare</code>.\n * This won't work for keys that get renamed by the compiler. So use\n * {'foo': 1, 'bar': 2} rather than {foo: 1, bar: 2}.\n * @param {Array<Object>} arr An array of objects to sort.\n * @param {string} key The object key to sort by.\n * @param {Function=} opt_compareFn The function to use to compare key\n *     values.\n */\nfunction sortObjectsByKey(arr, key, opt_compareFn) {\n  sortByKey(arr, function(obj) {\n    return obj[key];\n  }, opt_compareFn);\n}\nexports.sortObjectsByKey = sortObjectsByKey;\n\n\n/**\n * Tells if the array is sorted.\n * @param {!IArrayLike<T>} arr The array.\n * @param {?function(T,T):number=} opt_compareFn Function to compare the\n *     array elements.\n *     Should take 2 arguments to compare, and return a negative number, zero,\n *     or a positive number depending on whether the first argument is less\n *     than, equal to, or greater than the second.\n * @param {boolean=} opt_strict If true no equal elements are allowed.\n * @return {boolean} Whether the array is sorted.\n * @template T\n */\nfunction isSorted(arr, opt_compareFn, opt_strict) {\n  const compare = opt_compareFn || defaultCompare;\n  for (let i = 1; i < arr.length; i++) {\n    const compareResult = compare(arr[i - 1], arr[i]);\n    if (compareResult > 0 || compareResult == 0 && opt_strict) {\n      return false;\n    }\n  }\n  return true;\n}\nexports.isSorted = isSorted;\n\n\n/**\n * Compares two arrays for equality. Two arrays are considered equal if they\n * have the same length and their corresponding elements are equal according to\n * the comparison function.\n *\n * @param {IArrayLike<A>} arr1 The first array to compare.\n * @param {IArrayLike<B>} arr2 The second array to compare.\n * @param {?function(A,B):boolean=} opt_equalsFn Optional comparison function.\n *     Should take 2 arguments to compare, and return true if the arguments\n *     are equal. Defaults to {@link goog.array.defaultCompareEquality} which\n *     compares the elements using the built-in '===' operator.\n * @return {boolean} Whether the two arrays are equal.\n * @template A\n * @template B\n */\nfunction equals(arr1, arr2, opt_equalsFn) {\n  if (!goog.isArrayLike(arr1) || !goog.isArrayLike(arr2) ||\n      arr1.length != arr2.length) {\n    return false;\n  }\n  const l = arr1.length;\n  const equalsFn = opt_equalsFn || defaultCompareEquality;\n  for (let i = 0; i < l; i++) {\n    if (!equalsFn(arr1[i], arr2[i])) {\n      return false;\n    }\n  }\n  return true;\n}\nexports.equals = equals;\n\n\n/**\n * 3-way array compare function.\n * @param {!IArrayLike<VALUE>} arr1 The first array to\n *     compare.\n * @param {!IArrayLike<VALUE>} arr2 The second array to\n *     compare.\n * @param {function(VALUE, VALUE): number=} opt_compareFn Optional comparison\n *     function by which the array is to be ordered. Should take 2 arguments to\n *     compare, and return a negative number, zero, or a positive number\n *     depending on whether the first argument is less than, equal to, or\n *     greater than the second.\n * @return {number} Negative number, zero, or a positive number depending on\n *     whether the first argument is less than, equal to, or greater than the\n *     second.\n * @template VALUE\n */\nfunction compare3(arr1, arr2, opt_compareFn) {\n  const compare = opt_compareFn || defaultCompare;\n  const l = Math.min(arr1.length, arr2.length);\n  for (let i = 0; i < l; i++) {\n    const result = compare(arr1[i], arr2[i]);\n    if (result != 0) {\n      return result;\n    }\n  }\n  return defaultCompare(arr1.length, arr2.length);\n}\nexports.compare3 = compare3;\n\n\n/**\n * Compares its two arguments for order, using the built in < and >\n * operators.\n * @param {VALUE} a The first object to be compared.\n * @param {VALUE} b The second object to be compared.\n * @return {number} A negative number, zero, or a positive number as the first\n *     argument is less than, equal to, or greater than the second,\n *     respectively.\n * @template VALUE\n */\nfunction defaultCompare(a, b) {\n  return a > b ? 1 : a < b ? -1 : 0;\n}\nexports.defaultCompare = defaultCompare;\n\n\n/**\n * Compares its two arguments for inverse order, using the built in < and >\n * operators.\n * @param {VALUE} a The first object to be compared.\n * @param {VALUE} b The second object to be compared.\n * @return {number} A negative number, zero, or a positive number as the first\n *     argument is greater than, equal to, or less than the second,\n *     respectively.\n * @template VALUE\n */\nfunction inverseDefaultCompare(a, b) {\n  return -defaultCompare(a, b);\n}\nexports.inverseDefaultCompare = inverseDefaultCompare;\n\n\n/**\n * Compares its two arguments for equality, using the built in === operator.\n * @param {*} a The first object to compare.\n * @param {*} b The second object to compare.\n * @return {boolean} True if the two arguments are equal, false otherwise.\n */\nfunction defaultCompareEquality(a, b) {\n  return a === b;\n}\nexports.defaultCompareEquality = defaultCompareEquality;\n\n\n/**\n * Inserts a value into a sorted array. The array is not modified if the\n * value is already present.\n * @param {IArrayLike<VALUE>} array The array to modify.\n * @param {VALUE} value The object to insert.\n * @param {function(VALUE, VALUE): number=} opt_compareFn Optional comparison\n *     function by which the array is ordered. Should take 2 arguments to\n *     compare, and return a negative number, zero, or a positive number\n *     depending on whether the first argument is less than, equal to, or\n *     greater than the second.\n * @return {boolean} True if an element was inserted.\n * @template VALUE\n */\nfunction binaryInsert(array, value, opt_compareFn) {\n  const index = binarySearch(array, value, opt_compareFn);\n  if (index < 0) {\n    insertAt(array, value, -(index + 1));\n    return true;\n  }\n  return false;\n}\nexports.binaryInsert = binaryInsert;\n\n\n/**\n * Removes a value from a sorted array.\n * @param {!IArrayLike<VALUE>} array The array to modify.\n * @param {VALUE} value The object to remove.\n * @param {function(VALUE, VALUE): number=} opt_compareFn Optional comparison\n *     function by which the array is ordered. Should take 2 arguments to\n *     compare, and return a negative number, zero, or a positive number\n *     depending on whether the first argument is less than, equal to, or\n *     greater than the second.\n * @return {boolean} True if an element was removed.\n * @template VALUE\n */\nfunction binaryRemove(array, value, opt_compareFn) {\n  const index = binarySearch(array, value, opt_compareFn);\n  return (index >= 0) ? removeAt(array, index) : false;\n}\nexports.binaryRemove = binaryRemove;\n\n\n/**\n * Splits an array into disjoint buckets according to a splitting function.\n * @param {IArrayLike<T>} array The array.\n * @param {function(this:S, T, number, !IArrayLike<T>):?} sorter Function to\n *     call for every element.  This takes 3 arguments (the element, the index\n *     and the array) and must return a valid object key (a string, number,\n *     etc), or undefined, if that object should not be placed in a bucket.\n * @param {S=} opt_obj The object to be used as the value of 'this' within\n *     sorter.\n * @return {!Object<!Array<T>>} An object, with keys being all of the unique\n *     return values of sorter, and values being arrays containing the items for\n *     which the splitter returned that key.\n * @template T,S\n */\nfunction bucket(array, sorter, opt_obj) {\n  const buckets = {};\n\n  for (let i = 0; i < array.length; i++) {\n    const value = array[i];\n    const key = sorter.call(/** @type {?} */ (opt_obj), value, i, array);\n    if (key !== undefined) {\n      // Push the value to the right bucket, creating it if necessary.\n      const bucket = buckets[key] || (buckets[key] = []);\n      bucket.push(value);\n    }\n  }\n\n  return buckets;\n}\nexports.bucket = bucket;\n\n\n/**\n * Splits an array into disjoint buckets according to a splitting function.\n * @param {!IArrayLike<V>} array The array.\n * @param {function(V, number, !IArrayLike<V>):(K|undefined)} sorter Function to\n *     call for every element.  This takes 3 arguments (the element, the index,\n *     and the array) and must return a value to use as a key, or undefined, if\n *     that object should not be placed in a bucket.\n * @return {!Map<K, !Array<V>>} A map, with keys being all of the unique\n *     return values of sorter, and values being arrays containing the items for\n *     which the splitter returned that key.\n * @template K,V\n */\nfunction bucketToMap(array, sorter) {\n  const /** !Map<K, !Array<V>> */ buckets = new Map();\n\n  for (let i = 0; i < array.length; i++) {\n    const value = array[i];\n    const key = sorter(value, i, array);\n    if (key !== undefined) {\n      // Push the value to the right bucket, creating it if necessary.\n      let bucket = buckets.get(key);\n      if (!bucket) {\n        bucket = [];\n        buckets.set(key, bucket);\n      }\n      bucket.push(value);\n    }\n  }\n\n  return buckets;\n}\nexports.bucketToMap = bucketToMap;\n\n\n/**\n * Creates a new object built from the provided array and the key-generation\n * function.\n * @param {IArrayLike<T>} arr Array or array like object over\n *     which to iterate whose elements will be the values in the new object.\n * @param {?function(this:S, T, number, ?) : string} keyFunc The function to\n *     call for every element. This function takes 3 arguments (the element, the\n *     index and the array) and should return a string that will be used as the\n *     key for the element in the new object. If the function returns the same\n *     key for more than one element, the value for that key is\n *     implementation-defined.\n * @param {S=} opt_obj The object to be used as the value of 'this'\n *     within keyFunc.\n * @return {!Object<T>} The new object.\n * @template T,S\n */\nfunction toObject(arr, keyFunc, opt_obj) {\n  const ret = {};\n  forEach(arr, function(element, index) {\n    ret[keyFunc.call(/** @type {?} */ (opt_obj), element, index, arr)] =\n        element;\n  });\n  return ret;\n}\nexports.toObject = toObject;\n\n\n/**\n * Creates a new ES6 Map built from the provided array and the key-generation\n * function.\n * @param {!IArrayLike<V>} arr Array or array like object over which to iterate\n *     whose elements will be the values in the new object.\n * @param {?function(V, number, ?) : K} keyFunc The function to call for every\n *     element. This function takes 3 arguments (the element, the index, and the\n *     array) and should return a value that will be used as the key for the\n *     element in the new object. If the function returns the same key for more\n *     than one element, the value for that key is implementation-defined.\n * @return {!Map<K, V>} The new map.\n * @template K,V\n */\nfunction toMap(arr, keyFunc) {\n  const /** !Map<K, V> */ map = new Map();\n\n  for (let i = 0; i < arr.length; i++) {\n    const element = arr[i];\n    map.set(keyFunc(element, i, arr), element);\n  }\n\n  return map;\n}\nexports.toMap = toMap;\n\n\n/**\n * Creates a range of numbers in an arithmetic progression.\n *\n * Range takes 1, 2, or 3 arguments:\n * <pre>\n * range(5) is the same as range(0, 5, 1) and produces [0, 1, 2, 3, 4]\n * range(2, 5) is the same as range(2, 5, 1) and produces [2, 3, 4]\n * range(-2, -5, -1) produces [-2, -3, -4]\n * range(-2, -5, 1) produces [], since stepping by 1 wouldn't ever reach -5.\n * </pre>\n *\n * @param {number} startOrEnd The starting value of the range if an end argument\n *     is provided. Otherwise, the start value is 0, and this is the end value.\n * @param {number=} opt_end The optional end value of the range.\n * @param {number=} opt_step The step size between range values. Defaults to 1\n *     if opt_step is undefined or 0.\n * @return {!Array<number>} An array of numbers for the requested range. May be\n *     an empty array if adding the step would not converge toward the end\n *     value.\n */\nfunction range(startOrEnd, opt_end, opt_step) {\n  const array = [];\n  let start = 0;\n  let end = startOrEnd;\n  const step = opt_step || 1;\n  if (opt_end !== undefined) {\n    start = startOrEnd;\n    end = opt_end;\n  }\n\n  if (step * (end - start) < 0) {\n    // Sign mismatch: start + step will never reach the end value.\n    return [];\n  }\n\n  if (step > 0) {\n    for (let i = start; i < end; i += step) {\n      array.push(i);\n    }\n  } else {\n    for (let i = start; i > end; i += step) {\n      array.push(i);\n    }\n  }\n  return array;\n}\nexports.range = range;\n\n\n/**\n * Returns an array consisting of the given value repeated N times.\n *\n * @param {VALUE} value The value to repeat.\n * @param {number} n The repeat count.\n * @return {!Array<VALUE>} An array with the repeated value.\n * @template VALUE\n */\nfunction repeat(value, n) {\n  const array = [];\n  for (let i = 0; i < n; i++) {\n    array[i] = value;\n  }\n  return array;\n}\nexports.repeat = repeat;\n\n\n/**\n * Returns an array consisting of every argument with all arrays\n * expanded in-place recursively.\n *\n * @param {...*} var_args The values to flatten.\n * @return {!Array<?>} An array containing the flattened values.\n */\nfunction flatten(var_args) {\n  const CHUNK_SIZE = 8192;\n\n  const result = [];\n  for (let i = 0; i < arguments.length; i++) {\n    const element = arguments[i];\n    if (Array.isArray(element)) {\n      for (let c = 0; c < element.length; c += CHUNK_SIZE) {\n        const chunk = slice(element, c, c + CHUNK_SIZE);\n        const recurseResult = flatten.apply(null, chunk);\n        for (let r = 0; r < recurseResult.length; r++) {\n          result.push(recurseResult[r]);\n        }\n      }\n    } else {\n      result.push(element);\n    }\n  }\n  return result;\n}\nexports.flatten = flatten;\n\n\n/**\n * Rotates an array in-place. After calling this method, the element at\n * index i will be the element previously at index (i - n) %\n * array.length, for all values of i between 0 and array.length - 1,\n * inclusive.\n *\n * For example, suppose list comprises [t, a, n, k, s]. After invoking\n * rotate(array, 1) (or rotate(array, -4)), array will comprise [s, t, a, n, k].\n *\n * @param {!Array<T>} array The array to rotate.\n * @param {number} n The amount to rotate.\n * @return {!Array<T>} The array.\n * @template T\n */\nfunction rotate(array, n) {\n  asserts.assert(array.length != null);\n\n  if (array.length) {\n    n %= array.length;\n    if (n > 0) {\n      Array.prototype.unshift.apply(array, array.splice(-n, n));\n    } else if (n < 0) {\n      Array.prototype.push.apply(array, array.splice(0, -n));\n    }\n  }\n  return array;\n}\nexports.rotate = rotate;\n\n\n/**\n * Moves one item of an array to a new position keeping the order of the rest\n * of the items. Example use case: keeping a list of JavaScript objects\n * synchronized with the corresponding list of DOM elements after one of the\n * elements has been dragged to a new position.\n * @param {!IArrayLike<?>} arr The array to modify.\n * @param {number} fromIndex Index of the item to move between 0 and\n *     `arr.length - 1`.\n * @param {number} toIndex Target index between 0 and `arr.length - 1`.\n */\nfunction moveItem(arr, fromIndex, toIndex) {\n  asserts.assert(fromIndex >= 0 && fromIndex < arr.length);\n  asserts.assert(toIndex >= 0 && toIndex < arr.length);\n  // Remove 1 item at fromIndex.\n  const removedItems = Array.prototype.splice.call(arr, fromIndex, 1);\n  // Insert the removed item at toIndex.\n  Array.prototype.splice.call(arr, toIndex, 0, removedItems[0]);\n  // We don't use goog.array.insertAt and goog.array.removeAt, because they're\n  // significantly slower than splice.\n}\nexports.moveItem = moveItem;\n\n\n/**\n * Creates a new array for which the element at position i is an array of the\n * ith element of the provided arrays.  The returned array will only be as long\n * as the shortest array provided; additional values are ignored.  For example,\n * the result of zipping [1, 2] and [3, 4, 5] is [[1,3], [2, 4]].\n *\n * This is similar to the zip() function in Python.  See {@link\n * http://docs.python.org/library/functions.html#zip}\n *\n * @param {...!IArrayLike<?>} var_args Arrays to be combined.\n * @return {!Array<!Array<?>>} A new array of arrays created from\n *     provided arrays.\n */\nfunction zip(var_args) {\n  if (!arguments.length) {\n    return [];\n  }\n  const result = [];\n  let minLen = arguments[0].length;\n  for (let i = 1; i < arguments.length; i++) {\n    if (arguments[i].length < minLen) {\n      minLen = arguments[i].length;\n    }\n  }\n  for (let i = 0; i < minLen; i++) {\n    const value = [];\n    for (let j = 0; j < arguments.length; j++) {\n      value.push(arguments[j][i]);\n    }\n    result.push(value);\n  }\n  return result;\n}\nexports.zip = zip;\n\n\n/**\n * Shuffles the values in the specified array using the Fisher-Yates in-place\n * shuffle (also known as the Knuth Shuffle). By default, calls Math.random()\n * and so resets the state of that random number generator. Similarly, may reset\n * the state of any other specified random number generator.\n *\n * Runtime: O(n)\n *\n * @param {!Array<?>} arr The array to be shuffled.\n * @param {function():number=} opt_randFn Optional random function to use for\n *     shuffling.\n *     Takes no arguments, and returns a random number on the interval [0, 1).\n *     Defaults to Math.random() using JavaScript's built-in Math library.\n */\nfunction shuffle(arr, opt_randFn) {\n  const randFn = opt_randFn || Math.random;\n\n  for (let i = arr.length - 1; i > 0; i--) {\n    // Choose a random array index in [0, i] (inclusive with i).\n    const j = Math.floor(randFn() * (i + 1));\n\n    const tmp = arr[i];\n    arr[i] = arr[j];\n    arr[j] = tmp;\n  }\n}\nexports.shuffle = shuffle;\n\n\n/**\n * Returns a new array of elements from arr, based on the indexes of elements\n * provided by index_arr. For example, the result of index copying\n * ['a', 'b', 'c'] with index_arr [1,0,0,2] is ['b', 'a', 'a', 'c'].\n *\n * @param {!IArrayLike<T>} arr The array to get a indexed copy from.\n * @param {!IArrayLike<number>} index_arr An array of indexes to get from arr.\n * @return {!Array<T>} A new array of elements from arr in index_arr order.\n * @template T\n */\nfunction copyByIndex(arr, index_arr) {\n  const result = [];\n  forEach(index_arr, function(index) {\n    result.push(arr[index]);\n  });\n  return result;\n}\nexports.copyByIndex = copyByIndex;\n\n\n/**\n * Maps each element of the input array into zero or more elements of the output\n * array.\n *\n * @param {!IArrayLike<VALUE>|string} arr Array or array like object\n *     over which to iterate.\n * @param {function(this:THIS, VALUE, number, ?): !Array<RESULT>} f The function\n *     to call for every element. This function takes 3 arguments (the element,\n *     the index and the array) and should return an array. The result will be\n *     used to extend a new array.\n * @param {THIS=} opt_obj The object to be used as the value of 'this' within f.\n * @return {!Array<RESULT>} a new array with the concatenation of all arrays\n *     returned from f.\n * @template THIS, VALUE, RESULT\n */\nfunction concatMap(arr, f, opt_obj) {\n  return concat.apply([], map(arr, f, opt_obj));\n}\nexports.concatMap = concatMap;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview A base class for event objects.\n */\n\n\ngoog.provide('goog.events.Event');\n\n/**\n * goog.events.Event no longer depends on goog.Disposable. Keep requiring\n * goog.Disposable here to not break projects which assume this dependency.\n * @suppress {extraRequire}\n */\ngoog.require('goog.Disposable');\ngoog.require('goog.events.EventId');\n\n\n/**\n * A base class for event objects, so that they can support preventDefault and\n * stopPropagation.\n *\n * @param {string|!goog.events.EventId} type Event Type.\n * @param {Object=} opt_target Reference to the object that is the target of\n *     this event. It has to implement the `EventTarget` interface\n *     declared at {@link http://developer.mozilla.org/en/DOM/EventTarget}.\n * @constructor\n */\ngoog.events.Event = function(type, opt_target) {\n  'use strict';\n  /**\n   * Event type.\n   * @type {string}\n   */\n  this.type = type instanceof goog.events.EventId ? String(type) : type;\n\n  /**\n   * TODO(tbreisacher): The type should probably be\n   * EventTarget|goog.events.EventTarget.\n   *\n   * Target of the event.\n   * @type {Object|undefined}\n   */\n  this.target = opt_target;\n\n  /**\n   * Object that had the listener attached.\n   * @type {Object|undefined}\n   */\n  this.currentTarget = this.target;\n\n  /**\n   * Whether to cancel the event in internal capture/bubble processing for IE.\n   * @type {boolean}\n   * @private\n   */\n  this.propagationStopped_ = false;\n\n  /**\n   * Whether the default action has been prevented.\n   * This is a property to match the W3C specification at\n   * {@link http://www.w3.org/TR/DOM-Level-3-Events/\n   * #events-event-type-defaultPrevented}.\n   * Must be treated as read-only outside the class.\n   * @type {boolean}\n   */\n  this.defaultPrevented = false;\n};\n\n/**\n * @return {boolean} true iff internal propagation has been stopped.\n */\ngoog.events.Event.prototype.hasPropagationStopped = function() {\n  'use strict';\n  return this.propagationStopped_;\n};\n\n/**\n * Stops event propagation.\n * @return {void}\n */\ngoog.events.Event.prototype.stopPropagation = function() {\n  'use strict';\n  this.propagationStopped_ = true;\n};\n\n\n/**\n * Prevents the default action, for example a link redirecting to a url.\n * @return {void}\n */\ngoog.events.Event.prototype.preventDefault = function() {\n  'use strict';\n  this.defaultPrevented = true;\n};\n\n\n/**\n * Stops the propagation of the event. It is equivalent to\n * `e.stopPropagation()`, but can be used as the callback argument of\n * {@link goog.events.listen} without declaring another function.\n * @param {!goog.events.Event} e An event.\n * @return {void}\n */\ngoog.events.Event.stopPropagation = function(e) {\n  'use strict';\n  e.stopPropagation();\n};\n\n\n/**\n * Prevents the default action. It is equivalent to\n * `e.preventDefault()`, but can be used as the callback argument of\n * {@link goog.events.listen} without declaring another function.\n * @param {!goog.events.Event} e An event.\n * @return {void}\n */\ngoog.events.Event.preventDefault = function(e) {\n  'use strict';\n  e.preventDefault();\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Browser capability checks for the events package.\n */\n\ngoog.module('goog.events.BrowserFeature');\ngoog.module.declareLegacyNamespace();\n\n\n/**\n * Tricks Closure Compiler into believing that a function is pure.  The compiler\n * assumes that any `valueOf` function is pure, without analyzing its contents.\n *\n * @param {function(): T} fn\n * @return {T}\n * @template T\n */\nconst purify = (fn) => {\n  return ({valueOf: fn}).valueOf();\n};\n\n\n/**\n * Enum of browser capabilities.\n * @enum {boolean}\n */\nexports = {\n  /**\n   * Whether touch is enabled in the browser.\n   */\n  TOUCH_ENABLED:\n      ('ontouchstart' in goog.global ||\n       !!(goog.global['document'] && document.documentElement &&\n          'ontouchstart' in document.documentElement) ||\n       // IE10 uses non-standard touch events, so it has a different check.\n       !!(goog.global['navigator'] &&\n          (goog.global['navigator']['maxTouchPoints'] ||\n           goog.global['navigator']['msMaxTouchPoints']))),\n\n  /**\n   * Whether addEventListener supports W3C standard pointer events.\n   * http://www.w3.org/TR/pointerevents/\n   */\n  POINTER_EVENTS: ('PointerEvent' in goog.global),\n\n  /**\n   * Whether addEventListener supports MSPointer events (only used in IE10).\n   * http://msdn.microsoft.com/en-us/library/ie/hh772103(v=vs.85).aspx\n   * http://msdn.microsoft.com/library/hh673557(v=vs.85).aspx\n   */\n  MSPOINTER_EVENTS: false,\n\n  /**\n   * Whether addEventListener supports {passive: true}.\n   * https://developers.google.com/web/updates/2016/06/passive-event-listeners\n   */\n  PASSIVE_EVENTS: purify(function() {\n    // If we're in a web worker or other custom environment, we can't tell.\n    if (!goog.global.addEventListener || !Object.defineProperty) {  // IE 8\n      return false;\n    }\n\n    var passive = false;\n    var options = Object.defineProperty({}, 'passive', {\n      get: function() {\n        passive = true;\n      }\n    });\n    try {\n      const nullFunction = () => {};\n      goog.global.addEventListener('test', nullFunction, options);\n      goog.global.removeEventListener('test', nullFunction, options);\n    } catch (e) {\n    }\n\n    return passive;\n  })\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview String functions called from Closure packages that couldn't\n * depend on each other. Outside Closure, use goog.string function which\n * delegate to these.\n */\n\n\ngoog.provide('goog.string.internal');\n\n\n/**\n * Fast prefix-checker.\n * @param {string} str The string to check.\n * @param {string} prefix A string to look for at the start of `str`.\n * @return {boolean} True if `str` begins with `prefix`.\n * @see goog.string.startsWith\n */\ngoog.string.internal.startsWith = function(str, prefix) {\n  'use strict';\n  return str.lastIndexOf(prefix, 0) == 0;\n};\n\n\n/**\n * Fast suffix-checker.\n * @param {string} str The string to check.\n * @param {string} suffix A string to look for at the end of `str`.\n * @return {boolean} True if `str` ends with `suffix`.\n * @see goog.string.endsWith\n */\ngoog.string.internal.endsWith = function(str, suffix) {\n  'use strict';\n  const l = str.length - suffix.length;\n  return l >= 0 && str.indexOf(suffix, l) == l;\n};\n\n\n/**\n * Case-insensitive prefix-checker.\n * @param {string} str The string to check.\n * @param {string} prefix  A string to look for at the end of `str`.\n * @return {boolean} True if `str` begins with `prefix` (ignoring\n *     case).\n * @see goog.string.caseInsensitiveStartsWith\n */\ngoog.string.internal.caseInsensitiveStartsWith = function(str, prefix) {\n  'use strict';\n  return (\n      goog.string.internal.caseInsensitiveCompare(\n          prefix, str.slice(0, prefix.length)) == 0);\n};\n\n\n/**\n * Case-insensitive suffix-checker.\n * @param {string} str The string to check.\n * @param {string} suffix A string to look for at the end of `str`.\n * @return {boolean} True if `str` ends with `suffix` (ignoring\n *     case).\n * @see goog.string.caseInsensitiveEndsWith\n */\ngoog.string.internal.caseInsensitiveEndsWith = function(str, suffix) {\n  'use strict';\n  return (\n      goog.string.internal.caseInsensitiveCompare(\n          suffix, str.slice(str.length - suffix.length)) == 0);\n};\n\n\n/**\n * Case-insensitive equality checker.\n * @param {string} str1 First string to check.\n * @param {string} str2 Second string to check.\n * @return {boolean} True if `str1` and `str2` are the same string,\n *     ignoring case.\n * @see goog.string.caseInsensitiveEquals\n */\ngoog.string.internal.caseInsensitiveEquals = function(str1, str2) {\n  'use strict';\n  return str1.toLowerCase() == str2.toLowerCase();\n};\n\n\n/**\n * Checks if a string is empty or contains only whitespaces.\n * @param {string} str The string to check.\n * @return {boolean} Whether `str` is empty or whitespace only.\n * @see goog.string.isEmptyOrWhitespace\n */\ngoog.string.internal.isEmptyOrWhitespace = function(str) {\n  'use strict';\n  // testing length == 0 first is actually slower in all browsers (about the\n  // same in Opera).\n  // Since IE doesn't include non-breaking-space (0xa0) in their \\s character\n  // class (as required by section 7.2 of the ECMAScript spec), we explicitly\n  // include it in the regexp to enforce consistent cross-browser behavior.\n  return /^[\\s\\xa0]*$/.test(str);\n};\n\n\n/**\n * Trims white spaces to the left and right of a string.\n * @param {string} str The string to trim.\n * @return {string} A trimmed copy of `str`.\n */\ngoog.string.internal.trim =\n    (goog.TRUSTED_SITE && String.prototype.trim) ? function(str) {\n      'use strict';\n      return str.trim();\n    } : function(str) {\n      'use strict';\n      // Since IE doesn't include non-breaking-space (0xa0) in their \\s\n      // character class (as required by section 7.2 of the ECMAScript spec),\n      // we explicitly include it in the regexp to enforce consistent\n      // cross-browser behavior.\n      // NOTE: We don't use String#replace because it might have side effects\n      // causing this function to not compile to 0 bytes.\n      return /^[\\s\\xa0]*([\\s\\S]*?)[\\s\\xa0]*$/.exec(str)[1];\n    };\n\n\n/**\n * A string comparator that ignores case.\n * -1 = str1 less than str2\n *  0 = str1 equals str2\n *  1 = str1 greater than str2\n *\n * @param {string} str1 The string to compare.\n * @param {string} str2 The string to compare `str1` to.\n * @return {number} The comparator result, as described above.\n * @see goog.string.caseInsensitiveCompare\n */\ngoog.string.internal.caseInsensitiveCompare = function(str1, str2) {\n  'use strict';\n  const test1 = String(str1).toLowerCase();\n  const test2 = String(str2).toLowerCase();\n\n  if (test1 < test2) {\n    return -1;\n  } else if (test1 == test2) {\n    return 0;\n  } else {\n    return 1;\n  }\n};\n\n\n/**\n * Converts \\n to <br>s or <br />s.\n * @param {string} str The string in which to convert newlines.\n * @param {boolean=} opt_xml Whether to use XML compatible tags.\n * @return {string} A copy of `str` with converted newlines.\n * @see goog.string.newLineToBr\n */\ngoog.string.internal.newLineToBr = function(str, opt_xml) {\n  'use strict';\n  return str.replace(/(\\r\\n|\\r|\\n)/g, opt_xml ? '<br />' : '<br>');\n};\n\n\n/**\n * Escapes double quote '\"' and single quote '\\'' characters in addition to\n * '&', '<', and '>' so that a string can be included in an HTML tag attribute\n * value within double or single quotes.\n * @param {string} str string to be escaped.\n * @param {boolean=} opt_isLikelyToContainHtmlChars\n * @return {string} An escaped copy of `str`.\n * @see goog.string.htmlEscape\n */\ngoog.string.internal.htmlEscape = function(\n    str, opt_isLikelyToContainHtmlChars) {\n  'use strict';\n  if (opt_isLikelyToContainHtmlChars) {\n    str = str.replace(goog.string.internal.AMP_RE_, '&amp;')\n              .replace(goog.string.internal.LT_RE_, '&lt;')\n              .replace(goog.string.internal.GT_RE_, '&gt;')\n              .replace(goog.string.internal.QUOT_RE_, '&quot;')\n              .replace(goog.string.internal.SINGLE_QUOTE_RE_, '&#39;')\n              .replace(goog.string.internal.NULL_RE_, '&#0;');\n    return str;\n\n  } else {\n    // quick test helps in the case when there are no chars to replace, in\n    // worst case this makes barely a difference to the time taken\n    if (!goog.string.internal.ALL_RE_.test(str)) return str;\n\n    // str.indexOf is faster than regex.test in this case\n    if (str.indexOf('&') != -1) {\n      str = str.replace(goog.string.internal.AMP_RE_, '&amp;');\n    }\n    if (str.indexOf('<') != -1) {\n      str = str.replace(goog.string.internal.LT_RE_, '&lt;');\n    }\n    if (str.indexOf('>') != -1) {\n      str = str.replace(goog.string.internal.GT_RE_, '&gt;');\n    }\n    if (str.indexOf('\"') != -1) {\n      str = str.replace(goog.string.internal.QUOT_RE_, '&quot;');\n    }\n    if (str.indexOf('\\'') != -1) {\n      str = str.replace(goog.string.internal.SINGLE_QUOTE_RE_, '&#39;');\n    }\n    if (str.indexOf('\\x00') != -1) {\n      str = str.replace(goog.string.internal.NULL_RE_, '&#0;');\n    }\n    return str;\n  }\n};\n\n\n/**\n * Regular expression that matches an ampersand, for use in escaping.\n * @const {!RegExp}\n * @private\n */\ngoog.string.internal.AMP_RE_ = /&/g;\n\n\n/**\n * Regular expression that matches a less than sign, for use in escaping.\n * @const {!RegExp}\n * @private\n */\ngoog.string.internal.LT_RE_ = /</g;\n\n\n/**\n * Regular expression that matches a greater than sign, for use in escaping.\n * @const {!RegExp}\n * @private\n */\ngoog.string.internal.GT_RE_ = />/g;\n\n\n/**\n * Regular expression that matches a double quote, for use in escaping.\n * @const {!RegExp}\n * @private\n */\ngoog.string.internal.QUOT_RE_ = /\"/g;\n\n\n/**\n * Regular expression that matches a single quote, for use in escaping.\n * @const {!RegExp}\n * @private\n */\ngoog.string.internal.SINGLE_QUOTE_RE_ = /'/g;\n\n\n/**\n * Regular expression that matches null character, for use in escaping.\n * @const {!RegExp}\n * @private\n */\ngoog.string.internal.NULL_RE_ = /\\x00/g;\n\n\n/**\n * Regular expression that matches any character that needs to be escaped.\n * @const {!RegExp}\n * @private\n */\ngoog.string.internal.ALL_RE_ = /[\\x00&<>\"']/;\n\n\n/**\n * Do escaping of whitespace to preserve spatial formatting. We use character\n * entity #160 to make it safer for xml.\n * @param {string} str The string in which to escape whitespace.\n * @param {boolean=} opt_xml Whether to use XML compatible tags.\n * @return {string} An escaped copy of `str`.\n * @see goog.string.whitespaceEscape\n */\ngoog.string.internal.whitespaceEscape = function(str, opt_xml) {\n  'use strict';\n  // This doesn't use goog.string.preserveSpaces for backwards compatibility.\n  return goog.string.internal.newLineToBr(\n      str.replace(/  /g, ' &#160;'), opt_xml);\n};\n\n\n/**\n * Determines whether a string contains a substring.\n * @param {string} str The string to search.\n * @param {string} subString The substring to search for.\n * @return {boolean} Whether `str` contains `subString`.\n * @see goog.string.contains\n */\ngoog.string.internal.contains = function(str, subString) {\n  'use strict';\n  return str.indexOf(subString) != -1;\n};\n\n\n/**\n * Determines whether a string contains a substring, ignoring case.\n * @param {string} str The string to search.\n * @param {string} subString The substring to search for.\n * @return {boolean} Whether `str` contains `subString`.\n * @see goog.string.caseInsensitiveContains\n */\ngoog.string.internal.caseInsensitiveContains = function(str, subString) {\n  'use strict';\n  return goog.string.internal.contains(\n      str.toLowerCase(), subString.toLowerCase());\n};\n\n\n/**\n * Compares two version numbers.\n *\n * @param {string|number} version1 Version of first item.\n * @param {string|number} version2 Version of second item.\n *\n * @return {number}  1 if `version1` is higher.\n *                   0 if arguments are equal.\n *                  -1 if `version2` is higher.\n * @see goog.string.compareVersions\n */\ngoog.string.internal.compareVersions = function(version1, version2) {\n  'use strict';\n  let order = 0;\n  // Trim leading and trailing whitespace and split the versions into\n  // subversions.\n  const v1Subs = goog.string.internal.trim(String(version1)).split('.');\n  const v2Subs = goog.string.internal.trim(String(version2)).split('.');\n  const subCount = Math.max(v1Subs.length, v2Subs.length);\n\n  // Iterate over the subversions, as long as they appear to be equivalent.\n  for (let subIdx = 0; order == 0 && subIdx < subCount; subIdx++) {\n    let v1Sub = v1Subs[subIdx] || '';\n    let v2Sub = v2Subs[subIdx] || '';\n\n    do {\n      // Split the subversions into pairs of numbers and qualifiers (like 'b').\n      // Two different RegExp objects are use to make it clear the code\n      // is side-effect free\n      const v1Comp = /(\\d*)(\\D*)(.*)/.exec(v1Sub) || ['', '', '', ''];\n      const v2Comp = /(\\d*)(\\D*)(.*)/.exec(v2Sub) || ['', '', '', ''];\n      // Break if there are no more matches.\n      if (v1Comp[0].length == 0 && v2Comp[0].length == 0) {\n        break;\n      }\n\n      // Parse the numeric part of the subversion. A missing number is\n      // equivalent to 0.\n      const v1CompNum = v1Comp[1].length == 0 ? 0 : parseInt(v1Comp[1], 10);\n      const v2CompNum = v2Comp[1].length == 0 ? 0 : parseInt(v2Comp[1], 10);\n\n      // Compare the subversion components. The number has the highest\n      // precedence. Next, if the numbers are equal, a subversion without any\n      // qualifier is always higher than a subversion with any qualifier. Next,\n      // the qualifiers are compared as strings.\n      order = goog.string.internal.compareElements_(v1CompNum, v2CompNum) ||\n          goog.string.internal.compareElements_(\n              v1Comp[2].length == 0, v2Comp[2].length == 0) ||\n          goog.string.internal.compareElements_(v1Comp[2], v2Comp[2]);\n      // Stop as soon as an inequality is discovered.\n\n      v1Sub = v1Comp[3];\n      v2Sub = v2Comp[3];\n    } while (order == 0);\n  }\n\n  return order;\n};\n\n\n/**\n * Compares elements of a version number.\n *\n * @param {string|number|boolean} left An element from a version number.\n * @param {string|number|boolean} right An element from a version number.\n *\n * @return {number}  1 if `left` is higher.\n *                   0 if arguments are equal.\n *                  -1 if `right` is higher.\n * @private\n */\ngoog.string.internal.compareElements_ = function(left, right) {\n  'use strict';\n  if (left < right) {\n    return -1;\n  } else if (left > right) {\n    return 1;\n  }\n  return 0;\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utilities used by goog.labs.userAgent tools. These functions\n * should not be used outside of goog.labs.userAgent.*.\n *\n */\n\ngoog.module('goog.labs.userAgent.util');\ngoog.module.declareLegacyNamespace();\n\nconst {caseInsensitiveContains, contains} = goog.require('goog.string.internal');\nconst {useClientHints} = goog.require('goog.labs.userAgent');\n\n/**\n * @const {boolean} If true, use navigator.userAgentData without check.\n * TODO(user): FEATURESET_YEAR >= 2024 if it supports mobile and all the\n * brands we need.  See https://caniuse.com/mdn-api_navigator_useragentdata.\n */\nconst ASSUME_CLIENT_HINTS_SUPPORT = false;\n\n/**\n * Gets the native userAgent string from navigator if it exists.\n * If navigator or navigator.userAgent string is missing, returns an empty\n * string.\n * @return {string}\n */\nfunction getNativeUserAgentString() {\n  const navigator = getNavigator();\n  if (navigator) {\n    const userAgent = navigator.userAgent;\n    if (userAgent) {\n      return userAgent;\n    }\n  }\n  return '';\n}\n\n/**\n * Gets the native userAgentData object from navigator if it exists.\n * If navigator.userAgentData object is missing returns null.\n * @return {?NavigatorUAData}\n */\nfunction getNativeUserAgentData() {\n  const navigator = getNavigator();\n  // TODO(user): Use navigator?.userAgent ?? null once it's supported.\n  if (navigator) {\n    return navigator.userAgentData || null;\n  }\n  return null;\n}\n\n/**\n * Getter for the native navigator.\n * @return {!Navigator}\n */\nfunction getNavigator() {\n  return goog.global.navigator;\n}\n\n/**\n * A possible override for applications which wish to not check\n * navigator.userAgent but use a specified value for detection instead.\n * @type {?string}\n */\nlet userAgentInternal = null;\n\n/**\n * A possible override for applications which wish to not check\n * navigator.userAgentData but use a specified value for detection instead.\n * @type {?NavigatorUAData}\n */\nlet userAgentDataInternal = getNativeUserAgentData();\n\n/**\n * Override the user agent string with the given value.\n * This should only be used for testing within the goog.labs.userAgent\n * namespace.\n * Pass `null` to use the native browser object instead.\n * @param {?string=} userAgent The userAgent override.\n * @return {void}\n */\nfunction setUserAgent(userAgent = undefined) {\n  userAgentInternal =\n      typeof userAgent === 'string' ? userAgent : getNativeUserAgentString();\n}\n\n/** @return {string} The user agent string. */\nfunction getUserAgent() {\n  return userAgentInternal == null ? getNativeUserAgentString() :\n                                     userAgentInternal;\n}\n\n/**\n * Override the user agent data object with the given value.\n * This should only be used for testing within the goog.labs.userAgent\n * namespace.\n * Pass `null` to specify the absence of userAgentData. Note that this behavior\n * is different from setUserAgent.\n * @param {?NavigatorUAData} userAgentData The userAgentData override.\n */\nfunction setUserAgentData(userAgentData) {\n  userAgentDataInternal = userAgentData;\n}\n\n/**\n * If the user agent data object was overridden using setUserAgentData,\n * reset it so that it uses the native browser object instead, if it exists.\n */\nfunction resetUserAgentData() {\n  userAgentDataInternal = getNativeUserAgentData();\n}\n\n/** @return {?NavigatorUAData} Navigator.userAgentData if exist */\nfunction getUserAgentData() {\n  return userAgentDataInternal;\n}\n\n/**\n * Checks if any string in userAgentData.brands matches str.\n * Returns false if userAgentData is not supported.\n * @param {string} str\n * @return {boolean} Whether any brand string from userAgentData contains the\n *     given string.\n */\nfunction matchUserAgentDataBrand(str) {\n  if (!useClientHints()) return false;\n  const data = getUserAgentData();\n  if (!data) return false;\n  return data.brands.some(({brand}) => brand && contains(brand, str));\n}\n\n/**\n * @param {string} str\n * @return {boolean} Whether the user agent contains the given string.\n */\nfunction matchUserAgent(str) {\n  const userAgent = getUserAgent();\n  return contains(userAgent, str);\n}\n\n/**\n * @param {string} str\n * @return {boolean} Whether the user agent contains the given string, ignoring\n *     case.\n */\nfunction matchUserAgentIgnoreCase(str) {\n  const userAgent = getUserAgent();\n  return caseInsensitiveContains(userAgent, str);\n}\n\n/**\n * Parses the user agent into tuples for each section.\n * @param {string} userAgent\n * @return {!Array<!Array<string>>} Tuples of key, version, and the contents of\n *     the parenthetical.\n */\nfunction extractVersionTuples(userAgent) {\n  // Matches each section of a user agent string.\n  // Example UA:\n  // Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us)\n  // AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405\n  // This has three version tuples: Mozilla, AppleWebKit, and Mobile.\n\n  const versionRegExp = new RegExp(\n      // Key. Note that a key may have a space.\n      // (i.e. 'Mobile Safari' in 'Mobile Safari/5.0')\n      '([A-Z][\\\\w ]+)' +\n\n          '/' +                // slash\n          '([^\\\\s]+)' +        // version (i.e. '5.0b')\n          '\\\\s*' +             // whitespace\n          '(?:\\\\((.*?)\\\\))?',  // parenthetical info. parentheses not matched.\n      'g');\n\n  const data = [];\n  let match;\n\n  // Iterate and collect the version tuples.  Each iteration will be the\n  // next regex match.\n  while (match = versionRegExp.exec(userAgent)) {\n    data.push([\n      match[1],  // key\n      match[2],  // value\n      // || undefined as this is not undefined in IE7 and IE8\n      match[3] || undefined  // info\n    ]);\n  }\n\n  return data;\n}\n\nexports = {\n  ASSUME_CLIENT_HINTS_SUPPORT,\n  extractVersionTuples,\n  getNativeUserAgentString,\n  getUserAgent,\n  getUserAgentData,\n  matchUserAgent,\n  matchUserAgentDataBrand,\n  matchUserAgentIgnoreCase,\n  resetUserAgentData,\n  setUserAgent,\n  setUserAgentData,\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Useful compiler idioms.\n */\n\ngoog.provide('goog.reflect');\n\n\n/**\n * Syntax for object literal casts.\n * @see http://go/jscompiler-renaming\n * @see https://goo.gl/CRs09P\n *\n * Use this if you have an object literal whose keys need to have the same names\n * as the properties of some class even after they are renamed by the compiler.\n *\n * @param {!Function} type Type to cast to.\n * @param {Object} object Object literal to cast.\n * @return {Object} The object literal.\n */\ngoog.reflect.object = function(type, object) {\n  'use strict';\n  return object;\n};\n\n/**\n * Syntax for renaming property strings.\n * @see http://go/jscompiler-renaming\n * @see https://goo.gl/CRs09P\n *\n * Use this if you have an need to access a property as a string, but want\n * to also have the property renamed by the compiler. In contrast to\n * goog.reflect.object, this method takes an instance of an object.\n *\n * Properties must be simple names (not qualified names).\n *\n * @param {string} prop Name of the property\n * @param {!Object} object Instance of the object whose type will be used\n *     for renaming\n * @return {string} The renamed property.\n */\ngoog.reflect.objectProperty = function(prop, object) {\n  'use strict';\n  return prop;\n};\n\n/**\n * To assert to the compiler that an operation is needed when it would\n * otherwise be stripped. For example:\n * <code>\n *     // Force a layout\n *     goog.reflect.sinkValue(dialog.offsetHeight);\n * </code>\n * @param {T} x\n * @return {T}\n * @template T\n */\ngoog.reflect.sinkValue = function(x) {\n  'use strict';\n  goog.reflect.sinkValue[' '](x);\n  return x;\n};\n\n\n/**\n * The compiler should optimize this function away iff no one ever uses\n * goog.reflect.sinkValue.\n */\ngoog.reflect.sinkValue[' '] = function() {};\n\n\n/**\n * Check if a property can be accessed without throwing an exception.\n * @param {Object} obj The owner of the property.\n * @param {string} prop The property name.\n * @return {boolean} Whether the property is accessible. Will also return true\n *     if obj is null.\n */\ngoog.reflect.canAccessProperty = function(obj, prop) {\n  'use strict';\n  try {\n    goog.reflect.sinkValue(obj[prop]);\n    return true;\n  } catch (e) {\n  }\n  return false;\n};\n\n\n/**\n * Retrieves a value from a cache given a key. The compiler provides special\n * consideration for this call such that it is generally considered side-effect\n * free. However, if the `opt_keyFn` or `valueFn` have side-effects\n * then the entire call is considered to have side-effects.\n *\n * Conventionally storing the value on the cache would be considered a\n * side-effect and preclude unused calls from being pruned, ie. even if\n * the value was never used, it would still always be stored in the cache.\n *\n * Providing a side-effect free `valueFn` and `opt_keyFn`\n * allows unused calls to `goog.reflect.cache` to be pruned.\n *\n * @param {!Object<K, V>} cacheObj The object that contains the cached values.\n * @param {?} key The key to lookup in the cache. If it is not string or number\n *     then a `opt_keyFn` should be provided. The key is also used as the\n *     parameter to the `valueFn`.\n * @param {function(?):V} valueFn The value provider to use to calculate the\n *     value to store in the cache. This function should be side-effect free\n *     to take advantage of the optimization.\n * @param {function(?):K=} opt_keyFn The key provider to determine the cache\n *     map key. This should be used if the given key is not a string or number.\n *     If not provided then the given key is used. This function should be\n *     side-effect free to take advantage of the optimization.\n * @return {V} The cached or calculated value.\n * @template K\n * @template V\n */\ngoog.reflect.cache = function(cacheObj, key, valueFn, opt_keyFn) {\n  'use strict';\n  const storedKey = opt_keyFn ? opt_keyFn(key) : key;\n\n  if (Object.prototype.hasOwnProperty.call(cacheObj, storedKey)) {\n    return cacheObj[storedKey];\n  }\n\n  return (cacheObj[storedKey] = valueFn(key));\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Rendering engine detection.\n * @see <a href=\"http://www.useragentstring.com/\">User agent strings</a>\n * For information on the browser brand (such as Safari versus Chrome), see\n * goog.userAgent.product.\n * @see ../demos/useragent.html\n */\n\ngoog.provide('goog.userAgent');\n\ngoog.require('goog.labs.userAgent.browser');\ngoog.require('goog.labs.userAgent.engine');\ngoog.require('goog.labs.userAgent.platform');\ngoog.require('goog.labs.userAgent.util');\ngoog.require('goog.reflect');\ngoog.require('goog.string.internal');\n\n\n/**\n * @define {boolean} Whether we know at compile-time that the browser is IE.\n */\ngoog.userAgent.ASSUME_IE = goog.define('goog.userAgent.ASSUME_IE', false);\n\n\n/**\n * @define {boolean} Whether we know at compile-time that the browser is EDGE,\n * referring to EdgeHTML based Edge.\n */\ngoog.userAgent.ASSUME_EDGE = goog.define('goog.userAgent.ASSUME_EDGE', false);\n\n\n/**\n * @define {boolean} Whether we know at compile-time that the browser is GECKO.\n */\ngoog.userAgent.ASSUME_GECKO = goog.define('goog.userAgent.ASSUME_GECKO', false);\n\n\n/**\n * @define {boolean} Whether we know at compile-time that the browser is WEBKIT.\n */\ngoog.userAgent.ASSUME_WEBKIT =\n    goog.define('goog.userAgent.ASSUME_WEBKIT', false);\n\n\n/**\n * @define {boolean} Whether we know at compile-time that the browser is a\n *     mobile device running WebKit e.g. iPhone or Android.\n */\ngoog.userAgent.ASSUME_MOBILE_WEBKIT =\n    goog.define('goog.userAgent.ASSUME_MOBILE_WEBKIT', false);\n\n\n/**\n * @define {boolean} Whether we know at compile-time that the browser is OPERA,\n * referring to Presto-based Opera.\n */\ngoog.userAgent.ASSUME_OPERA = goog.define('goog.userAgent.ASSUME_OPERA', false);\n\n\n/**\n * @define {boolean} Whether the\n *     `goog.userAgent.isVersionOrHigher`\n *     function will return true for any version.\n */\ngoog.userAgent.ASSUME_ANY_VERSION =\n    goog.define('goog.userAgent.ASSUME_ANY_VERSION', false);\n\n\n/**\n * Whether we know the browser engine at compile-time.\n * @type {boolean}\n * @private\n */\ngoog.userAgent.BROWSER_KNOWN_ = goog.userAgent.ASSUME_IE ||\n    goog.userAgent.ASSUME_EDGE || goog.userAgent.ASSUME_GECKO ||\n    goog.userAgent.ASSUME_MOBILE_WEBKIT || goog.userAgent.ASSUME_WEBKIT ||\n    goog.userAgent.ASSUME_OPERA;\n\n\n/**\n * Returns the userAgent string for the current browser.\n *\n * @return {string} The userAgent string.\n */\ngoog.userAgent.getUserAgentString = function() {\n  'use strict';\n  return goog.labs.userAgent.util.getUserAgent();\n};\n\n\n/**\n * @return {?Navigator} The native navigator object.\n */\ngoog.userAgent.getNavigatorTyped = function() {\n  'use strict';\n  // Need a local navigator reference instead of using the global one,\n  // to avoid the rare case where they reference different objects.\n  // (in a WorkerPool, for example).\n  return goog.global['navigator'] || null;\n};\n\n\n/**\n * TODO(nnaze): Change type to \"Navigator\" and update compilation targets.\n * @return {?Object} The native navigator object.\n */\ngoog.userAgent.getNavigator = function() {\n  'use strict';\n  return goog.userAgent.getNavigatorTyped();\n};\n\n\n/**\n * Whether the user agent is Presto-based Opera.\n * @type {boolean}\n */\ngoog.userAgent.OPERA = goog.userAgent.BROWSER_KNOWN_ ?\n    goog.userAgent.ASSUME_OPERA :\n    goog.labs.userAgent.browser.isOpera();\n\n\n/**\n * Whether the user agent is Internet Explorer.\n * @type {boolean}\n */\ngoog.userAgent.IE = goog.userAgent.BROWSER_KNOWN_ ?\n    goog.userAgent.ASSUME_IE :\n    goog.labs.userAgent.browser.isIE();\n\n\n/**\n * Whether the user agent is Microsoft Edge (EdgeHTML based).\n * @type {boolean}\n */\ngoog.userAgent.EDGE = goog.userAgent.BROWSER_KNOWN_ ?\n    goog.userAgent.ASSUME_EDGE :\n    goog.labs.userAgent.engine.isEdge();\n\n\n/**\n * Whether the user agent is MS Internet Explorer or MS Edge (EdgeHTML based).\n * @type {boolean}\n */\ngoog.userAgent.EDGE_OR_IE = goog.userAgent.EDGE || goog.userAgent.IE;\n\n\n/**\n * Whether the user agent is Gecko. Gecko is the rendering engine used by\n * Mozilla, Firefox, and others.\n * @type {boolean}\n */\ngoog.userAgent.GECKO = goog.userAgent.BROWSER_KNOWN_ ?\n    goog.userAgent.ASSUME_GECKO :\n    goog.labs.userAgent.engine.isGecko();\n\n\n/**\n * Whether the user agent is WebKit. WebKit is the rendering engine that\n * Safari, Edge Chromium, Opera Chromium, Android and others use.\n * @type {boolean}\n */\ngoog.userAgent.WEBKIT = goog.userAgent.BROWSER_KNOWN_ ?\n    goog.userAgent.ASSUME_WEBKIT || goog.userAgent.ASSUME_MOBILE_WEBKIT :\n    goog.labs.userAgent.engine.isWebKit();\n\n\n/**\n * Whether the user agent is running on a mobile device.\n *\n * This is a separate function so that the logic can be tested.\n *\n * TODO(nnaze): Investigate swapping in goog.labs.userAgent.device.isMobile().\n *\n * @return {boolean} Whether the user agent is running on a mobile device.\n * @private\n */\ngoog.userAgent.isMobile_ = function() {\n  'use strict';\n  return goog.userAgent.WEBKIT &&\n      goog.labs.userAgent.util.matchUserAgent('Mobile');\n};\n\n\n/**\n * Whether the user agent is running on a mobile device.\n *\n * TODO(nnaze): Consider deprecating MOBILE when labs.userAgent\n *   is promoted as the gecko/webkit logic is likely inaccurate.\n *\n * @type {boolean}\n */\ngoog.userAgent.MOBILE =\n    goog.userAgent.ASSUME_MOBILE_WEBKIT || goog.userAgent.isMobile_();\n\n\n/**\n * Used while transitioning code to use WEBKIT instead.\n * @type {boolean}\n * @deprecated Use {@link goog.userAgent.product.SAFARI} instead.\n * TODO(nicksantos): Delete this from goog.userAgent.\n */\ngoog.userAgent.SAFARI = goog.userAgent.WEBKIT;\n\n\n/**\n * @return {string} the platform (operating system) the user agent is running\n *     on. Default to empty string because navigator.platform may not be defined\n *     (on Rhino, for example).\n * @private\n */\ngoog.userAgent.determinePlatform_ = function() {\n  'use strict';\n  var navigator = goog.userAgent.getNavigatorTyped();\n  return navigator && navigator.platform || '';\n};\n\n\n/**\n * The platform (operating system) the user agent is running on. Default to\n * empty string because navigator.platform may not be defined (on Rhino, for\n * example).\n * @type {string}\n */\ngoog.userAgent.PLATFORM = goog.userAgent.determinePlatform_();\n\n\n/**\n * @define {boolean} Whether the user agent is running on a Macintosh operating\n *     system.\n */\ngoog.userAgent.ASSUME_MAC = goog.define('goog.userAgent.ASSUME_MAC', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on a Windows operating\n *     system.\n */\ngoog.userAgent.ASSUME_WINDOWS =\n    goog.define('goog.userAgent.ASSUME_WINDOWS', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on a Linux operating\n *     system.\n */\ngoog.userAgent.ASSUME_LINUX = goog.define('goog.userAgent.ASSUME_LINUX', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on Android.\n */\ngoog.userAgent.ASSUME_ANDROID =\n    goog.define('goog.userAgent.ASSUME_ANDROID', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on an iPhone.\n */\ngoog.userAgent.ASSUME_IPHONE =\n    goog.define('goog.userAgent.ASSUME_IPHONE', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on an iPad.\n */\ngoog.userAgent.ASSUME_IPAD = goog.define('goog.userAgent.ASSUME_IPAD', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on an iPod.\n */\ngoog.userAgent.ASSUME_IPOD = goog.define('goog.userAgent.ASSUME_IPOD', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on KaiOS.\n */\ngoog.userAgent.ASSUME_KAIOS = goog.define('goog.userAgent.ASSUME_KAIOS', false);\n\n\n/**\n * @type {boolean}\n * @private\n */\ngoog.userAgent.PLATFORM_KNOWN_ = goog.userAgent.ASSUME_MAC ||\n    goog.userAgent.ASSUME_WINDOWS || goog.userAgent.ASSUME_LINUX ||\n    goog.userAgent.ASSUME_ANDROID || goog.userAgent.ASSUME_IPHONE ||\n    goog.userAgent.ASSUME_IPAD || goog.userAgent.ASSUME_IPOD;\n\n\n/**\n * Whether the user agent is running on a Macintosh operating system.\n * @type {boolean}\n */\ngoog.userAgent.MAC = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_MAC :\n    goog.labs.userAgent.platform.isMacintosh();\n\n\n/**\n * Whether the user agent is running on a Windows operating system.\n * @type {boolean}\n */\ngoog.userAgent.WINDOWS = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_WINDOWS :\n    goog.labs.userAgent.platform.isWindows();\n\n\n/**\n * Whether the user agent is Linux per the legacy behavior of\n * goog.userAgent.LINUX, which considered ChromeOS to also be\n * Linux.\n * @return {boolean}\n * @private\n */\ngoog.userAgent.isLegacyLinux_ = function() {\n  'use strict';\n  return goog.labs.userAgent.platform.isLinux() ||\n      goog.labs.userAgent.platform.isChromeOS();\n};\n\n\n/**\n * Whether the user agent is running on a Linux operating system.\n *\n * Note that goog.userAgent.LINUX considers ChromeOS to be Linux,\n * while goog.labs.userAgent.platform considers ChromeOS and\n * Linux to be different OSes.\n *\n * @type {boolean}\n */\ngoog.userAgent.LINUX = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_LINUX :\n    goog.userAgent.isLegacyLinux_();\n\n\n/**\n * Whether the user agent is running on Android.\n * @type {boolean}\n */\ngoog.userAgent.ANDROID = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_ANDROID :\n    goog.labs.userAgent.platform.isAndroid();\n\n\n/**\n * Whether the user agent is running on an iPhone.\n * @type {boolean}\n */\ngoog.userAgent.IPHONE = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_IPHONE :\n    goog.labs.userAgent.platform.isIphone();\n\n\n/**\n * Whether the user agent is running on an iPad.\n * @type {boolean}\n */\ngoog.userAgent.IPAD = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_IPAD :\n    goog.labs.userAgent.platform.isIpad();\n\n\n/**\n * Whether the user agent is running on an iPod.\n * @type {boolean}\n */\ngoog.userAgent.IPOD = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_IPOD :\n    goog.labs.userAgent.platform.isIpod();\n\n\n/**\n * Whether the user agent is running on iOS.\n * @type {boolean}\n */\ngoog.userAgent.IOS = goog.userAgent.PLATFORM_KNOWN_ ?\n    (goog.userAgent.ASSUME_IPHONE || goog.userAgent.ASSUME_IPAD ||\n     goog.userAgent.ASSUME_IPOD) :\n    goog.labs.userAgent.platform.isIos();\n\n/**\n * Whether the user agent is running on KaiOS.\n * @type {boolean}\n */\ngoog.userAgent.KAIOS = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_KAIOS :\n    goog.labs.userAgent.platform.isKaiOS();\n\n\n/**\n * @return {string} The string that describes the version number of the user\n *     agent.\n * @private\n */\ngoog.userAgent.determineVersion_ = function() {\n  'use strict';\n  // All browsers have different ways to detect the version and they all have\n  // different naming schemes.\n  // version is a string rather than a number because it may contain 'b', 'a',\n  // and so on.\n  var version = '';\n  var arr = goog.userAgent.getVersionRegexResult_();\n  if (arr) {\n    version = arr ? arr[1] : '';\n  }\n\n  if (goog.userAgent.IE) {\n    // IE9 can be in document mode 9 but be reporting an inconsistent user agent\n    // version.  If it is identifying as a version lower than 9 we take the\n    // documentMode as the version instead.  IE8 has similar behavior.\n    // It is recommended to set the X-UA-Compatible header to ensure that IE9\n    // uses documentMode 9.\n    var docMode = goog.userAgent.getDocumentMode_();\n    if (docMode != null && docMode > parseFloat(version)) {\n      return String(docMode);\n    }\n  }\n\n  return version;\n};\n\n\n/**\n * @return {?IArrayLike<string>|undefined} The version regex matches from\n *     parsing the user\n *     agent string. These regex statements must be executed inline so they can\n *     be compiled out by the closure compiler with the rest of the useragent\n *     detection logic when ASSUME_* is specified.\n * @private\n */\ngoog.userAgent.getVersionRegexResult_ = function() {\n  'use strict';\n  var userAgent = goog.userAgent.getUserAgentString();\n  if (goog.userAgent.GECKO) {\n    return /rv\\:([^\\);]+)(\\)|;)/.exec(userAgent);\n  }\n  if (goog.userAgent.EDGE) {\n    return /Edge\\/([\\d\\.]+)/.exec(userAgent);\n  }\n  if (goog.userAgent.IE) {\n    return /\\b(?:MSIE|rv)[: ]([^\\);]+)(\\)|;)/.exec(userAgent);\n  }\n  if (goog.userAgent.WEBKIT) {\n    // WebKit/125.4\n    return /WebKit\\/(\\S+)/.exec(userAgent);\n  }\n  if (goog.userAgent.OPERA) {\n    // If none of the above browsers were detected but the browser is Opera, the\n    // only string that is of interest is 'Version/<number>'.\n    return /(?:Version)[ \\/]?(\\S+)/.exec(userAgent);\n  }\n  return undefined;\n};\n\n\n/**\n * @return {number|undefined} Returns the document mode (for testing).\n * @private\n */\ngoog.userAgent.getDocumentMode_ = function() {\n  'use strict';\n  // NOTE(user): goog.userAgent may be used in context where there is no DOM.\n  var doc = goog.global['document'];\n  return doc ? doc['documentMode'] : undefined;\n};\n\n\n/**\n * The version of the user agent. This is a string because it might contain\n * 'b' (as in beta) as well as multiple dots.\n * @type {string}\n */\ngoog.userAgent.VERSION = goog.userAgent.determineVersion_();\n\n\n/**\n * Compares two version numbers.\n *\n * @param {string} v1 Version of first item.\n * @param {string} v2 Version of second item.\n *\n * @return {number}  1 if first argument is higher\n *                   0 if arguments are equal\n *                  -1 if second argument is higher.\n * @deprecated Use goog.string.compareVersions.\n */\ngoog.userAgent.compare = function(v1, v2) {\n  'use strict';\n  return goog.string.internal.compareVersions(v1, v2);\n};\n\n\n/**\n * Cache for {@link goog.userAgent.isVersionOrHigher}.\n * Calls to compareVersions are surprisingly expensive and, as a browser's\n * version number is unlikely to change during a session, we cache the results.\n * @const\n * @private\n */\ngoog.userAgent.isVersionOrHigherCache_ = {};\n\n\n/**\n * Whether the user agent version is higher or the same as the given version.\n * NOTE: When checking the version numbers for Firefox and Safari, be sure to\n * use the engine's version, not the browser's version number.  For example,\n * Firefox 3.0 corresponds to Gecko 1.9 and Safari 3.0 to Webkit 522.11.\n * Opera and Internet Explorer versions match the product release number.<br>\n * @see <a href=\"http://en.wikipedia.org/wiki/Safari_version_history\">\n *     Webkit</a>\n * @see <a href=\"http://en.wikipedia.org/wiki/Gecko_engine\">Gecko</a>\n *\n * @param {string|number} version The version to check.\n * @return {boolean} Whether the user agent version is higher or the same as\n *     the given version.\n */\ngoog.userAgent.isVersionOrHigher = function(version) {\n  'use strict';\n  return goog.userAgent.ASSUME_ANY_VERSION ||\n      goog.reflect.cache(\n          goog.userAgent.isVersionOrHigherCache_, version, function() {\n            'use strict';\n            return goog.string.internal.compareVersions(\n                       goog.userAgent.VERSION, version) >= 0;\n          });\n};\n\n\n/**\n * Whether the IE effective document mode is higher or the same as the given\n * document mode version.\n * NOTE: Only for IE, return false for another browser.\n *\n * @param {number} documentMode The document mode version to check.\n * @return {boolean} Whether the IE effective document mode is higher or the\n *     same as the given version.\n */\ngoog.userAgent.isDocumentModeOrHigher = function(documentMode) {\n  'use strict';\n  return Number(goog.userAgent.DOCUMENT_MODE) >= documentMode;\n};\n\n\n/**\n * Deprecated alias to `goog.userAgent.isDocumentModeOrHigher`.\n * @param {number} version The version to check.\n * @return {boolean} Whether the IE effective document mode is higher or the\n *      same as the given version.\n * @deprecated Use goog.userAgent.isDocumentModeOrHigher().\n */\ngoog.userAgent.isDocumentMode = goog.userAgent.isDocumentModeOrHigher;\n\n\n/**\n * For IE version < 7, documentMode is undefined, so attempt to use the\n * CSS1Compat property to see if we are in standards mode. If we are in\n * standards mode, treat the browser version as the document mode. Otherwise,\n * IE is emulating version 5.\n *\n * NOTE(user): Support for IE < 7 is long gone, so this is now simplified.\n * It returns document.documentMode for IE and undefined for everything else.\n *\n * @type {number|undefined}\n * @const\n */\ngoog.userAgent.DOCUMENT_MODE = (function() {\n  'use strict';\n  var doc = goog.global['document'];\n  if (!doc || !goog.userAgent.IE) return undefined;\n  // This must be an IE user agent.\n  var documentMode = goog.userAgent.getDocumentMode_();\n  if (documentMode) return documentMode;\n  // The user agent version string begins with the major version.\n  // Parse the major version and truncate anything following.\n  var ieVersion = parseInt(goog.userAgent.VERSION, 10);\n  return ieVersion || undefined;\n})();\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Closure user agent detection (Browser).\n * @see <a href=\"http://www.useragentstring.com/\">User agent strings</a>\n * For more information on rendering engine, platform, or device see the other\n * sub-namespaces in goog.labs.userAgent, goog.labs.userAgent.platform,\n * goog.labs.userAgent.device respectively.)\n */\n\ngoog.module('goog.labs.userAgent.browser');\ngoog.module.declareLegacyNamespace();\n\nconst util = goog.require('goog.labs.userAgent.util');\nconst {AsyncValue, Version} = goog.require('goog.labs.userAgent.highEntropy.highEntropyValue');\nconst {ChromiumRebrand} = goog.require('goog.labs.userAgent.chromiumRebrands');\nconst {assert, assertExists} = goog.require('goog.asserts');\nconst {compareVersions} = goog.require('goog.string.internal');\nconst {fullVersionList} = goog.require('goog.labs.userAgent.highEntropy.highEntropyData');\nconst {useClientHints} = goog.require('goog.labs.userAgent');\n\n// TODO(nnaze): Refactor to remove excessive exclusion logic in matching\n// functions.\n\n/**\n * A browser brand represents an opaque string that is used for making\n * brand-specific version checks in userAgentData.\n * @enum {string}\n */\nconst Brand = {\n  /**\n   * The browser brand for Android Browser.\n   * Do not depend on the value of this string. Because Android Browser has not\n   * implemented userAgentData yet, the value of this string is not guaranteed\n   * to stay the same in future revisions.\n   */\n  ANDROID_BROWSER: 'Android Browser',\n  /**\n   * The browser brand for Chromium, including Chromium-based Edge and Opera.\n   */\n  CHROMIUM: 'Chromium',\n  /**\n   * The browser brand for Edge.\n   * This brand can be used to get the version of both EdgeHTML and\n   * Chromium-based Edge.\n   */\n  EDGE: 'Microsoft Edge',\n  /**\n   * The browser brand for Firefox.\n   * Do not depend on the value of this string. Because Firefox has not\n   * implemented userAgentData yet, the value of this string is not guaranteed\n   * to stay the same in future revisions.\n   */\n  FIREFOX: 'Firefox',\n  /**\n   * The browser brand for Internet Explorer.\n   * Do not depend on the value of this string. Because IE will never support\n   * userAgentData, the value of this string should be treated as opaque (it's\n   * used internally for legacy-userAgent fallback).\n   */\n  IE: 'Internet Explorer',\n  /**\n   * The browser brand for Opera.\n   * This brand can be used to get the version of both Presto- and\n   * Chromium-based Opera.\n   */\n  OPERA: 'Opera',\n  /**\n   * The browser brand for Safari.\n   * Do not depend on the value of this string. Because Safari has not\n   * implemented userAgentData yet, the value of this string is not guaranteed\n   * to stay the same in future revisions.\n   */\n  SAFARI: 'Safari',\n  /**\n   * The browser brand for Silk.\n   * See\n   * https://docs.aws.amazon.com/silk/latest/developerguide/what-is-silk.html\n   * Do not depend on the value of this string. Because Silk does not\n   * identify itself in userAgentData yet, the value of this string is not\n   * guaranteed to stay the same in future revisions.\n   */\n  SILK: 'Silk',\n};\nexports.Brand = Brand;\n\n/** @typedef {(!Brand|!ChromiumRebrand)} */\nlet AllBrandsInternal;\n\n/**\n * All possible valid values to pass to various UACH Brand-accepting functions.\n * @typedef {(!Brand|!ChromiumRebrand)}\n */\nexports.AllBrands;\n\n/**\n * @param {boolean=} ignoreClientHintsFlag Iff truthy, the `useClientHints`\n *     function will not be called when evaluating if User-Agent Client Hints\n *     Brand data can be used. For existing labs.userAgent API surfaces with\n *     widespread use, this should be a falsy value so that usage of the Client\n *     Hints APIs can be gated behind flags / experiment rollouts.\n * @return {boolean} Whether to use navigator.userAgentData to determine\n * browser's brand.\n */\nfunction useUserAgentDataBrand(ignoreClientHintsFlag = false) {\n  if (util.ASSUME_CLIENT_HINTS_SUPPORT) return true;\n  // High-entropy API surfaces should not be gated behind the useClientHints\n  // check (as in production it is gated behind a define).\n  if (!ignoreClientHintsFlag && !useClientHints()) return false;\n  const userAgentData = util.getUserAgentData();\n  return !!userAgentData && userAgentData.brands.length > 0;\n}\n\n/**\n * @return {boolean} Whether this browser is likely to have the fullVersionList\n * high-entropy Client Hint.\n */\nfunction hasFullVersionList() {\n  // https://chromiumdash.appspot.com/commits?commit=1eb643c3057e64ff4d22468432ad16c4cab12879&platform=Linux\n  // indicates that for all platforms Chromium 98 shipped this feature.\n  // See also\n  // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Full-Version-List#browser_compatibility\n  return isAtLeast(Brand.CHROMIUM, 98);\n}\n\n/**\n * @return {boolean} Whether the user's browser is Opera. Note: Chromium based\n *     Opera (Opera 15+) is detected as Chrome to avoid unnecessary special\n *     casing.\n */\nfunction matchOpera() {\n  if (useUserAgentDataBrand()) {\n    // Pre-Chromium Edge doesn't support navigator.userAgentData.\n    return false;\n  }\n  return util.matchUserAgent('Opera');\n}\n\n/** @return {boolean} Whether the user's browser is IE. */\nfunction matchIE() {\n  if (useUserAgentDataBrand()) {\n    // IE doesn't support navigator.userAgentData.\n    return false;\n  }\n  return util.matchUserAgent('Trident') || util.matchUserAgent('MSIE');\n}\n\n/**\n * @return {boolean} Whether the user's browser is Edge. This refers to\n *     EdgeHTML based Edge.\n */\nfunction matchEdgeHtml() {\n  if (useUserAgentDataBrand()) {\n    // Pre-Chromium Edge doesn't support navigator.userAgentData.\n    return false;\n  }\n  return util.matchUserAgent('Edge');\n}\n\n/** @return {boolean} Whether the user's browser is Chromium based Edge. */\nfunction matchEdgeChromium() {\n  if (useUserAgentDataBrand()) {\n    return util.matchUserAgentDataBrand(Brand.EDGE);\n  }\n  return util.matchUserAgent('Edg/');\n}\n\n/** @return {boolean} Whether the user's browser is Chromium based Opera. */\nfunction matchOperaChromium() {\n  if (useUserAgentDataBrand()) {\n    return util.matchUserAgentDataBrand(Brand.OPERA);\n  }\n  return util.matchUserAgent('OPR');\n}\n\n/** @return {boolean} Whether the user's browser is Firefox. */\nfunction matchFirefox() {\n  // Firefox doesn't support navigator.userAgentData yet, so use\n  // navigator.userAgent.\n  return util.matchUserAgent('Firefox') || util.matchUserAgent('FxiOS');\n}\n\n/** @return {boolean} Whether the user's browser is Safari. */\nfunction matchSafari() {\n  // Apple-based browsers don't support navigator.userAgentData yet, so use\n  // navigator.userAgent.\n  return util.matchUserAgent('Safari') &&\n      !(matchChrome() || matchCoast() || matchOpera() || matchEdgeHtml() ||\n        matchEdgeChromium() || matchOperaChromium() || matchFirefox() ||\n        isSilk() || util.matchUserAgent('Android'));\n}\n\n/**\n * @return {boolean} Whether the user's browser is Coast (Opera's Webkit-based\n *     iOS browser).\n */\nfunction matchCoast() {\n  if (useUserAgentDataBrand()) {\n    // Coast doesn't support navigator.userAgentData.\n    return false;\n  }\n  return util.matchUserAgent('Coast');\n}\n\n/** @return {boolean} Whether the user's browser is iOS Webview. */\nfunction matchIosWebview() {\n  // Apple-based browsers don't support navigator.userAgentData yet, so use\n  // navigator.userAgent.\n  // iOS Webview does not show up as Chrome or Safari.\n  return (util.matchUserAgent('iPad') || util.matchUserAgent('iPhone')) &&\n      !matchSafari() && !matchChrome() && !matchCoast() && !matchFirefox() &&\n      util.matchUserAgent('AppleWebKit');\n}\n\n/**\n * @return {boolean} Whether the user's browser is any Chromium browser. This\n *     returns true for Chrome, Opera 15+, and Edge Chromium.\n */\nfunction matchChrome() {\n  if (useUserAgentDataBrand()) {\n    return util.matchUserAgentDataBrand(Brand.CHROMIUM);\n  }\n  return ((util.matchUserAgent('Chrome') || util.matchUserAgent('CriOS')) &&\n          !matchEdgeHtml()) ||\n      isSilk();\n}\n\n/** @return {boolean} Whether the user's browser is the Android browser. */\nfunction matchAndroidBrowser() {\n  // Android can appear in the user agent string for Chrome on Android.\n  // This is not the Android standalone browser if it does.\n  return util.matchUserAgent('Android') &&\n      !(isChrome() || isFirefox() || isOpera() || isSilk());\n}\n\n/** @return {boolean} Whether the user's browser is Opera. */\nconst isOpera = matchOpera;\nexports.isOpera = isOpera;\n\n/** @return {boolean} Whether the user's browser is IE. */\nconst isIE = matchIE;\nexports.isIE = isIE;\n\n/** @return {boolean} Whether the user's browser is EdgeHTML based Edge. */\nconst isEdge = matchEdgeHtml;\nexports.isEdge = isEdge;\n\n/** @return {boolean} Whether the user's browser is Chromium based Edge. */\nconst isEdgeChromium = matchEdgeChromium;\nexports.isEdgeChromium = isEdgeChromium;\n\n/** @return {boolean} Whether the user's browser is Chromium based Opera. */\nconst isOperaChromium = matchOperaChromium;\nexports.isOperaChromium = isOperaChromium;\n\n/** @return {boolean} Whether the user's browser is Firefox. */\nconst isFirefox = matchFirefox;\nexports.isFirefox = isFirefox;\n\n/** @return {boolean} Whether the user's browser is Safari. */\nconst isSafari = matchSafari;\nexports.isSafari = isSafari;\n\n/**\n * @return {boolean} Whether the user's browser is Coast (Opera's Webkit-based\n *     iOS browser).\n */\nconst isCoast = matchCoast;\nexports.isCoast = isCoast;\n\n/** @return {boolean} Whether the user's browser is iOS Webview. */\nconst isIosWebview = matchIosWebview;\nexports.isIosWebview = isIosWebview;\n\n/**\n * @return {boolean} Whether the user's browser is any Chromium based browser (\n *     Chrome, Blink-based Opera (15+) and Edge Chromium).\n */\nconst isChrome = matchChrome;\nexports.isChrome = isChrome;\n\n/** @return {boolean} Whether the user's browser is the Android browser. */\nconst isAndroidBrowser = matchAndroidBrowser;\nexports.isAndroidBrowser = isAndroidBrowser;\n\n/**\n * For more information, see:\n * http://docs.aws.amazon.com/silk/latest/developerguide/user-agent.html\n * @return {boolean} Whether the user's browser is Silk.\n */\nfunction isSilk() {\n  // As of Silk 93, Silk does not identify itself in userAgentData.brands.\n  // When Silk changes this behavior, update this method to call\n  // matchUserAgentDataBrand (akin to isChrome, etc.)\n  return util.matchUserAgent('Silk');\n}\nexports.isSilk = isSilk;\n\n/**\n * A helper function that returns a function mapping a list of candidate\n * version tuple keys to the first version string present under a key.\n * Ex:\n * <code>\n * // Arg extracted from \"Foo/1.2.3 Bar/0.2021\"\n * const mapVersion = createVersionMap([[\"Foo\", \"1.2.3\"], [\"Bar\", \"0.2021\"]]);\n * mapVersion([\"Bar\", \"Foo\"]); // returns \"0.2021\"\n * mapVersion([\"Baz\", \"Foo\"]); // returns \"1.2.3\"\n * mapVersion([\"Baz\", \"???\"]); // returns \"\"\n * </code>\n * @param {!Array<!Array<string>>} versionTuples Version tuples pre-extracted\n *     from a user agent string.\n * @return {function(!Array<string>): string} The version string, or empty\n * string if it doesn't exist under the given key.\n */\nfunction createVersionMap(versionTuples) {\n  // Construct a map for easy lookup.\n  const versionMap = {};\n  versionTuples.forEach((tuple) => {\n    // Note that the tuple is of length three, but we only care about the\n    // first two.\n    const key = tuple[0];\n    const value = tuple[1];\n    versionMap[key] = value;\n  });\n\n  // Gives the value with the first key it finds, otherwise empty string.\n  return (keys) => versionMap[keys.find((key) => key in versionMap)] || '';\n}\n\n/**\n * Returns the browser version.\n *\n * Note that for browsers with multiple brands, this function assumes a primary\n * brand and returns the version for that brand.\n *\n * Additionally, this function is not userAgentData-aware and will return\n * incorrect values when the User Agent string is frozen. The current status of\n * User Agent string freezing is available here:\n * https://www.chromestatus.com/feature/5704553745874944\n *\n * To mitigate both of these potential issues, use\n * getVersionStringForLogging() or fullVersionOf() instead.\n *\n * @return {string} The browser version or empty string if version cannot be\n *     determined. Note that for Internet Explorer, this returns the version of\n *     the browser, not the version of the rendering engine. (IE 8 in\n *     compatibility mode will return 8.0 rather than 7.0. To determine the\n *     rendering engine version, look at document.documentMode instead. See\n *     http://msdn.microsoft.com/en-us/library/cc196988(v=vs.85).aspx for more\n *     details.)\n */\nfunction getVersion() {\n  const userAgentString = util.getUserAgent();\n\n  // Special case IE since IE's version is inside the parenthesis and\n  // without the '/'.\n  if (isIE()) {\n    return getIEVersion(userAgentString);\n  }\n\n  const versionTuples = util.extractVersionTuples(userAgentString);\n  const lookUpValueWithKeys = createVersionMap(versionTuples);\n\n  // Check Opera before Chrome since Opera 15+ has \"Chrome\" in the string.\n  // See\n  // http://my.opera.com/ODIN/blog/2013/07/15/opera-user-agent-strings-opera-15-and-beyond\n  if (isOpera()) {\n    // Opera 10 has Version/10.0 but Opera/9.8, so look for \"Version\" first.\n    // Opera uses 'OPR' for more recent UAs.\n    return lookUpValueWithKeys(['Version', 'Opera']);\n  }\n\n  // Check Edge before Chrome since it has Chrome in the string.\n  if (isEdge()) {\n    return lookUpValueWithKeys(['Edge']);\n  }\n\n  // Check Chromium Edge before Chrome since it has Chrome in the string.\n  if (isEdgeChromium()) {\n    return lookUpValueWithKeys(['Edg']);\n  }\n\n  // Check Silk before Chrome since it may have Chrome in its string and be\n  // treated as Chrome.\n  if (isSilk()) {\n    return lookUpValueWithKeys(['Silk']);\n  }\n\n  if (isChrome()) {\n    return lookUpValueWithKeys(['Chrome', 'CriOS', 'HeadlessChrome']);\n  }\n\n  // Usually products browser versions are in the third tuple after \"Mozilla\"\n  // and the engine.\n  const tuple = versionTuples[2];\n  return tuple && tuple[1] || '';\n}\nexports.getVersion = getVersion;\n\n/**\n * Returns whether the current browser's version is at least as high as the\n * given one.\n *\n * Note that for browsers with multiple brands, this function assumes a primary\n * brand and checks the version for that brand.\n *\n * Additionally, this function is not userAgentData-aware and will return\n * incorrect values when the User Agent string is frozen. The current status of\n * User Agent string freezing is available here:\n * https://www.chromestatus.com/feature/5704553745874944\n *\n * To mitigate both of these potential issues, use isAtLeast()/isAtMost() or\n * fullVersionOf() instead.\n *\n * @param {string|number} version The version to check.\n * @return {boolean} Whether the browser version is higher or the same as the\n *     given version.\n * @deprecated Use isAtLeast()/isAtMost() instead.\n */\nfunction isVersionOrHigher(version) {\n  return compareVersions(getVersion(), version) >= 0;\n}\nexports.isVersionOrHigher = isVersionOrHigher;\n\n/**\n * A helper function to determine IE version. More information:\n * http://msdn.microsoft.com/en-us/library/ie/bg182625(v=vs.85).aspx#uaString\n * http://msdn.microsoft.com/en-us/library/hh869301(v=vs.85).aspx\n * http://blogs.msdn.com/b/ie/archive/2010/03/23/introducing-ie9-s-user-agent-string.aspx\n * http://blogs.msdn.com/b/ie/archive/2009/01/09/the-internet-explorer-8-user-agent-string-updated-edition.aspx\n * @param {string} userAgent the User-Agent.\n * @return {string}\n */\nfunction getIEVersion(userAgent) {\n  // IE11 may identify itself as MSIE 9.0 or MSIE 10.0 due to an IE 11 upgrade\n  // bug. Example UA:\n  // Mozilla/5.0 (MSIE 9.0; Windows NT 6.1; WOW64; Trident/7.0; rv:11.0)\n  // like Gecko.\n  // See http://www.whatismybrowser.com/developers/unknown-user-agent-fragments.\n  const rv = /rv: *([\\d\\.]*)/.exec(userAgent);\n  if (rv && rv[1]) {\n    return rv[1];\n  }\n\n  let version = '';\n  const msie = /MSIE +([\\d\\.]+)/.exec(userAgent);\n  if (msie && msie[1]) {\n    // IE in compatibility mode usually identifies itself as MSIE 7.0; in this\n    // case, use the Trident version to determine the version of IE. For more\n    // details, see the links above.\n    const tridentVersion = /Trident\\/(\\d.\\d)/.exec(userAgent);\n    if (msie[1] == '7.0') {\n      if (tridentVersion && tridentVersion[1]) {\n        switch (tridentVersion[1]) {\n          case '4.0':\n            version = '8.0';\n            break;\n          case '5.0':\n            version = '9.0';\n            break;\n          case '6.0':\n            version = '10.0';\n            break;\n          case '7.0':\n            version = '11.0';\n            break;\n        }\n      } else {\n        version = '7.0';\n      }\n    } else {\n      version = msie[1];\n    }\n  }\n  return version;\n}\n\n/**\n * A helper function to return the navigator.userAgent-supplied full version\n * number of the current browser or an empty string, based on whether the\n * current browser is the one specified.\n * @param {string} browser The brand whose version should be returned.\n * @return {string}\n */\nfunction getFullVersionFromUserAgentString(browser) {\n  const userAgentString = util.getUserAgent();\n  // Special case IE since IE's version is inside the parenthesis and\n  // without the '/'.\n  if (browser === Brand.IE) {\n    return isIE() ? getIEVersion(userAgentString) : '';\n  }\n\n  const versionTuples = util.extractVersionTuples(userAgentString);\n  const lookUpValueWithKeys = createVersionMap(versionTuples);\n  switch (browser) {\n    case Brand.OPERA:\n      // Opera 10 has Version/10.0 but Opera/9.8, so look for \"Version\"\n      // first. Opera uses 'OPR' for more recent UAs.\n      if (isOpera()) {\n        return lookUpValueWithKeys(['Version', 'Opera']);\n      } else if (isOperaChromium()) {\n        return lookUpValueWithKeys(['OPR']);\n      }\n      break;\n    case Brand.EDGE:\n      if (isEdge()) {\n        return lookUpValueWithKeys(['Edge']);\n      } else if (isEdgeChromium()) {\n        return lookUpValueWithKeys(['Edg']);\n      }\n      break;\n    case Brand.CHROMIUM:\n      if (isChrome()) {\n        return lookUpValueWithKeys(['Chrome', 'CriOS', 'HeadlessChrome']);\n      }\n      break;\n  }\n\n  // For the following browsers, the browser version is in the third tuple after\n  // \"Mozilla\" and the engine.\n  if ((browser === Brand.FIREFOX && isFirefox()) ||\n      (browser === Brand.SAFARI && isSafari()) ||\n      (browser === Brand.ANDROID_BROWSER && isAndroidBrowser()) ||\n      (browser === Brand.SILK && isSilk())) {\n    const tuple = versionTuples[2];\n    return tuple && tuple[1] || '';\n  }\n\n  return '';\n}\n\n/**\n * Returns the major version of the given browser brand, or NaN if the current\n * browser is not the given brand.\n * Note that the major version number may be different depending on which\n * browser is specified. The returned value can be used to make browser version\n * comparisons using comparison operators.\n * @private\n * @param {!AllBrandsInternal} browser The brand whose version should be\n *     returned.\n * @return {number} The major version number associated with the current\n * browser under the given brand, or NaN if the current browser doesn't match\n * the given brand.\n */\nfunction versionOf_(browser) {\n  let versionParts;\n  // Silk currently does not identify itself in its userAgentData.brands array,\n  // so if checking its version, always fall back to the user agent string.\n  if (useUserAgentDataBrand() && browser !== Brand.SILK) {\n    const data = util.getUserAgentData();\n    const matchingBrand = data.brands.find(({brand}) => brand === browser);\n    if (!matchingBrand || !matchingBrand.version) {\n      return NaN;\n    }\n    versionParts = matchingBrand.version.split('.');\n  } else {\n    const fullVersion = getFullVersionFromUserAgentString(browser);\n    if (fullVersion === '') {\n      return NaN;\n    }\n    versionParts = fullVersion.split('.');\n  }\n  if (versionParts.length === 0) {\n    return NaN;\n  }\n  const majorVersion = versionParts[0];\n  return Number(majorVersion);  // Returns NaN if it is not parseable.\n}\n\n/**\n * Returns true if the current browser matches the given brand and is at least\n * the given major version. The major version must be a whole number (i.e.\n * decimals should not be used to represent a minor version).\n * @param {!AllBrandsInternal} brand The brand whose version should be returned.\n * @param {number} majorVersion The major version number to compare against.\n *     This must be a whole number.\n * @return {boolean} Whether the current browser both matches the given brand\n *     and is at least the given version.\n */\nfunction isAtLeast(brand, majorVersion) {\n  assert(\n      Math.floor(majorVersion) === majorVersion,\n      'Major version must be an integer');\n  return versionOf_(brand) >= majorVersion;\n}\nexports.isAtLeast = isAtLeast;\n\n/**\n * Returns true if the current browser matches the given brand and is at most\n * the given version. The major version must be a whole number (i.e. decimals\n * should not be used to represent a minor version).\n * @param {!AllBrandsInternal} brand The brand whose version should be returned.\n * @param {number} majorVersion The major version number to compare against.\n *     This must be a whole number.\n * @return {boolean} Whether the current browser both matches the given brand\n *     and is at most the given version.\n */\nfunction isAtMost(brand, majorVersion) {\n  assert(\n      Math.floor(majorVersion) === majorVersion,\n      'Major version must be an integer');\n  return versionOf_(brand) <= majorVersion;\n}\nexports.isAtMost = isAtMost;\n\n/**\n * Loads the high-entropy browser brand/version data and wraps the correct\n * version string in a Version object.\n * @implements {AsyncValue<!Version>}\n */\nclass HighEntropyBrandVersion {\n  /**\n   * @param {string} brand The brand whose version is retrieved in this\n   *     container.\n   * @param {boolean} useUach Whether to attempt to use the User-Agent Client\n   *     Hints (UACH) API surface.\n   * @param {string} fallbackVersion The fallback version derived from the\n   *     userAgent string.\n   */\n  constructor(brand, useUach, fallbackVersion) {\n    /** @private @const {string} */\n    this.brand_ = brand;\n\n    /** @private @const {!Version} */\n    this.version_ = new Version(fallbackVersion);\n\n    /** @private @const {boolean} */\n    this.useUach_ = useUach;\n  }\n\n  /**\n   * @return {!Version|undefined}\n   * @override\n   */\n  getIfLoaded() {\n    if (this.useUach_) {\n      const loadedVersionList = fullVersionList.getIfLoaded();\n      if (loadedVersionList !== undefined) {\n        const matchingBrand =\n            loadedVersionList.find(({brand}) => this.brand_ === brand);\n        // We assumed in fullVersionOf that if the fullVersionList is defined\n        // the brands must match. Double-check this here.\n        assertExists(matchingBrand);\n        return new Version(matchingBrand.version);\n      }\n      // Fallthrough to fallback on Pre-UACH implementation\n    }\n    // We want to make sure the loading semantics of the Pre-UACH implementation\n    // match those of the UACH implementation. Loading must happen before any\n    // data can be retrieved from getIfLoaded.\n    // For HighEntropyBrandVersion, loading can either be done by calling #load\n    // or by calling the module-local loadFullVersions function.\n    if (preUachHasLoaded) {\n      return this.version_;\n    }\n    return;\n  }\n\n  /**\n   * @return {!Promise<!Version>}\n   * @override\n   */\n  async load() {\n    if (this.useUach_) {\n      const loadedVersionList = await fullVersionList.load();\n      if (loadedVersionList !== undefined) {\n        const matchingBrand =\n            loadedVersionList.find(({brand}) => this.brand_ === brand);\n        assertExists(matchingBrand);\n        return new Version(matchingBrand.version);\n      }\n      // Fallthrough to fallback on Pre-UACH implementation\n    } else {\n      // Await something so that calling load with or without UACH API\n      // availability results in waiting at least one macrotask before allowing\n      // access to the cached version information.\n      await 0;\n    }\n    // Regardless of whether we are using UACH APIs, we can now allow access to\n    // the fallback case\n    preUachHasLoaded = true;\n    return this.version_;\n  }\n}\n\n/**\n * Whether full version data should be considered available when using UACH\n * fallback implementations. This is flipped to true when either\n * loadFullVersions or HighEntropyBrandVersion.prototype.load are called,\n * matching the global singleton semantics of the UACH codepaths.\n */\nlet preUachHasLoaded = false;\n\n/**\n * Requests all full browser versions to be cached.  When the returned promise\n * resolves, subsequent calls to `fullVersionOf(...).getIfLoaded()` will return\n * a value.\n *\n * This method should be avoided in favor of directly awaiting\n * `fullVersionOf(...).load()` where it is used.\n *\n * @return {!Promise<void>}\n */\nasync function loadFullVersions() {\n  if (useUserAgentDataBrand(true)) {\n    await fullVersionList.load();\n  }\n  preUachHasLoaded = true;\n}\nexports.loadFullVersions = loadFullVersions;\n\n/**\n * Resets module-local caches used by functionality in this module.\n * This is only for use by goog.labs.userAgent.testUtil.resetUserAgent (and\n * labs.userAgent tests).\n * @package\n */\nexports.resetForTesting = () => {\n  preUachHasLoaded = false;\n  fullVersionList.resetForTesting();\n};\n\n\n/**\n * Returns an object that provides access to the full version string of the\n * current browser -- or undefined, based on whether the current browser matches\n * the requested browser brand. Note that the full version string is a\n * high-entropy value, and must be asynchronously loaded before it can be\n * accessed synchronously.\n * @param {!AllBrandsInternal} browser The brand whose version should be\n *     returned.\n * @return {!AsyncValue<!Version>|undefined} An object that can be used\n *     to get or load the full version string as a high-entropy value, or\n * undefined if the current browser doesn't match the given brand.\n */\nfunction fullVersionOf(browser) {\n  let fallbackVersionString = '';\n  // If we are reasonably certain now that the browser we are on has the\n  // fullVersionList high-entropy hint, then we can skip computing the fallback\n  // value as we won't end up using it.\n  if (!hasFullVersionList()) {\n    fallbackVersionString = getFullVersionFromUserAgentString(browser);\n  }\n  // Silk has the UACH API surface, but currently does not identify itself in\n  // the userAgentData.brands array. Fallback to using userAgent string version\n  // for Silk.\n  const useUach = browser !== Brand.SILK && useUserAgentDataBrand(true);\n  if (useUach) {\n    const data = util.getUserAgentData();\n    // Operate under the assumption that the low-entropy and high-entropy lists\n    // of brand/version pairs contain an identical set of brands. Therefore, if\n    // the low-entropy list doesn't contain the given brand, return undefined.\n    if (!data.brands.find(({brand}) => brand === browser)) {\n      return undefined;\n    }\n  } else if (fallbackVersionString === '') {\n    return undefined;\n  }\n  return new HighEntropyBrandVersion(browser, useUach, fallbackVersionString);\n}\nexports.fullVersionOf = fullVersionOf;\n\n\n/**\n * Returns a version string for the current browser or undefined, based on\n * whether the current browser is the one specified.\n * This value should ONLY be used for logging/debugging purposes. Do not use it\n * to branch code paths. For comparing versions, use isAtLeast()/isAtMost() or\n * fullVersionOf() instead.\n * @param {!AllBrandsInternal} browser The brand whose version should be\n *     returned.\n * @return {string} The version as a string.\n */\nfunction getVersionStringForLogging(browser) {\n  if (useUserAgentDataBrand(true)) {\n    const fullVersionObj = fullVersionOf(browser);\n    if (fullVersionObj) {\n      const fullVersion = fullVersionObj.getIfLoaded();\n      if (fullVersion) {\n        return fullVersion.toVersionStringForLogging();\n      }\n      // No full version, return the major version instead.\n      const data = util.getUserAgentData();\n      const matchingBrand = data.brands.find(({brand}) => brand === browser);\n      // Checking for the existence of matchingBrand is not necessary because\n      // the existence of fullVersionObj implies that there is already a\n      // matching brand.\n      assertExists(matchingBrand);\n      return matchingBrand.version;\n    }\n    // If fullVersionObj is undefined, this doesn't mean that the full version\n    // is unavailable, but rather that the current browser doesn't match the\n    // input `browser` argument.\n    return '';\n  } else {\n    return getFullVersionFromUserAgentString(browser);\n  }\n}\nexports.getVersionStringForLogging = getVersionStringForLogging;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Closure user agent detection.\n * @see http://en.wikipedia.org/wiki/User_agent\n * For more information on browser brand, platform, or device see the other\n * sub-namespaces in goog.labs.userAgent (browser, platform, and device).\n */\n\ngoog.module('goog.labs.userAgent.engine');\ngoog.module.declareLegacyNamespace();\n\nconst googArray = goog.require('goog.array');\nconst googString = goog.require('goog.string.internal');\nconst util = goog.require('goog.labs.userAgent.util');\n\n/**\n * @return {boolean} Whether the rendering engine is Presto.\n */\nfunction isPresto() {\n  return util.matchUserAgent('Presto');\n}\n\n/**\n * @return {boolean} Whether the rendering engine is Trident.\n */\nfunction isTrident() {\n  // IE only started including the Trident token in IE8.\n  return util.matchUserAgent('Trident') || util.matchUserAgent('MSIE');\n}\n\n/**\n * @return {boolean} Whether the rendering engine is EdgeHTML.\n */\nfunction isEdge() {\n  return util.matchUserAgent('Edge');\n}\n\n/**\n * @return {boolean} Whether the rendering engine is WebKit. This will return\n * true for Chrome, Blink-based Opera (15+), Edge Chromium and Safari.\n */\nfunction isWebKit() {\n  return util.matchUserAgentIgnoreCase('WebKit') && !isEdge();\n}\n\n/**\n * @return {boolean} Whether the rendering engine is Gecko.\n */\nfunction isGecko() {\n  return util.matchUserAgent('Gecko') && !isWebKit() && !isTrident() &&\n      !isEdge();\n}\n\n/**\n * @return {string} The rendering engine's version or empty string if version\n *     can't be determined.\n */\nfunction getVersion() {\n  const userAgentString = util.getUserAgent();\n  if (userAgentString) {\n    const tuples = util.extractVersionTuples(userAgentString);\n\n    const engineTuple = getEngineTuple(tuples);\n    if (engineTuple) {\n      // In Gecko, the version string is either in the browser info or the\n      // Firefox version.  See Gecko user agent string reference:\n      // http://goo.gl/mULqa\n      if (engineTuple[0] == 'Gecko') {\n        return getVersionForKey(tuples, 'Firefox');\n      }\n\n      return engineTuple[1];\n    }\n\n    // MSIE has only one version identifier, and the Trident version is\n    // specified in the parenthetical. IE Edge is covered in the engine tuple\n    // detection.\n    const browserTuple = tuples[0];\n    let info;\n    if (browserTuple && (info = browserTuple[2])) {\n      const match = /Trident\\/([^\\s;]+)/.exec(info);\n      if (match) {\n        return match[1];\n      }\n    }\n  }\n  return '';\n}\n\n/**\n * @param {!Array<!Array<string>>} tuples Extracted version tuples.\n * @return {!Array<string>|undefined} The engine tuple or undefined if not\n *     found.\n */\nfunction getEngineTuple(tuples) {\n  if (!isEdge()) {\n    return tuples[1];\n  }\n  for (let i = 0; i < tuples.length; i++) {\n    const tuple = tuples[i];\n    if (tuple[0] == 'Edge') {\n      return tuple;\n    }\n  }\n}\n\n/**\n * @param {string|number} version The version to check.\n * @return {boolean} Whether the rendering engine version is higher or the same\n *     as the given version.\n */\nfunction isVersionOrHigher(version) {\n  return googString.compareVersions(getVersion(), version) >= 0;\n}\n\n/**\n * @param {!Array<!Array<string>>} tuples Version tuples.\n * @param {string} key The key to look for.\n * @return {string} The version string of the given key, if present.\n *     Otherwise, the empty string.\n */\nfunction getVersionForKey(tuples, key) {\n  // TODO(nnaze): Move to util if useful elsewhere.\n\n  const pair = googArray.find(tuples, function(pair) {\n    return key == pair[0];\n  });\n\n  return pair && pair[1] || '';\n}\n\nexports = {\n  getVersion,\n  isEdge,\n  isGecko,\n  isPresto,\n  isTrident,\n  isVersionOrHigher,\n  isWebKit,\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview A patched, standardized event object for browser events.\n *\n * <pre>\n * The patched event object contains the following members:\n * - type           {string}    Event type, e.g. 'click'\n * - target         {Object}    The element that actually triggered the event\n * - currentTarget  {Object}    The element the listener is attached to\n * - relatedTarget  {Object}    For mouseover and mouseout, the previous object\n * - offsetX        {number}    X-coordinate relative to target\n * - offsetY        {number}    Y-coordinate relative to target\n * - clientX        {number}    X-coordinate relative to viewport\n * - clientY        {number}    Y-coordinate relative to viewport\n * - screenX        {number}    X-coordinate relative to the edge of the screen\n * - screenY        {number}    Y-coordinate relative to the edge of the screen\n * - button         {number}    Mouse button. Use isButton() to test.\n * - keyCode        {number}    Key-code\n * - ctrlKey        {boolean}   Was ctrl key depressed\n * - altKey         {boolean}   Was alt key depressed\n * - shiftKey       {boolean}   Was shift key depressed\n * - metaKey        {boolean}   Was meta key depressed\n * - pointerId      {number}    Pointer ID\n * - pointerType    {string}    Pointer type, e.g. 'mouse', 'pen', or 'touch'\n * - defaultPrevented {boolean} Whether the default action has been prevented\n * - state          {Object}    History state object\n *\n * NOTE: The keyCode member contains the raw browser keyCode. For normalized\n * key and character code use {@link goog.events.KeyHandler}.\n * </pre>\n */\n\ngoog.provide('goog.events.BrowserEvent');\ngoog.provide('goog.events.BrowserEvent.MouseButton');\ngoog.provide('goog.events.BrowserEvent.PointerType');\n\ngoog.require('goog.debug');\ngoog.require('goog.events.Event');\ngoog.require('goog.events.EventType');\ngoog.require('goog.reflect');\ngoog.require('goog.userAgent');\n\n/**\n * Accepts a browser event object and creates a patched, cross browser event\n * object.\n * The content of this object will not be initialized if no event object is\n * provided. If this is the case, init() needs to be invoked separately.\n * @param {Event=} opt_e Browser event object.\n * @param {EventTarget=} opt_currentTarget Current target for event.\n * @constructor\n * @extends {goog.events.Event}\n */\ngoog.events.BrowserEvent = function(opt_e, opt_currentTarget) {\n  'use strict';\n  goog.events.BrowserEvent.base(this, 'constructor', opt_e ? opt_e.type : '');\n\n  /**\n   * Target that fired the event.\n   * @override\n   * @type {?Node}\n   */\n  this.target = null;\n\n  /**\n   * Node that had the listener attached.\n   * @override\n   * @type {?Node|undefined}\n   */\n  this.currentTarget = null;\n\n  /**\n   * For mouseover and mouseout events, the related object for the event.\n   * @type {?Node}\n   */\n  this.relatedTarget = null;\n\n  /**\n   * X-coordinate relative to target.\n   * @type {number}\n   */\n  this.offsetX = 0;\n\n  /**\n   * Y-coordinate relative to target.\n   * @type {number}\n   */\n  this.offsetY = 0;\n\n  /**\n   * X-coordinate relative to the window.\n   * @type {number}\n   */\n  this.clientX = 0;\n\n  /**\n   * Y-coordinate relative to the window.\n   * @type {number}\n   */\n  this.clientY = 0;\n\n  /**\n   * X-coordinate relative to the monitor.\n   * @type {number}\n   */\n  this.screenX = 0;\n\n  /**\n   * Y-coordinate relative to the monitor.\n   * @type {number}\n   */\n  this.screenY = 0;\n\n  /**\n   * Which mouse button was pressed.\n   * @type {number}\n   */\n  this.button = 0;\n\n  /**\n   * Key of key press.\n   * @type {string}\n   */\n  this.key = '';\n\n  /**\n   * Keycode of key press.\n   * @type {number}\n   */\n  this.keyCode = 0;\n\n  /**\n   * Keycode of key press.\n   * @type {number}\n   */\n  this.charCode = 0;\n\n  /**\n   * Whether control was pressed at time of event.\n   * @type {boolean}\n   */\n  this.ctrlKey = false;\n\n  /**\n   * Whether alt was pressed at time of event.\n   * @type {boolean}\n   */\n  this.altKey = false;\n\n  /**\n   * Whether shift was pressed at time of event.\n   * @type {boolean}\n   */\n  this.shiftKey = false;\n\n  /**\n   * Whether the meta key was pressed at time of event.\n   * @type {boolean}\n   */\n  this.metaKey = false;\n\n  /**\n   * History state object, only set for PopState events where it's a copy of the\n   * state object provided to pushState or replaceState.\n   * @type {?Object}\n   */\n  this.state = null;\n\n  /**\n   * Whether the default platform modifier key was pressed at time of event.\n   * (This is control for all platforms except Mac, where it's Meta.)\n   * @type {boolean}\n   */\n  this.platformModifierKey = false;\n\n  /**\n   * @type {number}\n   */\n  this.pointerId = 0;\n\n  /**\n   * @type {string}\n   */\n  this.pointerType = '';\n\n  /**\n   * The browser event object.\n   * @private {?Event}\n   */\n  this.event_ = null;\n\n  if (opt_e) {\n    this.init(opt_e, opt_currentTarget);\n  }\n};\ngoog.inherits(goog.events.BrowserEvent, goog.events.Event);\n\n/**\n * @define {boolean} If true, use the layerX and layerY properties of a native\n * browser event over the offsetX and offsetY properties, which cause expensive\n * reflow. If layerX or layerY is not defined, offsetX and offsetY will be used\n * as usual.\n */\ngoog.events.BrowserEvent.USE_LAYER_XY_AS_OFFSET_XY =\n    goog.define('goog.events.BrowserEvent.USE_LAYER_XY_AS_OFFSET_XY', false);\n\n\n/**\n * Normalized button constants for the mouse.\n * @enum {number}\n */\ngoog.events.BrowserEvent.MouseButton = {\n  LEFT: 0,\n  MIDDLE: 1,\n  RIGHT: 2,\n  BACK: 3,\n  FORWARD: 4,\n};\n\n\n/**\n * Normalized pointer type constants for pointer events.\n * @enum {string}\n */\ngoog.events.BrowserEvent.PointerType = {\n  MOUSE: 'mouse',\n  PEN: 'pen',\n  TOUCH: 'touch'\n};\n\n\n/**\n * Static data for mapping mouse buttons.\n * @type {!Array<number>}\n * @deprecated Use `goog.events.BrowserEvent.IE_BUTTON_MAP` instead.\n */\ngoog.events.BrowserEvent.IEButtonMap = goog.debug.freeze([\n  1,  // LEFT\n  4,  // MIDDLE\n  2   // RIGHT\n]);\n\n\n/**\n * Static data for mapping mouse buttons.\n * @const {!Array<number>}\n */\ngoog.events.BrowserEvent.IE_BUTTON_MAP = goog.events.BrowserEvent.IEButtonMap;\n\n\n/**\n * Static data for mapping MSPointerEvent types to PointerEvent types.\n * @const {!Object<number, goog.events.BrowserEvent.PointerType>}\n */\ngoog.events.BrowserEvent.IE_POINTER_TYPE_MAP = goog.debug.freeze({\n  2: goog.events.BrowserEvent.PointerType.TOUCH,\n  3: goog.events.BrowserEvent.PointerType.PEN,\n  4: goog.events.BrowserEvent.PointerType.MOUSE\n});\n\n\n/**\n * Accepts a browser event object and creates a patched, cross browser event\n * object.\n * @param {Event} e Browser event object.\n * @param {EventTarget=} opt_currentTarget Current target for event.\n */\ngoog.events.BrowserEvent.prototype.init = function(e, opt_currentTarget) {\n  'use strict';\n  var type = this.type = e.type;\n\n  /**\n   * On touch devices use the first \"changed touch\" as the relevant touch.\n   * @type {?Touch}\n   * @suppress {strictMissingProperties} Added to tighten compiler checks\n   */\n  var relevantTouch =\n      e.changedTouches && e.changedTouches.length ? e.changedTouches[0] : null;\n\n  // TODO(nicksantos): Change this.target to type EventTarget.\n  this.target = /** @type {Node} */ (e.target) || e.srcElement;\n\n  // TODO(nicksantos): Change this.currentTarget to type EventTarget.\n  this.currentTarget = /** @type {Node} */ (opt_currentTarget);\n\n  var relatedTarget = /** @type {Node} */ (e.relatedTarget);\n  if (relatedTarget) {\n    // There's a bug in FireFox where sometimes, relatedTarget will be a\n    // chrome element, and accessing any property of it will get a permission\n    // denied exception. See:\n    // https://bugzilla.mozilla.org/show_bug.cgi?id=497780\n    if (goog.userAgent.GECKO) {\n      if (!goog.reflect.canAccessProperty(relatedTarget, 'nodeName')) {\n        relatedTarget = null;\n      }\n    }\n  } else if (type == goog.events.EventType.MOUSEOVER) {\n    relatedTarget = e.fromElement;\n  } else if (type == goog.events.EventType.MOUSEOUT) {\n    relatedTarget = e.toElement;\n  }\n\n  this.relatedTarget = relatedTarget;\n\n  if (relevantTouch) {\n    this.clientX = relevantTouch.clientX !== undefined ? relevantTouch.clientX :\n                                                         relevantTouch.pageX;\n    this.clientY = relevantTouch.clientY !== undefined ? relevantTouch.clientY :\n                                                         relevantTouch.pageY;\n    this.screenX = relevantTouch.screenX || 0;\n    this.screenY = relevantTouch.screenY || 0;\n  } else {\n    if (goog.events.BrowserEvent.USE_LAYER_XY_AS_OFFSET_XY) {\n      this.offsetX = (e.layerX !== undefined) ? e.layerX : e.offsetX;\n      this.offsetY = (e.layerY !== undefined) ? e.layerY : e.offsetY;\n    } else {\n      // Webkit emits a lame warning whenever layerX/layerY is accessed.\n      // http://code.google.com/p/chromium/issues/detail?id=101733\n      this.offsetX = (goog.userAgent.WEBKIT || e.offsetX !== undefined) ?\n          e.offsetX :\n          e.layerX;\n      this.offsetY = (goog.userAgent.WEBKIT || e.offsetY !== undefined) ?\n          e.offsetY :\n          e.layerY;\n    }\n    this.clientX = e.clientX !== undefined ? e.clientX : e.pageX;\n    this.clientY = e.clientY !== undefined ? e.clientY : e.pageY;\n    this.screenX = e.screenX || 0;\n    this.screenY = e.screenY || 0;\n  }\n\n  this.button = e.button;\n\n  this.keyCode = e.keyCode || 0;\n  /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n  this.key = e.key || '';\n  this.charCode = e.charCode || (type == 'keypress' ? e.keyCode : 0);\n  this.ctrlKey = e.ctrlKey;\n  this.altKey = e.altKey;\n  this.shiftKey = e.shiftKey;\n  this.metaKey = e.metaKey;\n  this.platformModifierKey = goog.userAgent.MAC ? e.metaKey : e.ctrlKey;\n  /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n  this.pointerId = e.pointerId || 0;\n  this.pointerType = goog.events.BrowserEvent.getPointerType_(e);\n  /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n  this.state = e.state;\n  this.event_ = e;\n  if (e.defaultPrevented) {\n    // Sync native event state to internal state via super class, where default\n    // prevention is implemented and managed.\n    goog.events.BrowserEvent.superClass_.preventDefault.call(this);\n  }\n};\n\n\n/**\n * Tests to see which button was pressed during the event. This is really only\n * useful in IE and Gecko browsers. And in IE, it's only useful for\n * mousedown/mouseup events, because click only fires for the left mouse button.\n *\n * Safari 2 only reports the left button being clicked, and uses the value '1'\n * instead of 0. Opera only reports a mousedown event for the middle button, and\n * no mouse events for the right button. Opera has default behavior for left and\n * middle click that can only be overridden via a configuration setting.\n *\n * There's a nice table of this mess at http://www.unixpapa.com/js/mouse.html.\n *\n * @param {goog.events.BrowserEvent.MouseButton} button The button\n *     to test for.\n * @return {boolean} True if button was pressed.\n */\ngoog.events.BrowserEvent.prototype.isButton = function(button) {\n  'use strict';\n  return this.event_.button == button;\n};\n\n\n/**\n * Whether this has an \"action\"-producing mouse button.\n *\n * By definition, this includes left-click on windows/linux, and left-click\n * without the ctrl key on Macs.\n *\n * @return {boolean} The result.\n */\ngoog.events.BrowserEvent.prototype.isMouseActionButton = function() {\n  'use strict';\n  // Ctrl+click should never behave like a left-click on mac, regardless of\n  // whether or not the browser will actually ever emit such an event.  If\n  // we see it, treat it like right-click always.\n  return this.isButton(goog.events.BrowserEvent.MouseButton.LEFT) &&\n      !(goog.userAgent.MAC && this.ctrlKey);\n};\n\n\n/**\n * @override\n */\ngoog.events.BrowserEvent.prototype.stopPropagation = function() {\n  'use strict';\n  goog.events.BrowserEvent.superClass_.stopPropagation.call(this);\n  if (this.event_.stopPropagation) {\n    this.event_.stopPropagation();\n  } else {\n    this.event_.cancelBubble = true;\n  }\n};\n\n\n/**\n * @override\n */\ngoog.events.BrowserEvent.prototype.preventDefault = function() {\n  'use strict';\n  goog.events.BrowserEvent.superClass_.preventDefault.call(this);\n  var be = this.event_;\n  if (!be.preventDefault) {\n    be.returnValue = false;\n  } else {\n    be.preventDefault();\n  }\n};\n\n\n/**\n * @return {Event} The underlying browser event object.\n */\ngoog.events.BrowserEvent.prototype.getBrowserEvent = function() {\n  'use strict';\n  return this.event_;\n};\n\n\n/**\n * Extracts the pointer type from the given event.\n * @param {!Event} e\n * @return {string} The pointer type, e.g. 'mouse', 'pen', or 'touch'.\n * @private\n */\ngoog.events.BrowserEvent.getPointerType_ = function(e) {\n  'use strict';\n  if (typeof (e.pointerType) === 'string') {\n    return e.pointerType;\n  }\n  // IE10 uses integer codes for pointer type.\n  // https://msdn.microsoft.com/en-us/library/hh772359(v=vs.85).aspx\n  return goog.events.BrowserEvent.IE_POINTER_TYPE_MAP[e.pointerType] || '';\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\ngoog.provide('goog.events.EventType');\n\ngoog.require('goog.events.eventTypeHelpers');\ngoog.require('goog.userAgent');\n\n\n/**\n * Constants for event names.\n * @enum {string}\n */\ngoog.events.EventType = {\n  // Mouse events\n  CLICK: 'click',\n  RIGHTCLICK: 'rightclick',\n  DBLCLICK: 'dblclick',\n  AUXCLICK: 'auxclick',\n  MOUSEDOWN: 'mousedown',\n  MOUSEUP: 'mouseup',\n  MOUSEOVER: 'mouseover',\n  MOUSEOUT: 'mouseout',\n  MOUSEMOVE: 'mousemove',\n  MOUSEENTER: 'mouseenter',\n  MOUSELEAVE: 'mouseleave',\n\n  // Non-existent event; will never fire. This exists as a mouse counterpart to\n  // POINTERCANCEL.\n  MOUSECANCEL: 'mousecancel',\n\n  // Selection events.\n  // https://www.w3.org/TR/selection-api/\n  SELECTIONCHANGE: 'selectionchange',\n  SELECTSTART: 'selectstart',  // IE, Safari, Chrome\n\n  // Wheel events\n  // http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents\n  WHEEL: 'wheel',\n\n  // Key events\n  KEYPRESS: 'keypress',\n  KEYDOWN: 'keydown',\n  KEYUP: 'keyup',\n\n  // Focus\n  BLUR: 'blur',\n  FOCUS: 'focus',\n  DEACTIVATE: 'deactivate',  // IE only\n  FOCUSIN: 'focusin',\n  FOCUSOUT: 'focusout',\n\n  // Forms\n  CHANGE: 'change',\n  RESET: 'reset',\n  SELECT: 'select',\n  SUBMIT: 'submit',\n  INPUT: 'input',\n  PROPERTYCHANGE: 'propertychange',  // IE only\n\n  // Drag and drop\n  DRAGSTART: 'dragstart',\n  DRAG: 'drag',\n  DRAGENTER: 'dragenter',\n  DRAGOVER: 'dragover',\n  DRAGLEAVE: 'dragleave',\n  DROP: 'drop',\n  DRAGEND: 'dragend',\n\n  // Touch events\n  // Note that other touch events exist, but we should follow the W3C list here.\n  // http://www.w3.org/TR/touch-events/#list-of-touchevent-types\n  TOUCHSTART: 'touchstart',\n  TOUCHMOVE: 'touchmove',\n  TOUCHEND: 'touchend',\n  TOUCHCANCEL: 'touchcancel',\n\n  // Misc\n  BEFOREUNLOAD: 'beforeunload',\n  CONSOLEMESSAGE: 'consolemessage',\n  CONTEXTMENU: 'contextmenu',\n  DEVICECHANGE: 'devicechange',\n  DEVICEMOTION: 'devicemotion',\n  DEVICEORIENTATION: 'deviceorientation',\n  DOMCONTENTLOADED: 'DOMContentLoaded',\n  ERROR: 'error',\n  HELP: 'help',\n  LOAD: 'load',\n  LOSECAPTURE: 'losecapture',\n  ORIENTATIONCHANGE: 'orientationchange',\n  READYSTATECHANGE: 'readystatechange',\n  RESIZE: 'resize',\n  SCROLL: 'scroll',\n  UNLOAD: 'unload',\n\n  // Media events\n  CANPLAY: 'canplay',\n  CANPLAYTHROUGH: 'canplaythrough',\n  DURATIONCHANGE: 'durationchange',\n  EMPTIED: 'emptied',\n  ENDED: 'ended',\n  LOADEDDATA: 'loadeddata',\n  LOADEDMETADATA: 'loadedmetadata',\n  PAUSE: 'pause',\n  PLAY: 'play',\n  PLAYING: 'playing',\n  PROGRESS: 'progress',\n  RATECHANGE: 'ratechange',\n  SEEKED: 'seeked',\n  SEEKING: 'seeking',\n  STALLED: 'stalled',\n  SUSPEND: 'suspend',\n  TIMEUPDATE: 'timeupdate',\n  VOLUMECHANGE: 'volumechange',\n  WAITING: 'waiting',\n\n  // Media Source Extensions events\n  // https://www.w3.org/TR/media-source/#mediasource-events\n  SOURCEOPEN: 'sourceopen',\n  SOURCEENDED: 'sourceended',\n  SOURCECLOSED: 'sourceclosed',\n  // https://www.w3.org/TR/media-source/#sourcebuffer-events\n  ABORT: 'abort',\n  UPDATE: 'update',\n  UPDATESTART: 'updatestart',\n  UPDATEEND: 'updateend',\n\n  // HTML 5 History events\n  // See http://www.w3.org/TR/html5/browsers.html#event-definitions-0\n  HASHCHANGE: 'hashchange',\n  PAGEHIDE: 'pagehide',\n  PAGESHOW: 'pageshow',\n  POPSTATE: 'popstate',\n\n  // Copy and Paste\n  // Support is limited. Make sure it works on your favorite browser\n  // before using.\n  // http://www.quirksmode.org/dom/events/cutcopypaste.html\n  COPY: 'copy',\n  PASTE: 'paste',\n  CUT: 'cut',\n  BEFORECOPY: 'beforecopy',\n  BEFORECUT: 'beforecut',\n  BEFOREPASTE: 'beforepaste',\n\n  // HTML5 online/offline events.\n  // http://www.w3.org/TR/offline-webapps/#related\n  ONLINE: 'online',\n  OFFLINE: 'offline',\n\n  // HTML 5 worker events\n  MESSAGE: 'message',\n  CONNECT: 'connect',\n\n  // Service Worker Events - ServiceWorkerGlobalScope context\n  // See https://w3c.github.io/ServiceWorker/#execution-context-events\n  // Note: message event defined in worker events section\n  INSTALL: 'install',\n  ACTIVATE: 'activate',\n  FETCH: 'fetch',\n  FOREIGNFETCH: 'foreignfetch',\n  MESSAGEERROR: 'messageerror',\n\n  // Service Worker Events - Document context\n  // See https://w3c.github.io/ServiceWorker/#document-context-events\n  STATECHANGE: 'statechange',\n  UPDATEFOUND: 'updatefound',\n  CONTROLLERCHANGE: 'controllerchange',\n\n  // CSS animation events.\n  ANIMATIONSTART:\n      goog.events.eventTypeHelpers.getVendorPrefixedName('AnimationStart'),\n  ANIMATIONEND:\n      goog.events.eventTypeHelpers.getVendorPrefixedName('AnimationEnd'),\n  ANIMATIONITERATION:\n      goog.events.eventTypeHelpers.getVendorPrefixedName('AnimationIteration'),\n\n  // CSS transition events. Based on the browser support described at:\n  // https://developer.mozilla.org/en/css/css_transitions#Browser_compatibility\n  TRANSITIONEND:\n      goog.events.eventTypeHelpers.getVendorPrefixedName('TransitionEnd'),\n\n  // W3C Pointer Events\n  // http://www.w3.org/TR/pointerevents/\n  POINTERDOWN: 'pointerdown',\n  POINTERUP: 'pointerup',\n  POINTERCANCEL: 'pointercancel',\n  POINTERMOVE: 'pointermove',\n  POINTEROVER: 'pointerover',\n  POINTEROUT: 'pointerout',\n  POINTERENTER: 'pointerenter',\n  POINTERLEAVE: 'pointerleave',\n  GOTPOINTERCAPTURE: 'gotpointercapture',\n  LOSTPOINTERCAPTURE: 'lostpointercapture',\n\n  // IE specific events.\n  // See http://msdn.microsoft.com/en-us/library/ie/hh772103(v=vs.85).aspx\n  // Note: these events will be supplanted in IE11.\n  MSGESTURECHANGE: 'MSGestureChange',\n  MSGESTUREEND: 'MSGestureEnd',\n  MSGESTUREHOLD: 'MSGestureHold',\n  MSGESTURESTART: 'MSGestureStart',\n  MSGESTURETAP: 'MSGestureTap',\n  MSGOTPOINTERCAPTURE: 'MSGotPointerCapture',\n  MSINERTIASTART: 'MSInertiaStart',\n  MSLOSTPOINTERCAPTURE: 'MSLostPointerCapture',\n  MSPOINTERCANCEL: 'MSPointerCancel',\n  MSPOINTERDOWN: 'MSPointerDown',\n  MSPOINTERENTER: 'MSPointerEnter',\n  MSPOINTERHOVER: 'MSPointerHover',\n  MSPOINTERLEAVE: 'MSPointerLeave',\n  MSPOINTERMOVE: 'MSPointerMove',\n  MSPOINTEROUT: 'MSPointerOut',\n  MSPOINTEROVER: 'MSPointerOver',\n  MSPOINTERUP: 'MSPointerUp',\n\n  // Native IMEs/input tools events.\n  TEXT: 'text',\n  // The textInput event is supported in IE9+, but only in lower case. All other\n  // browsers use the camel-case event name.\n  TEXTINPUT: goog.userAgent.IE ? 'textinput' : 'textInput',\n  COMPOSITIONSTART: 'compositionstart',\n  COMPOSITIONUPDATE: 'compositionupdate',\n  COMPOSITIONEND: 'compositionend',\n\n  // The beforeinput event is initially only supported in Safari. See\n  // https://bugs.chromium.org/p/chromium/issues/detail?id=342670 for Chrome\n  // implementation tracking.\n  BEFOREINPUT: 'beforeinput',\n\n  // Fullscreen API events. See https://fullscreen.spec.whatwg.org/.\n  FULLSCREENCHANGE: 'fullscreenchange',\n  // iOS-only fullscreen events. See\n  // https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/ControllingMediaWithJavaScript/ControllingMediaWithJavaScript.html\n  WEBKITBEGINFULLSCREEN: 'webkitbeginfullscreen',\n  WEBKITENDFULLSCREEN: 'webkitendfullscreen',\n\n  // Webview tag events\n  // See https://developer.chrome.com/apps/tags/webview\n  EXIT: 'exit',\n  LOADABORT: 'loadabort',\n  LOADCOMMIT: 'loadcommit',\n  LOADREDIRECT: 'loadredirect',\n  LOADSTART: 'loadstart',\n  LOADSTOP: 'loadstop',\n  RESPONSIVE: 'responsive',\n  SIZECHANGED: 'sizechanged',\n  UNRESPONSIVE: 'unresponsive',\n\n  // HTML5 Page Visibility API.  See details at\n  // `goog.labs.dom.PageVisibilityMonitor`.\n  VISIBILITYCHANGE: 'visibilitychange',\n\n  // LocalStorage event.\n  STORAGE: 'storage',\n\n  // Print events.\n  BEFOREPRINT: 'beforeprint',\n  AFTERPRINT: 'afterprint',\n\n  // Web app manifest events.\n  BEFOREINSTALLPROMPT: 'beforeinstallprompt',\n  APPINSTALLED: 'appinstalled',\n\n  // Web Animation API (WAAPI) playback events\n  // https://www.w3.org/TR/web-animations-1/#animation-playback-event-types\n  CANCEL: 'cancel',\n  FINISH: 'finish',\n  REMOVE: 'remove'\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview An interface for a listenable JavaScript object.\n */\n\ngoog.provide('goog.events.Listenable');\n\ngoog.requireType('goog.events.EventId');\ngoog.requireType('goog.events.EventLike');\ngoog.requireType('goog.events.ListenableKey');\n\n\n/**\n * A listenable interface. A listenable is an object with the ability\n * to dispatch/broadcast events to \"event listeners\" registered via\n * listen/listenOnce.\n *\n * The interface allows for an event propagation mechanism similar\n * to one offered by native browser event targets, such as\n * capture/bubble mechanism, stopping propagation, and preventing\n * default actions. Capture/bubble mechanism depends on the ancestor\n * tree constructed via `#getParentEventTarget`; this tree\n * must be directed acyclic graph. The meaning of default action(s)\n * in preventDefault is specific to a particular use case.\n *\n * Implementations that do not support capture/bubble or can not have\n * a parent listenable can simply not implement any ability to set the\n * parent listenable (and have `#getParentEventTarget` return\n * null).\n *\n * Implementation of this class can be used with or independently from\n * goog.events.\n *\n * Implementation must call `#addImplementation(implClass)`.\n *\n * @interface\n * @see goog.events\n * @see http://www.w3.org/TR/DOM-Level-2-Events/events.html\n */\ngoog.events.Listenable = function() {};\n\n\n/**\n * An expando property to indicate that an object implements\n * goog.events.Listenable.\n *\n * See addImplementation/isImplementedBy.\n *\n * @type {string}\n * @const\n */\ngoog.events.Listenable.IMPLEMENTED_BY_PROP =\n    'closure_listenable_' + ((Math.random() * 1e6) | 0);\n\n\n/**\n * Marks a given class (constructor) as an implementation of\n * Listenable, so that we can query that fact at runtime. The class\n * must have already implemented the interface.\n * @param {function(new:goog.events.Listenable,...)} cls The class constructor.\n *     The corresponding class must have already implemented the interface.\n */\ngoog.events.Listenable.addImplementation = function(cls) {\n  'use strict';\n  cls.prototype[goog.events.Listenable.IMPLEMENTED_BY_PROP] = true;\n};\n\n\n/**\n * @param {?Object} obj The object to check.\n * @return {boolean} Whether a given instance implements Listenable. The\n *     class/superclass of the instance must call addImplementation.\n */\ngoog.events.Listenable.isImplementedBy = function(obj) {\n  'use strict';\n  return !!(obj && obj[goog.events.Listenable.IMPLEMENTED_BY_PROP]);\n};\n\n\n/**\n * Adds an event listener. A listener can only be added once to an\n * object and if it is added again the key for the listener is\n * returned. Note that if the existing listener is a one-off listener\n * (registered via listenOnce), it will no longer be a one-off\n * listener after a call to listen().\n *\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The event type id.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener Callback\n *     method.\n * @param {boolean=} opt_useCapture Whether to fire in capture phase\n *     (defaults to false).\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {!goog.events.ListenableKey} Unique key for the listener.\n * @template SCOPE,EVENTOBJ\n */\ngoog.events.Listenable.prototype.listen = function(\n    type, listener, opt_useCapture, opt_listenerScope) {};\n\n\n/**\n * Adds an event listener that is removed automatically after the\n * listener fired once.\n *\n * If an existing listener already exists, listenOnce will do\n * nothing. In particular, if the listener was previously registered\n * via listen(), listenOnce() will not turn the listener into a\n * one-off listener. Similarly, if there is already an existing\n * one-off listener, listenOnce does not modify the listeners (it is\n * still a once listener).\n *\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The event type id.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener Callback\n *     method.\n * @param {boolean=} opt_useCapture Whether to fire in capture phase\n *     (defaults to false).\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {!goog.events.ListenableKey} Unique key for the listener.\n * @template SCOPE,EVENTOBJ\n */\ngoog.events.Listenable.prototype.listenOnce = function(\n    type, listener, opt_useCapture, opt_listenerScope) {};\n\n\n/**\n * Removes an event listener which was added with listen() or listenOnce().\n *\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The event type id.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener Callback\n *     method.\n * @param {boolean=} opt_useCapture Whether to fire in capture phase\n *     (defaults to false).\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call\n *     the listener.\n * @return {boolean} Whether any listener was removed.\n * @template SCOPE,EVENTOBJ\n */\ngoog.events.Listenable.prototype.unlisten = function(\n    type, listener, opt_useCapture, opt_listenerScope) {};\n\n\n/**\n * Removes an event listener which was added with listen() by the key\n * returned by listen().\n *\n * @param {!goog.events.ListenableKey} key The key returned by\n *     listen() or listenOnce().\n * @return {boolean} Whether any listener was removed.\n */\ngoog.events.Listenable.prototype.unlistenByKey = function(key) {};\n\n\n/**\n * Dispatches an event (or event like object) and calls all listeners\n * listening for events of this type. The type of the event is decided by the\n * type property on the event object.\n *\n * If any of the listeners returns false OR calls preventDefault then this\n * function will return false.  If one of the capture listeners calls\n * stopPropagation, then the bubble listeners won't fire.\n *\n * @param {?goog.events.EventLike} e Event object.\n * @return {boolean} If anyone called preventDefault on the event object (or\n *     if any of the listeners returns false) this will also return false.\n */\ngoog.events.Listenable.prototype.dispatchEvent = function(e) {};\n\n\n/**\n * Removes all listeners from this listenable. If type is specified,\n * it will only remove listeners of the particular type. otherwise all\n * registered listeners will be removed.\n *\n * @param {string|!goog.events.EventId=} opt_type Type of event to remove,\n *     default is to remove all types.\n * @return {number} Number of listeners removed.\n */\ngoog.events.Listenable.prototype.removeAllListeners = function(opt_type) {};\n\n\n/**\n * Returns the parent of this event target to use for capture/bubble\n * mechanism.\n *\n * NOTE(chrishenry): The name reflects the original implementation of\n * custom event target (`goog.events.EventTarget`). We decided\n * that changing the name is not worth it.\n *\n * @return {?goog.events.Listenable} The parent EventTarget or null if\n *     there is no parent.\n */\ngoog.events.Listenable.prototype.getParentEventTarget = function() {};\n\n\n/**\n * Fires all registered listeners in this listenable for the given\n * type and capture mode, passing them the given eventObject. This\n * does not perform actual capture/bubble. Only implementors of the\n * interface should be using this.\n *\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The type of the\n *     listeners to fire.\n * @param {boolean} capture The capture mode of the listeners to fire.\n * @param {EVENTOBJ} eventObject The event object to fire.\n * @return {boolean} Whether all listeners succeeded without\n *     attempting to prevent default behavior. If any listener returns\n *     false or called goog.events.Event#preventDefault, this returns\n *     false.\n * @template EVENTOBJ\n */\ngoog.events.Listenable.prototype.fireListeners = function(\n    type, capture, eventObject) {};\n\n\n/**\n * Gets all listeners in this listenable for the given type and\n * capture mode.\n *\n * @param {string|!goog.events.EventId} type The type of the listeners to fire.\n * @param {boolean} capture The capture mode of the listeners to fire.\n * @return {!Array<!goog.events.ListenableKey>} An array of registered\n *     listeners.\n * @template EVENTOBJ\n */\ngoog.events.Listenable.prototype.getListeners = function(type, capture) {};\n\n\n/**\n * Gets the goog.events.ListenableKey for the event or null if no such\n * listener is in use.\n *\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The name of the event\n *     without the 'on' prefix.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener The\n *     listener function to get.\n * @param {boolean} capture Whether the listener is a capturing listener.\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {?goog.events.ListenableKey} the found listener or null if not found.\n * @template SCOPE,EVENTOBJ\n */\ngoog.events.Listenable.prototype.getListener = function(\n    type, listener, capture, opt_listenerScope) {};\n\n\n/**\n * Whether there is any active listeners matching the specified\n * signature. If either the type or capture parameters are\n * unspecified, the function will match on the remaining criteria.\n *\n * @param {string|!goog.events.EventId<EVENTOBJ>=} opt_type Event type.\n * @param {boolean=} opt_capture Whether to check for capture or bubble\n *     listeners.\n * @return {boolean} Whether there is any active listeners matching\n *     the requested type and/or capture phase.\n * @template EVENTOBJ\n */\ngoog.events.Listenable.prototype.hasListener = function(\n    opt_type, opt_capture) {};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview An interface that describes a single registered listener.\n */\ngoog.provide('goog.events.ListenableKey');\n\ngoog.requireType('goog.events.Listenable');\n\n\n/**\n * An interface that describes a single registered listener.\n * @interface\n */\ngoog.events.ListenableKey = function() {};\n\n\n/**\n * Counter used to create a unique key\n * @type {number}\n * @private\n */\ngoog.events.ListenableKey.counter_ = 0;\n\n\n/**\n * Reserves a key to be used for ListenableKey#key field.\n * @return {number} A number to be used to fill ListenableKey#key\n *     field.\n */\ngoog.events.ListenableKey.reserveKey = function() {\n  'use strict';\n  return ++goog.events.ListenableKey.counter_;\n};\n\n\n/**\n * The source event target.\n * @type {?Object|?goog.events.Listenable}\n */\ngoog.events.ListenableKey.prototype.src;\n\n\n/**\n * The event type the listener is listening to.\n * @type {string}\n */\ngoog.events.ListenableKey.prototype.type;\n\n\n/**\n * The listener function.\n * @type {function(?):?|{handleEvent:function(?):?}|null}\n */\ngoog.events.ListenableKey.prototype.listener;\n\n\n/**\n * Whether the listener works on capture phase.\n * @type {boolean}\n */\ngoog.events.ListenableKey.prototype.capture;\n\n\n/**\n * The 'this' object for the listener function's scope.\n * @type {?Object|undefined}\n */\ngoog.events.ListenableKey.prototype.handler;\n\n\n/**\n * A globally unique number to identify the key.\n * @type {number}\n */\ngoog.events.ListenableKey.prototype.key;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Listener object.\n * @see ../demos/events.html\n */\n\ngoog.provide('goog.events.Listener');\n\ngoog.require('goog.events.ListenableKey');\ngoog.requireType('goog.events.Listenable');\n\n\n\n/**\n * Simple class that stores information about a listener\n * @param {function(?):?} listener Callback function.\n * @param {Function} proxy Wrapper for the listener that patches the event.\n * @param {EventTarget|goog.events.Listenable} src Source object for\n *     the event.\n * @param {string} type Event type.\n * @param {boolean} capture Whether in capture or bubble phase.\n * @param {Object=} opt_handler Object in whose context to execute the callback.\n * @implements {goog.events.ListenableKey}\n * @constructor\n */\ngoog.events.Listener = function(\n    listener, proxy, src, type, capture, opt_handler) {\n  'use strict';\n  if (goog.events.Listener.ENABLE_MONITORING) {\n    this.creationStack = new Error().stack;\n  }\n\n  /** @override */\n  this.listener = listener;\n\n  /**\n   * A wrapper over the original listener. This is used solely to\n   * handle native browser events (it is used to simulate the capture\n   * phase and to patch the event object).\n   * @type {Function}\n   */\n  this.proxy = proxy;\n\n  /**\n   * Object or node that callback is listening to\n   * @type {EventTarget|goog.events.Listenable}\n   */\n  this.src = src;\n\n  /**\n   * The event type.\n   * @const {string}\n   */\n  this.type = type;\n\n  /**\n   * Whether the listener is being called in the capture or bubble phase\n   * @const {boolean}\n   */\n  this.capture = !!capture;\n\n  /**\n   * Optional object whose context to execute the listener in\n   * @type {Object|undefined}\n   */\n  this.handler = opt_handler;\n\n  /**\n   * The key of the listener.\n   * @const {number}\n   * @override\n   */\n  this.key = goog.events.ListenableKey.reserveKey();\n\n  /**\n   * Whether to remove the listener after it has been called.\n   * @type {boolean}\n   */\n  this.callOnce = false;\n\n  /**\n   * Whether the listener has been removed.\n   * @type {boolean}\n   */\n  this.removed = false;\n};\n\n\n/**\n * @define {boolean} Whether to enable the monitoring of the\n *     goog.events.Listener instances. Switching on the monitoring is only\n *     recommended for debugging because it has a significant impact on\n *     performance and memory usage. If switched off, the monitoring code\n *     compiles down to 0 bytes.\n */\ngoog.events.Listener.ENABLE_MONITORING =\n    goog.define('goog.events.Listener.ENABLE_MONITORING', false);\n\n\n/**\n * If monitoring the goog.events.Listener instances is enabled, stores the\n * creation stack trace of the Disposable instance.\n * @type {string}\n */\ngoog.events.Listener.prototype.creationStack;\n\n\n/**\n * Marks this listener as removed. This also remove references held by\n * this listener object (such as listener and event source).\n */\ngoog.events.Listener.prototype.markAsRemoved = function() {\n  'use strict';\n  this.removed = true;\n  this.listener = null;\n  this.proxy = null;\n  this.src = null;\n  this.handler = null;\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview A map of listeners that provides utility functions to\n * deal with listeners on an event target. Used by\n * `goog.events.EventTarget`.\n *\n * WARNING: Do not use this class from outside goog.events package.\n *\n */\n\ngoog.provide('goog.events.ListenerMap');\n\ngoog.require('goog.array');\ngoog.require('goog.events.Listener');\ngoog.require('goog.object');\ngoog.requireType('goog.events.EventId');\ngoog.requireType('goog.events.Listenable');\ngoog.requireType('goog.events.ListenableKey');\n\n\n\n/**\n * Creates a new listener map.\n * @param {EventTarget|goog.events.Listenable} src The src object.\n * @constructor\n * @final\n */\ngoog.events.ListenerMap = function(src) {\n  'use strict';\n  /** @type {EventTarget|goog.events.Listenable} */\n  this.src = src;\n\n  /**\n   * Maps of event type to an array of listeners.\n   * @type {!Object<string, !Array<!goog.events.Listener>>}\n   */\n  this.listeners = {};\n\n  /**\n   * The count of types in this map that have registered listeners.\n   * @private {number}\n   */\n  this.typeCount_ = 0;\n};\n\n\n/**\n * @return {number} The count of event types in this map that actually\n *     have registered listeners.\n */\ngoog.events.ListenerMap.prototype.getTypeCount = function() {\n  'use strict';\n  return this.typeCount_;\n};\n\n\n/**\n * @return {number} Total number of registered listeners.\n */\ngoog.events.ListenerMap.prototype.getListenerCount = function() {\n  'use strict';\n  var count = 0;\n  for (var type in this.listeners) {\n    count += this.listeners[type].length;\n  }\n  return count;\n};\n\n\n/**\n * Adds an event listener. A listener can only be added once to an\n * object and if it is added again the key for the listener is\n * returned.\n *\n * Note that a one-off listener will not change an existing listener,\n * if any. On the other hand a normal listener will change existing\n * one-off listener to become a normal listener.\n *\n * @param {string|!goog.events.EventId} type The listener event type.\n * @param {!Function} listener This listener callback method.\n * @param {boolean} callOnce Whether the listener is a one-off\n *     listener.\n * @param {boolean=} opt_useCapture The capture mode of the listener.\n * @param {Object=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {!goog.events.ListenableKey} Unique key for the listener.\n */\ngoog.events.ListenerMap.prototype.add = function(\n    type, listener, callOnce, opt_useCapture, opt_listenerScope) {\n  'use strict';\n  var typeStr = type.toString();\n  var listenerArray = this.listeners[typeStr];\n  if (!listenerArray) {\n    listenerArray = this.listeners[typeStr] = [];\n    this.typeCount_++;\n  }\n\n  var listenerObj;\n  var index = goog.events.ListenerMap.findListenerIndex_(\n      listenerArray, listener, opt_useCapture, opt_listenerScope);\n  if (index > -1) {\n    listenerObj = listenerArray[index];\n    if (!callOnce) {\n      // Ensure that, if there is an existing callOnce listener, it is no\n      // longer a callOnce listener.\n      listenerObj.callOnce = false;\n    }\n  } else {\n    listenerObj = new goog.events.Listener(\n        listener, null, this.src, typeStr, !!opt_useCapture, opt_listenerScope);\n    listenerObj.callOnce = callOnce;\n    listenerArray.push(listenerObj);\n  }\n  return listenerObj;\n};\n\n\n/**\n * Removes a matching listener.\n * @param {string|!goog.events.EventId} type The listener event type.\n * @param {!Function} listener This listener callback method.\n * @param {boolean=} opt_useCapture The capture mode of the listener.\n * @param {Object=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {boolean} Whether any listener was removed.\n */\ngoog.events.ListenerMap.prototype.remove = function(\n    type, listener, opt_useCapture, opt_listenerScope) {\n  'use strict';\n  var typeStr = type.toString();\n  if (!(typeStr in this.listeners)) {\n    return false;\n  }\n\n  var listenerArray = this.listeners[typeStr];\n  var index = goog.events.ListenerMap.findListenerIndex_(\n      listenerArray, listener, opt_useCapture, opt_listenerScope);\n  if (index > -1) {\n    var listenerObj = listenerArray[index];\n    listenerObj.markAsRemoved();\n    goog.array.removeAt(listenerArray, index);\n    if (listenerArray.length == 0) {\n      delete this.listeners[typeStr];\n      this.typeCount_--;\n    }\n    return true;\n  }\n  return false;\n};\n\n\n/**\n * Removes the given listener object.\n * @param {!goog.events.ListenableKey} listener The listener to remove.\n * @return {boolean} Whether the listener is removed.\n */\ngoog.events.ListenerMap.prototype.removeByKey = function(listener) {\n  'use strict';\n  var type = listener.type;\n  if (!(type in this.listeners)) {\n    return false;\n  }\n\n  var removed = goog.array.remove(this.listeners[type], listener);\n  if (removed) {\n    /** @type {!goog.events.Listener} */ (listener).markAsRemoved();\n    if (this.listeners[type].length == 0) {\n      delete this.listeners[type];\n      this.typeCount_--;\n    }\n  }\n  return removed;\n};\n\n\n/**\n * Removes all listeners from this map. If opt_type is provided, only\n * listeners that match the given type are removed.\n * @param {string|!goog.events.EventId=} opt_type Type of event to remove.\n * @return {number} Number of listeners removed.\n */\ngoog.events.ListenerMap.prototype.removeAll = function(opt_type) {\n  'use strict';\n  var typeStr = opt_type && opt_type.toString();\n  var count = 0;\n  for (var type in this.listeners) {\n    if (!typeStr || type == typeStr) {\n      var listenerArray = this.listeners[type];\n      for (var i = 0; i < listenerArray.length; i++) {\n        ++count;\n        listenerArray[i].markAsRemoved();\n      }\n      delete this.listeners[type];\n      this.typeCount_--;\n    }\n  }\n  return count;\n};\n\n\n/**\n * Gets all listeners that match the given type and capture mode. The\n * returned array is a copy (but the listener objects are not).\n * @param {string|!goog.events.EventId} type The type of the listeners\n *     to retrieve.\n * @param {boolean} capture The capture mode of the listeners to retrieve.\n * @return {!Array<!goog.events.ListenableKey>} An array of matching\n *     listeners.\n */\ngoog.events.ListenerMap.prototype.getListeners = function(type, capture) {\n  'use strict';\n  var listenerArray = this.listeners[type.toString()];\n  var rv = [];\n  if (listenerArray) {\n    for (var i = 0; i < listenerArray.length; ++i) {\n      var listenerObj = listenerArray[i];\n      if (listenerObj.capture == capture) {\n        rv.push(listenerObj);\n      }\n    }\n  }\n  return rv;\n};\n\n\n/**\n * Gets the goog.events.ListenableKey for the event or null if no such\n * listener is in use.\n *\n * @param {string|!goog.events.EventId} type The type of the listener\n *     to retrieve.\n * @param {!Function} listener The listener function to get.\n * @param {boolean} capture Whether the listener is a capturing listener.\n * @param {Object=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {goog.events.ListenableKey} the found listener or null if not found.\n */\ngoog.events.ListenerMap.prototype.getListener = function(\n    type, listener, capture, opt_listenerScope) {\n  'use strict';\n  var listenerArray = this.listeners[type.toString()];\n  var i = -1;\n  if (listenerArray) {\n    i = goog.events.ListenerMap.findListenerIndex_(\n        listenerArray, listener, capture, opt_listenerScope);\n  }\n  return i > -1 ? listenerArray[i] : null;\n};\n\n\n/**\n * Whether there is a matching listener. If either the type or capture\n * parameters are unspecified, the function will match on the\n * remaining criteria.\n *\n * @param {string|!goog.events.EventId=} opt_type The type of the listener.\n * @param {boolean=} opt_capture The capture mode of the listener.\n * @return {boolean} Whether there is an active listener matching\n *     the requested type and/or capture phase.\n */\ngoog.events.ListenerMap.prototype.hasListener = function(\n    opt_type, opt_capture) {\n  'use strict';\n  var hasType = (opt_type !== undefined);\n  var typeStr = hasType ? opt_type.toString() : '';\n  var hasCapture = (opt_capture !== undefined);\n\n  return goog.object.some(this.listeners, function(listenerArray, type) {\n    'use strict';\n    for (var i = 0; i < listenerArray.length; ++i) {\n      if ((!hasType || listenerArray[i].type == typeStr) &&\n          (!hasCapture || listenerArray[i].capture == opt_capture)) {\n        return true;\n      }\n    }\n\n    return false;\n  });\n};\n\n\n/**\n * Finds the index of a matching goog.events.Listener in the given\n * listenerArray.\n * @param {!Array<!goog.events.Listener>} listenerArray Array of listener.\n * @param {!Function} listener The listener function.\n * @param {boolean=} opt_useCapture The capture flag for the listener.\n * @param {Object=} opt_listenerScope The listener scope.\n * @return {number} The index of the matching listener within the\n *     listenerArray.\n * @private\n */\ngoog.events.ListenerMap.findListenerIndex_ = function(\n    listenerArray, listener, opt_useCapture, opt_listenerScope) {\n  'use strict';\n  for (var i = 0; i < listenerArray.length; ++i) {\n    var listenerObj = listenerArray[i];\n    if (!listenerObj.removed && listenerObj.listener == listener &&\n        listenerObj.capture == !!opt_useCapture &&\n        listenerObj.handler == opt_listenerScope) {\n      return i;\n    }\n  }\n  return -1;\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utilities for manipulating objects/maps/hashes.\n */\ngoog.module('goog.object');\ngoog.module.declareLegacyNamespace();\n\n/**\n * Calls a function for each element in an object/map/hash.\n * @param {?Object<K,V>} obj The object over which to iterate.\n * @param {function(this:T,V,?,?Object<K,V>):?} f The function to call for every\n *     element. This function takes 3 arguments (the value, the key and the\n *     object) and the return value is ignored.\n * @param {T=} opt_obj This is used as the 'this' object within f.\n * @return {void}\n * @template T,K,V\n */\nfunction forEach(obj, f, opt_obj) {\n  for (const key in obj) {\n    f.call(/** @type {?} */ (opt_obj), obj[key], key, obj);\n  }\n}\n\n/**\n * Calls a function for each element in an object/map/hash. If that call returns\n * true, adds the element to a new object.\n * @param {?Object<K,V>} obj The object over which to iterate.\n * @param {function(this:T,V,?,?Object<K,V>):boolean} f The function to call for\n *     every element. This function takes 3 arguments (the value, the key and\n *     the object) and should return a boolean. If the return value is true the\n *     element is added to the result object. If it is false the element is not\n *     included.\n * @param {T=} opt_obj This is used as the 'this' object within f.\n * @return {!Object<K,V>} a new object in which only elements that passed the\n *     test are present.\n * @template T,K,V\n */\nfunction filter(obj, f, opt_obj) {\n  const res = {};\n  for (const key in obj) {\n    if (f.call(/** @type {?} */ (opt_obj), obj[key], key, obj)) {\n      res[key] = obj[key];\n    }\n  }\n  return res;\n}\n\n/**\n * For every element in an object/map/hash calls a function and inserts the\n * result into a new object.\n * @param {?Object<K,V>} obj The object over which to iterate.\n * @param {function(this:T,V,?,?Object<K,V>):R} f The function to call for every\n *     element. This function takes 3 arguments (the value, the key and the\n *     object) and should return something. The result will be inserted into a\n *     new object.\n * @param {T=} opt_obj This is used as the 'this' object within f.\n * @return {!Object<K,R>} a new object with the results from f.\n * @template T,K,V,R\n */\nfunction map(obj, f, opt_obj) {\n  const res = {};\n  for (const key in obj) {\n    res[key] = f.call(/** @type {?} */ (opt_obj), obj[key], key, obj);\n  }\n  return res;\n}\n\n/**\n * Calls a function for each element in an object/map/hash. If any\n * call returns true, returns true (without checking the rest). If\n * all calls return false, returns false.\n * @param {?Object<K,V>} obj The object to check.\n * @param {function(this:T,V,?,?Object<K,V>):boolean} f The function to call for\n *     every element. This function takes 3 arguments (the value, the key and\n *     the object) and should return a boolean.\n * @param {T=} opt_obj This is used as the 'this' object within f.\n * @return {boolean} true if any element passes the test.\n * @template T,K,V\n */\nfunction some(obj, f, opt_obj) {\n  for (const key in obj) {\n    if (f.call(/** @type {?} */ (opt_obj), obj[key], key, obj)) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * Calls a function for each element in an object/map/hash. If\n * all calls return true, returns true. If any call returns false, returns\n * false at this point and does not continue to check the remaining elements.\n * @param {?Object<K,V>} obj The object to check.\n * @param {?function(this:T,V,?,?Object<K,V>):boolean} f The function to call\n *     for every element. This function takes 3 arguments (the value, the key\n *     and the object) and should return a boolean.\n * @param {T=} opt_obj This is used as the 'this' object within f.\n * @return {boolean} false if any element fails the test.\n * @template T,K,V\n */\nfunction every(obj, f, opt_obj) {\n  for (const key in obj) {\n    if (!f.call(/** @type {?} */ (opt_obj), obj[key], key, obj)) {\n      return false;\n    }\n  }\n  return true;\n}\n\n/**\n * Returns the number of key-value pairs in the object map.\n * @param {?Object} obj The object for which to get the number of key-value\n *     pairs.\n * @return {number} The number of key-value pairs in the object map.\n */\nfunction getCount(obj) {\n  let rv = 0;\n  for (const key in obj) {\n    rv++;\n  }\n  return rv;\n}\n\n/**\n * Returns one key from the object map, if any exists.\n * For map literals the returned key will be the first one in most of the\n * browsers (a know exception is Konqueror).\n * @param {?Object} obj The object to pick a key from.\n * @return {string|undefined} The key or undefined if the object is empty.\n */\nfunction getAnyKey(obj) {\n  for (const key in obj) {\n    return key;\n  }\n}\n\n/**\n * Returns one value from the object map, if any exists.\n * For map literals the returned value will be the first one in most of the\n * browsers (a know exception is Konqueror).\n * @param {?Object<K,V>} obj The object to pick a value from.\n * @return {V|undefined} The value or undefined if the object is empty.\n * @template K,V\n */\nfunction getAnyValue(obj) {\n  for (const key in obj) {\n    return obj[key];\n  }\n}\n\n/**\n * Whether the object/hash/map contains the given object as a value.\n * An alias for containsValue(obj, val).\n * @param {?Object<K,V>} obj The object in which to look for val.\n * @param {V} val The object for which to check.\n * @return {boolean} true if val is present.\n * @template K,V\n */\nfunction contains(obj, val) {\n  return containsValue(obj, val);\n}\n\n/**\n * Returns the values of the object/map/hash.\n * @param {?Object<K,V>} obj The object from which to get the values.\n * @return {!Array<V>} The values in the object/map/hash.\n * @template K,V\n */\nfunction getValues(obj) {\n  const res = [];\n  let i = 0;\n  for (const key in obj) {\n    res[i++] = obj[key];\n  }\n  return res;\n}\n\n/**\n * Returns the keys of the object/map/hash.\n * @param {?Object} obj The object from which to get the keys.\n * @return {!Array<string>} Array of property keys.\n */\nfunction getKeys(obj) {\n  const res = [];\n  let i = 0;\n  for (const key in obj) {\n    res[i++] = key;\n  }\n  return res;\n}\n\n/**\n * Get a value from an object multiple levels deep.  This is useful for\n * pulling values from deeply nested objects, such as JSON responses.\n * Example usage: getValueByKeys(jsonObj, 'foo', 'entries', 3)\n * @param {?Object} obj An object to get the value from. Can be array-like.\n * @param {...(string|number|!IArrayLike<number|string>)} var_args A number of\n *     keys (as strings, or numbers, for array-like objects). Can also be\n *     specified as a single array of keys.\n * @return {*} The resulting value. If, at any point, the value for a key in the\n *     current object is null or undefined, returns undefined.\n */\nfunction getValueByKeys(obj, var_args) {\n  const isArrayLike = goog.isArrayLike(var_args);\n  const keys = isArrayLike ?\n      /** @type {!IArrayLike<number|string>} */ (var_args) :\n      arguments;\n\n  // Start with the 2nd parameter for the variable parameters syntax.\n  for (let i = isArrayLike ? 0 : 1; i < keys.length; i++) {\n    if (obj == null) return undefined;\n    obj = obj[keys[i]];\n  }\n\n  return obj;\n}\n\n/**\n * Whether the object/map/hash contains the given key.\n * @param {?Object} obj The object in which to look for key.\n * @param {?} key The key for which to check.\n * @return {boolean} true If the map contains the key.\n */\nfunction containsKey(obj, key) {\n  return obj !== null && key in obj;\n}\n\n/**\n * Whether the object/map/hash contains the given value. This is O(n).\n * @param {?Object<K,V>} obj The object in which to look for val.\n * @param {V} val The value for which to check.\n * @return {boolean} true If the map contains the value.\n * @template K,V\n */\nfunction containsValue(obj, val) {\n  for (const key in obj) {\n    if (obj[key] == val) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * Searches an object for an element that satisfies the given condition and\n * returns its key.\n * @param {?Object<K,V>} obj The object to search in.\n * @param {function(this:T,V,string,?Object<K,V>):boolean} f The function to\n *     call for every element. Takes 3 arguments (the value, the key and the\n *     object) and should return a boolean.\n * @param {T=} thisObj An optional \"this\" context for the function.\n * @return {string|undefined} The key of an element for which the function\n *     returns true or undefined if no such element is found.\n * @template T,K,V\n */\nfunction findKey(obj, f, thisObj = undefined) {\n  for (const key in obj) {\n    if (f.call(/** @type {?} */ (thisObj), obj[key], key, obj)) {\n      return key;\n    }\n  }\n  return undefined;\n}\n\n/**\n * Searches an object for an element that satisfies the given condition and\n * returns its value.\n * @param {?Object<K,V>} obj The object to search in.\n * @param {function(this:T,V,string,?Object<K,V>):boolean} f The function to\n *     call for every element. Takes 3 arguments (the value, the key and the\n *     object) and should return a boolean.\n * @param {T=} thisObj An optional \"this\" context for the function.\n * @return {V} The value of an element for which the function returns true or\n *     undefined if no such element is found.\n * @template T,K,V\n */\nfunction findValue(obj, f, thisObj = undefined) {\n  const key = findKey(obj, f, thisObj);\n  return key && obj[key];\n}\n\n/**\n * Whether the object/map/hash is empty.\n * @param {?Object} obj The object to test.\n * @return {boolean} true if obj is empty.\n */\nfunction isEmpty(obj) {\n  for (const key in obj) {\n    return false;\n  }\n  return true;\n}\n\n/**\n * Removes all key value pairs from the object/map/hash.\n * @param {?Object} obj The object to clear.\n * @return {void}\n */\nfunction clear(obj) {\n  for (const i in obj) {\n    delete obj[i];\n  }\n}\n\n/**\n * Removes a key-value pair based on the key.\n * @param {?Object} obj The object from which to remove the key.\n * @param {?} key The key to remove.\n * @return {boolean} Whether an element was removed.\n */\nfunction remove(obj, key) {\n  let rv;\n  if (rv = key in /** @type {!Object} */ (obj)) {\n    delete obj[key];\n  }\n  return rv;\n}\n\n/**\n * Adds a key-value pair to the object. Throws an exception if the key is\n * already in use. Use set if you want to change an existing pair.\n * @param {?Object<K,V>} obj The object to which to add the key-value pair.\n * @param {string} key The key to add.\n * @param {V} val The value to add.\n * @return {void}\n * @template K,V\n */\nfunction add(obj, key, val) {\n  if (obj !== null && key in obj) {\n    throw new Error(`The object already contains the key \"${key}\"`);\n  }\n  set(obj, key, val);\n}\n\n/**\n * Returns the value for the given key.\n * @param {?Object<K,V>} obj The object from which to get the value.\n * @param {string} key The key for which to get the value.\n * @param {R=} val The value to return if no item is found for the given key\n *     (default is undefined).\n * @return {V|R|undefined} The value for the given key.\n * @template K,V,R\n */\nfunction get(obj, key, val = undefined) {\n  if (obj !== null && key in obj) {\n    return obj[key];\n  }\n  return val;\n}\n\n/**\n * Adds a key-value pair to the object/map/hash.\n * @param {?Object<K,V>} obj The object to which to add the key-value pair.\n * @param {string} key The key to add.\n * @param {V} value The value to add.\n * @template K,V\n * @return {void}\n */\nfunction set(obj, key, value) {\n  obj[key] = value;\n}\n\n/**\n * Adds a key-value pair to the object/map/hash if it doesn't exist yet.\n * @param {?Object<K,V>} obj The object to which to add the key-value pair.\n * @param {string} key The key to add.\n * @param {V} value The value to add if the key wasn't present.\n * @return {V} The value of the entry at the end of the function.\n * @template K,V\n */\nfunction setIfUndefined(obj, key, value) {\n  return key in /** @type {!Object} */ (obj) ? obj[key] : (obj[key] = value);\n}\n\n/**\n * Sets a key and value to an object if the key is not set. The value will be\n * the return value of the given function. If the key already exists, the\n * object will not be changed and the function will not be called (the function\n * will be lazily evaluated -- only called if necessary).\n * This function is particularly useful when used with an `Object` which is\n * acting as a cache.\n * @param {?Object<K,V>} obj The object to which to add the key-value pair.\n * @param {string} key The key to add.\n * @param {function():V} f The value to add if the key wasn't present.\n * @return {V} The value of the entry at the end of the function.\n * @template K,V\n */\nfunction setWithReturnValueIfNotSet(obj, key, f) {\n  if (key in obj) {\n    return obj[key];\n  }\n\n  const val = f();\n  obj[key] = val;\n  return val;\n}\n\n/**\n * Compares two objects for equality using === on the values.\n * @param {!Object<K,V>} a\n * @param {!Object<K,V>} b\n * @return {boolean}\n * @template K,V\n */\nfunction equals(a, b) {\n  for (const k in a) {\n    if (!(k in b) || a[k] !== b[k]) {\n      return false;\n    }\n  }\n  for (const k in b) {\n    if (!(k in a)) {\n      return false;\n    }\n  }\n  return true;\n}\n\n/**\n * Returns a shallow clone of the object.\n * @param {?Object<K,V>} obj Object to clone.\n * @return {!Object<K,V>} Clone of the input object.\n * @template K,V\n */\nfunction clone(obj) {\n  const res = {};\n  for (const key in obj) {\n    res[key] = obj[key];\n  }\n  return res;\n}\n\n/**\n * Clones a value. The input may be an Object, Array, or basic type. Objects and\n * arrays will be cloned recursively.\n * WARNINGS:\n * <code>unsafeClone</code> does not detect reference loops. Objects\n * that refer to themselves will cause infinite recursion.\n * <code>unsafeClone</code> is unaware of unique identifiers, and\n * copies UIDs created by <code>getUid</code> into cloned results.\n * @param {T} obj The value to clone.\n * @return {T} A clone of the input value.\n * @template T\n */\nfunction unsafeClone(obj) {\n  if (!obj || typeof obj !== 'object') return obj;\n  if (typeof obj.clone === 'function') return obj.clone();\n  if (typeof Map !== 'undefined' && obj instanceof Map) {\n    return new Map(obj);\n  } else if (typeof Set !== 'undefined' && obj instanceof Set) {\n    return new Set(obj);\n  } else if (obj instanceof Date) {\n    return new Date(obj.getTime());\n  }\n  const clone = Array.isArray(obj) ? [] :\n      typeof ArrayBuffer === 'function' &&\n          typeof ArrayBuffer.isView === 'function' && ArrayBuffer.isView(obj) &&\n          !(obj instanceof DataView) ?\n                                     new obj.constructor(obj.length) :\n                                     {};\n  for (const key in obj) {\n    clone[key] = unsafeClone(obj[key]);\n  }\n  return clone;\n}\n\n/**\n * Returns a new object in which all the keys and values are interchanged\n * (keys become values and values become keys). If multiple keys map to the\n * same value, the chosen transposed value is implementation-dependent.\n * @param {?Object} obj The object to transpose.\n * @return {!Object} The transposed object.\n */\nfunction transpose(obj) {\n  const transposed = {};\n  for (const key in obj) {\n    transposed[obj[key]] = key;\n  }\n  return transposed;\n}\n\n/**\n * The names of the fields that are defined on Object.prototype.\n * @type {!Array<string>}\n */\nconst PROTOTYPE_FIELDS = [\n  'constructor',\n  'hasOwnProperty',\n  'isPrototypeOf',\n  'propertyIsEnumerable',\n  'toLocaleString',\n  'toString',\n  'valueOf',\n];\n\n/**\n * Extends an object with another object.\n * This operates 'in-place'; it does not create a new Object.\n * Example:\n * var o = {};\n * extend(o, {a: 0, b: 1});\n * o; // {a: 0, b: 1}\n * extend(o, {b: 2, c: 3});\n * o; // {a: 0, b: 2, c: 3}\n * @param {?Object} target The object to modify. Existing properties will be\n *     overwritten if they are also present in one of the objects in `var_args`.\n * @param {...(?Object|undefined)} var_args The objects from which values\n *     will be copied.\n * @return {void}\n * @deprecated Prefer Object.assign\n */\nfunction extend(target, var_args) {\n  let key;\n  let source;\n  for (let i = 1; i < arguments.length; i++) {\n    source = arguments[i];\n    for (key in source) {\n      target[key] = source[key];\n    }\n\n    // For IE the for-in-loop does not contain any properties that are not\n    // enumerable on the prototype object (for example isPrototypeOf from\n    // Object.prototype) and it will also not include 'replace' on objects that\n    // extend String and change 'replace' (not that it is common for anyone to\n    // extend anything except Object).\n\n    for (let j = 0; j < PROTOTYPE_FIELDS.length; j++) {\n      key = PROTOTYPE_FIELDS[j];\n      if (Object.prototype.hasOwnProperty.call(source, key)) {\n        target[key] = source[key];\n      }\n    }\n  }\n}\n\n/**\n * Creates a new object built from the key-value pairs provided as arguments.\n * @param {...*} var_args If only one argument is provided and it is an array\n *     then this is used as the arguments, otherwise even arguments are used as\n *     the property names and odd arguments are used as the property values.\n * @return {!Object} The new object.\n * @throws {!Error} If there are uneven number of arguments or there is only one\n *     non array argument.\n */\nfunction create(var_args) {\n  const argLength = arguments.length;\n  if (argLength == 1 && Array.isArray(arguments[0])) {\n    return create.apply(null, arguments[0]);\n  }\n\n  if (argLength % 2) {\n    throw new Error('Uneven number of arguments');\n  }\n\n  const rv = {};\n  for (let i = 0; i < argLength; i += 2) {\n    rv[arguments[i]] = arguments[i + 1];\n  }\n  return rv;\n}\n\n/**\n * Creates a new object where the property names come from the arguments but\n * the value is always set to true\n * @param {...*} var_args If only one argument is provided and it is an array\n *     then this is used as the arguments, otherwise the arguments are used as\n *     the property names.\n * @return {!Object} The new object.\n */\nfunction createSet(var_args) {\n  const argLength = arguments.length;\n  if (argLength == 1 && Array.isArray(arguments[0])) {\n    return createSet.apply(null, arguments[0]);\n  }\n\n  const rv = {};\n  for (let i = 0; i < argLength; i++) {\n    rv[arguments[i]] = true;\n  }\n  return rv;\n}\n\n/**\n * Creates an immutable view of the underlying object, if the browser\n * supports immutable objects.\n * In default mode, writes to this view will fail silently. In strict mode,\n * they will throw an error.\n * @param {!Object<K,V>} obj An object.\n * @return {!Object<K,V>} An immutable view of that object, or the original\n *     object if this browser does not support immutables.\n * @template K,V\n */\nfunction createImmutableView(obj) {\n  let result = obj;\n  if (Object.isFrozen && !Object.isFrozen(obj)) {\n    result = Object.create(obj);\n    Object.freeze(result);\n  }\n  return result;\n}\n\n/**\n * @param {!Object} obj An object.\n * @return {boolean} Whether this is an immutable view of the object.\n */\nfunction isImmutableView(obj) {\n  return !!Object.isFrozen && Object.isFrozen(obj);\n}\n\n/**\n * Get all properties names on a given Object regardless of enumerability.\n * <p> If the browser does not support `Object.getOwnPropertyNames` nor\n * `Object.getPrototypeOf` then this is equivalent to using\n * `getKeys`\n * @param {?Object} obj The object to get the properties of.\n * @param {boolean=} includeObjectPrototype Whether properties defined on\n *     `Object.prototype` should be included in the result.\n * @param {boolean=} includeFunctionPrototype Whether properties defined on\n *     `Function.prototype` should be included in the result.\n * @return {!Array<string>}\n * @public\n */\nfunction getAllPropertyNames(\n    obj, includeObjectPrototype = undefined,\n    includeFunctionPrototype = undefined) {\n  if (!obj) {\n    return [];\n  }\n\n  // Naively use a for..in loop to get the property names if the browser doesn't\n  // support any other APIs for getting it.\n  if (!Object.getOwnPropertyNames || !Object.getPrototypeOf) {\n    return getKeys(obj);\n  }\n\n  const visitedSet = {};\n\n  // Traverse the prototype chain and add all properties to the visited set.\n  let proto = obj;\n  while (proto && (proto !== Object.prototype || !!includeObjectPrototype) &&\n         (proto !== Function.prototype || !!includeFunctionPrototype)) {\n    const names = Object.getOwnPropertyNames(proto);\n    for (let i = 0; i < names.length; i++) {\n      visitedSet[names[i]] = true;\n    }\n    proto = Object.getPrototypeOf(proto);\n  }\n\n  return getKeys(visitedSet);\n}\n\n/**\n * Given a ES5 or ES6 class reference, return its super class / super\n * constructor.\n * This should be used in rare cases where you need to walk up the inheritance\n * tree (this is generally a bad idea). But this work with ES5 and ES6 classes,\n * unlike relying on the superClass_ property.\n * Note: To start walking up the hierarchy from an instance call this with its\n * `constructor` property; e.g. `getSuperClass(instance.constructor)`.\n * @param {function(new: ?)} constructor\n * @return {?Object}\n */\nfunction getSuperClass(constructor) {\n  const proto = Object.getPrototypeOf(constructor.prototype);\n  return proto && proto.constructor;\n}\n\nexports = {\n  add,\n  clear,\n  clone,\n  contains,\n  containsKey,\n  containsValue,\n  create,\n  createImmutableView,\n  createSet,\n  equals,\n  every,\n  extend,\n  filter,\n  findKey,\n  findValue,\n  forEach,\n  get,\n  getAllPropertyNames,\n  getAnyKey,\n  getAnyValue,\n  getCount,\n  getKeys,\n  getSuperClass,\n  getValueByKeys,\n  getValues,\n  isEmpty,\n  isImmutableView,\n  map,\n  remove,\n  set,\n  setIfUndefined,\n  setWithReturnValueIfNotSet,\n  some,\n  transpose,\n  unsafeClone,\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview An event manager for both native browser event\n * targets and custom JavaScript event targets\n * (`goog.events.Listenable`). This provides an abstraction\n * over browsers' event systems.\n *\n * It also provides a simulation of W3C event model's capture phase in\n * Internet Explorer (IE 8 and below). Caveat: the simulation does not\n * interact well with listeners registered directly on the elements\n * (bypassing goog.events) or even with listeners registered via\n * goog.events in a separate JS binary. In these cases, we provide\n * no ordering guarantees.\n *\n * The listeners will receive a \"patched\" event object. Such event object\n * contains normalized values for certain event properties that differs in\n * different browsers.\n *\n * Example usage:\n * <pre>\n * goog.events.listen(myNode, 'click', function(e) { alert('woo') });\n * goog.events.listen(myNode, 'mouseover', mouseHandler, true);\n * goog.events.unlisten(myNode, 'mouseover', mouseHandler, true);\n * goog.events.removeAll(myNode);\n * </pre>\n *\n *                                            in IE and event object patching]\n *\n * @see ../demos/events.html\n * @see ../demos/event-propagation.html\n * @see ../demos/stopevent.html\n */\n\n// IMPLEMENTATION NOTES:\n// goog.events stores an auxiliary data structure on each EventTarget\n// source being listened on. This allows us to take advantage of GC,\n// having the data structure GC'd when the EventTarget is GC'd. This\n// GC behavior is equivalent to using W3C DOM Events directly.\n\ngoog.provide('goog.events');\ngoog.provide('goog.events.CaptureSimulationMode');\ngoog.provide('goog.events.Key');\ngoog.provide('goog.events.ListenableType');\n\ngoog.require('goog.asserts');\ngoog.require('goog.debug.entryPointRegistry');\ngoog.require('goog.events.BrowserEvent');\ngoog.require('goog.events.BrowserFeature');\ngoog.require('goog.events.Listenable');\ngoog.require('goog.events.ListenerMap');\ngoog.requireType('goog.debug.ErrorHandler');\ngoog.requireType('goog.events.EventId');\ngoog.requireType('goog.events.EventLike');\ngoog.requireType('goog.events.EventWrapper');\ngoog.requireType('goog.events.ListenableKey');\ngoog.requireType('goog.events.Listener');\n\n\n/**\n * @typedef {number|goog.events.ListenableKey}\n */\ngoog.events.Key;\n\n\n/**\n * @typedef {EventTarget|goog.events.Listenable}\n */\ngoog.events.ListenableType;\n\n\n/**\n * Property name on a native event target for the listener map\n * associated with the event target.\n * @private @const {string}\n */\ngoog.events.LISTENER_MAP_PROP_ = 'closure_lm_' + ((Math.random() * 1e6) | 0);\n\n\n/**\n * String used to prepend to IE event types.\n * @const\n * @private\n */\ngoog.events.onString_ = 'on';\n\n\n/**\n * Map of computed \"on<eventname>\" strings for IE event types. Caching\n * this removes an extra object allocation in goog.events.listen which\n * improves IE6 performance.\n * @const\n * @dict\n * @private\n */\ngoog.events.onStringMap_ = {};\n\n\n/**\n * @enum {number} Different capture simulation mode for IE8-.\n */\ngoog.events.CaptureSimulationMode = {\n  /**\n   * Does not perform capture simulation. Will asserts in IE8- when you\n   * add capture listeners.\n   */\n  OFF_AND_FAIL: 0,\n\n  /**\n   * Does not perform capture simulation, silently ignore capture\n   * listeners.\n   */\n  OFF_AND_SILENT: 1,\n\n  /**\n   * Performs capture simulation.\n   */\n  ON: 2\n};\n\n\n/**\n * @define {number} The capture simulation mode for IE8-. By default,\n *     this is ON.\n */\ngoog.events.CAPTURE_SIMULATION_MODE =\n    goog.define('goog.events.CAPTURE_SIMULATION_MODE', 2);\n\n\n/**\n * Estimated count of total native listeners.\n * @private {number}\n */\ngoog.events.listenerCountEstimate_ = 0;\n\n\n/**\n * Adds an event listener for a specific event on a native event\n * target (such as a DOM element) or an object that has implemented\n * {@link goog.events.Listenable}. A listener can only be added once\n * to an object and if it is added again the key for the listener is\n * returned. Note that if the existing listener is a one-off listener\n * (registered via listenOnce), it will no longer be a one-off\n * listener after a call to listen().\n *\n * @param {EventTarget|goog.events.Listenable} src The node to listen\n *     to events on.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type or array of event types.\n * @param {function(this:T, EVENTOBJ):?|{handleEvent:function(?):?}|null}\n *     listener Callback method, or an object with a handleEvent function.\n *     WARNING: passing an Object is now softly deprecated.\n * @param {(boolean|!AddEventListenerOptions)=} opt_options\n * @param {T=} opt_handler Element in whose scope to call the listener.\n * @return {goog.events.Key} Unique key for the listener.\n * @template T,EVENTOBJ\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.events.listen = function(src, type, listener, opt_options, opt_handler) {\n  'use strict';\n  if (opt_options && opt_options.once) {\n    return goog.events.listenOnce(\n        src, type, listener, opt_options, opt_handler);\n  }\n  if (Array.isArray(type)) {\n    for (var i = 0; i < type.length; i++) {\n      goog.events.listen(src, type[i], listener, opt_options, opt_handler);\n    }\n    return null;\n  }\n\n  listener = goog.events.wrapListener(listener);\n  if (goog.events.Listenable.isImplementedBy(src)) {\n    var capture =\n        goog.isObject(opt_options) ? !!opt_options.capture : !!opt_options;\n    return src.listen(\n        /** @type {string|!goog.events.EventId} */ (type), listener, capture,\n        opt_handler);\n  } else {\n    return goog.events.listen_(\n        /** @type {!EventTarget} */ (src), type, listener,\n        /* callOnce */ false, opt_options, opt_handler);\n  }\n};\n\n\n/**\n * Adds an event listener for a specific event on a native event\n * target. A listener can only be added once to an object and if it\n * is added again the key for the listener is returned.\n *\n * Note that a one-off listener will not change an existing listener,\n * if any. On the other hand a normal listener will change existing\n * one-off listener to become a normal listener.\n *\n * @param {EventTarget} src The node to listen to events on.\n * @param {string|?goog.events.EventId<EVENTOBJ>} type Event type.\n * @param {!Function} listener Callback function.\n * @param {boolean} callOnce Whether the listener is a one-off\n *     listener or otherwise.\n * @param {(boolean|!AddEventListenerOptions)=} opt_options\n * @param {Object=} opt_handler Element in whose scope to call the listener.\n * @return {goog.events.ListenableKey} Unique key for the listener.\n * @template EVENTOBJ\n * @private\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.events.listen_ = function(\n    src, type, listener, callOnce, opt_options, opt_handler) {\n  'use strict';\n  if (!type) {\n    throw new Error('Invalid event type');\n  }\n\n  var capture =\n      goog.isObject(opt_options) ? !!opt_options.capture : !!opt_options;\n\n  var listenerMap = goog.events.getListenerMap_(src);\n  if (!listenerMap) {\n    src[goog.events.LISTENER_MAP_PROP_] = listenerMap =\n        new goog.events.ListenerMap(src);\n  }\n\n  var listenerObj = /** @type {goog.events.Listener} */ (\n      listenerMap.add(type, listener, callOnce, capture, opt_handler));\n\n  // If the listenerObj already has a proxy, it has been set up\n  // previously. We simply return.\n  if (listenerObj.proxy) {\n    return listenerObj;\n  }\n\n  var proxy = goog.events.getProxy();\n  listenerObj.proxy = proxy;\n\n  /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n  proxy.src = src;\n  /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n  proxy.listener = listenerObj;\n\n  // Attach the proxy through the browser's API\n  if (src.addEventListener) {\n    // Don't pass an object as `capture` if the browser doesn't support that.\n    if (!goog.events.BrowserFeature.PASSIVE_EVENTS) {\n      opt_options = capture;\n    }\n    // Don't break tests that expect a boolean.\n    if (opt_options === undefined) opt_options = false;\n    src.addEventListener(type.toString(), proxy, opt_options);\n  } else if (src.attachEvent) {\n    // The else if above used to be an unconditional else. It would call\n    // attachEvent come gws or high water. This would sometimes throw an\n    // exception on IE11, spoiling the day of some callers. The previous\n    // incarnation of this code, from 2007, indicates that it replaced an\n    // earlier still version that caused excess allocations on IE6.\n    src.attachEvent(goog.events.getOnString_(type.toString()), proxy);\n  } else if (src.addListener && src.removeListener) {\n    // In IE, MediaQueryList uses addListener() insteadd of addEventListener. In\n    // Safari, there is no global for the MediaQueryList constructor, so we just\n    // check whether the object \"looks like\" MediaQueryList.\n    goog.asserts.assert(\n        type === 'change', 'MediaQueryList only has a change event');\n    src.addListener(proxy);\n  } else {\n    throw new Error('addEventListener and attachEvent are unavailable.');\n  }\n\n  goog.events.listenerCountEstimate_++;\n  return listenerObj;\n};\n\n\n/**\n * Helper function for returning a proxy function.\n * @return {!Function} A new or reused function object.\n */\ngoog.events.getProxy = function() {\n  'use strict';\n  const proxyCallbackFunction = goog.events.handleBrowserEvent_;\n  /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n  const f = function(eventObject) {\n    return proxyCallbackFunction.call(f.src, f.listener, eventObject);\n  };\n  return f;\n};\n\n\n/**\n * Adds an event listener for a specific event on a native event\n * target (such as a DOM element) or an object that has implemented\n * {@link goog.events.Listenable}. After the event has fired the event\n * listener is removed from the target.\n *\n * If an existing listener already exists, listenOnce will do\n * nothing. In particular, if the listener was previously registered\n * via listen(), listenOnce() will not turn the listener into a\n * one-off listener. Similarly, if there is already an existing\n * one-off listener, listenOnce does not modify the listeners (it is\n * still a once listener).\n *\n * @param {EventTarget|goog.events.Listenable} src The node to listen\n *     to events on.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type or array of event types.\n * @param {function(this:T, EVENTOBJ):?|{handleEvent:function(?):?}|null}\n *     listener Callback method.\n * @param {(boolean|!AddEventListenerOptions)=} opt_options\n * @param {T=} opt_handler Element in whose scope to call the listener.\n * @return {goog.events.Key} Unique key for the listener.\n * @template T,EVENTOBJ\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.events.listenOnce = function(\n    src, type, listener, opt_options, opt_handler) {\n  'use strict';\n  if (Array.isArray(type)) {\n    for (var i = 0; i < type.length; i++) {\n      goog.events.listenOnce(src, type[i], listener, opt_options, opt_handler);\n    }\n    return null;\n  }\n\n  listener = goog.events.wrapListener(listener);\n  if (goog.events.Listenable.isImplementedBy(src)) {\n    var capture =\n        goog.isObject(opt_options) ? !!opt_options.capture : !!opt_options;\n    return src.listenOnce(\n        /** @type {string|!goog.events.EventId} */ (type), listener, capture,\n        opt_handler);\n  } else {\n    return goog.events.listen_(\n        /** @type {!EventTarget} */ (src), type, listener,\n        /* callOnce */ true, opt_options, opt_handler);\n  }\n};\n\n\n/**\n * Adds an event listener with a specific event wrapper on a DOM Node or an\n * object that has implemented {@link goog.events.Listenable}. A listener can\n * only be added once to an object.\n *\n * @param {EventTarget|goog.events.Listenable} src The target to\n *     listen to events on.\n * @param {goog.events.EventWrapper} wrapper Event wrapper to use.\n * @param {function(this:T, ?):?|{handleEvent:function(?):?}|null} listener\n *     Callback method, or an object with a handleEvent function.\n * @param {boolean=} opt_capt Whether to fire in capture phase (defaults to\n *     false).\n * @param {T=} opt_handler Element in whose scope to call the listener.\n * @template T\n */\ngoog.events.listenWithWrapper = function(\n    src, wrapper, listener, opt_capt, opt_handler) {\n  'use strict';\n  wrapper.listen(src, listener, opt_capt, opt_handler);\n};\n\n\n/**\n * Removes an event listener which was added with listen().\n *\n * @param {EventTarget|goog.events.Listenable} src The target to stop\n *     listening to events on.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type or array of event types to unlisten to.\n * @param {function(?):?|{handleEvent:function(?):?}|null} listener The\n *     listener function to remove.\n * @param {(boolean|!EventListenerOptions)=} opt_options\n *     whether the listener is fired during the capture or bubble phase of the\n *     event.\n * @param {Object=} opt_handler Element in whose scope to call the listener.\n * @return {?boolean} indicating whether the listener was there to remove.\n * @template EVENTOBJ\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.events.unlisten = function(src, type, listener, opt_options, opt_handler) {\n  'use strict';\n  if (Array.isArray(type)) {\n    for (var i = 0; i < type.length; i++) {\n      goog.events.unlisten(src, type[i], listener, opt_options, opt_handler);\n    }\n    return null;\n  }\n  var capture =\n      goog.isObject(opt_options) ? !!opt_options.capture : !!opt_options;\n\n  listener = goog.events.wrapListener(listener);\n  if (goog.events.Listenable.isImplementedBy(src)) {\n    return src.unlisten(\n        /** @type {string|!goog.events.EventId} */ (type), listener, capture,\n        opt_handler);\n  }\n\n  if (!src) {\n    // TODO(chrishenry): We should tighten the API to only accept\n    // non-null objects, or add an assertion here.\n    return false;\n  }\n\n  var listenerMap = goog.events.getListenerMap_(\n      /** @type {!EventTarget} */ (src));\n  if (listenerMap) {\n    var listenerObj = listenerMap.getListener(\n        /** @type {string|!goog.events.EventId} */ (type), listener, capture,\n        opt_handler);\n    if (listenerObj) {\n      return goog.events.unlistenByKey(listenerObj);\n    }\n  }\n\n  return false;\n};\n\n\n/**\n * Removes an event listener which was added with listen() by the key\n * returned by listen().\n *\n * @param {goog.events.Key} key The key returned by listen() for this\n *     event listener.\n * @return {boolean} indicating whether the listener was there to remove.\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.events.unlistenByKey = function(key) {\n  'use strict';\n  // TODO(chrishenry): Remove this check when tests that rely on this\n  // are fixed.\n  if (typeof key === 'number') {\n    return false;\n  }\n\n  var listener = key;\n  if (!listener || listener.removed) {\n    return false;\n  }\n\n  var src = listener.src;\n  if (goog.events.Listenable.isImplementedBy(src)) {\n    return /** @type {!goog.events.Listenable} */ (src).unlistenByKey(listener);\n  }\n\n  var type = listener.type;\n  /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n  var proxy = listener.proxy;\n  if (src.removeEventListener) {\n    src.removeEventListener(type, proxy, listener.capture);\n  } else if (src.detachEvent) {\n    src.detachEvent(goog.events.getOnString_(type), proxy);\n  } else if (src.addListener && src.removeListener) {\n    src.removeListener(proxy);\n  }\n  goog.events.listenerCountEstimate_--;\n\n  var listenerMap = goog.events.getListenerMap_(\n      /** @type {!EventTarget} */ (src));\n  // TODO(chrishenry): Try to remove this conditional and execute the\n  // first branch always. This should be safe.\n  if (listenerMap) {\n    listenerMap.removeByKey(listener);\n    if (listenerMap.getTypeCount() == 0) {\n      // Null the src, just because this is simple to do (and useful\n      // for IE <= 7).\n      listenerMap.src = null;\n      // We don't use delete here because IE does not allow delete\n      // on a window object.\n      src[goog.events.LISTENER_MAP_PROP_] = null;\n    }\n  } else {\n    /** @type {!goog.events.Listener} */ (listener).markAsRemoved();\n  }\n\n  return true;\n};\n\n\n/**\n * Removes an event listener which was added with listenWithWrapper().\n *\n * @param {EventTarget|goog.events.Listenable} src The target to stop\n *     listening to events on.\n * @param {goog.events.EventWrapper} wrapper Event wrapper to use.\n * @param {function(?):?|{handleEvent:function(?):?}|null} listener The\n *     listener function to remove.\n * @param {boolean=} opt_capt In DOM-compliant browsers, this determines\n *     whether the listener is fired during the capture or bubble phase of the\n *     event.\n * @param {Object=} opt_handler Element in whose scope to call the listener.\n */\ngoog.events.unlistenWithWrapper = function(\n    src, wrapper, listener, opt_capt, opt_handler) {\n  'use strict';\n  wrapper.unlisten(src, listener, opt_capt, opt_handler);\n};\n\n\n/**\n * Removes all listeners from an object. You can also optionally\n * remove listeners of a particular type.\n *\n * @param {Object|undefined} obj Object to remove listeners from. Must be an\n *     EventTarget or a goog.events.Listenable.\n * @param {string|!goog.events.EventId=} opt_type Type of event to remove.\n *     Default is all types.\n * @return {number} Number of listeners removed.\n */\ngoog.events.removeAll = function(obj, opt_type) {\n  'use strict';\n  // TODO(chrishenry): Change the type of obj to\n  // (!EventTarget|!goog.events.Listenable).\n\n  if (!obj) {\n    return 0;\n  }\n\n  if (goog.events.Listenable.isImplementedBy(obj)) {\n    return /** @type {?} */ (obj).removeAllListeners(opt_type);\n  }\n\n  var listenerMap = goog.events.getListenerMap_(\n      /** @type {!EventTarget} */ (obj));\n  if (!listenerMap) {\n    return 0;\n  }\n\n  var count = 0;\n  var typeStr = opt_type && opt_type.toString();\n  for (var type in listenerMap.listeners) {\n    if (!typeStr || type == typeStr) {\n      // Clone so that we don't need to worry about unlistenByKey\n      // changing the content of the ListenerMap.\n      var listeners = listenerMap.listeners[type].concat();\n      for (var i = 0; i < listeners.length; ++i) {\n        if (goog.events.unlistenByKey(listeners[i])) {\n          ++count;\n        }\n      }\n    }\n  }\n  return count;\n};\n\n\n/**\n * Gets the listeners for a given object, type and capture phase.\n *\n * @param {Object} obj Object to get listeners for.\n * @param {string|!goog.events.EventId} type Event type.\n * @param {boolean} capture Capture phase?.\n * @return {!Array<!goog.events.Listener>} Array of listener objects.\n */\ngoog.events.getListeners = function(obj, type, capture) {\n  'use strict';\n  if (goog.events.Listenable.isImplementedBy(obj)) {\n    return /** @type {!goog.events.Listenable} */ (obj).getListeners(\n        type, capture);\n  } else {\n    if (!obj) {\n      // TODO(chrishenry): We should tighten the API to accept\n      // !EventTarget|goog.events.Listenable, and add an assertion here.\n      return [];\n    }\n\n    var listenerMap = goog.events.getListenerMap_(\n        /** @type {!EventTarget} */ (obj));\n    return listenerMap ? listenerMap.getListeners(type, capture) : [];\n  }\n};\n\n\n/**\n * Gets the goog.events.Listener for the event or null if no such listener is\n * in use.\n *\n * @param {EventTarget|goog.events.Listenable} src The target from\n *     which to get listeners.\n * @param {?string|!goog.events.EventId<EVENTOBJ>} type The type of the event.\n * @param {function(EVENTOBJ):?|{handleEvent:function(?):?}|null} listener The\n *     listener function to get.\n * @param {boolean=} opt_capt In DOM-compliant browsers, this determines\n *                            whether the listener is fired during the\n *                            capture or bubble phase of the event.\n * @param {Object=} opt_handler Element in whose scope to call the listener.\n * @return {goog.events.ListenableKey} the found listener or null if not found.\n * @template EVENTOBJ\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.events.getListener = function(src, type, listener, opt_capt, opt_handler) {\n  'use strict';\n  // TODO(chrishenry): Change type from ?string to string, or add assertion.\n  type = /** @type {string} */ (type);\n  listener = goog.events.wrapListener(listener);\n  var capture = !!opt_capt;\n  if (goog.events.Listenable.isImplementedBy(src)) {\n    return src.getListener(type, listener, capture, opt_handler);\n  }\n\n  if (!src) {\n    // TODO(chrishenry): We should tighten the API to only accept\n    // non-null objects, or add an assertion here.\n    return null;\n  }\n\n  var listenerMap = goog.events.getListenerMap_(\n      /** @type {!EventTarget} */ (src));\n  if (listenerMap) {\n    return listenerMap.getListener(type, listener, capture, opt_handler);\n  }\n  return null;\n};\n\n\n/**\n * Returns whether an event target has any active listeners matching the\n * specified signature. If either the type or capture parameters are\n * unspecified, the function will match on the remaining criteria.\n *\n * @param {EventTarget|goog.events.Listenable} obj Target to get\n *     listeners for.\n * @param {string|!goog.events.EventId=} opt_type Event type.\n * @param {boolean=} opt_capture Whether to check for capture or bubble-phase\n *     listeners.\n * @return {boolean} Whether an event target has one or more listeners matching\n *     the requested type and/or capture phase.\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.events.hasListener = function(obj, opt_type, opt_capture) {\n  'use strict';\n  if (goog.events.Listenable.isImplementedBy(obj)) {\n    return obj.hasListener(opt_type, opt_capture);\n  }\n\n  var listenerMap = goog.events.getListenerMap_(\n      /** @type {!EventTarget} */ (obj));\n  return !!listenerMap && listenerMap.hasListener(opt_type, opt_capture);\n};\n\n\n/**\n * Provides a nice string showing the normalized event objects public members\n * @param {Object} e Event Object.\n * @return {string} String of the public members of the normalized event object.\n */\ngoog.events.expose = function(e) {\n  'use strict';\n  var str = [];\n  for (var key in e) {\n    if (e[key] && e[key].id) {\n      str.push(key + ' = ' + e[key] + ' (' + e[key].id + ')');\n    } else {\n      str.push(key + ' = ' + e[key]);\n    }\n  }\n  return str.join('\\n');\n};\n\n\n/**\n * Returns a string with on prepended to the specified type. This is used for IE\n * which expects \"on\" to be prepended. This function caches the string in order\n * to avoid extra allocations in steady state.\n * @param {string} type Event type.\n * @return {string} The type string with 'on' prepended.\n * @private\n */\ngoog.events.getOnString_ = function(type) {\n  'use strict';\n  if (type in goog.events.onStringMap_) {\n    return goog.events.onStringMap_[type];\n  }\n  return goog.events.onStringMap_[type] = goog.events.onString_ + type;\n};\n\n\n/**\n * Fires an object's listeners of a particular type and phase\n *\n * @param {Object} obj Object whose listeners to call.\n * @param {string|!goog.events.EventId} type Event type.\n * @param {boolean} capture Which event phase.\n * @param {Object} eventObject Event object to be passed to listener.\n * @return {boolean} True if all listeners returned true else false.\n */\ngoog.events.fireListeners = function(obj, type, capture, eventObject) {\n  'use strict';\n  if (goog.events.Listenable.isImplementedBy(obj)) {\n    return /** @type {!goog.events.Listenable} */ (obj).fireListeners(\n        type, capture, eventObject);\n  }\n\n  return goog.events.fireListeners_(obj, type, capture, eventObject);\n};\n\n\n/**\n * Fires an object's listeners of a particular type and phase.\n * @param {Object} obj Object whose listeners to call.\n * @param {string|!goog.events.EventId} type Event type.\n * @param {boolean} capture Which event phase.\n * @param {Object} eventObject Event object to be passed to listener.\n * @return {boolean} True if all listeners returned true else false.\n * @private\n */\ngoog.events.fireListeners_ = function(obj, type, capture, eventObject) {\n  'use strict';\n  /** @type {boolean} */\n  var retval = true;\n\n  var listenerMap = goog.events.getListenerMap_(\n      /** @type {EventTarget} */ (obj));\n  if (listenerMap) {\n    // TODO(chrishenry): Original code avoids array creation when there\n    // is no listener, so we do the same. If this optimization turns\n    // out to be not required, we can replace this with\n    // listenerMap.getListeners(type, capture) instead, which is simpler.\n    var listenerArray = listenerMap.listeners[type.toString()];\n    if (listenerArray) {\n      listenerArray = listenerArray.concat();\n      for (var i = 0; i < listenerArray.length; i++) {\n        var listener = listenerArray[i];\n        // We might not have a listener if the listener was removed.\n        if (listener && listener.capture == capture && !listener.removed) {\n          var result = goog.events.fireListener(listener, eventObject);\n          retval = retval && (result !== false);\n        }\n      }\n    }\n  }\n  return retval;\n};\n\n\n/**\n * Fires a listener with a set of arguments\n *\n * @param {goog.events.Listener} listener The listener object to call.\n * @param {Object} eventObject The event object to pass to the listener.\n * @return {*} Result of listener.\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.events.fireListener = function(listener, eventObject) {\n  'use strict';\n  var listenerFn = listener.listener;\n  var listenerHandler = listener.handler || listener.src;\n\n  if (listener.callOnce) {\n    goog.events.unlistenByKey(listener);\n  }\n  return listenerFn.call(listenerHandler, eventObject);\n};\n\n\n/**\n * Gets the total number of listeners currently in the system.\n * @return {number} Number of listeners.\n * @deprecated This returns estimated count, now that Closure no longer\n * stores a central listener registry. We still return an estimation\n * to keep existing listener-related tests passing. In the near future,\n * this function will be removed.\n */\ngoog.events.getTotalListenerCount = function() {\n  'use strict';\n  return goog.events.listenerCountEstimate_;\n};\n\n\n/**\n * Dispatches an event (or event like object) and calls all listeners\n * listening for events of this type. The type of the event is decided by the\n * type property on the event object.\n *\n * If any of the listeners returns false OR calls preventDefault then this\n * function will return false.  If one of the capture listeners calls\n * stopPropagation, then the bubble listeners won't fire.\n *\n * @param {goog.events.Listenable} src The event target.\n * @param {goog.events.EventLike} e Event object.\n * @return {boolean} If anyone called preventDefault on the event object (or\n *     if any of the handlers returns false) this will also return false.\n *     If there are no handlers, or if all handlers return true, this returns\n *     true.\n */\ngoog.events.dispatchEvent = function(src, e) {\n  'use strict';\n  goog.asserts.assert(\n      goog.events.Listenable.isImplementedBy(src),\n      'Can not use goog.events.dispatchEvent with ' +\n          'non-goog.events.Listenable instance.');\n  return src.dispatchEvent(e);\n};\n\n\n/**\n * Installs exception protection for the browser event entry point using the\n * given error handler.\n *\n * @param {goog.debug.ErrorHandler} errorHandler Error handler with which to\n *     protect the entry point.\n */\ngoog.events.protectBrowserEventEntryPoint = function(errorHandler) {\n  'use strict';\n  goog.events.handleBrowserEvent_ =\n      errorHandler.protectEntryPoint(goog.events.handleBrowserEvent_);\n};\n\n\n/**\n * Handles an event and dispatches it to the correct listeners. This\n * function is a proxy for the real listener the user specified.\n *\n * @param {goog.events.Listener} listener The listener object.\n * @param {Event=} opt_evt Optional event object that gets passed in via the\n *     native event handlers.\n * @return {*} Result of the event handler.\n * @this {EventTarget} The object or Element that fired the event.\n * @private\n */\ngoog.events.handleBrowserEvent_ = function(listener, opt_evt) {\n  'use strict';\n  if (listener.removed) {\n    return true;\n  }\n\n  // Otherwise, simply fire the listener.\n  return goog.events.fireListener(\n      listener, new goog.events.BrowserEvent(opt_evt, this));\n};\n\n\n/**\n * This is used to mark the IE event object so we do not do the Closure pass\n * twice for a bubbling event.\n * @param {Event} e The IE browser event.\n * @private\n */\ngoog.events.markIeEvent_ = function(e) {\n  'use strict';\n  // Only the keyCode and the returnValue can be changed. We use keyCode for\n  // non keyboard events.\n  // event.returnValue is a bit more tricky. It is undefined by default. A\n  // boolean false prevents the default action. In a window.onbeforeunload and\n  // the returnValue is non undefined it will be alerted. However, we will only\n  // modify the returnValue for keyboard events. We can get a problem if non\n  // closure events sets the keyCode or the returnValue\n\n  var useReturnValue = false;\n\n  if (e.keyCode == 0) {\n    // We cannot change the keyCode in case that srcElement is input[type=file].\n    // We could test that that is the case but that would allocate 3 objects.\n    // If we use try/catch we will only allocate extra objects in the case of a\n    // failure.\n\n    try {\n      e.keyCode = -1;\n      return;\n    } catch (ex) {\n      useReturnValue = true;\n    }\n  }\n\n  if (useReturnValue ||\n      /** @type {boolean|undefined} */ (e.returnValue) == undefined) {\n    e.returnValue = true;\n  }\n};\n\n\n/**\n * This is used to check if an IE event has already been handled by the Closure\n * system so we do not do the Closure pass twice for a bubbling event.\n * @param {Event} e  The IE browser event.\n * @return {boolean} True if the event object has been marked.\n * @private\n */\ngoog.events.isMarkedIeEvent_ = function(e) {\n  'use strict';\n  return e.keyCode < 0 || e.returnValue != undefined;\n};\n\n\n/**\n * Counter to create unique event ids.\n * @private {number}\n */\ngoog.events.uniqueIdCounter_ = 0;\n\n\n/**\n * Creates a unique event id.\n *\n * @param {string} identifier The identifier.\n * @return {string} A unique identifier.\n * @idGenerator {unique}\n */\ngoog.events.getUniqueId = function(identifier) {\n  'use strict';\n  return identifier + '_' + goog.events.uniqueIdCounter_++;\n};\n\n\n/**\n * @param {EventTarget} src The source object.\n * @return {goog.events.ListenerMap} A listener map for the given\n *     source object, or null if none exists.\n * @private\n */\ngoog.events.getListenerMap_ = function(src) {\n  'use strict';\n  var listenerMap = src[goog.events.LISTENER_MAP_PROP_];\n  // IE serializes the property as well (e.g. when serializing outer\n  // HTML). So we must check that the value is of the correct type.\n  return listenerMap instanceof goog.events.ListenerMap ? listenerMap : null;\n};\n\n\n/**\n * Expando property for listener function wrapper for Object with\n * handleEvent.\n * @private @const {string}\n */\ngoog.events.LISTENER_WRAPPER_PROP_ =\n    '__closure_events_fn_' + ((Math.random() * 1e9) >>> 0);\n\n\n/**\n * @param {Object|Function} listener The listener function or an\n *     object that contains handleEvent method.\n * @return {!Function} Either the original function or a function that\n *     calls obj.handleEvent. If the same listener is passed to this\n *     function more than once, the same function is guaranteed to be\n *     returned.\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.events.wrapListener = function(listener) {\n  'use strict';\n  goog.asserts.assert(listener, 'Listener can not be null.');\n\n  if (typeof listener === 'function') {\n    return listener;\n  }\n\n  goog.asserts.assert(\n      listener.handleEvent, 'An object listener must have handleEvent method.');\n  if (!listener[goog.events.LISTENER_WRAPPER_PROP_]) {\n    listener[goog.events.LISTENER_WRAPPER_PROP_] = function(e) {\n      'use strict';\n      return /** @type {?} */ (listener).handleEvent(e);\n    };\n  }\n  return listener[goog.events.LISTENER_WRAPPER_PROP_];\n};\n\n\n// Register the browser event handler as an entry point, so that\n// it can be monitored for exception handling, etc.\ngoog.debug.entryPointRegistry.register(\n    /**\n     * @param {function(!Function): !Function} transformer The transforming\n     *     function.\n     */\n    function(transformer) {\n      'use strict';\n      goog.events.handleBrowserEvent_ =\n          transformer(goog.events.handleBrowserEvent_);\n    });\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview A disposable implementation of a custom\n * listenable/event target. See also: documentation for\n * `goog.events.Listenable`.\n *\n * @see ../demos/eventtarget.html\n * @see goog.events.Listenable\n */\n\ngoog.provide('goog.events.EventTarget');\n\ngoog.require('goog.Disposable');\ngoog.require('goog.asserts');\ngoog.require('goog.events');\ngoog.require('goog.events.Event');\ngoog.require('goog.events.Listenable');\ngoog.require('goog.events.ListenerMap');\ngoog.require('goog.object');\ngoog.requireType('goog.events.EventId');\ngoog.requireType('goog.events.EventLike');\ngoog.requireType('goog.events.ListenableKey');\n\n\n\n/**\n * An implementation of `goog.events.Listenable` with full W3C\n * EventTarget-like support (capture/bubble mechanism, stopping event\n * propagation, preventing default actions).\n *\n * You may subclass this class to turn your class into a Listenable.\n *\n * Unless propagation is stopped, an event dispatched by an\n * EventTarget will bubble to the parent returned by\n * `getParentEventTarget`. To set the parent, call\n * `setParentEventTarget`. Subclasses that don't support\n * changing the parent can override the setter to throw an error.\n *\n * Example usage:\n * <pre>\n *   var source = new goog.events.EventTarget();\n *   function handleEvent(e) {\n *     alert('Type: ' + e.type + '; Target: ' + e.target);\n *   }\n *   source.listen('foo', handleEvent);\n *   // Or: goog.events.listen(source, 'foo', handleEvent);\n *   ...\n *   source.dispatchEvent('foo');  // will call handleEvent\n *   ...\n *   source.unlisten('foo', handleEvent);\n *   // Or: goog.events.unlisten(source, 'foo', handleEvent);\n * </pre>\n *\n * @constructor\n * @extends {goog.Disposable}\n * @implements {goog.events.Listenable}\n */\ngoog.events.EventTarget = function() {\n  'use strict';\n  goog.Disposable.call(this);\n\n  /**\n   * Maps of event type to an array of listeners.\n   * @private {!goog.events.ListenerMap}\n   */\n  this.eventTargetListeners_ = new goog.events.ListenerMap(this);\n\n  /**\n   * The object to use for event.target. Useful when mixing in an\n   * EventTarget to another object.\n   * @private {!Object}\n   */\n  this.actualEventTarget_ = this;\n\n  /**\n   * Parent event target, used during event bubbling.\n   *\n   * TODO(chrishenry): Change this to goog.events.Listenable. This\n   * currently breaks people who expect getParentEventTarget to return\n   * goog.events.EventTarget.\n   *\n   * @private {?goog.events.EventTarget}\n   */\n  this.parentEventTarget_ = null;\n};\ngoog.inherits(goog.events.EventTarget, goog.Disposable);\ngoog.events.Listenable.addImplementation(goog.events.EventTarget);\n\n\n/**\n * An artificial cap on the number of ancestors you can have. This is mainly\n * for loop detection.\n * @const {number}\n * @private\n */\ngoog.events.EventTarget.MAX_ANCESTORS_ = 1000;\n\n\n/**\n * Returns the parent of this event target to use for bubbling.\n *\n * @return {goog.events.EventTarget} The parent EventTarget or null if\n *     there is no parent.\n * @override\n */\ngoog.events.EventTarget.prototype.getParentEventTarget = function() {\n  'use strict';\n  return this.parentEventTarget_;\n};\n\n\n/**\n * Sets the parent of this event target to use for capture/bubble\n * mechanism.\n * @param {goog.events.EventTarget} parent Parent listenable (null if none).\n */\ngoog.events.EventTarget.prototype.setParentEventTarget = function(parent) {\n  'use strict';\n  this.parentEventTarget_ = parent;\n};\n\n\n/**\n * Adds an event listener to the event target. The same handler can only be\n * added once per the type. Even if you add the same handler multiple times\n * using the same type then it will only be called once when the event is\n * dispatched.\n *\n * @param {string|!goog.events.EventId} type The type of the event to listen for\n * @param {function(?):?|{handleEvent:function(?):?}|null} handler The function\n *     to handle the event. The handler can also be an object that implements\n *     the handleEvent method which takes the event object as argument.\n * @param {boolean=} opt_capture In DOM-compliant browsers, this determines\n *     whether the listener is fired during the capture or bubble phase\n *     of the event.\n * @param {Object=} opt_handlerScope Object in whose scope to call\n *     the listener.\n * @deprecated Use `#listen` instead, when possible. Otherwise, use\n *     `goog.events.listen` if you are passing Object\n *     (instead of Function) as handler.\n */\ngoog.events.EventTarget.prototype.addEventListener = function(\n    type, handler, opt_capture, opt_handlerScope) {\n  'use strict';\n  goog.events.listen(this, type, handler, opt_capture, opt_handlerScope);\n};\n\n\n/**\n * Removes an event listener from the event target. The handler must be the\n * same object as the one added. If the handler has not been added then\n * nothing is done.\n *\n * @param {string|!goog.events.EventId} type The type of the event to listen for\n * @param {function(?):?|{handleEvent:function(?):?}|null} handler The function\n *     to handle the event. The handler can also be an object that implements\n *     the handleEvent method which takes the event object as argument.\n * @param {boolean=} opt_capture In DOM-compliant browsers, this determines\n *     whether the listener is fired during the capture or bubble phase\n *     of the event.\n * @param {Object=} opt_handlerScope Object in whose scope to call\n *     the listener.\n * @deprecated Use `#unlisten` instead, when possible. Otherwise, use\n *     `goog.events.unlisten` if you are passing Object\n *     (instead of Function) as handler.\n */\ngoog.events.EventTarget.prototype.removeEventListener = function(\n    type, handler, opt_capture, opt_handlerScope) {\n  'use strict';\n  goog.events.unlisten(this, type, handler, opt_capture, opt_handlerScope);\n};\n\n\n/**\n * @param {?goog.events.EventLike} e Event object.\n * @return {boolean} If anyone called preventDefault on the event object (or\n *     if any of the listeners returns false) this will also return false.\n * @override\n */\ngoog.events.EventTarget.prototype.dispatchEvent = function(e) {\n  'use strict';\n  this.assertInitialized_();\n\n  var ancestorsTree, ancestor = this.getParentEventTarget();\n  if (ancestor) {\n    ancestorsTree = [];\n    var ancestorCount = 1;\n    for (; ancestor; ancestor = ancestor.getParentEventTarget()) {\n      ancestorsTree.push(ancestor);\n      goog.asserts.assert(\n          (++ancestorCount < goog.events.EventTarget.MAX_ANCESTORS_),\n          'infinite loop');\n    }\n  }\n\n  return goog.events.EventTarget.dispatchEventInternal_(\n      this.actualEventTarget_, e, ancestorsTree);\n};\n\n\n/**\n * Removes listeners from this object.  Classes that extend EventTarget may\n * need to override this method in order to remove references to DOM Elements\n * and additional listeners.\n * @override\n * @protected\n */\ngoog.events.EventTarget.prototype.disposeInternal = function() {\n  'use strict';\n  goog.events.EventTarget.superClass_.disposeInternal.call(this);\n\n  this.removeAllListeners();\n  this.parentEventTarget_ = null;\n};\n\n\n/**\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The event type id.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener Callback\n *     method.\n * @param {boolean=} opt_useCapture Whether to fire in capture phase\n *     (defaults to false).\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {!goog.events.ListenableKey} Unique key for the listener.\n * @template SCOPE,EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.listen = function(\n    type, listener, opt_useCapture, opt_listenerScope) {\n  'use strict';\n  this.assertInitialized_();\n  return this.eventTargetListeners_.add(\n      String(type), listener, false /* callOnce */, opt_useCapture,\n      opt_listenerScope);\n};\n\n\n/**\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The event type id.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener Callback\n *     method.\n * @param {boolean=} opt_useCapture Whether to fire in capture phase\n *     (defaults to false).\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {!goog.events.ListenableKey} Unique key for the listener.\n * @template SCOPE,EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.listenOnce = function(\n    type, listener, opt_useCapture, opt_listenerScope) {\n  'use strict';\n  return this.eventTargetListeners_.add(\n      String(type), listener, true /* callOnce */, opt_useCapture,\n      opt_listenerScope);\n};\n\n\n/**\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The event type id.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener Callback\n *     method.\n * @param {boolean=} opt_useCapture Whether to fire in capture phase\n *     (defaults to false).\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call\n *     the listener.\n * @return {boolean} Whether any listener was removed.\n * @template SCOPE,EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.unlisten = function(\n    type, listener, opt_useCapture, opt_listenerScope) {\n  'use strict';\n  return this.eventTargetListeners_.remove(\n      String(type), listener, opt_useCapture, opt_listenerScope);\n};\n\n\n/**\n * @param {!goog.events.ListenableKey} key The key returned by\n *     listen() or listenOnce().\n * @return {boolean} Whether any listener was removed.\n * @override\n */\ngoog.events.EventTarget.prototype.unlistenByKey = function(key) {\n  'use strict';\n  return this.eventTargetListeners_.removeByKey(key);\n};\n\n\n/**\n * @param {string|!goog.events.EventId=} opt_type Type of event to remove,\n *     default is to remove all types.\n * @return {number} Number of listeners removed.\n * @override\n */\ngoog.events.EventTarget.prototype.removeAllListeners = function(opt_type) {\n  'use strict';\n  // TODO(chrishenry): Previously, removeAllListeners can be called on\n  // uninitialized EventTarget, so we preserve that behavior. We\n  // should remove this when usages that rely on that fact are purged.\n  if (!this.eventTargetListeners_) {\n    return 0;\n  }\n  return this.eventTargetListeners_.removeAll(opt_type);\n};\n\n\n/**\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The type of the\n *     listeners to fire.\n * @param {boolean} capture The capture mode of the listeners to fire.\n * @param {EVENTOBJ} eventObject The event object to fire.\n * @return {boolean} Whether all listeners succeeded without\n *     attempting to prevent default behavior. If any listener returns\n *     false or called goog.events.Event#preventDefault, this returns\n *     false.\n * @template EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.fireListeners = function(\n    type, capture, eventObject) {\n  'use strict';\n  // TODO(chrishenry): Original code avoids array creation when there\n  // is no listener, so we do the same. If this optimization turns\n  // out to be not required, we can replace this with\n  // getListeners(type, capture) instead, which is simpler.\n  var listenerArray = this.eventTargetListeners_.listeners[String(type)];\n  if (!listenerArray) {\n    return true;\n  }\n  listenerArray = listenerArray.concat();\n\n  var rv = true;\n  for (var i = 0; i < listenerArray.length; ++i) {\n    var listener = listenerArray[i];\n    // We might not have a listener if the listener was removed.\n    if (listener && !listener.removed && listener.capture == capture) {\n      var listenerFn = listener.listener;\n      var listenerHandler = listener.handler || listener.src;\n\n      if (listener.callOnce) {\n        this.unlistenByKey(listener);\n      }\n      rv = listenerFn.call(listenerHandler, eventObject) !== false && rv;\n    }\n  }\n\n  return rv && !eventObject.defaultPrevented;\n};\n\n\n/**\n * @param {string|!goog.events.EventId} type The type of the listeners to fire.\n * @param {boolean} capture The capture mode of the listeners to fire.\n * @return {!Array<!goog.events.ListenableKey>} An array of registered\n *     listeners.\n * @template EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.getListeners = function(type, capture) {\n  'use strict';\n  return this.eventTargetListeners_.getListeners(String(type), capture);\n};\n\n\n/**\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The name of the event\n *     without the 'on' prefix.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener The\n *     listener function to get.\n * @param {boolean} capture Whether the listener is a capturing listener.\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {?goog.events.ListenableKey} the found listener or null if not found.\n * @template SCOPE,EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.getListener = function(\n    type, listener, capture, opt_listenerScope) {\n  'use strict';\n  return this.eventTargetListeners_.getListener(\n      String(type), listener, capture, opt_listenerScope);\n};\n\n\n/**\n * @param {string|!goog.events.EventId<EVENTOBJ>=} opt_type Event type.\n * @param {boolean=} opt_capture Whether to check for capture or bubble\n *     listeners.\n * @return {boolean} Whether there is any active listeners matching\n *     the requested type and/or capture phase.\n * @template EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.hasListener = function(\n    opt_type, opt_capture) {\n  'use strict';\n  var id = (opt_type !== undefined) ? String(opt_type) : undefined;\n  return this.eventTargetListeners_.hasListener(id, opt_capture);\n};\n\n\n/**\n * Sets the target to be used for `event.target` when firing\n * event. Mainly used for testing. For example, see\n * `goog.testing.events.mixinListenable`.\n * @param {!Object} target The target.\n */\ngoog.events.EventTarget.prototype.setTargetForTesting = function(target) {\n  'use strict';\n  this.actualEventTarget_ = target;\n};\n\n\n/**\n * Asserts that the event target instance is initialized properly.\n * @private\n */\ngoog.events.EventTarget.prototype.assertInitialized_ = function() {\n  'use strict';\n  goog.asserts.assert(\n      this.eventTargetListeners_,\n      'Event target is not initialized. Did you call the superclass ' +\n          '(goog.events.EventTarget) constructor?');\n};\n\n\n/**\n * Dispatches the given event on the ancestorsTree.\n *\n * @param {!Object} target The target to dispatch on.\n * @param {goog.events.Event|Object|string} e The event object.\n * @param {Array<goog.events.Listenable>=} opt_ancestorsTree The ancestors\n *     tree of the target, in reverse order from the closest ancestor\n *     to the root event target. May be null if the target has no ancestor.\n * @return {boolean} If anyone called preventDefault on the event object (or\n *     if any of the listeners returns false) this will also return false.\n * @private\n */\ngoog.events.EventTarget.dispatchEventInternal_ = function(\n    target, e, opt_ancestorsTree) {\n  'use strict';\n  /** @suppress {missingProperties} */\n  var type = e.type || /** @type {string} */ (e);\n\n  // If accepting a string or object, create a custom event object so that\n  // preventDefault and stopPropagation work with the event.\n  if (typeof e === 'string') {\n    e = new goog.events.Event(e, target);\n  } else if (!(e instanceof goog.events.Event)) {\n    var oldEvent = e;\n    e = new goog.events.Event(type, target);\n    goog.object.extend(e, oldEvent);\n  } else {\n    e.target = e.target || target;\n  }\n\n  var rv = true, currentTarget;\n\n  // Executes all capture listeners on the ancestors, if any.\n  if (opt_ancestorsTree) {\n    for (var i = opt_ancestorsTree.length - 1;\n         !e.hasPropagationStopped() && i >= 0; i--) {\n      currentTarget = e.currentTarget = opt_ancestorsTree[i];\n      rv = currentTarget.fireListeners(type, true, e) && rv;\n    }\n  }\n\n  // Executes capture and bubble listeners on the target.\n  if (!e.hasPropagationStopped()) {\n    currentTarget = /** @type {?} */ (e.currentTarget = target);\n    rv = currentTarget.fireListeners(type, true, e) && rv;\n    if (!e.hasPropagationStopped()) {\n      rv = currentTarget.fireListeners(type, false, e) && rv;\n    }\n  }\n\n  // Executes all bubble listeners on the ancestors, if any.\n  if (opt_ancestorsTree) {\n    for (i = 0; !e.hasPropagationStopped() && i < opt_ancestorsTree.length;\n         i++) {\n      currentTarget = e.currentTarget = opt_ancestorsTree[i];\n      rv = currentTarget.fireListeners(type, false, e) && rv;\n    }\n  }\n\n  return rv;\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview JSON utility functions.\n */\n\n\ngoog.provide('goog.json');\ngoog.provide('goog.json.Replacer');\ngoog.provide('goog.json.Reviver');\ngoog.provide('goog.json.Serializer');\n\n\n/**\n * @define {boolean} If true, use the native JSON parsing API.\n * NOTE: The default `goog.json.parse` implementation is able to handle\n * invalid JSON. JSPB used to produce invalid JSON which is not the case\n * anymore so this is safe to enable for parsing JSPB. Using native JSON is\n * faster and safer than the default implementation using `eval`.\n */\ngoog.json.USE_NATIVE_JSON = goog.define('goog.json.USE_NATIVE_JSON', false);\n\n\n/**\n * Tests if a string is an invalid JSON string. This only ensures that we are\n * not using any invalid characters\n * @param {string} s The string to test.\n * @return {boolean} True if the input is a valid JSON string.\n */\ngoog.json.isValid = function(s) {\n  'use strict';\n  // All empty whitespace is not valid.\n  if (/^\\s*$/.test(s)) {\n    return false;\n  }\n\n  // This is taken from http://www.json.org/json2.js which is released to the\n  // public domain.\n  // Changes: We dissallow \\u2028 Line separator and \\u2029 Paragraph separator\n  // inside strings.  We also treat \\u2028 and \\u2029 as whitespace which they\n  // are in the RFC but IE and Safari does not match \\s to these so we need to\n  // include them in the reg exps in all places where whitespace is allowed.\n  // We allowed \\x7f inside strings because some tools don't escape it,\n  // e.g. http://www.json.org/java/org/json/JSONObject.java\n\n  // Parsing happens in three stages. In the first stage, we run the text\n  // against regular expressions that look for non-JSON patterns. We are\n  // especially concerned with '()' and 'new' because they can cause invocation,\n  // and '=' because it can cause mutation. But just to be safe, we want to\n  // reject all unexpected forms.\n\n  // We split the first stage into 4 regexp operations in order to work around\n  // crippling inefficiencies in IE's and Safari's regexp engines. First we\n  // replace all backslash pairs with '@' (a non-JSON character). Second, we\n  // replace all simple value tokens with ']' characters, but only when followed\n  // by a colon, comma, closing bracket or end of string. Third, we delete all\n  // open brackets that follow a colon or comma or that begin the text. Finally,\n  // we look to see that the remaining characters are only whitespace or ']' or\n  // ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.\n\n  // Don't make these static since they have the global flag.\n  const backslashesRe = /\\\\[\"\\\\\\/bfnrtu]/g;\n  const simpleValuesRe =\n      /(?:\"[^\"\\\\\\n\\r\\u2028\\u2029\\x00-\\x08\\x0a-\\x1f]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)[\\s\\u2028\\u2029]*(?=:|,|]|}|$)/g;\n  const openBracketsRe = /(?:^|:|,)(?:[\\s\\u2028\\u2029]*\\[)+/g;\n  const remainderRe = /^[\\],:{}\\s\\u2028\\u2029]*$/;\n\n  return remainderRe.test(\n      s.replace(backslashesRe, '@')\n          .replace(simpleValuesRe, ']')\n          .replace(openBracketsRe, ''));\n};\n\n/**\n * Logs a parsing error in `JSON.parse` solvable by using `eval`.\n * @private {function(string, !Error)} The first parameter is the error message,\n *     the second is the exception thrown by `JSON.parse`.\n */\ngoog.json.errorLogger_ = () => {};\n\n\n/**\n * Sets an error logger to use if there's a recoverable parsing error.\n * @param {function(string, !Error)} errorLogger The first parameter is the\n *     error message, the second is the exception thrown by `JSON.parse`.\n */\ngoog.json.setErrorLogger = function(errorLogger) {\n  'use strict';\n  goog.json.errorLogger_ = errorLogger;\n};\n\n\n/**\n * Parses a JSON string and returns the result. This throws an exception if\n * the string is an invalid JSON string.\n *\n * Note that this is very slow on large strings. Use JSON.parse if possible.\n *\n * @param {*} s The JSON string to parse.\n * @throws Error if s is invalid JSON.\n * @return {Object} The object generated from the JSON string, or null.\n * @deprecated Use JSON.parse.\n */\ngoog.json.parse = goog.json.USE_NATIVE_JSON ?\n    /** @type {function(*):Object} */ (goog.global['JSON']['parse']) :\n    function(s) {\n      'use strict';\n      let error;\n      try {\n        return goog.global['JSON']['parse'](s);\n      } catch (ex) {\n        error = ex;\n      }\n      const o = String(s);\n      if (goog.json.isValid(o)) {\n\n        try {\n          const result = /** @type {?Object} */ (eval('(' + o + ')'));\n          if (error) {\n            goog.json.errorLogger_('Invalid JSON: ' + o, error);\n          }\n          return result;\n        } catch (ex) {\n        }\n      }\n      throw new Error('Invalid JSON string: ' + o);\n    };\n\n\n/**\n * JSON replacer, as defined in Section 15.12.3 of the ES5 spec.\n * @see http://ecma-international.org/ecma-262/5.1/#sec-15.12.3\n *\n * TODO(nicksantos): Array should also be a valid replacer.\n *\n * @typedef {function(this:Object, string, *): *}\n */\ngoog.json.Replacer;\n\n\n/**\n * JSON reviver, as defined in Section 15.12.2 of the ES5 spec.\n * @see http://ecma-international.org/ecma-262/5.1/#sec-15.12.3\n *\n * @typedef {function(this:Object, string, *): *}\n */\ngoog.json.Reviver;\n\n\n/**\n * Serializes an object or a value to a JSON string.\n *\n * @param {*} object The object to serialize.\n * @param {?goog.json.Replacer=} opt_replacer A replacer function\n *     called for each (key, value) pair that determines how the value\n *     should be serialized. By defult, this just returns the value\n *     and allows default serialization to kick in.\n * @throws Error if there are loops in the object graph.\n * @return {string} A JSON string representation of the input.\n */\ngoog.json.serialize = goog.json.USE_NATIVE_JSON ?\n    /** @type {function(*, ?goog.json.Replacer=):string} */\n    (goog.global['JSON']['stringify']) :\n    function(object, opt_replacer) {\n      'use strict';\n      // NOTE(nicksantos): Currently, we never use JSON.stringify.\n      //\n      // The last time I evaluated this, JSON.stringify had subtle bugs and\n      // behavior differences on all browsers, and the performance win was not\n      // large enough to justify all the issues. This may change in the future\n      // as browser implementations get better.\n      //\n      // assertSerialize in json_test contains if branches for the cases\n      // that fail.\n      return new goog.json.Serializer(opt_replacer).serialize(object);\n    };\n\n\n\n/**\n * Class that is used to serialize JSON objects to a string.\n * @param {?goog.json.Replacer=} opt_replacer Replacer.\n * @constructor\n */\ngoog.json.Serializer = function(opt_replacer) {\n  'use strict';\n  /**\n   * @type {goog.json.Replacer|null|undefined}\n   * @private\n   */\n  this.replacer_ = opt_replacer;\n};\n\n\n/**\n * Serializes an object or a value to a JSON string.\n *\n * @param {*} object The object to serialize.\n * @throws Error if there are loops in the object graph.\n * @return {string} A JSON string representation of the input.\n */\ngoog.json.Serializer.prototype.serialize = function(object) {\n  'use strict';\n  const sb = [];\n  this.serializeInternal(object, sb);\n  return sb.join('');\n};\n\n\n/**\n * Serializes a generic value to a JSON string\n * @protected\n * @param {*} object The object to serialize.\n * @param {Array<string>} sb Array used as a string builder.\n * @throws Error if there are loops in the object graph.\n */\ngoog.json.Serializer.prototype.serializeInternal = function(object, sb) {\n  'use strict';\n  if (object == null) {\n    // undefined == null so this branch covers undefined as well as null\n    sb.push('null');\n    return;\n  }\n\n  if (typeof object == 'object') {\n    if (Array.isArray(object)) {\n      this.serializeArray(object, sb);\n      return;\n    } else if (\n        object instanceof String || object instanceof Number ||\n        object instanceof Boolean) {\n      object = object.valueOf();\n      // Fall through to switch below.\n    } else {\n      this.serializeObject_(/** @type {!Object} */ (object), sb);\n      return;\n    }\n  }\n\n  switch (typeof object) {\n    case 'string':\n      this.serializeString_(object, sb);\n      break;\n    case 'number':\n      this.serializeNumber_(object, sb);\n      break;\n    case 'boolean':\n      sb.push(String(object));\n      break;\n    case 'function':\n      sb.push('null');\n      break;\n    default:\n      throw new Error('Unknown type: ' + typeof object);\n  }\n};\n\n\n/**\n * Character mappings used internally for goog.string.quote\n * @private\n * @type {!Object}\n */\ngoog.json.Serializer.charToJsonCharCache_ = {\n  '\\\"': '\\\\\"',\n  '\\\\': '\\\\\\\\',\n  '/': '\\\\/',\n  '\\b': '\\\\b',\n  '\\f': '\\\\f',\n  '\\n': '\\\\n',\n  '\\r': '\\\\r',\n  '\\t': '\\\\t',\n\n  '\\x0B': '\\\\u000b'  // '\\v' is not supported in JScript\n};\n\n\n/**\n * Regular expression used to match characters that need to be replaced.\n * The S60 browser has a bug where unicode characters are not matched by\n * regular expressions. The condition below detects such behaviour and\n * adjusts the regular expression accordingly.\n * @private\n * @type {!RegExp}\n */\ngoog.json.Serializer.charsToReplace_ = /\\uffff/.test('\\uffff') ?\n    /[\\\\\\\"\\x00-\\x1f\\x7f-\\uffff]/g :\n    /[\\\\\\\"\\x00-\\x1f\\x7f-\\xff]/g;\n\n\n/**\n * Serializes a string to a JSON string\n * @private\n * @param {string} s The string to serialize.\n * @param {Array<string>} sb Array used as a string builder.\n */\ngoog.json.Serializer.prototype.serializeString_ = function(s, sb) {\n  'use strict';\n  // The official JSON implementation does not work with international\n  // characters.\n  sb.push('\"', s.replace(goog.json.Serializer.charsToReplace_, function(c) {\n    'use strict';\n    // caching the result improves performance by a factor 2-3\n    let rv = goog.json.Serializer.charToJsonCharCache_[c];\n    if (!rv) {\n      rv = '\\\\u' + (c.charCodeAt(0) | 0x10000).toString(16).slice(1);\n      goog.json.Serializer.charToJsonCharCache_[c] = rv;\n    }\n    return rv;\n  }), '\"');\n};\n\n\n/**\n * Serializes a number to a JSON string\n * @private\n * @param {number} n The number to serialize.\n * @param {Array<string>} sb Array used as a string builder.\n */\ngoog.json.Serializer.prototype.serializeNumber_ = function(n, sb) {\n  'use strict';\n  sb.push(isFinite(n) && !isNaN(n) ? String(n) : 'null');\n};\n\n\n/**\n * Serializes an array to a JSON string\n * @param {Array<string>} arr The array to serialize.\n * @param {Array<string>} sb Array used as a string builder.\n * @protected\n */\ngoog.json.Serializer.prototype.serializeArray = function(arr, sb) {\n  'use strict';\n  const l = arr.length;\n  sb.push('[');\n  let sep = '';\n  for (let i = 0; i < l; i++) {\n    sb.push(sep);\n\n    const value = arr[i];\n    this.serializeInternal(\n        this.replacer_ ? this.replacer_.call(arr, String(i), value) : value,\n        sb);\n\n    sep = ',';\n  }\n  sb.push(']');\n};\n\n\n/**\n * Serializes an object to a JSON string\n * @private\n * @param {!Object} obj The object to serialize.\n * @param {Array<string>} sb Array used as a string builder.\n */\ngoog.json.Serializer.prototype.serializeObject_ = function(obj, sb) {\n  'use strict';\n  sb.push('{');\n  let sep = '';\n  for (const key in obj) {\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\n      const value = obj[key];\n      // Skip functions.\n      if (typeof value != 'function') {\n        sb.push(sep);\n        this.serializeString_(key, sb);\n        sb.push(':');\n\n        this.serializeInternal(\n            this.replacer_ ? this.replacer_.call(obj, key, value) : value, sb);\n\n        sep = ',';\n      }\n    }\n  }\n  sb.push('}');\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Simple freelist.\n *\n * An anterative to goog.structs.SimplePool, it imposes the requirement that the\n * objects in the list contain a \"next\" property that can be used to maintain\n * the pool.\n */\ngoog.module('goog.async.FreeList');\ngoog.module.declareLegacyNamespace();\n\n/** @template ITEM */\nclass FreeList {\n  /**\n   * @param {function():ITEM} create\n   * @param {function(ITEM):void} reset\n   * @param {number} limit\n   */\n  constructor(create, reset, limit) {\n    /** @private @const {number} */\n    this.limit_ = limit;\n    /** @private @const {function()} */\n    this.create_ = create;\n    /** @private @const {function(ITEM):void} */\n    this.reset_ = reset;\n\n    /** @private {number} */\n    this.occupants_ = 0;\n    /** @private {ITEM} */\n    this.head_ = null;\n  }\n\n  /** @return {ITEM} */\n  get() {\n    let item;\n    if (this.occupants_ > 0) {\n      this.occupants_--;\n      item = this.head_;\n      this.head_ = item.next;\n      item.next = null;\n    } else {\n      item = this.create_();\n    }\n    return item;\n  }\n\n  /** @param {ITEM} item An item available for possible future reuse. */\n  put(item) {\n    this.reset_(item);\n    if (this.occupants_ < this.limit_) {\n      this.occupants_++;\n      item.next = this.head_;\n      this.head_ = item;\n    }\n  }\n\n  /**\n   * Visible for testing.\n   * @return {number}\n   * @package\n   */\n  occupants() {\n    return this.occupants_;\n  }\n}\n\nexports = FreeList;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\ngoog.module('goog.async.WorkQueue');\ngoog.module.declareLegacyNamespace();\n\nconst FreeList = goog.require('goog.async.FreeList');\nconst {assert} = goog.require('goog.asserts');\n\n// TODO(johnlenz): generalize the WorkQueue if this is used by more\n// than goog.async.run.\n\n\n/**\n * A low GC workqueue. The key elements of this design:\n *   - avoids the need for goog.bind or equivalent by carrying scope\n *   - avoids the need for array reallocation by using a linked list\n *   - minimizes work entry objects allocation by recycling objects\n * @final\n * @struct\n */\nclass WorkQueue {\n  constructor() {\n    this.workHead_ = null;\n    this.workTail_ = null;\n  }\n\n  /**\n   * @param {function()} fn\n   * @param {Object|null|undefined} scope\n   */\n  add(fn, scope) {\n    const item = this.getUnusedItem_();\n    item.set(fn, scope);\n\n    if (this.workTail_) {\n      this.workTail_.next = item;\n      this.workTail_ = item;\n    } else {\n      assert(!this.workHead_);\n      this.workHead_ = item;\n      this.workTail_ = item;\n    }\n  }\n\n  /**\n   * @return {?WorkItem}\n   */\n  remove() {\n    let item = null;\n\n    if (this.workHead_) {\n      item = this.workHead_;\n      this.workHead_ = this.workHead_.next;\n      if (!this.workHead_) {\n        this.workTail_ = null;\n      }\n      item.next = null;\n    }\n    return item;\n  }\n\n  /**\n   * @param {!WorkItem} item\n   */\n  returnUnused(item) {\n    WorkQueue.freelist_.put(item);\n  }\n\n  /**\n   * @return {!WorkItem}\n   * @private\n   */\n  getUnusedItem_() {\n    return WorkQueue.freelist_.get();\n  }\n}\n\n/** @define {number} The maximum number of entries to keep for recycling. */\nWorkQueue.DEFAULT_MAX_UNUSED =\n    goog.define('goog.async.WorkQueue.DEFAULT_MAX_UNUSED', 100);\n\n/** @const @private {!FreeList<!WorkItem>} */\nWorkQueue.freelist_ = new FreeList(\n    () => new WorkItem(), item => item.reset(), WorkQueue.DEFAULT_MAX_UNUSED);\n\n/**\n * @final\n * @struct\n */\nclass WorkItem {\n  constructor() {\n    /** @type {?function()} */\n    this.fn = null;\n    /** @type {?Object|null|undefined} */\n    this.scope = null;\n    /** @type {?WorkItem} */\n    this.next = null;\n  }\n\n  /**\n   * @param {function()} fn\n   * @param {Object|null|undefined} scope\n   */\n  set(fn, scope) {\n    this.fn = fn;\n    this.scope = scope;\n    this.next = null;\n  }\n\n  /** Reset the work item so they don't prevent GC before reuse */\n  reset() {\n    this.fn = null;\n    this.scope = null;\n    this.next = null;\n  }\n}\n\nexports = WorkQueue;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\ngoog.module('goog.async.run');\ngoog.module.declareLegacyNamespace();\n\nconst WorkQueue = goog.require('goog.async.WorkQueue');\nconst asyncStackTag = goog.require('goog.debug.asyncStackTag');\nconst nextTick = goog.require('goog.async.nextTick');\nconst throwException = goog.require('goog.async.throwException');\n\n/**\n * @define {boolean} If true, use the global Promise to implement run\n * assuming either the native, or polyfill version will be used. Does still\n * permit tests to use forceNextTick.\n */\ngoog.ASSUME_NATIVE_PROMISE = goog.define('goog.ASSUME_NATIVE_PROMISE', false);\n\n/**\n * The function used to schedule work asynchronousely.\n * @private {function()}\n */\nlet schedule;\n\n/** @private {boolean} */\nlet workQueueScheduled = false;\n\n/** @type {!WorkQueue} */\nlet workQueue = new WorkQueue();\n\n/**\n * Fires the provided callback just before the current callstack unwinds, or as\n * soon as possible after the current JS execution context.\n * @param {function(this:THIS)} callback\n * @param {THIS=} context Object to use as the \"this value\" when calling the\n *     provided function.\n * @template THIS\n */\nlet run = (callback, context = undefined) => {\n  if (!schedule) {\n    initializeRunner();\n  }\n  if (!workQueueScheduled) {\n    // Nothing is currently scheduled, schedule it now.\n    schedule();\n    workQueueScheduled = true;\n  }\n  callback = asyncStackTag.wrap(callback, 'goog.async.run');\n\n  workQueue.add(callback, context);\n};\n\n/** Initializes the function to use to process the work queue. */\nlet initializeRunner = () => {\n  if (goog.ASSUME_NATIVE_PROMISE ||\n      (goog.global.Promise && goog.global.Promise.resolve)) {\n    // Use goog.global.Promise instead of just Promise because the relevant\n    // externs may be missing, and don't alias it because this could confuse the\n    // compiler into thinking the polyfill is required when it should be treated\n    // as optional.\n    const promise = goog.global.Promise.resolve(undefined);\n    schedule = () => {\n      promise.then(run.processWorkQueue);\n    };\n  } else {\n    schedule = () => {\n      nextTick(run.processWorkQueue);\n    };\n  }\n};\n\n/**\n * Forces run to use nextTick instead of Promise.\n * This should only be done in unit tests. It's useful because MockClock\n * replaces nextTick, but not the browser Promise implementation, so it allows\n * Promise-based code to be tested with MockClock.\n * However, we also want to run promises if the MockClock is no longer in\n * control so we schedule a backup \"setTimeout\" to the unmocked timeout if\n * provided.\n * @param {function(function())=} realSetTimeout\n */\nrun.forceNextTick = (realSetTimeout = undefined) => {\n  schedule = () => {\n    nextTick(run.processWorkQueue);\n    if (realSetTimeout) {\n      realSetTimeout(run.processWorkQueue);\n    }\n  };\n};\n\nif (goog.DEBUG) {\n  /** Reset the work queue. Only available for tests in debug mode. */\n  run.resetQueue = () => {\n    workQueueScheduled = false;\n    workQueue = new WorkQueue();\n  };\n\n  /** Resets the scheduler. Only available for tests in debug mode. */\n  run.resetSchedulerForTest = () => {\n    initializeRunner();\n  };\n}\n\n/**\n * Run any pending run work items. This function is not intended\n * for general use, but for use by entry point handlers to run items ahead of\n * nextTick.\n */\nrun.processWorkQueue = () => {\n  // NOTE: additional work queue items may be added while processing.\n  let item = null;\n  while (item = workQueue.remove()) {\n    try {\n      item.fn.call(item.scope);\n    } catch (e) {\n      throwException(e);\n    }\n    workQueue.returnUnused(item);\n  }\n\n  // There are no more work items, allow processing to be scheduled again.\n  workQueueScheduled = false;\n};\n\nexports = run;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utilities for string manipulation.\n */\n\n\n/**\n * Namespace for string utilities\n */\ngoog.provide('goog.string');\ngoog.provide('goog.string.Unicode');\n\ngoog.require('goog.dom.safe');\ngoog.require('goog.html.uncheckedconversions');\ngoog.require('goog.string.Const');\ngoog.require('goog.string.internal');\n\n\n/**\n * @define {boolean} Enables HTML escaping of lowercase letter \"e\" which helps\n * with detection of double-escaping as this letter is frequently used.\n */\ngoog.string.DETECT_DOUBLE_ESCAPING =\n    goog.define('goog.string.DETECT_DOUBLE_ESCAPING', false);\n\n\n/**\n * @define {boolean} Whether to force non-dom html unescaping.\n */\ngoog.string.FORCE_NON_DOM_HTML_UNESCAPING =\n    goog.define('goog.string.FORCE_NON_DOM_HTML_UNESCAPING', false);\n\n\n/**\n * Common Unicode string characters.\n * @enum {string}\n */\ngoog.string.Unicode = {\n  NBSP: '\\xa0',\n  ZERO_WIDTH_SPACE: '\\u200b'  // This is equivalent to <wbr>.\n};\n\n\n/**\n * Fast prefix-checker.\n * @param {string} str The string to check.\n * @param {string} prefix A string to look for at the start of `str`.\n * @return {boolean} True if `str` begins with `prefix`.\n */\ngoog.string.startsWith = goog.string.internal.startsWith;\n\n\n/**\n * Fast suffix-checker.\n * @param {string} str The string to check.\n * @param {string} suffix A string to look for at the end of `str`.\n * @return {boolean} True if `str` ends with `suffix`.\n */\ngoog.string.endsWith = goog.string.internal.endsWith;\n\n\n/**\n * Case-insensitive prefix-checker.\n * @param {string} str The string to check.\n * @param {string} prefix  A string to look for at the end of `str`.\n * @return {boolean} True if `str` begins with `prefix` (ignoring\n *     case).\n */\ngoog.string.caseInsensitiveStartsWith =\n    goog.string.internal.caseInsensitiveStartsWith;\n\n\n/**\n * Case-insensitive suffix-checker.\n * @param {string} str The string to check.\n * @param {string} suffix A string to look for at the end of `str`.\n * @return {boolean} True if `str` ends with `suffix` (ignoring\n *     case).\n */\ngoog.string.caseInsensitiveEndsWith =\n    goog.string.internal.caseInsensitiveEndsWith;\n\n\n/**\n * Case-insensitive equality checker.\n * @param {string} str1 First string to check.\n * @param {string} str2 Second string to check.\n * @return {boolean} True if `str1` and `str2` are the same string,\n *     ignoring case.\n */\ngoog.string.caseInsensitiveEquals = goog.string.internal.caseInsensitiveEquals;\n\n\n/**\n * Does simple python-style string substitution.\n * subs(\"foo%s hot%s\", \"bar\", \"dog\") becomes \"foobar hotdog\".\n * @param {string} str The string containing the pattern.\n * @param {...*} var_args The items to substitute into the pattern.\n * @return {string} A copy of `str` in which each occurrence of\n *     {@code %s} has been replaced an argument from `var_args`.\n */\ngoog.string.subs = function(str, var_args) {\n  'use strict';\n  const splitParts = str.split('%s');\n  let returnString = '';\n\n  const subsArguments = Array.prototype.slice.call(arguments, 1);\n  while (subsArguments.length &&\n         // Replace up to the last split part. We are inserting in the\n         // positions between split parts.\n         splitParts.length > 1) {\n    returnString += splitParts.shift() + subsArguments.shift();\n  }\n\n  return returnString + splitParts.join('%s');  // Join unused '%s'\n};\n\n\n/**\n * Converts multiple whitespace chars (spaces, non-breaking-spaces, new lines\n * and tabs) to a single space, and strips leading and trailing whitespace.\n * @param {string} str Input string.\n * @return {string} A copy of `str` with collapsed whitespace.\n */\ngoog.string.collapseWhitespace = function(str) {\n  'use strict';\n  // Since IE doesn't include non-breaking-space (0xa0) in their \\s character\n  // class (as required by section 7.2 of the ECMAScript spec), we explicitly\n  // include it in the regexp to enforce consistent cross-browser behavior.\n  return str.replace(/[\\s\\xa0]+/g, ' ').replace(/^\\s+|\\s+$/g, '');\n};\n\n\n/**\n * Checks if a string is empty or contains only whitespaces.\n * @param {string} str The string to check.\n * @return {boolean} Whether `str` is empty or whitespace only.\n */\ngoog.string.isEmptyOrWhitespace = goog.string.internal.isEmptyOrWhitespace;\n\n\n/**\n * Checks if a string is empty.\n * @param {string} str The string to check.\n * @return {boolean} Whether `str` is empty.\n */\ngoog.string.isEmptyString = function(str) {\n  'use strict';\n  return str.length == 0;\n};\n\n\n/**\n * Checks if a string is empty or contains only whitespaces.\n *\n * @param {string} str The string to check.\n * @return {boolean} Whether `str` is empty or whitespace only.\n * @deprecated Use goog.string.isEmptyOrWhitespace instead.\n */\ngoog.string.isEmpty = goog.string.isEmptyOrWhitespace;\n\n\n/**\n * Checks if a string is null, undefined, empty or contains only whitespaces.\n * @param {*} str The string to check.\n * @return {boolean} Whether `str` is null, undefined, empty, or\n *     whitespace only.\n * @deprecated Use goog.string.isEmptyOrWhitespace(goog.string.makeSafe(str))\n *     instead.\n */\ngoog.string.isEmptyOrWhitespaceSafe = function(str) {\n  'use strict';\n  return goog.string.isEmptyOrWhitespace(goog.string.makeSafe(str));\n};\n\n\n/**\n * Checks if a string is null, undefined, empty or contains only whitespaces.\n *\n * @param {*} str The string to check.\n * @return {boolean} Whether `str` is null, undefined, empty, or\n *     whitespace only.\n * @deprecated Use goog.string.isEmptyOrWhitespace instead.\n */\ngoog.string.isEmptySafe = goog.string.isEmptyOrWhitespaceSafe;\n\n\n/**\n * Checks if a string is all breaking whitespace.\n * @param {string} str The string to check.\n * @return {boolean} Whether the string is all breaking whitespace.\n */\ngoog.string.isBreakingWhitespace = function(str) {\n  'use strict';\n  return !/[^\\t\\n\\r ]/.test(str);\n};\n\n\n/**\n * Checks if a string contains all letters.\n * @param {string} str string to check.\n * @return {boolean} True if `str` consists entirely of letters.\n */\ngoog.string.isAlpha = function(str) {\n  'use strict';\n  return !/[^a-zA-Z]/.test(str);\n};\n\n\n/**\n * Checks if a string contains only numbers.\n * @param {*} str string to check. If not a string, it will be\n *     casted to one.\n * @return {boolean} True if `str` is numeric.\n */\ngoog.string.isNumeric = function(str) {\n  'use strict';\n  return !/[^0-9]/.test(str);\n};\n\n\n/**\n * Checks if a string contains only numbers or letters.\n * @param {string} str string to check.\n * @return {boolean} True if `str` is alphanumeric.\n */\ngoog.string.isAlphaNumeric = function(str) {\n  'use strict';\n  return !/[^a-zA-Z0-9]/.test(str);\n};\n\n\n/**\n * Checks if a character is a space character.\n * @param {string} ch Character to check.\n * @return {boolean} True if `ch` is a space.\n */\ngoog.string.isSpace = function(ch) {\n  'use strict';\n  return ch == ' ';\n};\n\n\n/**\n * Checks if a character is a valid unicode character.\n * @param {string} ch Character to check.\n * @return {boolean} True if `ch` is a valid unicode character.\n */\ngoog.string.isUnicodeChar = function(ch) {\n  'use strict';\n  return ch.length == 1 && ch >= ' ' && ch <= '~' ||\n      ch >= '\\u0080' && ch <= '\\uFFFD';\n};\n\n\n/**\n * Takes a string and replaces newlines with a space. Multiple lines are\n * replaced with a single space.\n * @param {string} str The string from which to strip newlines.\n * @return {string} A copy of `str` stripped of newlines.\n */\ngoog.string.stripNewlines = function(str) {\n  'use strict';\n  return str.replace(/(\\r\\n|\\r|\\n)+/g, ' ');\n};\n\n\n/**\n * Replaces Windows and Mac new lines with unix style: \\r or \\r\\n with \\n.\n * @param {string} str The string to in which to canonicalize newlines.\n * @return {string} `str` A copy of {@code} with canonicalized newlines.\n */\ngoog.string.canonicalizeNewlines = function(str) {\n  'use strict';\n  return str.replace(/(\\r\\n|\\r|\\n)/g, '\\n');\n};\n\n\n/**\n * Normalizes whitespace in a string, replacing all whitespace chars with\n * a space.\n * @param {string} str The string in which to normalize whitespace.\n * @return {string} A copy of `str` with all whitespace normalized.\n */\ngoog.string.normalizeWhitespace = function(str) {\n  'use strict';\n  return str.replace(/\\xa0|\\s/g, ' ');\n};\n\n\n/**\n * Normalizes spaces in a string, replacing all consecutive spaces and tabs\n * with a single space. Replaces non-breaking space with a space.\n * @param {string} str The string in which to normalize spaces.\n * @return {string} A copy of `str` with all consecutive spaces and tabs\n *    replaced with a single space.\n */\ngoog.string.normalizeSpaces = function(str) {\n  'use strict';\n  return str.replace(/\\xa0|[ \\t]+/g, ' ');\n};\n\n\n/**\n * Removes the breaking spaces from the left and right of the string and\n * collapses the sequences of breaking spaces in the middle into single spaces.\n * The original and the result strings render the same way in HTML.\n * @param {string} str A string in which to collapse spaces.\n * @return {string} Copy of the string with normalized breaking spaces.\n */\ngoog.string.collapseBreakingSpaces = function(str) {\n  'use strict';\n  return str.replace(/[\\t\\r\\n ]+/g, ' ')\n      .replace(/^[\\t\\r\\n ]+|[\\t\\r\\n ]+$/g, '');\n};\n\n\n/**\n * Trims white spaces to the left and right of a string.\n * @param {string} str The string to trim.\n * @return {string} A trimmed copy of `str`.\n */\ngoog.string.trim = goog.string.internal.trim;\n\n\n/**\n * Trims whitespaces at the left end of a string.\n * @param {string} str The string to left trim.\n * @return {string} A trimmed copy of `str`.\n */\ngoog.string.trimLeft = function(str) {\n  'use strict';\n  // Since IE doesn't include non-breaking-space (0xa0) in their \\s character\n  // class (as required by section 7.2 of the ECMAScript spec), we explicitly\n  // include it in the regexp to enforce consistent cross-browser behavior.\n  return str.replace(/^[\\s\\xa0]+/, '');\n};\n\n\n/**\n * Trims whitespaces at the right end of a string.\n * @param {string} str The string to right trim.\n * @return {string} A trimmed copy of `str`.\n */\ngoog.string.trimRight = function(str) {\n  'use strict';\n  // Since IE doesn't include non-breaking-space (0xa0) in their \\s character\n  // class (as required by section 7.2 of the ECMAScript spec), we explicitly\n  // include it in the regexp to enforce consistent cross-browser behavior.\n  return str.replace(/[\\s\\xa0]+$/, '');\n};\n\n\n/**\n * A string comparator that ignores case.\n * -1 = str1 less than str2\n *  0 = str1 equals str2\n *  1 = str1 greater than str2\n *\n * @param {string} str1 The string to compare.\n * @param {string} str2 The string to compare `str1` to.\n * @return {number} The comparator result, as described above.\n */\ngoog.string.caseInsensitiveCompare =\n    goog.string.internal.caseInsensitiveCompare;\n\n\n/**\n * Compares two strings interpreting their numeric substrings as numbers.\n *\n * @param {string} str1 First string.\n * @param {string} str2 Second string.\n * @param {!RegExp} tokenizerRegExp Splits a string into substrings of\n *     non-negative integers, non-numeric characters and optionally fractional\n *     numbers starting with a decimal point.\n * @return {number} Negative if str1 < str2, 0 is str1 == str2, positive if\n *     str1 > str2.\n * @private\n */\ngoog.string.numberAwareCompare_ = function(str1, str2, tokenizerRegExp) {\n  'use strict';\n  if (str1 == str2) {\n    return 0;\n  }\n  if (!str1) {\n    return -1;\n  }\n  if (!str2) {\n    return 1;\n  }\n\n  // Using match to split the entire string ahead of time turns out to be faster\n  // for most inputs than using RegExp.exec or iterating over each character.\n  const tokens1 = str1.toLowerCase().match(tokenizerRegExp);\n  const tokens2 = str2.toLowerCase().match(tokenizerRegExp);\n\n  const count = Math.min(tokens1.length, tokens2.length);\n\n  for (let i = 0; i < count; i++) {\n    const a = tokens1[i];\n    const b = tokens2[i];\n\n    // Compare pairs of tokens, returning if one token sorts before the other.\n    if (a != b) {\n      // Only if both tokens are integers is a special comparison required.\n      // Decimal numbers are sorted as strings (e.g., '.09' < '.1').\n      const num1 = parseInt(a, 10);\n      if (!isNaN(num1)) {\n        const num2 = parseInt(b, 10);\n        if (!isNaN(num2) && num1 - num2) {\n          return num1 - num2;\n        }\n      }\n      return a < b ? -1 : 1;\n    }\n  }\n\n  // If one string is a substring of the other, the shorter string sorts first.\n  if (tokens1.length != tokens2.length) {\n    return tokens1.length - tokens2.length;\n  }\n\n  // The two strings must be equivalent except for case (perfect equality is\n  // tested at the head of the function.) Revert to default ASCII string\n  // comparison to stabilize the sort.\n  return str1 < str2 ? -1 : 1;\n};\n\n\n/**\n * String comparison function that handles non-negative integer numbers in a\n * way humans might expect. Using this function, the string 'File 2.jpg' sorts\n * before 'File 10.jpg', and 'Version 1.9' before 'Version 1.10'. The comparison\n * is mostly case-insensitive, though strings that are identical except for case\n * are sorted with the upper-case strings before lower-case.\n *\n * This comparison function is up to 50x slower than either the default or the\n * case-insensitive compare. It should not be used in time-critical code, but\n * should be fast enough to sort several hundred short strings (like filenames)\n * with a reasonable delay.\n *\n * @param {string} str1 The string to compare in a numerically sensitive way.\n * @param {string} str2 The string to compare `str1` to.\n * @return {number} less than 0 if str1 < str2, 0 if str1 == str2, greater than\n *     0 if str1 > str2.\n */\ngoog.string.intAwareCompare = function(str1, str2) {\n  'use strict';\n  return goog.string.numberAwareCompare_(str1, str2, /\\d+|\\D+/g);\n};\n\n\n/**\n * String comparison function that handles non-negative integer and fractional\n * numbers in a way humans might expect. Using this function, the string\n * 'File 2.jpg' sorts before 'File 10.jpg', and '3.14' before '3.2'. Equivalent\n * to {@link goog.string.intAwareCompare} apart from the way how it interprets\n * dots.\n *\n * @param {string} str1 The string to compare in a numerically sensitive way.\n * @param {string} str2 The string to compare `str1` to.\n * @return {number} less than 0 if str1 < str2, 0 if str1 == str2, greater than\n *     0 if str1 > str2.\n */\ngoog.string.floatAwareCompare = function(str1, str2) {\n  'use strict';\n  return goog.string.numberAwareCompare_(str1, str2, /\\d+|\\.\\d+|\\D+/g);\n};\n\n\n/**\n * Alias for {@link goog.string.floatAwareCompare}.\n *\n * @param {string} str1\n * @param {string} str2\n * @return {number}\n */\ngoog.string.numerateCompare = goog.string.floatAwareCompare;\n\n\n/**\n * URL-encodes a string\n * @param {*} str The string to url-encode.\n * @return {string} An encoded copy of `str` that is safe for urls.\n *     Note that '#', ':', and other characters used to delimit portions\n *     of URLs *will* be encoded.\n */\ngoog.string.urlEncode = function(str) {\n  'use strict';\n  return encodeURIComponent(String(str));\n};\n\n\n/**\n * URL-decodes the string. We need to specially handle '+'s because\n * the javascript library doesn't convert them to spaces.\n * @param {string} str The string to url decode.\n * @return {string} The decoded `str`.\n */\ngoog.string.urlDecode = function(str) {\n  'use strict';\n  return decodeURIComponent(str.replace(/\\+/g, ' '));\n};\n\n\n/**\n * Converts \\n to <br>s or <br />s.\n * @param {string} str The string in which to convert newlines.\n * @param {boolean=} opt_xml Whether to use XML compatible tags.\n * @return {string} A copy of `str` with converted newlines.\n */\ngoog.string.newLineToBr = goog.string.internal.newLineToBr;\n\n\n/**\n * Escapes double quote '\"' and single quote '\\'' characters in addition to\n * '&', '<', and '>' so that a string can be included in an HTML tag attribute\n * value within double or single quotes.\n *\n * It should be noted that > doesn't need to be escaped for the HTML or XML to\n * be valid, but it has been decided to escape it for consistency with other\n * implementations.\n *\n * With goog.string.DETECT_DOUBLE_ESCAPING, this function escapes also the\n * lowercase letter \"e\".\n *\n * NOTE(user):\n * HtmlEscape is often called during the generation of large blocks of HTML.\n * Using statics for the regular expressions and strings is an optimization\n * that can more than half the amount of time IE spends in this function for\n * large apps, since strings and regexes both contribute to GC allocations.\n *\n * Testing for the presence of a character before escaping increases the number\n * of function calls, but actually provides a speed increase for the average\n * case -- since the average case often doesn't require the escaping of all 4\n * characters and indexOf() is much cheaper than replace().\n * The worst case does suffer slightly from the additional calls, therefore the\n * opt_isLikelyToContainHtmlChars option has been included for situations\n * where all 4 HTML entities are very likely to be present and need escaping.\n *\n * Some benchmarks (times tended to fluctuate +-0.05ms):\n *                                     FireFox                     IE6\n * (no chars / average (mix of cases) / all 4 chars)\n * no checks                     0.13 / 0.22 / 0.22         0.23 / 0.53 / 0.80\n * indexOf                       0.08 / 0.17 / 0.26         0.22 / 0.54 / 0.84\n * indexOf + re test             0.07 / 0.17 / 0.28         0.19 / 0.50 / 0.85\n *\n * An additional advantage of checking if replace actually needs to be called\n * is a reduction in the number of object allocations, so as the size of the\n * application grows the difference between the various methods would increase.\n *\n * @param {string} str string to be escaped.\n * @param {boolean=} opt_isLikelyToContainHtmlChars Don't perform a check to see\n *     if the character needs replacing - use this option if you expect each of\n *     the characters to appear often. Leave false if you expect few html\n *     characters to occur in your strings, such as if you are escaping HTML.\n * @return {string} An escaped copy of `str`.\n */\ngoog.string.htmlEscape = function(str, opt_isLikelyToContainHtmlChars) {\n  'use strict';\n  str = goog.string.internal.htmlEscape(str, opt_isLikelyToContainHtmlChars);\n  if (goog.string.DETECT_DOUBLE_ESCAPING) {\n    str = str.replace(goog.string.E_RE_, '&#101;');\n  }\n  return str;\n};\n\n\n/**\n * Regular expression that matches a lowercase letter \"e\", for use in escaping.\n * @const {!RegExp}\n * @private\n */\ngoog.string.E_RE_ = /e/g;\n\n\n/**\n * Unescapes an HTML string.\n *\n * @param {string} str The string to unescape.\n * @return {string} An unescaped copy of `str`.\n */\ngoog.string.unescapeEntities = function(str) {\n  'use strict';\n  if (goog.string.contains(str, '&')) {\n    // We are careful not to use a DOM if we do not have one or we explicitly\n    // requested non-DOM html unescaping.\n    if (!goog.string.FORCE_NON_DOM_HTML_UNESCAPING &&\n        'document' in goog.global) {\n      return goog.string.unescapeEntitiesUsingDom_(str);\n    } else {\n      // Fall back on pure XML entities\n      return goog.string.unescapePureXmlEntities_(str);\n    }\n  }\n  return str;\n};\n\n\n/**\n * Unescapes a HTML string using the provided document.\n *\n * @param {string} str The string to unescape.\n * @param {!Document} document A document to use in escaping the string.\n * @return {string} An unescaped copy of `str`.\n */\ngoog.string.unescapeEntitiesWithDocument = function(str, document) {\n  'use strict';\n  if (goog.string.contains(str, '&')) {\n    return goog.string.unescapeEntitiesUsingDom_(str, document);\n  }\n  return str;\n};\n\n\n/**\n * Unescapes an HTML string using a DOM to resolve non-XML, non-numeric\n * entities. This function is XSS-safe and whitespace-preserving.\n * @private\n * @param {string} str The string to unescape.\n * @param {Document=} opt_document An optional document to use for creating\n *     elements. If this is not specified then the default window.document\n *     will be used.\n * @return {string} The unescaped `str` string.\n */\ngoog.string.unescapeEntitiesUsingDom_ = function(str, opt_document) {\n  'use strict';\n  /** @type {!Object<string, string>} */\n  const seen = {'&amp;': '&', '&lt;': '<', '&gt;': '>', '&quot;': '\"'};\n  /** @type {!Element} */\n  let div;\n  if (opt_document) {\n    div = opt_document.createElement('div');\n  } else {\n    div = goog.global.document.createElement('div');\n  }\n  // Match as many valid entity characters as possible. If the actual entity\n  // happens to be shorter, it will still work as innerHTML will return the\n  // trailing characters unchanged. Since the entity characters do not include\n  // open angle bracket, there is no chance of XSS from the innerHTML use.\n  // Since no whitespace is passed to innerHTML, whitespace is preserved.\n  return str.replace(goog.string.HTML_ENTITY_PATTERN_, function(s, entity) {\n    'use strict';\n    // Check for cached entity.\n    let value = seen[s];\n    if (value) {\n      return value;\n    }\n    // Check for numeric entity.\n    if (entity.charAt(0) == '#') {\n      // Prefix with 0 so that hex entities (e.g. &#x10) parse as hex numbers.\n      const n = Number('0' + entity.slice(1));\n      if (!isNaN(n)) {\n        value = String.fromCharCode(n);\n      }\n    }\n    // Fall back to innerHTML otherwise.\n    if (!value) {\n      // Append a non-entity character to avoid a bug in Webkit that parses\n      // an invalid entity at the end of innerHTML text as the empty string.\n      goog.dom.safe.setInnerHtml(\n          div,\n          goog.html.uncheckedconversions\n              .safeHtmlFromStringKnownToSatisfyTypeContract(\n                  goog.string.Const.from('Single HTML entity.'), s + ' '));\n      // Then remove the trailing character from the result.\n      value = div.firstChild.nodeValue.slice(0, -1);\n    }\n    // Cache and return.\n    return seen[s] = value;\n  });\n};\n\n\n/**\n * Unescapes XML entities.\n * @private\n * @param {string} str The string to unescape.\n * @return {string} An unescaped copy of `str`.\n */\ngoog.string.unescapePureXmlEntities_ = function(str) {\n  'use strict';\n  return str.replace(/&([^;]+);/g, function(s, entity) {\n    'use strict';\n    switch (entity) {\n      case 'amp':\n        return '&';\n      case 'lt':\n        return '<';\n      case 'gt':\n        return '>';\n      case 'quot':\n        return '\"';\n      default:\n        if (entity.charAt(0) == '#') {\n          // Prefix with 0 so that hex entities (e.g. &#x10) parse as hex.\n          const n = Number('0' + entity.slice(1));\n          if (!isNaN(n)) {\n            return String.fromCharCode(n);\n          }\n        }\n        // For invalid entities we just return the entity\n        return s;\n    }\n  });\n};\n\n\n/**\n * Regular expression that matches an HTML entity.\n * See also HTML5: Tokenization / Tokenizing character references.\n * @private\n * @type {!RegExp}\n */\ngoog.string.HTML_ENTITY_PATTERN_ = /&([^;\\s<&]+);?/g;\n\n\n/**\n * Do escaping of whitespace to preserve spatial formatting. We use character\n * entity #160 to make it safer for xml.\n * @param {string} str The string in which to escape whitespace.\n * @param {boolean=} opt_xml Whether to use XML compatible tags.\n * @return {string} An escaped copy of `str`.\n */\ngoog.string.whitespaceEscape = function(str, opt_xml) {\n  'use strict';\n  // This doesn't use goog.string.preserveSpaces for backwards compatibility.\n  return goog.string.newLineToBr(str.replace(/  /g, ' &#160;'), opt_xml);\n};\n\n\n/**\n * Preserve spaces that would be otherwise collapsed in HTML by replacing them\n * with non-breaking space Unicode characters.\n * @param {string} str The string in which to preserve whitespace.\n * @return {string} A copy of `str` with preserved whitespace.\n */\ngoog.string.preserveSpaces = function(str) {\n  'use strict';\n  return str.replace(/(^|[\\n ]) /g, '$1' + goog.string.Unicode.NBSP);\n};\n\n\n/**\n * Strip quote characters around a string.  The second argument is a string of\n * characters to treat as quotes.  This can be a single character or a string of\n * multiple character and in that case each of those are treated as possible\n * quote characters. For example:\n *\n * <pre>\n * goog.string.stripQuotes('\"abc\"', '\"`') --> 'abc'\n * goog.string.stripQuotes('`abc`', '\"`') --> 'abc'\n * </pre>\n *\n * @param {string} str The string to strip.\n * @param {string} quoteChars The quote characters to strip.\n * @return {string} A copy of `str` without the quotes.\n */\ngoog.string.stripQuotes = function(str, quoteChars) {\n  'use strict';\n  const length = quoteChars.length;\n  for (let i = 0; i < length; i++) {\n    const quoteChar = length == 1 ? quoteChars : quoteChars.charAt(i);\n    if (str.charAt(0) == quoteChar && str.charAt(str.length - 1) == quoteChar) {\n      return str.substring(1, str.length - 1);\n    }\n  }\n  return str;\n};\n\n\n/**\n * Truncates a string to a certain length and adds '...' if necessary.  The\n * length also accounts for the ellipsis, so a maximum length of 10 and a string\n * 'Hello World!' produces 'Hello W...'.\n * @param {string} str The string to truncate.\n * @param {number} chars Max number of characters.\n * @param {boolean=} opt_protectEscapedCharacters Whether to protect escaped\n *     characters from being cut off in the middle.\n * @return {string} The truncated `str` string.\n */\ngoog.string.truncate = function(str, chars, opt_protectEscapedCharacters) {\n  'use strict';\n  if (opt_protectEscapedCharacters) {\n    str = goog.string.unescapeEntities(str);\n  }\n\n  if (str.length > chars) {\n    str = str.substring(0, chars - 3) + '...';\n  }\n\n  if (opt_protectEscapedCharacters) {\n    str = goog.string.htmlEscape(str);\n  }\n\n  return str;\n};\n\n\n/**\n * Truncate a string in the middle, adding \"...\" if necessary,\n * and favoring the beginning of the string.\n * @param {string} str The string to truncate the middle of.\n * @param {number} chars Max number of characters.\n * @param {boolean=} opt_protectEscapedCharacters Whether to protect escaped\n *     characters from being cutoff in the middle.\n * @param {number=} opt_trailingChars Optional number of trailing characters to\n *     leave at the end of the string, instead of truncating as close to the\n *     middle as possible.\n * @return {string} A truncated copy of `str`.\n */\ngoog.string.truncateMiddle = function(\n    str, chars, opt_protectEscapedCharacters, opt_trailingChars) {\n  'use strict';\n  if (opt_protectEscapedCharacters) {\n    str = goog.string.unescapeEntities(str);\n  }\n\n  if (opt_trailingChars && str.length > chars) {\n    if (opt_trailingChars > chars) {\n      opt_trailingChars = chars;\n    }\n    const endPoint = str.length - opt_trailingChars;\n    const startPoint = chars - opt_trailingChars;\n    str = str.substring(0, startPoint) + '...' + str.substring(endPoint);\n  } else if (str.length > chars) {\n    // Favor the beginning of the string:\n    let half = Math.floor(chars / 2);\n    const endPos = str.length - half;\n    half += chars % 2;\n    str = str.substring(0, half) + '...' + str.substring(endPos);\n  }\n\n  if (opt_protectEscapedCharacters) {\n    str = goog.string.htmlEscape(str);\n  }\n\n  return str;\n};\n\n\n/**\n * Special chars that need to be escaped for goog.string.quote.\n * @private {!Object<string, string>}\n */\ngoog.string.specialEscapeChars_ = {\n  '\\0': '\\\\0',\n  '\\b': '\\\\b',\n  '\\f': '\\\\f',\n  '\\n': '\\\\n',\n  '\\r': '\\\\r',\n  '\\t': '\\\\t',\n  '\\x0B': '\\\\x0B',  // '\\v' is not supported in JScript\n  '\"': '\\\\\"',\n  '\\\\': '\\\\\\\\',\n  // To support the use case of embedding quoted strings inside of script\n  // tags, we have to make sure HTML comments and opening/closing script tags do\n  // not appear in the resulting string. The specific strings that must be\n  // escaped are documented at:\n  // https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements\n  '<': '\\\\u003C'  // NOTE: JSON.parse crashes on '\\\\x3c'.\n};\n\n\n/**\n * Character mappings used internally for goog.string.escapeChar.\n * @private {!Object<string, string>}\n */\ngoog.string.jsEscapeCache_ = {\n  '\\'': '\\\\\\''\n};\n\n\n/**\n * Encloses a string in double quotes and escapes characters so that the\n * string is a valid JS string. The resulting string is safe to embed in\n * `<script>` tags as \"<\" is escaped.\n * @param {string} s The string to quote.\n * @return {string} A copy of `s` surrounded by double quotes.\n */\ngoog.string.quote = function(s) {\n  'use strict';\n  s = String(s);\n  const sb = ['\"'];\n  for (let i = 0; i < s.length; i++) {\n    const ch = s.charAt(i);\n    const cc = ch.charCodeAt(0);\n    sb[i + 1] = goog.string.specialEscapeChars_[ch] ||\n        ((cc > 31 && cc < 127) ? ch : goog.string.escapeChar(ch));\n  }\n  sb.push('\"');\n  return sb.join('');\n};\n\n\n/**\n * Takes a string and returns the escaped string for that input string.\n * @param {string} str The string to escape.\n * @return {string} An escaped string representing `str`.\n */\ngoog.string.escapeString = function(str) {\n  'use strict';\n  const sb = [];\n  for (let i = 0; i < str.length; i++) {\n    sb[i] = goog.string.escapeChar(str.charAt(i));\n  }\n  return sb.join('');\n};\n\n\n/**\n * Takes a character and returns the escaped string for that character. For\n * example escapeChar(String.fromCharCode(15)) -> \"\\\\x0E\".\n * @param {string} c The character to escape.\n * @return {string} An escaped string representing `c`.\n */\ngoog.string.escapeChar = function(c) {\n  'use strict';\n  if (c in goog.string.jsEscapeCache_) {\n    return goog.string.jsEscapeCache_[c];\n  }\n\n  if (c in goog.string.specialEscapeChars_) {\n    return goog.string.jsEscapeCache_[c] = goog.string.specialEscapeChars_[c];\n  }\n\n  let rv = c;\n  const cc = c.charCodeAt(0);\n  if (cc > 31 && cc < 127) {\n    rv = c;\n  } else {\n    // tab is 9 but handled above\n    if (cc < 256) {\n      rv = '\\\\x';\n      if (cc < 16 || cc > 256) {\n        rv += '0';\n      }\n    } else {\n      rv = '\\\\u';\n      if (cc < 4096) {  // \\u1000\n        rv += '0';\n      }\n    }\n    rv += cc.toString(16).toUpperCase();\n  }\n\n  return goog.string.jsEscapeCache_[c] = rv;\n};\n\n\n/**\n * Determines whether a string contains a substring.\n * @param {string} str The string to search.\n * @param {string} subString The substring to search for.\n * @return {boolean} Whether `str` contains `subString`.\n */\ngoog.string.contains = goog.string.internal.contains;\n\n\n/**\n * Determines whether a string contains a substring, ignoring case.\n * @param {string} str The string to search.\n * @param {string} subString The substring to search for.\n * @return {boolean} Whether `str` contains `subString`.\n */\ngoog.string.caseInsensitiveContains =\n    goog.string.internal.caseInsensitiveContains;\n\n\n/**\n * Returns the non-overlapping occurrences of ss in s.\n * If either s or ss evalutes to false, then returns zero.\n * @param {string} s The string to look in.\n * @param {string} ss The string to look for.\n * @return {number} Number of occurrences of ss in s.\n */\ngoog.string.countOf = function(s, ss) {\n  'use strict';\n  return s && ss ? s.split(ss).length - 1 : 0;\n};\n\n\n/**\n * Removes a substring of a specified length at a specific\n * index in a string.\n * @param {string} s The base string from which to remove.\n * @param {number} index The index at which to remove the substring.\n * @param {number} stringLength The length of the substring to remove.\n * @return {string} A copy of `s` with the substring removed or the full\n *     string if nothing is removed or the input is invalid.\n */\ngoog.string.removeAt = function(s, index, stringLength) {\n  'use strict';\n  let resultStr = s;\n  // If the index is greater or equal to 0 then remove substring\n  if (index >= 0 && index < s.length && stringLength > 0) {\n    resultStr = s.slice(0, index) + s.slice(index + stringLength);\n  }\n  return resultStr;\n};\n\n\n/**\n * Removes the first occurrence of a substring from a string.\n * @param {string} str The base string from which to remove.\n * @param {string} substr The string to remove.\n * @return {string} A copy of `str` with `substr` removed or the\n *     full string if nothing is removed.\n */\ngoog.string.remove = function(str, substr) {\n  'use strict';\n  return str.replace(substr, '');\n};\n\n\n/**\n *  Removes all occurrences of a substring from a string.\n *  @param {string} s The base string from which to remove.\n *  @param {string} ss The string to remove.\n *  @return {string} A copy of `s` with `ss` removed or the full\n *      string if nothing is removed.\n */\ngoog.string.removeAll = function(s, ss) {\n  'use strict';\n  const re = new RegExp(goog.string.regExpEscape(ss), 'g');\n  return s.replace(re, '');\n};\n\n\n/**\n *  Replaces all occurrences of a substring of a string with a new substring.\n *  @param {string} s The base string from which to remove.\n *  @param {string} ss The string to replace.\n *  @param {string} replacement The replacement string.\n *  @return {string} A copy of `s` with `ss` replaced by\n *      `replacement` or the original string if nothing is replaced.\n */\ngoog.string.replaceAll = function(s, ss, replacement) {\n  'use strict';\n  const re = new RegExp(goog.string.regExpEscape(ss), 'g');\n  return s.replace(re, replacement.replace(/\\$/g, '$$$$'));\n};\n\n\n/**\n * Escapes characters in the string that are not safe to use in a RegExp.\n * @param {*} s The string to escape. If not a string, it will be casted\n *     to one.\n * @return {string} A RegExp safe, escaped copy of `s`.\n */\ngoog.string.regExpEscape = function(s) {\n  'use strict';\n  return String(s)\n      .replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1')\n      .replace(/\\x08/g, '\\\\x08');\n};\n\n\n/**\n * Repeats a string n times.\n * @param {string} string The string to repeat.\n * @param {number} length The number of times to repeat.\n * @return {string} A string containing `length` repetitions of\n *     `string`.\n */\ngoog.string.repeat = (String.prototype.repeat) ? function(string, length) {\n  'use strict';\n  // The native method is over 100 times faster than the alternative.\n  return string.repeat(length);\n} : function(string, length) {\n  'use strict';\n  return new Array(length + 1).join(string);\n};\n\n\n/**\n * Pads number to given length and optionally rounds it to a given precision.\n * For example:\n * <pre>padNumber(1.25, 2, 3) -> '01.250'\n * padNumber(1.25, 2) -> '01.25'\n * padNumber(1.25, 2, 1) -> '01.3'\n * padNumber(1.25, 0) -> '1.25'</pre>\n *\n * @param {number} num The number to pad.\n * @param {number} length The desired length.\n * @param {number=} opt_precision The desired precision.\n * @return {string} `num` as a string with the given options.\n */\ngoog.string.padNumber = function(num, length, opt_precision) {\n  'use strict';\n  if (!Number.isFinite(num)) return String(num);\n  let s =\n      (opt_precision !== undefined) ? num.toFixed(opt_precision) : String(num);\n  let index = s.indexOf('.');\n  if (index === -1) {\n    index = s.length;\n  }\n  const sign = s[0] === '-' ? '-' : '';\n  if (sign) {\n    s = s.substring(1);\n  }\n  return sign + goog.string.repeat('0', Math.max(0, length - index)) + s;\n};\n\n\n/**\n * Returns a string representation of the given object, with\n * null and undefined being returned as the empty string.\n *\n * @param {*} obj The object to convert.\n * @return {string} A string representation of the `obj`.\n */\ngoog.string.makeSafe = function(obj) {\n  'use strict';\n  return obj == null ? '' : String(obj);\n};\n\n/**\n * Returns a string with at least 64-bits of randomness.\n *\n * Doesn't trust JavaScript's random function entirely. Uses a combination of\n * random and current timestamp, and then encodes the string in base-36 to\n * make it shorter.\n *\n * @return {string} A random string, e.g. sn1s7vb4gcic.\n */\ngoog.string.getRandomString = function() {\n  'use strict';\n  const x = 2147483648;\n  return Math.floor(Math.random() * x).toString(36) +\n      Math.abs(Math.floor(Math.random() * x) ^ goog.now()).toString(36);\n};\n\n\n/**\n * Compares two version numbers.\n *\n * @param {string|number} version1 Version of first item.\n * @param {string|number} version2 Version of second item.\n *\n * @return {number}  1 if `version1` is higher.\n *                   0 if arguments are equal.\n *                  -1 if `version2` is higher.\n */\ngoog.string.compareVersions = goog.string.internal.compareVersions;\n\n\n/**\n * String hash function similar to java.lang.String.hashCode().\n * The hash code for a string is computed as\n * s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1],\n * where s[i] is the ith character of the string and n is the length of\n * the string. We mod the result to make it between 0 (inclusive) and 2^32\n * (exclusive).\n * @param {string} str A string.\n * @return {number} Hash value for `str`, between 0 (inclusive) and 2^32\n *  (exclusive). The empty string returns 0.\n */\ngoog.string.hashCode = function(str) {\n  'use strict';\n  let result = 0;\n  for (let i = 0; i < str.length; ++i) {\n    // Normalize to 4 byte range, 0 ... 2^32.\n    result = (31 * result + str.charCodeAt(i)) >>> 0;\n  }\n  return result;\n};\n\n\n/**\n * The most recent unique ID. |0 is equivalent to Math.floor in this case.\n * @type {number}\n * @private\n */\ngoog.string.uniqueStringCounter_ = Math.random() * 0x80000000 | 0;\n\n\n/**\n * Generates and returns a string which is unique in the current document.\n * This is useful, for example, to create unique IDs for DOM elements.\n * @return {string} A unique id.\n */\ngoog.string.createUniqueString = function() {\n  'use strict';\n  return 'goog_' + goog.string.uniqueStringCounter_++;\n};\n\n\n/**\n * Converts the supplied string to a number, which may be Infinity or NaN.\n * This function strips whitespace: (toNumber(' 123') === 123)\n * This function accepts scientific notation: (toNumber('1e1') === 10)\n *\n * This is better than JavaScript's built-in conversions because, sadly:\n *     (Number(' ') === 0) and (parseFloat('123a') === 123)\n *\n * @param {string} str The string to convert.\n * @return {number} The number the supplied string represents, or NaN.\n */\ngoog.string.toNumber = function(str) {\n  'use strict';\n  const num = Number(str);\n  if (num == 0 && goog.string.isEmptyOrWhitespace(str)) {\n    return NaN;\n  }\n  return num;\n};\n\n\n/**\n * Returns whether the given string is lower camel case (e.g. \"isFooBar\").\n *\n * Note that this assumes the string is entirely letters.\n * @see http://en.wikipedia.org/wiki/CamelCase#Variations_and_synonyms\n *\n * @param {string} str String to test.\n * @return {boolean} Whether the string is lower camel case.\n */\ngoog.string.isLowerCamelCase = function(str) {\n  'use strict';\n  return /^[a-z]+([A-Z][a-z]*)*$/.test(str);\n};\n\n\n/**\n * Returns whether the given string is upper camel case (e.g. \"FooBarBaz\").\n *\n * Note that this assumes the string is entirely letters.\n * @see http://en.wikipedia.org/wiki/CamelCase#Variations_and_synonyms\n *\n * @param {string} str String to test.\n * @return {boolean} Whether the string is upper camel case.\n */\ngoog.string.isUpperCamelCase = function(str) {\n  'use strict';\n  return /^([A-Z][a-z]*)+$/.test(str);\n};\n\n\n/**\n * Converts a string from selector-case to camelCase (e.g. from\n * \"multi-part-string\" to \"multiPartString\"), useful for converting\n * CSS selectors and HTML dataset keys to their equivalent JS properties.\n * @param {string} str The string in selector-case form.\n * @return {string} The string in camelCase form.\n */\ngoog.string.toCamelCase = function(str) {\n  'use strict';\n  return String(str).replace(/\\-([a-z])/g, function(all, match) {\n    'use strict';\n    return match.toUpperCase();\n  });\n};\n\n\n/**\n * Converts a string from camelCase to selector-case (e.g. from\n * \"multiPartString\" to \"multi-part-string\"), useful for converting JS\n * style and dataset properties to equivalent CSS selectors and HTML keys.\n * @param {string} str The string in camelCase form.\n * @return {string} The string in selector-case form.\n */\ngoog.string.toSelectorCase = function(str) {\n  'use strict';\n  return String(str).replace(/([A-Z])/g, '-$1').toLowerCase();\n};\n\n\n/**\n * Converts a string into TitleCase. First character of the string is always\n * capitalized in addition to the first letter of every subsequent word.\n * Words are delimited by one or more whitespaces by default. Custom delimiters\n * can optionally be specified to replace the default, which doesn't preserve\n * whitespace delimiters and instead must be explicitly included if needed.\n *\n * Default delimiter => \" \":\n *    goog.string.toTitleCase('oneTwoThree')    => 'OneTwoThree'\n *    goog.string.toTitleCase('one two three')  => 'One Two Three'\n *    goog.string.toTitleCase('  one   two   ') => '  One   Two   '\n *    goog.string.toTitleCase('one_two_three')  => 'One_two_three'\n *    goog.string.toTitleCase('one-two-three')  => 'One-two-three'\n *\n * Custom delimiter => \"_-.\":\n *    goog.string.toTitleCase('oneTwoThree', '_-.')       => 'OneTwoThree'\n *    goog.string.toTitleCase('one two three', '_-.')     => 'One two three'\n *    goog.string.toTitleCase('  one   two   ', '_-.')    => '  one   two   '\n *    goog.string.toTitleCase('one_two_three', '_-.')     => 'One_Two_Three'\n *    goog.string.toTitleCase('one-two-three', '_-.')     => 'One-Two-Three'\n *    goog.string.toTitleCase('one...two...three', '_-.') => 'One...Two...Three'\n *    goog.string.toTitleCase('one. two. three', '_-.')   => 'One. two. three'\n *    goog.string.toTitleCase('one-two.three', '_-.')     => 'One-Two.Three'\n *\n * @param {string} str String value in camelCase form.\n * @param {string=} opt_delimiters Custom delimiter character set used to\n *      distinguish words in the string value. Each character represents a\n *      single delimiter. When provided, default whitespace delimiter is\n *      overridden and must be explicitly included if needed.\n * @return {string} String value in TitleCase form.\n */\ngoog.string.toTitleCase = function(str, opt_delimiters) {\n  'use strict';\n  let delimiters = (typeof opt_delimiters === 'string') ?\n      goog.string.regExpEscape(opt_delimiters) :\n      '\\\\s';\n\n  // For IE8, we need to prevent using an empty character set. Otherwise,\n  // incorrect matching will occur.\n  delimiters = delimiters ? '|[' + delimiters + ']+' : '';\n\n  const regexp = new RegExp('(^' + delimiters + ')([a-z])', 'g');\n  return str.replace(regexp, function(all, p1, p2) {\n    'use strict';\n    return p1 + p2.toUpperCase();\n  });\n};\n\n\n/**\n * Capitalizes a string, i.e. converts the first letter to uppercase\n * and all other letters to lowercase, e.g.:\n *\n * goog.string.capitalize('one')     => 'One'\n * goog.string.capitalize('ONE')     => 'One'\n * goog.string.capitalize('one two') => 'One two'\n *\n * Note that this function does not trim initial whitespace.\n *\n * @param {string} str String value to capitalize.\n * @return {string} String value with first letter in uppercase.\n */\ngoog.string.capitalize = function(str) {\n  'use strict';\n  return String(str.charAt(0)).toUpperCase() +\n      String(str.slice(1)).toLowerCase();\n};\n\n\n/**\n * Parse a string in decimal or hexidecimal ('0xFFFF') form.\n *\n * To parse a particular radix, please use parseInt(string, radix) directly. See\n * https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/parseInt\n *\n * This is a wrapper for the built-in parseInt function that will only parse\n * numbers as base 10 or base 16.  Some JS implementations assume strings\n * starting with \"0\" are intended to be octal. ES3 allowed but discouraged\n * this behavior. ES5 forbids it.  This function emulates the ES5 behavior.\n *\n * For more information, see Mozilla JS Reference: http://goo.gl/8RiFj\n *\n * @param {string|number|null|undefined} value The value to be parsed.\n * @return {number} The number, parsed. If the string failed to parse, this\n *     will be NaN.\n */\ngoog.string.parseInt = function(value) {\n  'use strict';\n  // Force finite numbers to strings.\n  if (isFinite(value)) {\n    value = String(value);\n  }\n\n  if (typeof value === 'string') {\n    // If the string starts with '0x' or '-0x', parse as hex.\n    return /^\\s*-?0x/i.test(value) ? parseInt(value, 16) : parseInt(value, 10);\n  }\n\n  return NaN;\n};\n\n\n/**\n * Splits a string on a separator a limited number of times.\n *\n * This implementation is more similar to Python or Java, where the limit\n * parameter specifies the maximum number of splits rather than truncating\n * the number of results.\n *\n * See http://docs.python.org/2/library/stdtypes.html#str.split\n * See JavaDoc: http://goo.gl/F2AsY\n * See Mozilla reference: http://goo.gl/dZdZs\n *\n * @param {string} str String to split.\n * @param {string} separator The separator.\n * @param {number} limit The limit to the number of splits. The resulting array\n *     will have a maximum length of limit+1.  Negative numbers are the same\n *     as zero.\n * @return {!Array<string>} The string, split.\n */\ngoog.string.splitLimit = function(str, separator, limit) {\n  'use strict';\n  const parts = str.split(separator);\n  const returnVal = [];\n\n  // Only continue doing this while we haven't hit the limit and we have\n  // parts left.\n  while (limit > 0 && parts.length) {\n    returnVal.push(parts.shift());\n    limit--;\n  }\n\n  // If there are remaining parts, append them to the end.\n  if (parts.length) {\n    returnVal.push(parts.join(separator));\n  }\n\n  return returnVal;\n};\n\n\n/**\n * Finds the characters to the right of the last instance of any separator\n *\n * This function is similar to goog.string.path.baseName, except it can take a\n * list of characters to split the string on. It will return the rightmost\n * grouping of characters to the right of any separator as a left-to-right\n * oriented string.\n *\n * @see goog.string.path.baseName\n * @param {string} str The string\n * @param {string|!Array<string>} separators A list of separator characters\n * @return {string} The last part of the string with respect to the separators\n */\ngoog.string.lastComponent = function(str, separators) {\n  'use strict';\n  if (!separators) {\n    return str;\n  } else if (typeof separators == 'string') {\n    separators = [separators];\n  }\n\n  let lastSeparatorIndex = -1;\n  for (let i = 0; i < separators.length; i++) {\n    if (separators[i] == '') {\n      continue;\n    }\n    const currentSeparatorIndex = str.lastIndexOf(separators[i]);\n    if (currentSeparatorIndex > lastSeparatorIndex) {\n      lastSeparatorIndex = currentSeparatorIndex;\n    }\n  }\n  if (lastSeparatorIndex == -1) {\n    return str;\n  }\n  return str.slice(lastSeparatorIndex + 1);\n};\n\n\n/**\n * Computes the Levenshtein edit distance between two strings.\n * @param {string} a\n * @param {string} b\n * @return {number} The edit distance between the two strings.\n */\ngoog.string.editDistance = function(a, b) {\n  'use strict';\n  const v0 = [];\n  const v1 = [];\n\n  if (a == b) {\n    return 0;\n  }\n\n  if (!a.length || !b.length) {\n    return Math.max(a.length, b.length);\n  }\n\n  for (let i = 0; i < b.length + 1; i++) {\n    v0[i] = i;\n  }\n\n  for (let i = 0; i < a.length; i++) {\n    v1[0] = i + 1;\n\n    for (let j = 0; j < b.length; j++) {\n      const cost = Number(a[i] != b[j]);\n      // Cost for the substring is the minimum of adding one character, removing\n      // one character, or a swap.\n      v1[j + 1] = Math.min(v1[j] + 1, v0[j + 1] + 1, v0[j] + cost);\n    }\n\n    for (let j = 0; j < v0.length; j++) {\n      v0[j] = v1[j];\n    }\n  }\n\n  return v1[b.length];\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Wrapper class for handling XmlHttpRequests.\n *\n * One off requests can be sent through goog.net.XhrIo.send() or an\n * instance can be created to send multiple requests.  Each request uses its\n * own XmlHttpRequest object and handles clearing of the event callback to\n * ensure no leaks.\n *\n * XhrIo is event based, it dispatches events on success, failure, finishing,\n * ready-state change, or progress (download and upload).\n *\n * The ready-state or timeout event fires first, followed by\n * a generic completed event. Then the abort, error, or success event\n * is fired as appropriate. Progress events are fired as they are\n * received. Lastly, the ready event will fire to indicate that the\n * object may be used to make another request.\n *\n * The error event may also be called before completed and\n * ready-state-change if the XmlHttpRequest.open() or .send() methods throw.\n *\n * This class does not support multiple requests, queuing, or prioritization.\n *\n * When progress events are supported by the browser, and progress is\n * enabled via .setProgressEventsEnabled(true), the\n * goog.net.EventType.PROGRESS event will be the re-dispatched browser\n * progress event. Additionally, a DOWNLOAD_PROGRESS or UPLOAD_PROGRESS event\n * will be fired for download and upload progress respectively.\n */\n\n\ngoog.provide('goog.net.XhrIo');\ngoog.provide('goog.net.XhrIo.ResponseType');\n\ngoog.require('goog.Timer');\ngoog.require('goog.array');\ngoog.require('goog.asserts');\ngoog.require('goog.collections.maps');\ngoog.require('goog.debug.entryPointRegistry');\ngoog.require('goog.events.EventTarget');\ngoog.require('goog.json.hybrid');\ngoog.require('goog.log');\ngoog.require('goog.net.ErrorCode');\ngoog.require('goog.net.EventType');\ngoog.require('goog.net.HttpStatus');\ngoog.require('goog.net.XmlHttp');\ngoog.require('goog.object');\ngoog.require('goog.string');\ngoog.require('goog.uri.utils');\ngoog.require('goog.userAgent');\ngoog.requireType('goog.Uri');\ngoog.requireType('goog.debug.ErrorHandler');\ngoog.requireType('goog.net.XhrLike');\ngoog.requireType('goog.net.XmlHttpFactory');\n\ngoog.scope(function() {\n\n'use strict';\n/**\n * Basic class for handling XMLHttpRequests.\n * @param {goog.net.XmlHttpFactory=} opt_xmlHttpFactory Factory to use when\n *     creating XMLHttpRequest objects.\n * @constructor\n * @extends {goog.events.EventTarget}\n */\ngoog.net.XhrIo = function(opt_xmlHttpFactory) {\n  'use strict';\n  XhrIo.base(this, 'constructor');\n\n  /**\n   * Map of default headers to add to every request, use:\n   * XhrIo.headers.set(name, value)\n   * @type {!Map<string,string>}\n   */\n  this.headers = new Map();\n\n  /**\n   * Optional XmlHttpFactory\n   * @private {goog.net.XmlHttpFactory}\n   */\n  this.xmlHttpFactory_ = opt_xmlHttpFactory || null;\n\n  /**\n   * Whether XMLHttpRequest is active.  A request is active from the time send()\n   * is called until onReadyStateChange() is complete, or error() or abort()\n   * is called.\n   * @private {boolean}\n   */\n  this.active_ = false;\n\n  /**\n   * The XMLHttpRequest object that is being used for the transfer.\n   * @private {?goog.net.XhrLike.OrNative}\n   */\n  this.xhr_ = null;\n\n  /**\n   * The options to use with the current XMLHttpRequest object.\n   * @private {?Object}\n   */\n  this.xhrOptions_ = null;\n\n  /**\n   * Last URL that was requested.\n   * @private {string|goog.Uri}\n   */\n  this.lastUri_ = '';\n\n  /**\n   * Method for the last request.\n   * @private {string}\n   */\n  this.lastMethod_ = '';\n\n  /**\n   * Last error code.\n   * @private {!goog.net.ErrorCode}\n   */\n  this.lastErrorCode_ = goog.net.ErrorCode.NO_ERROR;\n\n  /**\n   * Last error message.\n   * @private {Error|string}\n   */\n  this.lastError_ = '';\n\n  /**\n   * Used to ensure that we don't dispatch an multiple ERROR events. This can\n   * happen in IE when it does a synchronous load and one error is handled in\n   * the ready state change and one is handled due to send() throwing an\n   * exception.\n   * @private {boolean}\n   */\n  this.errorDispatched_ = false;\n\n  /**\n   * Used to make sure we don't fire the complete event from inside a send call.\n   * @private {boolean}\n   */\n  this.inSend_ = false;\n\n  /**\n   * Used in determining if a call to {@link #onReadyStateChange_} is from\n   * within a call to this.xhr_.open.\n   * @private {boolean}\n   */\n  this.inOpen_ = false;\n\n  /**\n   * Used in determining if a call to {@link #onReadyStateChange_} is from\n   * within a call to this.xhr_.abort.\n   * @private {boolean}\n   */\n  this.inAbort_ = false;\n\n  /**\n   * Number of milliseconds after which an incomplete request will be aborted\n   * and a {@link goog.net.EventType.TIMEOUT} event raised; 0 means no timeout\n   * is set.\n   * @private {number}\n   */\n  this.timeoutInterval_ = 0;\n\n  /**\n   * Timer to track request timeout.\n   * @private {?number}\n   */\n  this.timeoutId_ = null;\n\n  /**\n   * The requested type for the response. The empty string means use the default\n   * XHR behavior.\n   * @private {goog.net.XhrIo.ResponseType}\n   */\n  this.responseType_ = ResponseType.DEFAULT;\n\n  /**\n   * Whether a \"credentialed\" request is to be sent (one that is aware of\n   * cookies and authentication). This is applicable only for cross-domain\n   * requests and more recent browsers that support this part of the HTTP Access\n   * Control standard.\n   *\n   * @see http://www.w3.org/TR/XMLHttpRequest/#the-withcredentials-attribute\n   *\n   * @private {boolean}\n   */\n  this.withCredentials_ = false;\n\n  /**\n   * Whether progress events are enabled for this request. This is\n   * disabled by default because setting a progress event handler\n   * causes pre-flight OPTIONS requests to be sent for CORS requests,\n   * even in cases where a pre-flight request would not otherwise be\n   * sent.\n   *\n   * @see http://xhr.spec.whatwg.org/#security-considerations\n   *\n   * Note that this can cause problems for Firefox 22 and below, as an\n   * older \"LSProgressEvent\" will be dispatched by the browser. That\n   * progress event is no longer supported, and can lead to failures,\n   * including throwing exceptions.\n   *\n   * @see http://bugzilla.mozilla.org/show_bug.cgi?id=845631\n   * @see b/23469793\n   *\n   * @private {boolean}\n   */\n  this.progressEventsEnabled_ = false;\n\n  /**\n   * True if we can use XMLHttpRequest's timeout directly.\n   * @private {boolean}\n   */\n  this.useXhr2Timeout_ = false;\n\n  /**\n   * Specification for Trust Token operations (issuance, signing, and\n   * redemption).\n   * @private {?TrustTokenAttributeType}\n   */\n  this.trustToken_ = null;\n};\ngoog.inherits(goog.net.XhrIo, goog.events.EventTarget);\n\nconst XhrIo = goog.net.XhrIo;\n\n/**\n * Response types that may be requested for XMLHttpRequests.\n * @enum {string}\n * @see http://www.w3.org/TR/XMLHttpRequest/#the-responsetype-attribute\n */\ngoog.net.XhrIo.ResponseType = {\n  DEFAULT: '',\n  TEXT: 'text',\n  DOCUMENT: 'document',\n  // Not supported as of Chrome 10.0.612.1 dev\n  BLOB: 'blob',\n  ARRAY_BUFFER: 'arraybuffer',\n};\n\nconst ResponseType = goog.net.XhrIo.ResponseType;\n\n\n/**\n * A reference to the XhrIo logger\n * @private {?goog.log.Logger}\n * @const\n */\ngoog.net.XhrIo.prototype.logger_ = goog.log.getLogger('goog.net.XhrIo');\n\n\n/**\n * The Content-Type HTTP header name\n * @type {string}\n */\ngoog.net.XhrIo.CONTENT_TYPE_HEADER = 'Content-Type';\n\n\n/**\n * The Content-Transfer-Encoding HTTP header name\n * @type {string}\n */\ngoog.net.XhrIo.CONTENT_TRANSFER_ENCODING = 'Content-Transfer-Encoding';\n\n\n/**\n * The pattern matching the 'http' and 'https' URI schemes\n * @type {!RegExp}\n */\ngoog.net.XhrIo.HTTP_SCHEME_PATTERN = /^https?$/i;\n\nconst HTTP_SCHEME_PATTERN = goog.net.XhrIo.HTTP_SCHEME_PATTERN;\n\n\n/**\n * The methods that typically come along with form data.  We set different\n * headers depending on whether the HTTP action is one of these.\n * @type {!Array<string>}\n */\ngoog.net.XhrIo.METHODS_WITH_FORM_DATA = ['POST', 'PUT'];\n\n\n/**\n * The Content-Type HTTP header value for a url-encoded form\n * @type {string}\n */\ngoog.net.XhrIo.FORM_CONTENT_TYPE =\n    'application/x-www-form-urlencoded;charset=utf-8';\n\n\n/**\n * The XMLHttpRequest Level two timeout delay ms property name.\n *\n * @see http://www.w3.org/TR/XMLHttpRequest/#the-timeout-attribute\n *\n * @private {string}\n * @const\n */\ngoog.net.XhrIo.XHR2_TIMEOUT_ = 'timeout';\n\n\n/**\n * The XMLHttpRequest Level two ontimeout handler property name.\n *\n * @see http://www.w3.org/TR/XMLHttpRequest/#the-timeout-attribute\n *\n * @private {string}\n * @const\n */\ngoog.net.XhrIo.XHR2_ON_TIMEOUT_ = 'ontimeout';\n\n\n/**\n * All non-disposed instances of goog.net.XhrIo created\n * by {@link goog.net.XhrIo.send} are in this Array.\n * @see goog.net.XhrIo.cleanup\n * @private {!Array<!goog.net.XhrIo>}\n */\ngoog.net.XhrIo.sendInstances_ = [];\n\n\n/**\n * Static send that creates a short lived instance of XhrIo to send the\n * request.\n * @see goog.net.XhrIo.cleanup\n * @param {string|goog.Uri} url Uri to make request to.\n * @param {?function(this:goog.net.XhrIo, ?)=} opt_callback Callback function\n *     for when request is complete.\n * @param {string=} opt_method Send method, default: GET.\n * @param {ArrayBuffer|ArrayBufferView|Blob|Document|FormData|string=}\n *     opt_content Body data.\n * @param {(?Object|?goog.collections.maps.MapLike<string, string>)=}\n *     opt_headers Map of headers to add to the request.\n * @param {number=} opt_timeoutInterval Number of milliseconds after which an\n *     incomplete request will be aborted; 0 means no timeout is set.\n * @param {boolean=} opt_withCredentials Whether to send credentials with the\n *     request. Default to false. See {@link goog.net.XhrIo#setWithCredentials}.\n * @return {!goog.net.XhrIo} The sent XhrIo.\n */\ngoog.net.XhrIo.send = function(\n    url, opt_callback, opt_method, opt_content, opt_headers,\n    opt_timeoutInterval, opt_withCredentials) {\n  'use strict';\n  const x = new goog.net.XhrIo();\n  goog.net.XhrIo.sendInstances_.push(x);\n  if (opt_callback) {\n    x.listen(goog.net.EventType.COMPLETE, opt_callback);\n  }\n  x.listenOnce(goog.net.EventType.READY, x.cleanupSend_);\n  if (opt_timeoutInterval) {\n    x.setTimeoutInterval(opt_timeoutInterval);\n  }\n  if (opt_withCredentials) {\n    x.setWithCredentials(opt_withCredentials);\n  }\n  x.send(url, opt_method, opt_content, opt_headers);\n  return x;\n};\n\n\n/**\n * Disposes all non-disposed instances of goog.net.XhrIo created by\n * {@link goog.net.XhrIo.send}.\n * {@link goog.net.XhrIo.send} cleans up the goog.net.XhrIo instance\n * it creates when the request completes or fails.  However, if\n * the request never completes, then the goog.net.XhrIo is not disposed.\n * This can occur if the window is unloaded before the request completes.\n * We could have {@link goog.net.XhrIo.send} return the goog.net.XhrIo\n * it creates and make the client of {@link goog.net.XhrIo.send} be\n * responsible for disposing it in this case.  However, this makes things\n * significantly more complicated for the client, and the whole point\n * of {@link goog.net.XhrIo.send} is that it's simple and easy to use.\n * Clients of {@link goog.net.XhrIo.send} should call\n * {@link goog.net.XhrIo.cleanup} when doing final\n * cleanup on window unload.\n */\ngoog.net.XhrIo.cleanup = function() {\n  'use strict';\n  const instances = goog.net.XhrIo.sendInstances_;\n  while (instances.length) {\n    instances.pop().dispose();\n  }\n};\n\n\n/**\n * Installs exception protection for all entry point introduced by\n * goog.net.XhrIo instances which are not protected by\n * {@link goog.debug.ErrorHandler#protectWindowSetTimeout},\n * {@link goog.debug.ErrorHandler#protectWindowSetInterval}, or\n * {@link goog.events.protectBrowserEventEntryPoint}.\n *\n * @param {goog.debug.ErrorHandler} errorHandler Error handler with which to\n *     protect the entry point(s).\n */\ngoog.net.XhrIo.protectEntryPoints = function(errorHandler) {\n  'use strict';\n  goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_ =\n      errorHandler.protectEntryPoint(\n          goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_);\n};\n\n\n/**\n * Disposes of the specified goog.net.XhrIo created by\n * {@link goog.net.XhrIo.send} and removes it from\n * {@link goog.net.XhrIo.pendingStaticSendInstances_}.\n * @private\n */\ngoog.net.XhrIo.prototype.cleanupSend_ = function() {\n  'use strict';\n  this.dispose();\n  goog.array.remove(goog.net.XhrIo.sendInstances_, this);\n};\n\n\n/**\n * Returns the number of milliseconds after which an incomplete request will be\n * aborted, or 0 if no timeout is set.\n * @return {number} Timeout interval in milliseconds.\n */\ngoog.net.XhrIo.prototype.getTimeoutInterval = function() {\n  'use strict';\n  return this.timeoutInterval_;\n};\n\n\n/**\n * Sets the number of milliseconds after which an incomplete request will be\n * aborted and a {@link goog.net.EventType.TIMEOUT} event raised; 0 means no\n * timeout is set.\n * @param {number} ms Timeout interval in milliseconds; 0 means none.\n */\ngoog.net.XhrIo.prototype.setTimeoutInterval = function(ms) {\n  'use strict';\n  this.timeoutInterval_ = Math.max(0, ms);\n};\n\n\n/**\n * Sets the desired type for the response. At time of writing, this is only\n * supported in very recent versions of WebKit (10.0.612.1 dev and later).\n *\n * If this is used, the response may only be accessed via {@link #getResponse}.\n *\n * @param {goog.net.XhrIo.ResponseType} type The desired type for the response.\n */\ngoog.net.XhrIo.prototype.setResponseType = function(type) {\n  'use strict';\n  this.responseType_ = type;\n};\n\n\n/**\n * Gets the desired type for the response.\n * @return {goog.net.XhrIo.ResponseType} The desired type for the response.\n */\ngoog.net.XhrIo.prototype.getResponseType = function() {\n  'use strict';\n  return this.responseType_;\n};\n\n\n/**\n * Sets whether a \"credentialed\" request that is aware of cookie and\n * authentication information should be made. This option is only supported by\n * browsers that support HTTP Access Control. As of this writing, this option\n * is not supported in IE.\n *\n * @param {boolean} withCredentials Whether this should be a \"credentialed\"\n *     request.\n */\ngoog.net.XhrIo.prototype.setWithCredentials = function(withCredentials) {\n  'use strict';\n  this.withCredentials_ = withCredentials;\n};\n\n\n/**\n * Gets whether a \"credentialed\" request is to be sent.\n * @return {boolean} The desired type for the response.\n */\ngoog.net.XhrIo.prototype.getWithCredentials = function() {\n  'use strict';\n  return this.withCredentials_;\n};\n\n\n/**\n * Sets whether progress events are enabled for this request. Note\n * that progress events require pre-flight OPTIONS request handling\n * for CORS requests, and may cause trouble with older browsers. See\n * progressEventsEnabled_ for details.\n * @param {boolean} enabled Whether progress events should be enabled.\n */\ngoog.net.XhrIo.prototype.setProgressEventsEnabled = function(enabled) {\n  'use strict';\n  this.progressEventsEnabled_ = enabled;\n};\n\n\n/**\n * Gets whether progress events are enabled.\n * @return {boolean} Whether progress events are enabled for this request.\n */\ngoog.net.XhrIo.prototype.getProgressEventsEnabled = function() {\n  'use strict';\n  return this.progressEventsEnabled_;\n};\n\n/**\n * Specify a Trust Tokens operation to execute alongside the request.\n * @param {!TrustTokenAttributeType} trustToken a Trust Tokens operation to\n *     execute.\n */\ngoog.net.XhrIo.prototype.setTrustToken = function(trustToken) {\n  'use strict';\n  this.trustToken_ = trustToken;\n};\n/**\n * Instance send that actually uses XMLHttpRequest to make a server call.\n * @param {string|goog.Uri} url Uri to make request to.\n * @param {string=} opt_method Send method, default: GET.\n * @param {ArrayBuffer|ArrayBufferView|Blob|Document|FormData|string=}\n *     opt_content Body data.\n * @param {(?Object|?goog.collections.maps.MapLike<string, string>)=}\n *     opt_headers Map of headers to add to the request.\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n * @suppress {deprecated} Use deprecated goog.structs.forEach to allow different\n * types of parameters for opt_headers.\n */\ngoog.net.XhrIo.prototype.send = function(\n    url, opt_method, opt_content, opt_headers) {\n  'use strict';\n  if (this.xhr_) {\n    throw new Error(\n        '[goog.net.XhrIo] Object is active with another request=' +\n        this.lastUri_ + '; newUri=' + url);\n  }\n\n  const method = opt_method ? opt_method.toUpperCase() : 'GET';\n\n  this.lastUri_ = url;\n  this.lastError_ = '';\n  this.lastErrorCode_ = goog.net.ErrorCode.NO_ERROR;\n  this.lastMethod_ = method;\n  this.errorDispatched_ = false;\n  this.active_ = true;\n\n  // Use the factory to create the XHR object and options\n  this.xhr_ = this.createXhr();\n  this.xhrOptions_ = this.xmlHttpFactory_ ? this.xmlHttpFactory_.getOptions() :\n                                            goog.net.XmlHttp.getOptions();\n\n  // Set up the onreadystatechange callback\n  this.xhr_.onreadystatechange = goog.bind(this.onReadyStateChange_, this);\n\n  // Set up upload/download progress events, if progress events are supported.\n  if (this.getProgressEventsEnabled() && 'onprogress' in this.xhr_) {\n    /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n    this.xhr_.onprogress = goog.bind(function(e) {\n      'use strict';\n      this.onProgressHandler_(e, true);\n    }, this);\n    if (this.xhr_.upload) {\n      /**\n       * @suppress {strictMissingProperties} Added to tighten compiler checks\n       */\n      this.xhr_.upload.onprogress = goog.bind(this.onProgressHandler_, this);\n    }\n  }\n\n  /**\n   * Try to open the XMLHttpRequest (always async), if an error occurs here it\n   * is generally permission denied\n   */\n  try {\n    goog.log.fine(this.logger_, this.formatMsg_('Opening Xhr'));\n    this.inOpen_ = true;\n    this.xhr_.open(method, String(url), true);  // Always async!\n    this.inOpen_ = false;\n  } catch (err) {\n    goog.log.fine(\n        this.logger_, this.formatMsg_('Error opening Xhr: ' + err.message));\n    this.error_(goog.net.ErrorCode.EXCEPTION, err);\n    return;\n  }\n\n  // We can't use null since this won't allow requests with form data to have a\n  // content length specified which will cause some proxies to return a 411\n  // error.\n  const content = opt_content || '';\n\n  const headers = new Map(this.headers);\n\n  // Add headers specific to this request\n  if (opt_headers) {\n    if (Object.getPrototypeOf(opt_headers) === Object.prototype) {\n      for (let key in opt_headers) {\n        headers.set(key, opt_headers[key]);\n      }\n    } else if (\n        typeof opt_headers.keys === 'function' &&\n        typeof opt_headers.get === 'function') {\n      for (const key of opt_headers.keys()) {\n        headers.set(key, opt_headers.get(key));\n      }\n    } else {\n      throw new Error(\n          'Unknown input type for opt_headers: ' + String(opt_headers));\n    }\n  }\n\n  // Find whether a content type header is set, ignoring case.\n  // HTTP header names are case-insensitive.  See:\n  // http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2\n  const contentTypeKey =\n      Array.from(headers.keys())\n          .find(\n              header => goog.string.caseInsensitiveEquals(\n                  goog.net.XhrIo.CONTENT_TYPE_HEADER, header));\n\n  const contentIsFormData =\n      (goog.global['FormData'] && (content instanceof goog.global['FormData']));\n  if (goog.array.contains(goog.net.XhrIo.METHODS_WITH_FORM_DATA, method) &&\n      !contentTypeKey && !contentIsFormData) {\n    // For requests typically with form data, default to the url-encoded form\n    // content type unless this is a FormData request.  For FormData,\n    // the browser will automatically add a multipart/form-data content type\n    // with an appropriate multipart boundary.\n    headers.set(\n        goog.net.XhrIo.CONTENT_TYPE_HEADER, goog.net.XhrIo.FORM_CONTENT_TYPE);\n  }\n\n  // Add the headers to the Xhr object\n  for (const [key, value] of headers) {\n    this.xhr_.setRequestHeader(key, value);\n  }\n\n  if (this.responseType_) {\n    this.xhr_.responseType = this.responseType_;\n  }\n  // Set xhr_.withCredentials only when the value is different, or else in\n  // synchronous XMLHtppRequest.open Firefox will throw an exception.\n  // https://bugzilla.mozilla.org/show_bug.cgi?id=736340\n  if ('withCredentials' in this.xhr_ &&\n      this.xhr_.withCredentials !== this.withCredentials_) {\n    /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n    this.xhr_.withCredentials = this.withCredentials_;\n  }\n\n  if ('setTrustToken' in this.xhr_ && this.trustToken_) {\n    try {\n      this.xhr_.setTrustToken(this.trustToken_);\n    } catch (err) {\n      goog.log.fine(\n          this.logger_, this.formatMsg_('Error SetTrustToken: ' + err.message));\n    }\n  }\n  /**\n   * Try to send the request, or other wise report an error (404 not found).\n   */\n  try {\n    this.cleanUpTimeoutTimer_();  // Paranoid, should never be running.\n    if (this.timeoutInterval_ > 0) {\n      this.useXhr2Timeout_ = goog.net.XhrIo.shouldUseXhr2Timeout_(this.xhr_);\n      goog.log.fine(\n          this.logger_,\n          this.formatMsg_(\n              'Will abort after ' + this.timeoutInterval_ +\n              'ms if incomplete, xhr2 ' + this.useXhr2Timeout_));\n      if (this.useXhr2Timeout_) {\n        this.xhr_[goog.net.XhrIo.XHR2_TIMEOUT_] = this.timeoutInterval_;\n        this.xhr_[goog.net.XhrIo.XHR2_ON_TIMEOUT_] =\n            goog.bind(this.timeout_, this);\n      } else {\n        this.timeoutId_ =\n            goog.Timer.callOnce(this.timeout_, this.timeoutInterval_, this);\n      }\n    }\n    goog.log.fine(this.logger_, this.formatMsg_('Sending request'));\n    this.inSend_ = true;\n    this.xhr_.send(content);\n    this.inSend_ = false;\n\n  } catch (err) {\n    goog.log.fine(this.logger_, this.formatMsg_('Send error: ' + err.message));\n    this.error_(goog.net.ErrorCode.EXCEPTION, err);\n  }\n};\n\n\n/**\n * Determines if the argument is an XMLHttpRequest that supports the level 2\n * timeout value and event.\n *\n * Currently, FF 21.0 OS X has the fields but won't actually call the timeout\n * handler.  Perhaps the confusion in the bug referenced below hasn't\n * entirely been resolved.\n *\n * @see http://www.w3.org/TR/XMLHttpRequest/#the-timeout-attribute\n * @see https://bugzilla.mozilla.org/show_bug.cgi?id=525816\n *\n * @param {!goog.net.XhrLike.OrNative} xhr The request.\n * @return {boolean} True if the request supports level 2 timeout.\n * @private\n */\ngoog.net.XhrIo.shouldUseXhr2Timeout_ = function(xhr) {\n  'use strict';\n  return goog.userAgent.IE &&\n      typeof xhr[goog.net.XhrIo.XHR2_TIMEOUT_] === 'number' &&\n      xhr[goog.net.XhrIo.XHR2_ON_TIMEOUT_] !== undefined;\n};\n\n\n/**\n * Creates a new XHR object.\n * @return {!goog.net.XhrLike.OrNative} The newly created XHR object.\n * @protected\n */\ngoog.net.XhrIo.prototype.createXhr = function() {\n  'use strict';\n  return this.xmlHttpFactory_ ? this.xmlHttpFactory_.createInstance() :\n                                goog.net.XmlHttp();\n};\n\n\n/**\n * The request didn't complete after {@link goog.net.XhrIo#timeoutInterval_}\n * milliseconds; raises a {@link goog.net.EventType.TIMEOUT} event and aborts\n * the request.\n * @private\n */\ngoog.net.XhrIo.prototype.timeout_ = function() {\n  'use strict';\n  if (typeof goog == 'undefined') {\n    // If goog is undefined then the callback has occurred as the application\n    // is unloading and will error.  Thus we let it silently fail.\n  } else if (this.xhr_) {\n    this.lastError_ =\n        'Timed out after ' + this.timeoutInterval_ + 'ms, aborting';\n    this.lastErrorCode_ = goog.net.ErrorCode.TIMEOUT;\n    goog.log.fine(this.logger_, this.formatMsg_(this.lastError_));\n    this.dispatchEvent(goog.net.EventType.TIMEOUT);\n    this.abort(goog.net.ErrorCode.TIMEOUT);\n  }\n};\n\n\n/**\n * Something errorred, so inactivate, fire error callback and clean up\n * @param {goog.net.ErrorCode} errorCode The error code.\n * @param {Error} err The error object.\n * @private\n */\ngoog.net.XhrIo.prototype.error_ = function(errorCode, err) {\n  'use strict';\n  this.active_ = false;\n  if (this.xhr_) {\n    this.inAbort_ = true;\n    this.xhr_.abort();  // Ensures XHR isn't hung (FF)\n    this.inAbort_ = false;\n  }\n  this.lastError_ = err;\n  this.lastErrorCode_ = errorCode;\n  this.dispatchErrors_();\n  this.cleanUpXhr_();\n};\n\n\n/**\n * Dispatches COMPLETE and ERROR in case of an error. This ensures that we do\n * not dispatch multiple error events.\n * @private\n */\ngoog.net.XhrIo.prototype.dispatchErrors_ = function() {\n  'use strict';\n  if (!this.errorDispatched_) {\n    this.errorDispatched_ = true;\n    this.dispatchEvent(goog.net.EventType.COMPLETE);\n    this.dispatchEvent(goog.net.EventType.ERROR);\n  }\n};\n\n\n/**\n * Abort the current XMLHttpRequest\n * @param {goog.net.ErrorCode=} opt_failureCode Optional error code to use -\n *     defaults to ABORT.\n */\ngoog.net.XhrIo.prototype.abort = function(opt_failureCode) {\n  'use strict';\n  if (this.xhr_ && this.active_) {\n    goog.log.fine(this.logger_, this.formatMsg_('Aborting'));\n    this.active_ = false;\n    this.inAbort_ = true;\n    this.xhr_.abort();\n    this.inAbort_ = false;\n    this.lastErrorCode_ = opt_failureCode || goog.net.ErrorCode.ABORT;\n    this.dispatchEvent(goog.net.EventType.COMPLETE);\n    this.dispatchEvent(goog.net.EventType.ABORT);\n    this.cleanUpXhr_();\n  }\n};\n\n\n/**\n * Nullifies all callbacks to reduce risks of leaks.\n * @override\n * @protected\n */\ngoog.net.XhrIo.prototype.disposeInternal = function() {\n  'use strict';\n  if (this.xhr_) {\n    // We explicitly do not call xhr_.abort() unless active_ is still true.\n    // This is to avoid unnecessarily aborting a successful request when\n    // dispose() is called in a callback triggered by a complete response, but\n    // in which browser cleanup has not yet finished.\n    // (See http://b/issue?id=1684217.)\n    if (this.active_) {\n      this.active_ = false;\n      this.inAbort_ = true;\n      this.xhr_.abort();\n      this.inAbort_ = false;\n    }\n    this.cleanUpXhr_(true);\n  }\n\n  XhrIo.base(this, 'disposeInternal');\n};\n\n\n/**\n * Internal handler for the XHR object's readystatechange event.  This method\n * checks the status and the readystate and fires the correct callbacks.\n * If the request has ended, the handlers are cleaned up and the XHR object is\n * nullified.\n * @private\n */\ngoog.net.XhrIo.prototype.onReadyStateChange_ = function() {\n  'use strict';\n  if (this.isDisposed()) {\n    // This method is the target of an untracked goog.Timer.callOnce().\n    return;\n  }\n  if (!this.inOpen_ && !this.inSend_ && !this.inAbort_) {\n    // Were not being called from within a call to this.xhr_.send\n    // this.xhr_.abort, or this.xhr_.open, so this is an entry point\n    this.onReadyStateChangeEntryPoint_();\n  } else {\n    this.onReadyStateChangeHelper_();\n  }\n};\n\n\n/**\n * Used to protect the onreadystatechange handler entry point.  Necessary\n * as {#onReadyStateChange_} maybe called from within send or abort, this\n * method is only called when {#onReadyStateChange_} is called as an\n * entry point.\n * {@see #protectEntryPoints}\n * @private\n */\ngoog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_ = function() {\n  'use strict';\n  this.onReadyStateChangeHelper_();\n};\n\n\n/**\n * Helper for {@link #onReadyStateChange_}.  This is used so that\n * entry point calls to {@link #onReadyStateChange_} can be routed through\n * {@link #onReadyStateChangeEntryPoint_}.\n * @private\n */\ngoog.net.XhrIo.prototype.onReadyStateChangeHelper_ = function() {\n  'use strict';\n  if (!this.active_) {\n    // can get called inside abort call\n    return;\n  }\n\n  if (typeof goog == 'undefined') {\n    // NOTE(user): If goog is undefined then the callback has occurred as the\n    // application is unloading and will error.  Thus we let it silently fail.\n\n  } else if (\n      this.xhrOptions_[goog.net.XmlHttp.OptionType.LOCAL_REQUEST_ERROR] &&\n      this.getReadyState() == goog.net.XmlHttp.ReadyState.COMPLETE &&\n      this.getStatus() == 2) {\n    // NOTE(user): In IE if send() errors on a *local* request the readystate\n    // is still changed to COMPLETE.  We need to ignore it and allow the\n    // try/catch around send() to pick up the error.\n    goog.log.fine(\n        this.logger_,\n        this.formatMsg_('Local request error detected and ignored'));\n\n  } else {\n    // In IE when the response has been cached we sometimes get the callback\n    // from inside the send call and this usually breaks code that assumes that\n    // XhrIo is asynchronous.  If that is the case we delay the callback\n    // using a timer.\n    if (this.inSend_ &&\n        this.getReadyState() == goog.net.XmlHttp.ReadyState.COMPLETE) {\n      goog.Timer.callOnce(this.onReadyStateChange_, 0, this);\n      return;\n    }\n\n    this.dispatchEvent(goog.net.EventType.READY_STATE_CHANGE);\n\n    // readyState indicates the transfer has finished\n    if (this.isComplete()) {\n      goog.log.fine(this.logger_, this.formatMsg_('Request complete'));\n\n      this.active_ = false;\n\n      try {\n        // Call the specific callbacks for success or failure. Only call the\n        // success if the status is 200 (HTTP_OK) or 304 (HTTP_CACHED)\n        if (this.isSuccess()) {\n          this.dispatchEvent(goog.net.EventType.COMPLETE);\n          this.dispatchEvent(goog.net.EventType.SUCCESS);\n        } else {\n          this.lastErrorCode_ = goog.net.ErrorCode.HTTP_ERROR;\n          this.lastError_ =\n              this.getStatusText() + ' [' + this.getStatus() + ']';\n          this.dispatchErrors_();\n        }\n      } finally {\n        this.cleanUpXhr_();\n      }\n    }\n  }\n};\n\n\n/**\n * Internal handler for the XHR object's onprogress event. Fires both a generic\n * PROGRESS event and either a DOWNLOAD_PROGRESS or UPLOAD_PROGRESS event to\n * allow specific binding for each XHR progress event.\n * @param {!ProgressEvent} e XHR progress event.\n * @param {boolean=} opt_isDownload Whether the current progress event is from a\n *     download. Used to determine whether DOWNLOAD_PROGRESS or UPLOAD_PROGRESS\n *     event should be dispatched.\n * @private\n */\ngoog.net.XhrIo.prototype.onProgressHandler_ = function(e, opt_isDownload) {\n  'use strict';\n  goog.asserts.assert(\n      e.type === goog.net.EventType.PROGRESS,\n      'goog.net.EventType.PROGRESS is of the same type as raw XHR progress.');\n  this.dispatchEvent(\n      goog.net.XhrIo.buildProgressEvent_(e, goog.net.EventType.PROGRESS));\n  this.dispatchEvent(goog.net.XhrIo.buildProgressEvent_(\n      e,\n      opt_isDownload ? goog.net.EventType.DOWNLOAD_PROGRESS :\n                       goog.net.EventType.UPLOAD_PROGRESS));\n};\n\n\n/**\n * Creates a representation of the native ProgressEvent. IE doesn't support\n * constructing ProgressEvent via \"new\", and the alternatives (e.g.,\n * ProgressEvent.initProgressEvent) are non-standard or deprecated.\n * @param {!ProgressEvent} e XHR progress event.\n * @param {!goog.net.EventType} eventType The type of the event.\n * @return {!ProgressEvent} The progress event.\n * @private\n */\ngoog.net.XhrIo.buildProgressEvent_ = function(e, eventType) {\n  'use strict';\n  return /** @type {!ProgressEvent} */ ({\n    type: eventType,\n    lengthComputable: e.lengthComputable,\n    loaded: e.loaded,\n    total: e.total,\n  });\n};\n\n\n/**\n * Remove the listener to protect against leaks, and nullify the XMLHttpRequest\n * object.\n * @param {boolean=} opt_fromDispose If this is from the dispose (don't want to\n *     fire any events).\n * @private\n */\ngoog.net.XhrIo.prototype.cleanUpXhr_ = function(opt_fromDispose) {\n  'use strict';\n  if (this.xhr_) {\n    // Cancel any pending timeout event handler.\n    this.cleanUpTimeoutTimer_();\n\n    // Save reference so we can mark it as closed after the READY event.  The\n    // READY event may trigger another request, thus we must nullify this.xhr_\n    const xhr = this.xhr_;\n    const clearedOnReadyStateChange =\n        this.xhrOptions_[goog.net.XmlHttp.OptionType.USE_NULL_FUNCTION] ?\n        () => {} :\n        null;\n    this.xhr_ = null;\n    this.xhrOptions_ = null;\n\n    if (!opt_fromDispose) {\n      this.dispatchEvent(goog.net.EventType.READY);\n    }\n\n    try {\n      // NOTE(user): Not nullifying in FireFox can still leak if the callbacks\n      // are defined in the same scope as the instance of XhrIo. But, IE doesn't\n      // allow you to set the onreadystatechange to NULL so nullFunction is\n      // used.\n      xhr.onreadystatechange = clearedOnReadyStateChange;\n    } catch (e) {\n      // This seems to occur with a Gears HTTP request. Delayed the setting of\n      // this onreadystatechange until after READY is sent out and catching the\n      // error to see if we can track down the problem.\n      goog.log.error(\n          this.logger_,\n          'Problem encountered resetting onreadystatechange: ' + e.message);\n    }\n  }\n};\n\n\n/**\n * Make sure the timeout timer isn't running.\n * @private\n */\ngoog.net.XhrIo.prototype.cleanUpTimeoutTimer_ = function() {\n  'use strict';\n  if (this.xhr_ && this.useXhr2Timeout_) {\n    this.xhr_[goog.net.XhrIo.XHR2_ON_TIMEOUT_] = null;\n  }\n  if (this.timeoutId_) {\n    goog.Timer.clear(this.timeoutId_);\n    this.timeoutId_ = null;\n  }\n};\n\n\n/**\n * @return {boolean} Whether there is an active request.\n */\ngoog.net.XhrIo.prototype.isActive = function() {\n  'use strict';\n  return !!this.xhr_;\n};\n\n\n/**\n * @return {boolean} Whether the request has completed.\n */\ngoog.net.XhrIo.prototype.isComplete = function() {\n  'use strict';\n  return this.getReadyState() == goog.net.XmlHttp.ReadyState.COMPLETE;\n};\n\n\n/**\n * @return {boolean} Whether the request completed with a success.\n */\ngoog.net.XhrIo.prototype.isSuccess = function() {\n  'use strict';\n  const status = this.getStatus();\n  // A zero status code is considered successful for local files.\n  return goog.net.HttpStatus.isSuccess(status) ||\n      status === 0 && !this.isLastUriEffectiveSchemeHttp_();\n};\n\n\n/**\n * @return {boolean} whether the effective scheme of the last URI that was\n *     fetched was 'http' or 'https'.\n * @private\n */\ngoog.net.XhrIo.prototype.isLastUriEffectiveSchemeHttp_ = function() {\n  'use strict';\n  const scheme = goog.uri.utils.getEffectiveScheme(String(this.lastUri_));\n  return HTTP_SCHEME_PATTERN.test(scheme);\n};\n\n\n/**\n * Get the readystate from the Xhr object\n * Will only return correct result when called from the context of a callback\n * @return {goog.net.XmlHttp.ReadyState} goog.net.XmlHttp.ReadyState.*.\n */\ngoog.net.XhrIo.prototype.getReadyState = function() {\n  'use strict';\n  return this.xhr_ ?\n      /** @type {goog.net.XmlHttp.ReadyState} */ (this.xhr_.readyState) :\n      goog.net.XmlHttp.ReadyState.UNINITIALIZED;\n};\n\n\n/**\n * Get the status from the Xhr object\n * Will only return correct result when called from the context of a callback\n * @return {number} Http status.\n */\ngoog.net.XhrIo.prototype.getStatus = function() {\n  'use strict';\n  /**\n   * IE doesn't like you checking status until the readystate is greater than 2\n   * (i.e. it is receiving or complete).  The try/catch is used for when the\n   * page is unloading and an ERROR_NOT_AVAILABLE may occur when accessing xhr_.\n   */\n  try {\n    return this.getReadyState() > goog.net.XmlHttp.ReadyState.LOADED ?\n        this.xhr_.status :\n        -1;\n  } catch (e) {\n    return -1;\n  }\n};\n\n\n/**\n * Get the status text from the Xhr object\n * Will only return correct result when called from the context of a callback\n * @return {string} Status text.\n */\ngoog.net.XhrIo.prototype.getStatusText = function() {\n  'use strict';\n  /**\n   * IE doesn't like you checking status until the readystate is greater than 2\n   * (i.e. it is receiving or complete).  The try/catch is used for when the\n   * page is unloading and an ERROR_NOT_AVAILABLE may occur when accessing xhr_.\n   */\n  try {\n    return this.getReadyState() > goog.net.XmlHttp.ReadyState.LOADED ?\n        this.xhr_.statusText :\n        '';\n  } catch (e) {\n    goog.log.fine(this.logger_, 'Can not get status: ' + e.message);\n    return '';\n  }\n};\n\n\n/**\n * Get the last Uri that was requested\n * @return {string} Last Uri.\n */\ngoog.net.XhrIo.prototype.getLastUri = function() {\n  'use strict';\n  return String(this.lastUri_);\n};\n\n\n/**\n * Get the response text from the Xhr object\n * Will only return correct result when called from the context of a callback.\n * @return {string} Result from the server, or '' if no result available.\n */\ngoog.net.XhrIo.prototype.getResponseText = function() {\n  'use strict';\n  try {\n    return this.xhr_ ? this.xhr_.responseText : '';\n  } catch (e) {\n    // http://www.w3.org/TR/XMLHttpRequest/#the-responsetext-attribute\n    // states that responseText should return '' (and responseXML null)\n    // when the state is not LOADING or DONE. Instead, IE can\n    // throw unexpected exceptions, for example when a request is aborted\n    // or no data is available yet.\n    goog.log.fine(this.logger_, 'Can not get responseText: ' + e.message);\n    return '';\n  }\n};\n\n\n/**\n * Get the response body from the Xhr object. This property is only available\n * in IE since version 7 according to MSDN:\n * http://msdn.microsoft.com/en-us/library/ie/ms534368(v=vs.85).aspx\n * Will only return correct result when called from the context of a callback.\n *\n * One option is to construct a VBArray from the returned object and convert\n * it to a JavaScript array using the toArray method:\n * `(new window['VBArray'](xhrIo.getResponseBody())).toArray()`\n * This will result in an array of numbers in the range of [0..255]\n *\n * Another option is to use the VBScript CStr method to convert it into a\n * string as outlined in http://stackoverflow.com/questions/1919972\n *\n * @return {Object} Binary result from the server or null if not available.\n */\ngoog.net.XhrIo.prototype.getResponseBody = function() {\n  'use strict';\n  try {\n    if (this.xhr_ && 'responseBody' in this.xhr_) {\n      return this.xhr_['responseBody'];\n    }\n  } catch (e) {\n    // IE can throw unexpected exceptions, for example when a request is aborted\n    // or no data is yet available.\n    goog.log.fine(this.logger_, 'Can not get responseBody: ' + e.message);\n  }\n  return null;\n};\n\n\n/**\n * Get the response XML from the Xhr object\n * Will only return correct result when called from the context of a callback.\n * @return {Document} The DOM Document representing the XML file, or null\n * if no result available.\n */\ngoog.net.XhrIo.prototype.getResponseXml = function() {\n  'use strict';\n  try {\n    return this.xhr_ ? this.xhr_.responseXML : null;\n  } catch (e) {\n    goog.log.fine(this.logger_, 'Can not get responseXML: ' + e.message);\n    return null;\n  }\n};\n\n\n/**\n * Get the response and evaluates it as JSON from the Xhr object\n * Will only return correct result when called from the context of a callback\n * @param {string=} opt_xssiPrefix Optional XSSI prefix string to use for\n *     stripping of the response before parsing. This needs to be set only if\n *     your backend server prepends the same prefix string to the JSON response.\n * @throws Error if the response text is invalid JSON.\n * @return {Object|undefined} JavaScript object.\n */\ngoog.net.XhrIo.prototype.getResponseJson = function(opt_xssiPrefix) {\n  'use strict';\n  if (!this.xhr_) {\n    return undefined;\n  }\n\n  let responseText = this.xhr_.responseText;\n  if (opt_xssiPrefix && responseText.indexOf(opt_xssiPrefix) == 0) {\n    responseText = responseText.substring(opt_xssiPrefix.length);\n  }\n\n  return goog.json.hybrid.parse(responseText);\n};\n\n\n/**\n * Get the response as the type specificed by {@link #setResponseType}. At time\n * of writing, this is only directly supported in very recent versions of WebKit\n * (10.0.612.1 dev and later). If the field is not supported directly, we will\n * try to emulate it.\n *\n * Emulating the response means following the rules laid out at\n * http://www.w3.org/TR/XMLHttpRequest/#the-response-attribute\n *\n * On browsers with no support for this (Chrome < 10, Firefox < 4, etc), only\n * response types of DEFAULT or TEXT may be used, and the response returned will\n * be the text response.\n *\n * On browsers with Mozilla's draft support for array buffers (Firefox 4, 5),\n * only response types of DEFAULT, TEXT, and ARRAY_BUFFER may be used, and the\n * response returned will be either the text response or the Mozilla\n * implementation of the array buffer response.\n *\n * On browsers will full support, any valid response type supported by the\n * browser may be used, and the response provided by the browser will be\n * returned.\n *\n * @return {*} The response.\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.net.XhrIo.prototype.getResponse = function() {\n  'use strict';\n  try {\n    if (!this.xhr_) {\n      return null;\n    }\n    if ('response' in this.xhr_) {\n      return this.xhr_.response;\n    }\n    switch (this.responseType_) {\n      case ResponseType.DEFAULT:\n      case ResponseType.TEXT:\n        return this.xhr_.responseText;\n      // DOCUMENT and BLOB don't need to be handled here because they are\n      // introduced in the same spec that adds the .response field, and would\n      // have been caught above.\n      // ARRAY_BUFFER needs an implementation for Firefox 4, where it was\n      // implemented using a draft spec rather than the final spec.\n      case ResponseType.ARRAY_BUFFER:\n        if ('mozResponseArrayBuffer' in this.xhr_) {\n          return this.xhr_.mozResponseArrayBuffer;\n        }\n    }\n    // Fell through to a response type that is not supported on this browser.\n    goog.log.error(\n        this.logger_,\n        'Response type ' + this.responseType_ + ' is not ' +\n            'supported on this browser');\n    return null;\n  } catch (e) {\n    goog.log.fine(this.logger_, 'Can not get response: ' + e.message);\n    return null;\n  }\n};\n\n\n/**\n * Get the value of the response-header with the given name from the Xhr object\n * Will only return correct result when called from the context of a callback\n * and the request has completed\n * @param {string} key The name of the response-header to retrieve.\n * @return {string|undefined} The value of the response-header named key.\n */\ngoog.net.XhrIo.prototype.getResponseHeader = function(key) {\n  'use strict';\n  if (!this.xhr_ || !this.isComplete()) {\n    return undefined;\n  }\n\n  const value = this.xhr_.getResponseHeader(key);\n  return value === null ? undefined : value;\n};\n\n\n/**\n * Gets the text of all the headers in the response.\n * Will only return correct result after ready state reaches `LOADED` (i.e.\n * `HEADERS_RECEIVED` as per MDN).\n * @return {string} The value of the response headers or empty string.\n */\ngoog.net.XhrIo.prototype.getAllResponseHeaders = function() {\n  'use strict';\n  // getAllResponseHeaders can return null if no response has been received,\n  // ensure we always return an empty string.\n  return this.xhr_ &&\n          this.getReadyState() >= goog.net.XmlHttp.ReadyState.LOADED ?\n      (this.xhr_.getAllResponseHeaders() || '') :\n      '';\n};\n\n\n/**\n * Returns all response headers as a key-value map.\n * Multiple values for the same header key can be combined into one,\n * separated by a comma and a space.\n * Note that the native getResponseHeader method for retrieving a single header\n * does a case insensitive match on the header name. This method does not\n * include any case normalization logic, it will just return a key-value\n * representation of the headers.\n * See: http://www.w3.org/TR/XMLHttpRequest/#the-getresponseheader()-method\n * @return {!Object<string, string>} An object with the header keys as keys\n *     and header values as values.\n */\ngoog.net.XhrIo.prototype.getResponseHeaders = function() {\n  'use strict';\n  // TODO(user): Make this function parse headers as per the spec\n  // (https://tools.ietf.org/html/rfc2616#section-4.2).\n\n  const headersObject = {};\n  const headersArray = this.getAllResponseHeaders().split('\\r\\n');\n  for (let i = 0; i < headersArray.length; i++) {\n    if (goog.string.isEmptyOrWhitespace(headersArray[i])) {\n      continue;\n    }\n    const keyValue =\n        goog.string.splitLimit(headersArray[i], ':', /* maxSplitCount= */ 1);\n    const key = keyValue[0];\n    let value = keyValue[1];\n\n    if (typeof value !== 'string') {\n      // There must be a value but it can be the empty string.\n      continue;\n    }\n\n    // Whitespace at the start and end of the value is meaningless.\n    value = value.trim();\n    // The key should not contain whitespace but we currently ignore that.\n\n    const values = headersObject[key] || [];\n    headersObject[key] = values;\n    values.push(value);\n  }\n\n  return goog.object.map(headersObject, function(values) {\n    'use strict';\n    return values.join(', ');\n  });\n};\n\n\n/**\n * Get the value of the response-header with the given name from the Xhr object.\n * As opposed to {@link #getResponseHeader}, this method does not require that\n * the request has completed.\n * @param {string} key The name of the response-header to retrieve.\n * @return {?string} The value of the response-header, or null if it is\n *     unavailable.\n */\ngoog.net.XhrIo.prototype.getStreamingResponseHeader = function(key) {\n  'use strict';\n  return this.xhr_ ? this.xhr_.getResponseHeader(key) : null;\n};\n\n\n/**\n * Gets the text of all the headers in the response. As opposed to\n * {@link #getAllResponseHeaders}, this method does not require that the request\n * has completed.\n * @return {string} The value of the response headers or empty string.\n */\ngoog.net.XhrIo.prototype.getAllStreamingResponseHeaders = function() {\n  'use strict';\n  return this.xhr_ ? this.xhr_.getAllResponseHeaders() : '';\n};\n\n\n/**\n * Get the last error message\n * @return {!goog.net.ErrorCode} Last error code.\n */\ngoog.net.XhrIo.prototype.getLastErrorCode = function() {\n  'use strict';\n  return this.lastErrorCode_;\n};\n\n\n/**\n * Get the last error message\n * @return {string} Last error message.\n */\ngoog.net.XhrIo.prototype.getLastError = function() {\n  'use strict';\n  return typeof this.lastError_ === 'string' ? this.lastError_ :\n                                               String(this.lastError_);\n};\n\n\n/**\n * Adds the last method, status and URI to the message.  This is used to add\n * this information to the logging calls.\n * @param {string} msg The message text that we want to add the extra text to.\n * @return {string} The message with the extra text appended.\n * @private\n */\ngoog.net.XhrIo.prototype.formatMsg_ = function(msg) {\n  'use strict';\n  return msg + ' [' + this.lastMethod_ + ' ' + this.lastUri_ + ' ' +\n      this.getStatus() + ']';\n};\n\n\n// Register the xhr handler as an entry point, so that\n// it can be monitored for exception handling, etc.\ngoog.debug.entryPointRegistry.register(\n    /**\n     * @param {function(!Function): !Function} transformer The transforming\n     *     function.\n     */\n    function(transformer) {\n      'use strict';\n      goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_ =\n          transformer(goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_);\n    });\n});  // goog.scope\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Provides a function to throw an error without interrupting\n * the current execution context.\n */\n\ngoog.module('goog.async.throwException');\ngoog.module.declareLegacyNamespace();\n\n/**\n * Throw an item without interrupting the current execution context.  For\n * example, if processing a group of items in a loop, sometimes it is useful\n * to report an error while still allowing the rest of the batch to be\n * processed.\n * @param {*} exception\n */\nfunction throwException(exception) {\n  // Each throw needs to be in its own context.\n  goog.global.setTimeout(() => {\n    throw exception;\n  }, 0);\n}\nexports = throwException;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview A timer class to which other classes and objects can listen on.\n * This is only an abstraction above `setInterval`.\n *\n * @see ../demos/timers.html\n */\n\ngoog.provide('goog.Timer');\n\ngoog.require('goog.Promise');\ngoog.require('goog.events.EventTarget');\ngoog.requireType('goog.Thenable');\n\n\n\n/**\n * Class for handling timing events.\n *\n * @param {number=} opt_interval Number of ms between ticks (default: 1ms).\n * @param {Object=} opt_timerObject  An object that has `setTimeout`,\n *     `setInterval`, `clearTimeout` and `clearInterval`\n *     (e.g., `window`).\n * @constructor\n * @extends {goog.events.EventTarget}\n */\ngoog.Timer = function(opt_interval, opt_timerObject) {\n  'use strict';\n  goog.events.EventTarget.call(this);\n\n  /**\n   * Number of ms between ticks\n   * @private {number}\n   */\n  this.interval_ = opt_interval || 1;\n\n  /**\n   * An object that implements `setTimeout`, `setInterval`,\n   * `clearTimeout` and `clearInterval`. We default to the window\n   * object. Changing this on {@link goog.Timer.prototype} changes the object\n   * for all timer instances which can be useful if your environment has some\n   * other implementation of timers than the `window` object.\n   * @private {{setTimeout:!Function, clearTimeout:!Function}}\n   */\n  this.timerObject_ = /** @type {{setTimeout, clearTimeout}} */ (\n      opt_timerObject || goog.Timer.defaultTimerObject);\n\n  /**\n   * Cached `tick_` bound to the object for later use in the timer.\n   * @private {Function}\n   * @const\n   */\n  this.boundTick_ = goog.bind(this.tick_, this);\n\n  /**\n   * Firefox browser often fires the timer event sooner (sometimes MUCH sooner)\n   * than the requested timeout. So we compare the time to when the event was\n   * last fired, and reschedule if appropriate. See also\n   * {@link goog.Timer.intervalScale}.\n   * @private {number}\n   */\n  this.last_ = goog.now();\n};\ngoog.inherits(goog.Timer, goog.events.EventTarget);\n\n\n/**\n * Maximum timeout value.\n *\n * Timeout values too big to fit into a signed 32-bit integer may cause overflow\n * in FF, Safari, and Chrome, resulting in the timeout being scheduled\n * immediately. It makes more sense simply not to schedule these timeouts, since\n * 24.8 days is beyond a reasonable expectation for the browser to stay open.\n *\n * @private {number}\n * @const\n */\ngoog.Timer.MAX_TIMEOUT_ = 2147483647;\n\n\n/**\n * A timer ID that cannot be returned by any known implementation of\n * `window.setTimeout`. Passing this value to `window.clearTimeout`\n * should therefore be a no-op.\n *\n * @private {number}\n * @const\n */\ngoog.Timer.INVALID_TIMEOUT_ID_ = -1;\n\n\n/**\n * Whether this timer is enabled\n * @type {boolean}\n */\ngoog.Timer.prototype.enabled = false;\n\n\n/**\n * An object that implements `setTimeout`, `setInterval`,\n * `clearTimeout` and `clearInterval`. We default to the global\n * object. Changing `goog.Timer.defaultTimerObject` changes the object for\n * all timer instances which can be useful if your environment has some other\n * implementation of timers you'd like to use.\n * @type {{setTimeout, clearTimeout}}\n */\ngoog.Timer.defaultTimerObject = goog.global;\n\n\n/**\n * Variable that controls the timer error correction. If the timer is called\n * before the requested interval times `intervalScale`, which often\n * happens on Mozilla, the timer is rescheduled.\n * @see {@link #last_}\n * @type {number}\n */\ngoog.Timer.intervalScale = 0.8;\n\n\n/**\n * Variable for storing the result of `setInterval`.\n * @private {?number}\n */\ngoog.Timer.prototype.timer_ = null;\n\n\n/**\n * Gets the interval of the timer.\n * @return {number} interval Number of ms between ticks.\n */\ngoog.Timer.prototype.getInterval = function() {\n  'use strict';\n  return this.interval_;\n};\n\n\n/**\n * Sets the interval of the timer.\n * @param {number} interval Number of ms between ticks.\n */\ngoog.Timer.prototype.setInterval = function(interval) {\n  'use strict';\n  this.interval_ = interval;\n  if (this.timer_ && this.enabled) {\n    // Stop and then start the timer to reset the interval.\n    this.stop();\n    this.start();\n  } else if (this.timer_) {\n    this.stop();\n  }\n};\n\n\n/**\n * Callback for the `setTimeout` used by the timer.\n * @private\n */\ngoog.Timer.prototype.tick_ = function() {\n  'use strict';\n  if (this.enabled) {\n    var elapsed = goog.now() - this.last_;\n    if (elapsed > 0 && elapsed < this.interval_ * goog.Timer.intervalScale) {\n      this.timer_ = this.timerObject_.setTimeout(\n          this.boundTick_, this.interval_ - elapsed);\n      return;\n    }\n\n    // Prevents setInterval from registering a duplicate timeout when called\n    // in the timer event handler.\n    if (this.timer_) {\n      this.timerObject_.clearTimeout(this.timer_);\n      this.timer_ = null;\n    }\n\n    this.dispatchTick();\n    // The timer could be stopped in the timer event handler.\n    if (this.enabled) {\n      // Stop and start to ensure there is always only one timeout even if\n      // start is called in the timer event handler.\n      this.stop();\n      this.start();\n    }\n  }\n};\n\n\n/**\n * Dispatches the TICK event. This is its own method so subclasses can override.\n */\ngoog.Timer.prototype.dispatchTick = function() {\n  'use strict';\n  this.dispatchEvent(goog.Timer.TICK);\n};\n\n\n/**\n * Starts the timer.\n */\ngoog.Timer.prototype.start = function() {\n  'use strict';\n  this.enabled = true;\n\n  // If there is no interval already registered, start it now\n  if (!this.timer_) {\n    // IMPORTANT!\n    // window.setInterval in FireFox has a bug - it fires based on\n    // absolute time, rather than on relative time. What this means\n    // is that if a computer is sleeping/hibernating for 24 hours\n    // and the timer interval was configured to fire every 1000ms,\n    // then after the PC wakes up the timer will fire, in rapid\n    // succession, 3600*24 times.\n    // This bug is described here and is already fixed, but it will\n    // take time to propagate, so for now I am switching this over\n    // to setTimeout logic.\n    //     https://bugzilla.mozilla.org/show_bug.cgi?id=376643\n    //\n    this.timer_ = this.timerObject_.setTimeout(this.boundTick_, this.interval_);\n    this.last_ = goog.now();\n  }\n};\n\n\n/**\n * Stops the timer.\n */\ngoog.Timer.prototype.stop = function() {\n  'use strict';\n  this.enabled = false;\n  if (this.timer_) {\n    this.timerObject_.clearTimeout(this.timer_);\n    this.timer_ = null;\n  }\n};\n\n\n/** @override */\ngoog.Timer.prototype.disposeInternal = function() {\n  'use strict';\n  goog.Timer.superClass_.disposeInternal.call(this);\n  this.stop();\n  delete this.timerObject_;\n};\n\n\n/**\n * Constant for the timer's event type.\n * @const\n */\ngoog.Timer.TICK = 'tick';\n\n\n/**\n * Calls the given function once, after the optional pause.\n * <p>\n * The function is always called asynchronously, even if the delay is 0. This\n * is a common trick to schedule a function to run after a batch of browser\n * event processing.\n *\n * @param {function(this:SCOPE)|{handleEvent:function()}|null} listener Function\n *     or object that has a handleEvent method.\n * @param {number=} opt_delay Milliseconds to wait; default is 0.\n * @param {SCOPE=} opt_handler Object in whose scope to call the listener.\n * @return {number} A handle to the timer ID.\n * @template SCOPE\n */\ngoog.Timer.callOnce = function(listener, opt_delay, opt_handler) {\n  'use strict';\n  if (typeof listener === 'function') {\n    if (opt_handler) {\n      listener = goog.bind(listener, opt_handler);\n    }\n  } else if (listener && typeof listener.handleEvent == 'function') {\n    // using typeof to prevent strict js warning\n    listener = goog.bind(listener.handleEvent, listener);\n  } else {\n    throw new Error('Invalid listener argument');\n  }\n\n  if (Number(opt_delay) > goog.Timer.MAX_TIMEOUT_) {\n    // Timeouts greater than MAX_INT return immediately due to integer\n    // overflow in many browsers.  Since MAX_INT is 24.8 days, just don't\n    // schedule anything at all.\n    return goog.Timer.INVALID_TIMEOUT_ID_;\n  } else {\n    return goog.Timer.defaultTimerObject.setTimeout(listener, opt_delay || 0);\n  }\n};\n\n\n/**\n * Clears a timeout initiated by {@link #callOnce}.\n * @param {?number} timerId A timer ID.\n */\ngoog.Timer.clear = function(timerId) {\n  'use strict';\n  goog.Timer.defaultTimerObject.clearTimeout(timerId);\n};\n\n\n/**\n * @param {number} delay Milliseconds to wait.\n * @param {(RESULT|goog.Thenable<RESULT>|Thenable)=} opt_result The value\n *     with which the promise will be resolved.\n * @return {!goog.Promise<RESULT>} A promise that will be resolved after\n *     the specified delay, unless it is canceled first.\n * @template RESULT\n */\ngoog.Timer.promise = function(delay, opt_result) {\n  'use strict';\n  var timerKey = null;\n  return new goog\n      .Promise(function(resolve, reject) {\n        'use strict';\n        timerKey = goog.Timer.callOnce(function() {\n          'use strict';\n          resolve(opt_result);\n        }, delay);\n        if (timerKey == goog.Timer.INVALID_TIMEOUT_ID_) {\n          reject(new Error('Failed to schedule timer.'));\n        }\n      })\n      .thenCatch(function(error) {\n        'use strict';\n        // Clear the timer. The most likely reason is \"cancel\" signal.\n        goog.Timer.clear(timerKey);\n        throw error;\n      });\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Definition of the goog.async.Throttle class.\n *\n * @see ../demos/timers.html\n */\n\ngoog.module('goog.async.Throttle');\ngoog.module.declareLegacyNamespace();\n\nconst Disposable = goog.require('goog.Disposable');\nconst Timer = goog.require('goog.Timer');\n\n\n/**\n * Throttle will perform an action that is passed in no more than once\n * per interval (specified in milliseconds). If it gets multiple signals\n * to perform the action while it is waiting, it will only perform the action\n * once at the end of the interval.\n * @final\n * @template T\n */\nclass Throttle extends Disposable {\n  /**\n   * @param {function(this: T, ...?)} listener Function to callback when the\n   *     action is triggered.\n   * @param {number} interval Interval over which to throttle. The listener can\n   *     only be called once per interval.\n   * @param {T=} handler Object in whose scope to call the listener.\n   */\n  constructor(listener, interval, handler) {\n    super();\n    /**\n     * Function to callback\n     * @type {function(this: T, ...?)}\n     * @private\n     */\n    this.listener_ = handler != null ? listener.bind(handler) : listener;\n\n    /**\n     * Interval for the throttle time\n     * @type {number}\n     * @private\n     */\n    this.interval_ = interval;\n\n    /**\n     * The last arguments passed into `fire`, or null if there is no pending\n     * call.\n     * @private {?IArrayLike}\n     */\n    this.args_ = null;\n\n    /**\n     * Indicates that the action is pending and needs to be fired.\n     * @type {boolean}\n     * @private\n     */\n    this.shouldFire_ = false;\n\n    /**\n     * Indicates the count of nested pauses currently in effect on the throttle.\n     * When this count is not zero, fired actions will be postponed until the\n     * throttle is resumed enough times to drop the pause count to zero.\n     * @type {number}\n     * @private\n     */\n    this.pauseCount_ = 0;\n\n    /**\n     * Timer for scheduling the next callback\n     * @type {?number}\n     * @private\n     */\n    this.timer_ = null;\n  }\n\n  /**\n   * Notifies the throttle that the action has happened. It will throttle\n   * the call so that the callback is not called too often according to the\n   * interval parameter passed to the constructor, passing the arguments\n   * from the last call of this function into the throttled function.\n   * @param {...?} var_args Arguments to pass on to the throttled function.\n   */\n  fire(var_args) {\n    this.args_ = arguments;\n    if (!this.timer_ && !this.pauseCount_) {\n      this.doAction_();\n    } else {\n      this.shouldFire_ = true;\n    }\n  }\n\n  /**\n   * Cancels any pending action callback. The throttle can be restarted by\n   * calling {@link #fire}.\n   */\n  stop() {\n    if (this.timer_) {\n      Timer.clear(this.timer_);\n      this.timer_ = null;\n      this.shouldFire_ = false;\n      this.args_ = null;\n    }\n  }\n\n  /**\n   * Pauses the throttle.  All pending and future action callbacks will be\n   * delayed until the throttle is resumed.  Pauses can be nested.\n   */\n  pause() {\n    this.pauseCount_++;\n  }\n\n  /**\n   * Resumes the throttle.  If doing so drops the pausing count to zero,\n   * pending action callbacks will be executed as soon as possible, but\n   * still no sooner than an interval's delay after the previous call.\n   * Future action callbacks will be executed as normal.\n   */\n  resume() {\n    this.pauseCount_--;\n    if (!this.pauseCount_ && this.shouldFire_ && !this.timer_) {\n      this.shouldFire_ = false;\n      this.doAction_();\n    }\n  }\n\n  /** @override */\n  disposeInternal() {\n    super.disposeInternal();\n    this.stop();\n  }\n\n  /**\n   * Handler for the timer to fire the throttle\n   * @private\n   */\n  onTimer_() {\n    this.timer_ = null;\n\n    if (this.shouldFire_ && !this.pauseCount_) {\n      this.shouldFire_ = false;\n      this.doAction_();\n    }\n  }\n\n  /**\n   * Calls the callback\n   * @private\n   */\n  doAction_() {\n    this.timer_ = Timer.callOnce(() => this.onTimer_(), this.interval_);\n    const args = this.args_;\n    // release memory first so it always happens even if listener throws\n    this.args_ = null;\n    this.listener_.apply(null, args);\n  }\n}\n\nexports = Throttle;\n",null,"/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Class to create objects which want to handle multiple events\n * and have their listeners easily cleaned up via a dispose method.\n *\n * Example:\n * <pre>\n * function Something() {\n *   Something.base(this);\n *\n *   ... set up object ...\n *\n *   // Add event listeners\n *   this.listen(this.starEl, goog.events.EventType.CLICK, this.handleStar);\n *   this.listen(this.headerEl, goog.events.EventType.CLICK, this.expand);\n *   this.listen(this.collapseEl, goog.events.EventType.CLICK, this.collapse);\n *   this.listen(this.infoEl, goog.events.EventType.MOUSEOVER, this.showHover);\n *   this.listen(this.infoEl, goog.events.EventType.MOUSEOUT, this.hideHover);\n * }\n * goog.inherits(Something, goog.events.EventHandler);\n *\n * Something.prototype.disposeInternal = function() {\n *   Something.base(this, 'disposeInternal');\n *   goog.dom.removeNode(this.container);\n * };\n *\n *\n * // Then elsewhere:\n *\n * var activeSomething = null;\n * function openSomething() {\n *   activeSomething = new Something();\n * }\n *\n * function closeSomething() {\n *   if (activeSomething) {\n *     activeSomething.dispose();  // Remove event listeners\n *     activeSomething = null;\n *   }\n * }\n * </pre>\n */\n\ngoog.provide('goog.events.EventHandler');\n\ngoog.require('goog.Disposable');\ngoog.require('goog.events');\ngoog.require('goog.object');\ngoog.requireType('goog.events.Event');\ngoog.requireType('goog.events.EventId');\ngoog.requireType('goog.events.EventTarget');\ngoog.requireType('goog.events.EventWrapper');\n\n\n\n/**\n * Super class for objects that want to easily manage a number of event\n * listeners.  It allows a short cut to listen and also provides a quick way\n * to remove all events listeners belonging to this object.\n * @param {SCOPE=} opt_scope Object in whose scope to call the listeners.\n * @constructor\n * @extends {goog.Disposable}\n * @template SCOPE\n */\ngoog.events.EventHandler = function(opt_scope) {\n  'use strict';\n  goog.Disposable.call(this);\n  // TODO(mknichel): Rename this to this.scope_ and fix the classes in google3\n  // that access this private variable. :(\n  this.handler_ = opt_scope;\n\n  /**\n   * Keys for events that are being listened to.\n   * @type {!Object<!goog.events.Key>}\n   * @private\n   */\n  this.keys_ = {};\n};\ngoog.inherits(goog.events.EventHandler, goog.Disposable);\n\n\n/**\n * Utility array used to unify the cases of listening for an array of types\n * and listening for a single event, without using recursion or allocating\n * an array each time.\n * @type {!Array<string>}\n * @const\n * @private\n */\ngoog.events.EventHandler.typeArray_ = [];\n\n\n/**\n * Listen to an event on a Listenable.  If the function is omitted then the\n * EventHandler's handleEvent method will be used.\n * @param {goog.events.ListenableType} src Event source.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type to listen for or array of event types.\n * @param {function(this:SCOPE, EVENTOBJ):?|{handleEvent:function(?):?}|null=}\n *     opt_fn Optional callback function to be used as the listener or an object\n *     with handleEvent function.\n * @param {(boolean|!AddEventListenerOptions)=} opt_options\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template EVENTOBJ, THIS\n */\ngoog.events.EventHandler.prototype.listen = function(\n    src, type, opt_fn, opt_options) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  return self.listen_(src, type, opt_fn, opt_options);\n};\n\n\n/**\n * Listen to an event on a Listenable.  If the function is omitted then the\n * EventHandler's handleEvent method will be used.\n * @param {goog.events.ListenableType} src Event source.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type to listen for or array of event types.\n * @param {function(this:T, EVENTOBJ):?|{handleEvent:function(this:T, ?):?}|\n *     null|undefined} fn Optional callback function to be used as the\n *     listener or an object with handleEvent function.\n * @param {boolean|!AddEventListenerOptions|undefined} options\n * @param {T} scope Object in whose scope to call the listener.\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template T, EVENTOBJ, THIS\n */\ngoog.events.EventHandler.prototype.listenWithScope = function(\n    src, type, fn, options, scope) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  // TODO(mknichel): Deprecate this function.\n  return self.listen_(src, type, fn, options, scope);\n};\n\n\n/**\n * Listen to an event on a Listenable.  If the function is omitted then the\n * EventHandler's handleEvent method will be used.\n * @param {goog.events.ListenableType} src Event source.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type to listen for or array of event types.\n * @param {function(EVENTOBJ):?|{handleEvent:function(?):?}|null=} opt_fn\n *     Optional callback function to be used as the listener or an object with\n *     handleEvent function.\n * @param {(boolean|!AddEventListenerOptions)=} opt_options\n * @param {Object=} opt_scope Object in whose scope to call the listener.\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template EVENTOBJ, THIS\n * @private\n */\ngoog.events.EventHandler.prototype.listen_ = function(\n    src, type, opt_fn, opt_options, opt_scope) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  if (!Array.isArray(type)) {\n    if (type) {\n      goog.events.EventHandler.typeArray_[0] = type.toString();\n    }\n    type = goog.events.EventHandler.typeArray_;\n  }\n  for (var i = 0; i < type.length; i++) {\n    var listenerObj = goog.events.listen(\n        src, type[i], opt_fn || self.handleEvent, opt_options || false,\n        opt_scope || self.handler_ || self);\n\n    if (!listenerObj) {\n      // When goog.events.listen run on OFF_AND_FAIL or OFF_AND_SILENT\n      // (goog.events.CaptureSimulationMode) in IE8-, it will return null\n      // value.\n      return self;\n    }\n\n    /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n    var key = listenerObj.key;\n    self.keys_[key] = listenerObj;\n  }\n\n  return self;\n};\n\n\n/**\n * Listen to an event on a Listenable.  If the function is omitted, then the\n * EventHandler's handleEvent method will be used. After the event has fired the\n * event listener is removed from the target. If an array of event types is\n * provided, each event type will be listened to once.\n * @param {goog.events.ListenableType} src Event source.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type to listen for or array of event types.\n * @param {function(this:SCOPE, EVENTOBJ):?|{handleEvent:function(?):?}|null=}\n * opt_fn\n *    Optional callback function to be used as the listener or an object with\n *    handleEvent function.\n * @param {(boolean|!AddEventListenerOptions)=} opt_options\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template EVENTOBJ, THIS\n */\ngoog.events.EventHandler.prototype.listenOnce = function(\n    src, type, opt_fn, opt_options) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  return self.listenOnce_(src, type, opt_fn, opt_options);\n};\n\n\n/**\n * Listen to an event on a Listenable.  If the function is omitted, then the\n * EventHandler's handleEvent method will be used. After the event has fired the\n * event listener is removed from the target. If an array of event types is\n * provided, each event type will be listened to once.\n * @param {goog.events.ListenableType} src Event source.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type to listen for or array of event types.\n * @param {function(this:T, EVENTOBJ):?|{handleEvent:function(this:T, ?):?}|\n *     null|undefined} fn Optional callback function to be used as the\n *     listener or an object with handleEvent function.\n * @param {boolean|undefined} capture Optional whether to use capture phase.\n * @param {T} scope Object in whose scope to call the listener.\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template T, EVENTOBJ, THIS\n */\ngoog.events.EventHandler.prototype.listenOnceWithScope = function(\n    src, type, fn, capture, scope) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  // TODO(mknichel): Deprecate this function.\n  return self.listenOnce_(src, type, fn, capture, scope);\n};\n\n\n/**\n * Listen to an event on a Listenable.  If the function is omitted, then the\n * EventHandler's handleEvent method will be used. After the event has fired\n * the event listener is removed from the target. If an array of event types is\n * provided, each event type will be listened to once.\n * @param {goog.events.ListenableType} src Event source.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type to listen for or array of event types.\n * @param {function(EVENTOBJ):?|{handleEvent:function(?):?}|null=} opt_fn\n *    Optional callback function to be used as the listener or an object with\n *    handleEvent function.\n * @param {(boolean|!AddEventListenerOptions)=} opt_options\n * @param {Object=} opt_scope Object in whose scope to call the listener.\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template EVENTOBJ, THIS\n * @private\n */\ngoog.events.EventHandler.prototype.listenOnce_ = function(\n    src, type, opt_fn, opt_options, opt_scope) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  if (Array.isArray(type)) {\n    for (var i = 0; i < type.length; i++) {\n      self.listenOnce_(src, type[i], opt_fn, opt_options, opt_scope);\n    }\n  } else {\n    var listenerObj = goog.events.listenOnce(\n        src, type, opt_fn || self.handleEvent, opt_options,\n        opt_scope || self.handler_ || self);\n    if (!listenerObj) {\n      // When goog.events.listen run on OFF_AND_FAIL or OFF_AND_SILENT\n      // (goog.events.CaptureSimulationMode) in IE8-, it will return null\n      // value.\n      return self;\n    }\n\n    /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n    var key = listenerObj.key;\n    self.keys_[key] = listenerObj;\n  }\n\n  return self;\n};\n\n\n/**\n * Adds an event listener with a specific event wrapper on a DOM Node or an\n * object that has implemented {@link goog.events.EventTarget}. A listener can\n * only be added once to an object.\n *\n * @param {EventTarget|goog.events.EventTarget} src The node to listen to\n *     events on.\n * @param {goog.events.EventWrapper} wrapper Event wrapper to use.\n * @param {function(this:SCOPE, ?):?|{handleEvent:function(?):?}|null} listener\n *     Callback method, or an object with a handleEvent function.\n * @param {boolean=} opt_capt Whether to fire in capture phase (defaults to\n *     false).\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template THIS\n */\ngoog.events.EventHandler.prototype.listenWithWrapper = function(\n    src, wrapper, listener, opt_capt) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  // TODO(mknichel): Remove the opt_scope from this function and then\n  // templatize it.\n  return self.listenWithWrapper_(src, wrapper, listener, opt_capt);\n};\n\n\n/**\n * Adds an event listener with a specific event wrapper on a DOM Node or an\n * object that has implemented {@link goog.events.EventTarget}. A listener can\n * only be added once to an object.\n *\n * @param {EventTarget|goog.events.EventTarget} src The node to listen to\n *     events on.\n * @param {goog.events.EventWrapper} wrapper Event wrapper to use.\n * @param {function(this:T, ?):?|{handleEvent:function(this:T, ?):?}|null}\n *     listener Optional callback function to be used as the\n *     listener or an object with handleEvent function.\n * @param {boolean|undefined} capture Optional whether to use capture phase.\n * @param {T} scope Object in whose scope to call the listener.\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template T, THIS\n */\ngoog.events.EventHandler.prototype.listenWithWrapperAndScope = function(\n    src, wrapper, listener, capture, scope) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  // TODO(mknichel): Deprecate this function.\n  return self.listenWithWrapper_(src, wrapper, listener, capture, scope);\n};\n\n\n/**\n * Adds an event listener with a specific event wrapper on a DOM Node or an\n * object that has implemented {@link goog.events.EventTarget}. A listener can\n * only be added once to an object.\n *\n * @param {EventTarget|goog.events.EventTarget} src The node to listen to\n *     events on.\n * @param {goog.events.EventWrapper} wrapper Event wrapper to use.\n * @param {function(?):?|{handleEvent:function(?):?}|null} listener Callback\n *     method, or an object with a handleEvent function.\n * @param {boolean=} opt_capt Whether to fire in capture phase (defaults to\n *     false).\n * @param {Object=} opt_scope Element in whose scope to call the listener.\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template THIS\n * @private\n */\ngoog.events.EventHandler.prototype.listenWithWrapper_ = function(\n    src, wrapper, listener, opt_capt, opt_scope) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  wrapper.listen(\n      src, listener, opt_capt, opt_scope || self.handler_ || self, self);\n  return self;\n};\n\n\n/**\n * @return {number} Number of listeners registered by this handler.\n */\ngoog.events.EventHandler.prototype.getListenerCount = function() {\n  'use strict';\n  var count = 0;\n  for (var key in this.keys_) {\n    if (Object.prototype.hasOwnProperty.call(this.keys_, key)) {\n      count++;\n    }\n  }\n  return count;\n};\n\n\n/**\n * Unlistens on an event.\n * @param {goog.events.ListenableType} src Event source.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type or array of event types to unlisten to.\n * @param {function(this:?, EVENTOBJ):?|{handleEvent:function(?):?}|null=}\n *     opt_fn Optional callback function to be used as the listener or an object\n *     with handleEvent function.\n * @param {(boolean|!EventListenerOptions)=} opt_options\n * @param {Object=} opt_scope Object in whose scope to call the listener.\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template EVENTOBJ, THIS\n */\ngoog.events.EventHandler.prototype.unlisten = function(\n    src, type, opt_fn, opt_options, opt_scope) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  if (Array.isArray(type)) {\n    for (var i = 0; i < type.length; i++) {\n      self.unlisten(src, type[i], opt_fn, opt_options, opt_scope);\n    }\n  } else {\n    var capture =\n        goog.isObject(opt_options) ? !!opt_options.capture : !!opt_options;\n    var listener = goog.events.getListener(\n        src, type, opt_fn || self.handleEvent, capture,\n        opt_scope || self.handler_ || self);\n\n    if (listener) {\n      goog.events.unlistenByKey(listener);\n      delete self.keys_[listener.key];\n    }\n  }\n\n  return self;\n};\n\n\n/**\n * Removes an event listener which was added with listenWithWrapper().\n *\n * @param {EventTarget|goog.events.EventTarget} src The target to stop\n *     listening to events on.\n * @param {goog.events.EventWrapper} wrapper Event wrapper to use.\n * @param {function(?):?|{handleEvent:function(?):?}|null} listener The\n *     listener function to remove.\n * @param {boolean=} opt_capt In DOM-compliant browsers, this determines\n *     whether the listener is fired during the capture or bubble phase of the\n *     event.\n * @param {Object=} opt_scope Element in whose scope to call the listener.\n * @return {THIS} This object, allowing for chaining of calls.\n * @this {THIS}\n * @template THIS\n */\ngoog.events.EventHandler.prototype.unlistenWithWrapper = function(\n    src, wrapper, listener, opt_capt, opt_scope) {\n  'use strict';\n  var self = /** @type {!goog.events.EventHandler} */ (this);\n  wrapper.unlisten(\n      src, listener, opt_capt, opt_scope || self.handler_ || self, self);\n  return self;\n};\n\n\n/**\n * Unlistens to all events.\n */\ngoog.events.EventHandler.prototype.removeAll = function() {\n  'use strict';\n  goog.object.forEach(this.keys_, function(listenerObj, key) {\n    'use strict';\n    if (this.keys_.hasOwnProperty(key)) {\n      goog.events.unlistenByKey(listenerObj);\n    }\n  }, this);\n\n  this.keys_ = {};\n};\n\n\n/**\n * Disposes of this EventHandler and removes all listeners that it registered.\n * @override\n * @protected\n */\ngoog.events.EventHandler.prototype.disposeInternal = function() {\n  'use strict';\n  goog.events.EventHandler.superClass_.disposeInternal.call(this);\n  this.removeAll();\n};\n\n\n/**\n * Default event handler\n * @param {goog.events.Event} e Event object.\n */\ngoog.events.EventHandler.prototype.handleEvent = function(e) {\n  'use strict';\n  throw new Error('EventHandler.handleEvent not implemented');\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Provides a utility for tracing and debugging WebChannel\n *     requests.\n *\n */\n\n\ngoog.provide('goog.labs.net.webChannel.WebChannelDebug');\n\ngoog.require('goog.json');\ngoog.require('goog.log');\ngoog.requireType('goog.Uri');\ngoog.requireType('goog.net.XmlHttp.ReadyState');\n\n\n\n/**\n * Logs and keeps a buffer of debugging info for the Channel.\n *\n * @constructor\n * @struct\n * @final\n */\ngoog.labs.net.webChannel.WebChannelDebug = function() {\n  'use strict';\n  /**\n   * The logger instance.\n   * @const\n   * @private {?goog.log.Logger}\n   */\n  this.logger_ = goog.log.getLogger('goog.labs.net.webChannel.WebChannelDebug');\n\n  /**\n   * Whether to enable redact. Defaults to true.\n   * @private {boolean}\n   */\n  this.redactEnabled_ = true;\n};\n\n\ngoog.scope(function() {\n'use strict';\nvar WebChannelDebug = goog.labs.net.webChannel.WebChannelDebug;\n\n\n/**\n * Turns off redact.\n */\nWebChannelDebug.prototype.disableRedact = function() {\n  'use strict';\n  this.redactEnabled_ = false;\n};\n\n\n/**\n * Logs that the browser went offline during the lifetime of a request.\n * @param {goog.Uri} url The URL being requested.\n */\nWebChannelDebug.prototype.browserOfflineResponse = function(url) {\n  'use strict';\n  this.info(function() {\n    'use strict';\n    return 'BROWSER_OFFLINE: ' + url;\n  });\n};\n\n\n/**\n * Logs an XmlHttp request..\n * @param {string} verb The request type (GET/POST).\n * @param {goog.Uri} uri The request destination.\n * @param {string|number|undefined} id The request id.\n * @param {number} attempt Which attempt # the request was.\n * @param {?string} postData The data posted in the request.\n */\nWebChannelDebug.prototype.xmlHttpChannelRequest = function(\n    verb, uri, id, attempt, postData) {\n  'use strict';\n  var self = this;\n  this.info(function() {\n    'use strict';\n    return 'XMLHTTP REQ (' + id + ') [attempt ' + attempt + ']: ' + verb +\n        '\\n' + uri + '\\n' + self.maybeRedactPostData_(postData);\n  });\n};\n\n\n/**\n * Logs the meta data received from an XmlHttp request.\n * @param {string} verb The request type (GET/POST).\n * @param {goog.Uri} uri The request destination.\n * @param {string|number|undefined} id The request id.\n * @param {number} attempt Which attempt # the request was.\n * @param {goog.net.XmlHttp.ReadyState} readyState The ready state.\n * @param {number} statusCode The HTTP status code.\n */\nWebChannelDebug.prototype.xmlHttpChannelResponseMetaData = function(\n    verb, uri, id, attempt, readyState, statusCode) {\n  'use strict';\n  this.info(function() {\n    'use strict';\n    return 'XMLHTTP RESP (' + id + ') [ attempt ' + attempt + ']: ' + verb +\n        '\\n' + uri + '\\n' + readyState + ' ' + statusCode;\n  });\n};\n\n\n/**\n * Logs the response data received from an XmlHttp request.\n * @param {string|number|undefined} id The request id.\n * @param {?string} responseText The response text.\n * @param {?string=} opt_desc Optional request description.\n */\nWebChannelDebug.prototype.xmlHttpChannelResponseText = function(\n    id, responseText, opt_desc) {\n  'use strict';\n  var self = this;\n  this.info(function() {\n    'use strict';\n    return 'XMLHTTP TEXT (' + id + '): ' + self.redactResponse_(responseText) +\n        (opt_desc ? ' ' + opt_desc : '');\n  });\n};\n\n\n/**\n * Logs a request timeout.\n * @param {goog.Uri} uri The uri that timed out.\n */\nWebChannelDebug.prototype.timeoutResponse = function(uri) {\n  'use strict';\n  this.info(function() {\n    'use strict';\n    return 'TIMEOUT: ' + uri;\n  });\n};\n\n\n/**\n * Logs a debug message.\n * @param {!goog.log.Loggable} text The message.\n */\nWebChannelDebug.prototype.debug = function(text) {\n  'use strict';\n  goog.log.fine(this.logger_, text);\n};\n\n\n/**\n * Logs an exception\n * @param {Error} e The error or error event.\n * @param {goog.log.Loggable=} opt_msg The optional message,\n *     defaults to 'Exception'.\n */\nWebChannelDebug.prototype.dumpException = function(e, opt_msg) {\n  'use strict';\n  goog.log.error(this.logger_, opt_msg || 'Exception', e);\n};\n\n\n/**\n * Logs an info message.\n * @param {!goog.log.Loggable} text The message.\n */\nWebChannelDebug.prototype.info = function(text) {\n  'use strict';\n  goog.log.info(this.logger_, text);\n};\n\n\n/**\n * Logs a warning message.\n * @param {!goog.log.Loggable} text The message.\n */\nWebChannelDebug.prototype.warning = function(text) {\n  'use strict';\n  goog.log.warning(this.logger_, text);\n};\n\n\n/**\n * Logs a severe message.\n * @param {!goog.log.Loggable} text The message.\n */\nWebChannelDebug.prototype.severe = function(text) {\n  'use strict';\n  goog.log.error(this.logger_, text);\n};\n\n\n/**\n * Removes potentially private data from a response so that we don't\n * accidentally save private and personal data to the server logs.\n * @param {?string} responseText A JSON response to clean.\n * @return {?string} The cleaned response.\n * @private\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\nWebChannelDebug.prototype.redactResponse_ = function(responseText) {\n  'use strict';\n  if (!this.redactEnabled_) {\n    return responseText;\n  }\n\n  if (!responseText) {\n    return null;\n  }\n\n  try {\n    var responseArray = JSON.parse(responseText);\n    if (responseArray) {\n      for (var i = 0; i < responseArray.length; i++) {\n        if (Array.isArray(responseArray[i])) {\n          this.maybeRedactArray_(responseArray[i]);\n        }\n      }\n    }\n\n    return goog.json.serialize(responseArray);\n  } catch (e) {\n    this.debug('Exception parsing expected JS array - probably was not JS');\n    return responseText;\n  }\n};\n\n\n/**\n * Removes data from a response array that may be sensitive.\n * @param {!Array<?>} array The array to clean.\n * @private\n */\nWebChannelDebug.prototype.maybeRedactArray_ = function(array) {\n  'use strict';\n  if (array.length < 2) {\n    return;\n  }\n  var dataPart = array[1];\n  if (!Array.isArray(dataPart)) {\n    return;\n  }\n  if (dataPart.length < 1) {\n    return;\n  }\n\n  var type = dataPart[0];\n  if (type != 'noop' && type != 'stop' && type != 'close') {\n    // redact all fields in the array\n    for (var i = 1; i < dataPart.length; i++) {\n      dataPart[i] = '';\n    }\n  }\n};\n\n\n/**\n * Removes potentially private data from a request POST body so that we don't\n * accidentally save private and personal data to the server logs.\n * @param {?string} data The data string to clean.\n * @return {?string} The data string with sensitive data replaced by 'redacted'.\n * @private\n */\nWebChannelDebug.prototype.maybeRedactPostData_ = function(data) {\n  'use strict';\n  if (!this.redactEnabled_) {\n    return data;\n  }\n\n  if (!data) {\n    return null;\n  }\n  var out = '';\n  var params = data.split('&');\n  for (var i = 0; i < params.length; i++) {\n    var param = params[i];\n    var keyValue = param.split('=');\n    if (keyValue.length > 1) {\n      var key = keyValue[0];\n      var value = keyValue[1];\n\n      var keyParts = key.split('_');\n      if (keyParts.length >= 2 && keyParts[1] == 'type') {\n        out += key + '=' + value + '&';\n      } else {\n        out += key + '=' +\n            'redacted' +\n            '&';\n      }\n    }\n  }\n  return out;\n};\n});  // goog.scope\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Static utilities for collecting stats associated with\n * ChannelRequest.\n *\n */\n\n\ngoog.provide('goog.labs.net.webChannel.requestStats');\ngoog.provide('goog.labs.net.webChannel.requestStats.Event');\ngoog.provide('goog.labs.net.webChannel.requestStats.ServerReachability');\ngoog.provide('goog.labs.net.webChannel.requestStats.ServerReachabilityEvent');\ngoog.provide('goog.labs.net.webChannel.requestStats.Stat');\ngoog.provide('goog.labs.net.webChannel.requestStats.StatEvent');\ngoog.provide('goog.labs.net.webChannel.requestStats.TimingEvent');\n\ngoog.require('goog.events.Event');\ngoog.require('goog.events.EventTarget');\n\n\ngoog.scope(function() {\n'use strict';\nconst requestStats = goog.labs.net.webChannel.requestStats;\n\n\n/**\n * Events fired.\n * @const\n */\nrequestStats.Event = {};\n\n\n/**\n * Singleton event target for firing stat events\n * @type {?goog.events.EventTarget}\n * @private\n */\nrequestStats.eventTarget_ = null;\n\n/**\n * Singleton event target for firing stat events\n * @return {!goog.events.EventTarget}\n * @private\n */\nrequestStats.getStatEventTarget_ = function() {\n  'use strict';\n  requestStats.eventTarget_ =\n      requestStats.eventTarget_ || new goog.events.EventTarget();\n  return requestStats.eventTarget_;\n};\n\n/**\n * The type of event that occurs every time some information about how reachable\n * the server is is discovered.\n */\nrequestStats.Event.SERVER_REACHABILITY_EVENT = 'serverreachability';\n\n\n/**\n * Types of events which reveal information about the reachability of the\n * server.\n * @enum {number}\n */\nrequestStats.ServerReachability = {\n  REQUEST_MADE: 1,\n  REQUEST_SUCCEEDED: 2,\n  REQUEST_FAILED: 3,\n  BACK_CHANNEL_ACTIVITY: 4  // any response data received\n};\n\n\n\n/**\n * Event class for SERVER_REACHABILITY_EVENT.\n *\n * @param {goog.events.EventTarget} target The stat event target for\n       the channel.\n * @param {requestStats.ServerReachability} reachabilityType\n *     The reachability event type.\n * @constructor\n * @extends {goog.events.Event}\n */\nrequestStats.ServerReachabilityEvent = function(target, reachabilityType) {\n  'use strict';\n  goog.events.Event.call(\n      this, requestStats.Event.SERVER_REACHABILITY_EVENT, target);\n\n  /**\n   * @type {requestStats.ServerReachability}\n   */\n  this.reachabilityType = reachabilityType;\n};\ngoog.inherits(requestStats.ServerReachabilityEvent, goog.events.Event);\n\n\n/**\n * Notify the channel that a particular fine grained network event has occurred.\n * Should be considered package-private.\n * @param {requestStats.ServerReachability} reachabilityType\n *     The reachability event type.\n */\nrequestStats.notifyServerReachabilityEvent = function(reachabilityType) {\n  'use strict';\n  const target = requestStats.getStatEventTarget_();\n  target.dispatchEvent(\n      new requestStats.ServerReachabilityEvent(target, reachabilityType));\n};\n\n\n/**\n * Stat Event that fires when things of interest happen that may be useful for\n * applications to know about for stats or debugging purposes.\n */\nrequestStats.Event.STAT_EVENT = 'statevent';\n\n\n/**\n * Enum that identifies events for statistics that are interesting to track.\n * @enum {number}\n */\nrequestStats.Stat = {\n  /** Event indicating a new connection attempt. */\n  CONNECT_ATTEMPT: 0,\n\n  /** Event indicating a connection error due to a general network problem. */\n  ERROR_NETWORK: 1,\n\n  /**\n   * Event indicating a connection error that isn't due to a general network\n   * problem.\n   */\n  ERROR_OTHER: 2,\n\n  /** Event indicating the start of test stage one. */\n  TEST_STAGE_ONE_START: 3,\n\n  /** Event indicating the start of test stage two. */\n  TEST_STAGE_TWO_START: 4,\n\n  /** Event indicating the first piece of test data was received. */\n  TEST_STAGE_TWO_DATA_ONE: 5,\n\n  /**\n   * Event indicating that the second piece of test data was received and it was\n   * received separately from the first.\n   */\n  TEST_STAGE_TWO_DATA_TWO: 6,\n\n  /** Event indicating both pieces of test data were received simultaneously. */\n  TEST_STAGE_TWO_DATA_BOTH: 7,\n\n  /** Event indicating stage one of the test request failed. */\n  TEST_STAGE_ONE_FAILED: 8,\n\n  /** Event indicating stage two of the test request failed. */\n  TEST_STAGE_TWO_FAILED: 9,\n\n  /**\n   * Event indicating that a buffering proxy is likely between the client and\n   * the server.\n   */\n  PROXY: 10,\n\n  /**\n   * Event indicating that no buffering proxy is likely between the client and\n   * the server.\n   */\n  NOPROXY: 11,\n\n  /** Event indicating an unknown SID error. */\n  REQUEST_UNKNOWN_SESSION_ID: 12,\n\n  /** Event indicating a bad status code was received. */\n  REQUEST_BAD_STATUS: 13,\n\n  /** Event indicating incomplete data was received */\n  REQUEST_INCOMPLETE_DATA: 14,\n\n  /** Event indicating bad data was received */\n  REQUEST_BAD_DATA: 15,\n\n  /** Event indicating no data was received when data was expected. */\n  REQUEST_NO_DATA: 16,\n\n  /** Event indicating a request timeout. */\n  REQUEST_TIMEOUT: 17,\n\n  /**\n   * Event indicating that the server never received our hanging GET and so it\n   * is being retried.\n   */\n  BACKCHANNEL_MISSING: 18,\n\n  /**\n   * Event indicating that we have determined that our hanging GET is not\n   * receiving data when it should be. Thus it is dead dead and will be retried.\n   */\n  BACKCHANNEL_DEAD: 19,\n\n  /**\n   * The browser declared itself offline during the lifetime of a request, or\n   * was offline when a request was initially made.\n   */\n  BROWSER_OFFLINE: 20\n};\n\n\n\n/**\n * Event class for STAT_EVENT.\n *\n * @param {goog.events.EventTarget} eventTarget The stat event target for\n       the channel.\n * @param {requestStats.Stat} stat The stat.\n * @constructor\n * @extends {goog.events.Event}\n */\nrequestStats.StatEvent = function(eventTarget, stat) {\n  'use strict';\n  goog.events.Event.call(this, requestStats.Event.STAT_EVENT, eventTarget);\n\n  /**\n   * The stat\n   * @type {requestStats.Stat}\n   */\n  this.stat = stat;\n};\ngoog.inherits(requestStats.StatEvent, goog.events.Event);\n\n\n/**\n * Returns the singleton event target for stat events.\n * @return {!goog.events.EventTarget} The event target for stat events.\n */\nrequestStats.getStatEventTarget = function() {\n  'use strict';\n  return requestStats.getStatEventTarget_();\n};\n\n\n/**\n * Helper function to call the stat event callback.\n * @param {requestStats.Stat} stat The stat.\n */\nrequestStats.notifyStatEvent = function(stat) {\n  'use strict';\n  const target = requestStats.getStatEventTarget_();\n  target.dispatchEvent(new requestStats.StatEvent(target, stat));\n};\n\n\n/**\n * An event that fires when POST requests complete successfully, indicating\n * the size of the POST and the round trip time.\n */\nrequestStats.Event.TIMING_EVENT = 'timingevent';\n\n\n\n/**\n * Event class for requestStats.Event.TIMING_EVENT\n *\n * @param {goog.events.EventTarget} target The stat event target for\n       the channel.\n * @param {number} size The number of characters in the POST data.\n * @param {number} rtt The total round trip time from POST to response in MS.\n * @param {number} retries The number of times the POST had to be retried.\n * @constructor\n * @extends {goog.events.Event}\n */\nrequestStats.TimingEvent = function(target, size, rtt, retries) {\n  'use strict';\n  goog.events.Event.call(this, requestStats.Event.TIMING_EVENT, target);\n\n  /**\n   * @type {number}\n   */\n  this.size = size;\n\n  /**\n   * @type {number}\n   */\n  this.rtt = rtt;\n\n  /**\n   * @type {number}\n   */\n  this.retries = retries;\n};\ngoog.inherits(requestStats.TimingEvent, goog.events.Event);\n\n\n/**\n * Helper function to notify listeners about POST request performance.\n *\n * @param {number} size Number of characters in the POST data.\n * @param {number} rtt The amount of time from POST start to response.\n * @param {number} retries The number of times the POST had to be retried.\n */\nrequestStats.notifyTimingEvent = function(size, rtt, retries) {\n  'use strict';\n  const target = requestStats.getStatEventTarget_();\n  target.dispatchEvent(\n      new requestStats.TimingEvent(target, size, rtt, retries));\n};\n\n\n/**\n * Allows the application to set an execution hooks for when a channel\n * starts processing requests. This is useful to track timing or logging\n * special information. The function takes no parameters and return void.\n * @param {Function} startHook  The function for the start hook.\n */\nrequestStats.setStartThreadExecutionHook = function(startHook) {\n  'use strict';\n  requestStats.startExecutionHook_ = startHook;\n};\n\n\n/**\n * Allows the application to set an execution hooks for when a channel\n * stops processing requests. This is useful to track timing or logging\n * special information. The function takes no parameters and return void.\n * @param {Function} endHook  The function for the end hook.\n */\nrequestStats.setEndThreadExecutionHook = function(endHook) {\n  'use strict';\n  requestStats.endExecutionHook_ = endHook;\n};\n\n\n/**\n * Application provided execution hook for the start hook.\n *\n * @type {Function}\n * @private\n */\nrequestStats.startExecutionHook_ = function() {};\n\n\n/**\n * Application provided execution hook for the end hook.\n *\n * @type {Function}\n * @private\n */\nrequestStats.endExecutionHook_ = function() {};\n\n\n/**\n * Helper function to call the start hook\n */\nrequestStats.onStartExecution = function() {\n  'use strict';\n  requestStats.startExecutionHook_();\n};\n\n\n/**\n * Helper function to call the end hook\n */\nrequestStats.onEndExecution = function() {\n  'use strict';\n  requestStats.endExecutionHook_();\n};\n\n\n/**\n * Wrapper around SafeTimeout which calls the start and end execution hooks\n * with a try...finally block.\n * @param {Function} fn The callback function.\n * @param {number} ms The time in MS for the timer.\n * @return {number} The ID of the timer.\n */\nrequestStats.setTimeout = function(fn, ms) {\n  'use strict';\n  if (typeof fn !== 'function') {\n    throw new Error('Fn must not be null and must be a function');\n  }\n  return goog.global.setTimeout(function() {\n    'use strict';\n    requestStats.onStartExecution();\n    try {\n      fn();\n    } finally {\n      requestStats.onEndExecution();\n    }\n  }, ms);\n};\n});  // goog.scope\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Error codes shared between goog.net.IframeIo and\n * goog.net.XhrIo.\n */\n\ngoog.provide('goog.net.ErrorCode');\n\n\n/**\n * Error codes\n * @enum {number}\n */\ngoog.net.ErrorCode = {\n\n  /**\n   * There is no error condition.\n   */\n  NO_ERROR: 0,\n\n  /**\n   * The most common error from iframeio, unfortunately, is that the browser\n   * responded with an error page that is classed as a different domain. The\n   * situations, are when a browser error page  is shown -- 404, access denied,\n   * DNS failure, connection reset etc.)\n   *\n   */\n  ACCESS_DENIED: 1,\n\n  /**\n   * Currently the only case where file not found will be caused is when the\n   * code is running on the local file system and a non-IE browser makes a\n   * request to a file that doesn't exist.\n   */\n  FILE_NOT_FOUND: 2,\n\n  /**\n   * If Firefox shows a browser error page, such as a connection reset by\n   * server or access denied, then it will fail silently without the error or\n   * load handlers firing.\n   */\n  FF_SILENT_ERROR: 3,\n\n  /**\n   * Custom error provided by the client through the error check hook.\n   */\n  CUSTOM_ERROR: 4,\n\n  /**\n   * Exception was thrown while processing the request.\n   */\n  EXCEPTION: 5,\n\n  /**\n   * The Http response returned a non-successful http status code.\n   */\n  HTTP_ERROR: 6,\n\n  /**\n   * The request was aborted.\n   */\n  ABORT: 7,\n\n  /**\n   * The request timed out.\n   */\n  TIMEOUT: 8,\n\n  /**\n   * The resource is not available offline.\n   */\n  OFFLINE: 9,\n};\n\n\n/**\n * Returns a friendly error message for an error code. These messages are for\n * debugging and are not localized.\n * @param {goog.net.ErrorCode} errorCode An error code.\n * @return {string} A message for debugging.\n */\ngoog.net.ErrorCode.getDebugMessage = function(errorCode) {\n  'use strict';\n  switch (errorCode) {\n    case goog.net.ErrorCode.NO_ERROR:\n      return 'No Error';\n\n    case goog.net.ErrorCode.ACCESS_DENIED:\n      return 'Access denied to content document';\n\n    case goog.net.ErrorCode.FILE_NOT_FOUND:\n      return 'File not found';\n\n    case goog.net.ErrorCode.FF_SILENT_ERROR:\n      return 'Firefox silently errored';\n\n    case goog.net.ErrorCode.CUSTOM_ERROR:\n      return 'Application custom error';\n\n    case goog.net.ErrorCode.EXCEPTION:\n      return 'An exception occurred';\n\n    case goog.net.ErrorCode.HTTP_ERROR:\n      return 'Http response at 400 or 500 level';\n\n    case goog.net.ErrorCode.ABORT:\n      return 'Request was aborted';\n\n    case goog.net.ErrorCode.TIMEOUT:\n      return 'Request timed out';\n\n    case goog.net.ErrorCode.OFFLINE:\n      return 'The resource is not available offline';\n\n    default:\n      return 'Unrecognized error code';\n  }\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Common events for the network classes.\n */\n\n\ngoog.provide('goog.net.EventType');\n\n\n/**\n * Event names for network events\n * @enum {string}\n */\ngoog.net.EventType = {\n  COMPLETE: 'complete',\n  SUCCESS: 'success',\n  ERROR: 'error',\n  ABORT: 'abort',\n  READY: 'ready',\n  READY_STATE_CHANGE: 'readystatechange',\n  TIMEOUT: 'timeout',\n  INCREMENTAL_DATA: 'incrementaldata',\n  PROGRESS: 'progress',\n  // DOWNLOAD_PROGRESS and UPLOAD_PROGRESS are special events dispatched by\n  // goog.net.XhrIo to allow binding listeners specific to each type of\n  // progress.\n  DOWNLOAD_PROGRESS: 'downloadprogress',\n  UPLOAD_PROGRESS: 'uploadprogress',\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Interface for a factory for creating XMLHttpRequest objects\n * and metadata about them.\n */\n\ngoog.provide('goog.net.XmlHttpFactory');\n\n/** @suppress {extraRequire} Typedef. */\ngoog.require('goog.net.XhrLike');\n\n\n\n/**\n * Abstract base class for an XmlHttpRequest factory.\n * @constructor\n */\ngoog.net.XmlHttpFactory = function() {};\n\n\n/**\n * Cache of options - we only actually call internalGetOptions once.\n * @type {?Object}\n * @private\n */\ngoog.net.XmlHttpFactory.prototype.cachedOptions_ = null;\n\n\n/**\n * @return {!goog.net.XhrLike.OrNative} A new XhrLike instance.\n */\ngoog.net.XmlHttpFactory.prototype.createInstance = goog.abstractMethod;\n\n\n/**\n * @return {Object} Options describing how xhr objects obtained from this\n *     factory should be used.\n */\ngoog.net.XmlHttpFactory.prototype.getOptions = function() {\n  'use strict';\n  return this.cachedOptions_ ||\n      (this.cachedOptions_ = this.internalGetOptions());\n};\n\n\n/**\n * Override this method in subclasses to preserve the caching offered by\n * getOptions().\n * @return {Object} Options describing how xhr objects obtained from this\n *     factory should be used.\n * @protected\n */\ngoog.net.XmlHttpFactory.prototype.internalGetOptions = goog.abstractMethod;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview The API spec for the WebChannel messaging library.\n *\n * Similar to HTML5 WebSocket, WebChannel offers an abstraction for\n * point-to-point socket-like communication between a browser client and\n * a remote origin.\n *\n * WebChannels are created via <code>WebChannel</code>. Multiple WebChannels\n * may be multiplexed over the same WebChannelTransport, which encapsulates\n * the underlying physical connectivity over standard wire protocols\n * such as HTTP.\n *\n * A WebChannel in turn represents a logical communication channel between\n * the client and server endpoint. A WebChannel remains open for as long\n * as the client or server endpoint allows.\n *\n * Messages are delivered in-order and reliably over the same WebChannel,\n * and the choice of the underlying wire protocols is completely transparent\n * to the API users.\n *\n * Note that we have no immediate plan to move this API out of labs. While\n * the implementation is production ready, the API is subject to change.\n */\n\ngoog.provide('goog.net.WebChannel');\ngoog.provide('goog.net.WebChannel.Options');\n\ngoog.require('goog.events');\ngoog.require('goog.events.Event');\ngoog.require('goog.events.Listenable');\ngoog.require('goog.net.XmlHttpFactory');\n\n\n\n/**\n * A WebChannel represents a logical bi-directional channel over which the\n * client communicates with a remote server that holds the other endpoint\n * of the channel. A WebChannel is always created in the context of a shared\n * {@link WebChannelTransport} instance. It is up to the underlying client-side\n * and server-side implementations to decide how or when multiplexing is\n * to be enabled.\n *\n * @interface\n * @extends {goog.events.Listenable}\n */\ngoog.net.WebChannel = function() {};\n\n\n\n/**\n * This interface defines a pluggable API to allow WebChannel runtime to support\n * customized algorithms in order to recover from transient failures such as\n * those failures caused by network or proxies (intermediaries).\n *\n * The algorithm may also choose to fail-fast, e.g. switch the client to some\n * offline mode.\n *\n * Extra measurements and logging could also be implemented in the custom\n * module, which has the full knowledge of all the state transitions\n * (due to failures).\n *\n * A default algorithm will be provided by the webchannel library itself. Custom\n * algorithms are expected to be tailored to specific client platforms or\n * networking environments, e.g. mobile, cellular network.\n *\n * @interface\n */\ngoog.net.WebChannel.FailureRecovery = function() {};\n\n\n/**\n * Configuration spec for newly created WebChannel instances.\n *\n * WebChannels are configured in the context of the containing\n * {@link WebChannelTransport}. The configuration parameters are specified\n * when a new instance of WebChannel is created via {@link WebChannelTransport}.\n * @record\n */\ngoog.net.WebChannel.Options = function() {};\n\n/**\n * Transport-metadata support.\n *\n * Custom HTTP headers to be added to every message sent to the server. This\n * object is mutable, and custom headers may be changed, removed, or added\n * during the runtime after a channel has been opened.\n *\n * Custom headers may trigger CORS preflight. See other related options.\n * @type {!Object<string, string>|undefined}\n */\ngoog.net.WebChannel.Options.prototype.messageHeaders;\n\n/**\n * Transport-metadata support.\n *\n * Similar to messageHeaders, but any custom HTTP headers will be sent only once\n * when the channel is opened as part of the handshake request. Typical usage is\n * to send an auth header to the server, which only checks the auth header at\n * the time during the handshake when the channel is opened.\n * @type {!Object<string, string>|undefined}\n */\ngoog.net.WebChannel.Options.prototype.initMessageHeaders;\n\n/**\n * Sent as initMessageHeaders via X-WebChannel-Content-Type,\n * to inform the server the MIME type of WebChannel messages.\n * @type {string|undefined}\n */\ngoog.net.WebChannel.Options.prototype.messageContentType;\n\n/**\n * Transport-metadata support.\n *\n * Custom url query parameters to be added to every message sent to the server.\n * This object is mutable, and custom parameters may be changed, removed or\n * added during the runtime after a channel has been opened.\n *\n * TODO: initMessageUrlParams\n * TODO: closeMessageUrlParams  (custom url query params to be added to the\n * channel-close message. Custom headers are not supported due to the use of\n * SendBeacon)\n *\n * @type {!Object<string, string>|undefined}\n */\ngoog.net.WebChannel.Options.prototype.messageUrlParams;\n\n/**\n * Whether a special header should be added to\n * each message so that the server can dispatch webchannel messages without\n * knowing the URL path prefix. Defaults to false.\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.clientProtocolHeaderRequired;\n\n/**\n * The maximum number of in-flight HTTP requests allowed\n * when SPDY is enabled. Currently we only detect SPDY in Chrome.\n * This parameter defaults to 10. When SPDY is not enabled, this parameter\n * will have no effect.\n * @type {number|undefined}\n */\ngoog.net.WebChannel.Options.prototype.concurrentRequestLimit;\n\n/**\n * Setting this to true to allow the use of sub-domains\n * (as configured by the server) to send XHRs with the CORS withCredentials\n * bit set to true.\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.supportsCrossDomainXhr;\n\n/**\n * Whether to bypass v8 encoding of client-sent messages.\n * This defaults to false now due to legacy servers. New applications should\n * always configure this option to true.\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.sendRawJson;\n\n/**\n * The URL parameter name that contains the session id (for sticky routing of\n * HTTP requests). When this param is specified, a server that supports this\n * option will respond with an opaque session id as part of the initial\n * handshake (via the X-HTTP-Session-Id header); and all the subsequent requests\n * will contain the httpSessionIdParam. This option will take precedence over\n * any duplicated parameter specified with messageUrlParams, whose value will be\n * ignored.\n * @type {string|undefined}\n */\ngoog.net.WebChannel.Options.prototype.httpSessionIdParam;\n\n/**\n * The URL parameter name to allow custom HTTP\n * headers to be overwritten as a URL param to bypass CORS preflight.\n *\n * @type {string|undefined}\n */\ngoog.net.WebChannel.Options.prototype.httpHeadersOverwriteParam;\n\n/**\n * Whether to encode Options.initMessageHeaders in the HTTP request body.\n * This option defaults to false. If true, Options.httpHeadersOverwriteParam\n * will be ignored.\n *\n * This option should not be set if Options.fastHandshake is set (which\n * uses GET for handshake).\n *\n * Web-only feature.\n *\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.encodeInitMessageHeaders;\n\n/**\n * Whether to force long-polling from client to server.\n * This defaults to false. Long-polling may be necessary when a (MITM) proxy\n * is buffering data sent by the server.\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.forceLongPolling;\n\n/**\n * Whether to enable automatic detection of buffering proxies. In the presence\n * of any buffering proxy, webchannel will use long-polling to send messages\n * from the server to the client. This option defaults to false.\n * Currently when fastHandshake is enabled, this option will be ignored.\n * Compared to \"forceLongPolling\", this option may introduce up to 2-RTT\n * extra latency for delivering messages generated immediately after the\n * handshake.\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.detectBufferingProxy;\n\n/**\n * This option informs the server the desired maximum timeout interval (in\n * Milliseconds) to complete a long-polling GET response, e.g. to accommodate\n * the timeout enforced by a proxy. The WebChannel server may adjust the\n * specified timeout or may ignore this client-configured timeout.\n * @type {number|undefined}\n */\ngoog.net.WebChannel.Options.prototype.longPollingTimeout;\n\n/**\n * Enable true 0-RTT message delivery, including\n * leveraging QUIC 0-RTT (which requires GET to be used). This option\n * defaults to false. Note it is allowed to send messages before Open event is\n * received, after a channel has been opened. In order to enable 0-RTT,\n * messages will be encoded as part of URL and therefore there needs be a size\n * limit for those initial messages that are sent immediately as part of the\n * GET handshake request. With sendRawJson=true, this limit is currently set\n * to 4K chars and data beyond this limit will be buffered till the handshake\n * (1-RTT) finishes. With sendRawJson=false, it's up to the application\n * to limit the amount of data that is sent as part of the handshake.\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.fastHandshake;\n\n/**\n * Enable the blocking RPC semantics for the handshake:\n * 1) the completion of handshake is blocked by the server-side application\n * logic for handling the handshake (HTTP) request; 2) the client application\n * will inspect the handshake (HTTP) response headers as generated\n * by the server application (v.s. by only the webchannel runtime). This option\n * defaults to false.\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.blockingHandshake;\n\n/**\n * Whether to disable logging redact. By default, redact is\n * enabled to remove any message payload or user-provided info\n * from closure logs.\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.disableRedact;\n\n/**\n * Inform the server about the client profile to enable\n * customized configs that are optimized for certain clients or environments.\n * Currently this information is sent via X-WebChannel-Client-Profile header.\n * @type {string|undefined}\n */\ngoog.net.WebChannel.Options.prototype.clientProfile;\n\n/**\n * The internal channel parameter name to allow\n * experimental channel configurations. Supported options include fastfail,\n * baseRetryDelayMs, retryDelaySeedMs, forwardChannelMaxRetries and\n * forwardChannelRequestTimeoutMs. Note that these options are subject to\n * change.\n * @type {!Object<string, boolean|number>|undefined}\n */\ngoog.net.WebChannel.Options.prototype.internalChannelParams;\n\n/**\n * Allows the caller to override the factory used to create\n * XMLHttpRequest objects. This is introduced to disable CORS on firefox OS.\n * @type {!goog.net.XmlHttpFactory|undefined}\n */\ngoog.net.WebChannel.Options.prototype.xmlHttpFactory;\n\n/**\n * Client-side thresholds that decide when to refresh\n * an underlying HTTP request, to limit memory consumption due to XHR buffering\n * or compression context. The client-side thresholds should be significantly\n * smaller than the server-side thresholds. This allows the client to eliminate\n * any latency introduced by request refreshing, i.e. an RTT window during which\n * messages may be buffered on the server-side. Supported params include\n * totalBytesReceived, totalDurationMs.\n * @type {!Object<string, number>|undefined}\n */\ngoog.net.WebChannel.Options.prototype.requestRefreshThresholds;\n\n/**\n * This is an experimental feature to use WHATWG Fetch/streams (when supported).\n * If a custom 'xmlHttpFactory' is speficied, this option will not be effective.\n * This option defaults to false now and will eventually be turned on by\n * default.\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.useFetchStreams;\n\n/**\n * Opt-in to enable Chrome origin trials from the WebChannel client. See\n * https://github.com/GoogleChrome/OriginTrials\n *\n * Origin trial history:\n * - fetch upload (11/2020 - 07/2021)\n * https://developers.chrome.com/origintrials/#/view_trial/3524066708417413121\n *\n * Participating in the origin trials will help Chrome to release new Web\n * platform features sooner, which will in turn help improve WebChannel\n * performance.\n *\n * Origin trials are not expected to interfere with WebChannel wire messages\n * and should not introduce any noticeable overhead.\n *\n * This is enabled by default with any on-going origin-trial.\n *\n * @type {boolean|undefined}\n */\ngoog.net.WebChannel.Options.prototype.enableOriginTrials;\n\n\n/**\n * Types that are allowed as message data.\n *\n * Note that JS objects (sent by the client) can only have string encoded\n * values due to the limitation of the current wire protocol.\n *\n * Unicode strings (sent by the server) may or may not need be escaped, as\n * decided by the server.\n *\n * @typedef {(!ArrayBuffer|!Blob|!Object<string, !Object|string>|!Array|string)}\n */\ngoog.net.WebChannel.MessageData;\n\n\n/**\n * Open the WebChannel against the URI specified in the constructor.\n */\ngoog.net.WebChannel.prototype.open = goog.abstractMethod;\n\n\n/**\n * Close the WebChannel.\n *\n * This is a full close (shutdown) with no guarantee of FIFO delivery in respect\n * to any in-flight messages sent to the server.\n *\n * If you need such a guarantee, see the Half the halfClose() method.\n */\ngoog.net.WebChannel.prototype.close = goog.abstractMethod;\n\n\n/**\n * Half-close the WebChannel.\n *\n * Half-close semantics:\n * 1. delivered as a regular message in FIFO programming order\n * 2. the server is expected to return a half-close too (with or without\n *    application involved), which will trigger a full close (shutdown)\n *    on the client side\n * 3. for now, the half-close event defined for server-initiated\n *    half-close is not exposed to the client application\n * 4. a client-side half-close may be triggered internally when the client\n *    receives a half-close from the server; and the client is expected to\n *    do a full close after the half-close is acked and delivered\n *    on the server-side.\n * 5. Full close is always a forced one. See the close() method.\n *\n * New messages sent after halfClose() will be dropped.\n *\n * NOTE: This is not yet implemented, and will throw an exception if called.\n */\ngoog.net.WebChannel.prototype.halfClose = goog.abstractMethod;\n\n\n/**\n * Sends a message to the server that maintains the other endpoint of\n * the WebChannel.\n *\n * O-RTT behavior:\n * 1. messages sent before open() is called will always be delivered as\n *    part of the handshake, i.e. with 0-RTT\n * 2. messages sent after open() is called but before the OPEN event\n *    is received will be delivered as part of the handshake if\n *    send() is called from the same execution context as open().\n * 3. otherwise, those messages will be buffered till the handshake\n *    is completed (which will fire the OPEN event).\n *\n * @param {!goog.net.WebChannel.MessageData} message The message to send.\n */\ngoog.net.WebChannel.prototype.send = goog.abstractMethod;\n\n\n/**\n * Common events fired by WebChannels.\n * @enum {string}\n */\ngoog.net.WebChannel.EventType = {\n  /** Dispatched when the channel is opened. */\n  OPEN: goog.events.getUniqueId('open'),\n\n  /** Dispatched when the channel is closed. */\n  CLOSE: goog.events.getUniqueId('close'),\n\n  /**\n   * Dispatched when the channel is aborted due to errors.\n   *\n   * For backward compatibility reasons, a CLOSE event will also be\n   * dispatched, following the ERROR event, which indicates that the channel\n   * has been completely shutdown .\n   */\n  ERROR: goog.events.getUniqueId('error'),\n\n  /** Dispatched when the channel has received a new message. */\n  MESSAGE: goog.events.getUniqueId('message')\n};\n\n\n\n/**\n * The event interface for the MESSAGE event.\n *\n * @constructor\n * @extends {goog.events.Event}\n */\ngoog.net.WebChannel.MessageEvent = function() {\n  'use strict';\n  goog.net.WebChannel.MessageEvent.base(\n      this, 'constructor', goog.net.WebChannel.EventType.MESSAGE);\n};\ngoog.inherits(goog.net.WebChannel.MessageEvent, goog.events.Event);\n\n\n/**\n * The content of the message received from the server.\n *\n * @type {!goog.net.WebChannel.MessageData}\n */\ngoog.net.WebChannel.MessageEvent.prototype.data;\n\n\n/**\n * The metadata key when the MESSAGE event represents a metadata message.\n *\n * @type {string|undefined}\n */\ngoog.net.WebChannel.MessageEvent.prototype.metadataKey;\n\n\n/**\n * Metadata as HTTP status code. Typically sent before the channel is\n * half-closed by the server.\n *\n * @type {number|undefined}\n */\ngoog.net.WebChannel.MessageEvent.prototype.statusCode;\n\n\n/**\n * Metadata as HTTP headers. Typically sent before the channel is\n * half-closed by the server.\n *\n * @type {!Object<string, string>|undefined}\n */\ngoog.net.WebChannel.MessageEvent.prototype.headers;\n\n\n/**\n * WebChannel level error conditions.\n *\n * Summary of error debugging and reporting in WebChannel:\n *\n * Network Error\n * 1. By default the webchannel library will set the error status to\n *    NETWORK_ERROR when a channel has to be aborted or closed. NETWORK_ERROR\n *    may be recovered by the application by retrying and opening a new channel.\n * 2. There may be lost messages (not acked by the server) when a channel is\n *    aborted. Currently we don't have a public API to retrieve messages that\n *    are waiting to be acked on the client side. File a bug if you think it\n *    is useful to expose such an API.\n * 3. Details of why a channel fails are available via closure debug logs,\n *    and stats events (see webchannel/requeststats.js). Those are internal\n *    stats and are subject to change. File a bug if you think it's useful to\n *    version and expose such stats as part of the WebChannel API.\n *\n * Server Error\n * 1. SERVER_ERROR is intended to indicate a non-recoverable condition, e.g.\n *    when auth fails.\n * 2. We don't currently generate any such errors, because most of the time\n *    it's the responsibility of upper-layer frameworks or the application\n *    itself to indicate to the client why a webchannel has been failed\n *    by the server.\n * 3. When a channel is failed by the server explicitly, we still signal\n *    NETWORK_ERROR to the client. Explicit server failure may happen when the\n *    server does a fail-over, or becomes overloaded, or conducts a forced\n *    shutdown etc.\n * 4. We use some heuristic to decide if the network (aka cloud) is down\n *    v.s. the actual server is down.\n *\n *  RuntimeProperties.getLastStatusCode is a useful state that we expose to\n *  the client to indicate the HTTP response status code of the last HTTP\n *  request initiated by the WebChannel client library, for debugging\n *  purposes only.\n *\n *  See WebChannel.Options.backChannelFailureRecovery and\n *  WebChannel.FailureRecovery to install a custom failure-recovery algorithm.\n *\n * @enum {number}\n */\ngoog.net.WebChannel.ErrorStatus = {\n  /** No error has occurred. */\n  OK: 0,\n\n  /** Communication to the server has failed. */\n  NETWORK_ERROR: 1,\n\n  /** The server fails to accept or process the WebChannel. */\n  SERVER_ERROR: 2\n};\n\n\n\n/**\n * The event interface for the ERROR event.\n *\n * @constructor\n * @extends {goog.events.Event}\n */\ngoog.net.WebChannel.ErrorEvent = function() {\n  'use strict';\n  goog.net.WebChannel.ErrorEvent.base(\n      this, 'constructor', goog.net.WebChannel.EventType.ERROR);\n};\ngoog.inherits(goog.net.WebChannel.ErrorEvent, goog.events.Event);\n\n\n/**\n * The error status.\n *\n * @type {!goog.net.WebChannel.ErrorStatus}\n */\ngoog.net.WebChannel.ErrorEvent.prototype.status;\n\n\n/**\n * @return {!goog.net.WebChannel.RuntimeProperties} The runtime properties\n * of the WebChannel instance.\n */\ngoog.net.WebChannel.prototype.getRuntimeProperties = goog.abstractMethod;\n\n\n\n/**\n * The runtime properties of the WebChannel instance.\n *\n * This class is defined for debugging and monitoring purposes, as well as for\n * runtime functions that the application may choose to manage by itself.\n *\n * @interface\n */\ngoog.net.WebChannel.RuntimeProperties = function() {};\n\n\n/**\n * @return {number} The effective limit for the number of concurrent HTTP\n * requests that are allowed to be made for sending messages from the client\n * to the server. When SPDY is not enabled, this limit will be one.\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.getConcurrentRequestLimit =\n    goog.abstractMethod;\n\n\n/**\n * For applications that need support multiple channels (e.g. from\n * different tabs) to the same origin, use this method to decide if SPDY is\n * enabled and therefore it is safe to open multiple channels.\n *\n * If SPDY is disabled, the application may choose to limit the number of active\n * channels to one or use other means such as sub-domains to work around\n * the browser connection limit.\n *\n * @return {boolean} Whether SPDY is enabled for the origin against which\n * the channel is created.\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.isSpdyEnabled =\n    goog.abstractMethod;\n\n\n/**\n * @return {number} The number of requests (for sending messages to the server)\n * that are pending. If this number is approaching the value of\n * getConcurrentRequestLimit(), client-to-server message delivery may experience\n * a higher latency.\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.getPendingRequestCount =\n    goog.abstractMethod;\n\n\n/**\n * For applications to query the current HTTP session id, sent by the server\n * during the initial handshake.\n *\n * @return {?string} the HTTP session id or null if no HTTP session is in use.\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.getHttpSessionId =\n    goog.abstractMethod;\n\n\n/**\n * Experimental API.\n *\n * This method generates an in-band commit request to the server, which will\n * ack the commit request as soon as all messages sent prior to this commit\n * request have been committed by the application.\n *\n * Committing a message has a stronger semantics than delivering a message\n * to the application. Detail spec:\n * https://github.com/bidiweb/webchannel/blob/master/commit.md\n *\n * Timeout or cancellation is not supported and the application is expected to\n * abort the channel if the commit-ack fails to arrive in time.\n *\n * ===\n *\n * This is currently implemented only in the client layer and the commit\n * callback will be invoked after all the pending client-sent messages have been\n * delivered by the server-side webchannel endpoint. This semantics is\n * different and weaker than what's required for end-to-end ack which requires\n * the server application to ack the in-order delivery of messages that are sent\n * before the commit request is issued.\n *\n * Commit should only be called after the channel open event is received.\n * Duplicated commits are allowed and only the last callback is guaranteed.\n * Commit called after the channel has been closed will be ignored.\n *\n * @param {function()} callback The callback will be invoked once an\n * ack has been received for the current commit or any newly issued commit.\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.commit = goog.abstractMethod;\n\n\n/**\n * This method may be used by the application to recover from a peer failure\n * or to enable sender-initiated flow-control.\n *\n * Detail spec: https://github.com/bidiweb/webchannel/blob/master/commit.md\n *\n * Note that the caller should NOT modify the list of returned messages.\n *\n * @return {!Array<!goog.net.WebChannel.MessageData>} The list of messages that\n * have not received commit-ack from the server; or if no commit has been\n * issued, the list of messages that have not been delivered to the server\n * application.\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.getNonAckedMessages =\n    goog.abstractMethod;\n\n\n/**\n * A low water-mark message count to notify the application when the\n * flow-control condition is cleared, that is, when the application is\n * able to send more messages.\n *\n * We expect the application to configure a high water-mark message count,\n * which is checked via getNonAckedMessageCount(). When the high water-mark\n * is exceeded, the application should install a callback via this method\n * to be notified when to start to send new messages.\n *\n * This is not yet implemented.\n *\n * @param {number} count The low water-mark count. It is an error to pass\n * a non-positive value.\n * @param {function()} callback The call back to notify the application\n * when NonAckedMessageCount is below the specified low water-mark count.\n * Any previously registered callback is cleared. This new callback will\n * be cleared once it has been fired, or when the channel is closed or aborted.\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.notifyNonAckedMessageCount =\n    goog.abstractMethod;\n\n\n/**\n * Experimental API.\n *\n * This method registers a callback to handle the commit request sent\n * by the server. Commit protocol spec:\n * https://github.com/bidiweb/webchannel/blob/master/commit.md\n *\n * This is not yet implemented.\n *\n * @param {function(!Object)} callback The callback will take an opaque\n * commitId which needs be passed back to the server when an ack-commit\n * response is generated by the client application, via ackCommit().\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.onCommit = goog.abstractMethod;\n\n\n/**\n * Experimental API.\n *\n * This method is used by the application to generate an ack-commit response\n * for the given commitId. Commit protocol spec:\n * https://github.com/bidiweb/webchannel/blob/master/commit.md\n *\n * This is not yet implemented.\n *\n * @param {!Object} commitId The commitId which denotes the commit request\n * from the server that needs be ack'ed.\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.ackCommit = goog.abstractMethod;\n\n\n/**\n * Transport-metadata support.\n *\n * Responses from the channel-close (abort) message are not available.\n *\n * In future when client-side half-close is supported, its response headers\n * will be available via this API too.\n * @return {!Object<string, string>|undefined} The response headers received\n * with the non-200 HTTP status code that causes the channel to be aborted.\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.getLastResponseHeaders =\n    goog.abstractMethod;\n\n/**\n * Transport-metadata support.\n *\n * TODO: getInitStatusCode   (handshake)\n * TODO: getInitResponseHeaders  (handshake)\n *\n * Note that response headers from client-initiated close (abort) are not\n * available.\n *\n * In future when client-initiated half-close is supported, its response status\n * will be available via this API.\n *\n * @return {number} The non-200 HTTP status code received that causes the\n * channel to be aborted.\n */\ngoog.net.WebChannel.RuntimeProperties.prototype.getLastStatusCode =\n    goog.abstractMethod;\n\n\n/**\n * Enum to indicate the current recovery state.\n *\n * @enum {string}\n */\ngoog.net.WebChannel.FailureRecovery.State = {\n  /** Initial state. */\n  INIT: 'init',\n\n  /** Once a failure has been detected. */\n  FAILED: 'failed',\n\n  /**\n   * Once a recovery operation has been issued, e.g. a new request to resume\n   * communication.\n   */\n  RECOVERING: 'recovering',\n\n  /** The channel has been closed.  */\n  CLOSED: 'closed'\n};\n\n\n/**\n * Enum to indicate different failure conditions as detected by the webchannel\n * runtime.\n *\n * This enum is to be used only between the runtime and FailureRecovery module,\n * and new states are expected to be introduced in future.\n *\n * @enum {string}\n */\ngoog.net.WebChannel.FailureRecovery.FailureCondition = {\n  /**\n   * The HTTP response returned a non-successful http status code.\n   */\n  HTTP_ERROR: 'http_error',\n\n  /**\n   * The request was aborted.\n   */\n  ABORT: 'abort',\n\n  /**\n   * The request timed out.\n   */\n  TIMEOUT: 'timeout',\n\n  /**\n   * Exception was thrown while processing the request/response.\n   */\n  EXCEPTION: 'exception'\n};\n\n\n/**\n * @return {!goog.net.WebChannel.FailureRecovery.State} the current state,\n * mainly for debugging use.\n */\ngoog.net.WebChannel.FailureRecovery.prototype.getState = goog.abstractMethod;\n\n\n/**\n * This method is for WebChannel runtime to set the current failure condition\n * and to provide a callback for the algorithm to signal to the runtime\n * when it is time to issue a recovery operation, e.g. a new request to the\n * server.\n *\n * Supported transitions include:\n *   INIT->FAILED\n *   FAILED->FAILED (re-entry ok)\n *   RECOVERY->FAILED.\n *\n * Ignored if state == CLOSED.\n *\n * Advanced implementations are expected to track all the state transitions\n * and their timestamps for monitoring purposes.\n *\n * @param {!goog.net.WebChannel.FailureRecovery.FailureCondition} failure The\n * new failure condition generated by the WebChannel runtime.\n * @param {!Function} operation The callback function to the WebChannel\n * runtime to issue a recovery operation, e.g. a new request. E.g. the default\n * recovery algorithm will issue timeout-based recovery operations.\n * Post-condition for the callback: state transition to RECOVERING.\n *\n * @return {!goog.net.WebChannel.FailureRecovery.State} The updated state\n * as decided by the failure recovery module. Upon a recoverable failure event,\n * the state is transitioned to RECOVERING; or the state is transitioned to\n * FAILED which indicates a fail-fast decision for the runtime to execute.\n */\ngoog.net.WebChannel.FailureRecovery.prototype.setFailure = goog.abstractMethod;\n\n\n/**\n * The Webchannel runtime needs call this method when webchannel is closed or\n * aborted.\n *\n * Once the instance is closed, any access to the instance will be a no-op.\n */\ngoog.net.WebChannel.FailureRecovery.prototype.close = goog.abstractMethod;\n\n\n/**\n * A request header to indicate to the server the messaging protocol\n * each HTTP message is speaking.\n *\n * @type {string}\n */\ngoog.net.WebChannel.X_CLIENT_PROTOCOL = 'X-Client-Protocol';\n\n\n/**\n * The value for x-client-protocol when the messaging protocol is WebChannel.\n *\n * @type {string}\n */\ngoog.net.WebChannel.X_CLIENT_PROTOCOL_WEB_CHANNEL = 'webchannel';\n\n\n/**\n * A response header for the server to signal the wire-protocol that\n * the browser establishes with the server (or proxy), e.g. \"spdy\" (aka http/2)\n * \"quic\". This information avoids the need to use private APIs to decide if\n * HTTP requests are multiplexed etc.\n *\n * @type {string}\n */\ngoog.net.WebChannel.X_CLIENT_WIRE_PROTOCOL = 'X-Client-Wire-Protocol';\n\n\n/**\n * A response header for the server to send back the HTTP session id as part of\n * the initial handshake. The value of the HTTP session id is opaque to the\n * WebChannel protocol.\n *\n * @type {string}\n */\ngoog.net.WebChannel.X_HTTP_SESSION_ID = 'X-HTTP-Session-Id';\n\n\n/**\n * A response header for the server to send back any initial response data as a\n * header to avoid any possible buffering by an intermediary, which may\n * be undesired during the handshake.\n *\n * @type {string}\n */\ngoog.net.WebChannel.X_HTTP_INITIAL_RESPONSE = 'X-HTTP-Initial-Response';\n\n\n/**\n * A request header for specifying the content-type of WebChannel messages,\n * e.g. application-defined JSON encoding styles. Currently this header\n * is sent by the client via initMessageHeaders when the channel is opened.\n *\n * @type {string}\n */\ngoog.net.WebChannel.X_WEBCHANNEL_CONTENT_TYPE = 'X-WebChannel-Content-Type';\n\n\n/**\n * A request header for specifying the client profile in order to apply\n * customized config params on the server side, e.g. timeouts.\n *\n * @type {string}\n */\ngoog.net.WebChannel.X_WEBCHANNEL_CLIENT_PROFILE = 'X-WebChannel-Client-Profile';\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Low level handling of XMLHttpRequest.\n */\n\ngoog.provide('goog.net.DefaultXmlHttpFactory');\ngoog.provide('goog.net.XmlHttp');\ngoog.provide('goog.net.XmlHttp.OptionType');\ngoog.provide('goog.net.XmlHttp.ReadyState');\ngoog.provide('goog.net.XmlHttpDefines');\n\ngoog.require('goog.asserts');\ngoog.require('goog.net.WrapperXmlHttpFactory');\ngoog.require('goog.net.XmlHttpFactory');\ngoog.requireType('goog.net.XhrLike');\n\n\n/**\n * Static class for creating XMLHttpRequest objects.\n * @return {!goog.net.XhrLike.OrNative} A new XMLHttpRequest object.\n */\ngoog.net.XmlHttp = function() {\n  'use strict';\n  return goog.net.XmlHttp.factory_.createInstance();\n};\n\n\n/**\n * @define {boolean} Whether to assume XMLHttpRequest exists. Setting this to\n *     true bypasses the ActiveX probing code.\n * NOTE(ruilopes): Due to the way JSCompiler works, this define *will not* strip\n * out the ActiveX probing code from binaries.  To achieve this, use\n * `goog.net.XmlHttpDefines.ASSUME_NATIVE_XHR` instead.\n * TODO(ruilopes): Collapse both defines.\n */\ngoog.net.XmlHttp.ASSUME_NATIVE_XHR =\n    goog.define('goog.net.XmlHttp.ASSUME_NATIVE_XHR', false);\n\n\n/** @const */\ngoog.net.XmlHttpDefines = {};\n\n\n/**\n * @define {boolean} Whether to assume XMLHttpRequest exists. Setting this to\n *     true eliminates the ActiveX probing code.\n */\ngoog.net.XmlHttpDefines.ASSUME_NATIVE_XHR =\n    goog.define('goog.net.XmlHttpDefines.ASSUME_NATIVE_XHR', false);\n\n\n/**\n * Gets the options to use with the XMLHttpRequest objects obtained using\n * the static methods.\n * @return {Object} The options.\n */\ngoog.net.XmlHttp.getOptions = function() {\n  'use strict';\n  return goog.net.XmlHttp.factory_.getOptions();\n};\n\n\n/**\n * Type of options that an XmlHttp object can have.\n * @enum {number}\n */\ngoog.net.XmlHttp.OptionType = {\n  /**\n   * Whether a no-op function should be used to clear the onreadystatechange\n   * handler instead of null.\n   */\n  USE_NULL_FUNCTION: 0,\n\n  /**\n   * NOTE(user): In IE if send() errors on a *local* request the readystate\n   * is still changed to COMPLETE.  We need to ignore it and allow the\n   * try/catch around send() to pick up the error.\n   */\n  LOCAL_REQUEST_ERROR: 1,\n};\n\n\n/**\n * Status constants for XMLHTTP, matches:\n * https://msdn.microsoft.com/en-us/library/ms534361(v=vs.85).aspx\n * @enum {number}\n */\ngoog.net.XmlHttp.ReadyState = {\n  /**\n   * Constant for when xmlhttprequest.readyState is uninitialized\n   */\n  UNINITIALIZED: 0,\n\n  /**\n   * Constant for when xmlhttprequest.readyState is loading.\n   */\n  LOADING: 1,\n\n  /**\n   * Constant for when xmlhttprequest.readyState is loaded.\n   */\n  LOADED: 2,\n\n  /**\n   * Constant for when xmlhttprequest.readyState is in an interactive state.\n   */\n  INTERACTIVE: 3,\n\n  /**\n   * Constant for when xmlhttprequest.readyState is completed\n   */\n  COMPLETE: 4,\n};\n\n\n/**\n * The global factory instance for creating XMLHttpRequest objects.\n * @type {goog.net.XmlHttpFactory}\n * @private\n */\ngoog.net.XmlHttp.factory_;\n\n\n/**\n * Sets the factories for creating XMLHttpRequest objects and their options.\n * @param {Function} factory The factory for XMLHttpRequest objects.\n * @param {Function} optionsFactory The factory for options.\n * @deprecated Use setGlobalFactory instead.\n */\ngoog.net.XmlHttp.setFactory = function(factory, optionsFactory) {\n  'use strict';\n  goog.net.XmlHttp.setGlobalFactory(new goog.net.WrapperXmlHttpFactory(\n      goog.asserts.assert(factory), goog.asserts.assert(optionsFactory)));\n};\n\n\n/**\n * Sets the global factory object.\n * @param {!goog.net.XmlHttpFactory} factory New global factory object.\n */\ngoog.net.XmlHttp.setGlobalFactory = function(factory) {\n  'use strict';\n  goog.net.XmlHttp.factory_ = factory;\n};\n\n\n\n/**\n * Default factory to use when creating xhr objects.  You probably shouldn't be\n * instantiating this directly, but rather using it via goog.net.XmlHttp.\n * @extends {goog.net.XmlHttpFactory}\n * @constructor\n */\ngoog.net.DefaultXmlHttpFactory = function() {\n  'use strict';\n  goog.net.XmlHttpFactory.call(this);\n};\ngoog.inherits(goog.net.DefaultXmlHttpFactory, goog.net.XmlHttpFactory);\n\n\n/** @override */\ngoog.net.DefaultXmlHttpFactory.prototype.createInstance = function() {\n  'use strict';\n  const progId = this.getProgId_();\n  if (progId) {\n    return new ActiveXObject(progId);\n  } else {\n    return new XMLHttpRequest();\n  }\n};\n\n\n/** @override */\ngoog.net.DefaultXmlHttpFactory.prototype.internalGetOptions = function() {\n  'use strict';\n  const progId = this.getProgId_();\n  const options = {};\n  if (progId) {\n    options[goog.net.XmlHttp.OptionType.USE_NULL_FUNCTION] = true;\n    options[goog.net.XmlHttp.OptionType.LOCAL_REQUEST_ERROR] = true;\n  }\n  return options;\n};\n\n\n/**\n * The ActiveX PROG ID string to use to create xhr's in IE. Lazily initialized.\n * @type {string|undefined}\n * @private\n */\ngoog.net.DefaultXmlHttpFactory.prototype.ieProgId_;\n\n\n/**\n * Initialize the private state used by other functions.\n * @return {string} The ActiveX PROG ID string to use to create xhr's in IE.\n * @private\n */\ngoog.net.DefaultXmlHttpFactory.prototype.getProgId_ = function() {\n  'use strict';\n  if (goog.net.XmlHttp.ASSUME_NATIVE_XHR ||\n      goog.net.XmlHttpDefines.ASSUME_NATIVE_XHR) {\n    return '';\n  }\n\n  // The following blog post describes what PROG IDs to use to create the\n  // XMLHTTP object in Internet Explorer:\n  // http://blogs.msdn.com/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-in-internet-explorer.aspx\n  // However we do not (yet) fully trust that this will be OK for old versions\n  // of IE on Win9x so we therefore keep the last 2.\n  if (!this.ieProgId_ && typeof XMLHttpRequest == 'undefined' &&\n      typeof ActiveXObject != 'undefined') {\n    // Candidate Active X types.\n    const ACTIVE_X_IDENTS = [\n      'MSXML2.XMLHTTP.6.0',\n      'MSXML2.XMLHTTP.3.0',\n      'MSXML2.XMLHTTP',\n      'Microsoft.XMLHTTP',\n    ];\n    for (let i = 0; i < ACTIVE_X_IDENTS.length; i++) {\n      const candidate = ACTIVE_X_IDENTS[i];\n\n      try {\n        new ActiveXObject(candidate);\n        // NOTE(user): cannot assign progid and return candidate in one line\n        // because JSCompiler complaings: BUG 658126\n        this.ieProgId_ = candidate;\n        return candidate;\n      } catch (e) {\n        // do nothing; try next choice\n      }\n    }\n\n    // couldn't find any matches\n    throw new Error(\n        'Could not create ActiveXObject. ActiveX might be disabled,' +\n        ' or MSXML might not be installed');\n  }\n\n  return /** @type {string} */ (this.ieProgId_);\n};\n\n\n// Set the global factory to an instance of the default factory.\ngoog.net.XmlHttp.setGlobalFactory(new goog.net.DefaultXmlHttpFactory());\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Definition of the ChannelRequest class. The request\n * object encapsulates the logic for making a single request, either for the\n * forward channel, back channel, or test channel, to the server. It contains\n * the logic for the two types of transports we use:\n * XMLHTTP and Image request. It provides timeout detection. More transports\n * to be added in future, such as Fetch, WebSocket.\n *\n */\n\n\ngoog.provide('goog.labs.net.webChannel.ChannelRequest');\n\ngoog.require('goog.Timer');\ngoog.require('goog.asserts');\ngoog.require('goog.async.Throttle');\ngoog.require('goog.dispose');\ngoog.require('goog.events.EventHandler');\ngoog.require('goog.labs.net.webChannel.Channel');\ngoog.require('goog.labs.net.webChannel.WebChannelDebug');\ngoog.require('goog.labs.net.webChannel.environment');\ngoog.require('goog.labs.net.webChannel.requestStats');\ngoog.require('goog.net.ErrorCode');\ngoog.require('goog.net.EventType');\ngoog.require('goog.net.WebChannel');\ngoog.require('goog.net.XmlHttp');\ngoog.require('goog.object');\ngoog.require('goog.string');\ngoog.require('goog.userAgent');\ngoog.requireType('goog.Uri');\ngoog.requireType('goog.events.Event');\ngoog.requireType('goog.labs.net.webChannel.Wire.QueuedMap');\ngoog.requireType('goog.net.XhrIo');\n\n\n\n/**\n * A new ChannelRequest is created for each request to the server.\n *\n * @param {goog.labs.net.webChannel.Channel} channel\n *     The channel that owns this request.\n * @param {goog.labs.net.webChannel.WebChannelDebug} channelDebug A\n *     WebChannelDebug to use for logging.\n * @param {string=} opt_sessionId The session id for the channel.\n * @param {string|number=} opt_requestId The request id for this request.\n * @param {number=} opt_retryId The retry id for this request.\n * @constructor\n * @struct\n * @final\n */\ngoog.labs.net.webChannel.ChannelRequest = function(\n    channel, channelDebug, opt_sessionId, opt_requestId, opt_retryId) {\n  'use strict';\n  /**\n   * The channel object that owns the request.\n   * @private {goog.labs.net.webChannel.Channel}\n   */\n  this.channel_ = channel;\n\n  /**\n   * The channel debug to use for logging\n   * @private {goog.labs.net.webChannel.WebChannelDebug}\n   */\n  this.channelDebug_ = channelDebug;\n\n  /**\n   * The Session ID for the channel.\n   * @private {string|undefined}\n   */\n  this.sid_ = opt_sessionId;\n\n  /**\n   * The RID (request ID) for the request.\n   * @private {string|number|undefined}\n   */\n  this.rid_ = opt_requestId;\n\n  /**\n   * The attempt number of the current request.\n   * @private {number}\n   */\n  this.retryId_ = opt_retryId || 1;\n\n  /**\n   * An object to keep track of the channel request event listeners.\n   * @private {!goog.events.EventHandler<\n   *     !goog.labs.net.webChannel.ChannelRequest>}\n   */\n  this.eventHandler_ = new goog.events.EventHandler(this);\n\n  /**\n   * The timeout in ms before failing the request.\n   * @private {number}\n   */\n  this.timeout_ = goog.labs.net.webChannel.ChannelRequest.TIMEOUT_MS_;\n\n  /**\n   * A timer for polling responseText in browsers that don't fire\n   * onreadystatechange during incremental loading of responseText.\n   * @private {goog.Timer}\n   */\n  this.pollingTimer_ =\n      new goog.Timer(goog.labs.net.webChannel.environment.getPollingInterval());\n\n  /**\n   * Extra HTTP headers to add to all the requests sent to the server.\n   * @private {?Object}\n   */\n  this.extraHeaders_ = null;\n\n\n  /**\n   * Whether the request was successful. This is only set to true after the\n   * request successfully completes.\n   * @private {boolean}\n   */\n  this.successful_ = false;\n\n\n  /**\n   * The TimerID of the timer used to detect if the request has timed-out.\n   * @type {?number}\n   * @private\n   */\n  this.watchDogTimerId_ = null;\n\n  /**\n   * The time in the future when the request will timeout.\n   * @private {?number}\n   */\n  this.watchDogTimeoutTime_ = null;\n\n  /**\n   * The time the request started.\n   * @private {?number}\n   */\n  this.requestStartTime_ = null;\n\n  /**\n   * The type of request (XMLHTTP, IMG)\n   * @private {?number}\n   */\n  this.type_ = null;\n\n  /**\n   * The base Uri for the request. The includes all the parameters except the\n   * one that indicates the retry number.\n   * @private {?goog.Uri}\n   */\n  this.baseUri_ = null;\n\n  /**\n   * The request Uri that was actually used for the most recent request attempt.\n   * @private {?goog.Uri}\n   */\n  this.requestUri_ = null;\n\n  /**\n   * The post data, if the request is a post.\n   * @private {?string}\n   */\n  this.postData_ = null;\n\n  /**\n   * An array of pending messages that we have either received a non-successful\n   * response for, or no response at all, and which therefore may or may not\n   * have been received by the server.\n   * @private {!Array<goog.labs.net.webChannel.Wire.QueuedMap>}\n   */\n  this.pendingMessages_ = [];\n\n  /**\n   * The XhrLte request if the request is using XMLHTTP\n   * @private {?goog.net.XhrIo}\n   */\n  this.xmlHttp_ = null;\n\n  /**\n   * The position of where the next unprocessed chunk starts in the response\n   * text.\n   * @private {number}\n   */\n  this.xmlHttpChunkStart_ = 0;\n\n  /**\n   * The verb (Get or Post) for the request.\n   * @private {?string}\n   */\n  this.verb_ = null;\n\n  /**\n   * The last error if the request failed.\n   * @private {?goog.labs.net.webChannel.ChannelRequest.Error}\n   */\n  this.lastError_ = null;\n\n  /**\n   * The response headers received along with the non-200 status.\n   *\n   * @private {!Object<string, string>|undefined}\n   */\n  this.errorResponseHeaders_ = undefined;\n\n  /**\n   * The last status code received.\n   * @private {number}\n   */\n  this.lastStatusCode_ = -1;\n\n  /**\n   * Whether the request has been cancelled due to a call to cancel.\n   * @private {boolean}\n   */\n  this.cancelled_ = false;\n\n  /**\n   * A throttle time in ms for readystatechange events for the backchannel.\n   * Useful for throttling when ready state is INTERACTIVE (partial data).\n   * If set to zero no throttle is used.\n   *\n   * See WebChannelBase.prototype.readyStateChangeThrottleMs_\n   *\n   * @private {number}\n   */\n  this.readyStateChangeThrottleMs_ = 0;\n\n  /**\n   * The throttle for readystatechange events for the current request, or null\n   * if there is none.\n   * @private {?goog.async.Throttle}\n   */\n  this.readyStateChangeThrottle_ = null;\n\n  /**\n   * Whether to the result is expected to be encoded for chunking and thus\n   * requires decoding.\n   * @private {boolean}\n   */\n  this.decodeChunks_ = false;\n\n  /**\n   * Whether to decode x-http-initial-response.\n   * @private {boolean}\n   */\n  this.decodeInitialResponse_ = false;\n\n  /**\n   * Whether x-http-initial-response has been decoded (dispatched).\n   * @private {boolean}\n   */\n  this.initialResponseDecoded_ = false;\n\n  /**\n   * Whether the first byte of response body has arrived, for a successful\n   * response.\n   * @private {boolean}\n   */\n  this.firstByteReceived_ = false;\n\n  /**\n   * The current state of fetch responses if webchannel is using WHATWG\n   * fetch/streams.\n   * @private {!goog.labs.net.webChannel.FetchResponseState}\n   */\n  this.fetchResponseState_ = new goog.labs.net.webChannel.FetchResponseState();\n};\n\n/**\n * A collection of fetch/stream properties.\n * @struct\n * @constructor\n */\ngoog.labs.net.webChannel.FetchResponseState = function() {\n  'use strict';\n  /**\n   * The TextDecoder for decoding Uint8Array responses from fetch request.\n   * @type {?goog.global.TextDecoder}\n   */\n  this.textDecoder = null;\n\n  /**\n   * The unconsumed response text from the fetch requests.\n   * @type {string}\n   */\n  this.responseBuffer = '';\n\n  /**\n   * Whether or not the response body has arrived.\n   * @type {boolean}\n   */\n  this.responseArrivedForFetch = false;\n};\n\n\ngoog.scope(function() {\n'use strict';\nconst WebChannel = goog.net.WebChannel;\nconst Channel = goog.labs.net.webChannel.Channel;\nconst ChannelRequest = goog.labs.net.webChannel.ChannelRequest;\nconst FetchResponseState = goog.labs.net.webChannel.FetchResponseState;\nconst requestStats = goog.labs.net.webChannel.requestStats;\nconst WebChannelDebug = goog.labs.net.webChannel.WebChannelDebug;\nconst environment = goog.labs.net.webChannel.environment;\n\n/**\n * Default timeout in MS for a request. The server must return data within this\n * time limit for the request to not timeout.\n * @private {number}\n */\nChannelRequest.TIMEOUT_MS_ = 45 * 1000;\n\n\n/**\n * Enum for channel requests type\n * @enum {number}\n * @private\n */\nChannelRequest.Type_ = {\n  /**\n   * XMLHTTP requests.\n   */\n  XML_HTTP: 1,\n\n  /**\n   * IMG requests.\n   */\n  CLOSE_REQUEST: 2\n};\n\n\n/**\n * Enum type for identifying an error.\n * @enum {number}\n */\nChannelRequest.Error = {\n  /**\n   * Errors due to a non-200 status code.\n   */\n  STATUS: 0,\n\n  /**\n   * Errors due to no data being returned.\n   */\n  NO_DATA: 1,\n\n  /**\n   * Errors due to a timeout.\n   */\n  TIMEOUT: 2,\n\n  /**\n   * Errors due to the server returning an unknown.\n   */\n  UNKNOWN_SESSION_ID: 3,\n\n  /**\n   * Errors due to bad data being received.\n   */\n  BAD_DATA: 4,\n\n  /**\n   * Errors due to the handler throwing an exception.\n   */\n  HANDLER_EXCEPTION: 5,\n\n  /**\n   * The browser declared itself offline during the request.\n   */\n  BROWSER_OFFLINE: 6\n};\n\n\n/**\n * Returns a useful error string for debugging based on the specified error\n * code.\n * @param {?ChannelRequest.Error} errorCode The error code.\n * @param {number} statusCode The HTTP status code.\n * @return {string} The error string for the given code combination.\n */\nChannelRequest.errorStringFromCode = function(errorCode, statusCode) {\n  'use strict';\n  switch (errorCode) {\n    case ChannelRequest.Error.STATUS:\n      return 'Non-200 return code (' + statusCode + ')';\n    case ChannelRequest.Error.NO_DATA:\n      return 'XMLHTTP failure (no data)';\n    case ChannelRequest.Error.TIMEOUT:\n      return 'HttpConnection timeout';\n    default:\n      return 'Unknown error';\n  }\n};\n\n\n/**\n * Sentinel value used to indicate an invalid chunk in a multi-chunk response.\n * @private {!Object}\n */\nChannelRequest.INVALID_CHUNK_ = {};\n\n\n/**\n * Sentinel value used to indicate an incomplete chunk in a multi-chunk\n * response.\n * @private {!Object}\n */\nChannelRequest.INCOMPLETE_CHUNK_ = {};\n\n\n/**\n * Returns whether XHR streaming is supported on this browser.\n *\n * @return {boolean} Whether XHR streaming is supported.\n * @see http://code.google.com/p/closure-library/issues/detail?id=346\n */\nChannelRequest.supportsXhrStreaming = function() {\n  'use strict';\n  return !goog.userAgent.IE || goog.userAgent.isDocumentModeOrHigher(10);\n};\n\n\n/**\n * Sets extra HTTP headers to add to all the requests sent to the server.\n *\n * @param {Object} extraHeaders The HTTP headers.\n */\nChannelRequest.prototype.setExtraHeaders = function(extraHeaders) {\n  'use strict';\n  this.extraHeaders_ = extraHeaders;\n};\n\n\n/**\n * Overrides the default HTTP method.\n *\n * @param {string} verb The HTTP method\n */\nChannelRequest.prototype.setVerb = function(verb) {\n  'use strict';\n  this.verb_ = verb;\n};\n\n\n/**\n * Sets the timeout for a request\n *\n * @param {number} timeout   The timeout in MS for when we fail the request.\n */\nChannelRequest.prototype.setTimeout = function(timeout) {\n  'use strict';\n  this.timeout_ = timeout;\n};\n\n\n/**\n * Sets the throttle for handling onreadystatechange events for the request.\n *\n * @param {number} throttle The throttle in ms.  A value of zero indicates\n *     no throttle.\n */\nChannelRequest.prototype.setReadyStateChangeThrottle = function(throttle) {\n  'use strict';\n  this.readyStateChangeThrottleMs_ = throttle;\n};\n\n\n/**\n * Sets the pending messages that this request is handling.\n *\n * @param {!Array<goog.labs.net.webChannel.Wire.QueuedMap>} pendingMessages\n *     The pending messages for this request.\n */\nChannelRequest.prototype.setPendingMessages = function(pendingMessages) {\n  'use strict';\n  this.pendingMessages_ = pendingMessages;\n};\n\n\n/**\n * Gets the pending messages that this request is handling, in case of a retry.\n *\n * @return {!Array<goog.labs.net.webChannel.Wire.QueuedMap>} The pending\n *     messages for this request.\n */\nChannelRequest.prototype.getPendingMessages = function() {\n  'use strict';\n  return this.pendingMessages_;\n};\n\n\n/**\n * Uses XMLHTTP to send an HTTP POST to the server.\n *\n * @param {goog.Uri} uri  The uri of the request.\n * @param {?string} postData  The data for the post body.\n * @param {boolean} decodeChunks  Whether to the result is expected to be\n *     encoded for chunking and thus requires decoding.\n */\nChannelRequest.prototype.xmlHttpPost = function(uri, postData, decodeChunks) {\n  'use strict';\n  this.type_ = ChannelRequest.Type_.XML_HTTP;\n  this.baseUri_ = uri.clone().makeUnique();\n  this.postData_ = postData;\n  this.decodeChunks_ = decodeChunks;\n  this.sendXmlHttp_(null /* hostPrefix */);\n};\n\n\n/**\n * Uses XMLHTTP to send an HTTP GET to the server.\n *\n * @param {goog.Uri} uri  The uri of the request.\n * @param {boolean} decodeChunks  Whether to the result is expected to be\n *     encoded for chunking and thus requires decoding.\n * @param {?string} hostPrefix  The host prefix, if we might be using a\n *     secondary domain.  Note that it should also be in the URL, adding this\n *     won't cause it to be added to the URL.\n */\nChannelRequest.prototype.xmlHttpGet = function(uri, decodeChunks, hostPrefix) {\n  'use strict';\n  this.type_ = ChannelRequest.Type_.XML_HTTP;\n  this.baseUri_ = uri.clone().makeUnique();\n  this.postData_ = null;\n  this.decodeChunks_ = decodeChunks;\n\n  this.sendXmlHttp_(hostPrefix);\n};\n\n\n/**\n * Sends a request via XMLHTTP according to the current state of the request\n * object.\n *\n * @param {?string} hostPrefix The host prefix, if we might be using a secondary\n *     domain.\n * @private\n */\nChannelRequest.prototype.sendXmlHttp_ = function(hostPrefix) {\n  'use strict';\n  this.requestStartTime_ = Date.now();\n  this.ensureWatchDogTimer_();\n\n  // clone the base URI to create the request URI. The request uri has the\n  // attempt number as a parameter which helps in debugging.\n  this.requestUri_ = this.baseUri_.clone();\n  this.requestUri_.setParameterValues('t', this.retryId_);\n\n  // send the request either as a POST or GET\n  this.xmlHttpChunkStart_ = 0;\n  const useSecondaryDomains = this.channel_.shouldUseSecondaryDomains();\n  this.fetchResponseState_ = new FetchResponseState();\n  // If the request is a GET request, start a backchannel to transfer streaming\n  // data. Note that WebChannel GET request can also be used for closing the\n  // channel as in method ChannelRequest#sendCloseRequest.\n  // The second parameter of Channel#createXhrIo is JS only.\n  this.xmlHttp_ = this.channel_.createXhrIo(\n      useSecondaryDomains ? hostPrefix : null, !this.postData_);\n\n  if (this.readyStateChangeThrottleMs_ > 0) {\n    this.readyStateChangeThrottle_ = new goog.async.Throttle(\n        goog.bind(this.xmlHttpHandler_, this, this.xmlHttp_),\n        this.readyStateChangeThrottleMs_);\n  }\n\n  this.eventHandler_.listen(\n      this.xmlHttp_, goog.net.EventType.READY_STATE_CHANGE,\n      this.readyStateChangeHandler_);\n\n  const headers =\n      this.extraHeaders_ ? goog.object.clone(this.extraHeaders_) : {};\n  if (this.postData_) {\n    if (!this.verb_) {\n      this.verb_ = 'POST';\n    }\n    headers['Content-Type'] = 'application/x-www-form-urlencoded';\n    this.xmlHttp_.send(this.requestUri_, this.verb_, this.postData_, headers);\n  } else {\n    this.verb_ = 'GET';\n    this.xmlHttp_.send(this.requestUri_, this.verb_, null, headers);\n  }\n  requestStats.notifyServerReachabilityEvent(\n      requestStats.ServerReachability.REQUEST_MADE);\n  this.channelDebug_.xmlHttpChannelRequest(\n      this.verb_, this.requestUri_, this.rid_, this.retryId_, this.postData_);\n};\n\n\n/**\n * Handles a readystatechange event.\n * @param {goog.events.Event} evt The event.\n * @private\n */\nChannelRequest.prototype.readyStateChangeHandler_ = function(evt) {\n  'use strict';\n  const xhr = /** @type {goog.net.XhrIo} */ (evt.target);\n  const throttle = this.readyStateChangeThrottle_;\n  if (throttle &&\n      xhr.getReadyState() == goog.net.XmlHttp.ReadyState.INTERACTIVE) {\n    // Only throttle in the partial data case.\n    this.channelDebug_.debug('Throttling readystatechange.');\n    throttle.fire();\n  } else {\n    // If we haven't throttled, just handle response directly.\n    this.xmlHttpHandler_(xhr);\n  }\n};\n\n\n/**\n * XmlHttp handler\n * @param {goog.net.XhrIo} xmlhttp The XhrIo object for the current request.\n * @private\n */\nChannelRequest.prototype.xmlHttpHandler_ = function(xmlhttp) {\n  'use strict';\n  requestStats.onStartExecution();\n\n  try {\n    if (xmlhttp == this.xmlHttp_) {\n      this.onXmlHttpReadyStateChanged_();\n    } else {\n      this.channelDebug_.warning(\n          'Called back with an ' +\n          'unexpected xmlhttp');\n    }\n  } catch (ex) {\n    this.channelDebug_.debug('Failed call to OnXmlHttpReadyStateChanged_');\n    if (this.hasResponseBody_()) {\n      const channelRequest = this;\n      this.channelDebug_.dumpException(ex, function() {\n        'use strict';\n        return 'ResponseText: ' + channelRequest.xmlHttp_.getResponseText();\n      });\n    } else {\n      this.channelDebug_.dumpException(ex, 'No response text');\n    }\n  } finally {\n    requestStats.onEndExecution();\n  }\n};\n\n\n/**\n * Called by the readystate handler for XMLHTTP requests.\n *\n * @private\n */\nChannelRequest.prototype.onXmlHttpReadyStateChanged_ = function() {\n  'use strict';\n  const readyState = this.xmlHttp_.getReadyState();\n  const errorCode = this.xmlHttp_.getLastErrorCode();\n  const statusCode = this.xmlHttp_.getStatus();\n\n  // we get partial results in browsers that support ready state interactive.\n  // We also make sure that getResponseText is not null in interactive mode\n  // before we continue.\n  if (readyState < goog.net.XmlHttp.ReadyState.INTERACTIVE ||\n      (readyState == goog.net.XmlHttp.ReadyState.INTERACTIVE &&\n       !environment.isPollingRequired() &&  // otherwise, go on to startPolling\n       !this.hasResponseBody_())) {\n    return;  // not yet ready\n  }\n\n  // Dispatch any appropriate network events.\n  if (!this.cancelled_ && readyState == goog.net.XmlHttp.ReadyState.COMPLETE &&\n      errorCode != goog.net.ErrorCode.ABORT) {\n    // Pretty conservative, these are the only known scenarios which we'd\n    // consider indicative of a truly non-functional network connection.\n    if (errorCode == goog.net.ErrorCode.TIMEOUT || statusCode <= 0) {\n      requestStats.notifyServerReachabilityEvent(\n          requestStats.ServerReachability.REQUEST_FAILED);\n    } else {\n      requestStats.notifyServerReachabilityEvent(\n          requestStats.ServerReachability.REQUEST_SUCCEEDED);\n    }\n  }\n\n  // got some data so cancel the watchdog timer\n  this.cancelWatchDogTimer_();\n\n  const status = this.xmlHttp_.getStatus();\n  this.lastStatusCode_ = status;\n  const responseText = this.decodeXmlHttpResponse_();\n\n  if (!this.hasResponseBody_()) {\n    const channelRequest = this;\n    this.channelDebug_.debug(function() {\n      'use strict';\n      return 'No response text for uri ' + channelRequest.requestUri_ +\n          ' status ' + status;\n    });\n  }\n  this.successful_ = (status == 200);\n\n  this.channelDebug_.xmlHttpChannelResponseMetaData(\n      /** @type {string} */ (this.verb_), this.requestUri_, this.rid_,\n      this.retryId_, readyState, status);\n\n  if (!this.successful_) {\n    this.errorResponseHeaders_ = this.xmlHttp_.getResponseHeaders();\n    if (status == 400 && responseText.indexOf('Unknown SID') > 0) {\n      // the server error string will include 'Unknown SID' which indicates the\n      // server doesn't know about the session (maybe it got restarted, maybe\n      // the user got moved to another server, etc.,). Handlers can special\n      // case this error\n      this.lastError_ = ChannelRequest.Error.UNKNOWN_SESSION_ID;\n      requestStats.notifyStatEvent(\n          requestStats.Stat.REQUEST_UNKNOWN_SESSION_ID);\n      this.channelDebug_.warning('XMLHTTP Unknown SID (' + this.rid_ + ')');\n    } else {\n      this.lastError_ = ChannelRequest.Error.STATUS;\n      requestStats.notifyStatEvent(requestStats.Stat.REQUEST_BAD_STATUS);\n      this.channelDebug_.warning(\n          'XMLHTTP Bad status ' + status + ' (' + this.rid_ + ')');\n    }\n    this.cleanup_();\n    this.dispatchFailure_();\n    return;\n  }\n\n  if (this.shouldCheckInitialResponse_()) {\n    const initialResponse = this.getInitialResponse_();\n    if (initialResponse) {\n      this.channelDebug_.xmlHttpChannelResponseText(\n          this.rid_, initialResponse,\n          'Initial handshake response via ' +\n              WebChannel.X_HTTP_INITIAL_RESPONSE);\n      this.initialResponseDecoded_ = true;\n      this.safeOnRequestData_(initialResponse);\n    } else {\n      this.successful_ = false;\n      this.lastError_ = ChannelRequest.Error.UNKNOWN_SESSION_ID;  // fail-fast\n      requestStats.notifyStatEvent(\n          requestStats.Stat.REQUEST_UNKNOWN_SESSION_ID);\n      this.channelDebug_.warning(\n          'XMLHTTP Missing X_HTTP_INITIAL_RESPONSE' +\n          ' (' + this.rid_ + ')');\n      this.cleanup_();\n      this.dispatchFailure_();\n      return;\n    }\n  }\n\n  if (this.decodeChunks_) {\n    this.decodeNextChunks_(readyState, responseText);\n    if (environment.isPollingRequired() && this.successful_ &&\n        readyState == goog.net.XmlHttp.ReadyState.INTERACTIVE) {\n      this.startPolling_();\n    }\n  } else {\n    this.channelDebug_.xmlHttpChannelResponseText(\n        this.rid_, responseText, null);\n    this.safeOnRequestData_(responseText);\n  }\n\n  if (readyState == goog.net.XmlHttp.ReadyState.COMPLETE) {\n    this.cleanup_();\n  }\n\n  if (!this.successful_) {\n    return;\n  }\n\n  if (!this.cancelled_) {\n    if (readyState == goog.net.XmlHttp.ReadyState.COMPLETE) {\n      this.channel_.onRequestComplete(this);\n    } else {\n      // The default is false, the result from this callback shouldn't carry\n      // over to the next callback, otherwise the request looks successful if\n      // the watchdog timer gets called\n      this.successful_ = false;\n      this.ensureWatchDogTimer_();\n    }\n  }\n};\n\n\n/**\n * Whether we need check the initial-response header that is sent during the\n * fast handshake.\n *\n * @return {boolean} true if the initial-response header is yet to be processed.\n * @private\n */\nChannelRequest.prototype.shouldCheckInitialResponse_ = function() {\n  'use strict';\n  return this.decodeInitialResponse_ && !this.initialResponseDecoded_;\n};\n\n\n/**\n * Queries the initial response header that is sent during the handshake.\n *\n * @return {?string} The non-empty header value or null.\n * @private\n */\nChannelRequest.prototype.getInitialResponse_ = function() {\n  'use strict';\n  if (this.xmlHttp_) {\n    const value = this.xmlHttp_.getStreamingResponseHeader(\n        WebChannel.X_HTTP_INITIAL_RESPONSE);\n    if (value && !goog.string.isEmptyOrWhitespace(value)) {\n      return value;\n    }\n  }\n\n  return null;\n};\n\n\n/**\n * Check if the initial response header has been handled.\n *\n * @return {boolean} true if X_HTTP_INITIAL_RESPONSE has been handled.\n */\nChannelRequest.prototype.isInitialResponseDecoded = function() {\n  'use strict';\n  return this.initialResponseDecoded_;\n};\n\n\n/**\n * Decodes X_HTTP_INITIAL_RESPONSE if present.\n */\nChannelRequest.prototype.setDecodeInitialResponse = function() {\n  'use strict';\n  this.decodeInitialResponse_ = true;\n};\n\n\n\n/**\n * Decodes the responses from XhrIo object.\n * @returns {string} responseText\n * @private\n */\nChannelRequest.prototype.decodeXmlHttpResponse_ = function() {\n  'use strict';\n  if (!this.useFetchStreamsForResponse_()) {\n    return this.xmlHttp_.getResponseText();\n  }\n  const responseChunks =\n      /** @type {!Array<!Uint8Array>} */ (this.xmlHttp_.getResponse());\n  let responseText = '';\n  const responseLength = responseChunks.length;\n  const requestCompleted =\n      this.xmlHttp_.getReadyState() == goog.net.XmlHttp.ReadyState.COMPLETE;\n  if (!this.fetchResponseState_.textDecoder) {\n    if (typeof TextDecoder === 'undefined') {\n      this.channelDebug_.severe(\n          'TextDecoder is not supported by this browser.');\n      this.cleanup_();\n      this.dispatchFailure_();\n      return '';\n    }\n    this.fetchResponseState_.textDecoder = new goog.global.TextDecoder();\n  }\n  for (let i = 0; i < responseLength; i++) {\n    this.fetchResponseState_.responseArrivedForFetch = true;\n    const isLastChunk = requestCompleted && i == responseLength - 1;\n    responseText += this.fetchResponseState_.textDecoder.decode(\n        responseChunks[i], {stream: isLastChunk});\n  }\n  responseChunks.length = 0;  // Empty the `responseChunks` array.\n  this.fetchResponseState_.responseBuffer += responseText;\n  this.xmlHttpChunkStart_ = 0;\n  return this.fetchResponseState_.responseBuffer;\n};\n\n\n/**\n * Whether or not the response has response body.\n * @private\n * @returns {boolean}\n */\nChannelRequest.prototype.hasResponseBody_ = function() {\n  'use strict';\n  if (!this.xmlHttp_) {\n    return false;\n  }\n  if (this.fetchResponseState_.responseArrivedForFetch) {\n    return true;\n  }\n  return !(!this.xmlHttp_.getResponseText() && !this.xmlHttp_.getResponse());\n};\n\n/**\n * Whether or not the response body is streamed.\n * @private\n * @returns {boolean}\n */\nChannelRequest.prototype.useFetchStreamsForResponse_ = function() {\n  'use strict';\n  if (!this.xmlHttp_) {\n    return false;\n  }\n  return (\n      this.verb_ == 'GET' && this.type_ != ChannelRequest.Type_.CLOSE_REQUEST &&\n      this.channel_.usesFetchStreams());\n};\n\n\n/**\n * Decodes the next set of available chunks in the response.\n * @param {number} readyState The value of readyState.\n * @param {string} responseText The value of responseText.\n * @private\n */\nChannelRequest.prototype.decodeNextChunks_ = function(\n    readyState, responseText) {\n  'use strict';\n  let decodeNextChunksSuccessful = true;\n\n  let chunkText;\n  while (!this.cancelled_ && this.xmlHttpChunkStart_ < responseText.length) {\n    chunkText = this.getNextChunk_(responseText);\n    if (chunkText == ChannelRequest.INCOMPLETE_CHUNK_) {\n      if (readyState == goog.net.XmlHttp.ReadyState.COMPLETE) {\n        // should have consumed entire response when the request is done\n        this.lastError_ = ChannelRequest.Error.BAD_DATA;\n        requestStats.notifyStatEvent(requestStats.Stat.REQUEST_INCOMPLETE_DATA);\n        decodeNextChunksSuccessful = false;\n      }\n      this.channelDebug_.xmlHttpChannelResponseText(\n          this.rid_, null, '[Incomplete Response]');\n      break;\n    } else if (chunkText == ChannelRequest.INVALID_CHUNK_) {\n      this.lastError_ = ChannelRequest.Error.BAD_DATA;\n      requestStats.notifyStatEvent(requestStats.Stat.REQUEST_BAD_DATA);\n      this.channelDebug_.xmlHttpChannelResponseText(\n          this.rid_, responseText, '[Invalid Chunk]');\n      decodeNextChunksSuccessful = false;\n      break;\n    } else {\n      this.channelDebug_.xmlHttpChannelResponseText(\n          this.rid_, /** @type {string} */ (chunkText), null);\n      this.safeOnRequestData_(/** @type {string} */ (chunkText));\n    }\n  }\n\n  if (this.useFetchStreamsForResponse_() && this.xmlHttpChunkStart_ != 0) {\n    // Remove processed chunk text from response buffer.\n    this.fetchResponseState_.responseBuffer =\n        this.fetchResponseState_.responseBuffer.slice(this.xmlHttpChunkStart_);\n    this.xmlHttpChunkStart_ = 0;\n  }\n\n  if (readyState == goog.net.XmlHttp.ReadyState.COMPLETE &&\n      responseText.length == 0 &&\n      !this.fetchResponseState_.responseArrivedForFetch) {\n    // also an error if we didn't get any response\n    this.lastError_ = ChannelRequest.Error.NO_DATA;\n    requestStats.notifyStatEvent(requestStats.Stat.REQUEST_NO_DATA);\n    decodeNextChunksSuccessful = false;\n  }\n\n  this.successful_ = this.successful_ && decodeNextChunksSuccessful;\n\n  if (!decodeNextChunksSuccessful) {\n    // malformed response - we make this trigger retry logic\n    this.channelDebug_.xmlHttpChannelResponseText(\n        this.rid_, responseText, '[Invalid Chunked Response]');\n    this.cleanup_();\n    this.dispatchFailure_();\n  } else {\n    if (responseText.length > 0 && !this.firstByteReceived_) {\n      this.firstByteReceived_ = true;\n      this.channel_.onFirstByteReceived(this, responseText);\n    }\n  }\n};\n\n\n/**\n * Polls the response for new data.\n * @private\n */\nChannelRequest.prototype.pollResponse_ = function() {\n  'use strict';\n  if (!this.xmlHttp_) {\n    return;  // already closed\n  }\n  const readyState = this.xmlHttp_.getReadyState();\n  const responseText = this.xmlHttp_.getResponseText();\n  if (this.xmlHttpChunkStart_ < responseText.length) {\n    this.cancelWatchDogTimer_();\n    this.decodeNextChunks_(readyState, responseText);\n    if (this.successful_ &&\n        readyState != goog.net.XmlHttp.ReadyState.COMPLETE) {\n      this.ensureWatchDogTimer_();\n    }\n  }\n};\n\n\n/**\n * Starts a polling interval for changes to responseText of the\n * XMLHttpRequest, for browsers that don't fire onreadystatechange\n * as data comes in incrementally.  This timer is disabled in\n * cleanup_().\n * @private\n */\nChannelRequest.prototype.startPolling_ = function() {\n  'use strict';\n  this.eventHandler_.listen(\n      this.pollingTimer_, goog.Timer.TICK, this.pollResponse_);\n  this.pollingTimer_.start();\n};\n\n\n/**\n * Returns the next chunk of a chunk-encoded response. This is not standard\n * HTTP chunked encoding because browsers don't expose the chunk boundaries to\n * the application through XMLHTTP. So we have an additional chunk encoding at\n * the application level that lets us tell where the beginning and end of\n * individual responses are so that we can only try to eval a complete JS array.\n *\n * The encoding is the size of the chunk encoded as a decimal string followed\n * by a newline followed by the data.\n *\n * @param {string} responseText The response text from the XMLHTTP response.\n * @return {string|!Object} The next chunk string or a sentinel object\n *                         indicating a special condition.\n * @private\n */\nChannelRequest.prototype.getNextChunk_ = function(responseText) {\n  'use strict';\n  const sizeStartIndex = this.xmlHttpChunkStart_;\n  const sizeEndIndex = responseText.indexOf('\\n', sizeStartIndex);\n  if (sizeEndIndex == -1) {\n    return ChannelRequest.INCOMPLETE_CHUNK_;\n  }\n\n  const sizeAsString = responseText.substring(sizeStartIndex, sizeEndIndex);\n  const size = Number(sizeAsString);\n  if (isNaN(size)) {\n    return ChannelRequest.INVALID_CHUNK_;\n  }\n\n  const chunkStartIndex = sizeEndIndex + 1;\n  if (chunkStartIndex + size > responseText.length) {\n    return ChannelRequest.INCOMPLETE_CHUNK_;\n  }\n\n  const chunkText = responseText.slice(chunkStartIndex, chunkStartIndex + size);\n  this.xmlHttpChunkStart_ = chunkStartIndex + size;\n  return chunkText;\n};\n\n\n/**\n * Uses an IMG tag or navigator.sendBeacon to send an HTTP get to the server.\n *\n * This is only currently used to terminate the connection, as an IMG tag is\n * the most reliable way to send something to the server while the page\n * is getting torn down.\n *\n * Navigator.sendBeacon is available on Chrome and Firefox as a formal\n * solution to ensure delivery without blocking window close. See\n * https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon\n *\n * For Chrome Apps, sendBeacon is always necessary due to Content Security\n * Policy (CSP) violation of using an IMG tag.\n *\n * For react-native, we use xhr to send the actual close request, and assume\n * there is no page-close issue with react-native.\n *\n * @param {goog.Uri} uri The uri to send a request to.\n */\nChannelRequest.prototype.sendCloseRequest = function(uri) {\n  'use strict';\n  this.type_ = ChannelRequest.Type_.CLOSE_REQUEST;\n  this.baseUri_ = uri.clone().makeUnique();\n\n  let requestSent = false;\n\n  if (goog.global.navigator && goog.global.navigator.sendBeacon) {\n    try {\n      // empty string body to avoid 413 error on chrome < 41\n      requestSent =\n          goog.global.navigator.sendBeacon(this.baseUri_.toString(), '');\n    } catch {\n      // Intentionally left empty; sendBeacon might throw TypeError in certain\n      // unexpected cases.\n    }\n  }\n\n  if (!requestSent && goog.global.Image) {\n    const eltImg = new Image();\n    eltImg.src = this.baseUri_;\n    requestSent = true;\n  }\n\n  if (!requestSent) {\n    // no handler is set to match the sendBeacon/Image behavior\n    this.xmlHttp_ = this.channel_.createXhrIo(null);\n    this.xmlHttp_.send(this.baseUri_);\n  }\n\n  this.requestStartTime_ = Date.now();\n  this.ensureWatchDogTimer_();\n};\n\n\n/**\n * Cancels the request no matter what the underlying transport is.\n */\nChannelRequest.prototype.cancel = function() {\n  'use strict';\n  this.cancelled_ = true;\n  this.cleanup_();\n};\n\n\n/**\n * Resets the timeout.\n *\n * @param {number=} opt_timeout The new timeout\n */\nChannelRequest.prototype.resetTimeout = function(opt_timeout) {\n  'use strict';\n  if (opt_timeout) {\n    this.setTimeout(opt_timeout);\n  }\n  // restart only if a timer is currently set\n  if (this.watchDogTimerId_) {\n    this.cancelWatchDogTimer_();\n    this.ensureWatchDogTimer_();\n  }\n};\n\n\n/**\n * Ensures that there is watchdog timeout which is used to ensure that\n * the connection completes in time.\n *\n * @private\n */\nChannelRequest.prototype.ensureWatchDogTimer_ = function() {\n  'use strict';\n  this.watchDogTimeoutTime_ = Date.now() + this.timeout_;\n  this.startWatchDogTimer_(this.timeout_);\n};\n\n\n/**\n * Starts the watchdog timer which is used to ensure that the connection\n * completes in time.\n * @param {number} time The number of milliseconds to wait.\n * @private\n */\nChannelRequest.prototype.startWatchDogTimer_ = function(time) {\n  'use strict';\n  if (this.watchDogTimerId_ != null) {\n    // assertion\n    throw new Error('WatchDog timer not null');\n  }\n  this.watchDogTimerId_ =\n      requestStats.setTimeout(goog.bind(this.onWatchDogTimeout_, this), time);\n};\n\n\n/**\n * Cancels the watchdog timer if it has been started.\n *\n * @private\n */\nChannelRequest.prototype.cancelWatchDogTimer_ = function() {\n  'use strict';\n  if (this.watchDogTimerId_) {\n    goog.global.clearTimeout(this.watchDogTimerId_);\n    this.watchDogTimerId_ = null;\n  }\n};\n\n\n/**\n * Called when the watchdog timer is triggered. It also handles a case where it\n * is called too early which we suspect may be happening sometimes\n * (not sure why)\n *\n * @private\n */\nChannelRequest.prototype.onWatchDogTimeout_ = function() {\n  'use strict';\n  this.watchDogTimerId_ = null;\n  const now = Date.now();\n  goog.asserts.assert(\n      this.watchDogTimeoutTime_, 'WatchDog timeout time missing?');\n  if (now - this.watchDogTimeoutTime_ >= 0) {\n    this.handleTimeout_();\n  } else {\n    // got called too early for some reason\n    this.channelDebug_.warning('WatchDog timer called too early');\n    this.startWatchDogTimer_(this.watchDogTimeoutTime_ - now);\n  }\n};\n\n\n/**\n * Called when the request has actually timed out. Will cleanup and notify the\n * channel of the failure.\n *\n * @private\n */\nChannelRequest.prototype.handleTimeout_ = function() {\n  'use strict';\n  if (this.successful_) {\n    // Should never happen.\n    this.channelDebug_.severe(\n        'Received watchdog timeout even though request loaded successfully');\n  }\n\n  this.channelDebug_.timeoutResponse(this.requestUri_);\n\n  // IMG or SendBeacon requests never notice if they were successful,\n  // and always 'time out'. This fact says nothing about reachability.\n  if (this.type_ != ChannelRequest.Type_.CLOSE_REQUEST) {\n    requestStats.notifyServerReachabilityEvent(\n        requestStats.ServerReachability.REQUEST_FAILED);\n    requestStats.notifyStatEvent(requestStats.Stat.REQUEST_TIMEOUT);\n  }\n\n  this.cleanup_();\n\n  // Set error and dispatch failure.\n  // This is called for CLOSE_REQUEST too to ensure channel_.onRequestComplete.\n  this.lastError_ = ChannelRequest.Error.TIMEOUT;\n  this.dispatchFailure_();\n};\n\n\n/**\n * Notifies the channel that this request failed.\n * @private\n */\nChannelRequest.prototype.dispatchFailure_ = function() {\n  'use strict';\n  if (this.channel_.isClosed() || this.cancelled_) {\n    return;\n  }\n\n  this.channel_.onRequestComplete(this);\n};\n\n\n/**\n * Cleans up the objects used to make the request. This function is\n * idempotent.\n *\n * @private\n */\nChannelRequest.prototype.cleanup_ = function() {\n  'use strict';\n  this.cancelWatchDogTimer_();\n\n  goog.dispose(this.readyStateChangeThrottle_);\n  this.readyStateChangeThrottle_ = null;\n\n  // Stop the polling timer, if necessary.\n  this.pollingTimer_.stop();\n\n  // Unhook all event handlers.\n  this.eventHandler_.removeAll();\n\n  if (this.xmlHttp_) {\n    // clear out this.xmlHttp_ before aborting so we handle getting reentered\n    // inside abort\n    const xmlhttp = this.xmlHttp_;\n    this.xmlHttp_ = null;\n    xmlhttp.abort();\n    xmlhttp.dispose();\n  }\n};\n\n\n/**\n * Indicates whether the request was successful. Only valid after the handler\n * is called to indicate completion of the request.\n *\n * @return {boolean} True if the request succeeded.\n */\nChannelRequest.prototype.getSuccess = function() {\n  'use strict';\n  return this.successful_;\n};\n\n\n/**\n * If the request was not successful, returns the reason.\n *\n * @return {?ChannelRequest.Error}  The last error.\n */\nChannelRequest.prototype.getLastError = function() {\n  'use strict';\n  return this.lastError_;\n};\n\n\n/**\n * @return {!Object<string, string>|undefined} Response headers received\n *     along with the non-200 status, as a key-value map.\n */\nChannelRequest.prototype.getErrorResponseHeaders = function() {\n  'use strict';\n  return this.errorResponseHeaders_;\n};\n\n\n/**\n * Returns the status code of the last request.\n *\n * @return {number} The status code of the last request.\n */\nChannelRequest.prototype.getLastStatusCode = function() {\n  'use strict';\n  return this.lastStatusCode_;\n};\n\n\n/**\n * Returns the session id for this channel.\n *\n * @return {string|undefined} The session ID.\n */\nChannelRequest.prototype.getSessionId = function() {\n  'use strict';\n  return this.sid_;\n};\n\n\n/**\n * Returns the request id for this request. Each request has a unique request\n * id and the request IDs are a sequential increasing count.\n *\n * @return {string|number|undefined} The request ID.\n */\nChannelRequest.prototype.getRequestId = function() {\n  'use strict';\n  return this.rid_;\n};\n\n\n/**\n * Returns the data for a post, if this request is a post.\n *\n * @return {?string} The POST data provided by the request initiator.\n */\nChannelRequest.prototype.getPostData = function() {\n  'use strict';\n  return this.postData_;\n};\n\n\n/**\n * Returns the XhrIo request object.\n *\n * @return {?goog.net.XhrIo} Any XhrIo request created for this object.\n */\nChannelRequest.prototype.getXhr = function() {\n  'use strict';\n  return this.xmlHttp_;\n};\n\n\n/**\n * Returns the time that the request started, if it has started.\n *\n * @return {?number} The time the request started, as returned by Date.now().\n */\nChannelRequest.prototype.getRequestStartTime = function() {\n  'use strict';\n  return this.requestStartTime_;\n};\n\n\n/**\n * Helper to call the callback's onRequestData, which catches any\n * exception.\n * @param {string} data The request data.\n * @private\n */\nChannelRequest.prototype.safeOnRequestData_ = function(data) {\n  'use strict';\n  try {\n    this.channel_.onRequestData(this, data);\n    const stats = requestStats.ServerReachability;\n    requestStats.notifyServerReachabilityEvent(stats.BACK_CHANNEL_ACTIVITY);\n  } catch (e) {\n    // Dump debug info, but keep going without closing the channel.\n    this.channelDebug_.dumpException(e, 'Error in httprequest callback');\n  }\n};\n\n\n/**\n * Convenience factory method.\n *\n * @param {Channel} channel The channel object that owns this request.\n * @param {WebChannelDebug} channelDebug A WebChannelDebug to use for logging.\n * @param {string=} opt_sessionId  The session id for the channel.\n * @param {string|number=} opt_requestId  The request id for this request.\n * @param {number=} opt_retryId  The retry id for this request.\n * @return {!ChannelRequest} The created channel request.\n */\nChannelRequest.createChannelRequest = function(\n    channel, channelDebug, opt_sessionId, opt_requestId, opt_retryId) {\n  'use strict';\n  return new ChannelRequest(\n      channel, channelDebug, opt_sessionId, opt_requestId, opt_retryId);\n};\n});  // goog.scope\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview A single module to define user-agent specific environment\n * details.\n *\n */\n\ngoog.module('goog.labs.net.webChannel.environment');\n\ngoog.module.declareLegacyNamespace();\n\nvar userAgent = goog.require('goog.userAgent');\n\n\n/**\n * The default polling interval in millis for Edge.\n *\n * Currently on edge, new-chunk events may be not be fired (at all) if a new\n * chunk arrives within 50ms following the previous chunk. This may be fixed\n * in future, which requires changes to the whatwg spec too.\n *\n * @private @const {number}\n */\nvar EDGE_POLLING_INTERVAL_ = 125;\n\n\n/**\n * History:\n *\n * IE11 is still using Trident, the traditional engine for IE.\n * Edge is using EdgeHTML, a fork of Trident. We are seeing the same issue\n * on IE-11 (reported in 2017), so treat IE the same as Edge for now.\n *\n * We used to do polling for Opera (only) with an 250ms interval, because Opera\n * only fires readyState == INTERACTIVE once. Opera switched to WebKit in 2013,\n * and then to Blink (chrome).\n *\n * TODO(user): check the raw UA string to keep polling for old, mobile operas\n * that may still be affected. For old Opera, double the polling interval\n * to 250ms.\n *\n * @return {boolean} True if polling is required with XHR.\n */\nexports.isPollingRequired = function() {\n  return userAgent.EDGE_OR_IE;\n};\n\n\n/**\n * How often to poll (in MS) for changes to responseText in browsers that don't\n * fire onreadystatechange during incremental loading of the response body.\n *\n * @return {number|undefined} The polling interval (MS) for the current U-A;\n * or undefined if polling is not supposed to be enabled.\n */\nexports.getPollingInterval = function() {\n  if (userAgent.EDGE_OR_IE) {\n    return EDGE_POLLING_INTERVAL_;\n  }\n\n  return undefined;\n};\n\n/**\n * Origin trial token for google.com\n *\n * https://developers.chrome.com/origintrials/#/trials\n *\n * http://googlechrome.github.io/OriginTrials/check-token.html\n * Origin: https://google.com:443\n * Matches Subdomains? Yes\n * Matches Third-party? Yes\n * Feature: FetchUploadStreaming\n * Up to Chrome 95 (ends with the rollout of next Chrome release), no later\n * than Nov 9, 2021\n *\n * Token for googleapis.com will be registered after google.com's is deployed.\n *\n */\nconst OT_TOKEN_GOOGLE_COM =\n    'A0eNbltY1nd4MP7XTHXnTxWogDL6mWTdgIIKfKOTJoUHNbFFMZQBoiHHjJ9UK9lgYndWFaxOWR7ld8uUjcWmcwIAAAB/eyJvcmlnaW4iOiJodHRwczovL2dvb2dsZS5jb206NDQzIiwiZmVhdHVyZSI6IkZldGNoVXBsb2FkU3RyZWFtaW5nIiwiZXhwaXJ5IjoxNjM2NTAyMzk5LCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlfQ==';\n\n\n/**\n * Creates ReadableStream to upload\n * @return {!ReadableStream} ReadableStream to upload\n */\nfunction createStream() {\n  const encoder = new goog.global.TextEncoder();\n  return new goog.global.ReadableStream({\n    start: controller => {\n      for (const obj of ['test\\r\\n', 'test\\r\\n']) {\n        controller.enqueue(encoder.encode(obj));\n      }\n      controller.close();\n    }\n  });\n}\n\n/**\n * Detect the user agent is chrome and its version is higher than M90.\n * This code is hard-coded from goog.labs.userAgent.browser to avoid file size\n * increasing.\n * @return {boolean} Whether the above is true.\n */\nfunction isChromeM90OrHigher() {\n  const userAgentStr = function() {\n    const navigator = goog.global.navigator;\n    if (navigator) {\n      const userAgent = navigator.userAgent;\n      if (userAgent) {\n        return userAgent;\n      }\n    }\n    return '';\n  }();\n\n  const matchUserAgent = function(str) {\n    return userAgentStr.indexOf(str) != -1;\n  };\n\n  if (!matchUserAgent('Chrome') || matchUserAgent('Edg')) {\n    return false;\n  }\n\n  const match = /Chrome\\/(\\d+)/.exec(userAgentStr);\n  const chromeVersion = parseInt(match[1], 10);\n  return chromeVersion >= 90;\n}\n\n/**\n * Detect the URL origin is *.google.com.\n * @param {string} url The target URL.\n * @return {boolean} Whether the above is true.\n */\nfunction isUrlGoogle(url) {\n  const match = /\\/\\/([^\\/]+)\\//.exec(url);\n  if (!match) {\n    return false;\n  }\n  const origin = match[1];\n  return origin.endsWith('google.com');\n}\n\n/**\n * The flag to run the origin trials code only once.\n */\nlet isStartOriginTrialsCalled = false;\n\n/**\n * For Fetch/upload OT, make three requests against the server endpoint.\n * POST requests contain only dummy payload.\n *\n * https://developers.chrome.com/origintrials/#/view_trial/3524066708417413121\n *\n * This function is expected to be called from background during the handshake.\n * Exceptions will be logged by the caller.\n *\n * No stats or logs are collected on the client-side. To be disabled once the\n * OT is expired.\n *\n * @param {string} path The base URL path for the requests\n * @param {function(*)} logError A function to execute when exceptions are\n *     caught.\n */\nexports.startOriginTrials = function(path, logError) {\n  if (isStartOriginTrialsCalled) {\n    return;\n  }\n  isStartOriginTrialsCalled = true;\n  // NE: may need check if path has already contains query params?\n\n  // Accept only Chrome M90 or later due to service worker support.\n  if (!isChromeM90OrHigher()) {\n    return;\n  }\n\n  // Accept only only google.com and subdoamins.\n  if (!isUrlGoogle(path)) {\n    return;\n  }\n  // Since 3P OT is not supported yet, we should check the current page matches\n  // the path (absolute one?) to disable this OT for cross-origin calls\n  if (!window || !window.document || !isUrlGoogle(window.document.URL)) {\n    return;\n  }\n\n  // Enable origin trial by injecting OT <meta> tag\n  const tokenElement =\n      /** @type {! HTMLMetaElement} */ (document.createElement('meta'));\n  tokenElement.httpEquiv = 'origin-trial';\n  tokenElement.content = OT_TOKEN_GOOGLE_COM;\n  // appendChild() synchronously enables OT.\n  document.head.appendChild(tokenElement);\n\n  // Check if fetch upload stream is actually enabled.\n  // By the spec, Streaming request doesn't has the Content-Type header:\n  // https://fetch.spec.whatwg.org/#concept-bodyinit-extract\n  // If Chrome doesn't support Streaming, the body stream is converted to a\n  // string \"[object ReadableStream]\" for fallback then it has \"Content-Type:\n  // text/plain;charset=UTF-8\".\n  const supportsRequestStreams = !new Request('', {\n                                    body: new ReadableStream(),\n                                    method: 'POST',\n                                  }).headers.has('Content-Type');\n\n  if (supportsRequestStreams) {\n    logError('OriginTrial unexpected.');\n  }\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Class for parsing and formatting URIs.\n *\n * This package is deprecated in favour of the Closure URL package (goog.url)\n * when manipulating URIs for use by a browser. This package uses regular\n * expressions to parse a potential URI which can fall out of sync with how a\n * browser will actually interpret the URI. See\n * `goog.uri.utils.setUrlPackageSupportLoggingHandler` for one way to identify\n * URIs that should instead be parsed using the URL package.\n *\n * Use goog.Uri(string) to parse a URI string.  Use goog.Uri.create(...) to\n * create a new instance of the goog.Uri object from Uri parts.\n *\n * e.g: <code>var myUri = new goog.Uri(window.location);</code>\n *\n * Implements RFC 3986 for parsing/formatting URIs.\n * http://www.ietf.org/rfc/rfc3986.txt\n *\n * Some changes have been made to the interface (more like .NETs), though the\n * internal representation is now of un-encoded parts, this will change the\n * behavior slightly.\n */\n\ngoog.provide('goog.Uri');\ngoog.provide('goog.Uri.QueryData');\n\ngoog.require('goog.array');\ngoog.require('goog.asserts');\ngoog.require('goog.collections.maps');\ngoog.require('goog.string');\ngoog.require('goog.structs');\ngoog.require('goog.uri.utils');\ngoog.require('goog.uri.utils.ComponentIndex');\ngoog.require('goog.uri.utils.StandardQueryParam');\n\n\n\n/**\n * This class contains setters and getters for the parts of the URI.\n * The <code>getXyz</code>/<code>setXyz</code> methods return the decoded part\n * -- so<code>goog.Uri.parse('/foo%20bar').getPath()</code> will return the\n * decoded path, <code>/foo bar</code>.\n *\n * Reserved characters (see RFC 3986 section 2.2) can be present in\n * their percent-encoded form in scheme, domain, and path URI components and\n * will not be auto-decoded. For example:\n * <code>goog.Uri.parse('rel%61tive/path%2fto/resource').getPath()</code> will\n * return <code>relative/path%2fto/resource</code>.\n *\n * The constructor accepts an optional unparsed, raw URI string.  The parser\n * is relaxed, so special characters that aren't escaped but don't cause\n * ambiguities will not cause parse failures.\n *\n * All setters return <code>this</code> and so may be chained, a la\n * <code>goog.Uri.parse('/foo').setFragment('part').toString()</code>.\n *\n * @param {*=} opt_uri Optional string URI to parse\n *        (use goog.Uri.create() to create a URI from parts), or if\n *        a goog.Uri is passed, a clone is created.\n * @param {boolean=} opt_ignoreCase If true, #getParameterValue will ignore\n * the case of the parameter name.\n *\n * @throws URIError If opt_uri is provided and URI is malformed (that is,\n *     if decodeURIComponent fails on any of the URI components).\n * @constructor\n * @struct\n */\ngoog.Uri = function(opt_uri, opt_ignoreCase) {\n  'use strict';\n  /**\n   * Scheme such as \"http\".\n   * @private {string}\n   */\n  this.scheme_ = '';\n\n  /**\n   * User credentials in the form \"username:password\".\n   * @private {string}\n   */\n  this.userInfo_ = '';\n\n  /**\n   * Domain part, e.g. \"www.google.com\".\n   * @private {string}\n   */\n  this.domain_ = '';\n\n  /**\n   * Port, e.g. 8080.\n   * @private {?number}\n   */\n  this.port_ = null;\n\n  /**\n   * Path, e.g. \"/tests/img.png\".\n   * @private {string}\n   */\n  this.path_ = '';\n\n  /**\n   * The fragment without the #.\n   * @private {string}\n   */\n  this.fragment_ = '';\n\n  /**\n   * Whether or not this Uri should be treated as Read Only.\n   * @private {boolean}\n   */\n  this.isReadOnly_ = false;\n\n  /**\n   * Whether or not to ignore case when comparing query params.\n   * @private {boolean}\n   */\n  this.ignoreCase_ = false;\n\n  /**\n   * Object representing query data.\n   * @private {!goog.Uri.QueryData}\n   */\n  this.queryData_;\n\n  // Parse in the uri string\n  var m;\n  if (opt_uri instanceof goog.Uri) {\n    this.ignoreCase_ = (opt_ignoreCase !== undefined) ? opt_ignoreCase :\n                                                        opt_uri.getIgnoreCase();\n    this.setScheme(opt_uri.getScheme());\n    this.setUserInfo(opt_uri.getUserInfo());\n    this.setDomain(opt_uri.getDomain());\n    this.setPort(opt_uri.getPort());\n    this.setPath(opt_uri.getPath());\n    this.setQueryData(opt_uri.getQueryData().clone());\n    this.setFragment(opt_uri.getFragment());\n  } else if (opt_uri && (m = goog.uri.utils.split(String(opt_uri)))) {\n    this.ignoreCase_ = !!opt_ignoreCase;\n\n    // Set the parts -- decoding as we do so.\n    // COMPATIBILITY NOTE - In IE, unmatched fields may be empty strings,\n    // whereas in other browsers they will be undefined.\n    this.setScheme(m[goog.uri.utils.ComponentIndex.SCHEME] || '', true);\n    this.setUserInfo(m[goog.uri.utils.ComponentIndex.USER_INFO] || '', true);\n    this.setDomain(m[goog.uri.utils.ComponentIndex.DOMAIN] || '', true);\n    this.setPort(m[goog.uri.utils.ComponentIndex.PORT]);\n    this.setPath(m[goog.uri.utils.ComponentIndex.PATH] || '', true);\n    this.setQueryData(m[goog.uri.utils.ComponentIndex.QUERY_DATA] || '', true);\n    this.setFragment(m[goog.uri.utils.ComponentIndex.FRAGMENT] || '', true);\n\n  } else {\n    this.ignoreCase_ = !!opt_ignoreCase;\n    this.queryData_ = new goog.Uri.QueryData(null, this.ignoreCase_);\n  }\n};\n\n\n/**\n * Parameter name added to stop caching.\n * @type {string}\n */\ngoog.Uri.RANDOM_PARAM = goog.uri.utils.StandardQueryParam.RANDOM;\n\n\n/**\n * @return {string} The string form of the url.\n * @override\n */\ngoog.Uri.prototype.toString = function() {\n  'use strict';\n  var out = [];\n\n  var scheme = this.getScheme();\n  if (scheme) {\n    out.push(\n        goog.Uri.encodeSpecialChars_(\n            scheme, goog.Uri.reDisallowedInSchemeOrUserInfo_, true),\n        ':');\n  }\n\n  var domain = this.getDomain();\n  if (domain || scheme == 'file') {\n    out.push('//');\n\n    var userInfo = this.getUserInfo();\n    if (userInfo) {\n      out.push(\n          goog.Uri.encodeSpecialChars_(\n              userInfo, goog.Uri.reDisallowedInSchemeOrUserInfo_, true),\n          '@');\n    }\n\n    out.push(goog.Uri.removeDoubleEncoding_(goog.string.urlEncode(domain)));\n\n    var port = this.getPort();\n    if (port != null) {\n      out.push(':', String(port));\n    }\n  }\n\n  var path = this.getPath();\n  if (path) {\n    if (this.hasDomain() && path.charAt(0) != '/') {\n      out.push('/');\n    }\n    out.push(goog.Uri.encodeSpecialChars_(\n        path,\n        path.charAt(0) == '/' ? goog.Uri.reDisallowedInAbsolutePath_ :\n                                goog.Uri.reDisallowedInRelativePath_,\n        true));\n  }\n\n  var query = this.getEncodedQuery();\n  if (query) {\n    out.push('?', query);\n  }\n\n  var fragment = this.getFragment();\n  if (fragment) {\n    out.push(\n        '#',\n        goog.Uri.encodeSpecialChars_(\n            fragment, goog.Uri.reDisallowedInFragment_));\n  }\n  return out.join('');\n};\n\n\n/**\n * Resolves the given relative URI (a goog.Uri object), using the URI\n * represented by this instance as the base URI.\n *\n * There are several kinds of relative URIs:<br>\n * 1. foo - replaces the last part of the path, the whole query and fragment<br>\n * 2. /foo - replaces the path, the query and fragment<br>\n * 3. //foo - replaces everything from the domain on.  foo is a domain name<br>\n * 4. ?foo - replace the query and fragment<br>\n * 5. #foo - replace the fragment only\n *\n * Additionally, if relative URI has a non-empty path, all \"..\" and \".\"\n * segments will be resolved, as described in RFC 3986.\n *\n * @param {!goog.Uri} relativeUri The relative URI to resolve.\n * @return {!goog.Uri} The resolved URI.\n */\ngoog.Uri.prototype.resolve = function(relativeUri) {\n  'use strict';\n  var absoluteUri = this.clone();\n\n  // we satisfy these conditions by looking for the first part of relativeUri\n  // that is not blank and applying defaults to the rest\n\n  var overridden = relativeUri.hasScheme();\n\n  if (overridden) {\n    absoluteUri.setScheme(relativeUri.getScheme());\n  } else {\n    overridden = relativeUri.hasUserInfo();\n  }\n\n  if (overridden) {\n    absoluteUri.setUserInfo(relativeUri.getUserInfo());\n  } else {\n    overridden = relativeUri.hasDomain();\n  }\n\n  if (overridden) {\n    absoluteUri.setDomain(relativeUri.getDomain());\n  } else {\n    overridden = relativeUri.hasPort();\n  }\n\n  var path = relativeUri.getPath();\n  if (overridden) {\n    absoluteUri.setPort(relativeUri.getPort());\n  } else {\n    overridden = relativeUri.hasPath();\n    if (overridden) {\n      // resolve path properly\n      if (path.charAt(0) != '/') {\n        // path is relative\n        if (this.hasDomain() && !this.hasPath()) {\n          // RFC 3986, section 5.2.3, case 1\n          path = '/' + path;\n        } else {\n          // RFC 3986, section 5.2.3, case 2\n          var lastSlashIndex = absoluteUri.getPath().lastIndexOf('/');\n          if (lastSlashIndex != -1) {\n            path = absoluteUri.getPath().slice(0, lastSlashIndex + 1) + path;\n          }\n        }\n      }\n      path = goog.Uri.removeDotSegments(path);\n    }\n  }\n\n  if (overridden) {\n    absoluteUri.setPath(path);\n  } else {\n    overridden = relativeUri.hasQuery();\n  }\n\n  if (overridden) {\n    absoluteUri.setQueryData(relativeUri.getQueryData().clone());\n  } else {\n    overridden = relativeUri.hasFragment();\n  }\n\n  if (overridden) {\n    absoluteUri.setFragment(relativeUri.getFragment());\n  }\n\n  return absoluteUri;\n};\n\n\n/**\n * Clones the URI instance.\n * @return {!goog.Uri} New instance of the URI object.\n */\ngoog.Uri.prototype.clone = function() {\n  'use strict';\n  return new goog.Uri(this);\n};\n\n\n/**\n * @return {string} The encoded scheme/protocol for the URI.\n */\ngoog.Uri.prototype.getScheme = function() {\n  'use strict';\n  return this.scheme_;\n};\n\n\n/**\n * Sets the scheme/protocol.\n * @throws URIError If opt_decode is true and newScheme is malformed (that is,\n *     if decodeURIComponent fails).\n * @param {string} newScheme New scheme value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setScheme = function(newScheme, opt_decode) {\n  'use strict';\n  this.enforceReadOnly();\n  this.scheme_ =\n      opt_decode ? goog.Uri.decodeOrEmpty_(newScheme, true) : newScheme;\n\n  // remove an : at the end of the scheme so somebody can pass in\n  // window.location.protocol\n  if (this.scheme_) {\n    this.scheme_ = this.scheme_.replace(/:$/, '');\n  }\n  return this;\n};\n\n\n/**\n * @return {boolean} Whether the scheme has been set.\n */\ngoog.Uri.prototype.hasScheme = function() {\n  'use strict';\n  return !!this.scheme_;\n};\n\n\n/**\n * @return {string} The decoded user info.\n */\ngoog.Uri.prototype.getUserInfo = function() {\n  'use strict';\n  return this.userInfo_;\n};\n\n\n/**\n * Sets the userInfo.\n * @throws URIError If opt_decode is true and newUserInfo is malformed (that is,\n *     if decodeURIComponent fails).\n * @param {string} newUserInfo New userInfo value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setUserInfo = function(newUserInfo, opt_decode) {\n  'use strict';\n  this.enforceReadOnly();\n  this.userInfo_ =\n      opt_decode ? goog.Uri.decodeOrEmpty_(newUserInfo) : newUserInfo;\n  return this;\n};\n\n\n/**\n * @return {boolean} Whether the user info has been set.\n */\ngoog.Uri.prototype.hasUserInfo = function() {\n  'use strict';\n  return !!this.userInfo_;\n};\n\n\n/**\n * @return {string} The decoded domain.\n */\ngoog.Uri.prototype.getDomain = function() {\n  'use strict';\n  return this.domain_;\n};\n\n\n/**\n * Sets the domain.\n * @throws URIError If opt_decode is true and newDomain is malformed (that is,\n *     if decodeURIComponent fails).\n * @param {string} newDomain New domain value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setDomain = function(newDomain, opt_decode) {\n  'use strict';\n  this.enforceReadOnly();\n  this.domain_ =\n      opt_decode ? goog.Uri.decodeOrEmpty_(newDomain, true) : newDomain;\n  return this;\n};\n\n\n/**\n * @return {boolean} Whether the domain has been set.\n */\ngoog.Uri.prototype.hasDomain = function() {\n  'use strict';\n  return !!this.domain_;\n};\n\n\n/**\n * @return {?number} The port number.\n */\ngoog.Uri.prototype.getPort = function() {\n  'use strict';\n  return this.port_;\n};\n\n\n/**\n * Sets the port number.\n * @param {*} newPort Port number. Will be explicitly casted to a number.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setPort = function(newPort) {\n  'use strict';\n  this.enforceReadOnly();\n\n  if (newPort) {\n    newPort = Number(newPort);\n    if (isNaN(newPort) || newPort < 0) {\n      throw new Error('Bad port number ' + newPort);\n    }\n    this.port_ = newPort;\n  } else {\n    this.port_ = null;\n  }\n\n  return this;\n};\n\n\n/**\n * @return {boolean} Whether the port has been set.\n */\ngoog.Uri.prototype.hasPort = function() {\n  'use strict';\n  return this.port_ != null;\n};\n\n\n/**\n * @return {string} The decoded path.\n */\ngoog.Uri.prototype.getPath = function() {\n  'use strict';\n  return this.path_;\n};\n\n\n/**\n * Sets the path.\n * @throws URIError If opt_decode is true and newPath is malformed (that is,\n *     if decodeURIComponent fails).\n * @param {string} newPath New path value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setPath = function(newPath, opt_decode) {\n  'use strict';\n  this.enforceReadOnly();\n  this.path_ = opt_decode ? goog.Uri.decodeOrEmpty_(newPath, true) : newPath;\n  return this;\n};\n\n\n/**\n * @return {boolean} Whether the path has been set.\n */\ngoog.Uri.prototype.hasPath = function() {\n  'use strict';\n  return !!this.path_;\n};\n\n\n/**\n * @return {boolean} Whether the query string has been set.\n */\ngoog.Uri.prototype.hasQuery = function() {\n  'use strict';\n  return this.queryData_.toString() !== '';\n};\n\n\n/**\n * Sets the query data.\n * @param {goog.Uri.QueryData|string|undefined} queryData QueryData object.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n *     Applies only if queryData is a string.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setQueryData = function(queryData, opt_decode) {\n  'use strict';\n  this.enforceReadOnly();\n\n  if (queryData instanceof goog.Uri.QueryData) {\n    this.queryData_ = queryData;\n    this.queryData_.setIgnoreCase(this.ignoreCase_);\n  } else {\n    if (!opt_decode) {\n      // QueryData accepts encoded query string, so encode it if\n      // opt_decode flag is not true.\n      queryData = goog.Uri.encodeSpecialChars_(\n          queryData, goog.Uri.reDisallowedInQuery_);\n    }\n    this.queryData_ = new goog.Uri.QueryData(queryData, this.ignoreCase_);\n  }\n\n  return this;\n};\n\n\n/**\n * Sets the URI query.\n * @param {string} newQuery New query value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setQuery = function(newQuery, opt_decode) {\n  'use strict';\n  return this.setQueryData(newQuery, opt_decode);\n};\n\n\n/**\n * @return {string} The encoded URI query, not including the ?.\n */\ngoog.Uri.prototype.getEncodedQuery = function() {\n  'use strict';\n  return this.queryData_.toString();\n};\n\n\n/**\n * @return {string} The decoded URI query, not including the ?.\n */\ngoog.Uri.prototype.getDecodedQuery = function() {\n  'use strict';\n  return this.queryData_.toDecodedString();\n};\n\n\n/**\n * Returns the query data.\n * @return {!goog.Uri.QueryData} QueryData object.\n */\ngoog.Uri.prototype.getQueryData = function() {\n  'use strict';\n  return this.queryData_;\n};\n\n\n/**\n * @return {string} The encoded URI query, not including the ?.\n *\n * Warning: This method, unlike other getter methods, returns encoded\n * value, instead of decoded one.\n */\ngoog.Uri.prototype.getQuery = function() {\n  'use strict';\n  return this.getEncodedQuery();\n};\n\n\n/**\n * Sets the value of the named query parameters, clearing previous values for\n * that key.\n *\n * @param {string} key The parameter to set.\n * @param {*} value The new value. Value does not need to be encoded.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setParameterValue = function(key, value) {\n  'use strict';\n  this.enforceReadOnly();\n  this.queryData_.set(key, value);\n  return this;\n};\n\n\n/**\n * Sets the values of the named query parameters, clearing previous values for\n * that key.  Not new values will currently be moved to the end of the query\n * string.\n *\n * So, <code>goog.Uri.parse('foo?a=b&c=d&e=f').setParameterValues('c', ['new'])\n * </code> yields <tt>foo?a=b&e=f&c=new</tt>.</p>\n *\n * @param {string} key The parameter to set.\n * @param {*} values The new values. If values is a single\n *     string then it will be treated as the sole value. Values do not need to\n *     be encoded.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setParameterValues = function(key, values) {\n  'use strict';\n  this.enforceReadOnly();\n\n  if (!Array.isArray(values)) {\n    values = [String(values)];\n  }\n\n  this.queryData_.setValues(key, values);\n\n  return this;\n};\n\n\n/**\n * Returns the value<b>s</b> for a given cgi parameter as a list of decoded\n * query parameter values.\n * @param {string} name The parameter to get values for.\n * @return {!Array<?>} The values for a given cgi parameter as a list of\n *     decoded query parameter values.\n */\ngoog.Uri.prototype.getParameterValues = function(name) {\n  'use strict';\n  return this.queryData_.getValues(name);\n};\n\n\n/**\n * Returns the first value for a given cgi parameter or undefined if the given\n * parameter name does not appear in the query string.\n * @param {string} paramName Unescaped parameter name.\n * @return {string|undefined} The first value for a given cgi parameter or\n *     undefined if the given parameter name does not appear in the query\n *     string.\n */\ngoog.Uri.prototype.getParameterValue = function(paramName) {\n  'use strict';\n  return /** @type {string|undefined} */ (this.queryData_.get(paramName));\n};\n\n\n/**\n * @return {string} The URI fragment, not including the #.\n */\ngoog.Uri.prototype.getFragment = function() {\n  'use strict';\n  return this.fragment_;\n};\n\n\n/**\n * Sets the URI fragment.\n * @throws URIError If opt_decode is true and newFragment is malformed (that is,\n *     if decodeURIComponent fails).\n * @param {string} newFragment New fragment value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setFragment = function(newFragment, opt_decode) {\n  'use strict';\n  this.enforceReadOnly();\n  this.fragment_ =\n      opt_decode ? goog.Uri.decodeOrEmpty_(newFragment) : newFragment;\n  return this;\n};\n\n\n/**\n * @return {boolean} Whether the URI has a fragment set.\n */\ngoog.Uri.prototype.hasFragment = function() {\n  'use strict';\n  return !!this.fragment_;\n};\n\n\n/**\n * Returns true if this has the same domain as that of uri2.\n * @param {!goog.Uri} uri2 The URI object to compare to.\n * @return {boolean} true if same domain; false otherwise.\n */\ngoog.Uri.prototype.hasSameDomainAs = function(uri2) {\n  'use strict';\n  return ((!this.hasDomain() && !uri2.hasDomain()) ||\n          this.getDomain() == uri2.getDomain()) &&\n      ((!this.hasPort() && !uri2.hasPort()) ||\n       this.getPort() == uri2.getPort());\n};\n\n\n/**\n * Adds a random parameter to the Uri.\n * @return {!goog.Uri} Reference to this Uri object.\n */\ngoog.Uri.prototype.makeUnique = function() {\n  'use strict';\n  this.enforceReadOnly();\n  this.setParameterValue(goog.Uri.RANDOM_PARAM, goog.string.getRandomString());\n\n  return this;\n};\n\n\n/**\n * Removes the named query parameter.\n *\n * @param {string} key The parameter to remove.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.removeParameter = function(key) {\n  'use strict';\n  this.enforceReadOnly();\n  this.queryData_.remove(key);\n  return this;\n};\n\n\n/**\n * Sets whether Uri is read only. If this goog.Uri is read-only,\n * enforceReadOnly_ will be called at the start of any function that may modify\n * this Uri.\n * @param {boolean} isReadOnly whether this goog.Uri should be read only.\n * @return {!goog.Uri} Reference to this Uri object.\n */\ngoog.Uri.prototype.setReadOnly = function(isReadOnly) {\n  'use strict';\n  this.isReadOnly_ = isReadOnly;\n  return this;\n};\n\n\n/**\n * @return {boolean} Whether the URI is read only.\n */\ngoog.Uri.prototype.isReadOnly = function() {\n  'use strict';\n  return this.isReadOnly_;\n};\n\n\n/**\n * Checks if this Uri has been marked as read only, and if so, throws an error.\n * This should be called whenever any modifying function is called.\n */\ngoog.Uri.prototype.enforceReadOnly = function() {\n  'use strict';\n  if (this.isReadOnly_) {\n    throw new Error('Tried to modify a read-only Uri');\n  }\n};\n\n\n/**\n * Sets whether to ignore case.\n * NOTE: If there are already key/value pairs in the QueryData, and\n * ignoreCase_ is set to false, the keys will all be lower-cased.\n * @param {boolean} ignoreCase whether this goog.Uri should ignore case.\n * @return {!goog.Uri} Reference to this Uri object.\n */\ngoog.Uri.prototype.setIgnoreCase = function(ignoreCase) {\n  'use strict';\n  this.ignoreCase_ = ignoreCase;\n  if (this.queryData_) {\n    this.queryData_.setIgnoreCase(ignoreCase);\n  }\n  return this;\n};\n\n\n/**\n * @return {boolean} Whether to ignore case.\n */\ngoog.Uri.prototype.getIgnoreCase = function() {\n  'use strict';\n  return this.ignoreCase_;\n};\n\n\n//==============================================================================\n// Static members\n//==============================================================================\n\n\n/**\n * Creates a uri from the string form.  Basically an alias of new goog.Uri().\n * If a Uri object is passed to parse then it will return a clone of the object.\n *\n * @throws URIError If parsing the URI is malformed. The passed URI components\n *     should all be parseable by decodeURIComponent.\n * @param {*} uri Raw URI string or instance of Uri\n *     object.\n * @param {boolean=} opt_ignoreCase Whether to ignore the case of parameter\n * names in #getParameterValue.\n * @return {!goog.Uri} The new URI object.\n */\ngoog.Uri.parse = function(uri, opt_ignoreCase) {\n  'use strict';\n  return uri instanceof goog.Uri ? uri.clone() :\n                                   new goog.Uri(uri, opt_ignoreCase);\n};\n\n\n/**\n * Creates a new goog.Uri object from unencoded parts.\n *\n * @param {?string=} opt_scheme Scheme/protocol or full URI to parse.\n * @param {?string=} opt_userInfo username:password.\n * @param {?string=} opt_domain www.google.com.\n * @param {?number=} opt_port 9830.\n * @param {?string=} opt_path /some/path/to/a/file.html.\n * @param {string|goog.Uri.QueryData=} opt_query a=1&b=2.\n * @param {?string=} opt_fragment The fragment without the #.\n * @param {boolean=} opt_ignoreCase Whether to ignore parameter name case in\n *     #getParameterValue.\n *\n * @return {!goog.Uri} The new URI object.\n */\ngoog.Uri.create = function(\n    opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_query,\n    opt_fragment, opt_ignoreCase) {\n  'use strict';\n  var uri = new goog.Uri(null, opt_ignoreCase);\n\n  // Only set the parts if they are defined and not empty strings.\n  opt_scheme && uri.setScheme(opt_scheme);\n  opt_userInfo && uri.setUserInfo(opt_userInfo);\n  opt_domain && uri.setDomain(opt_domain);\n  opt_port && uri.setPort(opt_port);\n  opt_path && uri.setPath(opt_path);\n  opt_query && uri.setQueryData(opt_query);\n  opt_fragment && uri.setFragment(opt_fragment);\n\n  return uri;\n};\n\n\n/**\n * Resolves a relative Uri against a base Uri, accepting both strings and\n * Uri objects.\n *\n * @param {*} base Base Uri.\n * @param {*} rel Relative Uri.\n * @return {!goog.Uri} Resolved uri.\n */\ngoog.Uri.resolve = function(base, rel) {\n  'use strict';\n  if (!(base instanceof goog.Uri)) {\n    base = goog.Uri.parse(base);\n  }\n\n  if (!(rel instanceof goog.Uri)) {\n    rel = goog.Uri.parse(rel);\n  }\n\n  return base.resolve(rel);\n};\n\n\n/**\n * Removes dot segments in given path component, as described in\n * RFC 3986, section 5.2.4.\n *\n * @param {string} path A non-empty path component.\n * @return {string} Path component with removed dot segments.\n */\ngoog.Uri.removeDotSegments = function(path) {\n  'use strict';\n  if (path == '..' || path == '.') {\n    return '';\n\n  } else if (\n      !goog.string.contains(path, './') && !goog.string.contains(path, '/.')) {\n    // This optimization detects uris which do not contain dot-segments,\n    // and as a consequence do not require any processing.\n    return path;\n\n  } else {\n    var leadingSlash = goog.string.startsWith(path, '/');\n    var segments = path.split('/');\n    var out = [];\n\n    for (var pos = 0; pos < segments.length;) {\n      var segment = segments[pos++];\n\n      if (segment == '.') {\n        if (leadingSlash && pos == segments.length) {\n          out.push('');\n        }\n      } else if (segment == '..') {\n        if (out.length > 1 || out.length == 1 && out[0] != '') {\n          out.pop();\n        }\n        if (leadingSlash && pos == segments.length) {\n          out.push('');\n        }\n      } else {\n        out.push(segment);\n        leadingSlash = true;\n      }\n    }\n\n    return out.join('/');\n  }\n};\n\n\n/**\n * Decodes a value or returns the empty string if it isn't defined or empty.\n * @throws URIError If decodeURIComponent fails to decode val.\n * @param {string|undefined} val Value to decode.\n * @param {boolean=} opt_preserveReserved If true, restricted characters will\n *     not be decoded.\n * @return {string} Decoded value.\n * @private\n */\ngoog.Uri.decodeOrEmpty_ = function(val, opt_preserveReserved) {\n  'use strict';\n  // Don't use UrlDecode() here because val is not a query parameter.\n  if (!val) {\n    return '';\n  }\n\n  // decodeURI has the same output for '%2f' and '%252f'. We double encode %25\n  // so that we can distinguish between the 2 inputs. This is later undone by\n  // removeDoubleEncoding_.\n  return opt_preserveReserved ? decodeURI(val.replace(/%25/g, '%2525')) :\n                                decodeURIComponent(val);\n};\n\n\n/**\n * If unescapedPart is non null, then escapes any characters in it that aren't\n * valid characters in a url and also escapes any special characters that\n * appear in extra.\n *\n * @param {*} unescapedPart The string to encode.\n * @param {RegExp} extra A character set of characters in [\\01-\\177].\n * @param {boolean=} opt_removeDoubleEncoding If true, remove double percent\n *     encoding.\n * @return {?string} null iff unescapedPart == null.\n * @private\n */\ngoog.Uri.encodeSpecialChars_ = function(\n    unescapedPart, extra, opt_removeDoubleEncoding) {\n  'use strict';\n  if (typeof unescapedPart === 'string') {\n    var encoded = encodeURI(unescapedPart).replace(extra, goog.Uri.encodeChar_);\n    if (opt_removeDoubleEncoding) {\n      // encodeURI double-escapes %XX sequences used to represent restricted\n      // characters in some URI components, remove the double escaping here.\n      encoded = goog.Uri.removeDoubleEncoding_(encoded);\n    }\n    return encoded;\n  }\n  return null;\n};\n\n\n/**\n * Converts a character in [\\01-\\177] to its unicode character equivalent.\n * @param {string} ch One character string.\n * @return {string} Encoded string.\n * @private\n */\ngoog.Uri.encodeChar_ = function(ch) {\n  'use strict';\n  var n = ch.charCodeAt(0);\n  return '%' + ((n >> 4) & 0xf).toString(16) + (n & 0xf).toString(16);\n};\n\n\n/**\n * Removes double percent-encoding from a string.\n * @param  {string} doubleEncodedString String\n * @return {string} String with double encoding removed.\n * @private\n */\ngoog.Uri.removeDoubleEncoding_ = function(doubleEncodedString) {\n  'use strict';\n  return doubleEncodedString.replace(/%25([0-9a-fA-F]{2})/g, '%$1');\n};\n\n\n/**\n * Regular expression for characters that are disallowed in the scheme or\n * userInfo part of the URI.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInSchemeOrUserInfo_ = /[#\\/\\?@]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in a relative path.\n * Colon is included due to RFC 3986 3.3.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInRelativePath_ = /[\\#\\?:]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in an absolute path.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInAbsolutePath_ = /[\\#\\?]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in the query.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInQuery_ = /[\\#\\?@]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in the fragment.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInFragment_ = /#/g;\n\n\n/**\n * Checks whether two URIs have the same domain.\n * @param {string} uri1String First URI string.\n * @param {string} uri2String Second URI string.\n * @return {boolean} true if the two URIs have the same domain; false otherwise.\n */\ngoog.Uri.haveSameDomain = function(uri1String, uri2String) {\n  'use strict';\n  // Differs from goog.uri.utils.haveSameDomain, since this ignores scheme.\n  // TODO(gboyer): Have this just call goog.uri.util.haveSameDomain.\n  var pieces1 = goog.uri.utils.split(uri1String);\n  var pieces2 = goog.uri.utils.split(uri2String);\n  return pieces1[goog.uri.utils.ComponentIndex.DOMAIN] ==\n      pieces2[goog.uri.utils.ComponentIndex.DOMAIN] &&\n      pieces1[goog.uri.utils.ComponentIndex.PORT] ==\n      pieces2[goog.uri.utils.ComponentIndex.PORT];\n};\n\n\n\n/**\n * Class used to represent URI query parameters.  It is essentially a hash of\n * name-value pairs, though a name can be present more than once.\n *\n * Has the same interface as the collections in goog.structs.\n *\n * @param {?string=} opt_query Optional encoded query string to parse into\n *     the object.\n * @param {boolean=} opt_ignoreCase If true, ignore the case of the parameter\n *     name in #get.\n * @constructor\n * @struct\n * @final\n */\ngoog.Uri.QueryData = function(opt_query, opt_ignoreCase) {\n  'use strict';\n  /**\n   * The map containing name/value or name/array-of-values pairs.\n   * May be null if it requires parsing from the query string.\n   *\n   * We need to use a Map because we cannot guarantee that the key names will\n   * not be problematic for IE.\n   *\n   * @private {?Map<string, !Array<*>>}\n   */\n  this.keyMap_ = null;\n\n  /**\n   * The number of params, or null if it requires computing.\n   * @private {?number}\n   */\n  this.count_ = null;\n\n  /**\n   * Encoded query string, or null if it requires computing from the key map.\n   * @private {?string}\n   */\n  this.encodedQuery_ = opt_query || null;\n\n  /**\n   * If true, ignore the case of the parameter name in #get.\n   * @private {boolean}\n   */\n  this.ignoreCase_ = !!opt_ignoreCase;\n};\n\n\n/**\n * If the underlying key map is not yet initialized, it parses the\n * query string and fills the map with parsed data.\n * @private\n */\ngoog.Uri.QueryData.prototype.ensureKeyMapInitialized_ = function() {\n  'use strict';\n  if (!this.keyMap_) {\n    this.keyMap_ = /** @type {!Map<string, !Array<*>>} */ (new Map());\n    this.count_ = 0;\n    if (this.encodedQuery_) {\n      var self = this;\n      goog.uri.utils.parseQueryData(this.encodedQuery_, function(name, value) {\n        'use strict';\n        self.add(goog.string.urlDecode(name), value);\n      });\n    }\n  }\n};\n\n\n/**\n * Creates a new query data instance from a map of names and values.\n *\n * @param {!goog.collections.maps.MapLike<string, ?>|!Object} map Map of string\n *     parameter names to parameter value. If parameter value is an array, it is\n *     treated as if the key maps to each individual value in the\n *     array.\n * @param {boolean=} opt_ignoreCase If true, ignore the case of the parameter\n *     name in #get.\n * @return {!goog.Uri.QueryData} The populated query data instance.\n */\ngoog.Uri.QueryData.createFromMap = function(map, opt_ignoreCase) {\n  'use strict';\n  var keys = goog.structs.getKeys(map);\n  if (typeof keys == 'undefined') {\n    throw new Error('Keys are undefined');\n  }\n\n  var queryData = new goog.Uri.QueryData(null, opt_ignoreCase);\n  var values = goog.structs.getValues(map);\n  for (var i = 0; i < keys.length; i++) {\n    var key = keys[i];\n    var value = values[i];\n    if (!Array.isArray(value)) {\n      queryData.add(key, value);\n    } else {\n      queryData.setValues(key, value);\n    }\n  }\n  return queryData;\n};\n\n\n/**\n * Creates a new query data instance from parallel arrays of parameter names\n * and values. Allows for duplicate parameter names. Throws an error if the\n * lengths of the arrays differ.\n *\n * @param {!Array<string>} keys Parameter names.\n * @param {!Array<?>} values Parameter values.\n * @param {boolean=} opt_ignoreCase If true, ignore the case of the parameter\n *     name in #get.\n * @return {!goog.Uri.QueryData} The populated query data instance.\n */\ngoog.Uri.QueryData.createFromKeysValues = function(\n    keys, values, opt_ignoreCase) {\n  'use strict';\n  if (keys.length != values.length) {\n    throw new Error('Mismatched lengths for keys/values');\n  }\n  var queryData = new goog.Uri.QueryData(null, opt_ignoreCase);\n  for (var i = 0; i < keys.length; i++) {\n    queryData.add(keys[i], values[i]);\n  }\n  return queryData;\n};\n\n\n/**\n * @return {?number} The number of parameters.\n */\ngoog.Uri.QueryData.prototype.getCount = function() {\n  'use strict';\n  this.ensureKeyMapInitialized_();\n  return this.count_;\n};\n\n\n/**\n * Adds a key value pair.\n * @param {string} key Name.\n * @param {*} value Value.\n * @return {!goog.Uri.QueryData} Instance of this object.\n */\ngoog.Uri.QueryData.prototype.add = function(key, value) {\n  'use strict';\n  this.ensureKeyMapInitialized_();\n  this.invalidateCache_();\n\n  key = this.getKeyName_(key);\n  var values = this.keyMap_.get(key);\n  if (!values) {\n    this.keyMap_.set(key, (values = []));\n  }\n  values.push(value);\n  this.count_ = goog.asserts.assertNumber(this.count_) + 1;\n  return this;\n};\n\n\n/**\n * Removes all the params with the given key.\n * @param {string} key Name.\n * @return {boolean} Whether any parameter was removed.\n */\ngoog.Uri.QueryData.prototype.remove = function(key) {\n  'use strict';\n  this.ensureKeyMapInitialized_();\n\n  key = this.getKeyName_(key);\n  if (this.keyMap_.has(key)) {\n    this.invalidateCache_();\n\n    // Decrement parameter count.\n    this.count_ =\n        goog.asserts.assertNumber(this.count_) - this.keyMap_.get(key).length;\n    return this.keyMap_.delete(key);\n  }\n  return false;\n};\n\n\n/**\n * Clears the parameters.\n */\ngoog.Uri.QueryData.prototype.clear = function() {\n  'use strict';\n  this.invalidateCache_();\n  this.keyMap_ = null;\n  this.count_ = 0;\n};\n\n\n/**\n * @return {boolean} Whether we have any parameters.\n */\ngoog.Uri.QueryData.prototype.isEmpty = function() {\n  'use strict';\n  this.ensureKeyMapInitialized_();\n  return this.count_ == 0;\n};\n\n\n/**\n * Whether there is a parameter with the given name\n * @param {string} key The parameter name to check for.\n * @return {boolean} Whether there is a parameter with the given name.\n */\ngoog.Uri.QueryData.prototype.containsKey = function(key) {\n  'use strict';\n  this.ensureKeyMapInitialized_();\n  key = this.getKeyName_(key);\n  return this.keyMap_.has(key);\n};\n\n\n/**\n * Whether there is a parameter with the given value.\n * @param {*} value The value to check for.\n * @return {boolean} Whether there is a parameter with the given value.\n */\ngoog.Uri.QueryData.prototype.containsValue = function(value) {\n  'use strict';\n  // NOTE(arv): This solution goes through all the params even if it was the\n  // first param. We can get around this by not reusing code or by switching to\n  // iterators.\n  var vals = this.getValues();\n  return goog.array.contains(vals, value);\n};\n\n\n/**\n * Runs a callback on every key-value pair in the map, including duplicate keys.\n * This won't maintain original order when duplicate keys are interspersed (like\n * getKeys() / getValues()).\n * @param {function(this:SCOPE, ?, string, !goog.Uri.QueryData)} f\n * @param {SCOPE=} opt_scope The value of \"this\" inside f.\n * @template SCOPE\n */\ngoog.Uri.QueryData.prototype.forEach = function(f, opt_scope) {\n  'use strict';\n  this.ensureKeyMapInitialized_();\n  this.keyMap_.forEach(function(values, key) {\n    'use strict';\n    values.forEach(function(value) {\n      'use strict';\n      f.call(opt_scope, value, key, this);\n    }, this);\n  }, this);\n};\n\n\n/**\n * Returns all the keys of the parameters. If a key is used multiple times\n * it will be included multiple times in the returned array\n * @return {!Array<string>} All the keys of the parameters.\n */\ngoog.Uri.QueryData.prototype.getKeys = function() {\n  'use strict';\n  this.ensureKeyMapInitialized_();\n  // We need to get the values to know how many keys to add.\n  const vals = Array.from(this.keyMap_.values());\n  const keys = Array.from(this.keyMap_.keys());\n  const rv = [];\n  for (let i = 0; i < keys.length; i++) {\n    const val = vals[i];\n    for (let j = 0; j < val.length; j++) {\n      rv.push(keys[i]);\n    }\n  }\n  return rv;\n};\n\n\n/**\n * Returns all the values of the parameters with the given name. If the query\n * data has no such key this will return an empty array. If no key is given\n * all values wil be returned.\n * @param {string=} opt_key The name of the parameter to get the values for.\n * @return {!Array<?>} All the values of the parameters with the given name.\n */\ngoog.Uri.QueryData.prototype.getValues = function(opt_key) {\n  'use strict';\n  this.ensureKeyMapInitialized_();\n  let rv = [];\n  if (typeof opt_key === 'string') {\n    if (this.containsKey(opt_key)) {\n      rv = rv.concat(this.keyMap_.get(this.getKeyName_(opt_key)));\n    }\n  } else {\n    // Return all values.\n    const values = Array.from(this.keyMap_.values());\n    for (let i = 0; i < values.length; i++) {\n      rv = rv.concat(values[i]);\n    }\n  }\n  return rv;\n};\n\n\n/**\n * Sets a key value pair and removes all other keys with the same value.\n *\n * @param {string} key Name.\n * @param {*} value Value.\n * @return {!goog.Uri.QueryData} Instance of this object.\n */\ngoog.Uri.QueryData.prototype.set = function(key, value) {\n  'use strict';\n  this.ensureKeyMapInitialized_();\n  this.invalidateCache_();\n\n  // TODO(chrishenry): This could be better written as\n  // this.remove(key), this.add(key, value), but that would reorder\n  // the key (since the key is first removed and then added at the\n  // end) and we would have to fix unit tests that depend on key\n  // ordering.\n  key = this.getKeyName_(key);\n  if (this.containsKey(key)) {\n    this.count_ =\n        goog.asserts.assertNumber(this.count_) - this.keyMap_.get(key).length;\n  }\n  this.keyMap_.set(key, [value]);\n  this.count_ = goog.asserts.assertNumber(this.count_) + 1;\n  return this;\n};\n\n\n/**\n * Returns the first value associated with the key. If the query data has no\n * such key this will return undefined or the optional default.\n * @param {string} key The name of the parameter to get the value for.\n * @param {*=} opt_default The default value to return if the query data\n *     has no such key.\n * @return {*} The first string value associated with the key, or opt_default\n *     if there's no value.\n */\ngoog.Uri.QueryData.prototype.get = function(key, opt_default) {\n  'use strict';\n  if (!key) {\n    return opt_default;\n  }\n  var values = this.getValues(key);\n  return values.length > 0 ? String(values[0]) : opt_default;\n};\n\n\n/**\n * Sets the values for a key. If the key already exists, this will\n * override all of the existing values that correspond to the key.\n * @param {string} key The key to set values for.\n * @param {!Array<?>} values The values to set.\n */\ngoog.Uri.QueryData.prototype.setValues = function(key, values) {\n  'use strict';\n  this.remove(key);\n\n  if (values.length > 0) {\n    this.invalidateCache_();\n    this.keyMap_.set(this.getKeyName_(key), goog.array.clone(values));\n    this.count_ = goog.asserts.assertNumber(this.count_) + values.length;\n  }\n};\n\n\n/**\n * @return {string} Encoded query string.\n * @override\n */\ngoog.Uri.QueryData.prototype.toString = function() {\n  'use strict';\n  if (this.encodedQuery_) {\n    return this.encodedQuery_;\n  }\n\n  if (!this.keyMap_) {\n    return '';\n  }\n\n  const sb = [];\n\n  // In the past, we use this.getKeys() and this.getVals(), but that\n  // generates a lot of allocations as compared to simply iterating\n  // over the keys.\n  const keys = Array.from(this.keyMap_.keys());\n  for (var i = 0; i < keys.length; i++) {\n    const key = keys[i];\n    const encodedKey = goog.string.urlEncode(key);\n    const val = this.getValues(key);\n    for (var j = 0; j < val.length; j++) {\n      var param = encodedKey;\n      // Ensure that null and undefined are encoded into the url as\n      // literal strings.\n      if (val[j] !== '') {\n        param += '=' + goog.string.urlEncode(val[j]);\n      }\n      sb.push(param);\n    }\n  }\n\n  return this.encodedQuery_ = sb.join('&');\n};\n\n\n/**\n * @throws URIError If URI is malformed (that is, if decodeURIComponent fails on\n *     any of the URI components).\n * @return {string} Decoded query string.\n */\ngoog.Uri.QueryData.prototype.toDecodedString = function() {\n  'use strict';\n  return goog.Uri.decodeOrEmpty_(this.toString());\n};\n\n\n/**\n * Invalidate the cache.\n * @private\n */\ngoog.Uri.QueryData.prototype.invalidateCache_ = function() {\n  'use strict';\n  this.encodedQuery_ = null;\n};\n\n\n/**\n * Removes all keys that are not in the provided list. (Modifies this object.)\n * @param {Array<string>} keys The desired keys.\n * @return {!goog.Uri.QueryData} a reference to this object.\n */\ngoog.Uri.QueryData.prototype.filterKeys = function(keys) {\n  'use strict';\n  this.ensureKeyMapInitialized_();\n  this.keyMap_.forEach(function(value, key) {\n    'use strict';\n    if (!goog.array.contains(keys, key)) {\n      this.remove(key);\n    }\n  }, this);\n  return this;\n};\n\n\n/**\n * Clone the query data instance.\n * @return {!goog.Uri.QueryData} New instance of the QueryData object.\n */\ngoog.Uri.QueryData.prototype.clone = function() {\n  'use strict';\n  var rv = new goog.Uri.QueryData();\n  rv.encodedQuery_ = this.encodedQuery_;\n  if (this.keyMap_) {\n    rv.keyMap_ = /** @type {!Map<string, !Array<*>>} */ (new Map(this.keyMap_));\n    rv.count_ = this.count_;\n  }\n  return rv;\n};\n\n\n/**\n * Helper function to get the key name from a JavaScript object. Converts\n * the object to a string, and to lower case if necessary.\n * @private\n * @param {*} arg The object to get a key name from.\n * @return {string} valid key name which can be looked up in #keyMap_.\n */\ngoog.Uri.QueryData.prototype.getKeyName_ = function(arg) {\n  'use strict';\n  var keyName = String(arg);\n  if (this.ignoreCase_) {\n    keyName = keyName.toLowerCase();\n  }\n  return keyName;\n};\n\n\n/**\n * Ignore case in parameter names.\n * NOTE: If there are already key/value pairs in the QueryData, and\n * ignoreCase_ is set to false, the keys will all be lower-cased.\n * @param {boolean} ignoreCase whether this goog.Uri should ignore case.\n */\ngoog.Uri.QueryData.prototype.setIgnoreCase = function(ignoreCase) {\n  'use strict';\n  var resetKeys = ignoreCase && !this.ignoreCase_;\n  if (resetKeys) {\n    this.ensureKeyMapInitialized_();\n    this.invalidateCache_();\n    this.keyMap_.forEach(function(value, key) {\n      'use strict';\n      var lowerCase = key.toLowerCase();\n      if (key != lowerCase) {\n        this.remove(key);\n        this.setValues(lowerCase, value);\n      }\n    }, this);\n  }\n  this.ignoreCase_ = ignoreCase;\n};\n\n\n/**\n * Extends a query data object with another query data or map like object. This\n * operates 'in-place', it does not create a new QueryData object.\n *\n * @param {...(?goog.Uri.QueryData|?goog.collections.maps.MapLike<?,\n *     ?>|?Object)} var_args The object from which key value pairs will be\n *     copied. Note: does not accept null.\n * @suppress {deprecated} Use deprecated goog.structs.forEach to allow different\n * types of parameters.\n */\ngoog.Uri.QueryData.prototype.extend = function(var_args) {\n  'use strict';\n  for (var i = 0; i < arguments.length; i++) {\n    var data = arguments[i];\n    goog.structs.forEach(data, function(value, key) {\n      'use strict';\n      this.add(key, value);\n    }, this);\n  }\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Base WebChannel implementation.\n */\n\n\ngoog.provide('goog.labs.net.webChannel.WebChannelBase');\n\ngoog.require('goog.Uri');\ngoog.require('goog.array');\ngoog.require('goog.asserts');\ngoog.require('goog.async.run');\ngoog.require('goog.collections.maps');\ngoog.require('goog.json');\ngoog.require('goog.labs.net.webChannel.Channel');\ngoog.require('goog.labs.net.webChannel.ChannelRequest');\ngoog.require('goog.labs.net.webChannel.ConnectionState');\ngoog.require('goog.labs.net.webChannel.ForwardChannelRequestPool');\ngoog.require('goog.labs.net.webChannel.WebChannelDebug');\ngoog.require('goog.labs.net.webChannel.Wire');\ngoog.require('goog.labs.net.webChannel.WireV8');\ngoog.require('goog.labs.net.webChannel.environment');\ngoog.require('goog.labs.net.webChannel.netUtils');\ngoog.require('goog.labs.net.webChannel.requestStats');\ngoog.require('goog.net.FetchXmlHttpFactory');\ngoog.require('goog.net.WebChannel');\ngoog.require('goog.net.XhrIo');\ngoog.require('goog.net.XmlHttpFactory');\ngoog.require('goog.net.rpc.HttpCors');\ngoog.require('goog.object');\ngoog.require('goog.string');\ngoog.require('goog.structs');\n\ngoog.scope(function() {\n'use strict';\nconst WebChannel = goog.net.WebChannel;\nconst ChannelRequest = goog.labs.net.webChannel.ChannelRequest;\nconst ConnectionState = goog.labs.net.webChannel.ConnectionState;\nconst ForwardChannelRequestPool =\n    goog.labs.net.webChannel.ForwardChannelRequestPool;\nconst WebChannelDebug = goog.labs.net.webChannel.WebChannelDebug;\nconst Wire = goog.labs.net.webChannel.Wire;\nconst WireV8 = goog.labs.net.webChannel.WireV8;\nconst environment = goog.labs.net.webChannel.environment;\nconst netUtils = goog.labs.net.webChannel.netUtils;\nconst requestStats = goog.labs.net.webChannel.requestStats;\n\nconst httpCors = goog.module.get('goog.net.rpc.HttpCors');\n\n/**\n * @define {boolean} If WebChannel should compile with Origin Trial features.\n */\nconst ALLOW_ORIGIN_TRIAL_FEATURES =\n    goog.define('goog.net.webChannel.ALLOW_ORIGIN_TRIAL_FEATURES', false);\n\n/**\n * @define {boolean} If webchannel should ping google.com for debugging\n * connectivity issues (that may have caused the channel to abort).\n */\nconst ENABLE_GOOGLE_COM_PING =\n    goog.define('goog.net.webChannel.ENABLE_GOOGLE_COM_PING', true);\n\n/**\n * Gets an internal channel parameter in a type-safe way.\n *\n * @param {string} paramName the key of the parameter to fetch.\n * @param {!T} defaultValue the default value to return\n * @param {!goog.net.WebChannel.Options=} options Configuration for the\n *        WebChannel instance.\n * @return {T}\n * @template T\n */\nfunction getInternalChannelParam(paramName, defaultValue, options) {\n  if (!options || !options.internalChannelParams) {\n    return defaultValue;\n  }\n  return /** @type {T} */ (options.internalChannelParams[paramName]) ||\n      defaultValue;\n}\n\n/**\n * This WebChannel implementation is branched off goog.net.BrowserChannel\n * for now. Ongoing changes to goog.net.BrowserChannel will be back\n * ported to this implementation as needed.\n *\n * @param {!goog.net.WebChannel.Options=} opt_options Configuration for the\n *        WebChannel instance.\n * @param {number=} opt_clientVersion An application-specific version number\n *        that is sent to the server when connected.\n * @param {!ConnectionState=} opt_conn Previously determined connection\n *        conditions.\n * @constructor\n * @struct\n * @implements {goog.labs.net.webChannel.Channel}\n */\ngoog.labs.net.webChannel.WebChannelBase = function(\n    opt_options, opt_clientVersion, opt_conn) {\n  'use strict';\n  /**\n   * The client library version (capabilities).\n   * @private {number}\n   */\n  this.clientVersion_ = opt_clientVersion || 0;\n\n  /**\n   * The server library version (capabilities).\n   * @private {number}\n   */\n  this.serverVersion_ = 0;\n\n\n  /**\n   * An array of queued maps that need to be sent to the server.\n   * @private {!Array<Wire.QueuedMap>}\n   */\n  this.outgoingMaps_ = [];\n\n  /**\n   * The channel debug used for logging\n   * @private {!WebChannelDebug}\n   */\n  this.channelDebug_ = new WebChannelDebug();\n\n  /**\n   * Connectivity state.\n   * @private {!ConnectionState}\n   */\n  this.connState_ = opt_conn || new ConnectionState();\n\n  /**\n   * Extra HTTP headers to add to all the requests sent to the server.\n   * @private {?Object}\n   */\n  this.extraHeaders_ = null;\n\n  /**\n   * Extra HTTP headers to add to the init request(s) sent to the server.\n   * @private {?Object}\n   */\n  this.initHeaders_ = null;\n\n  /**\n   * @private {?string} The URL param name to overwrite custom HTTP headers\n   * to bypass CORS preflight.\n   */\n  this.httpHeadersOverwriteParam_ = null;\n\n  /**\n   * Extra parameters to add to all the requests sent to the server.\n   * @private {?Object}\n   */\n  this.extraParams_ = null;\n\n  /**\n   * Parameter name for the http session id.\n   * @private {?string}\n   */\n  this.httpSessionIdParam_ = null;\n\n  /**\n   * The http session id, to be sent with httpSessionIdParam_ with each\n   * request after the initial handshake.\n   * @private {?string}\n   */\n  this.httpSessionId_ = null;\n\n  /**\n   * The ChannelRequest object for the backchannel.\n   * @private {?ChannelRequest}\n   */\n  this.backChannelRequest_ = null;\n\n  /**\n   * The relative path (in the context of the page hosting the browser channel)\n   * for making requests to the server.\n   * @private {?string}\n   */\n  this.path_ = null;\n\n  /**\n   * The absolute URI for the forwardchannel request.\n   * @private {?goog.Uri}\n   */\n  this.forwardChannelUri_ = null;\n\n  /**\n   * The absolute URI for the backchannel request.\n   * @private {?goog.Uri}\n   */\n  this.backChannelUri_ = null;\n\n  /**\n   * A subdomain prefix for using a subdomain in IE for the backchannel\n   * requests.\n   * @private {?string}\n   */\n  this.hostPrefix_ = null;\n\n  /**\n   * Whether we allow the use of a subdomain in IE for the backchannel requests.\n   * @private {boolean}\n   */\n  this.allowHostPrefix_ = true;\n\n  /**\n   * The next id to use for the RID (request identifier) parameter. This\n   * identifier uniquely identifies the forward channel request.\n   * @private {number}\n   */\n  this.nextRid_ = 0;\n\n  /**\n   * The id to use for the next outgoing map. This identifier uniquely\n   * identifies a sent map.\n   * @private {number}\n   */\n  this.nextMapId_ = 0;\n\n  /**\n   * Whether to fail forward-channel requests after one try or a few tries.\n   * @private {boolean}\n   */\n  this.failFast_ = getInternalChannelParam('failFast', false, opt_options);\n\n  /**\n   * The handler that receive callbacks for state changes and data.\n   * @private {?goog.labs.net.webChannel.WebChannelBase.Handler}\n   */\n  this.handler_ = null;\n\n  /**\n   * Timer identifier for asynchronously making a forward channel request.\n   * This is set to true if the func is scheduled with async.run, which\n   * is equivalent to setTimeout(0).\n   * @private {?number|?boolean}\n   */\n  this.forwardChannelTimerId_ = null;\n\n  /**\n   * Timer identifier for asynchronously making a back channel request.\n   * @private {?number}\n   */\n  this.backChannelTimerId_ = null;\n\n  /**\n   * Timer identifier for the timer that waits for us to retry the backchannel\n   * in the case where it is dead and no longer receiving data.\n   * @private {?number}\n   */\n  this.deadBackChannelTimerId_ = null;\n\n  /**\n   * Whether the client's network conditions can support streamed responses.\n   * @private {?boolean}\n   */\n  this.enableStreaming_ = null;\n\n  /**\n   * Whether streaming mode is allowed. In certain debugging situations, it's\n   * useful to disable this.\n   * @private {boolean}\n   */\n  this.allowStreamingMode_ = true;\n\n  /**\n   * The array identifier of the last array received from the server for the\n   * backchannel request.\n   * @private {number}\n   */\n  this.lastArrayId_ = -1;\n\n  /**\n   * The array id of the last array sent by the server that we know about.\n   * @private {number}\n   */\n  this.lastPostResponseArrayId_ = -1;\n\n  /**\n   * The non-200 status code received that causes the channel to be aborted.\n   * @private {number}\n   */\n  this.errorResponseStatusCode_ = -1;\n\n  /**\n   * The response headers received along with the non-200 status.\n   * @private {!Object<string, string>|undefined}\n   */\n  this.errorResponseHeaders_ = undefined;\n\n  /**\n   * Number of times we have retried the current forward channel request.\n   * @private {number}\n   */\n  this.forwardChannelRetryCount_ = 0;\n\n  /**\n   * Number of times in a row that we have retried the current back channel\n   * request and received no data.\n   * @private {number}\n   */\n  this.backChannelRetryCount_ = 0;\n\n  /**\n   * The attempt id for the current back channel request. Starts at 1 and\n   * increments for each reconnect. The server uses this to log if our\n   * connection is flaky or not.\n   * @private {number}\n   */\n  this.backChannelAttemptId_ = 0;\n\n  /**\n   * The base part of the time before firing next retry request. Default is 5\n   * seconds. Note that a random delay is added (see {@link retryDelaySeedMs_})\n   * for all retries, and linear backoff is applied to the sum for subsequent\n   * retries.\n   * @private {number}\n   */\n  this.baseRetryDelayMs_ =\n      getInternalChannelParam('baseRetryDelayMs', 5 * 1000, opt_options);\n\n  /**\n   * A random time between 0 and this number of MS is added to the\n   * {@link baseRetryDelayMs_}. Default is 10 seconds.\n   * @private {number}\n   */\n  this.retryDelaySeedMs_ =\n      getInternalChannelParam('retryDelaySeedMs', 10 * 1000, opt_options);\n\n  /**\n   * Maximum number of attempts to connect to the server for forward channel\n   * requests. Defaults to 2.\n   * @private {number}\n   */\n  this.forwardChannelMaxRetries_ =\n      getInternalChannelParam('forwardChannelMaxRetries', 2, opt_options);\n\n  /**\n   * The timeout in milliseconds for a forward channel request. Defaults to 20\n   * seconds. Note that part of this timeout can be randomized.\n   * @private {number}\n   */\n  this.forwardChannelRequestTimeoutMs_ = getInternalChannelParam(\n      'forwardChannelRequestTimeoutMs', 20 * 1000, opt_options);\n\n  /**\n   * The custom factory used to create XMLHttpRequest objects.\n   * @private {!goog.net.XmlHttpFactory | undefined}\n   */\n  this.xmlHttpFactory_ =\n      (opt_options && opt_options.xmlHttpFactory) || undefined;\n\n  /**\n   * Whether or not this channel uses WHATWG Fetch/streams.\n   * @private {boolean}\n   */\n  this.usesFetchStreams_ =\n      (opt_options && opt_options.useFetchStreams) || false;\n\n  /**\n   * The timeout in milliseconds for a back channel request. Defaults to using\n   * the timeout configured in ChannelRequest (45s). If server-side\n   * keepaliveInterval is known to the client, set the backchannel request\n   * timeout to 1.5 * keepaliveInterval (ms).\n   *\n   * @private {number|undefined}\n   */\n  this.backChannelRequestTimeoutMs_ = undefined;\n\n  /**\n   * A throttle time in ms for readystatechange events for the backchannel.\n   * Useful for throttling when ready state is INTERACTIVE (partial data).\n   *\n   * This throttle is useful if the server sends large data chunks down the\n   * backchannel.  It prevents examining XHR partial data on every readystate\n   * change event.  This is useful because large chunks can trigger hundreds\n   * of readystatechange events, each of which takes ~5ms or so to handle,\n   * in turn making the UI unresponsive for a significant period.\n   *\n   * If set to zero no throttle is used.\n   * @private {number}\n   */\n  this.readyStateChangeThrottleMs_ = 0;\n\n  /**\n   * Whether cross origin requests are supported for the channel.\n   *\n   * See {@link goog.net.XhrIo#setWithCredentials}.\n   * @private {boolean}\n   */\n  this.supportsCrossDomainXhrs_ =\n      (opt_options && opt_options.supportsCrossDomainXhr) || false;\n\n  /**\n   * The current session id.\n   * @private {string}\n   */\n  this.sid_ = '';\n\n  /**\n   * The current ChannelRequest pool for the forward channel.\n   * @private {!ForwardChannelRequestPool}\n   */\n  this.forwardChannelRequestPool_ = new ForwardChannelRequestPool(\n      opt_options && opt_options.concurrentRequestLimit);\n\n  /**\n   * The V8 codec.\n   * @private {!WireV8}\n   */\n  this.wireCodec_ = new WireV8();\n\n  /**\n   * Whether to turn on the fast handshake behavior.\n   *\n   * @private {boolean}\n   */\n  this.fastHandshake_ = (opt_options && opt_options.fastHandshake) || false;\n\n  /**\n   * Whether to encode initMessageHeaders in the body.\n   *\n   * @private {boolean}\n   */\n  this.encodeInitMessageHeaders_ =\n      (opt_options && opt_options.encodeInitMessageHeaders) || false;\n\n  if (this.fastHandshake_ && this.encodeInitMessageHeaders_) {\n    this.channelDebug_.warning(\n        'Ignore encodeInitMessageHeaders because fastHandshake is set.');\n    this.encodeInitMessageHeaders_ = false;\n  }\n\n  /**\n   * Whether to signal to the server to enable blocking handshake.\n   *\n   * @private {boolean}\n   */\n  this.blockingHandshake_ =\n      (opt_options && opt_options.blockingHandshake) || false;\n\n\n  if (opt_options && opt_options.disableRedact) {\n    this.channelDebug_.disableRedact();\n  }\n\n  if (opt_options && opt_options.forceLongPolling) {\n    this.allowStreamingMode_ = false;\n  }\n\n  /**\n   * Whether to detect buffering proxies.\n   *\n   * fastHandshake + detectBufferingProxy are yet to be implemented.\n   *\n   * @private {boolean}\n   */\n  this.detectBufferingProxy_ =\n      (!this.fastHandshake_ && this.allowStreamingMode_ && opt_options &&\n       opt_options.detectBufferingProxy) ||\n      false;\n\n  /**\n   * Long polling timeout interval for the server to complete the handing GET.\n   *\n   * @private {number|undefined}\n   */\n  this.longPollingTimeout_ = undefined;\n\n  if (opt_options && opt_options.longPollingTimeout &&\n      opt_options.longPollingTimeout > 0) {\n    this.longPollingTimeout_ = opt_options.longPollingTimeout;\n  }\n\n  /**\n   * Callback when all the pending client-sent messages have been flushed.\n   *\n   * @private {function()|undefined}\n   */\n  this.forwardChannelFlushedCallback_ = undefined;\n\n  /**\n   * TODO(user): move all backchannel states to its own class similar to\n   * forwardchannelrequestpool.js and log more stats.\n   *\n   * The estimated handshake RTT (ms) as measured from when the handshake\n   * request is sent and when the handshake response headers are received.\n   * If the value is 0, the RTT is unknown.\n   *\n   * @private {number}\n   */\n  this.handshakeRttMs_ = 0;\n\n  /**\n   * If BP detection is done or still in progress.\n   * Should only be checked when detectBufferingProxy is turned on.\n   * @private {boolean}\n   */\n  this.bpDetectionDone_ = false;\n\n  /**\n   * The timer for detecting buffering proxy. This needs be reset with each\n   * backchannel request. If this is not null, bpDetectionDone_ == false.\n   * @private {?number}\n   */\n  this.bpDetectionTimerId_ = null;\n\n  /***\n   * Whether to attempt Chrome Origin Trials as part of the handshake.\n   * @private @const {boolean}\n   */\n  this.enableOriginTrials_ = ALLOW_ORIGIN_TRIAL_FEATURES &&\n      (!opt_options || opt_options.enableOriginTrials !== false);\n\n  /**\n   * The array of non-acked maps at the time of channel close. Refer to\n   * `getNonAckedMessagesWithClosedChannel()` API for definitions of non-acked\n   * messages.\n   *\n   * @private {?Array<!Wire.QueuedMap>}\n   */\n  this.nonAckedMapsAtChannelClose_ = null;\n};\n\nconst WebChannelBase = goog.labs.net.webChannel.WebChannelBase;\n\n\n/**\n * The channel version that we negotiated with the server for this session.\n * Starts out as the version we request, and then is changed to the negotiated\n * version after the initial open.\n * @private {number}\n */\nWebChannelBase.prototype.channelVersion_ = Wire.LATEST_CHANNEL_VERSION;\n\n\n/**\n * Enum type for the channel state machine.\n * @enum {number}\n */\nWebChannelBase.State = {\n  /** The channel is closed. */\n  CLOSED: 0,\n\n  /** The channel has been initialized but hasn't yet initiated a connection. */\n  INIT: 1,\n\n  /** The channel is in the process of opening a connection to the server. */\n  OPENING: 2,\n\n  /** The channel is open. */\n  OPENED: 3\n};\n\n\n/**\n * The current state of the WebChannel.\n * @private {!WebChannelBase.State}\n */\nWebChannelBase.prototype.state_ = WebChannelBase.State.INIT;\n\n\n/**\n * The timeout in milliseconds for a forward channel request.\n * @type {number}\n */\nWebChannelBase.FORWARD_CHANNEL_RETRY_TIMEOUT = 20 * 1000;\n\n\n/**\n * Maximum number of attempts to connect to the server for back channel\n * requests.\n * @type {number}\n */\nWebChannelBase.BACK_CHANNEL_MAX_RETRIES = 3;\n\n\n/**\n * A number in MS of how long we guess the maxmium amount of time a round trip\n * to the server should take. In the future this could be substituted with a\n * real measurement of the RTT.\n * @type {number}\n */\nWebChannelBase.RTT_ESTIMATE = 3 * 1000;\n\n\n/**\n * When retrying for an inactive channel, we will multiply the total delay by\n * this number.\n * @type {number}\n */\nWebChannelBase.INACTIVE_CHANNEL_RETRY_FACTOR = 2;\n\n\n/**\n * Enum type for identifying an error.\n * @enum {number}\n */\nWebChannelBase.Error = {\n  /** Value that indicates no error has occurred. */\n  OK: 0,\n\n  /** An error due to a request failing. */\n  REQUEST_FAILED: 2,\n\n  /** An error due to the user being logged out. */\n  LOGGED_OUT: 4,\n\n  /** An error due to server response which contains no data. */\n  NO_DATA: 5,\n\n  /** An error due to a server response indicating an unknown session id */\n  UNKNOWN_SESSION_ID: 6,\n\n  /** An error due to a server response requesting to stop the channel. */\n  STOP: 7,\n\n  /** A general network error. */\n  NETWORK: 8,\n\n  /** An error due to bad data being returned from the server. */\n  BAD_DATA: 10,\n\n  /** An error due to a response that is not parsable. */\n  BAD_RESPONSE: 11\n};\n\n\n/**\n * Internal enum type for the two channel types.\n * @enum {number}\n * @private\n */\nWebChannelBase.ChannelType_ = {\n  FORWARD_CHANNEL: 1,\n\n  BACK_CHANNEL: 2\n};\n\n\n/**\n * The maximum number of maps that can be sent in one POST. Should match\n * MAX_MAPS_PER_REQUEST on the server code.\n * @type {number}\n * @private\n */\nWebChannelBase.MAX_MAPS_PER_REQUEST_ = 1000;\n\n\n/**\n * The maximum number of utf-8 chars that can be sent in one GET to enable 0-RTT\n * handshake.\n *\n *  @const @private {number}\n */\nWebChannelBase.MAX_CHARS_PER_GET_ = 4 * 1024;\n\n\n/**\n * A guess at a cutoff at which to no longer assume the backchannel is dead\n * when we are slow to receive data. Number in bytes.\n *\n * Assumption: The worst bandwidth we work on is 50 kilobits/sec\n * 50kbits/sec * (1 byte / 8 bits) * 6 sec dead backchannel timeout\n * @type {number}\n */\nWebChannelBase.OUTSTANDING_DATA_BACKCHANNEL_RETRY_CUTOFF = 37500;\n\n\n/**\n * @return {number} The server version or 0 if undefined\n */\nWebChannelBase.prototype.getServerVersion = function() {\n  'use strict';\n  return this.serverVersion_;\n};\n\n\n/**\n * @return {!ForwardChannelRequestPool} The forward channel request pool.\n */\nWebChannelBase.prototype.getForwardChannelRequestPool = function() {\n  'use strict';\n  return this.forwardChannelRequestPool_;\n};\n\n\n/**\n * @return {!Object} The codec object.\n */\nWebChannelBase.prototype.getWireCodec = function() {\n  'use strict';\n  return this.wireCodec_;\n};\n\n\n/**\n * Returns the logger.\n *\n * @return {!WebChannelDebug} The channel debug object.\n */\nWebChannelBase.prototype.getChannelDebug = function() {\n  'use strict';\n  return this.channelDebug_;\n};\n\n\n/**\n * Sets the logger.\n *\n * @param {!WebChannelDebug} channelDebug The channel debug object.\n */\nWebChannelBase.prototype.setChannelDebug = function(channelDebug) {\n  'use strict';\n  this.channelDebug_ = channelDebug;\n};\n\n\n/**\n * Starts the channel. This initiates connections to the server.\n *\n * @param {string} channelPath  The path for the channel connection.\n * @param {!Object=} opt_extraParams Extra parameter keys and values to add to\n *     the requests.\n * @param {string=} opt_oldSessionId  Session ID from a previous session.\n * @param {number=} opt_oldArrayId  The last array ID from a previous session.\n */\nWebChannelBase.prototype.connect = function(\n    channelPath, opt_extraParams, opt_oldSessionId, opt_oldArrayId) {\n  'use strict';\n  this.channelDebug_.debug('connect()');\n\n  this.startOriginTrials_(channelPath);\n\n  requestStats.notifyStatEvent(requestStats.Stat.CONNECT_ATTEMPT);\n\n  this.path_ = channelPath;\n  this.extraParams_ = opt_extraParams || {};\n\n  // Attach parameters about the previous session if reconnecting.\n  if (opt_oldSessionId && opt_oldArrayId !== undefined) {\n    this.extraParams_['OSID'] = opt_oldSessionId;\n    this.extraParams_['OAID'] = opt_oldArrayId;\n  }\n\n  this.enableStreaming_ = this.allowStreamingMode_;\n  this.connectChannel_();\n};\n\n\n/**\n * Disconnects and closes the channel.\n */\nWebChannelBase.prototype.disconnect = function() {\n  'use strict';\n  this.channelDebug_.debug('disconnect()');\n\n  this.cancelRequests_();\n\n  if (this.state_ == WebChannelBase.State.OPENED) {\n    const rid = this.nextRid_++;\n    const uri = this.forwardChannelUri_.clone();\n    uri.setParameterValue('SID', this.sid_);\n    uri.setParameterValue('RID', rid);\n    uri.setParameterValue('TYPE', 'terminate');\n\n    this.addAdditionalParams_(uri);\n\n    const request = ChannelRequest.createChannelRequest(\n        this, this.channelDebug_, this.sid_, rid);\n    request.sendCloseRequest(uri);\n  }\n\n  this.onClose_();\n};\n\n\n/**\n * Returns the session id of the channel. Only available after the\n * channel has been opened.\n * @return {string} Session ID.\n */\nWebChannelBase.prototype.getSessionId = function() {\n  'use strict';\n  return this.sid_;\n};\n\n\n/**\n * Starts the connection.\n * @private\n */\nWebChannelBase.prototype.connectChannel_ = function() {\n  'use strict';\n  this.channelDebug_.debug('connectChannel_()');\n  this.ensureInState_(WebChannelBase.State.INIT, WebChannelBase.State.CLOSED);\n  this.forwardChannelUri_ =\n      this.getForwardChannelUri(/** @type {string} */ (this.path_));\n  this.ensureForwardChannel_();\n};\n\n\n/**\n * Starts the Origin Trials.\n * @param {string} channelPath  The path for the channel connection.\n * @private\n */\nWebChannelBase.prototype.startOriginTrials_ = function(channelPath) {\n  'use strict';\n\n  if (!this.enableOriginTrials_) {\n    return;\n  }\n\n  this.channelDebug_.info('Origin Trials enabled.');\n  goog.async.run(goog.bind(this.runOriginTrials_, this, channelPath));\n};\n\n\n/**\n * Runs the Origin Trials.\n * @param {string} channelPath  The path for the channel connection.\n * @private\n */\nWebChannelBase.prototype.runOriginTrials_ = function(channelPath) {\n  'use strict';\n\n  try {\n    // Since startOriginTrials might throw exceptions asynchronously, we should\n    // capture it in promise-catch.\n    environment.startOriginTrials(channelPath, e => {\n      this.channelDebug_.dumpException(\n          /** @type {?Error} */ (e), 'Error in running origin trials');\n    });\n    this.channelDebug_.info('Origin Trials invoked: ' + channelPath);\n  } catch (e) {\n    this.channelDebug_.dumpException(e, 'Error in running origin trials');\n  }\n};\n\n\n/**\n * Cancels backchannel request.\n * @private\n */\nWebChannelBase.prototype.cancelBackChannelRequest_ = function() {\n  'use strict';\n  if (this.backChannelRequest_) {\n    this.clearBpDetectionTimer_();\n    this.backChannelRequest_.cancel();\n    this.backChannelRequest_ = null;\n  }\n};\n\n\n/**\n * Cancels all outstanding requests.\n * @private\n */\nWebChannelBase.prototype.cancelRequests_ = function() {\n  'use strict';\n  this.cancelBackChannelRequest_();\n\n  if (this.backChannelTimerId_) {\n    goog.global.clearTimeout(this.backChannelTimerId_);\n    this.backChannelTimerId_ = null;\n  }\n\n  this.clearDeadBackchannelTimer_();\n\n  this.forwardChannelRequestPool_.cancel();\n\n  if (this.forwardChannelTimerId_) {\n    this.clearForwardChannelTimer_();\n  }\n};\n\n\n/**\n * Clears the forward channel timer.\n * @private\n */\nWebChannelBase.prototype.clearForwardChannelTimer_ = function() {\n  'use strict';\n  if (typeof this.forwardChannelTimerId_ === 'number') {\n    goog.global.clearTimeout(this.forwardChannelTimerId_);\n  }\n\n  this.forwardChannelTimerId_ = null;\n};\n\n\n/**\n * Returns the extra HTTP headers to add to all the requests sent to the server.\n *\n * @return {Object} The HTTP headers, or null.\n */\nWebChannelBase.prototype.getExtraHeaders = function() {\n  'use strict';\n  return this.extraHeaders_;\n};\n\n\n/**\n * Sets extra HTTP headers to add to all the requests sent to the server.\n *\n * @param {Object} extraHeaders The HTTP headers, or null.\n */\nWebChannelBase.prototype.setExtraHeaders = function(extraHeaders) {\n  'use strict';\n  this.extraHeaders_ = extraHeaders;\n};\n\n\n/**\n * Returns the extra HTTP headers to add to the init requests\n * sent to the server.\n *\n * @return {Object} The HTTP headers, or null.\n */\nWebChannelBase.prototype.getInitHeaders = function() {\n  'use strict';\n  return this.initHeaders_;\n};\n\n\n/**\n * Sets extra HTTP headers to add to the init requests sent to the server.\n *\n * @param {Object} initHeaders The HTTP headers, or null.\n */\nWebChannelBase.prototype.setInitHeaders = function(initHeaders) {\n  'use strict';\n  this.initHeaders_ = initHeaders;\n};\n\n\n/**\n * Sets the URL param name to overwrite custom HTTP headers.\n *\n * @param {string} httpHeadersOverwriteParam The URL param name.\n */\nWebChannelBase.prototype.setHttpHeadersOverwriteParam = function(\n    httpHeadersOverwriteParam) {\n  'use strict';\n  this.httpHeadersOverwriteParam_ = httpHeadersOverwriteParam;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.setHttpSessionIdParam = function(httpSessionIdParam) {\n  'use strict';\n  this.httpSessionIdParam_ = httpSessionIdParam;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.getHttpSessionIdParam = function() {\n  'use strict';\n  return this.httpSessionIdParam_;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.setHttpSessionId = function(httpSessionId) {\n  'use strict';\n  this.httpSessionId_ = httpSessionId;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.getHttpSessionId = function() {\n  'use strict';\n  return this.httpSessionId_;\n};\n\n\n/**\n * Sets the throttle for handling onreadystatechange events for the request.\n *\n * @param {number} throttle The throttle in ms.  A value of zero indicates\n *     no throttle.\n */\nWebChannelBase.prototype.setReadyStateChangeThrottle = function(throttle) {\n  'use strict';\n  this.readyStateChangeThrottleMs_ = throttle;\n};\n\n\n/**\n * Sets whether cross origin requests are supported for the channel.\n *\n * Setting this allows the creation of requests to secondary domains and\n * sends XHRs with the CORS withCredentials bit set to true.\n *\n * In order for cross-origin requests to work, the server will also need to set\n * CORS response headers as per:\n * https://developer.mozilla.org/en-US/docs/HTTP_access_control\n *\n * See {@link goog.net.XhrIo#setWithCredentials}.\n * @param {boolean} supportCrossDomain Whether cross domain XHRs are supported.\n */\nWebChannelBase.prototype.setSupportsCrossDomainXhrs = function(\n    supportCrossDomain) {\n  'use strict';\n  this.supportsCrossDomainXhrs_ = supportCrossDomain;\n};\n\n\n/**\n * Returns the handler used for channel callback events.\n *\n * @return {WebChannelBase.Handler} The handler.\n */\nWebChannelBase.prototype.getHandler = function() {\n  'use strict';\n  return this.handler_;\n};\n\n\n/**\n * Sets the handler used for channel callback events.\n * @param {WebChannelBase.Handler} handler The handler to set.\n */\nWebChannelBase.prototype.setHandler = function(handler) {\n  'use strict';\n  this.handler_ = handler;\n};\n\n\n/**\n * Returns whether the channel allows the use of a subdomain. There may be\n * cases where this isn't allowed.\n * @return {boolean} Whether a host prefix is allowed.\n */\nWebChannelBase.prototype.getAllowHostPrefix = function() {\n  'use strict';\n  return this.allowHostPrefix_;\n};\n\n\n/**\n * Sets whether the channel allows the use of a subdomain. There may be cases\n * where this isn't allowed, for example, logging in with troutboard where\n * using a subdomain causes Apache to force the user to authenticate twice.\n * @param {boolean} allowHostPrefix Whether a host prefix is allowed.\n */\nWebChannelBase.prototype.setAllowHostPrefix = function(allowHostPrefix) {\n  'use strict';\n  this.allowHostPrefix_ = allowHostPrefix;\n};\n\n\n/**\n * Returns whether the channel is buffered or not.  This may be\n * queried in the WebChannelBase.okToMakeRequest() callback.\n *\n * @return {boolean} Whether the channel is buffered.\n */\nWebChannelBase.prototype.isBuffered = function() {\n  'use strict';\n  return !this.enableStreaming_;\n};\n\n\n/**\n * Returns whether streaming mode is allowed. In certain debugging situations,\n * it's useful for the application to have a way to disable streaming mode for a\n * user.\n\n * @return {boolean} Whether streaming mode is allowed.\n */\nWebChannelBase.prototype.getAllowStreamingMode = function() {\n  'use strict';\n  return this.allowStreamingMode_;\n};\n\n\n/**\n * Sets whether streaming mode is allowed. In certain debugging situations, it's\n * useful for the application to have a way to disable streaming mode for a\n * user.\n * @param {boolean} allowStreamingMode  Whether streaming mode is allowed.\n */\nWebChannelBase.prototype.setAllowStreamingMode = function(allowStreamingMode) {\n  'use strict';\n  this.allowStreamingMode_ = allowStreamingMode;\n};\n\n\n/**\n * Sends a request to the server. The format of the request is a Map data\n * structure of key/value pairs. These maps are then encoded in a format\n * suitable for the wire and then reconstituted as a Map data structure that\n * the server can process.\n * @param {!Object|!goog.collections.maps.MapLike} map The map to send.\n * @param {!Object=} opt_context The context associated with the map.\n */\nWebChannelBase.prototype.sendMap = function(map, opt_context) {\n  'use strict';\n  goog.asserts.assert(\n      this.state_ != WebChannelBase.State.CLOSED,\n      'Invalid operation: sending map when state is closed');\n\n  // We can only send 1000 maps per POST, but typically we should never have\n  // that much to send, so warn if we exceed that (we still send all the maps).\n  if (this.outgoingMaps_.length == WebChannelBase.MAX_MAPS_PER_REQUEST_) {\n    // severe() is temporary so that we get these uploaded and can figure out\n    // what's causing them. Afterwards can change to warning().\n    this.channelDebug_.severe(function() {\n      'use strict';\n      return 'Already have ' + WebChannelBase.MAX_MAPS_PER_REQUEST_ +\n          ' queued maps upon queueing ' + goog.json.serialize(map);\n    });\n  }\n\n  this.outgoingMaps_.push(\n      new Wire.QueuedMap(this.nextMapId_++, map, opt_context));\n\n  // Messages need be buffered during OPENING to avoid server-side race\n  if (this.state_ == WebChannelBase.State.OPENED) {\n    this.ensureForwardChannel_();\n  }\n};\n\n\n/**\n * When set to true, this changes the behavior of the forward channel so it\n * will not retry requests; it will fail after one network failure, and if\n * there was already one network failure, the request will fail immediately.\n * @param {boolean} failFast  Whether or not to fail fast.\n */\nWebChannelBase.prototype.setFailFast = function(failFast) {\n  'use strict';\n  this.failFast_ = failFast;\n  this.channelDebug_.info('setFailFast: ' + failFast);\n  if ((this.forwardChannelRequestPool_.hasPendingRequest() ||\n       this.forwardChannelTimerId_) &&\n      this.forwardChannelRetryCount_ > this.getForwardChannelMaxRetries()) {\n    const self = this;\n    this.channelDebug_.info(function() {\n      'use strict';\n      return 'Retry count ' + self.forwardChannelRetryCount_ +\n          ' > new maxRetries ' + self.getForwardChannelMaxRetries() +\n          '. Fail immediately!';\n    });\n\n    if (!this.forwardChannelRequestPool_.forceComplete(\n            goog.bind(this.onRequestComplete, this))) {\n      // i.e., this.forwardChannelTimerId_\n      this.clearForwardChannelTimer_();\n      // The error code from the last failed request is gone, so just use a\n      // generic one.\n      this.signalError_(WebChannelBase.Error.REQUEST_FAILED);\n    }\n  }\n};\n\n\n/**\n * @return {number} The max number of forward-channel retries, which will be 0\n * in fail-fast mode.\n */\nWebChannelBase.prototype.getForwardChannelMaxRetries = function() {\n  'use strict';\n  return this.failFast_ ? 0 : this.forwardChannelMaxRetries_;\n};\n\n\n/**\n * Sets the maximum number of attempts to connect to the server for forward\n * channel requests.\n * @param {number} retries The maximum number of attempts.\n */\nWebChannelBase.prototype.setForwardChannelMaxRetries = function(retries) {\n  'use strict';\n  this.forwardChannelMaxRetries_ = retries;\n};\n\n\n/**\n * Sets the timeout for a forward channel request.\n * @param {number} timeoutMs The timeout in milliseconds.\n */\nWebChannelBase.prototype.setForwardChannelRequestTimeout = function(timeoutMs) {\n  'use strict';\n  this.forwardChannelRequestTimeoutMs_ = timeoutMs;\n};\n\n\n/**\n * @return {number} The max number of back-channel retries, which is a constant.\n */\nWebChannelBase.prototype.getBackChannelMaxRetries = function() {\n  'use strict';\n  // Back-channel retries is a constant.\n  return WebChannelBase.BACK_CHANNEL_MAX_RETRIES;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.isClosed = function() {\n  'use strict';\n  return this.state_ == WebChannelBase.State.CLOSED;\n};\n\n\n/**\n * Returns the channel state.\n * @return {WebChannelBase.State} The current state of the channel.\n */\nWebChannelBase.prototype.getState = function() {\n  'use strict';\n  return this.state_;\n};\n\n\n/**\n * @return {!Object<string, string>|undefined} The response headers received\n * along with the non-200 status.\n */\nWebChannelBase.prototype.getLastResponseHeaders = function() {\n  'use strict';\n  return this.errorResponseHeaders_;\n};\n\n\n/**\n * @return {number} The non-200 status code received that causes the channel to\n * be aborted.\n */\nWebChannelBase.prototype.getLastStatusCode = function() {\n  'use strict';\n  return this.errorResponseStatusCode_;\n};\n\n\n/**\n * @return {number} The last array id received.\n */\nWebChannelBase.prototype.getLastArrayId = function() {\n  'use strict';\n  return this.lastArrayId_;\n};\n\n\n/**\n * Returns whether there are outstanding requests servicing the channel.\n * @return {boolean} true if there are outstanding requests.\n */\nWebChannelBase.prototype.hasOutstandingRequests = function() {\n  'use strict';\n  return this.getOutstandingRequests_() != 0;\n};\n\n\n/**\n * Returns the number of outstanding requests.\n * @return {number} The number of outstanding requests to the server.\n * @private\n */\nWebChannelBase.prototype.getOutstandingRequests_ = function() {\n  'use strict';\n  let count = 0;\n  if (this.backChannelRequest_) {\n    count++;\n  }\n  count += this.forwardChannelRequestPool_.getRequestCount();\n  return count;\n};\n\n\n/**\n * Ensures that a forward channel request is scheduled.\n * @private\n */\nWebChannelBase.prototype.ensureForwardChannel_ = function() {\n  'use strict';\n  if (this.forwardChannelRequestPool_.isFull()) {\n    // enough connection in process - no need to start a new request\n    return;\n  }\n\n  if (this.forwardChannelTimerId_) {\n    // no need to start a new request - one is already scheduled\n    return;\n  }\n\n  // Use async.run instead of setTimeout(0) to avoid the 1s message delay\n  // from chrome/firefox background tabs\n  this.forwardChannelTimerId_ = true;\n  goog.async.run(this.onStartForwardChannelTimer_, this);\n\n  this.forwardChannelRetryCount_ = 0;\n};\n\n\n/**\n * Schedules a forward-channel retry for the specified request, unless the max\n * retries has been reached.\n * @param {!ChannelRequest} request The failed request to retry.\n * @return {boolean} true iff a retry was scheduled.\n * @private\n */\nWebChannelBase.prototype.maybeRetryForwardChannel_ = function(request) {\n  'use strict';\n  if (this.forwardChannelRequestPool_.getRequestCount() >=\n      this.forwardChannelRequestPool_.getMaxSize() -\n          (this.forwardChannelTimerId_ ? 1 : 0)) {\n    // Should be impossible to be called in this state.\n    this.channelDebug_.severe('Unexpected retry request is scheduled.');\n    return false;\n  }\n\n  if (this.forwardChannelTimerId_) {\n    this.channelDebug_.debug(\n        'Use the retry request that is already scheduled.');\n    this.outgoingMaps_ =\n        request.getPendingMessages().concat(this.outgoingMaps_);\n    return true;\n  }\n\n  // No retry for open_() and fail-fast\n  if (this.state_ == WebChannelBase.State.INIT ||\n      this.state_ == WebChannelBase.State.OPENING ||\n      (this.forwardChannelRetryCount_ >= this.getForwardChannelMaxRetries())) {\n    return false;\n  }\n\n  this.channelDebug_.debug('Going to retry POST');\n\n  this.forwardChannelTimerId_ = requestStats.setTimeout(\n      goog.bind(this.onStartForwardChannelTimer_, this, request),\n      this.getRetryTime_(this.forwardChannelRetryCount_));\n  this.forwardChannelRetryCount_++;\n  return true;\n};\n\n\n/**\n * Timer callback for ensureForwardChannel\n * @param {ChannelRequest=} opt_retryRequest A failed request\n * to retry.\n * @private\n */\nWebChannelBase.prototype.onStartForwardChannelTimer_ = function(\n    opt_retryRequest) {\n  'use strict';\n  // null is possible if scheduled with async.run\n  if (this.forwardChannelTimerId_) {\n    this.forwardChannelTimerId_ = null;\n    this.startForwardChannel_(opt_retryRequest);\n  }\n};\n\n\n/**\n * Begins a new forward channel operation to the server.\n * @param {ChannelRequest=} opt_retryRequest A failed request to retry.\n * @private\n */\nWebChannelBase.prototype.startForwardChannel_ = function(opt_retryRequest) {\n  'use strict';\n  this.channelDebug_.debug('startForwardChannel_');\n  if (!this.okToMakeRequest_()) {\n    return;  // channel is cancelled\n  } else if (this.state_ == WebChannelBase.State.INIT) {\n    if (opt_retryRequest) {\n      this.channelDebug_.severe('Not supposed to retry the open');\n      return;\n    }\n    this.open_();\n    this.state_ = WebChannelBase.State.OPENING;\n  } else if (this.state_ == WebChannelBase.State.OPENED) {\n    if (opt_retryRequest) {\n      this.makeForwardChannelRequest_(opt_retryRequest);\n      return;\n    }\n\n    if (this.outgoingMaps_.length == 0) {\n      this.channelDebug_.debug(\n          'startForwardChannel_ returned: ' +\n          'nothing to send');\n      // no need to start a new forward channel request\n      return;\n    }\n\n    if (this.forwardChannelRequestPool_.isFull()) {\n      // Should be impossible to be called in this state.\n      this.channelDebug_.severe(\n          'startForwardChannel_ returned: ' +\n          'connection already in progress');\n      return;\n    }\n\n    this.makeForwardChannelRequest_();\n    this.channelDebug_.debug('startForwardChannel_ finished, sent request');\n  }\n};\n\n\n/**\n * Establishes a new channel session with the server.\n * @private\n */\nWebChannelBase.prototype.open_ = function() {\n  'use strict';\n  this.channelDebug_.debug('open_()');\n  this.nextRid_ = Math.floor(Math.random() * 100000);\n\n  const rid = this.nextRid_++;\n  const request =\n      ChannelRequest.createChannelRequest(this, this.channelDebug_, '', rid);\n\n  // mix the init headers\n  let extraHeaders = this.extraHeaders_;\n  if (this.initHeaders_) {\n    if (extraHeaders) {\n      extraHeaders = goog.object.clone(extraHeaders);\n      goog.object.extend(extraHeaders, this.initHeaders_);\n    } else {\n      extraHeaders = this.initHeaders_;\n    }\n  }\n\n  if (this.httpHeadersOverwriteParam_ === null &&\n      !this.encodeInitMessageHeaders_) {\n    request.setExtraHeaders(extraHeaders);\n    extraHeaders = null;\n  }\n\n  let requestText = this.dequeueOutgoingMaps_(\n      request,\n      this.fastHandshake_ ? this.getMaxNumMessagesForFastHandshake_() :\n                            WebChannelBase.MAX_MAPS_PER_REQUEST_);\n\n  const uri = this.forwardChannelUri_.clone();\n  uri.setParameterValue('RID', rid);\n\n  if (this.clientVersion_ > 0) {\n    uri.setParameterValue('CVER', this.clientVersion_);\n  }\n\n  // http-session-id to be generated as the response\n  if (this.getHttpSessionIdParam()) {\n    uri.setParameterValue(\n        WebChannel.X_HTTP_SESSION_ID, this.getHttpSessionIdParam());\n  }\n\n  this.addAdditionalParams_(uri);\n\n  if (extraHeaders) {\n    if (this.encodeInitMessageHeaders_) {\n      let encodedHeaders =\n          httpCors.generateEncodedHttpHeadersOverwriteParam(extraHeaders);\n      requestText = 'headers=' + encodedHeaders + '&' + requestText;\n    } else if (this.httpHeadersOverwriteParam_) {\n      httpCors.setHttpHeadersWithOverwriteParam(\n          uri, this.httpHeadersOverwriteParam_, extraHeaders);\n    }  // else - should not happen\n  }\n\n  this.forwardChannelRequestPool_.addRequest(request);\n\n  if (this.blockingHandshake_) {\n    uri.setParameterValue('TYPE', 'init');  // default to blocking in future\n  }\n\n  // Check the option and use GET to enable QUIC 0-RTT\n  if (this.fastHandshake_) {\n    uri.setParameterValue('$req', requestText);\n\n    // enable handshake upgrade\n    uri.setParameterValue('SID', 'null');\n    request.setDecodeInitialResponse();\n\n    request.xmlHttpPost(uri, null, true);  // Send as a GET\n  } else {\n    request.xmlHttpPost(uri, requestText, true);\n  }\n};\n\n\n/**\n * @return {number} The number of raw JSON messages to be encoded\n * with the fast-handshake (GET) request, including zero. If messages are not\n * encoded as raw JSON data, return WebChannelBase.MAX_MAPS_PER_REQUEST_\n * @private\n */\nWebChannelBase.prototype.getMaxNumMessagesForFastHandshake_ = function() {\n  'use strict';\n  let total = 0;\n  for (let i = 0; i < this.outgoingMaps_.length; i++) {\n    const map = this.outgoingMaps_[i];\n    const size = map.getRawDataSize();\n    if (size === undefined) {\n      break;\n    }\n    total += size;\n\n    if (total > WebChannelBase.MAX_CHARS_PER_GET_) {\n      return i;\n    }\n\n    if (total === WebChannelBase.MAX_CHARS_PER_GET_ ||\n        i === this.outgoingMaps_.length - 1) {\n      return i + 1;\n    }\n  }\n\n  return WebChannelBase.MAX_MAPS_PER_REQUEST_;\n};\n\n\n\n/**\n * Makes a forward channel request using XMLHTTP.\n * @param {!ChannelRequest=} opt_retryRequest A failed request to retry.\n * @private\n */\nWebChannelBase.prototype.makeForwardChannelRequest_ = function(\n    opt_retryRequest) {\n  'use strict';\n  let rid;\n  if (opt_retryRequest) {\n    rid = opt_retryRequest.getRequestId();  // Reuse the same RID for a retry\n  } else {\n    rid = this.nextRid_++;\n  }\n\n  const uri = this.forwardChannelUri_.clone();\n  uri.setParameterValue('SID', this.sid_);\n  uri.setParameterValue('RID', rid);\n  uri.setParameterValue('AID', this.lastArrayId_);\n\n  this.addAdditionalParams_(uri);\n\n  if (this.httpHeadersOverwriteParam_ && this.extraHeaders_) {\n    httpCors.setHttpHeadersWithOverwriteParam(\n        uri, this.httpHeadersOverwriteParam_, this.extraHeaders_);\n  }\n\n  const request = ChannelRequest.createChannelRequest(\n      this, this.channelDebug_, this.sid_, rid,\n      this.forwardChannelRetryCount_ + 1);\n\n  if (this.httpHeadersOverwriteParam_ === null) {\n    request.setExtraHeaders(this.extraHeaders_);\n  }\n\n  let requestText;\n  if (opt_retryRequest) {\n    this.requeuePendingMaps_(opt_retryRequest);\n  }\n  requestText =\n      this.dequeueOutgoingMaps_(request, WebChannelBase.MAX_MAPS_PER_REQUEST_);\n\n  // Randomize from 50%-100% of the forward channel timeout to avoid\n  // a big hit if servers happen to die at once.\n  request.setTimeout(\n      Math.round(this.forwardChannelRequestTimeoutMs_ * 0.50) +\n      Math.round(this.forwardChannelRequestTimeoutMs_ * 0.50 * Math.random()));\n  this.forwardChannelRequestPool_.addRequest(request);\n  request.xmlHttpPost(uri, requestText, true);\n};\n\n\n/**\n * Adds additional query parameters from `extraParams_` and `handler_` to the\n * given URI.\n * @param {!goog.Uri} uri The URI to add the parameters to.\n * @private\n */\nWebChannelBase.prototype.addAdditionalParams_ = function(uri) {\n  'use strict';\n  if (this.extraParams_) {\n    goog.object.forEach(this.extraParams_, function(value, key) {\n      'use strict';\n      uri.setParameterValue(key, value);\n    });\n  }\n\n  if (this.handler_) {\n    const params = this.handler_.getAdditionalParams(this);\n    if (params) {\n      goog.structs.forEach(params, function(value, key, coll) {\n        'use strict';\n        uri.setParameterValue(key, value);\n      });\n    }\n  }\n};\n\n\n/**\n * Returns the request text from the outgoing maps and resets it.\n * @param {!ChannelRequest} request The new request for sending the messages.\n * @param {number} maxNum The maximum number of messages to be encoded\n * @return {string} The encoded request text created from all the currently\n *                  queued outgoing maps.\n * @private\n */\nWebChannelBase.prototype.dequeueOutgoingMaps_ = function(request, maxNum) {\n  'use strict';\n  const count = Math.min(this.outgoingMaps_.length, maxNum);\n\n  const badMapHandler = this.handler_ ?\n      goog.bind(this.handler_.badMapError, this.handler_, this) :\n      null;\n  const result = this.wireCodec_.encodeMessageQueue(\n      this.outgoingMaps_, count, badMapHandler);\n\n  request.setPendingMessages(this.outgoingMaps_.splice(0, count));\n\n  return result;\n};\n\n\n/**\n * Requeues unacknowledged sent arrays for retransmission in the next forward\n * channel request.\n * @param {!ChannelRequest} retryRequest A failed request to retry.\n * @private\n */\nWebChannelBase.prototype.requeuePendingMaps_ = function(retryRequest) {\n  'use strict';\n  this.outgoingMaps_ =\n      retryRequest.getPendingMessages().concat(this.outgoingMaps_);\n};\n\n\n/**\n * Ensures there is a backchannel request for receiving data from the server.\n * @private\n */\nWebChannelBase.prototype.ensureBackChannel_ = function() {\n  'use strict';\n  if (this.backChannelRequest_) {\n    // already have one\n    return;\n  }\n\n  if (this.backChannelTimerId_) {\n    // no need to start a new request - one is already scheduled\n    return;\n  }\n\n  this.backChannelAttemptId_ = 1;\n\n  // Use async.run instead of setTimeout(0) to avoid the 1s message delay\n  // from chrome/firefox background tabs\n  // backChannelTimerId_ stays unset, as with setTimeout(0)\n  goog.async.run(this.onStartBackChannelTimer_, this);\n\n  this.backChannelRetryCount_ = 0;\n};\n\n\n/**\n * Schedules a back-channel retry, unless the max retries has been reached.\n * @return {boolean} true iff a retry was scheduled.\n * @private\n */\nWebChannelBase.prototype.maybeRetryBackChannel_ = function() {\n  'use strict';\n  if (this.backChannelRequest_ || this.backChannelTimerId_) {\n    // Should be impossible to be called in this state.\n    this.channelDebug_.severe('Request already in progress');\n    return false;\n  }\n\n  if (this.backChannelRetryCount_ >= this.getBackChannelMaxRetries()) {\n    return false;\n  }\n\n  this.channelDebug_.debug('Going to retry GET');\n\n  this.backChannelAttemptId_++;\n  this.backChannelTimerId_ = requestStats.setTimeout(\n      goog.bind(this.onStartBackChannelTimer_, this),\n      this.getRetryTime_(this.backChannelRetryCount_));\n  this.backChannelRetryCount_++;\n  return true;\n};\n\n\n/**\n * Timer callback for ensureBackChannel_.\n * @private\n */\nWebChannelBase.prototype.onStartBackChannelTimer_ = function() {\n  'use strict';\n  this.backChannelTimerId_ = null;\n  this.startBackChannel_();\n\n  if (!this.detectBufferingProxy_) {\n    return;\n  }\n\n  if (this.bpDetectionDone_) {\n    return;\n  }\n\n  if (this.backChannelRequest_ == null || this.handshakeRttMs_ <= 0) {\n    this.channelDebug_.warning(\n        'Skip bpDetectionTimerId_ ' + this.backChannelRequest_ + ' ' +\n        this.handshakeRttMs_);\n    return;\n  }\n\n  // This goes with each new request until bpDetectionDone_\n  const bpDetectionTimeout = 2 * this.handshakeRttMs_;\n  this.channelDebug_.info('BP detection timer enabled: ' + bpDetectionTimeout);\n\n  this.bpDetectionTimerId_ = requestStats.setTimeout(\n      goog.bind(this.onBpDetectionTimer_, this), bpDetectionTimeout);\n};\n\n\n/**\n * Timer callback for bpDetection.\n * @private\n */\nWebChannelBase.prototype.onBpDetectionTimer_ = function() {\n  'use strict';\n  if (!this.bpDetectionTimerId_) {\n    this.channelDebug_.warning('Invalid operation.');\n    return;\n  }\n\n  this.bpDetectionTimerId_ = null;\n  this.channelDebug_.info('BP detection timeout reached.');\n\n  goog.asserts.assert(\n      this.backChannelRequest_ != null,\n      'Invalid state: no backchannel request');\n\n  // We wait for extra response payload in addition to just headers to\n  // cancel the timer.\n  if (this.backChannelRequest_.getXhr() != null) {\n    const responseData = this.backChannelRequest_.getXhr().getResponseText();\n    if (responseData) {\n      this.channelDebug_.warning(\n          'Timer should have been cancelled : ' + responseData);\n    }\n  }\n\n  // Enable long-polling\n  this.channelDebug_.info(\n      'Buffering proxy detected and switch to long-polling!');\n  this.enableStreaming_ = false;\n\n  this.bpDetectionDone_ = true;\n  requestStats.notifyStatEvent(requestStats.Stat.PROXY);\n\n  // Cancel the request and start a new one immediately\n  this.cancelBackChannelRequest_();\n  this.startBackChannel_();\n};\n\n\n/**\n * Clears the timer for BP detection.\n * @private\n */\nWebChannelBase.prototype.clearBpDetectionTimer_ = function() {\n  'use strict';\n  if (this.bpDetectionTimerId_ != null) {\n    this.channelDebug_.debug('Cancel the BP detection timer.');\n    goog.global.clearTimeout(this.bpDetectionTimerId_);\n    this.bpDetectionTimerId_ = null;\n  }\n};\n\n\n/**\n * Begins a new back channel operation to the server.\n * @private\n */\nWebChannelBase.prototype.startBackChannel_ = function() {\n  'use strict';\n  if (!this.okToMakeRequest_()) {\n    // channel is cancelled\n    return;\n  }\n\n  this.channelDebug_.debug('Creating new HttpRequest');\n  this.backChannelRequest_ = ChannelRequest.createChannelRequest(\n      this, this.channelDebug_, this.sid_, 'rpc', this.backChannelAttemptId_);\n\n  if (this.httpHeadersOverwriteParam_ === null) {\n    this.backChannelRequest_.setExtraHeaders(this.extraHeaders_);\n  }\n\n  this.backChannelRequest_.setReadyStateChangeThrottle(\n      this.readyStateChangeThrottleMs_);\n  const uri = this.backChannelUri_.clone();\n  uri.setParameterValue('RID', 'rpc');\n  uri.setParameterValue('SID', this.sid_);\n  uri.setParameterValue('AID', this.lastArrayId_);\n\n  uri.setParameterValue('CI', this.enableStreaming_ ? '0' : '1');\n  if (!this.enableStreaming_ && this.longPollingTimeout_) {\n    uri.setParameterValue('TO', this.longPollingTimeout_);\n  }\n\n  uri.setParameterValue('TYPE', 'xmlhttp');\n\n  this.addAdditionalParams_(uri);\n\n  if (this.httpHeadersOverwriteParam_ && this.extraHeaders_) {\n    httpCors.setHttpHeadersWithOverwriteParam(\n        uri, this.httpHeadersOverwriteParam_, this.extraHeaders_);\n  }\n\n  if (this.backChannelRequestTimeoutMs_) {\n    this.backChannelRequest_.setTimeout(this.backChannelRequestTimeoutMs_);\n  }\n\n  this.backChannelRequest_.xmlHttpGet(\n      uri, true /* decodeChunks */, this.hostPrefix_);\n\n  this.channelDebug_.debug('New Request created');\n};\n\n\n/**\n * Gives the handler a chance to return an error code and stop channel\n * execution. A handler might want to do this to check that the user is still\n * logged in, for example.\n * @private\n * @return {boolean} If it's OK to make a request.\n */\nWebChannelBase.prototype.okToMakeRequest_ = function() {\n  'use strict';\n  if (this.handler_) {\n    const result = this.handler_.okToMakeRequest(this);\n    if (result != WebChannelBase.Error.OK) {\n      this.channelDebug_.debug(\n          'Handler returned error code from okToMakeRequest');\n      this.signalError_(result);\n      return false;\n    }\n  }\n  return true;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.onFirstByteReceived = function(request, responseText) {\n  'use strict';\n  if (this.backChannelRequest_ == request && this.detectBufferingProxy_) {\n    if (!this.bpDetectionDone_) {\n      this.channelDebug_.info(\n          'Great, no buffering proxy detected. Bytes received: ' +\n          responseText.length);\n      goog.asserts.assert(\n          this.bpDetectionTimerId_, 'Timer should not have been cancelled.');\n      this.clearBpDetectionTimer_();\n      this.bpDetectionDone_ = true;\n      requestStats.notifyStatEvent(requestStats.Stat.NOPROXY);\n    }\n  }\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.onRequestData = function(request, responseText) {\n  'use strict';\n  if (this.state_ == WebChannelBase.State.CLOSED ||\n      (this.backChannelRequest_ != request &&\n       !this.forwardChannelRequestPool_.hasRequest(request))) {\n    // either CLOSED or a request we don't know about (perhaps an old request)\n    return;\n  }\n\n  // first to check if request has been upgraded to backchannel\n  if (!request.isInitialResponseDecoded() &&\n      this.forwardChannelRequestPool_.hasRequest(request) &&\n      this.state_ == WebChannelBase.State.OPENED) {\n    let response;\n    try {\n      response = this.wireCodec_.decodeMessage(responseText);\n    } catch (ex) {\n      response = null;\n    }\n    if (Array.isArray(response) && response.length == 3) {\n      this.handlePostResponse_(/** @type {!Array<?>} */ (response), request);\n      this.onForwardChannelFlushed_();\n    } else {\n      this.channelDebug_.debug('Bad POST response data returned');\n      this.signalError_(WebChannelBase.Error.BAD_RESPONSE);\n    }\n  } else {\n    if (request.isInitialResponseDecoded() ||\n        this.backChannelRequest_ == request) {\n      this.clearDeadBackchannelTimer_();\n    }\n\n    if (!goog.string.isEmptyOrWhitespace(responseText)) {\n      let response = this.wireCodec_.decodeMessage(responseText);\n      this.onInput_(/** @type {!Array<?>} */ (response), request);\n    }\n  }\n};\n\n\n/**\n * Checks if we need call the flush callback.\n *\n * @private\n */\nWebChannelBase.prototype.onForwardChannelFlushed_ = function() {\n  'use strict';\n  if (this.forwardChannelRequestPool_.getRequestCount() <= 1) {\n    if (this.forwardChannelFlushedCallback_) {\n      try {\n        this.forwardChannelFlushedCallback_();\n      } catch (ex) {\n        this.channelDebug_.dumpException(\n            ex, 'Exception from forwardChannelFlushedCallback_ ');\n      }\n      // reset\n      this.forwardChannelFlushedCallback_ = undefined;\n    }\n  }\n};\n\n\n/**\n * Handles a POST response from the server.\n * @param {Array<number>} responseValues The key value pairs in\n *     the POST response.\n * @param {!ChannelRequest} forwardReq The forward channel request that\n * triggers this function call.\n * @private\n */\nWebChannelBase.prototype.handlePostResponse_ = function(\n    responseValues, forwardReq) {\n  'use strict';\n  // The first response value is set to 0 if server is missing backchannel.\n  if (responseValues[0] == 0) {\n    this.handleBackchannelMissing_(forwardReq);\n    return;\n  }\n  this.lastPostResponseArrayId_ = responseValues[1];\n  const outstandingArrays = this.lastPostResponseArrayId_ - this.lastArrayId_;\n  if (0 < outstandingArrays) {\n    const numOutstandingBackchannelBytes = responseValues[2];\n    this.channelDebug_.debug(\n        numOutstandingBackchannelBytes + ' bytes (in ' + outstandingArrays +\n        ' arrays) are outstanding on the BackChannel');\n    if (!this.shouldRetryBackChannel_(numOutstandingBackchannelBytes)) {\n      return;\n    }\n    if (!this.deadBackChannelTimerId_) {\n      // We expect to receive data within 2 RTTs or we retry the backchannel.\n      this.deadBackChannelTimerId_ = requestStats.setTimeout(\n          goog.bind(this.onBackChannelDead_, this),\n          2 * WebChannelBase.RTT_ESTIMATE);\n    }\n  }\n};\n\n\n/**\n * Handles a POST response from the server telling us that it has detected that\n * we have no hanging GET connection.\n * @param {!ChannelRequest} forwardReq The forward channel request that\n * triggers this function call.\n * @private\n * @suppress {strictPrimitiveOperators}\n */\nWebChannelBase.prototype.handleBackchannelMissing_ = function(forwardReq) {\n  'use strict';\n  // As long as the back channel was started before the POST was sent,\n  // we should retry the backchannel. We give a slight buffer of RTT_ESTIMATE\n  // so as not to excessively retry the backchannel\n  this.channelDebug_.debug('Server claims our backchannel is missing.');\n  if (this.backChannelTimerId_) {\n    this.channelDebug_.debug('But we are currently starting the request.');\n    return;\n  } else if (!this.backChannelRequest_) {\n    this.channelDebug_.warning('We do not have a BackChannel established');\n  } else if (\n      this.backChannelRequest_.getRequestStartTime() +\n          WebChannelBase.RTT_ESTIMATE <\n      forwardReq.getRequestStartTime()) {\n    this.clearDeadBackchannelTimer_();\n    this.cancelBackChannelRequest_();\n  } else {\n    return;\n  }\n  this.maybeRetryBackChannel_();\n  requestStats.notifyStatEvent(requestStats.Stat.BACKCHANNEL_MISSING);\n};\n\n\n/**\n * Determines whether we should start the process of retrying a possibly\n * dead backchannel.\n * @param {number} outstandingBytes The number of bytes for which the server has\n *     not yet received acknowledgement.\n * @return {boolean} Whether to start the backchannel retry timer.\n * @private\n */\nWebChannelBase.prototype.shouldRetryBackChannel_ = function(outstandingBytes) {\n  'use strict';\n  // Not too many outstanding bytes, not buffered and not after a retry.\n  return outstandingBytes <\n      WebChannelBase.OUTSTANDING_DATA_BACKCHANNEL_RETRY_CUTOFF &&\n      !this.isBuffered() && this.backChannelRetryCount_ == 0;\n};\n\n\n/**\n * Decides which host prefix should be used, if any.  If there is a handler,\n * allows the handler to validate a host prefix provided by the server, and\n * optionally override it.\n * @param {?string} serverHostPrefix The host prefix provided by the server.\n * @return {?string} The host prefix to actually use, if any. Will return null\n *     if the use of host prefixes was disabled via setAllowHostPrefix().\n * @override\n */\nWebChannelBase.prototype.correctHostPrefix = function(serverHostPrefix) {\n  'use strict';\n  if (this.allowHostPrefix_) {\n    if (this.handler_) {\n      return this.handler_.correctHostPrefix(serverHostPrefix);\n    }\n    return serverHostPrefix;\n  }\n  return null;\n};\n\n\n/**\n * Handles the timer that indicates that our backchannel is no longer able to\n * successfully receive data from the server.\n * @private\n */\nWebChannelBase.prototype.onBackChannelDead_ = function() {\n  'use strict';\n  if (this.deadBackChannelTimerId_ != null) {\n    this.deadBackChannelTimerId_ = null;\n    this.cancelBackChannelRequest_();\n    this.maybeRetryBackChannel_();\n    requestStats.notifyStatEvent(requestStats.Stat.BACKCHANNEL_DEAD);\n  }\n};\n\n\n/**\n * Clears the timer that indicates that our backchannel is no longer able to\n * successfully receive data from the server.\n * @private\n */\nWebChannelBase.prototype.clearDeadBackchannelTimer_ = function() {\n  'use strict';\n  if (this.deadBackChannelTimerId_ != null) {\n    goog.global.clearTimeout(this.deadBackChannelTimerId_);\n    this.deadBackChannelTimerId_ = null;\n  }\n};\n\n\n/**\n * Returns whether or not the given error/status combination is fatal or not.\n * On fatal errors we immediately close the session rather than retrying the\n * failed request.\n * @param {?ChannelRequest.Error} error The error code for the\n * failed request.\n * @param {number} statusCode The last HTTP status code.\n * @return {boolean} Whether or not the error is fatal.\n * @private\n */\nWebChannelBase.isFatalError_ = function(error, statusCode) {\n  'use strict';\n  return error == ChannelRequest.Error.UNKNOWN_SESSION_ID ||\n      (error == ChannelRequest.Error.STATUS && statusCode > 0);\n};\n\n\n/**\n * @override\n * @suppress {strictPrimitiveOperators}\n */\nWebChannelBase.prototype.onRequestComplete = function(request) {\n  'use strict';\n  this.channelDebug_.debug('Request complete');\n  let type;\n  let pendingMessages = null;\n  if (this.backChannelRequest_ == request) {\n    this.clearDeadBackchannelTimer_();\n    this.clearBpDetectionTimer_();\n    this.backChannelRequest_ = null;\n    type = WebChannelBase.ChannelType_.BACK_CHANNEL;\n  } else if (this.forwardChannelRequestPool_.hasRequest(request)) {\n    pendingMessages = request.getPendingMessages();\n    this.forwardChannelRequestPool_.removeRequest(request);\n    type = WebChannelBase.ChannelType_.FORWARD_CHANNEL;\n  } else {\n    // return if it was an old request from a previous session\n    return;\n  }\n\n  if (this.state_ == WebChannelBase.State.CLOSED) {\n    return;\n  }\n\n  if (request.getSuccess()) {\n    if (type == WebChannelBase.ChannelType_.FORWARD_CHANNEL) {\n      const size = request.getPostData() ? request.getPostData().length : 0;\n      requestStats.notifyTimingEvent(\n          size, Date.now() - request.getRequestStartTime(),\n          this.forwardChannelRetryCount_);\n      this.ensureForwardChannel_();\n      this.onSuccess_(request);\n    } else {  // i.e., back-channel\n      this.ensureBackChannel_();\n    }\n    return;\n  }\n  // Else unsuccessful. Fall through.\n\n  const lastStatusCode = request.getLastStatusCode();\n  const lastError = request.getLastError();\n  if (!WebChannelBase.isFatalError_(lastError, lastStatusCode)) {\n    // Maybe retry.\n    const self = this;\n    this.channelDebug_.debug(function() {\n      'use strict';\n      return 'Maybe retrying, last error: ' +\n          ChannelRequest.errorStringFromCode(\n              lastError, self.errorResponseStatusCode_);\n    });\n    if (type == WebChannelBase.ChannelType_.FORWARD_CHANNEL) {\n      if (this.maybeRetryForwardChannel_(request)) {\n        return;\n      }\n    }\n    if (type == WebChannelBase.ChannelType_.BACK_CHANNEL) {\n      if (this.maybeRetryBackChannel_()) {\n        return;\n      }\n    }\n    // Else exceeded max retries. Fall through.\n    this.channelDebug_.debug('Exceeded max number of retries');\n  } else {\n    // Else fatal error. Fall through and mark the pending maps as failed.\n    this.channelDebug_.debug('Not retrying due to error type');\n\n    if (lastStatusCode > 200) {\n      this.errorResponseStatusCode_ = request.getLastStatusCode();\n      this.errorResponseHeaders_ = request.getErrorResponseHeaders();\n    }\n  }\n\n  // Abort the channel now\n\n  // Record pending messages from the failed request\n  if (pendingMessages && pendingMessages.length > 0) {\n    this.forwardChannelRequestPool_.addPendingMessages(pendingMessages);\n  }\n\n  this.channelDebug_.debug('Error: HTTP request failed');\n  switch (lastError) {\n    case ChannelRequest.Error.NO_DATA:\n      this.signalError_(WebChannelBase.Error.NO_DATA);\n      break;\n    case ChannelRequest.Error.BAD_DATA:\n      this.signalError_(WebChannelBase.Error.BAD_DATA);\n      break;\n    case ChannelRequest.Error.UNKNOWN_SESSION_ID:\n      this.signalError_(WebChannelBase.Error.UNKNOWN_SESSION_ID);\n      break;\n    default:\n      this.signalError_(WebChannelBase.Error.REQUEST_FAILED);\n      break;\n  }\n};\n\n\n/**\n * @param {number} retryCount Number of retries so far.\n * @return {number} Time in ms before firing next retry request.\n * @private\n */\nWebChannelBase.prototype.getRetryTime_ = function(retryCount) {\n  'use strict';\n  let retryTime = this.baseRetryDelayMs_ +\n      Math.floor(Math.random() * this.retryDelaySeedMs_);\n  if (!this.isActive()) {\n    this.channelDebug_.debug('Inactive channel');\n    retryTime = retryTime * WebChannelBase.INACTIVE_CHANNEL_RETRY_FACTOR;\n  }\n  // Backoff for subsequent retries\n  retryTime *= retryCount;\n  return retryTime;\n};\n\n\n/**\n * @param {number} baseDelayMs The base part of the retry delay, in ms.\n * @param {number} delaySeedMs A random delay between 0 and this is added to\n *     the base part.\n */\nWebChannelBase.prototype.setRetryDelay = function(baseDelayMs, delaySeedMs) {\n  'use strict';\n  this.baseRetryDelayMs_ = baseDelayMs;\n  this.retryDelaySeedMs_ = delaySeedMs;\n};\n\n\n/**\n * Apply any handshake control headers.\n * @param {!ChannelRequest} request The underlying request object\n * @private\n */\nWebChannelBase.prototype.applyControlHeaders_ = function(request) {\n  'use strict';\n  const xhr = request.getXhr();\n  if (xhr) {\n    const clientProtocol =\n        xhr.getStreamingResponseHeader(WebChannel.X_CLIENT_WIRE_PROTOCOL);\n    if (clientProtocol) {\n      this.forwardChannelRequestPool_.applyClientProtocol(clientProtocol);\n    }\n\n    if (this.getHttpSessionIdParam()) {\n      const httpSessionIdHeader =\n          xhr.getStreamingResponseHeader(WebChannel.X_HTTP_SESSION_ID);\n      if (httpSessionIdHeader) {\n        this.setHttpSessionId(httpSessionIdHeader);\n        // update the cached uri\n        const httpSessionIdParam = this.getHttpSessionIdParam();\n\n        this.forwardChannelUri_.setParameterValue(\n            /** @type {string} */ (httpSessionIdParam),  // never null\n            httpSessionIdHeader);\n      } else {\n        this.channelDebug_.warning(\n            'Missing X_HTTP_SESSION_ID in the handshake response');\n      }\n    }\n  }\n};\n\n\n/**\n * Processes the data returned by the server.\n * @param {!Array<!Array<?>>} respArray The response array returned\n *     by the server.\n * @param {!ChannelRequest} request The underlying request object\n * @private\n * @suppress {strictPrimitiveOperators}\n */\nWebChannelBase.prototype.onInput_ = function(respArray, request) {\n  'use strict';\n  const batch =\n      this.handler_ && this.handler_.channelHandleMultipleArrays ? [] : null;\n  for (let i = 0; i < respArray.length; i++) {\n    let nextArray = respArray[i];\n    this.lastArrayId_ = nextArray[0];\n    nextArray = nextArray[1];\n    if (this.state_ == WebChannelBase.State.OPENING) {\n      if (nextArray[0] == 'c') {\n        this.sid_ = nextArray[1];\n        this.hostPrefix_ = this.correctHostPrefix(nextArray[2]);\n\n        const negotiatedVersion = nextArray[3];\n        if (negotiatedVersion != null) {\n          this.channelVersion_ = negotiatedVersion;\n          this.channelDebug_.info('VER=' + this.channelVersion_);\n        }\n\n        const negotiatedServerVersion = nextArray[4];\n        if (negotiatedServerVersion != null) {\n          this.serverVersion_ = negotiatedServerVersion;\n          this.channelDebug_.info('SVER=' + this.serverVersion_);\n        }\n\n        // CVER=22\n        const serverKeepaliveMs = nextArray[5];\n        if (serverKeepaliveMs != null &&\n            typeof serverKeepaliveMs === 'number' && serverKeepaliveMs > 0) {\n          const timeout = 1.5 * serverKeepaliveMs;\n          this.backChannelRequestTimeoutMs_ = timeout;\n          this.channelDebug_.info('backChannelRequestTimeoutMs_=' + timeout);\n        }\n\n        this.applyControlHeaders_(request);\n\n        this.state_ = WebChannelBase.State.OPENED;\n        if (this.handler_) {\n          this.handler_.channelOpened(this);\n        }\n\n        if (this.detectBufferingProxy_) {\n          this.handshakeRttMs_ = Date.now() - request.getRequestStartTime();\n          this.channelDebug_.info(\n              'Handshake RTT: ' + this.handshakeRttMs_ + 'ms');\n        }\n\n        this.startBackchannelAfterHandshake_(request);\n\n        if (this.outgoingMaps_.length > 0) {\n          this.ensureForwardChannel_();\n        }\n      } else if (nextArray[0] == 'stop' || nextArray[0] == 'close') {\n        // treat close also as an abort\n        this.signalError_(WebChannelBase.Error.STOP);\n      }\n    } else if (this.state_ == WebChannelBase.State.OPENED) {\n      if (nextArray[0] == 'stop' || nextArray[0] == 'close') {\n        if (batch && !(batch.length === 0)) {\n          this.handler_.channelHandleMultipleArrays(this, batch);\n          batch.length = 0;\n        }\n        if (nextArray[0] == 'stop') {\n          this.signalError_(WebChannelBase.Error.STOP);\n        } else {\n          this.disconnect();\n        }\n      } else if (nextArray[0] == 'noop') {\n        // ignore - noop to keep connection happy\n      } else {\n        if (batch) {\n          batch.push(nextArray);\n        } else if (this.handler_) {\n          this.handler_.channelHandleArray(this, nextArray);\n        }\n      }\n      // We have received useful data on the back-channel, so clear its retry\n      // count. We do this because back-channels by design do not complete\n      // quickly, so on a flaky connection we could have many fail to complete\n      // fully but still deliver a lot of data before they fail. We don't want\n      // to count such failures towards the retry limit, because we don't want\n      // to give up on a session if we can still receive data.\n      this.backChannelRetryCount_ = 0;\n    }\n  }\n  if (batch && !(batch.length === 0)) {\n    this.handler_.channelHandleMultipleArrays(this, batch);\n  }\n};\n\n\n/**\n * Starts the backchannel after the handshake.\n *\n * @param {!ChannelRequest} request The underlying request object\n * @private\n */\nWebChannelBase.prototype.startBackchannelAfterHandshake_ = function(request) {\n  'use strict';\n  this.backChannelUri_ = this.getBackChannelUri(\n      this.hostPrefix_, /** @type {string} */ (this.path_));\n\n  if (request.isInitialResponseDecoded()) {\n    this.channelDebug_.debug('Upgrade the handshake request to a backchannel.');\n    this.forwardChannelRequestPool_.removeRequest(request);\n    request.resetTimeout(this.backChannelRequestTimeoutMs_);\n    this.backChannelRequest_ = request;\n  } else {\n    this.ensureBackChannel_();\n  }\n};\n\n\n/**\n * Helper to ensure the channel is in the expected state.\n * @param {...number} var_args The channel must be in one of the indicated\n *     states.\n * @private\n */\nWebChannelBase.prototype.ensureInState_ = function(var_args) {\n  'use strict';\n  goog.asserts.assert(\n      goog.array.contains(arguments, this.state_),\n      'Unexpected channel state: %s', this.state_);\n};\n\n\n/**\n * Signals an error has occurred.\n * @param {WebChannelBase.Error} error The error code for the failure.\n * @private\n */\nWebChannelBase.prototype.signalError_ = function(error) {\n  'use strict';\n  this.channelDebug_.info('Error code ' + error);\n  if (error == WebChannelBase.Error.REQUEST_FAILED) {\n    if (ENABLE_GOOGLE_COM_PING) {\n      // Create a separate Internet connection to check\n      // if it's a server error or user's network error.\n      let imageUri = null;\n      if (this.handler_) {\n        imageUri = this.handler_.getNetworkTestImageUri(this);\n      }\n      netUtils.testNetwork(\n          goog.bind(this.testNetworkCallback_, this), imageUri);\n    }\n  } else {\n    requestStats.notifyStatEvent(requestStats.Stat.ERROR_OTHER);\n  }\n  this.onError_(error);\n};\n\n\n/**\n * Callback for netUtils.testNetwork during error handling.\n * @param {boolean} networkUp Whether the network is up.\n * @private\n */\nWebChannelBase.prototype.testNetworkCallback_ = function(networkUp) {\n  'use strict';\n  if (networkUp) {\n    this.channelDebug_.info('Successfully pinged google.com');\n    requestStats.notifyStatEvent(requestStats.Stat.ERROR_OTHER);\n  } else {\n    this.channelDebug_.info('Failed to ping google.com');\n    requestStats.notifyStatEvent(requestStats.Stat.ERROR_NETWORK);\n    // Do not call onError_ again to eliminate duplicated Error events.\n  }\n};\n\n\n/**\n * Called when messages have been successfully sent from the queue.\n * @param {!ChannelRequest} request The request object\n * @private\n */\nWebChannelBase.prototype.onSuccess_ = function(request) {\n  'use strict';\n  if (this.handler_) {\n    this.handler_.channelSuccess(this, request);\n  }\n};\n\n\n/**\n * Called when we've determined the final error for a channel. It closes the\n * notifiers the handler of the error and closes the channel.\n * @param {WebChannelBase.Error} error  The error code for the failure.\n * @private\n */\nWebChannelBase.prototype.onError_ = function(error) {\n  'use strict';\n  this.channelDebug_.debug('HttpChannel: error - ' + error);\n  this.state_ = WebChannelBase.State.CLOSED;\n  if (this.handler_) {\n    this.handler_.channelError(this, error);\n  }\n  this.onClose_();\n  this.cancelRequests_();\n};\n\n\n/**\n * Called when the channel has been closed. It notifiers the handler of the\n * event, and reports any pending or undelivered maps.\n * @private\n */\nWebChannelBase.prototype.onClose_ = function() {\n  'use strict';\n  this.state_ = WebChannelBase.State.CLOSED;\n  this.nonAckedMapsAtChannelClose_ = [];\n  if (this.handler_) {\n    const pendingMessages =\n        this.forwardChannelRequestPool_.getPendingMessages();\n\n    if (pendingMessages.length == 0 && this.outgoingMaps_.length == 0) {\n      this.handler_.channelClosed(this);\n    } else {\n      this.channelDebug_.debug(\n          () => 'Number of undelivered maps' +\n              ', pending: ' + pendingMessages.length +\n              ', outgoing: ' + this.outgoingMaps_.length);\n\n      goog.array.extend(this.nonAckedMapsAtChannelClose_, pendingMessages);\n      goog.array.extend(this.nonAckedMapsAtChannelClose_, this.outgoingMaps_);\n\n      this.forwardChannelRequestPool_.clearPendingMessages();\n\n      const copyOfUndeliveredMaps = goog.array.clone(this.outgoingMaps_);\n      this.outgoingMaps_.length = 0;\n\n      this.handler_.channelClosed(this, pendingMessages, copyOfUndeliveredMaps);\n    }\n  }\n};\n\n/**\n * @return {!Array<!Wire.QueuedMap>} Returns the list of non-acked maps, both\n * during an active channel or after the channel is closed. Refer to the\n * `getNonAckedMessages()` API for definitions of non-acked messages.\n */\nWebChannelBase.prototype.getNonAckedMaps = function() {\n  if (this.state_ == WebChannelBase.State.CLOSED) {\n    goog.asserts.assert(\n        this.nonAckedMapsAtChannelClose_ != null,\n        'nonAckedMapsAtChannelClose_ is not set after channel close.');\n    return this.nonAckedMapsAtChannelClose_;\n  }\n\n  // The underlying message objects are not cloned and thus exposes a mutability\n  // risk, but is chosen to make strict equality (i.e. ===) checks possible for\n  // callers.\n  let unAckedMaps = [];\n  goog.array.extend(\n      unAckedMaps, this.forwardChannelRequestPool_.getPendingMessages());\n  goog.array.extend(unAckedMaps, this.outgoingMaps_);\n\n  return unAckedMaps;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.getForwardChannelUri = function(path) {\n  'use strict';\n  const uri = this.createDataUri(null, path);\n  this.channelDebug_.debug('GetForwardChannelUri: ' + uri);\n  return uri;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.getConnectionState = function() {\n  'use strict';\n  return this.connState_;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.getBackChannelUri = function(hostPrefix, path) {\n  'use strict';\n  const uri = this.createDataUri(\n      this.shouldUseSecondaryDomains() ? hostPrefix : null, path);\n  this.channelDebug_.debug('GetBackChannelUri: ' + uri);\n  return uri;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.createDataUri = function(\n    hostPrefix, path, opt_overridePort) {\n  'use strict';\n  let uri = goog.Uri.parse(path);\n  const uriAbsolute = (uri.getDomain() != '');\n  if (uriAbsolute) {\n    if (hostPrefix) {\n      uri.setDomain(hostPrefix + '.' + uri.getDomain());\n    }\n\n    uri.setPort(opt_overridePort || uri.getPort());\n  } else {\n    const locationPage = goog.global.location;\n    let hostName;\n    if (hostPrefix) {\n      hostName = hostPrefix + '.' + locationPage.hostname;\n    } else {\n      hostName = locationPage.hostname;\n    }\n\n    const port = opt_overridePort || +locationPage.port;\n\n    uri = goog.Uri.create(locationPage.protocol, null, hostName, port, path);\n  }\n\n  const param = this.getHttpSessionIdParam();\n  const value = this.getHttpSessionId();\n  if (param && value) {\n    uri.setParameterValue(param, value);\n  }\n\n  // Add the protocol version to the URI.\n  uri.setParameterValue('VER', this.channelVersion_);\n\n  this.addAdditionalParams_(uri);\n\n  return uri;\n};\n\n/**\n * @override\n * @param {?string} hostPrefix The host prefix, if we need an XhrIo object\n *     capable of calling a secondary domain.\n * @param {boolean=} isStreaming Whether or not fetch/streams are enabled for\n *     the underlying HTTP request.\n * @return {!goog.net.XhrIo} A new XhrIo object.\n */\nWebChannelBase.prototype.createXhrIo = function(hostPrefix, isStreaming) {\n  'use strict';\n  if (hostPrefix && !this.supportsCrossDomainXhrs_) {\n    throw new Error('Can\\'t create secondary domain capable XhrIo object.');\n  }\n  let xhr;\n  if (this.usesFetchStreams_ && !this.xmlHttpFactory_) {\n    xhr = new goog.net.XhrIo(\n        new goog.net.FetchXmlHttpFactory({streamBinaryChunks: isStreaming}));\n  } else {\n    xhr = new goog.net.XhrIo(this.xmlHttpFactory_);\n  }\n  xhr.setWithCredentials(this.supportsCrossDomainXhrs_);\n  return xhr;\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.isActive = function() {\n  'use strict';\n  return !!this.handler_ && this.handler_.isActive(this);\n};\n\n\n/**\n * @override\n */\nWebChannelBase.prototype.shouldUseSecondaryDomains = function() {\n  'use strict';\n  return this.supportsCrossDomainXhrs_;\n};\n\n\n/**\n * Sets (overwrites) the forward channel flush callback.\n *\n * @param {function()} callback The callback to be invoked.\n */\nWebChannelBase.prototype.setForwardChannelFlushCallback = function(callback) {\n  'use strict';\n  this.forwardChannelFlushedCallback_ = callback;\n};\n\n\n/**\n * Abstract base class for the channel handler\n * @constructor\n * @struct\n */\nWebChannelBase.Handler = function() {};\n\n\n/**\n * Callback handler for when a batch of response arrays is received from the\n * server. When null, batched dispatching is disabled.\n * @type {?function(!WebChannelBase, !Array<!Array<?>>)}\n */\nWebChannelBase.Handler.prototype.channelHandleMultipleArrays = null;\n\n\n/**\n * Whether it's okay to make a request to the server. A handler can return\n * false if the channel should fail. For example, if the user has logged out,\n * the handler may want all requests to fail immediately.\n * @param {WebChannelBase} channel The channel.\n * @return {WebChannelBase.Error} An error code. The code should\n * return WebChannelBase.Error.OK to indicate it's okay. Any other\n * error code will cause a failure.\n */\nWebChannelBase.Handler.prototype.okToMakeRequest = function(channel) {\n  'use strict';\n  return WebChannelBase.Error.OK;\n};\n\n\n/**\n * Indicates the WebChannel has successfully negotiated with the server\n * and can now send and receive data.\n * @param {WebChannelBase} channel The channel.\n */\nWebChannelBase.Handler.prototype.channelOpened = function(channel) {};\n\n\n/**\n * New input is available for the application to process.\n *\n * @param {WebChannelBase} channel The channel.\n * @param {!Array<?>|!Object} array The data array.\n */\nWebChannelBase.Handler.prototype.channelHandleArray = function(\n    channel, array) {};\n\n\n/**\n * Indicates messages that have been successfully sent on the channel.\n *\n * @param {WebChannelBase} channel The channel.\n * @param {!ChannelRequest} request The request object that contains\n *     the pending messages that have been successfully delivered to the server.\n */\nWebChannelBase.Handler.prototype.channelSuccess = function(channel, request) {};\n\n\n/**\n * Indicates an error occurred on the WebChannel.\n *\n * @param {WebChannelBase} channel The channel.\n * @param {WebChannelBase.Error} error The error code.\n */\nWebChannelBase.Handler.prototype.channelError = function(channel, error) {};\n\n\n/**\n * Indicates the WebChannel is closed. Also notifies about which maps,\n * if any, that may not have been delivered to the server.\n * @param {WebChannelBase} channel The channel.\n * @param {Array<Wire.QueuedMap>=} opt_pendingMaps The\n *     array of pending maps, which may or may not have been delivered to the\n *     server.\n * @param {Array<Wire.QueuedMap>=} opt_undeliveredMaps\n *     The array of undelivered maps, which have definitely not been delivered\n *     to the server.\n */\nWebChannelBase.Handler.prototype.channelClosed = function(\n    channel, opt_pendingMaps, opt_undeliveredMaps) {};\n\n\n/**\n * Gets any parameters that should be added at the time another connection is\n * made to the server.\n * @param {WebChannelBase} channel The channel.\n * @return {!Object} Extra parameter keys and values to add to the requests.\n */\nWebChannelBase.Handler.prototype.getAdditionalParams = function(channel) {\n  'use strict';\n  return {};\n};\n\n\n/**\n * Gets the URI of an image that can be used to test network connectivity.\n * @param {WebChannelBase} channel The channel.\n * @return {goog.Uri?} A custom URI to load for the network test.\n */\nWebChannelBase.Handler.prototype.getNetworkTestImageUri = function(channel) {\n  'use strict';\n  return null;\n};\n\n\n/**\n * Gets whether this channel is currently active. This is used to determine the\n * length of time to wait before retrying.\n * @param {WebChannelBase} channel The channel.\n * @return {boolean} Whether the channel is currently active.\n */\nWebChannelBase.Handler.prototype.isActive = function(channel) {\n  'use strict';\n  return true;\n};\n\n/**\n * Whether or not this channel uses WHATWG Fetch/streams.\n * @override\n * @return {boolean}\n */\nWebChannelBase.prototype.usesFetchStreams = function() {\n  'use strict';\n  return this.usesFetchStreams_;\n};\n\n\n/**\n * Called by the channel if enumeration of the map throws an exception.\n * @param {WebChannelBase} channel The channel.\n * @param {Object} map The map that can't be enumerated.\n */\nWebChannelBase.Handler.prototype.badMapError = function(channel, map) {};\n\n\n/**\n * Allows the handler to override a host prefix provided by the server. Will\n * be called whenever the channel has received such a prefix and is considering\n * its use.\n * @param {?string} serverHostPrefix The host prefix provided by the server.\n * @return {?string} The host prefix the client should use.\n */\nWebChannelBase.Handler.prototype.correctHostPrefix = function(\n    serverHostPrefix) {\n  'use strict';\n  return serverHostPrefix;\n};\n});  // goog.scope\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview The dispose method is used to clean up references and\n * resources.\n */\n\ngoog.module('goog.dispose');\ngoog.module.declareLegacyNamespace();\n\n/**\n * Calls `dispose` on the argument if it supports it. If obj is not an\n *     object with a dispose() method, this is a no-op.\n * @param {*} obj The object to dispose of.\n */\nfunction dispose(obj) {\n  if (obj && typeof obj.dispose == 'function') {\n    obj.dispose();\n  }\n}\nexports = dispose;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Codec functions of the v8 wire protocol. Eventually we'd want\n * to support pluggable wire-format to improve wire efficiency and to enable\n * binary encoding. Such support will require an interface class, which\n * will be added later.\n *\n */\n\n\ngoog.provide('goog.labs.net.webChannel.WireV8');\n\ngoog.require('goog.asserts');\ngoog.require('goog.collections.maps');\ngoog.require('goog.json');\ngoog.require('goog.json.NativeJsonProcessor');\ngoog.require('goog.labs.net.webChannel.Wire');\ngoog.require('goog.structs');\ngoog.requireType('goog.string.Parser');\n\n\n\n/**\n * The v8 codec class.\n *\n * @constructor\n * @struct\n */\ngoog.labs.net.webChannel.WireV8 = function() {\n  'use strict';\n  /**\n   * Parser for a response payload. The parser should return an array.\n   * @private {!goog.string.Parser}\n   */\n  this.parser_ = new goog.json.NativeJsonProcessor();\n};\n\n\ngoog.scope(function() {\n'use strict';\nconst WireV8 = goog.labs.net.webChannel.WireV8;\nconst Wire = goog.labs.net.webChannel.Wire;\n\n\n/**\n * Encodes a standalone message into the wire format.\n *\n * May throw exception if the message object contains any invalid elements.\n *\n * @param {!Object|!goog.collections.maps.MapLike} message The message data.\n *     V8 only support JS objects (or Map).\n * @param {!Array<string>} buffer The text buffer to write the message to.\n * @param {string=} opt_prefix The prefix for each field of the object.\n */\nWireV8.prototype.encodeMessage = function(message, buffer, opt_prefix) {\n  'use strict';\n  const prefix = opt_prefix || '';\n  try {\n    goog.structs.forEach(message, function(value, key) {\n      'use strict';\n      let encodedValue = value;\n      if (goog.isObject(value)) {\n        encodedValue = goog.json.serialize(value);\n      }  // keep the fast-path for primitive types\n      buffer.push(prefix + key + '=' + encodeURIComponent(encodedValue));\n    });\n  } catch (ex) {\n    // We send a map here because lots of the retry logic relies on map IDs,\n    // so we have to send something (possibly redundant).\n    buffer.push(\n        prefix + 'type' +\n        '=' + encodeURIComponent('_badmap'));\n    throw ex;\n  }\n};\n\n\n/**\n * Encodes all the buffered messages of the forward channel.\n *\n * @param {!Array<Wire.QueuedMap>} messageQueue The message data.\n *     V8 only support JS objects.\n * @param {number} count The number of messages to be encoded.\n * @param {?function(!Object)} badMapHandler Callback for bad messages.\n * @return {string} the encoded messages\n */\nWireV8.prototype.encodeMessageQueue = function(\n    messageQueue, count, badMapHandler) {\n  'use strict';\n  let offset = -1;\n  while (true) {\n    const sb = ['count=' + count];\n    // To save a bit of bandwidth, specify the base mapId and the rest as\n    // offsets from it.\n    if (offset == -1) {\n      if (count > 0) {\n        offset = messageQueue[0].mapId;\n        sb.push('ofs=' + offset);\n      } else {\n        offset = 0;\n      }\n    } else {\n      sb.push('ofs=' + offset);\n    }\n    let done = true;\n    for (let i = 0; i < count; i++) {\n      let mapId = messageQueue[i].mapId;\n      const map = messageQueue[i].map;\n      mapId -= offset;\n      if (mapId < 0) {\n        // redo the encoding in case of retry/reordering, plus extra space\n        offset = Math.max(0, messageQueue[i].mapId - 100);\n        done = false;\n        continue;\n      }\n      try {\n        this.encodeMessage(map, sb, 'req' + mapId + '_');\n      } catch (ex) {\n        if (badMapHandler) {\n          badMapHandler(map);\n        }\n      }\n    }\n    if (done) {\n      return sb.join('&');\n    }\n  }\n};\n\n\n/**\n * Decodes a standalone message received from the wire. May throw exception\n * if text is ill-formatted.\n *\n * Must be valid JSON as it is insecure to use eval() to decode JS literals;\n * and eval() is disallowed in Chrome apps too.\n *\n * Invalid JS literals include null array elements, quotas etc.\n *\n * @param {string} messageText The string content as received from the wire.\n * @return {*} The decoded message object.\n */\nWireV8.prototype.decodeMessage = function(messageText) {\n  'use strict';\n  const response = this.parser_.parse(messageText);\n  goog.asserts.assert(Array.isArray(response));  // throw exception\n  return response;\n};\n});  // goog.scope\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview A pool of forward channel requests to enable real-time\n * messaging from the client to server.\n *\n */\n\ngoog.module('goog.labs.net.webChannel.ForwardChannelRequestPool');\n\ngoog.module.declareLegacyNamespace();\n\nconst ChannelRequest = goog.require('goog.labs.net.webChannel.ChannelRequest');\nconst Wire = goog.require('goog.labs.net.webChannel.Wire');\nconst array = goog.require('goog.array');\nconst googString = goog.require('goog.string');\n\n\n/**\n * This class represents the state of all forward channel requests.\n *\n * @param {number=} opt_maxPoolSize The maximum pool size.\n *\n * @struct @constructor @final\n */\nconst ForwardChannelRequestPool = function(opt_maxPoolSize) {\n  /**\n   * The max pool size as configured.\n   *\n   * @private {number}\n   */\n  this.maxPoolSizeConfigured_ =\n      opt_maxPoolSize || ForwardChannelRequestPool.MAX_POOL_SIZE_;\n\n  /**\n   * The current size limit of the request pool. This limit is meant to be\n   * read-only after the channel is fully opened.\n   *\n   * If SPDY or HTTP2 is enabled, set it to the max pool size, which is also\n   * configurable.\n   *\n   * @private {number}\n   */\n  this.maxSize_ = ForwardChannelRequestPool.isSpdyOrHttp2Enabled_() ?\n      this.maxPoolSizeConfigured_ :\n      1;\n\n  /**\n   * The container for all the pending request objects.\n   *\n   * @private {?Set<?ChannelRequest>}\n   */\n  this.requestPool_ = null;\n\n  if (this.maxSize_ > 1) {\n    this.requestPool_ = new Set();\n  }\n\n  /**\n   * The single request object when the pool size is limited to one.\n   *\n   * @private {?ChannelRequest}\n   */\n  this.request_ = null;\n\n  /**\n   * Saved pending messages when the pool is cancelled.\n   *\n   * @private {!Array<Wire.QueuedMap>}\n   */\n  this.pendingMessages_ = [];\n};\n\n\n/**\n * The default size limit of the request pool.\n *\n * @private {number}\n */\nForwardChannelRequestPool.MAX_POOL_SIZE_ = 10;\n\n\n/**\n * @return {boolean} True if SPDY or HTTP2 is enabled. Uses chrome-specific APIs\n *     as a fallback and will always return false for other browsers where\n *     PerformanceNavigationTiming is not available.\n * @private\n */\nForwardChannelRequestPool.isSpdyOrHttp2Enabled_ = function() {\n  if (goog.global.PerformanceNavigationTiming) {\n    const entrys = /** @type {!Array<!PerformanceNavigationTiming>} */ (\n        goog.global.performance.getEntriesByType('navigation'));\n    return entrys.length > 0 &&\n        (entrys[0].nextHopProtocol == 'hq' ||\n         entrys[0].nextHopProtocol == 'h2');\n  }\n  return !!(\n      goog.global.chrome && goog.global.chrome.loadTimes &&\n      goog.global.chrome.loadTimes() &&\n      goog.global.chrome.loadTimes().wasFetchedViaSpdy);\n};\n\n\n/**\n * Once we know the client protocol (from the handshake), check if we need\n * enable the request pool accordingly. This is more robust than using\n * browser-internal APIs (specific to Chrome).\n *\n * @param {string} clientProtocol The client protocol\n */\nForwardChannelRequestPool.prototype.applyClientProtocol = function(\n    clientProtocol) {\n  if (this.requestPool_) {\n    return;\n  }\n\n  if (googString.contains(clientProtocol, 'spdy') ||\n      googString.contains(clientProtocol, 'quic') ||\n      googString.contains(clientProtocol, 'h2')) {\n    this.maxSize_ = this.maxPoolSizeConfigured_;\n    this.requestPool_ = new Set();\n    if (this.request_) {\n      this.addRequest(this.request_);\n      this.request_ = null;\n    }\n  }\n};\n\n\n/**\n * @return {boolean} True if the pool is full.\n */\nForwardChannelRequestPool.prototype.isFull = function() {\n  if (this.request_) {\n    return true;\n  }\n\n  if (this.requestPool_) {\n    return this.requestPool_.size >= this.maxSize_;\n  }\n\n  return false;\n};\n\n\n/**\n * @return {number} The current size limit.\n */\nForwardChannelRequestPool.prototype.getMaxSize = function() {\n  return this.maxSize_;\n};\n\n\n/**\n * @return {number} The number of pending requests in the pool.\n */\nForwardChannelRequestPool.prototype.getRequestCount = function() {\n  if (this.request_) {\n    return 1;\n  }\n\n  if (this.requestPool_) {\n    return this.requestPool_.size;\n  }\n\n  return 0;\n};\n\n\n/**\n * @param {ChannelRequest} req The channel request.\n * @return {boolean} True if the request is a included inside the pool.\n */\nForwardChannelRequestPool.prototype.hasRequest = function(req) {\n  if (this.request_) {\n    return this.request_ == req;\n  }\n\n  if (this.requestPool_) {\n    return this.requestPool_.has(req);\n  }\n\n  return false;\n};\n\n\n/**\n * Adds a new request to the pool.\n *\n * @param {!ChannelRequest} req The new channel request.\n */\nForwardChannelRequestPool.prototype.addRequest = function(req) {\n  if (this.requestPool_) {\n    this.requestPool_.add(req);\n  } else {\n    this.request_ = req;\n  }\n};\n\n\n/**\n * Removes the given request from the pool.\n *\n * @param {ChannelRequest} req The channel request.\n * @return {boolean} Whether the request has been removed from the pool.\n */\nForwardChannelRequestPool.prototype.removeRequest = function(req) {\n  if (this.request_ && this.request_ == req) {\n    this.request_ = null;\n    return true;\n  }\n\n  if (this.requestPool_ && this.requestPool_.has(req)) {\n    this.requestPool_.delete(req);\n    return true;\n  }\n\n  return false;\n};\n\n\n/**\n * Clears the pool and cancel all the pending requests.\n */\nForwardChannelRequestPool.prototype.cancel = function() {\n  // save any pending messages\n  this.pendingMessages_ = this.getPendingMessages();\n\n  if (this.request_) {\n    this.request_.cancel();\n    this.request_ = null;\n    return;\n  }\n\n  if (this.requestPool_ && this.requestPool_.size !== 0) {\n    for (const val of this.requestPool_.values()) {\n      val.cancel();\n    }\n    this.requestPool_.clear();\n  }\n};\n\n\n/**\n * @return {boolean} Whether there are any pending requests.\n */\nForwardChannelRequestPool.prototype.hasPendingRequest = function() {\n  return (this.request_ != null) ||\n      (this.requestPool_ != null && this.requestPool_.size !== 0);\n};\n\n\n/**\n * @return {!Array<Wire.QueuedMap>} All the pending messages from the pool,\n *     as a new array.\n */\nForwardChannelRequestPool.prototype.getPendingMessages = function() {\n  if (this.request_ != null) {\n    return this.pendingMessages_.concat(this.request_.getPendingMessages());\n  }\n\n  if (this.requestPool_ != null && this.requestPool_.size !== 0) {\n    let result = this.pendingMessages_;\n    for (const val of this.requestPool_.values()) {\n      result = result.concat(val.getPendingMessages());\n    }\n    return result;\n  }\n\n  return array.clone(this.pendingMessages_);\n};\n\n\n/**\n * Records pending messages, e.g. when a request receives a failed response.\n *\n * @param {!Array<Wire.QueuedMap>} messages Pending messages.\n */\nForwardChannelRequestPool.prototype.addPendingMessages = function(messages) {\n  this.pendingMessages_ = this.pendingMessages_.concat(messages);\n};\n\n\n/**\n * Clears any recorded pending messages.\n */\nForwardChannelRequestPool.prototype.clearPendingMessages = function() {\n  this.pendingMessages_.length = 0;\n};\n\n\n/**\n * Cancels all pending requests and force the completion of channel requests.\n *\n * Need go through the standard onRequestComplete logic to expose the max-retry\n * failure in the standard way.\n *\n * @param {function(!ChannelRequest)} onComplete The completion callback.\n * @return {boolean} true if any request has been forced to complete.\n */\nForwardChannelRequestPool.prototype.forceComplete = function(onComplete) {\n  if (this.request_ != null) {\n    this.request_.cancel();\n    onComplete(this.request_);\n    return true;\n  }\n\n  if (this.requestPool_ && this.requestPool_.size !== 0) {\n    for (const val of this.requestPool_.values()) {\n      val.cancel();\n      onComplete(val);\n    }\n    return true;\n  }\n\n  return false;\n};\n\nexports = ForwardChannelRequestPool;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Generics method for collection-like classes and objects.\n *\n *\n * This file contains functions to work with collections. It supports using\n * Map, Set, Array and Object and other classes that implement collection-like\n * methods.\n * @suppress {strictMissingProperties}\n */\n\n\ngoog.provide('goog.structs');\n\ngoog.require('goog.array');\ngoog.require('goog.object');\n\n\n// We treat an object as a dictionary if it has getKeys or it is an object that\n// isn't arrayLike.\n\n\n/**\n * Returns the number of values in the collection-like object.\n * @param {Object} col The collection-like object.\n * @return {number} The number of values in the collection-like object.\n */\ngoog.structs.getCount = function(col) {\n  'use strict';\n  if (col.getCount && typeof col.getCount == 'function') {\n    return col.getCount();\n  }\n  if (goog.isArrayLike(col) || typeof col === 'string') {\n    return col.length;\n  }\n  return goog.object.getCount(col);\n};\n\n\n/**\n * Returns the values of the collection-like object.\n * @param {Object} col The collection-like object.\n * @return {!Array<?>} The values in the collection-like object.\n */\ngoog.structs.getValues = function(col) {\n  'use strict';\n  if (col.getValues && typeof col.getValues == 'function') {\n    return col.getValues();\n  }\n  // ES6 Map and Set both define a values function that returns an iterator.\n  // The typeof check allows the compiler to remove the Map and Set polyfills\n  // if they are otherwise unused throughout the entire binary.\n  if ((typeof Map !== 'undefined' && col instanceof Map) ||\n      (typeof Set !== 'undefined' && col instanceof Set)) {\n    return Array.from(col.values());\n  }\n  if (typeof col === 'string') {\n    return col.split('');\n  }\n  if (goog.isArrayLike(col)) {\n    var rv = [];\n    var l = col.length;\n    for (var i = 0; i < l; i++) {\n      rv.push(col[i]);\n    }\n    return rv;\n  }\n  return goog.object.getValues(col);\n};\n\n\n/**\n * Returns the keys of the collection. Some collections have no notion of\n * keys/indexes and this function will return undefined in those cases.\n * @param {Object} col The collection-like object.\n * @return {!Array|undefined} The keys in the collection.\n */\ngoog.structs.getKeys = function(col) {\n  'use strict';\n  if (col.getKeys && typeof col.getKeys == 'function') {\n    return col.getKeys();\n  }\n  // if we have getValues but no getKeys we know this is a key-less collection\n  if (col.getValues && typeof col.getValues == 'function') {\n    return undefined;\n  }\n  // ES6 Map and Set both define a keys function that returns an iterator. For\n  // Sets this iterates over the same values as the values iterator.\n  // The typeof check allows the compiler to remove the Map and Set polyfills\n  // if they are otherwise unused throughout the entire binary.\n  if (typeof Map !== 'undefined' && col instanceof Map) {\n    return Array.from(col.keys());\n  }\n  // Unlike the native Set, goog.structs.Set does not expose keys as the values.\n  if (typeof Set !== 'undefined' && col instanceof Set) {\n    return undefined;\n  }\n  if (goog.isArrayLike(col) || typeof col === 'string') {\n    var rv = [];\n    var l = col.length;\n    for (var i = 0; i < l; i++) {\n      rv.push(i);\n    }\n    return rv;\n  }\n\n  return goog.object.getKeys(col);\n};\n\n\n/**\n * Whether the collection contains the given value. This is O(n) and uses\n * equals (==) to test the existence.\n * @param {Object} col The collection-like object.\n * @param {*} val The value to check for.\n * @return {boolean} True if the map contains the value.\n */\ngoog.structs.contains = function(col, val) {\n  'use strict';\n  if (col.contains && typeof col.contains == 'function') {\n    return col.contains(val);\n  }\n  if (col.containsValue && typeof col.containsValue == 'function') {\n    return col.containsValue(val);\n  }\n  if (goog.isArrayLike(col) || typeof col === 'string') {\n    return goog.array.contains(/** @type {!Array<?>} */ (col), val);\n  }\n  return goog.object.containsValue(col, val);\n};\n\n\n/**\n * Whether the collection is empty.\n * @param {Object} col The collection-like object.\n * @return {boolean} True if empty.\n */\ngoog.structs.isEmpty = function(col) {\n  'use strict';\n  if (col.isEmpty && typeof col.isEmpty == 'function') {\n    return col.isEmpty();\n  }\n\n  // We do not use goog.string.isEmptyOrWhitespace because here we treat the\n  // string as\n  // collection and as such even whitespace matters\n\n  if (goog.isArrayLike(col) || typeof col === 'string') {\n    return /** @type {!Array<?>} */ (col).length === 0;\n  }\n  return goog.object.isEmpty(col);\n};\n\n\n/**\n * Removes all the elements from the collection.\n * @param {Object} col The collection-like object.\n * @return {void}\n */\ngoog.structs.clear = function(col) {\n  'use strict';\n  // NOTE(arv): This should not contain strings because strings are immutable\n  if (col.clear && typeof col.clear == 'function') {\n    col.clear();\n  } else if (goog.isArrayLike(col)) {\n    goog.array.clear(/** @type {IArrayLike<?>} */ (col));\n  } else {\n    goog.object.clear(col);\n  }\n};\n\n\n/**\n * Calls a function for each value in a collection. The function takes\n * three arguments; the value, the key and the collection.\n *\n * @param {S} col The collection-like object.\n * @param {function(this:T,?,?,S):?} f The function to call for every value.\n *     This function takes\n *     3 arguments (the value, the key or undefined if the collection has no\n *     notion of keys, and the collection) and the return value is irrelevant.\n * @param {T=} opt_obj The object to be used as the value of 'this'\n *     within `f`.\n * @return {void}\n * @template T,S\n * @deprecated Use a more specific method, e.g. native Array.prototype.forEach,\n *     or for-of.\n */\ngoog.structs.forEach = function(col, f, opt_obj) {\n  'use strict';\n  if (col.forEach && typeof col.forEach == 'function') {\n    col.forEach(f, opt_obj);\n  } else if (goog.isArrayLike(col) || typeof col === 'string') {\n    Array.prototype.forEach.call(/** @type {!Array<?>} */ (col), f, opt_obj);\n  } else {\n    var keys = goog.structs.getKeys(col);\n    var values = goog.structs.getValues(col);\n    var l = values.length;\n    for (var i = 0; i < l; i++) {\n      f.call(/** @type {?} */ (opt_obj), values[i], keys && keys[i], col);\n    }\n  }\n};\n\n\n/**\n * Calls a function for every value in the collection. When a call returns true,\n * adds the value to a new collection (Array is returned by default).\n *\n * @param {S} col The collection-like object.\n * @param {function(this:T,?,?,S):boolean} f The function to call for every\n *     value. This function takes\n *     3 arguments (the value, the key or undefined if the collection has no\n *     notion of keys, and the collection) and should return a Boolean. If the\n *     return value is true the value is added to the result collection. If it\n *     is false the value is not included.\n * @param {T=} opt_obj The object to be used as the value of 'this'\n *     within `f`.\n * @return {!Object|!Array<?>} A new collection where the passed values are\n *     present. If col is a key-less collection an array is returned.  If col\n *     has keys and values a plain old JS object is returned.\n * @template T,S\n */\ngoog.structs.filter = function(col, f, opt_obj) {\n  'use strict';\n  if (typeof col.filter == 'function') {\n    return col.filter(f, opt_obj);\n  }\n  if (goog.isArrayLike(col) || typeof col === 'string') {\n    return Array.prototype.filter.call(\n        /** @type {!Array<?>} */ (col), f, opt_obj);\n  }\n\n  var rv;\n  var keys = goog.structs.getKeys(col);\n  var values = goog.structs.getValues(col);\n  var l = values.length;\n  if (keys) {\n    rv = {};\n    for (var i = 0; i < l; i++) {\n      if (f.call(/** @type {?} */ (opt_obj), values[i], keys[i], col)) {\n        rv[keys[i]] = values[i];\n      }\n    }\n  } else {\n    // We should not use Array#filter here since we want to make sure that\n    // the index is undefined as well as make sure that col is passed to the\n    // function.\n    rv = [];\n    for (var i = 0; i < l; i++) {\n      if (f.call(opt_obj, values[i], undefined, col)) {\n        rv.push(values[i]);\n      }\n    }\n  }\n  return rv;\n};\n\n\n/**\n * Calls a function for every value in the collection and adds the result into a\n * new collection (defaults to creating a new Array).\n *\n * @param {S} col The collection-like object.\n * @param {function(this:T,?,?,S):V} f The function to call for every value.\n *     This function takes 3 arguments (the value, the key or undefined if the\n *     collection has no notion of keys, and the collection) and should return\n *     something. The result will be used as the value in the new collection.\n * @param {T=} opt_obj  The object to be used as the value of 'this'\n *     within `f`.\n * @return {!Object<V>|!Array<V>} A new collection with the new values.  If\n *     col is a key-less collection an array is returned.  If col has keys and\n *     values a plain old JS object is returned.\n * @template T,S,V\n */\ngoog.structs.map = function(col, f, opt_obj) {\n  'use strict';\n  if (typeof col.map == 'function') {\n    return col.map(f, opt_obj);\n  }\n  if (goog.isArrayLike(col) || typeof col === 'string') {\n    return Array.prototype.map.call(/** @type {!Array<?>} */ (col), f, opt_obj);\n  }\n\n  var rv;\n  var keys = goog.structs.getKeys(col);\n  var values = goog.structs.getValues(col);\n  var l = values.length;\n  if (keys) {\n    rv = {};\n    for (var i = 0; i < l; i++) {\n      rv[keys[i]] = f.call(/** @type {?} */ (opt_obj), values[i], keys[i], col);\n    }\n  } else {\n    // We should not use Array#map here since we want to make sure that\n    // the index is undefined as well as make sure that col is passed to the\n    // function.\n    rv = [];\n    for (var i = 0; i < l; i++) {\n      rv[i] = f.call(/** @type {?} */ (opt_obj), values[i], undefined, col);\n    }\n  }\n  return rv;\n};\n\n\n/**\n * Calls f for each value in a collection. If any call returns true this returns\n * true (without checking the rest). If all returns false this returns false.\n *\n * @param {S} col The collection-like object.\n * @param {function(this:T,?,?,S):boolean} f The function to call for every\n *     value. This function takes 3 arguments (the value, the key or undefined\n *     if the collection has no notion of keys, and the collection) and should\n *     return a boolean.\n * @param {T=} opt_obj  The object to be used as the value of 'this'\n *     within `f`.\n * @return {boolean} True if any value passes the test.\n * @template T,S\n */\ngoog.structs.some = function(col, f, opt_obj) {\n  'use strict';\n  if (typeof col.some == 'function') {\n    return col.some(f, opt_obj);\n  }\n  if (goog.isArrayLike(col) || typeof col === 'string') {\n    return Array.prototype.some.call(\n        /** @type {!Array<?>} */ (col), f, opt_obj);\n  }\n  var keys = goog.structs.getKeys(col);\n  var values = goog.structs.getValues(col);\n  var l = values.length;\n  for (var i = 0; i < l; i++) {\n    if (f.call(/** @type {?} */ (opt_obj), values[i], keys && keys[i], col)) {\n      return true;\n    }\n  }\n  return false;\n};\n\n\n/**\n * Calls f for each value in a collection. If all calls return true this return\n * true this returns true. If any returns false this returns false at this point\n *  and does not continue to check the remaining values.\n *\n * @param {S} col The collection-like object.\n * @param {function(this:T,?,?,S):boolean} f The function to call for every\n *     value. This function takes 3 arguments (the value, the key or\n *     undefined if the collection has no notion of keys, and the collection)\n *     and should return a boolean.\n * @param {T=} opt_obj  The object to be used as the value of 'this'\n *     within `f`.\n * @return {boolean} True if all key-value pairs pass the test.\n * @template T,S\n */\ngoog.structs.every = function(col, f, opt_obj) {\n  'use strict';\n  if (typeof col.every == 'function') {\n    return col.every(f, opt_obj);\n  }\n  if (goog.isArrayLike(col) || typeof col === 'string') {\n    return Array.prototype.every.call(\n        /** @type {!Array<?>} */ (col), f, opt_obj);\n  }\n  var keys = goog.structs.getKeys(col);\n  var values = goog.structs.getValues(col);\n  var l = values.length;\n  for (var i = 0; i < l; i++) {\n    if (!f.call(/** @type {?} */ (opt_obj), values[i], keys && keys[i], col)) {\n      return false;\n    }\n  }\n  return true;\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Simple utilities for dealing with URI strings.\n *\n * This package is deprecated in favour of the Closure URL package (goog.url)\n * when manipulating URIs for use by a browser. This package uses regular\n * expressions to parse a potential URI which can fall out of sync with how a\n * browser will actually interpret the URI. See\n * `goog.uri.utils.setUrlPackageSupportLoggingHandler` for one way to identify\n * URIs that should instead be parsed using the URL package.\n *\n * This is intended to be a lightweight alternative to constructing goog.Uri\n * objects.  Whereas goog.Uri adds several kilobytes to the binary regardless\n * of how much of its functionality you use, this is designed to be a set of\n * mostly-independent utilities so that the compiler includes only what is\n * necessary for the task.  Estimated savings of porting is 5k pre-gzip and\n * 1.5k post-gzip.  To ensure the savings remain, future developers should\n * avoid adding new functionality to existing functions, but instead create\n * new ones and factor out shared code.\n *\n * Many of these utilities have limited functionality, tailored to common\n * cases.  The query parameter utilities assume that the parameter keys are\n * already encoded, since most keys are compile-time alphanumeric strings.  The\n * query parameter mutation utilities also do not tolerate fragment identifiers.\n *\n * By design, these functions can be slower than goog.Uri equivalents.\n * Repeated calls to some of functions may be quadratic in behavior for IE,\n * although the effect is somewhat limited given the 2kb limit.\n *\n * One advantage of the limited functionality here is that this approach is\n * less sensitive to differences in URI encodings than goog.Uri, since these\n * functions operate on strings directly, rather than decoding them and\n * then re-encoding.\n *\n * Uses features of RFC 3986 for parsing/formatting URIs:\n *   http://www.ietf.org/rfc/rfc3986.txt\n */\n\ngoog.provide('goog.uri.utils');\ngoog.provide('goog.uri.utils.ComponentIndex');\ngoog.provide('goog.uri.utils.QueryArray');\ngoog.provide('goog.uri.utils.QueryValue');\ngoog.provide('goog.uri.utils.StandardQueryParam');\n\ngoog.require('goog.asserts');\ngoog.require('goog.string');\n\n\n/**\n * Character codes inlined to avoid object allocations due to charCode.\n * @enum {number}\n * @private\n */\ngoog.uri.utils.CharCode_ = {\n  AMPERSAND: 38,\n  EQUAL: 61,\n  HASH: 35,\n  QUESTION: 63\n};\n\n\n/**\n * Builds a URI string from already-encoded parts.\n *\n * No encoding is performed.  Any component may be omitted as either null or\n * undefined.\n *\n * @param {?string=} opt_scheme The scheme such as 'http'.\n * @param {?string=} opt_userInfo The user name before the '@'.\n * @param {?string=} opt_domain The domain such as 'www.google.com', already\n *     URI-encoded.\n * @param {(string|number|null)=} opt_port The port number.\n * @param {?string=} opt_path The path, already URI-encoded.  If it is not\n *     empty, it must begin with a slash.\n * @param {?string=} opt_queryData The URI-encoded query data.\n * @param {?string=} opt_fragment The URI-encoded fragment identifier.\n * @return {string} The fully combined URI.\n */\ngoog.uri.utils.buildFromEncodedParts = function(\n    opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData,\n    opt_fragment) {\n  'use strict';\n  var out = '';\n\n  if (opt_scheme) {\n    out += opt_scheme + ':';\n  }\n\n  if (opt_domain) {\n    out += '//';\n\n    if (opt_userInfo) {\n      out += opt_userInfo + '@';\n    }\n\n    out += opt_domain;\n\n    if (opt_port) {\n      out += ':' + opt_port;\n    }\n  }\n\n  if (opt_path) {\n    out += opt_path;\n  }\n\n  if (opt_queryData) {\n    out += '?' + opt_queryData;\n  }\n\n  if (opt_fragment) {\n    out += '#' + opt_fragment;\n  }\n\n  return out;\n};\n\n\n/**\n * A regular expression for breaking a URI into its component parts.\n *\n * {@link http://www.ietf.org/rfc/rfc3986.txt} says in Appendix B\n * As the \"first-match-wins\" algorithm is identical to the \"greedy\"\n * disambiguation method used by POSIX regular expressions, it is natural and\n * commonplace to use a regular expression for parsing the potential five\n * components of a URI reference.\n *\n * The following line is the regular expression for breaking-down a\n * well-formed URI reference into its components.\n *\n * <pre>\n * ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?\n *  12            3  4          5       6  7        8 9\n * </pre>\n *\n * The numbers in the second line above are only to assist readability; they\n * indicate the reference points for each subexpression (i.e., each paired\n * parenthesis). We refer to the value matched for subexpression <n> as $<n>.\n * For example, matching the above expression to\n * <pre>\n *     http://www.ics.uci.edu/pub/ietf/uri/#Related\n * </pre>\n * results in the following subexpression matches:\n * <pre>\n *    $1 = http:\n *    $2 = http\n *    $3 = //www.ics.uci.edu\n *    $4 = www.ics.uci.edu\n *    $5 = /pub/ietf/uri/\n *    $6 = <undefined>\n *    $7 = <undefined>\n *    $8 = #Related\n *    $9 = Related\n * </pre>\n * where <undefined> indicates that the component is not present, as is the\n * case for the query component in the above example. Therefore, we can\n * determine the value of the five components as\n * <pre>\n *    scheme    = $2\n *    authority = $4\n *    path      = $5\n *    query     = $7\n *    fragment  = $9\n * </pre>\n *\n * The regular expression has been modified slightly to expose the\n * userInfo, domain, and port separately from the authority.\n * The modified version yields\n * <pre>\n *    $1 = http              scheme\n *    $2 = <undefined>       userInfo -\\\n *    $3 = www.ics.uci.edu   domain     | authority\n *    $4 = <undefined>       port     -/\n *    $5 = /pub/ietf/uri/    path\n *    $6 = <undefined>       query without ?\n *    $7 = Related           fragment without #\n * </pre>\n *\n * TODO(user): separate out the authority terminating characters once this\n * file is moved to ES6.\n * @type {!RegExp}\n * @private\n */\ngoog.uri.utils.splitRe_ = new RegExp(\n    '^' +  // Anchor against the entire string.\n    '(?:' +\n    '([^:/?#.]+)' +  // scheme - ignore special characters\n                     // used by other URL parts such as :,\n                     // ?, /, #, and .\n    ':)?' +\n    '(?://' +\n    '(?:([^\\\\\\\\/?#]*)@)?' +  // userInfo\n    '([^\\\\\\\\/?#]*?)' +       // domain\n    '(?::([0-9]+))?' +       // port\n    '(?=[\\\\\\\\/?#]|$)' +      // authority-terminating character.\n    ')?' +\n    '([^?#]+)?' +          // path\n    '(?:\\\\?([^#]*))?' +    // query\n    '(?:#([\\\\s\\\\S]*))?' +  // fragment. Can't use '.*' with 's' flag as Firefox\n                           // doesn't support the flag, and can't use an\n                           // \"everything set\" ([^]) as IE10 doesn't match any\n                           // characters with it.\n    '$');\n\n\n/**\n * The index of each URI component in the return value of goog.uri.utils.split.\n * @enum {number}\n */\ngoog.uri.utils.ComponentIndex = {\n  SCHEME: 1,\n  USER_INFO: 2,\n  DOMAIN: 3,\n  PORT: 4,\n  PATH: 5,\n  QUERY_DATA: 6,\n  FRAGMENT: 7\n};\n\n/**\n * @type {?function(string)}\n * @private\n */\ngoog.uri.utils.urlPackageSupportLoggingHandler_ = null;\n\n/**\n * @param {?function(string)} handler The handler function to call when a URI\n *     with a protocol that is better supported by the Closure URL package is\n *     detected.\n */\ngoog.uri.utils.setUrlPackageSupportLoggingHandler = function(handler) {\n  'use strict';\n  goog.uri.utils.urlPackageSupportLoggingHandler_ = handler;\n};\n\n/**\n * Splits a URI into its component parts.\n *\n * Each component can be accessed via the component indices; for example:\n * <pre>\n * goog.uri.utils.split(someStr)[goog.uri.utils.ComponentIndex.QUERY_DATA];\n * </pre>\n *\n * @param {string} uri The URI string to examine.\n * @return {!Array<string|undefined>} Each component still URI-encoded.\n *     Each component that is present will contain the encoded value, whereas\n *     components that are not present will be undefined or empty, depending\n *     on the browser's regular expression implementation.  Never null, since\n *     arbitrary strings may still look like path names.\n */\ngoog.uri.utils.split = function(uri) {\n  'use strict';\n  // See @return comment -- never null.\n  var result = /** @type {!Array<string|undefined>} */ (\n      uri.match(goog.uri.utils.splitRe_));\n  if (goog.uri.utils.urlPackageSupportLoggingHandler_ &&\n      ['http', 'https', 'ws', 'wss',\n       'ftp'].indexOf(result[goog.uri.utils.ComponentIndex.SCHEME]) >= 0) {\n    goog.uri.utils.urlPackageSupportLoggingHandler_(uri);\n  }\n  return result;\n};\n\n\n/**\n * @param {?string} uri A possibly null string.\n * @param {boolean=} opt_preserveReserved If true, percent-encoding of RFC-3986\n *     reserved characters will not be removed.\n * @return {?string} The string URI-decoded, or null if uri is null.\n * @private\n */\ngoog.uri.utils.decodeIfPossible_ = function(uri, opt_preserveReserved) {\n  'use strict';\n  if (!uri) {\n    return uri;\n  }\n\n  return opt_preserveReserved ? decodeURI(uri) : decodeURIComponent(uri);\n};\n\n\n/**\n * Gets a URI component by index.\n *\n * It is preferred to use the getPathEncoded() variety of functions ahead,\n * since they are more readable.\n *\n * @param {goog.uri.utils.ComponentIndex} componentIndex The component index.\n * @param {string} uri The URI to examine.\n * @return {?string} The still-encoded component, or null if the component\n *     is not present.\n * @private\n */\ngoog.uri.utils.getComponentByIndex_ = function(componentIndex, uri) {\n  'use strict';\n  // Convert undefined, null, and empty string into null.\n  return goog.uri.utils.split(uri)[componentIndex] || null;\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The protocol or scheme, or null if none.  Does not\n *     include trailing colons or slashes.\n */\ngoog.uri.utils.getScheme = function(uri) {\n  'use strict';\n  return goog.uri.utils.getComponentByIndex_(\n      goog.uri.utils.ComponentIndex.SCHEME, uri);\n};\n\n\n/**\n * Gets the effective scheme for the URL.  If the URL is relative then the\n * scheme is derived from the page's location.\n * @param {string} uri The URI to examine.\n * @return {string} The protocol or scheme, always lower case.\n */\ngoog.uri.utils.getEffectiveScheme = function(uri) {\n  'use strict';\n  var scheme = goog.uri.utils.getScheme(uri);\n  if (!scheme && goog.global.self && goog.global.self.location) {\n    var protocol = goog.global.self.location.protocol;\n    scheme = protocol.slice(0, -1);\n  }\n  // NOTE: When called from a web worker in Firefox 3.5, location may be null.\n  // All other browsers with web workers support self.location from the worker.\n  return scheme ? scheme.toLowerCase() : '';\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The user name still encoded, or null if none.\n */\ngoog.uri.utils.getUserInfoEncoded = function(uri) {\n  'use strict';\n  return goog.uri.utils.getComponentByIndex_(\n      goog.uri.utils.ComponentIndex.USER_INFO, uri);\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The decoded user info, or null if none.\n */\ngoog.uri.utils.getUserInfo = function(uri) {\n  'use strict';\n  return goog.uri.utils.decodeIfPossible_(\n      goog.uri.utils.getUserInfoEncoded(uri));\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The domain name still encoded, or null if none.\n */\ngoog.uri.utils.getDomainEncoded = function(uri) {\n  'use strict';\n  return goog.uri.utils.getComponentByIndex_(\n      goog.uri.utils.ComponentIndex.DOMAIN, uri);\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The decoded domain, or null if none.\n */\ngoog.uri.utils.getDomain = function(uri) {\n  'use strict';\n  return goog.uri.utils.decodeIfPossible_(\n      goog.uri.utils.getDomainEncoded(uri), true /* opt_preserveReserved */);\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?number} The port number, or null if none.\n */\ngoog.uri.utils.getPort = function(uri) {\n  'use strict';\n  // Coerce to a number.  If the result of getComponentByIndex_ is null or\n  // non-numeric, the number coersion yields NaN.  This will then return\n  // null for all non-numeric cases (though also zero, which isn't a relevant\n  // port number).\n  return Number(\n             goog.uri.utils.getComponentByIndex_(\n                 goog.uri.utils.ComponentIndex.PORT, uri)) ||\n      null;\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The path still encoded, or null if none. Includes the\n *     leading slash, if any.\n */\ngoog.uri.utils.getPathEncoded = function(uri) {\n  'use strict';\n  return goog.uri.utils.getComponentByIndex_(\n      goog.uri.utils.ComponentIndex.PATH, uri);\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The decoded path, or null if none.  Includes the leading\n *     slash, if any.\n */\ngoog.uri.utils.getPath = function(uri) {\n  'use strict';\n  return goog.uri.utils.decodeIfPossible_(\n      goog.uri.utils.getPathEncoded(uri), true /* opt_preserveReserved */);\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The query data still encoded, or null if none.  Does not\n *     include the question mark itself.\n */\ngoog.uri.utils.getQueryData = function(uri) {\n  'use strict';\n  return goog.uri.utils.getComponentByIndex_(\n      goog.uri.utils.ComponentIndex.QUERY_DATA, uri);\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The fragment identifier, or null if none.  Does not\n *     include the hash mark itself.\n */\ngoog.uri.utils.getFragmentEncoded = function(uri) {\n  'use strict';\n  // The hash mark may not appear in any other part of the URL.\n  var hashIndex = uri.indexOf('#');\n  return hashIndex < 0 ? null : uri.slice(hashIndex + 1);\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @param {?string} fragment The encoded fragment identifier, or null if none.\n *     Does not include the hash mark itself.\n * @return {string} The URI with the fragment set.\n */\ngoog.uri.utils.setFragmentEncoded = function(uri, fragment) {\n  'use strict';\n  return goog.uri.utils.removeFragment(uri) + (fragment ? '#' + fragment : '');\n};\n\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The decoded fragment identifier, or null if none.  Does\n *     not include the hash mark.\n */\ngoog.uri.utils.getFragment = function(uri) {\n  'use strict';\n  return goog.uri.utils.decodeIfPossible_(\n      goog.uri.utils.getFragmentEncoded(uri));\n};\n\n\n/**\n * Extracts everything up to the port of the URI.\n * @param {string} uri The URI string.\n * @return {string} Everything up to and including the port.\n */\ngoog.uri.utils.getHost = function(uri) {\n  'use strict';\n  var pieces = goog.uri.utils.split(uri);\n  return goog.uri.utils.buildFromEncodedParts(\n      pieces[goog.uri.utils.ComponentIndex.SCHEME],\n      pieces[goog.uri.utils.ComponentIndex.USER_INFO],\n      pieces[goog.uri.utils.ComponentIndex.DOMAIN],\n      pieces[goog.uri.utils.ComponentIndex.PORT]);\n};\n\n\n/**\n * Returns the origin for a given URL.\n * @param {string} uri The URI string.\n * @return {string} Everything up to and including the port.\n */\ngoog.uri.utils.getOrigin = function(uri) {\n  'use strict';\n  var pieces = goog.uri.utils.split(uri);\n  return goog.uri.utils.buildFromEncodedParts(\n      pieces[goog.uri.utils.ComponentIndex.SCHEME], null /* opt_userInfo */,\n      pieces[goog.uri.utils.ComponentIndex.DOMAIN],\n      pieces[goog.uri.utils.ComponentIndex.PORT]);\n};\n\n\n/**\n * Extracts the path of the URL and everything after.\n * @param {string} uri The URI string.\n * @return {string} The URI, starting at the path and including the query\n *     parameters and fragment identifier.\n */\ngoog.uri.utils.getPathAndAfter = function(uri) {\n  'use strict';\n  var pieces = goog.uri.utils.split(uri);\n  return goog.uri.utils.buildFromEncodedParts(\n      null, null, null, null, pieces[goog.uri.utils.ComponentIndex.PATH],\n      pieces[goog.uri.utils.ComponentIndex.QUERY_DATA],\n      pieces[goog.uri.utils.ComponentIndex.FRAGMENT]);\n};\n\n\n/**\n * Gets the URI with the fragment identifier removed.\n * @param {string} uri The URI to examine.\n * @return {string} Everything preceding the hash mark.\n */\ngoog.uri.utils.removeFragment = function(uri) {\n  'use strict';\n  // The hash mark may not appear in any other part of the URL.\n  var hashIndex = uri.indexOf('#');\n  return hashIndex < 0 ? uri : uri.slice(0, hashIndex);\n};\n\n\n/**\n * Ensures that two URI's have the exact same domain, scheme, and port.\n *\n * Unlike the version in goog.Uri, this checks protocol, and therefore is\n * suitable for checking against the browser's same-origin policy.\n *\n * @param {string} uri1 The first URI.\n * @param {string} uri2 The second URI.\n * @return {boolean} Whether they have the same scheme, domain and port.\n */\ngoog.uri.utils.haveSameDomain = function(uri1, uri2) {\n  'use strict';\n  var pieces1 = goog.uri.utils.split(uri1);\n  var pieces2 = goog.uri.utils.split(uri2);\n  return pieces1[goog.uri.utils.ComponentIndex.DOMAIN] ==\n      pieces2[goog.uri.utils.ComponentIndex.DOMAIN] &&\n      pieces1[goog.uri.utils.ComponentIndex.SCHEME] ==\n      pieces2[goog.uri.utils.ComponentIndex.SCHEME] &&\n      pieces1[goog.uri.utils.ComponentIndex.PORT] ==\n      pieces2[goog.uri.utils.ComponentIndex.PORT];\n};\n\n\n/**\n * Asserts that there are no fragment or query identifiers, only in uncompiled\n * mode.\n * @param {string} uri The URI to examine.\n * @private\n */\ngoog.uri.utils.assertNoFragmentsOrQueries_ = function(uri) {\n  'use strict';\n  goog.asserts.assert(\n      uri.indexOf('#') < 0 && uri.indexOf('?') < 0,\n      'goog.uri.utils: Fragment or query identifiers are not supported: [%s]',\n      uri);\n};\n\n\n/**\n * Supported query parameter values by the parameter serializing utilities.\n *\n * If a value is null or undefined, the key-value pair is skipped, as an easy\n * way to omit parameters conditionally.  Non-array parameters are converted\n * to a string and URI encoded.  Array values are expanded into multiple\n * &key=value pairs, with each element stringized and URI-encoded.\n *\n * @typedef {*}\n */\ngoog.uri.utils.QueryValue;\n\n\n/**\n * An array representing a set of query parameters with alternating keys\n * and values.\n *\n * Keys are assumed to be URI encoded already and live at even indices.  See\n * goog.uri.utils.QueryValue for details on how parameter values are encoded.\n *\n * Example:\n * <pre>\n * var data = [\n *   // Simple param: ?name=BobBarker\n *   'name', 'BobBarker',\n *   // Conditional param -- may be omitted entirely.\n *   'specialDietaryNeeds', hasDietaryNeeds() ? getDietaryNeeds() : null,\n *   // Multi-valued param: &house=LosAngeles&house=NewYork&house=null\n *   'house', ['LosAngeles', 'NewYork', null]\n * ];\n * </pre>\n *\n * @typedef {!Array<string|goog.uri.utils.QueryValue>}\n */\ngoog.uri.utils.QueryArray;\n\n\n/**\n * Parses encoded query parameters and calls callback function for every\n * parameter found in the string.\n *\n * Missing value of parameter (e.g. “…&key&…”) is treated as if the value was an\n * empty string.  Keys may be empty strings (e.g. “…&=value&…”) which also means\n * that “…&=&…” and “…&&…” will result in an empty key and value.\n *\n * @param {string} encodedQuery Encoded query string excluding question mark at\n *     the beginning.\n * @param {function(string, string)} callback Function called for every\n *     parameter found in query string.  The first argument (name) will not be\n *     urldecoded (so the function is consistent with buildQueryData), but the\n *     second will.  If the parameter has no value (i.e. “=” was not present)\n *     the second argument (value) will be an empty string.\n */\ngoog.uri.utils.parseQueryData = function(encodedQuery, callback) {\n  'use strict';\n  if (!encodedQuery) {\n    return;\n  }\n  var pairs = encodedQuery.split('&');\n  for (var i = 0; i < pairs.length; i++) {\n    var indexOfEquals = pairs[i].indexOf('=');\n    var name = null;\n    var value = null;\n    if (indexOfEquals >= 0) {\n      name = pairs[i].substring(0, indexOfEquals);\n      value = pairs[i].substring(indexOfEquals + 1);\n    } else {\n      name = pairs[i];\n    }\n    callback(name, value ? goog.string.urlDecode(value) : '');\n  }\n};\n\n\n/**\n * Split the URI into 3 parts where the [1] is the queryData without a leading\n * '?'. For example, the URI http://foo.com/bar?a=b#abc returns\n * ['http://foo.com/bar','a=b','#abc'].\n * @param {string} uri The URI to parse.\n * @return {!Array<string>} An array representation of uri of length 3 where the\n *     middle value is the queryData without a leading '?'.\n * @private\n */\ngoog.uri.utils.splitQueryData_ = function(uri) {\n  'use strict';\n  // Find the query data and hash.\n  var hashIndex = uri.indexOf('#');\n  if (hashIndex < 0) {\n    hashIndex = uri.length;\n  }\n  var questionIndex = uri.indexOf('?');\n  var queryData;\n  if (questionIndex < 0 || questionIndex > hashIndex) {\n    questionIndex = hashIndex;\n    queryData = '';\n  } else {\n    queryData = uri.substring(questionIndex + 1, hashIndex);\n  }\n  return [uri.slice(0, questionIndex), queryData, uri.slice(hashIndex)];\n};\n\n\n/**\n * Join an array created by splitQueryData_ back into a URI.\n * @param {!Array<string>} parts A URI in the form generated by splitQueryData_.\n * @return {string} The joined URI.\n * @private\n */\ngoog.uri.utils.joinQueryData_ = function(parts) {\n  'use strict';\n  return parts[0] + (parts[1] ? '?' + parts[1] : '') + parts[2];\n};\n\n\n/**\n * @param {string} queryData\n * @param {string} newData\n * @return {string}\n * @private\n */\ngoog.uri.utils.appendQueryData_ = function(queryData, newData) {\n  'use strict';\n  if (!newData) {\n    return queryData;\n  }\n  return queryData ? queryData + '&' + newData : newData;\n};\n\n\n/**\n * @param {string} uri\n * @param {string} queryData\n * @return {string}\n * @private\n */\ngoog.uri.utils.appendQueryDataToUri_ = function(uri, queryData) {\n  'use strict';\n  if (!queryData) {\n    return uri;\n  }\n  var parts = goog.uri.utils.splitQueryData_(uri);\n  parts[1] = goog.uri.utils.appendQueryData_(parts[1], queryData);\n  return goog.uri.utils.joinQueryData_(parts);\n};\n\n\n/**\n * Appends key=value pairs to an array, supporting multi-valued objects.\n * @param {*} key The key prefix.\n * @param {goog.uri.utils.QueryValue} value The value to serialize.\n * @param {!Array<string>} pairs The array to which the 'key=value' strings\n *     should be appended.\n * @private\n */\ngoog.uri.utils.appendKeyValuePairs_ = function(key, value, pairs) {\n  'use strict';\n  goog.asserts.assertString(key);\n  if (Array.isArray(value)) {\n    // Convince the compiler it's an array.\n    goog.asserts.assertArray(value);\n    for (var j = 0; j < value.length; j++) {\n      // Convert to string explicitly, to short circuit the null and array\n      // logic in this function -- this ensures that null and undefined get\n      // written as literal 'null' and 'undefined', and arrays don't get\n      // expanded out but instead encoded in the default way.\n      goog.uri.utils.appendKeyValuePairs_(key, String(value[j]), pairs);\n    }\n  } else if (value != null) {\n    // Skip a top-level null or undefined entirely.\n    pairs.push(\n        key +\n        // Check for empty string. Zero gets encoded into the url as literal\n        // strings.  For empty string, skip the equal sign, to be consistent\n        // with UriBuilder.java.\n        (value === '' ? '' : '=' + goog.string.urlEncode(value)));\n  }\n};\n\n\n/**\n * Builds a query data string from a sequence of alternating keys and values.\n * Currently generates \"&key&\" for empty args.\n *\n * @param {!IArrayLike<string|goog.uri.utils.QueryValue>} keysAndValues\n *     Alternating keys and values. See the QueryArray typedef.\n * @param {number=} opt_startIndex A start offset into the arary, defaults to 0.\n * @return {string} The encoded query string, in the form 'a=1&b=2'.\n */\ngoog.uri.utils.buildQueryData = function(keysAndValues, opt_startIndex) {\n  'use strict';\n  goog.asserts.assert(\n      Math.max(keysAndValues.length - (opt_startIndex || 0), 0) % 2 == 0,\n      'goog.uri.utils: Key/value lists must be even in length.');\n\n  var params = [];\n  for (var i = opt_startIndex || 0; i < keysAndValues.length; i += 2) {\n    var key = /** @type {string} */ (keysAndValues[i]);\n    goog.uri.utils.appendKeyValuePairs_(key, keysAndValues[i + 1], params);\n  }\n  return params.join('&');\n};\n\n\n/**\n * Builds a query data string from a map.\n * Currently generates \"&key&\" for empty args.\n *\n * @param {!Object<string, goog.uri.utils.QueryValue>} map An object where keys\n *     are URI-encoded parameter keys, and the values are arbitrary types\n *     or arrays. Keys with a null value are dropped.\n * @return {string} The encoded query string, in the form 'a=1&b=2'.\n */\ngoog.uri.utils.buildQueryDataFromMap = function(map) {\n  'use strict';\n  var params = [];\n  for (var key in map) {\n    goog.uri.utils.appendKeyValuePairs_(key, map[key], params);\n  }\n  return params.join('&');\n};\n\n\n/**\n * Appends URI parameters to an existing URI.\n *\n * The variable arguments may contain alternating keys and values.  Keys are\n * assumed to be already URI encoded.  The values should not be URI-encoded,\n * and will instead be encoded by this function.\n * <pre>\n * appendParams('http://www.foo.com?existing=true',\n *     'key1', 'value1',\n *     'key2', 'value?willBeEncoded',\n *     'key3', ['valueA', 'valueB', 'valueC'],\n *     'key4', null);\n * result: 'http://www.foo.com?existing=true&' +\n *     'key1=value1&' +\n *     'key2=value%3FwillBeEncoded&' +\n *     'key3=valueA&key3=valueB&key3=valueC'\n * </pre>\n *\n * A single call to this function will not exhibit quadratic behavior in IE,\n * whereas multiple repeated calls may, although the effect is limited by\n * fact that URL's generally can't exceed 2kb.\n *\n * @param {string} uri The original URI, which may already have query data.\n * @param {...(goog.uri.utils.QueryArray|goog.uri.utils.QueryValue)}\n * var_args\n *     An array or argument list conforming to goog.uri.utils.QueryArray.\n * @return {string} The URI with all query parameters added.\n */\ngoog.uri.utils.appendParams = function(uri, var_args) {\n  'use strict';\n  var queryData = arguments.length == 2 ?\n      goog.uri.utils.buildQueryData(arguments[1], 0) :\n      goog.uri.utils.buildQueryData(arguments, 1);\n  return goog.uri.utils.appendQueryDataToUri_(uri, queryData);\n};\n\n\n/**\n * Appends query parameters from a map.\n *\n * @param {string} uri The original URI, which may already have query data.\n * @param {!Object<goog.uri.utils.QueryValue>} map An object where keys are\n *     URI-encoded parameter keys, and the values are arbitrary types or arrays.\n *     Keys with a null value are dropped.\n * @return {string} The new parameters.\n */\ngoog.uri.utils.appendParamsFromMap = function(uri, map) {\n  'use strict';\n  var queryData = goog.uri.utils.buildQueryDataFromMap(map);\n  return goog.uri.utils.appendQueryDataToUri_(uri, queryData);\n};\n\n\n/**\n * Appends a single URI parameter.\n *\n * Repeated calls to this can exhibit quadratic behavior in IE6 due to the\n * way string append works, though it should be limited given the 2kb limit.\n *\n * @param {string} uri The original URI, which may already have query data.\n * @param {string} key The key, which must already be URI encoded.\n * @param {*=} opt_value The value, which will be stringized and encoded\n *     (assumed not already to be encoded).  If omitted, undefined, or null, the\n *     key will be added as a valueless parameter.\n * @return {string} The URI with the query parameter added.\n */\ngoog.uri.utils.appendParam = function(uri, key, opt_value) {\n  'use strict';\n  var value = (opt_value != null) ? '=' + goog.string.urlEncode(opt_value) : '';\n  return goog.uri.utils.appendQueryDataToUri_(uri, key + value);\n};\n\n\n/**\n * Finds the next instance of a query parameter with the specified name.\n *\n * Does not instantiate any objects.\n *\n * @param {string} uri The URI to search.  May contain a fragment identifier\n *     if opt_hashIndex is specified.\n * @param {number} startIndex The index to begin searching for the key at.  A\n *     match may be found even if this is one character after the ampersand.\n * @param {string} keyEncoded The URI-encoded key.\n * @param {number} hashOrEndIndex Index to stop looking at.  If a hash\n *     mark is present, it should be its index, otherwise it should be the\n *     length of the string.\n * @return {number} The position of the first character in the key's name,\n *     immediately after either a question mark or a dot.\n * @private\n */\ngoog.uri.utils.findParam_ = function(\n    uri, startIndex, keyEncoded, hashOrEndIndex) {\n  'use strict';\n  var index = startIndex;\n  var keyLength = keyEncoded.length;\n\n  // Search for the key itself and post-filter for surronuding punctuation,\n  // rather than expensively building a regexp.\n  while ((index = uri.indexOf(keyEncoded, index)) >= 0 &&\n         index < hashOrEndIndex) {\n    var precedingChar = uri.charCodeAt(index - 1);\n    // Ensure that the preceding character is '&' or '?'.\n    if (precedingChar == goog.uri.utils.CharCode_.AMPERSAND ||\n        precedingChar == goog.uri.utils.CharCode_.QUESTION) {\n      // Ensure the following character is '&', '=', '#', or NaN\n      // (end of string).\n      var followingChar = uri.charCodeAt(index + keyLength);\n      if (!followingChar || followingChar == goog.uri.utils.CharCode_.EQUAL ||\n          followingChar == goog.uri.utils.CharCode_.AMPERSAND ||\n          followingChar == goog.uri.utils.CharCode_.HASH) {\n        return index;\n      }\n    }\n    index += keyLength + 1;\n  }\n\n  return -1;\n};\n\n\n/**\n * Regular expression for finding a hash mark or end of string.\n * @type {RegExp}\n * @private\n */\ngoog.uri.utils.hashOrEndRe_ = /#|$/;\n\n\n/**\n * Determines if the URI contains a specific key.\n *\n * Performs no object instantiations.\n *\n * @param {string} uri The URI to process.  May contain a fragment\n *     identifier.\n * @param {string} keyEncoded The URI-encoded key.  Case-sensitive.\n * @return {boolean} Whether the key is present.\n */\ngoog.uri.utils.hasParam = function(uri, keyEncoded) {\n  'use strict';\n  return goog.uri.utils.findParam_(\n             uri, 0, keyEncoded, uri.search(goog.uri.utils.hashOrEndRe_)) >= 0;\n};\n\n\n/**\n * Gets the first value of a query parameter.\n * @param {string} uri The URI to process.  May contain a fragment.\n * @param {string} keyEncoded The URI-encoded key.  Case-sensitive.\n * @return {?string} The first value of the parameter (URI-decoded), or null\n *     if the parameter is not found.\n */\ngoog.uri.utils.getParamValue = function(uri, keyEncoded) {\n  'use strict';\n  var hashOrEndIndex = uri.search(goog.uri.utils.hashOrEndRe_);\n  var foundIndex =\n      goog.uri.utils.findParam_(uri, 0, keyEncoded, hashOrEndIndex);\n\n  if (foundIndex < 0) {\n    return null;\n  } else {\n    var endPosition = uri.indexOf('&', foundIndex);\n    if (endPosition < 0 || endPosition > hashOrEndIndex) {\n      endPosition = hashOrEndIndex;\n    }\n    // Progress forth to the end of the \"key=\" or \"key&\" substring.\n    foundIndex += keyEncoded.length + 1;\n    return goog.string.urlDecode(\n        uri.slice(foundIndex, endPosition !== -1 ? endPosition : 0));\n  }\n};\n\n\n/**\n * Gets all values of a query parameter.\n * @param {string} uri The URI to process.  May contain a fragment.\n * @param {string} keyEncoded The URI-encoded key.  Case-sensitive.\n * @return {!Array<string>} All URI-decoded values with the given key.\n *     If the key is not found, this will have length 0, but never be null.\n */\ngoog.uri.utils.getParamValues = function(uri, keyEncoded) {\n  'use strict';\n  var hashOrEndIndex = uri.search(goog.uri.utils.hashOrEndRe_);\n  var position = 0;\n  var foundIndex;\n  var result = [];\n\n  while ((foundIndex = goog.uri.utils.findParam_(\n              uri, position, keyEncoded, hashOrEndIndex)) >= 0) {\n    // Find where this parameter ends, either the '&' or the end of the\n    // query parameters.\n    position = uri.indexOf('&', foundIndex);\n    if (position < 0 || position > hashOrEndIndex) {\n      position = hashOrEndIndex;\n    }\n\n    // Progress forth to the end of the \"key=\" or \"key&\" substring.\n    foundIndex += keyEncoded.length + 1;\n    result.push(\n        goog.string.urlDecode(uri.slice(foundIndex, Math.max(position, 0))));\n  }\n\n  return result;\n};\n\n\n/**\n * Regexp to find trailing question marks and ampersands.\n * @type {RegExp}\n * @private\n */\ngoog.uri.utils.trailingQueryPunctuationRe_ = /[?&]($|#)/;\n\n\n/**\n * Removes all instances of a query parameter.\n * @param {string} uri The URI to process.  Must not contain a fragment.\n * @param {string} keyEncoded The URI-encoded key.\n * @return {string} The URI with all instances of the parameter removed.\n */\ngoog.uri.utils.removeParam = function(uri, keyEncoded) {\n  'use strict';\n  var hashOrEndIndex = uri.search(goog.uri.utils.hashOrEndRe_);\n  var position = 0;\n  var foundIndex;\n  var buffer = [];\n\n  // Look for a query parameter.\n  while ((foundIndex = goog.uri.utils.findParam_(\n              uri, position, keyEncoded, hashOrEndIndex)) >= 0) {\n    // Get the portion of the query string up to, but not including, the ?\n    // or & starting the parameter.\n    buffer.push(uri.substring(position, foundIndex));\n    // Progress to immediately after the '&'.  If not found, go to the end.\n    // Avoid including the hash mark.\n    position = Math.min(\n        (uri.indexOf('&', foundIndex) + 1) || hashOrEndIndex, hashOrEndIndex);\n  }\n\n  // Append everything that is remaining.\n  buffer.push(uri.slice(position));\n\n  // Join the buffer, and remove trailing punctuation that remains.\n  return buffer.join('').replace(\n      goog.uri.utils.trailingQueryPunctuationRe_, '$1');\n};\n\n\n/**\n * Replaces all existing definitions of a parameter with a single definition.\n *\n * Repeated calls to this can exhibit quadratic behavior due to the need to\n * find existing instances and reconstruct the string, though it should be\n * limited given the 2kb limit.  Consider using appendParams or setParamsFromMap\n * to update multiple parameters in bulk.\n *\n * @param {string} uri The original URI, which may already have query data.\n * @param {string} keyEncoded The key, which must already be URI encoded.\n * @param {*} value The value, which will be stringized and encoded (assumed\n *     not already to be encoded).\n * @return {string} The URI with the query parameter added.\n */\ngoog.uri.utils.setParam = function(uri, keyEncoded, value) {\n  'use strict';\n  return goog.uri.utils.appendParam(\n      goog.uri.utils.removeParam(uri, keyEncoded), keyEncoded, value);\n};\n\n\n/**\n * Effeciently set or remove multiple query parameters in a URI. Order of\n * unchanged parameters will not be modified, all updated parameters will be\n * appended to the end of the query. Params with values of null or undefined are\n * removed.\n *\n * @param {string} uri The URI to process.\n * @param {!Object<string, goog.uri.utils.QueryValue>} params A list of\n *     parameters to update. If null or undefined, the param will be removed.\n * @return {string} An updated URI where the query data has been updated with\n *     the params.\n */\ngoog.uri.utils.setParamsFromMap = function(uri, params) {\n  'use strict';\n  var parts = goog.uri.utils.splitQueryData_(uri);\n  var queryData = parts[1];\n  var buffer = [];\n  if (queryData) {\n    queryData.split('&').forEach(function(pair) {\n      'use strict';\n      var indexOfEquals = pair.indexOf('=');\n      var name = indexOfEquals >= 0 ? pair.slice(0, indexOfEquals) : pair;\n      if (!params.hasOwnProperty(name)) {\n        buffer.push(pair);\n      }\n    });\n  }\n  parts[1] = goog.uri.utils.appendQueryData_(\n      buffer.join('&'), goog.uri.utils.buildQueryDataFromMap(params));\n  return goog.uri.utils.joinQueryData_(parts);\n};\n\n\n/**\n * Generates a URI path using a given URI and a path with checks to\n * prevent consecutive \"//\". The baseUri passed in must not contain\n * query or fragment identifiers. The path to append may not contain query or\n * fragment identifiers.\n *\n * @param {string} baseUri URI to use as the base.\n * @param {string} path Path to append.\n * @return {string} Updated URI.\n */\ngoog.uri.utils.appendPath = function(baseUri, path) {\n  'use strict';\n  goog.uri.utils.assertNoFragmentsOrQueries_(baseUri);\n\n  // Remove any trailing '/'\n  if (goog.string.endsWith(baseUri, '/')) {\n    baseUri = baseUri.slice(0, -1);\n  }\n  // Remove any leading '/'\n  if (goog.string.startsWith(path, '/')) {\n    path = path.slice(1);\n  }\n  return '' + baseUri + '/' + path;\n};\n\n\n/**\n * Replaces the path.\n * @param {string} uri URI to use as the base.\n * @param {string} path New path.\n * @return {string} Updated URI.\n */\ngoog.uri.utils.setPath = function(uri, path) {\n  'use strict';\n  // Add any missing '/'.\n  if (!goog.string.startsWith(path, '/')) {\n    path = '/' + path;\n  }\n  var parts = goog.uri.utils.split(uri);\n  return goog.uri.utils.buildFromEncodedParts(\n      parts[goog.uri.utils.ComponentIndex.SCHEME],\n      parts[goog.uri.utils.ComponentIndex.USER_INFO],\n      parts[goog.uri.utils.ComponentIndex.DOMAIN],\n      parts[goog.uri.utils.ComponentIndex.PORT], path,\n      parts[goog.uri.utils.ComponentIndex.QUERY_DATA],\n      parts[goog.uri.utils.ComponentIndex.FRAGMENT]);\n};\n\n\n/**\n * Standard supported query parameters.\n * @enum {string}\n */\ngoog.uri.utils.StandardQueryParam = {\n\n  /** Unused parameter for unique-ifying. */\n  RANDOM: 'zx'\n};\n\n\n/**\n * Sets the zx parameter of a URI to a random value.\n * @param {string} uri Any URI.\n * @return {string} That URI with the \"zx\" parameter added or replaced to\n *     contain a random string.\n */\ngoog.uri.utils.makeUnique = function(uri) {\n  'use strict';\n  return goog.uri.utils.setParam(\n      uri, goog.uri.utils.StandardQueryParam.RANDOM,\n      goog.string.getRandomString());\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Interface and shared data structures for implementing\n * different wire protocol versions.\n */\ngoog.provide('goog.labs.net.webChannel.Wire');\ngoog.provide('goog.labs.net.webChannel.Wire.QueuedMap');\n\n\n\ngoog.require('goog.collections.maps');\n\n\n\n/**\n * The interface class.\n * @interface\n */\ngoog.labs.net.webChannel.Wire = class {\n  constructor() {}\n};\n\n\n/**\n * The latest protocol version that this class supports. We request this version\n * from the server when opening the connection. Should match\n * LATEST_CHANNEL_VERSION on the server code.\n * @type {number}\n */\ngoog.labs.net.webChannel.Wire.LATEST_CHANNEL_VERSION = 8;\n\n\n/**\n * The JSON field key for the raw data wrapper object.\n * @type {string}\n */\ngoog.labs.net.webChannel.Wire.RAW_DATA_KEY = '__data__';\n\n\n\n/**\n * Simple container class for a (mapId, map) pair.\n */\ngoog.labs.net.webChannel.Wire.QueuedMap = class {\n  /**\n   * @param {number} mapId The id for this map.\n   * @param {!Object|!goog.collections.maps.MapLike} map The map itself.\n   * @param {!Object=} opt_context The context associated with the map.\n   */\n  constructor(mapId, map, opt_context) {\n    'use strict';\n    /**\n     * The id for this map.\n     * @type {number}\n     */\n    this.mapId = mapId;\n\n    /**\n     * The map itself.\n     * @type {!Object|!goog.collections.maps.MapLike}\n     */\n    this.map = map;\n\n    /**\n     * The context for the map.\n     * @type {Object}\n     */\n    this.context = opt_context || null;\n  }\n\n  /**\n   * @return {number|undefined} the size of the raw JSON message or\n   * undefined if the message is not encoded as a raw JSON message\n   */\n  getRawDataSize() {\n    'use strict';\n    if (goog.labs.net.webChannel.Wire.RAW_DATA_KEY in this.map) {\n      const data = this.map[goog.labs.net.webChannel.Wire.RAW_DATA_KEY];\n      if (typeof data === 'string') {\n        return data.length;\n      }\n    }\n\n    return undefined;\n  }\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n\n/**\n * @fileoverview Defines a class for parsing JSON using the browser's built in\n * JSON library.\n */\n\ngoog.module('goog.json.NativeJsonProcessor');\ngoog.module.declareLegacyNamespace();\n\nconst Parser = goog.require('goog.string.Parser');\nconst Stringifier = goog.require('goog.string.Stringifier');\nconst asserts = goog.require('goog.asserts');\nconst {Replacer, Reviver} = goog.require('goog.json.types');\n\n\n\n/**\n * A class that parses and stringifies JSON using the browser's built-in JSON\n * library.\n *\n\n * @implements {Parser}\n * @implements {Stringifier}\n * @final\n */\nexports = class {\n  /**\n   * @param {?Replacer=} opt_replacer An optional replacer to use during\n   *     serialization.\n   * @param {?=} opt_reviver An optional reviver to use during\n   *     parsing.\n   */\n  constructor(opt_replacer, opt_reviver) {\n    asserts.assert(goog.global['JSON'] !== undefined, 'JSON not defined');\n\n    /**\n     * @type {!Replacer|null|undefined}\n     * @private\n     */\n    this.replacer_ = opt_replacer;\n\n    /**\n     * @type {!Reviver|null|undefined}\n     * @private\n     */\n    this.reviver_ = opt_reviver;\n  };\n\n  /**\n   * Serializes an object or a value to a string.\n   * Agnostic to the particular format of object and string.\n   *\n   * @param {*} object The object to stringify.\n   * @return {string} A string representation of the input.\n   * @override\n   */\n  stringify(object) {\n    return goog.global['JSON'].stringify(object, this.replacer_);\n  }\n\n  /**\n   * Parses a string into an object and returns the result.\n   * Agnostic to the format of string and object.\n   *\n   * @param {string} s The string to parse.\n   * @return {*} The object generated from the string.\n   * @override\n   */\n  parse(s) {\n    return goog.global['JSON'].parse(s, this.reviver_);\n  }\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utility functions for managing networking, such as\n * testing network connectivity.\n *\n */\n\n\ngoog.provide('goog.labs.net.webChannel.netUtils');\n\ngoog.require('goog.Uri');\ngoog.require('goog.labs.net.webChannel.WebChannelDebug');\n\ngoog.scope(function() {\n'use strict';\nconst netUtils = goog.labs.net.webChannel.netUtils;\nconst WebChannelDebug = goog.labs.net.webChannel.WebChannelDebug;\n\n\n/**\n * Default timeout to allow for URI pings.\n * @type {number}\n */\nnetUtils.NETWORK_TIMEOUT = 10000;\n\n\n/**\n * Pings the network with an image URI to check if an error is a server error\n * or user's network error.\n *\n * The caller needs to add a 'rand' parameter to make sure the response is\n * not fulfilled by browser cache.\n *\n * @param {function(boolean)} callback The function to call back with results.\n * @param {goog.Uri=} opt_imageUri The URI (of an image) to use for the network\n *     test.\n */\nnetUtils.testNetwork = function(callback, opt_imageUri) {\n  'use strict';\n  let uri = opt_imageUri;\n  if (!uri) {\n    // default google.com image\n    uri = new goog.Uri('//www.google.com/images/cleardot.gif');\n\n    if (!(goog.global.location && goog.global.location.protocol == 'http')) {\n      uri.setScheme('https');  // e.g. chrome-extension\n    }\n    uri.makeUnique();\n  }\n\n  netUtils.testLoadImage(uri.toString(), netUtils.NETWORK_TIMEOUT, callback);\n};\n\n\n/**\n * Test loading the given image, retrying if necessary.\n * @param {string} url URL to the image.\n * @param {number} timeout Milliseconds before giving up.\n * @param {function(boolean)} callback Function to call with results.\n * @param {number} retries The number of times to retry.\n * @param {!WebChannelDebug} channelDebug The debug object\n * @param {number=} opt_pauseBetweenRetriesMS Optional number of milliseconds\n *     between retries - defaults to 0.\n */\nnetUtils.testLoadImageWithRetries = function(\n    url, timeout, callback, retries, channelDebug, opt_pauseBetweenRetriesMS) {\n  'use strict';\n  channelDebug.debug('TestLoadImageWithRetries: ' + opt_pauseBetweenRetriesMS);\n  if (retries == 0) {\n    // no more retries, give up\n    callback(false);\n    return;\n  }\n\n  const pauseBetweenRetries = opt_pauseBetweenRetriesMS || 0;\n  retries--;\n  netUtils.testLoadImage(url, timeout, function(succeeded) {\n    'use strict';\n    if (succeeded) {\n      callback(true);\n    } else {\n      // try again\n      goog.global.setTimeout(function() {\n        'use strict';\n        netUtils.testLoadImageWithRetries(\n            url, timeout, callback, retries, channelDebug, pauseBetweenRetries);\n      }, pauseBetweenRetries);\n    }\n  });\n};\n\n\n/**\n * Test loading the given image.\n * @param {string} url URL to the image.\n * @param {number} timeout Milliseconds before giving up.\n * @param {function(boolean)} callback Function to call with results.\n * @suppress {strictMissingProperties} Part of the go/strict_warnings_migration\n */\nnetUtils.testLoadImage = function(url, timeout, callback) {\n  'use strict';\n  const channelDebug = new WebChannelDebug();\n  channelDebug.debug('TestLoadImage: loading ' + url);\n  if (goog.global.Image) {\n    const img = new Image();\n    img.onload = goog.partial(\n        netUtils.imageCallback_, channelDebug, img, 'TestLoadImage: loaded',\n        true, callback);\n    img.onerror = goog.partial(\n        netUtils.imageCallback_, channelDebug, img, 'TestLoadImage: error',\n        false, callback);\n    img.onabort = goog.partial(\n        netUtils.imageCallback_, channelDebug, img, 'TestLoadImage: abort',\n        false, callback);\n    img.ontimeout = goog.partial(\n        netUtils.imageCallback_, channelDebug, img, 'TestLoadImage: timeout',\n        false, callback);\n\n    goog.global.setTimeout(function() {\n      'use strict';\n      if (img.ontimeout) {\n        img.ontimeout();\n      }\n    }, timeout);\n    img.src = url;\n  } else {\n    // log ERROR_OTHER from environements where Image is not supported\n    callback(false);\n  }\n};\n\n\n/**\n * Wrap the image callback with debug and cleanup logic.\n * @param {!WebChannelDebug} channelDebug The WebChannelDebug object.\n * @param {!Image} img The image element.\n * @param {string} debugText The debug text.\n * @param {boolean} result The result of image loading.\n * @param {function(boolean)} callback The image callback.\n * @private\n */\nnetUtils.imageCallback_ = function(\n    channelDebug, img, debugText, result, callback) {\n  'use strict';\n  try {\n    channelDebug.debug(debugText);\n    netUtils.clearImageCallbacks_(img);\n    callback(result);\n  } catch (e) {\n    channelDebug.dumpException(e);\n  }\n};\n\n\n/**\n * Clears handlers to avoid memory leaks.\n * @param {Image} img The image to clear handlers from.\n * @private\n * @suppress {strictMissingProperties} Part of the go/strict_warnings_migration\n */\nnetUtils.clearImageCallbacks_ = function(img) {\n  'use strict';\n  img.onload = null;\n  img.onerror = null;\n  img.onabort = null;\n  img.ontimeout = null;\n};\n});  // goog.scope\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\ngoog.provide('goog.net.FetchXmlHttp');\ngoog.provide('goog.net.FetchXmlHttpFactory');\n\ngoog.require('goog.asserts');\ngoog.require('goog.events.EventTarget');\ngoog.require('goog.functions');\ngoog.require('goog.log');\ngoog.require('goog.net.XhrLike');\ngoog.require('goog.net.XmlHttpFactory');\n\n\n\n/**\n * @record\n */\ngoog.net.FetchXmlHttpFactoryOptions = function() {\n  /**\n   * @type {!WorkerGlobalScope|undefined} The Service Worker global scope.\n   */\n  this.worker;\n\n  /**\n   * @type {boolean|undefined} Whether to store the FetchXmlHttp response as an\n   * array of Uint8Arrays.  If this is true then the 'responseType' attribute\n   * must be empty.\n   */\n  this.streamBinaryChunks;\n};\n\n\n\n/**\n * Factory for creating Xhr objects that uses the native fetch() method.\n * https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API\n * @param {!goog.net.FetchXmlHttpFactoryOptions} opts\n * @extends {goog.net.XmlHttpFactory}\n * @struct\n * @constructor\n */\ngoog.net.FetchXmlHttpFactory = function(opts) {\n  'use strict';\n  goog.net.FetchXmlHttpFactory.base(this, 'constructor');\n\n  /** @private @final {?WorkerGlobalScope} */\n  this.worker_ = opts.worker || null;\n\n  /** @private @final {boolean} */\n  this.streamBinaryChunks_ = opts.streamBinaryChunks || false;\n\n  /** @private {!RequestCredentials|undefined} */\n  this.credentialsMode_ = undefined;\n\n  /** @private {!RequestCache|undefined} */\n  this.cacheMode_ = undefined;\n};\ngoog.inherits(goog.net.FetchXmlHttpFactory, goog.net.XmlHttpFactory);\n\n\n/** @override */\ngoog.net.FetchXmlHttpFactory.prototype.createInstance = function() {\n  'use strict';\n  const instance =\n      new goog.net.FetchXmlHttp(this.worker_, this.streamBinaryChunks_);\n  if (this.credentialsMode_) {\n    instance.setCredentialsMode(this.credentialsMode_);\n  }\n  if (this.cacheMode_) {\n    instance.setCacheMode(this.cacheMode_);\n  }\n  return instance;\n};\n\n\n/** @override */\ngoog.net.FetchXmlHttpFactory.prototype.internalGetOptions =\n    goog.functions.constant({});\n\n\n/**\n * @param {!RequestCredentials} credentialsMode The credentials mode of the\n *     Service Worker fetch.\n */\ngoog.net.FetchXmlHttpFactory.prototype.setCredentialsMode = function(\n    credentialsMode) {\n  'use strict';\n  this.credentialsMode_ = credentialsMode;\n};\n\n\n/**\n * @param {!RequestCache} cacheMode The cache mode of the Service Worker fetch.\n */\ngoog.net.FetchXmlHttpFactory.prototype.setCacheMode = function(cacheMode) {\n  'use strict';\n  this.cacheMode_ = cacheMode;\n};\n\n\n\n/**\n * FetchXmlHttp object constructor.\n * @param {?WorkerGlobalScope} worker\n * @param {boolean} streamBinaryChunks\n * @extends {goog.events.EventTarget}\n * @implements {goog.net.XhrLike}\n * @constructor\n * @struct\n */\ngoog.net.FetchXmlHttp = function(worker, streamBinaryChunks) {\n  'use strict';\n  goog.net.FetchXmlHttp.base(this, 'constructor');\n\n  /** @private @final {?WorkerGlobalScope} */\n  this.worker_ = worker;\n\n  /** @private @final {boolean} */\n  this.streamBinaryChunks_ = streamBinaryChunks;\n\n  /** @private {RequestCredentials|undefined} */\n  this.credentialsMode_ = undefined;\n\n  /** @private {RequestCache|undefined} */\n  this.cacheMode_ = undefined;\n\n  /**\n   * Request state.\n   * @type {goog.net.FetchXmlHttp.RequestState}\n   */\n  this.readyState = goog.net.FetchXmlHttp.RequestState.UNSENT;\n\n  /**\n   * HTTP status.\n   * @type {number}\n   */\n  this.status = 0;\n\n  /**\n   * HTTP status string.\n   * @type {string}\n   */\n  this.statusText = '';\n\n  /**\n   * Content of the response.\n   * @type {string|!ArrayBuffer|!Array<!Uint8Array>}\n   */\n  this.response = '';\n\n  /**\n   * Content of the response.\n   * @type {string}\n   */\n  this.responseText = '';\n\n  /**\n   * The type of the response.  If this is set to 'arraybuffer' the request will\n   * be discrete, streaming is only supported for text encoded requests.\n   * @type {string}\n   */\n  this.responseType = '';\n\n  /**\n   * Document response entity body.\n   * NOTE: This is always null and not supported by this class.\n   * @final {null}\n   */\n  this.responseXML = null;\n\n  /**\n   * Method to call when the state changes.\n   * @type {?function()}\n   */\n  this.onreadystatechange = null;\n\n  /** @private {!Headers} */\n  this.requestHeaders_ = new Headers();\n\n  /** @private {?Headers} */\n  this.responseHeaders_ = null;\n\n  /**\n   * Request method (GET or POST).\n   * @private {string}\n   */\n  this.method_ = 'GET';\n\n  /**\n   * Request URL.\n   * @private {string}\n   */\n  this.url_ = '';\n\n  /**\n   * Whether the request is in progress.\n   * @private {boolean}\n   */\n  this.inProgress_ = false;\n\n  /** @private @final {?goog.log.Logger} */\n  this.logger_ = goog.log.getLogger('goog.net.FetchXmlHttp');\n\n  /** @private {?Response} */\n  this.fetchResponse_ = null;\n\n  /** @private {!ReadableStreamDefaultReader|null} */\n  this.currentReader_ = null;\n\n  /** @private {?TextDecoder} */\n  this.textDecoder_ = null;\n};\ngoog.inherits(goog.net.FetchXmlHttp, goog.events.EventTarget);\n\n\n/**\n * State of the requests.\n * @enum {number}\n */\ngoog.net.FetchXmlHttp.RequestState = {\n  UNSENT: 0,\n  OPENED: 1,\n  HEADER_RECEIVED: 2,\n  LOADING: 3,\n  DONE: 4,\n};\n\n\n/** @override */\ngoog.net.FetchXmlHttp.prototype.open = function(method, url, opt_async) {\n  'use strict';\n  goog.asserts.assert(!!opt_async, 'Only async requests are supported.');\n  if (this.readyState != goog.net.FetchXmlHttp.RequestState.UNSENT) {\n    this.abort();\n    throw new Error('Error reopening a connection');\n  }\n\n  this.method_ = method;\n  this.url_ = url;\n\n  this.readyState = goog.net.FetchXmlHttp.RequestState.OPENED;\n  this.dispatchCallback_();\n};\n\n\n/** @override */\ngoog.net.FetchXmlHttp.prototype.send = function(opt_data) {\n  'use strict';\n  if (this.readyState != goog.net.FetchXmlHttp.RequestState.OPENED) {\n    this.abort();\n    throw new Error('need to call open() first. ');\n  }\n\n  this.inProgress_ = true;\n  const requestInit = {\n    headers: this.requestHeaders_,\n    method: this.method_,\n    credentials: this.credentialsMode_,\n    cache: this.cacheMode_,\n  };\n  if (opt_data) {\n    requestInit['body'] = opt_data;\n  }\n\n  (this.worker_ || goog.global)\n      .fetch(new Request(this.url_, /** @type {!RequestInit} */ (requestInit)))\n      .then(\n          this.handleResponse_.bind(this), this.handleSendFailure_.bind(this));\n};\n\n\n/** @override */\ngoog.net.FetchXmlHttp.prototype.abort = function() {\n  'use strict';\n  this.response = this.responseText = '';\n  this.requestHeaders_ = new Headers();\n  this.status = 0;\n\n  if (!!this.currentReader_) {\n    this.currentReader_.cancel('Request was aborted.')\n        .catch(\n            e => goog.log.warning(\n                this.logger_, 'Fetch reader cancellation error.', e));\n  }\n\n  if (((this.readyState >= goog.net.FetchXmlHttp.RequestState.OPENED) &&\n       this.inProgress_) &&\n      (this.readyState != goog.net.FetchXmlHttp.RequestState.DONE)) {\n    this.inProgress_ = false;\n    this.requestDone_();\n  }\n\n  this.readyState = goog.net.FetchXmlHttp.RequestState.UNSENT;\n};\n\n\n/**\n * Handles the fetch response.\n * @param {!Response} response\n * @private\n */\ngoog.net.FetchXmlHttp.prototype.handleResponse_ = function(response) {\n  'use strict';\n  if (!this.inProgress_) {\n    // The request was aborted, ignore.\n    return;\n  }\n\n  this.fetchResponse_ = response;\n\n  if (!this.responseHeaders_) {\n    this.status = this.fetchResponse_.status;\n    this.statusText = this.fetchResponse_.statusText;\n    this.responseHeaders_ = response.headers;\n    this.readyState = goog.net.FetchXmlHttp.RequestState.HEADER_RECEIVED;\n    this.dispatchCallback_();\n  }\n  // A callback may abort the request.\n  if (!this.inProgress_) {\n    // The request was aborted, ignore.\n    return;\n  }\n\n  this.readyState = goog.net.FetchXmlHttp.RequestState.LOADING;\n  this.dispatchCallback_();\n  // A callback may abort the request.\n  if (!this.inProgress_) {\n    // The request was aborted, ignore.\n    return;\n  }\n\n  if (this.responseType === 'arraybuffer') {\n    response.arrayBuffer().then(\n        this.handleResponseArrayBuffer_.bind(this),\n        this.handleSendFailure_.bind(this));\n  } else if (\n      typeof (goog.global.ReadableStream) !== 'undefined' &&\n      'body' in response) {\n    this.currentReader_ =\n        /** @type {!ReadableStreamDefaultReader} */ (response.body.getReader());\n    if (this.streamBinaryChunks_) {\n      if (this.responseType) {\n        throw new Error(\n            'responseType must be empty for \"streamBinaryChunks\" mode responses.');\n      }\n      this.response = [];\n    } else {\n      this.response = this.responseText = '';\n      this.textDecoder_ = new TextDecoder();\n    }\n    this.readInputFromFetch_();\n  } else {\n    response.text().then(\n        this.handleResponseText_.bind(this),\n        this.handleSendFailure_.bind(this));\n  }\n};\n\n\n/**\n * Reads the next chunk of data from the fetch response.\n * @private\n */\ngoog.net.FetchXmlHttp.prototype.readInputFromFetch_ = function() {\n  'use strict';\n  this.currentReader_.read()\n      .then(this.handleDataFromStream_.bind(this))\n      .catch(this.handleSendFailure_.bind(this));\n};\n\n\n/**\n * Handles a chunk of data from the fetch response stream reader.\n * @param {!IIterableResult} result\n * @private\n */\ngoog.net.FetchXmlHttp.prototype.handleDataFromStream_ = function(result) {\n  'use strict';\n  if (!this.inProgress_) {\n    // The request was aborted, ignore.\n    return;\n  }\n\n  if (this.streamBinaryChunks_ && result.value) {\n    // When streamBinaryChunks_ is enabled, \"response\" is an array\n    /** @type {!Array} */ (this.response)\n        .push(/** @type {!Uint8Array} */ (result.value));\n  } else if (!this.streamBinaryChunks_) {\n    const dataPacket = result.value ?\n        /** @type {!Uint8Array} */ (result.value) :\n        new Uint8Array(0);\n    const newText =\n        this.textDecoder_.decode(dataPacket, {stream: !result.done});\n    if (newText) {\n      this.responseText += newText;\n      this.response = this.responseText;\n    }\n  }\n  if (result.done) {\n    this.requestDone_();\n  } else {\n    this.dispatchCallback_();\n  }\n\n  if (this.readyState == goog.net.FetchXmlHttp.RequestState.LOADING) {\n    this.readInputFromFetch_();\n  }\n};\n\n/**\n * Handles the response text.\n * @param {string} responseText\n * @private\n */\ngoog.net.FetchXmlHttp.prototype.handleResponseText_ = function(responseText) {\n  'use strict';\n  if (!this.inProgress_) {\n    // The request was aborted, ignore.\n    return;\n  }\n  this.response = this.responseText = responseText;\n  this.requestDone_();\n};\n\n\n/**\n * Handles the response text.\n * @param {!ArrayBuffer} responseArrayBuffer\n * @private\n */\ngoog.net.FetchXmlHttp.prototype.handleResponseArrayBuffer_ = function(\n    responseArrayBuffer) {\n  'use strict';\n  if (!this.inProgress_) {\n    // The request was aborted, ignore.\n    return;\n  }\n  this.response = responseArrayBuffer;\n  this.requestDone_();\n};\n\n\n/**\n * Handles the send failure.\n * @param {*} error\n * @private\n */\ngoog.net.FetchXmlHttp.prototype.handleSendFailure_ = function(error) {\n  'use strict';\n  const e = error instanceof Error ? error : Error(error);\n  goog.log.warning(this.logger_, 'Failed to fetch url ' + this.url_, e);\n  if (!this.inProgress_) {\n    // The request was aborted, ignore.\n    return;\n  }\n  this.requestDone_();\n};\n\n\n/**\n * Sets the request state to DONE and performs cleanup.\n * @private\n */\ngoog.net.FetchXmlHttp.prototype.requestDone_ = function() {\n  'use strict';\n  this.readyState = goog.net.FetchXmlHttp.RequestState.DONE;\n\n  this.fetchResponse_ = null;\n  this.currentReader_ = null;\n  this.textDecoder_ = null;\n\n  this.dispatchCallback_();\n};\n\n\n/** @override */\ngoog.net.FetchXmlHttp.prototype.setRequestHeader = function(header, value) {\n  'use strict';\n  this.requestHeaders_.append(header, value);\n};\n\n\n/** @override */\ngoog.net.FetchXmlHttp.prototype.getResponseHeader = function(header) {\n  'use strict';\n  // TODO(user): This method should return null when the headers are not\n  // present or the specified header is missing. The externs need to be fixed.\n  if (!this.responseHeaders_) {\n    goog.log.warning(\n        this.logger_,\n        'Attempting to get response header but no headers have been received ' +\n            'for url: ' + this.url_);\n    return '';\n  }\n  return this.responseHeaders_.get(header.toLowerCase()) || '';\n};\n\n\n/** @override */\ngoog.net.FetchXmlHttp.prototype.getAllResponseHeaders = function() {\n  'use strict';\n  if (!this.responseHeaders_) {\n    goog.log.warning(\n        this.logger_,\n        'Attempting to get all response headers but no headers have been ' +\n            'received for url: ' + this.url_);\n    return '';\n  }\n  const lines = [];\n  const iter = this.responseHeaders_.entries();\n  let entry = iter.next();\n  while (!entry.done) {\n    const pair = entry.value;\n    lines.push(pair[0] + ': ' + pair[1]);\n    entry = iter.next();\n  }\n  return lines.join('\\r\\n');\n};\n\n\n/**\n * @param {!RequestCredentials} credentialsMode The credentials mode of the\n *     Service Worker fetch.\n */\ngoog.net.FetchXmlHttp.prototype.setCredentialsMode = function(credentialsMode) {\n  'use strict';\n  this.credentialsMode_ = credentialsMode;\n};\n\n/**\n * @return {!RequestCredentials|undefined} The credentials mode of the\n *     Service Worker fetch.\n */\ngoog.net.FetchXmlHttp.prototype.getCredentialsMode = function() {\n  'use strict';\n  return this.credentialsMode_;\n};\n\n/**\n * @param {!RequestCache} cacheMode The cache mode of the Service Worker fetch.\n */\ngoog.net.FetchXmlHttp.prototype.setCacheMode = function(cacheMode) {\n  'use strict';\n  this.cacheMode_ = cacheMode;\n};\n\n\n/**\n * Dispatches the callback, if the callback attribute is defined.\n * @private\n */\ngoog.net.FetchXmlHttp.prototype.dispatchCallback_ = function() {\n  'use strict';\n  if (this.onreadystatechange) {\n    this.onreadystatechange.call(this);\n  }\n};\n\n// Polyfill XmlHttpRequest's withCredentials property for specifying whether to\n// include credentials on cross domain requests.\nObject.defineProperty(goog.net.FetchXmlHttp.prototype, 'withCredentials', {\n  get:\n      /**\n       * @this {goog.net.FetchXmlHttp}\n       * @return {boolean} Whether to include credentials in cross domain\n       *     requests.\n       */\n      function() {\n        'use strict';\n        return this.getCredentialsMode() === 'include';\n      },\n\n  set:\n      /**\n       * @param {boolean} value Whether to include credentials in cross domain\n       *     requests.\n       * @this {goog.net.FetchXmlHttp}\n       **/\n      function(value) {\n        'use strict';\n        this.setCredentialsMode(value ? 'include' : 'same-origin');\n      }\n});\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utilities for creating functions. Loosely inspired by these\n * java classes from the Guava library:\n * com.google.common.base.Functions\n * https://google.github.io/guava/releases/snapshot-jre/api/docs/index.html?com/google/common/base/Functions.html\n *\n * com.google.common.base.Predicates\n * https://google.github.io/guava/releases/snapshot-jre/api/docs/index.html?com/google/common/base/Predicates.html\n *\n * More about these can be found at\n * https://github.com/google/guava/wiki/FunctionalExplained\n */\n\n\ngoog.provide('goog.functions');\n\n\n/**\n * Creates a function that always returns the same value.\n * @param {T} retValue The value to return.\n * @return {function():T} The new function.\n * @template T\n */\ngoog.functions.constant = function(retValue) {\n  'use strict';\n  return function() {\n    'use strict';\n    return retValue;\n  };\n};\n\n\n/**\n * Always returns false.\n * @type {function(...): boolean}\n */\ngoog.functions.FALSE = function() {\n  'use strict';\n  return false;\n};\n\n\n/**\n * Always returns true.\n * @type {function(...): boolean}\n */\ngoog.functions.TRUE = function() {\n  'use strict';\n  return true;\n};\n\n\n/**\n * Always returns `null`.\n * @type {function(...): null}\n */\ngoog.functions.NULL = function() {\n  'use strict';\n  return null;\n};\n\n\n/**\n * Always returns `undefined`.\n * @type {function(...): undefined}\n */\ngoog.functions.UNDEFINED = function() {\n  return undefined;\n};\n\n/**\n * Always returns `undefined` (loosely-typed version).\n * @type {!Function}\n */\ngoog.functions.EMPTY = /** @type {?} */ (goog.functions.UNDEFINED);\n\n\n/**\n * A simple function that returns the first argument of whatever is passed\n * into it.\n * @param {T=} opt_returnValue The single value that will be returned.\n * @param {...*} var_args Optional trailing arguments. These are ignored.\n * @return {T} The first argument passed in, or undefined if nothing was passed.\n * @template T\n */\ngoog.functions.identity = function(opt_returnValue, var_args) {\n  'use strict';\n  return opt_returnValue;\n};\n\n\n/**\n * Creates a function that always throws an error with the given message.\n * @param {string} message The error message.\n * @return {!Function} The error-throwing function.\n */\ngoog.functions.error = function(message) {\n  'use strict';\n  return function() {\n    'use strict';\n    throw new Error(message);\n  };\n};\n\n\n/**\n * Creates a function that throws the given object.\n * @param {*} err An object to be thrown.\n * @return {!Function} The error-throwing function.\n */\ngoog.functions.fail = function(err) {\n  'use strict';\n  return function() {\n    'use strict';\n    throw err;\n  };\n};\n\n\n/**\n * Given a function, create a function that keeps opt_numArgs arguments and\n * silently discards all additional arguments.\n * @param {Function} f The original function.\n * @param {number=} opt_numArgs The number of arguments to keep. Defaults to 0.\n * @return {!Function} A version of f that only keeps the first opt_numArgs\n *     arguments.\n */\ngoog.functions.lock = function(f, opt_numArgs) {\n  'use strict';\n  opt_numArgs = opt_numArgs || 0;\n  return function() {\n    'use strict';\n    const self = /** @type {*} */ (this);\n    return f.apply(self, Array.prototype.slice.call(arguments, 0, opt_numArgs));\n  };\n};\n\n\n/**\n * Creates a function that returns its nth argument.\n * @param {number} n The position of the return argument.\n * @return {!Function} A new function.\n */\ngoog.functions.nth = function(n) {\n  'use strict';\n  return function() {\n    'use strict';\n    return arguments[n];\n  };\n};\n\n\n/**\n * Like goog.partial(), except that arguments are added after arguments to the\n * returned function.\n *\n * Usage:\n * function f(arg1, arg2, arg3, arg4) { ... }\n * var g = goog.functions.partialRight(f, arg3, arg4);\n * g(arg1, arg2);\n *\n * @param {!Function} fn A function to partially apply.\n * @param {...*} var_args Additional arguments that are partially applied to fn\n *     at the end.\n * @return {!Function} A partially-applied form of the function goog.partial()\n *     was invoked as a method of.\n */\ngoog.functions.partialRight = function(fn, var_args) {\n  'use strict';\n  const rightArgs = Array.prototype.slice.call(arguments, 1);\n  return function() {\n    'use strict';\n    // Even in strict mode, IE10/11 and Edge (non-Chromium) use global context\n    // when free-calling functions. To catch cases where people were using this\n    // erroneously, we explicitly change the context to undefined to match\n    // strict mode specifications.\n    let self = /** @type {*} */ (this);\n    if (self === goog.global) {\n      self = undefined;\n    }\n    const newArgs = Array.prototype.slice.call(arguments);\n    newArgs.push.apply(newArgs, rightArgs);\n    return fn.apply(self, newArgs);\n  };\n};\n\n\n/**\n * Given a function, create a new function that swallows its return value\n * and replaces it with a new one.\n * @param {Function} f A function.\n * @param {T} retValue A new return value.\n * @return {function(...?):T} A new function.\n * @template T\n */\ngoog.functions.withReturnValue = function(f, retValue) {\n  'use strict';\n  return goog.functions.sequence(f, goog.functions.constant(retValue));\n};\n\n\n/**\n * Creates a function that returns whether its argument equals the given value.\n *\n * Example:\n * var key = goog.object.findKey(obj, goog.functions.equalTo('needle'));\n *\n * @param {*} value The value to compare to.\n * @param {boolean=} opt_useLooseComparison Whether to use a loose (==)\n *     comparison rather than a strict (===) one. Defaults to false.\n * @return {function(*):boolean} The new function.\n */\ngoog.functions.equalTo = function(value, opt_useLooseComparison) {\n  'use strict';\n  return function(other) {\n    'use strict';\n    return opt_useLooseComparison ? (value == other) : (value === other);\n  };\n};\n\n\n/**\n * Creates the composition of the functions passed in.\n * For example, (goog.functions.compose(f, g))(a) is equivalent to f(g(a)).\n * @param {function(...?):T} fn The final function.\n * @param {...Function} var_args A list of functions.\n * @return {function(...?):T} The composition of all inputs.\n * @template T\n */\ngoog.functions.compose = function(fn, var_args) {\n  'use strict';\n  const functions = arguments;\n  const length = functions.length;\n  return function() {\n    'use strict';\n    const self = /** @type {*} */ (this);\n    let result;\n    if (length) {\n      result = functions[length - 1].apply(self, arguments);\n    }\n\n    for (let i = length - 2; i >= 0; i--) {\n      result = functions[i].call(self, result);\n    }\n    return result;\n  };\n};\n\n\n/**\n * Creates a function that calls the functions passed in in sequence, and\n * returns the value of the last function. For example,\n * (goog.functions.sequence(f, g))(x) is equivalent to f(x),g(x).\n * @param {...Function} var_args A list of functions.\n * @return {!Function} A function that calls all inputs in sequence.\n */\ngoog.functions.sequence = function(var_args) {\n  'use strict';\n  const functions = arguments;\n  const length = functions.length;\n  return function() {\n    'use strict';\n    const self = /** @type {*} */ (this);\n    let result;\n    for (let i = 0; i < length; i++) {\n      result = functions[i].apply(self, arguments);\n    }\n    return result;\n  };\n};\n\n\n/**\n * Creates a function that returns true if each of its components evaluates\n * to true. The components are evaluated in order, and the evaluation will be\n * short-circuited as soon as a function returns false.\n * For example, (goog.functions.and(f, g))(x) is equivalent to f(x) && g(x).\n * @param {...Function} var_args A list of functions.\n * @return {function(...?):boolean} A function that ANDs its component\n *      functions.\n */\ngoog.functions.and = function(var_args) {\n  'use strict';\n  const functions = arguments;\n  const length = functions.length;\n  return function() {\n    'use strict';\n    const self = /** @type {*} */ (this);\n    for (let i = 0; i < length; i++) {\n      if (!functions[i].apply(self, arguments)) {\n        return false;\n      }\n    }\n    return true;\n  };\n};\n\n\n/**\n * Creates a function that returns true if any of its components evaluates\n * to true. The components are evaluated in order, and the evaluation will be\n * short-circuited as soon as a function returns true.\n * For example, (goog.functions.or(f, g))(x) is equivalent to f(x) || g(x).\n * @param {...Function} var_args A list of functions.\n * @return {function(...?):boolean} A function that ORs its component\n *    functions.\n */\ngoog.functions.or = function(var_args) {\n  'use strict';\n  const functions = arguments;\n  const length = functions.length;\n  return function() {\n    'use strict';\n    const self = /** @type {*} */ (this);\n    for (let i = 0; i < length; i++) {\n      if (functions[i].apply(self, arguments)) {\n        return true;\n      }\n    }\n    return false;\n  };\n};\n\n\n/**\n * Creates a function that returns the Boolean opposite of a provided function.\n * For example, (goog.functions.not(f))(x) is equivalent to !f(x).\n * @param {!Function} f The original function.\n * @return {function(...?):boolean} A function that delegates to f and returns\n * opposite.\n */\ngoog.functions.not = function(f) {\n  'use strict';\n  return function() {\n    'use strict';\n    const self = /** @type {*} */ (this);\n    return !f.apply(self, arguments);\n  };\n};\n\n\n/**\n * Generic factory function to construct an object given the constructor\n * and the arguments. Intended to be bound to create object factories.\n *\n * Example:\n *\n * var factory = goog.partial(goog.functions.create, Class);\n *\n * @param {function(new:T, ...)} constructor The constructor for the Object.\n * @param {...*} var_args The arguments to be passed to the constructor.\n * @return {T} A new instance of the class given in `constructor`.\n * @template T\n * @deprecated This function does not work with ES6 class constructors. Use\n *     arrow functions + spread args instead.\n */\ngoog.functions.create = function(constructor, var_args) {\n  'use strict';\n  /**\n   * @constructor\n   * @final\n   */\n  const temp = function() {};\n  temp.prototype = constructor.prototype;\n\n  // obj will have constructor's prototype in its chain and\n  // 'obj instanceof constructor' will be true.\n  const obj = new temp();\n\n  // obj is initialized by constructor.\n  // arguments is only array-like so lacks shift(), but can be used with\n  // the Array prototype function.\n  constructor.apply(obj, Array.prototype.slice.call(arguments, 1));\n  return obj;\n};\n\n\n/**\n * @define {boolean} Whether the return value cache should be used.\n *    This should only be used to disable caches when testing.\n */\ngoog.functions.CACHE_RETURN_VALUE =\n    goog.define('goog.functions.CACHE_RETURN_VALUE', true);\n\n\n/**\n * Gives a wrapper function that caches the return value of a parameterless\n * function when first called.\n *\n * When called for the first time, the given function is called and its\n * return value is cached (thus this is only appropriate for idempotent\n * functions).  Subsequent calls will return the cached return value. This\n * allows the evaluation of expensive functions to be delayed until first used.\n *\n * To cache the return values of functions with parameters, see goog.memoize.\n *\n * @param {function():T} fn A function to lazily evaluate.\n * @return {function():T} A wrapped version the function.\n * @template T\n */\ngoog.functions.cacheReturnValue = function(fn) {\n  'use strict';\n  let called = false;\n  let value;\n\n  return function() {\n    'use strict';\n    if (!goog.functions.CACHE_RETURN_VALUE) {\n      return fn();\n    }\n\n    if (!called) {\n      value = fn();\n      called = true;\n    }\n\n    return value;\n  };\n};\n\n\n/**\n * Wraps a function to allow it to be called, at most, once. All\n * additional calls are no-ops.\n *\n * This is particularly useful for initialization functions\n * that should be called, at most, once.\n *\n * @param {function():*} f Function to call.\n * @return {function():undefined} Wrapped function.\n */\ngoog.functions.once = function(f) {\n  'use strict';\n  // Keep a reference to the function that we null out when we're done with\n  // it -- that way, the function can be GC'd when we're done with it.\n  let inner = f;\n  return function() {\n    'use strict';\n    if (inner) {\n      const tmp = inner;\n      inner = null;\n      tmp();\n    }\n  };\n};\n\n\n/**\n * Wraps a function to allow it to be called, at most, once per interval\n * (specified in milliseconds). If the wrapper function is called N times within\n * that interval, only the Nth call will go through.\n *\n * This is particularly useful for batching up repeated actions where the\n * last action should win. This can be used, for example, for refreshing an\n * autocomplete pop-up every so often rather than updating with every keystroke,\n * since the final text typed by the user is the one that should produce the\n * final autocomplete results. For more stateful debouncing with support for\n * pausing, resuming, and canceling debounced actions, use\n * `goog.async.Debouncer`.\n *\n * @param {function(this:SCOPE, ...?)} f Function to call.\n * @param {number} interval Interval over which to debounce. The function will\n *     only be called after the full interval has elapsed since the last call.\n * @param {SCOPE=} opt_scope Object in whose scope to call the function.\n * @return {function(...?): undefined} Wrapped function.\n * @template SCOPE\n */\ngoog.functions.debounce = function(f, interval, opt_scope) {\n  'use strict';\n  let timeout = 0;\n  return /** @type {function(...?)} */ (function(var_args) {\n    'use strict';\n    goog.global.clearTimeout(timeout);\n    const args = arguments;\n    timeout = goog.global.setTimeout(function() {\n      'use strict';\n      f.apply(opt_scope, args);\n    }, interval);\n  });\n};\n\n\n/**\n * Wraps a function to allow it to be called, at most, once per interval\n * (specified in milliseconds). If the wrapper function is called N times in\n * that interval, both the 1st and the Nth calls will go through.\n *\n * This is particularly useful for limiting repeated user requests where the\n * the last action should win, but you also don't want to wait until the end of\n * the interval before sending a request out, as it leads to a perception of\n * slowness for the user.\n *\n * @param {function(this:SCOPE, ...?)} f Function to call.\n * @param {number} interval Interval over which to throttle. The function can\n *     only be called once per interval.\n * @param {SCOPE=} opt_scope Object in whose scope to call the function.\n * @return {function(...?): undefined} Wrapped function.\n * @template SCOPE\n */\ngoog.functions.throttle = function(f, interval, opt_scope) {\n  'use strict';\n  let timeout = 0;\n  let shouldFire = false;\n  let storedArgs = [];\n\n  const handleTimeout = function() {\n    'use strict';\n    timeout = 0;\n    if (shouldFire) {\n      shouldFire = false;\n      fire();\n    }\n  };\n\n  const fire = function() {\n    'use strict';\n    timeout = goog.global.setTimeout(handleTimeout, interval);\n    let args = storedArgs;\n    storedArgs = [];  // Avoid a space leak by clearing stored arguments.\n    f.apply(opt_scope, args);\n  };\n\n  return /** @type {function(...?)} */ (function(var_args) {\n    'use strict';\n    storedArgs = arguments;\n    if (!timeout) {\n      fire();\n    } else {\n      shouldFire = true;\n    }\n  });\n};\n\n\n/**\n * Wraps a function to allow it to be called, at most, once per interval\n * (specified in milliseconds). If the wrapper function is called N times within\n * that interval, only the 1st call will go through.\n *\n * This is particularly useful for limiting repeated user requests where the\n * first request is guaranteed to have all the data required to perform the\n * final action, so there's no need to wait until the end of the interval before\n * sending the request out.\n *\n * @param {function(this:SCOPE, ...?)} f Function to call.\n * @param {number} interval Interval over which to rate-limit. The function will\n *     only be called once per interval, and ignored for the remainer of the\n *     interval.\n * @param {SCOPE=} opt_scope Object in whose scope to call the function.\n * @return {function(...?): undefined} Wrapped function.\n * @template SCOPE\n */\ngoog.functions.rateLimit = function(f, interval, opt_scope) {\n  'use strict';\n  let timeout = 0;\n\n  const handleTimeout = function() {\n    'use strict';\n    timeout = 0;\n  };\n\n  return /** @type {function(...?)} */ (function(var_args) {\n    'use strict';\n    if (!timeout) {\n      timeout = goog.global.setTimeout(handleTimeout, interval);\n      f.apply(opt_scope, arguments);\n    }\n  });\n};\n\n/**\n * Returns true if the specified value is a function.\n * @param {*} val Variable to test.\n * @return {boolean} Whether variable is a function.\n */\ngoog.functions.isFunction = (val) => {\n  return typeof val === 'function';\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n\n/**\n * @fileoverview Utility to attempt native JSON processing, falling back to\n *     goog.json if not available.\n *\n *     This is intended as a drop-in for current users of goog.json who want\n *     to take advantage of native JSON if present.\n */\n\ngoog.provide('goog.json.hybrid');\n\ngoog.require('goog.asserts');\ngoog.require('goog.json');\n\n\n/**\n * Attempts to serialize the JSON string natively, falling back to\n * `goog.json.serialize` if unsuccessful.\n * @param {!Object} obj JavaScript object to serialize to JSON.\n * @return {string} Resulting JSON string.\n */\ngoog.json.hybrid.stringify = goog.json.USE_NATIVE_JSON ?\n    goog.global['JSON']['stringify'] :\n    function(obj) {\n      'use strict';\n      if (goog.global.JSON) {\n        try {\n          return goog.global.JSON.stringify(obj);\n        } catch (e) {\n          // Native serialization failed.  Fall through to retry with\n          // goog.json.serialize.\n        }\n      }\n\n      return goog.json.serialize(obj);\n    };\n\n\n/**\n * Attempts to parse the JSON string natively, falling back to\n * the supplied `fallbackParser` if unsuccessful.\n * @param {string} jsonString JSON string to parse.\n * @param {function(string):Object} fallbackParser Fallback JSON parser used\n *     if native\n * @return {?Object} Resulting JSON object.\n * @private\n */\ngoog.json.hybrid.parse_ = function(jsonString, fallbackParser) {\n  'use strict';\n  if (goog.global.JSON) {\n    try {\n      var obj = goog.global.JSON.parse(jsonString);\n      goog.asserts.assert(typeof obj == 'object');\n      return /** @type {?Object} */ (obj);\n    } catch (e) {\n      // Native parse failed.  Fall through to retry with goog.json.parse.\n    }\n  }\n\n  return fallbackParser(jsonString);\n};\n\n\n/**\n * Attempts to parse the JSON string natively, falling back to\n * `goog.json.parse` if unsuccessful.\n * @param {string} jsonString JSON string to parse.\n * @return {?Object} Resulting JSON object.\n */\ngoog.json.hybrid.parse = goog.json.USE_NATIVE_JSON ?\n    goog.global['JSON']['parse'] :\n    function(jsonString) {\n      'use strict';\n      return goog.json.hybrid.parse_(jsonString, goog.json.parse);\n    };\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Constants for HTTP status codes.\n */\n\ngoog.provide('goog.net.HttpStatus');\n\n\n/**\n * HTTP Status Codes defined in RFC 2616, RFC 6585, RFC 4918 and RFC 7538.\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html\n * @see http://tools.ietf.org/html/rfc6585\n * @see https://tools.ietf.org/html/rfc4918\n * @see https://tools.ietf.org/html/rfc7538\n * @enum {number}\n */\ngoog.net.HttpStatus = {\n  // Informational 1xx\n  CONTINUE: 100,\n  SWITCHING_PROTOCOLS: 101,\n\n  // Successful 2xx\n  OK: 200,\n  CREATED: 201,\n  ACCEPTED: 202,\n  NON_AUTHORITATIVE_INFORMATION: 203,\n  NO_CONTENT: 204,\n  RESET_CONTENT: 205,\n  PARTIAL_CONTENT: 206,\n  MULTI_STATUS: 207,\n\n  // Redirection 3xx\n  MULTIPLE_CHOICES: 300,\n  MOVED_PERMANENTLY: 301,\n  FOUND: 302,\n  SEE_OTHER: 303,\n  NOT_MODIFIED: 304,\n  USE_PROXY: 305,\n  TEMPORARY_REDIRECT: 307,\n  PERMANENT_REDIRECT: 308,\n\n  // Client Error 4xx\n  BAD_REQUEST: 400,\n  UNAUTHORIZED: 401,\n  PAYMENT_REQUIRED: 402,\n  FORBIDDEN: 403,\n  NOT_FOUND: 404,\n  METHOD_NOT_ALLOWED: 405,\n  NOT_ACCEPTABLE: 406,\n  PROXY_AUTHENTICATION_REQUIRED: 407,\n  REQUEST_TIMEOUT: 408,\n  CONFLICT: 409,\n  GONE: 410,\n  LENGTH_REQUIRED: 411,\n  PRECONDITION_FAILED: 412,\n  REQUEST_ENTITY_TOO_LARGE: 413,\n  REQUEST_URI_TOO_LONG: 414,\n  UNSUPPORTED_MEDIA_TYPE: 415,\n  REQUEST_RANGE_NOT_SATISFIABLE: 416,\n  EXPECTATION_FAILED: 417,\n  UNPROCESSABLE_ENTITY: 422,\n  LOCKED: 423,\n  FAILED_DEPENDENCY: 424,\n  PRECONDITION_REQUIRED: 428,\n  TOO_MANY_REQUESTS: 429,\n  REQUEST_HEADER_FIELDS_TOO_LARGE: 431,\n  CLIENT_CLOSED_REQUEST: 499,  // Nonstandard, used by GRPC\n\n  // Server Error 5xx\n  INTERNAL_SERVER_ERROR: 500,\n  NOT_IMPLEMENTED: 501,\n  BAD_GATEWAY: 502,\n  SERVICE_UNAVAILABLE: 503,\n  GATEWAY_TIMEOUT: 504,\n  HTTP_VERSION_NOT_SUPPORTED: 505,\n  INSUFFICIENT_STORAGE: 507,\n  NETWORK_AUTHENTICATION_REQUIRED: 511,\n\n  /*\n   * IE returns this code for 204 due to its use of URLMon, which returns this\n   * code for 'Operation Aborted'. The status text is 'Unknown', the response\n   * headers are ''. Known to occur on IE 6 on XP through IE9 on Win7.\n   */\n  QUIRK_IE_NO_CONTENT: 1223,\n};\n\n\n/**\n * Returns whether the given status should be considered successful.\n *\n * Successful codes are OK (200), CREATED (201), ACCEPTED (202),\n * NO CONTENT (204), PARTIAL CONTENT (206), NOT MODIFIED (304),\n * and IE's no content code (1223).\n *\n * @param {number} status The status code to test.\n * @return {boolean} Whether the status code should be considered successful.\n */\ngoog.net.HttpStatus.isSuccess = function(status) {\n  'use strict';\n  switch (status) {\n    case goog.net.HttpStatus.OK:\n    case goog.net.HttpStatus.CREATED:\n    case goog.net.HttpStatus.ACCEPTED:\n    case goog.net.HttpStatus.NO_CONTENT:\n    case goog.net.HttpStatus.PARTIAL_CONTENT:\n    case goog.net.HttpStatus.NOT_MODIFIED:\n    case goog.net.HttpStatus.QUIRK_IE_NO_CONTENT:\n      return true;\n\n    default:\n      return false;\n  }\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Provides CORS support for HTTP based RPC requests.\n *\n * As part of net.rpc package, CORS features provided by this class\n * depend on the server support. Please check related specs to decide how\n * to enable any of the features provided by this class.\n */\n\ngoog.module('goog.net.rpc.HttpCors');\n\nconst GoogUri = goog.require('goog.Uri');\nconst googObject = goog.require('goog.object');\nconst googString = goog.require('goog.string');\nconst googUriUtils = goog.require('goog.uri.utils');\n\n\n/**\n * The default URL parameter name to overwrite http headers with a URL param\n * to avoid CORS preflight.\n *\n * See https://github.com/whatwg/fetch/issues/210#issue-129531743 for the spec.\n *\n * @type {string}\n */\nexports.HTTP_HEADERS_PARAM_NAME = '$httpHeaders';\n\n\n/**\n * The default URL parameter name to overwrite http method with a URL param\n * to avoid CORS preflight.\n *\n * See https://github.com/whatwg/fetch/issues/210#issue-129531743 for the spec.\n *\n * @type {string}\n */\nexports.HTTP_METHOD_PARAM_NAME = '$httpMethod';\n\n\n/**\n * Generates the URL parameter value with custom headers encoded as\n * HTTP/1.1 headers block.\n *\n * @param {!Object<string, string>} headers The custom headers.\n * @return {string} The URL param to overwrite custom HTTP headers.\n */\nexports.generateHttpHeadersOverwriteParam = function(headers) {\n  let result = '';\n  googObject.forEach(headers, function(value, key) {\n    result += key;\n    result += ':';\n    result += value;\n    result += '\\r\\n';\n  });\n  return result;\n};\n\n\n/**\n * Generates the URL-encoded URL parameter value with custom headers encoded as\n * HTTP/1.1 headers block.\n *\n * @param {!Object<string, string>} headers The custom headers.\n * @return {string} The URL param to overwrite custom HTTP headers.\n */\nexports.generateEncodedHttpHeadersOverwriteParam = function(headers) {\n  return googString.urlEncode(\n      exports.generateHttpHeadersOverwriteParam(headers));\n};\n\n\n/**\n * Sets custom HTTP headers via an overwrite URL param.\n *\n * @param {!GoogUri|string} url The URI object or a string path.\n * @param {string} urlParam The URL param name.\n * @param {!Object<string, string>} extraHeaders The HTTP headers.\n * @return {!GoogUri|string} The URI object or a string path with headers\n * encoded as a url param.\n */\nexports.setHttpHeadersWithOverwriteParam = function(\n    url, urlParam, extraHeaders) {\n  if (googObject.isEmpty(extraHeaders)) {\n    return url;\n  }\n  const httpHeaders = exports.generateHttpHeadersOverwriteParam(extraHeaders);\n  if (typeof url === 'string') {\n    return googUriUtils.appendParam(\n        url, googString.urlEncode(urlParam), httpHeaders);\n  } else {\n    url.setParameterValue(urlParam, httpHeaders);  // duplicate removed!\n    return url;\n  }\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Implementation of a WebChannel transport using WebChannelBase.\n *\n * When WebChannelBase is used as the underlying transport, the capabilities\n * of the WebChannel are limited to what's supported by the implementation.\n * Particularly, multiplexing is not possible, and only strings are\n * supported as message types.\n */\n\ngoog.provide('goog.labs.net.webChannel.WebChannelBaseTransport');\n\ngoog.require('goog.asserts');\ngoog.require('goog.collections.maps');\ngoog.require('goog.events.EventTarget');\ngoog.require('goog.json');\ngoog.require('goog.labs.net.webChannel.ChannelRequest');\ngoog.require('goog.labs.net.webChannel.WebChannelBase');\ngoog.require('goog.labs.net.webChannel.Wire');\ngoog.require('goog.log');\ngoog.require('goog.net.WebChannel');\ngoog.require('goog.net.WebChannelTransport');\ngoog.require('goog.object');\ngoog.require('goog.string');\n\n\n\n/**\n * Implementation of {@link goog.net.WebChannelTransport} with\n * {@link goog.labs.net.webChannel.WebChannelBase} as the underlying channel\n * implementation.\n *\n * @constructor\n * @struct\n * @implements {goog.net.WebChannelTransport}\n * @final\n */\ngoog.labs.net.webChannel.WebChannelBaseTransport = function() {\n  'use strict';\n  if (!goog.labs.net.webChannel.ChannelRequest.supportsXhrStreaming()) {\n    throw new Error('Environmental error: no available transport.');\n  }\n};\n\n\ngoog.scope(function() {\n'use strict';\nconst WebChannelBaseTransport =\n    goog.labs.net.webChannel.WebChannelBaseTransport;\nconst WebChannelBase = goog.labs.net.webChannel.WebChannelBase;\nconst Wire = goog.labs.net.webChannel.Wire;\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.prototype.createWebChannel = function(\n    url, opt_options) {\n  'use strict';\n  return new WebChannelBaseTransport.Channel(url, opt_options);\n};\n\n\n\n/**\n * Implementation of the {@link goog.net.WebChannel} interface.\n *\n * @param {string} url The URL path for the new WebChannel instance.\n * @param {!goog.net.WebChannel.Options=} opt_options Configuration for the\n *     new WebChannel instance.\n *\n * @constructor\n * @implements {goog.net.WebChannel}\n * @extends {goog.events.EventTarget}\n * @final\n */\nWebChannelBaseTransport.Channel = function(url, opt_options) {\n  'use strict';\n  WebChannelBaseTransport.Channel.base(this, 'constructor');\n\n  /**\n   * @private {!WebChannelBase} The underlying channel object.\n   */\n  this.channel_ = new WebChannelBase(\n      opt_options, goog.net.WebChannelTransport.CLIENT_VERSION);\n\n  /**\n   * @private {string} The URL of the target server end-point.\n   */\n  this.url_ = url;\n\n  /**\n   * @private {goog.log.Logger} The logger for this class.\n   */\n  this.logger_ =\n      goog.log.getLogger('goog.labs.net.webChannel.WebChannelBaseTransport');\n\n  /**\n   * @private {Object<string, string>} Extra URL parameters\n   * to be added to each HTTP request.\n   */\n  this.messageUrlParams_ =\n      (opt_options && opt_options.messageUrlParams) || null;\n\n  let messageHeaders = (opt_options && opt_options.messageHeaders) || null;\n\n  // default is false\n  if (opt_options && opt_options.clientProtocolHeaderRequired) {\n    if (messageHeaders) {\n      goog.object.set(\n          messageHeaders, goog.net.WebChannel.X_CLIENT_PROTOCOL,\n          goog.net.WebChannel.X_CLIENT_PROTOCOL_WEB_CHANNEL);\n    } else {\n      messageHeaders = goog.object.create(\n          goog.net.WebChannel.X_CLIENT_PROTOCOL,\n          goog.net.WebChannel.X_CLIENT_PROTOCOL_WEB_CHANNEL);\n    }\n  }\n\n  this.channel_.setExtraHeaders(messageHeaders);\n\n  let initHeaders = (opt_options && opt_options.initMessageHeaders) || null;\n\n  if (opt_options && opt_options.messageContentType) {\n    if (initHeaders) {\n      goog.object.set(\n          initHeaders, goog.net.WebChannel.X_WEBCHANNEL_CONTENT_TYPE,\n          opt_options.messageContentType);\n    } else {\n      initHeaders = goog.object.create(\n          goog.net.WebChannel.X_WEBCHANNEL_CONTENT_TYPE,\n          opt_options.messageContentType);\n    }\n  }\n\n  if (opt_options && opt_options.clientProfile) {\n    if (initHeaders) {\n      goog.object.set(\n          initHeaders, goog.net.WebChannel.X_WEBCHANNEL_CLIENT_PROFILE,\n          opt_options.clientProfile);\n    } else {\n      initHeaders = goog.object.create(\n          goog.net.WebChannel.X_WEBCHANNEL_CLIENT_PROFILE,\n          opt_options.clientProfile);\n    }\n  }\n\n  this.channel_.setInitHeaders(initHeaders);\n\n  const httpHeadersOverwriteParam =\n      opt_options && opt_options.httpHeadersOverwriteParam;\n  if (httpHeadersOverwriteParam &&\n      !goog.string.isEmptyOrWhitespace(httpHeadersOverwriteParam)) {\n    this.channel_.setHttpHeadersOverwriteParam(httpHeadersOverwriteParam);\n  }\n\n  /**\n   * @private {boolean} Whether to enable CORS.\n   */\n  this.supportsCrossDomainXhr_ =\n      (opt_options && opt_options.supportsCrossDomainXhr) || false;\n\n  /**\n   * @private {boolean} Whether to send raw Json and bypass v8 wire format.\n   */\n  this.sendRawJson_ = (opt_options && opt_options.sendRawJson) || false;\n\n  // Note that httpSessionIdParam will be ignored if the same parameter name\n  // has already been specified with messageUrlParams\n  const httpSessionIdParam = opt_options && opt_options.httpSessionIdParam;\n  if (httpSessionIdParam &&\n      !goog.string.isEmptyOrWhitespace(httpSessionIdParam)) {\n    this.channel_.setHttpSessionIdParam(httpSessionIdParam);\n    if (goog.object.containsKey(this.messageUrlParams_, httpSessionIdParam)) {\n      goog.object.remove(this.messageUrlParams_, httpSessionIdParam);\n      goog.log.warning(\n          this.logger_,\n          'Ignore httpSessionIdParam also specified with messageUrlParams: ' +\n              httpSessionIdParam);\n    }\n  }\n\n  /**\n   * The channel handler.\n   *\n   * @private {!WebChannelBaseTransport.Channel.Handler_}\n   */\n  this.channelHandler_ = new WebChannelBaseTransport.Channel.Handler_(this);\n};\ngoog.inherits(WebChannelBaseTransport.Channel, goog.events.EventTarget);\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.Channel.prototype.open = function() {\n  'use strict';\n  this.channel_.setHandler(this.channelHandler_);\n  if (this.supportsCrossDomainXhr_) {\n    this.channel_.setSupportsCrossDomainXhrs(true);\n  }\n  this.channel_.connect(this.url_, (this.messageUrlParams_ || undefined));\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.Channel.prototype.close = function() {\n  'use strict';\n  this.channel_.disconnect();\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.Channel.prototype.halfClose = function() {\n  'use strict';\n  // to be implemented\n  throw new Error('Not implemented');\n};\n\n\n/**\n * The WebChannelBase only supports object types.\n *\n * @param {!goog.net.WebChannel.MessageData} message The message to send.\n *\n * @override\n */\nWebChannelBaseTransport.Channel.prototype.send = function(message) {\n  'use strict';\n  this.channel_.sendMap(this.messageToMapObject_(message));\n};\n\n\n/**\n * Converts a message to the map used by the underlying channel.\n *\n * @param {!goog.net.WebChannel.MessageData} message\n * @return {!Object|!goog.collections.maps.MapLike}\n */\nWebChannelBaseTransport.Channel.prototype.messageToMapObject_ = function(\n    message) {\n  'use strict';\n  goog.asserts.assert(\n      goog.isObject(message) || typeof message === 'string',\n      'only object type or raw string is supported');\n\n  if (typeof message === 'string') {\n    const rawJson = {};\n    rawJson[Wire.RAW_DATA_KEY] = message;\n    return rawJson;\n  }\n\n  if (this.sendRawJson_) {\n    const rawJson = {};\n    rawJson[Wire.RAW_DATA_KEY] = goog.json.serialize(message);\n    return rawJson;\n  }\n\n  return message;\n};\n\n\n/**\n * Converts the map used by the underlying channel to a message.\n *\n * NOTE: In the case of the message being JS Object or string, the exact same\n * object passed during `messageToMapObject_()` is returned. In the case of raw\n * JSON, an equal (but not the same) object is returned (due to serialization).\n *\n * @param {!Object|!goog.collections.maps.MapLike} map\n * @return {!goog.net.WebChannel.MessageData}\n */\nWebChannelBaseTransport.Channel.prototype.mapObjectToMessage_ = function(map) {\n  'use strict';\n  if (Wire.RAW_DATA_KEY in map) {\n    const rawMessage = map[Wire.RAW_DATA_KEY];\n\n    if (this.sendRawJson_) {\n      return /** @type {!goog.net.WebChannel.MessageData} */ (\n          goog.json.parse(rawMessage));\n    } else {  // string message\n      return rawMessage;\n    }\n  }\n\n  return map;\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.Channel.prototype.disposeInternal = function() {\n  'use strict';\n  this.channel_.setHandler(null);\n  delete this.channelHandler_;\n  this.channel_.disconnect();\n  delete this.channel_;\n\n  WebChannelBaseTransport.Channel.base(this, 'disposeInternal');\n};\n\n\n\n/**\n * The message event.\n *\n * @param {!Array<?>|!Object} array The data array from the underlying channel.\n * @constructor\n * @extends {goog.net.WebChannel.MessageEvent}\n * @final\n */\nWebChannelBaseTransport.Channel.MessageEvent = function(array) {\n  'use strict';\n  WebChannelBaseTransport.Channel.MessageEvent.base(this, 'constructor');\n\n  // Metadata as HTTP headers and status code (always come in a pair).\n  if (array['__headers__']) {\n    this.headers = array['__headers__'];\n    this.statusCode = array['__status__'];\n    delete array['__headers__'];\n    delete array['__status__'];\n  }\n\n  // single-metadata only\n  const metadata = array['__sm__'];\n  if (metadata) {\n    this.metadataKey = goog.object.getAnyKey(metadata);\n    if (this.metadataKey) {\n      this.data = goog.object.get(metadata, this.metadataKey);\n    } else {\n      this.data = metadata;  // empty\n    }\n  } else {\n    this.data = array;\n  }\n};\ngoog.inherits(\n    WebChannelBaseTransport.Channel.MessageEvent,\n    goog.net.WebChannel.MessageEvent);\n\n\n\n/**\n * The error event.\n *\n * @param {WebChannelBase.Error} error The error code.\n * @constructor\n * @extends {goog.net.WebChannel.ErrorEvent}\n * @final\n */\nWebChannelBaseTransport.Channel.ErrorEvent = function(error) {\n  'use strict';\n  WebChannelBaseTransport.Channel.ErrorEvent.base(this, 'constructor');\n\n  /**\n   * High-level status code.\n   */\n  this.status = goog.net.WebChannel.ErrorStatus.NETWORK_ERROR;\n\n  /**\n   * @const {WebChannelBase.Error} Internal error code, for debugging use only.\n   */\n  this.errorCode = error;\n};\ngoog.inherits(\n    WebChannelBaseTransport.Channel.ErrorEvent, goog.net.WebChannel.ErrorEvent);\n\n\n\n/**\n * Implementation of {@link WebChannelBase.Handler} interface.\n *\n * @param {!WebChannelBaseTransport.Channel} channel The enclosing WebChannel.\n *\n * @constructor\n * @extends {WebChannelBase.Handler}\n * @private\n */\nWebChannelBaseTransport.Channel.Handler_ = function(channel) {\n  'use strict';\n  WebChannelBaseTransport.Channel.Handler_.base(this, 'constructor');\n\n  /**\n   * @type {!WebChannelBaseTransport.Channel}\n   * @private\n   */\n  this.channel_ = channel;\n};\ngoog.inherits(WebChannelBaseTransport.Channel.Handler_, WebChannelBase.Handler);\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.Channel.Handler_.prototype.channelOpened = function(\n    channel) {\n  'use strict';\n  goog.log.info(\n      this.channel_.logger_, 'WebChannel opened on ' + this.channel_.url_);\n  this.channel_.dispatchEvent(goog.net.WebChannel.EventType.OPEN);\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.Channel.Handler_.prototype.channelHandleArray =\n    function(channel, array) {\n  'use strict';\n  goog.asserts.assert(array, 'array expected to be defined');\n  this.channel_.dispatchEvent(\n      new WebChannelBaseTransport.Channel.MessageEvent(array));\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.Channel.Handler_.prototype.channelError = function(\n    channel, error) {\n  'use strict';\n  goog.log.info(\n      this.channel_.logger_,\n      'WebChannel aborted on ' + this.channel_.url_ +\n          ' due to channel error: ' + error);\n  this.channel_.dispatchEvent(\n      new WebChannelBaseTransport.Channel.ErrorEvent(error));\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.Channel.Handler_.prototype.channelClosed = function(\n    channel, opt_pendingMaps, opt_undeliveredMaps) {\n  'use strict';\n  goog.log.info(\n      this.channel_.logger_, 'WebChannel closed on ' + this.channel_.url_);\n  this.channel_.dispatchEvent(goog.net.WebChannel.EventType.CLOSE);\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.Channel.prototype.getRuntimeProperties = function() {\n  'use strict';\n  return new WebChannelBaseTransport.ChannelProperties(this, this.channel_);\n};\n\n\n\n/**\n * Implementation of the {@link goog.net.WebChannel.RuntimeProperties}.\n *\n * @param {!WebChannelBaseTransport.Channel} transportChannel The transport\n *     channel object.\n * @param {!WebChannelBase} channel The underlying channel object.\n *\n * @constructor\n * @implements {goog.net.WebChannel.RuntimeProperties}\n * @final\n */\nWebChannelBaseTransport.ChannelProperties = function(\n    transportChannel, channel) {\n  'use strict';\n  /**\n   * The transport channel object.\n   *\n   * @private @const {!WebChannelBaseTransport.Channel}\n   */\n  this.transportChannel_ = transportChannel;\n\n  /**\n   * The underlying channel object.\n   *\n   * @private @const {!WebChannelBase}\n   */\n  this.channel_ = channel;\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.ChannelProperties.prototype.getConcurrentRequestLimit =\n    function() {\n  'use strict';\n  return this.channel_.getForwardChannelRequestPool().getMaxSize();\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.ChannelProperties.prototype.isSpdyEnabled = function() {\n  'use strict';\n  return this.getConcurrentRequestLimit() > 1;\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.ChannelProperties.prototype.getPendingRequestCount =\n    function() {\n  'use strict';\n  return this.channel_.getForwardChannelRequestPool().getRequestCount();\n};\n\n\n/**\n * @override\n * @return {!Array<!goog.net.WebChannel.MessageData>}\n */\nWebChannelBaseTransport.ChannelProperties.prototype.getNonAckedMessages =\n    function() {\n  'use strict';\n  return this.channel_.getNonAckedMaps().map(\n      queued_map => this.transportChannel_.mapObjectToMessage_(queued_map.map));\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.ChannelProperties.prototype.getHttpSessionId =\n    function() {\n  'use strict';\n  return this.channel_.getHttpSessionId();\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.ChannelProperties.prototype.commit = function(\n    callback) {\n  'use strict';\n  this.channel_.setForwardChannelFlushCallback(callback);\n};\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.ChannelProperties.prototype.notifyNonAckedMessageCount =\n    goog.abstractMethod;\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.ChannelProperties.prototype.onCommit =\n    goog.abstractMethod;\n\n\n/**\n * @override\n */\nWebChannelBaseTransport.ChannelProperties.prototype.ackCommit =\n    goog.abstractMethod;\n\n\n/**\n * @override\n * @return {!Object<string, string>|undefined}\n */\nWebChannelBaseTransport.ChannelProperties.prototype.getLastResponseHeaders =\n    function() {\n  'use strict';\n  return this.channel_.getLastResponseHeaders();\n};\n\n/** @override */\nWebChannelBaseTransport.ChannelProperties.prototype.getLastStatusCode =\n    function() {\n  'use strict';\n  return this.channel_.getLastStatusCode();\n};\n});  // goog.scope\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview MD5 cryptographic hash.\n * Implementation of http://tools.ietf.org/html/rfc1321 with common\n * optimizations and tweaks (see http://en.wikipedia.org/wiki/MD5).\n *\n * Usage:\n *   var md5 = new goog.crypt.Md5();\n *   md5.update(bytes);\n *   var hash = md5.digest();\n *\n * Performance:\n *   Chrome 23              ~680 Mbit/s\n *   Chrome 13 (in a VM)    ~250 Mbit/s\n *   Firefox 6.0 (in a VM)  ~100 Mbit/s\n *   IE9 (in a VM)           ~27 Mbit/s\n *   Firefox 3.6             ~15 Mbit/s\n *   IE8 (in a VM)           ~13 Mbit/s\n */\n\ngoog.provide('goog.crypt.Md5');\n\ngoog.require('goog.crypt.Hash');\n\n\n\n/**\n * MD5 cryptographic hash constructor.\n * @constructor\n * @extends {goog.crypt.Hash}\n * @final\n * @struct\n */\ngoog.crypt.Md5 = function() {\n  'use strict';\n  goog.crypt.Md5.base(this, 'constructor');\n\n  /** @const {number} */\n  this.blockSize = 512 / 8;\n\n  /**\n   * Holds the current values of accumulated A-D variables (MD buffer).\n   * @type {!Array<number>}\n   * @private\n   */\n  this.chain_ = new Array(4);\n\n  /**\n   * A buffer holding the data until the whole block can be processed.\n   * @type {!Array<number>}\n   * @private\n   */\n  this.block_ = new Array(this.blockSize);\n\n  /**\n   * The length of yet-unprocessed data as collected in the block.\n   * @type {number}\n   * @private\n   */\n  this.blockLength_ = 0;\n\n  /**\n   * The total length of the message so far.\n   * @type {number}\n   * @private\n   */\n  this.totalLength_ = 0;\n\n  this.reset();\n};\ngoog.inherits(goog.crypt.Md5, goog.crypt.Hash);\n\n\n/**\n * Integer rotation constants used by the abbreviated implementation.\n * They are hardcoded in the unrolled implementation, so it is left\n * here commented out.\n * @type {Array<number>}\n * @private\n *\ngoog.crypt.Md5.S_ = [\n  7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22,\n  5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20,\n  4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23,\n  6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21\n];\n */\n\n/**\n * Sine function constants used by the abbreviated implementation.\n * They are hardcoded in the unrolled implementation, so it is left\n * here commented out.\n * @type {Array<number>}\n * @private\n *\ngoog.crypt.Md5.T_ = [\n  0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee,\n  0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501,\n  0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be,\n  0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821,\n  0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa,\n  0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8,\n  0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed,\n  0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a,\n  0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c,\n  0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70,\n  0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05,\n  0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665,\n  0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039,\n  0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1,\n  0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1,\n  0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391\n];\n */\n\n\n/** @override */\ngoog.crypt.Md5.prototype.reset = function() {\n  'use strict';\n  this.chain_[0] = 0x67452301;\n  this.chain_[1] = 0xefcdab89;\n  this.chain_[2] = 0x98badcfe;\n  this.chain_[3] = 0x10325476;\n\n  this.blockLength_ = 0;\n  this.totalLength_ = 0;\n};\n\n\n/**\n * Internal compress helper function. It takes a block of data (64 bytes)\n * and updates the accumulator.\n * @param {Array<number>|Uint8Array|string} buf The block to compress.\n * @param {number=} opt_offset Offset of the block in the buffer.\n * @private\n */\ngoog.crypt.Md5.prototype.compress_ = function(buf, opt_offset) {\n  'use strict';\n  if (!opt_offset) {\n    opt_offset = 0;\n  }\n\n  // We allocate the array every time, but it's cheap in practice.\n  var X = new Array(16);\n\n  // Get 16 little endian words. It is not worth unrolling this for Chrome 11.\n  if (typeof buf === 'string') {\n    for (var i = 0; i < 16; ++i) {\n      X[i] = (buf.charCodeAt(opt_offset++)) |\n          (buf.charCodeAt(opt_offset++) << 8) |\n          (buf.charCodeAt(opt_offset++) << 16) |\n          (buf.charCodeAt(opt_offset++) << 24);\n    }\n  } else {\n    for (var i = 0; i < 16; ++i) {\n      X[i] = (buf[opt_offset++]) | (buf[opt_offset++] << 8) |\n          (buf[opt_offset++] << 16) | (buf[opt_offset++] << 24);\n    }\n  }\n\n  var A = this.chain_[0];\n  var B = this.chain_[1];\n  var C = this.chain_[2];\n  var D = this.chain_[3];\n  var sum = 0;\n\n  /*\n   * This is an abbreviated implementation, it is left here commented out for\n   * reference purposes. See below for an unrolled version in use.\n   *\n  var f, n, tmp;\n  for (var i = 0; i < 64; ++i) {\n\n    if (i < 16) {\n      f = (D ^ (B & (C ^ D)));\n      n = i;\n    } else if (i < 32) {\n      f = (C ^ (D & (B ^ C)));\n      n = (5 * i + 1) % 16;\n    } else if (i < 48) {\n      f = (B ^ C ^ D);\n      n = (3 * i + 5) % 16;\n    } else {\n      f = (C ^ (B | (~D)));\n      n = (7 * i) % 16;\n    }\n\n    tmp = D;\n    D = C;\n    C = B;\n    sum = (A + f + goog.crypt.Md5.T_[i] + X[n]) & 0xffffffff;\n    B += ((sum << goog.crypt.Md5.S_[i]) & 0xffffffff) |\n         (sum >>> (32 - goog.crypt.Md5.S_[i]));\n    A = tmp;\n  }\n   */\n\n  /*\n   * This is an unrolled MD5 implementation, which gives ~30% speedup compared\n   * to the abbreviated implementation above, as measured on Chrome 11. It is\n   * important to keep 32-bit croppings to minimum and inline the integer\n   * rotation.\n   */\n  sum = (A + (D ^ (B & (C ^ D))) + X[0] + 0xd76aa478) & 0xffffffff;\n  A = B + (((sum << 7) & 0xffffffff) | (sum >>> 25));\n  sum = (D + (C ^ (A & (B ^ C))) + X[1] + 0xe8c7b756) & 0xffffffff;\n  D = A + (((sum << 12) & 0xffffffff) | (sum >>> 20));\n  sum = (C + (B ^ (D & (A ^ B))) + X[2] + 0x242070db) & 0xffffffff;\n  C = D + (((sum << 17) & 0xffffffff) | (sum >>> 15));\n  sum = (B + (A ^ (C & (D ^ A))) + X[3] + 0xc1bdceee) & 0xffffffff;\n  B = C + (((sum << 22) & 0xffffffff) | (sum >>> 10));\n  sum = (A + (D ^ (B & (C ^ D))) + X[4] + 0xf57c0faf) & 0xffffffff;\n  A = B + (((sum << 7) & 0xffffffff) | (sum >>> 25));\n  sum = (D + (C ^ (A & (B ^ C))) + X[5] + 0x4787c62a) & 0xffffffff;\n  D = A + (((sum << 12) & 0xffffffff) | (sum >>> 20));\n  sum = (C + (B ^ (D & (A ^ B))) + X[6] + 0xa8304613) & 0xffffffff;\n  C = D + (((sum << 17) & 0xffffffff) | (sum >>> 15));\n  sum = (B + (A ^ (C & (D ^ A))) + X[7] + 0xfd469501) & 0xffffffff;\n  B = C + (((sum << 22) & 0xffffffff) | (sum >>> 10));\n  sum = (A + (D ^ (B & (C ^ D))) + X[8] + 0x698098d8) & 0xffffffff;\n  A = B + (((sum << 7) & 0xffffffff) | (sum >>> 25));\n  sum = (D + (C ^ (A & (B ^ C))) + X[9] + 0x8b44f7af) & 0xffffffff;\n  D = A + (((sum << 12) & 0xffffffff) | (sum >>> 20));\n  sum = (C + (B ^ (D & (A ^ B))) + X[10] + 0xffff5bb1) & 0xffffffff;\n  C = D + (((sum << 17) & 0xffffffff) | (sum >>> 15));\n  sum = (B + (A ^ (C & (D ^ A))) + X[11] + 0x895cd7be) & 0xffffffff;\n  B = C + (((sum << 22) & 0xffffffff) | (sum >>> 10));\n  sum = (A + (D ^ (B & (C ^ D))) + X[12] + 0x6b901122) & 0xffffffff;\n  A = B + (((sum << 7) & 0xffffffff) | (sum >>> 25));\n  sum = (D + (C ^ (A & (B ^ C))) + X[13] + 0xfd987193) & 0xffffffff;\n  D = A + (((sum << 12) & 0xffffffff) | (sum >>> 20));\n  sum = (C + (B ^ (D & (A ^ B))) + X[14] + 0xa679438e) & 0xffffffff;\n  C = D + (((sum << 17) & 0xffffffff) | (sum >>> 15));\n  sum = (B + (A ^ (C & (D ^ A))) + X[15] + 0x49b40821) & 0xffffffff;\n  B = C + (((sum << 22) & 0xffffffff) | (sum >>> 10));\n  sum = (A + (C ^ (D & (B ^ C))) + X[1] + 0xf61e2562) & 0xffffffff;\n  A = B + (((sum << 5) & 0xffffffff) | (sum >>> 27));\n  sum = (D + (B ^ (C & (A ^ B))) + X[6] + 0xc040b340) & 0xffffffff;\n  D = A + (((sum << 9) & 0xffffffff) | (sum >>> 23));\n  sum = (C + (A ^ (B & (D ^ A))) + X[11] + 0x265e5a51) & 0xffffffff;\n  C = D + (((sum << 14) & 0xffffffff) | (sum >>> 18));\n  sum = (B + (D ^ (A & (C ^ D))) + X[0] + 0xe9b6c7aa) & 0xffffffff;\n  B = C + (((sum << 20) & 0xffffffff) | (sum >>> 12));\n  sum = (A + (C ^ (D & (B ^ C))) + X[5] + 0xd62f105d) & 0xffffffff;\n  A = B + (((sum << 5) & 0xffffffff) | (sum >>> 27));\n  sum = (D + (B ^ (C & (A ^ B))) + X[10] + 0x02441453) & 0xffffffff;\n  D = A + (((sum << 9) & 0xffffffff) | (sum >>> 23));\n  sum = (C + (A ^ (B & (D ^ A))) + X[15] + 0xd8a1e681) & 0xffffffff;\n  C = D + (((sum << 14) & 0xffffffff) | (sum >>> 18));\n  sum = (B + (D ^ (A & (C ^ D))) + X[4] + 0xe7d3fbc8) & 0xffffffff;\n  B = C + (((sum << 20) & 0xffffffff) | (sum >>> 12));\n  sum = (A + (C ^ (D & (B ^ C))) + X[9] + 0x21e1cde6) & 0xffffffff;\n  A = B + (((sum << 5) & 0xffffffff) | (sum >>> 27));\n  sum = (D + (B ^ (C & (A ^ B))) + X[14] + 0xc33707d6) & 0xffffffff;\n  D = A + (((sum << 9) & 0xffffffff) | (sum >>> 23));\n  sum = (C + (A ^ (B & (D ^ A))) + X[3] + 0xf4d50d87) & 0xffffffff;\n  C = D + (((sum << 14) & 0xffffffff) | (sum >>> 18));\n  sum = (B + (D ^ (A & (C ^ D))) + X[8] + 0x455a14ed) & 0xffffffff;\n  B = C + (((sum << 20) & 0xffffffff) | (sum >>> 12));\n  sum = (A + (C ^ (D & (B ^ C))) + X[13] + 0xa9e3e905) & 0xffffffff;\n  A = B + (((sum << 5) & 0xffffffff) | (sum >>> 27));\n  sum = (D + (B ^ (C & (A ^ B))) + X[2] + 0xfcefa3f8) & 0xffffffff;\n  D = A + (((sum << 9) & 0xffffffff) | (sum >>> 23));\n  sum = (C + (A ^ (B & (D ^ A))) + X[7] + 0x676f02d9) & 0xffffffff;\n  C = D + (((sum << 14) & 0xffffffff) | (sum >>> 18));\n  sum = (B + (D ^ (A & (C ^ D))) + X[12] + 0x8d2a4c8a) & 0xffffffff;\n  B = C + (((sum << 20) & 0xffffffff) | (sum >>> 12));\n  sum = (A + (B ^ C ^ D) + X[5] + 0xfffa3942) & 0xffffffff;\n  A = B + (((sum << 4) & 0xffffffff) | (sum >>> 28));\n  sum = (D + (A ^ B ^ C) + X[8] + 0x8771f681) & 0xffffffff;\n  D = A + (((sum << 11) & 0xffffffff) | (sum >>> 21));\n  sum = (C + (D ^ A ^ B) + X[11] + 0x6d9d6122) & 0xffffffff;\n  C = D + (((sum << 16) & 0xffffffff) | (sum >>> 16));\n  sum = (B + (C ^ D ^ A) + X[14] + 0xfde5380c) & 0xffffffff;\n  B = C + (((sum << 23) & 0xffffffff) | (sum >>> 9));\n  sum = (A + (B ^ C ^ D) + X[1] + 0xa4beea44) & 0xffffffff;\n  A = B + (((sum << 4) & 0xffffffff) | (sum >>> 28));\n  sum = (D + (A ^ B ^ C) + X[4] + 0x4bdecfa9) & 0xffffffff;\n  D = A + (((sum << 11) & 0xffffffff) | (sum >>> 21));\n  sum = (C + (D ^ A ^ B) + X[7] + 0xf6bb4b60) & 0xffffffff;\n  C = D + (((sum << 16) & 0xffffffff) | (sum >>> 16));\n  sum = (B + (C ^ D ^ A) + X[10] + 0xbebfbc70) & 0xffffffff;\n  B = C + (((sum << 23) & 0xffffffff) | (sum >>> 9));\n  sum = (A + (B ^ C ^ D) + X[13] + 0x289b7ec6) & 0xffffffff;\n  A = B + (((sum << 4) & 0xffffffff) | (sum >>> 28));\n  sum = (D + (A ^ B ^ C) + X[0] + 0xeaa127fa) & 0xffffffff;\n  D = A + (((sum << 11) & 0xffffffff) | (sum >>> 21));\n  sum = (C + (D ^ A ^ B) + X[3] + 0xd4ef3085) & 0xffffffff;\n  C = D + (((sum << 16) & 0xffffffff) | (sum >>> 16));\n  sum = (B + (C ^ D ^ A) + X[6] + 0x04881d05) & 0xffffffff;\n  B = C + (((sum << 23) & 0xffffffff) | (sum >>> 9));\n  sum = (A + (B ^ C ^ D) + X[9] + 0xd9d4d039) & 0xffffffff;\n  A = B + (((sum << 4) & 0xffffffff) | (sum >>> 28));\n  sum = (D + (A ^ B ^ C) + X[12] + 0xe6db99e5) & 0xffffffff;\n  D = A + (((sum << 11) & 0xffffffff) | (sum >>> 21));\n  sum = (C + (D ^ A ^ B) + X[15] + 0x1fa27cf8) & 0xffffffff;\n  C = D + (((sum << 16) & 0xffffffff) | (sum >>> 16));\n  sum = (B + (C ^ D ^ A) + X[2] + 0xc4ac5665) & 0xffffffff;\n  B = C + (((sum << 23) & 0xffffffff) | (sum >>> 9));\n  sum = (A + (C ^ (B | (~D))) + X[0] + 0xf4292244) & 0xffffffff;\n  A = B + (((sum << 6) & 0xffffffff) | (sum >>> 26));\n  sum = (D + (B ^ (A | (~C))) + X[7] + 0x432aff97) & 0xffffffff;\n  D = A + (((sum << 10) & 0xffffffff) | (sum >>> 22));\n  sum = (C + (A ^ (D | (~B))) + X[14] + 0xab9423a7) & 0xffffffff;\n  C = D + (((sum << 15) & 0xffffffff) | (sum >>> 17));\n  sum = (B + (D ^ (C | (~A))) + X[5] + 0xfc93a039) & 0xffffffff;\n  B = C + (((sum << 21) & 0xffffffff) | (sum >>> 11));\n  sum = (A + (C ^ (B | (~D))) + X[12] + 0x655b59c3) & 0xffffffff;\n  A = B + (((sum << 6) & 0xffffffff) | (sum >>> 26));\n  sum = (D + (B ^ (A | (~C))) + X[3] + 0x8f0ccc92) & 0xffffffff;\n  D = A + (((sum << 10) & 0xffffffff) | (sum >>> 22));\n  sum = (C + (A ^ (D | (~B))) + X[10] + 0xffeff47d) & 0xffffffff;\n  C = D + (((sum << 15) & 0xffffffff) | (sum >>> 17));\n  sum = (B + (D ^ (C | (~A))) + X[1] + 0x85845dd1) & 0xffffffff;\n  B = C + (((sum << 21) & 0xffffffff) | (sum >>> 11));\n  sum = (A + (C ^ (B | (~D))) + X[8] + 0x6fa87e4f) & 0xffffffff;\n  A = B + (((sum << 6) & 0xffffffff) | (sum >>> 26));\n  sum = (D + (B ^ (A | (~C))) + X[15] + 0xfe2ce6e0) & 0xffffffff;\n  D = A + (((sum << 10) & 0xffffffff) | (sum >>> 22));\n  sum = (C + (A ^ (D | (~B))) + X[6] + 0xa3014314) & 0xffffffff;\n  C = D + (((sum << 15) & 0xffffffff) | (sum >>> 17));\n  sum = (B + (D ^ (C | (~A))) + X[13] + 0x4e0811a1) & 0xffffffff;\n  B = C + (((sum << 21) & 0xffffffff) | (sum >>> 11));\n  sum = (A + (C ^ (B | (~D))) + X[4] + 0xf7537e82) & 0xffffffff;\n  A = B + (((sum << 6) & 0xffffffff) | (sum >>> 26));\n  sum = (D + (B ^ (A | (~C))) + X[11] + 0xbd3af235) & 0xffffffff;\n  D = A + (((sum << 10) & 0xffffffff) | (sum >>> 22));\n  sum = (C + (A ^ (D | (~B))) + X[2] + 0x2ad7d2bb) & 0xffffffff;\n  C = D + (((sum << 15) & 0xffffffff) | (sum >>> 17));\n  sum = (B + (D ^ (C | (~A))) + X[9] + 0xeb86d391) & 0xffffffff;\n  B = C + (((sum << 21) & 0xffffffff) | (sum >>> 11));\n\n  this.chain_[0] = (this.chain_[0] + A) & 0xffffffff;\n  this.chain_[1] = (this.chain_[1] + B) & 0xffffffff;\n  this.chain_[2] = (this.chain_[2] + C) & 0xffffffff;\n  this.chain_[3] = (this.chain_[3] + D) & 0xffffffff;\n};\n\n\n/** @override */\ngoog.crypt.Md5.prototype.update = function(bytes, opt_length) {\n  'use strict';\n  if (opt_length === undefined) {\n    opt_length = bytes.length;\n  }\n  var lengthMinusBlock = opt_length - this.blockSize;\n\n  // Copy some object properties to local variables in order to save on access\n  // time from inside the loop (~10% speedup was observed on Chrome 11).\n  var block = this.block_;\n  var blockLength = this.blockLength_;\n  var i = 0;\n\n  // The outer while loop should execute at most twice.\n  while (i < opt_length) {\n    // When we have no data in the block to top up, we can directly process the\n    // input buffer (assuming it contains sufficient data). This gives ~30%\n    // speedup on Chrome 14 and ~70% speedup on Firefox 6.0, but requires that\n    // the data is provided in large chunks (or in multiples of 64 bytes).\n    if (blockLength == 0) {\n      while (i <= lengthMinusBlock) {\n        this.compress_(bytes, i);\n        i += this.blockSize;\n      }\n    }\n\n    if (typeof bytes === 'string') {\n      while (i < opt_length) {\n        block[blockLength++] = bytes.charCodeAt(i++);\n        if (blockLength == this.blockSize) {\n          this.compress_(block);\n          blockLength = 0;\n          // Jump to the outer loop so we use the full-block optimization.\n          break;\n        }\n      }\n    } else {\n      while (i < opt_length) {\n        block[blockLength++] = bytes[i++];\n        if (blockLength == this.blockSize) {\n          this.compress_(block);\n          blockLength = 0;\n          // Jump to the outer loop so we use the full-block optimization.\n          break;\n        }\n      }\n    }\n  }\n\n  this.blockLength_ = blockLength;\n  this.totalLength_ += opt_length;\n};\n\n\n/** @override */\ngoog.crypt.Md5.prototype.digest = function() {\n  'use strict';\n  // This must accommodate at least 1 padding byte (0x80), 8 bytes of\n  // total bitlength, and must end at a 64-byte boundary.\n  var pad = new Array(\n      (this.blockLength_ < 56 ? this.blockSize : this.blockSize * 2) -\n      this.blockLength_);\n\n  // Add padding: 0x80 0x00*\n  pad[0] = 0x80;\n  for (var i = 1; i < pad.length - 8; ++i) {\n    pad[i] = 0;\n  }\n  // Add the total number of bits, little endian 64-bit integer.\n  var totalBits = this.totalLength_ * 8;\n  for (var i = pad.length - 8; i < pad.length; ++i) {\n    pad[i] = totalBits & 0xff;\n    totalBits /= 0x100;  // Don't use bit-shifting here!\n  }\n  this.update(pad);\n\n  var digest = new Array(16);\n  var n = 0;\n  for (var i = 0; i < 4; ++i) {\n    for (var j = 0; j < 32; j += 8) {\n      digest[n++] = (this.chain_[i] >>> j) & 0xff;\n    }\n  }\n  return digest;\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Abstract cryptographic hash interface.\n *\n * See goog.crypt.Sha1 and goog.crypt.Md5 for sample implementations.\n */\n\ngoog.provide('goog.crypt.Hash');\n\n\n\n/**\n * Create a cryptographic hash instance.\n *\n * @constructor\n * @struct\n */\ngoog.crypt.Hash = function() {\n  'use strict';\n  /**\n   * The block size for the hasher.\n   * @type {number}\n   */\n  this.blockSize = -1;\n};\n\n\n/**\n * Resets the internal accumulator.\n */\ngoog.crypt.Hash.prototype.reset = goog.abstractMethod;\n\n\n/**\n * Adds a byte array (array with values in [0-255] range) or a string (must\n * only contain 8-bit, i.e., Latin1 characters) to the internal accumulator.\n *\n * Many hash functions operate on blocks of data and implement optimizations\n * when a full chunk of data is readily available. Hence it is often preferable\n * to provide large chunks of data (a kilobyte or more) than to repeatedly\n * call the update method with few tens of bytes. If this is not possible, or\n * not feasible, it might be good to provide data in multiplies of hash block\n * size (often 64 bytes). Please see the implementation and performance tests\n * of your favourite hash.\n *\n * @param {Array<number>|Uint8Array|string} bytes Data used for the update.\n * @param {number=} opt_length Number of bytes to use.\n */\ngoog.crypt.Hash.prototype.update = goog.abstractMethod;\n\n\n/**\n * @return {!Array<number>} The finalized hash computed\n *     from the internal accumulator.\n */\ngoog.crypt.Hash.prototype.digest = goog.abstractMethod;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Defines an Integer class for representing (potentially)\n * infinite length two's-complement integer values.\n *\n * For the specific case of 64-bit integers, use goog.math.Long, which is more\n * efficient.\n */\n\ngoog.provide('goog.math.Integer');\n\ngoog.require('goog.reflect');\n\n/**\n * Constructs a two's-complement integer an array containing bits of the\n * integer in 32-bit (signed) pieces, given in little-endian order (i.e.,\n * lowest-order bits in the first piece), and the sign of -1 or 0.\n *\n * See the from* functions below for other convenient ways of constructing\n * Integers.\n *\n * The internal representation of an integer is an array of 32-bit signed\n * pieces, along with a sign (0 or -1) that indicates the contents of all the\n * other 32-bit pieces out to infinity.  We use 32-bit pieces because these are\n * the size of integers on which JavaScript performs bit-operations.  For\n * operations like addition and multiplication, we split each number into 16-bit\n * pieces, which can easily be multiplied within JavaScript's floating-point\n * representation without overflow or change in sign.\n *\n * @struct\n * @constructor\n * @param {Array<number>} bits Array containing the bits of the number.\n * @param {number} sign The sign of the number: -1 for negative and 0 positive.\n * @final\n */\ngoog.math.Integer = function(bits, sign) {\n  'use strict';\n  /**\n   * @type {number}\n   * @private\n   */\n  this.sign_ = sign;\n\n  // Note: using a local variable while initializing the array helps the\n  // compiler understand that assigning to the array is local side-effect and\n  // that enables the entire constructor to be seen as side-effect free.\n  var localBits = [];\n\n  // Copy the 32-bit signed integer values passed in.  We prune out those at the\n  // top that equal the sign since they are redundant.\n  var top = true;\n\n  for (var i = bits.length - 1; i >= 0; i--) {\n    var val = bits[i] | 0;\n    if (!top || val != sign) {\n      localBits[i] = val;\n      top = false;\n    }\n  }\n\n  /**\n   * @type {!Array<number>}\n   * @private\n   * @const\n   */\n  this.bits_ = localBits;\n};\n\n\n// NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the\n// from* methods on which they depend.\n\n\n/**\n * A cache of the Integer representations of small integer values.\n * @type {!Object<number, !goog.math.Integer>}\n * @private\n */\ngoog.math.Integer.IntCache_ = {};\n\n\n/**\n * Returns an Integer representing the given (32-bit) integer value.\n * @param {number} value A 32-bit integer value.\n * @return {!goog.math.Integer} The corresponding Integer value.\n */\ngoog.math.Integer.fromInt = function(value) {\n  'use strict';\n  if (-128 <= value && value < 128) {\n    return goog.reflect.cache(\n        goog.math.Integer.IntCache_, value, function(val) {\n          'use strict';\n          return new goog.math.Integer([val | 0], val < 0 ? -1 : 0);\n        });\n  }\n  return new goog.math.Integer([value | 0], value < 0 ? -1 : 0);\n};\n\n\n/**\n * Returns an Integer representing the given value, provided that it is a finite\n * number.  Otherwise, zero is returned.\n * @param {number} value The value in question.\n * @return {!goog.math.Integer} The corresponding Integer value.\n */\ngoog.math.Integer.fromNumber = function(value) {\n  'use strict';\n  if (isNaN(value) || !isFinite(value)) {\n    return goog.math.Integer.ZERO;\n  } else if (value < 0) {\n    return goog.math.Integer.fromNumber(-value).negate();\n  } else {\n    var bits = [];\n    var pow = 1;\n    for (var i = 0; value >= pow; i++) {\n      bits[i] = (value / pow) | 0;\n      pow *= goog.math.Integer.TWO_PWR_32_DBL_;\n    }\n    return new goog.math.Integer(bits, 0);\n  }\n};\n\n\n/**\n * Returns a Integer representing the value that comes by concatenating the\n * given entries, each is assumed to be 32 signed bits, given in little-endian\n * order (lowest order bits in the lowest index), and sign-extending the highest\n * order 32-bit value.\n * @param {Array<number>} bits The bits of the number, in 32-bit signed pieces,\n *     in little-endian order.\n * @return {!goog.math.Integer} The corresponding Integer value.\n */\ngoog.math.Integer.fromBits = function(bits) {\n  'use strict';\n  var high = bits[bits.length - 1];\n  return new goog.math.Integer(bits, high & (1 << 31) ? -1 : 0);\n};\n\n\n/**\n * Returns an Integer representation of the given string, written using the\n * given radix.\n * @param {string} str The textual representation of the Integer.\n * @param {number=} opt_radix The radix in which the text is written.\n * @return {!goog.math.Integer} The corresponding Integer value.\n */\ngoog.math.Integer.fromString = function(str, opt_radix) {\n  'use strict';\n  if (str.length == 0) {\n    throw new Error('number format error: empty string');\n  }\n\n  var radix = opt_radix || 10;\n  if (radix < 2 || 36 < radix) {\n    throw new Error('radix out of range: ' + radix);\n  }\n\n  if (str.charAt(0) == '-') {\n    return goog.math.Integer.fromString(str.substring(1), radix).negate();\n  } else if (str.indexOf('-') >= 0) {\n    throw new Error('number format error: interior \"-\" character');\n  }\n\n  // Do several (8) digits each time through the loop, so as to\n  // minimize the calls to the very expensive emulated div.\n  var radixToPower = goog.math.Integer.fromNumber(Math.pow(radix, 8));\n\n  var result = goog.math.Integer.ZERO;\n  for (var i = 0; i < str.length; i += 8) {\n    var size = Math.min(8, str.length - i);\n    var value = parseInt(str.substring(i, i + size), radix);\n    if (size < 8) {\n      var power = goog.math.Integer.fromNumber(Math.pow(radix, size));\n      result = result.multiply(power).add(goog.math.Integer.fromNumber(value));\n    } else {\n      result = result.multiply(radixToPower);\n      result = result.add(goog.math.Integer.fromNumber(value));\n    }\n  }\n  return result;\n};\n\n\n/**\n * A number used repeatedly in calculations.  This must appear before the first\n * call to the from* functions below.\n * @type {number}\n * @private\n */\ngoog.math.Integer.TWO_PWR_32_DBL_ = (1 << 16) * (1 << 16);\n\n\n/**  @type {!goog.math.Integer} */\ngoog.math.Integer.ZERO = goog.math.Integer.fromInt(0);\n\n/**  @type {!goog.math.Integer} */\ngoog.math.Integer.ONE = goog.math.Integer.fromInt(1);\n\n\n/**\n * @const\n * @type {!goog.math.Integer}\n * @private\n */\ngoog.math.Integer.TWO_PWR_24_ = goog.math.Integer.fromInt(1 << 24);\n\n/**\n * Returns the value, assuming it is a 32-bit integer.\n * @return {number} The corresponding int value.\n */\ngoog.math.Integer.prototype.toInt = function() {\n  'use strict';\n  return this.bits_.length > 0 ? this.bits_[0] : this.sign_;\n};\n\n\n/** @return {number} The closest floating-point representation to this value. */\ngoog.math.Integer.prototype.toNumber = function() {\n  'use strict';\n  if (this.isNegative()) {\n    return -this.negate().toNumber();\n  } else {\n    var val = 0;\n    var pow = 1;\n    for (var i = 0; i < this.bits_.length; i++) {\n      val += this.getBitsUnsigned(i) * pow;\n      pow *= goog.math.Integer.TWO_PWR_32_DBL_;\n    }\n    return val;\n  }\n};\n\n\n/**\n * @param {number=} opt_radix The radix in which the text should be written.\n * @return {string} The textual representation of this value.\n * @override\n */\ngoog.math.Integer.prototype.toString = function(opt_radix) {\n  'use strict';\n  var radix = opt_radix || 10;\n  if (radix < 2 || 36 < radix) {\n    throw new Error('radix out of range: ' + radix);\n  }\n\n  if (this.isZero()) {\n    return '0';\n  } else if (this.isNegative()) {\n    return '-' + this.negate().toString(radix);\n  }\n\n  // Do several (6) digits each time through the loop, so as to\n  // minimize the calls to the very expensive emulated div.\n  var radixToPower = goog.math.Integer.fromNumber(Math.pow(radix, 6));\n\n  var rem = this;\n  var result = '';\n  while (true) {\n    var remDiv = rem.divide(radixToPower);\n    // The right shifting fixes negative values in the case when\n    // intval >= 2^31; for more details see\n    // https://github.com/google/closure-library/pull/498\n    var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt() >>> 0;\n    var digits = intval.toString(radix);\n\n    rem = remDiv;\n    if (rem.isZero()) {\n      return digits + result;\n    } else {\n      while (digits.length < 6) {\n        digits = '0' + digits;\n      }\n      result = '' + digits + result;\n    }\n  }\n};\n\n\n/**\n * Returns the index-th 32-bit (signed) piece of the Integer according to\n * little-endian order (i.e., index 0 contains the smallest bits).\n * @param {number} index The index in question.\n * @return {number} The requested 32-bits as a signed number.\n */\ngoog.math.Integer.prototype.getBits = function(index) {\n  'use strict';\n  if (index < 0) {\n    return 0;  // Allowing this simplifies bit shifting operations below...\n  } else if (index < this.bits_.length) {\n    return this.bits_[index];\n  } else {\n    return this.sign_;\n  }\n};\n\n\n/**\n * Returns the index-th 32-bit piece as an unsigned number.\n * @param {number} index The index in question.\n * @return {number} The requested 32-bits as an unsigned number.\n */\ngoog.math.Integer.prototype.getBitsUnsigned = function(index) {\n  'use strict';\n  var val = this.getBits(index);\n  return val >= 0 ? val : goog.math.Integer.TWO_PWR_32_DBL_ + val;\n};\n\n\n/** @return {number} The sign bit of this number, -1 or 0. */\ngoog.math.Integer.prototype.getSign = function() {\n  'use strict';\n  return this.sign_;\n};\n\n\n/** @return {boolean} Whether this value is zero. */\ngoog.math.Integer.prototype.isZero = function() {\n  'use strict';\n  if (this.sign_ != 0) {\n    return false;\n  }\n  for (var i = 0; i < this.bits_.length; i++) {\n    if (this.bits_[i] != 0) {\n      return false;\n    }\n  }\n  return true;\n};\n\n\n/** @return {boolean} Whether this value is negative. */\ngoog.math.Integer.prototype.isNegative = function() {\n  'use strict';\n  return this.sign_ == -1;\n};\n\n\n/** @return {boolean} Whether this value is odd. */\ngoog.math.Integer.prototype.isOdd = function() {\n  'use strict';\n  return (this.bits_.length == 0) && (this.sign_ == -1) ||\n      (this.bits_.length > 0) && ((this.bits_[0] & 1) != 0);\n};\n\n\n/**\n * @param {goog.math.Integer} other Integer to compare against.\n * @return {boolean} Whether this Integer equals the other.\n */\ngoog.math.Integer.prototype.equals = function(other) {\n  'use strict';\n  if (this.sign_ != other.sign_) {\n    return false;\n  }\n  var len = Math.max(this.bits_.length, other.bits_.length);\n  for (var i = 0; i < len; i++) {\n    if (this.getBits(i) != other.getBits(i)) {\n      return false;\n    }\n  }\n  return true;\n};\n\n\n/**\n * @param {goog.math.Integer} other Integer to compare against.\n * @return {boolean} Whether this Integer does not equal the other.\n */\ngoog.math.Integer.prototype.notEquals = function(other) {\n  'use strict';\n  return !this.equals(other);\n};\n\n\n/**\n * @param {goog.math.Integer} other Integer to compare against.\n * @return {boolean} Whether this Integer is greater than the other.\n */\ngoog.math.Integer.prototype.greaterThan = function(other) {\n  'use strict';\n  return this.compare(other) > 0;\n};\n\n\n/**\n * @param {goog.math.Integer} other Integer to compare against.\n * @return {boolean} Whether this Integer is greater than or equal to the other.\n */\ngoog.math.Integer.prototype.greaterThanOrEqual = function(other) {\n  'use strict';\n  return this.compare(other) >= 0;\n};\n\n\n/**\n * @param {goog.math.Integer} other Integer to compare against.\n * @return {boolean} Whether this Integer is less than the other.\n */\ngoog.math.Integer.prototype.lessThan = function(other) {\n  'use strict';\n  return this.compare(other) < 0;\n};\n\n\n/**\n * @param {goog.math.Integer} other Integer to compare against.\n * @return {boolean} Whether this Integer is less than or equal to the other.\n */\ngoog.math.Integer.prototype.lessThanOrEqual = function(other) {\n  'use strict';\n  return this.compare(other) <= 0;\n};\n\n\n/**\n * Compares this Integer with the given one.\n * @param {goog.math.Integer} other Integer to compare against.\n * @return {number} 0 if they are the same, 1 if the this is greater, and -1\n *     if the given one is greater.\n */\ngoog.math.Integer.prototype.compare = function(other) {\n  'use strict';\n  var diff = this.subtract(other);\n  if (diff.isNegative()) {\n    return -1;\n  } else if (diff.isZero()) {\n    return 0;\n  } else {\n    return +1;\n  }\n};\n\n\n/**\n * Returns an integer with only the first numBits bits of this value, sign\n * extended from the final bit.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!goog.math.Integer} The shorted integer value.\n */\ngoog.math.Integer.prototype.shorten = function(numBits) {\n  'use strict';\n  var arr_index = (numBits - 1) >> 5;\n  var bit_index = (numBits - 1) % 32;\n  var bits = [];\n  for (var i = 0; i < arr_index; i++) {\n    bits[i] = this.getBits(i);\n  }\n  var sigBits = bit_index == 31 ? 0xFFFFFFFF : (1 << (bit_index + 1)) - 1;\n  var val = this.getBits(arr_index) & sigBits;\n  if (val & (1 << bit_index)) {\n    val |= 0xFFFFFFFF - sigBits;\n    bits[arr_index] = val;\n    return new goog.math.Integer(bits, -1);\n  } else {\n    bits[arr_index] = val;\n    return new goog.math.Integer(bits, 0);\n  }\n};\n\n\n/** @return {!goog.math.Integer} The negation of this value. */\ngoog.math.Integer.prototype.negate = function() {\n  'use strict';\n  return this.not().add(goog.math.Integer.ONE);\n};\n\n\n/** @return {!goog.math.Integer} The absolute value of this value. */\ngoog.math.Integer.prototype.abs = function() {\n  'use strict';\n  return this.isNegative() ? this.negate() : this;\n};\n\n\n/**\n * Returns the sum of this and the given Integer.\n * @param {goog.math.Integer} other The Integer to add to this.\n * @return {!goog.math.Integer} The Integer result.\n */\ngoog.math.Integer.prototype.add = function(other) {\n  'use strict';\n  var len = Math.max(this.bits_.length, other.bits_.length);\n  var arr = [];\n  var carry = 0;\n\n  for (var i = 0; i <= len; i++) {\n    var a1 = this.getBits(i) >>> 16;\n    var a0 = this.getBits(i) & 0xFFFF;\n\n    var b1 = other.getBits(i) >>> 16;\n    var b0 = other.getBits(i) & 0xFFFF;\n\n    var c0 = carry + a0 + b0;\n    var c1 = (c0 >>> 16) + a1 + b1;\n    carry = c1 >>> 16;\n    c0 &= 0xFFFF;\n    c1 &= 0xFFFF;\n    arr[i] = (c1 << 16) | c0;\n  }\n  return goog.math.Integer.fromBits(arr);\n};\n\n\n/**\n * Returns the difference of this and the given Integer.\n * @param {goog.math.Integer} other The Integer to subtract from this.\n * @return {!goog.math.Integer} The Integer result.\n */\ngoog.math.Integer.prototype.subtract = function(other) {\n  'use strict';\n  return this.add(other.negate());\n};\n\n\n/**\n * Returns the product of this and the given Integer.\n * @param {goog.math.Integer} other The Integer to multiply against this.\n * @return {!goog.math.Integer} The product of this and the other.\n */\ngoog.math.Integer.prototype.multiply = function(other) {\n  'use strict';\n  if (this.isZero()) {\n    return goog.math.Integer.ZERO;\n  } else if (other.isZero()) {\n    return goog.math.Integer.ZERO;\n  }\n\n  if (this.isNegative()) {\n    if (other.isNegative()) {\n      return this.negate().multiply(other.negate());\n    } else {\n      return this.negate().multiply(other).negate();\n    }\n  } else if (other.isNegative()) {\n    return this.multiply(other.negate()).negate();\n  }\n\n  // If both numbers are small, use float multiplication\n  if (this.lessThan(goog.math.Integer.TWO_PWR_24_) &&\n      other.lessThan(goog.math.Integer.TWO_PWR_24_)) {\n    return goog.math.Integer.fromNumber(this.toNumber() * other.toNumber());\n  }\n\n  // Fill in an array of 16-bit products.\n  var len = this.bits_.length + other.bits_.length;\n  var arr = [];\n  for (var i = 0; i < 2 * len; i++) {\n    arr[i] = 0;\n  }\n  for (var i = 0; i < this.bits_.length; i++) {\n    for (var j = 0; j < other.bits_.length; j++) {\n      var a1 = this.getBits(i) >>> 16;\n      var a0 = this.getBits(i) & 0xFFFF;\n\n      var b1 = other.getBits(j) >>> 16;\n      var b0 = other.getBits(j) & 0xFFFF;\n\n      arr[2 * i + 2 * j] += a0 * b0;\n      goog.math.Integer.carry16_(arr, 2 * i + 2 * j);\n      arr[2 * i + 2 * j + 1] += a1 * b0;\n      goog.math.Integer.carry16_(arr, 2 * i + 2 * j + 1);\n      arr[2 * i + 2 * j + 1] += a0 * b1;\n      goog.math.Integer.carry16_(arr, 2 * i + 2 * j + 1);\n      arr[2 * i + 2 * j + 2] += a1 * b1;\n      goog.math.Integer.carry16_(arr, 2 * i + 2 * j + 2);\n    }\n  }\n\n  // Combine the 16-bit values into 32-bit values.\n  for (var i = 0; i < len; i++) {\n    arr[i] = (arr[2 * i + 1] << 16) | arr[2 * i];\n  }\n  for (var i = len; i < 2 * len; i++) {\n    arr[i] = 0;\n  }\n  return new goog.math.Integer(arr, 0);\n};\n\n\n/**\n * Carries any overflow from the given index into later entries.\n * @param {Array<number>} bits Array of 16-bit values in little-endian order.\n * @param {number} index The index in question.\n * @private\n */\ngoog.math.Integer.carry16_ = function(bits, index) {\n  'use strict';\n  while ((bits[index] & 0xFFFF) != bits[index]) {\n    bits[index + 1] += bits[index] >>> 16;\n    bits[index] &= 0xFFFF;\n    index++;\n  }\n};\n\n\n/**\n * Returns \"this\" Integer divided by the given one. Both \"this\" and the given\n * Integer MUST be positive.\n *\n * This method is only needed for very large numbers (>10^308),\n * for which the original division algorithm gets into an infinite\n * loop (see https://github.com/google/closure-library/issues/500).\n *\n * The algorithm has some possible performance enhancements (or\n * could be rewritten entirely), it's just an initial solution for\n * the issue linked above.\n *\n * @param {!goog.math.Integer} other The Integer to divide \"this\" by.\n * @return {!goog.math.Integer.DivisionResult}\n * @private\n */\ngoog.math.Integer.prototype.slowDivide_ = function(other) {\n  'use strict';\n  if (this.isNegative() || other.isNegative()) {\n    throw new Error('slowDivide_ only works with positive integers.');\n  }\n\n  var twoPower = goog.math.Integer.ONE;\n  var multiple = other;\n\n  // First we have to figure out what the highest bit of the result\n  // is, so we increase \"twoPower\" and \"multiple\" until \"multiple\"\n  // exceeds \"this\".\n  while (multiple.lessThanOrEqual(this)) {\n    twoPower = twoPower.shiftLeft(1);\n    multiple = multiple.shiftLeft(1);\n  }\n\n  // Rewind by one power of two, giving us the highest bit of the\n  // result.\n  var res = twoPower.shiftRight(1);\n  var total = multiple.shiftRight(1);\n\n  // Now we starting decreasing \"multiple\" and \"twoPower\" to find the\n  // rest of the bits of the result.\n  var total2;\n  multiple = multiple.shiftRight(2);\n  twoPower = twoPower.shiftRight(2);\n  while (!multiple.isZero()) {\n    // whenever we can add \"multiple\" to the total and not exceed\n    // \"this\", that means we've found a 1 bit. Else we've found a 0\n    // and don't need to add to the result.\n    total2 = total.add(multiple);\n    if (total2.lessThanOrEqual(this)) {\n      res = res.add(twoPower);\n      total = total2;\n    }\n    multiple = multiple.shiftRight(1);\n    twoPower = twoPower.shiftRight(1);\n  }\n\n\n  // TODO(user): Calculate this more efficiently during the division.\n  // This is kind of a waste since it isn't always needed, but it keeps the\n  // API smooth. Since this is already a slow path it probably isn't a big deal.\n  var remainder = this.subtract(res.multiply(other));\n  return new goog.math.Integer.DivisionResult(res, remainder);\n};\n\n\n/**\n * Returns this Integer divided by the given one.\n * @param {!goog.math.Integer} other The Integer to divide this by.\n * @return {!goog.math.Integer} This value divided by the given one.\n */\ngoog.math.Integer.prototype.divide = function(other) {\n  'use strict';\n  return this.divideAndRemainder(other).quotient;\n};\n\n\n/**\n * A struct for holding the quotient and remainder of a division.\n *\n * @constructor\n * @final\n * @struct\n *\n * @param {!goog.math.Integer} quotient\n * @param {!goog.math.Integer} remainder\n */\ngoog.math.Integer.DivisionResult = function(quotient, remainder) {\n  'use strict';\n  /** @const */\n  this.quotient = quotient;\n\n  /** @const */\n  this.remainder = remainder;\n};\n\n\n/**\n * Returns this Integer divided by the given one, as well as the remainder of\n * that division.\n *\n * @param {!goog.math.Integer} other The Integer to divide this by.\n * @return {!goog.math.Integer.DivisionResult}\n */\ngoog.math.Integer.prototype.divideAndRemainder = function(other) {\n  'use strict';\n  if (other.isZero()) {\n    throw new Error('division by zero');\n  } else if (this.isZero()) {\n    return new goog.math.Integer.DivisionResult(\n        goog.math.Integer.ZERO, goog.math.Integer.ZERO);\n  }\n\n  if (this.isNegative()) {\n    // Do the division on the negative of the numerator...\n    var result = this.negate().divideAndRemainder(other);\n    return new goog.math.Integer.DivisionResult(\n        // ...and flip the sign back after.\n        result.quotient.negate(),\n        // The remainder must always have the same sign as the numerator.\n        result.remainder.negate());\n  } else if (other.isNegative()) {\n    // Do the division on the negative of the denominator...\n    var result = this.divideAndRemainder(other.negate());\n    return new goog.math.Integer.DivisionResult(\n        // ...and flip the sign back after.\n        result.quotient.negate(),\n        // The remainder must always have the same sign as the numerator.\n        result.remainder);\n  }\n\n  // Have to degrade to slowDivide for Very Large Numbers, because\n  // they're out of range for the floating-point approximation\n  // technique used below.\n  if (this.bits_.length > 30) {\n    return this.slowDivide_(other);\n  }\n\n  // Repeat the following until the remainder is less than other:  find a\n  // floating-point that approximates remainder / other *from below*, add this\n  // into the result, and subtract it from the remainder.  It is critical that\n  // the approximate value is less than or equal to the real value so that the\n  // remainder never becomes negative.\n  var res = goog.math.Integer.ZERO;\n  var rem = this;\n  while (rem.greaterThanOrEqual(other)) {\n    // Approximate the result of division. This may be a little greater or\n    // smaller than the actual value.\n    var approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));\n\n    // We will tweak the approximate result by changing it in the 48-th digit or\n    // the smallest non-fractional digit, whichever is larger.\n    var log2 = Math.ceil(Math.log(approx) / Math.LN2);\n    var delta = (log2 <= 48) ? 1 : Math.pow(2, log2 - 48);\n\n    // Decrease the approximation until it is smaller than the remainder.  Note\n    // that if it is too large, the product overflows and is negative.\n    var approxRes = goog.math.Integer.fromNumber(approx);\n    var approxRem = approxRes.multiply(other);\n    while (approxRem.isNegative() || approxRem.greaterThan(rem)) {\n      approx -= delta;\n      approxRes = goog.math.Integer.fromNumber(approx);\n      approxRem = approxRes.multiply(other);\n    }\n\n    // We know the answer can't be zero... and actually, zero would cause\n    // infinite recursion since we would make no progress.\n    if (approxRes.isZero()) {\n      approxRes = goog.math.Integer.ONE;\n    }\n\n    res = res.add(approxRes);\n    rem = rem.subtract(approxRem);\n  }\n  return new goog.math.Integer.DivisionResult(res, rem);\n};\n\n\n/**\n * Returns this Integer modulo the given one.\n * @param {!goog.math.Integer} other The Integer by which to mod.\n * @return {!goog.math.Integer} This value modulo the given one.\n */\ngoog.math.Integer.prototype.modulo = function(other) {\n  'use strict';\n  return this.divideAndRemainder(other).remainder;\n};\n\n\n/** @return {!goog.math.Integer} The bitwise-NOT of this value. */\ngoog.math.Integer.prototype.not = function() {\n  'use strict';\n  var len = this.bits_.length;\n  var arr = [];\n  for (var i = 0; i < len; i++) {\n    arr[i] = ~this.bits_[i];\n  }\n  return new goog.math.Integer(arr, ~this.sign_);\n};\n\n\n/**\n * Returns the bitwise-AND of this Integer and the given one.\n * @param {goog.math.Integer} other The Integer to AND with this.\n * @return {!goog.math.Integer} The bitwise-AND of this and the other.\n */\ngoog.math.Integer.prototype.and = function(other) {\n  'use strict';\n  var len = Math.max(this.bits_.length, other.bits_.length);\n  var arr = [];\n  for (var i = 0; i < len; i++) {\n    arr[i] = this.getBits(i) & other.getBits(i);\n  }\n  return new goog.math.Integer(arr, this.sign_ & other.sign_);\n};\n\n\n/**\n * Returns the bitwise-OR of this Integer and the given one.\n * @param {goog.math.Integer} other The Integer to OR with this.\n * @return {!goog.math.Integer} The bitwise-OR of this and the other.\n */\ngoog.math.Integer.prototype.or = function(other) {\n  'use strict';\n  var len = Math.max(this.bits_.length, other.bits_.length);\n  var arr = [];\n  for (var i = 0; i < len; i++) {\n    arr[i] = this.getBits(i) | other.getBits(i);\n  }\n  return new goog.math.Integer(arr, this.sign_ | other.sign_);\n};\n\n\n/**\n * Returns the bitwise-XOR of this Integer and the given one.\n * @param {goog.math.Integer} other The Integer to XOR with this.\n * @return {!goog.math.Integer} The bitwise-XOR of this and the other.\n */\ngoog.math.Integer.prototype.xor = function(other) {\n  'use strict';\n  var len = Math.max(this.bits_.length, other.bits_.length);\n  var arr = [];\n  for (var i = 0; i < len; i++) {\n    arr[i] = this.getBits(i) ^ other.getBits(i);\n  }\n  return new goog.math.Integer(arr, this.sign_ ^ other.sign_);\n};\n\n\n/**\n * Returns this value with bits shifted to the left by the given amount.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!goog.math.Integer} This shifted to the left by the given amount.\n */\ngoog.math.Integer.prototype.shiftLeft = function(numBits) {\n  'use strict';\n  var arr_delta = numBits >> 5;\n  var bit_delta = numBits % 32;\n  var len = this.bits_.length + arr_delta + (bit_delta > 0 ? 1 : 0);\n  var arr = [];\n  for (var i = 0; i < len; i++) {\n    if (bit_delta > 0) {\n      arr[i] = (this.getBits(i - arr_delta) << bit_delta) |\n          (this.getBits(i - arr_delta - 1) >>> (32 - bit_delta));\n    } else {\n      arr[i] = this.getBits(i - arr_delta);\n    }\n  }\n  return new goog.math.Integer(arr, this.sign_);\n};\n\n\n/**\n * Returns this value with bits shifted to the right by the given amount.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!goog.math.Integer} This shifted to the right by the given amount.\n */\ngoog.math.Integer.prototype.shiftRight = function(numBits) {\n  'use strict';\n  var arr_delta = numBits >> 5;\n  var bit_delta = numBits % 32;\n  var len = this.bits_.length - arr_delta;\n  var arr = [];\n  for (var i = 0; i < len; i++) {\n    if (bit_delta > 0) {\n      arr[i] = (this.getBits(i + arr_delta) >>> bit_delta) |\n          (this.getBits(i + arr_delta + 1) << (32 - bit_delta));\n    } else {\n      arr[i] = this.getBits(i + arr_delta);\n    }\n  }\n  return new goog.math.Integer(arr, this.sign_);\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Transport support for WebChannel.\n *\n * The <code>WebChannelTransport</code> implementation serves as the factory\n * for <code>WebChannel</code>, which offers an abstraction for\n * point-to-point socket-like communication similar to what BrowserChannel\n * or HTML5 WebSocket offers.\n */\n\ngoog.provide('goog.net.WebChannelTransport');\n\ngoog.requireType('goog.net.WebChannel');\ngoog.requireType('goog.net.WebChannel.Options');\n\n\n\n/**\n * A WebChannelTransport instance represents a shared context of logical\n * connectivity between a browser client and a remote origin.\n *\n * Over a single WebChannelTransport instance, multiple WebChannels may be\n * created against different URLs, which may all share the same\n * underlying connectivity (i.e. TCP connection) whenever possible.\n *\n * When multi-domains are supported, such as CORS, multiple origins may be\n * supported over a single WebChannelTransport instance at the same time.\n *\n * Sharing between different window contexts such as tabs is not addressed\n * by WebChannelTransport. Applications may choose HTML5 shared workers\n * or other techniques to access the same transport instance\n * across different window contexts.\n *\n * @interface\n */\ngoog.net.WebChannelTransport = function() {};\n\n\n/**\n * The client version. This integer value will be passed to the server\n * when a channel is opened to inform the server the client \"capabilities\".\n *\n * Wire protocol version is a different concept and is internal to the\n * transport implementation.\n *\n * @const\n * @type {number}\n */\ngoog.net.WebChannelTransport.CLIENT_VERSION = 22;\n\n\n/**\n * Create a new WebChannel instance.\n *\n * The new WebChannel is to be opened against the server-side resource\n * as specified by the given URL. See {@link goog.net.WebChannel} for detailed\n * semantics.\n *\n * @param {string} url The URL path for the new WebChannel instance.\n * @param {!goog.net.WebChannel.Options=} opt_options Configuration for the\n *     new WebChannel instance. The configuration object is reusable after\n *     the new channel instance is created.\n * @return {!goog.net.WebChannel} the newly created WebChannel instance.\n */\ngoog.net.WebChannelTransport.prototype.createWebChannel = goog.abstractMethod;\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Bring in closure-library dependencies\n */\n\ngoog.provide('firebase.webchannel.wrapper');\n\n// goog.net.WebChannelTransport\ngoog.require('goog.net.createWebChannelTransport');\ngoog.require('goog.net.FetchXmlHttpFactory');\ngoog.require('goog.labs.net.webChannel.requestStats');\ngoog.require('goog.labs.net.webChannel.WebChannelBaseTransport');\n\n/**\n * NOTE: The `createWebChannel` function takes an options object as a second param\n * whose properties are typically mangled. We override these in externs/overrides.js\n * Without those externs, this does not function properly.\n */\ngoog.labs.net.webChannel.WebChannelBaseTransport.prototype['createWebChannel'] =\n  goog.labs.net.webChannel.WebChannelBaseTransport.prototype.createWebChannel;\ngoog.labs.net.webChannel.WebChannelBaseTransport.Channel.prototype['send'] =\n  goog.labs.net.webChannel.WebChannelBaseTransport.Channel.prototype.send;\ngoog.labs.net.webChannel.WebChannelBaseTransport.Channel.prototype['open'] =\n  goog.labs.net.webChannel.WebChannelBaseTransport.Channel.prototype.open;\ngoog.labs.net.webChannel.WebChannelBaseTransport.Channel.prototype['close'] =\n  goog.labs.net.webChannel.WebChannelBaseTransport.Channel.prototype.close;\n\n// goog.net.ErrorCode\ngoog.require('goog.net.ErrorCode');\ngoog.net.ErrorCode['NO_ERROR'] = goog.net.ErrorCode.NO_ERROR;\ngoog.net.ErrorCode['TIMEOUT'] = goog.net.ErrorCode.TIMEOUT;\ngoog.net.ErrorCode['HTTP_ERROR'] = goog.net.ErrorCode.HTTP_ERROR;\n\n// goog.net.ErrorType\ngoog.require('goog.net.EventType');\ngoog.net.EventType['COMPLETE'] = goog.net.EventType.COMPLETE;\n\n// goog.net.WebChannel\ngoog.require('goog.net.WebChannel');\ngoog.require('goog.events.EventTarget');\ngoog.net.WebChannel['EventType'] = goog.net.WebChannel.EventType;\ngoog.net.WebChannel.EventType['OPEN'] = goog.net.WebChannel.EventType.OPEN;\ngoog.net.WebChannel.EventType['CLOSE'] = goog.net.WebChannel.EventType.CLOSE;\ngoog.net.WebChannel.EventType['ERROR'] = goog.net.WebChannel.EventType.ERROR;\ngoog.net.WebChannel.EventType['MESSAGE'] =\n  goog.net.WebChannel.EventType.MESSAGE;\ngoog.events.EventTarget.prototype['listen'] =\n  goog.events.EventTarget.prototype.listen;\n\ngoog.require('goog.net.XhrIo');\ngoog.net.XhrIo.prototype['listenOnce'] = goog.net.XhrIo.prototype.listenOnce;\ngoog.net.XhrIo.prototype['getLastError'] =\n  goog.net.XhrIo.prototype.getLastError;\ngoog.net.XhrIo.prototype['getLastErrorCode'] =\n  goog.net.XhrIo.prototype.getLastErrorCode;\ngoog.net.XhrIo.prototype['getStatus'] = goog.net.XhrIo.prototype.getStatus;\ngoog.net.XhrIo.prototype['getResponseJson'] =\n  goog.net.XhrIo.prototype.getResponseJson;\ngoog.net.XhrIo.prototype['getResponseText'] =\n  goog.net.XhrIo.prototype.getResponseText;\ngoog.net.XhrIo.prototype['send'] = goog.net.XhrIo.prototype.send;\ngoog.net.XhrIo.prototype['setWithCredentials'] =\n  goog.net.XhrIo.prototype.setWithCredentials;\n\ngoog.require('goog.crypt.Md5');\ngoog.crypt.Md5.prototype['digest'] = goog.crypt.Md5.prototype.digest;\ngoog.crypt.Md5.prototype['reset'] = goog.crypt.Md5.prototype.reset;\ngoog.crypt.Md5.prototype['update'] = goog.crypt.Md5.prototype.update;\n\ngoog.require('goog.math.Integer');\ngoog.math.Integer.prototype['add'] = goog.math.Integer.prototype.add;\ngoog.math.Integer.prototype['multiply'] = goog.math.Integer.prototype.multiply;\ngoog.math.Integer.prototype['modulo'] = goog.math.Integer.prototype.modulo;\ngoog.math.Integer.prototype['compare'] = goog.math.Integer.prototype.compare;\ngoog.math.Integer.prototype['toNumber'] = goog.math.Integer.prototype.toNumber;\ngoog.math.Integer.prototype['toString'] = goog.math.Integer.prototype.toString;\ngoog.math.Integer.prototype['getBits'] = goog.math.Integer.prototype.getBits;\ngoog.math.Integer['fromNumber'] = goog.math.Integer.fromNumber;\ngoog.math.Integer['fromString'] = goog.math.Integer.fromString;\n\nmodule['exports']['createWebChannelTransport'] =\n  goog.net.createWebChannelTransport;\nmodule['exports']['getStatEventTarget'] =\n  goog.labs.net.webChannel.requestStats.getStatEventTarget;\nmodule['exports']['ErrorCode'] = goog.net.ErrorCode;\nmodule['exports']['EventType'] = goog.net.EventType;\nmodule['exports']['Event'] = goog.labs.net.webChannel.requestStats.Event;\nmodule['exports']['Stat'] = goog.labs.net.webChannel.requestStats.Stat;\nmodule['exports']['FetchXmlHttpFactory'] = goog.net.FetchXmlHttpFactory;\nmodule['exports']['WebChannel'] = goog.net.WebChannel;\nmodule['exports']['XhrIo'] = goog.net.XhrIo;\nmodule['exports']['Md5'] = goog.crypt.Md5;\nmodule['exports']['Integer'] = goog.math.Integer;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Default factory for <code>WebChannelTransport</code> to\n * avoid exposing concrete classes to clients.\n */\n\ngoog.provide('goog.net.createWebChannelTransport');\n\ngoog.require('goog.labs.net.webChannel.WebChannelBaseTransport');\ngoog.requireType('goog.net.WebChannelTransport');\n\n\n/**\n * Create a new WebChannelTransport instance using the default implementation.\n * Throws an error message if no default transport available in the current\n * environment.\n *\n * @return {!goog.net.WebChannelTransport} the newly created transport instance.\n */\ngoog.net.createWebChannelTransport = function() {\n  'use strict';\n  return new goog.labs.net.webChannel.WebChannelBaseTransport();\n};\n","import { Orbit } from '@orbit/core';\nimport { Source } from '@orbit/data';\nimport { Dict, objectValues } from '@orbit/utils';\nimport { Strategy } from './strategy';\n\nconst { assert } = Orbit;\n\nexport interface CoordinatorOptions {\n  sources?: Source[];\n  strategies?: Strategy[];\n  defaultActivationOptions?: ActivationOptions;\n}\n\nexport enum LogLevel {\n  None,\n  Errors,\n  Warnings,\n  Info\n}\n\nexport interface ActivationOptions {\n  logLevel?: LogLevel;\n}\n\n/**\n * The Coordinator class manages a set of sources to which it applies a set of\n * coordination strategies.\n */\nexport class Coordinator {\n  protected _sources: Dict<Source>;\n  protected _strategies: Dict<Strategy>;\n  protected _activated?: Promise<void>;\n  protected _defaultActivationOptions: ActivationOptions;\n  protected _currentActivationOptions?: ActivationOptions;\n\n  constructor(options: CoordinatorOptions = {}) {\n    this._sources = {};\n    this._strategies = {};\n\n    if (options.sources) {\n      options.sources.forEach((source) => this.addSource(source));\n    }\n\n    if (options.strategies) {\n      options.strategies.forEach((strategy) => this.addStrategy(strategy));\n    }\n\n    this._defaultActivationOptions = options.defaultActivationOptions || {};\n\n    if (this._defaultActivationOptions.logLevel === undefined) {\n      this._defaultActivationOptions.logLevel = LogLevel.Info;\n    }\n  }\n\n  addSource(source: Source): void {\n    const name = source.name;\n    if (name) {\n      assert(\n        `A source named '${name}' has already been added to this coordinator.`,\n        !this._sources[name]\n      );\n      assert(\n        `A coordinator's sources can not be changed while it is active.`,\n        !this._activated\n      );\n      this._sources[name] = source;\n    } else {\n      assert(`Sources require a 'name' to be added to a coordinator.`, !!name);\n    }\n  }\n\n  removeSource(name: string): void {\n    let source = this._sources[name];\n\n    assert(\n      `Source '${name}' has not been added to this coordinator.`,\n      !!source\n    );\n    assert(\n      `A coordinator's sources can not be changed while it is active.`,\n      !this._activated\n    );\n\n    delete this._sources[name];\n  }\n\n  getSource<T extends Source = Source>(name: string): T {\n    return this._sources[name] as T;\n  }\n\n  get sources(): Source[] {\n    return objectValues(this._sources);\n  }\n\n  get sourceNames(): string[] {\n    return Object.keys(this._sources);\n  }\n\n  addStrategy(strategy: Strategy): void {\n    const name = strategy.name;\n\n    assert(\n      `A strategy named '${name}' has already been added to this coordinator.`,\n      !this._strategies[name]\n    );\n    assert(\n      `A coordinator's strategies can not be changed while it is active.`,\n      !this._activated\n    );\n\n    this._strategies[name] = strategy;\n  }\n\n  removeStrategy(name: string): void {\n    let strategy = this._strategies[name];\n\n    assert(\n      `Strategy '${name}' has not been added to this coordinator.`,\n      !!strategy\n    );\n    assert(\n      `A coordinator's strategies can not be changed while it is active.`,\n      !this._activated\n    );\n\n    delete this._strategies[name];\n  }\n\n  getStrategy<T extends Strategy = Strategy>(name: string): T {\n    return this._strategies[name] as T;\n  }\n\n  get strategies(): Strategy[] {\n    return objectValues(this._strategies);\n  }\n\n  get strategyNames(): string[] {\n    return Object.keys(this._strategies);\n  }\n\n  get activated(): Promise<void> | undefined {\n    return this._activated;\n  }\n\n  async activate(options: ActivationOptions = {}): Promise<void> {\n    if (!this._activated) {\n      this._activated = this._activate(options);\n    }\n    await this._activated;\n  }\n\n  async deactivate(): Promise<void> {\n    if (this._activated) {\n      await this._activated;\n      await this._deactivate();\n    }\n\n    this._activated = undefined;\n  }\n\n  protected async _activate(options: ActivationOptions = {}): Promise<void> {\n    if (options.logLevel === undefined) {\n      options.logLevel = this._defaultActivationOptions.logLevel;\n    }\n\n    this._currentActivationOptions = options;\n\n    for (let strategy of this.strategies) {\n      await strategy.activate(this, options);\n    }\n\n    for (let strategy of this.strategies) {\n      await strategy.beforeSourceActivation();\n    }\n\n    for (let source of this.sources) {\n      await source.activate();\n    }\n\n    for (let strategy of this.strategies) {\n      await strategy.afterSourceActivation();\n    }\n  }\n\n  protected async _deactivate(): Promise<void> {\n    const strategies = this.strategies.reverse();\n    const sources = this.sources.reverse();\n\n    for (let strategy of strategies) {\n      await strategy.beforeSourceDeactivation();\n    }\n\n    for (let source of sources) {\n      await source.deactivate();\n    }\n\n    for (let strategy of strategies) {\n      await strategy.afterSourceDeactivation();\n    }\n\n    for (let strategy of strategies) {\n      await strategy.deactivate();\n    }\n  }\n}\n","import { Orbit, Assertion } from '@orbit/core';\nimport { Source } from '@orbit/data';\nimport { Coordinator, ActivationOptions, LogLevel } from './coordinator';\n\nconst { assert } = Orbit;\n\nexport interface StrategyOptions {\n  /**\n   * Name of strategy.\n   *\n   * Used to uniquely identify this strategy in a coordinator's collection.\n   */\n  name?: string;\n\n  /**\n   * The names of sources to include in this strategy. Leave undefined\n   * to include all sources registered with a coordinator.\n   */\n  sources?: string[];\n\n  /**\n   * The prefix to use for logging from this strategy.\n   *\n   * Defaults to `[${name}]`.\n   */\n  logPrefix?: string;\n\n  /**\n   * A specific log level for this strategy.\n   *\n   * Overrides the log level used when activating the coordinator.\n   */\n  logLevel?: LogLevel;\n}\n\nexport abstract class Strategy {\n  protected _name!: string;\n  protected _coordinator?: Coordinator;\n  protected _sourceNames?: string[];\n  protected _sources: Source[] = [];\n  protected _customLogLevel?: LogLevel;\n  protected _logLevel?: LogLevel;\n  protected _logPrefix: string;\n\n  constructor(options: StrategyOptions = {}) {\n    if (options.name) {\n      this._name = options.name;\n    } else {\n      assert('Strategy requires a name', false);\n    }\n\n    this._sourceNames = options.sources;\n    this._logPrefix = options.logPrefix || `[${this._name}]`;\n    this._logLevel = this._customLogLevel = options.logLevel;\n  }\n\n  async activate(\n    coordinator: Coordinator,\n    options: ActivationOptions = {}\n  ): Promise<void> {\n    this._coordinator = coordinator;\n\n    if (this._customLogLevel === undefined) {\n      this._logLevel = options.logLevel;\n    }\n\n    if (this._sourceNames) {\n      this._sources = this._sourceNames.map((name) =>\n        coordinator.getSource(name)\n      );\n    } else {\n      this._sources = coordinator.sources;\n    }\n  }\n\n  async deactivate(): Promise<void> {\n    this._coordinator = undefined;\n  }\n\n  async beforeSourceActivation(): Promise<void> {}\n  async afterSourceActivation(): Promise<void> {}\n\n  async beforeSourceDeactivation(): Promise<void> {}\n  async afterSourceDeactivation(): Promise<void> {}\n\n  get name(): string {\n    return this._name;\n  }\n\n  get coordinator(): Coordinator | undefined {\n    return this._coordinator;\n  }\n\n  get sources(): Source[] {\n    return this._sources;\n  }\n\n  get logPrefix(): string {\n    return this._logPrefix;\n  }\n\n  get logLevel(): LogLevel | undefined {\n    return this._logLevel;\n  }\n\n  protected getSourceName(source: Source): string {\n    if (source.name) {\n      return source.name;\n    } else {\n      throw new Assertion(\n        `Sources require a 'name' to be used by a coordination strategy.`\n      );\n    }\n  }\n}\n","import { Coordinator, ActivationOptions } from '../coordinator';\nimport { Strategy, StrategyOptions } from '../strategy';\nimport { Operation, Source, Transform } from '@orbit/data';\nimport { Dict } from '@orbit/utils';\n\nexport class LogTruncationStrategy extends Strategy {\n  protected _transformListeners: Dict<\n    (transform: Transform<Operation>) => void\n  > = {};\n\n  constructor(options: StrategyOptions = {}) {\n    super({\n      ...options,\n      name: options.name || 'log-truncation'\n    });\n  }\n\n  async activate(\n    coordinator: Coordinator,\n    options: ActivationOptions = {}\n  ): Promise<void> {\n    await super.activate(coordinator, options);\n    this._transformListeners = {};\n    for (let source of this._sources) {\n      this._connectSource(source);\n    }\n  }\n\n  async deactivate(): Promise<void> {\n    await super.deactivate();\n    for (let source of this._sources) {\n      this._disconnectSource(source);\n    }\n    this._transformListeners = {};\n  }\n\n  async _review(source: Source): Promise<void> {\n    let sources = this._sources;\n    let transformId = source.transformLog.head;\n\n    if (transformId && sources.length > 1) {\n      let match = true;\n\n      for (let i = 0; i < sources.length; i++) {\n        let s = sources[i];\n        if (s !== source) {\n          if (\n            !s.requestQueue.empty ||\n            !s.syncQueue.empty ||\n            !s.transformLog.contains(transformId)\n          ) {\n            match = false;\n            break;\n          }\n        }\n      }\n      if (match) {\n        return this._truncateSources(transformId, 0);\n      }\n    }\n  }\n\n  _truncateSources(\n    transformId: string,\n    relativePosition: number\n  ): Promise<void> {\n    return this._sources.reduce((chain, source) => {\n      return chain.then(() =>\n        source.transformLog.truncate(transformId, relativePosition)\n      );\n    }, Promise.resolve());\n  }\n\n  _connectSource(source: Source): void {\n    const listener = async (): Promise<void> => {\n      if (source.requestQueue.empty && source.syncQueue.empty) {\n        return this._review(source);\n      }\n    };\n    const sourceName = this.getSourceName(source);\n    this._transformListeners[sourceName] = listener;\n    source.syncQueue.on('complete', listener);\n    source.requestQueue.on('complete', listener);\n  }\n\n  _disconnectSource(source: Source): void {\n    const sourceName = this.getSourceName(source);\n    const listener = this._transformListeners[sourceName];\n    source.syncQueue.off('complete', listener);\n    source.requestQueue.off('complete', listener);\n    delete this._transformListeners[sourceName];\n  }\n}\n","import { Coordinator, ActivationOptions, LogLevel } from '../coordinator';\nimport { Strategy, StrategyOptions } from '../strategy';\nimport { Listener } from '@orbit/core';\nimport {\n  Source,\n  isPullable,\n  isPushable,\n  isQueryable,\n  isSyncable,\n  isUpdatable\n} from '@orbit/data';\nimport { Dict, deepGet, deepSet } from '@orbit/utils';\n\ndeclare const console: any;\n\nexport interface EventLoggingStrategyOptions extends StrategyOptions {\n  events?: string[];\n  interfaces?: string[];\n}\n\nexport class EventLoggingStrategy extends Strategy {\n  protected _events?: string[];\n  protected _interfaces?: string[];\n  protected _eventListeners?: Dict<Dict<Listener>>;\n\n  constructor(options: EventLoggingStrategyOptions = {}) {\n    super({\n      ...options,\n      name: options.name || 'event-logging'\n    });\n\n    this._events = options.events;\n    this._interfaces = options.interfaces;\n    this._logPrefix = options.logPrefix || '[source-event]';\n  }\n\n  async activate(\n    coordinator: Coordinator,\n    options: ActivationOptions = {}\n  ): Promise<void> {\n    await super.activate(coordinator, options);\n    this._eventListeners = {};\n    this._sources.forEach((source) => this._activateSource(source));\n  }\n\n  async deactivate(): Promise<void> {\n    await super.deactivate();\n    this._sources.forEach((source) => this._deactivateSource(source));\n    this._eventListeners = undefined;\n  }\n\n  protected _activateSource(source: Source): void {\n    this._sourceEvents(source).forEach((event) => {\n      this._addListener(source, event);\n    });\n  }\n\n  protected _deactivateSource(source: Source): void {\n    this._sourceEvents(source).forEach((event) => {\n      this._removeListener(source, event);\n    });\n  }\n\n  protected _sourceEvents(source: Source): string[] {\n    if (this._events) {\n      return this._events;\n    } else {\n      let events: string[] = [];\n      let interfaces = this._interfaces || this._sourceInterfaces(source);\n\n      interfaces.forEach((i) => {\n        Array.prototype.push.apply(events, this._interfaceEvents(i));\n      });\n\n      return events;\n    }\n  }\n\n  protected _sourceInterfaces(source: Source): string[] {\n    let interfaces = ['transformable'];\n    if (isPullable(source)) {\n      interfaces.push('pullable');\n    }\n    if (isPushable(source)) {\n      interfaces.push('pushable');\n    }\n    if (isQueryable(source)) {\n      interfaces.push('queryable');\n    }\n    if (isSyncable(source)) {\n      interfaces.push('syncable');\n    }\n    if (isUpdatable(source)) {\n      interfaces.push('updatable');\n    }\n    return interfaces;\n  }\n\n  protected _interfaceEvents(interfaceName: string): string[] {\n    if (this._logLevel === LogLevel.Info) {\n      switch (interfaceName) {\n        case 'pullable':\n          return ['beforePull', 'pull', 'pullFail'];\n        case 'pushable':\n          return ['beforePush', 'push', 'pushFail'];\n        case 'queryable':\n          return ['beforeQuery', 'query', 'queryFail'];\n        case 'updatable':\n          return ['beforeUpdate', 'update', 'updateFail'];\n        case 'syncable':\n          return ['beforeSync', 'sync', 'syncFail'];\n        case 'transformable':\n          return ['transform'];\n      }\n    } else if (this._logLevel !== undefined && this._logLevel > LogLevel.None) {\n      switch (interfaceName) {\n        case 'pullable':\n          return ['pullFail'];\n        case 'pushable':\n          return ['pushFail'];\n        case 'queryable':\n          return ['queryFail'];\n        case 'syncable':\n          return ['syncFail'];\n        case 'updatable':\n          return ['updateFail'];\n      }\n    }\n    return [];\n  }\n\n  protected _addListener(source: Source, event: string): void {\n    const listener = this._generateListener(source, event);\n    const sourceName = this.getSourceName(source);\n    deepSet(this._eventListeners, [sourceName, event], listener);\n    source.on(event, listener);\n  }\n\n  protected _removeListener(source: Source, event: string): void {\n    const sourceName = this.getSourceName(source);\n    const listener = deepGet(this._eventListeners, [\n      sourceName,\n      event\n    ]) as Listener;\n    source.off(event, listener);\n    deepSet(this._eventListeners, [sourceName, event], undefined);\n  }\n\n  protected _generateListener(source: Source, event: string): Listener {\n    const sourceName = this.getSourceName(source);\n    return (...args: any[]) => {\n      console.log(this._logPrefix, sourceName, event, ...args);\n    };\n  }\n}\n","import { Coordinator, ActivationOptions } from '../coordinator';\nimport { Strategy, StrategyOptions } from '../strategy';\nimport { Orbit, Listener } from '@orbit/core';\nimport { Source } from '@orbit/data';\n\nconst { assert } = Orbit;\n\nexport interface ConnectionStrategyOptions extends StrategyOptions {\n  /**\n   * The name of the source to be observed.\n   */\n  source: string;\n\n  /**\n   * The name of the event to observe.\n   */\n  on: string;\n\n  /**\n   * The name of the source which will be acted upon.\n   */\n  target?: string;\n\n  /**\n   * The action to perform on the target.\n   *\n   * Can be specified as a string (e.g. `pull`) or a function which will be\n   * invoked in the context of this strategy (and thus will have access to\n   * both `this.source` and `this.target`).\n   */\n  action: string | ((...args: unknown[]) => unknown);\n\n  /**\n   * A handler for any errors thrown as a result of performing the action.\n   */\n  catch?: (error: Error, ...args: unknown[]) => void;\n\n  /**\n   * A filter function that returns `true` if the `action` should be performed.\n   *\n   * `filter` will be invoked in the context of this strategy (and thus will\n   * have access to both `this.source` and `this.target`).\n   */\n  filter?: (...args: unknown[]) => boolean;\n\n  /**\n   * Should resolution of `action` on the the target block the completion\n   * of the source's event?\n   *\n   * By default, `blocking` is false.\n   */\n  blocking?: boolean | ((...args: unknown[]) => boolean);\n}\n\ndeclare type CatchFn = (error: Error, ...args: unknown[]) => void;\ndeclare type FilterFn = (...args: unknown[]) => boolean;\n\nexport class ConnectionStrategy extends Strategy {\n  protected _blocking: boolean | ((...args: unknown[]) => boolean);\n  protected _event: string;\n  protected _action: string | ((...args: unknown[]) => unknown);\n  protected _catch?: CatchFn;\n  protected _listener?: Listener;\n  protected _filter?: FilterFn;\n\n  constructor(options: ConnectionStrategyOptions) {\n    assert(\n      'A `source` must be specified for a ConnectionStrategy',\n      !!options.source\n    );\n    assert(\n      '`source` should be a Source name specified as a string',\n      typeof options.source === 'string'\n    );\n    assert(\n      '`on` should be specified as the name of the event a ConnectionStrategy listens for',\n      typeof options.on === 'string'\n    );\n    options.sources = [options.source];\n    let defaultName = `${options.source}:${options.on}`;\n    delete (options as any).source;\n    if (options.target) {\n      assert(\n        '`target` should be a Source name specified as a string',\n        typeof options.target === 'string'\n      );\n      options.sources.push(options.target);\n      defaultName += ` -> ${options.target}`;\n      if (typeof options.action === 'string') {\n        defaultName += `:${options.action}`;\n      }\n      delete options.target;\n    }\n    options.name = options.name || defaultName;\n    super(options);\n\n    this._event = options.on;\n    this._action = options.action;\n    this._catch = options.catch;\n    this._filter = options.filter;\n    this._blocking =\n      typeof options.blocking === 'function'\n        ? options.blocking\n        : !!options.blocking;\n  }\n\n  get source(): Source {\n    return this._sources[0];\n  }\n\n  get target(): Source {\n    return this._sources[1];\n  }\n\n  get blocking(): boolean | ((...args: any[]) => boolean) {\n    return this._blocking;\n  }\n\n  async activate(\n    coordinator: Coordinator,\n    options: ActivationOptions = {}\n  ): Promise<void> {\n    await super.activate(coordinator, options);\n    this._listener = this.generateListener();\n    this.source.on(this._event, this._listener);\n  }\n\n  async deactivate(): Promise<void> {\n    await super.deactivate();\n    this.source.off(this._event, this._listener);\n    this._listener = undefined;\n  }\n\n  protected generateListener(): Listener {\n    return (...args: any[]) => this.defaultListener(...args);\n  }\n\n  protected async defaultListener(...args: any[]): Promise<any> {\n    if (this._filter) {\n      if (!this._filter.apply(this, args)) {\n        return;\n      }\n    }\n\n    let result = this.invokeAction(...args) as any;\n\n    if (this._catch && result && result.catch) {\n      result = result.catch((e: Error) => {\n        return (this._catch as CatchFn).apply(this, [e, ...args]);\n      });\n    }\n\n    if (result) {\n      let blocking = false;\n      if (typeof this._blocking === 'function') {\n        if (this._blocking(...args)) {\n          blocking = true;\n        }\n      } else if (this._blocking) {\n        blocking = true;\n      }\n\n      if (blocking) {\n        return this.handleBlockingResponse(result, ...args);\n      }\n    }\n  }\n\n  protected invokeAction(...args: any[]): unknown {\n    const target = this.target as any;\n\n    if (typeof this._action === 'string') {\n      return target[this._action](...args);\n    } else {\n      return this._action.apply(this, args);\n    }\n  }\n\n  protected async handleBlockingResponse(\n    result: Promise<any>,\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    ...args: any[]\n  ): Promise<any> {\n    await result;\n  }\n}\n","import {\n  ConnectionStrategy,\n  ConnectionStrategyOptions\n} from './connection-strategy';\nimport {\n  FullResponse,\n  NamedFullResponse,\n  Operation,\n  Query,\n  QueryExpression,\n  ResponseHints,\n  Transform\n} from '@orbit/data';\n\nexport interface RequestStrategyOptions extends ConnectionStrategyOptions {\n  /**\n   * Should results returned from calling `action` on the `target` source be\n   * passed as hint data back to the `source`?\n   *\n   * This can allow hints to inform the processing of subsequent actions on the\n   * source. For instance, a `beforeQuery` event might invoke `query` on a\n   * target, and those results could inform how the originating source performs\n   * `_query`. This might allow a target source's sorting and filtering of\n   * results to affect how the originating source processes the query.\n   *\n   * This setting is only effective for `blocking` strategies, since only in\n   * those scenarios is processing delayed.\n   */\n  passHints?: boolean;\n}\n\nexport class RequestStrategy extends ConnectionStrategy {\n  public passHints: boolean;\n\n  constructor(options: RequestStrategyOptions) {\n    super(options);\n\n    this.passHints = !!options.passHints;\n  }\n\n  protected invokeAction(\n    request: Query<QueryExpression> | Transform<Operation>\n  ): Promise<NamedFullResponse<unknown, unknown, Operation>> {\n    if (typeof this._action === 'string') {\n      return (this.target as any)[this._action](request, {\n        fullResponse: true\n      });\n    } else {\n      return super.invokeAction(...arguments) as Promise<\n        NamedFullResponse<unknown, unknown, Operation>\n      >;\n    }\n  }\n\n  protected async handleBlockingResponse(\n    result: Promise<FullResponse<unknown, unknown, Operation>>,\n    request: Query<QueryExpression> | Transform<Operation>,\n    hints?: ResponseHints<unknown, unknown>\n  ): Promise<NamedFullResponse<unknown, unknown, Operation>> {\n    const fullResponse = await result;\n    if (this.passHints && hints) {\n      this.assignHints(hints, fullResponse);\n    }\n    return [this.target.name as string, fullResponse];\n  }\n\n  protected assignHints(\n    hints: ResponseHints<unknown, unknown>,\n    fullResponse: FullResponse<unknown, unknown, Operation>\n  ): void {\n    if (fullResponse.data !== undefined) {\n      hints.data = fullResponse.data;\n    }\n    if (fullResponse.details !== undefined) {\n      hints.details = fullResponse.details;\n    }\n  }\n}\n","import { Orbit } from '@orbit/core';\nimport { StrategyOptions } from '../strategy';\nimport {\n  ConnectionStrategy,\n  ConnectionStrategyOptions\n} from './connection-strategy';\n\nconst { assert } = Orbit;\n\nexport interface SyncStrategyOptions extends StrategyOptions {\n  /**\n   * The name of the source to be observed.\n   */\n  source: string;\n\n  /**\n   * The name of the source which will be acted upon.\n   */\n  target: string;\n\n  /**\n   * A handler for any errors thrown as a result of the sync operation.\n   */\n  catch?: (error: Error, ...args: any[]) => void;\n\n  /**\n   * A filter function that returns `true` if the sync should be performed.\n   *\n   * `filter` will be invoked in the context of this strategy (and thus will\n   * have access to both `this.source` and `this.target`).\n   */\n  filter?: (...args: any[]) => boolean;\n\n  /**\n   * Should resolution of the target's `sync` block the completion of the\n   * source's `transform`?\n   *\n   * By default, `blocking` is false.\n   */\n  blocking?: boolean | ((...args: any[]) => boolean);\n}\n\nexport class SyncStrategy extends ConnectionStrategy {\n  constructor(options: SyncStrategyOptions) {\n    let opts = options as ConnectionStrategyOptions;\n    assert('A `source` must be specified for a SyncStrategy', !!opts.source);\n    assert('A `target` must be specified for a SyncStrategy', !!opts.target);\n    assert(\n      '`source` should be a Source name specified as a string',\n      typeof opts.source === 'string'\n    );\n    assert(\n      '`target` should be a Source name specified as a string',\n      typeof opts.target === 'string'\n    );\n    opts.on = opts.on || 'transform';\n    opts.action = opts.action || 'sync';\n    super(opts);\n  }\n}\n","import { Orbit } from './main';\ndeclare const console: any;\n\n/**\n * Display a deprecation warning with the provided message if the\n * provided `test` evaluates to a falsy value (or is missing).\n */\nexport function deprecate(\n  message: string,\n  test?: boolean | (() => boolean)\n): void {\n  if (!Orbit.debug) return;\n\n  if (typeof test === 'function') {\n    if (test()) return;\n  } else {\n    if (test) return;\n  }\n  console.warn(message);\n}\n","import { deprecate } from './deprecate';\n\n/**\n * Base exception class.\n */\nexport class Exception extends Error {\n  /**\n   * A synonym for message.\n   *\n   * @deprecated since v0.17, access `message` instead\n   */\n  public get description(): string {\n    deprecate(\n      \"'Exception#description' has been deprecated. Please access 'message' instead.\"\n    );\n    return this.message;\n  }\n}\n\n/**\n * Exception raised when an item does not exist in a log.\n */\nexport class NotLoggedException extends Exception {\n  public id: string;\n\n  constructor(id: string) {\n    super(`Action not logged: ${id}`);\n    this.id = id;\n  }\n}\n\n/**\n * Exception raised when a value is outside an allowed range.\n */\nexport class OutOfRangeException extends Exception {\n  public value: number;\n\n  constructor(value: number) {\n    super(`Out of range: ${value}`);\n    this.value = value;\n  }\n}\n\nexport class Assertion extends Exception {\n  constructor(message: string) {\n    super(`Assertion failed: ${message}`);\n  }\n}\n","import { assert } from './assert';\nimport { deprecate } from './deprecate';\nimport { uuid as customRandomUUID } from '@orbit/utils';\n\ndeclare const self: any;\ndeclare const global: any;\n\nexport interface OrbitGlobal {\n  globals: any;\n  assert: (description: string, test: boolean) => void | never;\n  deprecate: (message: string, test?: boolean | (() => boolean)) => void;\n  uuid: () => string;\n  debug: boolean;\n}\n\n// Establish the root object, `window` (`self`) in the browser, `global`\n// on the server, or `this` in some virtual machines. We use `self`\n// instead of `window` for `WebWorker` support.\n//\n// Source: https://github.com/jashkenas/underscore/blob/master/underscore.js#L11-L17\n//     Underscore.js 1.8.3\n//     http://underscorejs.org\n//     (c) 2009-2017 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n//     Underscore may be freely distributed under the MIT license.\nconst globals =\n  (typeof self == 'object' && self.self === self && self) ||\n  (typeof global == 'object' && global) ||\n  {};\n\nconst uuid =\n  globals.crypto?.randomUUID !== undefined\n    ? () => globals.crypto.randomUUID()\n    : customRandomUUID;\n\nexport const Orbit: OrbitGlobal = {\n  globals,\n  assert,\n  debug: true,\n  deprecate,\n  uuid\n};\n","import { Assertion } from './exception';\n\n/**\n * Throw an exception if `test` is not truthy.\n */\nexport function assert(description: string, test: boolean): void | never {\n  if (!test) {\n    throw new Assertion(description);\n  }\n}\n","import { Task, Performer } from './task';\n\n/**\n * A `TaskProcessor` performs a `Task` by calling `perform()` on its target.\n * This is triggered by calling `process()` on the processor.\n *\n * A processor maintains a promise that represents the eventual state (resolved\n * or rejected) of the task. This promise is created upon construction, and\n * will be returned by calling `settle()`.\n *\n * A task can be re-tried by first calling `reset()` on the processor. This\n * will clear the processor's state and allow `process()` to be invoked again.\n */\nexport class TaskProcessor<\n  Type = string,\n  Data = unknown,\n  Options = unknown,\n  Result = unknown\n> {\n  target: Performer<Type, Data, Options, Result>;\n  task: Task<Type, Data, Options>;\n\n  private _started!: boolean;\n  private _settled!: boolean;\n  private _settlement!: Promise<Result>;\n  private _success?: (resolution: Result) => void;\n  private _fail?: (e: Error) => void;\n\n  /**\n   * Creates an instance of TaskProcessor.\n   */\n  constructor(\n    target: Performer<Type, Data, Options, Result>,\n    task: Task<Type, Data, Options>\n  ) {\n    this.target = target;\n    this.task = task;\n\n    this.reset();\n  }\n\n  /**\n   * Clears the processor state, allowing for a fresh call to `process()`.\n   */\n  reset(): void {\n    this._started = false;\n    this._settled = false;\n    this._settlement = new Promise((resolve, reject) => {\n      this._success = (r) => {\n        this._settled = true;\n        resolve(r);\n      };\n\n      this._fail = (e) => {\n        this._settled = true;\n        reject(e);\n      };\n    });\n  }\n\n  /**\n   * Has `process` been invoked?\n   */\n  get started(): boolean {\n    return this._started;\n  }\n\n  /**\n   * Has promise settled, either via `process` or `reject`?\n   */\n  get settled(): boolean {\n    return this._settled;\n  }\n\n  /**\n   * The eventual result of processing.\n   */\n  settle(): Promise<Result> {\n    return this._settlement;\n  }\n\n  /**\n   * Invokes `perform` on the target.\n   */\n  process(): Promise<Result> {\n    if (!this._started) {\n      this._started = true;\n\n      this.target.perform(this.task).then(this._success, this._fail);\n    }\n\n    return this.settle();\n  }\n\n  /**\n   * Reject the current promise with a specific error.\n   */\n  reject(e: Error): void {\n    if (this._settled) {\n      throw new Error(\n        'TaskProcessor#reject can not be invoked when processing has already settled.'\n      );\n    } else if (this._fail) {\n      this._fail(e);\n    }\n  }\n}\n","export type Listener = (...args: any[]) => any;\n\n/**\n *  The `Notifier` class can emit messages to an array of subscribed listeners.\n * Here's a simple example:\n *\n * ```ts\n * import { Notifier } from '@orbit/core';\n *\n * let notifier = new Notifier();\n * notifier.addListener((message: string) => {\n *   console.log(\"I heard \" + message);\n * });\n * notifier.addListener((message: string) => {\n *   console.log(\"I also heard \" + message);\n * });\n *\n * notifier.emit('hello'); // logs \"I heard hello\" and \"I also heard hello\"\n * ```\n *\n * Calls to `emit` will send along all of their arguments.\n */\nexport class Notifier {\n  public listeners: Listener[];\n\n  constructor() {\n    this.listeners = [];\n  }\n\n  /**\n   * Add a callback as a listener, which will be triggered when sending\n   * notifications.\n   */\n  addListener(listener: Listener): () => void {\n    this.listeners.push(listener);\n\n    return () => this.removeListener(listener);\n  }\n\n  /**\n   * Remove a listener so that it will no longer receive notifications.\n   */\n  removeListener(listener: Listener): void {\n    const listeners = this.listeners;\n\n    for (let i = 0, len = listeners.length; i < len; i++) {\n      if (listeners[i] === listener) {\n        listeners.splice(i, 1);\n        return;\n      }\n    }\n  }\n\n  /**\n   * Notify registered listeners.\n   */\n  emit(...args: unknown[]): void {\n    this.listeners.slice(0).forEach((listener) => listener(...args));\n  }\n}\n","import { Notifier, Listener } from './notifier';\n\nconst EVENTED = '__evented__';\n\n/**\n * Has a class been decorated as `@evented`?\n */\nexport function isEvented(obj: unknown): boolean {\n  return !!(obj as { [EVENTED]?: boolean })[EVENTED];\n}\n\n/**\n * A class decorated as `@evented` should also implement the `Evented`\n * interface.\n *\n * ```ts\n * import { evented, Evented } from '@orbit/core';\n *\n * @evented\n * class Source implements Evented {\n *   // ... Evented implementation\n * }\n * ```\n */\nexport interface Evented<Event extends string = string> {\n  on: (event: Event, listener: Listener) => () => void;\n  off: (event: Event, listener?: Listener) => void;\n  one: (event: Event, listener: Listener) => () => void;\n  emit: (event: Event, ...args: unknown[]) => void;\n  listeners: (event: Event) => Listener[];\n}\n\n/**\n * Marks a class as evented.\n *\n * An evented class should also implement the `Evented` interface.\n *\n * ```ts\n * import { evented, Evented } from '@orbit/core';\n *\n * @evented\n * class Source implements Evented {\n *   ...\n * }\n * ```\n *\n * Listeners can then register themselves for particular events with `on`:\n *\n * ```ts\n * let source = new Source();\n *\n * function listener1(message: string) {\n *   console.log('listener1 heard ' + message);\n * };\n * function listener2(message: string) {\n *   console.log('listener2 heard ' + message);\n * };\n *\n * source.on('greeting', listener1);\n * source.on('greeting', listener2);\n *\n * evented.emit('greeting', 'hello'); // logs \"listener1 heard hello\" and\n *                                    //      \"listener2 heard hello\"\n * ```\n *\n * Listeners can be unregistered from events at any time with `off`:\n *\n * ```ts\n * source.off('greeting', listener2);\n * ```\n */\nexport function evented(Klass: { prototype: any }): void {\n  let proto = Klass.prototype;\n\n  if (isEvented(proto)) {\n    return;\n  }\n\n  proto[EVENTED] = true;\n\n  proto.on = function (eventName: string, listener: Listener): () => void {\n    return notifierForEvent(this, eventName, true).addListener(listener);\n  };\n\n  proto.off = function (eventName: string, listener: Listener) {\n    const notifier = notifierForEvent(this, eventName);\n\n    if (notifier) {\n      if (listener) {\n        notifier.removeListener(listener);\n      } else {\n        removeNotifierForEvent(this, eventName);\n      }\n    }\n  };\n\n  proto.one = function (eventName: string, listener: Listener): () => void {\n    const notifier = notifierForEvent(this, eventName, true);\n\n    const callOnce = function () {\n      listener(...arguments);\n      notifier.removeListener(callOnce);\n    };\n\n    return notifier.addListener(callOnce);\n  };\n\n  proto.emit = function (eventName: string, ...args: unknown[]) {\n    let notifier = notifierForEvent(this, eventName);\n\n    if (notifier) {\n      notifier.emit.apply(notifier, args);\n    }\n  };\n\n  proto.listeners = function (eventName: string) {\n    let notifier = notifierForEvent(this, eventName);\n    return notifier ? notifier.listeners : [];\n  };\n}\n\n/**\n * Settle any promises returned by event listeners in series.\n *\n * Returns an array of results (or `undefined`) returned by listeners.\n *\n * If any errors are encountered during processing, they will be caught and\n * returned with other results. Errors will not interrupt further processing.\n */\nexport async function settleInSeries(\n  obj: Evented,\n  eventName: string,\n  ...args: unknown[]\n): Promise<unknown[]> {\n  const listeners = obj.listeners(eventName);\n  const results: unknown[] = [];\n\n  for (let listener of listeners) {\n    try {\n      results.push(await listener(...args));\n    } catch (e) {\n      results.push(e);\n    }\n  }\n  return results;\n}\n\n/**\n * Fulfills any promises returned by event listeners in series.\n *\n * Returns an array of results (or `undefined`) returned by listeners.\n *\n * On error, processing will stop and the returned promise will be rejected with\n * the error that was encountered.\n */\nexport async function fulfillInSeries(\n  obj: Evented,\n  eventName: string,\n  ...args: unknown[]\n): Promise<unknown[]> {\n  const listeners = obj.listeners(eventName);\n  const results: unknown[] = [];\n\n  for (let listener of listeners) {\n    results.push(await listener(...args));\n  }\n\n  return results;\n}\n\n/**\n * Fulfills any promises returned by event listeners in parallel, using\n * `Promise.all`.\n *\n * Returns an array of results (or `undefined`) returned by listeners.\n *\n * On error, processing will stop and the returned promise will be rejected with\n * the error that was encountered.\n */\nexport async function fulfillAll(\n  obj: Evented,\n  eventName: string,\n  ...args: unknown[]\n): Promise<unknown[]> {\n  const listeners = obj.listeners(eventName);\n  const promises: Promise<unknown>[] = [];\n\n  for (let listener of listeners) {\n    promises.push(listener(...args));\n  }\n\n  return Promise.all(promises);\n}\n\nfunction notifierForEvent(\n  object: any,\n  eventName: string,\n  createIfUndefined = false\n) {\n  if (object._eventedNotifiers === undefined) {\n    object._eventedNotifiers = {};\n  }\n  let notifier = object._eventedNotifiers[eventName];\n  if (!notifier && createIfUndefined) {\n    notifier = object._eventedNotifiers[eventName] = new Notifier();\n  }\n  return notifier;\n}\n\nfunction removeNotifierForEvent(object: any, eventName: string) {\n  if (object._eventedNotifiers && object._eventedNotifiers[eventName]) {\n    delete object._eventedNotifiers[eventName];\n  }\n}\n","import { Orbit } from './main';\nimport { Task, Performer } from './task';\nimport { TaskProcessor } from './task-processor';\nimport { Bucket } from './bucket';\nimport { evented, Evented, settleInSeries } from './evented';\n\nconst { assert } = Orbit;\n\n/**\n * Settings for a `TaskQueue`.\n */\nexport interface TaskQueueSettings<\n  Type = string,\n  Data = unknown,\n  Options = unknown\n> {\n  /**\n   * Name used for tracking and debugging a task queue.\n   */\n  name?: string;\n\n  /**\n   * A bucket in which to persist queue state.\n   */\n  bucket?: Bucket<Task<Type, Data, Options>[]>;\n\n  /**\n   * A flag indicating whether tasks should be processed as soon as they are\n   * pushed into a queue. Set to `false` to override the default `true`\n   * behavior.\n   */\n  autoProcess?: boolean;\n\n  /**\n   * A flag indicating whether activation should happen as part of\n   * instantiation. Set to `false` to override the default `true` behavior. When\n   * `autoActivate === false`, no tasks reified from the queue's bucket will be\n   * automatically processed as part of queue instantiation, regardless of the\n   * `autoProcess` setting. Invoke `queue.activate()` as a separate step to\n   * finish activation and start processing tasks.\n   */\n  autoActivate?: boolean;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface TaskQueue extends Evented {}\n\n/**\n * `TaskQueue` is a FIFO queue of asynchronous tasks that should be\n * performed sequentially.\n *\n * Tasks are added to the queue with `push`. Each task will be processed by\n * calling its `process` method.\n *\n * By default, task queues will be processed automatically, as soon as tasks\n * are pushed to them. This can be overridden by setting the `autoProcess`\n * setting to `false` and calling `process` when you'd like to start\n * processing.\n */\n@evented\nexport class TaskQueue<\n  Type = string,\n  Data = unknown,\n  Options = unknown,\n  Result = unknown\n> {\n  public autoProcess: boolean;\n\n  private _performer: Performer<Type, Data, Options, Result>;\n  private _name?: string;\n  private _bucket?: Bucket<Task<Type, Data, Options>[]>;\n  private _tasks: Task<Type, Data, Options>[] = [];\n  private _processors: TaskProcessor<Type, Data, Options, Result>[] = [];\n  private _error?: Error;\n  private _resolution?: Promise<void>;\n  private _resolve?: () => void;\n  private _reject?: (e: Error) => void;\n  private _reified!: Promise<void>;\n\n  /**\n   * Creates an instance of `TaskQueue`.\n   */\n  constructor(\n    target: Performer<Type, Data, Options, Result>,\n    settings: TaskQueueSettings<Type, Data, Options> = {}\n  ) {\n    this._performer = target;\n    this._name = settings.name;\n    this._bucket = settings.bucket;\n    this.autoProcess =\n      settings.autoProcess === undefined ? true : settings.autoProcess;\n\n    if (this._bucket) {\n      assert('TaskQueue requires a name if it has a bucket', !!this._name);\n    }\n\n    const autoActivate =\n      settings.autoActivate === undefined || settings.autoActivate;\n\n    if (autoActivate) {\n      this.activate();\n    } else {\n      this._reify();\n    }\n  }\n\n  async activate(): Promise<void> {\n    await this._reify();\n\n    if (this.length > 0 && this.autoProcess) {\n      this.process();\n    }\n  }\n\n  /**\n   * Name used for tracking / debugging this queue.\n   */\n  get name(): string | undefined {\n    return this._name;\n  }\n\n  /**\n   * The object which will `perform` the tasks in this queue.\n   */\n  get performer(): Performer<Type, Data, Options, Result> {\n    return this._performer;\n  }\n\n  /**\n   * A bucket used to persist the state of this queue.\n   */\n  get bucket(): Bucket<Task<Type, Data>[]> | undefined {\n    return this._bucket;\n  }\n\n  /**\n   * The number of tasks in the queue.\n   */\n  get length(): number {\n    return this._tasks.length;\n  }\n\n  /**\n   * The tasks in the queue.\n   */\n  get entries(): Task<Type, Data>[] {\n    return this._tasks;\n  }\n\n  /**\n   * The current task being processed (if actively processing), or the next\n   * task to be processed (if not actively processing).\n   */\n  get current(): Task<Type, Data> {\n    return this._tasks[0];\n  }\n\n  /**\n   * The processor wrapper that is processing the current task (or next task,\n   * if none are being processed).\n   */\n  get currentProcessor(): TaskProcessor<Type, Data, Options, Result> {\n    return this._processors[0];\n  }\n\n  /**\n   * If an error occurs while processing a task, processing will be halted, the\n   * `fail` event will be emitted, and this property will reflect the error\n   * encountered.\n   */\n  get error(): Error | undefined {\n    return this._error;\n  }\n\n  /**\n   * Is the queue empty?\n   */\n  get empty(): boolean {\n    return this.length === 0;\n  }\n\n  /**\n   * Is the queue actively processing a task?\n   */\n  get processing(): boolean {\n    const processor = this.currentProcessor;\n\n    return processor !== undefined && processor.started && !processor.settled;\n  }\n\n  /**\n   * Resolves when the queue has been fully reified from its associated bucket,\n   * if applicable.\n   */\n  get reified(): Promise<void> {\n    return this._reified;\n  }\n\n  /**\n   * Push a new task onto the end of the queue.\n   *\n   * If `autoProcess` is enabled, this will automatically trigger processing of\n   * the queue.\n   *\n   * Returns the result of processing the pushed task.\n   */\n  async push(task: Task<Type, Data, Options>): Promise<Result> {\n    await this._reified;\n\n    const processor = new TaskProcessor(this._performer, task);\n    this._tasks.push(task);\n    this._processors.push(processor);\n    await this._persist();\n    if (this.autoProcess) this._settle();\n    return processor.settle();\n  }\n\n  /**\n   * Cancels and re-tries processing the current task.\n   *\n   * Returns the result of the retried task.\n   */\n  async retry(): Promise<Result> {\n    await this._reified;\n\n    this._cancel();\n    let processor = this.currentProcessor;\n    processor.reset();\n    await this._persist();\n    this._settle();\n    return processor.settle();\n  }\n\n  /**\n   * Cancels and discards the current task.\n   *\n   * If `autoProcess` is enabled, this will automatically trigger processing of\n   * the queue.\n   */\n  async skip(e?: Error): Promise<void> {\n    await this._reified;\n\n    this._cancel();\n    this._tasks.shift();\n    let processor = this._processors.shift();\n    if (processor !== undefined && !processor.settled) {\n      processor.reject(\n        e || new Error('Processing cancelled via `TaskQueue#skip`')\n      );\n    }\n    await this._persist();\n    if (this.autoProcess) this._settle();\n  }\n\n  /**\n   * Cancels the current task and completely clears the queue.\n   */\n  async clear(e?: Error): Promise<void> {\n    await this._reified;\n\n    this._cancel();\n    this._tasks = [];\n    for (let processor of this._processors) {\n      if (!processor.settled) {\n        processor.reject(\n          e || new Error('Processing cancelled via `TaskQueue#clear`')\n        );\n      }\n    }\n    this._processors = [];\n    await this._persist();\n    await this._settle();\n  }\n\n  /**\n   * Cancels the current task and removes it, but does not continue processing.\n   *\n   * Returns the canceled and removed task.\n   */\n  async shift(e?: Error): Promise<Task<Type, Data> | undefined> {\n    await this._reified;\n\n    let task = this._tasks.shift();\n    if (task) {\n      this._cancel();\n      let processor = this._processors.shift();\n      if (processor !== undefined && !processor.settled) {\n        processor.reject(\n          e || new Error('Processing cancelled via `TaskQueue#shift`')\n        );\n      }\n      await this._persist();\n    }\n    return task;\n  }\n\n  /**\n   * Cancels processing the current task and inserts a new task at the beginning\n   * of the queue. This new task will be processed next.\n   *\n   * Returns the result of processing the new task.\n   */\n  async unshift(task: Task<Type, Data, Options>): Promise<Result> {\n    await this._reified;\n\n    let processor = new TaskProcessor<Type, Data, Options, Result>(\n      this._performer,\n      task\n    );\n    this._cancel();\n    this._tasks.unshift(task);\n    this._processors.unshift(processor);\n    await this._persist();\n    if (this.autoProcess) this._settle();\n    return processor.settle();\n  }\n\n  /**\n   * Processes all the tasks in the queue. Resolves when the queue is empty.\n   */\n  async process(): Promise<void> {\n    await this._reified;\n\n    let resolution = this._resolution;\n    if (!resolution) {\n      if (this._tasks.length === 0) {\n        resolution = this._complete();\n      } else {\n        this._error = undefined;\n        this._resolution = resolution = new Promise((resolve, reject) => {\n          this._resolve = resolve;\n          this._reject = reject;\n        });\n        await this._settleEach(resolution);\n      }\n    }\n    return resolution;\n  }\n\n  private async _settle(): Promise<void> {\n    try {\n      await this.process();\n    } catch (e) {}\n  }\n\n  private async _complete(): Promise<void> {\n    if (this._resolve) {\n      this._resolve();\n    }\n    this._resolve = undefined;\n    this._reject = undefined;\n    this._error = undefined;\n    this._resolution = undefined;\n    await settleInSeries(this, 'complete');\n  }\n\n  private async _fail(task: Task<Type, Data>, e: Error): Promise<void> {\n    if (this._reject) {\n      this._reject(e);\n    }\n    this._resolve = undefined;\n    this._reject = undefined;\n    this._error = e;\n    this._resolution = undefined;\n    await settleInSeries(this, 'fail', task, e);\n  }\n\n  private _cancel(): void {\n    this._error = undefined;\n    this._resolution = undefined;\n  }\n\n  private async _settleEach(resolution: any): Promise<void> {\n    if (this._tasks.length === 0) {\n      return this._complete();\n    } else {\n      const task = this._tasks[0];\n      const processor = this._processors[0];\n\n      try {\n        await settleInSeries(this, 'beforeTask', task);\n        await processor.process();\n        if (resolution === this._resolution) {\n          this._tasks.shift();\n          this._processors.shift();\n\n          await this._persist();\n          await settleInSeries(this, 'task', task);\n          await this._settleEach(resolution);\n        }\n      } catch (e) {\n        if (resolution === this._resolution) {\n          return this._fail(task, e as Error);\n        }\n      }\n    }\n  }\n\n  private _reify(): Promise<void> {\n    this._tasks = [];\n    this._processors = [];\n\n    this._reified = this._loadTasksFromBucket().then(\n      (tasks: Task<Type, Data, Options>[] | undefined) => {\n        if (tasks) {\n          this._tasks = tasks;\n          this._processors = tasks.map(\n            (task) => new TaskProcessor(this._performer, task)\n          );\n        }\n      }\n    );\n\n    return this._reified;\n  }\n\n  private async _loadTasksFromBucket(): Promise<\n    Task<Type, Data, Options>[] | undefined\n  > {\n    if (this._bucket && this._name) {\n      return this._bucket.getItem(this._name);\n    }\n  }\n\n  private async _persist(): Promise<void> {\n    this.emit('change');\n    if (this._bucket && this._name) {\n      await this._bucket.setItem(this._name, this._tasks);\n    }\n  }\n}\n","import { evented, Evented } from './evented';\n\n/**\n * Settings used to instantiate and/or upgrade a `Bucket`.\n */\nexport interface BucketSettings {\n  /**\n   * Name used for tracking and debugging a bucket instance.\n   */\n  name?: string;\n\n  /**\n   * The namespace used by the bucket when accessing any items.\n   *\n   * This is used to distinguish one bucket's contents from another.\n   */\n  namespace?: string;\n\n  /**\n   * The current version of the bucket.\n   *\n   * Used to identify the version of the bucket's schema and thus migrate it\n   * as needed.\n   */\n  version?: number;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-interface\nexport interface Bucket<Item> extends Evented<'upgrade'> {}\n\n/**\n * Buckets can persist state. The base `Bucket` class is abstract and should be\n * extended to create buckets with different persistence strategies.\n *\n * Buckets have a simple map-like interface with methods like `getItem`,\n * `setItem`, and `removeItem`. All methods return promises to enable usage with\n * asynchronous stores like IndexedDB.\n *\n * Buckets can be assigned a unique `namespace` in order to avoid collisions.\n *\n * Buckets can be assigned a version, and can be \"upgraded\" to a new version.\n * The upgrade process allows buckets to migrate their data between versions.\n */\n@evented\nexport abstract class Bucket<Item = unknown> {\n  private _name?: string;\n  private _namespace!: string;\n  private _version!: number;\n\n  constructor(settings: BucketSettings = {}) {\n    if (settings.version === undefined) {\n      settings.version = 1;\n    }\n\n    if (settings.namespace === undefined) {\n      settings.namespace = 'orbit-bucket';\n    }\n\n    this._applySettings(settings);\n  }\n\n  /**\n   * Retrieves an item from the bucket.\n   */\n  abstract getItem(key: string): Promise<Item>;\n\n  /**\n   * Stores an item in the bucket.\n   */\n  abstract setItem(key: string, value: Item): Promise<void>;\n\n  /**\n   * Removes an item from the bucket.\n   */\n  abstract removeItem(key: string): Promise<void>;\n\n  /**\n   * Clears all items from the bucket.\n   */\n  abstract clear(): Promise<void>;\n\n  /**\n   * Name used for tracking and debugging a bucket instance.\n   */\n  get name(): string | undefined {\n    return this._name;\n  }\n\n  /**\n   * The namespace used by the bucket when accessing any items.\n   *\n   * This is used to distinguish one bucket's contents from another.\n   */\n  get namespace(): string {\n    return this._namespace;\n  }\n\n  /**\n   * The current version of the bucket.\n   *\n   * This is read-only. To change versions, `upgrade` should be invoked.\n   */\n  get version(): number {\n    return this._version;\n  }\n\n  /**\n   * Upgrades Bucket to a new version with new settings.\n   *\n   * Settings, beyond `version`, are bucket-specific.\n   */\n  upgrade(settings: BucketSettings = {}): Promise<void> {\n    if (settings.version === undefined) {\n      settings.version = this._version + 1;\n    }\n    return this._applySettings(settings).then(() =>\n      this.emit('upgrade', this._version)\n    );\n  }\n\n  /**\n   * Applies settings passed from a `constructor` or `upgrade`.\n   */\n  protected async _applySettings(settings: BucketSettings): Promise<void> {\n    if (settings.name !== undefined) {\n      this._name = settings.name;\n    }\n    if (settings.namespace !== undefined) {\n      this._namespace = settings.namespace;\n    }\n    if (settings.version !== undefined) {\n      this._version = settings.version;\n    }\n  }\n}\n","import { Orbit } from './main';\nimport { evented, Evented } from './evented';\nimport { Bucket } from './bucket';\nimport { NotLoggedException, OutOfRangeException } from './exception';\n\nconst { assert } = Orbit;\n\nexport interface LogOptions {\n  name?: string;\n  data?: string[];\n  bucket?: Bucket<string[]>;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface Log\n  extends Evented<'append' | 'truncate' | 'rollback' | 'clear' | 'change'> {}\n\n/**\n * Logs track a series of unique events that have occurred. Each event is\n * tracked based on its unique id. The log only tracks the ids but currently\n * does not track any details.\n *\n * Logs can automatically be persisted by assigning them a bucket.\n */\n@evented\nexport class Log {\n  private _name?: string;\n  private _bucket?: Bucket<string[]>;\n  private _data: string[] = [];\n\n  public reified!: Promise<void>;\n\n  constructor(options: LogOptions = {}) {\n    this._name = options.name;\n    this._bucket = options.bucket;\n\n    if (this._bucket) {\n      assert('Log requires a name if it has a bucket', !!this._name);\n    }\n\n    this._reify(options.data);\n  }\n\n  get name(): string | undefined {\n    return this._name;\n  }\n\n  get bucket(): Bucket<string[]> | undefined {\n    return this._bucket;\n  }\n\n  get head(): string {\n    return this._data[this._data.length - 1];\n  }\n\n  get entries(): string[] {\n    return this._data;\n  }\n\n  get length(): number {\n    return this._data.length;\n  }\n\n  append(...ids: string[]): Promise<void> {\n    return this.reified\n      .then(() => {\n        Array.prototype.push.apply(this._data, ids);\n        return this._persist();\n      })\n      .then(() => {\n        this.emit('append', ids);\n      });\n  }\n\n  before(id: string, relativePosition = 0): string[] {\n    const index = this._data.indexOf(id);\n    if (index === -1) {\n      throw new NotLoggedException(id);\n    }\n\n    const position = index + relativePosition;\n    if (position < 0 || position >= this._data.length) {\n      throw new OutOfRangeException(position);\n    }\n\n    return this._data.slice(0, position);\n  }\n\n  after(id: string, relativePosition = 0): string[] {\n    const index = this._data.indexOf(id);\n    if (index === -1) {\n      throw new NotLoggedException(id);\n    }\n\n    const position = index + 1 + relativePosition;\n    if (position < 0 || position > this._data.length) {\n      throw new OutOfRangeException(position);\n    }\n\n    return this._data.slice(position);\n  }\n\n  truncate(id: string, relativePosition = 0): Promise<void> {\n    let removed: string[];\n\n    return this.reified\n      .then(() => {\n        const index = this._data.indexOf(id);\n        if (index === -1) {\n          throw new NotLoggedException(id);\n        }\n\n        const position = index + relativePosition;\n        if (position < 0 || position > this._data.length) {\n          throw new OutOfRangeException(position);\n        }\n\n        if (position === this._data.length) {\n          removed = this._data;\n          this._data = [];\n        } else {\n          removed = this._data.slice(0, position);\n          this._data = this._data.slice(position);\n        }\n\n        return this._persist();\n      })\n      .then(() => {\n        this.emit('truncate', id, relativePosition, removed);\n      });\n  }\n\n  rollback(id: string, relativePosition = 0): Promise<void> {\n    let removed: string[];\n\n    return this.reified\n      .then(() => {\n        const index = this._data.indexOf(id);\n        if (index === -1) {\n          throw new NotLoggedException(id);\n        }\n\n        const position = index + 1 + relativePosition;\n        if (position < 0 || position > this._data.length) {\n          throw new OutOfRangeException(position);\n        }\n\n        removed = this._data.slice(position);\n        this._data = this._data.slice(0, position);\n\n        return this._persist();\n      })\n      .then(() => {\n        this.emit('rollback', id, relativePosition, removed);\n      });\n  }\n\n  clear(): Promise<void> {\n    let clearedData: string[];\n\n    return this.reified\n      .then(() => {\n        clearedData = this._data;\n        this._data = [];\n        return this._persist();\n      })\n      .then(() => this.emit('clear', clearedData));\n  }\n\n  contains(id: string): boolean {\n    return this._data.indexOf(id) > -1;\n  }\n\n  private async _persist(): Promise<void> {\n    this.emit('change');\n    if (this._bucket && this._name) {\n      await this._bucket.setItem(this._name, this._data);\n    }\n  }\n\n  private _reify(data?: string[]): Promise<void> {\n    if (data) {\n      this._initData(data);\n      this.reified = Promise.resolve();\n    } else {\n      this.reified = this._loadDataFromBucket().then((bucketData) =>\n        this._initData(bucketData)\n      );\n    }\n\n    return this.reified;\n  }\n\n  private async _loadDataFromBucket(): Promise<string[] | undefined> {\n    if (this._bucket && this._name) {\n      return (await this._bucket.getItem(this._name)) as string[] | undefined;\n    }\n  }\n\n  private _initData(data?: string[]): void {\n    this._data = data ?? [];\n  }\n}\n","import { deepMerge } from '@orbit/utils';\nimport { Operation } from './operation';\nimport { RequestOptions } from './request';\n\n/**\n * Operation terms are used by transform builders to allow for the construction of\n * operations in composable patterns.\n */\nexport class OperationTerm<O extends Operation> {\n  protected _operation: O;\n\n  constructor(operation: O) {\n    this._operation = operation;\n  }\n\n  toOperation(): O {\n    return this._operation;\n  }\n\n  options(options: RequestOptions): this {\n    this._operation.options = deepMerge(this._operation.options || {}, options);\n    return this;\n  }\n}\n","import { deepMerge } from '@orbit/utils';\nimport { QueryExpression } from './query-expression';\nimport { RequestOptions } from './request';\n\n/**\n * Query terms are used by query builders to allow for the construction of\n * query expressions in composable patterns.\n */\nexport class QueryTerm<QE extends QueryExpression> {\n  protected _expression: QE;\n\n  constructor(expression: QE) {\n    this._expression = expression;\n  }\n\n  toQueryExpression(): QE {\n    return this._expression;\n  }\n\n  options(options: RequestOptions): this {\n    this._expression.options = deepMerge(\n      this._expression.options || {},\n      options\n    );\n    return this;\n  }\n}\n","import { Orbit } from '@orbit/core';\nimport { QueryTerm } from './query-term';\nimport { RequestOptions } from './request';\nimport { QueryExpression } from './query-expression';\n\n/**\n * Queries are used to extract data from a source.\n *\n * Each query's `expressions` must be a query expression or an array of\n * expressions. This distinction allows for a clear distinction between queries\n * that return singular vs. arrayed results.\n */\nexport interface Query<QE extends QueryExpression> {\n  id: string;\n  expressions: QE | QE[];\n  options?: RequestOptions;\n}\n\nexport type QueryBuilderFunc<QE extends QueryExpression, QB> = (\n  QueryBuilder: QB\n) => QE | QE[] | QueryTerm<QE> | QueryTerm<QE>[];\n\nexport type QueryOrExpressions<QE extends QueryExpression, QB> =\n  | Query<QE>\n  | QE\n  | QE[]\n  | QueryTerm<QE>\n  | QueryTerm<QE>[]\n  | QueryBuilderFunc<QE, QB>;\n\n/**\n * A builder function for creating a Query from its constituent parts.\n *\n * If a `Query` is passed in with an `id` and `expression`, and no replacement\n * `id` or `options` are also passed in, then the `Query` will be returned\n * unchanged.\n *\n * For all other cases, a new `Query` object will be created and returned.\n *\n * Queries will be assigned the specified `queryId` as `id`. If none is\n * specified, a UUID will be generated.\n */\nexport function buildQuery<QE extends QueryExpression, QB = unknown>(\n  queryOrExpressions: QueryOrExpressions<QE, QB>,\n  queryOptions?: RequestOptions,\n  queryId?: string,\n  queryBuilder?: QB\n): Query<QE> {\n  if (typeof queryOrExpressions === 'function') {\n    const queryBuilderFn = queryOrExpressions as QueryBuilderFunc<QE, QB>;\n    return buildQuery<QE, QB>(\n      queryBuilderFn(queryBuilder as QB),\n      queryOptions,\n      queryId\n    );\n  } else {\n    let query = queryOrExpressions as Query<QE>;\n    let expressions: QE | QE[];\n    let options: RequestOptions | undefined;\n    let id: string;\n\n    if (isQuery(query)) {\n      if (queryOptions || queryId) {\n        expressions = query.expressions;\n        if (query.options && queryOptions) {\n          options = {\n            ...query.options,\n            ...queryOptions\n          };\n        } else {\n          options = queryOptions ?? query.options;\n        }\n        id = queryId ?? query.id;\n      } else {\n        return query;\n      }\n    } else {\n      if (Array.isArray(queryOrExpressions)) {\n        expressions = [];\n        for (let qe of queryOrExpressions) {\n          expressions.push(toQueryExpression<QE>(qe));\n        }\n      } else {\n        expressions = toQueryExpression(\n          queryOrExpressions as QE | QueryTerm<QE>\n        );\n      }\n      options = queryOptions;\n      id = queryId ?? Orbit.uuid();\n    }\n\n    return { expressions, options, id };\n  }\n}\n\nexport function toQueryExpression<QE extends QueryExpression = QueryExpression>(\n  expression: QE | QueryTerm<QE>\n): QE {\n  if (isQueryTerm(expression)) {\n    return (expression as QueryTerm<QE>).toQueryExpression();\n  } else {\n    return expression;\n  }\n}\n\nexport function isQueryTerm<QE extends QueryExpression = QueryExpression>(\n  expression: QE | QueryTerm<QE>\n): expression is QueryTerm<QE> {\n  return typeof (expression as QueryTerm<QE>).toQueryExpression === 'function';\n}\n\nexport function isQuery<\n  QE extends QueryExpression = QueryExpression,\n  QB = unknown\n>(query: QueryOrExpressions<QE, QB>): query is Query<QE> {\n  return (query as Query<QE>).expressions !== undefined;\n}\n","import { Options } from './options';\n\nexport interface RequestOptions extends Options {\n  fullResponse?: boolean;\n  sources?: { [name: string]: RequestOptions };\n}\n\nexport type DefaultRequestOptions<RO extends RequestOptions> = RO & {\n  fullResponse?: false;\n};\n\nexport type FullRequestOptions<RO extends RequestOptions> = RO & {\n  fullResponse: true;\n};\n\n/**\n * Merges general request options with those specific to a source. The more\n * specific options override the general options. If an array of options is\n * provided, they will be merged to a single set.\n */\nexport function requestOptionsForSource<RO extends RequestOptions>(\n  options: RO | undefined | (RO | undefined)[],\n  source?: string\n): RO | undefined {\n  let result: RO | undefined;\n\n  if (options !== undefined) {\n    if (Array.isArray(options)) {\n      for (let o of options) {\n        if (o) {\n          let so = extractRequestOptionsForSource<RO>(o, source);\n          if (result) {\n            result = {\n              ...result,\n              ...so\n            };\n          } else {\n            result = so;\n          }\n        }\n      }\n    } else {\n      result = extractRequestOptionsForSource<RO>(options, source);\n    }\n  }\n\n  return result;\n}\n\nfunction extractRequestOptionsForSource<RO extends RequestOptions>(\n  options: RO,\n  source?: string\n): RO {\n  if (options.sources) {\n    let { sources, ...rest } = options;\n\n    if (source && sources[source]) {\n      return {\n        ...rest,\n        ...sources[source]\n      } as RO;\n    } else {\n      return rest as RO;\n    }\n  } else {\n    return options;\n  }\n}\n","import { Operation } from './operation';\nimport { Transform } from './transform';\n\nexport type NamedFullResponse<\n  Data,\n  Details = unknown,\n  O extends Operation = Operation\n> = [string, FullResponse<Data, Details, O>];\n\nexport interface NamedFullResponseMap<\n  Data,\n  Details = unknown,\n  O extends Operation = Operation\n> {\n  [name: string]: FullResponse<Data, Details, O>;\n}\n\nexport interface FullResponse<\n  Data,\n  Details = unknown,\n  O extends Operation = Operation\n> {\n  /**\n   * Primary data for this response.\n   */\n  data?: Data;\n\n  /**\n   * Source-specific response details. For example, a request that uses `fetch`\n   * might include the raw response document in `details`.\n   */\n  details?: Details;\n\n  /**\n   * Transforms should be returned if fulfilling a request results in mutations\n   * to a source.\n   */\n  transforms?: Transform<O>[];\n\n  /**\n   * If fulfilling this request triggers downstream requests in other sources,\n   * those full responses may be returned in the `sources` map.\n   *\n   * Note: Response `data` and `details` from other sources do not necessarily\n   * match the types of the primary response\n   */\n  sources?: NamedFullResponseMap<unknown, unknown, O>;\n}\n\nexport interface ResponseHints<Data, Details> {\n  data?: Data;\n  details?: Details;\n}\n\nexport function mapNamedFullResponses<\n  Data = unknown,\n  Details = unknown,\n  O extends Operation = Operation\n>(\n  responses: (NamedFullResponse<Data, Details, O> | undefined)[]\n): NamedFullResponseMap<Data, Details, O> {\n  let map: NamedFullResponseMap<Data, Details, O> = {};\n  for (let r of responses) {\n    if (typeof r?.[0] === 'string' && r?.[1] !== undefined) {\n      map[r[0]] = r[1];\n    }\n  }\n  return map;\n}\n","import {\n  Orbit,\n  evented,\n  Evented,\n  settleInSeries,\n  Bucket,\n  TaskQueue,\n  TaskQueueSettings,\n  Task,\n  Performer,\n  Log\n} from '@orbit/core';\nimport { Operation } from './operation';\nimport { Query } from './query';\nimport { QueryExpression } from './query-expression';\nimport {\n  DefaultRequestOptions,\n  RequestOptions,\n  requestOptionsForSource\n} from './request';\nimport { Transform } from './transform';\n\nconst { assert } = Orbit;\n\nexport interface SourceSettings<\n  QueryOptions extends RequestOptions = RequestOptions,\n  TransformOptions extends RequestOptions = RequestOptions,\n  QueryBuilder = unknown,\n  TransformBuilder = unknown\n> {\n  name?: string;\n  bucket?: Bucket;\n  queryBuilder?: QueryBuilder;\n  transformBuilder?: TransformBuilder;\n  autoActivate?: boolean;\n  requestQueueSettings?: TaskQueueSettings;\n  syncQueueSettings?: TaskQueueSettings;\n  defaultQueryOptions?: DefaultRequestOptions<QueryOptions>;\n  defaultTransformOptions?: DefaultRequestOptions<TransformOptions>;\n}\n\nexport type SourceClass<\n  QueryOptions extends RequestOptions = RequestOptions,\n  TransformOptions extends RequestOptions = RequestOptions,\n  QueryBuilder = unknown,\n  TransformBuilder = unknown\n> = new () => Source<\n  QueryOptions,\n  TransformOptions,\n  QueryBuilder,\n  TransformBuilder\n>;\n\nexport interface Source extends Evented, Performer {}\n\n/**\n * Base class for sources.\n */\n@evented\nexport abstract class Source<\n  QueryOptions extends RequestOptions = RequestOptions,\n  TransformOptions extends RequestOptions = RequestOptions,\n  QueryBuilder = unknown,\n  TransformBuilder = unknown\n> {\n  protected _name?: string;\n  protected _bucket?: Bucket;\n  protected _transformLog: Log;\n  protected _requestQueue: TaskQueue;\n  protected _syncQueue: TaskQueue;\n  protected _queryBuilder?: QueryBuilder;\n  protected _transformBuilder?: TransformBuilder;\n  protected _defaultQueryOptions?: DefaultRequestOptions<QueryOptions>;\n  protected _defaultTransformOptions?: DefaultRequestOptions<TransformOptions>;\n  private _activated?: Promise<void>;\n\n  constructor(\n    settings: SourceSettings<\n      QueryOptions,\n      TransformOptions,\n      QueryBuilder,\n      TransformBuilder\n    > = {}\n  ) {\n    const name = (this._name = settings.name);\n    const bucket = (this._bucket = settings.bucket);\n    const requestQueueSettings = settings.requestQueueSettings || {};\n    const syncQueueSettings = settings.syncQueueSettings || {};\n    const autoActivate =\n      settings.autoActivate === undefined || settings.autoActivate;\n\n    this._queryBuilder = settings.queryBuilder;\n    this._transformBuilder = settings.transformBuilder;\n\n    this._defaultQueryOptions = settings.defaultQueryOptions;\n    this._defaultTransformOptions = settings.defaultTransformOptions;\n\n    if (bucket) {\n      assert('TransformLog requires a name if it has a bucket', !!name);\n    }\n\n    this._transformLog = new Log({\n      name: name ? `${name}-log` : undefined,\n      bucket: bucket as Bucket<string[]>\n    });\n\n    this._syncQueue = new TaskQueue(this, {\n      name: name ? `${name}-sync` : undefined,\n      bucket: bucket as Bucket<Task[]>,\n      autoActivate: false,\n      ...syncQueueSettings\n    });\n\n    this._requestQueue = new TaskQueue(this, {\n      name: name ? `${name}-requests` : undefined,\n      bucket: bucket as Bucket<Task[]>,\n      autoActivate: false,\n      ...requestQueueSettings\n    });\n\n    if (autoActivate) {\n      this.activate();\n    }\n  }\n\n  get name(): string | undefined {\n    return this._name;\n  }\n\n  get bucket(): Bucket | undefined {\n    return this._bucket;\n  }\n\n  get transformLog(): Log {\n    return this._transformLog;\n  }\n\n  get requestQueue(): TaskQueue {\n    return this._requestQueue;\n  }\n\n  get syncQueue(): TaskQueue {\n    return this._syncQueue;\n  }\n\n  get queryBuilder(): QueryBuilder | undefined {\n    return this._queryBuilder;\n  }\n\n  get transformBuilder(): TransformBuilder | undefined {\n    return this._transformBuilder;\n  }\n\n  get defaultQueryOptions(): DefaultRequestOptions<QueryOptions> | undefined {\n    return this._defaultQueryOptions;\n  }\n\n  set defaultQueryOptions(\n    options: DefaultRequestOptions<QueryOptions> | undefined\n  ) {\n    this._defaultQueryOptions = options;\n  }\n\n  get defaultTransformOptions():\n    | DefaultRequestOptions<TransformOptions>\n    | undefined {\n    return this._defaultTransformOptions;\n  }\n\n  set defaultTransformOptions(\n    options: DefaultRequestOptions<TransformOptions> | undefined\n  ) {\n    this._defaultTransformOptions = options;\n  }\n\n  getQueryOptions(\n    query: Query<QueryExpression>,\n    expression?: QueryExpression\n  ): QueryOptions | undefined {\n    return requestOptionsForSource<QueryOptions>(\n      [\n        this._defaultQueryOptions,\n        query.options as QueryOptions | undefined,\n        expression?.options as QueryOptions | undefined\n      ],\n      this._name\n    );\n  }\n\n  getTransformOptions(\n    transform: Transform<Operation>,\n    operation?: Operation\n  ): TransformOptions | undefined {\n    return requestOptionsForSource(\n      [\n        this._defaultTransformOptions,\n        transform.options as TransformOptions | undefined,\n        operation?.options as TransformOptions | undefined\n      ],\n      this._name\n    );\n  }\n\n  // Performer interface\n  perform(task: Task): Promise<unknown> {\n    const methodName = `__${task.type}__`;\n    const method = (this as any)[methodName] as (data: any) => Promise<unknown>;\n\n    assert(\n      `Method '${methodName}' does not exist on Source`,\n      method !== undefined\n    );\n\n    return method.call(this, task.data);\n  }\n\n  /**\n   * Upgrade source as part of a schema upgrade.\n   */\n  upgrade(): Promise<void> {\n    return Promise.resolve();\n  }\n\n  get activated(): Promise<void> {\n    if (!this._activated) {\n      throw new Error(`\"${this.name}\" source is not activated`);\n    }\n    return this._activated;\n  }\n\n  async activate(): Promise<void> {\n    if (!this._activated) {\n      this._activated = this._activate();\n    }\n    await this._activated;\n  }\n\n  async deactivate(): Promise<void> {\n    if (this._activated) {\n      await this._activated;\n    }\n\n    this._activated = undefined;\n  }\n\n  /**\n   * Notifies listeners that this source has been transformed by emitting the\n   * `transform` event.\n   *\n   * Resolves when any promises returned to event listeners are resolved.\n   *\n   * Also, adds an entry to the Source's `transformLog` for each transform.\n   */\n  async transformed(transforms: Transform<Operation>[]): Promise<void> {\n    await this.activated;\n\n    for (let transform of transforms) {\n      if (!this._transformLog.contains(transform.id)) {\n        await this._transformLog.append(transform.id);\n        await settleInSeries(this, 'transform', transform);\n      }\n    }\n  }\n\n  /////////////////////////////////////////////////////////////////////////////\n  // Protected methods\n  /////////////////////////////////////////////////////////////////////////////\n\n  protected async _activate(): Promise<void> {\n    await this._transformLog.reified;\n    await this._syncQueue.activate();\n    await this._requestQueue.activate();\n  }\n}\n","/* eslint-disable valid-jsdoc */\nimport { Orbit } from '@orbit/core';\nimport { Operation } from './operation';\nimport { OperationTerm } from './operation-term';\nimport { RequestOptions } from './request';\n\nexport type TransformBuilderFunc<O extends Operation, TB> = (\n  TransformBuilder: TB\n) => O | O[] | OperationTerm<O> | OperationTerm<O>[];\n\nexport type TransformOrOperations<O extends Operation, TB> =\n  | Transform<O>\n  | O\n  | O[]\n  | OperationTerm<O>\n  | OperationTerm<O>[]\n  | TransformBuilderFunc<O, TB>;\n\n/**\n * A Transform represents a set of operations that can mutate a source.\n */\nexport interface Transform<O extends Operation> {\n  id: string;\n  operations: O | O[];\n  options?: RequestOptions;\n}\n\n/**\n * A builder function for creating a Transform from its constituent parts.\n *\n * If a `Transform` is passed in with an `id` and `operations`, and no\n * replacement `id` or `options` are also passed in, then the `Transform`\n * will be returned unchanged.\n *\n * For all other cases, a new `Transform` object will be created and returned.\n *\n * Transforms will be assigned the specified `transformId` as `id`. If none\n * is specified, a UUID will be generated.\n */\nexport function buildTransform<O extends Operation, TB = unknown>(\n  transformOrOperations: TransformOrOperations<O, TB>,\n  transformOptions?: RequestOptions,\n  transformId?: string,\n  transformBuilder?: TB\n): Transform<O> {\n  if (typeof transformOrOperations === 'function') {\n    const transformBuilderFn = transformOrOperations as TransformBuilderFunc<\n      O,\n      TB\n    >;\n    return buildTransform<O, TB>(\n      transformBuilderFn(transformBuilder as TB),\n      transformOptions,\n      transformId\n    );\n  } else {\n    let transform = transformOrOperations as Transform<O>;\n    let operations: O | O[];\n    let options: RequestOptions | undefined;\n    let id: string;\n\n    if (isTransform(transform)) {\n      if (transformOptions || transformId) {\n        operations = transform.operations;\n        if (transform.options && transformOptions) {\n          options = {\n            ...transform.options,\n            ...transformOptions\n          };\n        } else {\n          options = transformOptions ?? transform.options;\n        }\n        id = transformId ?? transform.id;\n      } else {\n        return transform;\n      }\n    } else {\n      if (Array.isArray(transformOrOperations)) {\n        operations = [];\n        for (let o of transformOrOperations) {\n          operations.push(toOperation<O>(o));\n        }\n      } else {\n        operations = toOperation<O>(transformOrOperations as O);\n      }\n      options = transformOptions;\n      id = transformId ?? Orbit.uuid();\n    }\n\n    return { operations, options, id };\n  }\n}\n\nfunction toOperation<O extends Operation = Operation>(\n  operation: O | OperationTerm<O>\n): O {\n  if (isOperationTerm(operation)) {\n    return (operation as OperationTerm<O>).toOperation();\n  } else {\n    return operation;\n  }\n}\n\nfunction isOperationTerm<O extends Operation = Operation>(\n  operation: O | OperationTerm<O>\n): operation is OperationTerm<O> {\n  return typeof (operation as OperationTerm<O>).toOperation === 'function';\n}\n\nfunction isTransform<O extends Operation = Operation>(\n  transform: TransformOrOperations<O, unknown>\n): transform is Transform<O> {\n  return (transform as Transform<O>).operations !== undefined;\n}\n","import { Orbit, settleInSeries, fulfillInSeries } from '@orbit/core';\nimport { Source, SourceClass } from '../source';\nimport { Query, QueryOrExpressions, buildQuery } from '../query';\nimport {\n  DefaultRequestOptions,\n  FullRequestOptions,\n  RequestOptions\n} from '../request';\nimport {\n  FullResponse,\n  NamedFullResponse,\n  mapNamedFullResponses,\n  ResponseHints\n} from '../response';\nimport { Operation } from '../operation';\nimport { QueryExpression } from '../query-expression';\nimport { Transform } from '../transform';\n\nconst { assert, deprecate } = Orbit;\n\nconst PULLABLE = '__pullable__';\n\n/**\n * Has a source been decorated as `@pullable`?\n */\nexport function isPullable(source: Source): boolean {\n  return !!(source as { [PULLABLE]?: boolean })[PULLABLE];\n}\n\n/**\n * A source decorated as `@pullable` must also implement the `Pullable`\n * interface.\n *\n * @deprecated since v0.17, use `Queryable` instead\n */\nexport interface Pullable<\n  Data,\n  Details,\n  O extends Operation,\n  QE extends QueryExpression,\n  QueryBuilder,\n  Options extends RequestOptions = RequestOptions\n> {\n  /**\n   * The `pull` method accepts a query or expression(s) and returns a promise\n   * that resolves to an array of `Transform` instances that represent the\n   * changeset that resulted from applying the query. In other words, a `pull`\n   * request retrieves the results of a query in `Transform` form.\n   */\n  pull<RequestOperation extends O = O>(\n    queryOrExpressions: QueryOrExpressions<QE, QueryBuilder>,\n    options?: DefaultRequestOptions<Options>,\n    id?: string\n  ): Promise<Transform<RequestOperation>[]>;\n  pull<\n    RequestData extends Data = Data,\n    RequestDetails extends Details = Details,\n    RequestOperation extends O = O\n  >(\n    queryOrExpressions: QueryOrExpressions<QE, QueryBuilder>,\n    options?: FullRequestOptions<Options>,\n    id?: string\n  ): Promise<FullResponse<RequestData, RequestDetails, RequestOperation>>;\n\n  _pull(query: Query<QE>): Promise<FullResponse<Data, Details, O>>;\n}\n\n/**\n * Marks a source as \"pullable\" and adds an implementation of the `Pullable`\n * interface.\n *\n * The `pull` method is part of the \"request flow\" in Orbit. Requests trigger\n * events before and after processing of each request. Observers can delay the\n * resolution of a request by returning a promise in an event listener.\n *\n * A pullable source emits the following events:\n *\n * - `beforePull` - emitted prior to the processing of `pull`, this event\n * includes the requested `Query` as an argument.\n *\n * - `pull` - emitted after a `pull` has successfully been requested, this\n * event's arguments include both the requested `Query` and an array of the\n * resulting `Transform` instances.\n *\n * - `pullFail` - emitted when an error has occurred processing a `pull`, this\n * event's arguments include both the requested `Query` and the error.\n *\n * A pullable source must implement a private method `_pull`, which performs\n * the processing required for `pull` and returns a promise that resolves to an\n * array of `Transform` instances.\n */\nexport function pullable(Klass: unknown): void {\n  let proto = (Klass as SourceClass).prototype;\n\n  if (isPullable(proto)) {\n    return;\n  }\n\n  assert(\n    'Pullable interface can only be applied to a Source',\n    proto instanceof Source\n  );\n\n  proto[PULLABLE] = true;\n\n  proto.pull = async function (\n    queryOrExpressions: QueryOrExpressions<QueryExpression, unknown>,\n    options?: RequestOptions,\n    id?: string\n  ): Promise<unknown> {\n    deprecate(\n      \"'pull' has been deprecated. Please use 'query' instead and create your own transform from the results.\"\n    );\n\n    await this.activated;\n    const query = buildQuery(\n      queryOrExpressions,\n      options,\n      id,\n      this.queryBuilder\n    );\n    const response = await this._requestQueue.push({\n      type: 'pull',\n      data: query\n    });\n    return options?.fullResponse ? response : response.transforms || [];\n  };\n\n  proto.__pull__ = async function (\n    query: Query<QueryExpression>\n  ): Promise<FullResponse<unknown, unknown, Operation>> {\n    try {\n      const hints: ResponseHints<unknown, unknown> = {};\n      const otherResponses = (await fulfillInSeries(\n        this,\n        'beforePull',\n        query,\n        hints\n      )) as (NamedFullResponse<unknown, unknown, Operation> | undefined)[];\n      const fullResponse = await this._pull(query, hints);\n      if (otherResponses.length > 0) {\n        fullResponse.sources = mapNamedFullResponses(otherResponses);\n      }\n      if (fullResponse.transforms?.length > 0) {\n        await this.transformed(fullResponse.transforms);\n      }\n      await settleInSeries(this, 'pull', query, fullResponse);\n      return fullResponse;\n    } catch (error) {\n      await settleInSeries(this, 'pullFail', query, error);\n      throw error;\n    }\n  };\n}\n","import { Orbit, settleInSeries, fulfillInSeries } from '@orbit/core';\nimport { Source, SourceClass } from '../source';\nimport { Transform, TransformOrOperations, buildTransform } from '../transform';\nimport {\n  DefaultRequestOptions,\n  FullRequestOptions,\n  RequestOptions\n} from '../request';\nimport {\n  FullResponse,\n  NamedFullResponse,\n  mapNamedFullResponses,\n  ResponseHints\n} from '../response';\nimport { Operation } from '../operation';\n\nconst { assert, deprecate } = Orbit;\n\nconst PUSHABLE = '__pushable__';\n\n/**\n * Has a source been decorated as `@pushable`?\n */\nexport function isPushable(source: Source): boolean {\n  return !!(source as { [PUSHABLE]?: boolean })[PUSHABLE];\n}\n\n/**\n * A source decorated as `@pushable` must also implement the `Pushable`\n * interface.\n *\n * @deprecated since v0.17, use `Updatable` instead\n */\nexport interface Pushable<\n  Data,\n  Details,\n  O extends Operation,\n  TransformBuilder,\n  Options extends RequestOptions = RequestOptions\n> {\n  /**\n   * The `push` method accepts a `Transform` instance as an argument and returns\n   * a promise that resolves to an array of `Transform` instances that are\n   * applied as a result. In other words, `push` captures the direct results\n   * _and_ side effects of applying a `Transform` to a source.\n   */\n  push<RequestOperation extends O = O>(\n    transformOrOperations: TransformOrOperations<O, TransformBuilder>,\n    options?: DefaultRequestOptions<Options>,\n    id?: string\n  ): Promise<Transform<RequestOperation>[]>;\n  push<\n    RequestData extends Data = Data,\n    RequestDetails extends Details = Details,\n    RequestOperation extends O = O\n  >(\n    transformOrOperations: TransformOrOperations<O, TransformBuilder>,\n    options: FullRequestOptions<Options>,\n    id?: string\n  ): Promise<FullResponse<RequestData, RequestDetails, RequestOperation>>;\n\n  _push(\n    transform: Transform<O>,\n    hints?: ResponseHints<Data, Details>\n  ): Promise<FullResponse<Data, Details, O>>;\n}\n\n/**\n * Marks a source as \"pushable\" and adds an implementation of the `Pushable`\n * interface.\n *\n * The `push` method is part of the \"request flow\" in Orbit. Requests trigger\n * events before and after processing of each request. Observers can delay the\n * resolution of a request by returning a promise in an event listener.\n *\n * A pushable source emits the following events:\n *\n * - `beforePush` - emitted prior to the processing of `push`, this event\n * includes the requested `Transform` as an argument.\n *\n * - `push` - emitted after a `push` has successfully been applied, this event's\n * arguments include both the requested `Transform` and an array of the actual\n * applied `Transform` instances.\n *\n * - `pushFail` - emitted when an error has occurred pushing a transform, this\n * event's arguments include both the requested `Transform` and the error.\n *\n * A pushable source must implement a private method `_push`, which performs\n * the processing required for `push` and returns a promise that resolves to an\n * array of `Transform` instances.\n */\nexport function pushable(Klass: unknown): void {\n  let proto = (Klass as SourceClass).prototype;\n\n  if (isPushable(proto)) {\n    return;\n  }\n\n  assert(\n    'Pushable interface can only be applied to a Source',\n    proto instanceof Source\n  );\n\n  proto[PUSHABLE] = true;\n\n  proto.push = async function <RO extends RequestOptions>(\n    transformOrOperations: TransformOrOperations<Operation, unknown>,\n    options?: RO,\n    id?: string\n  ): Promise<unknown> {\n    deprecate(\n      \"'push' has been deprecated. Please use 'update' instead and specify '{ fullResponse: true }' to access the resultant 'transforms'.\"\n    );\n\n    await this.activated;\n    const transform = buildTransform(\n      transformOrOperations,\n      options,\n      id,\n      this.transformBuilder\n    );\n\n    if (this.transformLog.contains(transform.id)) {\n      const transforms: Transform<Operation>[] = [];\n      const response = options?.fullResponse ? { transforms } : transforms;\n      return response;\n    } else {\n      const response = await this._requestQueue.push({\n        type: 'push',\n        data: transform\n      });\n      return options?.fullResponse ? response : response.transforms || [];\n    }\n  };\n\n  proto.__push__ = async function (\n    transform: Transform<Operation>\n  ): Promise<FullResponse<unknown, unknown, Operation>> {\n    if (this.transformLog.contains(transform.id)) {\n      return { transforms: [] };\n    }\n\n    try {\n      const hints: ResponseHints<unknown, unknown> = {};\n      const otherResponses = (await fulfillInSeries(\n        this,\n        'beforePush',\n        transform,\n        hints\n      )) as (NamedFullResponse<unknown, unknown, Operation> | undefined)[];\n      const fullResponse = await this._push(transform, hints);\n      if (otherResponses.length > 0) {\n        fullResponse.sources = mapNamedFullResponses(otherResponses);\n      }\n      if (fullResponse.transforms?.length > 0) {\n        await this.transformed(fullResponse.transforms);\n      }\n      await settleInSeries(this, 'push', transform, fullResponse);\n      return fullResponse;\n    } catch (error) {\n      await settleInSeries(this, 'pushFail', transform, error);\n      throw error;\n    }\n  };\n}\n","import { fulfillInSeries, Orbit, settleInSeries } from '@orbit/core';\nimport { Operation } from '../operation';\nimport { buildQuery, Query, QueryOrExpressions } from '../query';\nimport { QueryExpression } from '../query-expression';\nimport { AsyncQueryable } from '../queryable';\nimport { RequestOptions } from '../request';\nimport {\n  FullResponse,\n  mapNamedFullResponses,\n  NamedFullResponse,\n  ResponseHints\n} from '../response';\nimport { Source, SourceClass } from '../source';\n\nconst { assert } = Orbit;\n\nconst QUERYABLE = '__queryable__';\n\n/**\n * Has a source been decorated as `@queryable`?\n */\nexport function isQueryable(source: Source): boolean {\n  return !!(source as { [QUERYABLE]?: boolean })[QUERYABLE];\n}\n\n/**\n * A source decorated as `@queryable` must also implement the `Queryable`\n * interface.\n */\nexport interface Queryable<\n  Data,\n  Details,\n  O extends Operation,\n  QE extends QueryExpression,\n  QueryBuilder,\n  Options extends RequestOptions = RequestOptions\n> extends AsyncQueryable<Data, Details, O, QE, QueryBuilder, Options> {\n  _query(\n    query: Query<QE>,\n    hints?: ResponseHints<Data, Details>\n  ): Promise<FullResponse<Data, Details, O>>;\n}\n\n/**\n * Marks a source as \"queryable\" and adds an implementation of the `Queryable`\n * interface.\n *\n * The `query` method is part of the \"request flow\" in Orbit. Requests trigger\n * events before and after processing of each request. Observers can delay the\n * resolution of a request by returning a promise in an event listener.\n *\n * The `Queryable` interface introduces the following events:\n *\n * - `beforeQuery` - emitted prior to the processing of `query`, this event\n * includes the requested `Query` as an argument.\n *\n * - `query` - emitted after a `query` has successfully returned, this event's\n * arguments include both the requested `Query` and the results.\n *\n * - `queryFail` - emitted when an error has occurred processing a query, this\n * event's arguments include both the requested `Query` and the error.\n *\n * A queryable source must implement a private method `_query`, which performs\n * the processing required for `query` and returns a promise that resolves to a\n * set of results.\n */\nexport function queryable(Klass: unknown): void {\n  let proto = (Klass as SourceClass).prototype;\n\n  if (isQueryable(proto)) {\n    return;\n  }\n\n  assert(\n    'Queryable interface can only be applied to a Source',\n    proto instanceof Source\n  );\n\n  (proto as any)[QUERYABLE] = true;\n\n  proto.query = async function (\n    queryOrExpressions: QueryOrExpressions<QueryExpression, unknown>,\n    options?: RequestOptions,\n    id?: string\n  ): Promise<unknown> {\n    await this.activated;\n    const query = buildQuery(\n      queryOrExpressions,\n      options,\n      id,\n      this.queryBuilder\n    );\n    const response = await this._requestQueue.push({\n      type: 'query',\n      data: query\n    });\n    return options?.fullResponse ? response : response.data;\n  };\n\n  proto.__query__ = async function (\n    query: Query<QueryExpression>\n  ): Promise<FullResponse<unknown, unknown, Operation>> {\n    try {\n      const hints: ResponseHints<unknown, unknown> = {};\n      const otherResponses = (await fulfillInSeries(\n        this,\n        'beforeQuery',\n        query,\n        hints\n      )) as (NamedFullResponse<unknown, unknown, Operation> | undefined)[];\n      const fullResponse = await this._query(query, hints);\n      if (otherResponses.length > 0) {\n        fullResponse.sources = mapNamedFullResponses(otherResponses);\n      }\n      if (fullResponse.transforms?.length > 0) {\n        await this.transformed(fullResponse.transforms);\n      }\n      await settleInSeries(this, 'query', query, fullResponse);\n      return fullResponse;\n    } catch (error) {\n      await settleInSeries(this, 'queryFail', query, error);\n      throw error;\n    }\n  };\n}\n","import { Orbit, fulfillInSeries, settleInSeries } from '@orbit/core';\nimport { Operation } from '../operation';\nimport { Source, SourceClass } from '../source';\nimport { buildTransform, Transform, TransformBuilderFunc } from '../transform';\n\nconst { assert } = Orbit;\n\nconst SYNCABLE = '__syncable__';\n\n/**\n * Has a source been decorated as `@syncable`?\n */\nexport function isSyncable(source: Source): boolean {\n  return !!(source as { [SYNCABLE]?: boolean })[SYNCABLE];\n}\n\n/**\n * A source decorated as `@syncable` must also implement the `Syncable`\n * interface.\n */\n\nexport interface Syncable<O extends Operation, TransformBuilder> {\n  /**\n   * The `sync` method to a source. This method accepts a `Transform` or array\n   * of `Transform`s as an argument and applies it to the source.\n   */\n  sync(\n    transformOrTransforms:\n      | Transform<O>\n      | Transform<O>[]\n      | TransformBuilderFunc<O, TransformBuilder>\n  ): Promise<void>;\n\n  _sync(transform: Transform<O>): Promise<void>;\n}\n\n/**\n * Marks a source as \"syncable\" and adds an implementation of the `Syncable`\n * interface.\n *\n * The `sync` method is part of the \"sync flow\" in Orbit. This flow is used to\n * synchronize the contents of sources.\n *\n * Other sources can participate in the resolution of a `sync` by observing the\n * `transform` event, which is emitted whenever a new `Transform` is applied to\n * a source.\n */\nexport function syncable(Klass: unknown): void {\n  let proto = (Klass as SourceClass).prototype;\n\n  if (isSyncable(proto)) {\n    return;\n  }\n\n  assert(\n    'Syncable interface can only be applied to a Source',\n    proto instanceof Source\n  );\n\n  proto[SYNCABLE] = true;\n\n  proto.sync = async function (\n    transformOrTransforms:\n      | Transform<Operation>\n      | Transform<Operation>[]\n      | TransformBuilderFunc<Operation, unknown>\n  ): Promise<void> {\n    await this.activated;\n\n    if (Array.isArray(transformOrTransforms)) {\n      const transforms = transformOrTransforms as Transform<Operation>[];\n\n      for (let transform of transforms) {\n        await this.sync(transform);\n      }\n    } else {\n      let transform;\n\n      if (typeof transformOrTransforms === 'function') {\n        transform = buildTransform(\n          transformOrTransforms,\n          undefined,\n          undefined,\n          this.transformBuilder\n        );\n      } else {\n        transform = transformOrTransforms as Transform<Operation>;\n\n        if (this.transformLog.contains(transform.id)) {\n          return;\n        }\n      }\n\n      return this._syncQueue.push({\n        type: 'sync',\n        data: transform\n      });\n    }\n  };\n\n  proto.__sync__ = async function (\n    transform: Transform<Operation>\n  ): Promise<void> {\n    if (this.transformLog.contains(transform.id)) {\n      return;\n    }\n\n    try {\n      await fulfillInSeries(this, 'beforeSync', transform);\n      await this._sync(transform);\n      await this.transformed([transform]);\n      await settleInSeries(this, 'sync', transform);\n    } catch (error) {\n      await settleInSeries(this, 'syncFail', transform, error);\n      throw error;\n    }\n  };\n}\n","import { Orbit, fulfillInSeries, settleInSeries } from '@orbit/core';\nimport { Source, SourceClass } from '../source';\nimport { Transform, TransformOrOperations, buildTransform } from '../transform';\nimport { RequestOptions } from '../request';\nimport {\n  NamedFullResponse,\n  ResponseHints,\n  FullResponse,\n  mapNamedFullResponses\n} from '../response';\nimport { Operation } from '../operation';\nimport { AsyncUpdatable } from '../updatable';\n\nconst { assert } = Orbit;\n\nconst UPDATABLE = '__updatable__';\n\n/**\n * Has a source been decorated as `@updatable`?\n */\nexport function isUpdatable(source: Source): boolean {\n  return !!(source as { [UPDATABLE]?: boolean })[UPDATABLE];\n}\n\n/**\n * A source decorated as `@updatable` must also implement the `Updatable`\n * interface.\n */\nexport interface Updatable<\n  Data,\n  Details,\n  O extends Operation,\n  TransformBuilder,\n  Options extends RequestOptions = RequestOptions\n> extends AsyncUpdatable<Data, Details, O, TransformBuilder, Options> {\n  _update(\n    transform: Transform<O>,\n    hints?: ResponseHints<Data, Details>\n  ): Promise<FullResponse<Data, Details, O>>;\n}\n\n/**\n * Marks a source as \"updatable\" and adds an implementation of the `Updatable`\n * interface.\n *\n * The `update` method is part of the \"request flow\" in Orbit. Requests trigger\n * events before and after processing of each request. Observers can delay the\n * resolution of a request by returning a promise in an event listener.\n *\n * An updatable source emits the following events:\n *\n * - `beforeUpdate` - emitted prior to the processing of `update`, this event\n * includes the requested `Transform` as an argument.\n *\n * - `update` - emitted after an `update` has successfully been applied, this\n * event includes the requested `Transform` as an argument.\n *\n * - `updateFail` - emitted when an error has occurred applying an update, this\n * event's arguments include both the requested `Transform` and the error.\n *\n * An updatable source must implement a private method `_update`, which performs\n * the processing required for `update` and returns a promise that resolves when\n * complete.\n */\nexport function updatable(Klass: unknown): void {\n  let proto = (Klass as SourceClass).prototype;\n\n  if (isUpdatable(proto)) {\n    return;\n  }\n\n  assert(\n    'Updatable interface can only be applied to a Source',\n    proto instanceof Source\n  );\n\n  proto[UPDATABLE] = true;\n\n  proto.update = async function (\n    transformOrOperations: TransformOrOperations<Operation, unknown>,\n    options?: RequestOptions,\n    id?: string\n  ): Promise<unknown> {\n    await this.activated;\n    const transform = buildTransform(\n      transformOrOperations,\n      options,\n      id,\n      this.transformBuilder\n    );\n\n    if (this.transformLog.contains(transform.id)) {\n      return options?.fullResponse ? { transforms: [] } : undefined;\n    } else {\n      const response = await this._requestQueue.push({\n        type: 'update',\n        data: transform\n      });\n      return options?.fullResponse ? response : response.data;\n    }\n  };\n\n  proto.__update__ = async function (\n    transform: Transform<Operation>\n  ): Promise<FullResponse<unknown, unknown, Operation>> {\n    if (this.transformLog.contains(transform.id)) {\n      return { transforms: [] };\n    }\n\n    try {\n      const hints: ResponseHints<unknown, unknown> = {};\n      const otherResponses = (await fulfillInSeries(\n        this,\n        'beforeUpdate',\n        transform,\n        hints\n      )) as (NamedFullResponse<unknown, unknown, Operation> | undefined)[];\n      const fullResponse = await this._update(transform, hints);\n      if (otherResponses.length > 0) {\n        fullResponse.sources = mapNamedFullResponses(otherResponses);\n      }\n      if (fullResponse.transforms?.length > 0) {\n        await this.transformed(fullResponse.transforms);\n      }\n      await settleInSeries(this, 'update', transform, fullResponse);\n      return fullResponse;\n    } catch (error) {\n      await settleInSeries(this, 'updateFail', transform, error);\n      throw error;\n    }\n  };\n}\n","import { IdentitySerializer } from './identity-serializer';\n\nexport interface IdentityMapSettings<Identity> {\n  serializer: IdentitySerializer<Identity>;\n}\n\nexport class IdentityMap<Identity, Model> implements Map<Identity, Model> {\n  protected _serializer: IdentitySerializer<Identity>;\n  protected _map: Map<string, Model>;\n\n  constructor(settings: IdentityMapSettings<Identity>) {\n    this._serializer = settings.serializer;\n    this._map = new Map();\n  }\n\n  get(identity: Identity): Model | undefined {\n    const identifier = this._serializer.serialize(identity);\n    if (identifier !== undefined) {\n      return this._map.get(identifier);\n    }\n  }\n\n  set(identity: Identity, record: Model): this {\n    const identifier = this._serializer.serialize(identity);\n    if (identifier !== undefined) {\n      this._map.set(identifier, record);\n    }\n    return this;\n  }\n\n  has(identity: Identity): boolean {\n    const identifier = this._serializer.serialize(identity);\n    if (identifier !== undefined) {\n      return this._map.has(identifier);\n    } else {\n      return false;\n    }\n  }\n\n  delete(identity: Identity): boolean {\n    const identifier = this._serializer.serialize(identity);\n    const result = this._map.has(identifier);\n    if (result) {\n      this._map.delete(identifier);\n    }\n    return result;\n  }\n\n  entries(): IterableIterator<[Identity, Model]> {\n    return Array.from(this._map)\n      .map(([identifier, record]): [Identity, Model] => [\n        this._serializer.deserialize(identifier),\n        record\n      ])\n      [Symbol.iterator]();\n  }\n\n  keys(): IterableIterator<Identity> {\n    return Array.from(this)\n      .map(([identity]) => identity)\n      [Symbol.iterator]();\n  }\n\n  values(): IterableIterator<Model> {\n    return this._map.values();\n  }\n\n  [Symbol.iterator](): IterableIterator<[Identity, Model]> {\n    return this.entries();\n  }\n\n  clear(): void {\n    this._map.clear();\n  }\n\n  forEach(\n    callbackFn: (\n      record: Model,\n      identity: Identity,\n      map: IdentityMap<Identity, Model>\n    ) => void,\n    thisArg?: unknown\n  ): void {\n    for (let [identity, record] of this) {\n      callbackFn.call(thisArg, record, identity, this);\n    }\n  }\n\n  get size(): number {\n    return this._map.size;\n  }\n\n  get [Symbol.toStringTag](): string {\n    return 'IdentityMap';\n  }\n}\n","import { Exception } from '@orbit/core';\n\n/**\n * A client-side error occurred while communicating with a remote server.\n */\nexport class ClientError extends Exception {\n  public data?: unknown;\n  public response?: Response;\n\n  constructor(description: string) {\n    super(`Client error: ${description}`);\n  }\n}\n\n/**\n * A server-side error occurred while communicating with a remote server.\n */\nexport class ServerError extends Exception {\n  public data?: unknown;\n  public response?: Response;\n\n  constructor(description: string) {\n    super(`Server error: ${description}`);\n  }\n}\n\n/**\n * A network error occurred while attempting to communicate with a remote\n * server.\n */\nexport class NetworkError extends Exception {\n  constructor(description: string) {\n    super(`Network error: ${description}`);\n  }\n}\n\nexport class InvalidServerResponse extends Exception {\n  public response: string;\n\n  constructor(response: string) {\n    super(`Invalid server response: ${response}`);\n    this.response = response;\n  }\n}\n","export enum JSONAPISerializers {\n  Resource = 'resource',\n  ResourceField = 'resourceField',\n  ResourceIdentity = 'resourceIdentity',\n  ResourceType = 'resourceType',\n  ResourceDocument = 'resourceDocument',\n  ResourceTypeParam = 'resourceTypeParam',\n  ResourceTypePath = 'resourceTypePath',\n  ResourceFieldParam = 'resourceFieldParam',\n  ResourceFieldPath = 'resourceFieldPath',\n  ResourceAtomicOperation = 'resourceAtomicOperation',\n  ResourceAtomicOperationsDocument = 'resourceAtomicOperationsDocument',\n  ResourceAtomicResultsDocument = 'resourceAtomicResultsDocument'\n}\n","import { Dict } from '@orbit/utils';\n\ninterface RawParam {\n  path: string[];\n  val: any;\n}\n\nexport interface Param {\n  path: string;\n  val: string;\n}\n\nfunction flattenObjectToParams(obj: any, path: string[] = []): RawParam[] {\n  let params: RawParam[] = [];\n\n  Object.keys(obj).forEach((key) => {\n    if (!obj.hasOwnProperty(key)) {\n      return;\n    }\n\n    let newPath = path.slice();\n    newPath.push(key);\n\n    if (obj[key] !== null && typeof obj[key] === 'object') {\n      Array.prototype.push.apply(\n        params,\n        flattenObjectToParams(obj[key], newPath)\n      );\n    } else {\n      params.push({\n        path: newPath,\n        val: obj[key]\n      });\n    }\n  });\n\n  return params;\n}\n\nexport function encodeQueryParams(obj: Dict<any>): string {\n  return flattenObjectToParams(obj)\n    .map((rawParam) => {\n      let path: string;\n      let val = rawParam.val;\n\n      if (val === null) {\n        val = 'null';\n      }\n\n      if (rawParam.path.length === 1) {\n        path = rawParam.path[0];\n      } else {\n        let firstSegment = rawParam.path[0];\n        let remainingSegments = rawParam.path.slice(1);\n        path = firstSegment + '[' + remainingSegments.join('][') + ']';\n      }\n      return { path, val };\n    })\n    .map(\n      (param) =>\n        encodeURIComponent(param.path) + '=' + encodeURIComponent(param.val)\n    )\n    .join('&');\n}\n\nexport function appendQueryParams(url: string, obj: Dict<string>): string {\n  let fullUrl = url;\n\n  if (obj.filter && Array.isArray(obj.filter)) {\n    let filter = obj.filter;\n    delete obj.filter;\n\n    filter.forEach((filterOption: any) => {\n      fullUrl = appendQueryParams(fullUrl, { filter: filterOption });\n    });\n  }\n\n  let queryParams = encodeQueryParams(obj);\n  if (queryParams.length > 0) {\n    fullUrl += nextQueryParamIndicator(fullUrl);\n    fullUrl += queryParams;\n  }\n  return fullUrl;\n}\n\nfunction nextQueryParamIndicator(url: string): string {\n  if (url.indexOf('?') === -1) {\n    return '?';\n  }\n\n  return '&';\n}\n","import { Orbit } from '@orbit/core';\nimport { QueryExpressionParseError } from '@orbit/data';\nimport {\n  AttributeFilterSpecifier,\n  AttributeSortSpecifier,\n  FilterSpecifier,\n  RecordKeyMap,\n  PageSpecifier,\n  RelatedRecordFilterSpecifier,\n  RelatedRecordsFilterSpecifier,\n  SortSpecifier\n} from '@orbit/records';\nimport { clone, Dict } from '@orbit/utils';\nimport { JSONAPISerializer } from './jsonapi-serializer';\nimport { appendQueryParams } from './lib/query-params';\nimport { SerializerForFn, StringSerializer } from '@orbit/serializers';\nimport { JSONAPISerializers } from './serializers/jsonapi-serializers';\nimport { ResourceIdentity } from './resource-document';\nimport { JSONAPIResourceIdentitySerializer } from './serializers/jsonapi-resource-identity-serializer';\nimport { JSONAPIResourceFieldSerializer } from './serializers/jsonapi-resource-field-serializer';\nimport { RecordQueryRequest } from './lib/query-requests';\nimport { RecordTransformRequest } from './lib/transform-requests';\n\nconst { deprecate } = Orbit;\n\nexport interface JSONAPIURLBuilderSettings {\n  host?: string;\n  namespace?: string;\n  serializer?: JSONAPISerializer;\n  serializerFor: SerializerForFn;\n  keyMap?: RecordKeyMap;\n}\n\nexport class JSONAPIURLBuilder {\n  host?: string;\n  namespace?: string;\n  serializerFor: SerializerForFn;\n  serializer?: JSONAPISerializer;\n  keyMap?: RecordKeyMap;\n\n  constructor(settings: JSONAPIURLBuilderSettings) {\n    this.host = settings.host;\n    this.namespace = settings.namespace;\n    this.serializerFor = settings.serializerFor;\n    if (settings.serializer) {\n      this.serializer = settings.serializer;\n      deprecate(\n        \"The 'serializer' setting for 'JSONAPIURLBuilder' has been deprecated. Pass 'serializerFor' instead.\"\n      );\n    }\n    this.keyMap = settings.keyMap;\n  }\n\n  /* eslint-disable-next-line @typescript-eslint/no-unused-vars */\n  resourceNamespace(type?: string): string | undefined {\n    return this.namespace;\n  }\n\n  /* eslint-disable-next-line @typescript-eslint/no-unused-vars */\n  resourceHost(type?: string): string | undefined {\n    return this.host;\n  }\n\n  resourceURL(type: string, id?: string): string {\n    let host = this.resourceHost(type);\n    let namespace = this.resourceNamespace(type);\n    let url: string[] = [];\n\n    if (host) {\n      url.push(host);\n    }\n    if (namespace) {\n      url.push(namespace);\n    }\n    url.push(this.resourcePath(type, id));\n\n    if (!host) {\n      url.unshift('');\n    }\n\n    return url.join('/');\n  }\n\n  resourcePath(type: string, id?: string): string {\n    let resourceType, resourceId;\n    if (this.serializer) {\n      resourceType = this.serializer.resourceType(type);\n      if (id) {\n        resourceId = this.serializer.resourceId(type, id);\n      }\n    } else {\n      const resourceTypeSerializer = this.serializerFor(\n        JSONAPISerializers.ResourceTypePath\n      ) as StringSerializer;\n      resourceType = resourceTypeSerializer.serialize(type);\n      if (id) {\n        const resourceIdentitySerializer = this.serializerFor(\n          JSONAPISerializers.ResourceIdentity\n        ) as JSONAPIResourceIdentitySerializer;\n        const identity = resourceIdentitySerializer.serialize({\n          type,\n          id\n        }) as ResourceIdentity;\n        resourceId = identity.id;\n      }\n    }\n\n    let path = [resourceType];\n    if (resourceId) {\n      path.push(resourceId);\n    }\n    return path.join('/');\n  }\n\n  resourceRelationshipURL(\n    type: string,\n    id: string,\n    relationship: string\n  ): string {\n    return [\n      this.resourceURL(type, id),\n      'relationships',\n      this.serializeRelationshipInPath(type, relationship)\n    ].join('/');\n  }\n\n  relatedResourceURL(type: string, id: string, relationship: string): string {\n    return [\n      this.resourceURL(type, id),\n      this.serializeRelationshipInPath(type, relationship)\n    ].join('/');\n  }\n\n  buildFilterParam(\n    filters: FilterSpecifier[] | Dict<unknown | unknown[]>,\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    request?: RecordQueryRequest | RecordTransformRequest\n  ): Dict<unknown>[] {\n    const params: Dict<unknown>[] = [];\n\n    if (Array.isArray(filters)) {\n      for (let filterSpecifier of filters) {\n        if (\n          filterSpecifier.kind === 'attribute' &&\n          filterSpecifier.op === 'equal'\n        ) {\n          const attributeFilter = filterSpecifier as AttributeFilterSpecifier;\n          const field = this.serializeFieldParam(attributeFilter.attribute, {\n            kind: 'attribute'\n          });\n          params.push({\n            [field]: attributeFilter.value ?? null\n          });\n        } else if (filterSpecifier.kind === 'relatedRecord') {\n          const relatedRecordFilter = filterSpecifier as RelatedRecordFilterSpecifier;\n          if (relatedRecordFilter.op !== 'equal') {\n            throw new QueryExpressionParseError(\n              `Filter operation '${relatedRecordFilter.op}' not recognized by JSONAPIURLBuilder#buildFilterParam for relatedRecord filtering. Override this method to provide a custom handler.`\n            );\n          }\n          const field = this.serializeFieldParam(relatedRecordFilter.relation, {\n            kind: 'relationship'\n          });\n          if (Array.isArray(relatedRecordFilter.record)) {\n            params.push({\n              [field]: relatedRecordFilter.record\n                .map((e) => e?.id ?? null)\n                .join(',')\n            });\n          } else {\n            params.push({\n              [field]: relatedRecordFilter?.record?.id ?? null\n            });\n          }\n        } else if (filterSpecifier.kind === 'relatedRecords') {\n          const relatedRecordsFilter = filterSpecifier as RelatedRecordsFilterSpecifier;\n          if (relatedRecordsFilter.op !== 'equal') {\n            throw new QueryExpressionParseError(\n              `Filter operation '${relatedRecordsFilter.op}' not recognized by JSONAPIURLBuilder#buildFilterParam for relatedRecords filtering. Override this method to provide a custom handler.`\n            );\n          }\n          const field = this.serializeFieldParam(\n            relatedRecordsFilter.relation,\n            { kind: 'relationship' }\n          );\n          params.push({\n            [field]: relatedRecordsFilter.records\n              .map((e) => e?.id ?? null)\n              .join(',')\n          });\n        } else {\n          throw new QueryExpressionParseError(\n            `Filter operation '${filterSpecifier.op}' not recognized by JSONAPIURLBuilder#buildFilterParam. Override this method to provide a custom handler.`\n          );\n        }\n      }\n    } else {\n      for (let key in filters) {\n        const value = filters[key];\n        const fieldParam = this.serializeFieldParam(key);\n\n        if (Array.isArray(value)) {\n          for (let v of value) {\n            params.push({ [fieldParam]: v });\n          }\n        } else {\n          params.push({ [fieldParam]: value });\n        }\n      }\n    }\n\n    return params;\n  }\n\n  buildSortParam(\n    sortSpecifiers: (SortSpecifier | string)[] | string,\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    request?: RecordQueryRequest | RecordTransformRequest\n  ): string {\n    if (Array.isArray(sortSpecifiers)) {\n      return sortSpecifiers\n        .map((sortSpecifier) => {\n          let descending;\n          let fieldName;\n          if (typeof sortSpecifier === 'string') {\n            descending = sortSpecifier.charAt(0) === '-';\n            fieldName = descending ? sortSpecifier.substring(1) : sortSpecifier;\n          } else if (sortSpecifier.kind === 'attribute') {\n            const attributeSort = sortSpecifier as AttributeSortSpecifier;\n            descending = attributeSort.order === 'descending';\n            fieldName = attributeSort.attribute;\n          }\n\n          if (fieldName) {\n            const field = this.serializeFieldParam(fieldName, {\n              kind: 'attribute'\n            });\n            return `${descending ? '-' : ''}${field}`;\n          }\n        })\n        .join(',');\n    } else if (typeof sortSpecifiers === 'string') {\n      return sortSpecifiers;\n    }\n\n    throw new QueryExpressionParseError(\n      `Sort specifier not recognized for JSONAPISource.`\n    );\n  }\n\n  buildPageParam(\n    pageSpecifier: PageSpecifier,\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    request?: RecordQueryRequest | RecordTransformRequest\n  ): Dict<unknown> {\n    let pageParam = clone(pageSpecifier);\n    delete pageParam.kind;\n    return pageParam;\n  }\n\n  buildIncludeParam(\n    includeSpecifier: string | string[] | string[][],\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    request?: RecordQueryRequest | RecordTransformRequest\n  ): string {\n    if (Array.isArray(includeSpecifier)) {\n      return includeSpecifier\n        .map((s) => {\n          const paths = Array.isArray(s) ? s : s.split('.');\n          return paths\n            .map((p) => this.serializeFieldParam(p, { kind: 'relationship' }))\n            .join('.');\n        })\n        .join(',');\n    } else {\n      return includeSpecifier;\n    }\n  }\n\n  buildFieldsParam(\n    fieldsSpecifier: Dict<string | string[]>,\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    request?: RecordQueryRequest | RecordTransformRequest\n  ): Dict<string> {\n    const params: Dict<string> = {};\n\n    for (let type in fieldsSpecifier) {\n      const value = fieldsSpecifier[type];\n\n      const serializer = this.serializerFor(\n        JSONAPISerializers.ResourceTypeParam\n      ) as StringSerializer;\n      const typeParam = serializer.serialize(type);\n\n      const fields = Array.isArray(value) ? value : value.split(',');\n      params[typeParam] = fields\n        .map((f: string) => this.serializeFieldParam(f))\n        .join(',');\n    }\n\n    return params;\n  }\n\n  appendQueryParams(url: string, params: Dict<string>): string {\n    let fullUrl = url;\n    if (params) {\n      fullUrl = appendQueryParams(fullUrl, params);\n    }\n    return fullUrl;\n  }\n\n  protected serializeFieldParam(\n    field: string,\n    options?: {\n      type?: string;\n      // TODO: remove kind param when deprecated serializer is removed\n      kind?: 'attribute' | 'relationship';\n    }\n  ): string {\n    if (this.serializer) {\n      if (options?.kind === 'attribute') {\n        return this.serializer.resourceAttribute(options?.type, field);\n      } else if (options?.kind === 'relationship') {\n        return this.serializer.resourceRelationship(options?.type, field);\n      } else {\n        return field;\n      }\n    } else {\n      const serializer = this.serializerFor(\n        JSONAPISerializers.ResourceFieldParam\n      ) as JSONAPIResourceFieldSerializer;\n      return serializer.serialize(field, { type: options?.type }) as string;\n    }\n  }\n\n  protected serializeRelationshipInPath(\n    type: string | undefined,\n    relationship: string\n  ): string {\n    if (this.serializer) {\n      return this.serializer.resourceRelationship(type, relationship);\n    } else {\n      const serializer = this.serializerFor(\n        JSONAPISerializers.ResourceFieldPath\n      ) as JSONAPIResourceFieldSerializer;\n      return serializer.serialize(relationship, { type }) as string;\n    }\n  }\n}\n","import { RecordSchema, RecordKeyMap } from '@orbit/records';\nimport {\n  BaseSerializer,\n  SerializerForFn,\n  StringSerializer\n} from '@orbit/serializers';\nimport { JSONAPIResourceIdentitySerializer } from './jsonapi-resource-identity-serializer';\nimport { JSONAPIResourceSerializer } from './jsonapi-resource-serializer';\nimport { JSONAPISerializers } from './jsonapi-serializers';\nimport { JSONAPIAtomicOperationSerializer } from './jsonapi-atomic-operation-serializer';\nimport { JSONAPIResourceFieldSerializer } from './jsonapi-resource-field-serializer';\nimport { JSONAPIAtomicOperationsDocumentSerializer } from './jsonapi-atomic-operations-document-serializer';\nimport { JSONAPIAtomicResultsDocumentSerializer } from './jsonapi-atomic-results-document-serializer';\nimport { JSONAPIDocumentSerializer } from './jsonapi-document-serializer';\n\nexport abstract class JSONAPIBaseSerializer<\n  From,\n  To,\n  SerializationOptions,\n  DeserializationOptions\n> extends BaseSerializer<\n  From,\n  To,\n  SerializationOptions,\n  DeserializationOptions\n> {\n  serializerFor!: SerializerForFn;\n  protected _schema: RecordSchema;\n  protected _keyMap?: RecordKeyMap;\n\n  constructor(settings: {\n    serializerFor: SerializerForFn;\n    serializationOptions?: SerializationOptions;\n    deserializationOptions?: DeserializationOptions;\n    schema: RecordSchema;\n    keyMap?: RecordKeyMap;\n  }) {\n    const {\n      serializerFor,\n      serializationOptions,\n      deserializationOptions,\n      schema,\n      keyMap\n    } = settings;\n    super({\n      serializerFor,\n      serializationOptions,\n      deserializationOptions\n    });\n    this._schema = schema;\n    this._keyMap = keyMap;\n  }\n\n  get schema(): RecordSchema {\n    return this._schema;\n  }\n\n  get keyMap(): RecordKeyMap | undefined {\n    return this._keyMap;\n  }\n\n  protected get resourceSerializer(): JSONAPIResourceSerializer {\n    return this.serializerFor(\n      JSONAPISerializers.Resource\n    ) as JSONAPIResourceSerializer;\n  }\n\n  protected get documentSerializer(): JSONAPIDocumentSerializer {\n    return this.serializerFor(\n      JSONAPISerializers.ResourceDocument\n    ) as JSONAPIDocumentSerializer;\n  }\n\n  protected get identitySerializer(): JSONAPIResourceIdentitySerializer {\n    return this.serializerFor(\n      JSONAPISerializers.ResourceIdentity\n    ) as JSONAPIResourceIdentitySerializer;\n  }\n\n  protected get typeSerializer(): StringSerializer {\n    return this.serializerFor(\n      JSONAPISerializers.ResourceType\n    ) as StringSerializer;\n  }\n\n  protected get fieldSerializer(): JSONAPIResourceFieldSerializer {\n    return this.serializerFor(\n      JSONAPISerializers.ResourceField\n    ) as JSONAPIResourceFieldSerializer;\n  }\n\n  protected get atomicOperationSerializer(): JSONAPIAtomicOperationSerializer {\n    return this.serializerFor(\n      JSONAPISerializers.ResourceAtomicOperation\n    ) as JSONAPIAtomicOperationSerializer;\n  }\n\n  protected get atomicOperationsDocumentSerializer(): JSONAPIAtomicOperationsDocumentSerializer {\n    return this.serializerFor(\n      JSONAPISerializers.ResourceAtomicOperationsDocument\n    ) as JSONAPIAtomicOperationsDocumentSerializer;\n  }\n\n  protected get atomicResultsDocumentSerializer(): JSONAPIAtomicResultsDocumentSerializer {\n    return this.serializerFor(\n      JSONAPISerializers.ResourceAtomicResultsDocument\n    ) as JSONAPIAtomicResultsDocumentSerializer;\n  }\n}\n","import {\n  RecordIdentity,\n  RecordOperation,\n  AddToRelatedRecordsOperation,\n  ReplaceRelatedRecordOperation,\n  ReplaceRelatedRecordsOperation,\n  UpdateRecordOperation,\n  RemoveFromRelatedRecordsOperation,\n  RemoveRecordOperation,\n  AddRecordOperation,\n  ReplaceAttributeOperation\n} from '@orbit/records';\nimport {\n  AddResourceAtomicOperation,\n  AddToRelatedResourcesAtomicOperation,\n  RemoveFromRelatedResourcesAtomicOperation,\n  RemoveResourceAtomicOperation,\n  ReplaceRelatedResourceAtomicOperation,\n  ReplaceRelatedResourcesAtomicOperation,\n  ResourceAtomicOperation,\n  UpdateResourceAtomicOperation\n} from '../resource-operations';\nimport { Resource, ResourceIdentity } from '../resource-document';\nimport { JSONAPIBaseSerializer } from './jsonapi-base-serializer';\n\nexport class JSONAPIAtomicOperationSerializer extends JSONAPIBaseSerializer<\n  RecordOperation,\n  ResourceAtomicOperation,\n  unknown,\n  unknown\n> {\n  serialize(operation: RecordOperation): ResourceAtomicOperation {\n    switch (operation.op) {\n      case 'addRecord':\n        return this.serializeAddRecordOperation(operation);\n      case 'updateRecord':\n        return this.serializeUpdateRecordOperation(operation);\n      case 'removeRecord':\n        return this.serializeRemoveRecordOperation(operation);\n      case 'addToRelatedRecords':\n        return this.serializeAddToRelatedRecordsOperation(operation);\n      case 'removeFromRelatedRecords':\n        return this.serializeRemoveFromRelatedRecordsOperation(operation);\n      case 'replaceRelatedRecord':\n        return this.serializeReplaceRelatedRecordOperation(operation);\n      case 'replaceRelatedRecords':\n        return this.serializeReplaceRelatedRecordsOperation(operation);\n      case 'replaceAttribute':\n        return this.serializeReplaceAttributeOperation(operation);\n      default:\n        throw new Error(\n          `JSONAPIOperationSerializer: Unrecognized operation ${operation.op}.`\n        );\n    }\n  }\n\n  deserialize(operation: ResourceAtomicOperation): RecordOperation {\n    if (isAddOperation(operation)) {\n      return this.deserializeAddOperation(operation);\n    } else if (isUpdateOperation(operation)) {\n      return this.deserializeUpdateOperation(operation);\n    } else if (isRemoveOperation(operation)) {\n      return this.deserializeRemoveOperation(operation);\n    } else {\n      throw new Error(\n        `JSONAPIOperationSerializer: Only \"add\", \"update\" and \"remove\" operations are supported at this time.`\n      );\n    }\n  }\n\n  protected serializeAddRecordOperation(\n    operation: AddRecordOperation\n  ): AddResourceAtomicOperation {\n    const ref = this.identitySerializer.serialize(operation.record);\n    return {\n      op: 'add',\n      ref,\n      data: this.resourceSerializer.serialize(operation.record)\n    };\n  }\n\n  protected serializeUpdateRecordOperation(\n    operation: UpdateRecordOperation\n  ): UpdateResourceAtomicOperation {\n    return {\n      op: 'update',\n      ref: this.identitySerializer.serialize(\n        operation.record\n      ) as ResourceIdentity,\n      data: this.resourceSerializer.serialize(operation.record)\n    };\n  }\n\n  protected serializeRemoveRecordOperation(\n    operation: RemoveRecordOperation\n  ): RemoveResourceAtomicOperation {\n    return {\n      op: 'remove',\n      ref: this.identitySerializer.serialize(\n        operation.record\n      ) as ResourceIdentity\n    };\n  }\n\n  protected serializeAddToRelatedRecordsOperation(\n    operation: AddToRelatedRecordsOperation\n  ): AddToRelatedResourcesAtomicOperation {\n    const ref = this.identitySerializer.serialize(\n      operation.record\n    ) as ResourceIdentity;\n    return {\n      op: 'add',\n      ref: { relationship: operation.relationship, ...ref },\n      data: this.identitySerializer.serialize(operation.relatedRecord)\n    };\n  }\n\n  protected serializeRemoveFromRelatedRecordsOperation(\n    operation: RemoveFromRelatedRecordsOperation\n  ): RemoveFromRelatedResourcesAtomicOperation {\n    const ref = this.identitySerializer.serialize(\n      operation.record\n    ) as ResourceIdentity;\n    return {\n      op: 'remove',\n      ref: { relationship: operation.relationship, ...ref },\n      data: this.identitySerializer.serialize(operation.relatedRecord)\n    };\n  }\n\n  protected serializeReplaceRelatedRecordsOperation(\n    operation: ReplaceRelatedRecordsOperation\n  ): ReplaceRelatedResourcesAtomicOperation {\n    const ref = this.identitySerializer.serialize(\n      operation.record\n    ) as ResourceIdentity;\n    return {\n      op: 'update',\n      ref: { relationship: operation.relationship, ...ref },\n      data: operation.relatedRecords.map((record) =>\n        this.identitySerializer.serialize(record)\n      )\n    };\n  }\n\n  protected serializeReplaceRelatedRecordOperation(\n    operation: ReplaceRelatedRecordOperation\n  ): ReplaceRelatedResourceAtomicOperation {\n    const ref = this.identitySerializer.serialize(\n      operation.record\n    ) as ResourceIdentity;\n    return {\n      op: 'update',\n      ref: { relationship: operation.relationship, ...ref },\n      data: operation.relatedRecord\n        ? this.identitySerializer.serialize(operation.relatedRecord)\n        : null\n    };\n  }\n\n  protected serializeReplaceAttributeOperation(\n    operation: ReplaceAttributeOperation\n  ): UpdateResourceAtomicOperation {\n    const record = {\n      id: operation.record.id,\n      type: operation.record.type,\n      attributes: {\n        [operation.attribute]: operation.value\n      }\n    };\n    const resource = this.resourceSerializer.deserialize(record);\n    const ref = {\n      id: resource.id,\n      type: resource.type\n    };\n\n    return {\n      op: 'update',\n      ref,\n      data: resource\n    };\n  }\n\n  protected deserializeAddOperation(\n    operation: AddResourceAtomicOperation | AddToRelatedResourcesAtomicOperation\n  ): AddRecordOperation | AddToRelatedRecordsOperation {\n    if (isRelatedResourceOperation(operation)) {\n      return {\n        op: 'addToRelatedRecords',\n        relationship: operation.ref.relationship,\n        record: this.identitySerializer.deserialize(operation.ref),\n        relatedRecord: this.identitySerializer.deserialize(\n          operation.data as RecordIdentity\n        )\n      };\n    } else {\n      return {\n        op: 'addRecord',\n        record: this.resourceSerializer.deserialize(operation.data)\n      };\n    }\n  }\n\n  protected deserializeUpdateOperation(\n    operation:\n      | UpdateResourceAtomicOperation\n      | ReplaceRelatedResourceAtomicOperation\n      | ReplaceRelatedResourcesAtomicOperation\n  ):\n    | ReplaceRelatedRecordOperation\n    | ReplaceRelatedRecordsOperation\n    | UpdateRecordOperation {\n    if (isRelatedResourceOperation(operation)) {\n      if (Array.isArray(operation.data)) {\n        return {\n          op: 'replaceRelatedRecords',\n          relationship: operation.ref.relationship,\n          record: this.identitySerializer.deserialize(operation.ref),\n          relatedRecords: (operation.data as RecordIdentity[]).map((record) =>\n            this.identitySerializer.deserialize(record)\n          )\n        };\n      } else {\n        return {\n          op: 'replaceRelatedRecord',\n          relationship: operation.ref.relationship,\n          record: this.identitySerializer.deserialize(operation.ref),\n          relatedRecord: operation.data\n            ? this.identitySerializer.deserialize(\n                operation.data as RecordIdentity\n              )\n            : null\n        };\n      }\n    } else {\n      return {\n        op: 'updateRecord',\n        record: this.resourceSerializer.deserialize(operation.data as Resource)\n      };\n    }\n  }\n\n  protected deserializeRemoveOperation(\n    operation:\n      | RemoveResourceAtomicOperation\n      | RemoveFromRelatedResourcesAtomicOperation\n  ): RemoveFromRelatedRecordsOperation | RemoveRecordOperation {\n    if (isRelatedResourceOperation(operation)) {\n      return {\n        op: 'removeFromRelatedRecords',\n        relationship: operation.ref.relationship,\n        record: this.identitySerializer.deserialize(operation.ref),\n        relatedRecord: this.identitySerializer.deserialize(\n          operation.data as RecordIdentity\n        )\n      };\n    } else {\n      return {\n        op: 'removeRecord',\n        record: this.identitySerializer.deserialize(operation.ref)\n      };\n    }\n  }\n}\n\nfunction isRelatedResourceOperation(\n  operation: ResourceAtomicOperation\n): operation is\n  | AddToRelatedResourcesAtomicOperation\n  | RemoveFromRelatedResourcesAtomicOperation\n  | ReplaceRelatedResourceAtomicOperation\n  | ReplaceRelatedResourcesAtomicOperation {\n  return !!operation.ref.relationship;\n}\n\nfunction isAddOperation(\n  operation: ResourceAtomicOperation\n): operation is\n  | AddResourceAtomicOperation\n  | AddToRelatedResourcesAtomicOperation {\n  return operation.op === 'add';\n}\n\nfunction isUpdateOperation(\n  operation: ResourceAtomicOperation\n): operation is\n  | UpdateResourceAtomicOperation\n  | ReplaceRelatedResourcesAtomicOperation\n  | ReplaceRelatedResourcesAtomicOperation {\n  return operation.op === 'update';\n}\n\nfunction isRemoveOperation(\n  operation: ResourceAtomicOperation\n): operation is\n  | RemoveResourceAtomicOperation\n  | RemoveFromRelatedResourcesAtomicOperation {\n  return operation.op === 'remove';\n}\n","import { deepSet } from '@orbit/utils';\nimport { Assertion, Orbit } from '@orbit/core';\nimport {\n  InitializedRecord,\n  RecordIdentity,\n  ModelDefinition\n} from '@orbit/records';\nimport { Resource, ResourceIdentity } from '../resource-document';\nimport { JSONAPIBaseSerializer } from './jsonapi-base-serializer';\nimport { JSONAPIResourceIdentityDeserializationOptions } from './jsonapi-resource-identity-serializer';\n\nconst { deprecate } = Orbit;\nexport class JSONAPIResourceSerializer extends JSONAPIBaseSerializer<\n  InitializedRecord,\n  Resource,\n  unknown,\n  JSONAPIResourceIdentityDeserializationOptions\n> {\n  serialize(record: InitializedRecord): Resource {\n    const resource: Resource = this.identitySerializer.serialize(record);\n    const model: ModelDefinition = this.schema.getModel(record.type);\n\n    this.serializeAttributes(resource, record, model);\n    this.serializeRelationships(resource, record, model);\n    this.serializeLinks(resource, record, model);\n    this.serializeMeta(resource, record, model);\n\n    return resource;\n  }\n\n  deserialize(\n    resource: Resource,\n    customOptions?: JSONAPIResourceIdentityDeserializationOptions\n  ): InitializedRecord {\n    const options = this.buildDeserializationOptions(customOptions);\n    options.includeKeys = true;\n    const record: InitializedRecord = this.identitySerializer.deserialize(\n      resource as ResourceIdentity,\n      options\n    );\n    const model: ModelDefinition = this.schema.getModel(record.type);\n\n    this.deserializeAttributes(record, resource, model);\n    this.deserializeRelationships(record, resource, model);\n    this.deserializeLinks(record, resource, model);\n    this.deserializeMeta(record, resource, model);\n\n    return record;\n  }\n\n  protected serializeAttributes(\n    resource: Resource,\n    record: InitializedRecord,\n    model: ModelDefinition\n  ): void {\n    if (record.attributes) {\n      for (let field of Object.keys(record.attributes)) {\n        this.serializeAttribute(resource, record, field, model);\n      }\n    }\n  }\n\n  protected serializeAttribute(\n    resource: Resource,\n    record: InitializedRecord,\n    field: string,\n    model: ModelDefinition\n  ): void {\n    const value = record.attributes?.[field];\n    if (value === undefined) {\n      return;\n    }\n\n    const fieldOptions = model.attributes?.[field];\n    if (fieldOptions === undefined) {\n      return;\n    }\n\n    let resValue: unknown;\n    if (value === null) {\n      resValue = null;\n    } else {\n      const type = fieldOptions.type ?? 'unknown';\n      const serializer = this.serializerFor(type);\n      if (serializer) {\n        const serializationOptions =\n          fieldOptions.serialization ??\n          (fieldOptions as any).serializationOptions;\n\n        if ((fieldOptions as any).serializationOptions !== undefined) {\n          // TODO: Remove in v0.18\n          deprecate(\n            `The attribute '${field}' for '${record.type}' has been assigned \\`serializationOptions\\` in the schema. Use \\`serialization\\` instead.`\n          );\n        }\n\n        resValue = serializer.serialize(value, serializationOptions);\n      } else {\n        throw new Assertion(\n          `Serializer could not be found for attribute type '${type}'`\n        );\n      }\n    }\n\n    const resField = this.fieldSerializer.serialize(field, {\n      type: record.type\n    }) as string;\n\n    deepSet(resource, ['attributes', resField], resValue);\n  }\n\n  protected serializeRelationships(\n    resource: Resource,\n    record: InitializedRecord,\n    model: ModelDefinition\n  ): void {\n    if (record.relationships) {\n      for (let field of Object.keys(record.relationships)) {\n        this.serializeRelationship(resource, record, field, model);\n      }\n    }\n  }\n\n  protected serializeRelationship(\n    resource: Resource,\n    record: InitializedRecord,\n    field: string,\n    model: ModelDefinition\n  ): void {\n    const value = record.relationships?.[field].data;\n\n    if (value === undefined) {\n      return;\n    }\n    if (model.relationships?.[field] === undefined) {\n      return;\n    }\n\n    let resValue;\n\n    if (value === null) {\n      resValue = null;\n    } else {\n      const identitySerializer = this.identitySerializer;\n\n      if (Array.isArray(value)) {\n        resValue = (value as RecordIdentity[]).map((identity) =>\n          identitySerializer.serialize(identity)\n        );\n      } else {\n        resValue = identitySerializer.serialize(value);\n      }\n    }\n\n    const resField = this.fieldSerializer.serialize(field, {\n      type: record.type\n    }) as string;\n\n    deepSet(resource, ['relationships', resField, 'data'], resValue);\n  }\n\n  /* eslint-disable @typescript-eslint/no-unused-vars */\n  protected serializeLinks(\n    resource: Resource,\n    record: InitializedRecord,\n    model: ModelDefinition\n  ): void {}\n\n  protected serializeMeta(\n    resource: Resource,\n    record: InitializedRecord,\n    model: ModelDefinition\n  ): void {}\n  /* eslint-enable @typescript-eslint/no-unused-vars */\n\n  protected deserializeAttributes(\n    record: InitializedRecord,\n    resource: Resource,\n    model: ModelDefinition\n  ): void {\n    if (resource.attributes) {\n      for (let resField of Object.keys(resource.attributes)) {\n        this.deserializeAttribute(record, resource, resField, model);\n      }\n    }\n  }\n\n  protected deserializeAttribute(\n    record: InitializedRecord,\n    resource: Resource,\n    resField: string,\n    model: ModelDefinition\n  ): void {\n    const resValue: any = resource.attributes?.[resField];\n    if (resValue === undefined) {\n      return;\n    }\n\n    const field = this.fieldSerializer.deserialize(resField, {\n      type: record.type\n    }) as string;\n\n    const fieldOptions = model.attributes?.[field];\n    if (fieldOptions === undefined) {\n      return;\n    }\n\n    let value: unknown;\n    if (resValue === null) {\n      value = null;\n    } else {\n      const type = fieldOptions.type || 'unknown';\n      const serializer = this.serializerFor(type);\n      if (serializer) {\n        const deserializationOptions =\n          fieldOptions.deserialization ??\n          (fieldOptions as any).deserializationOptions;\n\n        if ((fieldOptions as any).deserializationOptions !== undefined) {\n          // TODO: Remove in v0.18\n          deprecate(\n            `The attribute '${field}' for '${record.type}' has been assigned \\`deserializationOptions\\` in the schema. Use \\`deserialization\\` instead.`\n          );\n        }\n\n        value = serializer.deserialize(resValue, deserializationOptions);\n      } else {\n        throw new Assertion(\n          `Serializer could not be found for attribute type '${type}'`\n        );\n      }\n    }\n\n    deepSet(record, ['attributes', field], value);\n  }\n\n  protected deserializeRelationships(\n    record: InitializedRecord,\n    resource: Resource,\n    model: ModelDefinition\n  ): void {\n    if (resource.relationships) {\n      for (let resField of Object.keys(resource.relationships)) {\n        this.deserializeRelationship(record, resource, resField, model);\n      }\n    }\n  }\n\n  protected deserializeRelationship(\n    record: InitializedRecord,\n    resource: Resource,\n    resField: string,\n    model: ModelDefinition\n  ): void {\n    const resValue: any = resource.relationships?.[resField];\n    if (!resValue) {\n      return;\n    }\n\n    const field = this.fieldSerializer.deserialize(resField, {\n      type: record.type\n    }) as string;\n\n    const fieldOptions = model.relationships?.[field];\n    if (fieldOptions === undefined) {\n      return;\n    }\n\n    let resData = resValue.data;\n\n    if (resData !== undefined) {\n      let data;\n\n      if (resData === null) {\n        data = null;\n      } else {\n        const identitySerializer = this.identitySerializer;\n\n        if (Array.isArray(resData)) {\n          data = (resData as ResourceIdentity[]).map((resourceIdentity) =>\n            identitySerializer.deserialize(resourceIdentity)\n          );\n        } else {\n          data = identitySerializer.deserialize(resData as ResourceIdentity);\n        }\n      }\n\n      deepSet(record, ['relationships', field, 'data'], data);\n    }\n\n    let { links, meta } = resValue;\n\n    if (links !== undefined) {\n      deepSet(record, ['relationships', field, 'links'], links);\n    }\n\n    if (meta !== undefined) {\n      deepSet(record, ['relationships', field, 'meta'], meta);\n    }\n  }\n\n  protected deserializeLinks(\n    record: InitializedRecord,\n    resource: Resource,\n    /* eslint-disable-next-line @typescript-eslint/no-unused-vars */\n    model: ModelDefinition\n  ): void {\n    if (resource.links) {\n      record.links = resource.links;\n    }\n  }\n\n  protected deserializeMeta(\n    record: InitializedRecord,\n    resource: Resource,\n    /* eslint-disable-next-line @typescript-eslint/no-unused-vars */\n    model: ModelDefinition\n  ): void {\n    if (resource.meta) {\n      record.meta = resource.meta;\n    }\n  }\n}\n","import { Orbit, Assertion } from '@orbit/core';\nimport { InitializedRecord, RecordSchema, RecordKeyMap } from '@orbit/records';\nimport { Dict } from '@orbit/utils';\nimport { Resource } from '../resource-document';\nimport { JSONAPIBaseSerializer } from './jsonapi-base-serializer';\nimport { SerializerForFn } from '@orbit/serializers';\n\nconst { assert } = Orbit;\n\nexport interface JSONAPIResourceIdentityDeserializationOptions {\n  primaryRecord?: InitializedRecord;\n  includeKeys?: boolean;\n}\n\nexport interface JSONAPIResourceIdentitySerializerSettings {\n  serializerFor: SerializerForFn;\n  deserializationOptions?: JSONAPIResourceIdentityDeserializationOptions;\n  schema: RecordSchema;\n  keyMap?: RecordKeyMap;\n  getResourceKey?: (recordType: string) => string;\n}\n\nexport class JSONAPIResourceIdentitySerializer extends JSONAPIBaseSerializer<\n  InitializedRecord,\n  Resource,\n  unknown,\n  JSONAPIResourceIdentityDeserializationOptions\n> {\n  protected _resourceKeys: Dict<string>;\n  protected _getCustomResourceKey?: (recordType: string) => string;\n\n  getResourceKey(type: string): string {\n    let key = this._resourceKeys[type];\n    if (key === undefined) {\n      if (this._getCustomResourceKey) {\n        key = this._getCustomResourceKey(type);\n      }\n\n      if (key === undefined) {\n        const model = this.schema.getModel(type);\n        if (model?.keys) {\n          let availableKeys = Object.keys(model.keys);\n          if (availableKeys.length === 1) {\n            key = availableKeys[0];\n          }\n        }\n        if (key === undefined) {\n          key = 'id';\n        }\n      }\n\n      assert(\n        \"JSONAPIResourceIdentitySerializer requires a keyMap to support resource keys other than 'id'\",\n        key === 'id' || this.keyMap !== undefined\n      );\n\n      this._resourceKeys[type] = key;\n    }\n    return key;\n  }\n\n  constructor(settings: JSONAPIResourceIdentitySerializerSettings) {\n    const {\n      serializerFor,\n      deserializationOptions,\n      schema,\n      keyMap,\n      getResourceKey\n    } = settings;\n    super({\n      serializerFor,\n      deserializationOptions,\n      schema,\n      keyMap\n    });\n    this._resourceKeys = {};\n    this._getCustomResourceKey = getResourceKey;\n  }\n\n  serialize(recordIdentity: InitializedRecord): Resource {\n    const { type, id } = recordIdentity;\n    const resourceKey = this.getResourceKey(type);\n    const resourceType = this.typeSerializer.serialize(type) as string;\n    const keyMap = this.keyMap as RecordKeyMap;\n    const resourceId =\n      resourceKey === 'id' ? id : keyMap.idToKey(type, resourceKey, id);\n\n    const resource: Resource = {\n      type: resourceType\n    };\n\n    if (resourceId !== undefined) {\n      resource.id = resourceId;\n    }\n\n    return resource;\n  }\n\n  deserialize(\n    resource: Resource,\n    customOptions?: JSONAPIResourceIdentityDeserializationOptions\n  ): InitializedRecord {\n    const options = this.buildDeserializationOptions(customOptions);\n    const type = this.typeSerializer.deserialize(resource.type) as string;\n    const resourceKey = this.getResourceKey(type);\n\n    if (resourceKey === 'id') {\n      const { id } = resource;\n      if (id) {\n        return { type, id };\n      } else {\n        throw new Assertion(`Resource of type '${type}' is missing 'id'`);\n      }\n    } else {\n      const keyMap = this.keyMap as RecordKeyMap;\n      const primaryRecord = options?.primaryRecord;\n      let id: string;\n      let keys: Dict<string> | null;\n\n      if (resource.id) {\n        keys = {\n          [resourceKey]: resource.id\n        };\n\n        id =\n          options.primaryRecord?.id ||\n          keyMap.idFromKeys(type, keys) ||\n          this.schema.generateId(type);\n      } else {\n        keys = null;\n        id =\n          (primaryRecord && primaryRecord.id) || this.schema.generateId(type);\n      }\n\n      const record: InitializedRecord = { type, id };\n\n      if (keys) {\n        if (options.includeKeys) {\n          record.keys = keys;\n          keyMap.pushRecord(record);\n        } else {\n          keyMap.pushRecord({\n            type,\n            id,\n            keys\n          });\n        }\n      }\n\n      return record;\n    }\n  }\n}\n","import { InitializedRecord } from '@orbit/records';\nimport { Resource, ResourceDocument } from '../resource-document';\nimport { RecordDocument } from '../record-document';\nimport { JSONAPIBaseSerializer } from './jsonapi-base-serializer';\n\nexport interface JSONAPIDocumentDeserializationOptions {\n  primaryRecord?: InitializedRecord;\n  primaryRecords?: InitializedRecord[];\n}\n\nexport class JSONAPIDocumentSerializer extends JSONAPIBaseSerializer<\n  RecordDocument,\n  ResourceDocument,\n  unknown,\n  JSONAPIDocumentDeserializationOptions\n> {\n  serialize(document: RecordDocument): ResourceDocument {\n    let resDocument: ResourceDocument = {\n      data: Array.isArray(document.data)\n        ? this.serializeRecords(document.data as InitializedRecord[])\n        : this.serializeRecord(document.data as InitializedRecord)\n    };\n\n    this.serializeLinks(document, resDocument);\n    this.serializeMeta(document, resDocument);\n\n    return resDocument;\n  }\n\n  deserialize(\n    resDocument: ResourceDocument,\n    customOptions?: JSONAPIDocumentDeserializationOptions\n  ): RecordDocument {\n    const options = this.buildSerializationOptions(\n      customOptions\n    ) as JSONAPIDocumentDeserializationOptions;\n    let resData = resDocument.data;\n    let data;\n\n    if (Array.isArray(resData)) {\n      data = this.deserializeResources(\n        resData as Resource[],\n        options?.primaryRecords\n      );\n    } else if (resData !== null) {\n      data = this.deserializeResource(\n        resData as Resource,\n        options?.primaryRecord\n      );\n    } else {\n      data = null;\n    }\n\n    let result: RecordDocument = { data };\n\n    if (resDocument.included) {\n      result.included = resDocument.included.map((e) =>\n        this.deserializeResource(e)\n      );\n    }\n\n    this.deserializeLinks(resDocument, result);\n    this.deserializeMeta(resDocument, result);\n\n    return result;\n  }\n\n  protected serializeRecords(records: InitializedRecord[]): Resource[] {\n    return records.map((record) => this.serializeRecord(record));\n  }\n\n  protected serializeRecord(record: InitializedRecord): Resource {\n    return this.resourceSerializer.serialize(record);\n  }\n\n  /* eslint-disable @typescript-eslint/no-unused-vars */\n  protected serializeLinks(\n    document: RecordDocument,\n    resDocument: ResourceDocument\n  ): void {}\n\n  protected serializeMeta(\n    document: RecordDocument,\n    resDocument: ResourceDocument\n  ): void {}\n  /* eslint-enable @typescript-eslint/no-unused-vars */\n\n  protected deserializeResources(\n    resources: Resource[],\n    primaryRecords?: InitializedRecord[]\n  ): InitializedRecord[] {\n    if (primaryRecords) {\n      return resources.map((entry, i) => {\n        return this.deserializeResource(entry, primaryRecords[i]);\n      });\n    } else {\n      return resources.map((entry) => this.deserializeResource(entry));\n    }\n  }\n\n  protected deserializeResource(\n    resource: Resource,\n    primaryRecord?: InitializedRecord\n  ): InitializedRecord {\n    if (primaryRecord) {\n      return this.resourceSerializer.deserialize(resource, { primaryRecord });\n    } else {\n      return this.resourceSerializer.deserialize(resource);\n    }\n  }\n\n  protected deserializeLinks(\n    resDocument: ResourceDocument,\n    document: RecordDocument\n  ): void {\n    if (resDocument.links) {\n      document.links = resDocument.links;\n    }\n  }\n\n  protected deserializeMeta(\n    resDocument: ResourceDocument,\n    document: RecordDocument\n  ): void {\n    if (resDocument.meta) {\n      document.meta = resDocument.meta;\n    }\n  }\n}\n","import {\n  StringSerializer,\n  StringSerializationOptions\n} from '@orbit/serializers';\n\nexport interface JSONAPIResourceFieldSerializationOptions\n  extends StringSerializationOptions {\n  type?: string;\n}\n\nexport class JSONAPIResourceFieldSerializer extends StringSerializer {\n  serialize(\n    arg: string,\n    customOptions?: JSONAPIResourceFieldSerializationOptions\n  ): string {\n    return super.serialize(arg, customOptions as StringSerializationOptions);\n  }\n\n  deserialize(\n    arg: string,\n    customOptions?: JSONAPIResourceFieldSerializationOptions\n  ): string {\n    return super.deserialize(arg, customOptions as StringSerializationOptions);\n  }\n}\n","import { deepMerge } from '@orbit/utils';\nimport {\n  NoopSerializer,\n  BooleanSerializer,\n  StringSerializer,\n  DateSerializer,\n  DateTimeSerializer,\n  NumberSerializer,\n  buildSerializerFor,\n  buildSerializerClassFor,\n  buildSerializerSettingsFor,\n  SerializerForFn,\n  SerializerClassForFn,\n  SerializerSettingsForFn,\n  SerializerClass\n} from '@orbit/serializers';\nimport { JSONAPIAtomicOperationSerializer } from './jsonapi-atomic-operation-serializer';\nimport { JSONAPIResourceSerializer } from './jsonapi-resource-serializer';\nimport { JSONAPIResourceIdentitySerializer } from './jsonapi-resource-identity-serializer';\nimport { RecordSchema, RecordKeyMap } from '@orbit/records';\nimport { JSONAPISerializers } from './jsonapi-serializers';\nimport { JSONAPIDocumentSerializer } from './jsonapi-document-serializer';\nimport { JSONAPIResourceFieldSerializer } from './jsonapi-resource-field-serializer';\n\nexport function buildJSONAPISerializerFor(settings: {\n  schema: RecordSchema;\n  keyMap?: RecordKeyMap;\n  serializerFor?: SerializerForFn;\n  serializerClassFor?: SerializerClassForFn;\n  serializerSettingsFor?: SerializerSettingsForFn;\n}): SerializerForFn {\n  const { schema, keyMap } = settings;\n\n  const defaultSerializerClassFor = buildSerializerClassFor({\n    unknown: NoopSerializer,\n    object: NoopSerializer,\n    array: NoopSerializer,\n    boolean: BooleanSerializer as SerializerClass,\n    string: StringSerializer as SerializerClass,\n    date: DateSerializer as SerializerClass,\n    datetime: DateTimeSerializer as SerializerClass,\n    number: NumberSerializer as SerializerClass,\n    [JSONAPISerializers.Resource as string]: JSONAPIResourceSerializer as SerializerClass,\n    [JSONAPISerializers.ResourceDocument as string]: JSONAPIDocumentSerializer as SerializerClass,\n    [JSONAPISerializers.ResourceIdentity as string]: JSONAPIResourceIdentitySerializer as SerializerClass,\n    [JSONAPISerializers.ResourceAtomicOperation as string]: JSONAPIAtomicOperationSerializer as SerializerClass,\n    [JSONAPISerializers.ResourceType as string]: StringSerializer as SerializerClass,\n    [JSONAPISerializers.ResourceTypeParam as string]: StringSerializer as SerializerClass,\n    [JSONAPISerializers.ResourceTypePath as string]: StringSerializer as SerializerClass,\n    [JSONAPISerializers.ResourceField as string]: JSONAPIResourceFieldSerializer as SerializerClass,\n    [JSONAPISerializers.ResourceFieldParam as string]: JSONAPIResourceFieldSerializer as SerializerClass,\n    [JSONAPISerializers.ResourceFieldPath as string]: JSONAPIResourceFieldSerializer as SerializerClass\n  });\n  let serializerClassFor: SerializerClassForFn;\n  if (settings.serializerClassFor) {\n    serializerClassFor = (type = 'unknown') => {\n      return (\n        (settings.serializerClassFor as SerializerClassForFn)(type) ||\n        defaultSerializerClassFor(type)\n      );\n    };\n  } else {\n    serializerClassFor = defaultSerializerClassFor;\n  }\n\n  let serializerSettingsFor: SerializerSettingsForFn;\n  let defaultSerializerSettingsFor = buildSerializerSettingsFor({\n    sharedSettings: {\n      keyMap,\n      schema\n    },\n    settingsByType: {\n      [JSONAPISerializers.ResourceTypePath]: {\n        serializationOptions: { inflectors: ['pluralize', 'dasherize'] }\n      },\n      [JSONAPISerializers.ResourceFieldPath]: {\n        serializationOptions: { inflectors: ['dasherize'] }\n      }\n    }\n  });\n  let customSerializerSettingsFor = settings.serializerSettingsFor;\n  if (customSerializerSettingsFor) {\n    serializerSettingsFor = (type = 'unknown') => {\n      let defaultSerializerSettings = defaultSerializerSettingsFor(type) || {};\n      let customSerializerSettings =\n        (customSerializerSettingsFor as SerializerSettingsForFn)(type) || {};\n      return deepMerge(defaultSerializerSettings, customSerializerSettings);\n    };\n  } else {\n    serializerSettingsFor = defaultSerializerSettingsFor;\n  }\n\n  let customSerializerFor = settings.serializerFor;\n  let backupSerializerFor = buildSerializerFor({\n    serializerClassFor,\n    serializerSettingsFor\n  });\n  if (customSerializerFor) {\n    return (type = 'unknown') =>\n      (customSerializerFor as SerializerForFn)(type) ||\n      backupSerializerFor(type);\n  } else {\n    return (type = 'unknown') => backupSerializerFor(type);\n  }\n}\n","import { Orbit } from '@orbit/core';\nimport { requestOptionsForSource } from '@orbit/data';\nimport {\n  RecordKeyMap,\n  InitializedRecord,\n  RecordSchema,\n  RecordQueryExpression,\n  RecordTransform,\n  RecordQuery\n} from '@orbit/records';\nimport { Dict } from '@orbit/utils';\nimport {\n  NetworkError,\n  InvalidServerResponse,\n  ClientError,\n  ServerError\n} from './lib/exceptions';\nimport { RecordTransformRequest } from './lib/transform-requests';\nimport { RecordQueryRequest } from './lib/query-requests';\nimport { deepMerge, toArray } from '@orbit/utils';\nimport { ResourceDocument } from './resource-document';\nimport { RecordDocument } from './record-document';\nimport { JSONAPIRequestOptions } from './lib/jsonapi-request-options';\nimport {\n  JSONAPIURLBuilder,\n  JSONAPIURLBuilderSettings\n} from './jsonapi-url-builder';\nimport {\n  JSONAPISerializer,\n  JSONAPISerializerSettings\n} from './jsonapi-serializer';\nimport {\n  SerializerForFn,\n  SerializerClassForFn,\n  SerializerSettingsForFn\n} from '@orbit/serializers';\nimport { buildJSONAPISerializerFor } from './serializers/jsonapi-serializer-builder';\nimport { JSONAPISerializers } from './serializers/jsonapi-serializers';\nimport { RecordOperation } from '@orbit/records';\nimport { JSONAPIResponse } from './jsonapi-response';\n\nconst { assert, deprecate } = Orbit;\n\nexport interface FetchSettings {\n  headers?: Dict<any>;\n  method?: string;\n  json?: Dict<any>;\n  body?: string;\n  params?: Dict<any>;\n  timeout?: number;\n  credentials?: string;\n  cache?: string;\n  redirect?: string;\n  referrer?: string;\n  referrerPolicy?: string;\n  integrity?: string;\n}\n\nexport interface JSONAPIRequestProcessorSettings {\n  sourceName: string;\n  serializerFor?: SerializerForFn;\n  serializerClassFor?: SerializerClassForFn;\n  serializerSettingsFor?: SerializerSettingsForFn;\n  SerializerClass?: new (\n    settings: JSONAPISerializerSettings\n  ) => JSONAPISerializer;\n  URLBuilderClass?: new (\n    settings: JSONAPIURLBuilderSettings\n  ) => JSONAPIURLBuilder;\n  namespace?: string;\n  host?: string;\n  defaultFetchSettings?: FetchSettings;\n  allowedContentTypes?: string[];\n  schema: RecordSchema;\n  keyMap?: RecordKeyMap;\n}\n\nexport class JSONAPIRequestProcessor {\n  sourceName: string;\n  urlBuilder: JSONAPIURLBuilder;\n  allowedContentTypes: string[];\n  defaultFetchSettings!: FetchSettings;\n  schema: RecordSchema;\n  keyMap?: RecordKeyMap;\n  protected _serializer?: JSONAPISerializer;\n  protected _serializerFor: SerializerForFn;\n\n  constructor(settings: JSONAPIRequestProcessorSettings) {\n    let {\n      sourceName,\n      allowedContentTypes,\n      schema,\n      keyMap,\n      SerializerClass,\n      serializerFor,\n      serializerClassFor,\n      serializerSettingsFor\n    } = settings;\n\n    this.sourceName = sourceName;\n    this.allowedContentTypes = allowedContentTypes || [\n      'application/vnd.api+json',\n      'application/json'\n    ];\n    this.schema = schema;\n    this.keyMap = keyMap;\n    if (SerializerClass) {\n      deprecate(\n        \"The 'SerializerClass' setting for 'JSONAPIRequestProcessor' has been deprecated. Pass 'serializerFor', 'serializerClassFor', and/or 'serializerSettingsFor' instead.\"\n      );\n      this._serializer = new SerializerClass({\n        schema,\n        keyMap\n      });\n    }\n    this._serializerFor = buildJSONAPISerializerFor({\n      schema,\n      keyMap,\n      serializerFor,\n      serializerClassFor,\n      serializerSettingsFor\n    });\n    const URLBuilderClass = settings.URLBuilderClass || JSONAPIURLBuilder;\n    const urlBuilderOptions: JSONAPIURLBuilderSettings = {\n      host: settings.host,\n      namespace: settings.namespace,\n      keyMap: settings.keyMap,\n      serializer: this._serializer,\n      serializerFor: this._serializerFor\n    };\n    this.urlBuilder = new URLBuilderClass(urlBuilderOptions);\n    this.initDefaultFetchSettings(settings);\n  }\n\n  /**\n   * @deprecated since v0.17, use `serializerFor` instead\n   */\n  get serializer(): JSONAPISerializer {\n    deprecate(\n      \"'JSONAPIRequestProcessor#serializer' has been deprecated. Use 'serializerFor' instead.\"\n    );\n    if (this._serializer) {\n      return this._serializer;\n    } else {\n      return this._serializerFor(\n        JSONAPISerializers.ResourceDocument\n      ) as JSONAPISerializer;\n    }\n  }\n\n  get serializerFor(): SerializerForFn {\n    return this._serializerFor;\n  }\n\n  fetch(url: string, customSettings?: FetchSettings): Promise<JSONAPIResponse> {\n    let settings = this.initFetchSettings(customSettings);\n\n    let fullUrl = url;\n    if (settings.params) {\n      fullUrl = this.urlBuilder.appendQueryParams(fullUrl, settings.params);\n      delete settings.params;\n    }\n\n    let fetchFn = (Orbit as any).fetch || Orbit.globals.fetch;\n\n    // console.log('fetch', fullUrl, settings, 'polyfill', fetchFn.polyfill);\n\n    if (settings.timeout !== undefined && settings.timeout > 0) {\n      let timeout = settings.timeout;\n      delete settings.timeout;\n\n      return new Promise((resolve, reject) => {\n        let timedOut: boolean;\n\n        let timer = Orbit.globals.setTimeout(() => {\n          timedOut = true;\n          reject(new NetworkError(`No fetch response within ${timeout}ms.`));\n        }, timeout);\n\n        fetchFn(fullUrl, settings)\n          .catch((e: Error) => {\n            Orbit.globals.clearTimeout(timer);\n\n            if (!timedOut) {\n              return this.handleFetchError(e);\n            }\n          })\n          .then((response: any) => {\n            Orbit.globals.clearTimeout(timer);\n\n            if (!timedOut) {\n              return this.handleFetchResponse(response);\n            }\n          })\n          .then(resolve, reject);\n      });\n    } else {\n      return fetchFn(fullUrl, settings)\n        .catch((e: Error) => this.handleFetchError(e))\n        .then((response: any) => this.handleFetchResponse(response));\n    }\n  }\n\n  initFetchSettings(customSettings: FetchSettings = {}): FetchSettings {\n    let settings: FetchSettings = deepMerge(\n      {},\n      this.defaultFetchSettings,\n      customSettings\n    );\n\n    if (settings.json) {\n      assert(\n        \"`json` and `body` can't both be set for fetch requests.\",\n        !settings.body\n      );\n      settings.body = JSON.stringify(settings.json);\n      delete settings.json;\n    }\n\n    if (settings.headers && !settings.body) {\n      delete settings.headers['Content-Type'];\n    }\n\n    return settings;\n  }\n\n  operationsFromDeserializedDocument(\n    deserialized: RecordDocument\n  ): RecordOperation[] {\n    const records: InitializedRecord[] = [];\n    Array.prototype.push.apply(records, toArray(deserialized.data));\n\n    if (deserialized.included) {\n      Array.prototype.push.apply(records, deserialized.included);\n    }\n\n    return records.map((record) => {\n      return {\n        op: 'updateRecord',\n        record\n      };\n    });\n  }\n\n  buildFetchSettings(\n    request: RecordQueryRequest | RecordTransformRequest\n  ): FetchSettings {\n    const settings = {\n      params: {},\n      ...request.options?.settings\n    };\n\n    if (request.options) {\n      const { filter, sort, page, include, fields } = request.options;\n\n      if (filter) {\n        settings.params.filter = this.urlBuilder.buildFilterParam(\n          filter,\n          request\n        );\n      }\n\n      if (sort) {\n        settings.params.sort = this.urlBuilder.buildSortParam(sort, request);\n      }\n\n      if (page) {\n        settings.params.page = this.urlBuilder.buildPageParam(page, request);\n      }\n\n      if (include) {\n        settings.params.include = this.urlBuilder.buildIncludeParam(\n          include,\n          request\n        );\n      }\n\n      if (fields) {\n        settings.params.fields = this.urlBuilder.buildFieldsParam(\n          fields,\n          request\n        );\n      }\n    }\n\n    return settings;\n  }\n\n  mergeRequestOptions(\n    options:\n      | JSONAPIRequestOptions\n      | undefined\n      | (JSONAPIRequestOptions | undefined)[]\n  ): JSONAPIRequestOptions | undefined {\n    return requestOptionsForSource<JSONAPIRequestOptions>(\n      options,\n      this.sourceName\n    );\n  }\n\n  /**\n   * @deprecated since v0.17, use `mergeRequestOptions` instead\n   */\n  customRequestOptions(\n    queryOrTransform: RecordQuery | RecordTransform,\n    queryExpressionOrOperation: RecordQueryExpression | RecordOperation\n  ): JSONAPIRequestOptions | undefined {\n    deprecate(\n      \"'JSONAPIRequestProcessor#customRequestOptions' has been deprecated. Use 'mergeRequestOptions' instead.\"\n    );\n    return this.mergeRequestOptions([\n      queryOrTransform.options,\n      queryExpressionOrOperation.options\n    ]);\n  }\n\n  /* eslint-disable @typescript-eslint/no-unused-vars */\n  preprocessResponseDocument(\n    document: ResourceDocument | undefined,\n    request: RecordQueryRequest | RecordTransformRequest\n  ): void {}\n  /* eslint-enable @typescript-eslint/no-unused-vars */\n\n  protected responseHasContent(\n    response: Response,\n    ignoreUnrecognizedContent?: boolean\n  ): boolean {\n    let contentType = response.headers.get('Content-Type');\n    if (contentType) {\n      for (let allowedContentType of this.allowedContentTypes) {\n        if (contentType.indexOf(allowedContentType) > -1) {\n          return true;\n        }\n      }\n      if (!ignoreUnrecognizedContent) {\n        throw new InvalidServerResponse(\n          `The server responded with the content type '${contentType}', which is not allowed. Allowed content types include: '${this.allowedContentTypes.join(\n            \"', '\"\n          )}'.`\n        );\n      }\n    }\n    return false;\n  }\n\n  protected initDefaultFetchSettings(\n    settings: JSONAPIRequestProcessorSettings\n  ): void {\n    this.defaultFetchSettings = {\n      headers: {\n        Accept: 'application/vnd.api+json',\n        'Content-Type': 'application/vnd.api+json'\n      },\n      timeout: 5000\n    };\n\n    if (settings.defaultFetchSettings) {\n      deepMerge(this.defaultFetchSettings, settings.defaultFetchSettings);\n    }\n  }\n\n  protected async handleFetchResponse(\n    response: Response\n  ): Promise<JSONAPIResponse> {\n    const responseDetail: JSONAPIResponse = {\n      response\n    };\n    if (response.status >= 200 && response.status < 300) {\n      if (response.status !== 204 && this.responseHasContent(response)) {\n        responseDetail.document = await response.json();\n      }\n    } else if (response.status !== 304 && response.status !== 404) {\n      if (this.responseHasContent(response, true)) {\n        const document = await response.json();\n        await this.handleFetchResponseError(response, document);\n      } else {\n        await this.handleFetchResponseError(response);\n      }\n    }\n    return responseDetail;\n  }\n\n  protected async handleFetchResponseError(\n    response: Response,\n    data?: unknown\n  ): Promise<Error> {\n    let error: any;\n    if (response.status >= 400 && response.status < 500) {\n      error = new ClientError(response.statusText);\n    } else {\n      error = new ServerError(response.statusText);\n    }\n    error.response = response;\n    error.data = data;\n    throw error;\n  }\n\n  protected async handleFetchError(e: Error | string): Promise<Error> {\n    if (typeof e === 'string') {\n      throw new NetworkError(e);\n    } else {\n      throw e;\n    }\n  }\n}\n","import { Dict, toArray } from '@orbit/utils';\nimport {\n  RecordQuery,\n  AddToRelatedRecordsOperation,\n  ReplaceRelatedRecordOperation,\n  ReplaceRelatedRecordsOperation,\n  FindRecord,\n  FindRecords,\n  FindRelatedRecord,\n  FindRelatedRecords,\n  RecordIdentity,\n  RecordQueryExpression,\n  cloneRecordIdentity,\n  RecordOperation,\n  RecordQueryExpressionResult,\n  RecordNotFoundException\n} from '@orbit/records';\nimport { buildTransform, FullResponse } from '@orbit/data';\nimport { JSONAPIRequestProcessor } from '../jsonapi-request-processor';\nimport { JSONAPIRequestOptions } from './jsonapi-request-options';\nimport { JSONAPISerializers } from '../serializers/jsonapi-serializers';\nimport { JSONAPIDocumentSerializer } from '../serializers/jsonapi-document-serializer';\nimport { RecordDocument } from '../record-document';\nimport { JSONAPIResponse } from '../jsonapi-response';\n\nexport interface QueryRequest {\n  op: string;\n  options?: JSONAPIRequestOptions;\n}\n\nexport interface FindRecordRequest extends QueryRequest {\n  op: 'findRecord';\n  record: RecordIdentity;\n}\n\nexport interface FindRecordsRequest extends QueryRequest {\n  op: 'findRecords';\n  type: string;\n}\n\nexport interface FindRelatedRecordRequest extends QueryRequest {\n  op: 'findRelatedRecord';\n  record: RecordIdentity;\n  relationship: string;\n}\n\nexport interface FindRelatedRecordsRequest extends QueryRequest {\n  op: 'findRelatedRecords';\n  record: RecordIdentity;\n  relationship: string;\n}\n\nexport type RecordQueryRequest =\n  | FindRecordRequest\n  | FindRecordsRequest\n  | FindRelatedRecordRequest\n  | FindRelatedRecordsRequest;\n\nexport type QueryRequestProcessorResponse = FullResponse<\n  RecordQueryExpressionResult,\n  JSONAPIResponse,\n  RecordOperation\n>;\n\nexport interface QueryRequestProcessor {\n  (\n    requestProcessor: JSONAPIRequestProcessor,\n    request: RecordQueryRequest\n  ): Promise<QueryRequestProcessorResponse>;\n}\n\nexport function getQueryRequests(\n  requestProcessor: JSONAPIRequestProcessor,\n  query: RecordQuery\n): RecordQueryRequest[] {\n  const requests: RecordQueryRequest[] = [];\n\n  for (let expression of toArray(query.expressions)) {\n    const request = ExpressionToRequestMap[expression.op](\n      expression as RecordQueryExpression,\n      requestProcessor\n    );\n\n    const options = requestProcessor.mergeRequestOptions([\n      request.options,\n      query.options,\n      expression.options\n    ]);\n    if (options) request.options = options;\n\n    requests.push(request);\n  }\n  return requests;\n}\n\nexport interface ExpressionToRequestConverter {\n  (\n    expression: RecordQueryExpression,\n    requestProcessor: JSONAPIRequestProcessor\n  ): RecordQueryRequest;\n}\n\nconst ExpressionToRequestMap: Dict<ExpressionToRequestConverter> = {\n  findRecord(expression: RecordQueryExpression): FindRecordRequest {\n    const exp = expression as FindRecord;\n    return {\n      op: 'findRecord',\n      record: cloneRecordIdentity(exp.record)\n    };\n  },\n  findRecords(expression: RecordQueryExpression): FindRecordsRequest {\n    const exp = expression as FindRecords;\n    const { filter, sort, page } = exp;\n    return {\n      op: 'findRecords',\n      type: exp.type as string,\n      options: { filter, sort, page }\n    };\n  },\n  findRelatedRecord(\n    expression: RecordQueryExpression\n  ): FindRelatedRecordRequest {\n    const exp = expression as FindRelatedRecord;\n    return {\n      op: 'findRelatedRecord',\n      record: cloneRecordIdentity(exp.record),\n      relationship: exp.relationship\n    };\n  },\n  findRelatedRecords(\n    expression: RecordQueryExpression\n  ): FindRelatedRecordsRequest {\n    const exp = expression as FindRelatedRecords;\n    const { filter, sort, page } = exp;\n    return {\n      op: 'findRelatedRecords',\n      record: cloneRecordIdentity(exp.record),\n      relationship: exp.relationship,\n      options: { filter, sort, page }\n    };\n  }\n};\n\nexport const QueryRequestProcessors: Dict<QueryRequestProcessor> = {\n  async findRecord(\n    requestProcessor: JSONAPIRequestProcessor,\n    request: RecordQueryRequest\n  ): Promise<QueryRequestProcessorResponse> {\n    const { record } = request as FindRecordRequest;\n    const settings = requestProcessor.buildFetchSettings(request);\n    const url =\n      request.options?.url ??\n      requestProcessor.urlBuilder.resourceURL(record.type, record.id);\n\n    const details = await requestProcessor.fetch(url, settings);\n    const { document } = details;\n    requestProcessor.preprocessResponseDocument(document, request);\n\n    if (document) {\n      const serializer = requestProcessor.serializerFor(\n        JSONAPISerializers.ResourceDocument\n      ) as JSONAPIDocumentSerializer;\n      const recordDoc = serializer.deserialize(document) as RecordDocument;\n      const operations = requestProcessor.operationsFromDeserializedDocument(\n        recordDoc\n      );\n      const transforms = [buildTransform<RecordOperation>(operations)];\n\n      return { transforms, data: recordDoc.data, details };\n    } else {\n      if (request.options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(record.type, record.id);\n      }\n      return { transforms: [] };\n    }\n  },\n\n  async findRecords(\n    requestProcessor: JSONAPIRequestProcessor,\n    request: RecordQueryRequest\n  ): Promise<QueryRequestProcessorResponse> {\n    const { type } = request as FindRecordsRequest;\n    const settings = requestProcessor.buildFetchSettings(request);\n    const url =\n      request.options?.url ?? requestProcessor.urlBuilder.resourceURL(type);\n\n    const details = await requestProcessor.fetch(url, settings);\n    const { document } = details;\n    requestProcessor.preprocessResponseDocument(document, request);\n\n    if (document) {\n      const serializer = requestProcessor.serializerFor(\n        JSONAPISerializers.ResourceDocument\n      ) as JSONAPIDocumentSerializer;\n      const recordDoc = serializer.deserialize(document) as RecordDocument;\n      const operations = requestProcessor.operationsFromDeserializedDocument(\n        recordDoc\n      );\n      const transforms = [buildTransform(operations)];\n\n      return { transforms, data: recordDoc.data, details };\n    } else {\n      return { transforms: [] };\n    }\n  },\n\n  async findRelatedRecord(\n    requestProcessor: JSONAPIRequestProcessor,\n    request: RecordQueryRequest\n  ): Promise<QueryRequestProcessorResponse> {\n    const { record, relationship } = request as FindRelatedRecordRequest;\n    const settings = requestProcessor.buildFetchSettings(request);\n    const url =\n      request.options?.url ??\n      requestProcessor.urlBuilder.relatedResourceURL(\n        record.type,\n        record.id,\n        relationship\n      );\n\n    const details = await requestProcessor.fetch(url, settings);\n    const { document } = details;\n    requestProcessor.preprocessResponseDocument(document, request);\n\n    if (document) {\n      const serializer = requestProcessor.serializerFor(\n        JSONAPISerializers.ResourceDocument\n      ) as JSONAPIDocumentSerializer;\n      const recordDoc = serializer.deserialize(document) as RecordDocument;\n      const relatedRecord = recordDoc.data;\n      const operations = requestProcessor.operationsFromDeserializedDocument(\n        recordDoc\n      );\n      operations.push({\n        op: 'replaceRelatedRecord',\n        record,\n        relationship,\n        relatedRecord\n      } as ReplaceRelatedRecordOperation);\n      const transforms = [buildTransform(operations)];\n\n      return { transforms, data: relatedRecord, details };\n    } else {\n      if (request.options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(record.type, record.id);\n      }\n      return { transforms: [] };\n    }\n  },\n\n  async findRelatedRecords(\n    requestProcessor: JSONAPIRequestProcessor,\n    request: RecordQueryRequest\n  ): Promise<QueryRequestProcessorResponse> {\n    const { record, relationship } = request as FindRelatedRecordsRequest;\n    const settings = requestProcessor.buildFetchSettings(request);\n    const url =\n      request.options?.url ??\n      requestProcessor.urlBuilder.relatedResourceURL(\n        record.type,\n        record.id,\n        relationship\n      );\n\n    const details = await requestProcessor.fetch(url, settings);\n    const { document } = details;\n    requestProcessor.preprocessResponseDocument(document, request);\n\n    if (document) {\n      const serializer = requestProcessor.serializerFor(\n        JSONAPISerializers.ResourceDocument\n      ) as JSONAPIDocumentSerializer;\n      const recordDoc = serializer.deserialize(document) as RecordDocument;\n      const relatedRecords = recordDoc.data as RecordIdentity[];\n      const operations = requestProcessor.operationsFromDeserializedDocument(\n        recordDoc\n      );\n\n      const partialSet =\n        request.options?.partialSet ??\n        !!(\n          request.options?.filter ||\n          request.options?.page ||\n          recordDoc.links?.next ||\n          recordDoc.links?.prev\n        );\n\n      if (partialSet) {\n        for (let relatedRecord of relatedRecords) {\n          operations.push({\n            op: 'addToRelatedRecords',\n            record,\n            relationship,\n            relatedRecord\n          } as AddToRelatedRecordsOperation);\n        }\n      } else {\n        operations.push({\n          op: 'replaceRelatedRecords',\n          record,\n          relationship,\n          relatedRecords\n        } as ReplaceRelatedRecordsOperation);\n      }\n      const transforms = [buildTransform(operations)];\n\n      return { transforms, data: relatedRecords, details };\n    } else {\n      if (request.options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(record.type, record.id);\n      }\n      return { transforms: [] };\n    }\n  }\n};\n","import { clone, deepSet, Dict, toArray } from '@orbit/utils';\nimport {\n  cloneRecordIdentity,\n  equalRecordIdentities,\n  recordDiffs,\n  InitializedRecord,\n  RecordIdentity,\n  RecordOperation,\n  AddRecordOperation,\n  RemoveRecordOperation,\n  ReplaceAttributeOperation,\n  AddToRelatedRecordsOperation,\n  RemoveFromRelatedRecordsOperation,\n  ReplaceRelatedRecordOperation,\n  ReplaceRelatedRecordsOperation,\n  RecordTransform,\n  RecordOperationResult\n} from '@orbit/records';\nimport { buildTransform, FullResponse } from '@orbit/data';\nimport { JSONAPIRequestProcessor } from '../jsonapi-request-processor';\nimport { ResourceDocument } from '../resource-document';\nimport { RecordDocument } from '../record-document';\nimport { JSONAPIRequestOptions } from './jsonapi-request-options';\nimport { JSONAPISerializers } from '../serializers/jsonapi-serializers';\nimport { JSONAPIDocumentSerializer } from '../serializers/jsonapi-document-serializer';\nimport { JSONAPIResourceIdentitySerializer } from '../serializers/jsonapi-resource-identity-serializer';\nimport { JSONAPIResponse } from '../jsonapi-response';\n\nexport interface BaseTransformRecordRequest {\n  op: string;\n  options?: JSONAPIRequestOptions;\n  record: RecordIdentity;\n}\n\nexport interface TransformRecordRelationshipRequest\n  extends BaseTransformRecordRequest {\n  relationship: string;\n}\n\nexport interface AddRecordRequest extends BaseTransformRecordRequest {\n  op: 'addRecord';\n  record: InitializedRecord;\n}\n\nexport interface RemoveRecordRequest extends BaseTransformRecordRequest {\n  op: 'removeRecord';\n}\n\nexport interface UpdateRecordRequest extends BaseTransformRecordRequest {\n  op: 'updateRecord';\n  record: InitializedRecord;\n}\n\nexport interface AddToRelatedRecordsRequest\n  extends TransformRecordRelationshipRequest {\n  op: 'addToRelatedRecords';\n  relatedRecords: RecordIdentity[];\n}\n\nexport interface RemoveFromRelatedRecordsRequest\n  extends TransformRecordRelationshipRequest {\n  op: 'removeFromRelatedRecords';\n  relatedRecords: RecordIdentity[];\n}\n\nexport interface ReplaceRelatedRecordRequest\n  extends TransformRecordRelationshipRequest {\n  op: 'replaceRelatedRecord';\n  relatedRecord: RecordIdentity;\n}\n\nexport interface ReplaceRelatedRecordsRequest\n  extends TransformRecordRelationshipRequest {\n  op: 'replaceRelatedRecord';\n  relatedRecords: RecordIdentity[];\n}\n\nexport type RecordTransformRequest =\n  | AddRecordRequest\n  | RemoveRecordRequest\n  | UpdateRecordRequest\n  | AddToRelatedRecordsRequest\n  | RemoveFromRelatedRecordsRequest\n  | ReplaceRelatedRecordRequest\n  | ReplaceRelatedRecordsRequest;\n\nexport type TransformRequestProcessorResponse = FullResponse<\n  RecordOperationResult,\n  JSONAPIResponse,\n  RecordOperation\n>;\n\nexport interface TransformRequestProcessor {\n  (\n    requestProcessor: JSONAPIRequestProcessor,\n    request: RecordTransformRequest\n  ): Promise<TransformRequestProcessorResponse>;\n}\n\nexport const TransformRequestProcessors: Dict<TransformRequestProcessor> = {\n  async addRecord(\n    requestProcessor: JSONAPIRequestProcessor,\n    request: RecordTransformRequest\n  ): Promise<TransformRequestProcessorResponse> {\n    const { record } = request as AddRecordRequest;\n    const serializer = requestProcessor.serializerFor(\n      JSONAPISerializers.ResourceDocument\n    ) as JSONAPIDocumentSerializer;\n    const requestDoc = serializer.serialize({\n      data: record\n    }) as ResourceDocument;\n    const settings = {\n      ...requestProcessor.buildFetchSettings(request),\n      method: 'POST',\n      json: requestDoc\n    };\n    const url =\n      request.options?.url ??\n      requestProcessor.urlBuilder.resourceURL(record.type);\n\n    const details = await requestProcessor.fetch(url, settings);\n    const document = details.document as ResourceDocument;\n    requestProcessor.preprocessResponseDocument(document, request);\n\n    const recordDoc = serializer.deserialize(document, {\n      primaryRecord: record\n    });\n    return handleChanges(record, recordDoc, details);\n  },\n\n  async removeRecord(\n    requestProcessor: JSONAPIRequestProcessor,\n    request: RecordTransformRequest\n  ): Promise<TransformRequestProcessorResponse> {\n    const { record } = request as RemoveRecordRequest;\n    const { type, id } = record;\n    const settings = {\n      ...requestProcessor.buildFetchSettings(request),\n      method: 'DELETE'\n    };\n    const url =\n      request.options?.url ?? requestProcessor.urlBuilder.resourceURL(type, id);\n\n    const details = await requestProcessor.fetch(url, settings);\n    return { transforms: [], data: record, details };\n  },\n\n  async updateRecord(\n    requestProcessor: JSONAPIRequestProcessor,\n    request: RecordTransformRequest\n  ): Promise<TransformRequestProcessorResponse> {\n    const { record } = request as UpdateRecordRequest;\n    const { type, id } = record;\n    const serializer = requestProcessor.serializerFor(\n      JSONAPISerializers.ResourceDocument\n    ) as JSONAPIDocumentSerializer;\n    const requestDoc = serializer.serialize({\n      data: record\n    }) as ResourceDocument;\n    const settings = {\n      ...requestProcessor.buildFetchSettings(request),\n      method: 'PATCH',\n      json: requestDoc\n    };\n    const url =\n      request.options?.url ?? requestProcessor.urlBuilder.resourceURL(type, id);\n\n    const details = await requestProcessor.fetch(url, settings);\n    const { document } = details;\n    if (document) {\n      requestProcessor.preprocessResponseDocument(document, request);\n      const recordDoc = serializer.deserialize(document, {\n        primaryRecord: record\n      });\n      return handleChanges(record, recordDoc, details);\n    } else {\n      return { transforms: [], data: record, details };\n    }\n  },\n\n  async addToRelatedRecords(\n    requestProcessor: JSONAPIRequestProcessor,\n    request: RecordTransformRequest\n  ): Promise<TransformRequestProcessorResponse> {\n    const {\n      relationship,\n      record,\n      relatedRecords\n    } = request as AddToRelatedRecordsRequest;\n    const { type, id } = record;\n    const resourceIdentitySerializer = requestProcessor.serializerFor(\n      JSONAPISerializers.ResourceIdentity\n    ) as JSONAPIResourceIdentitySerializer;\n    const json = {\n      data: relatedRecords.map((r) => resourceIdentitySerializer.serialize(r))\n    };\n    const settings = {\n      ...requestProcessor.buildFetchSettings(request),\n      method: 'POST',\n      json\n    };\n    const url =\n      request.options?.url ??\n      requestProcessor.urlBuilder.resourceRelationshipURL(\n        type,\n        id,\n        relationship\n      );\n\n    const details = await requestProcessor.fetch(url, settings);\n    return { transforms: [], data: record, details };\n  },\n\n  async removeFromRelatedRecords(\n    requestProcessor: JSONAPIRequestProcessor,\n    request: RecordTransformRequest\n  ): Promise<TransformRequestProcessorResponse> {\n    const {\n      relationship,\n      record,\n      relatedRecords\n    } = request as RemoveFromRelatedRecordsRequest;\n    const { type, id } = record;\n    const resourceIdentitySerializer = requestProcessor.serializerFor(\n      JSONAPISerializers.ResourceIdentity\n    ) as JSONAPIResourceIdentitySerializer;\n    const json = {\n      data: relatedRecords.map((r) => resourceIdentitySerializer.serialize(r))\n    };\n    const settings = {\n      ...requestProcessor.buildFetchSettings(request),\n      method: 'DELETE',\n      json\n    };\n    const url =\n      request.options?.url ??\n      requestProcessor.urlBuilder.resourceRelationshipURL(\n        type,\n        id,\n        relationship\n      );\n\n    const details = await requestProcessor.fetch(url, settings);\n    return { transforms: [], data: record, details };\n  },\n\n  async replaceRelatedRecord(\n    requestProcessor: JSONAPIRequestProcessor,\n    request: RecordTransformRequest\n  ): Promise<TransformRequestProcessorResponse> {\n    const {\n      relationship,\n      relatedRecord,\n      record\n    } = request as ReplaceRelatedRecordRequest;\n    const { type, id } = record;\n    const resourceIdentitySerializer = requestProcessor.serializerFor(\n      JSONAPISerializers.ResourceIdentity\n    ) as JSONAPIResourceIdentitySerializer;\n    const json = {\n      data: relatedRecord\n        ? resourceIdentitySerializer.serialize(relatedRecord)\n        : null\n    };\n    const settings = {\n      ...requestProcessor.buildFetchSettings(request),\n      method: 'PATCH',\n      json\n    };\n    const url =\n      request.options?.url ??\n      requestProcessor.urlBuilder.resourceRelationshipURL(\n        type,\n        id,\n        relationship\n      );\n\n    const details = await requestProcessor.fetch(url, settings);\n    return { transforms: [], data: record, details };\n  },\n\n  async replaceRelatedRecords(\n    requestProcessor: JSONAPIRequestProcessor,\n    request: RecordTransformRequest\n  ): Promise<TransformRequestProcessorResponse> {\n    const {\n      relationship,\n      relatedRecords,\n      record\n    } = request as ReplaceRelatedRecordsRequest;\n    const { type, id } = record;\n    const resourceIdentitySerializer = requestProcessor.serializerFor(\n      JSONAPISerializers.ResourceIdentity\n    ) as JSONAPIResourceIdentitySerializer;\n    const json = {\n      data: relatedRecords.map((r) => resourceIdentitySerializer.serialize(r))\n    };\n    const settings = {\n      ...requestProcessor.buildFetchSettings(request),\n      method: 'PATCH',\n      json\n    };\n    const url =\n      request.options?.url ??\n      requestProcessor.urlBuilder.resourceRelationshipURL(\n        type,\n        id,\n        relationship\n      );\n\n    const details = await requestProcessor.fetch(url, settings);\n    return { transforms: [], data: record, details };\n  }\n};\n\nexport function getTransformRequests(\n  requestProcessor: JSONAPIRequestProcessor,\n  transform: RecordTransform\n): RecordTransformRequest[] {\n  const requests: RecordTransformRequest[] = [];\n  let prevRequest: RecordTransformRequest | null = null;\n\n  for (let operation of toArray(transform.operations)) {\n    let request;\n    let newRequestNeeded = true;\n\n    if (\n      prevRequest &&\n      equalRecordIdentities(prevRequest.record, operation.record)\n    ) {\n      if (operation.op === 'removeRecord') {\n        newRequestNeeded = false;\n\n        if (prevRequest.op !== 'removeRecord') {\n          prevRequest = null;\n          requests.pop();\n        }\n      } else if (\n        prevRequest.op === 'addRecord' ||\n        prevRequest.op === 'updateRecord'\n      ) {\n        if (operation.op === 'replaceAttribute') {\n          newRequestNeeded = false;\n          replaceRecordAttribute(\n            prevRequest.record,\n            operation.attribute,\n            operation.value\n          );\n        } else if (operation.op === 'replaceRelatedRecord') {\n          newRequestNeeded = false;\n          replaceRecordHasOne(\n            prevRequest.record,\n            operation.relationship,\n            operation.relatedRecord as RecordIdentity\n          );\n        } else if (operation.op === 'replaceRelatedRecords') {\n          newRequestNeeded = false;\n          replaceRecordHasMany(\n            prevRequest.record,\n            operation.relationship,\n            operation.relatedRecords\n          );\n        }\n      } else if (\n        prevRequest.op === 'addToRelatedRecords' &&\n        operation.op === 'addToRelatedRecords' &&\n        (prevRequest as AddToRelatedRecordsRequest).relationship ===\n          operation.relationship\n      ) {\n        newRequestNeeded = false;\n        (prevRequest as AddToRelatedRecordsRequest).relatedRecords.push(\n          cloneRecordIdentity(operation.relatedRecord)\n        );\n      } else if (\n        prevRequest.op === 'removeFromRelatedRecords' &&\n        operation.op === 'removeFromRelatedRecords' &&\n        (prevRequest as RemoveFromRelatedRecordsRequest).relationship ===\n          operation.relationship\n      ) {\n        newRequestNeeded = false;\n        (prevRequest as RemoveFromRelatedRecordsRequest).relatedRecords.push(\n          cloneRecordIdentity(operation.relatedRecord)\n        );\n      }\n    }\n\n    if (newRequestNeeded) {\n      request = OperationToRequestMap[operation.op](operation);\n    }\n\n    if (request) {\n      const options = requestProcessor.mergeRequestOptions([\n        request.options,\n        transform.options,\n        operation.options\n      ]);\n      if (options) request.options = options;\n\n      requests.push(request);\n      prevRequest = request;\n    }\n  }\n\n  return requests;\n}\n\nexport interface OperationToRequestConverter {\n  (operation: RecordOperation): RecordTransformRequest;\n}\n\nconst OperationToRequestMap: Dict<OperationToRequestConverter> = {\n  addRecord(operation: RecordOperation): RecordTransformRequest {\n    const op = operation as AddRecordOperation;\n    return {\n      op: 'addRecord',\n      record: clone(op.record)\n    };\n  },\n\n  removeRecord(operation: RecordOperation): RecordTransformRequest {\n    const op = operation as RemoveRecordOperation;\n    return {\n      op: 'removeRecord',\n      record: cloneRecordIdentity(op.record)\n    };\n  },\n\n  replaceAttribute(operation: RecordOperation): RecordTransformRequest {\n    const op = operation as ReplaceAttributeOperation;\n    const record = cloneRecordIdentity(op.record);\n\n    replaceRecordAttribute(record, op.attribute, op.value);\n\n    return {\n      op: 'updateRecord',\n      record\n    };\n  },\n\n  updateRecord(operation: RecordOperation): RecordTransformRequest {\n    return {\n      op: 'updateRecord',\n      record: clone(operation.record)\n    };\n  },\n\n  addToRelatedRecords(operation: RecordOperation): RecordTransformRequest {\n    const {\n      record,\n      relationship,\n      relatedRecord\n    } = operation as AddToRelatedRecordsOperation;\n    return {\n      op: 'addToRelatedRecords',\n      record: cloneRecordIdentity(record),\n      relationship,\n      relatedRecords: [cloneRecordIdentity(relatedRecord)]\n    } as AddToRelatedRecordsRequest;\n  },\n\n  removeFromRelatedRecords(operation: RecordOperation): RecordTransformRequest {\n    const {\n      record,\n      relationship,\n      relatedRecord\n    } = operation as RemoveFromRelatedRecordsOperation;\n    return {\n      op: 'removeFromRelatedRecords',\n      record: cloneRecordIdentity(record),\n      relationship,\n      relatedRecords: [cloneRecordIdentity(relatedRecord)]\n    } as RemoveFromRelatedRecordsRequest;\n  },\n\n  replaceRelatedRecord(operation: RecordOperation): RecordTransformRequest {\n    const record = cloneRecordIdentity(operation.record);\n    const {\n      relationship,\n      relatedRecord\n    } = operation as ReplaceRelatedRecordOperation;\n\n    deepSet(record, ['relationships', relationship, 'data'], relatedRecord);\n\n    return {\n      op: 'updateRecord',\n      record\n    } as UpdateRecordRequest;\n  },\n\n  replaceRelatedRecords(operation: RecordOperation): RecordTransformRequest {\n    const record = cloneRecordIdentity(operation.record);\n    const {\n      relationship,\n      relatedRecords\n    } = operation as ReplaceRelatedRecordsOperation;\n\n    deepSet(record, ['relationships', relationship, 'data'], relatedRecords);\n\n    return {\n      op: 'updateRecord',\n      record\n    } as UpdateRecordRequest;\n  }\n};\n\nfunction replaceRecordAttribute(\n  record: RecordIdentity,\n  attribute: string,\n  value: any\n) {\n  deepSet(record, ['attributes', attribute], value);\n}\n\nfunction replaceRecordHasOne(\n  record: RecordIdentity,\n  relationship: string,\n  relatedRecord: RecordIdentity\n) {\n  deepSet(\n    record,\n    ['relationships', relationship, 'data'],\n    relatedRecord ? cloneRecordIdentity(relatedRecord) : null\n  );\n}\n\nfunction replaceRecordHasMany(\n  record: RecordIdentity,\n  relationship: string,\n  relatedRecords: RecordIdentity[]\n) {\n  deepSet(\n    record,\n    ['relationships', relationship, 'data'],\n    relatedRecords.map((r) => cloneRecordIdentity(r))\n  );\n}\n\nfunction handleChanges(\n  record: InitializedRecord,\n  recordDoc: RecordDocument,\n  details: JSONAPIResponse\n): TransformRequestProcessorResponse {\n  let updatedRecord: InitializedRecord = recordDoc.data as InitializedRecord;\n  let transforms: RecordTransform[] = [];\n  let updateOps = recordDiffs(record, updatedRecord);\n  if (updateOps.length > 0) {\n    transforms.push(buildTransform(updateOps));\n  }\n  if (recordDoc.included && recordDoc.included.length > 0) {\n    let includedOps = recordDoc.included.map((record) => {\n      return { op: 'updateRecord', record } as RecordOperation;\n    });\n    transforms.push(buildTransform<RecordOperation>(includedOps));\n  }\n  return { transforms, data: updatedRecord, details };\n}\n","import { Orbit, Assertion } from '@orbit/core';\nimport {\n  RequestOptions,\n  pullable,\n  pushable,\n  queryable,\n  updatable,\n  TransformNotAllowed,\n  QueryNotAllowed,\n  FullResponse,\n  DefaultRequestOptions\n} from '@orbit/data';\nimport {\n  RecordSource,\n  RecordSourceSettings,\n  RecordPullable,\n  RecordPushable,\n  RecordQueryable,\n  RecordUpdatable,\n  RecordOperation,\n  RecordTransform,\n  RecordQuery,\n  RecordQueryExpressionResult,\n  RecordOperationResult,\n  RecordQueryResult,\n  RecordTransformResult,\n  RecordSourceQueryOptions,\n  RecordQueryBuilder,\n  RecordTransformBuilder\n} from '@orbit/records';\nimport {\n  JSONAPIRequestProcessor,\n  JSONAPIRequestProcessorSettings,\n  FetchSettings\n} from './jsonapi-request-processor';\nimport {\n  JSONAPISerializer,\n  JSONAPISerializerSettings\n} from './jsonapi-serializer';\nimport {\n  JSONAPIURLBuilder,\n  JSONAPIURLBuilderSettings\n} from './jsonapi-url-builder';\nimport {\n  QueryRequestProcessor,\n  QueryRequestProcessors,\n  RecordQueryRequest,\n  getQueryRequests,\n  QueryRequestProcessorResponse\n} from './lib/query-requests';\nimport {\n  TransformRequestProcessor,\n  TransformRequestProcessors,\n  RecordTransformRequest,\n  getTransformRequests,\n  TransformRequestProcessorResponse\n} from './lib/transform-requests';\nimport {\n  SerializerClassForFn,\n  SerializerSettingsForFn,\n  SerializerForFn\n} from '@orbit/serializers';\nimport { JSONAPIResponse } from './jsonapi-response';\n\nconst { deprecate } = Orbit;\n\ninterface JSONAPISharedRequestOptions {\n  maxRequests?: number;\n  parallelRequests?: boolean;\n}\nexport interface JSONAPIQueryOptions\n  extends RecordSourceQueryOptions,\n    JSONAPISharedRequestOptions {}\n\nexport interface JSONAPITransformOptions\n  extends RequestOptions,\n    JSONAPISharedRequestOptions {}\n\nexport interface JSONAPISourceSettings<\n  QO extends JSONAPIQueryOptions = JSONAPIQueryOptions,\n  TO extends JSONAPITransformOptions = JSONAPITransformOptions,\n  QB = RecordQueryBuilder,\n  TB = RecordTransformBuilder\n> extends RecordSourceSettings<QO, TO, QB, TB> {\n  /**\n   * Deprecated in favor of `defaultTransformOptions.maxRequests`\n   *\n   * @deprecated since v0.17, remove in v0.18\n   */\n  maxRequestsPerTransform?: number;\n\n  /**\n   * Deprecated in favor of `defaultQueryOptions.maxRequests`\n   *\n   * @deprecated since v0.17, remove in v0.18\n   */\n  maxRequestsPerQuery?: number;\n\n  name?: string;\n  namespace?: string;\n  host?: string;\n  defaultFetchSettings?: FetchSettings;\n  allowedContentTypes?: string[];\n  serializerFor?: SerializerForFn;\n  serializerClassFor?: SerializerClassForFn;\n  serializerSettingsFor?: SerializerSettingsForFn;\n  SerializerClass?: new (\n    settings: JSONAPISerializerSettings\n  ) => JSONAPISerializer;\n  RequestProcessorClass?: new (\n    settings: JSONAPIRequestProcessorSettings\n  ) => JSONAPIRequestProcessor;\n  URLBuilderClass?: new (\n    settings: JSONAPIURLBuilderSettings\n  ) => JSONAPIURLBuilder;\n}\n\nexport interface JSONAPISource<\n  QO extends JSONAPIQueryOptions = JSONAPIQueryOptions,\n  TO extends JSONAPITransformOptions = JSONAPITransformOptions,\n  QB = RecordQueryBuilder,\n  TB = RecordTransformBuilder\n> extends RecordSource<QO, TO, QB, TB>,\n    RecordPullable<JSONAPIResponse[]>,\n    RecordPushable<JSONAPIResponse[]>,\n    RecordQueryable<JSONAPIResponse[], QB, QO>,\n    RecordUpdatable<JSONAPIResponse[], TB, TO> {}\n\n/**\n Source for accessing a JSON API compliant RESTful API with a network fetch\n request.\n\n If a single transform or query requires more than one fetch request,\n requests will be performed sequentially and resolved together. From the\n perspective of Orbit, these operations will all succeed or fail together. The\n `maxRequestsPerTransform` and `maxRequestsPerQuery` settings allow limits to be\n set on this behavior. These settings should be set to `1` if your client/server\n configuration is unable to resolve partially successful transforms / queries.\n\n @class JSONAPISource\n @extends Source\n */\n@pullable\n@pushable\n@queryable\n@updatable\nexport class JSONAPISource<\n    QO extends JSONAPIQueryOptions = JSONAPIQueryOptions,\n    TO extends JSONAPITransformOptions = JSONAPITransformOptions,\n    QB = RecordQueryBuilder,\n    TB = RecordTransformBuilder\n  >\n  extends RecordSource<QO, TO, QB, TB>\n  implements\n    RecordPullable<JSONAPIResponse[]>,\n    RecordPushable<JSONAPIResponse[]>,\n    RecordQueryable<JSONAPIResponse[], QB, QO>,\n    RecordUpdatable<JSONAPIResponse[], TB, TO> {\n  requestProcessor: JSONAPIRequestProcessor;\n\n  constructor(settings: JSONAPISourceSettings<QO, TO, QB, TB>) {\n    settings.name = settings.name || 'jsonapi';\n\n    super(settings);\n\n    let {\n      name,\n      maxRequestsPerTransform,\n      maxRequestsPerQuery,\n      namespace,\n      host,\n      defaultFetchSettings,\n      allowedContentTypes,\n      serializerFor,\n      serializerClassFor,\n      serializerSettingsFor,\n      SerializerClass,\n      RequestProcessorClass,\n      URLBuilderClass,\n      keyMap\n    } = settings;\n\n    if (this.schema === undefined) {\n      throw new Assertion(\n        \"JSONAPISource's `schema` must be specified in the  `settings` passed to its constructor\"\n      );\n    }\n\n    if (this._defaultQueryOptions === undefined) {\n      this._defaultQueryOptions = {} as DefaultRequestOptions<QO>;\n    }\n    if (this._defaultTransformOptions === undefined) {\n      this._defaultTransformOptions = {} as DefaultRequestOptions<TO>;\n    }\n\n    // Parallelize query requests by default (but not transform requests)\n    if (this._defaultQueryOptions.parallelRequests === undefined) {\n      this._defaultQueryOptions.parallelRequests = true;\n    }\n\n    if (maxRequestsPerTransform !== undefined) {\n      deprecate(\n        \"The 'maxRequestsPerTransform' setting for 'JSONAPSource' has been deprecated in favor of 'defaultTransformOptions.maxRequests'.\"\n      );\n      this._defaultTransformOptions.maxRequests = maxRequestsPerTransform;\n    }\n    if (maxRequestsPerQuery !== undefined) {\n      deprecate(\n        \"The 'maxRequestsPerQuery' setting for 'JSONAPSource' has been deprecated in favor of 'defaultQueryOptions.maxRequests'.\"\n      );\n      this._defaultQueryOptions.maxRequests = maxRequestsPerQuery;\n    }\n\n    RequestProcessorClass = RequestProcessorClass || JSONAPIRequestProcessor;\n    this.requestProcessor = new RequestProcessorClass({\n      sourceName: name,\n      serializerFor,\n      serializerClassFor,\n      serializerSettingsFor,\n      SerializerClass,\n      URLBuilderClass: URLBuilderClass || JSONAPIURLBuilder,\n      allowedContentTypes,\n      defaultFetchSettings,\n      namespace,\n      host,\n      schema: this.schema,\n      keyMap\n    });\n  }\n\n  /**\n   * Deprecated in favor of `defaultTransformOptions.maxRequests`\n   *\n   * @deprecated since v0.17, remove in v0.18\n   */\n  get maxRequestsPerTransform(): number | undefined {\n    deprecate(\n      \"The 'maxRequestsPerTransform' property for 'JSONAPSource' has been deprecated in favor of 'defaultTransformOptions.maxRequests'.\"\n    );\n    return this._defaultTransformOptions?.maxRequests;\n  }\n\n  /**\n   * Deprecated in favor of `defaultTransformOptions.maxRequests`\n   *\n   * @deprecated since v0.17, remove in v0.18\n   */\n  set maxRequestsPerTransform(val: number | undefined) {\n    deprecate(\n      \"The 'maxRequestsPerTransform' property for 'JSONAPSource' has been deprecated in favor of 'defaultTransformOptions.maxRequests'.\"\n    );\n    if (this._defaultTransformOptions === undefined) {\n      this._defaultTransformOptions = {} as DefaultRequestOptions<TO>;\n    }\n    this._defaultTransformOptions.maxRequests = val;\n  }\n\n  /**\n   * Deprecated in favor of `defaultQueryOptions.maxRequests`\n   *\n   * @deprecated since v0.17, remove in v0.18\n   */\n  get maxRequestsPerQuery(): number | undefined {\n    deprecate(\n      \"The 'maxRequestsPerQuery' property for 'JSONAPSource' has been deprecated in favor of 'defaultQueryOptions.maxRequests'.\"\n    );\n    return this._defaultQueryOptions?.maxRequests;\n  }\n\n  /**\n   * Deprecated in favor of `defaultQueryOptions.maxRequests`\n   *\n   * @deprecated since v0.17, remove in v0.18\n   */\n  set maxRequestsPerQuery(val: number | undefined) {\n    deprecate(\n      \"The 'maxRequestsPerQuery' property for 'JSONAPSource' has been deprecated in favor of 'defaultQueryOptions.maxRequests'.\"\n    );\n    if (this._defaultQueryOptions === undefined) {\n      this._defaultQueryOptions = {} as DefaultRequestOptions<QO>;\n    }\n    this._defaultQueryOptions.maxRequests = val;\n  }\n\n  /////////////////////////////////////////////////////////////////////////////\n  // Pushable interface implementation\n  /////////////////////////////////////////////////////////////////////////////\n\n  async _push(\n    transform: RecordTransform\n  ): Promise<FullResponse<undefined, JSONAPIResponse[], RecordOperation>> {\n    if (this.transformLog.contains(transform.id)) {\n      return {};\n    }\n\n    const responses = await this.processTransformRequests(transform);\n    const details: JSONAPIResponse[] = [];\n    const transforms: RecordTransform[] = [];\n\n    for (let response of responses) {\n      if (response.transforms) {\n        Array.prototype.push.apply(transforms, response.transforms);\n      }\n      if (response.details) {\n        details.push(response.details);\n      }\n    }\n\n    return {\n      transforms: [transform, ...transforms],\n      details\n    };\n  }\n\n  /////////////////////////////////////////////////////////////////////////////\n  // Pullable interface implementation\n  /////////////////////////////////////////////////////////////////////////////\n\n  async _pull(\n    query: RecordQuery\n  ): Promise<FullResponse<undefined, JSONAPIResponse[], RecordOperation>> {\n    const responses = await this.processQueryRequests(query);\n    const details: JSONAPIResponse[] = [];\n    const transforms: RecordTransform[] = [];\n\n    for (let response of responses) {\n      if (response.transforms) {\n        Array.prototype.push.apply(transforms, response.transforms);\n      }\n      if (response.details) {\n        details.push(response.details);\n      }\n    }\n\n    return {\n      transforms,\n      details\n    };\n  }\n\n  /////////////////////////////////////////////////////////////////////////////\n  // Queryable interface implementation\n  /////////////////////////////////////////////////////////////////////////////\n\n  async _query(\n    query: RecordQuery\n  ): Promise<\n    FullResponse<RecordQueryResult, JSONAPIResponse[], RecordOperation>\n  > {\n    const responses = await this.processQueryRequests(query);\n    const details: JSONAPIResponse[] = [];\n    const transforms: RecordTransform[] = [];\n    const data: RecordQueryExpressionResult[] = [];\n\n    for (let response of responses) {\n      if (response.transforms) {\n        Array.prototype.push.apply(transforms, response.transforms);\n      }\n      if (response.details) {\n        details.push(response.details);\n      }\n      data.push(response.data);\n    }\n\n    return {\n      data: Array.isArray(query.expressions) ? data : data[0],\n      details,\n      transforms\n    };\n  }\n\n  /////////////////////////////////////////////////////////////////////////////\n  // Updatable interface implementation\n  /////////////////////////////////////////////////////////////////////////////\n\n  async _update(\n    transform: RecordTransform\n  ): Promise<\n    FullResponse<RecordTransformResult, JSONAPIResponse[], RecordOperation>\n  > {\n    if (this.transformLog.contains(transform.id)) {\n      return {};\n    }\n\n    const responses = await this.processTransformRequests(transform);\n    const details: JSONAPIResponse[] = [];\n    const transforms: RecordTransform[] = [];\n    const data: RecordOperationResult[] = [];\n\n    for (let response of responses) {\n      if (response.transforms) {\n        Array.prototype.push.apply(transforms, response.transforms);\n      }\n      if (response.details) {\n        details.push(response.details);\n      }\n      data.push(response.data);\n    }\n\n    return {\n      data: Array.isArray(transform.operations) ? data : data[0],\n      details,\n      transforms: [transform, ...transforms]\n    };\n  }\n\n  protected getQueryRequestProcessor(\n    request: RecordQueryRequest\n  ): QueryRequestProcessor {\n    return QueryRequestProcessors[request.op];\n  }\n\n  protected getTransformRequestProcessor(\n    request: RecordTransformRequest\n  ): TransformRequestProcessor {\n    return TransformRequestProcessors[request.op];\n  }\n\n  protected async processQueryRequests(\n    query: RecordQuery\n  ): Promise<QueryRequestProcessorResponse[]> {\n    const options = this.getQueryOptions(query);\n    const requests = getQueryRequests(this.requestProcessor, query);\n    if (\n      options?.maxRequests !== undefined &&\n      requests.length > options.maxRequests\n    ) {\n      throw new QueryNotAllowed(\n        `This query requires ${requests.length} requests, which exceeds the specified limit of ${options.maxRequests} requests per query.`,\n        query\n      );\n    }\n\n    if (options?.parallelRequests) {\n      return Promise.all(\n        requests.map((request) => {\n          const processor = this.getQueryRequestProcessor(request);\n          return processor(this.requestProcessor, request);\n        })\n      );\n    } else {\n      const responses = [];\n      for (let request of requests) {\n        const processor = this.getQueryRequestProcessor(request);\n        responses.push(await processor(this.requestProcessor, request));\n      }\n      return responses;\n    }\n  }\n\n  protected async processTransformRequests(\n    transform: RecordTransform\n  ): Promise<TransformRequestProcessorResponse[]> {\n    const options = this.getTransformOptions(transform);\n    const requests = getTransformRequests(this.requestProcessor, transform);\n    if (\n      options?.maxRequests !== undefined &&\n      requests.length > options.maxRequests\n    ) {\n      throw new TransformNotAllowed(\n        `This transform requires ${requests.length} requests, which exceeds the specified limit of ${options.maxRequests} requests per transform.`,\n        transform\n      );\n    }\n\n    if (options?.parallelRequests) {\n      return Promise.all(\n        requests.map((request) => {\n          const processor = this.getTransformRequestProcessor(request);\n          return processor(this.requestProcessor, request);\n        })\n      );\n    } else {\n      const responses = [];\n      for (let request of requests) {\n        const processor = this.getTransformRequestProcessor(request);\n        responses.push(await processor(this.requestProcessor, request));\n      }\n      return responses;\n    }\n  }\n}\n","import { deepSet, Dict } from '@orbit/utils';\nimport { Orbit, Assertion } from '@orbit/core';\nimport {\n  RecordSchema,\n  RecordKeyMap,\n  InitializedRecord,\n  RecordIdentity,\n  RecordOperation,\n  ModelDefinition\n} from '@orbit/records';\nimport {\n  Serializer,\n  SerializerForFn,\n  StringSerializer,\n  buildSerializerSettingsFor\n} from '@orbit/serializers';\nimport {\n  Resource,\n  ResourceDocument,\n  ResourceIdentity,\n  ResourceRelationship\n} from './resource-document';\nimport {\n  ResourceAtomicOperation,\n  RecordOperationsDocument\n} from './resource-operations';\nimport { ResourceAtomicOperationsDocument } from './resource-operations';\nimport { RecordDocument } from './record-document';\nimport { JSONAPIResourceSerializer } from './serializers/jsonapi-resource-serializer';\nimport { JSONAPIResourceIdentitySerializer } from './serializers/jsonapi-resource-identity-serializer';\nimport { buildJSONAPISerializerFor } from './serializers/jsonapi-serializer-builder';\nimport { JSONAPISerializers } from './serializers/jsonapi-serializers';\nimport { JSONAPIAtomicOperationSerializer } from './serializers/jsonapi-atomic-operation-serializer';\nimport { JSONAPIResourceFieldSerializer } from './serializers/jsonapi-resource-field-serializer';\n\nconst { deprecate } = Orbit;\n\nexport interface JSONAPISerializationOptions {\n  primaryRecord?: InitializedRecord;\n  primaryRecords?: InitializedRecord[];\n}\n\nexport interface JSONAPISerializerSettings {\n  schema: RecordSchema;\n  keyMap?: RecordKeyMap;\n  serializers?: Dict<Serializer>;\n}\n\n/**\n * @deprecated since v0.17, remove in v0.18\n */\nexport class JSONAPISerializer\n  implements\n    Serializer<\n      RecordDocument,\n      ResourceDocument,\n      JSONAPISerializationOptions,\n      JSONAPISerializationOptions\n    > {\n  protected _schema: RecordSchema;\n  protected _keyMap?: RecordKeyMap;\n  protected _serializerFor: SerializerForFn;\n\n  constructor(settings: JSONAPISerializerSettings) {\n    deprecate(\n      \"The 'JSONAPISerializer' class has deprecated. Use 'serializerFor' instead.\"\n    );\n\n    const { schema, keyMap, serializers } = settings;\n\n    let serializerFor: SerializerForFn | undefined;\n    if (serializers) {\n      serializerFor = (type: string) => serializers[type];\n    }\n    const serializerSettingsFor = buildSerializerSettingsFor({\n      settingsByType: {\n        [JSONAPISerializers.ResourceField]: {\n          serializationOptions: { inflectors: ['dasherize'] }\n        },\n        [JSONAPISerializers.ResourceType]: {\n          serializationOptions: { inflectors: ['pluralize', 'dasherize'] }\n        }\n      }\n    });\n\n    this._schema = schema;\n    this._keyMap = keyMap;\n    this._serializerFor = buildJSONAPISerializerFor({\n      schema,\n      keyMap,\n      serializerFor,\n      serializerSettingsFor\n    });\n  }\n\n  get schema(): RecordSchema {\n    return this._schema;\n  }\n\n  get keyMap(): RecordKeyMap | undefined {\n    return this._keyMap;\n  }\n\n  get serializerFor(): SerializerForFn {\n    return this._serializerFor;\n  }\n\n  /* eslint-disable-next-line @typescript-eslint/no-unused-vars */\n  resourceKey(type: string): string {\n    return 'id';\n  }\n\n  resourceType(type: string): string {\n    return this.typeSerializer.serialize(type) as string;\n  }\n\n  resourceRelationship(type: string | undefined, relationship: string): string {\n    return this.fieldSerializer.serialize(relationship, { type }) as string;\n  }\n\n  resourceAttribute(type: string | undefined, attr: string): string {\n    return this.fieldSerializer.serialize(attr, { type }) as string;\n  }\n\n  resourceIdentity(identity: RecordIdentity): Resource {\n    return {\n      type: this.resourceType(identity.type),\n      id: this.resourceId(identity.type, identity.id)\n    };\n  }\n\n  resourceIds(type: string, ids: string[]): (string | undefined)[] {\n    return ids.map((id) => this.resourceId(type, id));\n  }\n\n  resourceId(type: string, id: string): string | undefined {\n    let resourceKey = this.resourceKey(type);\n\n    if (resourceKey === 'id') {\n      return id;\n    } else if (this.keyMap) {\n      return this.keyMap.idToKey(type, resourceKey, id);\n    } else {\n      throw new Assertion(\n        `A keyMap is required to determine an id from the key '${resourceKey}'`\n      );\n    }\n  }\n\n  recordId(type: string, resourceId: string): string {\n    let resourceKey = this.resourceKey(type);\n\n    if (resourceKey === 'id') {\n      return resourceId;\n    }\n\n    let existingId;\n    if (this.keyMap) {\n      existingId = this.keyMap.keyToId(type, resourceKey, resourceId);\n      if (existingId) {\n        return existingId;\n      }\n    } else {\n      throw new Assertion(\n        `A keyMap is required to determine an id from the key '${resourceKey}'`\n      );\n    }\n\n    return this._generateNewId(type, resourceKey, resourceId);\n  }\n\n  recordType(resourceType: string): string {\n    return this.typeSerializer.deserialize(resourceType) as string;\n  }\n\n  recordIdentity(resourceIdentity: ResourceIdentity): RecordIdentity {\n    let type = this.recordType(resourceIdentity.type);\n    let id = this.recordId(type, resourceIdentity.id);\n    return { type, id };\n  }\n\n  recordAttribute(type: string, resourceAttribute: string): string {\n    return this.fieldSerializer.deserialize(resourceAttribute) as string;\n  }\n\n  recordRelationship(type: string, resourceRelationship: string): string {\n    return this.fieldSerializer.deserialize(resourceRelationship) as string;\n  }\n\n  serialize(document: RecordDocument): ResourceDocument {\n    let data = document.data;\n\n    return {\n      data: Array.isArray(data)\n        ? this.serializeRecords(data as InitializedRecord[])\n        : this.serializeRecord(data as InitializedRecord)\n    };\n  }\n\n  serializeAtomicOperationsDocument(\n    document: RecordOperationsDocument\n  ): ResourceAtomicOperationsDocument {\n    return {\n      'atomic:operations': this.serializeAtomicOperations(document.operations)\n    };\n  }\n\n  serializeAtomicOperations(\n    operations: RecordOperation[]\n  ): ResourceAtomicOperation[] {\n    return operations.map((operation) =>\n      this.serializeAtomicOperation(operation)\n    );\n  }\n\n  serializeAtomicOperation(\n    operation: RecordOperation\n  ): ResourceAtomicOperation {\n    return this.atomicOperationSerializer.serialize(operation);\n  }\n\n  serializeRecords(records: InitializedRecord[]): Resource[] {\n    return records.map((record) => this.serializeRecord(record));\n  }\n\n  serializeRecord(record: InitializedRecord): Resource {\n    const resource: Resource = {\n      type: this.resourceType(record.type)\n    };\n    const model: ModelDefinition = this._schema.getModel(record.type);\n\n    this.serializeId(resource, record, model);\n    this.serializeAttributes(resource, record, model);\n    this.serializeRelationships(resource, record, model);\n\n    return resource;\n  }\n\n  serializeIdentity(record: InitializedRecord): Resource {\n    return {\n      type: this.resourceType(record.type),\n      id: this.resourceId(record.type, record.id)\n    };\n  }\n\n  serializeId(\n    resource: Resource,\n    record: RecordIdentity,\n    /* eslint-disable-next-line @typescript-eslint/no-unused-vars */\n    model: ModelDefinition\n  ): void {\n    let value = this.resourceId(record.type, record.id);\n    if (value !== undefined) {\n      resource.id = value;\n    }\n  }\n\n  serializeAttributes(\n    resource: Resource,\n    record: InitializedRecord,\n    model: ModelDefinition\n  ): void {\n    if (record.attributes) {\n      Object.keys(record.attributes).forEach((attr) => {\n        this.serializeAttribute(resource, record, attr, model);\n      });\n    }\n  }\n\n  serializeAttribute(\n    resource: Resource,\n    record: InitializedRecord,\n    attr: string,\n    model: ModelDefinition\n  ): void {\n    let value: any = record.attributes?.[attr];\n    if (value === undefined) {\n      return;\n    }\n    const attrOptions = model.attributes?.[attr];\n    if (attrOptions === undefined) {\n      return;\n    }\n    const serializer = this.serializerFor(attrOptions.type || 'unknown');\n    if (serializer) {\n      const serializationOptions =\n        attrOptions.serialization ?? (attrOptions as any).serializationOptions;\n\n      if ((attrOptions as any).serializationOptions !== undefined) {\n        deprecate(\n          `The attribute '${attr}' for '${record.type}' has been assigned \\`serializationOptions\\` in the schema. Use \\`serialization\\` instead.`\n        );\n      }\n\n      value =\n        value === null\n          ? null\n          : serializer.serialize(value, serializationOptions);\n    }\n    deepSet(\n      resource,\n      ['attributes', this.resourceAttribute(record.type, attr)],\n      value\n    );\n  }\n\n  serializeRelationships(\n    resource: Resource,\n    record: InitializedRecord,\n    model: ModelDefinition\n  ): void {\n    if (record.relationships) {\n      Object.keys(record.relationships).forEach((relationship) => {\n        this.serializeRelationship(resource, record, relationship, model);\n      });\n    }\n  }\n\n  serializeRelationship(\n    resource: Resource,\n    record: InitializedRecord,\n    relationship: string,\n    model: ModelDefinition\n  ): void {\n    const value = record.relationships?.[relationship].data;\n\n    if (value === undefined) {\n      return;\n    }\n    if (model.relationships?.[relationship] === undefined) {\n      return;\n    }\n\n    let data;\n\n    if (Array.isArray(value)) {\n      data = (value as RecordIdentity[]).map((id) => this.resourceIdentity(id));\n    } else if (value !== null) {\n      data = this.resourceIdentity(value as RecordIdentity);\n    } else {\n      data = null;\n    }\n\n    const resourceRelationship = this.resourceRelationship(\n      record.type,\n      relationship\n    );\n\n    deepSet(resource, ['relationships', resourceRelationship, 'data'], data);\n  }\n\n  deserialize(\n    document: ResourceDocument,\n    options?: JSONAPISerializationOptions\n  ): RecordDocument {\n    let result: RecordDocument;\n    let data;\n\n    if (Array.isArray(document.data)) {\n      let primaryRecords = options?.primaryRecords;\n      if (primaryRecords) {\n        data = (document.data as Resource[]).map((entry, i) => {\n          return this.deserializeResource(entry, primaryRecords?.[i]);\n        });\n      } else {\n        data = (document.data as Resource[]).map((entry) =>\n          this.deserializeResource(entry)\n        );\n      }\n    } else if (document.data !== null) {\n      let primaryRecord = options && options.primaryRecord;\n      if (primaryRecord) {\n        data = this.deserializeResource(\n          document.data as Resource,\n          primaryRecord\n        );\n      } else {\n        data = this.deserializeResource(document.data as Resource);\n      }\n    } else {\n      data = null;\n    }\n    result = { data };\n\n    if (document.included) {\n      result.included = document.included.map((e) =>\n        this.deserializeResource(e)\n      );\n    }\n\n    if (document.links) {\n      result.links = document.links;\n    }\n\n    if (document.meta) {\n      result.meta = document.meta;\n    }\n\n    return result;\n  }\n\n  deserializeAtomicOperationsDocument(\n    document: ResourceAtomicOperationsDocument\n  ): RecordOperationsDocument {\n    const result: RecordOperationsDocument = {\n      operations: this.deserializeAtomicOperations(\n        document['atomic:operations']\n      )\n    };\n\n    if (document.links) {\n      result.links = document.links;\n    }\n\n    if (document.meta) {\n      result.meta = document.meta;\n    }\n\n    return result;\n  }\n\n  deserializeAtomicOperations(\n    operations: ResourceAtomicOperation[]\n  ): RecordOperation[] {\n    return operations.map((operation) =>\n      this.deserializeAtomicOperation(operation)\n    );\n  }\n\n  deserializeAtomicOperation(\n    operation: ResourceAtomicOperation\n  ): RecordOperation {\n    return this.atomicOperationSerializer.deserialize(operation);\n  }\n\n  deserializeResourceIdentity(\n    resource: Resource,\n    primaryRecord?: InitializedRecord\n  ): InitializedRecord {\n    let record: InitializedRecord;\n    const type: string = this.recordType(resource.type);\n    const resourceKey = this.resourceKey(type);\n\n    if (resourceKey === 'id') {\n      if (resource.id) {\n        record = { type, id: resource.id };\n      } else {\n        throw new Assertion(`A resource has been enountered without an id`);\n      }\n    } else if (this.keyMap) {\n      let id: string;\n      let keys: Dict<string> | undefined;\n\n      if (resource.id) {\n        keys = {\n          [resourceKey]: resource.id\n        };\n\n        id =\n          (primaryRecord && primaryRecord.id) ||\n          this.keyMap.idFromKeys(type, keys) ||\n          this.schema.generateId(type);\n      } else {\n        id =\n          (primaryRecord && primaryRecord.id) || this.schema.generateId(type);\n      }\n\n      record = { type, id };\n\n      if (keys) {\n        record.keys = keys;\n      }\n    } else {\n      throw new Assertion(\n        `A keyMap is required to determine an id from the key '${resourceKey}'`\n      );\n    }\n\n    if (this.keyMap) {\n      this.keyMap.pushRecord(record);\n    }\n\n    return record;\n  }\n\n  deserializeResource(\n    resource: Resource,\n    primaryRecord?: InitializedRecord\n  ): InitializedRecord {\n    const record = this.deserializeResourceIdentity(resource, primaryRecord);\n    const model: ModelDefinition = this._schema.getModel(record.type);\n\n    this.deserializeAttributes(record, resource, model);\n    this.deserializeRelationships(record, resource, model);\n    this.deserializeLinks(record, resource, model);\n    this.deserializeMeta(record, resource, model);\n\n    return record;\n  }\n\n  deserializeAttributes(\n    record: InitializedRecord,\n    resource: Resource,\n    model: ModelDefinition\n  ): void {\n    if (resource.attributes) {\n      Object.keys(resource.attributes).forEach((resourceAttribute) => {\n        let attribute = this.recordAttribute(record.type, resourceAttribute);\n        if (this.schema.hasAttribute(record.type, attribute)) {\n          let value = resource.attributes?.[resourceAttribute];\n          if (value !== undefined) {\n            this.deserializeAttribute(record, attribute, value, model);\n          }\n        }\n      });\n    }\n  }\n\n  deserializeAttribute(\n    record: InitializedRecord,\n    attr: string,\n    value: unknown,\n    model: ModelDefinition\n  ): void {\n    record.attributes = record.attributes || {};\n    if (value !== undefined && value !== null) {\n      const attrOptions = model.attributes?.[attr];\n      if (attrOptions === undefined) {\n        return;\n      }\n      const serializer = this.serializerFor(attrOptions?.type || 'unknown');\n      if (serializer) {\n        const deserializationOptions =\n          attrOptions.deserialization ??\n          (attrOptions as any).deserializationOptions;\n\n        if ((attrOptions as any).deserializationOptions !== undefined) {\n          deprecate(\n            `The attribute '${attr}' for '${record.type}' has been assigned \\`deserializationOptions\\` in the schema. Use \\`deserialization\\` instead.`\n          );\n        }\n\n        value = serializer.deserialize(value, deserializationOptions);\n      }\n    }\n    record.attributes[attr] = value;\n  }\n\n  deserializeRelationships(\n    record: InitializedRecord,\n    resource: Resource,\n    model: ModelDefinition\n  ): void {\n    if (resource.relationships) {\n      Object.keys(resource.relationships).forEach((resourceRel) => {\n        let relationship = this.recordRelationship(record.type, resourceRel);\n        if (this.schema.hasRelationship(record.type, relationship)) {\n          let value = resource.relationships?.[resourceRel];\n          if (value !== undefined) {\n            this.deserializeRelationship(record, relationship, value, model);\n          }\n        }\n      });\n    }\n  }\n\n  deserializeRelationship(\n    record: InitializedRecord,\n    relationship: string,\n    value: ResourceRelationship,\n    /* eslint-disable-next-line @typescript-eslint/no-unused-vars */\n    model: ModelDefinition\n  ): void {\n    let resourceData = value.data;\n\n    if (resourceData !== undefined) {\n      let data;\n\n      if (resourceData === null) {\n        data = null;\n      } else if (Array.isArray(resourceData)) {\n        data = (resourceData as ResourceIdentity[]).map((resourceIdentity) =>\n          this.recordIdentity(resourceIdentity)\n        );\n      } else {\n        data = this.recordIdentity(resourceData as ResourceIdentity);\n      }\n\n      deepSet(record, ['relationships', relationship, 'data'], data);\n    }\n\n    let { links, meta } = value;\n\n    if (links !== undefined) {\n      deepSet(record, ['relationships', relationship, 'links'], links);\n    }\n\n    if (meta !== undefined) {\n      deepSet(record, ['relationships', relationship, 'meta'], meta);\n    }\n  }\n\n  deserializeLinks(\n    record: InitializedRecord,\n    resource: Resource,\n    /* eslint-disable-next-line @typescript-eslint/no-unused-vars */\n    model: ModelDefinition\n  ): void {\n    if (resource.links) {\n      record.links = resource.links;\n    }\n  }\n\n  deserializeMeta(\n    record: InitializedRecord,\n    resource: Resource,\n    /* eslint-disable-next-line @typescript-eslint/no-unused-vars */\n    model: ModelDefinition\n  ): void {\n    if (resource.meta) {\n      record.meta = resource.meta;\n    }\n  }\n\n  // Protected / Private\n\n  protected get resourceSerializer(): JSONAPIResourceSerializer {\n    return this.serializerFor(\n      JSONAPISerializers.Resource\n    ) as JSONAPIResourceSerializer;\n  }\n\n  protected get identitySerializer(): JSONAPIResourceIdentitySerializer {\n    return this.serializerFor(\n      JSONAPISerializers.ResourceIdentity\n    ) as JSONAPIResourceIdentitySerializer;\n  }\n\n  protected get typeSerializer(): StringSerializer {\n    return this.serializerFor(\n      JSONAPISerializers.ResourceType\n    ) as StringSerializer;\n  }\n\n  protected get fieldSerializer(): JSONAPIResourceFieldSerializer {\n    return this.serializerFor(\n      JSONAPISerializers.ResourceField\n    ) as JSONAPIResourceFieldSerializer;\n  }\n\n  protected get atomicOperationSerializer(): JSONAPIAtomicOperationSerializer {\n    return this.serializerFor(\n      JSONAPISerializers.ResourceAtomicOperation\n    ) as JSONAPIAtomicOperationSerializer;\n  }\n\n  protected _generateNewId(\n    type: string,\n    keyName: string,\n    keyValue: string\n  ): string {\n    let id = this.schema.generateId(type);\n\n    if (this.keyMap) {\n      this.keyMap.pushRecord({\n        type,\n        id,\n        keys: {\n          [keyName]: keyValue\n        }\n      });\n    } else {\n      throw new Assertion(\n        `A keyMap is required to generate ids for resource type '${type}'`\n      );\n    }\n\n    return id;\n  }\n}\n","import { RecordOperation } from '@orbit/records';\nimport {\n  ResourceAtomicOperation,\n  RecordOperationsDocument,\n  ResourceAtomicOperationsDocument\n} from '../resource-operations';\nimport { JSONAPIBaseSerializer } from './jsonapi-base-serializer';\n\nexport class JSONAPIAtomicOperationsDocumentSerializer extends JSONAPIBaseSerializer<\n  RecordOperationsDocument,\n  ResourceAtomicOperationsDocument,\n  unknown,\n  unknown\n> {\n  serialize(\n    document: RecordOperationsDocument\n  ): ResourceAtomicOperationsDocument {\n    const result: ResourceAtomicOperationsDocument = {\n      'atomic:operations': this.serializeAtomicOperations(document.operations)\n    };\n\n    this.serializeLinks(document, result);\n    this.serializeMeta(document, result);\n\n    return result;\n  }\n\n  protected serializeAtomicOperations(\n    operations: RecordOperation[]\n  ): ResourceAtomicOperation[] {\n    return operations.map((operation) =>\n      this.serializeAtomicOperation(operation)\n    );\n  }\n\n  protected serializeAtomicOperation(\n    operation: RecordOperation\n  ): ResourceAtomicOperation {\n    return this.atomicOperationSerializer.serialize(operation);\n  }\n\n  /* eslint-disable @typescript-eslint/no-unused-vars */\n  protected serializeLinks(\n    document: RecordOperationsDocument,\n    resDocument: ResourceAtomicOperationsDocument\n  ): void {}\n\n  protected serializeMeta(\n    document: RecordOperationsDocument,\n    resDocument: ResourceAtomicOperationsDocument\n  ): void {}\n  /* eslint-enable @typescript-eslint/no-unused-vars */\n\n  deserialize(\n    document: ResourceAtomicOperationsDocument\n  ): RecordOperationsDocument {\n    const result: RecordOperationsDocument = {\n      operations: this.deserializeAtomicOperations(\n        document['atomic:operations']\n      )\n    };\n\n    this.deserializeLinks(document, result);\n    this.deserializeMeta(document, result);\n\n    return result;\n  }\n\n  deserializeAtomicOperations(\n    operations: ResourceAtomicOperation[]\n  ): RecordOperation[] {\n    return operations.map((operation) =>\n      this.deserializeAtomicOperation(operation)\n    );\n  }\n\n  deserializeAtomicOperation(\n    operation: ResourceAtomicOperation\n  ): RecordOperation {\n    return this.atomicOperationSerializer.deserialize(operation);\n  }\n\n  protected deserializeLinks(\n    resDocument: ResourceAtomicOperationsDocument,\n    document: RecordOperationsDocument\n  ): void {\n    if (resDocument.links) {\n      document.links = resDocument.links;\n    }\n  }\n\n  protected deserializeMeta(\n    resDocument: ResourceAtomicOperationsDocument,\n    document: RecordOperationsDocument\n  ): void {\n    if (resDocument.meta) {\n      document.meta = resDocument.meta;\n    }\n  }\n}\n","import { InitializedRecord } from '@orbit/records';\nimport {\n  RecordResultsDocument,\n  ResourceAtomicResultsDocument\n} from '../resource-operations';\nimport { Resource } from '../resource-document';\nimport { JSONAPIBaseSerializer } from './jsonapi-base-serializer';\n\nexport class JSONAPIAtomicResultsDocumentSerializer extends JSONAPIBaseSerializer<\n  RecordResultsDocument,\n  ResourceAtomicResultsDocument,\n  unknown,\n  unknown\n> {\n  serialize(document: RecordResultsDocument): ResourceAtomicResultsDocument {\n    const result: ResourceAtomicResultsDocument = {\n      'atomic:results': this.serializeResults(document.results)\n    };\n\n    this.serializeLinks(document, result);\n    this.serializeMeta(document, result);\n\n    return result;\n  }\n\n  serializeResults(results: InitializedRecord[]): Resource[] {\n    return results.map((record) => this.resourceSerializer.serialize(record));\n  }\n\n  /* eslint-disable @typescript-eslint/no-unused-vars */\n  protected serializeLinks(\n    document: RecordResultsDocument,\n    resDocument: ResourceAtomicResultsDocument\n  ): void {}\n\n  protected serializeMeta(\n    document: RecordResultsDocument,\n    resDocument: ResourceAtomicResultsDocument\n  ): void {}\n  /* eslint-enable @typescript-eslint/no-unused-vars */\n\n  deserialize(document: ResourceAtomicResultsDocument): RecordResultsDocument {\n    const result: RecordResultsDocument = {\n      results: this.deserializeAtomicResults(document['atomic:results'])\n    };\n\n    this.deserializeLinks(document, result);\n    this.deserializeMeta(document, result);\n\n    return result;\n  }\n\n  deserializeAtomicResults(results: Resource[]): InitializedRecord[] {\n    return results.map((resource) =>\n      this.resourceSerializer.deserialize(resource)\n    );\n  }\n\n  protected deserializeLinks(\n    resDocument: ResourceAtomicResultsDocument,\n    document: RecordResultsDocument\n  ): void {\n    if (resDocument.links) {\n      document.links = resDocument.links;\n    }\n  }\n\n  protected deserializeMeta(\n    resDocument: ResourceAtomicResultsDocument,\n    document: RecordResultsDocument\n  ): void {\n    if (resDocument.meta) {\n      document.meta = resDocument.meta;\n    }\n  }\n}\n","/**\n * Code based on: https://github.com/mattbierner/hamt\n * Author: Matt Bierner\n * MIT license\n *\n * Which is based on: https://github.com/exclipy/pdata\n */\n\n/* eslint-disable */\nfunction _typeof(obj: any) { return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; }\n\n/* Configuration\n ******************************************************************************/\nconst SIZE = 5;\n\nconst BUCKET_SIZE = Math.pow(2, SIZE);\n\nconst MASK = BUCKET_SIZE - 1;\n\nconst MAX_INDEX_NODE = BUCKET_SIZE / 2;\n\nconst MIN_ARRAY_NODE = BUCKET_SIZE / 4;\n\n/*\n ******************************************************************************/\nconst nothing = {};\n\nfunction constant(x: any) {\n  return function () {\n    return x;\n  };\n}\n\n/**\n  Get 32 bit hash of string.\n\n  Based on:\n  http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery\n*/\nfunction hash(str: any) {\n  const type = typeof str === 'undefined' ? 'undefined' : _typeof(str);\n  if (type === 'number') return str;\n  if (type !== 'string') str += '';\n\n  let h = 0;\n  for (var i = 0, len = str.length; i < len; ++i) {\n    var c = str.charCodeAt(i);\n    h = (h << 5) - h + c | 0;\n  }\n  return h;\n}\n\n/* Bit Ops\n ******************************************************************************/\n/**\n  Hamming weight.\n\n  Taken from: http://jsperf.com/hamming-weight\n*/\nfunction popcount(x: any): any {\n  x -= x >> 1 & 0x55555555;\n  x = (x & 0x33333333) + (x >> 2 & 0x33333333);\n  x = x + (x >> 4) & 0x0f0f0f0f;\n  x += x >> 8;\n  x += x >> 16;\n  return x & 0x7f;\n}\n\nfunction hashFragment(shift: any, h: any): any {\n  return h >>> shift & MASK;\n}\n\nfunction toBitmap(x: any): any {\n  return 1 << x;\n}\n\nfunction fromBitmap(bitmap: any, bit: any): any {\n  return popcount(bitmap & bit - 1);\n}\n\n/* Array Ops\n ******************************************************************************/\n/**\n  Set a value in an array.\n\n  @param mutate Should the input array be mutated?\n  @param at Index to change.\n  @param v New value\n  @param arr Array.\n*/\nfunction arrayUpdate(mutate: boolean, at: number, v: any, arr: any[]): any[] {\n  var out = arr;\n  if (!mutate) {\n    var len = arr.length;\n    out = new Array(len);\n    for (var i = 0; i < len; ++i) {\n      out[i] = arr[i];\n    }\n  }\n  out[at] = v;\n  return out;\n}\n\n/**\n  Remove a value from an array.\n\n  @param mutate Should the input array be mutated?\n  @param at Index to remove.\n  @param arr Array.\n*/\nfunction arraySpliceOut(mutate: boolean, at: number, arr: any[]): any[] {\n  var len = arr.length;\n  var i = 0,\n      g = 0;\n  var out = arr;\n  if (mutate) {\n    i = g = at;\n  } else {\n    out = new Array(len - 1);\n    while (i < at) {\n      out[g++] = arr[i++];\n    }++i;\n  }\n  while (i < len) {\n    out[g++] = arr[i++];\n  }return out;\n}\n\n/**\n  Insert a value into an array.\n\n  @param mutate Should the input array be mutated?\n  @param at Index to insert at.\n  @param v Value to insert,\n  @param arr Array.\n*/\nfunction arraySpliceIn(mutate: boolean, at: number, v: any, arr: any[]): any[] {\n  var len = arr.length;\n  if (mutate) {\n    var _i = len;\n    while (_i >= at) {\n      arr[_i--] = arr[_i];\n    }arr[at] = v;\n    return arr;\n  }\n  var i = 0,\n      g = 0;\n  var out = new Array(len + 1);\n  while (i < at) {\n    out[g++] = arr[i++];\n  }out[at] = v;\n  while (i < len) {\n    out[++g] = arr[i++];\n  }return out;\n}\n\n/* Node Structures\n ******************************************************************************/\nconst LEAF = 1;\nconst COLLISION = 2;\nconst INDEX = 3;\nconst ARRAY = 4;\n\n/**\n  Empty node.\n*/\nconst empty = {\n  __hamt_isEmpty: true,\n\n  _modify(edit: any, keyEq: any, shift: any, f: any, h: any, k: any, size: any): any {\n    var v = f();\n    if (v === nothing) return empty;\n    ++size.value;\n    return Leaf(edit, h, k, v);\n  }\n};\n\nfunction isEmptyNode(x: any): boolean {\n  return x === empty || x && x.__hamt_isEmpty;\n}\n\n/**\n  Leaf holding a value.\n\n  @member edit Edit of the node.\n  @member hash Hash of key.\n  @member key Key.\n  @member value Value stored.\n*/\nfunction Leaf(edit: any, hash: any, key: any, value: any) {\n  return {\n    type: LEAF,\n    edit: edit,\n    hash: hash,\n    key: key,\n    value: value,\n    _modify: Leaf__modify\n  };\n}\n\n/**\n  Leaf holding multiple values with the same hash but different keys.\n\n  @member edit Edit of the node.\n  @member hash Hash of key.\n  @member children Array of collision children node.\n*/\nfunction Collision(edit: any, hash: any, children: any) {\n  return {\n    type: COLLISION,\n    edit: edit,\n    hash: hash,\n    children: children,\n    _modify: Collision__modify\n  };\n}\n\n/**\n  Internal node with a sparse set of children.\n\n  Uses a bitmap and array to pack children.\n\n  @member edit Edit of the node.\n  @member mask Bitmap that encode the positions of children in the array.\n  @member children Array of child nodes.\n*/\nfunction IndexedNode(edit: any, mask: any, children: any) {\n  return {\n    type: INDEX,\n    edit: edit,\n    mask: mask,\n    children: children,\n    _modify: IndexedNode__modify\n  };\n}\n\n/**\n  Internal node with many children.\n\n  @member edit Edit of the node.\n  @member size Number of children.\n  @member children Array of child nodes.\n*/\nfunction ArrayNode(edit: any, size: any, children: any) {\n  return {\n    type: ARRAY,\n    edit: edit,\n    size: size,\n    children: children,\n    _modify: ArrayNode__modify\n  };\n}\n\n/**\n    Is `node` a leaf node?\n*/\nfunction isLeaf(node: any): boolean {\n  return node === empty || node.type === LEAF || node.type === COLLISION;\n}\n\n/* Internal node operations.\n ******************************************************************************/\n/**\n  Expand an indexed node into an array node.\n\n  @param edit Current edit.\n  @param frag Index of added child.\n  @param child Added child.\n  @param mask Index node mask before child added.\n  @param subNodes Index node children before child added.\n*/\nfunction expand(edit: any, frag: any, child: any, bitmap: any, subNodes: any): any {\n  var arr = [];\n  var bit = bitmap;\n  var count = 0;\n  for (var i = 0; bit; ++i) {\n      if (bit & 1) arr[i] = subNodes[count++];\n      bit >>>= 1;\n  }\n  arr[frag] = child;\n  return ArrayNode(edit, count + 1, arr);\n}\n\n/**\n  Collapse an array node into a indexed node.\n\n  @param edit Current edit.\n  @param count Number of elements in new array.\n  @param removed Index of removed element.\n  @param elements Array node children before remove.\n*/\nfunction pack(edit: any, count: any, removed: any, elements: any): any {\n  var children = new Array(count - 1);\n  var g = 0;\n  var bitmap = 0;\n  for (var i = 0, len = elements.length; i < len; ++i) {\n    if (i !== removed) {\n      var elem = elements[i];\n      if (elem && !isEmptyNode(elem)) {\n        children[g++] = elem;\n        bitmap |= 1 << i;\n      }\n    }\n  }\n  return IndexedNode(edit, bitmap, children);\n}\n\n/**\n  Merge two leaf nodes.\n\n  @param shift Current shift.\n  @param h1 Node 1 hash.\n  @param n1 Node 1.\n  @param h2 Node 2 hash.\n  @param n2 Node 2.\n*/\nfunction mergeLeaves(edit: any, shift: any, h1: any, n1: any, h2: any, n2: any): any {\n  if (h1 === h2) return Collision(edit, h1, [n2, n1]);\n\n  var subH1 = hashFragment(shift, h1);\n  var subH2 = hashFragment(shift, h2);\n  return IndexedNode(edit, toBitmap(subH1) | toBitmap(subH2), subH1 === subH2 ? [mergeLeaves(edit, shift + SIZE, h1, n1, h2, n2)] : subH1 < subH2 ? [n1, n2] : [n2, n1]);\n}\n\n/**\n  Update an entry in a collision list.\n\n  @param mutate Should mutation be used?\n  @param edit Current edit.\n  @param keyEq Key compare function.\n  @param hash Hash of collision.\n  @param list Collision list.\n  @param f Update function.\n  @param k Key to update.\n  @param size Size ref.\n*/\nfunction updateCollisionList(mutate: boolean, edit: any, keyEq: any, h: any, list: any, f: any, k: any, size: any): any {\n  var len = list.length;\n  for (var i = 0; i < len; ++i) {\n    var child = list[i];\n    if (keyEq(k, child.key)) {\n      var value = child.value;\n      var _newValue = f(value);\n      if (_newValue === value) return list;\n\n      if (_newValue === nothing) {\n        --size.value;\n        return arraySpliceOut(mutate, i, list);\n      }\n      return arrayUpdate(mutate, i, Leaf(edit, h, k, _newValue), list);\n    }\n  }\n\n  var newValue = f();\n  if (newValue === nothing) return list;\n  ++size.value;\n  return arrayUpdate(mutate, len, Leaf(edit, h, k, newValue), list);\n}\n\nfunction canEditNode(edit: any, node: any): boolean {\n  return edit === node.edit;\n}\n\n/* Editing\n ******************************************************************************/\nfunction Leaf__modify(this: any, edit: any, keyEq: any, shift: any, f: any, h: any, k: any, size: any): any {\n  if (keyEq(k, this.key)) {\n    var _v = f(this.value);\n    if (_v === this.value) return this;else if (_v === nothing) {\n      --size.value;\n      return empty;\n    }\n    if (canEditNode(edit, this)) {\n      this.value = _v;\n      return this;\n    }\n    return Leaf(edit, h, k, _v);\n  }\n  var v = f();\n  if (v === nothing) return this;\n  ++size.value;\n  return mergeLeaves(edit, shift, this.hash, this, h, Leaf(edit, h, k, v));\n}\n\nfunction Collision__modify(this: any, edit: any, keyEq: any, shift: any, f: any, h: any, k: any, size: any): any {\n  if (h === this.hash) {\n    var canEdit = canEditNode(edit, this);\n    var list = updateCollisionList(canEdit, edit, keyEq, this.hash, this.children, f, k, size);\n    if (list === this.children) return this;\n\n    return list.length > 1 ? Collision(edit, this.hash, list) : list[0]; // collapse single element collision list\n  }\n  var v = f();\n  if (v === nothing) return this;\n  ++size.value;\n  return mergeLeaves(edit, shift, this.hash, this, h, Leaf(edit, h, k, v));\n}\n\nfunction IndexedNode__modify(this: any, edit: any, keyEq: any, shift: any, f: any, h: any, k: any, size: any): any {\n  var mask = this.mask;\n  var children = this.children;\n  var frag = hashFragment(shift, h);\n  var bit = toBitmap(frag);\n  var indx = fromBitmap(mask, bit);\n  var exists = mask & bit;\n  var current = exists ? children[indx] : empty;\n  var child = current._modify(edit, keyEq, shift + SIZE, f, h, k, size);\n\n  if (current === child) return this;\n\n  var canEdit = canEditNode(edit, this);\n  var bitmap = mask;\n  var newChildren = undefined;\n  if (exists && isEmptyNode(child)) {\n    // remove\n    bitmap &= ~bit;\n    if (!bitmap) return empty;\n    if (children.length <= 2 && isLeaf(children[indx ^ 1])) return children[indx ^ 1]; // collapse\n\n    newChildren = arraySpliceOut(canEdit, indx, children);\n  } else if (!exists && !isEmptyNode(child)) {\n    // add\n    if (children.length >= MAX_INDEX_NODE) return expand(edit, frag, child, mask, children);\n\n    bitmap |= bit;\n    newChildren = arraySpliceIn(canEdit, indx, child, children);\n  } else {\n    // modify\n    newChildren = arrayUpdate(canEdit, indx, child, children);\n  }\n\n  if (canEdit) {\n    this.mask = bitmap;\n    this.children = newChildren;\n    return this;\n  }\n  return IndexedNode(edit, bitmap, newChildren);\n}\n\nfunction ArrayNode__modify(this: any, edit: any, keyEq: any, shift: any, f: any, h: any, k: any, size: any): any {\n  var count = this.size;\n  var children = this.children;\n  var frag = hashFragment(shift, h);\n  var child = children[frag];\n  var newChild = (child || empty)._modify(edit, keyEq, shift + SIZE, f, h, k, size);\n\n  if (child === newChild) return this;\n\n  var canEdit = canEditNode(edit, this);\n  var newChildren = undefined;\n  if (isEmptyNode(child) && !isEmptyNode(newChild)) {\n    // add\n    ++count;\n    newChildren = arrayUpdate(canEdit, frag, newChild, children);\n  } else if (!isEmptyNode(child) && isEmptyNode(newChild)) {\n    // remove\n    --count;\n    if (count <= MIN_ARRAY_NODE) return pack(edit, count, frag, children);\n    newChildren = arrayUpdate(canEdit, frag, empty, children);\n  } else {\n    // modify\n    newChildren = arrayUpdate(canEdit, frag, newChild, children);\n  }\n\n  if (canEdit) {\n    this.size = count;\n    this.children = newChildren;\n    return this;\n  }\n  return ArrayNode(edit, count, newChildren);\n};\n\n/* Queries\n ******************************************************************************/\n/**\n    Lookup the value for `key` in `map` using a custom `hash`.\n\n    Returns the value or `alt` if none.\n*/\nfunction tryGetHash(alt: any, hash: any, key: any, map: any): any {\n  var node = map._root;\n  var shift = 0;\n  var keyEq = map._config.keyEq;\n  while (true) {\n    switch (node.type) {\n      case LEAF:\n        {\n          return keyEq(key, node.key) ? node.value : alt;\n        }\n      case COLLISION:\n        {\n          if (hash === node.hash) {\n            var children = node.children;\n            for (var i = 0, len = children.length; i < len; ++i) {\n              var child = children[i];\n              if (keyEq(key, child.key)) return child.value;\n            }\n          }\n          return alt;\n        }\n      case INDEX:\n        {\n          var frag = hashFragment(shift, hash);\n          var bit = toBitmap(frag);\n          if (node.mask & bit) {\n            node = node.children[fromBitmap(node.mask, bit)];\n            shift += SIZE;\n            break;\n          }\n          return alt;\n        }\n      case ARRAY:\n        {\n          node = node.children[hashFragment(shift, hash)];\n          if (node) {\n            shift += SIZE;\n            break;\n          }\n          return alt;\n        }\n      default:\n        return alt;\n    }\n  }\n}\n\n/**\n  Lookup the value for `key` in `map` using internal hash function.\n\n  @see `tryGetHash`\n*/\nfunction tryGet(alt: any, key: any, map: any): any {\n  return tryGetHash(alt, map._config.hash(key), key, map);\n}\n\n/**\n  Lookup the value for `key` in `map` using a custom `hash`.\n\n  Returns the value or `undefined` if none.\n*/\nfunction getHash(hash: any, key: any, map: any): any {\n  return tryGetHash(undefined, hash, key, map);\n}\n\n/**\n    Does an entry exist for `key` in `map`? Uses custom `hash`.\n*/\nfunction hasHash(hash: any, key: any, map: any): boolean {\n  return tryGetHash(nothing, hash, key, map) !== nothing;\n}\n\n/**\n  Does an entry exist for `key` in `map`? Uses internal hash function.\n*/\nfunction has(key: any, map: any): boolean {\n  return hasHash(map._config.hash(key), key, map);\n}\n\nfunction defKeyCompare(x: any, y: any): boolean {\n  return x === y;\n}\n\n/**\n  Does `map` contain any elements?\n*/\nfunction isEmpty(map: any): boolean {\n  return map && !!isEmptyNode(map._root);\n}\n\n/* Updates\n ******************************************************************************/\n/**\n    Alter the value stored for `key` in `map` using function `f` using\n    custom hash.\n\n    `f` is invoked with the current value for `k` if it exists,\n    or no arguments if no such value exists. `modify` will always either\n    update or insert a value into the map.\n\n    Returns a map with the modified value. Does not alter `map`.\n*/\nfunction modifyHash(f: any, hash: any, key: any, map: any): any {\n  var size = { value: map._size };\n  var newRoot = map._root._modify(map._editable ? map._edit : NaN, map._config.keyEq, 0, f, hash, key, size);\n  return map.setTree(newRoot, size.value);\n}\n\n/**\n  Alter the value stored for `key` in `map` using function `f` using\n  internal hash function.\n\n  @see `modifyHash`\n*/\nfunction modify(f: any, key: any, map: any): any {\n  return modifyHash(f, map._config.hash(key), key, map);\n}\n\n/**\n  Store `value` for `key` in `map` using custom `hash`.\n\n  Returns a map with the modified value. Does not alter `map`.\n*/\nfunction setHash(hash: any, key: any, value: any, map: any): any {\n  return modifyHash(constant(value), hash, key, map);\n}\n\n\n/**\n  Store `value` for `key` in `map` using internal hash function.\n\n  @see `setHash`\n*/\nfunction set(key: any, value: any, map: any): any {\n  return setHash(map._config.hash(key), key, value, map);\n}\n\n/**\n  Remove the entry for `key` in `map`.\n\n  Returns a map with the value removed. Does not alter `map`.\n*/\nconst del = constant(nothing);\nfunction removeHash(hash: any, key: any, map: any): any {\n  return modifyHash(del, hash, key, map);\n}\n\n/**\n  Remove the entry for `key` in `map` using internal hash function.\n\n  @see `removeHash`\n*/\nfunction remove(key: any, map: any): any {\n  return removeHash(map._config.hash(key), key, map);\n}\n\n/* Mutation\n ******************************************************************************/\n/**\n  Mark `map` as mutable.\n */\nfunction beginMutation(map: any): any {\n  return new HAMTMap(map._editable + 1, map._edit + 1, map._config, map._root, map._size);\n}\n\n/**\n  Mark `map` as immutable.\n */\nfunction endMutation(map: any): any {\n  map._editable = map._editable && map._editable - 1;\n  return map;\n}\n\n/**\n  Mutate `map` within the context of `f`.\n  @param f\n  @param map HAMT\n*/\nfunction mutate(f: any, map: any): any {\n  var transient = beginMutation(map);\n  f(transient);\n  return endMutation(transient);\n};\n\n/* Traversal\n ******************************************************************************/\n/**\n  Apply a continuation.\n*/\nfunction appk(k: any): any {\n  return k && lazyVisitChildren(k[0], k[1], k[2], k[3], k[4]);\n}\n\n/**\n  Recursively visit all values stored in an array of nodes lazily.\n*/\nfunction lazyVisitChildren(len: any, children: any, i: any, f: any, k: any): any {\n  while (i < len) {\n    var child = children[i++];\n    if (child && !isEmptyNode(child)) return lazyVisit(child, f, [len, children, i, f, k]);\n  }\n  return appk(k);\n}\n\n/**\n  Recursively visit all values stored in `node` lazily.\n*/\nfunction lazyVisit(node: any, f: any, k?: any): any {\n  switch (node.type) {\n    case LEAF:\n      return {\n        value: f(node),\n        rest: k\n      };\n\n    case COLLISION:\n    case ARRAY:\n    case INDEX:\n      var children = node.children;\n      return lazyVisitChildren(children.length, children, 0, f, k);\n\n    default:\n      return appk(k);\n  }\n}\n\nconst DONE = {\n  done: true\n};\n\n/**\n  Lazily visit each value in map with function `f`.\n*/\nfunction visit(map: any, f: any): any {\n  return new HAMTMapIterator(lazyVisit(map._root, f));\n}\n\n/**\n  Get a Javascsript iterator of `map`.\n\n  Iterates over `[key, value]` arrays.\n*/\nfunction buildPairs(x: any): any {\n  return [x.key, x.value];\n}\n\nfunction entries(map: any): any {\n  return visit(map, buildPairs);\n};\n\n/**\n  Get array of all keys in `map`.\n\n  Order is not guaranteed.\n*/\nfunction buildKeys(x: any): any {\n  return x.key;\n}\nfunction keys(map: any): any {\n  return visit(map, buildKeys);\n}\n\n/**\n  Get array of all values in `map`.\n\n  Order is not guaranteed, duplicates are preserved.\n*/\nfunction buildValues(x: any): any {\n  return x.value;\n}\nfunction values(map: any): any {\n  return visit(map, buildValues);\n}\n\n/* Fold\n ******************************************************************************/\n/**\n  Visit every entry in the map, aggregating data.\n\n  Order of nodes is not guaranteed.\n\n  @param f Function mapping accumulated value, value, and key to new value.\n  @param z Starting value.\n  @param m HAMT\n*/\nfunction fold(f: any, z: any, m: any): any {\n  var root = m._root;\n  if (root.type === LEAF) return f(z, root.value, root.key);\n\n  var toVisit = [root.children];\n  var children = undefined;\n  while (children = toVisit.pop()) {\n    for (var i = 0, len = children.length; i < len;) {\n      var child = children[i++];\n      if (child && child.type) {\n        if (child.type === LEAF) z = f(z, child.value, child.key);else toVisit.push(child.children);\n      }\n    }\n  }\n  return z;\n}\n\n/**\n  Visit every entry in the map, aggregating data.\n\n  Order of nodes is not guaranteed.\n\n  @param f Function invoked with value and key\n  @param map HAMT\n*/\nfunction forEach(f: any, map: any): any {\n  return fold(function(_: any, value: any, key: any): any {\n    return f(value, key, map);\n  }, null, map);\n}\n\n/* Export\n ******************************************************************************/\nexport class HAMTMapIterator<T> implements IterableIterator<T> {\n  private v: any;\n\n  constructor(v: any) {\n    this.v = v;\n  }\n\n  next() {\n    if (!this.v) return DONE;\n    var v0 = this.v;\n    this.v = appk(v0.rest);\n    return v0;\n  }\n\n  [Symbol.iterator] () {\n    return this;\n  }\n}\n\nexport interface HAMTMapConfig {\n  keyEq?: Function, // TODO\n  hash?: Function // TODO\n}\n\nexport class HAMTMap {\n  private _map: any;\n  private _editable: boolean;\n  private _edit: any;\n  private _config: HAMTMapConfig;\n  private _root: any;\n  private _size: number;\n\n  constructor(editable = false, edit = 0, config: HAMTMapConfig = {}, root = empty, size: number = 0) {\n    this._editable = editable;\n    this._edit = edit;\n    this._config = {\n      keyEq: config && config.keyEq || defKeyCompare,\n      hash: config && config.hash || hash\n    };\n    this._root = root;\n    this._size = size;\n  }\n\n  get size(): number {\n    return this._size;\n  }\n\n  setTree(newRoot: any, newSize: number): any {\n    if (this._editable) {\n      this._root = newRoot;\n      this._size = newSize;\n      return this;\n    }\n    return newRoot === this._root ? this : new HAMTMap(this._editable, this._edit, this._config, newRoot, newSize);\n  }\n\n  tryGetHash(alt: any, hash: any, key: any): any {\n    return tryGetHash(alt, hash, key, this);\n  }\n\n  tryGet(alt: any, key: any): any {\n    return tryGet(alt, key, this);\n  }\n\n  getHash(hash: any, key: any): any {\n    return getHash(hash, key, this);\n  }\n\n  get(key: any, alt?: any): any {\n    return tryGet(alt, key, this);\n  }\n\n  hasHash(hash: any, key: any): boolean {\n    return hasHash(hash, key, this);\n  }\n\n  has(key: any): boolean {\n    return has(key, this);\n  }\n\n  isEmpty(): boolean {\n    return isEmpty(this);\n  }\n\n  modifyHash(hash: any, key: any, f: any): any {\n    return modifyHash(f, hash, key, this);\n  }\n\n  modify(key: any, f: any): any {\n    return modify(f, key, this);\n  }\n\n  setHash(hash: any, key: any, value: any): any {\n    return setHash(hash, key, value, this);\n  }\n\n  set(key: any, value: any): any {\n    return set(key, value, this);\n  }\n\n  deleteHash(hash: any, key: any): any {\n    return removeHash(hash, key, this);\n  }\n\n  removeHash(hash: any, key: any): any {\n    return removeHash(hash, key, this);\n  }\n\n  remove(key: any): any {\n    return remove(key, this);\n  }\n\n  beginMutation(): any {\n    return beginMutation(this);\n  }\n\n  endMutation(): any {\n    return endMutation(this);\n  }\n\n  mutate(f: any): any {\n    return mutate(f, this);\n  }\n\n  entries(): any {\n    return entries(this);\n  }\n\n  keys(): any {\n    return keys(this);\n  }\n\n  values(): any {\n    return values(this);\n  }\n\n  fold(f: any, z: any): any {\n    return fold(f, z, this);\n  }\n\n  forEach(f: any): any {\n    return forEach(f, this);\n  }\n\n  [Symbol.iterator] () {\n    return entries(this);\n  }\n}\n","import { HAMTMap } from './utils/hamt';\n\nexport class ImmutableMap<K, V> {\n  private _data: HAMTMap;\n\n  constructor(base?: ImmutableMap<K, V>) {\n    if (base) {\n      this._data = base.data;\n    } else {\n      this._data = new HAMTMap();\n    }\n  }\n\n  get size(): number {\n    return this._data.size;\n  }\n\n  clear(): void {\n    this._data = new HAMTMap();\n  }\n\n  get(key: K): V {\n    return this._data.get(key);\n  }\n\n  set(key: K, value: V): void {\n    this._data = this._data.set(key, value);\n  }\n\n  setMany(entries: [K, V][]): void {\n    let data = this._data.beginMutation();\n    entries.forEach((entry) => {\n      data.set(entry[0], entry[1]);\n    });\n    this._data = data.endMutation();\n  }\n\n  remove(key: K): void {\n    this._data = this._data.remove(key);\n  }\n\n  removeMany(keys: K[]): void {\n    let data = this._data.beginMutation();\n    keys.forEach((key) => {\n      data.remove(key);\n    });\n    this._data = data.endMutation();\n  }\n\n  has(key: K): boolean {\n    return this.get(key) !== undefined;\n  }\n\n  keys(): IterableIterator<K> {\n    return this._data.keys();\n  }\n\n  values(): IterableIterator<V> {\n    return this._data.values();\n  }\n\n  entries(): IterableIterator<[K, V]> {\n    return this._data.entries();\n  }\n\n  protected get data(): HAMTMap {\n    return this._data;\n  }\n}\n","import { Orbit, evented, Evented } from '@orbit/core';\nimport {\n  DefaultRequestOptions,\n  RequestOptions,\n  requestOptionsForSource\n} from '@orbit/data';\nimport {\n  RecordKeyMap,\n  RecordOperation,\n  RecordSchema,\n  RecordQueryBuilder,\n  RecordTransformBuilder,\n  RecordQueryExpression,\n  RecordQuery,\n  RecordTransform,\n  RecordNormalizer,\n  StandardRecordNormalizer,\n  StandardRecordValidator,\n  buildRecordValidatorFor\n} from '@orbit/records';\nimport { Dict } from '@orbit/utils';\nimport { StandardValidator, ValidatorForFn } from '@orbit/validators';\nconst { assert } = Orbit;\n\nexport interface RecordCacheQueryOptions extends RequestOptions {\n  raiseNotFoundExceptions?: boolean;\n}\n\nexport interface RecordCacheTransformOptions extends RequestOptions {\n  raiseNotFoundExceptions?: boolean;\n  useBuffer?: boolean;\n}\n\nexport interface RecordCacheSettings<\n  QueryOptions extends RequestOptions = RecordCacheQueryOptions,\n  TransformOptions extends RequestOptions = RecordCacheTransformOptions,\n  QueryBuilder = RecordQueryBuilder,\n  TransformBuilder = RecordTransformBuilder\n> {\n  name?: string;\n  schema: RecordSchema;\n  keyMap?: RecordKeyMap;\n  normalizer?: RecordNormalizer;\n  validatorFor?: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n  validators?: Dict<StandardValidator | StandardRecordValidator>;\n\n  /**\n   * Automatically validate the contents of all requests.\n   *\n   * If true, builds a `validatorFor` function if one has not been provided.\n   * This will include standard validators as well as any custom `validators`\n   * that may be provided.\n   *\n   * @default true\n   */\n  autoValidate?: boolean;\n\n  queryBuilder?: QueryBuilder;\n  transformBuilder?: TransformBuilder;\n  defaultQueryOptions?: DefaultRequestOptions<QueryOptions>;\n  defaultTransformOptions?: DefaultRequestOptions<TransformOptions>;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface RecordCache extends Evented {}\n\n@evented\nexport abstract class RecordCache<\n  QueryOptions extends RequestOptions = RecordCacheQueryOptions,\n  TransformOptions extends RequestOptions = RecordCacheTransformOptions,\n  QueryBuilder = RecordQueryBuilder,\n  TransformBuilder = RecordTransformBuilder\n> {\n  protected _name?: string;\n  protected _keyMap?: RecordKeyMap;\n  protected _schema: RecordSchema;\n  protected _queryBuilder: QueryBuilder;\n  protected _transformBuilder: TransformBuilder;\n  protected _validatorFor?: ValidatorForFn<\n    StandardValidator | StandardRecordValidator\n  >;\n  protected _defaultQueryOptions?: DefaultRequestOptions<QueryOptions>;\n  protected _defaultTransformOptions?: DefaultRequestOptions<TransformOptions>;\n\n  constructor(\n    settings: RecordCacheSettings<\n      QueryOptions,\n      TransformOptions,\n      QueryBuilder,\n      TransformBuilder\n    >\n  ) {\n    assert(\n      'RecordCache requires a `schema` setting to be constructed',\n      !!settings.schema\n    );\n\n    const { name, schema, keyMap } = settings;\n\n    this._name = name;\n    this._schema = schema;\n    this._keyMap = keyMap;\n\n    let { validatorFor, validators } = settings;\n    const autoValidate = settings.autoValidate !== false;\n\n    if (!autoValidate) {\n      assert(\n        'RecordCache should not be constructed with a `validatorFor` or `validators` if `autoValidate === false`',\n        validators === undefined && validatorFor === undefined\n      );\n    } else if (validatorFor !== undefined) {\n      assert(\n        'RecordCache can be constructed with either a `validatorFor` or `validators`, but not both',\n        validators === undefined\n      );\n    } else {\n      validatorFor = buildRecordValidatorFor({ validators });\n    }\n\n    this._validatorFor = validatorFor;\n\n    if (\n      settings.queryBuilder === undefined ||\n      settings.transformBuilder === undefined\n    ) {\n      let normalizer = settings.normalizer;\n\n      if (normalizer === undefined) {\n        normalizer = new StandardRecordNormalizer({\n          schema,\n          keyMap,\n          validateInputs: autoValidate\n        });\n      }\n\n      if (settings.queryBuilder === undefined) {\n        (settings as any).queryBuilder = new RecordQueryBuilder({\n          schema,\n          normalizer,\n          validatorFor\n        });\n      }\n\n      if (settings.transformBuilder === undefined) {\n        (settings as any).transformBuilder = new RecordTransformBuilder({\n          schema,\n          normalizer,\n          validatorFor\n        });\n      }\n    }\n\n    this._queryBuilder = settings.queryBuilder as QueryBuilder;\n    this._transformBuilder = settings.transformBuilder as TransformBuilder;\n\n    this._defaultQueryOptions = settings.defaultQueryOptions;\n    this._defaultTransformOptions = settings.defaultTransformOptions;\n  }\n\n  get name(): string | undefined {\n    return this._name;\n  }\n\n  get schema(): RecordSchema {\n    return this._schema;\n  }\n\n  get keyMap(): RecordKeyMap | undefined {\n    return this._keyMap;\n  }\n\n  get validatorFor():\n    | ValidatorForFn<StandardValidator | StandardRecordValidator>\n    | undefined {\n    return this._validatorFor;\n  }\n\n  get queryBuilder(): QueryBuilder {\n    return this._queryBuilder;\n  }\n\n  get transformBuilder(): TransformBuilder {\n    return this._transformBuilder;\n  }\n\n  get defaultQueryOptions(): DefaultRequestOptions<QueryOptions> | undefined {\n    return this._defaultQueryOptions;\n  }\n\n  set defaultQueryOptions(\n    options: DefaultRequestOptions<QueryOptions> | undefined\n  ) {\n    this._defaultQueryOptions = options;\n  }\n\n  get defaultTransformOptions():\n    | DefaultRequestOptions<TransformOptions>\n    | undefined {\n    return this._defaultTransformOptions;\n  }\n\n  set defaultTransformOptions(\n    options: DefaultRequestOptions<TransformOptions> | undefined\n  ) {\n    this._defaultTransformOptions = options;\n  }\n\n  getQueryOptions(\n    query: RecordQuery,\n    expression?: RecordQueryExpression\n  ): QueryOptions | undefined {\n    return requestOptionsForSource<QueryOptions>(\n      [\n        this._defaultQueryOptions,\n        query.options as QueryOptions | undefined,\n        expression?.options as QueryOptions | undefined\n      ],\n      this._name\n    );\n  }\n\n  getTransformOptions(\n    transform: RecordTransform,\n    operation?: RecordOperation\n  ): TransformOptions | undefined {\n    return requestOptionsForSource(\n      [\n        this._defaultTransformOptions,\n        transform.options as TransformOptions | undefined,\n        operation?.options as TransformOptions | undefined\n      ],\n      this._name\n    );\n  }\n}\n","import { Orbit, Evented } from '@orbit/core';\nimport {\n  RecordQueryExpression,\n  FindRecord,\n  FindRecords,\n  FindRelatedRecord,\n  FindRelatedRecords,\n  equalRecordIdentities,\n  RecordQuery,\n  RecordSchema,\n  RecordOperation\n} from '@orbit/records';\n\nimport { RecordChange, recordOperationChange } from './record-change';\n\nconst { assert } = Orbit;\n\nexport interface LiveQuerySettings {\n  debounce: boolean;\n  query: RecordQuery;\n}\n\nexport abstract class LiveQuery {\n  readonly debounce: boolean;\n  protected abstract get cache(): Evented;\n  protected abstract get schema(): RecordSchema;\n\n  protected _query: RecordQuery;\n  protected _subscribe(onNext: () => void): () => void {\n    const execute = this.debounce ? onceTick(onNext) : onNext;\n\n    const unsubscribePatch = this.cache.on(\n      'patch',\n      (operation: RecordOperation) => {\n        if (this.operationRelevantForQuery(operation)) {\n          execute();\n        }\n      }\n    );\n\n    const unsubscribeReset = this.cache.on('reset', () => {\n      execute();\n    });\n\n    function unsubscribe() {\n      cancelTick(execute);\n      unsubscribePatch();\n      unsubscribeReset();\n    }\n\n    return unsubscribe;\n  }\n\n  constructor(settings: LiveQuerySettings) {\n    assert(\n      'Only single expression queries are supported on LiveQuery',\n      !Array.isArray(settings.query.expressions)\n    );\n    this.debounce = settings.debounce;\n    this._query = settings.query;\n  }\n\n  operationRelevantForQuery(operation: RecordOperation): boolean {\n    const change = recordOperationChange(operation);\n    const expression = this._query.expressions as RecordQueryExpression;\n    return this.queryExpressionRelevantForChange(expression, change);\n  }\n\n  protected queryExpressionRelevantForChange(\n    expression: RecordQueryExpression,\n    change: RecordChange\n  ): boolean {\n    switch (expression.op) {\n      case 'findRecord':\n        return this.findRecordQueryExpressionRelevantForChange(\n          expression as FindRecord,\n          change\n        );\n      case 'findRecords':\n        return this.findRecordsQueryExpressionRelevantForChange(\n          expression as FindRecords,\n          change\n        );\n      case 'findRelatedRecord':\n        return this.findRelatedRecordQueryExpressionRelevantForChange(\n          expression as FindRelatedRecord,\n          change\n        );\n      case 'findRelatedRecords':\n        return this.findRelatedRecordsQueryExpressionRelevantForChange(\n          expression as FindRelatedRecords,\n          change\n        );\n      default:\n        return true;\n    }\n  }\n\n  protected findRecordQueryExpressionRelevantForChange(\n    expression: FindRecord,\n    change: RecordChange\n  ): boolean {\n    return equalRecordIdentities(expression.record, change);\n  }\n\n  protected findRecordsQueryExpressionRelevantForChange(\n    expression: FindRecords,\n    change: RecordChange\n  ): boolean {\n    if (expression.type) {\n      return expression.type === change.type;\n    } else if (expression.records) {\n      for (let record of expression.records) {\n        if (record.type === change.type) {\n          return true;\n        }\n      }\n      return false;\n    }\n    return true;\n  }\n\n  protected findRelatedRecordQueryExpressionRelevantForChange(\n    expression: FindRelatedRecord,\n    change: RecordChange\n  ): boolean {\n    return (\n      equalRecordIdentities(expression.record, change) &&\n      (change.relationships.includes(expression.relationship) || change.remove)\n    );\n  }\n\n  protected findRelatedRecordsQueryExpressionRelevantForChange(\n    expression: FindRelatedRecords,\n    change: RecordChange\n  ): boolean {\n    const relationshipDef = this.schema.getRelationship(\n      expression.record.type,\n      expression.relationship\n    );\n    const type = relationshipDef?.type;\n\n    if (Array.isArray(type) && type.find((type) => type === change.type)) {\n      return true;\n    } else if (type === change.type) {\n      return true;\n    }\n\n    return (\n      equalRecordIdentities(expression.record, change) &&\n      (change.relationships.includes(expression.relationship) || change.remove)\n    );\n  }\n}\n\nconst isNode = typeof Orbit.globals.process?.nextTick === 'function';\nlet resolvedPromise: Promise<void>;\nconst nextTick = isNode\n  ? function (fn: () => void) {\n      if (!resolvedPromise) {\n        resolvedPromise = Promise.resolve();\n      }\n      resolvedPromise.then(() => {\n        Orbit.globals.process.nextTick(fn);\n      });\n    }\n  : Orbit.globals.setImmediate ?? setTimeout;\n\nfunction onceTick(fn: () => void) {\n  return function tick() {\n    if (!ticks.has(tick)) {\n      ticks.add(tick);\n      nextTick(() => {\n        fn();\n        cancelTick(tick);\n      });\n    }\n  };\n}\n\nfunction cancelTick(tick: () => void) {\n  ticks.delete(tick);\n}\n\nconst ticks = new WeakSet();\n","import {\n  InitializedRecord,\n  cloneRecordIdentity,\n  RecordIdentity,\n  RecordOperation\n} from '@orbit/records';\n\nexport interface RecordChange extends RecordIdentity {\n  keys: string[];\n  attributes: string[];\n  relationships: string[];\n  meta: string[];\n  links: string[];\n  remove: boolean;\n}\n\nexport function recordOperationChange(\n  operation: RecordOperation\n): RecordChange {\n  const record = operation.record as InitializedRecord;\n  const change: RecordChange = {\n    ...cloneRecordIdentity(record),\n    remove: false,\n    keys: [],\n    attributes: [],\n    relationships: [],\n    meta: [],\n    links: []\n  };\n\n  switch (operation.op) {\n    case 'addRecord':\n    case 'updateRecord':\n      if (record.keys) {\n        change.keys = Object.keys(record.keys);\n      }\n      if (record.attributes) {\n        change.attributes = Object.keys(record.attributes);\n      }\n      if (record.relationships) {\n        change.relationships = Object.keys(record.relationships);\n      }\n      if (record.meta) {\n        change.meta = Object.keys(record.meta);\n      }\n      if (record.links) {\n        change.links = Object.keys(record.links);\n      }\n      break;\n    case 'replaceAttribute':\n      change.attributes = [operation.attribute];\n      break;\n    case 'replaceKey':\n      change.keys = [operation.key];\n      break;\n    case 'replaceRelatedRecord':\n    case 'replaceRelatedRecords':\n    case 'addToRelatedRecords':\n    case 'removeFromRelatedRecords':\n      change.relationships = [operation.relationship];\n      break;\n    case 'removeRecord':\n      change.remove = true;\n      break;\n  }\n\n  return change;\n}\n","import { RequestOptions } from '@orbit/data';\nimport {\n  RecordQuery,\n  RecordQueryBuilder,\n  RecordQueryResult,\n  RecordSchema,\n  RecordTransformBuilder\n} from '@orbit/records';\nimport {\n  RecordCacheQueryOptions,\n  RecordCacheTransformOptions\n} from '../record-cache';\nimport { SyncRecordCache } from '../sync-record-cache';\nimport { LiveQuery, LiveQuerySettings } from './live-query';\n\nexport interface SyncLiveQueryUpdateSettings<\n  QO extends RequestOptions = RecordCacheQueryOptions,\n  TO extends RequestOptions = RecordCacheTransformOptions,\n  QB = RecordQueryBuilder,\n  TB = RecordTransformBuilder\n> {\n  cache: SyncRecordCache<QO, TO, QB, TB>;\n  query: RecordQuery;\n}\n\nexport class SyncLiveQueryUpdate<\n  QO extends RequestOptions = RecordCacheQueryOptions,\n  TO extends RequestOptions = RecordCacheTransformOptions,\n  QB = RecordQueryBuilder,\n  TB = RecordTransformBuilder\n> {\n  private _cache: SyncRecordCache<QO, TO, QB, TB>;\n  private _query: RecordQuery;\n\n  constructor(settings: SyncLiveQueryUpdateSettings<QO, TO, QB, TB>) {\n    this._cache = settings.cache;\n    this._query = settings.query;\n  }\n\n  query<Result extends RecordQueryResult = RecordQueryResult>(): Result {\n    return this._cache.query(this._query);\n  }\n}\n\nexport interface SyncLiveQuerySettings<\n  QO extends RequestOptions = RecordCacheQueryOptions,\n  TO extends RequestOptions = RecordCacheTransformOptions,\n  QB = RecordQueryBuilder,\n  TB = RecordTransformBuilder\n> extends LiveQuerySettings {\n  cache: SyncRecordCache<QO, TO, QB, TB>;\n}\n\nexport class SyncLiveQuery<\n  QO extends RequestOptions = RecordCacheQueryOptions,\n  TO extends RequestOptions = RecordCacheTransformOptions,\n  QB = RecordQueryBuilder,\n  TB = RecordTransformBuilder\n> extends LiveQuery {\n  protected cache: SyncRecordCache<QO, TO, QB, TB>;\n\n  protected get schema(): RecordSchema {\n    return this.cache.schema;\n  }\n\n  private get _update() {\n    return new SyncLiveQueryUpdate<QO, TO, QB, TB>({\n      cache: this.cache,\n      query: this._query\n    });\n  }\n\n  constructor(settings: SyncLiveQuerySettings<QO, TO, QB, TB>) {\n    super(settings);\n    this.cache = settings.cache;\n  }\n\n  query<Result extends RecordQueryResult = RecordQueryResult>(): Result {\n    return this._update.query<Result>();\n  }\n\n  subscribe(\n    cb: (update: SyncLiveQueryUpdate<QO, TO, QB, TB>) => void\n  ): () => void {\n    return this._subscribe(() => {\n      cb(this._update);\n    });\n  }\n}\n","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { SyncRecordAccessor } from './record-accessor';\nimport { RecordOperation } from '@orbit/records';\n\nexport interface SyncOperationProcessorClass {\n  new (cache: SyncRecordAccessor): SyncOperationProcessor;\n}\n\n/**\n * Operation processors are used to identify operations that should be performed\n * together to ensure that a `Cache` or other container of data remains\n * consistent and correct.\n *\n * `OperationProcessor` is an abstract base class to be extended by specific\n * operation processors.\n */\nexport abstract class SyncOperationProcessor {\n  private _accessor: SyncRecordAccessor;\n\n  /**\n   * The `SyncRecordAccessor` that is monitored.\n   */\n  get accessor(): SyncRecordAccessor {\n    return this._accessor;\n  }\n\n  constructor(accessor: SyncRecordAccessor) {\n    this._accessor = accessor;\n  }\n\n  /**\n   * Called when all the data in a cache has been reset.\n   *\n   * If `base` is included, the cache is being reset to match a base cache.\n   */\n  reset(base?: SyncRecordAccessor): void {}\n\n  /**\n   * Allow the processor to perform an upgrade as part of a cache upgrade.\n   */\n  upgrade(): void {}\n\n  /**\n   * Validates an operation before processing it.\n   */\n  validate(operation: RecordOperation): void {}\n\n  /**\n   * Called before an `operation` has been applied.\n   *\n   * Returns an array of operations to be applied **BEFORE** the `operation`\n   * itself is applied.\n   */\n  before(operation: RecordOperation): RecordOperation[] {\n    return [];\n  }\n\n  /**\n   * Called before an `operation` has been applied.\n   *\n   * Returns an array of operations to be applied **AFTER** the `operation`\n   * has been applied successfully.\n   */\n  after(operation: RecordOperation): RecordOperation[] {\n    return [];\n  }\n\n  /**\n   * Called immediately after an `operation` has been applied and before the\n   * `patch` event has been emitted (i.e. before any listeners have been\n   * notified that the operation was applied).\n   *\n   * No operations may be returned.\n   */\n  immediate(operation: RecordOperation): void {}\n\n  /**\n   * Called after an `operation` _and_ any related operations have been applied.\n   *\n   * Returns an array of operations to be applied **AFTER** the `operation`\n   * itself and any operations returned from the `after` hook have been applied.\n   */\n  finally(operation: RecordOperation): RecordOperation[] {\n    return [];\n  }\n}\n","import {\n  cloneRecordIdentity,\n  InitializedRecord,\n  RecordIdentity,\n  RecordOperation,\n  RecordSchema\n} from '@orbit/records';\nimport { deepGet } from '@orbit/utils';\nimport { RecordRelationshipIdentity } from '../../record-accessor';\n\nexport function getInverseRelationship(\n  schema: RecordSchema,\n  record: RecordIdentity,\n  relationship: string,\n  relatedRecord?: RecordIdentity | null\n): RecordRelationshipIdentity | null {\n  if (relatedRecord) {\n    const recordIdentity = cloneRecordIdentity(record);\n\n    return {\n      record: recordIdentity,\n      relationship,\n      relatedRecord\n    };\n  }\n  return null;\n}\n\nexport function getInverseRelationships(\n  schema: RecordSchema,\n  record: RecordIdentity,\n  relationship: string,\n  relatedRecords?: RecordIdentity[]\n): RecordRelationshipIdentity[] {\n  if (relatedRecords && relatedRecords.length > 0) {\n    const recordIdentity = cloneRecordIdentity(record);\n\n    return relatedRecords.map((relatedRecord) => {\n      return {\n        record: recordIdentity,\n        relationship,\n        relatedRecord\n      };\n    });\n  }\n  return [];\n}\n\nexport function getAllInverseRelationships(\n  schema: RecordSchema,\n  record: InitializedRecord\n): RecordRelationshipIdentity[] {\n  const recordIdentity = cloneRecordIdentity(record);\n  const inverseRelationships: RecordRelationshipIdentity[] = [];\n\n  schema.eachRelationship(record.type, (relationship) => {\n    const relationshipData = deepGet(record, [\n      'relationships',\n      relationship,\n      'data'\n    ]) as RecordIdentity | RecordIdentity[] | null | undefined;\n\n    if (Array.isArray(relationshipData)) {\n      for (let relatedRecord of relationshipData) {\n        inverseRelationships.push({\n          record: recordIdentity,\n          relationship,\n          relatedRecord\n        });\n      }\n    } else if (relationshipData) {\n      inverseRelationships.push({\n        record: recordIdentity,\n        relationship,\n        relatedRecord: relationshipData\n      });\n    }\n  });\n\n  return inverseRelationships;\n}\n\nexport function getInverseRelationshipRemovalOps(\n  schema: RecordSchema,\n  inverseRelationships: RecordRelationshipIdentity[]\n): RecordOperation[] {\n  const ops: RecordOperation[] = [];\n\n  for (let inverseRelationship of inverseRelationships) {\n    const { type } = inverseRelationship.record;\n    const { relationship } = inverseRelationship;\n    const relationshipDef = schema.getRelationship(type, relationship);\n\n    // TODO - remove deprecated `type` check\n    if ((relationshipDef.kind ?? (relationshipDef as any).type) === 'hasMany') {\n      ops.push({\n        op: 'removeFromRelatedRecords',\n        record: inverseRelationship.record,\n        relationship: inverseRelationship.relationship,\n        relatedRecord: inverseRelationship.relatedRecord\n      });\n    } else {\n      ops.push({\n        op: 'replaceRelatedRecord',\n        record: inverseRelationship.record,\n        relationship: inverseRelationship.relationship,\n        relatedRecord: null\n      });\n    }\n  }\n\n  return ops;\n}\n","import {\n  InitializedRecord,\n  RecordIdentity,\n  RecordOperation\n} from '@orbit/records';\nimport { SyncOperationProcessor } from '../sync-operation-processor';\nimport {\n  getInverseRelationship,\n  getInverseRelationships,\n  getAllInverseRelationships,\n  getInverseRelationshipRemovalOps\n} from './utils/cache-integrity-utils';\n\n/**\n * An operation processor that ensures that a cache's data is consistent and\n * doesn't contain any dead references.\n *\n * This is achieved by maintaining a mapping of reverse relationships for each\n * record. When a record is removed, any references to it can also be identified\n * and removed.\n */\nexport class SyncCacheIntegrityProcessor extends SyncOperationProcessor {\n  after(operation: RecordOperation): RecordOperation[] {\n    switch (operation.op) {\n      case 'replaceRelatedRecord':\n        this.removeInverseRelationship(\n          operation.record,\n          operation.relationship,\n          this.accessor.getRelatedRecordSync(\n            operation.record,\n            operation.relationship\n          )\n        );\n        return [];\n\n      case 'replaceRelatedRecords':\n        this.removeInverseRelationships(\n          operation.record,\n          operation.relationship,\n          this.accessor.getRelatedRecordsSync(\n            operation.record,\n            operation.relationship\n          )\n        );\n        return [];\n\n      case 'removeFromRelatedRecords':\n        this.removeInverseRelationship(\n          operation.record,\n          operation.relationship,\n          operation.relatedRecord\n        );\n        return [];\n\n      case 'removeRecord':\n        this.removeAllInverseRelationships(operation.record);\n        return [];\n\n      case 'updateRecord':\n        this.removeAllInverseRelationships(operation.record);\n        return [];\n\n      default:\n        return [];\n    }\n  }\n\n  finally(operation: RecordOperation): RecordOperation[] {\n    switch (operation.op) {\n      case 'replaceRelatedRecord':\n        this.addInverseRelationship(\n          operation.record,\n          operation.relationship,\n          operation.relatedRecord\n        );\n        return [];\n\n      case 'replaceRelatedRecords':\n        this.addInverseRelationships(\n          operation.record,\n          operation.relationship,\n          operation.relatedRecords\n        );\n        return [];\n\n      case 'addToRelatedRecords':\n        this.addInverseRelationship(\n          operation.record,\n          operation.relationship,\n          operation.relatedRecord\n        );\n        return [];\n\n      case 'addRecord':\n        this.addAllInverseRelationships(operation.record);\n        return [];\n\n      case 'updateRecord':\n        this.addAllInverseRelationships(operation.record);\n        return [];\n\n      case 'removeRecord':\n        return this.clearInverseRelationshipOps(operation.record);\n\n      default:\n        return [];\n    }\n  }\n\n  protected addInverseRelationship(\n    record: RecordIdentity,\n    relationship: string,\n    relatedRecord: RecordIdentity | null\n  ): void {\n    let inverseRelationship = getInverseRelationship(\n      this.accessor.schema,\n      record,\n      relationship,\n      relatedRecord\n    );\n    if (inverseRelationship) {\n      this.accessor.addInverseRelationshipsSync([inverseRelationship]);\n    }\n  }\n\n  protected addInverseRelationships(\n    record: RecordIdentity,\n    relationship: string,\n    relatedRecords: RecordIdentity[]\n  ): void {\n    let inverseRelationships = getInverseRelationships(\n      this.accessor.schema,\n      record,\n      relationship,\n      relatedRecords\n    );\n    if (inverseRelationships) {\n      this.accessor.addInverseRelationshipsSync(inverseRelationships);\n    }\n  }\n\n  protected addAllInverseRelationships(record: InitializedRecord): void {\n    let inverseRelationships = getAllInverseRelationships(\n      this.accessor.schema,\n      record\n    );\n    if (inverseRelationships.length > 0) {\n      this.accessor.addInverseRelationshipsSync(inverseRelationships);\n    }\n  }\n\n  protected removeInverseRelationship(\n    record: RecordIdentity,\n    relationship: string,\n    relatedRecord?: RecordIdentity | null\n  ): void {\n    let inverseRelationship = getInverseRelationship(\n      this.accessor.schema,\n      record,\n      relationship,\n      relatedRecord\n    );\n    if (inverseRelationship) {\n      this.accessor.removeInverseRelationshipsSync([inverseRelationship]);\n    }\n  }\n\n  protected removeInverseRelationships(\n    record: RecordIdentity,\n    relationship: string,\n    relatedRecords?: RecordIdentity[]\n  ): void {\n    let inverseRelationships = getInverseRelationships(\n      this.accessor.schema,\n      record,\n      relationship,\n      relatedRecords\n    );\n    if (inverseRelationships.length > 0) {\n      this.accessor.removeInverseRelationshipsSync(inverseRelationships);\n    }\n  }\n\n  protected removeAllInverseRelationships(record: RecordIdentity): void {\n    const currentRecord = this.accessor.getRecordSync(record);\n    if (currentRecord) {\n      const inverseRelationships = getAllInverseRelationships(\n        this.accessor.schema,\n        currentRecord\n      );\n      if (inverseRelationships.length > 0) {\n        this.accessor.removeInverseRelationshipsSync(inverseRelationships);\n      }\n    }\n  }\n\n  protected clearInverseRelationshipOps(\n    record: RecordIdentity\n  ): RecordOperation[] {\n    return getInverseRelationshipRemovalOps(\n      this.accessor.schema,\n      this.accessor.getInverseRelationshipsSync(record)\n    );\n  }\n}\n","import { deepGet } from '@orbit/utils';\nimport {\n  cloneRecordIdentity,\n  equalRecordIdentities,\n  uniqueRecordIdentities,\n  InitializedRecord,\n  RecordIdentity,\n  RecordOperation,\n  RelationshipDefinition,\n  RecordSchema\n} from '@orbit/records';\n\nexport function recordAdded(\n  schema: RecordSchema,\n  record: InitializedRecord\n): RecordOperation[] {\n  const ops: RecordOperation[] = [];\n\n  if (record.relationships) {\n    const recordIdentity = cloneRecordIdentity(record);\n\n    schema.eachRelationship(record.type, (relationship, relationshipDef) => {\n      const relationshipData = deepGet(record, [\n        'relationships',\n        relationship,\n        'data'\n      ]) as RecordIdentity | RecordIdentity[] | null | undefined;\n\n      if (relationshipData) {\n        const relatedRecords = recordArrayFromData(\n          relationshipData\n        ) as RecordIdentity[];\n\n        Array.prototype.push.apply(\n          ops,\n          addRelatedRecordsOps(\n            schema,\n            recordIdentity,\n            relationshipDef,\n            relatedRecords\n          )\n        );\n      }\n    });\n  }\n\n  return ops;\n}\n\nexport function relatedRecordAdded(\n  schema: RecordSchema,\n  record: RecordIdentity,\n  relationship: string,\n  relatedRecord: RecordIdentity\n): RecordOperation[] {\n  const ops: RecordOperation[] = [];\n\n  if (relatedRecord) {\n    const { type } = record;\n    const relationshipDef = schema.getRelationship(type, relationship);\n    const inverseRelationship = relationshipDef.inverse;\n\n    if (inverseRelationship) {\n      ops.push(\n        addRelationshipOp(schema, relatedRecord, inverseRelationship, record)\n      );\n    }\n  }\n\n  return ops;\n}\n\nexport function relatedRecordRemoved(\n  schema: RecordSchema,\n  record: RecordIdentity,\n  relationship: string,\n  relatedRecord: RecordIdentity,\n  currentRelatedRecord?: RecordIdentity | null\n): RecordOperation[] {\n  const ops: RecordOperation[] = [];\n\n  if (currentRelatedRecord) {\n    const { type } = record;\n    const relationshipDef = schema.getRelationship(type, relationship);\n    const inverseRelationship = relationshipDef.inverse;\n\n    if (inverseRelationship) {\n      ops.push(\n        removeRelationshipOp(schema, relatedRecord, inverseRelationship, record)\n      );\n    }\n  }\n\n  return ops;\n}\n\nexport function relatedRecordReplaced(\n  schema: RecordSchema,\n  record: RecordIdentity,\n  relationship: string,\n  relatedRecord: RecordIdentity | null,\n  currentRelatedRecord?: RecordIdentity | null\n): RecordOperation[] {\n  const ops: RecordOperation[] = [];\n\n  if (\n    !equalRecordIdentities(\n      relatedRecord as RecordIdentity,\n      currentRelatedRecord as RecordIdentity\n    )\n  ) {\n    const { type } = record;\n    const relationshipDef = schema.getRelationship(type, relationship);\n    const inverseRelationship = relationshipDef.inverse;\n\n    if (inverseRelationship) {\n      if (currentRelatedRecord) {\n        ops.push(\n          removeRelationshipOp(\n            schema,\n            currentRelatedRecord,\n            inverseRelationship,\n            record\n          )\n        );\n      }\n\n      if (relatedRecord) {\n        ops.push(\n          addRelationshipOp(schema, relatedRecord, inverseRelationship, record)\n        );\n      }\n    }\n  }\n\n  return ops;\n}\n\nexport function relatedRecordsReplaced(\n  schema: RecordSchema,\n  record: RecordIdentity,\n  relationship: string,\n  relatedRecords: RecordIdentity[],\n  currentRelatedRecords?: RecordIdentity[]\n): RecordOperation[] {\n  const ops: RecordOperation[] = [];\n  const { type } = record;\n  const relationshipDef = schema.getRelationship(type, relationship);\n\n  let addedRecords: RecordIdentity[];\n\n  if (currentRelatedRecords && currentRelatedRecords.length > 0) {\n    let removedRecords = uniqueRecordIdentities(\n      currentRelatedRecords,\n      relatedRecords\n    );\n    Array.prototype.push.apply(\n      ops,\n      removeRelatedRecordsOps(schema, record, relationshipDef, removedRecords)\n    );\n\n    addedRecords = uniqueRecordIdentities(\n      relatedRecords,\n      currentRelatedRecords\n    );\n  } else {\n    addedRecords = relatedRecords;\n  }\n\n  Array.prototype.push.apply(\n    ops,\n    addRelatedRecordsOps(schema, record, relationshipDef, addedRecords)\n  );\n\n  return ops;\n}\n\nexport function recordRemoved(\n  schema: RecordSchema,\n  record?: InitializedRecord\n): RecordOperation[] {\n  const ops: RecordOperation[] = [];\n\n  if (record && record.relationships) {\n    const recordIdentity = cloneRecordIdentity(record);\n\n    schema.eachRelationship(record.type, (relationship, relationshipDef) => {\n      const relationshipData = deepGet(record, [\n        'relationships',\n        relationship,\n        'data'\n      ]) as RecordIdentity | RecordIdentity[] | null | undefined;\n\n      if (relationshipData) {\n        const relatedRecords = recordArrayFromData(\n          relationshipData\n        ) as RecordIdentity[];\n\n        Array.prototype.push.apply(\n          ops,\n          removeRelatedRecordsOps(\n            schema,\n            recordIdentity,\n            relationshipDef,\n            relatedRecords\n          )\n        );\n      }\n    });\n  }\n\n  return ops;\n}\n\nexport function recordUpdated(\n  schema: RecordSchema,\n  record: InitializedRecord,\n  currentRecord?: InitializedRecord\n): RecordOperation[] {\n  const ops: RecordOperation[] = [];\n\n  if (record.relationships) {\n    const recordIdentity = cloneRecordIdentity(record);\n\n    schema.eachRelationship(record.type, (relationship, relationshipDef) => {\n      const relationshipData = deepGet(record, [\n        'relationships',\n        relationship,\n        'data'\n      ]) as RecordIdentity | RecordIdentity[] | null | undefined;\n\n      const currentRelationshipData =\n        currentRecord &&\n        (deepGet(currentRecord, ['relationships', relationship, 'data']) as\n          | RecordIdentity\n          | RecordIdentity[]\n          | null\n          | undefined);\n\n      if (relationshipData !== undefined) {\n        // TODO - remove deprecated `type` check\n        if (\n          (relationshipDef.kind ?? (relationshipDef as any).type) === 'hasMany'\n        ) {\n          Array.prototype.push.apply(\n            ops,\n            relatedRecordsReplaced(\n              schema,\n              recordIdentity,\n              relationship,\n              (relationshipData as RecordIdentity[]) || [],\n              (currentRelationshipData as RecordIdentity[]) || []\n            )\n          );\n        } else {\n          Array.prototype.push.apply(\n            ops,\n            relatedRecordReplaced(\n              schema,\n              recordIdentity,\n              relationship,\n              (relationshipData as RecordIdentity) || null,\n              (currentRelationshipData as RecordIdentity) || null\n            )\n          );\n        }\n      }\n    });\n  }\n\n  return ops;\n}\n\nfunction addRelatedRecordsOps(\n  schema: RecordSchema,\n  record: RecordIdentity,\n  relationshipDef: RelationshipDefinition,\n  relatedRecords: RecordIdentity[]\n): RecordOperation[] {\n  if (relatedRecords.length > 0 && relationshipDef.inverse) {\n    const inverse = relationshipDef.inverse;\n    return relatedRecords.map((relatedRecord) =>\n      addRelationshipOp(schema, relatedRecord, inverse, record)\n    );\n  }\n  return [];\n}\n\nexport function removeRelatedRecordsOps(\n  schema: RecordSchema,\n  record: RecordIdentity,\n  relationshipDef: RelationshipDefinition,\n  relatedRecords: RecordIdentity[]\n): RecordOperation[] {\n  if (relatedRecords.length > 0) {\n    if (relationshipDef.dependent === 'remove') {\n      return removeDependentRecords(relatedRecords);\n    } else if (relationshipDef.inverse) {\n      const inverse = relationshipDef.inverse;\n      return relatedRecords.map((relatedRecord) =>\n        removeRelationshipOp(schema, relatedRecord, inverse, record)\n      );\n    }\n  }\n  return [];\n}\n\nexport function addRelationshipOp(\n  schema: RecordSchema,\n  record: RecordIdentity,\n  relationship: string,\n  relatedRecord: RecordIdentity\n): RecordOperation {\n  const { type } = record;\n  const relationshipDef = schema.getRelationship(type, relationship);\n  // TODO - remove deprecated `type` check\n  const isHasMany =\n    (relationshipDef.kind ?? (relationshipDef as any).type) === 'hasMany';\n\n  return {\n    op: isHasMany ? 'addToRelatedRecords' : 'replaceRelatedRecord',\n    record,\n    relationship,\n    relatedRecord\n  } as RecordOperation;\n}\n\nexport function removeRelationshipOp(\n  schema: RecordSchema,\n  record: RecordIdentity,\n  relationship: string,\n  relatedRecord: RecordIdentity\n): RecordOperation {\n  const { type } = record;\n  const relationshipDef = schema.getRelationship(type, relationship);\n  // TODO - remove deprecated `type` check\n  const isHasMany =\n    (relationshipDef.kind ?? (relationshipDef as any).type) === 'hasMany';\n\n  return {\n    op: isHasMany ? 'removeFromRelatedRecords' : 'replaceRelatedRecord',\n    record,\n    relationship,\n    relatedRecord: isHasMany ? relatedRecord : null\n  } as RecordOperation;\n}\n\nexport function recordArrayFromData(\n  data: RecordIdentity | RecordIdentity[] | null\n): RecordIdentity[] {\n  if (Array.isArray(data)) {\n    return data;\n  } else if (data) {\n    return [data];\n  } else {\n    return [];\n  }\n}\n\nfunction removeDependentRecords(\n  relatedRecords: RecordIdentity[]\n): RecordOperation[] {\n  return relatedRecords.map(\n    (record) =>\n      ({\n        op: 'removeRecord',\n        record\n      } as RecordOperation)\n  );\n}\n","import { RecordOperation } from '@orbit/records';\nimport { SyncOperationProcessor } from '../sync-operation-processor';\nimport {\n  recordAdded,\n  relatedRecordAdded,\n  relatedRecordRemoved,\n  relatedRecordReplaced,\n  relatedRecordsReplaced,\n  recordRemoved,\n  recordUpdated\n} from './utils/schema-consistency-utils';\n\n/**\n * An operation processor that ensures that a cache's data is consistent with\n * its associated schema. This includes maintenance of inverse and dependent\n * relationships.\n */\nexport class SyncSchemaConsistencyProcessor extends SyncOperationProcessor {\n  after(operation: RecordOperation): RecordOperation[] {\n    switch (operation.op) {\n      case 'addRecord':\n        return recordAdded(this.accessor.schema, operation.record);\n\n      case 'addToRelatedRecords':\n        return relatedRecordAdded(\n          this.accessor.schema,\n          operation.record,\n          operation.relationship,\n          operation.relatedRecord\n        );\n\n      case 'replaceRelatedRecord':\n        return relatedRecordReplaced(\n          this.accessor.schema,\n          operation.record,\n          operation.relationship,\n          operation.relatedRecord,\n          this.accessor.getRelatedRecordSync(\n            operation.record,\n            operation.relationship\n          )\n        );\n\n      case 'replaceRelatedRecords':\n        return relatedRecordsReplaced(\n          this.accessor.schema,\n          operation.record,\n          operation.relationship,\n          operation.relatedRecords,\n          this.accessor.getRelatedRecordsSync(\n            operation.record,\n            operation.relationship\n          )\n        );\n\n      case 'removeFromRelatedRecords':\n        return relatedRecordRemoved(\n          this.accessor.schema,\n          operation.record,\n          operation.relationship,\n          operation.relatedRecord,\n          this.accessor.getRecordSync(operation.relatedRecord)\n        );\n\n      case 'removeRecord':\n        return recordRemoved(\n          this.accessor.schema,\n          this.accessor.getRecordSync(operation.record)\n        );\n\n      case 'updateRecord':\n        return recordUpdated(\n          this.accessor.schema,\n          operation.record,\n          this.accessor.getRecordSync(operation.record)\n        );\n\n      default:\n        return [];\n    }\n  }\n}\n","import { Assertion } from '@orbit/core';\nimport {\n  RecordOperation,\n  RecordSchema,\n  StandardRecordValidator,\n  validateRecordOperation,\n  ValidationError\n} from '@orbit/records';\nimport { StandardValidator, ValidatorForFn } from '@orbit/validators';\nimport { SyncRecordAccessor } from '../record-accessor';\nimport { RecordCache } from '../record-cache';\nimport { SyncOperationProcessor } from '../sync-operation-processor';\n\n/**\n * An operation processor that ensures that an operation is compatible with\n * its associated schema.\n */\nexport class SyncSchemaValidationProcessor extends SyncOperationProcessor {\n  schema: RecordSchema;\n  validatorFor: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n\n  constructor(accessor: SyncRecordAccessor) {\n    super(accessor);\n\n    const cache = (this.accessor as unknown) as RecordCache;\n    const { schema, validatorFor } = cache;\n    if (validatorFor === undefined || schema === undefined) {\n      throw new Assertion(\n        'SyncSchemaValidationProcessor requires a RecordCache with both a `validationFor` and a `schema`.'\n      );\n    }\n\n    this.schema = schema;\n    this.validatorFor = validatorFor;\n  }\n\n  validate(operation: RecordOperation): void {\n    const { schema, validatorFor } = this;\n    const issues = validateRecordOperation(operation, { schema, validatorFor });\n    if (issues) {\n      throw new ValidationError('Validation failed', issues);\n    }\n  }\n}\n","import { RequestOptions } from '@orbit/data';\nimport {\n  AddRecordOperation,\n  AddToRelatedRecordsOperation,\n  equalRecordIdentities,\n  equalRecordIdentitySets,\n  InitializedRecord,\n  RecordIdentity,\n  RecordNotFoundException,\n  RecordOperation,\n  recordsInclude,\n  RemoveFromRelatedRecordsOperation,\n  RemoveRecordOperation,\n  ReplaceAttributeOperation,\n  ReplaceKeyOperation,\n  ReplaceRelatedRecordOperation,\n  ReplaceRelatedRecordsOperation,\n  UpdateRecordOperation\n} from '@orbit/records';\nimport { deepGet, deepSet, Dict, eq } from '@orbit/utils';\nimport { SyncRecordAccessor } from '../record-accessor';\n\nexport interface SyncInverseTransformOperator {\n  (\n    cache: SyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): RecordOperation | undefined;\n}\n\nexport const SyncInverseTransformOperators: Dict<SyncInverseTransformOperator> = {\n  addRecord(\n    cache: SyncRecordAccessor,\n    operation: RecordOperation,\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    options?: RequestOptions\n  ): RecordOperation | undefined {\n    const op = operation as AddRecordOperation;\n    const { type, id } = op.record;\n    const current = cache.getRecordSync(op.record);\n\n    if (current) {\n      if (eq(current, op.record)) {\n        return;\n      } else {\n        return {\n          op: 'updateRecord',\n          record: current\n        };\n      }\n    } else {\n      return {\n        op: 'removeRecord',\n        record: { type, id }\n      };\n    }\n  },\n\n  updateRecord(\n    cache: SyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): RecordOperation | undefined {\n    const op = operation as UpdateRecordOperation;\n    const currentRecord = cache.getRecordSync(op.record);\n    const replacement: InitializedRecord = op.record;\n    const { type, id } = replacement;\n\n    if (currentRecord) {\n      let result = { type, id };\n      let changed = false;\n\n      ['attributes', 'keys'].forEach((grouping) => {\n        if ((replacement as any)[grouping]) {\n          Object.keys((replacement as any)[grouping]).forEach((field) => {\n            let value = (replacement as any)[grouping][field];\n            let currentValue = deepGet(currentRecord, [grouping, field]);\n            if (!eq(value, currentValue)) {\n              changed = true;\n              deepSet(\n                result,\n                [grouping, field],\n                currentValue === undefined ? null : currentValue\n              );\n            }\n          });\n        }\n      });\n\n      if (replacement.relationships) {\n        Object.keys(replacement.relationships).forEach((field) => {\n          let data = deepGet(replacement, ['relationships', field, 'data']);\n          if (data !== undefined) {\n            let currentData = deepGet(currentRecord, [\n              'relationships',\n              field,\n              'data'\n            ]);\n            let relationshipChanged;\n\n            if (Array.isArray(data)) {\n              if (currentData) {\n                relationshipChanged = !equalRecordIdentitySets(\n                  currentData,\n                  data\n                );\n              } else {\n                relationshipChanged = true;\n                currentData = [];\n              }\n            } else {\n              if (currentData) {\n                relationshipChanged = !equalRecordIdentities(currentData, data);\n              } else {\n                relationshipChanged = true;\n                currentData = null;\n              }\n            }\n\n            if (relationshipChanged) {\n              changed = true;\n              deepSet(result, ['relationships', field, 'data'], currentData);\n            }\n          }\n        });\n      }\n\n      if (changed) {\n        return {\n          op: 'updateRecord',\n          record: result\n        };\n      }\n    } else {\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(type, id);\n      } else {\n        return {\n          op: 'removeRecord',\n          record: { type, id }\n        };\n      }\n    }\n  },\n\n  removeRecord(\n    cache: SyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): RecordOperation | undefined {\n    const op = operation as RemoveRecordOperation;\n    const { record } = op;\n    const currentRecord = cache.getRecordSync(record);\n\n    if (currentRecord) {\n      return {\n        op: 'addRecord',\n        record: currentRecord\n      };\n    } else {\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(record.type, record.id);\n      }\n    }\n  },\n\n  replaceKey(\n    cache: SyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): RecordOperation | undefined {\n    const op = operation as ReplaceKeyOperation;\n    const { record, key } = op;\n    const currentRecord = cache.getRecordSync(record);\n\n    if (currentRecord === undefined) {\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(record.type, record.id);\n      }\n    }\n\n    const currentValue = currentRecord && deepGet(currentRecord, ['keys', key]);\n\n    if (!eq(currentValue, op.value)) {\n      const { type, id } = record;\n\n      return {\n        op: 'replaceKey',\n        record: { type, id },\n        key,\n        value: currentValue\n      };\n    }\n  },\n\n  replaceAttribute(\n    cache: SyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): RecordOperation | undefined {\n    const op = operation as ReplaceAttributeOperation;\n    const { record, attribute } = op;\n    const currentRecord = cache.getRecordSync(record);\n\n    if (currentRecord === undefined) {\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(record.type, record.id);\n      }\n    }\n\n    const currentValue =\n      currentRecord && deepGet(currentRecord, ['attributes', attribute]);\n\n    if (!eq(currentValue, op.value)) {\n      const { type, id } = record;\n\n      return {\n        op: 'replaceAttribute',\n        record: { type, id },\n        attribute,\n        value: currentValue\n      };\n    }\n  },\n\n  addToRelatedRecords(\n    cache: SyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): RecordOperation | undefined {\n    const op = operation as AddToRelatedRecordsOperation;\n    const { record, relationship, relatedRecord } = op;\n    const currentRelatedRecords = cache.getRelatedRecordsSync(\n      record,\n      relationship\n    );\n\n    if (currentRelatedRecords === undefined) {\n      if (options?.raiseNotFoundExceptions) {\n        if (cache.getRecordSync(record) === undefined) {\n          throw new RecordNotFoundException(record.type, record.id);\n        }\n      }\n    }\n\n    if (\n      currentRelatedRecords === undefined ||\n      !recordsInclude(currentRelatedRecords, relatedRecord)\n    ) {\n      return {\n        op: 'removeFromRelatedRecords',\n        record,\n        relationship,\n        relatedRecord\n      };\n    }\n  },\n\n  removeFromRelatedRecords(\n    cache: SyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): RecordOperation | undefined {\n    const op = operation as RemoveFromRelatedRecordsOperation;\n    const { record, relationship, relatedRecord } = op;\n    const currentRelatedRecords = cache.getRelatedRecordsSync(\n      record,\n      relationship\n    );\n\n    if (currentRelatedRecords === undefined) {\n      if (options?.raiseNotFoundExceptions) {\n        if (cache.getRecordSync(record) === undefined) {\n          throw new RecordNotFoundException(record.type, record.id);\n        }\n      }\n    }\n\n    if (\n      currentRelatedRecords !== undefined &&\n      recordsInclude(currentRelatedRecords, relatedRecord)\n    ) {\n      return {\n        op: 'addToRelatedRecords',\n        record,\n        relationship,\n        relatedRecord\n      };\n    }\n  },\n\n  replaceRelatedRecords(\n    cache: SyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): RecordOperation | undefined {\n    const op = operation as ReplaceRelatedRecordsOperation;\n    const { record, relationship, relatedRecords } = op;\n    const currentRelatedRecords = cache.getRelatedRecordsSync(\n      record,\n      relationship\n    );\n\n    if (currentRelatedRecords === undefined) {\n      if (options?.raiseNotFoundExceptions) {\n        if (cache.getRecordSync(record) === undefined) {\n          throw new RecordNotFoundException(record.type, record.id);\n        }\n      }\n    }\n\n    if (\n      currentRelatedRecords === undefined ||\n      !equalRecordIdentitySets(currentRelatedRecords, relatedRecords)\n    ) {\n      return {\n        op: 'replaceRelatedRecords',\n        record,\n        relationship,\n        relatedRecords: currentRelatedRecords || []\n      };\n    }\n  },\n\n  replaceRelatedRecord(\n    cache: SyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): RecordOperation | undefined {\n    const op = operation as ReplaceRelatedRecordOperation;\n    const { record, relationship, relatedRecord } = op;\n    const currentRelatedRecord = cache.getRelatedRecordSync(\n      record,\n      relationship\n    );\n\n    if (currentRelatedRecord === undefined) {\n      if (options?.raiseNotFoundExceptions) {\n        if (cache.getRecordSync(record) === undefined) {\n          throw new RecordNotFoundException(record.type, record.id);\n        }\n      }\n    }\n\n    if (\n      currentRelatedRecord === undefined ||\n      !equalRecordIdentities(\n        currentRelatedRecord as RecordIdentity,\n        relatedRecord as RecordIdentity\n      )\n    ) {\n      return {\n        op: 'replaceRelatedRecord',\n        record,\n        relationship,\n        relatedRecord: currentRelatedRecord || null\n      };\n    }\n  }\n};\n","import { QueryExpressionParseError, RequestOptions } from '@orbit/data';\nimport {\n  AttributeSortSpecifier,\n  FindRecord,\n  FindRecords,\n  FindRelatedRecord,\n  FindRelatedRecords,\n  InitializedRecord,\n  RecordIdentity,\n  RecordNotFoundException,\n  RecordQueryExpression,\n  RecordQueryExpressionResult,\n  SortSpecifier\n} from '@orbit/records';\nimport { deepGet, Dict, isNone } from '@orbit/utils';\nimport { SyncRecordAccessor } from '../record-accessor';\n\nexport interface SyncQueryOperator {\n  (\n    cache: SyncRecordAccessor,\n    expression: RecordQueryExpression,\n    options?: RequestOptions\n  ): RecordQueryExpressionResult;\n}\n\nexport const SyncQueryOperators: Dict<SyncQueryOperator> = {\n  findRecord(\n    cache: SyncRecordAccessor,\n    expression: RecordQueryExpression,\n    options?: RequestOptions\n  ): InitializedRecord | undefined {\n    const { record } = expression as FindRecord;\n    const currentRecord = cache.getRecordSync(record);\n\n    if (!currentRecord) {\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(record.type, record.id);\n      }\n    }\n\n    return currentRecord;\n  },\n\n  findRecords(\n    cache: SyncRecordAccessor,\n    expression: RecordQueryExpression,\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    options?: RequestOptions\n  ): InitializedRecord[] {\n    let exp = expression as FindRecords;\n    let results = cache.getRecordsSync(exp.records || exp.type);\n    if (exp.filter) {\n      results = filterRecords(results, exp.filter);\n    }\n    if (exp.sort) {\n      results = sortRecords(results, exp.sort);\n    }\n    if (exp.page) {\n      results = paginateRecords(results, exp.page);\n    }\n    return results;\n  },\n\n  findRelatedRecords(\n    cache: SyncRecordAccessor,\n    expression: RecordQueryExpression,\n    options?: RequestOptions\n  ): InitializedRecord[] | undefined {\n    const exp = expression as FindRelatedRecords;\n    const { record, relationship } = exp;\n    const relatedIds = cache.getRelatedRecordsSync(record, relationship);\n    if (!relatedIds || relatedIds.length === 0) {\n      if (!cache.getRecordSync(record)) {\n        if (options?.raiseNotFoundExceptions) {\n          throw new RecordNotFoundException(record.type, record.id);\n        } else {\n          return undefined;\n        }\n      }\n\n      return [];\n    }\n    let results = cache.getRecordsSync(relatedIds);\n\n    if (exp.filter) {\n      results = filterRecords(results, exp.filter);\n    }\n    if (exp.sort) {\n      results = sortRecords(results, exp.sort);\n    }\n    if (exp.page) {\n      results = paginateRecords(results, exp.page);\n    }\n    return results;\n  },\n\n  findRelatedRecord(\n    cache: SyncRecordAccessor,\n    expression: RecordQueryExpression,\n    options?: RequestOptions\n  ): InitializedRecord | null | undefined {\n    const exp = expression as FindRelatedRecord;\n    const { record, relationship } = exp;\n    const relatedId = cache.getRelatedRecordSync(record, relationship);\n\n    if (relatedId) {\n      return cache.getRecordSync(relatedId) || null;\n    } else {\n      if (!cache.getRecordSync(record)) {\n        if (options?.raiseNotFoundExceptions) {\n          throw new RecordNotFoundException(record.type, record.id);\n        } else {\n          return undefined;\n        }\n      }\n\n      return null;\n    }\n  }\n};\n\nfunction filterRecords(records: InitializedRecord[], filters: any[]) {\n  return records.filter((record) => {\n    for (let i = 0, l = filters.length; i < l; i++) {\n      if (!applyFilter(record, filters[i])) {\n        return false;\n      }\n    }\n    return true;\n  });\n}\n\nfunction applyFilter(record: InitializedRecord, filter: any): boolean {\n  if (filter.kind === 'attribute') {\n    let actual = deepGet(record, ['attributes', filter.attribute]);\n    if (actual === undefined) {\n      return false;\n    }\n    let expected = filter.value;\n    switch (filter.op) {\n      case 'equal':\n        return actual === expected;\n      case 'gt':\n        return actual > expected;\n      case 'gte':\n        return actual >= expected;\n      case 'lt':\n        return actual < expected;\n      case 'lte':\n        return actual <= expected;\n      default:\n        throw new QueryExpressionParseError(\n          'Filter operation ${filter.op} not recognized for Store.'\n        );\n    }\n  } else if (filter.kind === 'relatedRecords') {\n    let actual: RecordIdentity[] = deepGet(record, [\n      'relationships',\n      filter.relation,\n      'data'\n    ]);\n    if (actual === undefined) {\n      return false;\n    }\n    let expected: RecordIdentity[] = filter.records;\n    switch (filter.op) {\n      case 'equal':\n        return (\n          actual.length === expected.length &&\n          expected.every((e) =>\n            actual.some((a) => a.id === e.id && a.type === e.type)\n          )\n        );\n      case 'all':\n        return expected.every((e) =>\n          actual.some((a) => a.id === e.id && a.type === e.type)\n        );\n      case 'some':\n        return expected.some((e) =>\n          actual.some((a) => a.id === e.id && a.type === e.type)\n        );\n      case 'none':\n        return !expected.some((e) =>\n          actual.some((a) => a.id === e.id && a.type === e.type)\n        );\n      default:\n        throw new QueryExpressionParseError(\n          'Filter operation ${filter.op} not recognized for Store.'\n        );\n    }\n  } else if (filter.kind === 'relatedRecord') {\n    let actual = deepGet(record, ['relationships', filter.relation, 'data']);\n    if (actual === undefined) {\n      return false;\n    }\n    let expected = filter.record;\n    switch (filter.op) {\n      case 'equal':\n        if (actual === null) {\n          return expected === null;\n        } else {\n          if (Array.isArray(expected)) {\n            return expected.some(\n              (e) => actual.type === e.type && actual.id === e.id\n            );\n          } else if (expected) {\n            return actual.type === expected.type && actual.id === expected.id;\n          } else {\n            return false;\n          }\n        }\n      default:\n        throw new QueryExpressionParseError(\n          'Filter operation ${filter.op} not recognized for Store.'\n        );\n    }\n  }\n  return false;\n}\n\nfunction sortRecords(\n  records: InitializedRecord[],\n  sortSpecifiers: SortSpecifier[]\n): InitializedRecord[] {\n  const comparisonValues = new Map();\n\n  records.forEach((record) => {\n    comparisonValues.set(\n      record,\n      sortSpecifiers.map((sortSpecifier) => {\n        if (sortSpecifier.kind === 'attribute') {\n          return deepGet(record, [\n            'attributes',\n            (sortSpecifier as AttributeSortSpecifier).attribute\n          ]);\n        } else {\n          throw new QueryExpressionParseError(\n            'Sort specifier ${sortSpecifier.kind} not recognized for Store.'\n          );\n        }\n      })\n    );\n  });\n\n  const comparisonOrders = sortSpecifiers.map((sortExpression) =>\n    sortExpression.order === 'descending' ? -1 : 1\n  );\n\n  return records.sort((record1, record2) => {\n    const values1 = comparisonValues.get(record1);\n    const values2 = comparisonValues.get(record2);\n    for (let i = 0; i < sortSpecifiers.length; i++) {\n      if (values1[i] < values2[i]) {\n        return -comparisonOrders[i];\n      } else if (values1[i] > values2[i]) {\n        return comparisonOrders[i];\n      } else if (isNone(values1[i]) && !isNone(values2[i])) {\n        return comparisonOrders[i];\n      } else if (isNone(values2[i]) && !isNone(values1[i])) {\n        return -comparisonOrders[i];\n      }\n    }\n    return 0;\n  });\n}\n\nfunction paginateRecords(\n  records: InitializedRecord[],\n  paginationOptions: any\n): InitializedRecord[] {\n  if (paginationOptions.limit !== undefined) {\n    let offset =\n      paginationOptions.offset === undefined ? 0 : paginationOptions.offset;\n    let limit = paginationOptions.limit;\n\n    return records.slice(offset, offset + limit);\n  } else {\n    throw new QueryExpressionParseError(\n      'Pagination options not recognized for Store. Please specify `offset` and `limit`.'\n    );\n  }\n}\n","import { RequestOptions } from '@orbit/data';\nimport {\n  AddRecordOperation,\n  AddToRelatedRecordsOperation,\n  cloneRecordIdentity,\n  equalRecordIdentities,\n  InitializedRecord,\n  mergeRecords,\n  RecordIdentity,\n  RecordNotFoundException,\n  RecordOperation,\n  RecordOperationResult,\n  recordsInclude,\n  RemoveFromRelatedRecordsOperation,\n  RemoveRecordOperation,\n  ReplaceAttributeOperation,\n  ReplaceKeyOperation,\n  ReplaceRelatedRecordOperation,\n  ReplaceRelatedRecordsOperation,\n  UpdateRecordOperation\n} from '@orbit/records';\nimport { clone, deepGet, deepSet, Dict } from '@orbit/utils';\nimport { SyncRecordAccessor } from '../record-accessor';\n\nexport interface SyncTransformOperator {\n  (\n    cache: SyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): RecordOperationResult;\n}\n\nexport const SyncTransformOperators: Dict<SyncTransformOperator> = {\n  addRecord(\n    cache: SyncRecordAccessor,\n    operation: RecordOperation,\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    options?: RequestOptions\n  ): RecordOperationResult {\n    const op = operation as AddRecordOperation;\n    const { record } = op;\n    cache.setRecordSync(record);\n\n    if (cache.keyMap) {\n      cache.keyMap.pushRecord(record);\n    }\n\n    return record;\n  },\n\n  updateRecord(\n    cache: SyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): RecordOperationResult {\n    const op = operation as UpdateRecordOperation;\n    const { record } = op;\n    const currentRecord = cache.getRecordSync(record);\n\n    if (currentRecord === undefined) {\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(record.type, record.id);\n      }\n    }\n\n    const mergedRecord = mergeRecords(currentRecord || null, record);\n\n    cache.setRecordSync(mergedRecord);\n\n    if (cache.keyMap) {\n      cache.keyMap.pushRecord(mergedRecord);\n    }\n\n    return mergedRecord;\n  },\n\n  removeRecord(\n    cache: SyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): RecordOperationResult {\n    const op = operation as RemoveRecordOperation;\n    const record = cache.removeRecordSync(op.record);\n\n    if (record === undefined) {\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(op.record.type, op.record.id);\n      }\n    }\n\n    return record;\n  },\n\n  replaceKey(\n    cache: SyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): RecordOperationResult {\n    const op = operation as ReplaceKeyOperation;\n    const currentRecord = cache.getRecordSync(op.record);\n    let record: InitializedRecord;\n\n    if (currentRecord) {\n      record = clone(currentRecord);\n    } else {\n      record = cloneRecordIdentity(op.record);\n\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(record.type, record.id);\n      }\n    }\n\n    deepSet(record, ['keys', op.key], op.value);\n    cache.setRecordSync(record);\n\n    if (cache.keyMap) {\n      cache.keyMap.pushRecord(record);\n    }\n\n    return record;\n  },\n\n  replaceAttribute(\n    cache: SyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): RecordOperationResult {\n    const op = operation as ReplaceAttributeOperation;\n    const currentRecord = cache.getRecordSync(op.record);\n    let record: InitializedRecord;\n\n    if (currentRecord) {\n      record = clone(currentRecord);\n    } else {\n      record = cloneRecordIdentity(op.record);\n\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(record.type, record.id);\n      }\n    }\n\n    deepSet(record, ['attributes', op.attribute], op.value);\n    cache.setRecordSync(record);\n\n    return record;\n  },\n\n  addToRelatedRecords(\n    cache: SyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): RecordOperationResult {\n    const op = operation as AddToRelatedRecordsOperation;\n    const { relationship, relatedRecord } = op;\n    const currentRecord = cache.getRecordSync(op.record);\n    let record: InitializedRecord;\n\n    if (currentRecord) {\n      record = clone(currentRecord);\n    } else {\n      record = cloneRecordIdentity(op.record);\n\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(record.type, record.id);\n      }\n    }\n\n    const relatedRecords: RecordIdentity[] =\n      deepGet(record, ['relationships', relationship, 'data']) || [];\n\n    if (!recordsInclude(relatedRecords, relatedRecord)) {\n      relatedRecords.push(relatedRecord);\n\n      deepSet(record, ['relationships', relationship, 'data'], relatedRecords);\n      cache.setRecordSync(record);\n    }\n\n    return record;\n  },\n\n  removeFromRelatedRecords(\n    cache: SyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): RecordOperationResult {\n    const op = operation as RemoveFromRelatedRecordsOperation;\n    const currentRecord = cache.getRecordSync(op.record);\n    const { relationship, relatedRecord } = op;\n    let record: InitializedRecord;\n\n    if (currentRecord) {\n      record = clone(currentRecord);\n      let relatedRecords: RecordIdentity[] = deepGet(record, [\n        'relationships',\n        relationship,\n        'data'\n      ]);\n      if (relatedRecords) {\n        relatedRecords = relatedRecords.filter(\n          (r) => !equalRecordIdentities(r, relatedRecord)\n        );\n\n        if (\n          deepSet(\n            record,\n            ['relationships', relationship, 'data'],\n            relatedRecords\n          )\n        ) {\n          cache.setRecordSync(record);\n        }\n      }\n      return record;\n    } else {\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(op.record.type, op.record.id);\n      }\n    }\n  },\n\n  replaceRelatedRecords(\n    cache: SyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): RecordOperationResult {\n    const op = operation as ReplaceRelatedRecordsOperation;\n    const currentRecord = cache.getRecordSync(op.record);\n    const { relationship, relatedRecords } = op;\n    let record: InitializedRecord;\n\n    if (currentRecord) {\n      record = clone(currentRecord);\n    } else {\n      record = cloneRecordIdentity(op.record);\n\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(record.type, record.id);\n      }\n    }\n\n    if (\n      deepSet(record, ['relationships', relationship, 'data'], relatedRecords)\n    ) {\n      cache.setRecordSync(record);\n    }\n\n    return record;\n  },\n\n  replaceRelatedRecord(\n    cache: SyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): RecordOperationResult {\n    const op = operation as ReplaceRelatedRecordOperation;\n    const currentRecord = cache.getRecordSync(op.record);\n    const { relationship, relatedRecord } = op;\n    let record: InitializedRecord;\n\n    if (currentRecord) {\n      record = clone(currentRecord);\n    } else {\n      record = cloneRecordIdentity(op.record);\n\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(record.type, record.id);\n      }\n    }\n\n    if (\n      deepSet(record, ['relationships', relationship, 'data'], relatedRecord)\n    ) {\n      cache.setRecordSync(record);\n    }\n\n    return record;\n  }\n};\n","import { Assertion, Orbit } from '@orbit/core';\nimport {\n  buildQuery,\n  buildTransform,\n  DefaultRequestOptions,\n  FullRequestOptions,\n  FullResponse,\n  OperationTerm,\n  QueryOrExpressions,\n  RequestOptions,\n  TransformOrOperations\n} from '@orbit/data';\nimport {\n  InitializedRecord,\n  RecordIdentity,\n  RecordOperation,\n  RecordOperationResult,\n  RecordOperationTerm,\n  RecordQuery,\n  RecordQueryBuilder,\n  RecordQueryExpression,\n  RecordQueryResult,\n  recordsReferencedByOperations,\n  RecordTransform,\n  RecordTransformBuilder,\n  RecordTransformBuilderFunc,\n  RecordTransformResult,\n  SyncRecordQueryable,\n  SyncRecordUpdatable\n} from '@orbit/records';\nimport { deepGet, Dict, toArray } from '@orbit/utils';\nimport { SyncLiveQuery } from './live-query/sync-live-query';\nimport { SyncCacheIntegrityProcessor } from './operation-processors/sync-cache-integrity-processor';\nimport { SyncSchemaConsistencyProcessor } from './operation-processors/sync-schema-consistency-processor';\nimport { SyncSchemaValidationProcessor } from './operation-processors/sync-schema-validation-processor';\nimport {\n  SyncInverseTransformOperator,\n  SyncInverseTransformOperators\n} from './operators/sync-inverse-transform-operators';\nimport {\n  SyncQueryOperator,\n  SyncQueryOperators\n} from './operators/sync-query-operators';\nimport {\n  SyncTransformOperator,\n  SyncTransformOperators\n} from './operators/sync-transform-operators';\nimport {\n  RecordChangeset,\n  RecordRelationshipIdentity,\n  SyncRecordAccessor\n} from './record-accessor';\nimport {\n  RecordCache,\n  RecordCacheQueryOptions,\n  RecordCacheSettings,\n  RecordCacheTransformOptions\n} from './record-cache';\nimport { RecordTransformBuffer } from './record-transform-buffer';\nimport { PatchResult, RecordCacheUpdateDetails } from './response';\nimport {\n  SyncOperationProcessor,\n  SyncOperationProcessorClass\n} from './sync-operation-processor';\n\nconst { assert, deprecate } = Orbit;\n\nexport interface SyncRecordCacheSettings<\n  QO extends RequestOptions = RecordCacheQueryOptions,\n  TO extends RequestOptions = RecordCacheTransformOptions,\n  QB = RecordQueryBuilder,\n  TB = RecordTransformBuilder\n> extends RecordCacheSettings<QO, TO, QB, TB> {\n  processors?: SyncOperationProcessorClass[];\n  queryOperators?: Dict<SyncQueryOperator>;\n  transformOperators?: Dict<SyncTransformOperator>;\n  inverseTransformOperators?: Dict<SyncInverseTransformOperator>;\n  debounceLiveQueries?: boolean;\n  transformBuffer?: RecordTransformBuffer;\n}\n\nexport abstract class SyncRecordCache<\n    QO extends RequestOptions = RecordCacheQueryOptions,\n    TO extends RequestOptions = RecordCacheTransformOptions,\n    QB = RecordQueryBuilder,\n    TB = RecordTransformBuilder,\n    QueryResponseDetails = unknown,\n    TransformResponseDetails extends RecordCacheUpdateDetails = RecordCacheUpdateDetails\n  >\n  extends RecordCache<QO, TO, QB, TB>\n  implements\n    SyncRecordAccessor,\n    SyncRecordQueryable<QueryResponseDetails, QB, QO>,\n    SyncRecordUpdatable<TransformResponseDetails, TB, TO> {\n  protected _processors: SyncOperationProcessor[];\n  protected _queryOperators: Dict<SyncQueryOperator>;\n  protected _transformOperators: Dict<SyncTransformOperator>;\n  protected _inverseTransformOperators: Dict<SyncInverseTransformOperator>;\n  protected _debounceLiveQueries: boolean;\n  protected _transformBuffer?: RecordTransformBuffer;\n\n  constructor(settings: SyncRecordCacheSettings<QO, TO, QB, TB>) {\n    super(settings);\n\n    this._queryOperators = settings.queryOperators ?? SyncQueryOperators;\n    this._transformOperators =\n      settings.transformOperators ?? SyncTransformOperators;\n    this._inverseTransformOperators =\n      settings.inverseTransformOperators ?? SyncInverseTransformOperators;\n    this._debounceLiveQueries = settings.debounceLiveQueries !== false;\n    this._transformBuffer = settings.transformBuffer;\n\n    const processors: SyncOperationProcessorClass[] = settings.processors\n      ? settings.processors\n      : [SyncSchemaConsistencyProcessor, SyncCacheIntegrityProcessor];\n\n    if (settings.autoValidate !== false && settings.processors === undefined) {\n      processors.push(SyncSchemaValidationProcessor);\n    }\n\n    this._processors = processors.map((Processor) => {\n      let processor = new Processor(this);\n      assert(\n        'Each processor must extend SyncOperationProcessor',\n        processor instanceof SyncOperationProcessor\n      );\n      return processor;\n    });\n  }\n\n  get processors(): SyncOperationProcessor[] {\n    return this._processors;\n  }\n\n  getQueryOperator(op: string): SyncQueryOperator {\n    return this._queryOperators[op];\n  }\n\n  getTransformOperator(op: string): SyncTransformOperator {\n    return this._transformOperators[op];\n  }\n\n  getInverseTransformOperator(op: string): SyncInverseTransformOperator {\n    return this._inverseTransformOperators[op];\n  }\n\n  // Abstract methods for getting records and relationships\n  abstract getRecordSync(\n    recordIdentity: RecordIdentity\n  ): InitializedRecord | undefined;\n  abstract getRecordsSync(\n    typeOrIdentities?: string | RecordIdentity[]\n  ): InitializedRecord[];\n  abstract getInverseRelationshipsSync(\n    recordIdentityOrIdentities: RecordIdentity | RecordIdentity[]\n  ): RecordRelationshipIdentity[];\n\n  // Abstract methods for setting records and relationships\n  abstract setRecordSync(record: InitializedRecord): void;\n  abstract setRecordsSync(records: InitializedRecord[]): void;\n  abstract removeRecordSync(\n    recordIdentity: RecordIdentity\n  ): InitializedRecord | undefined;\n  abstract removeRecordsSync(\n    recordIdentities: RecordIdentity[]\n  ): InitializedRecord[];\n  abstract addInverseRelationshipsSync(\n    relationships: RecordRelationshipIdentity[]\n  ): void;\n  abstract removeInverseRelationshipsSync(\n    relationships: RecordRelationshipIdentity[]\n  ): void;\n\n  applyRecordChangesetSync(changeset: RecordChangeset): void {\n    const {\n      setRecords,\n      removeRecords,\n      addInverseRelationships,\n      removeInverseRelationships\n    } = changeset;\n\n    if (setRecords && setRecords.length > 0) {\n      this.setRecordsSync(setRecords);\n    }\n    if (removeRecords && removeRecords.length > 0) {\n      this.removeRecordsSync(removeRecords);\n    }\n    if (addInverseRelationships && addInverseRelationships.length > 0) {\n      this.addInverseRelationshipsSync(addInverseRelationships);\n    }\n    if (removeInverseRelationships && removeInverseRelationships.length > 0) {\n      this.removeInverseRelationshipsSync(removeInverseRelationships);\n    }\n  }\n\n  getRelatedRecordSync(\n    identity: RecordIdentity,\n    relationship: string\n  ): RecordIdentity | null | undefined {\n    const record = this.getRecordSync(identity);\n    if (record) {\n      return deepGet(record, ['relationships', relationship, 'data']);\n    }\n    return undefined;\n  }\n\n  getRelatedRecordsSync(\n    identity: RecordIdentity,\n    relationship: string\n  ): RecordIdentity[] | undefined {\n    const record = this.getRecordSync(identity);\n    if (record) {\n      return deepGet(record, ['relationships', relationship, 'data']);\n    }\n    return undefined;\n  }\n\n  /**\n   * Queries the cache.\n   */\n  query<RequestData extends RecordQueryResult = RecordQueryResult>(\n    queryOrExpressions: QueryOrExpressions<RecordQueryExpression, QB>,\n    options?: DefaultRequestOptions<QO>,\n    id?: string\n  ): RequestData;\n  query<RequestData extends RecordQueryResult = RecordQueryResult>(\n    queryOrExpressions: QueryOrExpressions<RecordQueryExpression, QB>,\n    options: FullRequestOptions<QO>,\n    id?: string\n  ): FullResponse<RequestData, QueryResponseDetails, RecordOperation>;\n  query<RequestData extends RecordQueryResult = RecordQueryResult>(\n    queryOrExpressions: QueryOrExpressions<RecordQueryExpression, QB>,\n    options?: QO,\n    id?: string\n  ):\n    | RequestData\n    | FullResponse<RequestData, QueryResponseDetails, RecordOperation> {\n    const query = buildQuery<RecordQueryExpression, QB>(\n      queryOrExpressions,\n      options,\n      id,\n      this._queryBuilder\n    );\n\n    const response = this._query<RequestData>(query, options);\n\n    if (options?.fullResponse) {\n      return response;\n    } else {\n      return response.data as RequestData;\n    }\n  }\n\n  /**\n   * Updates the cache.\n   */\n  update<RequestData extends RecordTransformResult = RecordTransformResult>(\n    transformOrOperations: TransformOrOperations<RecordOperation, TB>,\n    options?: DefaultRequestOptions<TO>,\n    id?: string\n  ): RequestData;\n  update<RequestData extends RecordTransformResult = RecordTransformResult>(\n    transformOrOperations: TransformOrOperations<RecordOperation, TB>,\n    options: FullRequestOptions<TO>,\n    id?: string\n  ): FullResponse<RequestData, TransformResponseDetails, RecordOperation>;\n  update<RequestData extends RecordTransformResult = RecordTransformResult>(\n    transformOrOperations: TransformOrOperations<RecordOperation, TB>,\n    options?: TO,\n    id?: string\n  ):\n    | RequestData\n    | FullResponse<RequestData, TransformResponseDetails, RecordOperation> {\n    const transform = buildTransform(\n      transformOrOperations,\n      options,\n      id,\n      this._transformBuilder\n    );\n\n    const response = this._update<RequestData>(transform, options);\n\n    if (options?.fullResponse) {\n      return response;\n    } else {\n      return response.data as RequestData;\n    }\n  }\n\n  /**\n   * Patches the cache with an operation or operations.\n   *\n   * @deprecated since v0.17\n   */\n  patch(\n    operationOrOperations:\n      | RecordOperation\n      | RecordOperation[]\n      | RecordOperationTerm\n      | RecordOperationTerm[]\n      | RecordTransformBuilderFunc\n  ): PatchResult {\n    deprecate(\n      'SyncRecordCache#patch has been deprecated. Use SyncRecordCache#update instead.'\n    );\n\n    // TODO - Why is this `this` cast necessary for TS to understand the correct\n    // method overload?\n    const { data, details } = (this as any).update(operationOrOperations, {\n      fullResponse: true\n    });\n\n    return {\n      inverse: details?.inverseOperations || [],\n      data: Array.isArray(data) ? data : [data]\n    };\n  }\n\n  liveQuery(\n    queryOrExpressions: QueryOrExpressions<RecordQueryExpression, QB>,\n    options?: DefaultRequestOptions<QO>,\n    id?: string\n  ): SyncLiveQuery<QO, TO, QB, TB> {\n    const query = buildQuery(\n      queryOrExpressions,\n      options,\n      id,\n      this.queryBuilder\n    );\n\n    let debounce = options && (options as any).debounce;\n    if (typeof debounce !== 'boolean') {\n      debounce = this._debounceLiveQueries;\n    }\n\n    return new SyncLiveQuery<QO, TO, QB, TB>({\n      debounce,\n      cache: this,\n      query\n    });\n  }\n\n  /////////////////////////////////////////////////////////////////////////////\n  // Protected methods\n  /////////////////////////////////////////////////////////////////////////////\n\n  protected _query<RequestData extends RecordQueryResult = RecordQueryResult>(\n    query: RecordQuery,\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    options?: QO\n  ): FullResponse<RequestData, QueryResponseDetails, RecordOperation> {\n    let data;\n\n    if (Array.isArray(query.expressions)) {\n      data = [];\n      for (let expression of query.expressions) {\n        const queryOperator = this.getQueryOperator(expression.op);\n        if (!queryOperator) {\n          throw new Error(`Unable to find query operator: ${expression.op}`);\n        }\n        data.push(\n          queryOperator(\n            this,\n            expression,\n            this.getQueryOptions(query, expression)\n          )\n        );\n      }\n    } else {\n      const expression = query.expressions as RecordQueryExpression;\n      const queryOperator = this.getQueryOperator(expression.op);\n      if (!queryOperator) {\n        throw new Error(`Unable to find query operator: ${expression.op}`);\n      }\n      data = queryOperator(\n        this,\n        expression,\n        this.getQueryOptions(query, expression)\n      );\n    }\n\n    return { data: data as RequestData };\n  }\n\n  protected _update<\n    RequestData extends RecordTransformResult = RecordTransformResult\n  >(\n    transform: RecordTransform,\n    options?: TO\n  ): FullResponse<RequestData, TransformResponseDetails, RecordOperation> {\n    if (this.getTransformOptions(transform)?.useBuffer) {\n      const buffer = this._initTransformBuffer(transform);\n\n      buffer.startTrackingChanges();\n\n      const response = buffer.update(transform, {\n        fullResponse: true\n      });\n\n      const changes = buffer.stopTrackingChanges();\n\n      this.applyRecordChangesetSync(changes);\n\n      const {\n        appliedOperations,\n        appliedOperationResults\n      } = response.details as TransformResponseDetails;\n\n      for (let i = 0, len = appliedOperations.length; i < len; i++) {\n        this.emit('patch', appliedOperations[i], appliedOperationResults[i]);\n      }\n\n      return response as FullResponse<\n        RequestData,\n        TransformResponseDetails,\n        RecordOperation\n      >;\n    } else {\n      const response = {\n        data: []\n      } as FullResponse<\n        RecordOperationResult[],\n        RecordCacheUpdateDetails,\n        RecordOperation\n      >;\n\n      if (options?.fullResponse) {\n        response.details = {\n          appliedOperations: [],\n          appliedOperationResults: [],\n          inverseOperations: []\n        };\n      }\n\n      let data: RecordTransformResult;\n\n      if (Array.isArray(transform.operations)) {\n        this._applyTransformOperations(\n          transform,\n          transform.operations,\n          response,\n          true\n        );\n        data = response.data;\n      } else {\n        this._applyTransformOperation(\n          transform,\n          transform.operations,\n          response,\n          true\n        );\n        if (Array.isArray(response.data)) {\n          data = response.data[0];\n        }\n      }\n\n      if (options?.fullResponse) {\n        response.details?.inverseOperations.reverse();\n      }\n\n      return {\n        ...response,\n        data\n      } as FullResponse<RequestData, TransformResponseDetails, RecordOperation>;\n    }\n  }\n\n  protected _getTransformBuffer(): RecordTransformBuffer {\n    if (this._transformBuffer === undefined) {\n      throw new Assertion(\n        'transformBuffer must be provided to cache via constructor settings'\n      );\n    }\n    return this._transformBuffer;\n  }\n\n  protected _initTransformBuffer(\n    transform: RecordTransform\n  ): RecordTransformBuffer {\n    const buffer = this._getTransformBuffer();\n\n    const records = recordsReferencedByOperations(\n      toArray(transform.operations)\n    );\n    const inverseRelationships = this.getInverseRelationshipsSync(records);\n    const relatedRecords = inverseRelationships.map((ir) => ir.record);\n    Array.prototype.push.apply(records, relatedRecords);\n\n    buffer.resetState();\n    buffer.setRecordsSync(this.getRecordsSync(records));\n    buffer.addInverseRelationshipsSync(inverseRelationships);\n\n    return buffer;\n  }\n\n  protected _applyTransformOperations(\n    transform: RecordTransform,\n    ops: RecordOperation[] | RecordOperationTerm[],\n    response: FullResponse<\n      RecordOperationResult[],\n      RecordCacheUpdateDetails,\n      RecordOperation\n    >,\n    primary = false\n  ): void {\n    for (const op of ops) {\n      this._applyTransformOperation(transform, op, response, primary);\n    }\n  }\n\n  protected _applyTransformOperation(\n    transform: RecordTransform,\n    operation: RecordOperation | RecordOperationTerm,\n    response: FullResponse<\n      RecordOperationResult[],\n      RecordCacheUpdateDetails,\n      RecordOperation\n    >,\n    primary = false\n  ): void {\n    if (operation instanceof OperationTerm) {\n      operation = operation.toOperation() as RecordOperation;\n    }\n    for (let processor of this._processors) {\n      processor.validate(operation);\n    }\n\n    const inverseTransformOperator = this.getInverseTransformOperator(\n      operation.op\n    );\n    const inverseOp: RecordOperation | undefined = inverseTransformOperator(\n      this,\n      operation,\n      this.getTransformOptions(transform, operation)\n    );\n    if (inverseOp) {\n      response.details?.inverseOperations?.push(inverseOp);\n\n      // Query and perform related `before` operations\n      for (let processor of this._processors) {\n        this._applyTransformOperations(\n          transform,\n          processor.before(operation),\n          response\n        );\n      }\n\n      // Query related `after` operations before performing\n      // the requested operation. These will be applied on success.\n      let preparedOps = [];\n      for (let processor of this._processors) {\n        preparedOps.push(processor.after(operation));\n      }\n\n      // Perform the requested operation\n      let transformOperator = this.getTransformOperator(operation.op);\n      let data = transformOperator(\n        this,\n        operation,\n        this.getTransformOptions(transform, operation)\n      );\n      if (primary) {\n        response.data?.push(data);\n      }\n      if (response.details) {\n        response.details.appliedOperationResults.push(data);\n        response.details.appliedOperations.push(operation);\n      }\n\n      // Query and perform related `immediate` operations\n      for (let processor of this._processors) {\n        processor.immediate(operation);\n      }\n\n      // Emit event\n      this.emit('patch', operation, data);\n\n      // Perform prepared operations after performing the requested operation\n      for (let ops of preparedOps) {\n        this._applyTransformOperations(transform, ops, response);\n      }\n\n      // Query and perform related `finally` operations\n      for (let processor of this._processors) {\n        this._applyTransformOperations(\n          transform,\n          processor.finally(operation),\n          response\n        );\n      }\n    } else if (primary) {\n      response.data?.push(undefined);\n    }\n  }\n}\n","import { Dict, objectValues } from '@orbit/utils';\nimport {\n  deserializeRecordIdentity,\n  InitializedRecord,\n  RecordIdentity,\n  serializeRecordIdentity\n} from '@orbit/records';\nimport { RecordChangeset, RecordRelationshipIdentity } from './record-accessor';\nimport { SyncRecordCache, SyncRecordCacheSettings } from './sync-record-cache';\nimport { RecordTransformBuffer } from './record-transform-buffer';\n\nfunction serializeRecordRelationshipIdentity(\n  rri: RecordRelationshipIdentity\n): string {\n  return `${serializeRecordIdentity(rri.record)}::${rri.relationship}`;\n}\n\nfunction deserializeRecordRelationshipIdentity(\n  rri: string\n): { record: RecordIdentity; relationship: string } {\n  const [record, relationship] = rri.split('::');\n  return { record: deserializeRecordIdentity(record), relationship };\n}\n\nexport interface SimpleRecordTransformBufferState {\n  records: Dict<InitializedRecord | null>;\n  inverseRelationships: Dict<Dict<RecordRelationshipIdentity | null>>;\n}\n\nexport class SimpleRecordTransformBuffer\n  extends SyncRecordCache\n  implements RecordTransformBuffer {\n  protected _state!: SimpleRecordTransformBufferState;\n  protected _delta?: SimpleRecordTransformBufferState;\n\n  constructor(settings: SyncRecordCacheSettings) {\n    super(settings);\n    this.resetState();\n  }\n\n  resetState(): void {\n    this._state = {\n      records: {},\n      inverseRelationships: {}\n    };\n  }\n\n  startTrackingChanges(): void {\n    this._delta = {\n      records: {},\n      inverseRelationships: {}\n    };\n  }\n\n  stopTrackingChanges(): RecordChangeset {\n    if (this._delta === undefined) {\n      throw new Error(\n        `Changes are not being tracked. Call 'startTrackingChanges' before 'stopTrackingChanges'`\n      );\n    }\n\n    let { records, inverseRelationships } = this._delta;\n    let changeset: RecordChangeset = {};\n\n    for (let rid of Object.keys(records)) {\n      let rv = records[rid];\n      if (rv === null) {\n        changeset.removeRecords = changeset.removeRecords ?? [];\n        changeset.removeRecords.push(deserializeRecordIdentity(rid));\n      } else {\n        changeset.setRecords = changeset.setRecords ?? [];\n        changeset.setRecords.push(rv);\n      }\n    }\n\n    for (let rid of Object.keys(inverseRelationships)) {\n      let relatedRecord = deserializeRecordIdentity(rid);\n      let rels = inverseRelationships[rid];\n      for (let rel of Object.keys(rels)) {\n        let rv = rels[rel];\n        let { record, relationship } = deserializeRecordRelationshipIdentity(\n          rel\n        );\n        let rri = { relatedRecord, record, relationship };\n        if (rv === null) {\n          changeset.removeInverseRelationships =\n            changeset.removeInverseRelationships ?? [];\n          changeset.removeInverseRelationships.push(rri);\n        } else {\n          changeset.addInverseRelationships =\n            changeset.addInverseRelationships ?? [];\n          changeset.addInverseRelationships.push(rri);\n        }\n      }\n    }\n\n    this._delta = undefined;\n\n    return changeset;\n  }\n\n  getRecordSync(identity: RecordIdentity): InitializedRecord | undefined {\n    return this._state.records[serializeRecordIdentity(identity)] ?? undefined;\n  }\n\n  getRecordsSync(\n    typeOrIdentities?: string | RecordIdentity[]\n  ): InitializedRecord[] {\n    if (typeof typeOrIdentities === 'string') {\n      return objectValues(this._state.records[typeOrIdentities]);\n    } else if (Array.isArray(typeOrIdentities)) {\n      const records: InitializedRecord[] = [];\n      const identities: RecordIdentity[] = typeOrIdentities;\n      for (let i of identities) {\n        let record = this.getRecordSync(i);\n        if (record) {\n          records.push(record);\n        }\n      }\n      return records;\n    } else {\n      throw new Error('typeOrIdentities must be specified in getRecordsSync');\n    }\n  }\n\n  setRecordSync(record: InitializedRecord): void {\n    this._state.records[serializeRecordIdentity(record)] = record;\n    if (this._delta) {\n      this._delta.records[serializeRecordIdentity(record)] = record;\n    }\n  }\n\n  setRecordsSync(records: InitializedRecord[]): void {\n    records.forEach((record) => this.setRecordSync(record));\n  }\n\n  removeRecordSync(\n    recordIdentity: RecordIdentity\n  ): InitializedRecord | undefined {\n    const record = this.getRecordSync(recordIdentity);\n    if (record) {\n      delete this._state.records[serializeRecordIdentity(record)];\n      if (this._delta) {\n        this._delta.records[serializeRecordIdentity(record)] = null;\n      }\n      return record;\n    } else {\n      return undefined;\n    }\n  }\n\n  removeRecordsSync(recordIdentities: RecordIdentity[]): InitializedRecord[] {\n    const records = [];\n    for (let recordIdentity of recordIdentities) {\n      let record = this.getRecordSync(recordIdentity);\n      if (record) {\n        records.push(record);\n        delete this._state.records[serializeRecordIdentity(record)];\n        if (this._delta) {\n          this._delta.records[serializeRecordIdentity(record)] = null;\n        }\n      }\n    }\n    return records;\n  }\n\n  getInverseRelationshipsSync(\n    recordIdentityOrIdentities: RecordIdentity | RecordIdentity[]\n  ): RecordRelationshipIdentity[] {\n    if (Array.isArray(recordIdentityOrIdentities)) {\n      let relationships: RecordRelationshipIdentity[] = [];\n      recordIdentityOrIdentities.forEach((record) => {\n        Array.prototype.push(\n          relationships,\n          this._getInverseRelationshipsSync(record)\n        );\n      });\n      return relationships;\n    } else {\n      return this._getInverseRelationshipsSync(recordIdentityOrIdentities);\n    }\n  }\n\n  addInverseRelationshipsSync(\n    relationships: RecordRelationshipIdentity[]\n  ): void {\n    for (let relationship of relationships) {\n      const ri = serializeRecordIdentity(relationship.relatedRecord);\n      const rri = serializeRecordRelationshipIdentity(relationship);\n      const rels = this._state.inverseRelationships[ri] ?? {};\n      rels[rri] = relationship;\n      this._state.inverseRelationships[ri] = rels;\n      if (this._delta) {\n        const rels = this._delta.inverseRelationships[ri] ?? {};\n        rels[rri] = relationship;\n        this._delta.inverseRelationships[ri] = rels;\n      }\n    }\n  }\n\n  removeInverseRelationshipsSync(\n    relationships: RecordRelationshipIdentity[]\n  ): void {\n    for (let relationship of relationships) {\n      const ri = serializeRecordIdentity(relationship.relatedRecord);\n      const rri = serializeRecordRelationshipIdentity(relationship);\n      const rels = this._state.inverseRelationships[ri];\n\n      if (rels) {\n        rels[rri] = null;\n        if (this._delta) {\n          const rels = this._delta.inverseRelationships[ri] ?? {};\n          rels[rri] = null;\n        }\n      }\n    }\n  }\n\n  /////////////////////////////////////////////////////////////////////////////\n  // Protected methods\n  /////////////////////////////////////////////////////////////////////////////\n\n  protected _getInverseRelationshipsSync(\n    recordIdentity: RecordIdentity\n  ): RecordRelationshipIdentity[] {\n    let relationships = this._state.inverseRelationships[\n      serializeRecordIdentity(recordIdentity)\n    ];\n    if (relationships) {\n      return objectValues(relationships).filter((r) => r !== null);\n    } else {\n      return [];\n    }\n  }\n}\n","import { RequestOptions } from '@orbit/data';\nimport {\n  AddRecordOperation,\n  AddToRelatedRecordsOperation,\n  cloneRecordIdentity,\n  equalRecordIdentities,\n  InitializedRecord,\n  mergeRecords,\n  RecordIdentity,\n  RecordNotFoundException,\n  RecordOperation,\n  RecordOperationResult,\n  recordsInclude,\n  RemoveFromRelatedRecordsOperation,\n  RemoveRecordOperation,\n  ReplaceAttributeOperation,\n  ReplaceKeyOperation,\n  ReplaceRelatedRecordOperation,\n  ReplaceRelatedRecordsOperation,\n  UpdateRecordOperation\n} from '@orbit/records';\nimport { clone, deepGet, deepSet, Dict } from '@orbit/utils';\nimport { AsyncRecordAccessor } from '../record-accessor';\n\nexport interface AsyncTransformOperator {\n  (\n    cache: AsyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): Promise<RecordOperationResult>;\n}\n\nexport const AsyncTransformOperators: Dict<AsyncTransformOperator> = {\n  async addRecord(\n    cache: AsyncRecordAccessor,\n    operation: RecordOperation,\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    options?: RequestOptions\n  ): Promise<RecordOperationResult> {\n    const op = operation as AddRecordOperation;\n    const { record } = op;\n    await cache.setRecordAsync(record);\n\n    if (cache.keyMap) {\n      cache.keyMap.pushRecord(record);\n    }\n\n    return record;\n  },\n\n  async updateRecord(\n    cache: AsyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): Promise<RecordOperationResult> {\n    const op = operation as UpdateRecordOperation;\n    const { record } = op;\n    const currentRecord = await cache.getRecordAsync(record);\n\n    if (currentRecord === undefined) {\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(record.type, record.id);\n      }\n    }\n\n    const mergedRecord = mergeRecords(currentRecord || null, record);\n\n    await cache.setRecordAsync(mergedRecord);\n\n    if (cache.keyMap) {\n      cache.keyMap.pushRecord(mergedRecord);\n    }\n\n    return mergedRecord;\n  },\n\n  async removeRecord(\n    cache: AsyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): Promise<RecordOperationResult> {\n    const op = operation as RemoveRecordOperation;\n    const record = await cache.removeRecordAsync(op.record);\n\n    if (record === undefined) {\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(op.record.type, op.record.id);\n      }\n    }\n\n    return record;\n  },\n\n  async replaceKey(\n    cache: AsyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): Promise<RecordOperationResult> {\n    const op = operation as ReplaceKeyOperation;\n    const currentRecord = await cache.getRecordAsync(op.record);\n    let record: InitializedRecord;\n\n    if (currentRecord) {\n      record = clone(currentRecord);\n    } else {\n      record = cloneRecordIdentity(op.record);\n\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(record.type, record.id);\n      }\n    }\n\n    deepSet(record, ['keys', op.key], op.value);\n    await cache.setRecordAsync(record);\n\n    if (cache.keyMap) {\n      cache.keyMap.pushRecord(record);\n    }\n\n    return record;\n  },\n\n  async replaceAttribute(\n    cache: AsyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): Promise<RecordOperationResult> {\n    const op = operation as ReplaceAttributeOperation;\n    const currentRecord = await cache.getRecordAsync(op.record);\n    let record: InitializedRecord;\n\n    if (currentRecord) {\n      record = clone(currentRecord);\n    } else {\n      record = cloneRecordIdentity(op.record);\n\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(record.type, record.id);\n      }\n    }\n\n    deepSet(record, ['attributes', op.attribute], op.value);\n    await cache.setRecordAsync(record);\n\n    return record;\n  },\n\n  async addToRelatedRecords(\n    cache: AsyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): Promise<RecordOperationResult> {\n    const op = operation as AddToRelatedRecordsOperation;\n    const { relationship, relatedRecord } = op;\n    const currentRecord = await cache.getRecordAsync(op.record);\n    let record: InitializedRecord;\n\n    if (currentRecord) {\n      record = clone(currentRecord);\n    } else {\n      record = cloneRecordIdentity(op.record);\n\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(record.type, record.id);\n      }\n    }\n\n    const relatedRecords: RecordIdentity[] =\n      deepGet(record, ['relationships', relationship, 'data']) || [];\n\n    if (!recordsInclude(relatedRecords, relatedRecord)) {\n      relatedRecords.push(relatedRecord);\n\n      deepSet(record, ['relationships', relationship, 'data'], relatedRecords);\n      await cache.setRecordAsync(record);\n    }\n\n    return record;\n  },\n\n  async removeFromRelatedRecords(\n    cache: AsyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): Promise<RecordOperationResult> {\n    const op = operation as RemoveFromRelatedRecordsOperation;\n    const currentRecord = await cache.getRecordAsync(op.record);\n    const { relationship, relatedRecord } = op;\n    let record: InitializedRecord;\n\n    if (currentRecord) {\n      record = clone(currentRecord);\n      let relatedRecords: RecordIdentity[] = deepGet(record, [\n        'relationships',\n        relationship,\n        'data'\n      ]);\n      if (relatedRecords) {\n        relatedRecords = relatedRecords.filter(\n          (r) => !equalRecordIdentities(r, relatedRecord)\n        );\n\n        if (\n          deepSet(\n            record,\n            ['relationships', relationship, 'data'],\n            relatedRecords\n          )\n        ) {\n          await cache.setRecordAsync(record);\n        }\n      }\n      return record;\n    } else {\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(op.record.type, op.record.id);\n      }\n    }\n  },\n\n  async replaceRelatedRecords(\n    cache: AsyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): Promise<RecordOperationResult> {\n    const op = operation as ReplaceRelatedRecordsOperation;\n    const currentRecord = await cache.getRecordAsync(op.record);\n    const { relationship, relatedRecords } = op;\n    let record: InitializedRecord;\n\n    if (currentRecord) {\n      record = clone(currentRecord);\n    } else {\n      record = cloneRecordIdentity(op.record);\n\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(record.type, record.id);\n      }\n    }\n\n    if (\n      deepSet(record, ['relationships', relationship, 'data'], relatedRecords)\n    ) {\n      await cache.setRecordAsync(record);\n    }\n\n    return record;\n  },\n\n  async replaceRelatedRecord(\n    cache: AsyncRecordAccessor,\n    operation: RecordOperation,\n    options?: RequestOptions\n  ): Promise<RecordOperationResult> {\n    const op = operation as ReplaceRelatedRecordOperation;\n    const currentRecord = await cache.getRecordAsync(op.record);\n    const { relationship, relatedRecord } = op;\n    let record: InitializedRecord;\n\n    if (currentRecord) {\n      record = clone(currentRecord);\n    } else {\n      record = cloneRecordIdentity(op.record);\n\n      if (options?.raiseNotFoundExceptions) {\n        throw new RecordNotFoundException(record.type, record.id);\n      }\n    }\n\n    if (\n      deepSet(record, ['relationships', relationship, 'data'], relatedRecord)\n    ) {\n      await cache.setRecordAsync(record);\n    }\n\n    return record;\n  }\n};\n","import { Assertion, Orbit } from '@orbit/core';\nimport {\n  buildQuery,\n  buildTransform,\n  DefaultRequestOptions,\n  FullRequestOptions,\n  FullResponse,\n  OperationTerm,\n  QueryOrExpressions,\n  RequestOptions,\n  TransformOrOperations\n} from '@orbit/data';\nimport {\n  AsyncRecordQueryable,\n  AsyncRecordUpdatable,\n  InitializedRecord,\n  RecordIdentity,\n  RecordOperation,\n  RecordOperationResult,\n  RecordOperationTerm,\n  RecordQuery,\n  RecordQueryBuilder,\n  RecordQueryExpression,\n  RecordQueryResult,\n  recordsReferencedByOperations,\n  RecordTransform,\n  RecordTransformBuilder,\n  RecordTransformBuilderFunc,\n  RecordTransformResult\n} from '@orbit/records';\nimport { deepGet, Dict, toArray } from '@orbit/utils';\nimport {\n  AsyncOperationProcessor,\n  AsyncOperationProcessorClass\n} from './async-operation-processor';\nimport { AsyncLiveQuery } from './live-query/async-live-query';\nimport { AsyncCacheIntegrityProcessor } from './operation-processors/async-cache-integrity-processor';\nimport { AsyncSchemaConsistencyProcessor } from './operation-processors/async-schema-consistency-processor';\nimport { AsyncSchemaValidationProcessor } from './operation-processors/async-schema-validation-processor';\nimport {\n  AsyncInverseTransformOperator,\n  AsyncInverseTransformOperators\n} from './operators/async-inverse-transform-operators';\nimport {\n  AsyncQueryOperator,\n  AsyncQueryOperators\n} from './operators/async-query-operators';\nimport {\n  AsyncTransformOperator,\n  AsyncTransformOperators\n} from './operators/async-transform-operators';\nimport {\n  AsyncRecordAccessor,\n  RecordChangeset,\n  RecordRelationshipIdentity\n} from './record-accessor';\nimport {\n  RecordCache,\n  RecordCacheQueryOptions,\n  RecordCacheSettings,\n  RecordCacheTransformOptions\n} from './record-cache';\nimport { RecordTransformBuffer } from './record-transform-buffer';\nimport { PatchResult, RecordCacheUpdateDetails } from './response';\n\nconst { assert, deprecate } = Orbit;\n\nexport interface AsyncRecordCacheSettings<\n  QO extends RequestOptions = RecordCacheQueryOptions,\n  TO extends RequestOptions = RecordCacheTransformOptions,\n  QB = RecordQueryBuilder,\n  TB = RecordTransformBuilder\n> extends RecordCacheSettings<QO, TO, QB, TB> {\n  processors?: AsyncOperationProcessorClass[];\n  queryOperators?: Dict<AsyncQueryOperator>;\n  transformOperators?: Dict<AsyncTransformOperator>;\n  inverseTransformOperators?: Dict<AsyncInverseTransformOperator>;\n  debounceLiveQueries?: boolean;\n  transformBuffer?: RecordTransformBuffer;\n}\n\nexport abstract class AsyncRecordCache<\n    QO extends RequestOptions = RecordCacheQueryOptions,\n    TO extends RequestOptions = RecordCacheTransformOptions,\n    QB = RecordQueryBuilder,\n    TB = RecordTransformBuilder,\n    QueryResponseDetails = unknown,\n    TransformResponseDetails extends RecordCacheUpdateDetails = RecordCacheUpdateDetails\n  >\n  extends RecordCache<QO, TO, QB, TB>\n  implements\n    AsyncRecordAccessor,\n    AsyncRecordQueryable<QueryResponseDetails, QB, QO>,\n    AsyncRecordUpdatable<TransformResponseDetails, TB, TO> {\n  protected _processors: AsyncOperationProcessor[];\n  protected _queryOperators: Dict<AsyncQueryOperator>;\n  protected _transformOperators: Dict<AsyncTransformOperator>;\n  protected _inverseTransformOperators: Dict<AsyncInverseTransformOperator>;\n  protected _debounceLiveQueries: boolean;\n  protected _transformBuffer?: RecordTransformBuffer;\n\n  constructor(settings: AsyncRecordCacheSettings<QO, TO, QB, TB>) {\n    super(settings);\n\n    this._queryOperators = settings.queryOperators ?? AsyncQueryOperators;\n    this._transformOperators =\n      settings.transformOperators ?? AsyncTransformOperators;\n    this._inverseTransformOperators =\n      settings.inverseTransformOperators ?? AsyncInverseTransformOperators;\n    this._debounceLiveQueries = settings.debounceLiveQueries !== false;\n    this._transformBuffer = settings.transformBuffer;\n\n    const processors: AsyncOperationProcessorClass[] = settings.processors\n      ? settings.processors\n      : [AsyncSchemaConsistencyProcessor, AsyncCacheIntegrityProcessor];\n\n    if (settings.autoValidate !== false && settings.processors === undefined) {\n      processors.push(AsyncSchemaValidationProcessor);\n    }\n\n    this._processors = processors.map((Processor) => {\n      let processor = new Processor(this);\n      assert(\n        'Each processor must extend AsyncOperationProcessor',\n        processor instanceof AsyncOperationProcessor\n      );\n      return processor;\n    });\n  }\n\n  get processors(): AsyncOperationProcessor[] {\n    return this._processors;\n  }\n\n  getQueryOperator(op: string): AsyncQueryOperator {\n    return this._queryOperators[op];\n  }\n\n  getTransformOperator(op: string): AsyncTransformOperator {\n    return this._transformOperators[op];\n  }\n\n  getInverseTransformOperator(op: string): AsyncInverseTransformOperator {\n    return this._inverseTransformOperators[op];\n  }\n\n  // Abstract methods for getting records and relationships\n  abstract getRecordAsync(\n    recordIdentity: RecordIdentity\n  ): Promise<InitializedRecord | undefined>;\n  abstract getRecordsAsync(\n    typeOrIdentities?: string | RecordIdentity[]\n  ): Promise<InitializedRecord[]>;\n  abstract getInverseRelationshipsAsync(\n    recordIdentityOrIdentities: RecordIdentity | RecordIdentity[]\n  ): Promise<RecordRelationshipIdentity[]>;\n\n  // Abstract methods for setting records and relationships\n  abstract setRecordAsync(record: InitializedRecord): Promise<void>;\n  abstract setRecordsAsync(records: InitializedRecord[]): Promise<void>;\n  abstract removeRecordAsync(\n    recordIdentity: RecordIdentity\n  ): Promise<InitializedRecord | undefined>;\n  abstract removeRecordsAsync(\n    recordIdentities: RecordIdentity[]\n  ): Promise<InitializedRecord[]>;\n  abstract addInverseRelationshipsAsync(\n    relationships: RecordRelationshipIdentity[]\n  ): Promise<void>;\n  abstract removeInverseRelationshipsAsync(\n    relationships: RecordRelationshipIdentity[]\n  ): Promise<void>;\n\n  async applyRecordChangesetAsync(changeset: RecordChangeset): Promise<void> {\n    const {\n      setRecords,\n      removeRecords,\n      addInverseRelationships,\n      removeInverseRelationships\n    } = changeset;\n\n    const promises = [];\n\n    if (setRecords && setRecords.length > 0) {\n      promises.push(await this.setRecordsAsync(setRecords));\n    }\n    if (removeRecords && removeRecords.length > 0) {\n      promises.push(await this.removeRecordsAsync(removeRecords));\n    }\n    if (addInverseRelationships && addInverseRelationships.length > 0) {\n      promises.push(\n        await this.addInverseRelationshipsAsync(addInverseRelationships)\n      );\n    }\n    if (removeInverseRelationships && removeInverseRelationships.length > 0) {\n      promises.push(\n        await this.removeInverseRelationshipsAsync(removeInverseRelationships)\n      );\n    }\n\n    await Promise.all(promises);\n  }\n\n  async getRelatedRecordAsync(\n    identity: RecordIdentity,\n    relationship: string\n  ): Promise<RecordIdentity | null | undefined> {\n    const record = await this.getRecordAsync(identity);\n    if (record) {\n      return deepGet(record, ['relationships', relationship, 'data']);\n    }\n    return undefined;\n  }\n\n  async getRelatedRecordsAsync(\n    identity: RecordIdentity,\n    relationship: string\n  ): Promise<RecordIdentity[] | undefined> {\n    const record = await this.getRecordAsync(identity);\n    if (record) {\n      return deepGet(record, ['relationships', relationship, 'data']);\n    }\n    return undefined;\n  }\n\n  /**\n   * Queries the cache.\n   */\n  query<RequestData extends RecordQueryResult = RecordQueryResult>(\n    queryOrExpressions: QueryOrExpressions<RecordQueryExpression, QB>,\n    options?: DefaultRequestOptions<QO>,\n    id?: string\n  ): Promise<RequestData>;\n  query<RequestData extends RecordQueryResult = RecordQueryResult>(\n    queryOrExpressions: QueryOrExpressions<RecordQueryExpression, QB>,\n    options: FullRequestOptions<QO>,\n    id?: string\n  ): Promise<FullResponse<RequestData, QueryResponseDetails, RecordOperation>>;\n  async query<RequestData extends RecordQueryResult = RecordQueryResult>(\n    queryOrExpressions: QueryOrExpressions<RecordQueryExpression, QB>,\n    options?: QO,\n    id?: string\n  ): Promise<\n    | RequestData\n    | FullResponse<RequestData, QueryResponseDetails, RecordOperation>\n  > {\n    const query = buildQuery(\n      queryOrExpressions,\n      options,\n      id,\n      this._queryBuilder\n    );\n\n    const response = await this._query<RequestData>(query, options);\n\n    if (options?.fullResponse) {\n      return response;\n    } else {\n      return response.data as RequestData;\n    }\n  }\n\n  /**\n   * Updates the cache.\n   */\n  update<RequestData extends RecordTransformResult = RecordTransformResult>(\n    transformOrOperations: TransformOrOperations<RecordOperation, TB>,\n    options?: DefaultRequestOptions<TO>,\n    id?: string\n  ): Promise<RequestData>;\n  update<RequestData extends RecordTransformResult = RecordTransformResult>(\n    transformOrOperations: TransformOrOperations<RecordOperation, TB>,\n    options: FullRequestOptions<TO>,\n    id?: string\n  ): Promise<\n    FullResponse<RequestData, TransformResponseDetails, RecordOperation>\n  >;\n  async update<\n    RequestData extends RecordTransformResult = RecordTransformResult\n  >(\n    transformOrOperations: TransformOrOperations<RecordOperation, TB>,\n    options?: TO,\n    id?: string\n  ): Promise<\n    | RequestData\n    | FullResponse<RequestData, TransformResponseDetails, RecordOperation>\n  > {\n    const transform = buildTransform(\n      transformOrOperations,\n      options,\n      id,\n      this._transformBuilder\n    );\n\n    const response = await this._update<RequestData>(transform, options);\n\n    if (options?.fullResponse) {\n      return response;\n    } else {\n      return response.data as RequestData;\n    }\n  }\n\n  /**\n   * Patches the cache with an operation or operations.\n   *\n   * @deprecated since v0.17\n   */\n  async patch(\n    operationOrOperations:\n      | RecordOperation\n      | RecordOperation[]\n      | RecordOperationTerm\n      | RecordOperationTerm[]\n      | RecordTransformBuilderFunc\n  ): Promise<PatchResult> {\n    deprecate(\n      'AsyncRecordCache#patch has been deprecated. Use AsyncRecordCache#update instead.'\n    );\n\n    // TODO - Why is this `this` cast necessary for TS to understand the correct\n    // method overload?\n    const { data, details } = await (this as any).update(\n      operationOrOperations,\n      {\n        fullResponse: true\n      }\n    );\n\n    return {\n      inverse: details?.inverseOperations || [],\n      data: Array.isArray(data) ? data : [data]\n    };\n  }\n\n  liveQuery(\n    queryOrExpressions: QueryOrExpressions<RecordQueryExpression, QB>,\n    options?: DefaultRequestOptions<QO>,\n    id?: string\n  ): AsyncLiveQuery<QO, TO, QB, TB> {\n    const query = buildQuery(\n      queryOrExpressions,\n      options,\n      id,\n      this.queryBuilder\n    );\n\n    let debounce = options && (options as any).debounce;\n    if (typeof debounce !== 'boolean') {\n      debounce = this._debounceLiveQueries;\n    }\n\n    return new AsyncLiveQuery<QO, TO, QB, TB>({\n      debounce,\n      cache: this,\n      query\n    });\n  }\n\n  /////////////////////////////////////////////////////////////////////////////\n  // Protected methods\n  /////////////////////////////////////////////////////////////////////////////\n\n  protected async _query<\n    RequestData extends RecordQueryResult = RecordQueryResult\n  >(\n    query: RecordQuery,\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    options?: QO\n  ): Promise<FullResponse<RequestData, QueryResponseDetails, RecordOperation>> {\n    let data;\n\n    if (Array.isArray(query.expressions)) {\n      data = [];\n      for (let expression of query.expressions) {\n        const queryOperator = this.getQueryOperator(expression.op);\n        if (!queryOperator) {\n          throw new Error(`Unable to find query operator: ${expression.op}`);\n        }\n        data.push(\n          await queryOperator(\n            this,\n            expression,\n            this.getQueryOptions(query, expression)\n          )\n        );\n      }\n    } else {\n      const expression = query.expressions as RecordQueryExpression;\n      const queryOperator = this.getQueryOperator(expression.op);\n      if (!queryOperator) {\n        throw new Error(`Unable to find query operator: ${expression.op}`);\n      }\n      data = await queryOperator(\n        this,\n        expression,\n        this.getQueryOptions(query, expression)\n      );\n    }\n\n    return { data: data as RequestData };\n  }\n\n  protected async _update<\n    RequestData extends RecordTransformResult = RecordTransformResult\n  >(\n    transform: RecordTransform,\n    options?: TO\n  ): Promise<\n    FullResponse<RequestData, TransformResponseDetails, RecordOperation>\n  > {\n    if (this.getTransformOptions(transform)?.useBuffer) {\n      const buffer = await this._initTransformBuffer(transform);\n\n      buffer.startTrackingChanges();\n\n      const response = buffer.update(transform, {\n        fullResponse: true\n      });\n\n      const changes = buffer.stopTrackingChanges();\n\n      await this.applyRecordChangesetAsync(changes);\n\n      const {\n        appliedOperations,\n        appliedOperationResults\n      } = response.details as TransformResponseDetails;\n\n      for (let i = 0, len = appliedOperations.length; i < len; i++) {\n        this.emit('patch', appliedOperations[i], appliedOperationResults[i]);\n      }\n\n      return response as FullResponse<\n        RequestData,\n        TransformResponseDetails,\n        RecordOperation\n      >;\n    } else {\n      const response = {\n        data: []\n      } as FullResponse<\n        RecordOperationResult[],\n        RecordCacheUpdateDetails,\n        RecordOperation\n      >;\n\n      if (options?.fullResponse) {\n        response.details = {\n          appliedOperations: [],\n          appliedOperationResults: [],\n          inverseOperations: []\n        };\n      }\n\n      let data: RecordTransformResult;\n\n      if (Array.isArray(transform.operations)) {\n        await this._applyTransformOperations(\n          transform,\n          transform.operations,\n          response,\n          true\n        );\n        data = response.data;\n      } else {\n        await this._applyTransformOperation(\n          transform,\n          transform.operations,\n          response,\n          true\n        );\n        if (Array.isArray(response.data)) {\n          data = response.data[0];\n        }\n      }\n\n      if (options?.fullResponse) {\n        response.details?.inverseOperations.reverse();\n      }\n\n      return {\n        ...response,\n        data\n      } as FullResponse<RequestData, TransformResponseDetails, RecordOperation>;\n    }\n  }\n\n  protected _getTransformBuffer(): RecordTransformBuffer {\n    if (this._transformBuffer === undefined) {\n      throw new Assertion(\n        'transformBuffer must be provided to cache via constructor settings'\n      );\n    }\n    return this._transformBuffer;\n  }\n\n  protected async _initTransformBuffer(\n    transform: RecordTransform\n  ): Promise<RecordTransformBuffer> {\n    const buffer = this._getTransformBuffer();\n\n    const records = recordsReferencedByOperations(\n      toArray(transform.operations)\n    );\n    const inverseRelationships = await this.getInverseRelationshipsAsync(\n      records\n    );\n    const relatedRecords = inverseRelationships.map((ir) => ir.record);\n    Array.prototype.push.apply(records, relatedRecords);\n\n    buffer.resetState();\n    buffer.setRecordsSync(await this.getRecordsAsync(records));\n    buffer.addInverseRelationshipsSync(inverseRelationships);\n\n    return buffer;\n  }\n\n  protected async _applyTransformOperations(\n    transform: RecordTransform,\n    ops: RecordOperation[] | RecordOperationTerm[],\n    response: FullResponse<\n      RecordOperationResult[],\n      RecordCacheUpdateDetails,\n      RecordOperation\n    >,\n    primary = false\n  ): Promise<void> {\n    for (let op of ops) {\n      await this._applyTransformOperation(transform, op, response, primary);\n    }\n  }\n\n  protected async _applyTransformOperation(\n    transform: RecordTransform,\n    operation: RecordOperation | RecordOperationTerm,\n    response: FullResponse<\n      RecordOperationResult[],\n      RecordCacheUpdateDetails,\n      RecordOperation\n    >,\n    primary = false\n  ): Promise<void> {\n    if (operation instanceof OperationTerm) {\n      operation = operation.toOperation() as RecordOperation;\n    }\n\n    for (let processor of this._processors) {\n      await processor.validate(operation);\n    }\n\n    const inverseTransformOperator = this.getInverseTransformOperator(\n      operation.op\n    );\n    const inverseOp:\n      | RecordOperation\n      | undefined = await inverseTransformOperator(\n      this,\n      operation,\n      this.getTransformOptions(transform, operation)\n    );\n    if (inverseOp) {\n      response.details?.inverseOperations?.push(inverseOp);\n\n      // Query and perform related `before` operations\n      for (let processor of this._processors) {\n        await this._applyTransformOperations(\n          transform,\n          await processor.before(operation),\n          response\n        );\n      }\n\n      // Query related `after` operations before performing\n      // the requested operation. These will be applied on success.\n      let preparedOps = [];\n      for (let processor of this._processors) {\n        preparedOps.push(await processor.after(operation));\n      }\n\n      // Perform the requested operation\n      let transformOperator = this.getTransformOperator(operation.op);\n      let data = await transformOperator(\n        this,\n        operation,\n        this.getTransformOptions(transform, operation)\n      );\n      if (primary) {\n        response.data?.push(data);\n      }\n      if (response.details) {\n        response.details.appliedOperationResults.push(data);\n        response.details.appliedOperations.push(operation);\n      }\n\n      // Query and perform related `immediate` operations\n      for (let processor of this._processors) {\n        await processor.immediate(operation);\n      }\n\n      // Emit event\n      this.emit('patch', operation, data);\n\n      // Perform prepared operations after performing the requested operation\n      for (let ops of preparedOps) {\n        await this._applyTransformOperations(transform, ops, response);\n      }\n\n      // Query and perform related `finally` operations\n      for (let processor of this._processors) {\n        await this._applyTransformOperations(\n          transform,\n          await processor.finally(operation),\n          response\n        );\n      }\n    } else if (primary) {\n      response.data?.push(undefined);\n    }\n  }\n}\n","import { Orbit } from '@orbit/core';\nimport {\n  DefaultRequestOptions,\n  FullRequestOptions,\n  FullResponse,\n  RequestOptions\n} from '@orbit/data';\nimport { ImmutableMap } from '@orbit/immutable';\nimport {\n  RecordCacheQueryOptions,\n  RecordCacheTransformOptions,\n  RecordCacheUpdateDetails,\n  RecordRelationshipIdentity,\n  RecordTransformBuffer,\n  SimpleRecordTransformBuffer,\n  SyncRecordCache,\n  SyncRecordCacheSettings\n} from '@orbit/record-cache';\nimport {\n  coalesceRecordOperations,\n  equalRecordIdentities,\n  InitializedRecord,\n  RecordIdentity,\n  RecordOperation,\n  RecordQueryBuilder,\n  RecordTransform,\n  RecordTransformBuilder,\n  RecordTransformResult\n} from '@orbit/records';\nimport { clone, Dict, toArray } from '@orbit/utils';\n\nconst { assert, deprecate } = Orbit;\n\nexport interface MemoryCacheMergeOptions {\n  coalesce?: boolean;\n}\n\nexport interface MemoryCacheSettings<\n  QO extends RequestOptions = RecordCacheQueryOptions,\n  TO extends RequestOptions = RecordCacheTransformOptions,\n  QB = RecordQueryBuilder,\n  TB = RecordTransformBuilder,\n  QRD = unknown,\n  TRD extends RecordCacheUpdateDetails = RecordCacheUpdateDetails\n> extends SyncRecordCacheSettings<QO, TO, QB, TB> {\n  base?: MemoryCache<QO, TO, QB, TB, QRD, TRD>;\n  trackUpdateOperations?: boolean;\n}\n\nexport interface MemoryCacheClass<\n  QO extends RequestOptions = RecordCacheQueryOptions,\n  TO extends RequestOptions = RecordCacheTransformOptions,\n  QB = RecordQueryBuilder,\n  TB = RecordTransformBuilder,\n  QRD = unknown,\n  TRD extends RecordCacheUpdateDetails = RecordCacheUpdateDetails\n> {\n  new (settings: MemoryCacheSettings<QO, TO, QB, TB, QRD, TRD>): MemoryCache<\n    QO,\n    TO,\n    QB,\n    TB,\n    QRD,\n    TRD\n  >;\n}\n\n/**\n * A cache used to access records in memory.\n *\n * Because data is stored in immutable maps, this type of cache can be forked\n * efficiently.\n */\nexport class MemoryCache<\n  QO extends RequestOptions = RecordCacheQueryOptions,\n  TO extends RequestOptions = RecordCacheTransformOptions,\n  QB = RecordQueryBuilder,\n  TB = RecordTransformBuilder,\n  QRD = unknown,\n  TRD extends RecordCacheUpdateDetails = RecordCacheUpdateDetails\n> extends SyncRecordCache<QO, TO, QB, TB, QRD, TRD> {\n  protected _base?: MemoryCache<QO, TO, QB, TB, QRD, TRD>;\n  protected _records!: Dict<ImmutableMap<string, InitializedRecord>>;\n  protected _inverseRelationships!: Dict<\n    ImmutableMap<string, RecordRelationshipIdentity[]>\n  >;\n  protected _updateOperations?: RecordOperation[];\n  protected _isTrackingUpdateOperations: boolean;\n\n  constructor(settings: MemoryCacheSettings<QO, TO, QB, TB, QRD, TRD>) {\n    const { base, trackUpdateOperations } = settings;\n\n    super(settings);\n\n    this._base = base;\n\n    // Track update operations if explicitly told to do so, or if a `base`\n    // cache has been specified.\n    this._isTrackingUpdateOperations =\n      trackUpdateOperations ?? base !== undefined;\n\n    this.reset();\n  }\n\n  get base(): MemoryCache<QO, TO, QB, TB, QRD, TRD> | undefined {\n    return this._base;\n  }\n\n  /**\n   * Create a clone, or \"fork\", from a \"base\" cache.\n   *\n   * The forked cache will have the same `schema` and `keyMap` as its base\n   * source. The forked cache will start with the same immutable document as the\n   * base source. Its contents and log will evolve independently.\n   *\n   * @returns the forked cache\n   */\n  fork(\n    settings: Partial<MemoryCacheSettings<QO, TO, QB, TB, QRD, TRD>> = {}\n  ): MemoryCache<QO, TO, QB, TB, QRD, TRD> {\n    // required settings\n    settings.base = this;\n    settings.schema = this.schema;\n    settings.keyMap = this._keyMap;\n\n    // customizable settings\n    settings.queryBuilder ??= this._queryBuilder;\n    settings.transformBuilder ??= this._transformBuilder;\n    settings.defaultQueryOptions ??= this._defaultQueryOptions;\n    settings.defaultTransformOptions ??= this._defaultTransformOptions;\n    if (settings.autoValidate !== false) {\n      settings.validatorFor ??= this._validatorFor;\n      if (\n        settings.autoValidate === undefined &&\n        settings.validatorFor === undefined\n      ) {\n        settings.autoValidate = false;\n      }\n    }\n\n    return new MemoryCache(\n      settings as MemoryCacheSettings<QO, TO, QB, TB, QRD, TRD>\n    );\n  }\n\n  /**\n   * Merges the operations from a forked cache back to this cache.\n   *\n   * @returns the result of calling `update` with the operations\n   */\n  merge<RequestData extends RecordTransformResult = RecordTransformResult>(\n    forkedCache: MemoryCache<QO, TO, QB, TB, QRD, TRD>,\n    options?: DefaultRequestOptions<TO> & MemoryCacheMergeOptions\n  ): RequestData;\n  merge<RequestData extends RecordTransformResult = RecordTransformResult>(\n    forkedCache: MemoryCache<QO, TO, QB, TB, QRD, TRD>,\n    options: FullRequestOptions<TO> & MemoryCacheMergeOptions\n  ): FullResponse<RequestData, TRD, RecordOperation>;\n  merge<RequestData extends RecordTransformResult = RecordTransformResult>(\n    forkedCache: MemoryCache<QO, TO, QB, TB, QRD, TRD>,\n    options?: TO & MemoryCacheMergeOptions\n  ): RequestData | FullResponse<RequestData, TRD, RecordOperation> {\n    let { coalesce, ...remainingOptions } = options ?? {};\n\n    assert(\n      'MemoryCache#merge can only merge a forked cache that is configured with `trackUpdateOperations: true`.',\n      forkedCache.isTrackingUpdateOperations\n    );\n\n    let ops = forkedCache.getAllUpdateOperations();\n\n    if (coalesce !== false) {\n      ops = coalesceRecordOperations(ops);\n    }\n\n    if (options?.fullResponse) {\n      return this.update<RequestData>(\n        ops,\n        remainingOptions as FullRequestOptions<TO>\n      );\n    } else {\n      return this.update<RequestData>(\n        ops,\n        remainingOptions as DefaultRequestOptions<TO>\n      );\n    }\n  }\n\n  /**\n   * Rebase resets this cache's state to that of its base cache, then re-applies\n   * any tracked update operations.\n   *\n   * Rebasing requires both a `base` cache as well as tracking of update\n   * operations (which is enabled by default when a `base` cache is assigned).\n   */\n  rebase(): void {\n    const base = this._base;\n\n    assert(\n      'A `base` cache must be defined for `rebase` to work',\n      base !== undefined\n    );\n\n    assert(\n      'MemoryCache#rebase requires that the cache is configured with `trackUpdateOperations: true`.',\n      this._isTrackingUpdateOperations\n    );\n\n    // get update ops prior to resetting state\n    let ops = this.getAllUpdateOperations();\n\n    // reset the state of the cache to match its base cache\n    this.reset();\n\n    // reapply update ops\n    this.update(ops);\n  }\n\n  getRecordSync(identity: RecordIdentity): InitializedRecord | undefined {\n    return this._records[identity.type].get(identity.id);\n  }\n\n  getRecordsSync(\n    typeOrIdentities?: string | RecordIdentity[]\n  ): InitializedRecord[] {\n    if (typeOrIdentities === undefined) {\n      const types = Object.keys(this.schema.models);\n      const records: InitializedRecord[] = [];\n      types.forEach((type) =>\n        Array.prototype.push.apply(\n          records,\n          Array.from(this._records[type].values())\n        )\n      );\n      return records;\n    } else if (typeof typeOrIdentities === 'string') {\n      const type: string = typeOrIdentities;\n      return Array.from(this._records[type].values());\n    } else {\n      const records: InitializedRecord[] = [];\n      const identities: RecordIdentity[] = typeOrIdentities;\n      for (let identity of identities) {\n        let record = this.getRecordSync(identity);\n        if (record) {\n          records.push(record);\n        }\n      }\n      return records;\n    }\n  }\n\n  setRecordSync(record: InitializedRecord): void {\n    this._records[record.type].set(record.id, record);\n  }\n\n  setRecordsSync(records: InitializedRecord[]): void {\n    let typedMap: any = {};\n    for (let record of records) {\n      typedMap[record.type] = typedMap[record.type] || [];\n      typedMap[record.type].push([record.id, record]);\n    }\n    for (let type in typedMap) {\n      this._records[type].setMany(typedMap[type]);\n    }\n  }\n\n  removeRecordSync(\n    recordIdentity: RecordIdentity\n  ): InitializedRecord | undefined {\n    const recordMap = this._records[recordIdentity.type];\n    const record = recordMap.get(recordIdentity.id);\n    if (record) {\n      recordMap.remove(recordIdentity.id);\n      return record;\n    } else {\n      return undefined;\n    }\n  }\n\n  removeRecordsSync(recordIdentities: RecordIdentity[]): InitializedRecord[] {\n    const records = [];\n    const typedIds: any = {};\n    for (let recordIdentity of recordIdentities) {\n      let record = this.getRecordSync(recordIdentity);\n      if (record) {\n        records.push(record);\n        typedIds[record.type] = typedIds[record.type] || [];\n        typedIds[record.type].push(recordIdentity.id);\n      }\n    }\n    for (let type in typedIds) {\n      this._records[type].removeMany(typedIds[type]);\n    }\n    return records;\n  }\n\n  getInverseRelationshipsSync(\n    recordIdentityOrIdentities: RecordIdentity | RecordIdentity[]\n  ): RecordRelationshipIdentity[] {\n    const results: RecordRelationshipIdentity[] = [];\n    const identities: RecordIdentity[] = Array.isArray(\n      recordIdentityOrIdentities\n    )\n      ? recordIdentityOrIdentities\n      : [recordIdentityOrIdentities];\n\n    for (let identity of identities) {\n      const result = this._inverseRelationships[identity.type].get(identity.id);\n      if (result) {\n        Array.prototype.push.apply(results, result);\n      }\n    }\n\n    return results;\n  }\n\n  addInverseRelationshipsSync(\n    relationships: RecordRelationshipIdentity[]\n  ): void {\n    relationships.forEach((r) => {\n      let rels = this._inverseRelationships[r.relatedRecord.type].get(\n        r.relatedRecord.id\n      );\n      rels = rels ? [...rels, clone(r)] : [clone(r)];\n      this._inverseRelationships[r.relatedRecord.type].set(\n        r.relatedRecord.id,\n        rels\n      );\n    });\n  }\n\n  removeInverseRelationshipsSync(\n    relationships: RecordRelationshipIdentity[]\n  ): void {\n    relationships.forEach((r) => {\n      let rels = this._inverseRelationships[r.relatedRecord.type].get(\n        r.relatedRecord.id\n      );\n      if (rels) {\n        let newRels = rels.filter(\n          (rel) =>\n            !(\n              equalRecordIdentities(rel.record, r.record) &&\n              rel.relationship === r.relationship\n            )\n        );\n        this._inverseRelationships[r.relatedRecord.type].set(\n          r.relatedRecord.id,\n          newRels\n        );\n      }\n    });\n  }\n\n  /**\n   * Resets the cache's to its initial state, which will be either empty or a\n   * clone of its `base` cache, if it has one.\n   */\n  reset(): void {\n    let base = this._base;\n\n    if (arguments.length > 0) {\n      deprecate(\n        'Calling MemoryCache#reset with a `base` argument is deprecated. Instead configure your MemoryCache with a `base` cache.'\n      );\n      base ??= arguments[0];\n    }\n\n    this._records = {};\n\n    if (this._isTrackingUpdateOperations) {\n      this._updateOperations = [];\n    }\n\n    Object.keys(this._schema.models).forEach((type) => {\n      let baseRecords = base?._records[type];\n\n      this._records[type] = new ImmutableMap<string, InitializedRecord>(\n        baseRecords\n      );\n    });\n\n    this._resetInverseRelationships(base);\n\n    this._processors.forEach((processor) => processor.reset(base));\n\n    this.emit('reset');\n  }\n\n  /**\n   * Upgrade the cache based on the current state of the schema.\n   */\n  upgrade(): void {\n    Object.keys(this._schema.models).forEach((type) => {\n      if (!this._records[type]) {\n        this._records[type] = new ImmutableMap<string, InitializedRecord>();\n      }\n    });\n\n    this._resetInverseRelationships();\n\n    for (let processor of this._processors) {\n      processor.upgrade();\n    }\n  }\n\n  get isTrackingUpdateOperations(): boolean {\n    return this._isTrackingUpdateOperations;\n  }\n\n  getAllUpdateOperations(): RecordOperation[] {\n    assert(\n      'MemoryCache#getAllUpdateOperations requires that cache be configured with `trackUpdateOperations: true`.',\n      this._isTrackingUpdateOperations\n    );\n\n    return this._updateOperations as RecordOperation[];\n  }\n\n  /////////////////////////////////////////////////////////////////////////////\n  // Protected methods\n  /////////////////////////////////////////////////////////////////////////////\n\n  protected _update<\n    RequestData extends RecordTransformResult = RecordTransformResult\n  >(\n    transform: RecordTransform,\n    options?: TO\n  ): FullResponse<RequestData, TRD, RecordOperation> {\n    if (this._isTrackingUpdateOperations) {\n      Array.prototype.push.apply(\n        this._updateOperations,\n        toArray(transform.operations)\n      );\n    }\n    return super._update<RequestData>(transform, options);\n  }\n\n  /**\n   * Override `_getTransformBuffer` on base `SyncRecordCache` to provide a\n   * `transformBuffer` if a custom one hasn't been provided via the constructor\n   * setting.\n   */\n  protected _getTransformBuffer(): RecordTransformBuffer {\n    if (this._transformBuffer === undefined) {\n      const { schema, keyMap } = this;\n      this._transformBuffer = new SimpleRecordTransformBuffer({\n        schema,\n        keyMap\n      });\n    }\n    return this._transformBuffer;\n  }\n\n  protected _resetInverseRelationships(\n    base?: MemoryCache<QO, TO, QB, TB, QRD, TRD>\n  ): void {\n    const inverseRelationships: Dict<\n      ImmutableMap<string, RecordRelationshipIdentity[]>\n    > = {};\n    Object.keys(this._schema.models).forEach((type) => {\n      let baseRelationships = base && base._inverseRelationships[type];\n      inverseRelationships[type] = new ImmutableMap(baseRelationships);\n    });\n    this._inverseRelationships = inverseRelationships;\n  }\n}\n","import { Assertion, Orbit } from '@orbit/core';\nimport {\n  DefaultRequestOptions,\n  FullRequestOptions,\n  FullResponse,\n  queryable,\n  RequestOptions,\n  Resettable,\n  ResponseHints,\n  syncable,\n  updatable\n} from '@orbit/data';\nimport { RecordCacheUpdateDetails } from '@orbit/record-cache';\nimport {\n  coalesceRecordOperations,\n  RecordOperation,\n  RecordOperationResult,\n  RecordQuery,\n  RecordQueryable,\n  RecordQueryBuilder,\n  RecordQueryExpressionResult,\n  RecordQueryResult,\n  RecordSource,\n  RecordSourceQueryOptions,\n  RecordSourceSettings,\n  RecordSyncable,\n  RecordTransform,\n  RecordTransformBuilder,\n  RecordTransformResult,\n  RecordUpdatable\n} from '@orbit/records';\nimport { Dict, toArray } from '@orbit/utils';\nimport {\n  MemoryCache,\n  MemoryCacheClass,\n  MemoryCacheSettings\n} from './memory-cache';\n\nconst { assert, deprecate } = Orbit;\n\nexport interface MemorySourceSettings<\n  QO extends RequestOptions = RecordSourceQueryOptions,\n  TO extends RequestOptions = RequestOptions,\n  QB = RecordQueryBuilder,\n  TB = RecordTransformBuilder,\n  QRD = unknown,\n  TRD extends RecordCacheUpdateDetails = RecordCacheUpdateDetails\n> extends RecordSourceSettings<QO, TO, QB, TB> {\n  base?: MemorySource<QO, TO, QB, TB, QRD, TRD>;\n  cacheClass?: MemoryCacheClass<QO, TO, QB, TB, QRD, TRD>;\n  cacheSettings?: Partial<MemoryCacheSettings<QO, TO, QB, TB, QRD, TRD>>;\n}\n\nexport interface MemorySourceMergeOptions {\n  coalesce?: boolean;\n\n  /**\n   * @deprecated since v0.17\n   */\n  sinceTransformId?: string;\n\n  /**\n   * @deprecated since v0.17, include transform options alongside merge options instead\n   */\n  transformOptions?: RequestOptions;\n}\n\nexport interface MemorySource<\n  QO extends RequestOptions = RecordSourceQueryOptions,\n  TO extends RequestOptions = RequestOptions,\n  QB = RecordQueryBuilder,\n  TB = RecordTransformBuilder,\n  QRD = unknown,\n  TRD extends RecordCacheUpdateDetails = RecordCacheUpdateDetails\n> extends RecordSource<QO, TO, QB, TB>,\n    RecordSyncable,\n    RecordQueryable<QRD, QB, QO>,\n    RecordUpdatable<TRD, TB, TO> {}\n\n@syncable\n@queryable\n@updatable\nexport class MemorySource<\n    QO extends RequestOptions = RecordSourceQueryOptions,\n    TO extends RequestOptions = RequestOptions,\n    QB = RecordQueryBuilder,\n    TB = RecordTransformBuilder,\n    QRD = unknown,\n    TRD extends RecordCacheUpdateDetails = RecordCacheUpdateDetails\n  >\n  extends RecordSource<QO, TO, QB, TB>\n  implements\n    RecordSyncable,\n    RecordQueryable<QRD, QB, QO>,\n    RecordUpdatable<TRD, TB, TO>,\n    Resettable {\n  protected _cache: MemoryCache<QO, TO, QB, TB, QRD, TRD>;\n  protected _base?: MemorySource<QO, TO, QB, TB, QRD, TRD>;\n  protected _forkPoint?: string;\n  protected _transforms: Dict<RecordTransform>;\n  protected _transformInverses: Dict<RecordOperation[]>;\n\n  constructor(settings: MemorySourceSettings<QO, TO, QB, TB, QRD, TRD>) {\n    const { keyMap, schema, base } = settings;\n\n    settings.name = settings.name ?? 'memory';\n\n    super(settings);\n\n    this._transforms = {};\n    this._transformInverses = {};\n\n    this.transformLog.on('clear', this._logCleared.bind(this));\n    this.transformLog.on('truncate', this._logTruncated.bind(this));\n    this.transformLog.on('rollback', this._logRolledback.bind(this));\n\n    let cacheSettings: Partial<MemoryCacheSettings<QO, TO, QB, TB, QRD, TRD>> =\n      settings.cacheSettings ?? {};\n    cacheSettings.schema = schema;\n    cacheSettings.keyMap = keyMap;\n    cacheSettings.queryBuilder ??= this.queryBuilder;\n    cacheSettings.transformBuilder ??= this.transformBuilder;\n    cacheSettings.defaultQueryOptions ??= this.defaultQueryOptions;\n    cacheSettings.defaultTransformOptions ??= this.defaultTransformOptions;\n    cacheSettings.autoValidate ??= settings.autoValidate;\n\n    if (\n      cacheSettings.autoValidate !== false &&\n      cacheSettings.validatorFor === undefined &&\n      cacheSettings.validators === undefined\n    ) {\n      cacheSettings.validatorFor = this._validatorFor;\n    }\n\n    if (base) {\n      this._base = base;\n      this._forkPoint = base.transformLog.head;\n      cacheSettings.base = base.cache;\n    }\n\n    const cacheClass = settings.cacheClass ?? MemoryCache;\n    this._cache = new cacheClass(\n      cacheSettings as MemoryCacheSettings<QO, TO, QB, TB, QRD, TRD>\n    );\n  }\n\n  get cache(): MemoryCache<QO, TO, QB, TB, QRD, TRD> {\n    return this._cache;\n  }\n\n  get base(): MemorySource<QO, TO, QB, TB, QRD, TRD> | undefined {\n    return this._base;\n  }\n\n  get forkPoint(): string | undefined {\n    return this._forkPoint;\n  }\n\n  async upgrade(): Promise<void> {\n    this._cache.upgrade();\n  }\n\n  /////////////////////////////////////////////////////////////////////////////\n  // Syncable interface implementation\n  /////////////////////////////////////////////////////////////////////////////\n\n  async _sync(transform: RecordTransform): Promise<void> {\n    if (!this.transformLog.contains(transform.id)) {\n      this._applyTransform(transform);\n      await this.transformed([transform]);\n    }\n  }\n\n  /////////////////////////////////////////////////////////////////////////////\n  // Updatable interface implementation\n  /////////////////////////////////////////////////////////////////////////////\n\n  async _update(\n    transform: RecordTransform,\n    hints?: ResponseHints<RecordTransformResult, TRD>\n  ): Promise<FullResponse<RecordTransformResult, TRD, RecordOperation>> {\n    let results: RecordTransformResult;\n    const response: FullResponse<\n      RecordTransformResult,\n      TRD,\n      RecordOperation\n    > = {};\n\n    if (!this.transformLog.contains(transform.id)) {\n      results = this._applyTransform(transform);\n      response.transforms = [transform];\n    }\n\n    if (hints?.data) {\n      if (Array.isArray(transform.operations)) {\n        assert(\n          'MemorySource#update: `hints.data` must be an array if `transform.operations` is an array',\n          Array.isArray(hints.data)\n        );\n\n        response.data = (hints.data as RecordOperationResult[]).map((h) =>\n          this._retrieveOperationResult(h)\n        );\n      } else {\n        response.data = this._retrieveOperationResult(\n          hints.data as RecordOperationResult\n        );\n      }\n    } else if (results) {\n      response.data = results;\n    }\n\n    if (hints?.details) {\n      response.details = hints.details;\n    }\n\n    return response;\n  }\n\n  /////////////////////////////////////////////////////////////////////////////\n  // Queryable interface implementation\n  /////////////////////////////////////////////////////////////////////////////\n\n  async _query(\n    query: RecordQuery,\n    hints?: ResponseHints<RecordQueryResult, QRD>\n  ): Promise<FullResponse<RecordQueryResult, QRD, RecordOperation>> {\n    let response: FullResponse<RecordQueryResult, QRD, RecordOperation>;\n\n    if (hints?.data) {\n      response = {};\n      if (Array.isArray(query.expressions)) {\n        assert(\n          'MemorySource#query: `hints.data` must be an array if `query.expressions` is an array',\n          Array.isArray(hints.data)\n        );\n\n        response.data = (hints.data as RecordQueryExpressionResult[]).map((h) =>\n          this._retrieveQueryExpressionResult(h)\n        );\n      } else {\n        response.data = this._retrieveQueryExpressionResult(\n          hints.data as RecordQueryExpressionResult\n        );\n      }\n    } else {\n      response = this._cache.query(query, {\n        fullResponse: true\n      } as FullRequestOptions<QO>);\n    }\n\n    if (hints?.details) {\n      response.details = hints.details;\n    }\n\n    return response;\n  }\n\n  /////////////////////////////////////////////////////////////////////////////\n  // Public methods\n  /////////////////////////////////////////////////////////////////////////////\n\n  /**\n   * Create a clone, or \"fork\", from a \"base\" source.\n   *\n   * The forked source will have the same `schema` and `keyMap` as its base source.\n   * The forked source's cache will start with the same immutable document as\n   * the base source. Its contents and log will evolve independently.\n   *\n   * @returns The forked source.\n   */\n  fork(\n    settings: Partial<MemorySourceSettings<QO, TO, QB, TB, QRD, TRD>> = {}\n  ): MemorySource<QO, TO, QB, TB, QRD, TRD> {\n    // required settings\n    settings.base = this;\n    settings.schema = this.schema;\n    settings.keyMap = this.keyMap;\n\n    // customizable settings\n    settings.queryBuilder ??= this._queryBuilder;\n    settings.transformBuilder ??= this._transformBuilder;\n    settings.defaultQueryOptions ??= this._defaultQueryOptions;\n    settings.defaultTransformOptions ??= this._defaultTransformOptions;\n    if (settings.autoValidate !== false) {\n      settings.validatorFor ??= this._validatorFor;\n      if (\n        settings.autoValidate === undefined &&\n        settings.validatorFor === undefined\n      ) {\n        settings.autoValidate = false;\n      }\n    }\n\n    return new MemorySource<QO, TO, QB, TB, QRD, TRD>(\n      settings as MemorySourceSettings<QO, TO, QB, TB, QRD, TRD>\n    );\n  }\n\n  /**\n   * Merge transforms from a forked source back into a base source.\n   *\n   * By default, all of the operations from all of the transforms in the forked\n   * source's history will be reduced into a single transform. A subset of\n   * operations can be selected by specifying the `sinceTransformId` option.\n   *\n   * The `coalesce` option controls whether operations are coalesced into a\n   * minimal equivalent set before being reduced into a transform.\n   *\n   * @param forkedSource - The source to merge.\n   * @param options - Merge options\n   * @returns The result of calling `update()` with the forked transforms.\n   */\n  merge<RequestData extends RecordTransformResult = RecordTransformResult>(\n    forkedSource: MemorySource<QO, TO, QB, TB, QRD, TRD>,\n    options?: DefaultRequestOptions<TO> & MemorySourceMergeOptions\n  ): Promise<RequestData>;\n  merge<RequestData extends RecordTransformResult = RecordTransformResult>(\n    forkedSource: MemorySource<QO, TO, QB, TB, QRD, TRD>,\n    options: FullRequestOptions<TO> & MemorySourceMergeOptions\n  ): Promise<FullResponse<RequestData, TRD, RecordOperation>>;\n  async merge<\n    RequestData extends RecordTransformResult = RecordTransformResult\n  >(\n    forkedSource: MemorySource<QO, TO, QB, TB, QRD, TRD>,\n    options?: TO & MemorySourceMergeOptions\n  ): Promise<\n    RecordTransformResult | FullResponse<RequestData, TRD, RecordOperation>\n  > {\n    let { coalesce, sinceTransformId, transformOptions, ...remainingOptions } =\n      options ?? {};\n\n    let requestOptions: TO;\n    if (transformOptions) {\n      deprecate(\n        'In MemorySource#merge, passing `transformOptions` nested within `options` is deprecated. Instead, include them directly alongside other options.'\n      );\n      requestOptions = transformOptions as TO;\n    } else {\n      requestOptions = (remainingOptions ?? {}) as TO;\n    }\n\n    let ops: RecordOperation[] = [];\n\n    if (forkedSource.cache.isTrackingUpdateOperations) {\n      ops = forkedSource.cache.getAllUpdateOperations();\n    } else {\n      let transforms: RecordTransform[];\n      if (sinceTransformId) {\n        deprecate(\n          'In MemorySource#merge, passing `sinceTransformId` is deprecated. Instead, call `update` with a custom transform/operations.'\n        );\n        transforms = forkedSource.getTransformsSince(sinceTransformId);\n      } else {\n        transforms = forkedSource.getAllTransforms();\n      }\n\n      transforms.forEach((t) => {\n        Array.prototype.push.apply(ops, toArray(t.operations));\n      });\n    }\n\n    if (coalesce !== false) {\n      ops = coalesceRecordOperations(ops);\n    }\n\n    if (requestOptions.fullResponse) {\n      return this.update<RequestData>(\n        ops,\n        requestOptions as FullRequestOptions<TO>\n      );\n    } else {\n      return this.update<RequestData>(\n        ops,\n        requestOptions as DefaultRequestOptions<TO>\n      );\n    }\n  }\n\n  /**\n   * Rebase works similarly to a git rebase:\n   *\n   * After a source is forked, there is a parent- and a child-source. Both may\n   * be updated with transforms. When `childSource.rebase()` is called, the\n   * child source's state will be reset to match the current state of its\n   * parent, and then any locally made transforms will be replayed on the child\n   * source.\n   */\n  rebase(): void {\n    const base = this._base;\n\n    if (!base) {\n      throw new Assertion(\n        'A `base` source must be defined for `rebase` to work'\n      );\n    }\n\n    // reset the state of the cache to match the base cache\n    this.cache.reset();\n\n    // replay all locally made transforms\n    this.getAllTransforms().forEach((t) => this._applyTransform(t));\n\n    // reset the fork point\n    this._forkPoint = base.transformLog.head;\n  }\n\n  /**\n   * Reset the source's cache and transform log to its initial state, which will\n   * be either empty or a matching its `base`, if it has one.\n   */\n  async reset(): Promise<void> {\n    // reset the state of the cache (which will match a base cache, if present)\n    this.cache.reset();\n\n    // reset the fork point\n    this._forkPoint = this._base ? this._base.transformLog.head : undefined;\n\n    // clear the transform log, which in turn will clear any tracked transforms\n    await this.transformLog.clear();\n  }\n\n  /**\n   * Rolls back the source to a particular `transformId`.\n   *\n   * `relativePosition` can be a positive or negative integer used to specify a\n   * position relative to `transformId`.\n   */\n  rollback(transformId: string, relativePosition = 0): Promise<void> {\n    return this.transformLog.rollback(transformId, relativePosition);\n  }\n\n  /**\n   * Returns all logged transforms since a particular `transformId`.\n   */\n  getTransformsSince(transformId: string): RecordTransform[] {\n    return this.transformLog\n      .after(transformId)\n      .map((id) => this._transforms[id]);\n  }\n\n  /**\n   * @deprecated since v0.17, call `getTransformsSince` instead\n   */\n  transformsSince(transformId: string): RecordTransform[] {\n    deprecate(\n      'MemorySource#transformsSince has been deprecated. Please call `source.getTransformsSince(tranformId)` instead.'\n    );\n    return this.getTransformsSince(transformId);\n  }\n\n  /**\n   * Returns all logged transforms.\n   */\n  getAllTransforms(): RecordTransform[] {\n    return this.transformLog.entries.map((id) => this._transforms[id]);\n  }\n\n  /**\n   * @deprecated since v0.17, call `getAllTransforms` instead\n   */\n  allTransforms(): RecordTransform[] {\n    deprecate(\n      'MemorySource#allTransforms has been deprecated. Please call `source.getAllTransforms()` instead.'\n    );\n    return this.getAllTransforms();\n  }\n\n  getTransform(transformId: string): RecordTransform {\n    return this._transforms[transformId];\n  }\n\n  getInverseOperations(transformId: string): RecordOperation[] {\n    return this._transformInverses[transformId];\n  }\n\n  get defaultQueryOptions(): DefaultRequestOptions<QO> | undefined {\n    return super.defaultQueryOptions;\n  }\n\n  set defaultQueryOptions(options: DefaultRequestOptions<QO> | undefined) {\n    super.defaultQueryOptions = this._cache.defaultQueryOptions = options;\n  }\n\n  get defaultTransformOptions(): DefaultRequestOptions<TO> | undefined {\n    return super.defaultTransformOptions;\n  }\n\n  set defaultTransformOptions(options: DefaultRequestOptions<TO> | undefined) {\n    this._defaultTransformOptions = this._cache.defaultTransformOptions = options;\n  }\n\n  /////////////////////////////////////////////////////////////////////////////\n  // Protected methods\n  /////////////////////////////////////////////////////////////////////////////\n\n  protected _retrieveQueryExpressionResult(\n    result: RecordQueryExpressionResult\n  ): RecordQueryExpressionResult {\n    if (Array.isArray(result)) {\n      return this._cache.getRecordsSync(result);\n    } else if (result) {\n      return this._cache.getRecordSync(result);\n    } else {\n      return result;\n    }\n  }\n\n  protected _retrieveOperationResult(\n    result: RecordOperationResult\n  ): RecordOperationResult {\n    if (result) {\n      return this._cache.getRecordSync(result);\n    } else {\n      return result;\n    }\n  }\n\n  protected _applyTransform(transform: RecordTransform): RecordTransformResult {\n    const { data, details } = this.cache.update(transform, {\n      fullResponse: true\n    } as FullRequestOptions<TO>);\n    this._transforms[transform.id] = transform;\n    this._transformInverses[transform.id] = details?.inverseOperations ?? [];\n    return data;\n  }\n\n  protected _clearTransformFromHistory(transformId: string): void {\n    delete this._transforms[transformId];\n    delete this._transformInverses[transformId];\n  }\n\n  protected _logCleared(): void {\n    this._transforms = {};\n    this._transformInverses = {};\n  }\n\n  protected _logTruncated(\n    transformId: string,\n    relativePosition: number,\n    removed: string[]\n  ): void {\n    removed.forEach((id) => this._clearTransformFromHistory(id));\n  }\n\n  protected _logRolledback(\n    transformId: string,\n    relativePosition: number,\n    removed: string[]\n  ): void {\n    removed.reverse().forEach((id) => {\n      const inverseOperations = this._transformInverses[id];\n      if (inverseOperations) {\n        this.cache.update(inverseOperations);\n      }\n      this._clearTransformFromHistory(id);\n    });\n  }\n}\n","import { Dict, isNone, clone } from '@orbit/utils';\n\nexport interface LinkObject {\n  href: string;\n  meta?: Dict<unknown>;\n}\n\nexport type Link = string | LinkObject;\n\nexport interface RecordIdentity {\n  type: string;\n  id: string;\n}\n\nexport interface RecordHasOneRelationship {\n  data?: RecordIdentity | null;\n  links?: Dict<Link>;\n  meta?: Dict<unknown>;\n}\n\nexport interface RecordHasManyRelationship {\n  data?: RecordIdentity[];\n  links?: Dict<Link>;\n  meta?: Dict<unknown>;\n}\n\nexport type RecordRelationship =\n  | RecordHasOneRelationship\n  | RecordHasManyRelationship;\n\nexport interface RecordFields {\n  keys?: Dict<string>;\n  attributes?: Dict<unknown>;\n  relationships?: Dict<RecordRelationship>;\n  links?: Dict<Link>;\n  meta?: Dict<unknown>;\n}\n\n/**\n * @deprecated since v0.17, use alias `InitializedRecord` instead\n */\nexport interface Record extends RecordFields, RecordIdentity {}\n\nexport interface InitializedRecord extends RecordFields, RecordIdentity {}\n\nexport interface UninitializedRecord extends RecordFields {\n  type: string;\n  id?: string;\n}\n\nexport interface RecordKeyValue {\n  type: string;\n  key: string;\n  value: string;\n}\n\n/**\n * @deprecated since v0.17, replaced by `RecordNormalizer`\n */\nexport interface RecordInitializer {\n  initializeRecord(record: UninitializedRecord): InitializedRecord;\n}\n\nexport function cloneRecordIdentity(identity: RecordIdentity): RecordIdentity {\n  const { type, id } = identity;\n  return { type, id };\n}\n\nexport function equalRecordIdentities(\n  record1?: RecordIdentity | null,\n  record2?: RecordIdentity | null\n): boolean {\n  return (\n    (isNone(record1) && isNone(record2)) ||\n    (!!record1 &&\n      !!record2 &&\n      record1.type === record2.type &&\n      record1.id === record2.id)\n  );\n}\n\nexport function equalRecordIdentitySets(\n  set1: RecordIdentity[],\n  set2: RecordIdentity[]\n): boolean {\n  if (set1.length === set2.length) {\n    if (set1.length === 0) {\n      return true;\n    }\n\n    const serialized1 = serializeRecordIdentities(set1);\n    const serialized2 = serializeRecordIdentities(set2);\n\n    return (\n      exclusiveIdentities(serialized1, serialized2).length === 0 &&\n      exclusiveIdentities(serialized2, serialized1).length === 0\n    );\n  }\n  return false;\n}\n\nexport function uniqueRecordIdentities(\n  set1: RecordIdentity[],\n  set2: RecordIdentity[]\n): RecordIdentity[] {\n  return exclusiveIdentities(\n    serializeRecordIdentities(set1),\n    serializeRecordIdentities(set2)\n  ).map((id) => deserializeRecordIdentity(id));\n}\n\nexport function dedupeRecordIdentities(\n  recordIdentities: RecordIdentity[]\n): RecordIdentity[] {\n  let dict: Dict<true> = {};\n  let deduped: RecordIdentity[] = [];\n  recordIdentities.forEach((ri) => {\n    const sri = serializeRecordIdentity(ri);\n    if (dict[sri] === undefined) {\n      deduped.push(ri);\n      dict[sri] = true;\n    }\n  });\n  return deduped;\n}\n\nexport function recordsInclude(\n  records: RecordIdentity[],\n  match: RecordIdentity\n): boolean {\n  for (let r of records) {\n    if (equalRecordIdentities(r, match)) {\n      return true;\n    }\n  }\n  return false;\n}\n\nexport function recordsIncludeAll(\n  records: RecordIdentity[],\n  match: RecordIdentity[]\n): boolean {\n  return (\n    exclusiveIdentities(\n      serializeRecordIdentities(match),\n      serializeRecordIdentities(records)\n    ).length === 0\n  );\n}\n\nexport function mergeRecords(\n  current: InitializedRecord | null,\n  updates: InitializedRecord\n): InitializedRecord {\n  if (current) {\n    let record: InitializedRecord = cloneRecordIdentity(current);\n\n    // Merge `meta` and `links`, replacing whole sections rather than merging\n    // individual members\n    mergeRecordSection(record, current, updates, 'meta', 0);\n    mergeRecordSection(record, current, updates, 'links', 0);\n\n    // Merge attributes and keys, replacing at the individual field level\n    mergeRecordSection(record, current, updates, 'attributes', 1);\n    mergeRecordSection(record, current, updates, 'keys', 1);\n\n    // Merge relationships, replacing at the `data`, `links`, and `meta` level\n    // for each relationship\n    mergeRecordSection(record, current, updates, 'relationships', 2);\n\n    return record;\n  } else {\n    return clone(updates);\n  }\n}\n\nfunction mergeRecordSection(\n  record: any,\n  current: any,\n  update: any,\n  section: string,\n  replacementDepth: number\n): void {\n  if (current[section] && update[section]) {\n    if (replacementDepth === 0) {\n      record[section] = clone(update[section]);\n    } else if (replacementDepth === 1) {\n      record[section] = Object.assign({}, current[section], update[section]);\n    } else {\n      record[section] = {};\n      for (let name of Object.keys(current[section])) {\n        mergeRecordSection(\n          record[section],\n          current[section],\n          update[section],\n          name,\n          replacementDepth - 1\n        );\n      }\n      for (let name of Object.keys(update[section])) {\n        if (!record[section][name]) {\n          record[section][name] = clone(update[section][name]);\n        }\n      }\n    }\n  } else if (current[section]) {\n    record[section] = clone(current[section]);\n  } else if (update[section]) {\n    record[section] = clone(update[section]);\n  }\n}\n\nexport function isRecordIdentity(\n  identity: RecordIdentity | unknown\n): identity is RecordIdentity {\n  const { id, type } = identity as RecordIdentity;\n  return typeof id === 'string' && typeof type === 'string';\n}\n\nexport function serializeRecordIdentity(record: RecordIdentity): string {\n  return `${record.type}:${record.id}`;\n}\n\nexport function deserializeRecordIdentity(identity: string): RecordIdentity {\n  const [type, id] = identity.split(':');\n  return { type, id };\n}\n\nfunction serializeRecordIdentities(\n  recordIdentities: RecordIdentity[]\n): string[] {\n  return recordIdentities.map((r) => serializeRecordIdentity(r));\n}\n\nfunction exclusiveIdentities(\n  identities1: string[],\n  identities2: string[]\n): string[] {\n  return identities1.filter((i) => !identities2.includes(i));\n}\n","import { ValidationIssue, ValidationOptions, Validator } from './validator';\n\ninterface BaseIssue extends ValidationIssue<unknown[]> {\n  validator: 'array';\n}\n\ninterface TypeIssue extends BaseIssue {\n  validation: 'type';\n}\n\ninterface MinItemsIssue extends BaseIssue {\n  validation: 'minItems';\n  details: {\n    minItems: number;\n  };\n}\n\ninterface MaxItemsIssue extends BaseIssue {\n  validation: 'maxItems';\n  details: {\n    maxItems: number;\n  };\n}\n\nexport type ArrayValidationIssue = TypeIssue | MinItemsIssue | MaxItemsIssue;\n\nexport interface ArrayValidationOptions extends ValidationOptions {\n  minItems?: number;\n  maxItems?: number;\n}\n\nexport type ArrayValidator = Validator<\n  unknown[],\n  ArrayValidationOptions,\n  ArrayValidationIssue\n>;\n\nexport const validateArray: ArrayValidator = (\n  input: unknown[],\n  options?: ArrayValidationOptions\n): undefined | ArrayValidationIssue[] => {\n  if (!Array.isArray(input)) {\n    return [\n      {\n        validator: 'array',\n        validation: 'type',\n        description: 'is not an array',\n        ref: input\n      }\n    ];\n  }\n  if (options?.minItems !== undefined && input.length < options.minItems) {\n    return [\n      {\n        validator: 'array',\n        validation: 'minItems',\n        description: 'has too few members',\n        ref: input,\n        details: {\n          minItems: options.minItems\n        }\n      }\n    ];\n  }\n  if (options?.maxItems !== undefined && input.length > options.maxItems) {\n    return [\n      {\n        validator: 'array',\n        validation: 'maxItems',\n        description: 'has too many members',\n        ref: input,\n        details: {\n          maxItems: options.maxItems\n        }\n      }\n    ];\n  }\n};\n","import { ValidationIssue, ValidationOptions, Validator } from './validator';\n\ninterface BaseIssue extends ValidationIssue<Date> {\n  validator: 'date';\n}\n\ninterface TypeIssue extends BaseIssue {\n  validation: 'type';\n}\n\ninterface MinimumIssue extends BaseIssue {\n  validation: 'minimum';\n  details: {\n    minimum: Date;\n  };\n}\n\ninterface MaximumIssue extends BaseIssue {\n  validation: 'maximum';\n  details: {\n    maximum: Date;\n  };\n}\n\ninterface ExclusiveMinimumIssue extends BaseIssue {\n  validation: 'exclusiveMinimum';\n  details: {\n    exclusiveMinimum: Date;\n  };\n}\n\ninterface ExclusiveMaximumIssue extends BaseIssue {\n  validation: 'exclusiveMaximum';\n  details: {\n    exclusiveMaximum: Date;\n  };\n}\n\nexport type DateValidationIssue =\n  | TypeIssue\n  | MinimumIssue\n  | MaximumIssue\n  | ExclusiveMinimumIssue\n  | ExclusiveMaximumIssue;\n\nexport interface DateValidationOptions extends ValidationOptions {\n  minimum?: Date;\n  maximum?: Date;\n  exclusiveMinimum?: Date;\n  exclusiveMaximum?: Date;\n}\n\nexport type DateValidator = Validator<\n  Date,\n  DateValidationOptions,\n  DateValidationIssue\n>;\n\nexport const validateDate: DateValidator = (\n  input: Date,\n  options?: DateValidationOptions\n): undefined | DateValidationIssue[] => {\n  if (!(input instanceof Date)) {\n    return [\n      {\n        validator: 'date',\n        validation: 'type',\n        description: 'is not a date',\n        ref: input\n      }\n    ];\n  }\n  if (options?.minimum !== undefined && input < options.minimum) {\n    return [\n      {\n        validator: 'date',\n        validation: 'minimum',\n        description: 'is too early',\n        ref: input,\n        details: {\n          minimum: options.minimum\n        }\n      }\n    ];\n  }\n  if (options?.maximum !== undefined && input > options.maximum) {\n    return [\n      {\n        validator: 'date',\n        validation: 'maximum',\n        description: 'is too late',\n        ref: input,\n        details: {\n          maximum: options.maximum\n        }\n      }\n    ];\n  }\n  if (\n    options?.exclusiveMinimum !== undefined &&\n    input <= options.exclusiveMinimum\n  ) {\n    return [\n      {\n        validator: 'date',\n        validation: 'exclusiveMinimum',\n        description: 'is too early',\n        ref: input,\n        details: {\n          exclusiveMinimum: options.exclusiveMinimum\n        }\n      }\n    ];\n  }\n  if (\n    options?.exclusiveMaximum !== undefined &&\n    input >= options.exclusiveMaximum\n  ) {\n    return [\n      {\n        validator: 'date',\n        validation: 'exclusiveMaximum',\n        description: 'is too late',\n        ref: input,\n        details: {\n          exclusiveMaximum: options.exclusiveMaximum\n        }\n      }\n    ];\n  }\n};\n","import { Dict } from '@orbit/utils';\nimport { ArrayValidator, validateArray } from './array-validator';\nimport { BooleanValidator, validateBoolean } from './boolean-validator';\nimport { DateValidator, validateDate } from './date-validator';\nimport { NumberValidator, validateNumber } from './number-validator';\nimport { ObjectValidator, validateObject } from './object-validator';\nimport { StringValidator, validateString } from './string-validator';\n\nexport enum StandardValidators {\n  Array = 'array',\n  Boolean = 'boolean',\n  Date = 'date',\n  DateTime = 'datetime',\n  Number = 'number',\n  Object = 'object',\n  String = 'string'\n}\n\nexport type StandardValidator =\n  | ArrayValidator\n  | BooleanValidator\n  | DateValidator\n  | NumberValidator\n  | ObjectValidator\n  | StringValidator;\n\nexport const standardValidators: Dict<StandardValidator> = {\n  array: validateArray,\n  boolean: validateBoolean,\n  date: validateDate,\n  datetime: validateDate,\n  number: validateNumber,\n  object: validateObject,\n  string: validateString\n};\n","import { ValidationIssue, Validator } from './validator';\n\ninterface BaseIssue extends ValidationIssue<boolean> {\n  validator: 'boolean';\n}\n\ninterface TypeIssue extends BaseIssue {\n  validation: 'type';\n}\n\nexport type BooleanValidationIssue = TypeIssue;\n\nexport type BooleanValidator = Validator<\n  boolean,\n  undefined,\n  BooleanValidationIssue\n>;\n\nexport const validateBoolean: BooleanValidator = (\n  input: boolean\n): undefined | BooleanValidationIssue[] => {\n  if (typeof input !== 'boolean') {\n    return [\n      {\n        validator: 'boolean',\n        validation: 'type',\n        description: 'is not a boolean',\n        ref: input\n      }\n    ];\n  }\n};\n","import { ValidationIssue, ValidationOptions, Validator } from './validator';\n\ninterface BaseIssue extends ValidationIssue<number> {\n  validator: 'number';\n}\n\ninterface TypeIssue extends BaseIssue {\n  validation: 'type';\n}\n\ninterface MinimumIssue extends BaseIssue {\n  validation: 'minimum';\n  details: {\n    minimum: number;\n  };\n}\n\ninterface MaximumIssue extends BaseIssue {\n  validation: 'maximum';\n  details: {\n    maximum: number;\n  };\n}\n\ninterface ExclusiveMinimumIssue extends BaseIssue {\n  validation: 'exclusiveMinimum';\n  details: {\n    exclusiveMinimum: number;\n  };\n}\n\ninterface ExclusiveMaximumIssue extends BaseIssue {\n  validation: 'exclusiveMaximum';\n  details: {\n    exclusiveMaximum: number;\n  };\n}\n\nexport type NumberValidationIssue =\n  | TypeIssue\n  | MinimumIssue\n  | MaximumIssue\n  | ExclusiveMinimumIssue\n  | ExclusiveMaximumIssue;\n\nexport interface NumberValidationOptions extends ValidationOptions {\n  minimum?: number;\n  maximum?: number;\n  exclusiveMinimum?: number;\n  exclusiveMaximum?: number;\n}\n\nexport type NumberValidator = Validator<\n  number,\n  NumberValidationOptions,\n  NumberValidationIssue\n>;\n\nexport const validateNumber: NumberValidator = (\n  input: number,\n  options?: NumberValidationOptions\n): undefined | NumberValidationIssue[] => {\n  if (typeof input !== 'number') {\n    return [\n      {\n        validator: 'number',\n        validation: 'type',\n        description: 'is not a number',\n        ref: input\n      }\n    ];\n  }\n  if (options?.minimum !== undefined && input < options.minimum) {\n    return [\n      {\n        validator: 'number',\n        validation: 'minimum',\n        description: 'is too low',\n        ref: input,\n        details: {\n          minimum: options.minimum\n        }\n      }\n    ];\n  }\n  if (options?.maximum !== undefined && input > options.maximum) {\n    return [\n      {\n        validator: 'number',\n        validation: 'maximum',\n        description: 'is too high',\n        ref: input,\n        details: {\n          maximum: options.maximum\n        }\n      }\n    ];\n  }\n  if (\n    options?.exclusiveMinimum !== undefined &&\n    input <= options.exclusiveMinimum\n  ) {\n    return [\n      {\n        validator: 'number',\n        validation: 'exclusiveMinimum',\n        description: 'is too low',\n        ref: input,\n        details: {\n          exclusiveMinimum: options.exclusiveMinimum\n        }\n      }\n    ];\n  }\n  if (\n    options?.exclusiveMaximum !== undefined &&\n    input >= options.exclusiveMaximum\n  ) {\n    return [\n      {\n        validator: 'number',\n        validation: 'exclusiveMaximum',\n        description: 'is too high',\n        ref: input,\n        details: {\n          exclusiveMaximum: options.exclusiveMaximum\n        }\n      }\n    ];\n  }\n};\n","import { ValidationIssue, ValidationOptions, Validator } from './validator';\n\ninterface BaseIssue extends ValidationIssue<unknown> {\n  validator: 'object';\n}\n\ninterface TypeIssue extends BaseIssue {\n  validation: 'type';\n}\nexport type ObjectValidationIssue = TypeIssue;\n\nexport type ObjectValidationOptions = ValidationOptions;\n\nexport type ObjectValidator = Validator<\n  unknown,\n  ObjectValidationOptions,\n  ObjectValidationIssue\n>;\n\nexport const validateObject: ObjectValidator = (\n  input: unknown,\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  options?: ObjectValidationOptions\n): undefined | ObjectValidationIssue[] => {\n  if (typeof input !== 'object' || input === null) {\n    return [\n      {\n        validator: 'object',\n        validation: 'type',\n        description: 'is not an object',\n        ref: input\n      }\n    ];\n  }\n};\n","import { ValidationIssue, ValidationOptions, Validator } from './validator';\n\ninterface BaseIssue extends ValidationIssue<string> {\n  validator: 'string';\n}\n\ninterface TypeIssue extends BaseIssue {\n  validation: 'type';\n}\n\ninterface MinLengthIssue extends BaseIssue {\n  validation: 'minLength';\n  details: {\n    minLength: number;\n  };\n}\n\ninterface MaxLengthIssue extends BaseIssue {\n  validation: 'maxLength';\n  details: {\n    maxLength: number;\n  };\n}\n\nexport type StringValidationIssue = TypeIssue | MinLengthIssue | MaxLengthIssue;\n\nexport interface StringValidationOptions extends ValidationOptions {\n  minLength?: number;\n  maxLength?: number;\n}\n\nexport type StringValidator = Validator<\n  string,\n  StringValidationOptions,\n  StringValidationIssue\n>;\n\nexport const validateString: StringValidator = (\n  input: string,\n  options?: StringValidationOptions\n): undefined | StringValidationIssue[] => {\n  if (typeof input !== 'string') {\n    return [\n      {\n        validator: 'string',\n        validation: 'type',\n        description: 'is not a string',\n        ref: input\n      }\n    ];\n  }\n  if (options?.minLength !== undefined && input.length < options.minLength) {\n    return [\n      {\n        validator: 'string',\n        validation: 'minLength',\n        description: 'is too short',\n        ref: input,\n        details: {\n          minLength: options.minLength\n        }\n      }\n    ];\n  }\n  if (options?.maxLength !== undefined && input.length > options.maxLength) {\n    return [\n      {\n        validator: 'string',\n        validation: 'maxLength',\n        description: 'is too long',\n        ref: input,\n        details: {\n          maxLength: options.maxLength\n        }\n      }\n    ];\n  }\n};\n","export interface ValidationOptions {\n  [key: string]: unknown;\n}\n\nexport interface ValidationIssue<Ref = unknown, Details = unknown> {\n  /**\n   * An identifier for the validator that caused the issue.\n   */\n  validator: string;\n\n  /**\n   * An identifier for the validation violation.\n   */\n  validation: string;\n\n  /**\n   * A brief description of the violation. This does not have to be appropriate\n   * for end users, who should typically be shown internationalized, customized\n   * messages.\n   */\n  description: string;\n\n  /**\n   * A reference to the source of the validation issue. This should be specific\n   * enough to allow dereferencing to a particular record, field, etc. For\n   * low-level primitive validations (e.g. booleans, strings, etc.), this should\n   * be the value itself.\n   */\n  ref?: Ref;\n\n  /**\n   * Details specific to the validation performed that will be helpful to\n   * understand the violation.\n   */\n  details?: Details;\n}\n\nexport type Validator<\n  Input = unknown,\n  Options = ValidationOptions,\n  Issue = ValidationIssue<Input>\n> = (input: Input, options?: Options) => undefined | Issue[];\n\nexport function formatValidationDescription(\n  summary: string,\n  issues?: ValidationIssue[]\n): string {\n  if (issues && issues.length > 0) {\n    return `${summary}\\n${issues\n      .map((i) => `- ${i.description.replace(/\\n/g, '\\n  ')}`)\n      .join('\\n')}`;\n  } else {\n    return summary;\n  }\n}\n","import { Exception } from '@orbit/core';\nimport {\n  formatValidationDescription,\n  ValidationIssue\n} from '@orbit/validators';\n\n/**\n * An error occured related to the schema.\n */\nexport class SchemaError extends Exception {\n  constructor(description: string) {\n    super(`Schema: ${description}`);\n  }\n}\n\n/**\n * A validation failed.\n */\nexport class ValidationError extends Exception {\n  public issues?: ValidationIssue[];\n\n  constructor(description: string, issues?: ValidationIssue[]) {\n    super(formatValidationDescription(description, issues));\n    this.issues = issues;\n  }\n}\n\n/**\n * A model is not defined in the schema.\n */\nexport class ModelNotDefined extends SchemaError {\n  constructor(type: string) {\n    super(`Model '${type}' not defined.`);\n  }\n}\n\n/**\n * An attribute definition could not be found in the model definition.\n */\nexport class AttributeNotDefined extends SchemaError {\n  constructor(type: string, attribute: string) {\n    super(`Attribute '${attribute}' not defined for model '${type}'.`);\n  }\n}\n\n/**\n * A key definition could not be found in the model definition.\n */\nexport class KeyNotDefined extends SchemaError {\n  constructor(type: string, key: string) {\n    super(`Key '${key}' not defined for model '${type}'.`);\n  }\n}\n\n/**\n * A relationship definition could not be found in the model definition.\n */\nexport class RelationshipNotDefined extends SchemaError {\n  constructor(type: string, relationship: string) {\n    super(`Relationship '${relationship}' not defined for model '${type}'.`);\n  }\n}\n\n/**\n * An error occurred related to a particular record.\n */\nexport abstract class RecordException extends Exception {\n  public type: string;\n  public id: string;\n  public field?: string;\n\n  constructor(description: string, type: string, id: string, field?: string) {\n    let specifier = `${type}:${id}`;\n\n    if (field) {\n      specifier = `${specifier}/${field}`;\n    }\n\n    super(`${description}: ${specifier}`);\n\n    this.type = type;\n    this.id = id;\n    this.field = field;\n  }\n}\n\n/**\n * A record could not be found.\n */\nexport class RecordNotFoundException extends RecordException {\n  constructor(type: string, id: string) {\n    super('Record not found', type, id);\n  }\n}\n","import { deepGet, deepSet, Dict } from '@orbit/utils';\nimport { InitializedRecord, UninitializedRecord } from './record';\n\n/**\n * Maintains a map between records' ids and keys.\n */\nexport class RecordKeyMap {\n  private _idsToKeys!: Dict<Dict<string>>;\n  private _keysToIds!: Dict<Dict<string>>;\n\n  constructor() {\n    this.reset();\n  }\n\n  /**\n   * Resets the contents of the key map.\n   */\n  reset(): void {\n    this._idsToKeys = {};\n    this._keysToIds = {};\n  }\n\n  /**\n   * Return a key value given a model type, key name, and id.\n   */\n  idToKey(type: string, keyName: string, idValue: string): string | undefined {\n    return deepGet(this._idsToKeys, [type, keyName, idValue]);\n  }\n\n  /**\n   * Return an id value given a model type, key name, and key value.\n   */\n  keyToId(type: string, keyName: string, keyValue: string): string | undefined {\n    return deepGet(this._keysToIds, [type, keyName, keyValue]);\n  }\n\n  /**\n   * Store the id and key values of a record in this key map.\n   */\n  pushRecord(record: InitializedRecord | UninitializedRecord): void {\n    const { type, id, keys } = record;\n\n    if (!keys || !id) {\n      return;\n    }\n\n    Object.keys(keys).forEach((keyName) => {\n      let keyValue = keys[keyName];\n      if (keyValue) {\n        deepSet(this._idsToKeys, [type, keyName, id], keyValue);\n        deepSet(this._keysToIds, [type, keyName, keyValue], id);\n      }\n    });\n  }\n\n  /**\n   * Given a record, find the cached id if it exists.\n   */\n  idFromKeys(type: string, keys: Dict<string>): string | undefined {\n    for (let key of Object.keys(keys)) {\n      let value = keys[key];\n      if (value) {\n        return this.keyToId(type, key, value);\n      }\n    }\n  }\n}\n","import { eq, deepGet, deepSet } from '@orbit/utils';\nimport { Operation } from '@orbit/data';\nimport {\n  InitializedRecord,\n  RecordIdentity,\n  cloneRecordIdentity,\n  equalRecordIdentities,\n  mergeRecords,\n  dedupeRecordIdentities\n} from './record';\n\n/**\n * Add record operation.\n */\nexport interface AddRecordOperation extends Operation {\n  op: 'addRecord';\n  record: InitializedRecord;\n}\n\n/**\n * Update record operation.\n */\nexport interface UpdateRecordOperation extends Operation {\n  op: 'updateRecord';\n  record: InitializedRecord;\n}\n\n/**\n * Remove record operation.\n */\nexport interface RemoveRecordOperation extends Operation {\n  op: 'removeRecord';\n  record: RecordIdentity;\n}\n\n/**\n * Replace key operation.\n */\nexport interface ReplaceKeyOperation extends Operation {\n  op: 'replaceKey';\n  record: RecordIdentity;\n  key: string;\n  value: string;\n}\n\n/**\n * Replace attribute operation.\n */\nexport interface ReplaceAttributeOperation extends Operation {\n  op: 'replaceAttribute';\n  record: RecordIdentity;\n  attribute: string;\n  value: unknown;\n}\n\n/**\n * Add to has-many relationship operation.\n */\nexport interface AddToRelatedRecordsOperation extends Operation {\n  op: 'addToRelatedRecords';\n  record: RecordIdentity;\n  relationship: string;\n  relatedRecord: RecordIdentity;\n}\n\n/**\n * Remove from has-many relationship operation.\n */\nexport interface RemoveFromRelatedRecordsOperation extends Operation {\n  op: 'removeFromRelatedRecords';\n  record: RecordIdentity;\n  relationship: string;\n  relatedRecord: RecordIdentity;\n}\n\n/**\n * Replace has-many relationship operation.\n */\nexport interface ReplaceRelatedRecordsOperation extends Operation {\n  op: 'replaceRelatedRecords';\n  record: RecordIdentity;\n  relationship: string;\n  relatedRecords: RecordIdentity[];\n}\n\n/**\n * Replace has-one relationship operation.\n */\nexport interface ReplaceRelatedRecordOperation extends Operation {\n  op: 'replaceRelatedRecord';\n  record: RecordIdentity;\n  relationship: string;\n  relatedRecord: RecordIdentity | null;\n}\n\n/**\n * Union of all record-related operations.\n */\nexport type RecordOperation =\n  | AddRecordOperation\n  | UpdateRecordOperation\n  | RemoveRecordOperation\n  | ReplaceKeyOperation\n  | ReplaceAttributeOperation\n  | AddToRelatedRecordsOperation\n  | RemoveFromRelatedRecordsOperation\n  | ReplaceRelatedRecordsOperation\n  | ReplaceRelatedRecordOperation;\n\nexport type AddRecordOperationResult = InitializedRecord;\nexport type UpdateRecordOperationResult = undefined;\nexport type RemoveRecordOperationResult = undefined;\nexport type ReplaceKeyOperationResult = undefined;\nexport type ReplaceAttributeOperationResult = undefined;\nexport type AddToRelatedRecordsOperationResult = undefined;\nexport type RemoveFromRelatedRecordsOperationResult = undefined;\nexport type ReplaceRelatedRecordsOperationResult = undefined;\nexport type ReplaceRelatedRecordOperationResult = undefined;\n\nexport type RecordOperationResult<T = InitializedRecord> = T | undefined;\n\nfunction markOperationToDelete(operation: Operation): void {\n  const o: any = operation;\n  o._deleted = true;\n}\n\nfunction isOperationMarkedToDelete(operation: Operation): boolean {\n  const o: any = operation;\n  return o._deleted === true;\n}\n\nfunction mergeOperations(\n  superceded: RecordOperation,\n  superceding: RecordOperation,\n  consecutiveOps: boolean\n): void {\n  if (superceded.options || superceding.options) {\n    // do not merge if one of the operations have options\n    return;\n  } else if (equalRecordIdentities(superceded.record, superceding.record)) {\n    if (superceding.op === 'removeRecord') {\n      markOperationToDelete(superceded);\n      if (superceded.op === 'addRecord') {\n        markOperationToDelete(superceding);\n      }\n    } else if (\n      !isOperationMarkedToDelete(superceding) &&\n      (consecutiveOps || superceding.op === 'replaceAttribute')\n    ) {\n      if (isReplaceFieldOp(superceded.op) && isReplaceFieldOp(superceding.op)) {\n        if (\n          superceded.op === 'replaceAttribute' &&\n          superceding.op === 'replaceAttribute' &&\n          superceded.attribute === superceding.attribute\n        ) {\n          markOperationToDelete(superceded);\n        } else if (\n          superceded.op === 'replaceRelatedRecord' &&\n          superceding.op === 'replaceRelatedRecord' &&\n          superceded.relationship === superceding.relationship\n        ) {\n          markOperationToDelete(superceded);\n        } else if (\n          superceded.op === 'replaceRelatedRecords' &&\n          superceding.op === 'replaceRelatedRecords' &&\n          superceded.relationship === superceding.relationship\n        ) {\n          markOperationToDelete(superceded);\n        } else {\n          if (superceded.op === 'replaceAttribute') {\n            updateRecordReplaceAttribute(\n              superceded.record,\n              superceded.attribute,\n              superceded.value\n            );\n            delete (superceded as any).attribute;\n            delete superceded.value;\n          } else if (superceded.op === 'replaceRelatedRecord') {\n            updateRecordReplaceHasOne(\n              superceded.record,\n              superceded.relationship,\n              superceded.relatedRecord\n            );\n            delete (superceded as any).relationship;\n            delete (superceded as any).relatedRecord;\n          } else if (superceded.op === 'replaceRelatedRecords') {\n            updateRecordReplaceHasMany(\n              superceded.record,\n              superceded.relationship,\n              superceded.relatedRecords\n            );\n            delete (superceded as any).relationship;\n            delete (superceded as any).relatedRecords;\n          }\n          if (superceding.op === 'replaceAttribute') {\n            updateRecordReplaceAttribute(\n              superceded.record,\n              superceding.attribute,\n              superceding.value\n            );\n          } else if (superceding.op === 'replaceRelatedRecord') {\n            updateRecordReplaceHasOne(\n              superceded.record,\n              superceding.relationship,\n              superceding.relatedRecord\n            );\n          } else if (superceding.op === 'replaceRelatedRecords') {\n            updateRecordReplaceHasMany(\n              superceded.record,\n              superceding.relationship,\n              superceding.relatedRecords\n            );\n          }\n          superceded.op = 'updateRecord';\n          markOperationToDelete(superceding);\n        }\n      } else if (\n        (superceded.op === 'addRecord' ||\n          superceded.op === 'updateRecord' ||\n          (superceded as any).op === 'replaceRecord') &&\n        (superceding.op === 'updateRecord' ||\n          (superceding as any).op === 'replaceRecord')\n      ) {\n        superceded.record = mergeRecords(superceded.record, superceding.record);\n        markOperationToDelete(superceding);\n      } else if (\n        (superceded.op === 'addRecord' ||\n          superceded.op === 'updateRecord' ||\n          (superceded as any).op === 'replaceRecord') &&\n        isReplaceFieldOp(superceding.op)\n      ) {\n        if (superceding.op === 'replaceAttribute') {\n          updateRecordReplaceAttribute(\n            superceded.record,\n            superceding.attribute,\n            superceding.value\n          );\n        } else if (superceding.op === 'replaceRelatedRecord') {\n          updateRecordReplaceHasOne(\n            superceded.record,\n            superceding.relationship,\n            superceding.relatedRecord\n          );\n        } else if (superceding.op === 'replaceRelatedRecords') {\n          updateRecordReplaceHasMany(\n            superceded.record,\n            superceding.relationship,\n            superceding.relatedRecords\n          );\n        }\n        markOperationToDelete(superceding);\n      } else if (superceding.op === 'addToRelatedRecords') {\n        if (superceded.op === 'addRecord') {\n          updateRecordAddToHasMany(\n            superceded.record,\n            superceding.relationship,\n            superceding.relatedRecord\n          );\n          markOperationToDelete(superceding);\n        } else if (\n          superceded.op === 'updateRecord' ||\n          (superceded as any).op === 'replaceRecord'\n        ) {\n          let record: InitializedRecord = superceded.record;\n          if (record.relationships?.[superceding.relationship]?.data) {\n            updateRecordAddToHasMany(\n              superceded.record,\n              superceding.relationship,\n              superceding.relatedRecord\n            );\n            markOperationToDelete(superceding);\n          }\n        }\n      } else if (superceding.op === 'removeFromRelatedRecords') {\n        if (\n          superceded.op === 'addToRelatedRecords' &&\n          superceded.relationship === superceding.relationship &&\n          equalRecordIdentities(\n            superceded.relatedRecord,\n            superceding.relatedRecord\n          )\n        ) {\n          markOperationToDelete(superceded);\n          markOperationToDelete(superceding);\n        } else if (\n          superceded.op === 'addRecord' ||\n          superceded.op === 'updateRecord' ||\n          (superceded as any).op === 'replaceRecord'\n        ) {\n          let record: InitializedRecord = superceded.record;\n          if (record.relationships?.[superceding.relationship]?.data) {\n            updateRecordRemoveFromHasMany(\n              superceded.record,\n              superceding.relationship,\n              superceding.relatedRecord\n            );\n            markOperationToDelete(superceding);\n          }\n        }\n      }\n    }\n  } else if (superceding.record && superceding.op === 'removeRecord') {\n    if (\n      (superceded as ReplaceRelatedRecordOperation).relatedRecord &&\n      equalRecordIdentities(\n        (superceded as ReplaceRelatedRecordOperation)\n          .relatedRecord as RecordIdentity,\n        superceding.record\n      )\n    ) {\n      markOperationToDelete(superceded);\n    }\n  }\n}\n\nfunction isReplaceFieldOp(op: string): boolean {\n  return (\n    op === 'replaceAttribute' ||\n    op === 'replaceRelatedRecord' ||\n    op === 'replaceRelatedRecords'\n  );\n}\n\nfunction updateRecordReplaceAttribute(\n  record: InitializedRecord,\n  attribute: string,\n  value: unknown\n) {\n  deepSet(record, ['attributes', attribute], value);\n}\n\nfunction updateRecordReplaceHasOne(\n  record: InitializedRecord,\n  relationship: string,\n  relatedRecord: RecordIdentity | null\n) {\n  deepSet(\n    record,\n    ['relationships', relationship, 'data'],\n    relatedRecord ? cloneRecordIdentity(relatedRecord) : null\n  );\n}\n\nfunction updateRecordReplaceHasMany(\n  record: InitializedRecord,\n  relationship: string,\n  relatedRecords: RecordIdentity[]\n) {\n  deepSet(\n    record,\n    ['relationships', relationship, 'data'],\n    relatedRecords.map(cloneRecordIdentity)\n  );\n}\n\nfunction updateRecordAddToHasMany(\n  record: InitializedRecord,\n  relationship: string,\n  relatedRecord: RecordIdentity\n) {\n  const data = deepGet(record, ['relationships', relationship, 'data']) || [];\n  data.push(cloneRecordIdentity(relatedRecord));\n  deepSet(record, ['relationships', relationship, 'data'], data);\n}\n\nfunction updateRecordRemoveFromHasMany(\n  record: InitializedRecord,\n  relationship: string,\n  relatedRecord: RecordIdentity\n) {\n  const data = deepGet(record, [\n    'relationships',\n    relationship,\n    'data'\n  ]) as RecordIdentity[];\n  if (data) {\n    for (let i = 0, l = data.length; i < l; i++) {\n      let r = data[i];\n      if (equalRecordIdentities(r, relatedRecord)) {\n        data.splice(i, 1);\n        break;\n      }\n    }\n  }\n}\n\n/**\n * Coalesces operations into a minimal set of equivalent operations.\n *\n * This method respects the order of the operations array and does not allow\n * reordering of operations that affect relationships.\n */\nexport function coalesceRecordOperations(\n  operations: RecordOperation[]\n): RecordOperation[] {\n  for (let i = 0, l = operations.length; i < l; i++) {\n    let currentOp = operations[i];\n    let consecutiveOps = true;\n\n    for (let j = i + 1; j < l; j++) {\n      let nextOp = operations[j];\n\n      mergeOperations(currentOp, nextOp, consecutiveOps);\n\n      if (isOperationMarkedToDelete(currentOp)) {\n        break;\n      } else if (!isOperationMarkedToDelete(nextOp)) {\n        consecutiveOps = false;\n      }\n    }\n  }\n\n  return operations.filter((o) => !isOperationMarkedToDelete(o));\n}\n\n/**\n * Determine the differences between a record and its updated version in terms\n * of a set of operations.\n */\nexport function recordDiffs(\n  record: InitializedRecord,\n  updatedRecord: InitializedRecord\n): RecordOperation[] {\n  const ops: RecordOperation[] = [];\n\n  if (record && updatedRecord) {\n    let fullRecordUpdate = false;\n    const recordIdentity = cloneRecordIdentity(record);\n    const diffRecord: InitializedRecord = { ...recordIdentity };\n\n    for (let member in updatedRecord) {\n      if (member !== 'id' && member !== 'type') {\n        let value: unknown;\n        let updatedValue: unknown;\n\n        switch (member) {\n          case 'attributes':\n          case 'keys':\n          case 'relationships':\n            for (let field in updatedRecord[member]) {\n              value = record[member]?.[field];\n              updatedValue = (updatedRecord[member] as any)[field];\n\n              if (!eq(value, updatedValue)) {\n                if (member === 'relationships') {\n                  fullRecordUpdate = true;\n                }\n                deepSet(diffRecord, [member, field], updatedValue);\n              }\n            }\n            break;\n\n          default:\n            value = (record as any)[member];\n            updatedValue = (updatedRecord as any)[member];\n\n            if (!eq(updatedValue, value)) {\n              (diffRecord as any)[member] = updatedValue;\n              fullRecordUpdate = true;\n            }\n        }\n      }\n    }\n\n    // If updates consist solely of attributes and keys, update fields\n    // with individual operations. Otherwise, update the record as a\n    // whole.\n    if (fullRecordUpdate) {\n      let op: UpdateRecordOperation = {\n        op: 'updateRecord',\n        record: diffRecord\n      };\n      ops.push(op);\n    } else {\n      if (diffRecord.attributes) {\n        for (let attribute in diffRecord.attributes) {\n          let value = diffRecord.attributes[attribute];\n          let op: ReplaceAttributeOperation = {\n            op: 'replaceAttribute',\n            record: recordIdentity,\n            attribute,\n            value\n          };\n          ops.push(op);\n        }\n      }\n      if (diffRecord.keys) {\n        for (let key in diffRecord.keys) {\n          let value = diffRecord.keys[key];\n          let op: ReplaceKeyOperation = {\n            op: 'replaceKey',\n            record: recordIdentity,\n            key,\n            value\n          };\n          ops.push(op);\n        }\n      }\n    }\n  }\n\n  return ops;\n}\n\n/**\n * Returns the deduped identities of all the records directly referenced by an\n * array of operations.\n */\nexport function recordsReferencedByOperations(\n  operations: RecordOperation[]\n): RecordIdentity[] {\n  const records = [];\n\n  for (let operation of operations) {\n    if (operation.record) {\n      records.push(operation.record);\n\n      if (operation.op === 'addRecord' || operation.op === 'updateRecord') {\n        let record = operation.record;\n        if (record.relationships) {\n          for (let relName in record.relationships) {\n            let rel = record.relationships[relName];\n            if (rel?.data) {\n              if (Array.isArray(rel.data)) {\n                Array.prototype.push.apply(records, rel.data);\n              } else {\n                records.push(rel.data);\n              }\n            }\n          }\n        }\n      }\n    }\n    if (\n      operation.op === 'addToRelatedRecords' ||\n      operation.op === 'removeFromRelatedRecords' ||\n      operation.op === 'replaceRelatedRecord'\n    ) {\n      if (operation.relatedRecord) {\n        records.push(operation.relatedRecord);\n      }\n    } else if (operation.op === 'replaceRelatedRecords') {\n      Array.prototype.push.apply(records, operation.relatedRecords);\n    }\n  }\n\n  return dedupeRecordIdentities(records);\n}\n","import { RecordAttributeValidator } from './record-attribute-validator';\nimport { RecordFieldDefinitionValidator } from './record-field-definition-validator';\nimport { RecordIdentityValidator } from './record-identity-validator';\nimport { RecordKeyValidator } from './record-key-validator';\nimport { RecordOperationValidator } from './record-operation-validator';\nimport { RecordQueryExpressionValidator } from './record-query-expression-validator';\nimport { RecordRelationshipValidator } from './record-relationship-validator';\nimport { RecordTypeValidator } from './record-type-validator';\nimport { RecordValidator } from './record-validator';\nimport { RelatedRecordValidator } from './related-record-validator';\n\nexport enum StandardRecordValidators {\n  Record = 'record',\n  RecordAttribute = 'recordAttribute',\n  RecordIdentity = 'recordIdentity',\n  RecordKey = 'recordKey',\n  RecordOperation = 'recordOperation',\n  RecordQueryExpression = 'recordQueryExpression',\n  RecordRelationship = 'recordRelationship',\n  RecordType = 'recordType',\n  RelatedRecord = 'relatedRecord',\n  RecordFieldDefinition = 'recordFieldDefinition'\n}\n\nexport type StandardRecordValidator =\n  | RecordValidator\n  | RecordAttributeValidator\n  | RecordIdentityValidator\n  | RecordKeyValidator\n  | RecordOperationValidator\n  | RecordQueryExpressionValidator\n  | RecordRelationshipValidator\n  | RecordTypeValidator\n  | RelatedRecordValidator\n  | RecordFieldDefinitionValidator;\n","import { OperationTerm } from '@orbit/data';\nimport {\n  AddRecordOperation,\n  UpdateRecordOperation,\n  RemoveRecordOperation,\n  ReplaceAttributeOperation,\n  ReplaceKeyOperation,\n  AddToRelatedRecordsOperation,\n  RemoveFromRelatedRecordsOperation,\n  ReplaceRelatedRecordsOperation,\n  ReplaceRelatedRecordOperation,\n  RecordOperation\n} from './record-operation';\nimport {\n  InitializedRecord,\n  RecordIdentity,\n  UninitializedRecord\n} from './record';\nimport { RecordTransformBuilder } from './record-transform-builder';\nimport { StandardRecordValidators } from './record-validators/standard-record-validators';\nimport { RecordOperationValidator } from './record-validators/record-operation-validator';\nimport { RecordSchema } from './record-schema';\nimport { ValidationError } from './record-exceptions';\n\nexport class BaseRecordOperationTerm<\n  O extends RecordOperation,\n  RT = string,\n  RI = RecordIdentity,\n  R = UninitializedRecord\n> extends OperationTerm<O> {\n  $transformBuilder: RecordTransformBuilder<RT, RI, R>;\n\n  constructor(\n    transformBuilder: RecordTransformBuilder<RT, RI, R>,\n    operation: O\n  ) {\n    super(operation);\n    this.$transformBuilder = transformBuilder;\n  }\n\n  toOperation(): O {\n    const operation = super.toOperation();\n\n    const validatorFor = this.$transformBuilder.$validatorFor;\n    if (validatorFor) {\n      const schema = this.$transformBuilder.$schema as RecordSchema;\n\n      const validateRecordOperation = validatorFor(\n        StandardRecordValidators.RecordOperation\n      ) as RecordOperationValidator;\n\n      const issues = validateRecordOperation(operation, {\n        validatorFor,\n        schema\n      });\n      if (issues !== undefined) {\n        throw new ValidationError(\n          'Validation isssues encountered while building a transform operation',\n          issues\n        );\n      }\n    }\n\n    return operation;\n  }\n}\n\nexport class AddRecordTerm<\n  RT = string,\n  RI = RecordIdentity,\n  R = UninitializedRecord\n> extends BaseRecordOperationTerm<AddRecordOperation, RT, RI, R> {\n  constructor(\n    transformBuilder: RecordTransformBuilder<RT, RI, R>,\n    record: InitializedRecord\n  ) {\n    super(transformBuilder, {\n      op: 'addRecord',\n      record\n    });\n  }\n}\n\nexport class UpdateRecordTerm<\n  RT = string,\n  RI = RecordIdentity,\n  R = UninitializedRecord\n> extends BaseRecordOperationTerm<UpdateRecordOperation, RT, RI, R> {\n  constructor(\n    transformBuilder: RecordTransformBuilder<RT, RI, R>,\n    record: InitializedRecord\n  ) {\n    super(transformBuilder, {\n      op: 'updateRecord',\n      record\n    });\n  }\n}\n\nexport class RemoveRecordTerm<\n  RT = string,\n  RI = RecordIdentity,\n  R = UninitializedRecord\n> extends BaseRecordOperationTerm<RemoveRecordOperation, RT, RI, R> {\n  constructor(\n    transformBuilder: RecordTransformBuilder<RT, RI, R>,\n    record: RecordIdentity\n  ) {\n    super(transformBuilder, {\n      op: 'removeRecord',\n      record\n    });\n  }\n}\n\nexport class ReplaceAttributeTerm<\n  RT = string,\n  RI = RecordIdentity,\n  R = UninitializedRecord\n> extends BaseRecordOperationTerm<ReplaceAttributeOperation, RT, RI, R> {\n  constructor(\n    transformBuilder: RecordTransformBuilder<RT, RI, R>,\n    record: RecordIdentity,\n    attribute: string,\n    value: unknown\n  ) {\n    super(transformBuilder, {\n      op: 'replaceAttribute',\n      record,\n      attribute,\n      value\n    });\n  }\n}\n\nexport class ReplaceKeyTerm<\n  RT = string,\n  RI = RecordIdentity,\n  R = UninitializedRecord\n> extends BaseRecordOperationTerm<ReplaceKeyOperation, RT, RI, R> {\n  constructor(\n    transformBuilder: RecordTransformBuilder<RT, RI, R>,\n    record: RecordIdentity,\n    key: string,\n    value: string\n  ) {\n    super(transformBuilder, {\n      op: 'replaceKey',\n      record,\n      key,\n      value\n    });\n  }\n}\n\nexport class AddToRelatedRecordsTerm<\n  RT = string,\n  RI = RecordIdentity,\n  R = UninitializedRecord\n> extends BaseRecordOperationTerm<AddToRelatedRecordsOperation, RT, RI, R> {\n  constructor(\n    transformBuilder: RecordTransformBuilder<RT, RI, R>,\n    record: RecordIdentity,\n    relationship: string,\n    relatedRecord: RecordIdentity\n  ) {\n    super(transformBuilder, {\n      op: 'addToRelatedRecords',\n      record,\n      relationship,\n      relatedRecord\n    });\n  }\n}\n\nexport class RemoveFromRelatedRecordsTerm<\n  RT = string,\n  RI = RecordIdentity,\n  R = UninitializedRecord\n> extends BaseRecordOperationTerm<\n  RemoveFromRelatedRecordsOperation,\n  RT,\n  RI,\n  R\n> {\n  constructor(\n    transformBuilder: RecordTransformBuilder<RT, RI, R>,\n    record: RecordIdentity,\n    relationship: string,\n    relatedRecord: RecordIdentity\n  ) {\n    super(transformBuilder, {\n      op: 'removeFromRelatedRecords',\n      record,\n      relationship,\n      relatedRecord\n    });\n  }\n}\n\nexport class ReplaceRelatedRecordsTerm<\n  RT = string,\n  RI = RecordIdentity,\n  R = UninitializedRecord\n> extends BaseRecordOperationTerm<ReplaceRelatedRecordsOperation, RT, RI, R> {\n  constructor(\n    transformBuilder: RecordTransformBuilder<RT, RI, R>,\n    record: RecordIdentity,\n    relationship: string,\n    relatedRecords: RecordIdentity[]\n  ) {\n    super(transformBuilder, {\n      op: 'replaceRelatedRecords',\n      record,\n      relationship,\n      relatedRecords\n    });\n  }\n}\n\nexport class ReplaceRelatedRecordTerm<\n  RT = string,\n  RI = RecordIdentity,\n  R = UninitializedRecord\n> extends BaseRecordOperationTerm<ReplaceRelatedRecordOperation, RT, RI, R> {\n  constructor(\n    transformBuilder: RecordTransformBuilder<RT, RI, R>,\n    record: RecordIdentity,\n    relationship: string,\n    relatedRecord: RecordIdentity | null\n  ) {\n    super(transformBuilder, {\n      op: 'replaceRelatedRecord',\n      record,\n      relationship,\n      relatedRecord\n    });\n  }\n}\n\nexport type RecordOperationTerm<\n  RT = string,\n  RI = RecordIdentity,\n  R = UninitializedRecord\n> =\n  | AddRecordTerm<RT, RI, R>\n  | UpdateRecordTerm<RT, RI, R>\n  | RemoveRecordTerm<RT, RI, R>\n  | ReplaceKeyTerm<RT, RI, R>\n  | ReplaceAttributeTerm<RT, RI, R>\n  | AddToRelatedRecordsTerm<RT, RI, R>\n  | RemoveFromRelatedRecordsTerm<RT, RI, R>\n  | ReplaceRelatedRecordsTerm<RT, RI, R>\n  | ReplaceRelatedRecordTerm<RT, RI, R>;\n","import { QueryTerm } from '@orbit/data';\nimport { isObject } from '@orbit/utils';\nimport { RecordIdentity } from './record';\nimport { ValidationError } from './record-exceptions';\nimport { RecordQueryBuilder } from './record-query-builder';\nimport {\n  AttributeFilterSpecifier,\n  AttributeSortSpecifier,\n  FilterSpecifier,\n  FindRecord,\n  FindRecords,\n  FindRelatedRecord,\n  FindRelatedRecords,\n  PageSpecifier,\n  RecordQueryExpression,\n  RelatedRecordFilterSpecifier,\n  RelatedRecordsFilterSpecifier,\n  SetComparisonOperator,\n  SortOrder,\n  SortSpecifier,\n  ValueComparisonOperator\n} from './record-query-expression';\nimport { RecordSchema } from './record-schema';\nimport { RecordQueryExpressionValidator } from './record-validators/record-query-expression-validator';\nimport { StandardRecordValidators } from './record-validators/standard-record-validators';\n\nexport interface AttributeSortParam {\n  attribute: string;\n  order?: SortOrder;\n}\n\nexport type SortParam = SortSpecifier | AttributeSortParam | string;\n\nexport interface PageParam {\n  offset?: number;\n  limit?: number;\n}\n\nexport interface AttributeFilterParam {\n  op?: ValueComparisonOperator;\n  attribute: string;\n  value: any;\n}\n\nexport interface RelatedRecordFilterParam<RI = RecordIdentity> {\n  op?: SetComparisonOperator;\n  relation: string;\n  record: RI | RI[] | null;\n}\n\nexport interface RelatedRecordsFilterParam<RI = RecordIdentity> {\n  op?: SetComparisonOperator;\n  relation: string;\n  records: RI[];\n}\n\nexport type FilterParam<RI = RecordIdentity> =\n  | FilterSpecifier\n  | AttributeFilterParam\n  | RelatedRecordFilterParam<RI>\n  | RelatedRecordsFilterParam<RI>;\n\nfunction isFilterSpecifier<RI = RecordIdentity>(\n  param: FilterParam<RI>\n): param is FilterSpecifier {\n  return (param as FilterSpecifier).kind !== undefined;\n}\n\nfunction isAttributeFilterParam<RI = RecordIdentity>(\n  param: FilterParam<RI>\n): param is AttributeFilterParam {\n  return (param as AttributeFilterParam).attribute !== undefined;\n}\n\nfunction isRelatedRecordFilterParam<RI = RecordIdentity>(\n  param: FilterParam<RI>\n): param is RelatedRecordFilterParam<RI> {\n  return (\n    (param as RelatedRecordFilterParam<RI>).relation !== undefined &&\n    (param as RelatedRecordFilterParam<RI>).record !== undefined\n  );\n}\n\nfunction isRelatedRecordsFilterParam<RI = RecordIdentity>(\n  param: FilterParam<RI>\n): param is RelatedRecordsFilterParam<RI> {\n  return (\n    (param as RelatedRecordsFilterParam<RI>).relation !== undefined &&\n    (param as RelatedRecordsFilterParam<RI>).records !== undefined\n  );\n}\n\nexport class BaseRecordQueryTerm<\n  QE extends RecordQueryExpression,\n  RT = string,\n  RI = RecordIdentity\n> extends QueryTerm<QE> {\n  $queryBuilder: RecordQueryBuilder<RT, RI>;\n\n  constructor(queryBuilder: RecordQueryBuilder<RT, RI>, expression: QE) {\n    super(expression);\n    this.$queryBuilder = queryBuilder;\n  }\n\n  toQueryExpression(): QE {\n    const expression = super.toQueryExpression();\n\n    const validatorFor = this.$queryBuilder.$validatorFor;\n    if (validatorFor) {\n      const schema = this.$queryBuilder.$schema as RecordSchema;\n      const validateRecordQueryExpression = validatorFor(\n        StandardRecordValidators.RecordQueryExpression\n      ) as RecordQueryExpressionValidator;\n\n      const issues = validateRecordQueryExpression(expression, {\n        validatorFor,\n        schema\n      });\n\n      if (issues !== undefined) {\n        throw new ValidationError(\n          'Validation isssues encountered while building a query expression',\n          issues\n        );\n      }\n    }\n\n    return expression;\n  }\n}\n\n/**\n * A query term representing a single record.\n */\nexport class FindRecordTerm<\n  RT = string,\n  RI = RecordIdentity\n> extends BaseRecordQueryTerm<FindRecord, RT, RI> {\n  constructor(\n    queryBuilder: RecordQueryBuilder<RT, RI>,\n    record: RecordIdentity\n  ) {\n    super(queryBuilder, {\n      op: 'findRecord',\n      record\n    });\n  }\n}\n\nexport class FindRelatedRecordTerm<\n  RT = string,\n  RI = RecordIdentity\n> extends BaseRecordQueryTerm<FindRelatedRecord, RT, RI> {\n  constructor(\n    queryBuilder: RecordQueryBuilder<RT, RI>,\n    record: RecordIdentity,\n    relationship: string\n  ) {\n    super(queryBuilder, {\n      op: 'findRelatedRecord',\n      record,\n      relationship\n    });\n  }\n}\n\nexport class FindRecordsTerm<\n  RT = string,\n  RI = RecordIdentity\n> extends BaseRecordQueryTerm<FindRecords | FindRelatedRecords, RT, RI> {\n  /**\n   * Applies sorting to a collection query.\n   *\n   * Sort specifiers can be expressed in object form, like:\n   *\n   * ```ts\n   * { attribute: 'name', order: 'descending' }\n   * { attribute: 'name', order: 'ascending' }\n   * ```\n   *\n   * Or in string form, like:\n   *\n   * ```ts\n   * '-name' // descending order\n   * 'name'  // ascending order\n   * ```\n   */\n  sort(...params: SortParam[]): this {\n    const specifiers = params.map((p) => this.$sortParamToSpecifier(p));\n    this._expression.sort = (this._expression.sort ?? []).concat(specifiers);\n    return this;\n  }\n\n  /**\n   * Applies pagination to a collection query.\n   */\n  page(param: PageParam): this {\n    this._expression.page = this.$pageParamToSpecifier(param);\n    return this;\n  }\n\n  /**\n   * Apply a filter expression.\n   *\n   * For example:\n   *\n   * ```ts\n   * oqb\n   *   .records('planet')\n   *   .filter({ attribute: 'atmosphere', value: true },\n   *           { attribute: 'classification', value: 'terrestrial' });\n   * ```\n   */\n  filter(...params: FilterParam<RI>[]): this {\n    const specifiers = params.map((p) => this.$filterParamToSpecifier(p));\n    this._expression.filter = (this._expression.filter ?? []).concat(\n      specifiers\n    );\n    return this;\n  }\n\n  $filterParamToSpecifier(param: FilterParam<RI>): FilterSpecifier {\n    let specifier: FilterSpecifier | undefined;\n\n    if (isFilterSpecifier<RI>(param)) {\n      specifier = param;\n    } else {\n      const op = param.op ?? 'equal';\n      if (isAttributeFilterParam(param)) {\n        const { attribute, value } = param;\n        specifier = {\n          kind: 'attribute',\n          op,\n          attribute,\n          value\n        } as AttributeFilterSpecifier;\n      } else if (isRelatedRecordFilterParam<RI>(param)) {\n        const { relation } = param;\n        let record: RecordIdentity[] | RecordIdentity | null;\n        if (Array.isArray(param.record)) {\n          record = param.record.map((ri) =>\n            this.$queryBuilder.$normalizeRecordIdentity(ri)\n          );\n        } else if (param.record) {\n          record = this.$queryBuilder.$normalizeRecordIdentity(param.record);\n        } else {\n          record = null;\n        }\n        specifier = {\n          kind: 'relatedRecord',\n          op,\n          relation,\n          record\n        } as RelatedRecordFilterSpecifier;\n      } else if (isRelatedRecordsFilterParam<RI>(param)) {\n        const { relation } = param;\n        let records = param.records.map((ri) =>\n          this.$queryBuilder.$normalizeRecordIdentity(ri)\n        );\n        specifier = {\n          kind: 'relatedRecords',\n          op,\n          relation,\n          records\n        } as RelatedRecordsFilterSpecifier;\n      }\n    }\n\n    if (specifier === undefined) {\n      throw new ValidationError(\n        'Unrecognized `filter` param encountered while building query expression'\n      );\n    }\n\n    return specifier;\n  }\n\n  $pageParamToSpecifier(param: PageParam): PageSpecifier {\n    let specifier: PageSpecifier | undefined;\n\n    if (param.hasOwnProperty('offset') || param.hasOwnProperty('limit')) {\n      specifier = {\n        kind: 'offsetLimit',\n        offset: param.offset,\n        limit: param.limit\n      };\n    }\n\n    if (specifier === undefined) {\n      throw new ValidationError(\n        'Unrecognized `page` param encountered while building query expression'\n      );\n    }\n\n    return specifier;\n  }\n\n  $sortParamToSpecifier(param: SortParam): SortSpecifier {\n    let specifier: SortSpecifier | undefined;\n\n    if (isObject(param)) {\n      if (param.hasOwnProperty('kind')) {\n        specifier = param as SortSpecifier;\n      } else if (param.hasOwnProperty('attribute')) {\n        specifier = {\n          kind: 'attribute',\n          attribute: (param as AttributeSortParam).attribute,\n          order: (param as AttributeSortParam).order || 'ascending'\n        } as AttributeSortSpecifier;\n      }\n    } else if (typeof param === 'string') {\n      specifier = this.$parseSortParamString(param);\n    }\n\n    if (specifier === undefined) {\n      throw new ValidationError(\n        'Unrecognized `sort` param encountered while building query expression'\n      );\n    }\n\n    return specifier;\n  }\n\n  $parseSortParamString(sortSpecifier: string): AttributeSortSpecifier {\n    let attribute: string;\n    let order: SortOrder;\n\n    if (sortSpecifier[0] === '-') {\n      attribute = sortSpecifier.slice(1);\n      order = 'descending';\n    } else {\n      attribute = sortSpecifier;\n      order = 'ascending';\n    }\n\n    return {\n      kind: 'attribute',\n      attribute,\n      order\n    };\n  }\n}\n\nexport type RecordQueryTerm<RT = string, RI = RecordIdentity> =\n  | FindRecordTerm<RT, RI>\n  | FindRelatedRecordTerm<RT, RI>\n  | FindRecordsTerm<RT, RI>;\n","import { Orbit } from '@orbit/core';\nimport { QueryBuilderFunc } from '@orbit/data';\nimport { StandardValidator, ValidatorForFn } from '@orbit/validators';\nimport { RecordIdentity } from './record';\nimport { RecordNormalizer } from './record-normalizer';\nimport {\n  FindRecords,\n  FindRelatedRecords,\n  RecordQueryExpression\n} from './record-query-expression';\nimport {\n  FindRecordsTerm,\n  FindRecordTerm,\n  FindRelatedRecordTerm\n} from './record-query-term';\nimport { RecordSchema } from './record-schema';\nimport { StandardRecordValidator } from './record-validators/standard-record-validators';\n\nconst { assert } = Orbit;\n\nexport type RecordQueryBuilderFunc = QueryBuilderFunc<\n  RecordQueryExpression,\n  RecordQueryBuilder\n>;\n\nexport interface RecordQueryBuilderSettings<RT = string, RI = RecordIdentity> {\n  schema?: RecordSchema;\n  normalizer?: RecordNormalizer<RT, RI>;\n  validatorFor?: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n}\n\nexport class RecordQueryBuilder<RT = string, RI = RecordIdentity> {\n  $schema?: RecordSchema;\n  $normalizer?: RecordNormalizer<RT, RI>;\n  $validatorFor?: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n\n  constructor(settings: RecordQueryBuilderSettings<RT, RI> = {}) {\n    const { schema, normalizer, validatorFor } = settings;\n\n    if (validatorFor) {\n      assert(\n        'A RecordQueryBuilder that has been assigned a `validatorFor` requires a `schema`',\n        schema !== undefined\n      );\n    }\n\n    this.$schema = schema;\n    this.$normalizer = normalizer;\n    this.$validatorFor = validatorFor;\n  }\n\n  /**\n   * Find a record by its identity.\n   */\n  findRecord(record: RI): FindRecordTerm<RT, RI> {\n    return new FindRecordTerm(this, this.$normalizeRecordIdentity(record));\n  }\n\n  /**\n   * Find all records of a specific type.\n   *\n   * If `type` is unspecified, find all records unfiltered by type.\n   */\n  findRecords(typeOrIdentities?: RT | RI[]): FindRecordsTerm<RT, RI> {\n    const expression: FindRecords = {\n      op: 'findRecords'\n    };\n\n    if (Array.isArray(typeOrIdentities)) {\n      expression.records = typeOrIdentities.map((ri) =>\n        this.$normalizeRecordIdentity(ri)\n      );\n    } else if (typeOrIdentities !== undefined) {\n      expression.type = this.$normalizeRecordType(typeOrIdentities);\n    }\n\n    return new FindRecordsTerm(this, expression);\n  }\n\n  /**\n   * Find a record in a to-one relationship.\n   */\n  findRelatedRecord(\n    record: RI,\n    relationship: string\n  ): FindRelatedRecordTerm<RT, RI> {\n    return new FindRelatedRecordTerm(\n      this,\n      this.$normalizeRecordIdentity(record),\n      relationship\n    );\n  }\n\n  /**\n   * Find records in a to-many relationship.\n   */\n  findRelatedRecords(\n    record: RI,\n    relationship: string\n  ): FindRecordsTerm<RT, RI> {\n    const expression: FindRelatedRecords = {\n      op: 'findRelatedRecords',\n      record: this.$normalizeRecordIdentity(record),\n      relationship\n    };\n\n    return new FindRecordsTerm(this, expression);\n  }\n\n  $normalizeRecordType(rt: RT): string {\n    if (this.$normalizer !== undefined) {\n      return this.$normalizer.normalizeRecordType(rt);\n    } else {\n      return (rt as unknown) as string;\n    }\n  }\n\n  $normalizeRecordIdentity(ri: RI): RecordIdentity {\n    if (this.$normalizer !== undefined) {\n      return this.$normalizer.normalizeRecordIdentity(ri);\n    } else {\n      return (ri as unknown) as RecordIdentity;\n    }\n  }\n}\n","/* eslint-disable valid-jsdoc */\nimport { evented, Evented, fulfillAll, Orbit } from '@orbit/core';\nimport { Dict } from '@orbit/utils';\nimport { ArrayValidationOptions } from '@orbit/validators';\nimport {\n  AttributeNotDefined,\n  KeyNotDefined,\n  ModelNotDefined,\n  RelationshipNotDefined\n} from './record-exceptions';\n\nconst { uuid, deprecate } = Orbit;\n\nexport interface FieldValidationOptions {\n  required?: boolean;\n  [key: string]: unknown;\n}\n\nexport interface AttributeDefinition {\n  type?: string;\n  serialization?: Dict<unknown>;\n  deserialization?: Dict<unknown>;\n  validation?: FieldValidationOptions & {\n    notNull?: boolean;\n  };\n  meta?: Dict<unknown>;\n}\n\nexport interface HasOneRelationshipDefinition {\n  kind: 'hasOne';\n  type?: string | string[];\n  model?: string | string[];\n  inverse?: string;\n  dependent?: 'remove';\n  validation?: FieldValidationOptions & {\n    notNull?: boolean;\n  };\n  meta?: Dict<unknown>;\n}\n\nexport interface HasManyRelationshipDefinition {\n  kind: 'hasMany';\n  type?: string | string[];\n  model?: string | string[];\n  inverse?: string;\n  dependent?: 'remove';\n  validation?: FieldValidationOptions & ArrayValidationOptions;\n  meta?: Dict<unknown>;\n}\n\nexport type RelationshipDefinition =\n  | HasOneRelationshipDefinition\n  | HasManyRelationshipDefinition;\n\nexport interface KeyDefinition {\n  /**\n   * @deprecated since v0.17 - not used by any standard serializers\n   */\n  primaryKey?: boolean;\n\n  validation?: FieldValidationOptions & {\n    notNull?: boolean;\n  };\n\n  meta?: Dict<unknown>;\n}\n\nexport interface ModelDefinition {\n  keys?: Dict<KeyDefinition>;\n  attributes?: Dict<AttributeDefinition>;\n  relationships?: Dict<RelationshipDefinition>;\n}\n\n/**\n * Settings used to initialze and/or upgrade schemas.\n */\nexport interface RecordSchemaSettings {\n  /**\n   * Schema version. Defaults to 1.\n   */\n  version?: number;\n\n  /**\n   * Function used to generate record IDs.\n   */\n  generateId?: (model?: string) => string;\n\n  /**\n   * Function used to pluralize names.\n   *\n   * @deprecated\n   */\n  pluralize?: (word: string) => string;\n\n  /**\n   * Function used to singularize names.\n   *\n   * @deprecated\n   */\n  singularize?: (word: string) => string;\n\n  /**\n   * Map of model definitions.\n   */\n  models?: Dict<ModelDefinition>;\n}\n\nexport type RecordSchemaEvent = 'upgrade';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface RecordSchema extends Evented<RecordSchemaEvent> {}\n\n/**\n * A `Schema` defines the models allowed in a source, including their keys,\n * attributes, and relationships. A single schema may be shared across multiple\n * sources.\n */\n@evented\nexport class RecordSchema {\n  private _models!: Dict<ModelDefinition>;\n  private _version!: number;\n\n  constructor(settings: RecordSchemaSettings = {}) {\n    if (settings.version === undefined) {\n      settings.version = 1;\n    }\n\n    if (settings.models === undefined) {\n      settings.models = {};\n    }\n\n    this._applySettings(settings);\n  }\n\n  /**\n   * Version\n   */\n  get version(): number {\n    return this._version;\n  }\n\n  /**\n   * Upgrades Schema to a new version with new settings.\n   *\n   * Emits the `upgrade` event to cue sources to upgrade their data.\n   */\n  async upgrade(settings: RecordSchemaSettings = {}): Promise<void> {\n    if (settings.version === undefined) {\n      settings.version = this._version + 1;\n    }\n    this._applySettings(settings);\n    await fulfillAll(this as Evented, 'upgrade', this._version);\n  }\n\n  /**\n   * Registers a complete set of settings\n   */\n  protected _applySettings(settings: RecordSchemaSettings): void {\n    // Version\n    if (settings.version !== undefined) {\n      this._version = settings.version;\n    }\n\n    // Allow overrides\n    if (settings.generateId) {\n      this.generateId = settings.generateId;\n    }\n    if (settings.pluralize) {\n      deprecate(\n        'Schema#pluralize has been deprecated. Use inflectors from in @orbit/serializers instead.'\n      );\n      this.pluralize = settings.pluralize;\n    }\n    if (settings.singularize) {\n      deprecate(\n        'Schema#singularize has been deprecated. Use inflectors from @orbit/serializers instead.'\n      );\n      this.singularize = settings.singularize;\n    }\n\n    // Register model schemas\n    if (settings.models) {\n      this._deprecateRelationshipModel(settings.models);\n      this._models = settings.models;\n    }\n  }\n\n  /**\n   * Generate an id for a given model type.\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  generateId(type?: string): string {\n    return uuid();\n  }\n\n  /**\n   * A naive pluralization method.\n   *\n   * Deprecated in favor of inflectors now in @orbit/serializers\n   *\n   * @deprecated since v0.17, remove in v0.18\n   */\n  pluralize(word: string): string {\n    deprecate(\n      'Schema#pluralize has been deprecated. Use inflectors from @orbit/serializers instead.'\n    );\n    return word + 's';\n  }\n\n  /**\n   * A naive singularization method.\n   *\n   * Deprecated in favor of inflectors now in @orbit/serializers\n   *\n   * @deprecated since v0.17, remove in v0.18\n   */\n  singularize(word: string): string {\n    deprecate(\n      'Schema#singularize has been deprecated. Use inflectors from @orbit/serializers instead.'\n    );\n    if (word.lastIndexOf('s') === word.length - 1) {\n      return word.substr(0, word.length - 1);\n    } else {\n      console.warn(\n        `Orbit's built-in naive singularization rules cannot singularize ${word}. Pass singularize & pluralize functions to Schema to customize.`\n      );\n      return word;\n    }\n  }\n\n  get models(): Dict<ModelDefinition> {\n    return this._models;\n  }\n\n  getModel(type: string): ModelDefinition {\n    const model = this.models[type];\n    if (model) {\n      return model;\n    } else {\n      throw new ModelNotDefined(type);\n    }\n  }\n\n  getAttribute(type: string, attribute: string): AttributeDefinition {\n    const model = this.getModel(type);\n    const attributeDef = model.attributes?.[attribute];\n    if (attributeDef) {\n      return attributeDef;\n    } else {\n      throw new AttributeNotDefined(type, attribute);\n    }\n  }\n\n  getKey(type: string, key: string): KeyDefinition {\n    const model = this.getModel(type);\n    const keyDef = model.keys?.[key];\n    if (keyDef) {\n      return keyDef;\n    } else {\n      throw new KeyNotDefined(type, key);\n    }\n  }\n\n  getRelationship(type: string, relationship: string): RelationshipDefinition {\n    const model = this.getModel(type);\n    const relationshipDef = model.relationships?.[relationship];\n    if (relationshipDef) {\n      return relationshipDef;\n    } else {\n      throw new RelationshipNotDefined(type, relationship);\n    }\n  }\n\n  hasModel(type: string): boolean {\n    return this.models[type] !== undefined;\n  }\n\n  hasAttribute(type: string, attribute: string): boolean {\n    return this.models[type]?.attributes?.[attribute] !== undefined;\n  }\n\n  hasKey(type: string, key: string): boolean {\n    return this.models[type]?.keys?.[key] !== undefined;\n  }\n\n  hasRelationship(type: string, relationship: string): boolean {\n    return this.models[type]?.relationships?.[relationship] !== undefined;\n  }\n\n  eachAttribute(\n    type: string,\n    callbackFn: (name: string, attribute: AttributeDefinition) => void\n  ): void {\n    const model = this.getModel(type);\n    const attributes = model.attributes || {};\n    for (let name in attributes) {\n      callbackFn(name, attributes[name]);\n    }\n  }\n\n  eachKey(\n    type: string,\n    callbackFn: (name: string, key: KeyDefinition) => void\n  ): void {\n    const model = this.getModel(type);\n    const keys = model.keys || {};\n    for (let name in keys) {\n      callbackFn(name, keys[name]);\n    }\n  }\n\n  eachRelationship(\n    type: string,\n    callbackFn: (name: string, relationship: RelationshipDefinition) => void\n  ): void {\n    const model = this.getModel(type);\n    const relationships = model.relationships || {};\n    for (let name in relationships) {\n      callbackFn(name, relationships[name]);\n    }\n  }\n\n  _deprecateRelationshipModel(models: Dict<ModelDefinition>): void {\n    for (let type in models) {\n      if (models[type].relationships) {\n        let relationships = models[type]\n          .relationships as Dict<RelationshipDefinition>;\n        for (let name in relationships) {\n          let relationship = relationships[name];\n          if (relationship.model) {\n            deprecate(\n              'RelationshipDefinition.model is deprecated, use `type` and `kind` instead.'\n            );\n          }\n        }\n      }\n    }\n  }\n}\n","import { Orbit } from '@orbit/core';\nimport { TransformBuilderFunc } from '@orbit/data';\nimport { StandardValidator, ValidatorForFn } from '@orbit/validators';\nimport {\n  InitializedRecord,\n  RecordIdentity,\n  RecordInitializer,\n  UninitializedRecord\n} from './record';\nimport { RecordNormalizer } from './record-normalizer';\nimport { RecordOperation } from './record-operation';\nimport {\n  AddRecordTerm,\n  AddToRelatedRecordsTerm,\n  RemoveFromRelatedRecordsTerm,\n  RemoveRecordTerm,\n  ReplaceAttributeTerm,\n  ReplaceKeyTerm,\n  ReplaceRelatedRecordsTerm,\n  ReplaceRelatedRecordTerm,\n  UpdateRecordTerm\n} from './record-operation-term';\nimport { RecordSchema } from './record-schema';\nimport { StandardRecordValidator } from './record-validators/standard-record-validators';\n\nconst { assert, deprecate } = Orbit;\n\nexport type RecordTransformBuilderFunc = TransformBuilderFunc<\n  RecordOperation,\n  RecordTransformBuilder\n>;\n\nexport interface RecordTransformBuilderSettings<\n  RT = string,\n  RI = RecordIdentity,\n  R = UninitializedRecord\n> {\n  /**\n   * @deprecated since v0.17, replaced by `recordNormalizer`\n   */\n  recordInitializer?: RecordInitializer;\n\n  schema?: RecordSchema;\n  normalizer?: RecordNormalizer<RT, RI, R>;\n  validatorFor?: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n}\n\nexport class RecordTransformBuilder<\n  RT = string,\n  RI = RecordIdentity,\n  R = UninitializedRecord\n> {\n  $schema?: RecordSchema;\n  $normalizer?: RecordNormalizer<RT, RI, R>;\n  $validatorFor?: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n\n  constructor(settings: RecordTransformBuilderSettings<RT, RI, R> = {}) {\n    const { schema, normalizer, validatorFor, recordInitializer } = settings;\n\n    if (validatorFor) {\n      assert(\n        'A RecordTransformBuilder that has been assigned a `validatorFor` requires a `schema`',\n        schema !== undefined\n      );\n    }\n\n    this.$schema = schema;\n    this.$normalizer = normalizer;\n    this.$validatorFor = validatorFor;\n\n    if (recordInitializer) {\n      if (this.$normalizer !== undefined) {\n        deprecate(\n          'A `normalizer` and `recordInitializer` have both been assigned to the `TransformBuilder`. Only the `normalizer` will be used.'\n        );\n      } else {\n        deprecate(\n          'A `recordInitializer` has been assigned to the `TransformBuilder`. The `recordInitializer` setting has been deprecated in favor of `normalizer`, and will be treated as if it were a `RecordNormalizer`.'\n        );\n        this.$normalizer = {\n          normalizeRecordType(type: RT): string {\n            return (type as unknown) as string;\n          },\n          normalizeRecord(record: R) {\n            return recordInitializer.initializeRecord(\n              (record as unknown) as UninitializedRecord\n            );\n          },\n          normalizeRecordIdentity(recordIdentity: RI) {\n            return (recordIdentity as unknown) as RecordIdentity;\n          }\n        };\n      }\n    }\n  }\n\n  /**\n   * Instantiate a new `addRecord` operation.\n   */\n  addRecord(record: R): AddRecordTerm<RT, RI, R> {\n    return new AddRecordTerm(this, this.$normalizeRecord(record));\n  }\n\n  /**\n   * Instantiate a new `updateRecord` operation.\n   */\n  updateRecord(record: R): UpdateRecordTerm<RT, RI, R> {\n    return new UpdateRecordTerm(this, this.$normalizeRecord(record));\n  }\n\n  /**\n   * Instantiate a new `removeRecord` operation.\n   */\n  removeRecord(record: RI): RemoveRecordTerm<RT, RI, R> {\n    return new RemoveRecordTerm(this, this.$normalizeRecordIdentity(record));\n  }\n\n  /**\n   * Instantiate a new `replaceKey` operation.\n   */\n  replaceKey(\n    record: RI,\n    key: string,\n    value: string\n  ): ReplaceKeyTerm<RT, RI, R> {\n    return new ReplaceKeyTerm(\n      this,\n      this.$normalizeRecordIdentity(record),\n      key,\n      value\n    );\n  }\n\n  /**\n   * Instantiate a new `replaceAttribute` operation.\n   */\n  replaceAttribute(\n    record: RI,\n    attribute: string,\n    value: unknown\n  ): ReplaceAttributeTerm<RT, RI, R> {\n    return new ReplaceAttributeTerm(\n      this,\n      this.$normalizeRecordIdentity(record),\n      attribute,\n      value\n    );\n  }\n\n  /**\n   * Instantiate a new `addToRelatedRecords` operation.\n   */\n  addToRelatedRecords(\n    record: RI,\n    relationship: string,\n    relatedRecord: RI\n  ): AddToRelatedRecordsTerm<RT, RI, R> {\n    return new AddToRelatedRecordsTerm(\n      this,\n      this.$normalizeRecordIdentity(record),\n      relationship,\n      this.$normalizeRecordIdentity(relatedRecord)\n    );\n  }\n\n  /**\n   * Instantiate a new `removeFromRelatedRecords` operation.\n   */\n  removeFromRelatedRecords(\n    record: RI,\n    relationship: string,\n    relatedRecord: RI\n  ): RemoveFromRelatedRecordsTerm<RT, RI, R> {\n    return new RemoveFromRelatedRecordsTerm(\n      this,\n      this.$normalizeRecordIdentity(record),\n      relationship,\n      this.$normalizeRecordIdentity(relatedRecord)\n    );\n  }\n\n  /**\n   * Instantiate a new `replaceRelatedRecords` operation.\n   */\n  replaceRelatedRecords(\n    record: RI,\n    relationship: string,\n    relatedRecords: RI[]\n  ): ReplaceRelatedRecordsTerm<RT, RI, R> {\n    return new ReplaceRelatedRecordsTerm(\n      this,\n      this.$normalizeRecordIdentity(record),\n      relationship,\n      relatedRecords.map((ri) => this.$normalizeRecordIdentity(ri))\n    );\n  }\n\n  /**\n   * Instantiate a new `replaceRelatedRecord` operation.\n   */\n  replaceRelatedRecord(\n    record: RI,\n    relationship: string,\n    relatedRecord: RI | null\n  ): ReplaceRelatedRecordTerm<RT, RI, R> {\n    return new ReplaceRelatedRecordTerm(\n      this,\n      this.$normalizeRecordIdentity(record),\n      relationship,\n      relatedRecord ? this.$normalizeRecordIdentity(relatedRecord) : null\n    );\n  }\n\n  $normalizeRecord(r: R): InitializedRecord {\n    if (this.$normalizer) {\n      return this.$normalizer.normalizeRecord(r);\n    } else {\n      return (r as unknown) as InitializedRecord;\n    }\n  }\n\n  $normalizeRecordIdentity(ri: RI): RecordIdentity {\n    if (this.$normalizer !== undefined) {\n      return this.$normalizer.normalizeRecordIdentity(ri);\n    } else {\n      return (ri as unknown) as RecordIdentity;\n    }\n  }\n}\n","import { Assertion } from '@orbit/core';\nimport {\n  StandardValidator,\n  ValidationIssue,\n  Validator,\n  ValidatorForFn\n} from '@orbit/validators';\nimport { RecordIdentity } from '../record';\nimport { AttributeDefinition, RecordSchema } from '../record-schema';\nimport {\n  RecordFieldDefinitionIssue,\n  RecordFieldDefinitionValidator\n} from './record-field-definition-validator';\nimport {\n  StandardRecordValidators,\n  StandardRecordValidator\n} from './standard-record-validators';\n\ninterface BaseIssue extends ValidationIssue {\n  validator: StandardRecordValidators.RecordAttribute;\n  ref: {\n    record: RecordIdentity;\n    attribute: string;\n    value?: unknown;\n  };\n}\n\ninterface TypeIssue extends BaseIssue {\n  validation: 'type';\n}\n\ninterface ValueRequiredIssue extends BaseIssue {\n  validation: 'valueRequired';\n}\n\ninterface ValueNotNullIssue extends BaseIssue {\n  validation: 'valueNotNull';\n}\n\ninterface ValueValidIssue extends BaseIssue {\n  validation: 'valueValid';\n  details: ValidationIssue[];\n}\n\nexport interface RecordAttributeInput {\n  record: RecordIdentity;\n  attribute: string;\n  value: unknown;\n}\n\nexport type RecordAttributeValidationIssue =\n  | TypeIssue\n  | RecordFieldDefinitionIssue\n  | ValueRequiredIssue\n  | ValueNotNullIssue\n  | ValueValidIssue;\n\nexport interface RecordAttributeValidationOptions {\n  validatorFor: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n  schema?: RecordSchema;\n  attributeDef?: AttributeDefinition;\n}\n\nexport type RecordAttributeValidator = Validator<\n  RecordAttributeInput,\n  RecordAttributeValidationOptions,\n  RecordAttributeValidationIssue\n>;\n\nexport const validateRecordAttribute: RecordAttributeValidator = (\n  input: RecordAttributeInput,\n  options?: RecordAttributeValidationOptions\n): undefined | RecordAttributeValidationIssue[] => {\n  if (options?.validatorFor === undefined) {\n    throw new Assertion('validateRecordAttribute requires a `validatorFor`');\n  }\n\n  const { record, attribute, value } = input;\n  const { type } = record;\n  const { validatorFor, schema } = options;\n  let { attributeDef } = options;\n\n  // Validate attribute definition, if one is not provided\n  if (attributeDef === undefined) {\n    if (schema === undefined) {\n      throw new Assertion(\n        'validateRecordAttribute requires either a `schema` or `attributeDef`'\n      );\n    }\n\n    const validateRecordFieldDefinition = validatorFor(\n      StandardRecordValidators.RecordFieldDefinition\n    ) as RecordFieldDefinitionValidator;\n\n    const defIssues = validateRecordFieldDefinition(\n      { kind: 'attribute', type, field: attribute },\n      { schema }\n    );\n    if (defIssues) return defIssues;\n\n    attributeDef = schema.getAttribute(type, attribute);\n  }\n\n  // Validate value\n  if (value === undefined) {\n    if (attributeDef.validation?.required) {\n      return [\n        {\n          validator: StandardRecordValidators.RecordAttribute,\n          validation: 'valueRequired',\n          description: 'value is required',\n          ref: {\n            record,\n            attribute,\n            value\n          }\n        }\n      ];\n    }\n  } else if (value === null) {\n    if (attributeDef.validation?.notNull) {\n      return [\n        {\n          validator: StandardRecordValidators.RecordAttribute,\n          validation: 'valueNotNull',\n          description: 'value can not be null',\n          ref: {\n            record,\n            attribute,\n            value\n          }\n        }\n      ];\n    }\n  } else if (attributeDef.type) {\n    const validateRecordValue = validatorFor(attributeDef.type) as Validator;\n\n    if (validateRecordValue === undefined) {\n      return [\n        {\n          validator: StandardRecordValidators.RecordAttribute,\n          ref: {\n            record,\n            attribute,\n            value\n          },\n          validation: 'type',\n          description: `validator has not been provided for attribute '${attribute}' of \\`type\\` '${attributeDef.type}'`\n        }\n      ];\n    } else {\n      const valueIssues = validateRecordValue(value, attributeDef.validation);\n      if (valueIssues) {\n        return [\n          {\n            validator: StandardRecordValidators.RecordAttribute,\n            ref: {\n              record,\n              attribute,\n              value\n            },\n            validation: 'valueValid',\n            description: 'value is invalid',\n            details: valueIssues\n          }\n        ];\n      }\n    }\n  }\n};\n","import { Assertion } from '@orbit/core';\nimport { ValidationIssue, Validator } from '@orbit/validators';\nimport { RecordSchema } from '../record-schema';\nimport { StandardRecordValidators } from './standard-record-validators';\n\nexport interface RecordFieldDefinitionInput {\n  kind: 'attribute' | 'key' | 'relationship';\n  type: string;\n  field: string;\n}\n\nexport interface RecordFieldDefinitionIssue extends ValidationIssue {\n  validator: StandardRecordValidators.RecordFieldDefinition;\n  validation: 'fieldDefined';\n  ref: RecordFieldDefinitionInput;\n}\n\nexport interface RecordFieldDefinitionValidationOptions {\n  schema: RecordSchema;\n}\n\nexport type RecordFieldDefinitionValidator = Validator<\n  RecordFieldDefinitionInput,\n  RecordFieldDefinitionValidationOptions,\n  RecordFieldDefinitionIssue\n>;\n\nexport const validateRecordFieldDefinition: RecordFieldDefinitionValidator = (\n  input: RecordFieldDefinitionInput,\n  options?: RecordFieldDefinitionValidationOptions\n): undefined | RecordFieldDefinitionIssue[] => {\n  if (options?.schema === undefined) {\n    throw new Assertion('validateRecordFieldDefinition requires a `schema`');\n  }\n\n  const { schema } = options;\n  const { kind, type, field } = input;\n\n  if (\n    !(\n      (kind === 'attribute' && schema.hasAttribute(type, field)) ||\n      (kind === 'key' && schema.hasKey(type, field)) ||\n      (kind === 'relationship' && schema.hasRelationship(type, field))\n    )\n  ) {\n    return [\n      {\n        validator: StandardRecordValidators.RecordFieldDefinition,\n        validation: 'fieldDefined',\n        ref: input,\n        description: `${kind} '${field}' for type '${type}' is not defined in schema`\n      }\n    ];\n  }\n};\n","import { Assertion } from '@orbit/core';\nimport {\n  StandardValidator,\n  ValidationIssue,\n  Validator,\n  ValidatorForFn\n} from '@orbit/validators';\nimport { RecordIdentity } from '../record';\nimport { ModelDefinition, RecordSchema } from '../record-schema';\nimport {\n  RecordTypeValidationIssue,\n  RecordTypeValidator\n} from './record-type-validator';\nimport {\n  StandardRecordValidator,\n  StandardRecordValidators\n} from './standard-record-validators';\n\ninterface BaseIssue extends ValidationIssue {\n  validator: StandardRecordValidators.RecordIdentity;\n  ref: RecordIdentity;\n}\n\ninterface TypeIssue extends BaseIssue {\n  validation: 'type';\n}\n\nexport type RecordIdentityValidationIssue =\n  | TypeIssue\n  | RecordTypeValidationIssue;\n\nexport interface RecordIdentityValidationOptions {\n  validatorFor: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n  schema?: RecordSchema;\n  modelDef?: ModelDefinition;\n}\n\nexport type RecordIdentityValidator = Validator<\n  RecordIdentity,\n  RecordIdentityValidationOptions,\n  RecordIdentityValidationIssue\n>;\n\nexport const validateRecordIdentity: RecordIdentityValidator = (\n  record: RecordIdentity,\n  options?: RecordIdentityValidationOptions\n): undefined | RecordIdentityValidationIssue[] => {\n  const { type, id } = record;\n\n  if (typeof type !== 'string' || typeof id !== 'string') {\n    return [\n      {\n        validator: StandardRecordValidators.RecordIdentity,\n        validation: 'type',\n        ref: record,\n        description:\n          'Record identities must be in the form `{ type, id }`, with string values for both `type` and `id`.'\n      }\n    ];\n  }\n\n  // Only check type if a `modelDef` has not been provided\n  if (options?.modelDef === undefined) {\n    if (options?.validatorFor === undefined || options?.schema === undefined) {\n      throw new Assertion(\n        'validateRecordIdentity requires either a `modelDef` or both a `validatorFor` and a `schema`'\n      );\n    }\n    const { validatorFor, schema } = options;\n\n    const validateRecordType = validatorFor(\n      StandardRecordValidators.RecordType\n    ) as RecordTypeValidator;\n\n    return validateRecordType(type, { schema });\n  }\n};\n","import { Assertion } from '@orbit/core';\nimport {\n  StandardValidator,\n  ValidationIssue,\n  Validator,\n  ValidatorForFn\n} from '@orbit/validators';\nimport { RecordIdentity } from '../record';\nimport { KeyDefinition, RecordSchema } from '../record-schema';\nimport {\n  RecordFieldDefinitionIssue,\n  RecordFieldDefinitionValidator\n} from './record-field-definition-validator';\nimport {\n  StandardRecordValidator,\n  StandardRecordValidators\n} from './standard-record-validators';\n\ninterface BaseIssue extends ValidationIssue {\n  validator: StandardRecordValidators.RecordKey;\n  ref: {\n    record: RecordIdentity;\n    key: string;\n    value?: unknown;\n  };\n}\n\ninterface ValueRequiredIssue extends BaseIssue {\n  validation: 'valueRequired';\n}\n\ninterface ValueNotNullIssue extends BaseIssue {\n  validation: 'valueNotNull';\n}\n\ninterface ValueValidIssue extends BaseIssue {\n  validation: 'valueValid';\n}\n\nexport interface RecordKeyInput {\n  record: RecordIdentity;\n  key: string;\n  value: string;\n}\n\nexport type RecordKeyValidationIssue =\n  | RecordFieldDefinitionIssue\n  | ValueRequiredIssue\n  | ValueNotNullIssue\n  | ValueValidIssue;\n\nexport interface RecordKeyValidationOptions {\n  validatorFor: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n  schema?: RecordSchema;\n  keyDef?: KeyDefinition;\n}\n\nexport type RecordKeyValidator = Validator<\n  RecordKeyInput,\n  RecordKeyValidationOptions,\n  RecordKeyValidationIssue\n>;\n\nexport const validateRecordKey: RecordKeyValidator = (\n  input: RecordKeyInput,\n  options?: RecordKeyValidationOptions\n): undefined | RecordKeyValidationIssue[] => {\n  if (options?.validatorFor === undefined) {\n    throw new Assertion('validateRecordKey requires a `validatorFor`');\n  }\n\n  const { record, key, value } = input;\n  const { type } = record;\n  const { validatorFor, schema } = options;\n  let { keyDef } = options;\n\n  // Validate key definition, if one is not provided\n  if (keyDef === undefined) {\n    if (schema === undefined) {\n      throw new Assertion(\n        'validateRecordKey requires either a `schema` or `keyDef`'\n      );\n    }\n\n    const validateRecordFieldDefinition = validatorFor(\n      StandardRecordValidators.RecordFieldDefinition\n    ) as RecordFieldDefinitionValidator;\n\n    const defIssues = validateRecordFieldDefinition(\n      { kind: 'key', type, field: key },\n      { schema }\n    );\n    if (defIssues) return defIssues;\n\n    keyDef = schema.getKey(type, key);\n  }\n\n  // Validate value\n  if (value === undefined) {\n    if (keyDef.validation?.required) {\n      return [\n        {\n          validator: StandardRecordValidators.RecordKey,\n          validation: 'valueRequired',\n          description: 'value is required',\n          ref: {\n            record,\n            key,\n            value\n          }\n        }\n      ];\n    }\n  } else if (value === null) {\n    if (keyDef.validation?.notNull) {\n      return [\n        {\n          validator: StandardRecordValidators.RecordKey,\n          validation: 'valueNotNull',\n          description: 'value can not be null',\n          ref: {\n            record,\n            key,\n            value\n          }\n        }\n      ];\n    }\n  } else if (typeof value !== 'string') {\n    return [\n      {\n        validator: StandardRecordValidators.RecordKey,\n        ref: {\n          record,\n          key,\n          value\n        },\n        validation: 'valueValid',\n        description: 'value is invalid'\n      }\n    ];\n  }\n};\n","import { Assertion } from '@orbit/core';\nimport {\n  formatValidationDescription,\n  StandardValidator,\n  ValidationIssue,\n  Validator,\n  ValidatorForFn\n} from '@orbit/validators';\nimport { RecordOperation } from '../record-operation';\nimport { RecordSchema } from '../record-schema';\nimport { RecordAttributeValidator } from './record-attribute-validator';\nimport { RecordIdentityValidator } from './record-identity-validator';\nimport { RecordKeyValidator } from './record-key-validator';\nimport { RecordRelationshipValidator } from './record-relationship-validator';\nimport { RecordValidationIssue, RecordValidator } from './record-validator';\nimport {\n  RelatedRecordValidationIssue,\n  RelatedRecordValidator\n} from './related-record-validator';\nimport {\n  StandardRecordValidator,\n  StandardRecordValidators\n} from './standard-record-validators';\n\nexport interface RecordOperationValidationOptions {\n  validatorFor: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n  schema: RecordSchema;\n}\n\ninterface BaseIssue extends ValidationIssue {\n  validator: StandardRecordValidators.RecordOperation;\n  ref: RecordOperation;\n}\n\ninterface OperationAllowedIssue extends BaseIssue {\n  validation: 'operationAllowed';\n}\n\ninterface OperationValidIssue extends BaseIssue {\n  validation: 'operationValid';\n  details: (RecordValidationIssue | RelatedRecordValidationIssue)[];\n}\n\nexport type RecordOperationValidationIssue =\n  | OperationAllowedIssue\n  | OperationValidIssue;\n\nexport type RecordOperationValidator = Validator<\n  RecordOperation,\n  RecordOperationValidationOptions,\n  RecordOperationValidationIssue\n>;\n\nexport const validateRecordOperation: RecordOperationValidator = (\n  operation: RecordOperation,\n  options?: {\n    schema: RecordSchema;\n    validatorFor: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n  }\n): undefined | RecordOperationValidationIssue[] => {\n  if (options?.validatorFor === undefined || options?.schema === undefined) {\n    throw new Assertion(\n      'validateRecordOperation requires both a `validationFor` and a `schema`.'\n    );\n  }\n\n  const { schema, validatorFor } = options;\n  let issues;\n\n  switch (operation.op) {\n    case 'addRecord':\n      issues = (validatorFor(\n        StandardRecordValidators.Record\n      ) as RecordValidator)(operation.record, { schema, validatorFor });\n      break;\n\n    case 'updateRecord':\n      issues = (validatorFor(\n        StandardRecordValidators.Record\n      ) as RecordValidator)(operation.record, {\n        schema,\n        validatorFor,\n        partialRecord: true\n      });\n      break;\n\n    case 'removeRecord':\n      issues = (validatorFor(\n        StandardRecordValidators.RecordIdentity\n      ) as RecordIdentityValidator)(operation.record, { schema, validatorFor });\n      break;\n\n    case 'replaceKey':\n      issues = (validatorFor(\n        StandardRecordValidators.RecordKey\n      ) as RecordKeyValidator)(operation, { schema, validatorFor });\n      break;\n\n    case 'replaceAttribute':\n      issues = (validatorFor(\n        StandardRecordValidators.RecordAttribute\n      ) as RecordAttributeValidator)(operation, { schema, validatorFor });\n      break;\n\n    case 'addToRelatedRecords':\n      issues = (validatorFor(\n        StandardRecordValidators.RelatedRecord\n      ) as RelatedRecordValidator)(operation, { schema, validatorFor });\n      break;\n\n    case 'removeFromRelatedRecords':\n      issues = (validatorFor(\n        StandardRecordValidators.RelatedRecord\n      ) as RelatedRecordValidator)(operation, { schema, validatorFor });\n      break;\n\n    case 'replaceRelatedRecords':\n      issues = (validatorFor(\n        StandardRecordValidators.RecordRelationship\n      ) as RecordRelationshipValidator)(\n        {\n          record: operation.record,\n          relationship: operation.relationship,\n          data: operation.relatedRecords\n        },\n        { schema, validatorFor }\n      );\n      break;\n\n    case 'replaceRelatedRecord':\n      issues = (validatorFor(\n        StandardRecordValidators.RecordRelationship\n      ) as RecordRelationshipValidator)(\n        {\n          record: operation.record,\n          relationship: operation.relationship,\n          data: operation.relatedRecord\n        },\n        { schema, validatorFor }\n      );\n      break;\n\n    default:\n      return [\n        {\n          validator: StandardRecordValidators.RecordOperation,\n          validation: 'operationAllowed',\n          ref: operation,\n          description: `record operation '${\n            (operation as any).op\n          }' is not recognized`\n        }\n      ];\n  }\n\n  if (issues !== undefined) {\n    return [\n      {\n        validator: StandardRecordValidators.RecordOperation,\n        validation: 'operationValid',\n        ref: operation,\n        details: issues,\n        description: formatValidationDescription(\n          'record operation is invalid',\n          issues\n        )\n      }\n    ];\n  }\n};\n","import { Assertion } from '@orbit/core';\nimport {\n  ArrayValidator,\n  formatValidationDescription,\n  StandardValidator,\n  StandardValidators,\n  ValidationIssue,\n  Validator,\n  ValidatorForFn\n} from '@orbit/validators';\nimport { RecordIdentity } from '../record';\nimport { RecordSchema, RelationshipDefinition } from '../record-schema';\nimport {\n  RecordFieldDefinitionIssue,\n  RecordFieldDefinitionValidator\n} from './record-field-definition-validator';\nimport { RelatedRecordValidator } from './related-record-validator';\nimport {\n  StandardRecordValidator,\n  StandardRecordValidators\n} from './standard-record-validators';\n\ninterface BaseIssue extends ValidationIssue {\n  validator: StandardRecordValidators.RecordRelationship;\n  ref: {\n    record: RecordIdentity;\n    relationship: string;\n    data?: RecordIdentity[] | RecordIdentity | null;\n  };\n}\n\ninterface RequiredIssue extends BaseIssue {\n  validation: 'dataRequired';\n}\n\ninterface NotNullIssue extends BaseIssue {\n  validation: 'dataNotNull';\n}\n\ninterface DataValidIssue extends BaseIssue {\n  validation: 'dataValid';\n  details?: ValidationIssue[];\n}\n\nexport interface RecordRelationshipInput {\n  record: RecordIdentity;\n  relationship: string;\n  data: RecordIdentity[] | RecordIdentity | null;\n}\n\nexport type RecordRelationshipValidationIssue =\n  | RecordFieldDefinitionIssue\n  | RequiredIssue\n  | NotNullIssue\n  | DataValidIssue;\n\nexport interface RecordRelationshipValidationOptions {\n  validatorFor: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n  schema: RecordSchema;\n  relationshipDef?: RelationshipDefinition;\n}\n\nexport type RecordRelationshipValidator = Validator<\n  RecordRelationshipInput,\n  RecordRelationshipValidationOptions,\n  RecordRelationshipValidationIssue\n>;\n\nexport const validateRecordRelationship: RecordRelationshipValidator = (\n  input: RecordRelationshipInput,\n  options?: RecordRelationshipValidationOptions\n): undefined | RecordRelationshipValidationIssue[] => {\n  if (options?.validatorFor === undefined || options?.schema === undefined) {\n    throw new Assertion(\n      'validateRecordRelationship requires both a `validatorFor` and `schema`'\n    );\n  }\n\n  const { record, relationship, data } = input;\n  const { type } = record;\n  const { validatorFor, schema } = options;\n  let { relationshipDef } = options;\n\n  // Validate relationship definition, if one is not provided\n  if (relationshipDef === undefined) {\n    const validateRecordFieldDefinition = validatorFor(\n      StandardRecordValidators.RecordFieldDefinition\n    ) as RecordFieldDefinitionValidator;\n\n    const defIssues = validateRecordFieldDefinition(\n      { kind: 'relationship', type, field: relationship },\n      { schema }\n    );\n    if (defIssues) return defIssues;\n\n    relationshipDef = schema.getRelationship(type, relationship);\n  }\n\n  // Validate data\n  if (data === undefined) {\n    if (relationshipDef.validation?.required) {\n      return [\n        {\n          validator: StandardRecordValidators.RecordRelationship,\n          validation: 'dataRequired',\n          description: 'data is required',\n          ref: {\n            record,\n            relationship,\n            data\n          }\n        }\n      ];\n    }\n  } else {\n    const dataIssues: ValidationIssue[] = [];\n\n    const validateRelatedRecord = validatorFor(\n      StandardRecordValidators.RelatedRecord\n    ) as RelatedRecordValidator;\n\n    if (relationshipDef.kind === 'hasMany') {\n      if (!Array.isArray(data)) {\n        return [\n          {\n            validator: StandardRecordValidators.RecordRelationship,\n            ref: {\n              record,\n              relationship,\n              data\n            },\n            validation: 'dataValid',\n            description: 'data for a hasMany relationship must be an array'\n          }\n        ];\n      } else {\n        if (relationshipDef.validation) {\n          // Validate any array constraints\n          const validateArray = validatorFor(\n            StandardValidators.Array\n          ) as ArrayValidator;\n          const arrayIssues = validateArray(data, relationshipDef.validation);\n\n          if (arrayIssues) dataIssues.push(...arrayIssues);\n        }\n\n        for (let identity of data) {\n          let issues = validateRelatedRecord(\n            {\n              record,\n              relationship,\n              relatedRecord: identity\n            },\n            {\n              validatorFor,\n              schema,\n              relationshipDef\n            }\n          );\n          if (issues) dataIssues.push(...issues);\n        }\n      }\n    } else if (relationshipDef.kind === 'hasOne') {\n      if (data === null) {\n        if (relationshipDef.validation?.notNull) {\n          return [\n            {\n              validator: StandardRecordValidators.RecordRelationship,\n              validation: 'dataNotNull',\n              description: 'data can not be null',\n              ref: {\n                record,\n                relationship,\n                data\n              }\n            }\n          ];\n        }\n      } else {\n        if (Array.isArray(data)) {\n          return [\n            {\n              validator: StandardRecordValidators.RecordRelationship,\n              ref: {\n                record,\n                relationship,\n                data\n              },\n              validation: 'dataValid',\n              description: 'data for a hasOne relationship can not be an array'\n            }\n          ];\n        } else {\n          let issues = validateRelatedRecord(\n            {\n              record,\n              relationship,\n              relatedRecord: data\n            },\n            {\n              validatorFor,\n              schema,\n              relationshipDef\n            }\n          );\n          if (issues) dataIssues.push(...issues);\n        }\n      }\n    }\n\n    if (dataIssues.length > 0) {\n      return [\n        {\n          validator: StandardRecordValidators.RecordRelationship,\n          ref: {\n            record,\n            relationship,\n            data\n          },\n          validation: 'dataValid',\n          details: dataIssues,\n          description: formatValidationDescription(\n            'relationship data is invalid',\n            dataIssues\n          )\n        }\n      ];\n    }\n  }\n};\n","import { Assertion } from '@orbit/core';\nimport { ValidationIssue, Validator } from '@orbit/validators';\nimport { RecordSchema } from '../record-schema';\nimport { StandardRecordValidators } from './standard-record-validators';\n\ninterface BaseIssue extends ValidationIssue {\n  validator: StandardRecordValidators.RecordType;\n  ref: string;\n}\n\ninterface TypeIssue extends BaseIssue {\n  validation: 'type';\n}\n\ninterface RecordTypeDefined extends BaseIssue {\n  validation: 'recordTypeDefined';\n}\n\nexport type RecordTypeValidationIssue = TypeIssue | RecordTypeDefined;\n\nexport interface RecordTypeValidationOptions {\n  schema: RecordSchema;\n}\n\nexport type RecordTypeValidator = Validator<\n  string,\n  RecordTypeValidationOptions,\n  RecordTypeValidationIssue\n>;\n\nexport const validateRecordType: RecordTypeValidator = (\n  type: string,\n  options?: RecordTypeValidationOptions\n): undefined | RecordTypeValidationIssue[] => {\n  if (typeof type !== 'string') {\n    return [\n      {\n        validator: StandardRecordValidators.RecordType,\n        validation: 'type',\n        ref: type,\n        description: 'Record `type` must be a string.'\n      }\n    ];\n  } else {\n    if (options?.schema === undefined) {\n      throw new Assertion('validateRecordType requires a `schema`');\n    }\n\n    if (!options.schema.hasModel(type)) {\n      // Return early if model is not defined in schema\n      return [\n        {\n          validator: StandardRecordValidators.RecordType,\n          validation: 'recordTypeDefined',\n          ref: type,\n          description: `Record type '${type}' does not exist in schema`\n        }\n      ];\n    }\n  }\n};\n","import { Assertion } from '@orbit/core';\nimport {\n  StandardValidator,\n  Validator,\n  ValidatorForFn\n} from '@orbit/validators';\nimport { InitializedRecord } from '../record';\nimport { ModelDefinition, RecordSchema } from '../record-schema';\nimport {\n  RecordAttributeValidationIssue,\n  RecordAttributeValidator\n} from './record-attribute-validator';\nimport {\n  RecordIdentityValidationIssue,\n  RecordIdentityValidator\n} from './record-identity-validator';\nimport {\n  RecordKeyValidationIssue,\n  RecordKeyValidator\n} from './record-key-validator';\nimport {\n  RecordRelationshipValidationIssue,\n  RecordRelationshipValidator\n} from './record-relationship-validator';\nimport {\n  StandardRecordValidators,\n  StandardRecordValidator\n} from './standard-record-validators';\n\nexport type RecordValidationIssue =\n  | RecordIdentityValidationIssue\n  | RecordKeyValidationIssue\n  | RecordAttributeValidationIssue\n  | RecordRelationshipValidationIssue;\n\nexport interface RecordValidationOptions {\n  validatorFor: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n  schema: RecordSchema;\n  modelDef?: ModelDefinition;\n  partialRecord?: boolean;\n}\n\nexport type RecordValidator = Validator<\n  InitializedRecord,\n  RecordValidationOptions,\n  RecordValidationIssue\n>;\n\nexport const validateRecord: RecordValidator = (\n  record: InitializedRecord,\n  options?: RecordValidationOptions\n): undefined | RecordValidationIssue[] => {\n  if (options?.validatorFor === undefined || options?.schema === undefined) {\n    throw new Assertion(\n      'validateRecord requires both a `validatorFor` and `schema`'\n    );\n  }\n\n  const { validatorFor, schema, partialRecord } = options;\n  let { modelDef } = options;\n\n  // Validate record identity\n  const validateRecordIdentity = validatorFor(\n    StandardRecordValidators.RecordIdentity\n  ) as RecordIdentityValidator;\n  const recordIdentityIssues = validateRecordIdentity(record, {\n    validatorFor,\n    modelDef,\n    schema\n  });\n\n  // Return early if there are any identity issue\n  if (recordIdentityIssues) return recordIdentityIssues;\n\n  const { type, id } = record;\n  const issues = [];\n  modelDef ??= schema.getModel(type);\n\n  // Validate keys\n  if (record.keys || modelDef.keys) {\n    const validateKey = validatorFor(\n      StandardRecordValidators.RecordKey\n    ) as RecordKeyValidator;\n\n    if (record.keys) {\n      for (let k in record.keys) {\n        const keyDef = modelDef.keys?.[k];\n        const keyIssues = validateKey(\n          { record: { type, id }, key: k, value: record.keys[k] },\n          { schema, keyDef, validatorFor }\n        );\n        if (keyIssues) issues.push(...keyIssues);\n      }\n    }\n\n    // For records that are supposed to be \"full\" (i.e. non-partial), verify\n    // all defined keys to check if any are missing\n    if (!partialRecord && modelDef.keys) {\n      for (let k in modelDef.keys) {\n        if (record.keys?.[k] === undefined) {\n          const keyDef = modelDef.keys[k];\n          const keyIssues = validateKey(\n            { record: { type, id }, key: k, value: undefined as any },\n            { schema, keyDef, validatorFor }\n          );\n          if (keyIssues) issues.push(...keyIssues);\n        }\n      }\n    }\n  }\n\n  // Validate attributes\n  if (record.attributes || modelDef.attributes) {\n    const validateAttribute = validatorFor(\n      StandardRecordValidators.RecordAttribute\n    ) as RecordAttributeValidator;\n\n    if (record.attributes) {\n      for (let a in record.attributes) {\n        const attributeDef = modelDef.attributes?.[a];\n        const attrIssues = validateAttribute(\n          { record: { type, id }, attribute: a, value: record.attributes[a] },\n          { schema, attributeDef, validatorFor }\n        );\n        if (attrIssues) issues.push(...attrIssues);\n      }\n    }\n\n    // For records that are supposed to be \"full\" (i.e. non-partial), verify\n    // all defined attributes to check if any are missing\n    if (!partialRecord && modelDef.attributes) {\n      for (let a in modelDef.attributes) {\n        if (record.attributes?.[a] === undefined) {\n          const attributeDef = modelDef.attributes[a];\n          const attrIssues = validateAttribute(\n            { record: { type, id }, attribute: a, value: undefined },\n            { schema, attributeDef, validatorFor }\n          );\n          if (attrIssues) issues.push(...attrIssues);\n        }\n      }\n    }\n  }\n\n  // Validate relationships\n  if (record.relationships || modelDef.relationships) {\n    const validateRelationship = validatorFor(\n      StandardRecordValidators.RecordRelationship\n    ) as RecordRelationshipValidator;\n\n    if (record.relationships) {\n      for (let r in record.relationships) {\n        const relationshipDef = modelDef.relationships?.[r];\n        const relationshipIssues = validateRelationship(\n          {\n            record: { type, id },\n            relationship: r,\n            data: record.relationships[r].data as any\n          },\n          { schema, relationshipDef, validatorFor }\n        );\n        if (relationshipIssues) issues.push(...relationshipIssues);\n      }\n    }\n\n    // For records that are supposed to be \"full\" (i.e. non-partial), verify\n    // all defined relationships to check if any are missing\n    if (!partialRecord && modelDef.relationships) {\n      for (let r in modelDef.relationships) {\n        if (record.relationships?.[r] === undefined) {\n          const relationshipDef = modelDef.relationships[r];\n          const relationshipIssues = validateRelationship(\n            { record: { type, id }, relationship: r, data: undefined as any },\n            { schema, relationshipDef, validatorFor }\n          );\n          if (relationshipIssues) issues.push(...relationshipIssues);\n        }\n      }\n    }\n  }\n\n  if (issues.length > 0) return issues;\n};\n","import { Assertion } from '@orbit/core';\nimport {\n  formatValidationDescription,\n  StandardValidator,\n  ValidationIssue,\n  Validator,\n  ValidatorForFn\n} from '@orbit/validators';\nimport { RecordIdentity } from '../record';\nimport { RecordSchema, RelationshipDefinition } from '../record-schema';\nimport {\n  RecordFieldDefinitionIssue,\n  RecordFieldDefinitionValidator\n} from './record-field-definition-validator';\nimport { RecordIdentityValidator } from './record-identity-validator';\nimport {\n  StandardRecordValidator,\n  StandardRecordValidators\n} from './standard-record-validators';\n\ninterface BaseIssue extends ValidationIssue {\n  validator: StandardRecordValidators.RelatedRecord;\n  ref: {\n    record: RecordIdentity;\n    relationship: string;\n    relatedRecord?: RecordIdentity;\n  };\n}\n\ninterface RelatedRecordValidIssue extends BaseIssue {\n  validation: 'relatedRecordValid';\n  details: ValidationIssue[];\n}\n\ninterface RelatedRecordTypeIssue extends BaseIssue {\n  validation: 'relatedRecordType';\n  details: {\n    allowedTypes: string[];\n  };\n}\n\nexport interface RelatedRecordInput {\n  record: RecordIdentity;\n  relationship: string;\n  relatedRecord: RecordIdentity;\n}\n\nexport type RelatedRecordValidationIssue =\n  | RecordFieldDefinitionIssue\n  | RelatedRecordValidIssue\n  | RelatedRecordTypeIssue;\n\nexport interface RelatedRecordValidationOptions {\n  validatorFor: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n  schema: RecordSchema;\n  relationshipDef?: RelationshipDefinition;\n}\n\nexport type RelatedRecordValidator = Validator<\n  RelatedRecordInput,\n  RelatedRecordValidationOptions,\n  RelatedRecordValidationIssue\n>;\n\nexport const validateRelatedRecord: RelatedRecordValidator = (\n  input: RelatedRecordInput,\n  options?: RelatedRecordValidationOptions\n): undefined | RelatedRecordValidationIssue[] => {\n  if (options?.validatorFor === undefined || options?.schema === undefined) {\n    throw new Assertion(\n      'validateRelatedRecord requires both a `validatorFor` and `schema`'\n    );\n  }\n\n  const { record, relationship, relatedRecord } = input;\n  const { type } = record;\n  const { validatorFor, schema } = options;\n  let { relationshipDef } = options;\n\n  // Validate relationship definition, if one is not provided\n  if (relationshipDef === undefined) {\n    const validateRecordFieldDefinition = validatorFor(\n      StandardRecordValidators.RecordFieldDefinition\n    ) as RecordFieldDefinitionValidator;\n\n    const defIssues = validateRecordFieldDefinition(\n      { kind: 'relationship', type, field: relationship },\n      { schema }\n    );\n    if (defIssues) return defIssues;\n\n    relationshipDef = schema.getRelationship(type, relationship);\n  }\n\n  // Validate that relatedRecord is a valid record identity\n  const validateRecordIdentity = validatorFor(\n    StandardRecordValidators.RecordIdentity\n  ) as RecordIdentityValidator;\n  const relatedRecordIssues = validateRecordIdentity(relatedRecord, {\n    schema,\n    validatorFor\n  });\n  if (relatedRecordIssues) {\n    return [\n      {\n        validator: StandardRecordValidators.RelatedRecord,\n        validation: 'relatedRecordValid',\n        ref: {\n          record,\n          relationship,\n          relatedRecord\n        },\n        details: relatedRecordIssues,\n        description: formatValidationDescription(\n          'relatedRecord is not a valid record identity',\n          relatedRecordIssues\n        )\n      }\n    ];\n  }\n\n  // Validate that relatedRecord.type is allowed in relationship\n  const allowedType = relationshipDef.type;\n  if (allowedType) {\n    const relatedType = relatedRecord.type;\n    const allowedTypes = Array.isArray(allowedType)\n      ? allowedType\n      : [allowedType];\n    if (!allowedTypes.includes(relatedType)) {\n      return [\n        {\n          validator: StandardRecordValidators.RelatedRecord,\n          validation: 'relatedRecordType',\n          ref: {\n            record,\n            relationship,\n            relatedRecord\n          },\n          details: {\n            allowedTypes\n          },\n          description: `relatedRecord has a type '${relatedType}' which is not an allowed type for this relationship`\n        }\n      ];\n    }\n  }\n};\n","import { Dict } from '@orbit/utils';\nimport { validateRecordAttribute } from './record-attribute-validator';\nimport { validateRecordFieldDefinition } from './record-field-definition-validator';\nimport { validateRecordIdentity } from './record-identity-validator';\nimport { validateRecordKey } from './record-key-validator';\nimport { validateRecordOperation } from './record-operation-validator';\nimport { validateRecordQueryExpression } from './record-query-expression-validator';\nimport { validateRecordRelationship } from './record-relationship-validator';\nimport { validateRecordType } from './record-type-validator';\nimport { validateRecord } from './record-validator';\nimport { validateRelatedRecord } from './related-record-validator';\nimport { StandardRecordValidator } from './standard-record-validators';\n\nexport const standardRecordValidators: Dict<StandardRecordValidator> = {\n  record: validateRecord,\n  recordAttribute: validateRecordAttribute,\n  recordIdentity: validateRecordIdentity,\n  recordKey: validateRecordKey,\n  recordOperation: validateRecordOperation,\n  recordQueryExpression: validateRecordQueryExpression,\n  recordRelationship: validateRecordRelationship,\n  recordType: validateRecordType,\n  relatedRecord: validateRelatedRecord,\n  recordFieldDefinition: validateRecordFieldDefinition\n};\n","import { Assertion } from '@orbit/core';\nimport {\n  formatValidationDescription,\n  StandardValidator,\n  ValidationIssue,\n  Validator,\n  ValidatorForFn\n} from '@orbit/validators';\nimport {\n  FindRecord,\n  FindRecords,\n  FindRelatedRecord,\n  FindRelatedRecords,\n  RecordQueryExpression\n} from '../record-query-expression';\nimport { RecordSchema } from '../record-schema';\nimport { RecordFieldDefinitionValidator } from './record-field-definition-validator';\nimport { RecordIdentityValidator } from './record-identity-validator';\nimport { RecordTypeValidator } from './record-type-validator';\nimport {\n  StandardRecordValidator,\n  StandardRecordValidators\n} from './standard-record-validators';\n\nexport interface RecordQueryExpressionValidationOptions {\n  validatorFor: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n  schema: RecordSchema;\n}\n\ninterface BaseIssue extends ValidationIssue {\n  validator: StandardRecordValidators.RecordQueryExpression;\n  ref: RecordQueryExpression;\n}\n\ninterface QueryExpressionAllowedIssue extends BaseIssue {\n  validation: 'queryExpressionAllowed';\n}\n\ninterface QueryExpressionValidIssue extends BaseIssue {\n  validation: 'queryExpressionValid';\n  details: ValidationIssue[];\n}\n\nexport type RecordQueryExpressionValidationIssue =\n  | QueryExpressionAllowedIssue\n  | QueryExpressionValidIssue;\n\nexport type RecordQueryExpressionValidator = Validator<\n  RecordQueryExpression,\n  RecordQueryExpressionValidationOptions,\n  RecordQueryExpressionValidationIssue\n>;\n\nfunction validateFindRecordQueryExpression(\n  expression: FindRecord,\n  options: {\n    schema: RecordSchema;\n    validatorFor: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n  }\n): undefined | ValidationIssue[] {\n  const { schema, validatorFor } = options;\n  const validateRecordIdentity = validatorFor(\n    StandardRecordValidators.RecordIdentity\n  ) as RecordIdentityValidator;\n\n  return validateRecordIdentity(expression.record, { schema, validatorFor });\n}\n\nfunction validateFindRelatedRecordQueryExpression(\n  expression: FindRelatedRecord,\n  options: {\n    schema: RecordSchema;\n    validatorFor: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n  }\n): undefined | ValidationIssue[] {\n  const { schema, validatorFor } = options;\n  const issues: ValidationIssue[] = [];\n\n  const validateRecordIdentity = validatorFor(\n    StandardRecordValidators.RecordIdentity\n  ) as RecordIdentityValidator;\n  const recordIssues = validateRecordIdentity(expression.record, {\n    schema,\n    validatorFor\n  });\n  if (recordIssues) issues.push(...recordIssues);\n\n  const validateRecordFieldDefinition = validatorFor(\n    StandardRecordValidators.RecordFieldDefinition\n  ) as RecordFieldDefinitionValidator;\n  const fieldIssues = validateRecordFieldDefinition(\n    {\n      kind: 'relationship',\n      type: expression.record.type,\n      field: expression.relationship\n    },\n    { schema }\n  );\n  if (fieldIssues) issues.push(...fieldIssues);\n\n  if (issues.length > 0) return issues;\n}\n\nfunction validateFindRelatedRecordsQueryExpression(\n  expression: FindRelatedRecords,\n  options: {\n    schema: RecordSchema;\n    validatorFor: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n  }\n): undefined | ValidationIssue[] {\n  const { schema, validatorFor } = options;\n  const issues: ValidationIssue[] = [];\n\n  const validateRecordIdentity = validatorFor(\n    StandardRecordValidators.RecordIdentity\n  ) as RecordIdentityValidator;\n  const recordIssues = validateRecordIdentity(expression.record, {\n    schema,\n    validatorFor\n  });\n  if (recordIssues) issues.push(...recordIssues);\n\n  const validateRecordFieldDefinition = validatorFor(\n    StandardRecordValidators.RecordFieldDefinition\n  ) as RecordFieldDefinitionValidator;\n  const fieldIssues = validateRecordFieldDefinition(\n    {\n      kind: 'relationship',\n      type: expression.record.type,\n      field: expression.relationship\n    },\n    { schema }\n  );\n  if (fieldIssues) issues.push(...fieldIssues);\n\n  // TODO - validate `sort`, `filter`, and `page`\n\n  if (issues.length > 0) return issues;\n}\n\nfunction validateFindRecordsQueryExpression(\n  expression: FindRecords,\n  options: {\n    schema: RecordSchema;\n    validatorFor: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n  }\n): undefined | ValidationIssue[] {\n  const { schema, validatorFor } = options;\n  const issues: ValidationIssue[] = [];\n\n  if (expression.records) {\n    const validateRecordIdentity = validatorFor(\n      StandardRecordValidators.RecordIdentity\n    ) as RecordIdentityValidator;\n\n    expression.records.forEach((r) => {\n      let i = validateRecordIdentity(r, {\n        schema,\n        validatorFor\n      });\n      if (i) issues.push(...i);\n    });\n  }\n\n  if (expression.type) {\n    const validateRecordType = validatorFor(\n      StandardRecordValidators.RecordType\n    ) as RecordTypeValidator;\n\n    let i = validateRecordType(expression.type, {\n      schema\n    });\n    if (i) issues.push(...i);\n  }\n\n  // TODO - validate `sort`, `filter`, and `page`\n\n  if (issues.length > 0) return issues;\n}\n\nexport const validateRecordQueryExpression: RecordQueryExpressionValidator = (\n  expression: RecordQueryExpression,\n  options?: {\n    schema: RecordSchema;\n    validatorFor: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n  }\n): undefined | RecordQueryExpressionValidationIssue[] => {\n  if (options?.validatorFor === undefined || options?.schema === undefined) {\n    throw new Assertion(\n      'validateRecordQueryExpression requires both a `validationFor` and a `schema`.'\n    );\n  }\n\n  const { schema, validatorFor } = options;\n  let issues;\n\n  switch (expression.op) {\n    case 'findRecord':\n      issues = validateFindRecordQueryExpression(expression, {\n        schema,\n        validatorFor\n      });\n      break;\n\n    case 'findRelatedRecord':\n      issues = validateFindRelatedRecordQueryExpression(expression, {\n        schema,\n        validatorFor\n      });\n      break;\n\n    case 'findRelatedRecords':\n      issues = validateFindRelatedRecordsQueryExpression(expression, {\n        schema,\n        validatorFor\n      });\n      break;\n\n    case 'findRecords':\n      issues = validateFindRecordsQueryExpression(expression, {\n        schema,\n        validatorFor\n      });\n      break;\n\n    default:\n      return [\n        {\n          validator: StandardRecordValidators.RecordQueryExpression,\n          validation: 'queryExpressionAllowed',\n          ref: expression,\n          description: `record query expression '${\n            (expression as any).op\n          }' is not recognized`\n        }\n      ];\n  }\n\n  if (issues !== undefined) {\n    return [\n      {\n        validator: StandardRecordValidators.RecordQueryExpression,\n        validation: 'queryExpressionValid',\n        ref: expression,\n        details: issues,\n        description: formatValidationDescription(\n          'record query expression is invalid',\n          issues\n        )\n      }\n    ];\n  }\n};\n","import { Dict } from '@orbit/utils';\nimport {\n  buildValidatorFor,\n  StandardValidator,\n  standardValidators,\n  ValidatorForFn\n} from '@orbit/validators';\nimport { StandardRecordValidator } from './standard-record-validators';\nimport { standardRecordValidators } from './standard-record-validator-dict';\n\nexport function buildRecordValidatorFor(settings?: {\n  validators?: Dict<StandardValidator | StandardRecordValidator>;\n}): ValidatorForFn<StandardValidator | StandardRecordValidator> {\n  return buildValidatorFor<StandardValidator | StandardRecordValidator>({\n    validators: {\n      ...standardValidators,\n      ...standardRecordValidators,\n      ...settings?.validators\n    }\n  });\n}\n","import { Validator } from './validator';\nimport { Dict } from '@orbit/utils';\n\nexport type ValidatorForFn<V = Validator> = (type: string) => V | undefined;\n\nexport function buildValidatorFor<V = Validator>(settings: {\n  validators: Dict<V>;\n}): ValidatorForFn<V> {\n  const { validators } = settings;\n\n  function validatorFor(type: string): V | undefined {\n    return validators[type] ?? validators['unknown'];\n  }\n\n  return validatorFor;\n}\n","import { Assertion, Orbit } from '@orbit/core';\nimport { clone } from '@orbit/utils';\nimport {\n  cloneRecordIdentity,\n  InitializedRecord,\n  isRecordIdentity,\n  RecordIdentity,\n  RecordKeyValue,\n  UninitializedRecord\n} from './record';\nimport { KeyNotDefined, ModelNotDefined } from './record-exceptions';\nimport { RecordKeyMap } from './record-key-map';\nimport { RecordNormalizer } from './record-normalizer';\nimport { RecordSchema } from './record-schema';\n\nconst { assert, deprecate } = Orbit;\n\nexport interface StandardRecordNormalizerSettings {\n  schema: RecordSchema;\n  keyMap?: RecordKeyMap;\n  cloneInputs?: boolean;\n  validateInputs?: boolean;\n}\n\nexport class StandardRecordNormalizer\n  implements\n    RecordNormalizer<\n      string,\n      RecordIdentity | RecordKeyValue,\n      UninitializedRecord\n    > {\n  schema: RecordSchema;\n  keyMap?: RecordKeyMap;\n  cloneInputs?: boolean;\n  validateInputs?: boolean;\n\n  constructor(settings: StandardRecordNormalizerSettings) {\n    const { schema, keyMap, cloneInputs, validateInputs } = settings;\n\n    assert(\n      \"StandardRecordNormalizer's `schema` must be specified in the `settings.schema` constructor argument\",\n      !!schema\n    );\n\n    this.schema = schema;\n    this.keyMap = keyMap;\n    this.cloneInputs = cloneInputs;\n    this.validateInputs = validateInputs;\n  }\n\n  normalizeRecordType(type: string): string {\n    if (this.validateInputs) {\n      if (typeof type !== 'string') {\n        throw new Assertion(\n          'StandardRecordNormalizer expects record types to be strings'\n        );\n      }\n\n      if (!this.schema.hasModel(type)) {\n        throw new ModelNotDefined(type);\n      }\n    }\n\n    return type;\n  }\n\n  normalizeRecordIdentity(\n    identity: RecordIdentity | RecordKeyValue\n  ): RecordIdentity {\n    const { schema, keyMap, cloneInputs, validateInputs } = this;\n    const { type } = identity;\n\n    if (validateInputs && !schema.hasModel(type)) {\n      throw new ModelNotDefined(type);\n    }\n\n    if (isRecordIdentity(identity)) {\n      return cloneInputs ? this.cloneRecordIdentity(identity) : identity;\n    } else {\n      if (keyMap === undefined) {\n        throw new Assertion(\n          \"StandardRecordNormalizer's `keyMap` must be specified in order to lookup an `id` from a `key`\"\n        );\n      }\n\n      const { key, value } = identity;\n\n      if (typeof key !== 'string' || typeof value !== 'string') {\n        throw new Assertion(\n          'StandardRecordNormalizer expects record identities in the form `{ type: string, id: string }` or `{ type: string, key: string, value: string }`'\n        );\n      }\n\n      if (validateInputs && !schema.hasKey(type, key)) {\n        throw new KeyNotDefined(type, key);\n      }\n\n      let id = keyMap.keyToId(type, key, value);\n\n      if (id === undefined) {\n        id = this.schema.generateId(type);\n        keyMap.pushRecord({ type, id, keys: { [key]: value } });\n      }\n\n      return { type, id };\n    }\n  }\n\n  normalizeRecord(record: UninitializedRecord): InitializedRecord {\n    const { keyMap, schema, cloneInputs, validateInputs } = this;\n    const { type } = record;\n\n    if (validateInputs && !schema.hasModel(type)) {\n      throw new ModelNotDefined(type);\n    }\n\n    let result = cloneInputs ? this.cloneRecord(record) : record;\n\n    // If `initializeRecord` has been defined on the schema, continue to call it\n    // but issue a deprecation warning.\n    // TODO: Remove in v0.18\n    if ((schema as any).initializeRecord !== undefined) {\n      deprecate(\n        \"RecordSchema's `initializeRecord` method should NOT be defined. Instead override `normalizeRecord` on the RecordNormalizer to initialize records.\"\n      );\n      result = (schema as any).initializeRecord(result);\n    }\n\n    if (result.id === undefined) {\n      const { keys } = result;\n\n      // Lookup id from keys if possible\n      if (keyMap !== undefined && keys !== undefined) {\n        if (validateInputs) {\n          Object.keys(keys).forEach((key) => {\n            if (!schema.hasKey(type, key)) {\n              throw new KeyNotDefined(type, key);\n            }\n          });\n        }\n\n        const id = keyMap.idFromKeys(result.type, keys);\n        if (id) {\n          result.id = id;\n        }\n      }\n\n      // Generate an id if one has still not been assigned\n      if (result.id === undefined) {\n        result.id = schema.generateId(result.type);\n\n        // Register any generated ids in the keyMap, if present\n        if (keyMap && result.keys !== undefined) {\n          keyMap.pushRecord(result);\n        }\n      }\n    }\n\n    return result as InitializedRecord;\n  }\n\n  protected cloneRecordIdentity(rid: RecordIdentity): RecordIdentity {\n    return cloneRecordIdentity(rid);\n  }\n\n  protected cloneRecord(record: UninitializedRecord): UninitializedRecord {\n    return clone(record);\n  }\n}\n","import { Orbit } from '@orbit/core';\nimport {\n  RequestOptions,\n  Source,\n  SourceClass,\n  SourceSettings\n} from '@orbit/data';\nimport { Dict } from '@orbit/utils';\nimport { StandardValidator, ValidatorForFn } from '@orbit/validators';\nimport { RecordKeyMap } from './record-key-map';\nimport { RecordNormalizer } from './record-normalizer';\nimport { RecordQueryBuilder } from './record-query-builder';\nimport { RecordSchema } from './record-schema';\nimport { RecordTransformBuilder } from './record-transform-builder';\nimport { buildRecordValidatorFor } from './record-validators/record-validator-builder';\nimport { StandardRecordValidator } from './record-validators/standard-record-validators';\nimport { StandardRecordNormalizer } from './standard-record-normalizer';\n\nconst { assert } = Orbit;\n\nexport interface RecordSourceQueryOptions extends RequestOptions {\n  raiseNotFoundExceptions?: boolean;\n}\n\nexport interface RecordSourceSettings<\n  QO extends RequestOptions = RecordSourceQueryOptions,\n  TO extends RequestOptions = RequestOptions,\n  QB = RecordQueryBuilder,\n  TB = RecordTransformBuilder\n> extends SourceSettings<QO, TO, QB, TB> {\n  schema: RecordSchema;\n  keyMap?: RecordKeyMap;\n  normalizer?: RecordNormalizer;\n\n  /**\n   * A completely custom set of validators.\n   */\n  validatorFor?: ValidatorForFn<StandardValidator | StandardRecordValidator>;\n\n  /**\n   * Custom validators to override, and be merged with, the standard ones which\n   * will be built as long as `autoValidate !== false`.\n   */\n  validators?: Dict<StandardValidator | StandardRecordValidator>;\n\n  /**\n   * Automatically validate the contents of all requests.\n   *\n   * If true, builds a `validatorFor` function if one has not been provided.\n   * This will include standard validators as well as any custom `validators`\n   * that may be provided.\n   *\n   * @default true\n   */\n  autoValidate?: boolean;\n\n  /**\n   * Automatically upgrade this source whenever its schema is upgraded.\n   *\n   * Override the `upgrade` method to provide an upgrade implementation.\n   *\n   * @default true\n   */\n  autoUpgrade?: boolean;\n}\n\nexport type RecordSourceClass<\n  QO extends RequestOptions = RecordSourceQueryOptions,\n  TO extends RequestOptions = RequestOptions,\n  QB = RecordQueryBuilder,\n  TB = RecordTransformBuilder\n> = SourceClass<QO, TO, QB, TB>;\n\n/**\n * Abstract base class for record-based sources.\n */\nexport abstract class RecordSource<\n  QO extends RequestOptions = RecordSourceQueryOptions,\n  TO extends RequestOptions = RequestOptions,\n  QB = RecordQueryBuilder,\n  TB = RecordTransformBuilder\n> extends Source<QO, TO, QB, TB> {\n  protected _keyMap?: RecordKeyMap;\n  protected _schema: RecordSchema;\n  protected _validatorFor?: ValidatorForFn<\n    StandardValidator | StandardRecordValidator\n  >;\n\n  // Unlike in `Source`, builders will always be set\n  protected _queryBuilder!: QB;\n  protected _transformBuilder!: TB;\n\n  constructor(settings: RecordSourceSettings<QO, TO, QB, TB>) {\n    const autoActivate =\n      settings.autoActivate === undefined || settings.autoActivate;\n\n    const { schema } = settings;\n    let { validatorFor, validators } = settings;\n\n    const autoValidate = settings.autoValidate !== false;\n\n    if (!autoValidate) {\n      assert(\n        'RecordSource should not be constructed with a `validatorFor` or `validators` if `autoValidate === false`',\n        validators === undefined && validatorFor === undefined\n      );\n    } else if (validatorFor !== undefined) {\n      assert(\n        'RecordSource can be constructed with either a `validatorFor` or `validators`, but not both',\n        validators === undefined\n      );\n    } else {\n      validatorFor = buildRecordValidatorFor({ validators });\n    }\n\n    assert(\n      \"RecordSource's `schema` must be specified in `settings.schema` constructor argument\",\n      !!schema\n    );\n\n    if (\n      settings.queryBuilder === undefined ||\n      settings.transformBuilder === undefined\n    ) {\n      let { normalizer } = settings;\n\n      if (normalizer === undefined) {\n        normalizer = new StandardRecordNormalizer({\n          schema,\n          keyMap: settings.keyMap,\n          validateInputs: autoValidate\n        });\n      }\n\n      if (settings.queryBuilder === undefined) {\n        (settings as any).queryBuilder = new RecordQueryBuilder({\n          schema,\n          normalizer,\n          validatorFor\n        });\n      }\n\n      if (settings.transformBuilder === undefined) {\n        (settings as any).transformBuilder = new RecordTransformBuilder({\n          schema,\n          normalizer,\n          validatorFor\n        });\n      }\n    }\n\n    super({ ...settings, autoActivate: false });\n\n    this._schema = schema;\n    this._keyMap = settings.keyMap;\n    this._validatorFor = validatorFor;\n\n    if (settings.autoUpgrade === undefined || settings.autoUpgrade) {\n      this._schema.on('upgrade', () => this.upgrade());\n    }\n\n    if (autoActivate) {\n      this.activate();\n    }\n  }\n\n  get schema(): RecordSchema {\n    return this._schema;\n  }\n\n  get keyMap(): RecordKeyMap | undefined {\n    return this._keyMap;\n  }\n\n  get validatorFor():\n    | ValidatorForFn<StandardValidator | StandardRecordValidator>\n    | undefined {\n    return this._validatorFor;\n  }\n\n  get queryBuilder(): QB {\n    return this._queryBuilder;\n  }\n\n  get transformBuilder(): TB {\n    return this._transformBuilder;\n  }\n\n  /**\n   * Upgrade source as part of a schema upgrade.\n   */\n  async upgrade(): Promise<void> {\n    return;\n  }\n}\n","import { Serializer } from './serializer';\nimport { SerializerForFn } from './serializer-builders';\n\nexport abstract class BaseSerializer<\n  From,\n  To,\n  SerializationOptions = unknown,\n  DeserializationOptions = unknown\n> implements\n    Serializer<From, To, SerializationOptions, DeserializationOptions> {\n  serializerFor?: SerializerForFn;\n  protected serializationOptions?: SerializationOptions;\n  protected deserializationOptions?: DeserializationOptions;\n\n  constructor(settings?: {\n    serializerFor?: SerializerForFn;\n    serializationOptions?: SerializationOptions;\n    deserializationOptions?: DeserializationOptions;\n  }) {\n    this.serializerFor = settings?.serializerFor;\n    this.serializationOptions = settings?.serializationOptions;\n    this.deserializationOptions = settings?.deserializationOptions;\n  }\n\n  protected buildSerializationOptions(\n    customOptions?: SerializationOptions\n  ): SerializationOptions {\n    let options = this.serializationOptions;\n    if (options && customOptions) {\n      return {\n        ...options,\n        ...customOptions\n      };\n    } else {\n      return (options || customOptions || {}) as SerializationOptions;\n    }\n  }\n\n  protected buildDeserializationOptions(\n    customOptions?: DeserializationOptions\n  ): DeserializationOptions {\n    let options = this.deserializationOptions;\n    if (options && customOptions) {\n      return {\n        ...options,\n        ...customOptions\n      };\n    } else {\n      return (options || customOptions || {}) as DeserializationOptions;\n    }\n  }\n\n  abstract serialize(arg: From, options?: SerializationOptions): To;\n  abstract deserialize(arg: To, options?: DeserializationOptions): From;\n}\n","import { BaseSerializer } from './base-serializer';\n\nexport class BooleanSerializer extends BaseSerializer<boolean, boolean> {\n  serialize(arg: boolean): boolean {\n    return arg ? true : false;\n  }\n\n  deserialize(arg: boolean): boolean {\n    return arg ? true : false;\n  }\n}\n","import { BaseSerializer } from './base-serializer';\n\nexport class DateSerializer extends BaseSerializer<Date, string> {\n  serialize(arg: Date): string {\n    return `${arg.getFullYear()}-${arg.getMonth() + 1}-${arg.getDate()}`;\n  }\n\n  deserialize(arg: string): Date {\n    const [year, month, date] = arg.split('-');\n    return new Date(parseInt(year), parseInt(month) - 1, parseInt(date));\n  }\n}\n","import { BaseSerializer } from './base-serializer';\n\nexport class DateTimeSerializer extends BaseSerializer<Date, string> {\n  serialize(arg: Date): string {\n    return arg.toISOString();\n  }\n\n  deserialize(arg: string): Date {\n    let offset = arg.indexOf('+');\n    if (offset !== -1 && arg.length - 5 === offset) {\n      offset += 3;\n      return new Date(arg.slice(0, offset) + ':' + arg.slice(offset));\n    }\n    return new Date(arg);\n  }\n}\n","import { Dict } from '@orbit/utils';\n\nexport type Inflector = (input: string) => string;\n\nexport function buildInflector(\n  mappings: Dict<string> = {},\n  fallback?: Inflector\n): Inflector {\n  return (input: string) => {\n    if (mappings[input]) {\n      return mappings[input];\n    } else if (fallback) {\n      return fallback(input);\n    } else {\n      throw new Error(`Inflection mapping for '${input}' does not exist.`);\n    }\n  };\n}\n","import { Serializer } from './serializer';\n\nexport class NoopSerializer\n  implements Serializer<unknown, unknown, unknown, unknown> {\n  serialize(arg: unknown): unknown {\n    return arg;\n  }\n\n  deserialize(arg: unknown): unknown {\n    return arg;\n  }\n}\n","import { BaseSerializer } from './base-serializer';\n\nexport class NumberSerializer extends BaseSerializer<number, number> {\n  serialize(arg: number): number {\n    return arg;\n  }\n\n  deserialize(arg: number): number {\n    return arg;\n  }\n}\n","/**\n * Uppercase the first letter of a string, but don't change the remainder.\n */\nexport function capitalize(str: string): string {\n  return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\n/**\n * Convert underscored, dasherized, or space-delimited words into\n * lowerCamelCase.\n */\nexport function camelize(str: string): string {\n  return str\n    .replace(/(\\-|\\_|\\.|\\s)+(.)?/g, function (match, separator, chr) {\n      return chr ? chr.toUpperCase() : '';\n    })\n    .replace(/(^|\\/)([A-Z])/g, function (match) {\n      return match.toLowerCase();\n    });\n}\n\n/**\n * Converts a camelized string into all lowercase separated by underscores.\n */\nexport function decamelize(str: string): string {\n  return str.replace(/([a-z\\d])([A-Z])/g, '$1_$2').toLowerCase();\n}\n\n/**\n * Dasherize words that are underscored, space-delimited, or camelCased.\n */\nexport function dasherize(str: string): string {\n  return decamelize(str).replace(/[ _]/g, '-');\n}\n\n/**\n * Underscore words that are dasherized, space-delimited, or camelCased.\n */\nexport function underscore(str: string): string {\n  return str\n    .replace(/([a-z\\d])([A-Z]+)/g, '$1_$2')\n    .replace(/\\-|\\s+/g, '_')\n    .toLowerCase();\n}\n\n/**\n * A naive pluralization method.\n */\nexport function pluralize(word: string): string {\n  return word + 's';\n}\n\n/**\n * A naive singularization method.\n */\nexport function singularize(word: string): string {\n  if (word.lastIndexOf('s') === word.length - 1) {\n    return word.substr(0, word.length - 1);\n  } else {\n    return word;\n  }\n}\n\nexport type StandardInflectorName =\n  | 'camelize'\n  | 'dasherize'\n  | 'underscore'\n  | 'pluralize'\n  | 'singularize';\n\nexport const standardInflectors = {\n  camelize,\n  dasherize,\n  underscore,\n  pluralize,\n  singularize\n};\n\nexport const standardInverseInflectors = {\n  camelize: null, // There's no rational inverse for camelization\n  dasherize: 'camelize',\n  underscore: 'camelize',\n  pluralize: 'singularize',\n  singularize: 'pluralize'\n};\n","import { Dict } from '@orbit/utils';\nimport { BaseSerializer } from './base-serializer';\nimport { Inflector } from './inflector';\nimport {\n  standardInflectors,\n  standardInverseInflectors,\n  StandardInflectorName\n} from './standard-inflectors';\n\nexport type InflectorOrName = Inflector | StandardInflectorName;\n\nexport interface StringSerializationOptions {\n  inflectors?: InflectorOrName[];\n}\n\nexport interface StringSerializerSettings {\n  serializationOptions?: StringSerializationOptions;\n  deserializationOptions?: StringSerializationOptions;\n  inflectors?: Dict<Inflector>;\n  inverseInflectors?: Dict<InflectorOrName>;\n}\n\nexport class StringSerializer extends BaseSerializer<\n  string,\n  string,\n  StringSerializationOptions,\n  StringSerializationOptions\n> {\n  inflectors: Dict<Inflector>;\n  inverseInflectors: Dict<InflectorOrName>;\n\n  constructor(settings?: StringSerializerSettings) {\n    super(settings);\n\n    this.inflectors = settings?.inflectors || {};\n    this.inverseInflectors = settings?.inverseInflectors || {};\n\n    if (\n      this.serializationOptions &&\n      this.deserializationOptions === undefined\n    ) {\n      const { inflectors } = this.serializationOptions;\n      this.deserializationOptions = {\n        inflectors: this.buildInverseInflectors(inflectors)\n      };\n    }\n  }\n\n  serialize(arg: string, customOptions?: StringSerializationOptions): string {\n    const options = this.buildSerializationOptions(customOptions);\n    const { inflectors } = options;\n    let result = arg;\n\n    if (inflectors) {\n      for (let inflector of inflectors) {\n        result = this.applyInflector(inflector, result);\n      }\n    }\n\n    return result;\n  }\n\n  deserialize(arg: string, customOptions?: StringSerializationOptions): string {\n    const options = this.buildDeserializationOptions(customOptions);\n    const { inflectors } = options;\n    let result = arg;\n\n    if (inflectors) {\n      for (let inflector of inflectors) {\n        result = this.applyInflector(inflector, result);\n      }\n    }\n\n    return result;\n  }\n\n  protected buildInverseInflectors(\n    inflectors?: InflectorOrName[]\n  ): InflectorOrName[] | undefined {\n    if (inflectors) {\n      const inverseInflectors: StandardInflectorName[] = [];\n\n      for (let inflector of inflectors) {\n        let inverseInflector;\n        if (typeof inflector === 'string') {\n          inverseInflector =\n            this.inverseInflectors[inflector] ||\n            standardInverseInflectors[inflector];\n        }\n        if (inverseInflector) {\n          inverseInflectors.unshift(inverseInflector as StandardInflectorName);\n        } else {\n          return;\n        }\n      }\n\n      return inverseInflectors;\n    }\n  }\n\n  protected applyInflector(\n    inflectorOrName: InflectorOrName,\n    arg: string\n  ): string {\n    let inflector: Inflector;\n\n    if (typeof inflectorOrName === 'function') {\n      inflector = inflectorOrName;\n    } else {\n      inflector =\n        this.inflectors[inflectorOrName] ??\n        standardInflectors[inflectorOrName as StandardInflectorName];\n\n      if (!inflector) {\n        throw new Error(\n          `'StringSerializer does not recognize inflector '${inflectorOrName}'`\n        );\n      }\n    }\n\n    return inflector(arg);\n  }\n}\n","import { Serializer, SerializerClass } from './serializer';\nimport { Dict } from '@orbit/utils';\n\nexport type SerializerForFn<S = Serializer> = (type: string) => S | undefined;\n\nexport function buildSerializerFor<S = Serializer>(settings: {\n  serializers?: Dict<S>;\n  serializerClassFor?: SerializerClassForFn<S>;\n  serializerSettingsFor?: SerializerSettingsForFn;\n}): SerializerForFn<S> {\n  const customSerializers = settings.serializers ?? {};\n  const serializers = {\n    ...customSerializers\n  };\n  const serializerClassFor = settings.serializerClassFor;\n  const serializerSettingsFor = settings.serializerSettingsFor;\n\n  function serializerFor(type: string): S | undefined {\n    return (serializers[type] as S) ?? createSerializer(type);\n  }\n\n  function createSerializer(type: string): S | undefined {\n    const SerializerClass = serializerClassFor && serializerClassFor(type);\n    if (SerializerClass) {\n      const settings =\n        (serializerSettingsFor && serializerSettingsFor(type)) || {};\n\n      settings.serializerFor = serializerFor;\n\n      return (serializers[type] = new SerializerClass(settings));\n    }\n  }\n\n  return serializerFor;\n}\n\nexport type SerializerClassForFn<S = Serializer> = (\n  type: string\n) => SerializerClass<S>;\n\nexport function buildSerializerClassFor<S = Serializer>(\n  serializerClasses: Dict<SerializerClass<S>> = {}\n): SerializerClassForFn<S> {\n  return (type: string) => serializerClasses[type];\n}\n\nexport type SerializerSettingsForFn = (\n  type: string\n) => Dict<unknown> | undefined;\n\nexport function buildSerializerSettingsFor(settings: {\n  sharedSettings?: Dict<unknown>;\n  settingsByType?: Dict<Dict<unknown>>;\n}): SerializerSettingsForFn {\n  const serializerSettings: Dict<Dict<unknown>> = {};\n  const sharedSettings = settings.sharedSettings || {};\n  const settingsByType = settings.settingsByType || {};\n\n  function serializerSettingsFor(type: string): Dict<unknown> {\n    return serializerSettings[type] || createSerializerSettings(type);\n  }\n\n  function createSerializerSettings(type: string): Dict<unknown> {\n    const settingsForType = settingsByType[type] || {};\n    const settings = {\n      ...sharedSettings,\n      ...settingsForType\n    } as Dict<unknown>;\n\n    return (serializerSettings[type] = settings);\n  }\n\n  return serializerSettingsFor;\n}\n","/**\n * Like the Lodash _.every function, this function takes an array and a\n * predicate function and returns true or false depending on whether the\n * predicate is true for every item in the array.\n */\nexport function every(\n  array: any[],\n  predicate: (member: any, index: number) => boolean\n): boolean {\n  let index = -1;\n  let length: number = array.length;\n\n  while (++index < length) {\n    if (!predicate(array[index], index)) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\n/**\n * Like the Lodash _.some function, this function takes an array and a predicate\n * function and returns true or false depending on whether the predicate is true\n * for any of the items in the array.\n */\nexport function some(\n  array: any[],\n  predicate: (member: any, index: number) => boolean\n): boolean {\n  let index = -1;\n  let length: number = array.length;\n\n  while (++index < length) {\n    if (predicate(array[index], index)) {\n      return true;\n    }\n  }\n\n  return false;\n}\n\n/**\n * This function is similar to Array.prototype.find, but it returns the result\n * of calling the value function rather than an item of the array.\n *\n * @deprecated since v0.17, remove in v0.18\n */\nexport function firstResult(\n  array: any[],\n  valueFn: (member: any, index: number) => any\n): any {\n  let index = -1;\n  let length: number = array.length;\n\n  while (++index < length) {\n    let result = valueFn(array[index], index);\n    if (result) {\n      return result;\n    }\n  }\n}\n","/* eslint-disable @typescript-eslint/explicit-module-boundary-types, eqeqeq, no-eq-null, valid-jsdoc */\n\n/**\n * `eq` checks the equality of two objects.\n *\n * The properties belonging to objects (but not their prototypes) will be\n * traversed deeply and compared.\n *\n * Includes special handling for strings, numbers, dates, booleans, regexes, and\n * arrays\n */\nexport function eq(a: any, b: any): boolean {\n  // Some elements of this function come from underscore\n  // (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n  //\n  // https://github.com/jashkenas/underscore/blob/master/underscore.js\n\n  // Identical objects are equal. `0 === -0`, but they aren't identical.\n  // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n  if (a === b) {\n    return a !== 0 || 1 / a == 1 / b;\n  }\n  // A strict comparison is necessary because `null == undefined`.\n  if (a == null || b == null) {\n    return a === b;\n  }\n\n  let type = Object.prototype.toString.call(a);\n  if (type !== Object.prototype.toString.call(b)) {\n    return false;\n  }\n\n  switch (type) {\n    case '[object String]':\n      return a == String(b);\n    case '[object Number]':\n      // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for\n      // other numeric values.\n      return a != +a ? b != +b : a == 0 ? 1 / a == 1 / b : a == +b;\n    case '[object Date]':\n    case '[object Boolean]':\n      // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n      // millisecond representations. Note that invalid dates with millisecond representations\n      // of `NaN` are not equivalent.\n      return +a == +b;\n    // RegExps are compared by their source patterns and flags.\n    case '[object RegExp]':\n      return (\n        a.source == b.source &&\n        a.global == b.global &&\n        a.multiline == b.multiline &&\n        a.ignoreCase == b.ignoreCase\n      );\n  }\n  if (typeof a != 'object' || typeof b != 'object') {\n    return false;\n  }\n\n  if (type === '[object Array]') {\n    if (a.length !== b.length) {\n      return false;\n    }\n  }\n\n  let i;\n  for (i in b) {\n    if (b.hasOwnProperty(i)) {\n      if (!eq(a[i], b[i])) {\n        return false;\n      }\n    }\n  }\n  for (i in a) {\n    if (a.hasOwnProperty(i)) {\n      if (!eq(a[i], b[i])) {\n        return false;\n      }\n    }\n  }\n  return true;\n}\n","/* eslint-disable @typescript-eslint/explicit-module-boundary-types, valid-jsdoc */\n\n/**\n * Clones a value. If the value is an object, a deeply nested clone will be\n * created.\n *\n * Traverses all object properties (but not prototype properties).\n */\nexport function clone(obj: any): any {\n  if (obj === undefined || obj === null || typeof obj !== 'object') {\n    return obj;\n  }\n\n  let dup: any;\n  let type = Object.prototype.toString.call(obj);\n\n  if (type === '[object Date]') {\n    dup = new Date();\n    dup.setTime(obj.getTime());\n  } else if (type === '[object RegExp]') {\n    dup = obj.constructor(obj);\n  } else if (type === '[object Array]') {\n    dup = [];\n    for (let i = 0, len = obj.length; i < len; i++) {\n      if (obj.hasOwnProperty(i)) {\n        dup.push(clone(obj[i]));\n      }\n    }\n  } else {\n    let val;\n\n    dup = {};\n    for (let key in obj) {\n      if (obj.hasOwnProperty(key)) {\n        val = obj[key];\n        if (typeof val === 'object') {\n          val = clone(val);\n        }\n        dup[key] = val;\n      }\n    }\n  }\n  return dup;\n}\n\n/**\n * Expose properties and methods from one object on another.\n *\n * Methods will be called on `source` and will maintain `source` as the context.\n *\n * @deprecated since v0.17\n */\nexport function expose(destination: any, source: any): void {\n  let properties: string[];\n  if (arguments.length > 2) {\n    properties = Array.prototype.slice.call(arguments, 2);\n  } else {\n    properties = Object.keys(source);\n  }\n\n  properties.forEach((p) => {\n    if (typeof source[p] === 'function') {\n      destination[p] = function () {\n        return source[p].apply(source, arguments);\n      };\n    } else {\n      destination[p] = source[p];\n    }\n  });\n}\n\n/**\n * Extend an object with the properties of one or more other objects.\n *\n * @deprecated since v0.17\n */\nexport function extend(destination: any, ...sources: any[]): any {\n  sources.forEach((source) => {\n    for (let p in source) {\n      if (source.hasOwnProperty(p)) {\n        destination[p] = source[p];\n      }\n    }\n  });\n  return destination;\n}\n\n/**\n * Converts an object to an `Array` if it's not already.\n *\n * @export\n * @param {*} obj\n * @returns {any[]}\n */\nexport function toArray(obj: unknown): any[] {\n  if (isNone(obj)) {\n    return [];\n  } else {\n    return Array.isArray(obj) ? obj : [obj];\n  }\n}\n\n/**\n * Checks whether a value is a non-null object\n *\n * @export\n * @param {*} obj\n * @returns {boolean}\n */\nexport function isObject(obj: unknown): boolean {\n  return obj !== null && typeof obj === 'object';\n}\n\n/**\n * Checks whether an object is null or undefined\n *\n * @export\n * @param {*} obj\n * @returns {boolean}\n */\nexport function isNone(obj: unknown): boolean {\n  return obj === undefined || obj === null;\n}\n\n/**\n * Merges properties from other objects into a base object. Properties that\n * resolve to `undefined` will not overwrite properties on the base object\n * that already exist.\n *\n * @deprecated since v0.17\n */\nexport function merge(object: any, ...sources: any[]): any {\n  sources.forEach((source) => {\n    Object.keys(source).forEach((field) => {\n      if (source.hasOwnProperty(field)) {\n        let value = source[field];\n        if (value !== undefined) {\n          object[field] = clone(value);\n        }\n      }\n    });\n  });\n  return object;\n}\n\n/**\n * Merges properties from other objects into a base object, traversing and\n * merging any objects that are encountered.\n *\n * Properties that resolve to `undefined` will not overwrite properties on the\n * base object that already exist.\n */\nexport function deepMerge(object: any, ...sources: any[]): any {\n  sources.forEach((source) => {\n    Object.keys(source).forEach((field) => {\n      if (source.hasOwnProperty(field)) {\n        let a = object[field];\n        let b = source[field];\n        if (\n          isObject(a) &&\n          isObject(b) &&\n          !Array.isArray(a) &&\n          !Array.isArray(b)\n        ) {\n          deepMerge(a, b);\n        } else if (b !== undefined) {\n          object[field] = clone(b);\n        }\n      }\n    });\n  });\n  return object;\n}\n\n/**\n * Retrieves a value from a nested path on an object.\n *\n * Returns any falsy value encountered while traversing the path.\n */\nexport function deepGet(obj: any, path: string[]): any {\n  let index = -1;\n  let result = obj;\n\n  while (++index < path.length) {\n    result = result[path[index]];\n    if (!result) {\n      return result;\n    }\n  }\n\n  return result;\n}\n\n/**\n * Sets a value on an object at a nested path.\n *\n * This function will create objects along the path if necessary to allow\n * setting a deeply nested value.\n *\n * Returns `false` only if the current value is already strictly equal to the\n * requested `value` argument. Otherwise returns `true`.\n */\nexport function deepSet(obj: any, path: string[], value: any): boolean {\n  let ptr = obj;\n  let prop = path.pop() as string;\n  let segment;\n  for (let i = 0, l = path.length; i < l; i++) {\n    segment = path[i];\n    if (ptr[segment] === undefined) {\n      ptr[segment] = typeof segment === 'number' ? [] : {};\n    }\n    ptr = ptr[segment];\n  }\n  if (ptr[prop] === value) {\n    return false;\n  } else {\n    ptr[prop] = value;\n    return true;\n  }\n}\n\n/**\n * Find an array of values that correspond to the keys of an object.\n *\n * This is a ponyfill for `Object.values`, which is still experimental.\n */\nexport function objectValues(obj: any): any[] {\n  if (Object.values) {\n    return Object.values(obj);\n  } else {\n    return Object.keys(obj).map((k) => obj[k]);\n  }\n}\n","/**\n * Uppercase the first letter of a string, but don't change the remainder.\n *\n * @deprecated since v0.17\n */\nexport function capitalize(str: string): string {\n  console.warn(\n    \"'capitalize' has been deprecated in @orbit/utils. Please import from @orbit/serializers instead.\"\n  );\n  return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\n/**\n * Convert underscored, dasherized, or space-delimited words into\n * lowerCamelCase.\n *\n * @deprecated since v0.17\n */\nexport function camelize(str: string): string {\n  console.warn(\n    \"'camelize' has been deprecated in @orbit/utils. Please import from @orbit/serializers instead.\"\n  );\n  return str\n    .replace(/(\\-|\\_|\\.|\\s)+(.)?/g, function (match, separator, chr) {\n      return chr ? chr.toUpperCase() : '';\n    })\n    .replace(/(^|\\/)([A-Z])/g, function (match) {\n      return match.toLowerCase();\n    });\n}\n\n/**\n * Converts a camelized string into all lowercase separated by underscores.\n *\n * @deprecated since v0.17\n */\nexport function decamelize(str: string): string {\n  console.warn(\n    \"'decamelize' has been deprecated in @orbit/utils. Please import from @orbit/serializers instead.\"\n  );\n  return str.replace(/([a-z\\d])([A-Z])/g, '$1_$2').toLowerCase();\n}\n\n/**\n * Dasherize words that are underscored, space-delimited, or camelCased.\n *\n * @deprecated since v0.17\n */\nexport function dasherize(str: string): string {\n  console.warn(\n    \"'dasherize' has been deprecated in @orbit/utils. Please import from @orbit/serializers instead.\"\n  );\n  return decamelize(str).replace(/[ _]/g, '-');\n}\n\n/**\n * Underscore words that are dasherized, space-delimited, or camelCased.\n *\n * @deprecated since v0.17\n */\nexport function underscore(str: string): string {\n  console.warn(\n    \"'underscore' has been deprecated in @orbit/utils. Please import from @orbit/serializers instead.\"\n  );\n  return str\n    .replace(/([a-z\\d])([A-Z]+)/g, '$1_$2')\n    .replace(/\\-|\\s+/g, '_')\n    .toLowerCase();\n}\n","/**\n * Fast UUID generator, RFC4122 version 4 compliant.\n * @author Jeff Ward (jcward.com).\n * @license MIT license\n * @link http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136\n **/\n\nconst lut: string[] = [];\n\nfor (let i = 0; i < 256; i++) {\n  lut[i] = (i < 16 ? '0' : '') + i.toString(16);\n}\n\n/**\n * `uuid` generates a Version 4 UUID using Jeff Ward's high performance\n * generator.\n */\nexport function uuid(): string {\n  let d0 = (Math.random() * 0xffffffff) | 0;\n  let d1 = (Math.random() * 0xffffffff) | 0;\n  let d2 = (Math.random() * 0xffffffff) | 0;\n  let d3 = (Math.random() * 0xffffffff) | 0;\n\n  return (\n    lut[d0 & 0xff] +\n    lut[(d0 >> 8) & 0xff] +\n    lut[(d0 >> 16) & 0xff] +\n    lut[(d0 >> 24) & 0xff] +\n    '-' +\n    lut[d1 & 0xff] +\n    lut[(d1 >> 8) & 0xff] +\n    '-' +\n    lut[((d1 >> 16) & 0x0f) | 0x40] +\n    lut[(d1 >> 24) & 0xff] +\n    '-' +\n    lut[(d2 & 0x3f) | 0x80] +\n    lut[(d2 >> 8) & 0xff] +\n    '-' +\n    lut[(d2 >> 16) & 0xff] +\n    lut[(d2 >> 24) & 0xff] +\n    lut[d3 & 0xff] +\n    lut[(d3 >> 8) & 0xff] +\n    lut[(d3 >> 16) & 0xff] +\n    lut[(d3 >> 24) & 0xff]\n  );\n}\n","import type { Integration, WrappedFunction } from '@sentry/types';\nimport { getOriginalFunction } from '@sentry/utils';\n\nlet originalFunctionToString: () => void;\n\n/** Patch toString calls to return proper name for wrapped functions */\nexport class FunctionToString implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'FunctionToString';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string;\n\n  public constructor() {\n    this.name = FunctionToString.id;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    // eslint-disable-next-line @typescript-eslint/unbound-method\n    originalFunctionToString = Function.prototype.toString;\n\n    // intrinsics (like Function.prototype) might be immutable in some environments\n    // e.g. Node with --frozen-intrinsics, XS (an embedded JavaScript engine) or SES (a JavaScript proposal)\n    try {\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      Function.prototype.toString = function (this: WrappedFunction, ...args: any[]): string {\n        const context = getOriginalFunction(this) || this;\n        return originalFunctionToString.apply(context, args);\n      };\n    } catch {\n      // ignore errors here, just don't patch this\n    }\n  }\n}\n","import type { Client, Event, EventHint, Integration, StackFrame } from '@sentry/types';\nimport { getEventDescription, logger, stringMatchesSomePattern } from '@sentry/utils';\n\n// \"Script error.\" is hard coded into browsers for errors that it can't read.\n// this is the result of a script being pulled in from an external domain and CORS.\nconst DEFAULT_IGNORE_ERRORS = [/^Script error\\.?$/, /^Javascript error: Script error\\.? on line 0$/];\n\nconst DEFAULT_IGNORE_TRANSACTIONS = [\n  /^.*healthcheck.*$/,\n  /^.*healthy.*$/,\n  /^.*live.*$/,\n  /^.*ready.*$/,\n  /^.*heartbeat.*$/,\n  /^.*\\/health$/,\n  /^.*\\/healthz$/,\n];\n\n/** Options for the InboundFilters integration */\nexport interface InboundFiltersOptions {\n  allowUrls: Array<string | RegExp>;\n  denyUrls: Array<string | RegExp>;\n  ignoreErrors: Array<string | RegExp>;\n  ignoreTransactions: Array<string | RegExp>;\n  ignoreInternal: boolean;\n  disableErrorDefaults: boolean;\n  disableTransactionDefaults: boolean;\n}\n\n/** Inbound filters configurable by the user */\nexport class InboundFilters implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'InboundFilters';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string;\n\n  private readonly _options: Partial<InboundFiltersOptions>;\n\n  public constructor(options: Partial<InboundFiltersOptions> = {}) {\n    this.name = InboundFilters.id;\n    this._options = options;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_addGlobaleventProcessor: unknown, _getCurrentHub: unknown): void {\n    // noop\n  }\n\n  /** @inheritDoc */\n  public processEvent(event: Event, _eventHint: EventHint, client: Client): Event | null {\n    const clientOptions = client.getOptions();\n    const options = _mergeOptions(this._options, clientOptions);\n    return _shouldDropEvent(event, options) ? null : event;\n  }\n}\n\n/** JSDoc */\nexport function _mergeOptions(\n  internalOptions: Partial<InboundFiltersOptions> = {},\n  clientOptions: Partial<InboundFiltersOptions> = {},\n): Partial<InboundFiltersOptions> {\n  return {\n    allowUrls: [...(internalOptions.allowUrls || []), ...(clientOptions.allowUrls || [])],\n    denyUrls: [...(internalOptions.denyUrls || []), ...(clientOptions.denyUrls || [])],\n    ignoreErrors: [\n      ...(internalOptions.ignoreErrors || []),\n      ...(clientOptions.ignoreErrors || []),\n      ...(internalOptions.disableErrorDefaults ? [] : DEFAULT_IGNORE_ERRORS),\n    ],\n    ignoreTransactions: [\n      ...(internalOptions.ignoreTransactions || []),\n      ...(clientOptions.ignoreTransactions || []),\n      ...(internalOptions.disableTransactionDefaults ? [] : DEFAULT_IGNORE_TRANSACTIONS),\n    ],\n    ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true,\n  };\n}\n\n/** JSDoc */\nexport function _shouldDropEvent(event: Event, options: Partial<InboundFiltersOptions>): boolean {\n  if (options.ignoreInternal && _isSentryError(event)) {\n    __DEBUG_BUILD__ &&\n      logger.warn(`Event dropped due to being internal Sentry Error.\\nEvent: ${getEventDescription(event)}`);\n    return true;\n  }\n  if (_isIgnoredError(event, options.ignoreErrors)) {\n    __DEBUG_BUILD__ &&\n      logger.warn(\n        `Event dropped due to being matched by \\`ignoreErrors\\` option.\\nEvent: ${getEventDescription(event)}`,\n      );\n    return true;\n  }\n  if (_isIgnoredTransaction(event, options.ignoreTransactions)) {\n    __DEBUG_BUILD__ &&\n      logger.warn(\n        `Event dropped due to being matched by \\`ignoreTransactions\\` option.\\nEvent: ${getEventDescription(event)}`,\n      );\n    return true;\n  }\n  if (_isDeniedUrl(event, options.denyUrls)) {\n    __DEBUG_BUILD__ &&\n      logger.warn(\n        `Event dropped due to being matched by \\`denyUrls\\` option.\\nEvent: ${getEventDescription(\n          event,\n        )}.\\nUrl: ${_getEventFilterUrl(event)}`,\n      );\n    return true;\n  }\n  if (!_isAllowedUrl(event, options.allowUrls)) {\n    __DEBUG_BUILD__ &&\n      logger.warn(\n        `Event dropped due to not being matched by \\`allowUrls\\` option.\\nEvent: ${getEventDescription(\n          event,\n        )}.\\nUrl: ${_getEventFilterUrl(event)}`,\n      );\n    return true;\n  }\n  return false;\n}\n\nfunction _isIgnoredError(event: Event, ignoreErrors?: Array<string | RegExp>): boolean {\n  // If event.type, this is not an error\n  if (event.type || !ignoreErrors || !ignoreErrors.length) {\n    return false;\n  }\n\n  return _getPossibleEventMessages(event).some(message => stringMatchesSomePattern(message, ignoreErrors));\n}\n\nfunction _isIgnoredTransaction(event: Event, ignoreTransactions?: Array<string | RegExp>): boolean {\n  if (event.type !== 'transaction' || !ignoreTransactions || !ignoreTransactions.length) {\n    return false;\n  }\n\n  const name = event.transaction;\n  return name ? stringMatchesSomePattern(name, ignoreTransactions) : false;\n}\n\nfunction _isDeniedUrl(event: Event, denyUrls?: Array<string | RegExp>): boolean {\n  // TODO: Use Glob instead?\n  if (!denyUrls || !denyUrls.length) {\n    return false;\n  }\n  const url = _getEventFilterUrl(event);\n  return !url ? false : stringMatchesSomePattern(url, denyUrls);\n}\n\nfunction _isAllowedUrl(event: Event, allowUrls?: Array<string | RegExp>): boolean {\n  // TODO: Use Glob instead?\n  if (!allowUrls || !allowUrls.length) {\n    return true;\n  }\n  const url = _getEventFilterUrl(event);\n  return !url ? true : stringMatchesSomePattern(url, allowUrls);\n}\n\nfunction _getPossibleEventMessages(event: Event): string[] {\n  const possibleMessages: string[] = [];\n\n  if (event.message) {\n    possibleMessages.push(event.message);\n  }\n\n  let lastException;\n  try {\n    // @ts-expect-error Try catching to save bundle size\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    lastException = event.exception.values[event.exception.values.length - 1];\n  } catch (e) {\n    // try catching to save bundle size checking existence of variables\n  }\n\n  if (lastException) {\n    if (lastException.value) {\n      possibleMessages.push(lastException.value);\n      if (lastException.type) {\n        possibleMessages.push(`${lastException.type}: ${lastException.value}`);\n      }\n    }\n  }\n\n  if (__DEBUG_BUILD__ && possibleMessages.length === 0) {\n    logger.error(`Could not extract message for event ${getEventDescription(event)}`);\n  }\n\n  return possibleMessages;\n}\n\nfunction _isSentryError(event: Event): boolean {\n  try {\n    // @ts-expect-error can't be a sentry error if undefined\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    return event.exception.values[0].type === 'SentryError';\n  } catch (e) {\n    // ignore\n  }\n  return false;\n}\n\nfunction _getLastValidUrl(frames: StackFrame[] = []): string | null {\n  for (let i = frames.length - 1; i >= 0; i--) {\n    const frame = frames[i];\n\n    if (frame && frame.filename !== '<anonymous>' && frame.filename !== '[native code]') {\n      return frame.filename || null;\n    }\n  }\n\n  return null;\n}\n\nfunction _getEventFilterUrl(event: Event): string | null {\n  try {\n    let frames;\n    try {\n      // @ts-expect-error we only care about frames if the whole thing here is defined\n      frames = event.exception.values[0].stacktrace.frames;\n    } catch (e) {\n      // ignore\n    }\n    return frames ? _getLastValidUrl(frames) : null;\n  } catch (oO) {\n    __DEBUG_BUILD__ && logger.error(`Cannot extract url for event ${getEventDescription(event)}`);\n    return null;\n  }\n}\n","export const DEFAULT_ENVIRONMENT = 'production';\n","import type { Event, EventHint, EventProcessor } from '@sentry/types';\nimport { getGlobalSingleton, isThenable, logger, SyncPromise } from '@sentry/utils';\n\n/**\n * Returns the global event processors.\n */\nexport function getGlobalEventProcessors(): EventProcessor[] {\n  return getGlobalSingleton<EventProcessor[]>('globalEventProcessors', () => []);\n}\n\n/**\n * Add a EventProcessor to be kept globally.\n * @param callback EventProcessor to add\n */\nexport function addGlobalEventProcessor(callback: EventProcessor): void {\n  getGlobalEventProcessors().push(callback);\n}\n\n/**\n * Process an array of event processors, returning the processed event (or `null` if the event was dropped).\n */\nexport function notifyEventProcessors(\n  processors: EventProcessor[],\n  event: Event | null,\n  hint: EventHint,\n  index: number = 0,\n): PromiseLike<Event | null> {\n  return new SyncPromise<Event | null>((resolve, reject) => {\n    const processor = processors[index];\n    if (event === null || typeof processor !== 'function') {\n      resolve(event);\n    } else {\n      const result = processor({ ...event }, hint) as Event | null;\n\n      __DEBUG_BUILD__ &&\n        processor.id &&\n        result === null &&\n        logger.log(`Event processor \"${processor.id}\" dropped event`);\n\n      if (isThenable(result)) {\n        void result\n          .then(final => notifyEventProcessors(processors, final, hint, index + 1).then(resolve))\n          .then(null, reject);\n      } else {\n        void notifyEventProcessors(processors, result, hint, index + 1)\n          .then(resolve)\n          .then(null, reject);\n      }\n    }\n  });\n}\n","import type { SerializedSession, Session, SessionContext, SessionStatus } from '@sentry/types';\nimport { dropUndefinedKeys, timestampInSeconds, uuid4 } from '@sentry/utils';\n\n/**\n * Creates a new `Session` object by setting certain default parameters. If optional @param context\n * is passed, the passed properties are applied to the session object.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns a new `Session` object\n */\nexport function makeSession(context?: Omit<SessionContext, 'started' | 'status'>): Session {\n  // Both timestamp and started are in seconds since the UNIX epoch.\n  const startingTime = timestampInSeconds();\n\n  const session: Session = {\n    sid: uuid4(),\n    init: true,\n    timestamp: startingTime,\n    started: startingTime,\n    duration: 0,\n    status: 'ok',\n    errors: 0,\n    ignoreDuration: false,\n    toJSON: () => sessionToJSON(session),\n  };\n\n  if (context) {\n    updateSession(session, context);\n  }\n\n  return session;\n}\n\n/**\n * Updates a session object with the properties passed in the context.\n *\n * Note that this function mutates the passed object and returns void.\n * (Had to do this instead of returning a new and updated session because closing and sending a session\n * makes an update to the session after it was passed to the sending logic.\n * @see BaseClient.captureSession )\n *\n * @param session the `Session` to update\n * @param context the `SessionContext` holding the properties that should be updated in @param session\n */\n// eslint-disable-next-line complexity\nexport function updateSession(session: Session, context: SessionContext = {}): void {\n  if (context.user) {\n    if (!session.ipAddress && context.user.ip_address) {\n      session.ipAddress = context.user.ip_address;\n    }\n\n    if (!session.did && !context.did) {\n      session.did = context.user.id || context.user.email || context.user.username;\n    }\n  }\n\n  session.timestamp = context.timestamp || timestampInSeconds();\n\n  if (context.ignoreDuration) {\n    session.ignoreDuration = context.ignoreDuration;\n  }\n  if (context.sid) {\n    // Good enough uuid validation. — Kamil\n    session.sid = context.sid.length === 32 ? context.sid : uuid4();\n  }\n  if (context.init !== undefined) {\n    session.init = context.init;\n  }\n  if (!session.did && context.did) {\n    session.did = `${context.did}`;\n  }\n  if (typeof context.started === 'number') {\n    session.started = context.started;\n  }\n  if (session.ignoreDuration) {\n    session.duration = undefined;\n  } else if (typeof context.duration === 'number') {\n    session.duration = context.duration;\n  } else {\n    const duration = session.timestamp - session.started;\n    session.duration = duration >= 0 ? duration : 0;\n  }\n  if (context.release) {\n    session.release = context.release;\n  }\n  if (context.environment) {\n    session.environment = context.environment;\n  }\n  if (!session.ipAddress && context.ipAddress) {\n    session.ipAddress = context.ipAddress;\n  }\n  if (!session.userAgent && context.userAgent) {\n    session.userAgent = context.userAgent;\n  }\n  if (typeof context.errors === 'number') {\n    session.errors = context.errors;\n  }\n  if (context.status) {\n    session.status = context.status;\n  }\n}\n\n/**\n * Closes a session by setting its status and updating the session object with it.\n * Internally calls `updateSession` to update the passed session object.\n *\n * Note that this function mutates the passed session (@see updateSession for explanation).\n *\n * @param session the `Session` object to be closed\n * @param status the `SessionStatus` with which the session was closed. If you don't pass a status,\n *               this function will keep the previously set status, unless it was `'ok'` in which case\n *               it is changed to `'exited'`.\n */\nexport function closeSession(session: Session, status?: Exclude<SessionStatus, 'ok'>): void {\n  let context = {};\n  if (status) {\n    context = { status };\n  } else if (session.status === 'ok') {\n    context = { status: 'exited' };\n  }\n\n  updateSession(session, context);\n}\n\n/**\n * Serializes a passed session object to a JSON object with a slightly different structure.\n * This is necessary because the Sentry backend requires a slightly different schema of a session\n * than the one the JS SDKs use internally.\n *\n * @param session the session to be converted\n *\n * @returns a JSON object of the passed session\n */\nfunction sessionToJSON(session: Session): SerializedSession {\n  return dropUndefinedKeys({\n    sid: `${session.sid}`,\n    init: session.init,\n    // Make sure that sec is converted to ms for date constructor\n    started: new Date(session.started * 1000).toISOString(),\n    timestamp: new Date(session.timestamp * 1000).toISOString(),\n    status: session.status,\n    errors: session.errors,\n    did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined,\n    duration: session.duration,\n    attrs: {\n      release: session.release,\n      environment: session.environment,\n      ip_address: session.ipAddress,\n      user_agent: session.userAgent,\n    },\n  });\n}\n","/* eslint-disable max-lines */\nimport type {\n  Attachment,\n  Breadcrumb,\n  CaptureContext,\n  Context,\n  Contexts,\n  Event,\n  EventHint,\n  EventProcessor,\n  Extra,\n  Extras,\n  Primitive,\n  PropagationContext,\n  RequestSession,\n  Scope as ScopeInterface,\n  ScopeContext,\n  Session,\n  Severity,\n  SeverityLevel,\n  Span,\n  Transaction,\n  User,\n} from '@sentry/types';\nimport { arrayify, dateTimestampInSeconds, isPlainObject, uuid4 } from '@sentry/utils';\n\nimport { getGlobalEventProcessors, notifyEventProcessors } from './eventProcessors';\nimport { updateSession } from './session';\n\n/**\n * Default value for maximum number of breadcrumbs added to an event.\n */\nconst DEFAULT_MAX_BREADCRUMBS = 100;\n\n/**\n * Holds additional event information. {@link Scope.applyToEvent} will be\n * called by the client before an event will be sent.\n */\nexport class Scope implements ScopeInterface {\n  /** Flag if notifying is happening. */\n  protected _notifyingListeners: boolean;\n\n  /** Callback for client to receive scope changes. */\n  protected _scopeListeners: Array<(scope: Scope) => void>;\n\n  /** Callback list that will be called after {@link applyToEvent}. */\n  protected _eventProcessors: EventProcessor[];\n\n  /** Array of breadcrumbs. */\n  protected _breadcrumbs: Breadcrumb[];\n\n  /** User */\n  protected _user: User;\n\n  /** Tags */\n  protected _tags: { [key: string]: Primitive };\n\n  /** Extra */\n  protected _extra: Extras;\n\n  /** Contexts */\n  protected _contexts: Contexts;\n\n  /** Attachments */\n  protected _attachments: Attachment[];\n\n  /** Propagation Context for distributed tracing */\n  protected _propagationContext: PropagationContext;\n\n  /**\n   * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get\n   * sent to Sentry\n   */\n  protected _sdkProcessingMetadata: { [key: string]: unknown };\n\n  /** Fingerprint */\n  protected _fingerprint?: string[];\n\n  /** Severity */\n  // eslint-disable-next-line deprecation/deprecation\n  protected _level?: Severity | SeverityLevel;\n\n  /** Transaction Name */\n  protected _transactionName?: string;\n\n  /** Span */\n  protected _span?: Span;\n\n  /** Session */\n  protected _session?: Session;\n\n  /** Request Mode Session Status */\n  protected _requestSession?: RequestSession;\n\n  // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.\n\n  public constructor() {\n    this._notifyingListeners = false;\n    this._scopeListeners = [];\n    this._eventProcessors = [];\n    this._breadcrumbs = [];\n    this._attachments = [];\n    this._user = {};\n    this._tags = {};\n    this._extra = {};\n    this._contexts = {};\n    this._sdkProcessingMetadata = {};\n    this._propagationContext = generatePropagationContext();\n  }\n\n  /**\n   * Inherit values from the parent scope.\n   * @param scope to clone.\n   */\n  public static clone(scope?: Scope): Scope {\n    const newScope = new Scope();\n    if (scope) {\n      newScope._breadcrumbs = [...scope._breadcrumbs];\n      newScope._tags = { ...scope._tags };\n      newScope._extra = { ...scope._extra };\n      newScope._contexts = { ...scope._contexts };\n      newScope._user = scope._user;\n      newScope._level = scope._level;\n      newScope._span = scope._span;\n      newScope._session = scope._session;\n      newScope._transactionName = scope._transactionName;\n      newScope._fingerprint = scope._fingerprint;\n      newScope._eventProcessors = [...scope._eventProcessors];\n      newScope._requestSession = scope._requestSession;\n      newScope._attachments = [...scope._attachments];\n      newScope._sdkProcessingMetadata = { ...scope._sdkProcessingMetadata };\n      newScope._propagationContext = { ...scope._propagationContext };\n    }\n    return newScope;\n  }\n\n  /**\n   * Add internal on change listener. Used for sub SDKs that need to store the scope.\n   * @hidden\n   */\n  public addScopeListener(callback: (scope: Scope) => void): void {\n    this._scopeListeners.push(callback);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public addEventProcessor(callback: EventProcessor): this {\n    this._eventProcessors.push(callback);\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setUser(user: User | null): this {\n    this._user = user || {};\n    if (this._session) {\n      updateSession(this._session, { user });\n    }\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getUser(): User | undefined {\n    return this._user;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getRequestSession(): RequestSession | undefined {\n    return this._requestSession;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setRequestSession(requestSession?: RequestSession): this {\n    this._requestSession = requestSession;\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTags(tags: { [key: string]: Primitive }): this {\n    this._tags = {\n      ...this._tags,\n      ...tags,\n    };\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTag(key: string, value: Primitive): this {\n    this._tags = { ...this._tags, [key]: value };\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setExtras(extras: Extras): this {\n    this._extra = {\n      ...this._extra,\n      ...extras,\n    };\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setExtra(key: string, extra: Extra): this {\n    this._extra = { ...this._extra, [key]: extra };\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setFingerprint(fingerprint: string[]): this {\n    this._fingerprint = fingerprint;\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setLevel(\n    // eslint-disable-next-line deprecation/deprecation\n    level: Severity | SeverityLevel,\n  ): this {\n    this._level = level;\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTransactionName(name?: string): this {\n    this._transactionName = name;\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setContext(key: string, context: Context | null): this {\n    if (context === null) {\n      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n      delete this._contexts[key];\n    } else {\n      this._contexts[key] = context;\n    }\n\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setSpan(span?: Span): this {\n    this._span = span;\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getSpan(): Span | undefined {\n    return this._span;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getTransaction(): Transaction | undefined {\n    // Often, this span (if it exists at all) will be a transaction, but it's not guaranteed to be. Regardless, it will\n    // have a pointer to the currently-active transaction.\n    const span = this.getSpan();\n    return span && span.transaction;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setSession(session?: Session): this {\n    if (!session) {\n      delete this._session;\n    } else {\n      this._session = session;\n    }\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getSession(): Session | undefined {\n    return this._session;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public update(captureContext?: CaptureContext): this {\n    if (!captureContext) {\n      return this;\n    }\n\n    if (typeof captureContext === 'function') {\n      const updatedScope = (captureContext as <T>(scope: T) => T)(this);\n      return updatedScope instanceof Scope ? updatedScope : this;\n    }\n\n    if (captureContext instanceof Scope) {\n      this._tags = { ...this._tags, ...captureContext._tags };\n      this._extra = { ...this._extra, ...captureContext._extra };\n      this._contexts = { ...this._contexts, ...captureContext._contexts };\n      if (captureContext._user && Object.keys(captureContext._user).length) {\n        this._user = captureContext._user;\n      }\n      if (captureContext._level) {\n        this._level = captureContext._level;\n      }\n      if (captureContext._fingerprint) {\n        this._fingerprint = captureContext._fingerprint;\n      }\n      if (captureContext._requestSession) {\n        this._requestSession = captureContext._requestSession;\n      }\n      if (captureContext._propagationContext) {\n        this._propagationContext = captureContext._propagationContext;\n      }\n    } else if (isPlainObject(captureContext)) {\n      // eslint-disable-next-line no-param-reassign\n      captureContext = captureContext as ScopeContext;\n      this._tags = { ...this._tags, ...captureContext.tags };\n      this._extra = { ...this._extra, ...captureContext.extra };\n      this._contexts = { ...this._contexts, ...captureContext.contexts };\n      if (captureContext.user) {\n        this._user = captureContext.user;\n      }\n      if (captureContext.level) {\n        this._level = captureContext.level;\n      }\n      if (captureContext.fingerprint) {\n        this._fingerprint = captureContext.fingerprint;\n      }\n      if (captureContext.requestSession) {\n        this._requestSession = captureContext.requestSession;\n      }\n      if (captureContext.propagationContext) {\n        this._propagationContext = captureContext.propagationContext;\n      }\n    }\n\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public clear(): this {\n    this._breadcrumbs = [];\n    this._tags = {};\n    this._extra = {};\n    this._user = {};\n    this._contexts = {};\n    this._level = undefined;\n    this._transactionName = undefined;\n    this._fingerprint = undefined;\n    this._requestSession = undefined;\n    this._span = undefined;\n    this._session = undefined;\n    this._notifyScopeListeners();\n    this._attachments = [];\n    this._propagationContext = generatePropagationContext();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this {\n    const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS;\n\n    // No data has been changed, so don't notify scope listeners\n    if (maxCrumbs <= 0) {\n      return this;\n    }\n\n    const mergedBreadcrumb = {\n      timestamp: dateTimestampInSeconds(),\n      ...breadcrumb,\n    };\n\n    const breadcrumbs = this._breadcrumbs;\n    breadcrumbs.push(mergedBreadcrumb);\n    this._breadcrumbs = breadcrumbs.length > maxCrumbs ? breadcrumbs.slice(-maxCrumbs) : breadcrumbs;\n\n    this._notifyScopeListeners();\n\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getLastBreadcrumb(): Breadcrumb | undefined {\n    return this._breadcrumbs[this._breadcrumbs.length - 1];\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public clearBreadcrumbs(): this {\n    this._breadcrumbs = [];\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public addAttachment(attachment: Attachment): this {\n    this._attachments.push(attachment);\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getAttachments(): Attachment[] {\n    return this._attachments;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public clearAttachments(): this {\n    this._attachments = [];\n    return this;\n  }\n\n  /**\n   * Applies data from the scope to the event and runs all event processors on it.\n   *\n   * @param event Event\n   * @param hint Object containing additional information about the original exception, for use by the event processors.\n   * @hidden\n   */\n  public applyToEvent(\n    event: Event,\n    hint: EventHint = {},\n    additionalEventProcessors?: EventProcessor[],\n  ): PromiseLike<Event | null> {\n    if (this._extra && Object.keys(this._extra).length) {\n      event.extra = { ...this._extra, ...event.extra };\n    }\n    if (this._tags && Object.keys(this._tags).length) {\n      event.tags = { ...this._tags, ...event.tags };\n    }\n    if (this._user && Object.keys(this._user).length) {\n      event.user = { ...this._user, ...event.user };\n    }\n    if (this._contexts && Object.keys(this._contexts).length) {\n      event.contexts = { ...this._contexts, ...event.contexts };\n    }\n    if (this._level) {\n      event.level = this._level;\n    }\n    if (this._transactionName) {\n      event.transaction = this._transactionName;\n    }\n\n    // We want to set the trace context for normal events only if there isn't already\n    // a trace context on the event. There is a product feature in place where we link\n    // errors with transaction and it relies on that.\n    if (this._span) {\n      event.contexts = { trace: this._span.getTraceContext(), ...event.contexts };\n      const transaction = this._span.transaction;\n      if (transaction) {\n        event.sdkProcessingMetadata = {\n          dynamicSamplingContext: transaction.getDynamicSamplingContext(),\n          ...event.sdkProcessingMetadata,\n        };\n        const transactionName = transaction.name;\n        if (transactionName) {\n          event.tags = { transaction: transactionName, ...event.tags };\n        }\n      }\n    }\n\n    this._applyFingerprint(event);\n\n    const scopeBreadcrumbs = this._getBreadcrumbs();\n    const breadcrumbs = [...(event.breadcrumbs || []), ...scopeBreadcrumbs];\n    event.breadcrumbs = breadcrumbs.length > 0 ? breadcrumbs : undefined;\n\n    event.sdkProcessingMetadata = {\n      ...event.sdkProcessingMetadata,\n      ...this._sdkProcessingMetadata,\n      propagationContext: this._propagationContext,\n    };\n\n    // TODO (v8): Update this order to be: Global > Client > Scope\n    return notifyEventProcessors(\n      [...(additionalEventProcessors || []), ...getGlobalEventProcessors(), ...this._eventProcessors],\n      event,\n      hint,\n    );\n  }\n\n  /**\n   * Add data which will be accessible during event processing but won't get sent to Sentry\n   */\n  public setSDKProcessingMetadata(newData: { [key: string]: unknown }): this {\n    this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...newData };\n\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setPropagationContext(context: PropagationContext): this {\n    this._propagationContext = context;\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getPropagationContext(): PropagationContext {\n    return this._propagationContext;\n  }\n\n  /**\n   * Get the breadcrumbs for this scope.\n   */\n  protected _getBreadcrumbs(): Breadcrumb[] {\n    return this._breadcrumbs;\n  }\n\n  /**\n   * This will be called on every set call.\n   */\n  protected _notifyScopeListeners(): void {\n    // We need this check for this._notifyingListeners to be able to work on scope during updates\n    // If this check is not here we'll produce endless recursion when something is done with the scope\n    // during the callback.\n    if (!this._notifyingListeners) {\n      this._notifyingListeners = true;\n      this._scopeListeners.forEach(callback => {\n        callback(this);\n      });\n      this._notifyingListeners = false;\n    }\n  }\n\n  /**\n   * Applies fingerprint from the scope to the event if there's one,\n   * uses message if there's one instead or get rid of empty fingerprint\n   */\n  private _applyFingerprint(event: Event): void {\n    // Make sure it's an array first and we actually have something in place\n    event.fingerprint = event.fingerprint ? arrayify(event.fingerprint) : [];\n\n    // If we have something on the scope, then merge it with event\n    if (this._fingerprint) {\n      event.fingerprint = event.fingerprint.concat(this._fingerprint);\n    }\n\n    // If we have no data at all, remove empty array default\n    if (event.fingerprint && !event.fingerprint.length) {\n      delete event.fingerprint;\n    }\n  }\n}\n\nfunction generatePropagationContext(): PropagationContext {\n  return {\n    traceId: uuid4(),\n    spanId: uuid4().substring(16),\n  };\n}\n","/* eslint-disable max-lines */\nimport type {\n  Breadcrumb,\n  BreadcrumbHint,\n  Client,\n  CustomSamplingContext,\n  Event,\n  EventHint,\n  Extra,\n  Extras,\n  Hub as HubInterface,\n  Integration,\n  IntegrationClass,\n  Primitive,\n  Session,\n  SessionContext,\n  Severity,\n  SeverityLevel,\n  Transaction,\n  TransactionContext,\n  User,\n} from '@sentry/types';\nimport { consoleSandbox, dateTimestampInSeconds, getGlobalSingleton, GLOBAL_OBJ, logger, uuid4 } from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from './constants';\nimport { Scope } from './scope';\nimport { closeSession, makeSession, updateSession } from './session';\n\n/**\n * API compatibility version of this hub.\n *\n * WARNING: This number should only be increased when the global interface\n * changes and new methods are introduced.\n *\n * @hidden\n */\nexport const API_VERSION = 4;\n\n/**\n * Default maximum number of breadcrumbs added to an event. Can be overwritten\n * with {@link Options.maxBreadcrumbs}.\n */\nconst DEFAULT_BREADCRUMBS = 100;\n\nexport interface RunWithAsyncContextOptions {\n  /** Whether to reuse an existing async context if one exists. Defaults to false. */\n  reuseExisting?: boolean;\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Strategy used to track async context.\n */\nexport interface AsyncContextStrategy {\n  /**\n   * Gets the current async context. Returns undefined if there is no current async context.\n   */\n  getCurrentHub: () => Hub | undefined;\n  /**\n   * Runs the supplied callback in its own async context.\n   */\n  runWithAsyncContext<T>(callback: () => T, options: RunWithAsyncContextOptions): T;\n}\n\n/**\n * A layer in the process stack.\n * @hidden\n */\nexport interface Layer {\n  client?: Client;\n  scope: Scope;\n}\n\n/**\n * An object that contains a hub and maintains a scope stack.\n * @hidden\n */\nexport interface Carrier {\n  __SENTRY__?: {\n    hub?: Hub;\n    acs?: AsyncContextStrategy;\n    /**\n     * Extra Hub properties injected by various SDKs\n     */\n    integrations?: Integration[];\n    extensions?: {\n      /** Extension methods for the hub, which are bound to the current Hub instance */\n      // eslint-disable-next-line @typescript-eslint/ban-types\n      [key: string]: Function;\n    };\n  };\n}\n\n/**\n * @inheritDoc\n */\nexport class Hub implements HubInterface {\n  /** Is a {@link Layer}[] containing the client and scope */\n  private readonly _stack: Layer[];\n\n  /** Contains the last event id of a captured event.  */\n  private _lastEventId?: string;\n\n  /**\n   * Creates a new instance of the hub, will push one {@link Layer} into the\n   * internal stack on creation.\n   *\n   * @param client bound to the hub.\n   * @param scope bound to the hub.\n   * @param version number, higher number means higher priority.\n   */\n  public constructor(client?: Client, scope: Scope = new Scope(), private readonly _version: number = API_VERSION) {\n    this._stack = [{ scope }];\n    if (client) {\n      this.bindClient(client);\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public isOlderThan(version: number): boolean {\n    return this._version < version;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public bindClient(client?: Client): void {\n    const top = this.getStackTop();\n    top.client = client;\n    if (client && client.setupIntegrations) {\n      client.setupIntegrations();\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public pushScope(): Scope {\n    // We want to clone the content of prev scope\n    const scope = Scope.clone(this.getScope());\n    this.getStack().push({\n      client: this.getClient(),\n      scope,\n    });\n    return scope;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public popScope(): boolean {\n    if (this.getStack().length <= 1) return false;\n    return !!this.getStack().pop();\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public withScope(callback: (scope: Scope) => void): void {\n    const scope = this.pushScope();\n    try {\n      callback(scope);\n    } finally {\n      this.popScope();\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getClient<C extends Client>(): C | undefined {\n    return this.getStackTop().client as C;\n  }\n\n  /** Returns the scope of the top stack. */\n  public getScope(): Scope {\n    return this.getStackTop().scope;\n  }\n\n  /** Returns the scope stack for domains or the process. */\n  public getStack(): Layer[] {\n    return this._stack;\n  }\n\n  /** Returns the topmost scope layer in the order domain > local > process. */\n  public getStackTop(): Layer {\n    return this._stack[this._stack.length - 1];\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureException(exception: unknown, hint?: EventHint): string {\n    const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());\n    const syntheticException = new Error('Sentry syntheticException');\n    this._withClient((client, scope) => {\n      client.captureException(\n        exception,\n        {\n          originalException: exception,\n          syntheticException,\n          ...hint,\n          event_id: eventId,\n        },\n        scope,\n      );\n    });\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureMessage(\n    message: string,\n    // eslint-disable-next-line deprecation/deprecation\n    level?: Severity | SeverityLevel,\n    hint?: EventHint,\n  ): string {\n    const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());\n    const syntheticException = new Error(message);\n    this._withClient((client, scope) => {\n      client.captureMessage(\n        message,\n        level,\n        {\n          originalException: message,\n          syntheticException,\n          ...hint,\n          event_id: eventId,\n        },\n        scope,\n      );\n    });\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureEvent(event: Event, hint?: EventHint): string {\n    const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n    if (!event.type) {\n      this._lastEventId = eventId;\n    }\n\n    this._withClient((client, scope) => {\n      client.captureEvent(event, { ...hint, event_id: eventId }, scope);\n    });\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public lastEventId(): string | undefined {\n    return this._lastEventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public addBreadcrumb(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void {\n    const { scope, client } = this.getStackTop();\n\n    if (!client) return;\n\n    const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } =\n      (client.getOptions && client.getOptions()) || {};\n\n    if (maxBreadcrumbs <= 0) return;\n\n    const timestamp = dateTimestampInSeconds();\n    const mergedBreadcrumb = { timestamp, ...breadcrumb };\n    const finalBreadcrumb = beforeBreadcrumb\n      ? (consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) as Breadcrumb | null)\n      : mergedBreadcrumb;\n\n    if (finalBreadcrumb === null) return;\n\n    if (client.emit) {\n      client.emit('beforeAddBreadcrumb', finalBreadcrumb, hint);\n    }\n\n    scope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setUser(user: User | null): void {\n    this.getScope().setUser(user);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTags(tags: { [key: string]: Primitive }): void {\n    this.getScope().setTags(tags);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setExtras(extras: Extras): void {\n    this.getScope().setExtras(extras);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTag(key: string, value: Primitive): void {\n    this.getScope().setTag(key, value);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setExtra(key: string, extra: Extra): void {\n    this.getScope().setExtra(key, extra);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  public setContext(name: string, context: { [key: string]: any } | null): void {\n    this.getScope().setContext(name, context);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public configureScope(callback: (scope: Scope) => void): void {\n    const { scope, client } = this.getStackTop();\n    if (client) {\n      callback(scope);\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public run(callback: (hub: Hub) => void): void {\n    const oldHub = makeMain(this);\n    try {\n      callback(this);\n    } finally {\n      makeMain(oldHub);\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null {\n    const client = this.getClient();\n    if (!client) return null;\n    try {\n      return client.getIntegration(integration);\n    } catch (_oO) {\n      __DEBUG_BUILD__ && logger.warn(`Cannot retrieve integration ${integration.id} from the current Hub`);\n      return null;\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public startTransaction(context: TransactionContext, customSamplingContext?: CustomSamplingContext): Transaction {\n    const result = this._callExtensionMethod<Transaction>('startTransaction', context, customSamplingContext);\n\n    if (__DEBUG_BUILD__ && !result) {\n      const client = this.getClient();\n      if (!client) {\n        // eslint-disable-next-line no-console\n        console.warn(\n          \"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'\",\n        );\n      } else {\n        // eslint-disable-next-line no-console\n        console.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n`);\n      }\n    }\n\n    return result;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public traceHeaders(): { [key: string]: string } {\n    return this._callExtensionMethod<{ [key: string]: string }>('traceHeaders');\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureSession(endSession: boolean = false): void {\n    // both send the update and pull the session from the scope\n    if (endSession) {\n      return this.endSession();\n    }\n\n    // only send the update\n    this._sendSessionUpdate();\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public endSession(): void {\n    const layer = this.getStackTop();\n    const scope = layer.scope;\n    const session = scope.getSession();\n    if (session) {\n      closeSession(session);\n    }\n    this._sendSessionUpdate();\n\n    // the session is over; take it off of the scope\n    scope.setSession();\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public startSession(context?: SessionContext): Session {\n    const { scope, client } = this.getStackTop();\n    const { release, environment = DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {};\n\n    // Will fetch userAgent if called from browser sdk\n    const { userAgent } = GLOBAL_OBJ.navigator || {};\n\n    const session = makeSession({\n      release,\n      environment,\n      user: scope.getUser(),\n      ...(userAgent && { userAgent }),\n      ...context,\n    });\n\n    // End existing session if there's one\n    const currentSession = scope.getSession && scope.getSession();\n    if (currentSession && currentSession.status === 'ok') {\n      updateSession(currentSession, { status: 'exited' });\n    }\n    this.endSession();\n\n    // Afterwards we set the new session on the scope\n    scope.setSession(session);\n\n    return session;\n  }\n\n  /**\n   * Returns if default PII should be sent to Sentry and propagated in ourgoing requests\n   * when Tracing is used.\n   */\n  public shouldSendDefaultPii(): boolean {\n    const client = this.getClient();\n    const options = client && client.getOptions();\n    return Boolean(options && options.sendDefaultPii);\n  }\n\n  /**\n   * Sends the current Session on the scope\n   */\n  private _sendSessionUpdate(): void {\n    const { scope, client } = this.getStackTop();\n\n    const session = scope.getSession();\n    if (session && client && client.captureSession) {\n      client.captureSession(session);\n    }\n  }\n\n  /**\n   * Internal helper function to call a method on the top client if it exists.\n   *\n   * @param method The method to call on the client.\n   * @param args Arguments to pass to the client function.\n   */\n  private _withClient(callback: (client: Client, scope: Scope) => void): void {\n    const { scope, client } = this.getStackTop();\n    if (client) {\n      callback(client, scope);\n    }\n  }\n\n  /**\n   * Calls global extension method and binding current instance to the function call\n   */\n  // @ts-expect-error Function lacks ending return statement and return type does not include 'undefined'. ts(2366)\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private _callExtensionMethod<T>(method: string, ...args: any[]): T {\n    const carrier = getMainCarrier();\n    const sentry = carrier.__SENTRY__;\n    if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {\n      return sentry.extensions[method].apply(this, args);\n    }\n    __DEBUG_BUILD__ && logger.warn(`Extension method ${method} couldn't be found, doing nothing.`);\n  }\n}\n\n/**\n * Returns the global shim registry.\n *\n * FIXME: This function is problematic, because despite always returning a valid Carrier,\n * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check\n * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.\n **/\nexport function getMainCarrier(): Carrier {\n  GLOBAL_OBJ.__SENTRY__ = GLOBAL_OBJ.__SENTRY__ || {\n    extensions: {},\n    hub: undefined,\n  };\n  return GLOBAL_OBJ;\n}\n\n/**\n * Replaces the current main hub with the passed one on the global object\n *\n * @returns The old replaced hub\n */\nexport function makeMain(hub: Hub): Hub {\n  const registry = getMainCarrier();\n  const oldHub = getHubFromCarrier(registry);\n  setHubOnCarrier(registry, hub);\n  return oldHub;\n}\n\n/**\n * Returns the default hub instance.\n *\n * If a hub is already registered in the global carrier but this module\n * contains a more recent version, it replaces the registered version.\n * Otherwise, the currently registered hub will be returned.\n */\nexport function getCurrentHub(): Hub {\n  // Get main carrier (global for every environment)\n  const registry = getMainCarrier();\n\n  if (registry.__SENTRY__ && registry.__SENTRY__.acs) {\n    const hub = registry.__SENTRY__.acs.getCurrentHub();\n\n    if (hub) {\n      return hub;\n    }\n  }\n\n  // Return hub that lives on a global object\n  return getGlobalHub(registry);\n}\n\nfunction getGlobalHub(registry: Carrier = getMainCarrier()): Hub {\n  // If there's no hub, or its an old API, assign a new one\n  if (!hasHubOnCarrier(registry) || getHubFromCarrier(registry).isOlderThan(API_VERSION)) {\n    setHubOnCarrier(registry, new Hub());\n  }\n\n  // Return hub that lives on a global object\n  return getHubFromCarrier(registry);\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * If the carrier does not contain a hub, a new hub is created with the global hub client and scope.\n */\nexport function ensureHubOnCarrier(carrier: Carrier, parent: Hub = getGlobalHub()): void {\n  // If there's no hub on current domain, or it's an old API, assign a new one\n  if (!hasHubOnCarrier(carrier) || getHubFromCarrier(carrier).isOlderThan(API_VERSION)) {\n    const globalHubTopStack = parent.getStackTop();\n    setHubOnCarrier(carrier, new Hub(globalHubTopStack.client, Scope.clone(globalHubTopStack.scope)));\n  }\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Sets the global async context strategy\n */\nexport function setAsyncContextStrategy(strategy: AsyncContextStrategy | undefined): void {\n  // Get main carrier (global for every environment)\n  const registry = getMainCarrier();\n  registry.__SENTRY__ = registry.__SENTRY__ || {};\n  registry.__SENTRY__.acs = strategy;\n}\n\n/**\n * Runs the supplied callback in its own async context. Async Context strategies are defined per SDK.\n *\n * @param callback The callback to run in its own async context\n * @param options Options to pass to the async context strategy\n * @returns The result of the callback\n */\nexport function runWithAsyncContext<T>(callback: () => T, options: RunWithAsyncContextOptions = {}): T {\n  const registry = getMainCarrier();\n\n  if (registry.__SENTRY__ && registry.__SENTRY__.acs) {\n    return registry.__SENTRY__.acs.runWithAsyncContext(callback, options);\n  }\n\n  // if there was no strategy, fallback to just calling the callback\n  return callback();\n}\n\n/**\n * This will tell whether a carrier has a hub on it or not\n * @param carrier object\n */\nfunction hasHubOnCarrier(carrier: Carrier): boolean {\n  return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub);\n}\n\n/**\n * This will create a new {@link Hub} and add to the passed object on\n * __SENTRY__.hub.\n * @param carrier object\n * @hidden\n */\nexport function getHubFromCarrier(carrier: Carrier): Hub {\n  return getGlobalSingleton<Hub>('hub', () => new Hub(), carrier);\n}\n\n/**\n * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute\n * @param carrier object\n * @param hub Hub\n * @returns A boolean indicating success or failure\n */\nexport function setHubOnCarrier(carrier: Carrier, hub: Hub): boolean {\n  if (!carrier) return false;\n  const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {});\n  __SENTRY__.hub = hub;\n  return true;\n}\n","import type { Event, StackParser } from '@sentry/types';\nimport { GLOBAL_OBJ } from '@sentry/utils';\n\n/** Keys are source filename/url, values are metadata objects. */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst filenameMetadataMap = new Map<string, any>();\n/** Set of stack strings that have already been parsed. */\nconst parsedStacks = new Set<string>();\n\nfunction ensureMetadataStacksAreParsed(parser: StackParser): void {\n  if (!GLOBAL_OBJ._sentryModuleMetadata) {\n    return;\n  }\n\n  for (const stack of Object.keys(GLOBAL_OBJ._sentryModuleMetadata)) {\n    const metadata = GLOBAL_OBJ._sentryModuleMetadata[stack];\n\n    if (parsedStacks.has(stack)) {\n      continue;\n    }\n\n    // Ensure this stack doesn't get parsed again\n    parsedStacks.add(stack);\n\n    const frames = parser(stack);\n\n    // Go through the frames starting from the top of the stack and find the first one with a filename\n    for (const frame of frames.reverse()) {\n      if (frame.filename) {\n        // Save the metadata for this filename\n        filenameMetadataMap.set(frame.filename, metadata);\n        break;\n      }\n    }\n  }\n}\n\n/**\n * Retrieve metadata for a specific JavaScript file URL.\n *\n * Metadata is injected by the Sentry bundler plugins using the `_experiments.moduleMetadata` config option.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getMetadataForUrl(parser: StackParser, filename: string): any | undefined {\n  ensureMetadataStacksAreParsed(parser);\n  return filenameMetadataMap.get(filename);\n}\n\n/**\n * Adds metadata to stack frames.\n *\n * Metadata is injected by the Sentry bundler plugins using the `_experiments.moduleMetadata` config option.\n */\nexport function addMetadataToStackFrames(parser: StackParser, event: Event): void {\n  try {\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    event.exception!.values!.forEach(exception => {\n      if (!exception.stacktrace) {\n        return;\n      }\n\n      for (const frame of exception.stacktrace.frames || []) {\n        if (!frame.filename) {\n          continue;\n        }\n\n        const metadata = getMetadataForUrl(parser, frame.filename);\n\n        if (metadata) {\n          frame.module_metadata = metadata;\n        }\n      }\n    });\n  } catch (_) {\n    // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n  }\n}\n\n/**\n * Strips metadata from stack frames.\n */\nexport function stripMetadataFromStackFrames(event: Event): void {\n  try {\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    event.exception!.values!.forEach(exception => {\n      if (!exception.stacktrace) {\n        return;\n      }\n\n      for (const frame of exception.stacktrace.frames || []) {\n        delete frame.module_metadata;\n      }\n    });\n  } catch (_) {\n    // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n  }\n}\n","import type { EventItem, EventProcessor, Hub, Integration } from '@sentry/types';\nimport { forEachEnvelopeItem } from '@sentry/utils';\n\nimport { addMetadataToStackFrames, stripMetadataFromStackFrames } from '../metadata';\n\n/**\n * Adds module metadata to stack frames.\n *\n * Metadata can be injected by the Sentry bundler plugins using the `_experiments.moduleMetadata` config option.\n *\n * When this integration is added, the metadata passed to the bundler plugin is added to the stack frames of all events\n * under the `module_metadata` property. This can be used to help in tagging or routing of events from different teams\n * our sources\n */\nexport class ModuleMetadata implements Integration {\n  /*\n   * @inheritDoc\n   */\n  public static id: string = 'ModuleMetadata';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string;\n\n  public constructor() {\n    this.name = ModuleMetadata.id;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (processor: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    const client = getCurrentHub().getClient();\n\n    if (!client || typeof client.on !== 'function') {\n      return;\n    }\n\n    // We need to strip metadata from stack frames before sending them to Sentry since these are client side only.\n    client.on('beforeEnvelope', envelope => {\n      forEachEnvelopeItem(envelope, (item, type) => {\n        if (type === 'event') {\n          const event = Array.isArray(item) ? (item as EventItem)[1] : undefined;\n\n          if (event) {\n            stripMetadataFromStackFrames(event);\n            item[1] = event;\n          }\n        }\n      });\n    });\n\n    const stackParser = client.getOptions().stackParser;\n\n    addGlobalEventProcessor(event => {\n      addMetadataToStackFrames(stackParser, event);\n      return event;\n    });\n  }\n}\n","export const SDK_VERSION = '7.73.0';\n","import type {\n  Breadcrumb,\n  CaptureContext,\n  CheckIn,\n  CustomSamplingContext,\n  Event,\n  EventHint,\n  Extra,\n  Extras,\n  MonitorConfig,\n  Primitive,\n  Severity,\n  SeverityLevel,\n  TransactionContext,\n  User,\n} from '@sentry/types';\nimport { logger, uuid4 } from '@sentry/utils';\n\nimport type { Hub } from './hub';\nimport { getCurrentHub } from './hub';\nimport type { Scope } from './scope';\n\n// Note: All functions in this file are typed with a return value of `ReturnType<Hub[HUB_FUNCTION]>`,\n// where HUB_FUNCTION is some method on the Hub class.\n//\n// This is done to make sure the top level SDK methods stay in sync with the hub methods.\n// Although every method here has an explicit return type, some of them (that map to void returns) do not\n// contain `return` keywords. This is done to save on bundle size, as `return` is not minifiable.\n\n/**\n * Captures an exception event and sends it to Sentry.\n *\n * @param exception An exception-like object.\n * @param captureContext Additional scope data to apply to exception event.\n * @returns The generated eventId.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\nexport function captureException(exception: any, captureContext?: CaptureContext): ReturnType<Hub['captureException']> {\n  return getCurrentHub().captureException(exception, { captureContext });\n}\n\n/**\n * Captures a message event and sends it to Sentry.\n *\n * @param message The message to send to Sentry.\n * @param Severity Define the level of the message.\n * @returns The generated eventId.\n */\nexport function captureMessage(\n  message: string,\n  // eslint-disable-next-line deprecation/deprecation\n  captureContext?: CaptureContext | Severity | SeverityLevel,\n): ReturnType<Hub['captureMessage']> {\n  // This is necessary to provide explicit scopes upgrade, without changing the original\n  // arity of the `captureMessage(message, level)` method.\n  const level = typeof captureContext === 'string' ? captureContext : undefined;\n  const context = typeof captureContext !== 'string' ? { captureContext } : undefined;\n  return getCurrentHub().captureMessage(message, level, context);\n}\n\n/**\n * Captures a manually created event and sends it to Sentry.\n *\n * @param event The event to send to Sentry.\n * @returns The generated eventId.\n */\nexport function captureEvent(event: Event, hint?: EventHint): ReturnType<Hub['captureEvent']> {\n  return getCurrentHub().captureEvent(event, hint);\n}\n\n/**\n * Callback to set context information onto the scope.\n * @param callback Callback function that receives Scope.\n */\nexport function configureScope(callback: (scope: Scope) => void): ReturnType<Hub['configureScope']> {\n  getCurrentHub().configureScope(callback);\n}\n\n/**\n * Records a new breadcrumb which will be attached to future events.\n *\n * Breadcrumbs will be added to subsequent events to provide more context on\n * user's actions prior to an error or crash.\n *\n * @param breadcrumb The breadcrumb to record.\n */\nexport function addBreadcrumb(breadcrumb: Breadcrumb): ReturnType<Hub['addBreadcrumb']> {\n  getCurrentHub().addBreadcrumb(breadcrumb);\n}\n\n/**\n * Sets context data with the given name.\n * @param name of the context\n * @param context Any kind of data. This data will be normalized.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function setContext(name: string, context: { [key: string]: any } | null): ReturnType<Hub['setContext']> {\n  getCurrentHub().setContext(name, context);\n}\n\n/**\n * Set an object that will be merged sent as extra data with the event.\n * @param extras Extras object to merge into current context.\n */\nexport function setExtras(extras: Extras): ReturnType<Hub['setExtras']> {\n  getCurrentHub().setExtras(extras);\n}\n\n/**\n * Set key:value that will be sent as extra data with the event.\n * @param key String of extra\n * @param extra Any kind of data. This data will be normalized.\n */\nexport function setExtra(key: string, extra: Extra): ReturnType<Hub['setExtra']> {\n  getCurrentHub().setExtra(key, extra);\n}\n\n/**\n * Set an object that will be merged sent as tags data with the event.\n * @param tags Tags context object to merge into current context.\n */\nexport function setTags(tags: { [key: string]: Primitive }): ReturnType<Hub['setTags']> {\n  getCurrentHub().setTags(tags);\n}\n\n/**\n * Set key:value that will be sent as tags data with the event.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key String key of tag\n * @param value Value of tag\n */\nexport function setTag(key: string, value: Primitive): ReturnType<Hub['setTag']> {\n  getCurrentHub().setTag(key, value);\n}\n\n/**\n * Updates user context information for future events.\n *\n * @param user User context object to be set in the current context. Pass `null` to unset the user.\n */\nexport function setUser(user: User | null): ReturnType<Hub['setUser']> {\n  getCurrentHub().setUser(user);\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n *     pushScope();\n *     callback();\n *     popScope();\n *\n * @param callback that will be enclosed into push/popScope.\n */\nexport function withScope(callback: (scope: Scope) => void): ReturnType<Hub['withScope']> {\n  getCurrentHub().withScope(callback);\n}\n\n/**\n * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.\n *\n * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a\n * new child span within the transaction or any span, call the respective `.startChild()` method.\n *\n * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.\n *\n * The transaction must be finished with a call to its `.finish()` method, at which point the transaction with all its\n * finished child spans will be sent to Sentry.\n *\n * NOTE: This function should only be used for *manual* instrumentation. Auto-instrumentation should call\n * `startTransaction` directly on the hub.\n *\n * @param context Properties of the new `Transaction`.\n * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent\n * default values). See {@link Options.tracesSampler}.\n *\n * @returns The transaction which was just started\n */\nexport function startTransaction(\n  context: TransactionContext,\n  customSamplingContext?: CustomSamplingContext,\n): ReturnType<Hub['startTransaction']> {\n  return getCurrentHub().startTransaction({ ...context }, customSamplingContext);\n}\n\n/**\n * Create a cron monitor check in and send it to Sentry.\n *\n * @param checkIn An object that describes a check in.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nexport function captureCheckIn(checkIn: CheckIn, upsertMonitorConfig?: MonitorConfig): string {\n  const hub = getCurrentHub();\n  const scope = hub.getScope();\n  const client = hub.getClient();\n  if (!client) {\n    __DEBUG_BUILD__ && logger.warn('Cannot capture check-in. No client defined.');\n  } else if (!client.captureCheckIn) {\n    __DEBUG_BUILD__ && logger.warn('Cannot capture check-in. Client does not support sending check-ins.');\n  } else {\n    return client.captureCheckIn(checkIn, upsertMonitorConfig, scope);\n  }\n\n  return uuid4();\n}\n\n/**\n * Call `flush()` on the current client, if there is one. See {@link Client.flush}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause\n * the client to wait until all events are sent before resolving the promise.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function flush(timeout?: number): Promise<boolean> {\n  const client = getCurrentHub().getClient();\n  if (client) {\n    return client.flush(timeout);\n  }\n  __DEBUG_BUILD__ && logger.warn('Cannot flush events. No client defined.');\n  return Promise.resolve(false);\n}\n\n/**\n * Call `close()` on the current client, if there is one. See {@link Client.close}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this\n * parameter will cause the client to wait until all events are sent before disabling itself.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function close(timeout?: number): Promise<boolean> {\n  const client = getCurrentHub().getClient();\n  if (client) {\n    return client.close(timeout);\n  }\n  __DEBUG_BUILD__ && logger.warn('Cannot flush events and disable SDK. No client defined.');\n  return Promise.resolve(false);\n}\n\n/**\n * This is the getter for lastEventId.\n *\n * @returns The last event id of a captured event.\n */\nexport function lastEventId(): string | undefined {\n  return getCurrentHub().lastEventId();\n}\n","import type { Options } from '@sentry/types';\n\nimport { getCurrentHub } from '../hub';\n\n// Treeshakable guard to remove all code related to tracing\ndeclare const __SENTRY_TRACING__: boolean | undefined;\n\n/**\n * Determines if tracing is currently enabled.\n *\n * Tracing is enabled when at least one of `tracesSampleRate` and `tracesSampler` is defined in the SDK config.\n */\nexport function hasTracingEnabled(\n  maybeOptions?: Pick<Options, 'tracesSampleRate' | 'tracesSampler' | 'enableTracing'> | undefined,\n): boolean {\n  if (typeof __SENTRY_TRACING__ === 'boolean' && !__SENTRY_TRACING__) {\n    return false;\n  }\n\n  const client = getCurrentHub().getClient();\n  const options = maybeOptions || (client && client.getOptions());\n  return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options);\n}\n","import type { Transaction } from '@sentry/types';\n\nimport type { Hub } from '../hub';\nimport { getCurrentHub } from '../hub';\n\n/**\n * The `extractTraceparentData` function and `TRACEPARENT_REGEXP` constant used\n * to be declared in this file. It was later moved into `@sentry/utils` as part of a\n * move to remove `@sentry/tracing` dependencies from `@sentry/node` (`extractTraceparentData`\n * is the only tracing function used by `@sentry/node`).\n *\n * These exports are kept here for backwards compatability's sake.\n *\n * TODO(v7): Reorganize these exports\n *\n * See https://github.com/getsentry/sentry-javascript/issues/4642 for more details.\n */\nexport { TRACEPARENT_REGEXP, extractTraceparentData } from '@sentry/utils';\n\n/** Grabs active transaction off scope, if any */\nexport function getActiveTransaction<T extends Transaction>(maybeHub?: Hub): T | undefined {\n  const hub = maybeHub || getCurrentHub();\n  const scope = hub.getScope();\n  return scope.getTransaction() as T | undefined;\n}\n\n// so it can be used in manual instrumentation without necessitating a hard dependency on @sentry/utils\nexport { stripUrlQueryAndFragment } from '@sentry/utils';\n","import { addInstrumentationHandler, logger } from '@sentry/utils';\n\nimport type { SpanStatusType } from './span';\nimport { getActiveTransaction } from './utils';\n\nlet errorsInstrumented = false;\n\n/**\n * Configures global error listeners\n */\nexport function registerErrorInstrumentation(): void {\n  if (errorsInstrumented) {\n    return;\n  }\n\n  errorsInstrumented = true;\n  addInstrumentationHandler('error', errorCallback);\n  addInstrumentationHandler('unhandledrejection', errorCallback);\n}\n\n/**\n * If an error or unhandled promise occurs, we mark the active transaction as failed\n */\nfunction errorCallback(): void {\n  const activeTransaction = getActiveTransaction();\n  if (activeTransaction) {\n    const status: SpanStatusType = 'internal_error';\n    __DEBUG_BUILD__ && logger.log(`[Tracing] Transaction: ${status} -> Global error occured`);\n    activeTransaction.setStatus(status);\n  }\n}\n\n// The function name will be lost when bundling but we need to be able to identify this listener later to maintain the\n// node.js default exit behaviour\nerrorCallback.tag = 'sentry_tracingErrorCallback';\n","/* eslint-disable max-lines */\nimport type {\n  Instrumenter,\n  Primitive,\n  Span as SpanInterface,\n  SpanContext,\n  SpanOrigin,\n  TraceContext,\n  Transaction,\n} from '@sentry/types';\nimport { dropUndefinedKeys, generateSentryTraceHeader, logger, timestampInSeconds, uuid4 } from '@sentry/utils';\n\n/**\n * Keeps track of finished spans for a given transaction\n * @internal\n * @hideconstructor\n * @hidden\n */\nexport class SpanRecorder {\n  public spans: Span[];\n\n  private readonly _maxlen: number;\n\n  public constructor(maxlen: number = 1000) {\n    this._maxlen = maxlen;\n    this.spans = [];\n  }\n\n  /**\n   * This is just so that we don't run out of memory while recording a lot\n   * of spans. At some point we just stop and flush out the start of the\n   * trace tree (i.e.the first n spans with the smallest\n   * start_timestamp).\n   */\n  public add(span: Span): void {\n    if (this.spans.length > this._maxlen) {\n      span.spanRecorder = undefined;\n    } else {\n      this.spans.push(span);\n    }\n  }\n}\n\n/**\n * Span contains all data about a span\n */\nexport class Span implements SpanInterface {\n  /**\n   * @inheritDoc\n   */\n  public traceId: string;\n\n  /**\n   * @inheritDoc\n   */\n  public spanId: string;\n\n  /**\n   * @inheritDoc\n   */\n  public parentSpanId?: string;\n\n  /**\n   * Internal keeper of the status\n   */\n  public status?: SpanStatusType | string;\n\n  /**\n   * @inheritDoc\n   */\n  public sampled?: boolean;\n\n  /**\n   * Timestamp in seconds when the span was created.\n   */\n  public startTimestamp: number;\n\n  /**\n   * Timestamp in seconds when the span ended.\n   */\n  public endTimestamp?: number;\n\n  /**\n   * @inheritDoc\n   */\n  public op?: string;\n\n  /**\n   * @inheritDoc\n   */\n  public description?: string;\n\n  /**\n   * @inheritDoc\n   */\n  public tags: { [key: string]: Primitive };\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  public data: { [key: string]: any };\n\n  /**\n   * List of spans that were finalized\n   */\n  public spanRecorder?: SpanRecorder;\n\n  /**\n   * @inheritDoc\n   */\n  public transaction?: Transaction;\n\n  /**\n   * The instrumenter that created this span.\n   */\n  public instrumenter: Instrumenter;\n\n  /**\n   * The origin of the span, giving context about what created the span.\n   */\n  public origin?: SpanOrigin;\n\n  /**\n   * You should never call the constructor manually, always use `Sentry.startTransaction()`\n   * or call `startChild()` on an existing span.\n   * @internal\n   * @hideconstructor\n   * @hidden\n   */\n  public constructor(spanContext: SpanContext = {}) {\n    this.traceId = spanContext.traceId || uuid4();\n    this.spanId = spanContext.spanId || uuid4().substring(16);\n    this.startTimestamp = spanContext.startTimestamp || timestampInSeconds();\n    this.tags = spanContext.tags || {};\n    this.data = spanContext.data || {};\n    this.instrumenter = spanContext.instrumenter || 'sentry';\n    this.origin = spanContext.origin || 'manual';\n\n    if (spanContext.parentSpanId) {\n      this.parentSpanId = spanContext.parentSpanId;\n    }\n    // We want to include booleans as well here\n    if ('sampled' in spanContext) {\n      this.sampled = spanContext.sampled;\n    }\n    if (spanContext.op) {\n      this.op = spanContext.op;\n    }\n    if (spanContext.description) {\n      this.description = spanContext.description;\n    }\n    if (spanContext.name) {\n      this.description = spanContext.name;\n    }\n    if (spanContext.status) {\n      this.status = spanContext.status;\n    }\n    if (spanContext.endTimestamp) {\n      this.endTimestamp = spanContext.endTimestamp;\n    }\n  }\n\n  /** An alias for `description` of the Span. */\n  public get name(): string {\n    return this.description || '';\n  }\n  /** Update the name of the span. */\n  public set name(name: string) {\n    this.setName(name);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public startChild(\n    spanContext?: Pick<SpanContext, Exclude<keyof SpanContext, 'sampled' | 'traceId' | 'parentSpanId'>>,\n  ): Span {\n    const childSpan = new Span({\n      ...spanContext,\n      parentSpanId: this.spanId,\n      sampled: this.sampled,\n      traceId: this.traceId,\n    });\n\n    childSpan.spanRecorder = this.spanRecorder;\n    if (childSpan.spanRecorder) {\n      childSpan.spanRecorder.add(childSpan);\n    }\n\n    childSpan.transaction = this.transaction;\n\n    if (__DEBUG_BUILD__ && childSpan.transaction) {\n      const opStr = (spanContext && spanContext.op) || '< unknown op >';\n      const nameStr = childSpan.transaction.name || '< unknown name >';\n      const idStr = childSpan.transaction.spanId;\n\n      const logMessage = `[Tracing] Starting '${opStr}' span on transaction '${nameStr}' (${idStr}).`;\n      childSpan.transaction.metadata.spanMetadata[childSpan.spanId] = { logMessage };\n      logger.log(logMessage);\n    }\n\n    return childSpan;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTag(key: string, value: Primitive): this {\n    this.tags = { ...this.tags, [key]: value };\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n  public setData(key: string, value: any): this {\n    this.data = { ...this.data, [key]: value };\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setStatus(value: SpanStatusType): this {\n    this.status = value;\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setHttpStatus(httpStatus: number): this {\n    this.setTag('http.status_code', String(httpStatus));\n    this.setData('http.response.status_code', httpStatus);\n    const spanStatus = spanStatusfromHttpCode(httpStatus);\n    if (spanStatus !== 'unknown_error') {\n      this.setStatus(spanStatus);\n    }\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setName(name: string): void {\n    this.description = name;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public isSuccess(): boolean {\n    return this.status === 'ok';\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public finish(endTimestamp?: number): void {\n    if (\n      __DEBUG_BUILD__ &&\n      // Don't call this for transactions\n      this.transaction &&\n      this.transaction.spanId !== this.spanId\n    ) {\n      const { logMessage } = this.transaction.metadata.spanMetadata[this.spanId];\n      if (logMessage) {\n        logger.log((logMessage as string).replace('Starting', 'Finishing'));\n      }\n    }\n\n    this.endTimestamp = typeof endTimestamp === 'number' ? endTimestamp : timestampInSeconds();\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public toTraceparent(): string {\n    return generateSentryTraceHeader(this.traceId, this.spanId, this.sampled);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public toContext(): SpanContext {\n    return dropUndefinedKeys({\n      data: this.data,\n      description: this.description,\n      endTimestamp: this.endTimestamp,\n      op: this.op,\n      parentSpanId: this.parentSpanId,\n      sampled: this.sampled,\n      spanId: this.spanId,\n      startTimestamp: this.startTimestamp,\n      status: this.status,\n      tags: this.tags,\n      traceId: this.traceId,\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public updateWithContext(spanContext: SpanContext): this {\n    this.data = spanContext.data || {};\n    this.description = spanContext.description;\n    this.endTimestamp = spanContext.endTimestamp;\n    this.op = spanContext.op;\n    this.parentSpanId = spanContext.parentSpanId;\n    this.sampled = spanContext.sampled;\n    this.spanId = spanContext.spanId || this.spanId;\n    this.startTimestamp = spanContext.startTimestamp || this.startTimestamp;\n    this.status = spanContext.status;\n    this.tags = spanContext.tags || {};\n    this.traceId = spanContext.traceId || this.traceId;\n\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getTraceContext(): TraceContext {\n    return dropUndefinedKeys({\n      data: Object.keys(this.data).length > 0 ? this.data : undefined,\n      description: this.description,\n      op: this.op,\n      parent_span_id: this.parentSpanId,\n      span_id: this.spanId,\n      status: this.status,\n      tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,\n      trace_id: this.traceId,\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public toJSON(): {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    data?: { [key: string]: any };\n    description?: string;\n    op?: string;\n    parent_span_id?: string;\n    span_id: string;\n    start_timestamp: number;\n    status?: string;\n    tags?: { [key: string]: Primitive };\n    timestamp?: number;\n    trace_id: string;\n    origin?: SpanOrigin;\n  } {\n    return dropUndefinedKeys({\n      data: Object.keys(this.data).length > 0 ? this.data : undefined,\n      description: this.description,\n      op: this.op,\n      parent_span_id: this.parentSpanId,\n      span_id: this.spanId,\n      start_timestamp: this.startTimestamp,\n      status: this.status,\n      tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,\n      timestamp: this.endTimestamp,\n      trace_id: this.traceId,\n      origin: this.origin,\n    });\n  }\n}\n\nexport type SpanStatusType =\n  /** The operation completed successfully. */\n  | 'ok'\n  /** Deadline expired before operation could complete. */\n  | 'deadline_exceeded'\n  /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */\n  | 'unauthenticated'\n  /** 403 Forbidden */\n  | 'permission_denied'\n  /** 404 Not Found. Some requested entity (file or directory) was not found. */\n  | 'not_found'\n  /** 429 Too Many Requests */\n  | 'resource_exhausted'\n  /** Client specified an invalid argument. 4xx. */\n  | 'invalid_argument'\n  /** 501 Not Implemented */\n  | 'unimplemented'\n  /** 503 Service Unavailable */\n  | 'unavailable'\n  /** Other/generic 5xx. */\n  | 'internal_error'\n  /** Unknown. Any non-standard HTTP status code. */\n  | 'unknown_error'\n  /** The operation was cancelled (typically by the user). */\n  | 'cancelled'\n  /** Already exists (409) */\n  | 'already_exists'\n  /** Operation was rejected because the system is not in a state required for the operation's */\n  | 'failed_precondition'\n  /** The operation was aborted, typically due to a concurrency issue. */\n  | 'aborted'\n  /** Operation was attempted past the valid range. */\n  | 'out_of_range'\n  /** Unrecoverable data loss or corruption */\n  | 'data_loss';\n\n/**\n * Converts a HTTP status code into a {@link SpanStatusType}.\n *\n * @param httpStatus The HTTP response status code.\n * @returns The span status or unknown_error.\n */\nexport function spanStatusfromHttpCode(httpStatus: number): SpanStatusType {\n  if (httpStatus < 400 && httpStatus >= 100) {\n    return 'ok';\n  }\n\n  if (httpStatus >= 400 && httpStatus < 500) {\n    switch (httpStatus) {\n      case 401:\n        return 'unauthenticated';\n      case 403:\n        return 'permission_denied';\n      case 404:\n        return 'not_found';\n      case 409:\n        return 'already_exists';\n      case 413:\n        return 'failed_precondition';\n      case 429:\n        return 'resource_exhausted';\n      default:\n        return 'invalid_argument';\n    }\n  }\n\n  if (httpStatus >= 500 && httpStatus < 600) {\n    switch (httpStatus) {\n      case 501:\n        return 'unimplemented';\n      case 503:\n        return 'unavailable';\n      case 504:\n        return 'deadline_exceeded';\n      default:\n        return 'internal_error';\n    }\n  }\n\n  return 'unknown_error';\n}\n","import type { Client, DynamicSamplingContext, Scope } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from '../constants';\n\n/**\n * Creates a dynamic sampling context from a client.\n *\n * Dispatchs the `createDsc` lifecycle hook as a side effect.\n */\nexport function getDynamicSamplingContextFromClient(\n  trace_id: string,\n  client: Client,\n  scope?: Scope,\n): DynamicSamplingContext {\n  const options = client.getOptions();\n\n  const { publicKey: public_key } = client.getDsn() || {};\n  const { segment: user_segment } = (scope && scope.getUser()) || {};\n\n  const dsc = dropUndefinedKeys({\n    environment: options.environment || DEFAULT_ENVIRONMENT,\n    release: options.release,\n    user_segment,\n    public_key,\n    trace_id,\n  }) as DynamicSamplingContext;\n\n  client.emit && client.emit('createDsc', dsc);\n\n  return dsc;\n}\n","import type {\n  Context,\n  Contexts,\n  DynamicSamplingContext,\n  Measurements,\n  MeasurementUnit,\n  Transaction as TransactionInterface,\n  TransactionContext,\n  TransactionEvent,\n  TransactionMetadata,\n} from '@sentry/types';\nimport { dropUndefinedKeys, logger } from '@sentry/utils';\n\nimport type { Hub } from '../hub';\nimport { getCurrentHub } from '../hub';\nimport { getDynamicSamplingContextFromClient } from './dynamicSamplingContext';\nimport { Span as SpanClass, SpanRecorder } from './span';\n\n/** JSDoc */\nexport class Transaction extends SpanClass implements TransactionInterface {\n  public metadata: TransactionMetadata;\n\n  /**\n   * The reference to the current hub.\n   */\n  public _hub: Hub;\n\n  private _name: string;\n\n  private _measurements: Measurements;\n\n  private _contexts: Contexts;\n\n  private _trimEnd?: boolean;\n\n  private _frozenDynamicSamplingContext: Readonly<Partial<DynamicSamplingContext>> | undefined;\n\n  /**\n   * This constructor should never be called manually. Those instrumenting tracing should use\n   * `Sentry.startTransaction()`, and internal methods should use `hub.startTransaction()`.\n   * @internal\n   * @hideconstructor\n   * @hidden\n   */\n  public constructor(transactionContext: TransactionContext, hub?: Hub) {\n    super(transactionContext);\n    // We need to delete description since it's set by the Span class constructor\n    // but not needed for transactions.\n    delete this.description;\n\n    this._measurements = {};\n    this._contexts = {};\n\n    this._hub = hub || getCurrentHub();\n\n    this._name = transactionContext.name || '';\n\n    this.metadata = {\n      source: 'custom',\n      ...transactionContext.metadata,\n      spanMetadata: {},\n    };\n\n    this._trimEnd = transactionContext.trimEnd;\n\n    // this is because transactions are also spans, and spans have a transaction pointer\n    this.transaction = this;\n\n    // If Dynamic Sampling Context is provided during the creation of the transaction, we freeze it as it usually means\n    // there is incoming Dynamic Sampling Context. (Either through an incoming request, a baggage meta-tag, or other means)\n    const incomingDynamicSamplingContext = this.metadata.dynamicSamplingContext;\n    if (incomingDynamicSamplingContext) {\n      // We shallow copy this in case anything writes to the original reference of the passed in `dynamicSamplingContext`\n      this._frozenDynamicSamplingContext = { ...incomingDynamicSamplingContext };\n    }\n  }\n\n  /** Getter for `name` property */\n  public get name(): string {\n    return this._name;\n  }\n\n  /** Setter for `name` property, which also sets `source` as custom */\n  public set name(newName: string) {\n    this.setName(newName);\n  }\n\n  /**\n   * JSDoc\n   */\n  public setName(name: string, source: TransactionMetadata['source'] = 'custom'): void {\n    this._name = name;\n    this.metadata.source = source;\n  }\n\n  /**\n   * Attaches SpanRecorder to the span itself\n   * @param maxlen maximum number of spans that can be recorded\n   */\n  public initSpanRecorder(maxlen: number = 1000): void {\n    if (!this.spanRecorder) {\n      this.spanRecorder = new SpanRecorder(maxlen);\n    }\n    this.spanRecorder.add(this);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setContext(key: string, context: Context | null): void {\n    if (context === null) {\n      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n      delete this._contexts[key];\n    } else {\n      this._contexts[key] = context;\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setMeasurement(name: string, value: number, unit: MeasurementUnit = ''): void {\n    this._measurements[name] = { value, unit };\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setMetadata(newMetadata: Partial<TransactionMetadata>): void {\n    this.metadata = { ...this.metadata, ...newMetadata };\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public finish(endTimestamp?: number): string | undefined {\n    const transaction = this._finishTransaction(endTimestamp);\n    if (!transaction) {\n      return undefined;\n    }\n    return this._hub.captureEvent(transaction);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public toContext(): TransactionContext {\n    const spanContext = super.toContext();\n\n    return dropUndefinedKeys({\n      ...spanContext,\n      name: this.name,\n      trimEnd: this._trimEnd,\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public updateWithContext(transactionContext: TransactionContext): this {\n    super.updateWithContext(transactionContext);\n\n    this.name = transactionContext.name || '';\n\n    this._trimEnd = transactionContext.trimEnd;\n\n    return this;\n  }\n\n  /**\n   * @inheritdoc\n   *\n   * @experimental\n   */\n  public getDynamicSamplingContext(): Readonly<Partial<DynamicSamplingContext>> {\n    if (this._frozenDynamicSamplingContext) {\n      return this._frozenDynamicSamplingContext;\n    }\n\n    const hub = this._hub || getCurrentHub();\n    const client = hub.getClient();\n\n    if (!client) return {};\n\n    const scope = hub.getScope();\n    const dsc = getDynamicSamplingContextFromClient(this.traceId, client, scope);\n\n    const maybeSampleRate = this.metadata.sampleRate;\n    if (maybeSampleRate !== undefined) {\n      dsc.sample_rate = `${maybeSampleRate}`;\n    }\n\n    // We don't want to have a transaction name in the DSC if the source is \"url\" because URLs might contain PII\n    const source = this.metadata.source;\n    if (source && source !== 'url') {\n      dsc.transaction = this.name;\n    }\n\n    if (this.sampled !== undefined) {\n      dsc.sampled = String(this.sampled);\n    }\n\n    // Uncomment if we want to make DSC immutable\n    // this._frozenDynamicSamplingContext = dsc;\n\n    return dsc;\n  }\n\n  /**\n   * Override the current hub with a new one.\n   * Used if you want another hub to finish the transaction.\n   *\n   * @internal\n   */\n  public setHub(hub: Hub): void {\n    this._hub = hub;\n  }\n\n  /**\n   * Finish the transaction & prepare the event to send to Sentry.\n   */\n  protected _finishTransaction(endTimestamp?: number): TransactionEvent | undefined {\n    // This transaction is already finished, so we should not flush it again.\n    if (this.endTimestamp !== undefined) {\n      return undefined;\n    }\n\n    if (!this.name) {\n      __DEBUG_BUILD__ && logger.warn('Transaction has no name, falling back to `<unlabeled transaction>`.');\n      this.name = '<unlabeled transaction>';\n    }\n\n    // just sets the end timestamp\n    super.finish(endTimestamp);\n\n    const client = this._hub.getClient();\n    if (client && client.emit) {\n      client.emit('finishTransaction', this);\n    }\n\n    if (this.sampled !== true) {\n      // At this point if `sampled !== true` we want to discard the transaction.\n      __DEBUG_BUILD__ && logger.log('[Tracing] Discarding transaction because its trace was not chosen to be sampled.');\n\n      if (client) {\n        client.recordDroppedEvent('sample_rate', 'transaction');\n      }\n\n      return undefined;\n    }\n\n    const finishedSpans = this.spanRecorder ? this.spanRecorder.spans.filter(s => s !== this && s.endTimestamp) : [];\n\n    if (this._trimEnd && finishedSpans.length > 0) {\n      this.endTimestamp = finishedSpans.reduce((prev: SpanClass, current: SpanClass) => {\n        if (prev.endTimestamp && current.endTimestamp) {\n          return prev.endTimestamp > current.endTimestamp ? prev : current;\n        }\n        return prev;\n      }).endTimestamp;\n    }\n\n    const metadata = this.metadata;\n\n    const transaction: TransactionEvent = {\n      contexts: {\n        ...this._contexts,\n        // We don't want to override trace context\n        trace: this.getTraceContext(),\n      },\n      spans: finishedSpans,\n      start_timestamp: this.startTimestamp,\n      tags: this.tags,\n      timestamp: this.endTimestamp,\n      transaction: this.name,\n      type: 'transaction',\n      sdkProcessingMetadata: {\n        ...metadata,\n        dynamicSamplingContext: this.getDynamicSamplingContext(),\n      },\n      ...(metadata.source && {\n        transaction_info: {\n          source: metadata.source,\n        },\n      }),\n    };\n\n    const hasMeasurements = Object.keys(this._measurements).length > 0;\n\n    if (hasMeasurements) {\n      __DEBUG_BUILD__ &&\n        logger.log(\n          '[Measurements] Adding measurements to transaction',\n          JSON.stringify(this._measurements, undefined, 2),\n        );\n      transaction.measurements = this._measurements;\n    }\n\n    __DEBUG_BUILD__ && logger.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`);\n\n    return transaction;\n  }\n}\n","/* eslint-disable max-lines */\nimport type { TransactionContext } from '@sentry/types';\nimport { logger, timestampInSeconds } from '@sentry/utils';\n\nimport type { Hub } from '../hub';\nimport type { Span } from './span';\nimport { SpanRecorder } from './span';\nimport { Transaction } from './transaction';\n\nexport const TRACING_DEFAULTS = {\n  idleTimeout: 1000,\n  finalTimeout: 30000,\n  heartbeatInterval: 5000,\n};\n\nconst FINISH_REASON_TAG = 'finishReason';\n\nconst IDLE_TRANSACTION_FINISH_REASONS = [\n  'heartbeatFailed',\n  'idleTimeout',\n  'documentHidden',\n  'finalTimeout',\n  'externalFinish',\n  'cancelled',\n];\n\n/**\n * @inheritDoc\n */\nexport class IdleTransactionSpanRecorder extends SpanRecorder {\n  public constructor(\n    private readonly _pushActivity: (id: string) => void,\n    private readonly _popActivity: (id: string) => void,\n    public transactionSpanId: string,\n    maxlen?: number,\n  ) {\n    super(maxlen);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public add(span: Span): void {\n    // We should make sure we do not push and pop activities for\n    // the transaction that this span recorder belongs to.\n    if (span.spanId !== this.transactionSpanId) {\n      // We patch span.finish() to pop an activity after setting an endTimestamp.\n      span.finish = (endTimestamp?: number) => {\n        span.endTimestamp = typeof endTimestamp === 'number' ? endTimestamp : timestampInSeconds();\n        this._popActivity(span.spanId);\n      };\n\n      // We should only push new activities if the span does not have an end timestamp.\n      if (span.endTimestamp === undefined) {\n        this._pushActivity(span.spanId);\n      }\n    }\n\n    super.add(span);\n  }\n}\n\nexport type BeforeFinishCallback = (transactionSpan: IdleTransaction, endTimestamp: number) => void;\n\n/**\n * An IdleTransaction is a transaction that automatically finishes. It does this by tracking child spans as activities.\n * You can have multiple IdleTransactions active, but if the `onScope` option is specified, the idle transaction will\n * put itself on the scope on creation.\n */\nexport class IdleTransaction extends Transaction {\n  // Activities store a list of active spans\n  public activities: Record<string, boolean>;\n  // Track state of activities in previous heartbeat\n  private _prevHeartbeatString: string | undefined;\n\n  // Amount of times heartbeat has counted. Will cause transaction to finish after 3 beats.\n  private _heartbeatCounter: number;\n\n  // We should not use heartbeat if we finished a transaction\n  private _finished: boolean;\n\n  // Idle timeout was canceled and we should finish the transaction with the last span end.\n  private _idleTimeoutCanceledPermanently: boolean;\n\n  private readonly _beforeFinishCallbacks: BeforeFinishCallback[];\n\n  /**\n   * Timer that tracks Transaction idleTimeout\n   */\n  private _idleTimeoutID: ReturnType<typeof setTimeout> | undefined;\n\n  private _finishReason: (typeof IDLE_TRANSACTION_FINISH_REASONS)[number];\n\n  public constructor(\n    transactionContext: TransactionContext,\n    private readonly _idleHub: Hub,\n    /**\n     * The time to wait in ms until the idle transaction will be finished. This timer is started each time\n     * there are no active spans on this transaction.\n     */\n    private readonly _idleTimeout: number = TRACING_DEFAULTS.idleTimeout,\n    /**\n     * The final value in ms that a transaction cannot exceed\n     */\n    private readonly _finalTimeout: number = TRACING_DEFAULTS.finalTimeout,\n    private readonly _heartbeatInterval: number = TRACING_DEFAULTS.heartbeatInterval,\n    // Whether or not the transaction should put itself on the scope when it starts and pop itself off when it ends\n    private readonly _onScope: boolean = false,\n  ) {\n    super(transactionContext, _idleHub);\n\n    this.activities = {};\n    this._heartbeatCounter = 0;\n    this._finished = false;\n    this._idleTimeoutCanceledPermanently = false;\n    this._beforeFinishCallbacks = [];\n    this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[4];\n\n    if (_onScope) {\n      // We set the transaction here on the scope so error events pick up the trace\n      // context and attach it to the error.\n      __DEBUG_BUILD__ && logger.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`);\n      _idleHub.configureScope(scope => scope.setSpan(this));\n    }\n\n    this._restartIdleTimeout();\n    setTimeout(() => {\n      if (!this._finished) {\n        this.setStatus('deadline_exceeded');\n        this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[3];\n        this.finish();\n      }\n    }, this._finalTimeout);\n  }\n\n  /** {@inheritDoc} */\n  public finish(endTimestamp: number = timestampInSeconds()): string | undefined {\n    this._finished = true;\n    this.activities = {};\n\n    if (this.op === 'ui.action.click') {\n      this.setTag(FINISH_REASON_TAG, this._finishReason);\n    }\n\n    if (this.spanRecorder) {\n      __DEBUG_BUILD__ &&\n        logger.log('[Tracing] finishing IdleTransaction', new Date(endTimestamp * 1000).toISOString(), this.op);\n\n      for (const callback of this._beforeFinishCallbacks) {\n        callback(this, endTimestamp);\n      }\n\n      this.spanRecorder.spans = this.spanRecorder.spans.filter((span: Span) => {\n        // If we are dealing with the transaction itself, we just return it\n        if (span.spanId === this.spanId) {\n          return true;\n        }\n\n        // We cancel all pending spans with status \"cancelled\" to indicate the idle transaction was finished early\n        if (!span.endTimestamp) {\n          span.endTimestamp = endTimestamp;\n          span.setStatus('cancelled');\n          __DEBUG_BUILD__ &&\n            logger.log('[Tracing] cancelling span since transaction ended early', JSON.stringify(span, undefined, 2));\n        }\n\n        const spanStartedBeforeTransactionFinish = span.startTimestamp < endTimestamp;\n\n        // Add a delta with idle timeout so that we prevent false positives\n        const timeoutWithMarginOfError = (this._finalTimeout + this._idleTimeout) / 1000;\n        const spanEndedBeforeFinalTimeout = span.endTimestamp - this.startTimestamp < timeoutWithMarginOfError;\n\n        if (__DEBUG_BUILD__) {\n          const stringifiedSpan = JSON.stringify(span, undefined, 2);\n          if (!spanStartedBeforeTransactionFinish) {\n            logger.log('[Tracing] discarding Span since it happened after Transaction was finished', stringifiedSpan);\n          } else if (!spanEndedBeforeFinalTimeout) {\n            logger.log('[Tracing] discarding Span since it finished after Transaction final timeout', stringifiedSpan);\n          }\n        }\n\n        return spanStartedBeforeTransactionFinish && spanEndedBeforeFinalTimeout;\n      });\n\n      __DEBUG_BUILD__ && logger.log('[Tracing] flushing IdleTransaction');\n    } else {\n      __DEBUG_BUILD__ && logger.log('[Tracing] No active IdleTransaction');\n    }\n\n    // if `this._onScope` is `true`, the transaction put itself on the scope when it started\n    if (this._onScope) {\n      const scope = this._idleHub.getScope();\n      if (scope.getTransaction() === this) {\n        scope.setSpan(undefined);\n      }\n    }\n\n    return super.finish(endTimestamp);\n  }\n\n  /**\n   * Register a callback function that gets excecuted before the transaction finishes.\n   * Useful for cleanup or if you want to add any additional spans based on current context.\n   *\n   * This is exposed because users have no other way of running something before an idle transaction\n   * finishes.\n   */\n  public registerBeforeFinishCallback(callback: BeforeFinishCallback): void {\n    this._beforeFinishCallbacks.push(callback);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public initSpanRecorder(maxlen?: number): void {\n    if (!this.spanRecorder) {\n      const pushActivity = (id: string): void => {\n        if (this._finished) {\n          return;\n        }\n        this._pushActivity(id);\n      };\n      const popActivity = (id: string): void => {\n        if (this._finished) {\n          return;\n        }\n        this._popActivity(id);\n      };\n\n      this.spanRecorder = new IdleTransactionSpanRecorder(pushActivity, popActivity, this.spanId, maxlen);\n\n      // Start heartbeat so that transactions do not run forever.\n      __DEBUG_BUILD__ && logger.log('Starting heartbeat');\n      this._pingHeartbeat();\n    }\n    this.spanRecorder.add(this);\n  }\n\n  /**\n   * Cancels the existing idle timeout, if there is one.\n   * @param restartOnChildSpanChange Default is `true`.\n   *                                 If set to false the transaction will end\n   *                                 with the last child span.\n   */\n  public cancelIdleTimeout(\n    endTimestamp?: Parameters<IdleTransaction['finish']>[0],\n    {\n      restartOnChildSpanChange,\n    }: {\n      restartOnChildSpanChange?: boolean;\n    } = {\n      restartOnChildSpanChange: true,\n    },\n  ): void {\n    this._idleTimeoutCanceledPermanently = restartOnChildSpanChange === false;\n    if (this._idleTimeoutID) {\n      clearTimeout(this._idleTimeoutID);\n      this._idleTimeoutID = undefined;\n\n      if (Object.keys(this.activities).length === 0 && this._idleTimeoutCanceledPermanently) {\n        this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5];\n        this.finish(endTimestamp);\n      }\n    }\n  }\n\n  /**\n   * Temporary method used to externally set the transaction's `finishReason`\n   *\n   * ** WARNING**\n   * This is for the purpose of experimentation only and will be removed in the near future, do not use!\n   *\n   * @internal\n   *\n   */\n  public setFinishReason(reason: string): void {\n    this._finishReason = reason;\n  }\n\n  /**\n   * Restarts idle timeout, if there is no running idle timeout it will start one.\n   */\n  private _restartIdleTimeout(endTimestamp?: Parameters<IdleTransaction['finish']>[0]): void {\n    this.cancelIdleTimeout();\n    this._idleTimeoutID = setTimeout(() => {\n      if (!this._finished && Object.keys(this.activities).length === 0) {\n        this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[1];\n        this.finish(endTimestamp);\n      }\n    }, this._idleTimeout);\n  }\n\n  /**\n   * Start tracking a specific activity.\n   * @param spanId The span id that represents the activity\n   */\n  private _pushActivity(spanId: string): void {\n    this.cancelIdleTimeout(undefined, { restartOnChildSpanChange: !this._idleTimeoutCanceledPermanently });\n    __DEBUG_BUILD__ && logger.log(`[Tracing] pushActivity: ${spanId}`);\n    this.activities[spanId] = true;\n    __DEBUG_BUILD__ && logger.log('[Tracing] new activities count', Object.keys(this.activities).length);\n  }\n\n  /**\n   * Remove an activity from usage\n   * @param spanId The span id that represents the activity\n   */\n  private _popActivity(spanId: string): void {\n    if (this.activities[spanId]) {\n      __DEBUG_BUILD__ && logger.log(`[Tracing] popActivity ${spanId}`);\n      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n      delete this.activities[spanId];\n      __DEBUG_BUILD__ && logger.log('[Tracing] new activities count', Object.keys(this.activities).length);\n    }\n\n    if (Object.keys(this.activities).length === 0) {\n      const endTimestamp = timestampInSeconds();\n      if (this._idleTimeoutCanceledPermanently) {\n        this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5];\n        this.finish(endTimestamp);\n      } else {\n        // We need to add the timeout here to have the real endtimestamp of the transaction\n        // Remember timestampInSeconds is in seconds, timeout is in ms\n        this._restartIdleTimeout(endTimestamp + this._idleTimeout / 1000);\n      }\n    }\n  }\n\n  /**\n   * Checks when entries of this.activities are not changing for 3 beats.\n   * If this occurs we finish the transaction.\n   */\n  private _beat(): void {\n    // We should not be running heartbeat if the idle transaction is finished.\n    if (this._finished) {\n      return;\n    }\n\n    const heartbeatString = Object.keys(this.activities).join('');\n\n    if (heartbeatString === this._prevHeartbeatString) {\n      this._heartbeatCounter++;\n    } else {\n      this._heartbeatCounter = 1;\n    }\n\n    this._prevHeartbeatString = heartbeatString;\n\n    if (this._heartbeatCounter >= 3) {\n      __DEBUG_BUILD__ && logger.log('[Tracing] Transaction finished because of no change for 3 heart beats');\n      this.setStatus('deadline_exceeded');\n      this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[0];\n      this.finish();\n    } else {\n      this._pingHeartbeat();\n    }\n  }\n\n  /**\n   * Pings the heartbeat\n   */\n  private _pingHeartbeat(): void {\n    __DEBUG_BUILD__ && logger.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`);\n    setTimeout(() => {\n      this._beat();\n    }, this._heartbeatInterval);\n  }\n}\n","import type { ClientOptions, CustomSamplingContext, Options, SamplingContext, TransactionContext } from '@sentry/types';\nimport { isNaN, logger } from '@sentry/utils';\n\nimport type { Hub } from '../hub';\nimport { getMainCarrier } from '../hub';\nimport { hasTracingEnabled } from '../utils/hasTracingEnabled';\nimport { registerErrorInstrumentation } from './errors';\nimport { IdleTransaction } from './idletransaction';\nimport { Transaction } from './transaction';\n\n/** Returns all trace headers that are currently on the top scope. */\nfunction traceHeaders(this: Hub): { [key: string]: string } {\n  const scope = this.getScope();\n  const span = scope.getSpan();\n\n  return span\n    ? {\n        'sentry-trace': span.toTraceparent(),\n      }\n    : {};\n}\n\n/**\n * Makes a sampling decision for the given transaction and stores it on the transaction.\n *\n * Called every time a transaction is created. Only transactions which emerge with a `sampled` value of `true` will be\n * sent to Sentry.\n *\n * @param transaction: The transaction needing a sampling decision\n * @param options: The current client's options, so we can access `tracesSampleRate` and/or `tracesSampler`\n * @param samplingContext: Default and user-provided data which may be used to help make the decision\n *\n * @returns The given transaction with its `sampled` value set\n */\nfunction sample<T extends Transaction>(\n  transaction: T,\n  options: Pick<Options, 'tracesSampleRate' | 'tracesSampler' | 'enableTracing'>,\n  samplingContext: SamplingContext,\n): T {\n  // nothing to do if tracing is not enabled\n  if (!hasTracingEnabled(options)) {\n    transaction.sampled = false;\n    return transaction;\n  }\n\n  // if the user has forced a sampling decision by passing a `sampled` value in their transaction context, go with that\n  if (transaction.sampled !== undefined) {\n    transaction.setMetadata({\n      sampleRate: Number(transaction.sampled),\n    });\n    return transaction;\n  }\n\n  // we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` nor `enableTracing` were defined, so one of these should\n  // work; prefer the hook if so\n  let sampleRate;\n  if (typeof options.tracesSampler === 'function') {\n    sampleRate = options.tracesSampler(samplingContext);\n    transaction.setMetadata({\n      sampleRate: Number(sampleRate),\n    });\n  } else if (samplingContext.parentSampled !== undefined) {\n    sampleRate = samplingContext.parentSampled;\n  } else if (typeof options.tracesSampleRate !== 'undefined') {\n    sampleRate = options.tracesSampleRate;\n    transaction.setMetadata({\n      sampleRate: Number(sampleRate),\n    });\n  } else {\n    // When `enableTracing === true`, we use a sample rate of 100%\n    sampleRate = 1;\n    transaction.setMetadata({\n      sampleRate,\n    });\n  }\n\n  // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The\n  // only valid values are booleans or numbers between 0 and 1.)\n  if (!isValidSampleRate(sampleRate)) {\n    __DEBUG_BUILD__ && logger.warn('[Tracing] Discarding transaction because of invalid sample rate.');\n    transaction.sampled = false;\n    return transaction;\n  }\n\n  // if the function returned 0 (or false), or if `tracesSampleRate` is 0, it's a sign the transaction should be dropped\n  if (!sampleRate) {\n    __DEBUG_BUILD__ &&\n      logger.log(\n        `[Tracing] Discarding transaction because ${\n          typeof options.tracesSampler === 'function'\n            ? 'tracesSampler returned 0 or false'\n            : 'a negative sampling decision was inherited or tracesSampleRate is set to 0'\n        }`,\n      );\n    transaction.sampled = false;\n    return transaction;\n  }\n\n  // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is\n  // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false.\n  transaction.sampled = Math.random() < (sampleRate as number | boolean);\n\n  // if we're not going to keep it, we're done\n  if (!transaction.sampled) {\n    __DEBUG_BUILD__ &&\n      logger.log(\n        `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(\n          sampleRate,\n        )})`,\n      );\n    return transaction;\n  }\n\n  __DEBUG_BUILD__ && logger.log(`[Tracing] starting ${transaction.op} transaction - ${transaction.name}`);\n  return transaction;\n}\n\n/**\n * Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1).\n */\nfunction isValidSampleRate(rate: unknown): boolean {\n  // we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  if (isNaN(rate) || !(typeof rate === 'number' || typeof rate === 'boolean')) {\n    __DEBUG_BUILD__ &&\n      logger.warn(\n        `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(\n          rate,\n        )} of type ${JSON.stringify(typeof rate)}.`,\n      );\n    return false;\n  }\n\n  // in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false\n  if (rate < 0 || rate > 1) {\n    __DEBUG_BUILD__ &&\n      logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${rate}.`);\n    return false;\n  }\n  return true;\n}\n\n/**\n * Creates a new transaction and adds a sampling decision if it doesn't yet have one.\n *\n * The Hub.startTransaction method delegates to this method to do its work, passing the Hub instance in as `this`, as if\n * it had been called on the hub directly. Exists as a separate function so that it can be injected into the class as an\n * \"extension method.\"\n *\n * @param this: The Hub starting the transaction\n * @param transactionContext: Data used to configure the transaction\n * @param CustomSamplingContext: Optional data to be provided to the `tracesSampler` function (if any)\n *\n * @returns The new transaction\n *\n * @see {@link Hub.startTransaction}\n */\nfunction _startTransaction(\n  this: Hub,\n  transactionContext: TransactionContext,\n  customSamplingContext?: CustomSamplingContext,\n): Transaction {\n  const client = this.getClient();\n  const options: Partial<ClientOptions> = (client && client.getOptions()) || {};\n\n  const configInstrumenter = options.instrumenter || 'sentry';\n  const transactionInstrumenter = transactionContext.instrumenter || 'sentry';\n\n  if (configInstrumenter !== transactionInstrumenter) {\n    __DEBUG_BUILD__ &&\n      logger.error(\n        `A transaction was started with instrumenter=\\`${transactionInstrumenter}\\`, but the SDK is configured with the \\`${configInstrumenter}\\` instrumenter.\nThe transaction will not be sampled. Please use the ${configInstrumenter} instrumentation to start transactions.`,\n      );\n\n    transactionContext.sampled = false;\n  }\n\n  let transaction = new Transaction(transactionContext, this);\n  transaction = sample(transaction, options, {\n    parentSampled: transactionContext.parentSampled,\n    transactionContext,\n    ...customSamplingContext,\n  });\n  if (transaction.sampled) {\n    transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans as number));\n  }\n  if (client && client.emit) {\n    client.emit('startTransaction', transaction);\n  }\n  return transaction;\n}\n\n/**\n * Create new idle transaction.\n */\nexport function startIdleTransaction(\n  hub: Hub,\n  transactionContext: TransactionContext,\n  idleTimeout: number,\n  finalTimeout: number,\n  onScope?: boolean,\n  customSamplingContext?: CustomSamplingContext,\n  heartbeatInterval?: number,\n): IdleTransaction {\n  const client = hub.getClient();\n  const options: Partial<ClientOptions> = (client && client.getOptions()) || {};\n\n  let transaction = new IdleTransaction(transactionContext, hub, idleTimeout, finalTimeout, heartbeatInterval, onScope);\n  transaction = sample(transaction, options, {\n    parentSampled: transactionContext.parentSampled,\n    transactionContext,\n    ...customSamplingContext,\n  });\n  if (transaction.sampled) {\n    transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans as number));\n  }\n  if (client && client.emit) {\n    client.emit('startTransaction', transaction);\n  }\n  return transaction;\n}\n\n/**\n * Adds tracing extensions to the global hub.\n */\nexport function addTracingExtensions(): void {\n  const carrier = getMainCarrier();\n  if (!carrier.__SENTRY__) {\n    return;\n  }\n  carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n  if (!carrier.__SENTRY__.extensions.startTransaction) {\n    carrier.__SENTRY__.extensions.startTransaction = _startTransaction;\n  }\n  if (!carrier.__SENTRY__.extensions.traceHeaders) {\n    carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;\n  }\n\n  registerErrorInstrumentation();\n}\n","import type {\n  Envelope,\n  EnvelopeItem,\n  EnvelopeItemType,\n  Event,\n  EventDropReason,\n  EventItem,\n  InternalBaseTransportOptions,\n  Transport,\n  TransportMakeRequestResponse,\n  TransportRequestExecutor,\n} from '@sentry/types';\nimport type { PromiseBuffer, RateLimits } from '@sentry/utils';\nimport {\n  createEnvelope,\n  envelopeItemTypeToDataCategory,\n  forEachEnvelopeItem,\n  isRateLimited,\n  logger,\n  makePromiseBuffer,\n  resolvedSyncPromise,\n  SentryError,\n  serializeEnvelope,\n  updateRateLimits,\n} from '@sentry/utils';\n\nexport const DEFAULT_TRANSPORT_BUFFER_SIZE = 30;\n\n/**\n * Creates an instance of a Sentry `Transport`\n *\n * @param options\n * @param makeRequest\n */\nexport function createTransport(\n  options: InternalBaseTransportOptions,\n  makeRequest: TransportRequestExecutor,\n  buffer: PromiseBuffer<void | TransportMakeRequestResponse> = makePromiseBuffer(\n    options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE,\n  ),\n): Transport {\n  let rateLimits: RateLimits = {};\n  const flush = (timeout?: number): PromiseLike<boolean> => buffer.drain(timeout);\n\n  function send(envelope: Envelope): PromiseLike<void | TransportMakeRequestResponse> {\n    const filteredEnvelopeItems: EnvelopeItem[] = [];\n\n    // Drop rate limited items from envelope\n    forEachEnvelopeItem(envelope, (item, type) => {\n      const envelopeItemDataCategory = envelopeItemTypeToDataCategory(type);\n      if (isRateLimited(rateLimits, envelopeItemDataCategory)) {\n        const event: Event | undefined = getEventForEnvelopeItem(item, type);\n        options.recordDroppedEvent('ratelimit_backoff', envelopeItemDataCategory, event);\n      } else {\n        filteredEnvelopeItems.push(item);\n      }\n    });\n\n    // Skip sending if envelope is empty after filtering out rate limited events\n    if (filteredEnvelopeItems.length === 0) {\n      return resolvedSyncPromise();\n    }\n\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    const filteredEnvelope: Envelope = createEnvelope(envelope[0], filteredEnvelopeItems as any);\n\n    // Creates client report for each item in an envelope\n    const recordEnvelopeLoss = (reason: EventDropReason): void => {\n      forEachEnvelopeItem(filteredEnvelope, (item, type) => {\n        const event: Event | undefined = getEventForEnvelopeItem(item, type);\n        options.recordDroppedEvent(reason, envelopeItemTypeToDataCategory(type), event);\n      });\n    };\n\n    const requestTask = (): PromiseLike<void | TransportMakeRequestResponse> =>\n      makeRequest({ body: serializeEnvelope(filteredEnvelope, options.textEncoder) }).then(\n        response => {\n          // We don't want to throw on NOK responses, but we want to at least log them\n          if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode >= 300)) {\n            __DEBUG_BUILD__ && logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`);\n          }\n\n          rateLimits = updateRateLimits(rateLimits, response);\n          return response;\n        },\n        error => {\n          recordEnvelopeLoss('network_error');\n          throw error;\n        },\n      );\n\n    return buffer.add(requestTask).then(\n      result => result,\n      error => {\n        if (error instanceof SentryError) {\n          __DEBUG_BUILD__ && logger.error('Skipped sending event because buffer is full.');\n          recordEnvelopeLoss('queue_overflow');\n          return resolvedSyncPromise();\n        } else {\n          throw error;\n        }\n      },\n    );\n  }\n\n  // We use this to identifify if the transport is the base transport\n  // TODO (v8): Remove this again as we'll no longer need it\n  send.__sentry__baseTransport__ = true;\n\n  return {\n    send,\n    flush,\n  };\n}\n\nfunction getEventForEnvelopeItem(item: Envelope[1][number], type: EnvelopeItemType): Event | undefined {\n  if (type !== 'event' && type !== 'transaction') {\n    return undefined;\n  }\n\n  return Array.isArray(item) ? (item as EventItem)[1] : undefined;\n}\n","import type { TransactionContext } from '@sentry/types';\nimport { isThenable } from '@sentry/utils';\n\nimport type { Hub } from '../hub';\nimport { getCurrentHub } from '../hub';\nimport { hasTracingEnabled } from '../utils/hasTracingEnabled';\nimport type { Span } from './span';\n\n/**\n * Wraps a function with a transaction/span and finishes the span after the function is done.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n *\n * This function is meant to be used internally and may break at any time. Use at your own risk.\n *\n * @internal\n * @private\n */\nexport function trace<T>(\n  context: TransactionContext,\n  callback: (span?: Span) => T,\n  // eslint-disable-next-line @typescript-eslint/no-empty-function\n  onError: (error: unknown) => void = () => {},\n): T {\n  const ctx = normalizeContext(context);\n\n  const hub = getCurrentHub();\n  const scope = hub.getScope();\n  const parentSpan = scope.getSpan();\n\n  const activeSpan = createChildSpanOrTransaction(hub, parentSpan, ctx);\n\n  scope.setSpan(activeSpan);\n\n  function finishAndSetSpan(): void {\n    activeSpan && activeSpan.finish();\n    hub.getScope().setSpan(parentSpan);\n  }\n\n  let maybePromiseResult: T;\n  try {\n    maybePromiseResult = callback(activeSpan);\n  } catch (e) {\n    activeSpan && activeSpan.setStatus('internal_error');\n    onError(e);\n    finishAndSetSpan();\n    throw e;\n  }\n\n  if (isThenable(maybePromiseResult)) {\n    Promise.resolve(maybePromiseResult).then(\n      () => {\n        finishAndSetSpan();\n      },\n      e => {\n        activeSpan && activeSpan.setStatus('internal_error');\n        onError(e);\n        finishAndSetSpan();\n      },\n    );\n  } else {\n    finishAndSetSpan();\n  }\n\n  return maybePromiseResult;\n}\n\n/**\n * Wraps a function with a transaction/span and finishes the span after the function is done.\n * The created span is the active span and will be used as parent by other spans created inside the function\n * and can be accessed via `Sentry.getSpan()`, as long as the function is executed while the scope is active.\n *\n * If you want to create a span that is not set as active, use {@link startInactiveSpan}.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n */\nexport function startSpan<T>(context: TransactionContext, callback: (span: Span | undefined) => T): T {\n  const ctx = normalizeContext(context);\n\n  const hub = getCurrentHub();\n  const scope = hub.getScope();\n  const parentSpan = scope.getSpan();\n\n  const activeSpan = createChildSpanOrTransaction(hub, parentSpan, ctx);\n  scope.setSpan(activeSpan);\n\n  function finishAndSetSpan(): void {\n    activeSpan && activeSpan.finish();\n    hub.getScope().setSpan(parentSpan);\n  }\n\n  let maybePromiseResult: T;\n  try {\n    maybePromiseResult = callback(activeSpan);\n  } catch (e) {\n    activeSpan && activeSpan.setStatus('internal_error');\n    finishAndSetSpan();\n    throw e;\n  }\n\n  if (isThenable(maybePromiseResult)) {\n    Promise.resolve(maybePromiseResult).then(\n      () => {\n        finishAndSetSpan();\n      },\n      () => {\n        activeSpan && activeSpan.setStatus('internal_error');\n        finishAndSetSpan();\n      },\n    );\n  } else {\n    finishAndSetSpan();\n  }\n\n  return maybePromiseResult;\n}\n\n/**\n * @deprecated Use {@link startSpan} instead.\n */\nexport const startActiveSpan = startSpan;\n\n/**\n * Similar to `Sentry.startSpan`. Wraps a function with a transaction/span, but does not finish the span\n * after the function is done automatically.\n *\n * The created span is the active span and will be used as parent by other spans created inside the function\n * and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n */\nexport function startSpanManual<T>(\n  context: TransactionContext,\n  callback: (span: Span | undefined, finish: () => void) => T,\n): T {\n  const ctx = normalizeContext(context);\n\n  const hub = getCurrentHub();\n  const scope = hub.getScope();\n  const parentSpan = scope.getSpan();\n\n  const activeSpan = createChildSpanOrTransaction(hub, parentSpan, ctx);\n  scope.setSpan(activeSpan);\n\n  function finishAndSetSpan(): void {\n    activeSpan && activeSpan.finish();\n    hub.getScope().setSpan(parentSpan);\n  }\n\n  let maybePromiseResult: T;\n  try {\n    maybePromiseResult = callback(activeSpan, finishAndSetSpan);\n  } catch (e) {\n    activeSpan && activeSpan.setStatus('internal_error');\n    throw e;\n  }\n\n  if (isThenable(maybePromiseResult)) {\n    Promise.resolve(maybePromiseResult).then(undefined, () => {\n      activeSpan && activeSpan.setStatus('internal_error');\n    });\n  }\n\n  return maybePromiseResult;\n}\n\n/**\n * Creates a span. This span is not set as active, so will not get automatic instrumentation spans\n * as children or be able to be accessed via `Sentry.getSpan()`.\n *\n * If you want to create a span that is set as active, use {@link startSpan}.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate` or `tracesSampler`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n */\nexport function startInactiveSpan(context: TransactionContext): Span | undefined {\n  if (!hasTracingEnabled()) {\n    return undefined;\n  }\n\n  const ctx = { ...context };\n  // If a name is set and a description is not, set the description to the name.\n  if (ctx.name !== undefined && ctx.description === undefined) {\n    ctx.description = ctx.name;\n  }\n\n  const hub = getCurrentHub();\n  const parentSpan = getActiveSpan();\n  return parentSpan ? parentSpan.startChild(ctx) : hub.startTransaction(ctx);\n}\n\n/**\n * Returns the currently active span.\n */\nexport function getActiveSpan(): Span | undefined {\n  return getCurrentHub().getScope().getSpan();\n}\n\nfunction createChildSpanOrTransaction(\n  hub: Hub,\n  parentSpan: Span | undefined,\n  ctx: TransactionContext,\n): Span | undefined {\n  if (!hasTracingEnabled()) {\n    return undefined;\n  }\n  return parentSpan ? parentSpan.startChild(ctx) : hub.startTransaction(ctx);\n}\n\nfunction normalizeContext(context: TransactionContext): TransactionContext {\n  const ctx = { ...context };\n  // If a name is set and a description is not, set the description to the name.\n  if (ctx.name !== undefined && ctx.description === undefined) {\n    ctx.description = ctx.name;\n  }\n\n  return ctx;\n}\n","import type { ClientOptions, DsnComponents, DsnLike, SdkInfo } from '@sentry/types';\nimport { dsnToString, makeDsn, urlEncode } from '@sentry/utils';\n\nconst SENTRY_API_VERSION = '7';\n\n/** Returns the prefix to construct Sentry ingestion API endpoints. */\nfunction getBaseApiEndpoint(dsn: DsnComponents): string {\n  const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n  const port = dsn.port ? `:${dsn.port}` : '';\n  return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;\n}\n\n/** Returns the ingest API endpoint for target. */\nfunction _getIngestEndpoint(dsn: DsnComponents): string {\n  return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`;\n}\n\n/** Returns a URL-encoded string with auth config suitable for a query string. */\nfunction _encodedAuth(dsn: DsnComponents, sdkInfo: SdkInfo | undefined): string {\n  return urlEncode({\n    // We send only the minimum set of required information. See\n    // https://github.com/getsentry/sentry-javascript/issues/2572.\n    sentry_key: dsn.publicKey,\n    sentry_version: SENTRY_API_VERSION,\n    ...(sdkInfo && { sentry_client: `${sdkInfo.name}/${sdkInfo.version}` }),\n  });\n}\n\n/**\n * Returns the envelope endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\nexport function getEnvelopeEndpointWithUrlEncodedAuth(\n  dsn: DsnComponents,\n  // TODO (v8): Remove `tunnelOrOptions` in favor of `options`, and use the substitute code below\n  // options: ClientOptions = {} as ClientOptions,\n  tunnelOrOptions: string | ClientOptions = {} as ClientOptions,\n): string {\n  // TODO (v8): Use this code instead\n  // const { tunnel, _metadata = {} } = options;\n  // return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, _metadata.sdk)}`;\n\n  const tunnel = typeof tunnelOrOptions === 'string' ? tunnelOrOptions : tunnelOrOptions.tunnel;\n  const sdkInfo =\n    typeof tunnelOrOptions === 'string' || !tunnelOrOptions._metadata ? undefined : tunnelOrOptions._metadata.sdk;\n\n  return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`;\n}\n\n/** Returns the url to the report dialog endpoint. */\nexport function getReportDialogEndpoint(\n  dsnLike: DsnLike,\n  dialogOptions: {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    [key: string]: any;\n    user?: { name?: string; email?: string };\n  },\n): string {\n  const dsn = makeDsn(dsnLike);\n  if (!dsn) {\n    return '';\n  }\n\n  const endpoint = `${getBaseApiEndpoint(dsn)}embed/error-page/`;\n\n  let encodedOptions = `dsn=${dsnToString(dsn)}`;\n  for (const key in dialogOptions) {\n    if (key === 'dsn') {\n      continue;\n    }\n\n    if (key === 'user') {\n      const user = dialogOptions.user;\n      if (!user) {\n        continue;\n      }\n      if (user.name) {\n        encodedOptions += `&name=${encodeURIComponent(user.name)}`;\n      }\n      if (user.email) {\n        encodedOptions += `&email=${encodeURIComponent(user.email)}`;\n      }\n    } else {\n      encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] as string)}`;\n    }\n  }\n\n  return `${endpoint}?${encodedOptions}`;\n}\n","import type {\n  BaseTransportOptions,\n  Envelope,\n  EnvelopeItemType,\n  Event,\n  EventItem,\n  Transport,\n  TransportMakeRequestResponse,\n} from '@sentry/types';\nimport { dsnFromString, forEachEnvelopeItem } from '@sentry/utils';\n\nimport { getEnvelopeEndpointWithUrlEncodedAuth } from '../api';\n\ninterface MatchParam {\n  /** The envelope to be sent */\n  envelope: Envelope;\n  /**\n   * A function that returns an event from the envelope if one exists. You can optionally pass an array of envelope item\n   * types to filter by - only envelopes matching the given types will be multiplexed.\n   * Allowed values are: 'event', 'transaction', 'profile', 'replay_event'\n   *\n   * @param types Defaults to ['event']\n   */\n  getEvent(types?: EnvelopeItemType[]): Event | undefined;\n}\n\ntype RouteTo = { dsn: string; release: string };\ntype Matcher = (param: MatchParam) => (string | RouteTo)[];\n\n/**\n * Gets an event from an envelope.\n *\n * This is only exported for use in the tests\n */\nexport function eventFromEnvelope(env: Envelope, types: EnvelopeItemType[]): Event | undefined {\n  let event: Event | undefined;\n\n  forEachEnvelopeItem(env, (item, type) => {\n    if (types.includes(type)) {\n      event = Array.isArray(item) ? (item as EventItem)[1] : undefined;\n    }\n    // bail out if we found an event\n    return !!event;\n  });\n\n  return event;\n}\n\n/**\n * Creates a transport that overrides the release on all events.\n */\nfunction makeOverrideReleaseTransport<TO extends BaseTransportOptions>(\n  createTransport: (options: TO) => Transport,\n  release: string,\n): (options: TO) => Transport {\n  return options => {\n    const transport = createTransport(options);\n\n    return {\n      send: async (envelope: Envelope): Promise<void | TransportMakeRequestResponse> => {\n        const event = eventFromEnvelope(envelope, ['event', 'transaction', 'profile', 'replay_event']);\n\n        if (event) {\n          event.release = release;\n        }\n        return transport.send(envelope);\n      },\n      flush: timeout => transport.flush(timeout),\n    };\n  };\n}\n\n/**\n * Creates a transport that can send events to different DSNs depending on the envelope contents.\n */\nexport function makeMultiplexedTransport<TO extends BaseTransportOptions>(\n  createTransport: (options: TO) => Transport,\n  matcher: Matcher,\n): (options: TO) => Transport {\n  return options => {\n    const fallbackTransport = createTransport(options);\n    const otherTransports: Record<string, Transport> = {};\n\n    function getTransport(dsn: string, release: string | undefined): Transport | undefined {\n      // We create a transport for every unique dsn/release combination as there may be code from multiple releases in\n      // use at the same time\n      const key = release ? `${dsn}:${release}` : dsn;\n\n      if (!otherTransports[key]) {\n        const validatedDsn = dsnFromString(dsn);\n        if (!validatedDsn) {\n          return undefined;\n        }\n        const url = getEnvelopeEndpointWithUrlEncodedAuth(validatedDsn);\n\n        otherTransports[key] = release\n          ? makeOverrideReleaseTransport(createTransport, release)({ ...options, url })\n          : createTransport({ ...options, url });\n      }\n\n      return otherTransports[key];\n    }\n\n    async function send(envelope: Envelope): Promise<void | TransportMakeRequestResponse> {\n      function getEvent(types?: EnvelopeItemType[]): Event | undefined {\n        const eventTypes: EnvelopeItemType[] = types && types.length ? types : ['event'];\n        return eventFromEnvelope(envelope, eventTypes);\n      }\n\n      const transports = matcher({ envelope, getEvent })\n        .map(result => {\n          if (typeof result === 'string') {\n            return getTransport(result, undefined);\n          } else {\n            return getTransport(result.dsn, result.release);\n          }\n        })\n        .filter((t): t is Transport => !!t);\n\n      // If we have no transports to send to, use the fallback transport\n      if (transports.length === 0) {\n        transports.push(fallbackTransport);\n      }\n\n      const results = await Promise.all(transports.map(transport => transport.send(envelope)));\n\n      return results[0];\n    }\n\n    async function flush(timeout: number | undefined): Promise<boolean> {\n      const allTransports = [...Object.keys(otherTransports).map(dsn => otherTransports[dsn]), fallbackTransport];\n      const results = await Promise.all(allTransports.map(transport => transport.flush(timeout)));\n      return results.every(r => r);\n    }\n\n    return {\n      send,\n      flush,\n    };\n  };\n}\n","import type { MeasurementUnit } from '@sentry/types';\n\nimport { getActiveTransaction } from './utils';\n\n/**\n * Adds a measurement to the current active transaction.\n */\nexport function setMeasurement(name: string, value: number, unit: MeasurementUnit): void {\n  const transaction = getActiveTransaction();\n  if (transaction) {\n    transaction.setMeasurement(name, value, unit);\n  }\n}\n","import { captureException, withScope } from '@sentry/core';\nimport type { DsnLike, Event as SentryEvent, Mechanism, Scope, WrappedFunction } from '@sentry/types';\nimport {\n  addExceptionMechanism,\n  addExceptionTypeValue,\n  addNonEnumerableProperty,\n  getOriginalFunction,\n  GLOBAL_OBJ,\n  markFunctionWrapped,\n} from '@sentry/utils';\n\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nlet ignoreOnError: number = 0;\n\n/**\n * @hidden\n */\nexport function shouldIgnoreOnError(): boolean {\n  return ignoreOnError > 0;\n}\n\n/**\n * @hidden\n */\nexport function ignoreNextOnError(): void {\n  // onerror should trigger before setTimeout\n  ignoreOnError++;\n  setTimeout(() => {\n    ignoreOnError--;\n  });\n}\n\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always\n * has a correct `this` context.\n * @returns The wrapped function.\n * @hidden\n */\nexport function wrap(\n  fn: WrappedFunction,\n  options: {\n    mechanism?: Mechanism;\n  } = {},\n  before?: WrappedFunction,\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): any {\n  // for future readers what this does is wrap a function and then create\n  // a bi-directional wrapping between them.\n  //\n  // example: wrapped = wrap(original);\n  //  original.__sentry_wrapped__ -> wrapped\n  //  wrapped.__sentry_original__ -> original\n\n  if (typeof fn !== 'function') {\n    return fn;\n  }\n\n  try {\n    // if we're dealing with a function that was previously wrapped, return\n    // the original wrapper.\n    const wrapper = fn.__sentry_wrapped__;\n    if (wrapper) {\n      return wrapper;\n    }\n\n    // We don't wanna wrap it twice\n    if (getOriginalFunction(fn)) {\n      return fn;\n    }\n  } catch (e) {\n    // Just accessing custom props in some Selenium environments\n    // can cause a \"Permission denied\" exception (see raven-js#495).\n    // Bail on wrapping and return the function as-is (defers to window.onerror).\n    return fn;\n  }\n\n  /* eslint-disable prefer-rest-params */\n  // It is important that `sentryWrapped` is not an arrow function to preserve the context of `this`\n  const sentryWrapped: WrappedFunction = function (this: unknown): void {\n    const args = Array.prototype.slice.call(arguments);\n\n    try {\n      if (before && typeof before === 'function') {\n        before.apply(this, arguments);\n      }\n\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n      const wrappedArguments = args.map((arg: any) => wrap(arg, options));\n\n      // Attempt to invoke user-land function\n      // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n      //       means the sentry.javascript SDK caught an error invoking your application code. This\n      //       is expected behavior and NOT indicative of a bug with sentry.javascript.\n      return fn.apply(this, wrappedArguments);\n    } catch (ex) {\n      ignoreNextOnError();\n\n      withScope((scope: Scope) => {\n        scope.addEventProcessor((event: SentryEvent) => {\n          if (options.mechanism) {\n            addExceptionTypeValue(event, undefined, undefined);\n            addExceptionMechanism(event, options.mechanism);\n          }\n\n          event.extra = {\n            ...event.extra,\n            arguments: args,\n          };\n\n          return event;\n        });\n\n        captureException(ex);\n      });\n\n      throw ex;\n    }\n  };\n  /* eslint-enable prefer-rest-params */\n\n  // Accessing some objects may throw\n  // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n  try {\n    for (const property in fn) {\n      if (Object.prototype.hasOwnProperty.call(fn, property)) {\n        sentryWrapped[property] = fn[property];\n      }\n    }\n  } catch (_oO) {} // eslint-disable-line no-empty\n\n  // Signal that this function has been wrapped/filled already\n  // for both debugging and to prevent it to being wrapped/filled twice\n  markFunctionWrapped(sentryWrapped, fn);\n\n  addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);\n\n  // Restore original function name (not all browsers allow that)\n  try {\n    const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') as PropertyDescriptor;\n    if (descriptor.configurable) {\n      Object.defineProperty(sentryWrapped, 'name', {\n        get(): string {\n          return fn.name;\n        },\n      });\n    }\n    // eslint-disable-next-line no-empty\n  } catch (_oO) {}\n\n  return sentryWrapped;\n}\n\n/**\n * All properties the report dialog supports\n */\nexport interface ReportDialogOptions {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  [key: string]: any;\n  eventId?: string;\n  dsn?: DsnLike;\n  user?: {\n    email?: string;\n    name?: string;\n  };\n  lang?: string;\n  title?: string;\n  subtitle?: string;\n  subtitle2?: string;\n  labelName?: string;\n  labelEmail?: string;\n  labelComments?: string;\n  labelClose?: string;\n  labelSubmit?: string;\n  errorGeneric?: string;\n  errorFormEntry?: string;\n  successMessage?: string;\n  /** Callback after reportDialog showed up */\n  onLoad?(this: void): void;\n}\n","import type { Client, Event, EventHint, Integration, Options } from '@sentry/types';\nimport { arrayify, logger } from '@sentry/utils';\n\nimport { addGlobalEventProcessor } from './eventProcessors';\nimport { getCurrentHub } from './hub';\n\ndeclare module '@sentry/types' {\n  interface Integration {\n    isDefaultInstance?: boolean;\n  }\n}\n\nexport const installedIntegrations: string[] = [];\n\n/** Map of integrations assigned to a client */\nexport type IntegrationIndex = {\n  [key: string]: Integration;\n};\n\n/**\n * Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to\n * preseve the order of integrations in the array.\n *\n * @private\n */\nfunction filterDuplicates(integrations: Integration[]): Integration[] {\n  const integrationsByName: { [key: string]: Integration } = {};\n\n  integrations.forEach(currentInstance => {\n    const { name } = currentInstance;\n\n    const existingInstance = integrationsByName[name];\n\n    // We want integrations later in the array to overwrite earlier ones of the same type, except that we never want a\n    // default instance to overwrite an existing user instance\n    if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) {\n      return;\n    }\n\n    integrationsByName[name] = currentInstance;\n  });\n\n  return Object.keys(integrationsByName).map(k => integrationsByName[k]);\n}\n\n/** Gets integrations to install */\nexport function getIntegrationsToSetup(options: Options): Integration[] {\n  const defaultIntegrations = options.defaultIntegrations || [];\n  const userIntegrations = options.integrations;\n\n  // We flag default instances, so that later we can tell them apart from any user-created instances of the same class\n  defaultIntegrations.forEach(integration => {\n    integration.isDefaultInstance = true;\n  });\n\n  let integrations: Integration[];\n\n  if (Array.isArray(userIntegrations)) {\n    integrations = [...defaultIntegrations, ...userIntegrations];\n  } else if (typeof userIntegrations === 'function') {\n    integrations = arrayify(userIntegrations(defaultIntegrations));\n  } else {\n    integrations = defaultIntegrations;\n  }\n\n  const finalIntegrations = filterDuplicates(integrations);\n\n  // The `Debug` integration prints copies of the `event` and `hint` which will be passed to `beforeSend` or\n  // `beforeSendTransaction`. It therefore has to run after all other integrations, so that the changes of all event\n  // processors will be reflected in the printed values. For lack of a more elegant way to guarantee that, we therefore\n  // locate it and, assuming it exists, pop it out of its current spot and shove it onto the end of the array.\n  const debugIndex = findIndex(finalIntegrations, integration => integration.name === 'Debug');\n  if (debugIndex !== -1) {\n    const [debugInstance] = finalIntegrations.splice(debugIndex, 1);\n    finalIntegrations.push(debugInstance);\n  }\n\n  return finalIntegrations;\n}\n\n/**\n * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default\n * integrations are added unless they were already provided before.\n * @param integrations array of integration instances\n * @param withDefault should enable default integrations\n */\nexport function setupIntegrations(client: Client, integrations: Integration[]): IntegrationIndex {\n  const integrationIndex: IntegrationIndex = {};\n\n  integrations.forEach(integration => {\n    // guard against empty provided integrations\n    if (integration) {\n      setupIntegration(client, integration, integrationIndex);\n    }\n  });\n\n  return integrationIndex;\n}\n\n/** Setup a single integration.  */\nexport function setupIntegration(client: Client, integration: Integration, integrationIndex: IntegrationIndex): void {\n  integrationIndex[integration.name] = integration;\n\n  if (installedIntegrations.indexOf(integration.name) === -1) {\n    integration.setupOnce(addGlobalEventProcessor, getCurrentHub);\n    installedIntegrations.push(integration.name);\n  }\n\n  if (client.on && typeof integration.preprocessEvent === 'function') {\n    const callback = integration.preprocessEvent.bind(integration) as typeof integration.preprocessEvent;\n    client.on('preprocessEvent', (event, hint) => callback(event, hint, client));\n  }\n\n  if (client.addEventProcessor && typeof integration.processEvent === 'function') {\n    const callback = integration.processEvent.bind(integration) as typeof integration.processEvent;\n\n    const processor = Object.assign((event: Event, hint: EventHint) => callback(event, hint, client), {\n      id: integration.name,\n    });\n\n    client.addEventProcessor(processor);\n  }\n\n  __DEBUG_BUILD__ && logger.log(`Integration installed: ${integration.name}`);\n}\n\n// Polyfill for Array.findIndex(), which is not supported in ES5\nfunction findIndex<T>(arr: T[], callback: (item: T) => boolean): number {\n  for (let i = 0; i < arr.length; i++) {\n    if (callback(arr[i]) === true) {\n      return i;\n    }\n  }\n\n  return -1;\n}\n","import type { Client, ClientOptions, Event, EventHint, StackFrame, StackParser } from '@sentry/types';\nimport { dateTimestampInSeconds, GLOBAL_OBJ, normalize, resolvedSyncPromise, truncate, uuid4 } from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from '../constants';\nimport { getGlobalEventProcessors, notifyEventProcessors } from '../eventProcessors';\nimport { Scope } from '../scope';\n\n/**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * Note: This also triggers callbacks for `addGlobalEventProcessor`, but not `beforeSend`.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n * @hidden\n */\nexport function prepareEvent(\n  options: ClientOptions,\n  event: Event,\n  hint: EventHint,\n  scope?: Scope,\n  client?: Client,\n): PromiseLike<Event | null> {\n  const { normalizeDepth = 3, normalizeMaxBreadth = 1_000 } = options;\n  const prepared: Event = {\n    ...event,\n    event_id: event.event_id || hint.event_id || uuid4(),\n    timestamp: event.timestamp || dateTimestampInSeconds(),\n  };\n  const integrations = hint.integrations || options.integrations.map(i => i.name);\n\n  applyClientOptions(prepared, options);\n  applyIntegrationsMetadata(prepared, integrations);\n\n  // Only put debug IDs onto frames for error events.\n  if (event.type === undefined) {\n    applyDebugIds(prepared, options.stackParser);\n  }\n\n  // If we have scope given to us, use it as the base for further modifications.\n  // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.\n  let finalScope = scope;\n  if (hint.captureContext) {\n    finalScope = Scope.clone(finalScope).update(hint.captureContext);\n  }\n\n  // We prepare the result here with a resolved Event.\n  let result = resolvedSyncPromise<Event | null>(prepared);\n\n  const clientEventProcessors = client && client.getEventProcessors ? client.getEventProcessors() : [];\n\n  // This should be the last thing called, since we want that\n  // {@link Hub.addEventProcessor} gets the finished prepared event.\n  //\n  // We need to check for the existence of `finalScope.getAttachments`\n  // because `getAttachments` can be undefined if users are using an older version\n  // of `@sentry/core` that does not have the `getAttachments` method.\n  // See: https://github.com/getsentry/sentry-javascript/issues/5229\n  if (finalScope) {\n    // Collect attachments from the hint and scope\n    if (finalScope.getAttachments) {\n      const attachments = [...(hint.attachments || []), ...finalScope.getAttachments()];\n\n      if (attachments.length) {\n        hint.attachments = attachments;\n      }\n    }\n\n    // In case we have a hub we reassign it.\n    result = finalScope.applyToEvent(prepared, hint, clientEventProcessors);\n  } else {\n    // Apply client & global event processors even if there is no scope\n    // TODO (v8): Update the order to be Global > Client\n    result = notifyEventProcessors([...clientEventProcessors, ...getGlobalEventProcessors()], prepared, hint);\n  }\n\n  return result.then(evt => {\n    if (evt) {\n      // We apply the debug_meta field only after all event processors have ran, so that if any event processors modified\n      // file names (e.g.the RewriteFrames integration) the filename -> debug ID relationship isn't destroyed.\n      // This should not cause any PII issues, since we're only moving data that is already on the event and not adding\n      // any new data\n      applyDebugMeta(evt);\n    }\n\n    if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n      return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);\n    }\n    return evt;\n  });\n}\n\n/**\n *  Enhances event using the client configuration.\n *  It takes care of all \"static\" values like environment, release and `dist`,\n *  as well as truncating overly long values.\n * @param event event instance to be enhanced\n */\nfunction applyClientOptions(event: Event, options: ClientOptions): void {\n  const { environment, release, dist, maxValueLength = 250 } = options;\n\n  if (!('environment' in event)) {\n    event.environment = 'environment' in options ? environment : DEFAULT_ENVIRONMENT;\n  }\n\n  if (event.release === undefined && release !== undefined) {\n    event.release = release;\n  }\n\n  if (event.dist === undefined && dist !== undefined) {\n    event.dist = dist;\n  }\n\n  if (event.message) {\n    event.message = truncate(event.message, maxValueLength);\n  }\n\n  const exception = event.exception && event.exception.values && event.exception.values[0];\n  if (exception && exception.value) {\n    exception.value = truncate(exception.value, maxValueLength);\n  }\n\n  const request = event.request;\n  if (request && request.url) {\n    request.url = truncate(request.url, maxValueLength);\n  }\n}\n\nconst debugIdStackParserCache = new WeakMap<StackParser, Map<string, StackFrame[]>>();\n\n/**\n * Puts debug IDs into the stack frames of an error event.\n */\nexport function applyDebugIds(event: Event, stackParser: StackParser): void {\n  const debugIdMap = GLOBAL_OBJ._sentryDebugIds;\n\n  if (!debugIdMap) {\n    return;\n  }\n\n  let debugIdStackFramesCache: Map<string, StackFrame[]>;\n  const cachedDebugIdStackFrameCache = debugIdStackParserCache.get(stackParser);\n  if (cachedDebugIdStackFrameCache) {\n    debugIdStackFramesCache = cachedDebugIdStackFrameCache;\n  } else {\n    debugIdStackFramesCache = new Map<string, StackFrame[]>();\n    debugIdStackParserCache.set(stackParser, debugIdStackFramesCache);\n  }\n\n  // Build a map of filename -> debug_id\n  const filenameDebugIdMap = Object.keys(debugIdMap).reduce<Record<string, string>>((acc, debugIdStackTrace) => {\n    let parsedStack: StackFrame[];\n    const cachedParsedStack = debugIdStackFramesCache.get(debugIdStackTrace);\n    if (cachedParsedStack) {\n      parsedStack = cachedParsedStack;\n    } else {\n      parsedStack = stackParser(debugIdStackTrace);\n      debugIdStackFramesCache.set(debugIdStackTrace, parsedStack);\n    }\n\n    for (let i = parsedStack.length - 1; i >= 0; i--) {\n      const stackFrame = parsedStack[i];\n      if (stackFrame.filename) {\n        acc[stackFrame.filename] = debugIdMap[debugIdStackTrace];\n        break;\n      }\n    }\n    return acc;\n  }, {});\n\n  try {\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    event!.exception!.values!.forEach(exception => {\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n      exception.stacktrace!.frames!.forEach(frame => {\n        if (frame.filename) {\n          frame.debug_id = filenameDebugIdMap[frame.filename];\n        }\n      });\n    });\n  } catch (e) {\n    // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n  }\n}\n\n/**\n * Moves debug IDs from the stack frames of an error event into the debug_meta field.\n */\nexport function applyDebugMeta(event: Event): void {\n  // Extract debug IDs and filenames from the stack frames on the event.\n  const filenameDebugIdMap: Record<string, string> = {};\n  try {\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    event.exception!.values!.forEach(exception => {\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n      exception.stacktrace!.frames!.forEach(frame => {\n        if (frame.debug_id) {\n          if (frame.abs_path) {\n            filenameDebugIdMap[frame.abs_path] = frame.debug_id;\n          } else if (frame.filename) {\n            filenameDebugIdMap[frame.filename] = frame.debug_id;\n          }\n          delete frame.debug_id;\n        }\n      });\n    });\n  } catch (e) {\n    // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n  }\n\n  if (Object.keys(filenameDebugIdMap).length === 0) {\n    return;\n  }\n\n  // Fill debug_meta information\n  event.debug_meta = event.debug_meta || {};\n  event.debug_meta.images = event.debug_meta.images || [];\n  const images = event.debug_meta.images;\n  Object.keys(filenameDebugIdMap).forEach(filename => {\n    images.push({\n      type: 'sourcemap',\n      code_file: filename,\n      debug_id: filenameDebugIdMap[filename],\n    });\n  });\n}\n\n/**\n * This function adds all used integrations to the SDK info in the event.\n * @param event The event that will be filled with all integrations.\n */\nfunction applyIntegrationsMetadata(event: Event, integrationNames: string[]): void {\n  if (integrationNames.length > 0) {\n    event.sdk = event.sdk || {};\n    event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames];\n  }\n}\n\n/**\n * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n * Normalized keys:\n * - `breadcrumbs.data`\n * - `user`\n * - `contexts`\n * - `extra`\n * @param event Event\n * @returns Normalized event\n */\nfunction normalizeEvent(event: Event | null, depth: number, maxBreadth: number): Event | null {\n  if (!event) {\n    return null;\n  }\n\n  const normalized: Event = {\n    ...event,\n    ...(event.breadcrumbs && {\n      breadcrumbs: event.breadcrumbs.map(b => ({\n        ...b,\n        ...(b.data && {\n          data: normalize(b.data, depth, maxBreadth),\n        }),\n      })),\n    }),\n    ...(event.user && {\n      user: normalize(event.user, depth, maxBreadth),\n    }),\n    ...(event.contexts && {\n      contexts: normalize(event.contexts, depth, maxBreadth),\n    }),\n    ...(event.extra && {\n      extra: normalize(event.extra, depth, maxBreadth),\n    }),\n  };\n\n  // event.contexts.trace stores information about a Transaction. Similarly,\n  // event.spans[] stores information about child Spans. Given that a\n  // Transaction is conceptually a Span, normalization should apply to both\n  // Transactions and Spans consistently.\n  // For now the decision is to skip normalization of Transactions and Spans,\n  // so this block overwrites the normalized event to add back the original\n  // Transaction information prior to normalization.\n  if (event.contexts && event.contexts.trace && normalized.contexts) {\n    normalized.contexts.trace = event.contexts.trace;\n\n    // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it\n    if (event.contexts.trace.data) {\n      normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth);\n    }\n  }\n\n  // event.spans[].data may contain circular/dangerous data so we need to normalize it\n  if (event.spans) {\n    normalized.spans = event.spans.map(span => {\n      // We cannot use the spread operator here because `toJSON` on `span` is non-enumerable\n      if (span.data) {\n        span.data = normalize(span.data, depth, maxBreadth);\n      }\n      return span;\n    });\n  }\n\n  return normalized;\n}\n","/* eslint-disable max-lines */\nimport type {\n  Breadcrumb,\n  BreadcrumbHint,\n  Client,\n  ClientOptions,\n  DataCategory,\n  DsnComponents,\n  DynamicSamplingContext,\n  Envelope,\n  ErrorEvent,\n  Event,\n  EventDropReason,\n  EventHint,\n  EventProcessor,\n  Integration,\n  IntegrationClass,\n  Outcome,\n  PropagationContext,\n  SdkMetadata,\n  Session,\n  SessionAggregates,\n  Severity,\n  SeverityLevel,\n  Transaction,\n  TransactionEvent,\n  Transport,\n  TransportMakeRequestResponse,\n} from '@sentry/types';\nimport {\n  addItemToEnvelope,\n  checkOrSetAlreadyCaught,\n  createAttachmentEnvelopeItem,\n  isPlainObject,\n  isPrimitive,\n  isThenable,\n  logger,\n  makeDsn,\n  rejectedSyncPromise,\n  resolvedSyncPromise,\n  SentryError,\n  SyncPromise,\n} from '@sentry/utils';\n\nimport { getEnvelopeEndpointWithUrlEncodedAuth } from './api';\nimport { createEventEnvelope, createSessionEnvelope } from './envelope';\nimport type { IntegrationIndex } from './integration';\nimport { setupIntegration, setupIntegrations } from './integration';\nimport type { Scope } from './scope';\nimport { updateSession } from './session';\nimport { getDynamicSamplingContextFromClient } from './tracing/dynamicSamplingContext';\nimport { prepareEvent } from './utils/prepareEvent';\n\nconst ALREADY_SEEN_ERROR = \"Not capturing exception because it's already been captured.\";\n\n/**\n * Base implementation for all JavaScript SDK clients.\n *\n * Call the constructor with the corresponding options\n * specific to the client subclass. To access these options later, use\n * {@link Client.getOptions}.\n *\n * If a Dsn is specified in the options, it will be parsed and stored. Use\n * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is\n * invalid, the constructor will throw a {@link SentryException}. Note that\n * without a valid Dsn, the SDK will not send any events to Sentry.\n *\n * Before sending an event, it is passed through\n * {@link BaseClient._prepareEvent} to add SDK information and scope data\n * (breadcrumbs and context). To add more custom information, override this\n * method and extend the resulting prepared event.\n *\n * To issue automatically created events (e.g. via instrumentation), use\n * {@link Client.captureEvent}. It will prepare the event and pass it through\n * the callback lifecycle. To issue auto-breadcrumbs, use\n * {@link Client.addBreadcrumb}.\n *\n * @example\n * class NodeClient extends BaseClient<NodeOptions> {\n *   public constructor(options: NodeOptions) {\n *     super(options);\n *   }\n *\n *   // ...\n * }\n */\nexport abstract class BaseClient<O extends ClientOptions> implements Client<O> {\n  /** Options passed to the SDK. */\n  protected readonly _options: O;\n\n  /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */\n  protected readonly _dsn?: DsnComponents;\n\n  protected readonly _transport?: Transport;\n\n  /** Array of set up integrations. */\n  protected _integrations: IntegrationIndex;\n\n  /** Indicates whether this client's integrations have been set up. */\n  protected _integrationsInitialized: boolean;\n\n  /** Number of calls being processed */\n  protected _numProcessing: number;\n\n  /** Holds flushable  */\n  private _outcomes: { [key: string]: number };\n\n  // eslint-disable-next-line @typescript-eslint/ban-types\n  private _hooks: Record<string, Function[]>;\n\n  private _eventProcessors: EventProcessor[];\n\n  /**\n   * Initializes this client instance.\n   *\n   * @param options Options for the client.\n   */\n  protected constructor(options: O) {\n    this._options = options;\n    this._integrations = {};\n    this._integrationsInitialized = false;\n    this._numProcessing = 0;\n    this._outcomes = {};\n    this._hooks = {};\n    this._eventProcessors = [];\n\n    if (options.dsn) {\n      this._dsn = makeDsn(options.dsn);\n    } else {\n      __DEBUG_BUILD__ && logger.warn('No DSN provided, client will not send events.');\n    }\n\n    if (this._dsn) {\n      const url = getEnvelopeEndpointWithUrlEncodedAuth(this._dsn, options);\n      this._transport = options.transport({\n        recordDroppedEvent: this.recordDroppedEvent.bind(this),\n        ...options.transportOptions,\n        url,\n      });\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n  public captureException(exception: any, hint?: EventHint, scope?: Scope): string | undefined {\n    // ensure we haven't captured this very object before\n    if (checkOrSetAlreadyCaught(exception)) {\n      __DEBUG_BUILD__ && logger.log(ALREADY_SEEN_ERROR);\n      return;\n    }\n\n    let eventId: string | undefined = hint && hint.event_id;\n\n    this._process(\n      this.eventFromException(exception, hint)\n        .then(event => this._captureEvent(event, hint, scope))\n        .then(result => {\n          eventId = result;\n        }),\n    );\n\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureMessage(\n    message: string,\n    // eslint-disable-next-line deprecation/deprecation\n    level?: Severity | SeverityLevel,\n    hint?: EventHint,\n    scope?: Scope,\n  ): string | undefined {\n    let eventId: string | undefined = hint && hint.event_id;\n\n    const promisedEvent = isPrimitive(message)\n      ? this.eventFromMessage(String(message), level, hint)\n      : this.eventFromException(message, hint);\n\n    this._process(\n      promisedEvent\n        .then(event => this._captureEvent(event, hint, scope))\n        .then(result => {\n          eventId = result;\n        }),\n    );\n\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureEvent(event: Event, hint?: EventHint, scope?: Scope): string | undefined {\n    // ensure we haven't captured this very object before\n    if (hint && hint.originalException && checkOrSetAlreadyCaught(hint.originalException)) {\n      __DEBUG_BUILD__ && logger.log(ALREADY_SEEN_ERROR);\n      return;\n    }\n\n    let eventId: string | undefined = hint && hint.event_id;\n\n    this._process(\n      this._captureEvent(event, hint, scope).then(result => {\n        eventId = result;\n      }),\n    );\n\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureSession(session: Session): void {\n    if (!(typeof session.release === 'string')) {\n      __DEBUG_BUILD__ && logger.warn('Discarded session because of missing or non-string release');\n    } else {\n      this.sendSession(session);\n      // After sending, we set init false to indicate it's not the first occurrence\n      updateSession(session, { init: false });\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getDsn(): DsnComponents | undefined {\n    return this._dsn;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getOptions(): O {\n    return this._options;\n  }\n\n  /**\n   * @see SdkMetadata in @sentry/types\n   *\n   * @return The metadata of the SDK\n   */\n  public getSdkMetadata(): SdkMetadata | undefined {\n    return this._options._metadata;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getTransport(): Transport | undefined {\n    return this._transport;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public flush(timeout?: number): PromiseLike<boolean> {\n    const transport = this._transport;\n    if (transport) {\n      return this._isClientDoneProcessing(timeout).then(clientFinished => {\n        return transport.flush(timeout).then(transportFlushed => clientFinished && transportFlushed);\n      });\n    } else {\n      return resolvedSyncPromise(true);\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public close(timeout?: number): PromiseLike<boolean> {\n    return this.flush(timeout).then(result => {\n      this.getOptions().enabled = false;\n      return result;\n    });\n  }\n\n  /** Get all installed event processors. */\n  public getEventProcessors(): EventProcessor[] {\n    return this._eventProcessors;\n  }\n\n  /** @inheritDoc */\n  public addEventProcessor(eventProcessor: EventProcessor): void {\n    this._eventProcessors.push(eventProcessor);\n  }\n\n  /**\n   * Sets up the integrations\n   */\n  public setupIntegrations(forceInitialize?: boolean): void {\n    if ((forceInitialize && !this._integrationsInitialized) || (this._isEnabled() && !this._integrationsInitialized)) {\n      this._integrations = setupIntegrations(this, this._options.integrations);\n      this._integrationsInitialized = true;\n    }\n  }\n\n  /**\n   * Gets an installed integration by its `id`.\n   *\n   * @returns The installed integration or `undefined` if no integration with that `id` was installed.\n   */\n  public getIntegrationById(integrationId: string): Integration | undefined {\n    return this._integrations[integrationId];\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null {\n    try {\n      return (this._integrations[integration.id] as T) || null;\n    } catch (_oO) {\n      __DEBUG_BUILD__ && logger.warn(`Cannot retrieve integration ${integration.id} from the current Client`);\n      return null;\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public addIntegration(integration: Integration): void {\n    setupIntegration(this, integration, this._integrations);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public sendEvent(event: Event, hint: EventHint = {}): void {\n    this.emit('beforeSendEvent', event, hint);\n\n    let env = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel);\n\n    for (const attachment of hint.attachments || []) {\n      env = addItemToEnvelope(\n        env,\n        createAttachmentEnvelopeItem(\n          attachment,\n          this._options.transportOptions && this._options.transportOptions.textEncoder,\n        ),\n      );\n    }\n\n    const promise = this._sendEnvelope(env);\n    if (promise) {\n      promise.then(sendResponse => this.emit('afterSendEvent', event, sendResponse), null);\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public sendSession(session: Session | SessionAggregates): void {\n    const env = createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel);\n    void this._sendEnvelope(env);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public recordDroppedEvent(reason: EventDropReason, category: DataCategory, _event?: Event): void {\n    // Note: we use `event` in replay, where we overwrite this hook.\n\n    if (this._options.sendClientReports) {\n      // We want to track each category (error, transaction, session, replay_event) separately\n      // but still keep the distinction between different type of outcomes.\n      // We could use nested maps, but it's much easier to read and type this way.\n      // A correct type for map-based implementation if we want to go that route\n      // would be `Partial<Record<SentryRequestType, Partial<Record<Outcome, number>>>>`\n      // With typescript 4.1 we could even use template literal types\n      const key = `${reason}:${category}`;\n      __DEBUG_BUILD__ && logger.log(`Adding outcome: \"${key}\"`);\n\n      // The following works because undefined + 1 === NaN and NaN is falsy\n      this._outcomes[key] = this._outcomes[key] + 1 || 1;\n    }\n  }\n\n  // Keep on() & emit() signatures in sync with types' client.ts interface\n  /* eslint-disable @typescript-eslint/unified-signatures */\n\n  /** @inheritdoc */\n  public on(hook: 'startTransaction', callback: (transaction: Transaction) => void): void;\n\n  /** @inheritdoc */\n  public on(hook: 'finishTransaction', callback: (transaction: Transaction) => void): void;\n\n  /** @inheritdoc */\n  public on(hook: 'beforeEnvelope', callback: (envelope: Envelope) => void): void;\n\n  /** @inheritdoc */\n  public on(hook: 'beforeSendEvent', callback: (event: Event, hint?: EventHint) => void): void;\n\n  /** @inheritdoc */\n  public on(hook: 'preprocessEvent', callback: (event: Event, hint?: EventHint) => void): void;\n\n  /** @inheritdoc */\n  public on(\n    hook: 'afterSendEvent',\n    callback: (event: Event, sendResponse: TransportMakeRequestResponse | void) => void,\n  ): void;\n\n  /** @inheritdoc */\n  public on(hook: 'beforeAddBreadcrumb', callback: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => void): void;\n\n  /** @inheritdoc */\n  public on(hook: 'createDsc', callback: (dsc: DynamicSamplingContext) => void): void;\n\n  /** @inheritdoc */\n  public on(hook: 'otelSpanEnd', callback: (otelSpan: unknown, mutableOptions: { drop: boolean }) => void): void;\n\n  /** @inheritdoc */\n  public on(hook: string, callback: unknown): void {\n    if (!this._hooks[hook]) {\n      this._hooks[hook] = [];\n    }\n\n    // @ts-expect-error We assue the types are correct\n    this._hooks[hook].push(callback);\n  }\n\n  /** @inheritdoc */\n  public emit(hook: 'startTransaction', transaction: Transaction): void;\n\n  /** @inheritdoc */\n  public emit(hook: 'finishTransaction', transaction: Transaction): void;\n\n  /** @inheritdoc */\n  public emit(hook: 'beforeEnvelope', envelope: Envelope): void;\n\n  /** @inheritdoc */\n  public emit(hook: 'beforeSendEvent', event: Event, hint?: EventHint): void;\n\n  /** @inheritdoc */\n  public emit(hook: 'preprocessEvent', event: Event, hint?: EventHint): void;\n\n  /** @inheritdoc */\n  public emit(hook: 'afterSendEvent', event: Event, sendResponse: TransportMakeRequestResponse | void): void;\n\n  /** @inheritdoc */\n  public emit(hook: 'beforeAddBreadcrumb', breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;\n\n  /** @inheritdoc */\n  public emit(hook: 'createDsc', dsc: DynamicSamplingContext): void;\n\n  /** @inheritdoc */\n  public emit(hook: 'otelSpanEnd', otelSpan: unknown, mutableOptions: { drop: boolean }): void;\n\n  /** @inheritdoc */\n  public emit(hook: string, ...rest: unknown[]): void {\n    if (this._hooks[hook]) {\n      this._hooks[hook].forEach(callback => callback(...rest));\n    }\n  }\n\n  /* eslint-enable @typescript-eslint/unified-signatures */\n\n  /** Updates existing session based on the provided event */\n  protected _updateSessionFromEvent(session: Session, event: Event): void {\n    let crashed = false;\n    let errored = false;\n    const exceptions = event.exception && event.exception.values;\n\n    if (exceptions) {\n      errored = true;\n\n      for (const ex of exceptions) {\n        const mechanism = ex.mechanism;\n        if (mechanism && mechanism.handled === false) {\n          crashed = true;\n          break;\n        }\n      }\n    }\n\n    // A session is updated and that session update is sent in only one of the two following scenarios:\n    // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update\n    // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update\n    const sessionNonTerminal = session.status === 'ok';\n    const shouldUpdateAndSend = (sessionNonTerminal && session.errors === 0) || (sessionNonTerminal && crashed);\n\n    if (shouldUpdateAndSend) {\n      updateSession(session, {\n        ...(crashed && { status: 'crashed' }),\n        errors: session.errors || Number(errored || crashed),\n      });\n      this.captureSession(session);\n    }\n  }\n\n  /**\n   * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying\n   * \"no\" (resolving to `false`) in order to give the client a chance to potentially finish first.\n   *\n   * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not\n   * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to\n   * `true`.\n   * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and\n   * `false` otherwise\n   */\n  protected _isClientDoneProcessing(timeout?: number): PromiseLike<boolean> {\n    return new SyncPromise(resolve => {\n      let ticked: number = 0;\n      const tick: number = 1;\n\n      const interval = setInterval(() => {\n        if (this._numProcessing == 0) {\n          clearInterval(interval);\n          resolve(true);\n        } else {\n          ticked += tick;\n          if (timeout && ticked >= timeout) {\n            clearInterval(interval);\n            resolve(false);\n          }\n        }\n      }, tick);\n    });\n  }\n\n  /** Determines whether this SDK is enabled and a transport is present. */\n  protected _isEnabled(): boolean {\n    return this.getOptions().enabled !== false && this._transport !== undefined;\n  }\n\n  /**\n   * Adds common information to events.\n   *\n   * The information includes release and environment from `options`,\n   * breadcrumbs and context (extra, tags and user) from the scope.\n   *\n   * Information that is already present in the event is never overwritten. For\n   * nested objects, such as the context, keys are merged.\n   *\n   * @param event The original event.\n   * @param hint May contain additional information about the original exception.\n   * @param scope A scope containing event metadata.\n   * @returns A new event with more information.\n   */\n  protected _prepareEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event | null> {\n    const options = this.getOptions();\n    const integrations = Object.keys(this._integrations);\n    if (!hint.integrations && integrations.length > 0) {\n      hint.integrations = integrations;\n    }\n\n    this.emit('preprocessEvent', event, hint);\n\n    return prepareEvent(options, event, hint, scope, this).then(evt => {\n      if (evt === null) {\n        return evt;\n      }\n\n      // If a trace context is not set on the event, we use the propagationContext set on the event to\n      // generate a trace context. If the propagationContext does not have a dynamic sampling context, we\n      // also generate one for it.\n      const { propagationContext } = evt.sdkProcessingMetadata || {};\n      const trace = evt.contexts && evt.contexts.trace;\n      if (!trace && propagationContext) {\n        const { traceId: trace_id, spanId, parentSpanId, dsc } = propagationContext as PropagationContext;\n        evt.contexts = {\n          trace: {\n            trace_id,\n            span_id: spanId,\n            parent_span_id: parentSpanId,\n          },\n          ...evt.contexts,\n        };\n\n        const dynamicSamplingContext = dsc ? dsc : getDynamicSamplingContextFromClient(trace_id, this, scope);\n\n        evt.sdkProcessingMetadata = {\n          dynamicSamplingContext,\n          ...evt.sdkProcessingMetadata,\n        };\n      }\n      return evt;\n    });\n  }\n\n  /**\n   * Processes the event and logs an error in case of rejection\n   * @param event\n   * @param hint\n   * @param scope\n   */\n  protected _captureEvent(event: Event, hint: EventHint = {}, scope?: Scope): PromiseLike<string | undefined> {\n    return this._processEvent(event, hint, scope).then(\n      finalEvent => {\n        return finalEvent.event_id;\n      },\n      reason => {\n        if (__DEBUG_BUILD__) {\n          // If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for\n          // control flow, log just the message (no stack) as a log-level log.\n          const sentryError = reason as SentryError;\n          if (sentryError.logLevel === 'log') {\n            logger.log(sentryError.message);\n          } else {\n            logger.warn(sentryError);\n          }\n        }\n        return undefined;\n      },\n    );\n  }\n\n  /**\n   * Processes an event (either error or message) and sends it to Sentry.\n   *\n   * This also adds breadcrumbs and context information to the event. However,\n   * platform specific meta data (such as the User's IP address) must be added\n   * by the SDK implementor.\n   *\n   *\n   * @param event The event to send to Sentry.\n   * @param hint May contain additional information about the original exception.\n   * @param scope A scope containing event metadata.\n   * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.\n   */\n  protected _processEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event> {\n    const options = this.getOptions();\n    const { sampleRate } = options;\n\n    const isTransaction = isTransactionEvent(event);\n    const isError = isErrorEvent(event);\n    const eventType = event.type || 'error';\n    const beforeSendLabel = `before send for type \\`${eventType}\\``;\n\n    // 1.0 === 100% events are sent\n    // 0.0 === 0% events are sent\n    // Sampling for transaction happens somewhere else\n    if (isError && typeof sampleRate === 'number' && Math.random() > sampleRate) {\n      this.recordDroppedEvent('sample_rate', 'error', event);\n      return rejectedSyncPromise(\n        new SentryError(\n          `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`,\n          'log',\n        ),\n      );\n    }\n\n    const dataCategory: DataCategory = eventType === 'replay_event' ? 'replay' : eventType;\n\n    return this._prepareEvent(event, hint, scope)\n      .then(prepared => {\n        if (prepared === null) {\n          this.recordDroppedEvent('event_processor', dataCategory, event);\n          throw new SentryError('An event processor returned `null`, will not send event.', 'log');\n        }\n\n        const isInternalException = hint.data && (hint.data as { __sentry__: boolean }).__sentry__ === true;\n        if (isInternalException) {\n          return prepared;\n        }\n\n        const result = processBeforeSend(options, prepared, hint);\n        return _validateBeforeSendResult(result, beforeSendLabel);\n      })\n      .then(processedEvent => {\n        if (processedEvent === null) {\n          this.recordDroppedEvent('before_send', dataCategory, event);\n          throw new SentryError(`${beforeSendLabel} returned \\`null\\`, will not send event.`, 'log');\n        }\n\n        const session = scope && scope.getSession();\n        if (!isTransaction && session) {\n          this._updateSessionFromEvent(session, processedEvent);\n        }\n\n        // None of the Sentry built event processor will update transaction name,\n        // so if the transaction name has been changed by an event processor, we know\n        // it has to come from custom event processor added by a user\n        const transactionInfo = processedEvent.transaction_info;\n        if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) {\n          const source = 'custom';\n          processedEvent.transaction_info = {\n            ...transactionInfo,\n            source,\n          };\n        }\n\n        this.sendEvent(processedEvent, hint);\n        return processedEvent;\n      })\n      .then(null, reason => {\n        if (reason instanceof SentryError) {\n          throw reason;\n        }\n\n        this.captureException(reason, {\n          data: {\n            __sentry__: true,\n          },\n          originalException: reason,\n        });\n        throw new SentryError(\n          `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\\nReason: ${reason}`,\n        );\n      });\n  }\n\n  /**\n   * Occupies the client with processing and event\n   */\n  protected _process<T>(promise: PromiseLike<T>): void {\n    this._numProcessing++;\n    void promise.then(\n      value => {\n        this._numProcessing--;\n        return value;\n      },\n      reason => {\n        this._numProcessing--;\n        return reason;\n      },\n    );\n  }\n\n  /**\n   * @inheritdoc\n   */\n  protected _sendEnvelope(envelope: Envelope): PromiseLike<void | TransportMakeRequestResponse> | void {\n    this.emit('beforeEnvelope', envelope);\n\n    if (this._isEnabled() && this._transport) {\n      return this._transport.send(envelope).then(null, reason => {\n        __DEBUG_BUILD__ && logger.error('Error while sending event:', reason);\n      });\n    } else {\n      __DEBUG_BUILD__ && logger.error('Transport disabled');\n    }\n  }\n\n  /**\n   * Clears outcomes on this client and returns them.\n   */\n  protected _clearOutcomes(): Outcome[] {\n    const outcomes = this._outcomes;\n    this._outcomes = {};\n    return Object.keys(outcomes).map(key => {\n      const [reason, category] = key.split(':') as [EventDropReason, DataCategory];\n      return {\n        reason,\n        category,\n        quantity: outcomes[key],\n      };\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n  public abstract eventFromException(_exception: any, _hint?: EventHint): PromiseLike<Event>;\n\n  /**\n   * @inheritDoc\n   */\n  public abstract eventFromMessage(\n    _message: string,\n    // eslint-disable-next-line deprecation/deprecation\n    _level?: Severity | SeverityLevel,\n    _hint?: EventHint,\n  ): PromiseLike<Event>;\n}\n\n/**\n * Verifies that return value of configured `beforeSend` or `beforeSendTransaction` is of expected type, and returns the value if so.\n */\nfunction _validateBeforeSendResult(\n  beforeSendResult: PromiseLike<Event | null> | Event | null,\n  beforeSendLabel: string,\n): PromiseLike<Event | null> | Event | null {\n  const invalidValueError = `${beforeSendLabel} must return \\`null\\` or a valid event.`;\n  if (isThenable(beforeSendResult)) {\n    return beforeSendResult.then(\n      event => {\n        if (!isPlainObject(event) && event !== null) {\n          throw new SentryError(invalidValueError);\n        }\n        return event;\n      },\n      e => {\n        throw new SentryError(`${beforeSendLabel} rejected with ${e}`);\n      },\n    );\n  } else if (!isPlainObject(beforeSendResult) && beforeSendResult !== null) {\n    throw new SentryError(invalidValueError);\n  }\n  return beforeSendResult;\n}\n\n/**\n * Process the matching `beforeSendXXX` callback.\n */\nfunction processBeforeSend(\n  options: ClientOptions,\n  event: Event,\n  hint: EventHint,\n): PromiseLike<Event | null> | Event | null {\n  const { beforeSend, beforeSendTransaction } = options;\n\n  if (isErrorEvent(event) && beforeSend) {\n    return beforeSend(event, hint);\n  }\n\n  if (isTransactionEvent(event) && beforeSendTransaction) {\n    return beforeSendTransaction(event, hint);\n  }\n\n  return event;\n}\n\nfunction isErrorEvent(event: Event): event is ErrorEvent {\n  return event.type === undefined;\n}\n\nfunction isTransactionEvent(event: Event): event is TransactionEvent {\n  return event.type === 'transaction';\n}\n","import type {\n  DsnComponents,\n  Event,\n  EventEnvelope,\n  EventItem,\n  SdkInfo,\n  SdkMetadata,\n  Session,\n  SessionAggregates,\n  SessionEnvelope,\n  SessionItem,\n} from '@sentry/types';\nimport {\n  createEnvelope,\n  createEventEnvelopeHeaders,\n  dsnToString,\n  getSdkMetadataForEnvelopeHeader,\n} from '@sentry/utils';\n\n/**\n * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.\n * Merge with existing data if any.\n **/\nfunction enhanceEventWithSdkInfo(event: Event, sdkInfo?: SdkInfo): Event {\n  if (!sdkInfo) {\n    return event;\n  }\n  event.sdk = event.sdk || {};\n  event.sdk.name = event.sdk.name || sdkInfo.name;\n  event.sdk.version = event.sdk.version || sdkInfo.version;\n  event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])];\n  event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])];\n  return event;\n}\n\n/** Creates an envelope from a Session */\nexport function createSessionEnvelope(\n  session: Session | SessionAggregates,\n  dsn?: DsnComponents,\n  metadata?: SdkMetadata,\n  tunnel?: string,\n): SessionEnvelope {\n  const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n  const envelopeHeaders = {\n    sent_at: new Date().toISOString(),\n    ...(sdkInfo && { sdk: sdkInfo }),\n    ...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),\n  };\n\n  const envelopeItem: SessionItem =\n    'aggregates' in session ? [{ type: 'sessions' }, session] : [{ type: 'session' }, session.toJSON()];\n\n  return createEnvelope<SessionEnvelope>(envelopeHeaders, [envelopeItem]);\n}\n\n/**\n * Create an Envelope from an event.\n */\nexport function createEventEnvelope(\n  event: Event,\n  dsn?: DsnComponents,\n  metadata?: SdkMetadata,\n  tunnel?: string,\n): EventEnvelope {\n  const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n\n  /*\n    Note: Due to TS, event.type may be `replay_event`, theoretically.\n    In practice, we never call `createEventEnvelope` with `replay_event` type,\n    and we'd have to adjut a looot of types to make this work properly.\n    We want to avoid casting this around, as that could lead to bugs (e.g. when we add another type)\n    So the safe choice is to really guard against the replay_event type here.\n  */\n  const eventType = event.type && event.type !== 'replay_event' ? event.type : 'event';\n\n  enhanceEventWithSdkInfo(event, metadata && metadata.sdk);\n\n  const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn);\n\n  // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to\n  // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may\n  // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid\n  // of this `delete`, lest we miss putting it back in the next time the property is in use.)\n  delete event.sdkProcessingMetadata;\n\n  const eventItem: EventItem = [{ type: eventType }, event];\n  return createEnvelope<EventEnvelope>(envelopeHeaders, [eventItem]);\n}\n","import { getCurrentHub } from '@sentry/core';\nimport type { Event, EventHint, Exception, Severity, SeverityLevel, StackFrame, StackParser } from '@sentry/types';\nimport {\n  addExceptionMechanism,\n  addExceptionTypeValue,\n  extractExceptionKeysForMessage,\n  isDOMError,\n  isDOMException,\n  isError,\n  isErrorEvent,\n  isEvent,\n  isPlainObject,\n  normalizeToSize,\n  resolvedSyncPromise,\n} from '@sentry/utils';\n\ntype Prototype = { constructor: (...args: unknown[]) => unknown };\n\n/**\n * This function creates an exception from a JavaScript Error\n */\nexport function exceptionFromError(stackParser: StackParser, ex: Error): Exception {\n  // Get the frames first since Opera can lose the stack if we touch anything else first\n  const frames = parseStackFrames(stackParser, ex);\n\n  const exception: Exception = {\n    type: ex && ex.name,\n    value: extractMessage(ex),\n  };\n\n  if (frames.length) {\n    exception.stacktrace = { frames };\n  }\n\n  if (exception.type === undefined && exception.value === '') {\n    exception.value = 'Unrecoverable error caught';\n  }\n\n  return exception;\n}\n\n/**\n * @hidden\n */\nexport function eventFromPlainObject(\n  stackParser: StackParser,\n  exception: Record<string, unknown>,\n  syntheticException?: Error,\n  isUnhandledRejection?: boolean,\n): Event {\n  const hub = getCurrentHub();\n  const client = hub.getClient();\n  const normalizeDepth = client && client.getOptions().normalizeDepth;\n\n  const event: Event = {\n    exception: {\n      values: [\n        {\n          type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',\n          value: getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }),\n        },\n      ],\n    },\n    extra: {\n      __serialized__: normalizeToSize(exception, normalizeDepth),\n    },\n  };\n\n  if (syntheticException) {\n    const frames = parseStackFrames(stackParser, syntheticException);\n    if (frames.length) {\n      // event.exception.values[0] has been set above\n      (event.exception as { values: Exception[] }).values[0].stacktrace = { frames };\n    }\n  }\n\n  return event;\n}\n\n/**\n * @hidden\n */\nexport function eventFromError(stackParser: StackParser, ex: Error): Event {\n  return {\n    exception: {\n      values: [exceptionFromError(stackParser, ex)],\n    },\n  };\n}\n\n/** Parses stack frames from an error */\nexport function parseStackFrames(\n  stackParser: StackParser,\n  ex: Error & { framesToPop?: number; stacktrace?: string },\n): StackFrame[] {\n  // Access and store the stacktrace property before doing ANYTHING\n  // else to it because Opera is not very good at providing it\n  // reliably in other circumstances.\n  const stacktrace = ex.stacktrace || ex.stack || '';\n\n  const popSize = getPopSize(ex);\n\n  try {\n    return stackParser(stacktrace, popSize);\n  } catch (e) {\n    // no-empty\n  }\n\n  return [];\n}\n\n// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108\nconst reactMinifiedRegexp = /Minified React error #\\d+;/i;\n\nfunction getPopSize(ex: Error & { framesToPop?: number }): number {\n  if (ex) {\n    if (typeof ex.framesToPop === 'number') {\n      return ex.framesToPop;\n    }\n\n    if (reactMinifiedRegexp.test(ex.message)) {\n      return 1;\n    }\n  }\n\n  return 0;\n}\n\n/**\n * There are cases where stacktrace.message is an Event object\n * https://github.com/getsentry/sentry-javascript/issues/1949\n * In this specific case we try to extract stacktrace.message.error.message\n */\nfunction extractMessage(ex: Error & { message: { error?: Error } }): string {\n  const message = ex && ex.message;\n  if (!message) {\n    return 'No error message';\n  }\n  if (message.error && typeof message.error.message === 'string') {\n    return message.error.message;\n  }\n  return message;\n}\n\n/**\n * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.\n * @hidden\n */\nexport function eventFromException(\n  stackParser: StackParser,\n  exception: unknown,\n  hint?: EventHint,\n  attachStacktrace?: boolean,\n): PromiseLike<Event> {\n  const syntheticException = (hint && hint.syntheticException) || undefined;\n  const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace);\n  addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }\n  event.level = 'error';\n  if (hint && hint.event_id) {\n    event.event_id = hint.event_id;\n  }\n  return resolvedSyncPromise(event);\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nexport function eventFromMessage(\n  stackParser: StackParser,\n  message: string,\n  // eslint-disable-next-line deprecation/deprecation\n  level: Severity | SeverityLevel = 'info',\n  hint?: EventHint,\n  attachStacktrace?: boolean,\n): PromiseLike<Event> {\n  const syntheticException = (hint && hint.syntheticException) || undefined;\n  const event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n  event.level = level;\n  if (hint && hint.event_id) {\n    event.event_id = hint.event_id;\n  }\n  return resolvedSyncPromise(event);\n}\n\n/**\n * @hidden\n */\nexport function eventFromUnknownInput(\n  stackParser: StackParser,\n  exception: unknown,\n  syntheticException?: Error,\n  attachStacktrace?: boolean,\n  isUnhandledRejection?: boolean,\n): Event {\n  let event: Event;\n\n  if (isErrorEvent(exception as ErrorEvent) && (exception as ErrorEvent).error) {\n    // If it is an ErrorEvent with `error` property, extract it to get actual Error\n    const errorEvent = exception as ErrorEvent;\n    return eventFromError(stackParser, errorEvent.error as Error);\n  }\n\n  // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name\n  // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be\n  // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.\n  //\n  // https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n  // https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n  // https://webidl.spec.whatwg.org/#es-DOMException-specialness\n  if (isDOMError(exception) || isDOMException(exception as DOMException)) {\n    const domException = exception as DOMException;\n\n    if ('stack' in (exception as Error)) {\n      event = eventFromError(stackParser, exception as Error);\n    } else {\n      const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');\n      const message = domException.message ? `${name}: ${domException.message}` : name;\n      event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n      addExceptionTypeValue(event, message);\n    }\n    if ('code' in domException) {\n      // eslint-disable-next-line deprecation/deprecation\n      event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };\n    }\n\n    return event;\n  }\n  if (isError(exception)) {\n    // we have a real Error object, do nothing\n    return eventFromError(stackParser, exception);\n  }\n  if (isPlainObject(exception) || isEvent(exception)) {\n    // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize\n    // it manually. This will allow us to group events based on top-level keys which is much better than creating a new\n    // group on any key/value change.\n    const objectException = exception as Record<string, unknown>;\n    event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection);\n    addExceptionMechanism(event, {\n      synthetic: true,\n    });\n    return event;\n  }\n\n  // If none of previous checks were valid, then it means that it's not:\n  // - an instance of DOMError\n  // - an instance of DOMException\n  // - an instance of Event\n  // - an instance of Error\n  // - a valid ErrorEvent (one with an error property)\n  // - a plain Object\n  //\n  // So bail out and capture it as a simple message:\n  event = eventFromString(stackParser, exception as string, syntheticException, attachStacktrace);\n  addExceptionTypeValue(event, `${exception}`, undefined);\n  addExceptionMechanism(event, {\n    synthetic: true,\n  });\n\n  return event;\n}\n\n/**\n * @hidden\n */\nexport function eventFromString(\n  stackParser: StackParser,\n  input: string,\n  syntheticException?: Error,\n  attachStacktrace?: boolean,\n): Event {\n  const event: Event = {\n    message: input,\n  };\n\n  if (attachStacktrace && syntheticException) {\n    const frames = parseStackFrames(stackParser, syntheticException);\n    if (frames.length) {\n      event.exception = {\n        values: [{ value: input, stacktrace: { frames } }],\n      };\n    }\n  }\n\n  return event;\n}\n\nfunction getNonErrorObjectExceptionValue(\n  exception: Record<string, unknown>,\n  { isUnhandledRejection }: { isUnhandledRejection?: boolean },\n): string {\n  const keys = extractExceptionKeysForMessage(exception);\n  const captureType = isUnhandledRejection ? 'promise rejection' : 'exception';\n\n  // Some ErrorEvent instances do not have an `error` property, which is why they are not handled before\n  // We still want to try to get a decent message for these cases\n  if (isErrorEvent(exception)) {\n    return `Event \\`ErrorEvent\\` captured as ${captureType} with message \\`${exception.message}\\``;\n  }\n\n  if (isEvent(exception)) {\n    const className = getObjectClassName(exception);\n    return `Event \\`${className}\\` (type=${exception.type}) captured as ${captureType}`;\n  }\n\n  return `Object captured as ${captureType} with keys: ${keys}`;\n}\n\nfunction getObjectClassName(obj: unknown): string | undefined | void {\n  try {\n    const prototype: Prototype | null = Object.getPrototypeOf(obj);\n    return prototype ? prototype.constructor.name : undefined;\n  } catch (e) {\n    // ignore errors here\n  }\n}\n","import type { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback, UserFeedbackItem } from '@sentry/types';\nimport { createEnvelope, dsnToString } from '@sentry/utils';\n\n/**\n * Creates an envelope from a user feedback.\n */\nexport function createUserFeedbackEnvelope(\n  feedback: UserFeedback,\n  {\n    metadata,\n    tunnel,\n    dsn,\n  }: {\n    metadata: SdkMetadata | undefined;\n    tunnel: string | undefined;\n    dsn: DsnComponents | undefined;\n  },\n): EventEnvelope {\n  const headers: EventEnvelope[0] = {\n    event_id: feedback.event_id,\n    sent_at: new Date().toISOString(),\n    ...(metadata &&\n      metadata.sdk && {\n        sdk: {\n          name: metadata.sdk.name,\n          version: metadata.sdk.version,\n        },\n      }),\n    ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n  };\n  const item = createUserFeedbackEnvelopeItem(feedback);\n\n  return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(feedback: UserFeedback): UserFeedbackItem {\n  const feedbackHeaders: UserFeedbackItem[0] = {\n    type: 'user_report',\n  };\n  return [feedbackHeaders, feedback];\n}\n","import type { Scope } from '@sentry/core';\nimport { BaseClient, SDK_VERSION } from '@sentry/core';\nimport type {\n  BrowserClientProfilingOptions,\n  BrowserClientReplayOptions,\n  ClientOptions,\n  Event,\n  EventHint,\n  Options,\n  Severity,\n  SeverityLevel,\n  UserFeedback,\n} from '@sentry/types';\nimport { createClientReportEnvelope, dsnToString, getSDKSource, logger } from '@sentry/utils';\n\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { WINDOW } from './helpers';\nimport type { BrowserTransportOptions } from './transports/types';\nimport { createUserFeedbackEnvelope } from './userfeedback';\n\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see @sentry/types Options for more information.\n */\nexport type BrowserOptions = Options<BrowserTransportOptions> &\n  BrowserClientReplayOptions &\n  BrowserClientProfilingOptions;\n\n/**\n * Configuration options for the Sentry Browser SDK Client class\n * @see BrowserClient for more information.\n */\nexport type BrowserClientOptions = ClientOptions<BrowserTransportOptions> &\n  BrowserClientReplayOptions &\n  BrowserClientProfilingOptions;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class BrowserClient extends BaseClient<BrowserClientOptions> {\n  /**\n   * Creates a new Browser SDK instance.\n   *\n   * @param options Configuration options for this SDK.\n   */\n  public constructor(options: BrowserClientOptions) {\n    const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();\n\n    options._metadata = options._metadata || {};\n    options._metadata.sdk = options._metadata.sdk || {\n      name: 'sentry.javascript.browser',\n      packages: [\n        {\n          name: `${sdkSource}:@sentry/browser`,\n          version: SDK_VERSION,\n        },\n      ],\n      version: SDK_VERSION,\n    };\n\n    super(options);\n\n    if (options.sendClientReports && WINDOW.document) {\n      WINDOW.document.addEventListener('visibilitychange', () => {\n        if (WINDOW.document.visibilityState === 'hidden') {\n          this._flushOutcomes();\n        }\n      });\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event> {\n    return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public eventFromMessage(\n    message: string,\n    // eslint-disable-next-line deprecation/deprecation\n    level: Severity | SeverityLevel = 'info',\n    hint?: EventHint,\n  ): PromiseLike<Event> {\n    return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n  }\n\n  /**\n   * Sends user feedback to Sentry.\n   */\n  public captureUserFeedback(feedback: UserFeedback): void {\n    if (!this._isEnabled()) {\n      __DEBUG_BUILD__ && logger.warn('SDK not enabled, will not capture user feedback.');\n      return;\n    }\n\n    const envelope = createUserFeedbackEnvelope(feedback, {\n      metadata: this.getSdkMetadata(),\n      dsn: this.getDsn(),\n      tunnel: this.getOptions().tunnel,\n    });\n    void this._sendEnvelope(envelope);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  protected _prepareEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event | null> {\n    event.platform = event.platform || 'javascript';\n    return super._prepareEvent(event, hint, scope);\n  }\n\n  /**\n   * Sends client reports as an envelope.\n   */\n  private _flushOutcomes(): void {\n    const outcomes = this._clearOutcomes();\n\n    if (outcomes.length === 0) {\n      __DEBUG_BUILD__ && logger.log('No outcomes to send');\n      return;\n    }\n\n    // This is really the only place where we want to check for a DSN and only send outcomes then\n    if (!this._dsn) {\n      __DEBUG_BUILD__ && logger.log('No dsn provided, will not send outcomes');\n      return;\n    }\n\n    __DEBUG_BUILD__ && logger.log('Sending outcomes:', outcomes);\n\n    const envelope = createClientReportEnvelope(outcomes, this._options.tunnel && dsnToString(this._dsn));\n    void this._sendEnvelope(envelope);\n  }\n}\n","import { isNativeFetch, logger } from '@sentry/utils';\n\nimport { WINDOW } from '../helpers';\n\nlet cachedFetchImpl: FetchImpl | undefined = undefined;\n\nexport type FetchImpl = typeof fetch;\n\n/**\n * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers.\n * Whenever someone wraps the Fetch API and returns the wrong promise chain,\n * this chain becomes orphaned and there is no possible way to capture it's rejections\n * other than allowing it bubble up to this very handler. eg.\n *\n * const f = window.fetch;\n * window.fetch = function () {\n *   const p = f.apply(this, arguments);\n *\n *   p.then(function() {\n *     console.log('hi.');\n *   });\n *\n *   return p;\n * }\n *\n * `p.then(function () { ... })` is producing a completely separate promise chain,\n * however, what's returned is `p` - the result of original `fetch` call.\n *\n * This mean, that whenever we use the Fetch API to send our own requests, _and_\n * some ad-blocker blocks it, this orphaned chain will _always_ reject,\n * effectively causing another event to be captured.\n * This makes a whole process become an infinite loop, which we need to somehow\n * deal with, and break it in one way or another.\n *\n * To deal with this issue, we are making sure that we _always_ use the real\n * browser Fetch API, instead of relying on what `window.fetch` exposes.\n * The only downside to this would be missing our own requests as breadcrumbs,\n * but because we are already not doing this, it should be just fine.\n *\n * Possible failed fetch error messages per-browser:\n *\n * Chrome:  Failed to fetch\n * Edge:    Failed to Fetch\n * Firefox: NetworkError when attempting to fetch resource\n * Safari:  resource blocked by content blocker\n */\nexport function getNativeFetchImplementation(): FetchImpl {\n  if (cachedFetchImpl) {\n    return cachedFetchImpl;\n  }\n\n  /* eslint-disable @typescript-eslint/unbound-method */\n\n  // Fast path to avoid DOM I/O\n  if (isNativeFetch(WINDOW.fetch)) {\n    return (cachedFetchImpl = WINDOW.fetch.bind(WINDOW));\n  }\n\n  const document = WINDOW.document;\n  let fetchImpl = WINDOW.fetch;\n  // eslint-disable-next-line deprecation/deprecation\n  if (document && typeof document.createElement === 'function') {\n    try {\n      const sandbox = document.createElement('iframe');\n      sandbox.hidden = true;\n      document.head.appendChild(sandbox);\n      const contentWindow = sandbox.contentWindow;\n      if (contentWindow && contentWindow.fetch) {\n        fetchImpl = contentWindow.fetch;\n      }\n      document.head.removeChild(sandbox);\n    } catch (e) {\n      __DEBUG_BUILD__ &&\n        logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', e);\n    }\n  }\n\n  return (cachedFetchImpl = fetchImpl.bind(WINDOW));\n  /* eslint-enable @typescript-eslint/unbound-method */\n}\n\n/** Clears cached fetch impl */\nexport function clearCachedFetchImplementation(): void {\n  cachedFetchImpl = undefined;\n}\n","import { createTransport } from '@sentry/core';\nimport type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/types';\nimport { rejectedSyncPromise } from '@sentry/utils';\n\nimport type { BrowserTransportOptions } from './types';\nimport type { FetchImpl } from './utils';\nimport { clearCachedFetchImplementation, getNativeFetchImplementation } from './utils';\n\n/**\n * Creates a Transport that uses the Fetch API to send events to Sentry.\n */\nexport function makeFetchTransport(\n  options: BrowserTransportOptions,\n  nativeFetch: FetchImpl = getNativeFetchImplementation(),\n): Transport {\n  let pendingBodySize = 0;\n  let pendingCount = 0;\n\n  function makeRequest(request: TransportRequest): PromiseLike<TransportMakeRequestResponse> {\n    const requestSize = request.body.length;\n    pendingBodySize += requestSize;\n    pendingCount++;\n\n    const requestOptions: RequestInit = {\n      body: request.body,\n      method: 'POST',\n      referrerPolicy: 'origin',\n      headers: options.headers,\n      // Outgoing requests are usually cancelled when navigating to a different page, causing a \"TypeError: Failed to\n      // fetch\" error and sending a \"network_error\" client-outcome - in Chrome, the request status shows \"(cancelled)\".\n      // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're\n      // frequently sending events right before the user is switching pages (eg. whenfinishing navigation transactions).\n      // Gotchas:\n      // - `keepalive` isn't supported by Firefox\n      // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch):\n      //   If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error.\n      //   We will therefore only activate the flag when we're below that limit.\n      // There is also a limit of requests that can be open at the same time, so we also limit this to 15\n      // See https://github.com/getsentry/sentry-javascript/pull/7553 for details\n      keepalive: pendingBodySize <= 60_000 && pendingCount < 15,\n      ...options.fetchOptions,\n    };\n\n    try {\n      return nativeFetch(options.url, requestOptions).then(response => {\n        pendingBodySize -= requestSize;\n        pendingCount--;\n        return {\n          statusCode: response.status,\n          headers: {\n            'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n            'retry-after': response.headers.get('Retry-After'),\n          },\n        };\n      });\n    } catch (e) {\n      clearCachedFetchImplementation();\n      pendingBodySize -= requestSize;\n      pendingCount--;\n      return rejectedSyncPromise(e);\n    }\n  }\n\n  return createTransport(options, makeRequest);\n}\n","import { createTransport } from '@sentry/core';\nimport type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/types';\nimport { SyncPromise } from '@sentry/utils';\n\nimport type { BrowserTransportOptions } from './types';\n\n/**\n * The DONE ready state for XmlHttpRequest\n *\n * Defining it here as a constant b/c XMLHttpRequest.DONE is not always defined\n * (e.g. during testing, it is `undefined`)\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState}\n */\nconst XHR_READYSTATE_DONE = 4;\n\n/**\n * Creates a Transport that uses the XMLHttpRequest API to send events to Sentry.\n */\nexport function makeXHRTransport(options: BrowserTransportOptions): Transport {\n  function makeRequest(request: TransportRequest): PromiseLike<TransportMakeRequestResponse> {\n    return new SyncPromise((resolve, reject) => {\n      const xhr = new XMLHttpRequest();\n\n      xhr.onerror = reject;\n\n      xhr.onreadystatechange = (): void => {\n        if (xhr.readyState === XHR_READYSTATE_DONE) {\n          resolve({\n            statusCode: xhr.status,\n            headers: {\n              'x-sentry-rate-limits': xhr.getResponseHeader('X-Sentry-Rate-Limits'),\n              'retry-after': xhr.getResponseHeader('Retry-After'),\n            },\n          });\n        }\n      };\n\n      xhr.open('POST', options.url);\n\n      for (const header in options.headers) {\n        if (Object.prototype.hasOwnProperty.call(options.headers, header)) {\n          xhr.setRequestHeader(header, options.headers[header]);\n        }\n      }\n\n      xhr.send(request.body);\n    });\n  }\n\n  return createTransport(options, makeRequest);\n}\n","// This was originally forked from https://github.com/csnover/TraceKit, and was largely\n// re - written as part of raven - js.\n//\n// This code was later copied to the JavaScript mono - repo and further modified and\n// refactored over the years.\n\n// Copyright (c) 2013 Onur Can Cakmak onur.cakmak@gmail.com and all TraceKit contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files(the 'Software'), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify,\n// merge, publish, distribute, sublicense, and / or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies\n// or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\n// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport type { StackFrame, StackLineParser, StackLineParserFn } from '@sentry/types';\nimport { createStackParser } from '@sentry/utils';\n\n// global reference to slice\nconst UNKNOWN_FUNCTION = '?';\n\nconst OPERA10_PRIORITY = 10;\nconst OPERA11_PRIORITY = 20;\nconst CHROME_PRIORITY = 30;\nconst WINJS_PRIORITY = 40;\nconst GECKO_PRIORITY = 50;\n\nfunction createFrame(filename: string, func: string, lineno?: number, colno?: number): StackFrame {\n  const frame: StackFrame = {\n    filename,\n    function: func,\n    in_app: true, // All browser frames are considered in_app\n  };\n\n  if (lineno !== undefined) {\n    frame.lineno = lineno;\n  }\n\n  if (colno !== undefined) {\n    frame.colno = colno;\n  }\n\n  return frame;\n}\n\n// Chromium based browsers: Chrome, Brave, new Opera, new Edge\nconst chromeRegex =\n  /^\\s*at (?:(.+?\\)(?: \\[.+\\])?|.*?) ?\\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\\/)?.*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\nconst chromeEvalRegex = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n\nconst chrome: StackLineParserFn = line => {\n  const parts = chromeRegex.exec(line);\n\n  if (parts) {\n    const isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n\n    if (isEval) {\n      const subMatch = chromeEvalRegex.exec(parts[2]);\n\n      if (subMatch) {\n        // throw out eval line/column and use top-most line/column number\n        parts[2] = subMatch[1]; // url\n        parts[3] = subMatch[2]; // line\n        parts[4] = subMatch[3]; // column\n      }\n    }\n\n    // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now\n    // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)\n    const [func, filename] = extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]);\n\n    return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined);\n  }\n\n  return;\n};\n\nexport const chromeStackLineParser: StackLineParser = [CHROME_PRIORITY, chrome];\n\n// gecko regex: `(?:bundle|\\d+\\.js)`: `bundle` is for react native, `\\d+\\.js` also but specifically for ram bundles because it\n// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js\n// We need this specific case for now because we want no other regex to match.\nconst geckoREgex =\n  /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)?((?:[-a-z]+)?:\\/.*?|\\[native code\\]|[^@]*(?:bundle|\\d+\\.js)|\\/[\\w\\-. /=]+)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nconst geckoEvalRegex = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\n\nconst gecko: StackLineParserFn = line => {\n  const parts = geckoREgex.exec(line);\n\n  if (parts) {\n    const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n    if (isEval) {\n      const subMatch = geckoEvalRegex.exec(parts[3]);\n\n      if (subMatch) {\n        // throw out eval line/column and use top-most line number\n        parts[1] = parts[1] || 'eval';\n        parts[3] = subMatch[1];\n        parts[4] = subMatch[2];\n        parts[5] = ''; // no column when eval\n      }\n    }\n\n    let filename = parts[3];\n    let func = parts[1] || UNKNOWN_FUNCTION;\n    [func, filename] = extractSafariExtensionDetails(func, filename);\n\n    return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined);\n  }\n\n  return;\n};\n\nexport const geckoStackLineParser: StackLineParser = [GECKO_PRIORITY, gecko];\n\nconst winjsRegex = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:[-a-z]+):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nconst winjs: StackLineParserFn = line => {\n  const parts = winjsRegex.exec(line);\n\n  return parts\n    ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined)\n    : undefined;\n};\n\nexport const winjsStackLineParser: StackLineParser = [WINJS_PRIORITY, winjs];\n\nconst opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i;\n\nconst opera10: StackLineParserFn = line => {\n  const parts = opera10Regex.exec(line);\n  return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined;\n};\n\nexport const opera10StackLineParser: StackLineParser = [OPERA10_PRIORITY, opera10];\n\nconst opera11Regex =\n  / line (\\d+), column (\\d+)\\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\\(.*\\))? in (.*):\\s*$/i;\n\nconst opera11: StackLineParserFn = line => {\n  const parts = opera11Regex.exec(line);\n  return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;\n};\n\nexport const opera11StackLineParser: StackLineParser = [OPERA11_PRIORITY, opera11];\n\nexport const defaultStackLineParsers = [chromeStackLineParser, geckoStackLineParser, winjsStackLineParser];\n\nexport const defaultStackParser = createStackParser(...defaultStackLineParsers);\n\n/**\n * Safari web extensions, starting version unknown, can produce \"frames-only\" stacktraces.\n * What it means, is that instead of format like:\n *\n * Error: wat\n *   at function@url:row:col\n *   at function@url:row:col\n *   at function@url:row:col\n *\n * it produces something like:\n *\n *   function@url:row:col\n *   function@url:row:col\n *   function@url:row:col\n *\n * Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch.\n * This function is extracted so that we can use it in both places without duplicating the logic.\n * Unfortunately \"just\" changing RegExp is too complicated now and making it pass all tests\n * and fix this case seems like an impossible, or at least way too time-consuming task.\n */\nconst extractSafariExtensionDetails = (func: string, filename: string): [string, string] => {\n  const isSafariExtension = func.indexOf('safari-extension') !== -1;\n  const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1;\n\n  return isSafariExtension || isSafariWebExtension\n    ? [\n        func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION,\n        isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}`,\n      ]\n    : [func, filename];\n};\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport { getCurrentHub } from '@sentry/core';\nimport type { Event, EventHint, Hub, Integration, Primitive, StackParser } from '@sentry/types';\nimport {\n  addExceptionMechanism,\n  addInstrumentationHandler,\n  getLocationHref,\n  isErrorEvent,\n  isPrimitive,\n  isString,\n  logger,\n} from '@sentry/utils';\n\nimport type { BrowserClient } from '../client';\nimport { eventFromUnknownInput } from '../eventbuilder';\nimport { shouldIgnoreOnError } from '../helpers';\n\ntype GlobalHandlersIntegrationsOptionKeys = 'onerror' | 'onunhandledrejection';\n\n/** JSDoc */\ntype GlobalHandlersIntegrations = Record<GlobalHandlersIntegrationsOptionKeys, boolean>;\n\n/** Global handlers */\nexport class GlobalHandlers implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'GlobalHandlers';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string;\n\n  /** JSDoc */\n  private readonly _options: GlobalHandlersIntegrations;\n\n  /**\n   * Stores references functions to installing handlers. Will set to undefined\n   * after they have been run so that they are not used twice.\n   */\n  private _installFunc: Record<GlobalHandlersIntegrationsOptionKeys, (() => void) | undefined>;\n\n  /** JSDoc */\n  public constructor(options?: GlobalHandlersIntegrations) {\n    this.name = GlobalHandlers.id;\n    this._options = {\n      onerror: true,\n      onunhandledrejection: true,\n      ...options,\n    };\n\n    this._installFunc = {\n      onerror: _installGlobalOnErrorHandler,\n      onunhandledrejection: _installGlobalOnUnhandledRejectionHandler,\n    };\n  }\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    Error.stackTraceLimit = 50;\n    const options = this._options;\n\n    // We can disable guard-for-in as we construct the options object above + do checks against\n    // `this._installFunc` for the property.\n    // eslint-disable-next-line guard-for-in\n    for (const key in options) {\n      const installFunc = this._installFunc[key as GlobalHandlersIntegrationsOptionKeys];\n      if (installFunc && options[key as GlobalHandlersIntegrationsOptionKeys]) {\n        globalHandlerLog(key);\n        installFunc();\n        this._installFunc[key as GlobalHandlersIntegrationsOptionKeys] = undefined;\n      }\n    }\n  }\n}\n\n/** JSDoc */\nfunction _installGlobalOnErrorHandler(): void {\n  addInstrumentationHandler(\n    'error',\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    (data: { msg: any; url: any; line: any; column: any; error: any }) => {\n      const [hub, stackParser, attachStacktrace] = getHubAndOptions();\n      if (!hub.getIntegration(GlobalHandlers)) {\n        return;\n      }\n      const { msg, url, line, column, error } = data;\n      if (shouldIgnoreOnError() || (error && error.__sentry_own_request__)) {\n        return;\n      }\n\n      const event =\n        error === undefined && isString(msg)\n          ? _eventFromIncompleteOnError(msg, url, line, column)\n          : _enhanceEventWithInitialFrame(\n              eventFromUnknownInput(stackParser, error || msg, undefined, attachStacktrace, false),\n              url,\n              line,\n              column,\n            );\n\n      event.level = 'error';\n\n      addMechanismAndCapture(hub, error, event, 'onerror');\n    },\n  );\n}\n\n/** JSDoc */\nfunction _installGlobalOnUnhandledRejectionHandler(): void {\n  addInstrumentationHandler(\n    'unhandledrejection',\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    (e: any) => {\n      const [hub, stackParser, attachStacktrace] = getHubAndOptions();\n      if (!hub.getIntegration(GlobalHandlers)) {\n        return;\n      }\n      let error = e;\n\n      // dig the object of the rejection out of known event types\n      try {\n        // PromiseRejectionEvents store the object of the rejection under 'reason'\n        // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent\n        if ('reason' in e) {\n          error = e.reason;\n        }\n        // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents\n        // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into\n        // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec\n        // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and\n        // https://github.com/getsentry/sentry-javascript/issues/2380\n        else if ('detail' in e && 'reason' in e.detail) {\n          error = e.detail.reason;\n        }\n      } catch (_oO) {\n        // no-empty\n      }\n\n      if (shouldIgnoreOnError() || (error && error.__sentry_own_request__)) {\n        return true;\n      }\n\n      const event = isPrimitive(error)\n        ? _eventFromRejectionWithPrimitive(error)\n        : eventFromUnknownInput(stackParser, error, undefined, attachStacktrace, true);\n\n      event.level = 'error';\n\n      addMechanismAndCapture(hub, error, event, 'onunhandledrejection');\n      return;\n    },\n  );\n}\n\n/**\n * Create an event from a promise rejection where the `reason` is a primitive.\n *\n * @param reason: The `reason` property of the promise rejection\n * @returns An Event object with an appropriate `exception` value\n */\nfunction _eventFromRejectionWithPrimitive(reason: Primitive): Event {\n  return {\n    exception: {\n      values: [\n        {\n          type: 'UnhandledRejection',\n          // String() is needed because the Primitive type includes symbols (which can't be automatically stringified)\n          value: `Non-Error promise rejection captured with value: ${String(reason)}`,\n        },\n      ],\n    },\n  };\n}\n\n/**\n * This function creates a stack from an old, error-less onerror handler.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _eventFromIncompleteOnError(msg: any, url: any, line: any, column: any): Event {\n  const ERROR_TYPES_RE =\n    /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;\n\n  // If 'message' is ErrorEvent, get real message from inside\n  let message = isErrorEvent(msg) ? msg.message : msg;\n  let name = 'Error';\n\n  const groups = message.match(ERROR_TYPES_RE);\n  if (groups) {\n    name = groups[1];\n    message = groups[2];\n  }\n\n  const event = {\n    exception: {\n      values: [\n        {\n          type: name,\n          value: message,\n        },\n      ],\n    },\n  };\n\n  return _enhanceEventWithInitialFrame(event, url, line, column);\n}\n\n/** JSDoc */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _enhanceEventWithInitialFrame(event: Event, url: any, line: any, column: any): Event {\n  // event.exception\n  const e = (event.exception = event.exception || {});\n  // event.exception.values\n  const ev = (e.values = e.values || []);\n  // event.exception.values[0]\n  const ev0 = (ev[0] = ev[0] || {});\n  // event.exception.values[0].stacktrace\n  const ev0s = (ev0.stacktrace = ev0.stacktrace || {});\n  // event.exception.values[0].stacktrace.frames\n  const ev0sf = (ev0s.frames = ev0s.frames || []);\n\n  const colno = isNaN(parseInt(column, 10)) ? undefined : column;\n  const lineno = isNaN(parseInt(line, 10)) ? undefined : line;\n  const filename = isString(url) && url.length > 0 ? url : getLocationHref();\n\n  // event.exception.values[0].stacktrace.frames\n  if (ev0sf.length === 0) {\n    ev0sf.push({\n      colno,\n      filename,\n      function: '?',\n      in_app: true,\n      lineno,\n    });\n  }\n\n  return event;\n}\n\nfunction globalHandlerLog(type: string): void {\n  __DEBUG_BUILD__ && logger.log(`Global Handler attached: ${type}`);\n}\n\nfunction addMechanismAndCapture(hub: Hub, error: EventHint['originalException'], event: Event, type: string): void {\n  addExceptionMechanism(event, {\n    handled: false,\n    type,\n  });\n  hub.captureEvent(event, {\n    originalException: error,\n  });\n}\n\nfunction getHubAndOptions(): [Hub, StackParser, boolean | undefined] {\n  const hub = getCurrentHub();\n  const client = hub.getClient<BrowserClient>();\n  const options = (client && client.getOptions()) || {\n    stackParser: () => [],\n    attachStacktrace: false,\n  };\n  return [hub, options.stackParser, options.attachStacktrace];\n}\n","import type { Integration, WrappedFunction } from '@sentry/types';\nimport { fill, getFunctionName, getOriginalFunction } from '@sentry/utils';\n\nimport { WINDOW, wrap } from '../helpers';\n\nconst DEFAULT_EVENT_TARGET = [\n  'EventTarget',\n  'Window',\n  'Node',\n  'ApplicationCache',\n  'AudioTrackList',\n  'BroadcastChannel',\n  'ChannelMergerNode',\n  'CryptoOperation',\n  'EventSource',\n  'FileReader',\n  'HTMLUnknownElement',\n  'IDBDatabase',\n  'IDBRequest',\n  'IDBTransaction',\n  'KeyOperation',\n  'MediaController',\n  'MessagePort',\n  'ModalWindow',\n  'Notification',\n  'SVGElementInstance',\n  'Screen',\n  'SharedWorker',\n  'TextTrack',\n  'TextTrackCue',\n  'TextTrackList',\n  'WebSocket',\n  'WebSocketWorker',\n  'Worker',\n  'XMLHttpRequest',\n  'XMLHttpRequestEventTarget',\n  'XMLHttpRequestUpload',\n];\n\ntype XMLHttpRequestProp = 'onload' | 'onerror' | 'onprogress' | 'onreadystatechange';\n\n/** JSDoc */\ninterface TryCatchOptions {\n  setTimeout: boolean;\n  setInterval: boolean;\n  requestAnimationFrame: boolean;\n  XMLHttpRequest: boolean;\n  eventTarget: boolean | string[];\n}\n\n/** Wrap timer functions and event targets to catch errors and provide better meta data */\nexport class TryCatch implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'TryCatch';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string;\n\n  /** JSDoc */\n  private readonly _options: TryCatchOptions;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options?: Partial<TryCatchOptions>) {\n    this.name = TryCatch.id;\n    this._options = {\n      XMLHttpRequest: true,\n      eventTarget: true,\n      requestAnimationFrame: true,\n      setInterval: true,\n      setTimeout: true,\n      ...options,\n    };\n  }\n\n  /**\n   * Wrap timer functions and event targets to catch errors\n   * and provide better metadata.\n   */\n  public setupOnce(): void {\n    if (this._options.setTimeout) {\n      fill(WINDOW, 'setTimeout', _wrapTimeFunction);\n    }\n\n    if (this._options.setInterval) {\n      fill(WINDOW, 'setInterval', _wrapTimeFunction);\n    }\n\n    if (this._options.requestAnimationFrame) {\n      fill(WINDOW, 'requestAnimationFrame', _wrapRAF);\n    }\n\n    if (this._options.XMLHttpRequest && 'XMLHttpRequest' in WINDOW) {\n      fill(XMLHttpRequest.prototype, 'send', _wrapXHR);\n    }\n\n    const eventTargetOption = this._options.eventTarget;\n    if (eventTargetOption) {\n      const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET;\n      eventTarget.forEach(_wrapEventTarget);\n    }\n  }\n}\n\n/** JSDoc */\nfunction _wrapTimeFunction(original: () => void): () => number {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  return function (this: any, ...args: any[]): number {\n    const originalCallback = args[0];\n    args[0] = wrap(originalCallback, {\n      mechanism: {\n        data: { function: getFunctionName(original) },\n        handled: false,\n        type: 'instrument',\n      },\n    });\n    return original.apply(this, args);\n  };\n}\n\n/** JSDoc */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _wrapRAF(original: any): (callback: () => void) => any {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  return function (this: any, callback: () => void): () => void {\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    return original.apply(this, [\n      wrap(callback, {\n        mechanism: {\n          data: {\n            function: 'requestAnimationFrame',\n            handler: getFunctionName(original),\n          },\n          handled: false,\n          type: 'instrument',\n        },\n      }),\n    ]);\n  };\n}\n\n/** JSDoc */\nfunction _wrapXHR(originalSend: () => void): () => void {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  return function (this: XMLHttpRequest, ...args: any[]): void {\n    // eslint-disable-next-line @typescript-eslint/no-this-alias\n    const xhr = this;\n    const xmlHttpRequestProps: XMLHttpRequestProp[] = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];\n\n    xmlHttpRequestProps.forEach(prop => {\n      if (prop in xhr && typeof xhr[prop] === 'function') {\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        fill(xhr, prop, function (original: WrappedFunction): () => any {\n          const wrapOptions = {\n            mechanism: {\n              data: {\n                function: prop,\n                handler: getFunctionName(original),\n              },\n              handled: false,\n              type: 'instrument',\n            },\n          };\n\n          // If Instrument integration has been called before TryCatch, get the name of original function\n          const originalFunction = getOriginalFunction(original);\n          if (originalFunction) {\n            wrapOptions.mechanism.data.handler = getFunctionName(originalFunction);\n          }\n\n          // Otherwise wrap directly\n          return wrap(original, wrapOptions);\n        });\n      }\n    });\n\n    return originalSend.apply(this, args);\n  };\n}\n\n/** JSDoc */\nfunction _wrapEventTarget(target: string): void {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const globalObject = WINDOW as { [key: string]: any };\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n  const proto = globalObject[target] && globalObject[target].prototype;\n\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n  if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n    return;\n  }\n\n  fill(proto, 'addEventListener', function (original: () => void): (\n    eventName: string,\n    fn: EventListenerObject,\n    options?: boolean | AddEventListenerOptions,\n  ) => void {\n    return function (\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      this: any,\n      eventName: string,\n      fn: EventListenerObject,\n      options?: boolean | AddEventListenerOptions,\n    ): (eventName: string, fn: EventListenerObject, capture?: boolean, secure?: boolean) => void {\n      try {\n        if (typeof fn.handleEvent === 'function') {\n          // ESlint disable explanation:\n          //  First, it is generally safe to call `wrap` with an unbound function. Furthermore, using `.bind()` would\n          //  introduce a bug here, because bind returns a new function that doesn't have our\n          //  flags(like __sentry_original__) attached. `wrap` checks for those flags to avoid unnecessary wrapping.\n          //  Without those flags, every call to addEventListener wraps the function again, causing a memory leak.\n          // eslint-disable-next-line @typescript-eslint/unbound-method\n          fn.handleEvent = wrap(fn.handleEvent, {\n            mechanism: {\n              data: {\n                function: 'handleEvent',\n                handler: getFunctionName(fn),\n                target,\n              },\n              handled: false,\n              type: 'instrument',\n            },\n          });\n        }\n      } catch (err) {\n        // can sometimes get 'Permission denied to access property \"handle Event'\n      }\n\n      return original.apply(this, [\n        eventName,\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        wrap(fn as any as WrappedFunction, {\n          mechanism: {\n            data: {\n              function: 'addEventListener',\n              handler: getFunctionName(fn),\n              target,\n            },\n            handled: false,\n            type: 'instrument',\n          },\n        }),\n        options,\n      ]);\n    };\n  });\n\n  fill(\n    proto,\n    'removeEventListener',\n    function (\n      originalRemoveEventListener: () => void,\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    ): (this: any, eventName: string, fn: EventListenerObject, options?: boolean | EventListenerOptions) => () => void {\n      return function (\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        this: any,\n        eventName: string,\n        fn: EventListenerObject,\n        options?: boolean | EventListenerOptions,\n      ): () => void {\n        /**\n         * There are 2 possible scenarios here:\n         *\n         * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified\n         * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function\n         * as a pass-through, and call original `removeEventListener` with it.\n         *\n         * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using\n         * our wrapped version of `addEventListener`, which internally calls `wrap` helper.\n         * This helper \"wraps\" whole callback inside a try/catch statement, and attached appropriate metadata to it,\n         * in order for us to make a distinction between wrapped/non-wrapped functions possible.\n         * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.\n         *\n         * When someone adds a handler prior to initialization, and then do it again, but after,\n         * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible\n         * to get rid of the initial handler and it'd stick there forever.\n         */\n        const wrappedEventHandler = fn as unknown as WrappedFunction;\n        try {\n          const originalEventHandler = wrappedEventHandler && wrappedEventHandler.__sentry_wrapped__;\n          if (originalEventHandler) {\n            originalRemoveEventListener.call(this, eventName, originalEventHandler, options);\n          }\n        } catch (e) {\n          // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments\n        }\n        return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options);\n      };\n    },\n  );\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable max-lines */\nimport { getCurrentHub } from '@sentry/core';\nimport type { Event as SentryEvent, HandlerDataFetch, HandlerDataXhr, Integration } from '@sentry/types';\nimport type {\n  FetchBreadcrumbData,\n  FetchBreadcrumbHint,\n  XhrBreadcrumbData,\n  XhrBreadcrumbHint,\n} from '@sentry/types/build/types/breadcrumb';\nimport {\n  addInstrumentationHandler,\n  getEventDescription,\n  htmlTreeAsString,\n  logger,\n  parseUrl,\n  safeJoin,\n  SENTRY_XHR_DATA_KEY,\n  severityLevelFromString,\n} from '@sentry/utils';\n\nimport { WINDOW } from '../helpers';\n\ntype HandlerData = Record<string, unknown>;\n\n/** JSDoc */\ninterface BreadcrumbsOptions {\n  console: boolean;\n  dom:\n    | boolean\n    | {\n        serializeAttribute?: string | string[];\n        maxStringLength?: number;\n      };\n  fetch: boolean;\n  history: boolean;\n  sentry: boolean;\n  xhr: boolean;\n}\n\n/** maxStringLength gets capped to prevent 100 breadcrumbs exceeding 1MB event payload size */\nconst MAX_ALLOWED_STRING_LENGTH = 1024;\n\n/**\n * Default Breadcrumbs instrumentations\n * TODO: Deprecated - with v6, this will be renamed to `Instrument`\n */\nexport class Breadcrumbs implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Breadcrumbs';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string;\n\n  /**\n   * Options of the breadcrumbs integration.\n   */\n  // This field is public, because we use it in the browser client to check if the `sentry` option is enabled.\n  public readonly options: Readonly<BreadcrumbsOptions>;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options?: Partial<BreadcrumbsOptions>) {\n    this.name = Breadcrumbs.id;\n    this.options = {\n      console: true,\n      dom: true,\n      fetch: true,\n      history: true,\n      sentry: true,\n      xhr: true,\n      ...options,\n    };\n  }\n\n  /**\n   * Instrument browser built-ins w/ breadcrumb capturing\n   *  - Console API\n   *  - DOM API (click/typing)\n   *  - XMLHttpRequest API\n   *  - Fetch API\n   *  - History API\n   */\n  public setupOnce(): void {\n    if (this.options.console) {\n      addInstrumentationHandler('console', _consoleBreadcrumb);\n    }\n    if (this.options.dom) {\n      addInstrumentationHandler('dom', _domBreadcrumb(this.options.dom));\n    }\n    if (this.options.xhr) {\n      addInstrumentationHandler('xhr', _xhrBreadcrumb);\n    }\n    if (this.options.fetch) {\n      addInstrumentationHandler('fetch', _fetchBreadcrumb);\n    }\n    if (this.options.history) {\n      addInstrumentationHandler('history', _historyBreadcrumb);\n    }\n    if (this.options.sentry) {\n      const client = getCurrentHub().getClient();\n      client && client.on && client.on('beforeSendEvent', addSentryBreadcrumb);\n    }\n  }\n}\n\n/**\n * Adds a breadcrumb for Sentry events or transactions if this option is enabled.\n */\nfunction addSentryBreadcrumb(event: SentryEvent): void {\n  getCurrentHub().addBreadcrumb(\n    {\n      category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,\n      event_id: event.event_id,\n      level: event.level,\n      message: getEventDescription(event),\n    },\n    {\n      event,\n    },\n  );\n}\n\n/**\n * A HOC that creaes a function that creates breadcrumbs from DOM API calls.\n * This is a HOC so that we get access to dom options in the closure.\n */\nfunction _domBreadcrumb(dom: BreadcrumbsOptions['dom']): (handlerData: HandlerData) => void {\n  function _innerDomBreadcrumb(handlerData: HandlerData): void {\n    let target;\n    let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;\n\n    let maxStringLength =\n      typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined;\n    if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) {\n      __DEBUG_BUILD__ &&\n        logger.warn(\n          `\\`dom.maxStringLength\\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`,\n        );\n      maxStringLength = MAX_ALLOWED_STRING_LENGTH;\n    }\n\n    if (typeof keyAttrs === 'string') {\n      keyAttrs = [keyAttrs];\n    }\n\n    // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n    try {\n      const event = handlerData.event as Event | Node;\n      target = _isEvent(event)\n        ? htmlTreeAsString(event.target, { keyAttrs, maxStringLength })\n        : htmlTreeAsString(event, { keyAttrs, maxStringLength });\n    } catch (e) {\n      target = '<unknown>';\n    }\n\n    if (target.length === 0) {\n      return;\n    }\n\n    getCurrentHub().addBreadcrumb(\n      {\n        category: `ui.${handlerData.name}`,\n        message: target,\n      },\n      {\n        event: handlerData.event,\n        name: handlerData.name,\n        global: handlerData.global,\n      },\n    );\n  }\n\n  return _innerDomBreadcrumb;\n}\n\n/**\n * Creates breadcrumbs from console API calls\n */\nfunction _consoleBreadcrumb(handlerData: HandlerData & { args: unknown[]; level: string }): void {\n  const breadcrumb = {\n    category: 'console',\n    data: {\n      arguments: handlerData.args,\n      logger: 'console',\n    },\n    level: severityLevelFromString(handlerData.level),\n    message: safeJoin(handlerData.args, ' '),\n  };\n\n  if (handlerData.level === 'assert') {\n    if (handlerData.args[0] === false) {\n      breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;\n      breadcrumb.data.arguments = handlerData.args.slice(1);\n    } else {\n      // Don't capture a breadcrumb for passed assertions\n      return;\n    }\n  }\n\n  getCurrentHub().addBreadcrumb(breadcrumb, {\n    input: handlerData.args,\n    level: handlerData.level,\n  });\n}\n\n/**\n * Creates breadcrumbs from XHR API calls\n */\nfunction _xhrBreadcrumb(handlerData: HandlerData & HandlerDataXhr): void {\n  const { startTimestamp, endTimestamp } = handlerData;\n\n  const sentryXhrData = handlerData.xhr[SENTRY_XHR_DATA_KEY];\n\n  // We only capture complete, non-sentry requests\n  if (!startTimestamp || !endTimestamp || !sentryXhrData) {\n    return;\n  }\n\n  const { method, url, status_code, body } = sentryXhrData;\n\n  const data: XhrBreadcrumbData = {\n    method,\n    url,\n    status_code,\n  };\n\n  const hint: XhrBreadcrumbHint = {\n    xhr: handlerData.xhr,\n    input: body,\n    startTimestamp,\n    endTimestamp,\n  };\n\n  getCurrentHub().addBreadcrumb(\n    {\n      category: 'xhr',\n      data,\n      type: 'http',\n    },\n    hint,\n  );\n}\n\n/**\n * Creates breadcrumbs from fetch API calls\n */\nfunction _fetchBreadcrumb(handlerData: HandlerData & HandlerDataFetch & { response?: Response }): void {\n  const { startTimestamp, endTimestamp } = handlerData;\n\n  // We only capture complete fetch requests\n  if (!endTimestamp) {\n    return;\n  }\n\n  if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {\n    // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)\n    return;\n  }\n\n  if (handlerData.error) {\n    const data: FetchBreadcrumbData = handlerData.fetchData;\n    const hint: FetchBreadcrumbHint = {\n      data: handlerData.error,\n      input: handlerData.args,\n      startTimestamp,\n      endTimestamp,\n    };\n\n    getCurrentHub().addBreadcrumb(\n      {\n        category: 'fetch',\n        data,\n        level: 'error',\n        type: 'http',\n      },\n      hint,\n    );\n  } else {\n    const data: FetchBreadcrumbData = {\n      ...handlerData.fetchData,\n      status_code: handlerData.response && handlerData.response.status,\n    };\n    const hint: FetchBreadcrumbHint = {\n      input: handlerData.args,\n      response: handlerData.response,\n      startTimestamp,\n      endTimestamp,\n    };\n    getCurrentHub().addBreadcrumb(\n      {\n        category: 'fetch',\n        data,\n        type: 'http',\n      },\n      hint,\n    );\n  }\n}\n\n/**\n * Creates breadcrumbs from history API calls\n */\nfunction _historyBreadcrumb(handlerData: HandlerData & { from: string; to: string }): void {\n  let from: string | undefined = handlerData.from;\n  let to: string | undefined = handlerData.to;\n  const parsedLoc = parseUrl(WINDOW.location.href);\n  let parsedFrom = parseUrl(from);\n  const parsedTo = parseUrl(to);\n\n  // Initial pushState doesn't provide `from` information\n  if (!parsedFrom.path) {\n    parsedFrom = parsedLoc;\n  }\n\n  // Use only the path component of the URL if the URL matches the current\n  // document (almost all the time when using pushState)\n  if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {\n    to = parsedTo.relative;\n  }\n  if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {\n    from = parsedFrom.relative;\n  }\n\n  getCurrentHub().addBreadcrumb({\n    category: 'navigation',\n    data: {\n      from,\n      to,\n    },\n  });\n}\n\nfunction _isEvent(event: unknown): event is Event {\n  return !!event && !!(event as Record<string, unknown>).target;\n}\n","import type { Client, Event, EventHint, Integration } from '@sentry/types';\nimport { applyAggregateErrorsToEvent } from '@sentry/utils';\n\nimport { exceptionFromError } from '../eventbuilder';\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\ninterface LinkedErrorsOptions {\n  key: string;\n  limit: number;\n}\n\n/** Adds SDK info to an event. */\nexport class LinkedErrors implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'LinkedErrors';\n\n  /**\n   * @inheritDoc\n   */\n  public readonly name: string;\n\n  /**\n   * @inheritDoc\n   */\n  private readonly _key: LinkedErrorsOptions['key'];\n\n  /**\n   * @inheritDoc\n   */\n  private readonly _limit: LinkedErrorsOptions['limit'];\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: Partial<LinkedErrorsOptions> = {}) {\n    this.name = LinkedErrors.id;\n    this._key = options.key || DEFAULT_KEY;\n    this._limit = options.limit || DEFAULT_LIMIT;\n  }\n\n  /** @inheritdoc */\n  public setupOnce(): void {\n    // noop\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public preprocessEvent(event: Event, hint: EventHint | undefined, client: Client): void {\n    const options = client.getOptions();\n\n    applyAggregateErrorsToEvent(\n      exceptionFromError,\n      options.stackParser,\n      options.maxValueLength,\n      this._key,\n      this._limit,\n      event,\n      hint,\n    );\n  }\n}\n","import type { Event, Integration } from '@sentry/types';\n\nimport { WINDOW } from '../helpers';\n\n/** HttpContext integration collects information about HTTP request headers */\nexport class HttpContext implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'HttpContext';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string;\n\n  public constructor() {\n    this.name = HttpContext.id;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    // noop\n  }\n\n  /** @inheritDoc */\n  public preprocessEvent(event: Event): void {\n    // if none of the information we want exists, don't bother\n    if (!WINDOW.navigator && !WINDOW.location && !WINDOW.document) {\n      return;\n    }\n\n    // grab as much info as exists and add it to the event\n    const url = (event.request && event.request.url) || (WINDOW.location && WINDOW.location.href);\n    const { referrer } = WINDOW.document || {};\n    const { userAgent } = WINDOW.navigator || {};\n\n    const headers = {\n      ...(event.request && event.request.headers),\n      ...(referrer && { Referer: referrer }),\n      ...(userAgent && { 'User-Agent': userAgent }),\n    };\n    const request = { ...event.request, ...(url && { url }), headers };\n\n    event.request = request;\n  }\n}\n","import type { Event, Exception, Integration, StackFrame } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\n/** Deduplication filter */\nexport class Dedupe implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Dedupe';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string;\n\n  /**\n   * @inheritDoc\n   */\n  private _previousEvent?: Event;\n\n  public constructor() {\n    this.name = Dedupe.id;\n  }\n\n  /** @inheritDoc */\n  public setupOnce(_addGlobaleventProcessor: unknown, _getCurrentHub: unknown): void {\n    // noop\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public processEvent(currentEvent: Event): Event | null {\n    // We want to ignore any non-error type events, e.g. transactions or replays\n    // These should never be deduped, and also not be compared against as _previousEvent.\n    if (currentEvent.type) {\n      return currentEvent;\n    }\n\n    // Juuust in case something goes wrong\n    try {\n      if (_shouldDropEvent(currentEvent, this._previousEvent)) {\n        __DEBUG_BUILD__ && logger.warn('Event dropped due to being a duplicate of previously captured event.');\n        return null;\n      }\n    } catch (_oO) {} // eslint-disable-line no-empty\n\n    return (this._previousEvent = currentEvent);\n  }\n}\n\n/** JSDoc */\nfunction _shouldDropEvent(currentEvent: Event, previousEvent?: Event): boolean {\n  if (!previousEvent) {\n    return false;\n  }\n\n  if (_isSameMessageEvent(currentEvent, previousEvent)) {\n    return true;\n  }\n\n  if (_isSameExceptionEvent(currentEvent, previousEvent)) {\n    return true;\n  }\n\n  return false;\n}\n\n/** JSDoc */\nfunction _isSameMessageEvent(currentEvent: Event, previousEvent: Event): boolean {\n  const currentMessage = currentEvent.message;\n  const previousMessage = previousEvent.message;\n\n  // If neither event has a message property, they were both exceptions, so bail out\n  if (!currentMessage && !previousMessage) {\n    return false;\n  }\n\n  // If only one event has a stacktrace, but not the other one, they are not the same\n  if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) {\n    return false;\n  }\n\n  if (currentMessage !== previousMessage) {\n    return false;\n  }\n\n  if (!_isSameFingerprint(currentEvent, previousEvent)) {\n    return false;\n  }\n\n  if (!_isSameStacktrace(currentEvent, previousEvent)) {\n    return false;\n  }\n\n  return true;\n}\n\n/** JSDoc */\nfunction _isSameExceptionEvent(currentEvent: Event, previousEvent: Event): boolean {\n  const previousException = _getExceptionFromEvent(previousEvent);\n  const currentException = _getExceptionFromEvent(currentEvent);\n\n  if (!previousException || !currentException) {\n    return false;\n  }\n\n  if (previousException.type !== currentException.type || previousException.value !== currentException.value) {\n    return false;\n  }\n\n  if (!_isSameFingerprint(currentEvent, previousEvent)) {\n    return false;\n  }\n\n  if (!_isSameStacktrace(currentEvent, previousEvent)) {\n    return false;\n  }\n\n  return true;\n}\n\n/** JSDoc */\nfunction _isSameStacktrace(currentEvent: Event, previousEvent: Event): boolean {\n  let currentFrames = _getFramesFromEvent(currentEvent);\n  let previousFrames = _getFramesFromEvent(previousEvent);\n\n  // If neither event has a stacktrace, they are assumed to be the same\n  if (!currentFrames && !previousFrames) {\n    return true;\n  }\n\n  // If only one event has a stacktrace, but not the other one, they are not the same\n  if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) {\n    return false;\n  }\n\n  currentFrames = currentFrames as StackFrame[];\n  previousFrames = previousFrames as StackFrame[];\n\n  // If number of frames differ, they are not the same\n  if (previousFrames.length !== currentFrames.length) {\n    return false;\n  }\n\n  // Otherwise, compare the two\n  for (let i = 0; i < previousFrames.length; i++) {\n    const frameA = previousFrames[i];\n    const frameB = currentFrames[i];\n\n    if (\n      frameA.filename !== frameB.filename ||\n      frameA.lineno !== frameB.lineno ||\n      frameA.colno !== frameB.colno ||\n      frameA.function !== frameB.function\n    ) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\n/** JSDoc */\nfunction _isSameFingerprint(currentEvent: Event, previousEvent: Event): boolean {\n  let currentFingerprint = currentEvent.fingerprint;\n  let previousFingerprint = previousEvent.fingerprint;\n\n  // If neither event has a fingerprint, they are assumed to be the same\n  if (!currentFingerprint && !previousFingerprint) {\n    return true;\n  }\n\n  // If only one event has a fingerprint, but not the other one, they are not the same\n  if ((currentFingerprint && !previousFingerprint) || (!currentFingerprint && previousFingerprint)) {\n    return false;\n  }\n\n  currentFingerprint = currentFingerprint as string[];\n  previousFingerprint = previousFingerprint as string[];\n\n  // Otherwise, compare the two\n  try {\n    return !!(currentFingerprint.join('') === previousFingerprint.join(''));\n  } catch (_oO) {\n    return false;\n  }\n}\n\n/** JSDoc */\nfunction _getExceptionFromEvent(event: Event): Exception | undefined {\n  return event.exception && event.exception.values && event.exception.values[0];\n}\n\n/** JSDoc */\nfunction _getFramesFromEvent(event: Event): StackFrame[] | undefined {\n  const exception = event.exception;\n\n  if (exception) {\n    try {\n      // @ts-expect-error Object could be undefined\n      return exception.values[0].stacktrace.frames;\n    } catch (_oO) {\n      return undefined;\n    }\n  }\n  return undefined;\n}\n","import type { Hub } from '@sentry/core';\nimport {\n  getCurrentHub,\n  getIntegrationsToSetup,\n  getReportDialogEndpoint,\n  initAndBind,\n  Integrations as CoreIntegrations,\n} from '@sentry/core';\nimport type { UserFeedback } from '@sentry/types';\nimport { addInstrumentationHandler, logger, stackParserFromStackParserOptions, supportsFetch } from '@sentry/utils';\n\nimport type { BrowserClientOptions, BrowserOptions } from './client';\nimport { BrowserClient } from './client';\nimport type { ReportDialogOptions } from './helpers';\nimport { WINDOW, wrap as internalWrap } from './helpers';\nimport { Breadcrumbs, Dedupe, GlobalHandlers, HttpContext, LinkedErrors, TryCatch } from './integrations';\nimport { defaultStackParser } from './stack-parsers';\nimport { makeFetchTransport, makeXHRTransport } from './transports';\n\nexport const defaultIntegrations = [\n  new CoreIntegrations.InboundFilters(),\n  new CoreIntegrations.FunctionToString(),\n  new TryCatch(),\n  new Breadcrumbs(),\n  new GlobalHandlers(),\n  new LinkedErrors(),\n  new Dedupe(),\n  new HttpContext(),\n];\n\n/**\n * A magic string that build tooling can leverage in order to inject a release value into the SDK.\n */\ndeclare const __SENTRY_RELEASE__: string | undefined;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible when\n * loading the web page. To set context information or send manual events, use\n * the provided methods.\n *\n * @example\n *\n * ```\n *\n * import { init } from '@sentry/browser';\n *\n * init({\n *   dsn: '__DSN__',\n *   // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { configureScope } from '@sentry/browser';\n * configureScope((scope: Scope) => {\n *   scope.setExtra({ battery: 0.7 });\n *   scope.setTag({ user_mode: 'admin' });\n *   scope.setUser({ id: '4711' });\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { addBreadcrumb } from '@sentry/browser';\n * addBreadcrumb({\n *   message: 'My Breadcrumb',\n *   // ...\n * });\n * ```\n *\n * @example\n *\n * ```\n *\n * import * as Sentry from '@sentry/browser';\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n *   message: 'Manual',\n *   stacktrace: [\n *     // ...\n *   ],\n * });\n * ```\n *\n * @see {@link BrowserOptions} for documentation on configuration options.\n */\nexport function init(options: BrowserOptions = {}): void {\n  if (options.defaultIntegrations === undefined) {\n    options.defaultIntegrations = defaultIntegrations;\n  }\n  if (options.release === undefined) {\n    // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value\n    if (typeof __SENTRY_RELEASE__ === 'string') {\n      options.release = __SENTRY_RELEASE__;\n    }\n\n    // This supports the variable that sentry-webpack-plugin injects\n    if (WINDOW.SENTRY_RELEASE && WINDOW.SENTRY_RELEASE.id) {\n      options.release = WINDOW.SENTRY_RELEASE.id;\n    }\n  }\n  if (options.autoSessionTracking === undefined) {\n    options.autoSessionTracking = true;\n  }\n  if (options.sendClientReports === undefined) {\n    options.sendClientReports = true;\n  }\n\n  const clientOptions: BrowserClientOptions = {\n    ...options,\n    stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),\n    integrations: getIntegrationsToSetup(options),\n    transport: options.transport || (supportsFetch() ? makeFetchTransport : makeXHRTransport),\n  };\n\n  initAndBind(BrowserClient, clientOptions);\n\n  if (options.autoSessionTracking) {\n    startSessionTracking();\n  }\n}\n\n/**\n * Present the user with a report dialog.\n *\n * @param options Everything is optional, we try to fetch all info need from the global scope.\n */\nexport function showReportDialog(options: ReportDialogOptions = {}, hub: Hub = getCurrentHub()): void {\n  // doesn't work without a document (React Native)\n  if (!WINDOW.document) {\n    __DEBUG_BUILD__ && logger.error('Global document not defined in showReportDialog call');\n    return;\n  }\n\n  const { client, scope } = hub.getStackTop();\n  const dsn = options.dsn || (client && client.getDsn());\n  if (!dsn) {\n    __DEBUG_BUILD__ && logger.error('DSN not configured for showReportDialog call');\n    return;\n  }\n\n  if (scope) {\n    options.user = {\n      ...scope.getUser(),\n      ...options.user,\n    };\n  }\n\n  if (!options.eventId) {\n    options.eventId = hub.lastEventId();\n  }\n\n  const script = WINDOW.document.createElement('script');\n  script.async = true;\n  script.crossOrigin = 'anonymous';\n  script.src = getReportDialogEndpoint(dsn, options);\n\n  if (options.onLoad) {\n    script.onload = options.onLoad;\n  }\n\n  const injectionPoint = WINDOW.document.head || WINDOW.document.body;\n  if (injectionPoint) {\n    injectionPoint.appendChild(script);\n  } else {\n    __DEBUG_BUILD__ && logger.error('Not injecting report dialog. No injection point found in HTML');\n  }\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function forceLoad(): void {\n  // Noop\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function onLoad(callback: () => void): void {\n  callback();\n}\n\n/**\n * Wrap code within a try/catch block so the SDK is able to capture errors.\n *\n * @deprecated This function will be removed in v8.\n * It is not part of Sentry's official API and it's easily replaceable by using a try/catch block\n * and calling Sentry.captureException.\n *\n * @param fn A function to wrap.\n *\n * @returns The result of wrapped function call.\n */\n// TODO(v8): Remove this function\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function wrap(fn: (...args: any) => any): any {\n  return internalWrap(fn)();\n}\n\nfunction startSessionOnHub(hub: Hub): void {\n  hub.startSession({ ignoreDuration: true });\n  hub.captureSession();\n}\n\n/**\n * Enable automatic Session Tracking for the initial page load.\n */\nfunction startSessionTracking(): void {\n  if (typeof WINDOW.document === 'undefined') {\n    __DEBUG_BUILD__ &&\n      logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');\n    return;\n  }\n\n  const hub = getCurrentHub();\n\n  // The only way for this to be false is for there to be a version mismatch between @sentry/browser (>= 6.0.0) and\n  // @sentry/hub (< 5.27.0). In the simple case, there won't ever be such a mismatch, because the two packages are\n  // pinned at the same version in package.json, but there are edge cases where it's possible. See\n  // https://github.com/getsentry/sentry-javascript/issues/3207 and\n  // https://github.com/getsentry/sentry-javascript/issues/3234 and\n  // https://github.com/getsentry/sentry-javascript/issues/3278.\n  if (!hub.captureSession) {\n    return;\n  }\n\n  // The session duration for browser sessions does not track a meaningful\n  // concept that can be used as a metric.\n  // Automatically captured sessions are akin to page views, and thus we\n  // discard their duration.\n  startSessionOnHub(hub);\n\n  // We want to create a session for every navigation as well\n  addInstrumentationHandler('history', ({ from, to }) => {\n    // Don't create an additional session for the initial route or if the location did not change\n    if (!(from === undefined || from === to)) {\n      startSessionOnHub(getCurrentHub());\n    }\n  });\n}\n\n/**\n * Captures user feedback and sends it to Sentry.\n */\nexport function captureUserFeedback(feedback: UserFeedback): void {\n  const client = getCurrentHub().getClient<BrowserClient>();\n  if (client) {\n    client.captureUserFeedback(feedback);\n  }\n}\n","import type { Client, ClientOptions } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { getCurrentHub } from './hub';\n\n/** A class object that can instantiate Client objects. */\nexport type ClientClass<F extends Client, O extends ClientOptions> = new (options: O) => F;\n\n/**\n * Internal function to create a new SDK client instance. The client is\n * installed and then bound to the current scope.\n *\n * @param clientClass The client class to instantiate.\n * @param options Options to pass to the client.\n */\nexport function initAndBind<F extends Client, O extends ClientOptions>(\n  clientClass: ClientClass<F, O>,\n  options: O,\n): void {\n  if (options.debug === true) {\n    if (__DEBUG_BUILD__) {\n      logger.enable();\n    } else {\n      // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped\n      // eslint-disable-next-line no-console\n      console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');\n    }\n  }\n  const hub = getCurrentHub();\n  const scope = hub.getScope();\n  scope.update(options.initialScope);\n\n  const client = new clientClass(options);\n  hub.bindClient(client);\n}\n","import type { DsnComponents, Hub } from '@sentry/types';\n\n/**\n * Checks whether given url points to Sentry server\n * @param url url to verify\n */\nexport function isSentryRequestUrl(url: string, hub: Hub): boolean {\n  const client = hub.getClient();\n  const dsn = client && client.getDsn();\n  const tunnel = client && client.getOptions().tunnel;\n\n  return checkDsn(url, dsn) || checkTunnel(url, tunnel);\n}\n\nfunction checkTunnel(url: string, tunnel: string | undefined): boolean {\n  if (!tunnel) {\n    return false;\n  }\n\n  return removeTrailingSlash(url) === removeTrailingSlash(tunnel);\n}\n\nfunction checkDsn(url: string, dsn: DsnComponents | undefined): boolean {\n  return dsn ? url.includes(dsn.host) : false;\n}\n\nfunction removeTrailingSlash(str: string): string {\n  return str[str.length - 1] === '/' ? str.slice(0, -1) : str;\n}\n","import { GLOBAL_OBJ } from '@sentry/utils';\n\n// exporting a separate copy of `WINDOW` rather than exporting the one from `@sentry/browser`\n// prevents the browser package from being bundled in the CDN bundle, and avoids a\n// circular dependency between the browser and replay packages should `@sentry/browser` import\n// from `@sentry/replay` in the future\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nexport const REPLAY_SESSION_KEY = 'sentryReplaySession';\nexport const REPLAY_EVENT_NAME = 'replay_event';\nexport const RECORDING_EVENT_NAME = 'replay_recording';\nexport const UNABLE_TO_SEND_REPLAY = 'Unable to send Replay';\n\n// The idle limit for a session after which recording is paused.\nexport const SESSION_IDLE_PAUSE_DURATION = 300_000; // 5 minutes in ms\n\n// The idle limit for a session after which the session expires.\nexport const SESSION_IDLE_EXPIRE_DURATION = 900_000; // 15 minutes in ms\n\n/** Default flush delays */\nexport const DEFAULT_FLUSH_MIN_DELAY = 5_000;\n// XXX: Temp fix for our debounce logic where `maxWait` would never occur if it\n// was the same as `wait`\nexport const DEFAULT_FLUSH_MAX_DELAY = 5_500;\n\n/* How long to wait for error checkouts */\nexport const BUFFER_CHECKOUT_TIME = 60_000;\n\nexport const RETRY_BASE_INTERVAL = 5000;\nexport const RETRY_MAX_COUNT = 3;\n\n/* The max (uncompressed) size in bytes of a network body. Any body larger than this will be truncated. */\nexport const NETWORK_BODY_MAX_SIZE = 150_000;\n\n/* The max size of a single console arg that is captured. Any arg larger than this will be truncated. */\nexport const CONSOLE_ARG_MAX_SIZE = 5_000;\n\n/* Min. time to wait before we consider something a slow click. */\nexport const SLOW_CLICK_THRESHOLD = 3_000;\n/* For scroll actions after a click, we only look for a very short time period to detect programmatic scrolling. */\nexport const SLOW_CLICK_SCROLL_TIMEOUT = 300;\n\n/** When encountering a total segment size exceeding this size, stop the replay (as we cannot properly ingest it). */\nexport const REPLAY_MAX_EVENT_BUFFER_SIZE = 20_000_000; // ~20MB\n\n/** Replays must be min. 5s long before we send them. */\nexport const MIN_REPLAY_DURATION = 4_999;\n/* The max. allowed value that the minReplayDuration can be set to. */\nexport const MIN_REPLAY_DURATION_LIMIT = 15_000;\n\n/** The max. length of a replay. */\nexport const MAX_REPLAY_DURATION = 3_600_000; // 60 minutes in ms;\n\n/** Default attributes to be ignored when `maskAllText` is enabled */\nexport const DEFAULT_IGNORED_ATTRIBUTES = ['title', 'placeholder'];\n","var NodeType;\r\n(function (NodeType) {\r\n    NodeType[NodeType[\"Document\"] = 0] = \"Document\";\r\n    NodeType[NodeType[\"DocumentType\"] = 1] = \"DocumentType\";\r\n    NodeType[NodeType[\"Element\"] = 2] = \"Element\";\r\n    NodeType[NodeType[\"Text\"] = 3] = \"Text\";\r\n    NodeType[NodeType[\"CDATA\"] = 4] = \"CDATA\";\r\n    NodeType[NodeType[\"Comment\"] = 5] = \"Comment\";\r\n})(NodeType || (NodeType = {}));\n\nfunction isElement(n) {\r\n    return n.nodeType === n.ELEMENT_NODE;\r\n}\r\nfunction isShadowRoot(n) {\r\n    const host = n === null || n === void 0 ? void 0 : n.host;\r\n    return Boolean((host === null || host === void 0 ? void 0 : host.shadowRoot) === n);\r\n}\r\nfunction isNativeShadowDom(shadowRoot) {\r\n    return Object.prototype.toString.call(shadowRoot) === '[object ShadowRoot]';\r\n}\r\nfunction fixBrowserCompatibilityIssuesInCSS(cssText) {\r\n    if (cssText.includes(' background-clip: text;') &&\r\n        !cssText.includes(' -webkit-background-clip: text;')) {\r\n        cssText = cssText.replace(' background-clip: text;', ' -webkit-background-clip: text; background-clip: text;');\r\n    }\r\n    return cssText;\r\n}\r\nfunction escapeImportStatement(rule) {\r\n    const { cssText } = rule;\r\n    if (cssText.split('\"').length < 3)\r\n        return cssText;\r\n    const statement = ['@import', `url(${JSON.stringify(rule.href)})`];\r\n    if (rule.layerName === '') {\r\n        statement.push(`layer`);\r\n    }\r\n    else if (rule.layerName) {\r\n        statement.push(`layer(${rule.layerName})`);\r\n    }\r\n    if (rule.supportsText) {\r\n        statement.push(`supports(${rule.supportsText})`);\r\n    }\r\n    if (rule.media.length) {\r\n        statement.push(rule.media.mediaText);\r\n    }\r\n    return statement.join(' ') + ';';\r\n}\r\nfunction stringifyStylesheet(s) {\r\n    try {\r\n        const rules = s.rules || s.cssRules;\r\n        return rules\r\n            ? fixBrowserCompatibilityIssuesInCSS(Array.from(rules, stringifyRule).join(''))\r\n            : null;\r\n    }\r\n    catch (error) {\r\n        return null;\r\n    }\r\n}\r\nfunction stringifyRule(rule) {\r\n    let importStringified;\r\n    if (isCSSImportRule(rule)) {\r\n        try {\r\n            importStringified =\r\n                stringifyStylesheet(rule.styleSheet) ||\r\n                    escapeImportStatement(rule);\r\n        }\r\n        catch (error) {\r\n        }\r\n    }\r\n    else if (isCSSStyleRule(rule) && rule.selectorText.includes(':')) {\r\n        return fixSafariColons(rule.cssText);\r\n    }\r\n    return importStringified || rule.cssText;\r\n}\r\nfunction fixSafariColons(cssStringified) {\r\n    const regex = /(\\[(?:[\\w-]+)[^\\\\])(:(?:[\\w-]+)\\])/gm;\r\n    return cssStringified.replace(regex, '$1\\\\$2');\r\n}\r\nfunction isCSSImportRule(rule) {\r\n    return 'styleSheet' in rule;\r\n}\r\nfunction isCSSStyleRule(rule) {\r\n    return 'selectorText' in rule;\r\n}\r\nclass Mirror {\r\n    constructor() {\r\n        this.idNodeMap = new Map();\r\n        this.nodeMetaMap = new WeakMap();\r\n    }\r\n    getId(n) {\r\n        var _a;\r\n        if (!n)\r\n            return -1;\r\n        const id = (_a = this.getMeta(n)) === null || _a === void 0 ? void 0 : _a.id;\r\n        return id !== null && id !== void 0 ? id : -1;\r\n    }\r\n    getNode(id) {\r\n        return this.idNodeMap.get(id) || null;\r\n    }\r\n    getIds() {\r\n        return Array.from(this.idNodeMap.keys());\r\n    }\r\n    getMeta(n) {\r\n        return this.nodeMetaMap.get(n) || null;\r\n    }\r\n    removeNodeFromMap(n) {\r\n        const id = this.getId(n);\r\n        this.idNodeMap.delete(id);\r\n        if (n.childNodes) {\r\n            n.childNodes.forEach((childNode) => this.removeNodeFromMap(childNode));\r\n        }\r\n    }\r\n    has(id) {\r\n        return this.idNodeMap.has(id);\r\n    }\r\n    hasNode(node) {\r\n        return this.nodeMetaMap.has(node);\r\n    }\r\n    add(n, meta) {\r\n        const id = meta.id;\r\n        this.idNodeMap.set(id, n);\r\n        this.nodeMetaMap.set(n, meta);\r\n    }\r\n    replace(id, n) {\r\n        const oldNode = this.getNode(id);\r\n        if (oldNode) {\r\n            const meta = this.nodeMetaMap.get(oldNode);\r\n            if (meta)\r\n                this.nodeMetaMap.set(n, meta);\r\n        }\r\n        this.idNodeMap.set(id, n);\r\n    }\r\n    reset() {\r\n        this.idNodeMap = new Map();\r\n        this.nodeMetaMap = new WeakMap();\r\n    }\r\n}\r\nfunction createMirror() {\r\n    return new Mirror();\r\n}\r\nfunction shouldMaskInput({ maskInputOptions, tagName, type, }) {\r\n    if (tagName === 'OPTION') {\r\n        tagName = 'SELECT';\r\n    }\r\n    return Boolean(maskInputOptions[tagName.toLowerCase()] ||\r\n        (type && maskInputOptions[type]) ||\r\n        type === 'password' ||\r\n        (tagName === 'INPUT' && !type && maskInputOptions['text']));\r\n}\r\nfunction maskInputValue({ isMasked, element, value, maskInputFn, }) {\r\n    let text = value || '';\r\n    if (!isMasked) {\r\n        return text;\r\n    }\r\n    if (maskInputFn) {\r\n        text = maskInputFn(text, element);\r\n    }\r\n    return '*'.repeat(text.length);\r\n}\r\nfunction toLowerCase(str) {\r\n    return str.toLowerCase();\r\n}\r\nfunction toUpperCase(str) {\r\n    return str.toUpperCase();\r\n}\r\nconst ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';\r\nfunction is2DCanvasBlank(canvas) {\r\n    const ctx = canvas.getContext('2d');\r\n    if (!ctx)\r\n        return true;\r\n    const chunkSize = 50;\r\n    for (let x = 0; x < canvas.width; x += chunkSize) {\r\n        for (let y = 0; y < canvas.height; y += chunkSize) {\r\n            const getImageData = ctx.getImageData;\r\n            const originalGetImageData = ORIGINAL_ATTRIBUTE_NAME in getImageData\r\n                ? getImageData[ORIGINAL_ATTRIBUTE_NAME]\r\n                : getImageData;\r\n            const pixelBuffer = new Uint32Array(originalGetImageData.call(ctx, x, y, Math.min(chunkSize, canvas.width - x), Math.min(chunkSize, canvas.height - y)).data.buffer);\r\n            if (pixelBuffer.some((pixel) => pixel !== 0))\r\n                return false;\r\n        }\r\n    }\r\n    return true;\r\n}\r\nfunction isNodeMetaEqual(a, b) {\r\n    if (!a || !b || a.type !== b.type)\r\n        return false;\r\n    if (a.type === NodeType.Document)\r\n        return a.compatMode === b.compatMode;\r\n    else if (a.type === NodeType.DocumentType)\r\n        return (a.name === b.name &&\r\n            a.publicId === b.publicId &&\r\n            a.systemId === b.systemId);\r\n    else if (a.type === NodeType.Comment ||\r\n        a.type === NodeType.Text ||\r\n        a.type === NodeType.CDATA)\r\n        return a.textContent === b.textContent;\r\n    else if (a.type === NodeType.Element)\r\n        return (a.tagName === b.tagName &&\r\n            JSON.stringify(a.attributes) ===\r\n                JSON.stringify(b.attributes) &&\r\n            a.isSVG === b.isSVG &&\r\n            a.needBlock === b.needBlock);\r\n    return false;\r\n}\r\nfunction getInputType(element) {\r\n    const type = element.type;\r\n    return element.hasAttribute('data-rr-is-password')\r\n        ? 'password'\r\n        : type\r\n            ?\r\n                toLowerCase(type)\r\n            : null;\r\n}\r\nfunction getInputValue(el, tagName, type) {\r\n    if (tagName === 'INPUT' && (type === 'radio' || type === 'checkbox')) {\r\n        return el.getAttribute('value') || '';\r\n    }\r\n    return el.value;\r\n}\n\nlet _id = 1;\r\nconst tagNameRegex = new RegExp('[^a-z0-9-_:]');\r\nconst IGNORED_NODE = -2;\r\nfunction genId() {\r\n    return _id++;\r\n}\r\nfunction getValidTagName(element) {\r\n    if (element instanceof HTMLFormElement) {\r\n        return 'form';\r\n    }\r\n    const processedTagName = toLowerCase(element.tagName);\r\n    if (tagNameRegex.test(processedTagName)) {\r\n        return 'div';\r\n    }\r\n    return processedTagName;\r\n}\r\nfunction extractOrigin(url) {\r\n    let origin = '';\r\n    if (url.indexOf('//') > -1) {\r\n        origin = url.split('/').slice(0, 3).join('/');\r\n    }\r\n    else {\r\n        origin = url.split('/')[0];\r\n    }\r\n    origin = origin.split('?')[0];\r\n    return origin;\r\n}\r\nlet canvasService;\r\nlet canvasCtx;\r\nconst URL_IN_CSS_REF = /url\\((?:(')([^']*)'|(\")(.*?)\"|([^)]*))\\)/gm;\r\nconst URL_PROTOCOL_MATCH = /^(?:[a-z+]+:)?\\/\\//i;\r\nconst URL_WWW_MATCH = /^www\\..*/i;\r\nconst DATA_URI = /^(data:)([^,]*),(.*)/i;\r\nfunction absoluteToStylesheet(cssText, href) {\r\n    return (cssText || '').replace(URL_IN_CSS_REF, (origin, quote1, path1, quote2, path2, path3) => {\r\n        const filePath = path1 || path2 || path3;\r\n        const maybeQuote = quote1 || quote2 || '';\r\n        if (!filePath) {\r\n            return origin;\r\n        }\r\n        if (URL_PROTOCOL_MATCH.test(filePath) || URL_WWW_MATCH.test(filePath)) {\r\n            return `url(${maybeQuote}${filePath}${maybeQuote})`;\r\n        }\r\n        if (DATA_URI.test(filePath)) {\r\n            return `url(${maybeQuote}${filePath}${maybeQuote})`;\r\n        }\r\n        if (filePath[0] === '/') {\r\n            return `url(${maybeQuote}${extractOrigin(href) + filePath}${maybeQuote})`;\r\n        }\r\n        const stack = href.split('/');\r\n        const parts = filePath.split('/');\r\n        stack.pop();\r\n        for (const part of parts) {\r\n            if (part === '.') {\r\n                continue;\r\n            }\r\n            else if (part === '..') {\r\n                stack.pop();\r\n            }\r\n            else {\r\n                stack.push(part);\r\n            }\r\n        }\r\n        return `url(${maybeQuote}${stack.join('/')}${maybeQuote})`;\r\n    });\r\n}\r\nconst SRCSET_NOT_SPACES = /^[^ \\t\\n\\r\\u000c]+/;\r\nconst SRCSET_COMMAS_OR_SPACES = /^[, \\t\\n\\r\\u000c]+/;\r\nfunction getAbsoluteSrcsetString(doc, attributeValue) {\r\n    if (attributeValue.trim() === '') {\r\n        return attributeValue;\r\n    }\r\n    let pos = 0;\r\n    function collectCharacters(regEx) {\r\n        let chars;\r\n        const match = regEx.exec(attributeValue.substring(pos));\r\n        if (match) {\r\n            chars = match[0];\r\n            pos += chars.length;\r\n            return chars;\r\n        }\r\n        return '';\r\n    }\r\n    const output = [];\r\n    while (true) {\r\n        collectCharacters(SRCSET_COMMAS_OR_SPACES);\r\n        if (pos >= attributeValue.length) {\r\n            break;\r\n        }\r\n        let url = collectCharacters(SRCSET_NOT_SPACES);\r\n        if (url.slice(-1) === ',') {\r\n            url = absoluteToDoc(doc, url.substring(0, url.length - 1));\r\n            output.push(url);\r\n        }\r\n        else {\r\n            let descriptorsStr = '';\r\n            url = absoluteToDoc(doc, url);\r\n            let inParens = false;\r\n            while (true) {\r\n                const c = attributeValue.charAt(pos);\r\n                if (c === '') {\r\n                    output.push((url + descriptorsStr).trim());\r\n                    break;\r\n                }\r\n                else if (!inParens) {\r\n                    if (c === ',') {\r\n                        pos += 1;\r\n                        output.push((url + descriptorsStr).trim());\r\n                        break;\r\n                    }\r\n                    else if (c === '(') {\r\n                        inParens = true;\r\n                    }\r\n                }\r\n                else {\r\n                    if (c === ')') {\r\n                        inParens = false;\r\n                    }\r\n                }\r\n                descriptorsStr += c;\r\n                pos += 1;\r\n            }\r\n        }\r\n    }\r\n    return output.join(', ');\r\n}\r\nfunction absoluteToDoc(doc, attributeValue) {\r\n    if (!attributeValue || attributeValue.trim() === '') {\r\n        return attributeValue;\r\n    }\r\n    const a = doc.createElement('a');\r\n    a.href = attributeValue;\r\n    return a.href;\r\n}\r\nfunction isSVGElement(el) {\r\n    return Boolean(el.tagName === 'svg' || el.ownerSVGElement);\r\n}\r\nfunction getHref() {\r\n    const a = document.createElement('a');\r\n    a.href = '';\r\n    return a.href;\r\n}\r\nfunction transformAttribute(doc, tagName, name, value, element, maskAttributeFn) {\r\n    if (!value) {\r\n        return value;\r\n    }\r\n    if (name === 'src' ||\r\n        (name === 'href' && !(tagName === 'use' && value[0] === '#'))) {\r\n        return absoluteToDoc(doc, value);\r\n    }\r\n    else if (name === 'xlink:href' && value[0] !== '#') {\r\n        return absoluteToDoc(doc, value);\r\n    }\r\n    else if (name === 'background' &&\r\n        (tagName === 'table' || tagName === 'td' || tagName === 'th')) {\r\n        return absoluteToDoc(doc, value);\r\n    }\r\n    else if (name === 'srcset') {\r\n        return getAbsoluteSrcsetString(doc, value);\r\n    }\r\n    else if (name === 'style') {\r\n        return absoluteToStylesheet(value, getHref());\r\n    }\r\n    else if (tagName === 'object' && name === 'data') {\r\n        return absoluteToDoc(doc, value);\r\n    }\r\n    if (typeof maskAttributeFn === 'function') {\r\n        return maskAttributeFn(name, value, element);\r\n    }\r\n    return value;\r\n}\r\nfunction ignoreAttribute(tagName, name, _value) {\r\n    return (tagName === 'video' || tagName === 'audio') && name === 'autoplay';\r\n}\r\nfunction _isBlockedElement(element, blockClass, blockSelector, unblockSelector) {\r\n    try {\r\n        if (unblockSelector && element.matches(unblockSelector)) {\r\n            return false;\r\n        }\r\n        if (typeof blockClass === 'string') {\r\n            if (element.classList.contains(blockClass)) {\r\n                return true;\r\n            }\r\n        }\r\n        else {\r\n            for (let eIndex = element.classList.length; eIndex--;) {\r\n                const className = element.classList[eIndex];\r\n                if (blockClass.test(className)) {\r\n                    return true;\r\n                }\r\n            }\r\n        }\r\n        if (blockSelector) {\r\n            return element.matches(blockSelector);\r\n        }\r\n    }\r\n    catch (e) {\r\n    }\r\n    return false;\r\n}\r\nfunction elementClassMatchesRegex(el, regex) {\r\n    for (let eIndex = el.classList.length; eIndex--;) {\r\n        const className = el.classList[eIndex];\r\n        if (regex.test(className)) {\r\n            return true;\r\n        }\r\n    }\r\n    return false;\r\n}\r\nfunction distanceToMatch(node, matchPredicate, limit = Infinity, distance = 0) {\r\n    if (!node)\r\n        return -1;\r\n    if (node.nodeType !== node.ELEMENT_NODE)\r\n        return -1;\r\n    if (distance > limit)\r\n        return -1;\r\n    if (matchPredicate(node))\r\n        return distance;\r\n    return distanceToMatch(node.parentNode, matchPredicate, limit, distance + 1);\r\n}\r\nfunction createMatchPredicate(className, selector) {\r\n    return (node) => {\r\n        const el = node;\r\n        if (el === null)\r\n            return false;\r\n        if (className) {\r\n            if (typeof className === 'string') {\r\n                if (el.matches(`.${className}`))\r\n                    return true;\r\n            }\r\n            else if (elementClassMatchesRegex(el, className)) {\r\n                return true;\r\n            }\r\n        }\r\n        if (selector && el.matches(selector))\r\n            return true;\r\n        return false;\r\n    };\r\n}\r\nfunction needMaskingText(node, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, maskAllText) {\r\n    try {\r\n        const el = node.nodeType === node.ELEMENT_NODE\r\n            ? node\r\n            : node.parentElement;\r\n        if (el === null)\r\n            return false;\r\n        let maskDistance = -1;\r\n        let unmaskDistance = -1;\r\n        if (maskAllText) {\r\n            unmaskDistance = distanceToMatch(el, createMatchPredicate(unmaskTextClass, unmaskTextSelector));\r\n            if (unmaskDistance < 0) {\r\n                return true;\r\n            }\r\n            maskDistance = distanceToMatch(el, createMatchPredicate(maskTextClass, maskTextSelector), unmaskDistance >= 0 ? unmaskDistance : Infinity);\r\n        }\r\n        else {\r\n            maskDistance = distanceToMatch(el, createMatchPredicate(maskTextClass, maskTextSelector));\r\n            if (maskDistance < 0) {\r\n                return false;\r\n            }\r\n            unmaskDistance = distanceToMatch(el, createMatchPredicate(unmaskTextClass, unmaskTextSelector), maskDistance >= 0 ? maskDistance : Infinity);\r\n        }\r\n        return maskDistance >= 0\r\n            ? unmaskDistance >= 0\r\n                ? maskDistance <= unmaskDistance\r\n                : true\r\n            : unmaskDistance >= 0\r\n                ? false\r\n                : !!maskAllText;\r\n    }\r\n    catch (e) {\r\n    }\r\n    return !!maskAllText;\r\n}\r\nfunction onceIframeLoaded(iframeEl, listener, iframeLoadTimeout) {\r\n    const win = iframeEl.contentWindow;\r\n    if (!win) {\r\n        return;\r\n    }\r\n    let fired = false;\r\n    let readyState;\r\n    try {\r\n        readyState = win.document.readyState;\r\n    }\r\n    catch (error) {\r\n        return;\r\n    }\r\n    if (readyState !== 'complete') {\r\n        const timer = setTimeout(() => {\r\n            if (!fired) {\r\n                listener();\r\n                fired = true;\r\n            }\r\n        }, iframeLoadTimeout);\r\n        iframeEl.addEventListener('load', () => {\r\n            clearTimeout(timer);\r\n            fired = true;\r\n            listener();\r\n        });\r\n        return;\r\n    }\r\n    const blankUrl = 'about:blank';\r\n    if (win.location.href !== blankUrl ||\r\n        iframeEl.src === blankUrl ||\r\n        iframeEl.src === '') {\r\n        setTimeout(listener, 0);\r\n        return iframeEl.addEventListener('load', listener);\r\n    }\r\n    iframeEl.addEventListener('load', listener);\r\n}\r\nfunction onceStylesheetLoaded(link, listener, styleSheetLoadTimeout) {\r\n    let fired = false;\r\n    let styleSheetLoaded;\r\n    try {\r\n        styleSheetLoaded = link.sheet;\r\n    }\r\n    catch (error) {\r\n        return;\r\n    }\r\n    if (styleSheetLoaded)\r\n        return;\r\n    const timer = setTimeout(() => {\r\n        if (!fired) {\r\n            listener();\r\n            fired = true;\r\n        }\r\n    }, styleSheetLoadTimeout);\r\n    link.addEventListener('load', () => {\r\n        clearTimeout(timer);\r\n        fired = true;\r\n        listener();\r\n    });\r\n}\r\nfunction serializeNode(n, options) {\r\n    const { doc, mirror, blockClass, blockSelector, unblockSelector, maskAllText, maskAttributeFn, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, inlineStylesheet, maskInputOptions = {}, maskTextFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, newlyAddedElement = false, } = options;\r\n    const rootId = getRootId(doc, mirror);\r\n    switch (n.nodeType) {\r\n        case n.DOCUMENT_NODE:\r\n            if (n.compatMode !== 'CSS1Compat') {\r\n                return {\r\n                    type: NodeType.Document,\r\n                    childNodes: [],\r\n                    compatMode: n.compatMode,\r\n                };\r\n            }\r\n            else {\r\n                return {\r\n                    type: NodeType.Document,\r\n                    childNodes: [],\r\n                };\r\n            }\r\n        case n.DOCUMENT_TYPE_NODE:\r\n            return {\r\n                type: NodeType.DocumentType,\r\n                name: n.name,\r\n                publicId: n.publicId,\r\n                systemId: n.systemId,\r\n                rootId,\r\n            };\r\n        case n.ELEMENT_NODE:\r\n            return serializeElementNode(n, {\r\n                doc,\r\n                blockClass,\r\n                blockSelector,\r\n                unblockSelector,\r\n                inlineStylesheet,\r\n                maskAttributeFn,\r\n                maskInputOptions,\r\n                maskInputFn,\r\n                dataURLOptions,\r\n                inlineImages,\r\n                recordCanvas,\r\n                keepIframeSrcFn,\r\n                newlyAddedElement,\r\n                rootId,\r\n                maskAllText,\r\n                maskTextClass,\r\n                unmaskTextClass,\r\n                maskTextSelector,\r\n                unmaskTextSelector,\r\n            });\r\n        case n.TEXT_NODE:\r\n            return serializeTextNode(n, {\r\n                maskAllText,\r\n                maskTextClass,\r\n                unmaskTextClass,\r\n                maskTextSelector,\r\n                unmaskTextSelector,\r\n                maskTextFn,\r\n                maskInputOptions,\r\n                maskInputFn,\r\n                rootId,\r\n            });\r\n        case n.CDATA_SECTION_NODE:\r\n            return {\r\n                type: NodeType.CDATA,\r\n                textContent: '',\r\n                rootId,\r\n            };\r\n        case n.COMMENT_NODE:\r\n            return {\r\n                type: NodeType.Comment,\r\n                textContent: n.textContent || '',\r\n                rootId,\r\n            };\r\n        default:\r\n            return false;\r\n    }\r\n}\r\nfunction getRootId(doc, mirror) {\r\n    if (!mirror.hasNode(doc))\r\n        return undefined;\r\n    const docId = mirror.getId(doc);\r\n    return docId === 1 ? undefined : docId;\r\n}\r\nfunction serializeTextNode(n, options) {\r\n    var _a;\r\n    const { maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, maskTextFn, maskInputOptions, maskInputFn, rootId, } = options;\r\n    const parentTagName = n.parentNode && n.parentNode.tagName;\r\n    let textContent = n.textContent;\r\n    const isStyle = parentTagName === 'STYLE' ? true : undefined;\r\n    const isScript = parentTagName === 'SCRIPT' ? true : undefined;\r\n    const isTextarea = parentTagName === 'TEXTAREA' ? true : undefined;\r\n    if (isStyle && textContent) {\r\n        try {\r\n            if (n.nextSibling || n.previousSibling) {\r\n            }\r\n            else if ((_a = n.parentNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) {\r\n                textContent = stringifyStylesheet(n.parentNode.sheet);\r\n            }\r\n        }\r\n        catch (err) {\r\n            console.warn(`Cannot get CSS styles from text's parentNode. Error: ${err}`, n);\r\n        }\r\n        textContent = absoluteToStylesheet(textContent, getHref());\r\n    }\r\n    if (isScript) {\r\n        textContent = 'SCRIPT_PLACEHOLDER';\r\n    }\r\n    const forceMask = needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, maskAllText);\r\n    if (!isStyle && !isScript && !isTextarea && textContent && forceMask) {\r\n        textContent = maskTextFn\r\n            ? maskTextFn(textContent)\r\n            : textContent.replace(/[\\S]/g, '*');\r\n    }\r\n    if (isTextarea && textContent && (maskInputOptions.textarea || forceMask)) {\r\n        textContent = maskInputFn\r\n            ? maskInputFn(textContent, n.parentNode)\r\n            : textContent.replace(/[\\S]/g, '*');\r\n    }\r\n    if (parentTagName === 'OPTION' && textContent) {\r\n        const isInputMasked = shouldMaskInput({\r\n            type: null,\r\n            tagName: parentTagName,\r\n            maskInputOptions,\r\n        });\r\n        textContent = maskInputValue({\r\n            isMasked: needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, isInputMasked),\r\n            element: n,\r\n            value: textContent,\r\n            maskInputFn,\r\n        });\r\n    }\r\n    return {\r\n        type: NodeType.Text,\r\n        textContent: textContent || '',\r\n        isStyle,\r\n        rootId,\r\n    };\r\n}\r\nfunction serializeElementNode(n, options) {\r\n    const { doc, blockClass, blockSelector, unblockSelector, inlineStylesheet, maskInputOptions = {}, maskAttributeFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, newlyAddedElement = false, rootId, maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, } = options;\r\n    const needBlock = _isBlockedElement(n, blockClass, blockSelector, unblockSelector);\r\n    const tagName = getValidTagName(n);\r\n    let attributes = {};\r\n    const len = n.attributes.length;\r\n    for (let i = 0; i < len; i++) {\r\n        const attr = n.attributes[i];\r\n        if (!ignoreAttribute(tagName, attr.name, attr.value)) {\r\n            attributes[attr.name] = transformAttribute(doc, tagName, toLowerCase(attr.name), attr.value, n, maskAttributeFn);\r\n        }\r\n    }\r\n    if (tagName === 'link' && inlineStylesheet) {\r\n        const stylesheet = Array.from(doc.styleSheets).find((s) => {\r\n            return s.href === n.href;\r\n        });\r\n        let cssText = null;\r\n        if (stylesheet) {\r\n            cssText = stringifyStylesheet(stylesheet);\r\n        }\r\n        if (cssText) {\r\n            delete attributes.rel;\r\n            delete attributes.href;\r\n            attributes._cssText = absoluteToStylesheet(cssText, stylesheet.href);\r\n        }\r\n    }\r\n    if (tagName === 'style' &&\r\n        n.sheet &&\r\n        !(n.innerText || n.textContent || '').trim().length) {\r\n        const cssText = stringifyStylesheet(n.sheet);\r\n        if (cssText) {\r\n            attributes._cssText = absoluteToStylesheet(cssText, getHref());\r\n        }\r\n    }\r\n    if (tagName === 'input' ||\r\n        tagName === 'textarea' ||\r\n        tagName === 'select' ||\r\n        tagName === 'option') {\r\n        const el = n;\r\n        const type = getInputType(el);\r\n        const value = getInputValue(el, toUpperCase(tagName), type);\r\n        const checked = el.checked;\r\n        if (type !== 'submit' && type !== 'button' && value) {\r\n            const forceMask = needMaskingText(el, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, shouldMaskInput({\r\n                type,\r\n                tagName: toUpperCase(tagName),\r\n                maskInputOptions,\r\n            }));\r\n            attributes.value = maskInputValue({\r\n                isMasked: forceMask,\r\n                element: el,\r\n                value,\r\n                maskInputFn,\r\n            });\r\n        }\r\n        if (checked) {\r\n            attributes.checked = checked;\r\n        }\r\n    }\r\n    if (tagName === 'option') {\r\n        if (n.selected && !maskInputOptions['select']) {\r\n            attributes.selected = true;\r\n        }\r\n        else {\r\n            delete attributes.selected;\r\n        }\r\n    }\r\n    if (tagName === 'canvas' && recordCanvas) {\r\n        if (n.__context === '2d') {\r\n            if (!is2DCanvasBlank(n)) {\r\n                attributes.rr_dataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n            }\r\n        }\r\n        else if (!('__context' in n)) {\r\n            const canvasDataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n            const blankCanvas = document.createElement('canvas');\r\n            blankCanvas.width = n.width;\r\n            blankCanvas.height = n.height;\r\n            const blankCanvasDataURL = blankCanvas.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n            if (canvasDataURL !== blankCanvasDataURL) {\r\n                attributes.rr_dataURL = canvasDataURL;\r\n            }\r\n        }\r\n    }\r\n    if (tagName === 'img' && inlineImages) {\r\n        if (!canvasService) {\r\n            canvasService = doc.createElement('canvas');\r\n            canvasCtx = canvasService.getContext('2d');\r\n        }\r\n        const image = n;\r\n        const oldValue = image.crossOrigin;\r\n        image.crossOrigin = 'anonymous';\r\n        const recordInlineImage = () => {\r\n            image.removeEventListener('load', recordInlineImage);\r\n            try {\r\n                canvasService.width = image.naturalWidth;\r\n                canvasService.height = image.naturalHeight;\r\n                canvasCtx.drawImage(image, 0, 0);\r\n                attributes.rr_dataURL = canvasService.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n            }\r\n            catch (err) {\r\n                console.warn(`Cannot inline img src=${image.currentSrc}! Error: ${err}`);\r\n            }\r\n            oldValue\r\n                ? (attributes.crossOrigin = oldValue)\r\n                : image.removeAttribute('crossorigin');\r\n        };\r\n        if (image.complete && image.naturalWidth !== 0)\r\n            recordInlineImage();\r\n        else\r\n            image.addEventListener('load', recordInlineImage);\r\n    }\r\n    if (tagName === 'audio' || tagName === 'video') {\r\n        attributes.rr_mediaState = n.paused\r\n            ? 'paused'\r\n            : 'played';\r\n        attributes.rr_mediaCurrentTime = n.currentTime;\r\n    }\r\n    if (!newlyAddedElement) {\r\n        if (n.scrollLeft) {\r\n            attributes.rr_scrollLeft = n.scrollLeft;\r\n        }\r\n        if (n.scrollTop) {\r\n            attributes.rr_scrollTop = n.scrollTop;\r\n        }\r\n    }\r\n    if (needBlock) {\r\n        const { width, height } = n.getBoundingClientRect();\r\n        attributes = {\r\n            class: attributes.class,\r\n            rr_width: `${width}px`,\r\n            rr_height: `${height}px`,\r\n        };\r\n    }\r\n    if (tagName === 'iframe' && !keepIframeSrcFn(attributes.src)) {\r\n        if (!n.contentDocument) {\r\n            attributes.rr_src = attributes.src;\r\n        }\r\n        delete attributes.src;\r\n    }\r\n    let isCustomElement;\r\n    try {\r\n        if (customElements.get(tagName))\r\n            isCustomElement = true;\r\n    }\r\n    catch (e) {\r\n    }\r\n    return {\r\n        type: NodeType.Element,\r\n        tagName,\r\n        attributes,\r\n        childNodes: [],\r\n        isSVG: isSVGElement(n) || undefined,\r\n        needBlock,\r\n        rootId,\r\n        isCustom: isCustomElement,\r\n    };\r\n}\r\nfunction lowerIfExists(maybeAttr) {\r\n    if (maybeAttr === undefined || maybeAttr === null) {\r\n        return '';\r\n    }\r\n    else {\r\n        return maybeAttr.toLowerCase();\r\n    }\r\n}\r\nfunction slimDOMExcluded(sn, slimDOMOptions) {\r\n    if (slimDOMOptions.comment && sn.type === NodeType.Comment) {\r\n        return true;\r\n    }\r\n    else if (sn.type === NodeType.Element) {\r\n        if (slimDOMOptions.script &&\r\n            (sn.tagName === 'script' ||\r\n                (sn.tagName === 'link' &&\r\n                    (sn.attributes.rel === 'preload' ||\r\n                        sn.attributes.rel === 'modulepreload') &&\r\n                    sn.attributes.as === 'script') ||\r\n                (sn.tagName === 'link' &&\r\n                    sn.attributes.rel === 'prefetch' &&\r\n                    typeof sn.attributes.href === 'string' &&\r\n                    sn.attributes.href.endsWith('.js')))) {\r\n            return true;\r\n        }\r\n        else if (slimDOMOptions.headFavicon &&\r\n            ((sn.tagName === 'link' && sn.attributes.rel === 'shortcut icon') ||\r\n                (sn.tagName === 'meta' &&\r\n                    (lowerIfExists(sn.attributes.name).match(/^msapplication-tile(image|color)$/) ||\r\n                        lowerIfExists(sn.attributes.name) === 'application-name' ||\r\n                        lowerIfExists(sn.attributes.rel) === 'icon' ||\r\n                        lowerIfExists(sn.attributes.rel) === 'apple-touch-icon' ||\r\n                        lowerIfExists(sn.attributes.rel) === 'shortcut icon')))) {\r\n            return true;\r\n        }\r\n        else if (sn.tagName === 'meta') {\r\n            if (slimDOMOptions.headMetaDescKeywords &&\r\n                lowerIfExists(sn.attributes.name).match(/^description|keywords$/)) {\r\n                return true;\r\n            }\r\n            else if (slimDOMOptions.headMetaSocial &&\r\n                (lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) ||\r\n                    lowerIfExists(sn.attributes.name).match(/^(og|twitter):/) ||\r\n                    lowerIfExists(sn.attributes.name) === 'pinterest')) {\r\n                return true;\r\n            }\r\n            else if (slimDOMOptions.headMetaRobots &&\r\n                (lowerIfExists(sn.attributes.name) === 'robots' ||\r\n                    lowerIfExists(sn.attributes.name) === 'googlebot' ||\r\n                    lowerIfExists(sn.attributes.name) === 'bingbot')) {\r\n                return true;\r\n            }\r\n            else if (slimDOMOptions.headMetaHttpEquiv &&\r\n                sn.attributes['http-equiv'] !== undefined) {\r\n                return true;\r\n            }\r\n            else if (slimDOMOptions.headMetaAuthorship &&\r\n                (lowerIfExists(sn.attributes.name) === 'author' ||\r\n                    lowerIfExists(sn.attributes.name) === 'generator' ||\r\n                    lowerIfExists(sn.attributes.name) === 'framework' ||\r\n                    lowerIfExists(sn.attributes.name) === 'publisher' ||\r\n                    lowerIfExists(sn.attributes.name) === 'progid' ||\r\n                    lowerIfExists(sn.attributes.property).match(/^article:/) ||\r\n                    lowerIfExists(sn.attributes.property).match(/^product:/))) {\r\n                return true;\r\n            }\r\n            else if (slimDOMOptions.headMetaVerification &&\r\n                (lowerIfExists(sn.attributes.name) === 'google-site-verification' ||\r\n                    lowerIfExists(sn.attributes.name) === 'yandex-verification' ||\r\n                    lowerIfExists(sn.attributes.name) === 'csrf-token' ||\r\n                    lowerIfExists(sn.attributes.name) === 'p:domain_verify' ||\r\n                    lowerIfExists(sn.attributes.name) === 'verify-v1' ||\r\n                    lowerIfExists(sn.attributes.name) === 'verification' ||\r\n                    lowerIfExists(sn.attributes.name) === 'shopify-checkout-api-token')) {\r\n                return true;\r\n            }\r\n        }\r\n    }\r\n    return false;\r\n}\r\nfunction serializeNodeWithId(n, options) {\r\n    const { doc, mirror, blockClass, blockSelector, unblockSelector, maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, skipChild = false, inlineStylesheet = true, maskInputOptions = {}, maskAttributeFn, maskTextFn, maskInputFn, slimDOMOptions, dataURLOptions = {}, inlineImages = false, recordCanvas = false, onSerialize, onIframeLoad, iframeLoadTimeout = 5000, onStylesheetLoad, stylesheetLoadTimeout = 5000, keepIframeSrcFn = () => false, newlyAddedElement = false, } = options;\r\n    let { preserveWhiteSpace = true } = options;\r\n    const _serializedNode = serializeNode(n, {\r\n        doc,\r\n        mirror,\r\n        blockClass,\r\n        blockSelector,\r\n        maskAllText,\r\n        unblockSelector,\r\n        maskTextClass,\r\n        unmaskTextClass,\r\n        maskTextSelector,\r\n        unmaskTextSelector,\r\n        inlineStylesheet,\r\n        maskInputOptions,\r\n        maskAttributeFn,\r\n        maskTextFn,\r\n        maskInputFn,\r\n        dataURLOptions,\r\n        inlineImages,\r\n        recordCanvas,\r\n        keepIframeSrcFn,\r\n        newlyAddedElement,\r\n    });\r\n    if (!_serializedNode) {\r\n        console.warn(n, 'not serialized');\r\n        return null;\r\n    }\r\n    let id;\r\n    if (mirror.hasNode(n)) {\r\n        id = mirror.getId(n);\r\n    }\r\n    else if (slimDOMExcluded(_serializedNode, slimDOMOptions) ||\r\n        (!preserveWhiteSpace &&\r\n            _serializedNode.type === NodeType.Text &&\r\n            !_serializedNode.isStyle &&\r\n            !_serializedNode.textContent.replace(/^\\s+|\\s+$/gm, '').length)) {\r\n        id = IGNORED_NODE;\r\n    }\r\n    else {\r\n        id = genId();\r\n    }\r\n    const serializedNode = Object.assign(_serializedNode, { id });\r\n    mirror.add(n, serializedNode);\r\n    if (id === IGNORED_NODE) {\r\n        return null;\r\n    }\r\n    if (onSerialize) {\r\n        onSerialize(n);\r\n    }\r\n    let recordChild = !skipChild;\r\n    if (serializedNode.type === NodeType.Element) {\r\n        recordChild = recordChild && !serializedNode.needBlock;\r\n        delete serializedNode.needBlock;\r\n        const shadowRoot = n.shadowRoot;\r\n        if (shadowRoot && isNativeShadowDom(shadowRoot))\r\n            serializedNode.isShadowHost = true;\r\n    }\r\n    if ((serializedNode.type === NodeType.Document ||\r\n        serializedNode.type === NodeType.Element) &&\r\n        recordChild) {\r\n        if (slimDOMOptions.headWhitespace &&\r\n            serializedNode.type === NodeType.Element &&\r\n            serializedNode.tagName === 'head') {\r\n            preserveWhiteSpace = false;\r\n        }\r\n        const bypassOptions = {\r\n            doc,\r\n            mirror,\r\n            blockClass,\r\n            blockSelector,\r\n            maskAllText,\r\n            unblockSelector,\r\n            maskTextClass,\r\n            unmaskTextClass,\r\n            maskTextSelector,\r\n            unmaskTextSelector,\r\n            skipChild,\r\n            inlineStylesheet,\r\n            maskInputOptions,\r\n            maskAttributeFn,\r\n            maskTextFn,\r\n            maskInputFn,\r\n            slimDOMOptions,\r\n            dataURLOptions,\r\n            inlineImages,\r\n            recordCanvas,\r\n            preserveWhiteSpace,\r\n            onSerialize,\r\n            onIframeLoad,\r\n            iframeLoadTimeout,\r\n            onStylesheetLoad,\r\n            stylesheetLoadTimeout,\r\n            keepIframeSrcFn,\r\n        };\r\n        for (const childN of Array.from(n.childNodes)) {\r\n            const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\r\n            if (serializedChildNode) {\r\n                serializedNode.childNodes.push(serializedChildNode);\r\n            }\r\n        }\r\n        if (isElement(n) && n.shadowRoot) {\r\n            for (const childN of Array.from(n.shadowRoot.childNodes)) {\r\n                const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\r\n                if (serializedChildNode) {\r\n                    isNativeShadowDom(n.shadowRoot) &&\r\n                        (serializedChildNode.isShadow = true);\r\n                    serializedNode.childNodes.push(serializedChildNode);\r\n                }\r\n            }\r\n        }\r\n    }\r\n    if (n.parentNode &&\r\n        isShadowRoot(n.parentNode) &&\r\n        isNativeShadowDom(n.parentNode)) {\r\n        serializedNode.isShadow = true;\r\n    }\r\n    if (serializedNode.type === NodeType.Element &&\r\n        serializedNode.tagName === 'iframe') {\r\n        onceIframeLoaded(n, () => {\r\n            const iframeDoc = n.contentDocument;\r\n            if (iframeDoc && onIframeLoad) {\r\n                const serializedIframeNode = serializeNodeWithId(iframeDoc, {\r\n                    doc: iframeDoc,\r\n                    mirror,\r\n                    blockClass,\r\n                    blockSelector,\r\n                    unblockSelector,\r\n                    maskAllText,\r\n                    maskTextClass,\r\n                    unmaskTextClass,\r\n                    maskTextSelector,\r\n                    unmaskTextSelector,\r\n                    skipChild: false,\r\n                    inlineStylesheet,\r\n                    maskInputOptions,\r\n                    maskAttributeFn,\r\n                    maskTextFn,\r\n                    maskInputFn,\r\n                    slimDOMOptions,\r\n                    dataURLOptions,\r\n                    inlineImages,\r\n                    recordCanvas,\r\n                    preserveWhiteSpace,\r\n                    onSerialize,\r\n                    onIframeLoad,\r\n                    iframeLoadTimeout,\r\n                    onStylesheetLoad,\r\n                    stylesheetLoadTimeout,\r\n                    keepIframeSrcFn,\r\n                });\r\n                if (serializedIframeNode) {\r\n                    onIframeLoad(n, serializedIframeNode);\r\n                }\r\n            }\r\n        }, iframeLoadTimeout);\r\n    }\r\n    if (serializedNode.type === NodeType.Element &&\r\n        serializedNode.tagName === 'link' &&\r\n        serializedNode.attributes.rel === 'stylesheet') {\r\n        onceStylesheetLoaded(n, () => {\r\n            if (onStylesheetLoad) {\r\n                const serializedLinkNode = serializeNodeWithId(n, {\r\n                    doc,\r\n                    mirror,\r\n                    blockClass,\r\n                    blockSelector,\r\n                    unblockSelector,\r\n                    maskAllText,\r\n                    maskTextClass,\r\n                    unmaskTextClass,\r\n                    maskTextSelector,\r\n                    unmaskTextSelector,\r\n                    skipChild: false,\r\n                    inlineStylesheet,\r\n                    maskInputOptions,\r\n                    maskAttributeFn,\r\n                    maskTextFn,\r\n                    maskInputFn,\r\n                    slimDOMOptions,\r\n                    dataURLOptions,\r\n                    inlineImages,\r\n                    recordCanvas,\r\n                    preserveWhiteSpace,\r\n                    onSerialize,\r\n                    onIframeLoad,\r\n                    iframeLoadTimeout,\r\n                    onStylesheetLoad,\r\n                    stylesheetLoadTimeout,\r\n                    keepIframeSrcFn,\r\n                });\r\n                if (serializedLinkNode) {\r\n                    onStylesheetLoad(n, serializedLinkNode);\r\n                }\r\n            }\r\n        }, stylesheetLoadTimeout);\r\n    }\r\n    return serializedNode;\r\n}\r\nfunction snapshot(n, options) {\r\n    const { mirror = new Mirror(), blockClass = 'rr-block', blockSelector = null, unblockSelector = null, maskAllText = false, maskTextClass = 'rr-mask', unmaskTextClass = null, maskTextSelector = null, unmaskTextSelector = null, inlineStylesheet = true, inlineImages = false, recordCanvas = false, maskAllInputs = false, maskAttributeFn, maskTextFn, maskInputFn, slimDOM = false, dataURLOptions, preserveWhiteSpace, onSerialize, onIframeLoad, iframeLoadTimeout, onStylesheetLoad, stylesheetLoadTimeout, keepIframeSrcFn = () => false, } = options || {};\r\n    const maskInputOptions = maskAllInputs === true\r\n        ? {\r\n            color: true,\r\n            date: true,\r\n            'datetime-local': true,\r\n            email: true,\r\n            month: true,\r\n            number: true,\r\n            range: true,\r\n            search: true,\r\n            tel: true,\r\n            text: true,\r\n            time: true,\r\n            url: true,\r\n            week: true,\r\n            textarea: true,\r\n            select: true,\r\n        }\r\n        : maskAllInputs === false\r\n            ? {}\r\n            : maskAllInputs;\r\n    const slimDOMOptions = slimDOM === true || slimDOM === 'all'\r\n        ?\r\n            {\r\n                script: true,\r\n                comment: true,\r\n                headFavicon: true,\r\n                headWhitespace: true,\r\n                headMetaDescKeywords: slimDOM === 'all',\r\n                headMetaSocial: true,\r\n                headMetaRobots: true,\r\n                headMetaHttpEquiv: true,\r\n                headMetaAuthorship: true,\r\n                headMetaVerification: true,\r\n            }\r\n        : slimDOM === false\r\n            ? {}\r\n            : slimDOM;\r\n    return serializeNodeWithId(n, {\r\n        doc: n,\r\n        mirror,\r\n        blockClass,\r\n        blockSelector,\r\n        unblockSelector,\r\n        maskAllText,\r\n        maskTextClass,\r\n        unmaskTextClass,\r\n        maskTextSelector,\r\n        unmaskTextSelector,\r\n        skipChild: false,\r\n        inlineStylesheet,\r\n        maskInputOptions,\r\n        maskAttributeFn,\r\n        maskTextFn,\r\n        maskInputFn,\r\n        slimDOMOptions,\r\n        dataURLOptions,\r\n        inlineImages,\r\n        recordCanvas,\r\n        preserveWhiteSpace,\r\n        onSerialize,\r\n        onIframeLoad,\r\n        iframeLoadTimeout,\r\n        onStylesheetLoad,\r\n        stylesheetLoadTimeout,\r\n        keepIframeSrcFn,\r\n        newlyAddedElement: false,\r\n    });\r\n}\r\n\nconst commentre = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\r\nfunction parse(css, options = {}) {\r\n    let lineno = 1;\r\n    let column = 1;\r\n    function updatePosition(str) {\r\n        const lines = str.match(/\\n/g);\r\n        if (lines) {\r\n            lineno += lines.length;\r\n        }\r\n        const i = str.lastIndexOf('\\n');\r\n        column = i === -1 ? column + str.length : str.length - i;\r\n    }\r\n    function position() {\r\n        const start = { line: lineno, column };\r\n        return (node) => {\r\n            node.position = new Position(start);\r\n            whitespace();\r\n            return node;\r\n        };\r\n    }\r\n    class Position {\r\n        constructor(start) {\r\n            this.start = start;\r\n            this.end = { line: lineno, column };\r\n            this.source = options.source;\r\n        }\r\n    }\r\n    Position.prototype.content = css;\r\n    const errorsList = [];\r\n    function error(msg) {\r\n        const err = new Error(`${options.source || ''}:${lineno}:${column}: ${msg}`);\r\n        err.reason = msg;\r\n        err.filename = options.source;\r\n        err.line = lineno;\r\n        err.column = column;\r\n        err.source = css;\r\n        if (options.silent) {\r\n            errorsList.push(err);\r\n        }\r\n        else {\r\n            throw err;\r\n        }\r\n    }\r\n    function stylesheet() {\r\n        const rulesList = rules();\r\n        return {\r\n            type: 'stylesheet',\r\n            stylesheet: {\r\n                source: options.source,\r\n                rules: rulesList,\r\n                parsingErrors: errorsList,\r\n            },\r\n        };\r\n    }\r\n    function open() {\r\n        return match(/^{\\s*/);\r\n    }\r\n    function close() {\r\n        return match(/^}/);\r\n    }\r\n    function rules() {\r\n        let node;\r\n        const rules = [];\r\n        whitespace();\r\n        comments(rules);\r\n        while (css.length && css.charAt(0) !== '}' && (node = atrule() || rule())) {\r\n            if (node) {\r\n                rules.push(node);\r\n                comments(rules);\r\n            }\r\n        }\r\n        return rules;\r\n    }\r\n    function match(re) {\r\n        const m = re.exec(css);\r\n        if (!m) {\r\n            return;\r\n        }\r\n        const str = m[0];\r\n        updatePosition(str);\r\n        css = css.slice(str.length);\r\n        return m;\r\n    }\r\n    function whitespace() {\r\n        match(/^\\s*/);\r\n    }\r\n    function comments(rules = []) {\r\n        let c;\r\n        while ((c = comment())) {\r\n            if (c) {\r\n                rules.push(c);\r\n            }\r\n            c = comment();\r\n        }\r\n        return rules;\r\n    }\r\n    function comment() {\r\n        const pos = position();\r\n        if ('/' !== css.charAt(0) || '*' !== css.charAt(1)) {\r\n            return;\r\n        }\r\n        let i = 2;\r\n        while ('' !== css.charAt(i) &&\r\n            ('*' !== css.charAt(i) || '/' !== css.charAt(i + 1))) {\r\n            ++i;\r\n        }\r\n        i += 2;\r\n        if ('' === css.charAt(i - 1)) {\r\n            return error('End of comment missing');\r\n        }\r\n        const str = css.slice(2, i - 2);\r\n        column += 2;\r\n        updatePosition(str);\r\n        css = css.slice(i);\r\n        column += 2;\r\n        return pos({\r\n            type: 'comment',\r\n            comment: str,\r\n        });\r\n    }\r\n    function selector() {\r\n        const m = match(/^([^{]+)/);\r\n        if (!m) {\r\n            return;\r\n        }\r\n        return trim(m[0])\r\n            .replace(/\\/\\*([^*]|[\\r\\n]|(\\*+([^*/]|[\\r\\n])))*\\*\\/+/g, '')\r\n            .replace(/\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'/g, (m) => {\r\n            return m.replace(/,/g, '\\u200C');\r\n        })\r\n            .split(/\\s*(?![^(]*\\)),\\s*/)\r\n            .map((s) => {\r\n            return s.replace(/\\u200C/g, ',');\r\n        });\r\n    }\r\n    function declaration() {\r\n        const pos = position();\r\n        const propMatch = match(/^(\\*?[-#\\/\\*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/);\r\n        if (!propMatch) {\r\n            return;\r\n        }\r\n        const prop = trim(propMatch[0]);\r\n        if (!match(/^:\\s*/)) {\r\n            return error(`property missing ':'`);\r\n        }\r\n        const val = match(/^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^\\)]*?\\)|[^};])+)/);\r\n        const ret = pos({\r\n            type: 'declaration',\r\n            property: prop.replace(commentre, ''),\r\n            value: val ? trim(val[0]).replace(commentre, '') : '',\r\n        });\r\n        match(/^[;\\s]*/);\r\n        return ret;\r\n    }\r\n    function declarations() {\r\n        const decls = [];\r\n        if (!open()) {\r\n            return error(`missing '{'`);\r\n        }\r\n        comments(decls);\r\n        let decl;\r\n        while ((decl = declaration())) {\r\n            if (decl !== false) {\r\n                decls.push(decl);\r\n                comments(decls);\r\n            }\r\n            decl = declaration();\r\n        }\r\n        if (!close()) {\r\n            return error(`missing '}'`);\r\n        }\r\n        return decls;\r\n    }\r\n    function keyframe() {\r\n        let m;\r\n        const vals = [];\r\n        const pos = position();\r\n        while ((m = match(/^((\\d+\\.\\d+|\\.\\d+|\\d+)%?|[a-z]+)\\s*/))) {\r\n            vals.push(m[1]);\r\n            match(/^,\\s*/);\r\n        }\r\n        if (!vals.length) {\r\n            return;\r\n        }\r\n        return pos({\r\n            type: 'keyframe',\r\n            values: vals,\r\n            declarations: declarations(),\r\n        });\r\n    }\r\n    function atkeyframes() {\r\n        const pos = position();\r\n        let m = match(/^@([-\\w]+)?keyframes\\s*/);\r\n        if (!m) {\r\n            return;\r\n        }\r\n        const vendor = m[1];\r\n        m = match(/^([-\\w]+)\\s*/);\r\n        if (!m) {\r\n            return error('@keyframes missing name');\r\n        }\r\n        const name = m[1];\r\n        if (!open()) {\r\n            return error(`@keyframes missing '{'`);\r\n        }\r\n        let frame;\r\n        let frames = comments();\r\n        while ((frame = keyframe())) {\r\n            frames.push(frame);\r\n            frames = frames.concat(comments());\r\n        }\r\n        if (!close()) {\r\n            return error(`@keyframes missing '}'`);\r\n        }\r\n        return pos({\r\n            type: 'keyframes',\r\n            name,\r\n            vendor,\r\n            keyframes: frames,\r\n        });\r\n    }\r\n    function atsupports() {\r\n        const pos = position();\r\n        const m = match(/^@supports *([^{]+)/);\r\n        if (!m) {\r\n            return;\r\n        }\r\n        const supports = trim(m[1]);\r\n        if (!open()) {\r\n            return error(`@supports missing '{'`);\r\n        }\r\n        const style = comments().concat(rules());\r\n        if (!close()) {\r\n            return error(`@supports missing '}'`);\r\n        }\r\n        return pos({\r\n            type: 'supports',\r\n            supports,\r\n            rules: style,\r\n        });\r\n    }\r\n    function athost() {\r\n        const pos = position();\r\n        const m = match(/^@host\\s*/);\r\n        if (!m) {\r\n            return;\r\n        }\r\n        if (!open()) {\r\n            return error(`@host missing '{'`);\r\n        }\r\n        const style = comments().concat(rules());\r\n        if (!close()) {\r\n            return error(`@host missing '}'`);\r\n        }\r\n        return pos({\r\n            type: 'host',\r\n            rules: style,\r\n        });\r\n    }\r\n    function atmedia() {\r\n        const pos = position();\r\n        const m = match(/^@media *([^{]+)/);\r\n        if (!m) {\r\n            return;\r\n        }\r\n        const media = trim(m[1]);\r\n        if (!open()) {\r\n            return error(`@media missing '{'`);\r\n        }\r\n        const style = comments().concat(rules());\r\n        if (!close()) {\r\n            return error(`@media missing '}'`);\r\n        }\r\n        return pos({\r\n            type: 'media',\r\n            media,\r\n            rules: style,\r\n        });\r\n    }\r\n    function atcustommedia() {\r\n        const pos = position();\r\n        const m = match(/^@custom-media\\s+(--[^\\s]+)\\s*([^{;]+);/);\r\n        if (!m) {\r\n            return;\r\n        }\r\n        return pos({\r\n            type: 'custom-media',\r\n            name: trim(m[1]),\r\n            media: trim(m[2]),\r\n        });\r\n    }\r\n    function atpage() {\r\n        const pos = position();\r\n        const m = match(/^@page */);\r\n        if (!m) {\r\n            return;\r\n        }\r\n        const sel = selector() || [];\r\n        if (!open()) {\r\n            return error(`@page missing '{'`);\r\n        }\r\n        let decls = comments();\r\n        let decl;\r\n        while ((decl = declaration())) {\r\n            decls.push(decl);\r\n            decls = decls.concat(comments());\r\n        }\r\n        if (!close()) {\r\n            return error(`@page missing '}'`);\r\n        }\r\n        return pos({\r\n            type: 'page',\r\n            selectors: sel,\r\n            declarations: decls,\r\n        });\r\n    }\r\n    function atdocument() {\r\n        const pos = position();\r\n        const m = match(/^@([-\\w]+)?document *([^{]+)/);\r\n        if (!m) {\r\n            return;\r\n        }\r\n        const vendor = trim(m[1]);\r\n        const doc = trim(m[2]);\r\n        if (!open()) {\r\n            return error(`@document missing '{'`);\r\n        }\r\n        const style = comments().concat(rules());\r\n        if (!close()) {\r\n            return error(`@document missing '}'`);\r\n        }\r\n        return pos({\r\n            type: 'document',\r\n            document: doc,\r\n            vendor,\r\n            rules: style,\r\n        });\r\n    }\r\n    function atfontface() {\r\n        const pos = position();\r\n        const m = match(/^@font-face\\s*/);\r\n        if (!m) {\r\n            return;\r\n        }\r\n        if (!open()) {\r\n            return error(`@font-face missing '{'`);\r\n        }\r\n        let decls = comments();\r\n        let decl;\r\n        while ((decl = declaration())) {\r\n            decls.push(decl);\r\n            decls = decls.concat(comments());\r\n        }\r\n        if (!close()) {\r\n            return error(`@font-face missing '}'`);\r\n        }\r\n        return pos({\r\n            type: 'font-face',\r\n            declarations: decls,\r\n        });\r\n    }\r\n    const atimport = _compileAtrule('import');\r\n    const atcharset = _compileAtrule('charset');\r\n    const atnamespace = _compileAtrule('namespace');\r\n    function _compileAtrule(name) {\r\n        const re = new RegExp('^@' + name + '\\\\s*([^;]+);');\r\n        return () => {\r\n            const pos = position();\r\n            const m = match(re);\r\n            if (!m) {\r\n                return;\r\n            }\r\n            const ret = { type: name };\r\n            ret[name] = m[1].trim();\r\n            return pos(ret);\r\n        };\r\n    }\r\n    function atrule() {\r\n        if (css[0] !== '@') {\r\n            return;\r\n        }\r\n        return (atkeyframes() ||\r\n            atmedia() ||\r\n            atcustommedia() ||\r\n            atsupports() ||\r\n            atimport() ||\r\n            atcharset() ||\r\n            atnamespace() ||\r\n            atdocument() ||\r\n            atpage() ||\r\n            athost() ||\r\n            atfontface());\r\n    }\r\n    function rule() {\r\n        const pos = position();\r\n        const sel = selector();\r\n        if (!sel) {\r\n            return error('selector missing');\r\n        }\r\n        comments();\r\n        return pos({\r\n            type: 'rule',\r\n            selectors: sel,\r\n            declarations: declarations(),\r\n        });\r\n    }\r\n    return addParent(stylesheet());\r\n}\r\nfunction trim(str) {\r\n    return str ? str.replace(/^\\s+|\\s+$/g, '') : '';\r\n}\r\nfunction addParent(obj, parent) {\r\n    const isNode = obj && typeof obj.type === 'string';\r\n    const childParent = isNode ? obj : parent;\r\n    for (const k of Object.keys(obj)) {\r\n        const value = obj[k];\r\n        if (Array.isArray(value)) {\r\n            value.forEach((v) => {\r\n                addParent(v, childParent);\r\n            });\r\n        }\r\n        else if (value && typeof value === 'object') {\r\n            addParent(value, childParent);\r\n        }\r\n    }\r\n    if (isNode) {\r\n        Object.defineProperty(obj, 'parent', {\r\n            configurable: true,\r\n            writable: true,\r\n            enumerable: false,\r\n            value: parent || null,\r\n        });\r\n    }\r\n    return obj;\r\n}\n\nconst tagMap = {\r\n    script: 'noscript',\r\n    altglyph: 'altGlyph',\r\n    altglyphdef: 'altGlyphDef',\r\n    altglyphitem: 'altGlyphItem',\r\n    animatecolor: 'animateColor',\r\n    animatemotion: 'animateMotion',\r\n    animatetransform: 'animateTransform',\r\n    clippath: 'clipPath',\r\n    feblend: 'feBlend',\r\n    fecolormatrix: 'feColorMatrix',\r\n    fecomponenttransfer: 'feComponentTransfer',\r\n    fecomposite: 'feComposite',\r\n    feconvolvematrix: 'feConvolveMatrix',\r\n    fediffuselighting: 'feDiffuseLighting',\r\n    fedisplacementmap: 'feDisplacementMap',\r\n    fedistantlight: 'feDistantLight',\r\n    fedropshadow: 'feDropShadow',\r\n    feflood: 'feFlood',\r\n    fefunca: 'feFuncA',\r\n    fefuncb: 'feFuncB',\r\n    fefuncg: 'feFuncG',\r\n    fefuncr: 'feFuncR',\r\n    fegaussianblur: 'feGaussianBlur',\r\n    feimage: 'feImage',\r\n    femerge: 'feMerge',\r\n    femergenode: 'feMergeNode',\r\n    femorphology: 'feMorphology',\r\n    feoffset: 'feOffset',\r\n    fepointlight: 'fePointLight',\r\n    fespecularlighting: 'feSpecularLighting',\r\n    fespotlight: 'feSpotLight',\r\n    fetile: 'feTile',\r\n    feturbulence: 'feTurbulence',\r\n    foreignobject: 'foreignObject',\r\n    glyphref: 'glyphRef',\r\n    lineargradient: 'linearGradient',\r\n    radialgradient: 'radialGradient',\r\n};\r\nfunction getTagName(n) {\r\n    let tagName = tagMap[n.tagName] ? tagMap[n.tagName] : n.tagName;\r\n    if (tagName === 'link' && n.attributes._cssText) {\r\n        tagName = 'style';\r\n    }\r\n    return tagName;\r\n}\r\nfunction escapeRegExp(str) {\r\n    return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\r\n}\r\nconst HOVER_SELECTOR = /([^\\\\]):hover/;\r\nconst HOVER_SELECTOR_GLOBAL = new RegExp(HOVER_SELECTOR.source, 'g');\r\nfunction addHoverClass(cssText, cache) {\r\n    const cachedStyle = cache === null || cache === void 0 ? void 0 : cache.stylesWithHoverClass.get(cssText);\r\n    if (cachedStyle)\r\n        return cachedStyle;\r\n    const ast = parse(cssText, {\r\n        silent: true,\r\n    });\r\n    if (!ast.stylesheet) {\r\n        return cssText;\r\n    }\r\n    const selectors = [];\r\n    ast.stylesheet.rules.forEach((rule) => {\r\n        if ('selectors' in rule) {\r\n            (rule.selectors || []).forEach((selector) => {\r\n                if (HOVER_SELECTOR.test(selector)) {\r\n                    selectors.push(selector);\r\n                }\r\n            });\r\n        }\r\n    });\r\n    if (selectors.length === 0) {\r\n        return cssText;\r\n    }\r\n    const selectorMatcher = new RegExp(selectors\r\n        .filter((selector, index) => selectors.indexOf(selector) === index)\r\n        .sort((a, b) => b.length - a.length)\r\n        .map((selector) => {\r\n        return escapeRegExp(selector);\r\n    })\r\n        .join('|'), 'g');\r\n    const result = cssText.replace(selectorMatcher, (selector) => {\r\n        const newSelector = selector.replace(HOVER_SELECTOR_GLOBAL, '$1.\\\\:hover');\r\n        return `${selector}, ${newSelector}`;\r\n    });\r\n    cache === null || cache === void 0 ? void 0 : cache.stylesWithHoverClass.set(cssText, result);\r\n    return result;\r\n}\r\nfunction createCache() {\r\n    const stylesWithHoverClass = new Map();\r\n    return {\r\n        stylesWithHoverClass,\r\n    };\r\n}\r\nfunction buildNode(n, options) {\r\n    var _a;\r\n    const { doc, hackCss, cache } = options;\r\n    switch (n.type) {\r\n        case NodeType.Document:\r\n            return doc.implementation.createDocument(null, '', null);\r\n        case NodeType.DocumentType:\r\n            return doc.implementation.createDocumentType(n.name || 'html', n.publicId, n.systemId);\r\n        case NodeType.Element: {\r\n            const tagName = getTagName(n);\r\n            let node;\r\n            if (n.isSVG) {\r\n                node = doc.createElementNS('http://www.w3.org/2000/svg', tagName);\r\n            }\r\n            else {\r\n                if (n.isCustom &&\r\n                    ((_a = doc.defaultView) === null || _a === void 0 ? void 0 : _a.customElements) &&\r\n                    !doc.defaultView.customElements.get(n.tagName))\r\n                    doc.defaultView.customElements.define(n.tagName, class extends doc.defaultView.HTMLElement {\r\n                    });\r\n                node = doc.createElement(tagName);\r\n            }\r\n            const specialAttributes = {};\r\n            for (const name in n.attributes) {\r\n                if (!Object.prototype.hasOwnProperty.call(n.attributes, name)) {\r\n                    continue;\r\n                }\r\n                let value = n.attributes[name];\r\n                if (tagName === 'option' &&\r\n                    name === 'selected' &&\r\n                    value === false) {\r\n                    continue;\r\n                }\r\n                if (value === null) {\r\n                    continue;\r\n                }\r\n                if (value === true)\r\n                    value = '';\r\n                if (name.startsWith('rr_')) {\r\n                    specialAttributes[name] = value;\r\n                    continue;\r\n                }\r\n                const isTextarea = tagName === 'textarea' && name === 'value';\r\n                const isRemoteOrDynamicCss = tagName === 'style' && name === '_cssText';\r\n                if (isRemoteOrDynamicCss && hackCss && typeof value === 'string') {\r\n                    value = addHoverClass(value, cache);\r\n                }\r\n                if ((isTextarea || isRemoteOrDynamicCss) && typeof value === 'string') {\r\n                    const child = doc.createTextNode(value);\r\n                    for (const c of Array.from(node.childNodes)) {\r\n                        if (c.nodeType === node.TEXT_NODE) {\r\n                            node.removeChild(c);\r\n                        }\r\n                    }\r\n                    node.appendChild(child);\r\n                    continue;\r\n                }\r\n                try {\r\n                    if (n.isSVG && name === 'xlink:href') {\r\n                        node.setAttributeNS('http://www.w3.org/1999/xlink', name, value.toString());\r\n                    }\r\n                    else if (name === 'onload' ||\r\n                        name === 'onclick' ||\r\n                        name.substring(0, 7) === 'onmouse') {\r\n                        node.setAttribute('_' + name, value.toString());\r\n                    }\r\n                    else if (tagName === 'meta' &&\r\n                        n.attributes['http-equiv'] === 'Content-Security-Policy' &&\r\n                        name === 'content') {\r\n                        node.setAttribute('csp-content', value.toString());\r\n                        continue;\r\n                    }\r\n                    else if (tagName === 'link' &&\r\n                        (n.attributes.rel === 'preload' ||\r\n                            n.attributes.rel === 'modulepreload') &&\r\n                        n.attributes.as === 'script') {\r\n                    }\r\n                    else if (tagName === 'link' &&\r\n                        n.attributes.rel === 'prefetch' &&\r\n                        typeof n.attributes.href === 'string' &&\r\n                        n.attributes.href.endsWith('.js')) {\r\n                    }\r\n                    else if (tagName === 'img' &&\r\n                        n.attributes.srcset &&\r\n                        n.attributes.rr_dataURL) {\r\n                        node.setAttribute('rrweb-original-srcset', n.attributes.srcset);\r\n                    }\r\n                    else {\r\n                        node.setAttribute(name, value.toString());\r\n                    }\r\n                }\r\n                catch (error) {\r\n                }\r\n            }\r\n            for (const name in specialAttributes) {\r\n                const value = specialAttributes[name];\r\n                if (tagName === 'canvas' && name === 'rr_dataURL') {\r\n                    const image = document.createElement('img');\r\n                    image.onload = () => {\r\n                        const ctx = node.getContext('2d');\r\n                        if (ctx) {\r\n                            ctx.drawImage(image, 0, 0, image.width, image.height);\r\n                        }\r\n                    };\r\n                    image.src = value.toString();\r\n                    if (node.RRNodeType)\r\n                        node.rr_dataURL = value.toString();\r\n                }\r\n                else if (tagName === 'img' && name === 'rr_dataURL') {\r\n                    const image = node;\r\n                    if (!image.currentSrc.startsWith('data:')) {\r\n                        image.setAttribute('rrweb-original-src', n.attributes.src);\r\n                        image.src = value.toString();\r\n                    }\r\n                }\r\n                if (name === 'rr_width') {\r\n                    node.style.width = value.toString();\r\n                }\r\n                else if (name === 'rr_height') {\r\n                    node.style.height = value.toString();\r\n                }\r\n                else if (name === 'rr_mediaCurrentTime' &&\r\n                    typeof value === 'number') {\r\n                    node.currentTime = value;\r\n                }\r\n                else if (name === 'rr_mediaState') {\r\n                    switch (value) {\r\n                        case 'played':\r\n                            node\r\n                                .play()\r\n                                .catch((e) => console.warn('media playback error', e));\r\n                            break;\r\n                        case 'paused':\r\n                            node.pause();\r\n                            break;\r\n                    }\r\n                }\r\n            }\r\n            if (n.isShadowHost) {\r\n                if (!node.shadowRoot) {\r\n                    node.attachShadow({ mode: 'open' });\r\n                }\r\n                else {\r\n                    while (node.shadowRoot.firstChild) {\r\n                        node.shadowRoot.removeChild(node.shadowRoot.firstChild);\r\n                    }\r\n                }\r\n            }\r\n            return node;\r\n        }\r\n        case NodeType.Text:\r\n            return doc.createTextNode(n.isStyle && hackCss\r\n                ? addHoverClass(n.textContent, cache)\r\n                : n.textContent);\r\n        case NodeType.CDATA:\r\n            return doc.createCDATASection(n.textContent);\r\n        case NodeType.Comment:\r\n            return doc.createComment(n.textContent);\r\n        default:\r\n            return null;\r\n    }\r\n}\r\nfunction buildNodeWithSN(n, options) {\r\n    const { doc, mirror, skipChild = false, hackCss = true, afterAppend, cache, } = options;\r\n    if (mirror.has(n.id)) {\r\n        const nodeInMirror = mirror.getNode(n.id);\r\n        const meta = mirror.getMeta(nodeInMirror);\r\n        if (isNodeMetaEqual(meta, n))\r\n            return mirror.getNode(n.id);\r\n    }\r\n    let node = buildNode(n, { doc, hackCss, cache });\r\n    if (!node) {\r\n        return null;\r\n    }\r\n    if (n.rootId && mirror.getNode(n.rootId) !== doc) {\r\n        mirror.replace(n.rootId, doc);\r\n    }\r\n    if (n.type === NodeType.Document) {\r\n        doc.close();\r\n        doc.open();\r\n        if (n.compatMode === 'BackCompat' &&\r\n            n.childNodes &&\r\n            n.childNodes[0].type !== NodeType.DocumentType) {\r\n            if (n.childNodes[0].type === NodeType.Element &&\r\n                'xmlns' in n.childNodes[0].attributes &&\r\n                n.childNodes[0].attributes.xmlns === 'http://www.w3.org/1999/xhtml') {\r\n                doc.write('<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"\">');\r\n            }\r\n            else {\r\n                doc.write('<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"\">');\r\n            }\r\n        }\r\n        node = doc;\r\n    }\r\n    mirror.add(node, n);\r\n    if ((n.type === NodeType.Document || n.type === NodeType.Element) &&\r\n        !skipChild) {\r\n        for (const childN of n.childNodes) {\r\n            const childNode = buildNodeWithSN(childN, {\r\n                doc,\r\n                mirror,\r\n                skipChild: false,\r\n                hackCss,\r\n                afterAppend,\r\n                cache,\r\n            });\r\n            if (!childNode) {\r\n                console.warn('Failed to rebuild', childN);\r\n                continue;\r\n            }\r\n            if (childN.isShadow && isElement(node) && node.shadowRoot) {\r\n                node.shadowRoot.appendChild(childNode);\r\n            }\r\n            else if (n.type === NodeType.Document &&\r\n                childN.type == NodeType.Element) {\r\n                const htmlElement = childNode;\r\n                let body = null;\r\n                htmlElement.childNodes.forEach((child) => {\r\n                    if (child.nodeName === 'BODY')\r\n                        body = child;\r\n                });\r\n                if (body) {\r\n                    htmlElement.removeChild(body);\r\n                    node.appendChild(childNode);\r\n                    htmlElement.appendChild(body);\r\n                }\r\n                else {\r\n                    node.appendChild(childNode);\r\n                }\r\n            }\r\n            else {\r\n                node.appendChild(childNode);\r\n            }\r\n            if (afterAppend) {\r\n                afterAppend(childNode, childN.id);\r\n            }\r\n        }\r\n    }\r\n    return node;\r\n}\r\nfunction visit(mirror, onVisit) {\r\n    function walk(node) {\r\n        onVisit(node);\r\n    }\r\n    for (const id of mirror.getIds()) {\r\n        if (mirror.has(id)) {\r\n            walk(mirror.getNode(id));\r\n        }\r\n    }\r\n}\r\nfunction handleScroll(node, mirror) {\r\n    const n = mirror.getMeta(node);\r\n    if ((n === null || n === void 0 ? void 0 : n.type) !== NodeType.Element) {\r\n        return;\r\n    }\r\n    const el = node;\r\n    for (const name in n.attributes) {\r\n        if (!(Object.prototype.hasOwnProperty.call(n.attributes, name) &&\r\n            name.startsWith('rr_'))) {\r\n            continue;\r\n        }\r\n        const value = n.attributes[name];\r\n        if (name === 'rr_scrollLeft') {\r\n            el.scrollLeft = value;\r\n        }\r\n        if (name === 'rr_scrollTop') {\r\n            el.scrollTop = value;\r\n        }\r\n    }\r\n}\r\nfunction rebuild(n, options) {\r\n    const { doc, onVisit, hackCss = true, afterAppend, cache, mirror = new Mirror(), } = options;\r\n    const node = buildNodeWithSN(n, {\r\n        doc,\r\n        mirror,\r\n        skipChild: false,\r\n        hackCss,\r\n        afterAppend,\r\n        cache,\r\n    });\r\n    visit(mirror, (visitedNode) => {\r\n        if (onVisit) {\r\n            onVisit(visitedNode);\r\n        }\r\n        handleScroll(visitedNode, mirror);\r\n    });\r\n    return node;\r\n}\n\nexport { IGNORED_NODE, Mirror, NodeType, addHoverClass, buildNodeWithSN, createCache, createMatchPredicate, createMirror, distanceToMatch, escapeImportStatement, fixSafariColons, genId, getInputType, getInputValue, ignoreAttribute, is2DCanvasBlank, isCSSImportRule, isCSSStyleRule, isElement, isNativeShadowDom, isNodeMetaEqual, isShadowRoot, maskInputValue, needMaskingText, rebuild, serializeNodeWithId, shouldMaskInput, snapshot, stringifyRule, stringifyStylesheet, toLowerCase, toUpperCase, transformAttribute };\n","import { distanceToMatch, IGNORED_NODE, isShadowRoot, createMatchPredicate } from '../../rrweb-snapshot/es/rrweb-snapshot.js';\n\nfunction on(type, fn, target = document) {\r\n    const options = { capture: true, passive: true };\r\n    target.addEventListener(type, fn, options);\r\n    return () => target.removeEventListener(type, fn, options);\r\n}\r\nconst DEPARTED_MIRROR_ACCESS_WARNING = 'Please stop import mirror directly. Instead of that,' +\r\n    '\\r\\n' +\r\n    'now you can use replayer.getMirror() to access the mirror instance of a replayer,' +\r\n    '\\r\\n' +\r\n    'or you can use record.mirror to access the mirror instance during recording.';\r\nlet _mirror = {\r\n    map: {},\r\n    getId() {\r\n        console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n        return -1;\r\n    },\r\n    getNode() {\r\n        console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n        return null;\r\n    },\r\n    removeNodeFromMap() {\r\n        console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n    },\r\n    has() {\r\n        console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n        return false;\r\n    },\r\n    reset() {\r\n        console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n    },\r\n};\r\nif (typeof window !== 'undefined' && window.Proxy && window.Reflect) {\r\n    _mirror = new Proxy(_mirror, {\r\n        get(target, prop, receiver) {\r\n            if (prop === 'map') {\r\n                console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n            }\r\n            return Reflect.get(target, prop, receiver);\r\n        },\r\n    });\r\n}\r\nfunction throttle(func, wait, options = {}) {\r\n    let timeout = null;\r\n    let previous = 0;\r\n    return function (...args) {\r\n        const now = Date.now();\r\n        if (!previous && options.leading === false) {\r\n            previous = now;\r\n        }\r\n        const remaining = wait - (now - previous);\r\n        const context = this;\r\n        if (remaining <= 0 || remaining > wait) {\r\n            if (timeout) {\r\n                clearTimeout(timeout);\r\n                timeout = null;\r\n            }\r\n            previous = now;\r\n            func.apply(context, args);\r\n        }\r\n        else if (!timeout && options.trailing !== false) {\r\n            timeout = setTimeout(() => {\r\n                previous = options.leading === false ? 0 : Date.now();\r\n                timeout = null;\r\n                func.apply(context, args);\r\n            }, remaining);\r\n        }\r\n    };\r\n}\r\nfunction hookSetter(target, key, d, isRevoked, win = window) {\r\n    const original = win.Object.getOwnPropertyDescriptor(target, key);\r\n    win.Object.defineProperty(target, key, isRevoked\r\n        ? d\r\n        : {\r\n            set(value) {\r\n                setTimeout(() => {\r\n                    d.set.call(this, value);\r\n                }, 0);\r\n                if (original && original.set) {\r\n                    original.set.call(this, value);\r\n                }\r\n            },\r\n        });\r\n    return () => hookSetter(target, key, original || {}, true);\r\n}\r\nfunction patch(source, name, replacement) {\r\n    try {\r\n        if (!(name in source)) {\r\n            return () => {\r\n            };\r\n        }\r\n        const original = source[name];\r\n        const wrapped = replacement(original);\r\n        if (typeof wrapped === 'function') {\r\n            wrapped.prototype = wrapped.prototype || {};\r\n            Object.defineProperties(wrapped, {\r\n                __rrweb_original__: {\r\n                    enumerable: false,\r\n                    value: original,\r\n                },\r\n            });\r\n        }\r\n        source[name] = wrapped;\r\n        return () => {\r\n            source[name] = original;\r\n        };\r\n    }\r\n    catch (_a) {\r\n        return () => {\r\n        };\r\n    }\r\n}\r\nlet nowTimestamp = Date.now;\r\nif (!(/[1-9][0-9]{12}/.test(Date.now().toString()))) {\r\n    nowTimestamp = () => new Date().getTime();\r\n}\r\nfunction getWindowScroll(win) {\r\n    var _a, _b, _c, _d, _e, _f;\r\n    const doc = win.document;\r\n    return {\r\n        left: doc.scrollingElement\r\n            ? doc.scrollingElement.scrollLeft\r\n            : win.pageXOffset !== undefined\r\n                ? win.pageXOffset\r\n                : (doc === null || doc === void 0 ? void 0 : doc.documentElement.scrollLeft) ||\r\n                    ((_b = (_a = doc === null || doc === void 0 ? void 0 : doc.body) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.scrollLeft) ||\r\n                    ((_c = doc === null || doc === void 0 ? void 0 : doc.body) === null || _c === void 0 ? void 0 : _c.scrollLeft) ||\r\n                    0,\r\n        top: doc.scrollingElement\r\n            ? doc.scrollingElement.scrollTop\r\n            : win.pageYOffset !== undefined\r\n                ? win.pageYOffset\r\n                : (doc === null || doc === void 0 ? void 0 : doc.documentElement.scrollTop) ||\r\n                    ((_e = (_d = doc === null || doc === void 0 ? void 0 : doc.body) === null || _d === void 0 ? void 0 : _d.parentElement) === null || _e === void 0 ? void 0 : _e.scrollTop) ||\r\n                    ((_f = doc === null || doc === void 0 ? void 0 : doc.body) === null || _f === void 0 ? void 0 : _f.scrollTop) ||\r\n                    0,\r\n    };\r\n}\r\nfunction getWindowHeight() {\r\n    return (window.innerHeight ||\r\n        (document.documentElement && document.documentElement.clientHeight) ||\r\n        (document.body && document.body.clientHeight));\r\n}\r\nfunction getWindowWidth() {\r\n    return (window.innerWidth ||\r\n        (document.documentElement && document.documentElement.clientWidth) ||\r\n        (document.body && document.body.clientWidth));\r\n}\r\nfunction isBlocked(node, blockClass, blockSelector, unblockSelector, checkAncestors) {\r\n    if (!node) {\r\n        return false;\r\n    }\r\n    const el = node.nodeType === node.ELEMENT_NODE\r\n        ? node\r\n        : node.parentElement;\r\n    if (!el)\r\n        return false;\r\n    const blockedPredicate = createMatchPredicate(blockClass, blockSelector);\r\n    if (!checkAncestors) {\r\n        const isUnblocked = unblockSelector && el.matches(unblockSelector);\r\n        return blockedPredicate(el) && !isUnblocked;\r\n    }\r\n    const blockDistance = distanceToMatch(el, blockedPredicate);\r\n    let unblockDistance = -1;\r\n    if (blockDistance < 0) {\r\n        return false;\r\n    }\r\n    if (unblockSelector) {\r\n        unblockDistance = distanceToMatch(el, createMatchPredicate(null, unblockSelector));\r\n    }\r\n    if (blockDistance > -1 && unblockDistance < 0) {\r\n        return true;\r\n    }\r\n    return blockDistance < unblockDistance;\r\n}\r\nfunction isSerialized(n, mirror) {\r\n    return mirror.getId(n) !== -1;\r\n}\r\nfunction isIgnored(n, mirror) {\r\n    return mirror.getId(n) === IGNORED_NODE;\r\n}\r\nfunction isAncestorRemoved(target, mirror) {\r\n    if (isShadowRoot(target)) {\r\n        return false;\r\n    }\r\n    const id = mirror.getId(target);\r\n    if (!mirror.has(id)) {\r\n        return true;\r\n    }\r\n    if (target.parentNode &&\r\n        target.parentNode.nodeType === target.DOCUMENT_NODE) {\r\n        return false;\r\n    }\r\n    if (!target.parentNode) {\r\n        return true;\r\n    }\r\n    return isAncestorRemoved(target.parentNode, mirror);\r\n}\r\nfunction legacy_isTouchEvent(event) {\r\n    return Boolean(event.changedTouches);\r\n}\r\nfunction polyfill(win = window) {\r\n    if ('NodeList' in win && !win.NodeList.prototype.forEach) {\r\n        win.NodeList.prototype.forEach = Array.prototype\r\n            .forEach;\r\n    }\r\n    if ('DOMTokenList' in win && !win.DOMTokenList.prototype.forEach) {\r\n        win.DOMTokenList.prototype.forEach = Array.prototype\r\n            .forEach;\r\n    }\r\n    if (!Node.prototype.contains) {\r\n        Node.prototype.contains = (...args) => {\r\n            let node = args[0];\r\n            if (!(0 in args)) {\r\n                throw new TypeError('1 argument is required');\r\n            }\r\n            do {\r\n                if (this === node) {\r\n                    return true;\r\n                }\r\n            } while ((node = node && node.parentNode));\r\n            return false;\r\n        };\r\n    }\r\n}\r\nfunction queueToResolveTrees(queue) {\r\n    const queueNodeMap = {};\r\n    const putIntoMap = (m, parent) => {\r\n        const nodeInTree = {\r\n            value: m,\r\n            parent,\r\n            children: [],\r\n        };\r\n        queueNodeMap[m.node.id] = nodeInTree;\r\n        return nodeInTree;\r\n    };\r\n    const queueNodeTrees = [];\r\n    for (const mutation of queue) {\r\n        const { nextId, parentId } = mutation;\r\n        if (nextId && nextId in queueNodeMap) {\r\n            const nextInTree = queueNodeMap[nextId];\r\n            if (nextInTree.parent) {\r\n                const idx = nextInTree.parent.children.indexOf(nextInTree);\r\n                nextInTree.parent.children.splice(idx, 0, putIntoMap(mutation, nextInTree.parent));\r\n            }\r\n            else {\r\n                const idx = queueNodeTrees.indexOf(nextInTree);\r\n                queueNodeTrees.splice(idx, 0, putIntoMap(mutation, null));\r\n            }\r\n            continue;\r\n        }\r\n        if (parentId in queueNodeMap) {\r\n            const parentInTree = queueNodeMap[parentId];\r\n            parentInTree.children.push(putIntoMap(mutation, parentInTree));\r\n            continue;\r\n        }\r\n        queueNodeTrees.push(putIntoMap(mutation, null));\r\n    }\r\n    return queueNodeTrees;\r\n}\r\nfunction iterateResolveTree(tree, cb) {\r\n    cb(tree.value);\r\n    for (let i = tree.children.length - 1; i >= 0; i--) {\r\n        iterateResolveTree(tree.children[i], cb);\r\n    }\r\n}\r\nfunction isSerializedIframe(n, mirror) {\r\n    return Boolean(n.nodeName === 'IFRAME' && mirror.getMeta(n));\r\n}\r\nfunction isSerializedStylesheet(n, mirror) {\r\n    return Boolean(n.nodeName === 'LINK' &&\r\n        n.nodeType === n.ELEMENT_NODE &&\r\n        n.getAttribute &&\r\n        n.getAttribute('rel') === 'stylesheet' &&\r\n        mirror.getMeta(n));\r\n}\r\nfunction getBaseDimension(node, rootIframe) {\r\n    var _a, _b;\r\n    const frameElement = (_b = (_a = node.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView) === null || _b === void 0 ? void 0 : _b.frameElement;\r\n    if (!frameElement || frameElement === rootIframe) {\r\n        return {\r\n            x: 0,\r\n            y: 0,\r\n            relativeScale: 1,\r\n            absoluteScale: 1,\r\n        };\r\n    }\r\n    const frameDimension = frameElement.getBoundingClientRect();\r\n    const frameBaseDimension = getBaseDimension(frameElement, rootIframe);\r\n    const relativeScale = frameDimension.height / frameElement.clientHeight;\r\n    return {\r\n        x: frameDimension.x * frameBaseDimension.relativeScale +\r\n            frameBaseDimension.x,\r\n        y: frameDimension.y * frameBaseDimension.relativeScale +\r\n            frameBaseDimension.y,\r\n        relativeScale,\r\n        absoluteScale: frameBaseDimension.absoluteScale * relativeScale,\r\n    };\r\n}\r\nfunction hasShadowRoot(n) {\r\n    return Boolean(n === null || n === void 0 ? void 0 : n.shadowRoot);\r\n}\r\nfunction getNestedRule(rules, position) {\r\n    const rule = rules[position[0]];\r\n    if (position.length === 1) {\r\n        return rule;\r\n    }\r\n    else {\r\n        return getNestedRule(rule.cssRules[position[1]].cssRules, position.slice(2));\r\n    }\r\n}\r\nfunction getPositionsAndIndex(nestedIndex) {\r\n    const positions = [...nestedIndex];\r\n    const index = positions.pop();\r\n    return { positions, index };\r\n}\r\nfunction uniqueTextMutations(mutations) {\r\n    const idSet = new Set();\r\n    const uniqueMutations = [];\r\n    for (let i = mutations.length; i--;) {\r\n        const mutation = mutations[i];\r\n        if (!idSet.has(mutation.id)) {\r\n            uniqueMutations.push(mutation);\r\n            idSet.add(mutation.id);\r\n        }\r\n    }\r\n    return uniqueMutations;\r\n}\r\nclass StyleSheetMirror {\r\n    constructor() {\r\n        this.id = 1;\r\n        this.styleIDMap = new WeakMap();\r\n        this.idStyleMap = new Map();\r\n    }\r\n    getId(stylesheet) {\r\n        var _a;\r\n        return (_a = this.styleIDMap.get(stylesheet)) !== null && _a !== void 0 ? _a : -1;\r\n    }\r\n    has(stylesheet) {\r\n        return this.styleIDMap.has(stylesheet);\r\n    }\r\n    add(stylesheet, id) {\r\n        if (this.has(stylesheet))\r\n            return this.getId(stylesheet);\r\n        let newId;\r\n        if (id === undefined) {\r\n            newId = this.id++;\r\n        }\r\n        else\r\n            newId = id;\r\n        this.styleIDMap.set(stylesheet, newId);\r\n        this.idStyleMap.set(newId, stylesheet);\r\n        return newId;\r\n    }\r\n    getStyle(id) {\r\n        return this.idStyleMap.get(id) || null;\r\n    }\r\n    reset() {\r\n        this.styleIDMap = new WeakMap();\r\n        this.idStyleMap = new Map();\r\n        this.id = 1;\r\n    }\r\n    generateId() {\r\n        return this.id++;\r\n    }\r\n}\r\nfunction getShadowHost(n) {\r\n    var _a, _b;\r\n    let shadowHost = null;\r\n    if (((_b = (_a = n.getRootNode) === null || _a === void 0 ? void 0 : _a.call(n)) === null || _b === void 0 ? void 0 : _b.nodeType) === Node.DOCUMENT_FRAGMENT_NODE &&\r\n        n.getRootNode().host)\r\n        shadowHost = n.getRootNode().host;\r\n    return shadowHost;\r\n}\r\nfunction getRootShadowHost(n) {\r\n    let rootShadowHost = n;\r\n    let shadowHost;\r\n    while ((shadowHost = getShadowHost(rootShadowHost)))\r\n        rootShadowHost = shadowHost;\r\n    return rootShadowHost;\r\n}\r\nfunction shadowHostInDom(n) {\r\n    const doc = n.ownerDocument;\r\n    if (!doc)\r\n        return false;\r\n    const shadowHost = getRootShadowHost(n);\r\n    return doc.contains(shadowHost);\r\n}\r\nfunction inDom(n) {\r\n    const doc = n.ownerDocument;\r\n    if (!doc)\r\n        return false;\r\n    return doc.contains(n) || shadowHostInDom(n);\r\n}\n\nexport { StyleSheetMirror, _mirror, getBaseDimension, getNestedRule, getPositionsAndIndex, getRootShadowHost, getShadowHost, getWindowHeight, getWindowScroll, getWindowWidth, hasShadowRoot, hookSetter, inDom, isAncestorRemoved, isBlocked, isIgnored, isSerialized, isSerializedIframe, isSerializedStylesheet, iterateResolveTree, legacy_isTouchEvent, nowTimestamp, on, patch, polyfill, queueToResolveTrees, shadowHostInDom, throttle, uniqueTextMutations };\n","var EventType = /* @__PURE__ */ ((EventType2) => {\n  EventType2[EventType2[\"DomContentLoaded\"] = 0] = \"DomContentLoaded\";\n  EventType2[EventType2[\"Load\"] = 1] = \"Load\";\n  EventType2[EventType2[\"FullSnapshot\"] = 2] = \"FullSnapshot\";\n  EventType2[EventType2[\"IncrementalSnapshot\"] = 3] = \"IncrementalSnapshot\";\n  EventType2[EventType2[\"Meta\"] = 4] = \"Meta\";\n  EventType2[EventType2[\"Custom\"] = 5] = \"Custom\";\n  EventType2[EventType2[\"Plugin\"] = 6] = \"Plugin\";\n  return EventType2;\n})(EventType || {});\nvar IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {\n  IncrementalSource2[IncrementalSource2[\"Mutation\"] = 0] = \"Mutation\";\n  IncrementalSource2[IncrementalSource2[\"MouseMove\"] = 1] = \"MouseMove\";\n  IncrementalSource2[IncrementalSource2[\"MouseInteraction\"] = 2] = \"MouseInteraction\";\n  IncrementalSource2[IncrementalSource2[\"Scroll\"] = 3] = \"Scroll\";\n  IncrementalSource2[IncrementalSource2[\"ViewportResize\"] = 4] = \"ViewportResize\";\n  IncrementalSource2[IncrementalSource2[\"Input\"] = 5] = \"Input\";\n  IncrementalSource2[IncrementalSource2[\"TouchMove\"] = 6] = \"TouchMove\";\n  IncrementalSource2[IncrementalSource2[\"MediaInteraction\"] = 7] = \"MediaInteraction\";\n  IncrementalSource2[IncrementalSource2[\"StyleSheetRule\"] = 8] = \"StyleSheetRule\";\n  IncrementalSource2[IncrementalSource2[\"CanvasMutation\"] = 9] = \"CanvasMutation\";\n  IncrementalSource2[IncrementalSource2[\"Font\"] = 10] = \"Font\";\n  IncrementalSource2[IncrementalSource2[\"Log\"] = 11] = \"Log\";\n  IncrementalSource2[IncrementalSource2[\"Drag\"] = 12] = \"Drag\";\n  IncrementalSource2[IncrementalSource2[\"StyleDeclaration\"] = 13] = \"StyleDeclaration\";\n  IncrementalSource2[IncrementalSource2[\"Selection\"] = 14] = \"Selection\";\n  IncrementalSource2[IncrementalSource2[\"AdoptedStyleSheet\"] = 15] = \"AdoptedStyleSheet\";\n  IncrementalSource2[IncrementalSource2[\"CustomElement\"] = 16] = \"CustomElement\";\n  return IncrementalSource2;\n})(IncrementalSource || {});\nvar MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {\n  MouseInteractions2[MouseInteractions2[\"MouseUp\"] = 0] = \"MouseUp\";\n  MouseInteractions2[MouseInteractions2[\"MouseDown\"] = 1] = \"MouseDown\";\n  MouseInteractions2[MouseInteractions2[\"Click\"] = 2] = \"Click\";\n  MouseInteractions2[MouseInteractions2[\"ContextMenu\"] = 3] = \"ContextMenu\";\n  MouseInteractions2[MouseInteractions2[\"DblClick\"] = 4] = \"DblClick\";\n  MouseInteractions2[MouseInteractions2[\"Focus\"] = 5] = \"Focus\";\n  MouseInteractions2[MouseInteractions2[\"Blur\"] = 6] = \"Blur\";\n  MouseInteractions2[MouseInteractions2[\"TouchStart\"] = 7] = \"TouchStart\";\n  MouseInteractions2[MouseInteractions2[\"TouchMove_Departed\"] = 8] = \"TouchMove_Departed\";\n  MouseInteractions2[MouseInteractions2[\"TouchEnd\"] = 9] = \"TouchEnd\";\n  MouseInteractions2[MouseInteractions2[\"TouchCancel\"] = 10] = \"TouchCancel\";\n  return MouseInteractions2;\n})(MouseInteractions || {});\nvar PointerTypes = /* @__PURE__ */ ((PointerTypes2) => {\n  PointerTypes2[PointerTypes2[\"Mouse\"] = 0] = \"Mouse\";\n  PointerTypes2[PointerTypes2[\"Pen\"] = 1] = \"Pen\";\n  PointerTypes2[PointerTypes2[\"Touch\"] = 2] = \"Touch\";\n  return PointerTypes2;\n})(PointerTypes || {});\nvar CanvasContext = /* @__PURE__ */ ((CanvasContext2) => {\n  CanvasContext2[CanvasContext2[\"2D\"] = 0] = \"2D\";\n  CanvasContext2[CanvasContext2[\"WebGL\"] = 1] = \"WebGL\";\n  CanvasContext2[CanvasContext2[\"WebGL2\"] = 2] = \"WebGL2\";\n  return CanvasContext2;\n})(CanvasContext || {});\nvar ReplayerEvents = /* @__PURE__ */ ((ReplayerEvents2) => {\n  ReplayerEvents2[\"Start\"] = \"start\";\n  ReplayerEvents2[\"Pause\"] = \"pause\";\n  ReplayerEvents2[\"Resume\"] = \"resume\";\n  ReplayerEvents2[\"Resize\"] = \"resize\";\n  ReplayerEvents2[\"Finish\"] = \"finish\";\n  ReplayerEvents2[\"FullsnapshotRebuilded\"] = \"fullsnapshot-rebuilded\";\n  ReplayerEvents2[\"LoadStylesheetStart\"] = \"load-stylesheet-start\";\n  ReplayerEvents2[\"LoadStylesheetEnd\"] = \"load-stylesheet-end\";\n  ReplayerEvents2[\"SkipStart\"] = \"skip-start\";\n  ReplayerEvents2[\"SkipEnd\"] = \"skip-end\";\n  ReplayerEvents2[\"MouseInteraction\"] = \"mouse-interaction\";\n  ReplayerEvents2[\"EventCast\"] = \"event-cast\";\n  ReplayerEvents2[\"CustomEvent\"] = \"custom-event\";\n  ReplayerEvents2[\"Flush\"] = \"flush\";\n  ReplayerEvents2[\"StateChange\"] = \"state-change\";\n  ReplayerEvents2[\"PlayBack\"] = \"play-back\";\n  ReplayerEvents2[\"Destroy\"] = \"destroy\";\n  return ReplayerEvents2;\n})(ReplayerEvents || {});\n\nexport { CanvasContext, EventType, IncrementalSource, MouseInteractions, PointerTypes, ReplayerEvents };\n","import { isShadowRoot, isNativeShadowDom, getInputType, getInputValue, shouldMaskInput, needMaskingText, maskInputValue, ignoreAttribute, transformAttribute, toLowerCase, IGNORED_NODE, serializeNodeWithId } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport { isIgnored, isBlocked, isSerialized, isAncestorRemoved, hasShadowRoot, inDom, getShadowHost, isSerializedIframe, isSerializedStylesheet } from '../utils.js';\n\nfunction isNodeInLinkedList(n) {\r\n    return '__ln' in n;\r\n}\r\nclass DoubleLinkedList {\r\n    constructor() {\r\n        this.length = 0;\r\n        this.head = null;\r\n        this.tail = null;\r\n    }\r\n    get(position) {\r\n        if (position >= this.length) {\r\n            throw new Error('Position outside of list range');\r\n        }\r\n        let current = this.head;\r\n        for (let index = 0; index < position; index++) {\r\n            current = (current === null || current === void 0 ? void 0 : current.next) || null;\r\n        }\r\n        return current;\r\n    }\r\n    addNode(n) {\r\n        const node = {\r\n            value: n,\r\n            previous: null,\r\n            next: null,\r\n        };\r\n        n.__ln = node;\r\n        if (n.previousSibling && isNodeInLinkedList(n.previousSibling)) {\r\n            const current = n.previousSibling.__ln.next;\r\n            node.next = current;\r\n            node.previous = n.previousSibling.__ln;\r\n            n.previousSibling.__ln.next = node;\r\n            if (current) {\r\n                current.previous = node;\r\n            }\r\n        }\r\n        else if (n.nextSibling &&\r\n            isNodeInLinkedList(n.nextSibling) &&\r\n            n.nextSibling.__ln.previous) {\r\n            const current = n.nextSibling.__ln.previous;\r\n            node.previous = current;\r\n            node.next = n.nextSibling.__ln;\r\n            n.nextSibling.__ln.previous = node;\r\n            if (current) {\r\n                current.next = node;\r\n            }\r\n        }\r\n        else {\r\n            if (this.head) {\r\n                this.head.previous = node;\r\n            }\r\n            node.next = this.head;\r\n            this.head = node;\r\n        }\r\n        if (node.next === null) {\r\n            this.tail = node;\r\n        }\r\n        this.length++;\r\n    }\r\n    removeNode(n) {\r\n        const current = n.__ln;\r\n        if (!this.head) {\r\n            return;\r\n        }\r\n        if (!current.previous) {\r\n            this.head = current.next;\r\n            if (this.head) {\r\n                this.head.previous = null;\r\n            }\r\n            else {\r\n                this.tail = null;\r\n            }\r\n        }\r\n        else {\r\n            current.previous.next = current.next;\r\n            if (current.next) {\r\n                current.next.previous = current.previous;\r\n            }\r\n            else {\r\n                this.tail = current.previous;\r\n            }\r\n        }\r\n        if (n.__ln) {\r\n            delete n.__ln;\r\n        }\r\n        this.length--;\r\n    }\r\n}\r\nconst moveKey = (id, parentId) => `${id}@${parentId}`;\r\nclass MutationBuffer {\r\n    constructor() {\r\n        this.frozen = false;\r\n        this.locked = false;\r\n        this.texts = [];\r\n        this.attributes = [];\r\n        this.removes = [];\r\n        this.mapRemoves = [];\r\n        this.movedMap = {};\r\n        this.addedSet = new Set();\r\n        this.movedSet = new Set();\r\n        this.droppedSet = new Set();\r\n        this.processMutations = (mutations) => {\r\n            mutations.forEach(this.processMutation);\r\n            this.emit();\r\n        };\r\n        this.emit = () => {\r\n            if (this.frozen || this.locked) {\r\n                return;\r\n            }\r\n            const adds = [];\r\n            const addedIds = new Set();\r\n            const addList = new DoubleLinkedList();\r\n            const getNextId = (n) => {\r\n                let ns = n;\r\n                let nextId = IGNORED_NODE;\r\n                while (nextId === IGNORED_NODE) {\r\n                    ns = ns && ns.nextSibling;\r\n                    nextId = ns && this.mirror.getId(ns);\r\n                }\r\n                return nextId;\r\n            };\r\n            const pushAdd = (n) => {\r\n                if (!n.parentNode || !inDom(n)) {\r\n                    return;\r\n                }\r\n                const parentId = isShadowRoot(n.parentNode)\r\n                    ? this.mirror.getId(getShadowHost(n))\r\n                    : this.mirror.getId(n.parentNode);\r\n                const nextId = getNextId(n);\r\n                if (parentId === -1 || nextId === -1) {\r\n                    return addList.addNode(n);\r\n                }\r\n                const sn = serializeNodeWithId(n, {\r\n                    doc: this.doc,\r\n                    mirror: this.mirror,\r\n                    blockClass: this.blockClass,\r\n                    blockSelector: this.blockSelector,\r\n                    maskAllText: this.maskAllText,\r\n                    unblockSelector: this.unblockSelector,\r\n                    maskTextClass: this.maskTextClass,\r\n                    unmaskTextClass: this.unmaskTextClass,\r\n                    maskTextSelector: this.maskTextSelector,\r\n                    unmaskTextSelector: this.unmaskTextSelector,\r\n                    skipChild: true,\r\n                    newlyAddedElement: true,\r\n                    inlineStylesheet: this.inlineStylesheet,\r\n                    maskInputOptions: this.maskInputOptions,\r\n                    maskAttributeFn: this.maskAttributeFn,\r\n                    maskTextFn: this.maskTextFn,\r\n                    maskInputFn: this.maskInputFn,\r\n                    slimDOMOptions: this.slimDOMOptions,\r\n                    dataURLOptions: this.dataURLOptions,\r\n                    recordCanvas: this.recordCanvas,\r\n                    inlineImages: this.inlineImages,\r\n                    onSerialize: (currentN) => {\r\n                        if (isSerializedIframe(currentN, this.mirror)) {\r\n                            this.iframeManager.addIframe(currentN);\r\n                        }\r\n                        if (isSerializedStylesheet(currentN, this.mirror)) {\r\n                            this.stylesheetManager.trackLinkElement(currentN);\r\n                        }\r\n                        if (hasShadowRoot(n)) {\r\n                            this.shadowDomManager.addShadowRoot(n.shadowRoot, this.doc);\r\n                        }\r\n                    },\r\n                    onIframeLoad: (iframe, childSn) => {\r\n                        this.iframeManager.attachIframe(iframe, childSn);\r\n                        this.shadowDomManager.observeAttachShadow(iframe);\r\n                    },\r\n                    onStylesheetLoad: (link, childSn) => {\r\n                        this.stylesheetManager.attachLinkElement(link, childSn);\r\n                    },\r\n                });\r\n                if (sn) {\r\n                    adds.push({\r\n                        parentId,\r\n                        nextId,\r\n                        node: sn,\r\n                    });\r\n                    addedIds.add(sn.id);\r\n                }\r\n            };\r\n            while (this.mapRemoves.length) {\r\n                this.mirror.removeNodeFromMap(this.mapRemoves.shift());\r\n            }\r\n            for (const n of this.movedSet) {\r\n                if (isParentRemoved(this.removes, n, this.mirror) &&\r\n                    !this.movedSet.has(n.parentNode)) {\r\n                    continue;\r\n                }\r\n                pushAdd(n);\r\n            }\r\n            for (const n of this.addedSet) {\r\n                if (!isAncestorInSet(this.droppedSet, n) &&\r\n                    !isParentRemoved(this.removes, n, this.mirror)) {\r\n                    pushAdd(n);\r\n                }\r\n                else if (isAncestorInSet(this.movedSet, n)) {\r\n                    pushAdd(n);\r\n                }\r\n                else {\r\n                    this.droppedSet.add(n);\r\n                }\r\n            }\r\n            let candidate = null;\r\n            while (addList.length) {\r\n                let node = null;\r\n                if (candidate) {\r\n                    const parentId = this.mirror.getId(candidate.value.parentNode);\r\n                    const nextId = getNextId(candidate.value);\r\n                    if (parentId !== -1 && nextId !== -1) {\r\n                        node = candidate;\r\n                    }\r\n                }\r\n                if (!node) {\r\n                    let tailNode = addList.tail;\r\n                    while (tailNode) {\r\n                        const _node = tailNode;\r\n                        tailNode = tailNode.previous;\r\n                        if (_node) {\r\n                            const parentId = this.mirror.getId(_node.value.parentNode);\r\n                            const nextId = getNextId(_node.value);\r\n                            if (nextId === -1)\r\n                                continue;\r\n                            else if (parentId !== -1) {\r\n                                node = _node;\r\n                                break;\r\n                            }\r\n                            else {\r\n                                const unhandledNode = _node.value;\r\n                                if (unhandledNode.parentNode &&\r\n                                    unhandledNode.parentNode.nodeType ===\r\n                                        Node.DOCUMENT_FRAGMENT_NODE) {\r\n                                    const shadowHost = unhandledNode.parentNode\r\n                                        .host;\r\n                                    const parentId = this.mirror.getId(shadowHost);\r\n                                    if (parentId !== -1) {\r\n                                        node = _node;\r\n                                        break;\r\n                                    }\r\n                                }\r\n                            }\r\n                        }\r\n                    }\r\n                }\r\n                if (!node) {\r\n                    while (addList.head) {\r\n                        addList.removeNode(addList.head.value);\r\n                    }\r\n                    break;\r\n                }\r\n                candidate = node.previous;\r\n                addList.removeNode(node.value);\r\n                pushAdd(node.value);\r\n            }\r\n            const payload = {\r\n                texts: this.texts\r\n                    .map((text) => ({\r\n                    id: this.mirror.getId(text.node),\r\n                    value: text.value,\r\n                }))\r\n                    .filter((text) => !addedIds.has(text.id))\r\n                    .filter((text) => this.mirror.has(text.id)),\r\n                attributes: this.attributes\r\n                    .map((attribute) => {\r\n                    const { attributes } = attribute;\r\n                    if (typeof attributes.style === 'string') {\r\n                        const diffAsStr = JSON.stringify(attribute.styleDiff);\r\n                        const unchangedAsStr = JSON.stringify(attribute._unchangedStyles);\r\n                        if (diffAsStr.length < attributes.style.length) {\r\n                            if ((diffAsStr + unchangedAsStr).split('var(').length ===\r\n                                attributes.style.split('var(').length) {\r\n                                attributes.style = attribute.styleDiff;\r\n                            }\r\n                        }\r\n                    }\r\n                    return {\r\n                        id: this.mirror.getId(attribute.node),\r\n                        attributes: attributes,\r\n                    };\r\n                })\r\n                    .filter((attribute) => !addedIds.has(attribute.id))\r\n                    .filter((attribute) => this.mirror.has(attribute.id)),\r\n                removes: this.removes,\r\n                adds,\r\n            };\r\n            if (!payload.texts.length &&\r\n                !payload.attributes.length &&\r\n                !payload.removes.length &&\r\n                !payload.adds.length) {\r\n                return;\r\n            }\r\n            this.texts = [];\r\n            this.attributes = [];\r\n            this.removes = [];\r\n            this.addedSet = new Set();\r\n            this.movedSet = new Set();\r\n            this.droppedSet = new Set();\r\n            this.movedMap = {};\r\n            this.mutationCb(payload);\r\n        };\r\n        this.processMutation = (m) => {\r\n            if (isIgnored(m.target, this.mirror)) {\r\n                return;\r\n            }\r\n            let unattachedDoc;\r\n            try {\r\n                unattachedDoc = document.implementation.createHTMLDocument();\r\n            }\r\n            catch (e) {\r\n                unattachedDoc = this.doc;\r\n            }\r\n            switch (m.type) {\r\n                case 'characterData': {\r\n                    const value = m.target.textContent;\r\n                    if (!isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector, false) &&\r\n                        value !== m.oldValue) {\r\n                        this.texts.push({\r\n                            value: needMaskingText(m.target, this.maskTextClass, this.maskTextSelector, this.unmaskTextClass, this.unmaskTextSelector, this.maskAllText) && value\r\n                                ? this.maskTextFn\r\n                                    ? this.maskTextFn(value)\r\n                                    : value.replace(/[\\S]/g, '*')\r\n                                : value,\r\n                            node: m.target,\r\n                        });\r\n                    }\r\n                    break;\r\n                }\r\n                case 'attributes': {\r\n                    const target = m.target;\r\n                    let attributeName = m.attributeName;\r\n                    let value = m.target.getAttribute(attributeName);\r\n                    if (attributeName === 'value') {\r\n                        const type = getInputType(target);\r\n                        const tagName = target.tagName;\r\n                        value = getInputValue(target, tagName, type);\r\n                        const isInputMasked = shouldMaskInput({\r\n                            maskInputOptions: this.maskInputOptions,\r\n                            tagName,\r\n                            type,\r\n                        });\r\n                        const forceMask = needMaskingText(m.target, this.maskTextClass, this.maskTextSelector, this.unmaskTextClass, this.unmaskTextSelector, isInputMasked);\r\n                        value = maskInputValue({\r\n                            isMasked: forceMask,\r\n                            element: target,\r\n                            value,\r\n                            maskInputFn: this.maskInputFn,\r\n                        });\r\n                    }\r\n                    if (isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector, false) ||\r\n                        value === m.oldValue) {\r\n                        return;\r\n                    }\r\n                    let item = this.attributes.find((a) => a.node === m.target);\r\n                    if (target.tagName === 'IFRAME' &&\r\n                        attributeName === 'src' &&\r\n                        !this.keepIframeSrcFn(value)) {\r\n                        if (!target.contentDocument) {\r\n                            attributeName = 'rr_src';\r\n                        }\r\n                        else {\r\n                            return;\r\n                        }\r\n                    }\r\n                    if (!item) {\r\n                        item = {\r\n                            node: m.target,\r\n                            attributes: {},\r\n                            styleDiff: {},\r\n                            _unchangedStyles: {},\r\n                        };\r\n                        this.attributes.push(item);\r\n                    }\r\n                    if (attributeName === 'type' &&\r\n                        target.tagName === 'INPUT' &&\r\n                        (m.oldValue || '').toLowerCase() === 'password') {\r\n                        target.setAttribute('data-rr-is-password', 'true');\r\n                    }\r\n                    if (!ignoreAttribute(target.tagName, attributeName)) {\r\n                        item.attributes[attributeName] = transformAttribute(this.doc, toLowerCase(target.tagName), toLowerCase(attributeName), value, target, this.maskAttributeFn);\r\n                        if (attributeName === 'style') {\r\n                            const old = unattachedDoc.createElement('span');\r\n                            if (m.oldValue) {\r\n                                old.setAttribute('style', m.oldValue);\r\n                            }\r\n                            for (const pname of Array.from(target.style)) {\r\n                                const newValue = target.style.getPropertyValue(pname);\r\n                                const newPriority = target.style.getPropertyPriority(pname);\r\n                                if (newValue !== old.style.getPropertyValue(pname) ||\r\n                                    newPriority !== old.style.getPropertyPriority(pname)) {\r\n                                    if (newPriority === '') {\r\n                                        item.styleDiff[pname] = newValue;\r\n                                    }\r\n                                    else {\r\n                                        item.styleDiff[pname] = [newValue, newPriority];\r\n                                    }\r\n                                }\r\n                                else {\r\n                                    item._unchangedStyles[pname] = [newValue, newPriority];\r\n                                }\r\n                            }\r\n                            for (const pname of Array.from(old.style)) {\r\n                                if (target.style.getPropertyValue(pname) === '') {\r\n                                    item.styleDiff[pname] = false;\r\n                                }\r\n                            }\r\n                        }\r\n                    }\r\n                    break;\r\n                }\r\n                case 'childList': {\r\n                    if (isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector, true)) {\r\n                        return;\r\n                    }\r\n                    m.addedNodes.forEach((n) => this.genAdds(n, m.target));\r\n                    m.removedNodes.forEach((n) => {\r\n                        const nodeId = this.mirror.getId(n);\r\n                        const parentId = isShadowRoot(m.target)\r\n                            ? this.mirror.getId(m.target.host)\r\n                            : this.mirror.getId(m.target);\r\n                        if (isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector, false) ||\r\n                            isIgnored(n, this.mirror) ||\r\n                            !isSerialized(n, this.mirror)) {\r\n                            return;\r\n                        }\r\n                        if (this.addedSet.has(n)) {\r\n                            deepDelete(this.addedSet, n);\r\n                            this.droppedSet.add(n);\r\n                        }\r\n                        else if (this.addedSet.has(m.target) && nodeId === -1) ;\r\n                        else if (isAncestorRemoved(m.target, this.mirror)) ;\r\n                        else if (this.movedSet.has(n) &&\r\n                            this.movedMap[moveKey(nodeId, parentId)]) {\r\n                            deepDelete(this.movedSet, n);\r\n                        }\r\n                        else {\r\n                            this.removes.push({\r\n                                parentId,\r\n                                id: nodeId,\r\n                                isShadow: isShadowRoot(m.target) && isNativeShadowDom(m.target)\r\n                                    ? true\r\n                                    : undefined,\r\n                            });\r\n                        }\r\n                        this.mapRemoves.push(n);\r\n                    });\r\n                    break;\r\n                }\r\n            }\r\n        };\r\n        this.genAdds = (n, target) => {\r\n            if (this.processedNodeManager.inOtherBuffer(n, this))\r\n                return;\r\n            if (this.addedSet.has(n) || this.movedSet.has(n))\r\n                return;\r\n            if (this.mirror.hasNode(n)) {\r\n                if (isIgnored(n, this.mirror)) {\r\n                    return;\r\n                }\r\n                this.movedSet.add(n);\r\n                let targetId = null;\r\n                if (target && this.mirror.hasNode(target)) {\r\n                    targetId = this.mirror.getId(target);\r\n                }\r\n                if (targetId && targetId !== -1) {\r\n                    this.movedMap[moveKey(this.mirror.getId(n), targetId)] = true;\r\n                }\r\n            }\r\n            else {\r\n                this.addedSet.add(n);\r\n                this.droppedSet.delete(n);\r\n            }\r\n            if (!isBlocked(n, this.blockClass, this.blockSelector, this.unblockSelector, false)) {\r\n                n.childNodes.forEach((childN) => this.genAdds(childN));\r\n                if (hasShadowRoot(n)) {\r\n                    n.shadowRoot.childNodes.forEach((childN) => {\r\n                        this.processedNodeManager.add(childN, this);\r\n                        this.genAdds(childN, n);\r\n                    });\r\n                }\r\n            }\r\n        };\r\n    }\r\n    init(options) {\r\n        [\r\n            'mutationCb',\r\n            'blockClass',\r\n            'blockSelector',\r\n            'unblockSelector',\r\n            'maskAllText',\r\n            'maskTextClass',\r\n            'unmaskTextClass',\r\n            'maskTextSelector',\r\n            'unmaskTextSelector',\r\n            'inlineStylesheet',\r\n            'maskInputOptions',\r\n            'maskAttributeFn',\r\n            'maskTextFn',\r\n            'maskInputFn',\r\n            'keepIframeSrcFn',\r\n            'recordCanvas',\r\n            'inlineImages',\r\n            'slimDOMOptions',\r\n            'dataURLOptions',\r\n            'doc',\r\n            'mirror',\r\n            'iframeManager',\r\n            'stylesheetManager',\r\n            'shadowDomManager',\r\n            'canvasManager',\r\n            'processedNodeManager',\r\n        ].forEach((key) => {\r\n            this[key] = options[key];\r\n        });\r\n    }\r\n    freeze() {\r\n        this.frozen = true;\r\n        this.canvasManager.freeze();\r\n    }\r\n    unfreeze() {\r\n        this.frozen = false;\r\n        this.canvasManager.unfreeze();\r\n        this.emit();\r\n    }\r\n    isFrozen() {\r\n        return this.frozen;\r\n    }\r\n    lock() {\r\n        this.locked = true;\r\n        this.canvasManager.lock();\r\n    }\r\n    unlock() {\r\n        this.locked = false;\r\n        this.canvasManager.unlock();\r\n        this.emit();\r\n    }\r\n    reset() {\r\n        this.shadowDomManager.reset();\r\n        this.canvasManager.reset();\r\n    }\r\n}\r\nfunction deepDelete(addsSet, n) {\r\n    addsSet.delete(n);\r\n    n.childNodes.forEach((childN) => deepDelete(addsSet, childN));\r\n}\r\nfunction isParentRemoved(removes, n, mirror) {\r\n    if (removes.length === 0)\r\n        return false;\r\n    return _isParentRemoved(removes, n, mirror);\r\n}\r\nfunction _isParentRemoved(removes, n, mirror) {\r\n    const { parentNode } = n;\r\n    if (!parentNode) {\r\n        return false;\r\n    }\r\n    const parentId = mirror.getId(parentNode);\r\n    if (removes.some((r) => r.id === parentId)) {\r\n        return true;\r\n    }\r\n    return _isParentRemoved(removes, parentNode, mirror);\r\n}\r\nfunction isAncestorInSet(set, n) {\r\n    if (set.size === 0)\r\n        return false;\r\n    return _isAncestorInSet(set, n);\r\n}\r\nfunction _isAncestorInSet(set, n) {\r\n    const { parentNode } = n;\r\n    if (!parentNode) {\r\n        return false;\r\n    }\r\n    if (set.has(parentNode)) {\r\n        return true;\r\n    }\r\n    return _isAncestorInSet(set, parentNode);\r\n}\n\nexport { MutationBuffer as default };\n","let errorHandler;\r\nfunction registerErrorHandler(handler) {\r\n    errorHandler = handler;\r\n}\r\nfunction unregisterErrorHandler() {\r\n    errorHandler = undefined;\r\n}\r\nconst callbackWrapper = (cb) => {\r\n    if (!errorHandler) {\r\n        return cb;\r\n    }\r\n    const rrwebWrapped = ((...rest) => {\r\n        try {\r\n            return cb(...rest);\r\n        }\r\n        catch (error) {\r\n            if (errorHandler && errorHandler(error) === true) {\r\n                return () => {\r\n                };\r\n            }\r\n            throw error;\r\n        }\r\n    });\r\n    return rrwebWrapped;\r\n};\n\nexport { callbackWrapper, registerErrorHandler, unregisterErrorHandler };\n","import { toLowerCase, toUpperCase, getInputType, getInputValue, shouldMaskInput, needMaskingText, maskInputValue } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport { on, throttle, isBlocked, getWindowScroll, getWindowHeight, getWindowWidth, hookSetter, patch, legacy_isTouchEvent, nowTimestamp } from '../utils.js';\nimport { MouseInteractions, IncrementalSource, PointerTypes } from '../../../types/dist/rrweb-types.js';\nimport MutationBuffer from './mutation.js';\nimport { callbackWrapper } from './error-handler.js';\n\nconst mutationBuffers = [];\r\nfunction getEventTarget(event) {\r\n    try {\r\n        if ('composedPath' in event) {\r\n            const path = event.composedPath();\r\n            if (path.length) {\r\n                return path[0];\r\n            }\r\n        }\r\n        else if ('path' in event && event.path.length) {\r\n            return event.path[0];\r\n        }\r\n    }\r\n    catch (_a) {\r\n    }\r\n    return event && event.target;\r\n}\r\nfunction initMutationObserver(options, rootEl) {\r\n    var _a, _b;\r\n    const mutationBuffer = new MutationBuffer();\r\n    mutationBuffers.push(mutationBuffer);\r\n    mutationBuffer.init(options);\r\n    let mutationObserverCtor = window.MutationObserver ||\r\n        window.__rrMutationObserver;\r\n    const angularZoneSymbol = (_b = (_a = window === null || window === void 0 ? void 0 : window.Zone) === null || _a === void 0 ? void 0 : _a.__symbol__) === null || _b === void 0 ? void 0 : _b.call(_a, 'MutationObserver');\r\n    if (angularZoneSymbol &&\r\n        window[angularZoneSymbol]) {\r\n        mutationObserverCtor = window[angularZoneSymbol];\r\n    }\r\n    const observer = new mutationObserverCtor(callbackWrapper((mutations) => {\r\n        if (options.onMutation && options.onMutation(mutations) === false) {\r\n            return;\r\n        }\r\n        mutationBuffer.processMutations.bind(mutationBuffer)(mutations);\r\n    }));\r\n    observer.observe(rootEl, {\r\n        attributes: true,\r\n        attributeOldValue: true,\r\n        characterData: true,\r\n        characterDataOldValue: true,\r\n        childList: true,\r\n        subtree: true,\r\n    });\r\n    return observer;\r\n}\r\nfunction initMoveObserver({ mousemoveCb, sampling, doc, mirror, }) {\r\n    if (sampling.mousemove === false) {\r\n        return () => {\r\n        };\r\n    }\r\n    const threshold = typeof sampling.mousemove === 'number' ? sampling.mousemove : 50;\r\n    const callbackThreshold = typeof sampling.mousemoveCallback === 'number'\r\n        ? sampling.mousemoveCallback\r\n        : 500;\r\n    let positions = [];\r\n    let timeBaseline;\r\n    const wrappedCb = throttle(callbackWrapper((source) => {\r\n        const totalOffset = Date.now() - timeBaseline;\r\n        mousemoveCb(positions.map((p) => {\r\n            p.timeOffset -= totalOffset;\r\n            return p;\r\n        }), source);\r\n        positions = [];\r\n        timeBaseline = null;\r\n    }), callbackThreshold);\r\n    const updatePosition = callbackWrapper(throttle(callbackWrapper((evt) => {\r\n        const target = getEventTarget(evt);\r\n        const { clientX, clientY } = legacy_isTouchEvent(evt)\r\n            ? evt.changedTouches[0]\r\n            : evt;\r\n        if (!timeBaseline) {\r\n            timeBaseline = nowTimestamp();\r\n        }\r\n        positions.push({\r\n            x: clientX,\r\n            y: clientY,\r\n            id: mirror.getId(target),\r\n            timeOffset: nowTimestamp() - timeBaseline,\r\n        });\r\n        wrappedCb(typeof DragEvent !== 'undefined' && evt instanceof DragEvent\r\n            ? IncrementalSource.Drag\r\n            : evt instanceof MouseEvent\r\n                ? IncrementalSource.MouseMove\r\n                : IncrementalSource.TouchMove);\r\n    }), threshold, {\r\n        trailing: false,\r\n    }));\r\n    const handlers = [\r\n        on('mousemove', updatePosition, doc),\r\n        on('touchmove', updatePosition, doc),\r\n        on('drag', updatePosition, doc),\r\n    ];\r\n    return callbackWrapper(() => {\r\n        handlers.forEach((h) => h());\r\n    });\r\n}\r\nfunction initMouseInteractionObserver({ mouseInteractionCb, doc, mirror, blockClass, blockSelector, unblockSelector, sampling, }) {\r\n    if (sampling.mouseInteraction === false) {\r\n        return () => {\r\n        };\r\n    }\r\n    const disableMap = sampling.mouseInteraction === true ||\r\n        sampling.mouseInteraction === undefined\r\n        ? {}\r\n        : sampling.mouseInteraction;\r\n    const handlers = [];\r\n    let currentPointerType = null;\r\n    const getHandler = (eventKey) => {\r\n        return (event) => {\r\n            const target = getEventTarget(event);\r\n            if (isBlocked(target, blockClass, blockSelector, unblockSelector, true)) {\r\n                return;\r\n            }\r\n            let pointerType = null;\r\n            let thisEventKey = eventKey;\r\n            if ('pointerType' in event) {\r\n                switch (event.pointerType) {\r\n                    case 'mouse':\r\n                        pointerType = PointerTypes.Mouse;\r\n                        break;\r\n                    case 'touch':\r\n                        pointerType = PointerTypes.Touch;\r\n                        break;\r\n                    case 'pen':\r\n                        pointerType = PointerTypes.Pen;\r\n                        break;\r\n                }\r\n                if (pointerType === PointerTypes.Touch) {\r\n                    if (MouseInteractions[eventKey] === MouseInteractions.MouseDown) {\r\n                        thisEventKey = 'TouchStart';\r\n                    }\r\n                    else if (MouseInteractions[eventKey] === MouseInteractions.MouseUp) {\r\n                        thisEventKey = 'TouchEnd';\r\n                    }\r\n                }\r\n                else if (pointerType === PointerTypes.Pen) ;\r\n            }\r\n            else if (legacy_isTouchEvent(event)) {\r\n                pointerType = PointerTypes.Touch;\r\n            }\r\n            if (pointerType !== null) {\r\n                currentPointerType = pointerType;\r\n                if ((thisEventKey.startsWith('Touch') &&\r\n                    pointerType === PointerTypes.Touch) ||\r\n                    (thisEventKey.startsWith('Mouse') &&\r\n                        pointerType === PointerTypes.Mouse)) {\r\n                    pointerType = null;\r\n                }\r\n            }\r\n            else if (MouseInteractions[eventKey] === MouseInteractions.Click) {\r\n                pointerType = currentPointerType;\r\n                currentPointerType = null;\r\n            }\r\n            const e = legacy_isTouchEvent(event) ? event.changedTouches[0] : event;\r\n            if (!e) {\r\n                return;\r\n            }\r\n            const id = mirror.getId(target);\r\n            const { clientX, clientY } = e;\r\n            callbackWrapper(mouseInteractionCb)(Object.assign({ type: MouseInteractions[thisEventKey], id, x: clientX, y: clientY }, (pointerType !== null && { pointerType })));\r\n        };\r\n    };\r\n    Object.keys(MouseInteractions)\r\n        .filter((key) => Number.isNaN(Number(key)) &&\r\n        !key.endsWith('_Departed') &&\r\n        disableMap[key] !== false)\r\n        .forEach((eventKey) => {\r\n        let eventName = toLowerCase(eventKey);\r\n        const handler = getHandler(eventKey);\r\n        if (window.PointerEvent) {\r\n            switch (MouseInteractions[eventKey]) {\r\n                case MouseInteractions.MouseDown:\r\n                case MouseInteractions.MouseUp:\r\n                    eventName = eventName.replace('mouse', 'pointer');\r\n                    break;\r\n                case MouseInteractions.TouchStart:\r\n                case MouseInteractions.TouchEnd:\r\n                    return;\r\n            }\r\n        }\r\n        handlers.push(on(eventName, handler, doc));\r\n    });\r\n    return callbackWrapper(() => {\r\n        handlers.forEach((h) => h());\r\n    });\r\n}\r\nfunction initScrollObserver({ scrollCb, doc, mirror, blockClass, blockSelector, unblockSelector, sampling, }) {\r\n    const updatePosition = callbackWrapper(throttle(callbackWrapper((evt) => {\r\n        const target = getEventTarget(evt);\r\n        if (!target ||\r\n            isBlocked(target, blockClass, blockSelector, unblockSelector, true)) {\r\n            return;\r\n        }\r\n        const id = mirror.getId(target);\r\n        if (target === doc && doc.defaultView) {\r\n            const scrollLeftTop = getWindowScroll(doc.defaultView);\r\n            scrollCb({\r\n                id,\r\n                x: scrollLeftTop.left,\r\n                y: scrollLeftTop.top,\r\n            });\r\n        }\r\n        else {\r\n            scrollCb({\r\n                id,\r\n                x: target.scrollLeft,\r\n                y: target.scrollTop,\r\n            });\r\n        }\r\n    }), sampling.scroll || 100));\r\n    return on('scroll', updatePosition, doc);\r\n}\r\nfunction initViewportResizeObserver({ viewportResizeCb }, { win }) {\r\n    let lastH = -1;\r\n    let lastW = -1;\r\n    const updateDimension = callbackWrapper(throttle(callbackWrapper(() => {\r\n        const height = getWindowHeight();\r\n        const width = getWindowWidth();\r\n        if (lastH !== height || lastW !== width) {\r\n            viewportResizeCb({\r\n                width: Number(width),\r\n                height: Number(height),\r\n            });\r\n            lastH = height;\r\n            lastW = width;\r\n        }\r\n    }), 200));\r\n    return on('resize', updateDimension, win);\r\n}\r\nfunction wrapEventWithUserTriggeredFlag(v, enable) {\r\n    const value = Object.assign({}, v);\r\n    if (!enable)\r\n        delete value.userTriggered;\r\n    return value;\r\n}\r\nconst INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];\r\nconst lastInputValueMap = new WeakMap();\r\nfunction initInputObserver({ inputCb, doc, mirror, blockClass, blockSelector, unblockSelector, ignoreClass, ignoreSelector, maskInputOptions, maskInputFn, sampling, userTriggeredOnInput, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, }) {\r\n    function eventHandler(event) {\r\n        let target = getEventTarget(event);\r\n        const userTriggered = event.isTrusted;\r\n        const tagName = target && toUpperCase(target.tagName);\r\n        if (tagName === 'OPTION')\r\n            target = target.parentElement;\r\n        if (!target ||\r\n            !tagName ||\r\n            INPUT_TAGS.indexOf(tagName) < 0 ||\r\n            isBlocked(target, blockClass, blockSelector, unblockSelector, true)) {\r\n            return;\r\n        }\r\n        const el = target;\r\n        if (el.classList.contains(ignoreClass) ||\r\n            (ignoreSelector && el.matches(ignoreSelector))) {\r\n            return;\r\n        }\r\n        const type = getInputType(target);\r\n        let text = getInputValue(el, tagName, type);\r\n        let isChecked = false;\r\n        const isInputMasked = shouldMaskInput({\r\n            maskInputOptions,\r\n            tagName,\r\n            type,\r\n        });\r\n        const forceMask = needMaskingText(target, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, isInputMasked);\r\n        if (type === 'radio' || type === 'checkbox') {\r\n            isChecked = target.checked;\r\n        }\r\n        text = maskInputValue({\r\n            isMasked: forceMask,\r\n            element: target,\r\n            value: text,\r\n            maskInputFn,\r\n        });\r\n        cbWithDedup(target, callbackWrapper(wrapEventWithUserTriggeredFlag)({ text, isChecked, userTriggered }, userTriggeredOnInput));\r\n        const name = target.name;\r\n        if (type === 'radio' && name && isChecked) {\r\n            doc\r\n                .querySelectorAll(`input[type=\"radio\"][name=\"${name}\"]`)\r\n                .forEach((el) => {\r\n                if (el !== target) {\r\n                    const text = maskInputValue({\r\n                        isMasked: forceMask,\r\n                        element: el,\r\n                        value: getInputValue(el, tagName, type),\r\n                        maskInputFn,\r\n                    });\r\n                    cbWithDedup(el, callbackWrapper(wrapEventWithUserTriggeredFlag)({\r\n                        text,\r\n                        isChecked: !isChecked,\r\n                        userTriggered: false,\r\n                    }, userTriggeredOnInput));\r\n                }\r\n            });\r\n        }\r\n    }\r\n    function cbWithDedup(target, v) {\r\n        const lastInputValue = lastInputValueMap.get(target);\r\n        if (!lastInputValue ||\r\n            lastInputValue.text !== v.text ||\r\n            lastInputValue.isChecked !== v.isChecked) {\r\n            lastInputValueMap.set(target, v);\r\n            const id = mirror.getId(target);\r\n            callbackWrapper(inputCb)(Object.assign(Object.assign({}, v), { id }));\r\n        }\r\n    }\r\n    const events = sampling.input === 'last' ? ['change'] : ['input', 'change'];\r\n    const handlers = events.map((eventName) => on(eventName, callbackWrapper(eventHandler), doc));\r\n    const currentWindow = doc.defaultView;\r\n    if (!currentWindow) {\r\n        return () => {\r\n            handlers.forEach((h) => h());\r\n        };\r\n    }\r\n    const propertyDescriptor = currentWindow.Object.getOwnPropertyDescriptor(currentWindow.HTMLInputElement.prototype, 'value');\r\n    const hookProperties = [\r\n        [currentWindow.HTMLInputElement.prototype, 'value'],\r\n        [currentWindow.HTMLInputElement.prototype, 'checked'],\r\n        [currentWindow.HTMLSelectElement.prototype, 'value'],\r\n        [currentWindow.HTMLTextAreaElement.prototype, 'value'],\r\n        [currentWindow.HTMLSelectElement.prototype, 'selectedIndex'],\r\n        [currentWindow.HTMLOptionElement.prototype, 'selected'],\r\n    ];\r\n    if (propertyDescriptor && propertyDescriptor.set) {\r\n        handlers.push(...hookProperties.map((p) => hookSetter(p[0], p[1], {\r\n            set() {\r\n                callbackWrapper(eventHandler)({\r\n                    target: this,\r\n                    isTrusted: false,\r\n                });\r\n            },\r\n        }, false, currentWindow)));\r\n    }\r\n    return callbackWrapper(() => {\r\n        handlers.forEach((h) => h());\r\n    });\r\n}\r\nfunction getNestedCSSRulePositions(rule) {\r\n    const positions = [];\r\n    function recurse(childRule, pos) {\r\n        if ((hasNestedCSSRule('CSSGroupingRule') &&\r\n            childRule.parentRule instanceof CSSGroupingRule) ||\r\n            (hasNestedCSSRule('CSSMediaRule') &&\r\n                childRule.parentRule instanceof CSSMediaRule) ||\r\n            (hasNestedCSSRule('CSSSupportsRule') &&\r\n                childRule.parentRule instanceof CSSSupportsRule) ||\r\n            (hasNestedCSSRule('CSSConditionRule') &&\r\n                childRule.parentRule instanceof CSSConditionRule)) {\r\n            const rules = Array.from(childRule.parentRule.cssRules);\r\n            const index = rules.indexOf(childRule);\r\n            pos.unshift(index);\r\n        }\r\n        else if (childRule.parentStyleSheet) {\r\n            const rules = Array.from(childRule.parentStyleSheet.cssRules);\r\n            const index = rules.indexOf(childRule);\r\n            pos.unshift(index);\r\n        }\r\n        return pos;\r\n    }\r\n    return recurse(rule, positions);\r\n}\r\nfunction getIdAndStyleId(sheet, mirror, styleMirror) {\r\n    let id, styleId;\r\n    if (!sheet)\r\n        return {};\r\n    if (sheet.ownerNode)\r\n        id = mirror.getId(sheet.ownerNode);\r\n    else\r\n        styleId = styleMirror.getId(sheet);\r\n    return {\r\n        styleId,\r\n        id,\r\n    };\r\n}\r\nfunction initStyleSheetObserver({ styleSheetRuleCb, mirror, stylesheetManager }, { win }) {\r\n    if (!win.CSSStyleSheet || !win.CSSStyleSheet.prototype) {\r\n        return () => {\r\n        };\r\n    }\r\n    const insertRule = win.CSSStyleSheet.prototype.insertRule;\r\n    win.CSSStyleSheet.prototype.insertRule = new Proxy(insertRule, {\r\n        apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n            const [rule, index] = argumentsList;\r\n            const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror);\r\n            if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n                styleSheetRuleCb({\r\n                    id,\r\n                    styleId,\r\n                    adds: [{ rule, index }],\r\n                });\r\n            }\r\n            return target.apply(thisArg, argumentsList);\r\n        }),\r\n    });\r\n    const deleteRule = win.CSSStyleSheet.prototype.deleteRule;\r\n    win.CSSStyleSheet.prototype.deleteRule = new Proxy(deleteRule, {\r\n        apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n            const [index] = argumentsList;\r\n            const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror);\r\n            if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n                styleSheetRuleCb({\r\n                    id,\r\n                    styleId,\r\n                    removes: [{ index }],\r\n                });\r\n            }\r\n            return target.apply(thisArg, argumentsList);\r\n        }),\r\n    });\r\n    let replace;\r\n    if (win.CSSStyleSheet.prototype.replace) {\r\n        replace = win.CSSStyleSheet.prototype.replace;\r\n        win.CSSStyleSheet.prototype.replace = new Proxy(replace, {\r\n            apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n                const [text] = argumentsList;\r\n                const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror);\r\n                if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n                    styleSheetRuleCb({\r\n                        id,\r\n                        styleId,\r\n                        replace: text,\r\n                    });\r\n                }\r\n                return target.apply(thisArg, argumentsList);\r\n            }),\r\n        });\r\n    }\r\n    let replaceSync;\r\n    if (win.CSSStyleSheet.prototype.replaceSync) {\r\n        replaceSync = win.CSSStyleSheet.prototype.replaceSync;\r\n        win.CSSStyleSheet.prototype.replaceSync = new Proxy(replaceSync, {\r\n            apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n                const [text] = argumentsList;\r\n                const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror);\r\n                if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n                    styleSheetRuleCb({\r\n                        id,\r\n                        styleId,\r\n                        replaceSync: text,\r\n                    });\r\n                }\r\n                return target.apply(thisArg, argumentsList);\r\n            }),\r\n        });\r\n    }\r\n    const supportedNestedCSSRuleTypes = {};\r\n    if (canMonkeyPatchNestedCSSRule('CSSGroupingRule')) {\r\n        supportedNestedCSSRuleTypes.CSSGroupingRule = win.CSSGroupingRule;\r\n    }\r\n    else {\r\n        if (canMonkeyPatchNestedCSSRule('CSSMediaRule')) {\r\n            supportedNestedCSSRuleTypes.CSSMediaRule = win.CSSMediaRule;\r\n        }\r\n        if (canMonkeyPatchNestedCSSRule('CSSConditionRule')) {\r\n            supportedNestedCSSRuleTypes.CSSConditionRule = win.CSSConditionRule;\r\n        }\r\n        if (canMonkeyPatchNestedCSSRule('CSSSupportsRule')) {\r\n            supportedNestedCSSRuleTypes.CSSSupportsRule = win.CSSSupportsRule;\r\n        }\r\n    }\r\n    const unmodifiedFunctions = {};\r\n    Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {\r\n        unmodifiedFunctions[typeKey] = {\r\n            insertRule: type.prototype.insertRule,\r\n            deleteRule: type.prototype.deleteRule,\r\n        };\r\n        type.prototype.insertRule = new Proxy(unmodifiedFunctions[typeKey].insertRule, {\r\n            apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n                const [rule, index] = argumentsList;\r\n                const { id, styleId } = getIdAndStyleId(thisArg.parentStyleSheet, mirror, stylesheetManager.styleMirror);\r\n                if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n                    styleSheetRuleCb({\r\n                        id,\r\n                        styleId,\r\n                        adds: [\r\n                            {\r\n                                rule,\r\n                                index: [\r\n                                    ...getNestedCSSRulePositions(thisArg),\r\n                                    index || 0,\r\n                                ],\r\n                            },\r\n                        ],\r\n                    });\r\n                }\r\n                return target.apply(thisArg, argumentsList);\r\n            }),\r\n        });\r\n        type.prototype.deleteRule = new Proxy(unmodifiedFunctions[typeKey].deleteRule, {\r\n            apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n                const [index] = argumentsList;\r\n                const { id, styleId } = getIdAndStyleId(thisArg.parentStyleSheet, mirror, stylesheetManager.styleMirror);\r\n                if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n                    styleSheetRuleCb({\r\n                        id,\r\n                        styleId,\r\n                        removes: [\r\n                            { index: [...getNestedCSSRulePositions(thisArg), index] },\r\n                        ],\r\n                    });\r\n                }\r\n                return target.apply(thisArg, argumentsList);\r\n            }),\r\n        });\r\n    });\r\n    return callbackWrapper(() => {\r\n        win.CSSStyleSheet.prototype.insertRule = insertRule;\r\n        win.CSSStyleSheet.prototype.deleteRule = deleteRule;\r\n        replace && (win.CSSStyleSheet.prototype.replace = replace);\r\n        replaceSync && (win.CSSStyleSheet.prototype.replaceSync = replaceSync);\r\n        Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {\r\n            type.prototype.insertRule = unmodifiedFunctions[typeKey].insertRule;\r\n            type.prototype.deleteRule = unmodifiedFunctions[typeKey].deleteRule;\r\n        });\r\n    });\r\n}\r\nfunction initAdoptedStyleSheetObserver({ mirror, stylesheetManager, }, host) {\r\n    var _a, _b, _c;\r\n    let hostId = null;\r\n    if (host.nodeName === '#document')\r\n        hostId = mirror.getId(host);\r\n    else\r\n        hostId = mirror.getId(host.host);\r\n    const patchTarget = host.nodeName === '#document'\r\n        ? (_a = host.defaultView) === null || _a === void 0 ? void 0 : _a.Document\r\n        : (_c = (_b = host.ownerDocument) === null || _b === void 0 ? void 0 : _b.defaultView) === null || _c === void 0 ? void 0 : _c.ShadowRoot;\r\n    const originalPropertyDescriptor = Object.getOwnPropertyDescriptor(patchTarget === null || patchTarget === void 0 ? void 0 : patchTarget.prototype, 'adoptedStyleSheets');\r\n    if (hostId === null ||\r\n        hostId === -1 ||\r\n        !patchTarget ||\r\n        !originalPropertyDescriptor)\r\n        return () => {\r\n        };\r\n    Object.defineProperty(host, 'adoptedStyleSheets', {\r\n        configurable: originalPropertyDescriptor.configurable,\r\n        enumerable: originalPropertyDescriptor.enumerable,\r\n        get() {\r\n            var _a;\r\n            return (_a = originalPropertyDescriptor.get) === null || _a === void 0 ? void 0 : _a.call(this);\r\n        },\r\n        set(sheets) {\r\n            var _a;\r\n            const result = (_a = originalPropertyDescriptor.set) === null || _a === void 0 ? void 0 : _a.call(this, sheets);\r\n            if (hostId !== null && hostId !== -1) {\r\n                try {\r\n                    stylesheetManager.adoptStyleSheets(sheets, hostId);\r\n                }\r\n                catch (e) {\r\n                }\r\n            }\r\n            return result;\r\n        },\r\n    });\r\n    return callbackWrapper(() => {\r\n        Object.defineProperty(host, 'adoptedStyleSheets', {\r\n            configurable: originalPropertyDescriptor.configurable,\r\n            enumerable: originalPropertyDescriptor.enumerable,\r\n            get: originalPropertyDescriptor.get,\r\n            set: originalPropertyDescriptor.set,\r\n        });\r\n    });\r\n}\r\nfunction initStyleDeclarationObserver({ styleDeclarationCb, mirror, ignoreCSSAttributes, stylesheetManager, }, { win }) {\r\n    const setProperty = win.CSSStyleDeclaration.prototype.setProperty;\r\n    win.CSSStyleDeclaration.prototype.setProperty = new Proxy(setProperty, {\r\n        apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n            var _a;\r\n            const [property, value, priority] = argumentsList;\r\n            if (ignoreCSSAttributes.has(property)) {\r\n                return setProperty.apply(thisArg, [property, value, priority]);\r\n            }\r\n            const { id, styleId } = getIdAndStyleId((_a = thisArg.parentRule) === null || _a === void 0 ? void 0 : _a.parentStyleSheet, mirror, stylesheetManager.styleMirror);\r\n            if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n                styleDeclarationCb({\r\n                    id,\r\n                    styleId,\r\n                    set: {\r\n                        property,\r\n                        value,\r\n                        priority,\r\n                    },\r\n                    index: getNestedCSSRulePositions(thisArg.parentRule),\r\n                });\r\n            }\r\n            return target.apply(thisArg, argumentsList);\r\n        }),\r\n    });\r\n    const removeProperty = win.CSSStyleDeclaration.prototype.removeProperty;\r\n    win.CSSStyleDeclaration.prototype.removeProperty = new Proxy(removeProperty, {\r\n        apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n            var _a;\r\n            const [property] = argumentsList;\r\n            if (ignoreCSSAttributes.has(property)) {\r\n                return removeProperty.apply(thisArg, [property]);\r\n            }\r\n            const { id, styleId } = getIdAndStyleId((_a = thisArg.parentRule) === null || _a === void 0 ? void 0 : _a.parentStyleSheet, mirror, stylesheetManager.styleMirror);\r\n            if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n                styleDeclarationCb({\r\n                    id,\r\n                    styleId,\r\n                    remove: {\r\n                        property,\r\n                    },\r\n                    index: getNestedCSSRulePositions(thisArg.parentRule),\r\n                });\r\n            }\r\n            return target.apply(thisArg, argumentsList);\r\n        }),\r\n    });\r\n    return callbackWrapper(() => {\r\n        win.CSSStyleDeclaration.prototype.setProperty = setProperty;\r\n        win.CSSStyleDeclaration.prototype.removeProperty = removeProperty;\r\n    });\r\n}\r\nfunction initMediaInteractionObserver({ mediaInteractionCb, blockClass, blockSelector, unblockSelector, mirror, sampling, doc, }) {\r\n    const handler = callbackWrapper((type) => throttle(callbackWrapper((event) => {\r\n        const target = getEventTarget(event);\r\n        if (!target ||\r\n            isBlocked(target, blockClass, blockSelector, unblockSelector, true)) {\r\n            return;\r\n        }\r\n        const { currentTime, volume, muted, playbackRate } = target;\r\n        mediaInteractionCb({\r\n            type,\r\n            id: mirror.getId(target),\r\n            currentTime,\r\n            volume,\r\n            muted,\r\n            playbackRate,\r\n        });\r\n    }), sampling.media || 500));\r\n    const handlers = [\r\n        on('play', handler(0), doc),\r\n        on('pause', handler(1), doc),\r\n        on('seeked', handler(2), doc),\r\n        on('volumechange', handler(3), doc),\r\n        on('ratechange', handler(4), doc),\r\n    ];\r\n    return callbackWrapper(() => {\r\n        handlers.forEach((h) => h());\r\n    });\r\n}\r\nfunction initFontObserver({ fontCb, doc }) {\r\n    const win = doc.defaultView;\r\n    if (!win) {\r\n        return () => {\r\n        };\r\n    }\r\n    const handlers = [];\r\n    const fontMap = new WeakMap();\r\n    const originalFontFace = win.FontFace;\r\n    win.FontFace = function FontFace(family, source, descriptors) {\r\n        const fontFace = new originalFontFace(family, source, descriptors);\r\n        fontMap.set(fontFace, {\r\n            family,\r\n            buffer: typeof source !== 'string',\r\n            descriptors,\r\n            fontSource: typeof source === 'string'\r\n                ? source\r\n                : JSON.stringify(Array.from(new Uint8Array(source))),\r\n        });\r\n        return fontFace;\r\n    };\r\n    const restoreHandler = patch(doc.fonts, 'add', function (original) {\r\n        return function (fontFace) {\r\n            setTimeout(callbackWrapper(() => {\r\n                const p = fontMap.get(fontFace);\r\n                if (p) {\r\n                    fontCb(p);\r\n                    fontMap.delete(fontFace);\r\n                }\r\n            }), 0);\r\n            return original.apply(this, [fontFace]);\r\n        };\r\n    });\r\n    handlers.push(() => {\r\n        win.FontFace = originalFontFace;\r\n    });\r\n    handlers.push(restoreHandler);\r\n    return callbackWrapper(() => {\r\n        handlers.forEach((h) => h());\r\n    });\r\n}\r\nfunction initSelectionObserver(param) {\r\n    const { doc, mirror, blockClass, blockSelector, unblockSelector, selectionCb, } = param;\r\n    let collapsed = true;\r\n    const updateSelection = callbackWrapper(() => {\r\n        const selection = doc.getSelection();\r\n        if (!selection || (collapsed && (selection === null || selection === void 0 ? void 0 : selection.isCollapsed)))\r\n            return;\r\n        collapsed = selection.isCollapsed || false;\r\n        const ranges = [];\r\n        const count = selection.rangeCount || 0;\r\n        for (let i = 0; i < count; i++) {\r\n            const range = selection.getRangeAt(i);\r\n            const { startContainer, startOffset, endContainer, endOffset } = range;\r\n            const blocked = isBlocked(startContainer, blockClass, blockSelector, unblockSelector, true) ||\r\n                isBlocked(endContainer, blockClass, blockSelector, unblockSelector, true);\r\n            if (blocked)\r\n                continue;\r\n            ranges.push({\r\n                start: mirror.getId(startContainer),\r\n                startOffset,\r\n                end: mirror.getId(endContainer),\r\n                endOffset,\r\n            });\r\n        }\r\n        selectionCb({ ranges });\r\n    });\r\n    updateSelection();\r\n    return on('selectionchange', updateSelection);\r\n}\r\nfunction initCustomElementObserver({ doc, customElementCb, }) {\r\n    const win = doc.defaultView;\r\n    if (!win || !win.customElements) {\r\n        return () => {\r\n        };\r\n    }\r\n    const restoreHandler = patch(win.customElements, 'define', function (original) {\r\n        return function (name, constructor, options) {\r\n            try {\r\n                customElementCb({\r\n                    define: {\r\n                        name,\r\n                    },\r\n                });\r\n            }\r\n            catch (e) {\r\n            }\r\n            return original.apply(this, [name, constructor, options]);\r\n        };\r\n    });\r\n    return restoreHandler;\r\n}\r\nfunction mergeHooks(o, hooks) {\r\n    const { mutationCb, mousemoveCb, mouseInteractionCb, scrollCb, viewportResizeCb, inputCb, mediaInteractionCb, styleSheetRuleCb, styleDeclarationCb, canvasMutationCb, fontCb, selectionCb, customElementCb, } = o;\r\n    o.mutationCb = (...p) => {\r\n        if (hooks.mutation) {\r\n            hooks.mutation(...p);\r\n        }\r\n        mutationCb(...p);\r\n    };\r\n    o.mousemoveCb = (...p) => {\r\n        if (hooks.mousemove) {\r\n            hooks.mousemove(...p);\r\n        }\r\n        mousemoveCb(...p);\r\n    };\r\n    o.mouseInteractionCb = (...p) => {\r\n        if (hooks.mouseInteraction) {\r\n            hooks.mouseInteraction(...p);\r\n        }\r\n        mouseInteractionCb(...p);\r\n    };\r\n    o.scrollCb = (...p) => {\r\n        if (hooks.scroll) {\r\n            hooks.scroll(...p);\r\n        }\r\n        scrollCb(...p);\r\n    };\r\n    o.viewportResizeCb = (...p) => {\r\n        if (hooks.viewportResize) {\r\n            hooks.viewportResize(...p);\r\n        }\r\n        viewportResizeCb(...p);\r\n    };\r\n    o.inputCb = (...p) => {\r\n        if (hooks.input) {\r\n            hooks.input(...p);\r\n        }\r\n        inputCb(...p);\r\n    };\r\n    o.mediaInteractionCb = (...p) => {\r\n        if (hooks.mediaInteaction) {\r\n            hooks.mediaInteaction(...p);\r\n        }\r\n        mediaInteractionCb(...p);\r\n    };\r\n    o.styleSheetRuleCb = (...p) => {\r\n        if (hooks.styleSheetRule) {\r\n            hooks.styleSheetRule(...p);\r\n        }\r\n        styleSheetRuleCb(...p);\r\n    };\r\n    o.styleDeclarationCb = (...p) => {\r\n        if (hooks.styleDeclaration) {\r\n            hooks.styleDeclaration(...p);\r\n        }\r\n        styleDeclarationCb(...p);\r\n    };\r\n    o.canvasMutationCb = (...p) => {\r\n        if (hooks.canvasMutation) {\r\n            hooks.canvasMutation(...p);\r\n        }\r\n        canvasMutationCb(...p);\r\n    };\r\n    o.fontCb = (...p) => {\r\n        if (hooks.font) {\r\n            hooks.font(...p);\r\n        }\r\n        fontCb(...p);\r\n    };\r\n    o.selectionCb = (...p) => {\r\n        if (hooks.selection) {\r\n            hooks.selection(...p);\r\n        }\r\n        selectionCb(...p);\r\n    };\r\n    o.customElementCb = (...c) => {\r\n        if (hooks.customElement) {\r\n            hooks.customElement(...c);\r\n        }\r\n        customElementCb(...c);\r\n    };\r\n}\r\nfunction initObservers(o, hooks = {}) {\r\n    const currentWindow = o.doc.defaultView;\r\n    if (!currentWindow) {\r\n        return () => {\r\n        };\r\n    }\r\n    mergeHooks(o, hooks);\r\n    const mutationObserver = initMutationObserver(o, o.doc);\r\n    const mousemoveHandler = initMoveObserver(o);\r\n    const mouseInteractionHandler = initMouseInteractionObserver(o);\r\n    const scrollHandler = initScrollObserver(o);\r\n    const viewportResizeHandler = initViewportResizeObserver(o, {\r\n        win: currentWindow,\r\n    });\r\n    const inputHandler = initInputObserver(o);\r\n    const mediaInteractionHandler = initMediaInteractionObserver(o);\r\n    const styleSheetObserver = initStyleSheetObserver(o, { win: currentWindow });\r\n    const adoptedStyleSheetObserver = initAdoptedStyleSheetObserver(o, o.doc);\r\n    const styleDeclarationObserver = initStyleDeclarationObserver(o, {\r\n        win: currentWindow,\r\n    });\r\n    const fontObserver = o.collectFonts\r\n        ? initFontObserver(o)\r\n        : () => {\r\n        };\r\n    const selectionObserver = initSelectionObserver(o);\r\n    const customElementObserver = initCustomElementObserver(o);\r\n    const pluginHandlers = [];\r\n    for (const plugin of o.plugins) {\r\n        pluginHandlers.push(plugin.observer(plugin.callback, currentWindow, plugin.options));\r\n    }\r\n    return callbackWrapper(() => {\r\n        mutationBuffers.forEach((b) => b.reset());\r\n        mutationObserver.disconnect();\r\n        mousemoveHandler();\r\n        mouseInteractionHandler();\r\n        scrollHandler();\r\n        viewportResizeHandler();\r\n        inputHandler();\r\n        mediaInteractionHandler();\r\n        styleSheetObserver();\r\n        adoptedStyleSheetObserver();\r\n        styleDeclarationObserver();\r\n        fontObserver();\r\n        selectionObserver();\r\n        customElementObserver();\r\n        pluginHandlers.forEach((h) => h());\r\n    });\r\n}\r\nfunction hasNestedCSSRule(prop) {\r\n    return typeof window[prop] !== 'undefined';\r\n}\r\nfunction canMonkeyPatchNestedCSSRule(prop) {\r\n    return Boolean(typeof window[prop] !== 'undefined' &&\r\n        window[prop].prototype &&\r\n        'insertRule' in window[prop].prototype &&\r\n        'deleteRule' in window[prop].prototype);\r\n}\n\nexport { INPUT_TAGS, initAdoptedStyleSheetObserver, initMutationObserver, initObservers, initScrollObserver, mutationBuffers };\n","class CrossOriginIframeMirror {\r\n    constructor(generateIdFn) {\r\n        this.generateIdFn = generateIdFn;\r\n        this.iframeIdToRemoteIdMap = new WeakMap();\r\n        this.iframeRemoteIdToIdMap = new WeakMap();\r\n    }\r\n    getId(iframe, remoteId, idToRemoteMap, remoteToIdMap) {\r\n        const idToRemoteIdMap = idToRemoteMap || this.getIdToRemoteIdMap(iframe);\r\n        const remoteIdToIdMap = remoteToIdMap || this.getRemoteIdToIdMap(iframe);\r\n        let id = idToRemoteIdMap.get(remoteId);\r\n        if (!id) {\r\n            id = this.generateIdFn();\r\n            idToRemoteIdMap.set(remoteId, id);\r\n            remoteIdToIdMap.set(id, remoteId);\r\n        }\r\n        return id;\r\n    }\r\n    getIds(iframe, remoteId) {\r\n        const idToRemoteIdMap = this.getIdToRemoteIdMap(iframe);\r\n        const remoteIdToIdMap = this.getRemoteIdToIdMap(iframe);\r\n        return remoteId.map((id) => this.getId(iframe, id, idToRemoteIdMap, remoteIdToIdMap));\r\n    }\r\n    getRemoteId(iframe, id, map) {\r\n        const remoteIdToIdMap = map || this.getRemoteIdToIdMap(iframe);\r\n        if (typeof id !== 'number')\r\n            return id;\r\n        const remoteId = remoteIdToIdMap.get(id);\r\n        if (!remoteId)\r\n            return -1;\r\n        return remoteId;\r\n    }\r\n    getRemoteIds(iframe, ids) {\r\n        const remoteIdToIdMap = this.getRemoteIdToIdMap(iframe);\r\n        return ids.map((id) => this.getRemoteId(iframe, id, remoteIdToIdMap));\r\n    }\r\n    reset(iframe) {\r\n        if (!iframe) {\r\n            this.iframeIdToRemoteIdMap = new WeakMap();\r\n            this.iframeRemoteIdToIdMap = new WeakMap();\r\n            return;\r\n        }\r\n        this.iframeIdToRemoteIdMap.delete(iframe);\r\n        this.iframeRemoteIdToIdMap.delete(iframe);\r\n    }\r\n    getIdToRemoteIdMap(iframe) {\r\n        let idToRemoteIdMap = this.iframeIdToRemoteIdMap.get(iframe);\r\n        if (!idToRemoteIdMap) {\r\n            idToRemoteIdMap = new Map();\r\n            this.iframeIdToRemoteIdMap.set(iframe, idToRemoteIdMap);\r\n        }\r\n        return idToRemoteIdMap;\r\n    }\r\n    getRemoteIdToIdMap(iframe) {\r\n        let remoteIdToIdMap = this.iframeRemoteIdToIdMap.get(iframe);\r\n        if (!remoteIdToIdMap) {\r\n            remoteIdToIdMap = new Map();\r\n            this.iframeRemoteIdToIdMap.set(iframe, remoteIdToIdMap);\r\n        }\r\n        return remoteIdToIdMap;\r\n    }\r\n}\n\nexport { CrossOriginIframeMirror as default };\n","import { genId, NodeType } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport CrossOriginIframeMirror from './cross-origin-iframe-mirror.js';\nimport { EventType, IncrementalSource } from '../../../types/dist/rrweb-types.js';\n\nclass IframeManager {\r\n    constructor(options) {\r\n        this.iframes = new WeakMap();\r\n        this.crossOriginIframeMap = new WeakMap();\r\n        this.crossOriginIframeMirror = new CrossOriginIframeMirror(genId);\r\n        this.crossOriginIframeRootIdMap = new WeakMap();\r\n        this.mutationCb = options.mutationCb;\r\n        this.wrappedEmit = options.wrappedEmit;\r\n        this.stylesheetManager = options.stylesheetManager;\r\n        this.recordCrossOriginIframes = options.recordCrossOriginIframes;\r\n        this.crossOriginIframeStyleMirror = new CrossOriginIframeMirror(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror));\r\n        this.mirror = options.mirror;\r\n        if (this.recordCrossOriginIframes) {\r\n            window.addEventListener('message', this.handleMessage.bind(this));\r\n        }\r\n    }\r\n    addIframe(iframeEl) {\r\n        this.iframes.set(iframeEl, true);\r\n        if (iframeEl.contentWindow)\r\n            this.crossOriginIframeMap.set(iframeEl.contentWindow, iframeEl);\r\n    }\r\n    addLoadListener(cb) {\r\n        this.loadListener = cb;\r\n    }\r\n    attachIframe(iframeEl, childSn) {\r\n        var _a;\r\n        this.mutationCb({\r\n            adds: [\r\n                {\r\n                    parentId: this.mirror.getId(iframeEl),\r\n                    nextId: null,\r\n                    node: childSn,\r\n                },\r\n            ],\r\n            removes: [],\r\n            texts: [],\r\n            attributes: [],\r\n            isAttachIframe: true,\r\n        });\r\n        (_a = this.loadListener) === null || _a === void 0 ? void 0 : _a.call(this, iframeEl);\r\n        if (iframeEl.contentDocument &&\r\n            iframeEl.contentDocument.adoptedStyleSheets &&\r\n            iframeEl.contentDocument.adoptedStyleSheets.length > 0)\r\n            this.stylesheetManager.adoptStyleSheets(iframeEl.contentDocument.adoptedStyleSheets, this.mirror.getId(iframeEl.contentDocument));\r\n    }\r\n    handleMessage(message) {\r\n        const crossOriginMessageEvent = message;\r\n        if (crossOriginMessageEvent.data.type !== 'rrweb' ||\r\n            crossOriginMessageEvent.origin !== crossOriginMessageEvent.data.origin)\r\n            return;\r\n        const iframeSourceWindow = message.source;\r\n        if (!iframeSourceWindow)\r\n            return;\r\n        const iframeEl = this.crossOriginIframeMap.get(message.source);\r\n        if (!iframeEl)\r\n            return;\r\n        const transformedEvent = this.transformCrossOriginEvent(iframeEl, crossOriginMessageEvent.data.event);\r\n        if (transformedEvent)\r\n            this.wrappedEmit(transformedEvent, crossOriginMessageEvent.data.isCheckout);\r\n    }\r\n    transformCrossOriginEvent(iframeEl, e) {\r\n        var _a;\r\n        switch (e.type) {\r\n            case EventType.FullSnapshot: {\r\n                this.crossOriginIframeMirror.reset(iframeEl);\r\n                this.crossOriginIframeStyleMirror.reset(iframeEl);\r\n                this.replaceIdOnNode(e.data.node, iframeEl);\r\n                const rootId = e.data.node.id;\r\n                this.crossOriginIframeRootIdMap.set(iframeEl, rootId);\r\n                this.patchRootIdOnNode(e.data.node, rootId);\r\n                return {\r\n                    timestamp: e.timestamp,\r\n                    type: EventType.IncrementalSnapshot,\r\n                    data: {\r\n                        source: IncrementalSource.Mutation,\r\n                        adds: [\r\n                            {\r\n                                parentId: this.mirror.getId(iframeEl),\r\n                                nextId: null,\r\n                                node: e.data.node,\r\n                            },\r\n                        ],\r\n                        removes: [],\r\n                        texts: [],\r\n                        attributes: [],\r\n                        isAttachIframe: true,\r\n                    },\r\n                };\r\n            }\r\n            case EventType.Meta:\r\n            case EventType.Load:\r\n            case EventType.DomContentLoaded: {\r\n                return false;\r\n            }\r\n            case EventType.Plugin: {\r\n                return e;\r\n            }\r\n            case EventType.Custom: {\r\n                this.replaceIds(e.data.payload, iframeEl, ['id', 'parentId', 'previousId', 'nextId']);\r\n                return e;\r\n            }\r\n            case EventType.IncrementalSnapshot: {\r\n                switch (e.data.source) {\r\n                    case IncrementalSource.Mutation: {\r\n                        e.data.adds.forEach((n) => {\r\n                            this.replaceIds(n, iframeEl, [\r\n                                'parentId',\r\n                                'nextId',\r\n                                'previousId',\r\n                            ]);\r\n                            this.replaceIdOnNode(n.node, iframeEl);\r\n                            const rootId = this.crossOriginIframeRootIdMap.get(iframeEl);\r\n                            rootId && this.patchRootIdOnNode(n.node, rootId);\r\n                        });\r\n                        e.data.removes.forEach((n) => {\r\n                            this.replaceIds(n, iframeEl, ['parentId', 'id']);\r\n                        });\r\n                        e.data.attributes.forEach((n) => {\r\n                            this.replaceIds(n, iframeEl, ['id']);\r\n                        });\r\n                        e.data.texts.forEach((n) => {\r\n                            this.replaceIds(n, iframeEl, ['id']);\r\n                        });\r\n                        return e;\r\n                    }\r\n                    case IncrementalSource.Drag:\r\n                    case IncrementalSource.TouchMove:\r\n                    case IncrementalSource.MouseMove: {\r\n                        e.data.positions.forEach((p) => {\r\n                            this.replaceIds(p, iframeEl, ['id']);\r\n                        });\r\n                        return e;\r\n                    }\r\n                    case IncrementalSource.ViewportResize: {\r\n                        return false;\r\n                    }\r\n                    case IncrementalSource.MediaInteraction:\r\n                    case IncrementalSource.MouseInteraction:\r\n                    case IncrementalSource.Scroll:\r\n                    case IncrementalSource.CanvasMutation:\r\n                    case IncrementalSource.Input: {\r\n                        this.replaceIds(e.data, iframeEl, ['id']);\r\n                        return e;\r\n                    }\r\n                    case IncrementalSource.StyleSheetRule:\r\n                    case IncrementalSource.StyleDeclaration: {\r\n                        this.replaceIds(e.data, iframeEl, ['id']);\r\n                        this.replaceStyleIds(e.data, iframeEl, ['styleId']);\r\n                        return e;\r\n                    }\r\n                    case IncrementalSource.Font: {\r\n                        return e;\r\n                    }\r\n                    case IncrementalSource.Selection: {\r\n                        e.data.ranges.forEach((range) => {\r\n                            this.replaceIds(range, iframeEl, ['start', 'end']);\r\n                        });\r\n                        return e;\r\n                    }\r\n                    case IncrementalSource.AdoptedStyleSheet: {\r\n                        this.replaceIds(e.data, iframeEl, ['id']);\r\n                        this.replaceStyleIds(e.data, iframeEl, ['styleIds']);\r\n                        (_a = e.data.styles) === null || _a === void 0 ? void 0 : _a.forEach((style) => {\r\n                            this.replaceStyleIds(style, iframeEl, ['styleId']);\r\n                        });\r\n                        return e;\r\n                    }\r\n                }\r\n            }\r\n        }\r\n        return false;\r\n    }\r\n    replace(iframeMirror, obj, iframeEl, keys) {\r\n        for (const key of keys) {\r\n            if (!Array.isArray(obj[key]) && typeof obj[key] !== 'number')\r\n                continue;\r\n            if (Array.isArray(obj[key])) {\r\n                obj[key] = iframeMirror.getIds(iframeEl, obj[key]);\r\n            }\r\n            else {\r\n                obj[key] = iframeMirror.getId(iframeEl, obj[key]);\r\n            }\r\n        }\r\n        return obj;\r\n    }\r\n    replaceIds(obj, iframeEl, keys) {\r\n        return this.replace(this.crossOriginIframeMirror, obj, iframeEl, keys);\r\n    }\r\n    replaceStyleIds(obj, iframeEl, keys) {\r\n        return this.replace(this.crossOriginIframeStyleMirror, obj, iframeEl, keys);\r\n    }\r\n    replaceIdOnNode(node, iframeEl) {\r\n        this.replaceIds(node, iframeEl, ['id', 'rootId']);\r\n        if ('childNodes' in node) {\r\n            node.childNodes.forEach((child) => {\r\n                this.replaceIdOnNode(child, iframeEl);\r\n            });\r\n        }\r\n    }\r\n    patchRootIdOnNode(node, rootId) {\r\n        if (node.type !== NodeType.Document && !node.rootId)\r\n            node.rootId = rootId;\r\n        if ('childNodes' in node) {\r\n            node.childNodes.forEach((child) => {\r\n                this.patchRootIdOnNode(child, rootId);\r\n            });\r\n        }\r\n    }\r\n}\n\nexport { IframeManager };\n","import { initMutationObserver, initScrollObserver, initAdoptedStyleSheetObserver } from './observer.js';\nimport { patch, inDom } from '../utils.js';\nimport { isNativeShadowDom } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\n\nclass ShadowDomManager {\r\n    constructor(options) {\r\n        this.shadowDoms = new WeakSet();\r\n        this.restoreHandlers = [];\r\n        this.mutationCb = options.mutationCb;\r\n        this.scrollCb = options.scrollCb;\r\n        this.bypassOptions = options.bypassOptions;\r\n        this.mirror = options.mirror;\r\n        this.init();\r\n    }\r\n    init() {\r\n        this.reset();\r\n        this.patchAttachShadow(Element, document);\r\n    }\r\n    addShadowRoot(shadowRoot, doc) {\r\n        if (!isNativeShadowDom(shadowRoot))\r\n            return;\r\n        if (this.shadowDoms.has(shadowRoot))\r\n            return;\r\n        this.shadowDoms.add(shadowRoot);\r\n        const observer = initMutationObserver(Object.assign(Object.assign({}, this.bypassOptions), { doc, mutationCb: this.mutationCb, mirror: this.mirror, shadowDomManager: this }), shadowRoot);\r\n        this.restoreHandlers.push(() => observer.disconnect());\r\n        this.restoreHandlers.push(initScrollObserver(Object.assign(Object.assign({}, this.bypassOptions), { scrollCb: this.scrollCb, doc: shadowRoot, mirror: this.mirror })));\r\n        setTimeout(() => {\r\n            if (shadowRoot.adoptedStyleSheets &&\r\n                shadowRoot.adoptedStyleSheets.length > 0)\r\n                this.bypassOptions.stylesheetManager.adoptStyleSheets(shadowRoot.adoptedStyleSheets, this.mirror.getId(shadowRoot.host));\r\n            this.restoreHandlers.push(initAdoptedStyleSheetObserver({\r\n                mirror: this.mirror,\r\n                stylesheetManager: this.bypassOptions.stylesheetManager,\r\n            }, shadowRoot));\r\n        }, 0);\r\n    }\r\n    observeAttachShadow(iframeElement) {\r\n        if (!iframeElement.contentWindow || !iframeElement.contentDocument)\r\n            return;\r\n        this.patchAttachShadow(iframeElement.contentWindow.Element, iframeElement.contentDocument);\r\n    }\r\n    patchAttachShadow(element, doc) {\r\n        const manager = this;\r\n        this.restoreHandlers.push(patch(element.prototype, 'attachShadow', function (original) {\r\n            return function (option) {\r\n                const shadowRoot = original.call(this, option);\r\n                if (this.shadowRoot && inDom(this))\r\n                    manager.addShadowRoot(this.shadowRoot, doc);\r\n                return shadowRoot;\r\n            };\r\n        }));\r\n    }\r\n    reset() {\r\n        this.restoreHandlers.forEach((handler) => {\r\n            try {\r\n                handler();\r\n            }\r\n            catch (e) {\r\n            }\r\n        });\r\n        this.restoreHandlers = [];\r\n        this.shadowDoms = new WeakSet();\r\n    }\r\n}\n\nexport { ShadowDomManager };\n","/*\n * base64-arraybuffer 1.0.1 <https://github.com/niklasvh/base64-arraybuffer>\n * Copyright (c) 2021 Niklas von Hertzen <https://hertzen.com>\n * Released under MIT License\n */\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nvar lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (var i = 0; i < chars.length; i++) {\n    lookup[chars.charCodeAt(i)] = i;\n}\nvar encode = function (arraybuffer) {\n    var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';\n    for (i = 0; i < len; i += 3) {\n        base64 += chars[bytes[i] >> 2];\n        base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n        base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n        base64 += chars[bytes[i + 2] & 63];\n    }\n    if (len % 3 === 2) {\n        base64 = base64.substring(0, base64.length - 1) + '=';\n    }\n    else if (len % 3 === 1) {\n        base64 = base64.substring(0, base64.length - 2) + '==';\n    }\n    return base64;\n};\nvar decode = function (base64) {\n    var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;\n    if (base64[base64.length - 1] === '=') {\n        bufferLength--;\n        if (base64[base64.length - 2] === '=') {\n            bufferLength--;\n        }\n    }\n    var arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);\n    for (i = 0; i < len; i += 4) {\n        encoded1 = lookup[base64.charCodeAt(i)];\n        encoded2 = lookup[base64.charCodeAt(i + 1)];\n        encoded3 = lookup[base64.charCodeAt(i + 2)];\n        encoded4 = lookup[base64.charCodeAt(i + 3)];\n        bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n        bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n        bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n    }\n    return arraybuffer;\n};\n\nexport { decode, encode };\n","import { encode } from './../../../../../../ext/base64-arraybuffer/dist/base64-arraybuffer.es5.js';\n\nconst canvasVarMap = new Map();\r\nfunction variableListFor(ctx, ctor) {\r\n    let contextMap = canvasVarMap.get(ctx);\r\n    if (!contextMap) {\r\n        contextMap = new Map();\r\n        canvasVarMap.set(ctx, contextMap);\r\n    }\r\n    if (!contextMap.has(ctor)) {\r\n        contextMap.set(ctor, []);\r\n    }\r\n    return contextMap.get(ctor);\r\n}\r\nconst saveWebGLVar = (value, win, ctx) => {\r\n    if (!value ||\r\n        !(isInstanceOfWebGLObject(value, win) || typeof value === 'object'))\r\n        return;\r\n    const name = value.constructor.name;\r\n    const list = variableListFor(ctx, name);\r\n    let index = list.indexOf(value);\r\n    if (index === -1) {\r\n        index = list.length;\r\n        list.push(value);\r\n    }\r\n    return index;\r\n};\r\nfunction serializeArg(value, win, ctx) {\r\n    if (value instanceof Array) {\r\n        return value.map((arg) => serializeArg(arg, win, ctx));\r\n    }\r\n    else if (value === null) {\r\n        return value;\r\n    }\r\n    else if (value instanceof Float32Array ||\r\n        value instanceof Float64Array ||\r\n        value instanceof Int32Array ||\r\n        value instanceof Uint32Array ||\r\n        value instanceof Uint8Array ||\r\n        value instanceof Uint16Array ||\r\n        value instanceof Int16Array ||\r\n        value instanceof Int8Array ||\r\n        value instanceof Uint8ClampedArray) {\r\n        const name = value.constructor.name;\r\n        return {\r\n            rr_type: name,\r\n            args: [Object.values(value)],\r\n        };\r\n    }\r\n    else if (value instanceof ArrayBuffer) {\r\n        const name = value.constructor.name;\r\n        const base64 = encode(value);\r\n        return {\r\n            rr_type: name,\r\n            base64,\r\n        };\r\n    }\r\n    else if (value instanceof DataView) {\r\n        const name = value.constructor.name;\r\n        return {\r\n            rr_type: name,\r\n            args: [\r\n                serializeArg(value.buffer, win, ctx),\r\n                value.byteOffset,\r\n                value.byteLength,\r\n            ],\r\n        };\r\n    }\r\n    else if (value instanceof HTMLImageElement) {\r\n        const name = value.constructor.name;\r\n        const { src } = value;\r\n        return {\r\n            rr_type: name,\r\n            src,\r\n        };\r\n    }\r\n    else if (value instanceof HTMLCanvasElement) {\r\n        const name = 'HTMLImageElement';\r\n        const src = value.toDataURL();\r\n        return {\r\n            rr_type: name,\r\n            src,\r\n        };\r\n    }\r\n    else if (value instanceof ImageData) {\r\n        const name = value.constructor.name;\r\n        return {\r\n            rr_type: name,\r\n            args: [serializeArg(value.data, win, ctx), value.width, value.height],\r\n        };\r\n    }\r\n    else if (isInstanceOfWebGLObject(value, win) || typeof value === 'object') {\r\n        const name = value.constructor.name;\r\n        const index = saveWebGLVar(value, win, ctx);\r\n        return {\r\n            rr_type: name,\r\n            index: index,\r\n        };\r\n    }\r\n    return value;\r\n}\r\nconst serializeArgs = (args, win, ctx) => {\r\n    return [...args].map((arg) => serializeArg(arg, win, ctx));\r\n};\r\nconst isInstanceOfWebGLObject = (value, win) => {\r\n    const webGLConstructorNames = [\r\n        'WebGLActiveInfo',\r\n        'WebGLBuffer',\r\n        'WebGLFramebuffer',\r\n        'WebGLProgram',\r\n        'WebGLRenderbuffer',\r\n        'WebGLShader',\r\n        'WebGLShaderPrecisionFormat',\r\n        'WebGLTexture',\r\n        'WebGLUniformLocation',\r\n        'WebGLVertexArrayObject',\r\n        'WebGLVertexArrayObjectOES',\r\n    ];\r\n    const supportedWebGLConstructorNames = webGLConstructorNames.filter((name) => typeof win[name] === 'function');\r\n    return Boolean(supportedWebGLConstructorNames.find((name) => value instanceof win[name]));\r\n};\n\nexport { isInstanceOfWebGLObject, saveWebGLVar, serializeArg, serializeArgs, variableListFor };\n","import { patch, isBlocked } from '../../../utils.js';\n\nfunction getNormalizedContextName(contextType) {\r\n    return contextType === 'experimental-webgl' ? 'webgl' : contextType;\r\n}\r\nfunction initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector, setPreserveDrawingBufferToTrue) {\r\n    const handlers = [];\r\n    try {\r\n        const restoreHandler = patch(win.HTMLCanvasElement.prototype, 'getContext', function (original) {\r\n            return function (contextType, ...args) {\r\n                if (!isBlocked(this, blockClass, blockSelector, unblockSelector, true)) {\r\n                    const ctxName = getNormalizedContextName(contextType);\r\n                    if (!('__context' in this))\r\n                        this.__context = ctxName;\r\n                    if (setPreserveDrawingBufferToTrue &&\r\n                        ['webgl', 'webgl2'].includes(ctxName)) {\r\n                        if (args[0] && typeof args[0] === 'object') {\r\n                            const contextAttributes = args[0];\r\n                            if (!contextAttributes.preserveDrawingBuffer) {\r\n                                contextAttributes.preserveDrawingBuffer = true;\r\n                            }\r\n                        }\r\n                        else {\r\n                            args.splice(0, 1, {\r\n                                preserveDrawingBuffer: true,\r\n                            });\r\n                        }\r\n                    }\r\n                }\r\n                return original.apply(this, [contextType, ...args]);\r\n            };\r\n        });\r\n        handlers.push(restoreHandler);\r\n    }\r\n    catch (_a) {\r\n        console.error('failed to patch HTMLCanvasElement.prototype.getContext');\r\n    }\r\n    return () => {\r\n        handlers.forEach((h) => h());\r\n    };\r\n}\n\nexport { initCanvasContextObserver as default };\n","import { CanvasContext } from '../../../../../types/dist/rrweb-types.js';\nimport { patch, isBlocked, hookSetter } from '../../../utils.js';\nimport { saveWebGLVar, serializeArgs } from './serialize-args.js';\n\nfunction patchGLPrototype(prototype, type, cb, blockClass, blockSelector, unblockSelector, mirror, win) {\r\n    const handlers = [];\r\n    const props = Object.getOwnPropertyNames(prototype);\r\n    for (const prop of props) {\r\n        if ([\r\n            'isContextLost',\r\n            'canvas',\r\n            'drawingBufferWidth',\r\n            'drawingBufferHeight',\r\n        ].includes(prop)) {\r\n            continue;\r\n        }\r\n        try {\r\n            if (typeof prototype[prop] !== 'function') {\r\n                continue;\r\n            }\r\n            const restoreHandler = patch(prototype, prop, function (original) {\r\n                return function (...args) {\r\n                    const result = original.apply(this, args);\r\n                    saveWebGLVar(result, win, this);\r\n                    if ('tagName' in this.canvas &&\r\n                        !isBlocked(this.canvas, blockClass, blockSelector, unblockSelector, true)) {\r\n                        const recordArgs = serializeArgs([...args], win, this);\r\n                        const mutation = {\r\n                            type,\r\n                            property: prop,\r\n                            args: recordArgs,\r\n                        };\r\n                        cb(this.canvas, mutation);\r\n                    }\r\n                    return result;\r\n                };\r\n            });\r\n            handlers.push(restoreHandler);\r\n        }\r\n        catch (_a) {\r\n            const hookHandler = hookSetter(prototype, prop, {\r\n                set(v) {\r\n                    cb(this.canvas, {\r\n                        type,\r\n                        property: prop,\r\n                        args: [v],\r\n                        setter: true,\r\n                    });\r\n                },\r\n            });\r\n            handlers.push(hookHandler);\r\n        }\r\n    }\r\n    return handlers;\r\n}\r\nfunction initCanvasWebGLMutationObserver(cb, win, blockClass, blockSelector, unblockSelector, mirror) {\r\n    const handlers = [];\r\n    handlers.push(...patchGLPrototype(win.WebGLRenderingContext.prototype, CanvasContext.WebGL, cb, blockClass, blockSelector, unblockSelector, mirror, win));\r\n    if (typeof win.WebGL2RenderingContext !== 'undefined') {\r\n        handlers.push(...patchGLPrototype(win.WebGL2RenderingContext.prototype, CanvasContext.WebGL2, cb, blockClass, blockSelector, unblockSelector, mirror, win));\r\n    }\r\n    return () => {\r\n        handlers.forEach((h) => h());\r\n    };\r\n}\n\nexport { initCanvasWebGLMutationObserver as default };\n","import { createBase64WorkerFactory } from './_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js';\n\nvar WorkerFactory = createBase64WorkerFactory('Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJT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VuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=', null, false);\n/* eslint-enable */\n\nexport { WorkerFactory as default };\n","function decodeBase64(base64, enableUnicode) {\n    var binaryString = atob(base64);\n    if (enableUnicode) {\n        var binaryView = new Uint8Array(binaryString.length);\n        for (var i = 0, n = binaryString.length; i < n; ++i) {\n            binaryView[i] = binaryString.charCodeAt(i);\n        }\n        return String.fromCharCode.apply(null, new Uint16Array(binaryView.buffer));\n    }\n    return binaryString;\n}\n\nfunction createURL(base64, sourcemapArg, enableUnicodeArg) {\n    var sourcemap = sourcemapArg === undefined ? null : sourcemapArg;\n    var enableUnicode = enableUnicodeArg === undefined ? false : enableUnicodeArg;\n    var source = decodeBase64(base64, enableUnicode);\n    var start = source.indexOf('\\n', 10) + 1;\n    var body = source.substring(start) + (sourcemap ? '\\/\\/# sourceMappingURL=' + sourcemap : '');\n    var blob = new Blob([body], { type: 'application/javascript' });\n    return URL.createObjectURL(blob);\n}\n\nfunction createBase64WorkerFactory(base64, sourcemapArg, enableUnicodeArg) {\n    var url;\n    return function WorkerFactory(options) {\n        url = url || createURL(base64, sourcemapArg, enableUnicodeArg);\n        return new Worker(url, options);\n    };\n}\n\nexport { createBase64WorkerFactory };\n","import { __rest, __awaiter } from './../../../../../../ext/tslib/tslib.es6.js';\nimport { isBlocked } from '../../../utils.js';\nimport { CanvasContext } from '../../../../../types/dist/rrweb-types.js';\nimport initCanvas2DMutationObserver from './2d.js';\nimport initCanvasContextObserver from './canvas.js';\nimport initCanvasWebGLMutationObserver from './webgl.js';\nimport WorkerFactory from '../../../../../../_virtual/image-bitmap-data-url-worker.js';\n\nclass CanvasManager {\r\n    reset() {\r\n        this.pendingCanvasMutations.clear();\r\n        this.resetObservers && this.resetObservers();\r\n    }\r\n    freeze() {\r\n        this.frozen = true;\r\n    }\r\n    unfreeze() {\r\n        this.frozen = false;\r\n    }\r\n    lock() {\r\n        this.locked = true;\r\n    }\r\n    unlock() {\r\n        this.locked = false;\r\n    }\r\n    constructor(options) {\r\n        this.pendingCanvasMutations = new Map();\r\n        this.rafStamps = { latestId: 0, invokeId: null };\r\n        this.frozen = false;\r\n        this.locked = false;\r\n        this.processMutation = (target, mutation) => {\r\n            const newFrame = this.rafStamps.invokeId &&\r\n                this.rafStamps.latestId !== this.rafStamps.invokeId;\r\n            if (newFrame || !this.rafStamps.invokeId)\r\n                this.rafStamps.invokeId = this.rafStamps.latestId;\r\n            if (!this.pendingCanvasMutations.has(target)) {\r\n                this.pendingCanvasMutations.set(target, []);\r\n            }\r\n            this.pendingCanvasMutations.get(target).push(mutation);\r\n        };\r\n        const { sampling = 'all', win, blockClass, blockSelector, unblockSelector, recordCanvas, dataURLOptions, } = options;\r\n        this.mutationCb = options.mutationCb;\r\n        this.mirror = options.mirror;\r\n        if (recordCanvas && sampling === 'all')\r\n            this.initCanvasMutationObserver(win, blockClass, blockSelector, unblockSelector);\r\n        if (recordCanvas && typeof sampling === 'number')\r\n            this.initCanvasFPSObserver(sampling, win, blockClass, blockSelector, unblockSelector, {\r\n                dataURLOptions,\r\n            });\r\n    }\r\n    initCanvasFPSObserver(fps, win, blockClass, blockSelector, unblockSelector, options) {\r\n        const canvasContextReset = initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector, true);\r\n        const snapshotInProgressMap = new Map();\r\n        const worker = new WorkerFactory();\r\n        worker.onmessage = (e) => {\r\n            const { id } = e.data;\r\n            snapshotInProgressMap.set(id, false);\r\n            if (!('base64' in e.data))\r\n                return;\r\n            const { base64, type, width, height } = e.data;\r\n            this.mutationCb({\r\n                id,\r\n                type: CanvasContext['2D'],\r\n                commands: [\r\n                    {\r\n                        property: 'clearRect',\r\n                        args: [0, 0, width, height],\r\n                    },\r\n                    {\r\n                        property: 'drawImage',\r\n                        args: [\r\n                            {\r\n                                rr_type: 'ImageBitmap',\r\n                                args: [\r\n                                    {\r\n                                        rr_type: 'Blob',\r\n                                        data: [{ rr_type: 'ArrayBuffer', base64 }],\r\n                                        type,\r\n                                    },\r\n                                ],\r\n                            },\r\n                            0,\r\n                            0,\r\n                        ],\r\n                    },\r\n                ],\r\n            });\r\n        };\r\n        const timeBetweenSnapshots = 1000 / fps;\r\n        let lastSnapshotTime = 0;\r\n        let rafId;\r\n        const getCanvas = () => {\r\n            const matchedCanvas = [];\r\n            win.document.querySelectorAll('canvas').forEach((canvas) => {\r\n                if (!isBlocked(canvas, blockClass, blockSelector, unblockSelector, true)) {\r\n                    matchedCanvas.push(canvas);\r\n                }\r\n            });\r\n            return matchedCanvas;\r\n        };\r\n        const takeCanvasSnapshots = (timestamp) => {\r\n            if (lastSnapshotTime &&\r\n                timestamp - lastSnapshotTime < timeBetweenSnapshots) {\r\n                rafId = requestAnimationFrame(takeCanvasSnapshots);\r\n                return;\r\n            }\r\n            lastSnapshotTime = timestamp;\r\n            getCanvas()\r\n                .forEach((canvas) => __awaiter(this, void 0, void 0, function* () {\r\n                var _a;\r\n                const id = this.mirror.getId(canvas);\r\n                if (snapshotInProgressMap.get(id))\r\n                    return;\r\n                snapshotInProgressMap.set(id, true);\r\n                if (['webgl', 'webgl2'].includes(canvas.__context)) {\r\n                    const context = canvas.getContext(canvas.__context);\r\n                    if (((_a = context === null || context === void 0 ? void 0 : context.getContextAttributes()) === null || _a === void 0 ? void 0 : _a.preserveDrawingBuffer) === false) {\r\n                        context.clear(context.COLOR_BUFFER_BIT);\r\n                    }\r\n                }\r\n                const bitmap = yield createImageBitmap(canvas);\r\n                worker.postMessage({\r\n                    id,\r\n                    bitmap,\r\n                    width: canvas.width,\r\n                    height: canvas.height,\r\n                    dataURLOptions: options.dataURLOptions,\r\n                }, [bitmap]);\r\n            }));\r\n            rafId = requestAnimationFrame(takeCanvasSnapshots);\r\n        };\r\n        rafId = requestAnimationFrame(takeCanvasSnapshots);\r\n        this.resetObservers = () => {\r\n            canvasContextReset();\r\n            cancelAnimationFrame(rafId);\r\n        };\r\n    }\r\n    initCanvasMutationObserver(win, blockClass, blockSelector, unblockSelector) {\r\n        this.startRAFTimestamping();\r\n        this.startPendingCanvasMutationFlusher();\r\n        const canvasContextReset = initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector, false);\r\n        const canvas2DReset = initCanvas2DMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector, unblockSelector);\r\n        const canvasWebGL1and2Reset = initCanvasWebGLMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector, unblockSelector, this.mirror);\r\n        this.resetObservers = () => {\r\n            canvasContextReset();\r\n            canvas2DReset();\r\n            canvasWebGL1and2Reset();\r\n        };\r\n    }\r\n    startPendingCanvasMutationFlusher() {\r\n        requestAnimationFrame(() => this.flushPendingCanvasMutations());\r\n    }\r\n    startRAFTimestamping() {\r\n        const setLatestRAFTimestamp = (timestamp) => {\r\n            this.rafStamps.latestId = timestamp;\r\n            requestAnimationFrame(setLatestRAFTimestamp);\r\n        };\r\n        requestAnimationFrame(setLatestRAFTimestamp);\r\n    }\r\n    flushPendingCanvasMutations() {\r\n        this.pendingCanvasMutations.forEach((values, canvas) => {\r\n            const id = this.mirror.getId(canvas);\r\n            this.flushPendingCanvasMutationFor(canvas, id);\r\n        });\r\n        requestAnimationFrame(() => this.flushPendingCanvasMutations());\r\n    }\r\n    flushPendingCanvasMutationFor(canvas, id) {\r\n        if (this.frozen || this.locked) {\r\n            return;\r\n        }\r\n        const valuesWithType = this.pendingCanvasMutations.get(canvas);\r\n        if (!valuesWithType || id === -1)\r\n            return;\r\n        const values = valuesWithType.map((value) => {\r\n            const rest = __rest(value, [\"type\"]);\r\n            return rest;\r\n        });\r\n        const { type } = valuesWithType[0];\r\n        this.mutationCb({ id, type, commands: values });\r\n        this.pendingCanvasMutations.delete(canvas);\r\n    }\r\n}\n\nexport { CanvasManager };\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __rest(s, e) {\r\n    var t = {};\r\n    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n        t[p] = s[p];\r\n    if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n                t[p[i]] = s[p[i]];\r\n        }\r\n    return t;\r\n}\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n    return new (P || (P = Promise))(function (resolve, reject) {\r\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n    });\r\n}\n\nexport { __awaiter, __rest };\n","import { CanvasContext } from '../../../../../types/dist/rrweb-types.js';\nimport { patch, isBlocked, hookSetter } from '../../../utils.js';\nimport { serializeArgs } from './serialize-args.js';\n\nfunction initCanvas2DMutationObserver(cb, win, blockClass, blockSelector, unblockSelector) {\r\n    const handlers = [];\r\n    const props2D = Object.getOwnPropertyNames(win.CanvasRenderingContext2D.prototype);\r\n    for (const prop of props2D) {\r\n        try {\r\n            if (typeof win.CanvasRenderingContext2D.prototype[prop] !== 'function') {\r\n                continue;\r\n            }\r\n            const restoreHandler = patch(win.CanvasRenderingContext2D.prototype, prop, function (original) {\r\n                return function (...args) {\r\n                    if (!isBlocked(this.canvas, blockClass, blockSelector, unblockSelector, true)) {\r\n                        setTimeout(() => {\r\n                            const recordArgs = serializeArgs([...args], win, this);\r\n                            cb(this.canvas, {\r\n                                type: CanvasContext['2D'],\r\n                                property: prop,\r\n                                args: recordArgs,\r\n                            });\r\n                        }, 0);\r\n                    }\r\n                    return original.apply(this, args);\r\n                };\r\n            });\r\n            handlers.push(restoreHandler);\r\n        }\r\n        catch (_a) {\r\n            const hookHandler = hookSetter(win.CanvasRenderingContext2D.prototype, prop, {\r\n                set(v) {\r\n                    cb(this.canvas, {\r\n                        type: CanvasContext['2D'],\r\n                        property: prop,\r\n                        args: [v],\r\n                        setter: true,\r\n                    });\r\n                },\r\n            });\r\n            handlers.push(hookHandler);\r\n        }\r\n    }\r\n    return () => {\r\n        handlers.forEach((h) => h());\r\n    };\r\n}\n\nexport { initCanvas2DMutationObserver as default };\n","import { stringifyRule } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport { StyleSheetMirror } from '../utils.js';\n\nclass StylesheetManager {\r\n    constructor(options) {\r\n        this.trackedLinkElements = new WeakSet();\r\n        this.styleMirror = new StyleSheetMirror();\r\n        this.mutationCb = options.mutationCb;\r\n        this.adoptedStyleSheetCb = options.adoptedStyleSheetCb;\r\n    }\r\n    attachLinkElement(linkEl, childSn) {\r\n        if ('_cssText' in childSn.attributes)\r\n            this.mutationCb({\r\n                adds: [],\r\n                removes: [],\r\n                texts: [],\r\n                attributes: [\r\n                    {\r\n                        id: childSn.id,\r\n                        attributes: childSn\r\n                            .attributes,\r\n                    },\r\n                ],\r\n            });\r\n        this.trackLinkElement(linkEl);\r\n    }\r\n    trackLinkElement(linkEl) {\r\n        if (this.trackedLinkElements.has(linkEl))\r\n            return;\r\n        this.trackedLinkElements.add(linkEl);\r\n        this.trackStylesheetInLinkElement(linkEl);\r\n    }\r\n    adoptStyleSheets(sheets, hostId) {\r\n        if (sheets.length === 0)\r\n            return;\r\n        const adoptedStyleSheetData = {\r\n            id: hostId,\r\n            styleIds: [],\r\n        };\r\n        const styles = [];\r\n        for (const sheet of sheets) {\r\n            let styleId;\r\n            if (!this.styleMirror.has(sheet)) {\r\n                styleId = this.styleMirror.add(sheet);\r\n                styles.push({\r\n                    styleId,\r\n                    rules: Array.from(sheet.rules || CSSRule, (r, index) => ({\r\n                        rule: stringifyRule(r),\r\n                        index,\r\n                    })),\r\n                });\r\n            }\r\n            else\r\n                styleId = this.styleMirror.getId(sheet);\r\n            adoptedStyleSheetData.styleIds.push(styleId);\r\n        }\r\n        if (styles.length > 0)\r\n            adoptedStyleSheetData.styles = styles;\r\n        this.adoptedStyleSheetCb(adoptedStyleSheetData);\r\n    }\r\n    reset() {\r\n        this.styleMirror.reset();\r\n        this.trackedLinkElements = new WeakSet();\r\n    }\r\n    trackStylesheetInLinkElement(linkEl) {\r\n    }\r\n}\n\nexport { StylesheetManager };\n","class ProcessedNodeManager {\r\n    constructor() {\r\n        this.nodeMap = new WeakMap();\r\n        this.loop = true;\r\n        this.periodicallyClear();\r\n    }\r\n    periodicallyClear() {\r\n        requestAnimationFrame(() => {\r\n            this.clear();\r\n            if (this.loop)\r\n                this.periodicallyClear();\r\n        });\r\n    }\r\n    inOtherBuffer(node, thisBuffer) {\r\n        const buffers = this.nodeMap.get(node);\r\n        return (buffers && Array.from(buffers).some((buffer) => buffer !== thisBuffer));\r\n    }\r\n    add(node, buffer) {\r\n        this.nodeMap.set(node, (this.nodeMap.get(node) || new Set()).add(buffer));\r\n    }\r\n    clear() {\r\n        this.nodeMap = new WeakMap();\r\n    }\r\n    destroy() {\r\n        this.loop = false;\r\n    }\r\n}\n\nexport { ProcessedNodeManager as default };\n","import { createMirror, snapshot } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport { initObservers, mutationBuffers } from './observer.js';\nimport { polyfill, nowTimestamp, on, getWindowWidth, getWindowHeight, getWindowScroll, isSerializedIframe, isSerializedStylesheet, hasShadowRoot } from '../utils.js';\nimport { EventType, IncrementalSource } from '../../../types/dist/rrweb-types.js';\nimport { IframeManager } from './iframe-manager.js';\nimport { ShadowDomManager } from './shadow-dom-manager.js';\nimport { CanvasManager } from './observers/canvas/canvas-manager.js';\nimport { StylesheetManager } from './stylesheet-manager.js';\nimport ProcessedNodeManager from './processed-node-manager.js';\nimport { callbackWrapper, unregisterErrorHandler, registerErrorHandler } from './error-handler.js';\n\nfunction wrapEvent(e) {\r\n    return Object.assign(Object.assign({}, e), { timestamp: nowTimestamp() });\r\n}\r\nlet wrappedEmit;\r\nlet takeFullSnapshot;\r\nlet canvasManager;\r\nlet recording = false;\r\nconst mirror = createMirror();\r\nfunction record(options = {}) {\r\n    const { emit, checkoutEveryNms, checkoutEveryNth, blockClass = 'rr-block', blockSelector = null, unblockSelector = null, ignoreClass = 'rr-ignore', ignoreSelector = null, maskAllText = false, maskTextClass = 'rr-mask', unmaskTextClass = null, maskTextSelector = null, unmaskTextSelector = null, inlineStylesheet = true, maskAllInputs, maskInputOptions: _maskInputOptions, slimDOMOptions: _slimDOMOptions, maskAttributeFn, maskInputFn, maskTextFn, hooks, packFn, sampling = {}, dataURLOptions = {}, mousemoveWait, recordCanvas = false, recordCrossOriginIframes = false, recordAfter = options.recordAfter === 'DOMContentLoaded'\r\n        ? options.recordAfter\r\n        : 'load', userTriggeredOnInput = false, collectFonts = false, inlineImages = false, plugins, keepIframeSrcFn = () => false, ignoreCSSAttributes = new Set([]), errorHandler, onMutation, } = options;\r\n    registerErrorHandler(errorHandler);\r\n    const inEmittingFrame = recordCrossOriginIframes\r\n        ? window.parent === window\r\n        : true;\r\n    let passEmitsToParent = false;\r\n    if (!inEmittingFrame) {\r\n        try {\r\n            if (window.parent.document) {\r\n                passEmitsToParent = false;\r\n            }\r\n        }\r\n        catch (e) {\r\n            passEmitsToParent = true;\r\n        }\r\n    }\r\n    if (inEmittingFrame && !emit) {\r\n        throw new Error('emit function is required');\r\n    }\r\n    if (mousemoveWait !== undefined && sampling.mousemove === undefined) {\r\n        sampling.mousemove = mousemoveWait;\r\n    }\r\n    mirror.reset();\r\n    const maskInputOptions = maskAllInputs === true\r\n        ? {\r\n            color: true,\r\n            date: true,\r\n            'datetime-local': true,\r\n            email: true,\r\n            month: true,\r\n            number: true,\r\n            range: true,\r\n            search: true,\r\n            tel: true,\r\n            text: true,\r\n            time: true,\r\n            url: true,\r\n            week: true,\r\n            textarea: true,\r\n            select: true,\r\n            radio: true,\r\n            checkbox: true,\r\n        }\r\n        : _maskInputOptions !== undefined\r\n            ? _maskInputOptions\r\n            : {};\r\n    const slimDOMOptions = _slimDOMOptions === true || _slimDOMOptions === 'all'\r\n        ? {\r\n            script: true,\r\n            comment: true,\r\n            headFavicon: true,\r\n            headWhitespace: true,\r\n            headMetaSocial: true,\r\n            headMetaRobots: true,\r\n            headMetaHttpEquiv: true,\r\n            headMetaVerification: true,\r\n            headMetaAuthorship: _slimDOMOptions === 'all',\r\n            headMetaDescKeywords: _slimDOMOptions === 'all',\r\n        }\r\n        : _slimDOMOptions\r\n            ? _slimDOMOptions\r\n            : {};\r\n    polyfill();\r\n    let lastFullSnapshotEvent;\r\n    let incrementalSnapshotCount = 0;\r\n    const eventProcessor = (e) => {\r\n        for (const plugin of plugins || []) {\r\n            if (plugin.eventProcessor) {\r\n                e = plugin.eventProcessor(e);\r\n            }\r\n        }\r\n        if (packFn &&\r\n            !passEmitsToParent) {\r\n            e = packFn(e);\r\n        }\r\n        return e;\r\n    };\r\n    wrappedEmit = (e, isCheckout) => {\r\n        var _a;\r\n        if (((_a = mutationBuffers[0]) === null || _a === void 0 ? void 0 : _a.isFrozen()) &&\r\n            e.type !== EventType.FullSnapshot &&\r\n            !(e.type === EventType.IncrementalSnapshot &&\r\n                e.data.source === IncrementalSource.Mutation)) {\r\n            mutationBuffers.forEach((buf) => buf.unfreeze());\r\n        }\r\n        if (inEmittingFrame) {\r\n            emit === null || emit === void 0 ? void 0 : emit(eventProcessor(e), isCheckout);\r\n        }\r\n        else if (passEmitsToParent) {\r\n            const message = {\r\n                type: 'rrweb',\r\n                event: eventProcessor(e),\r\n                origin: window.location.origin,\r\n                isCheckout,\r\n            };\r\n            window.parent.postMessage(message, '*');\r\n        }\r\n        if (e.type === EventType.FullSnapshot) {\r\n            lastFullSnapshotEvent = e;\r\n            incrementalSnapshotCount = 0;\r\n        }\r\n        else if (e.type === EventType.IncrementalSnapshot) {\r\n            if (e.data.source === IncrementalSource.Mutation &&\r\n                e.data.isAttachIframe) {\r\n                return;\r\n            }\r\n            incrementalSnapshotCount++;\r\n            const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;\r\n            const exceedTime = checkoutEveryNms &&\r\n                e.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;\r\n            if (exceedCount || exceedTime) {\r\n                takeFullSnapshot(true);\r\n            }\r\n        }\r\n    };\r\n    const wrappedMutationEmit = (m) => {\r\n        wrappedEmit(wrapEvent({\r\n            type: EventType.IncrementalSnapshot,\r\n            data: Object.assign({ source: IncrementalSource.Mutation }, m),\r\n        }));\r\n    };\r\n    const wrappedScrollEmit = (p) => wrappedEmit(wrapEvent({\r\n        type: EventType.IncrementalSnapshot,\r\n        data: Object.assign({ source: IncrementalSource.Scroll }, p),\r\n    }));\r\n    const wrappedCanvasMutationEmit = (p) => wrappedEmit(wrapEvent({\r\n        type: EventType.IncrementalSnapshot,\r\n        data: Object.assign({ source: IncrementalSource.CanvasMutation }, p),\r\n    }));\r\n    const wrappedAdoptedStyleSheetEmit = (a) => wrappedEmit(wrapEvent({\r\n        type: EventType.IncrementalSnapshot,\r\n        data: Object.assign({ source: IncrementalSource.AdoptedStyleSheet }, a),\r\n    }));\r\n    const stylesheetManager = new StylesheetManager({\r\n        mutationCb: wrappedMutationEmit,\r\n        adoptedStyleSheetCb: wrappedAdoptedStyleSheetEmit,\r\n    });\r\n    const iframeManager = new IframeManager({\r\n        mirror,\r\n        mutationCb: wrappedMutationEmit,\r\n        stylesheetManager: stylesheetManager,\r\n        recordCrossOriginIframes,\r\n        wrappedEmit,\r\n    });\r\n    for (const plugin of plugins || []) {\r\n        if (plugin.getMirror)\r\n            plugin.getMirror({\r\n                nodeMirror: mirror,\r\n                crossOriginIframeMirror: iframeManager.crossOriginIframeMirror,\r\n                crossOriginIframeStyleMirror: iframeManager.crossOriginIframeStyleMirror,\r\n            });\r\n    }\r\n    const processedNodeManager = new ProcessedNodeManager();\r\n    canvasManager = new CanvasManager({\r\n        recordCanvas,\r\n        mutationCb: wrappedCanvasMutationEmit,\r\n        win: window,\r\n        blockClass,\r\n        blockSelector,\r\n        unblockSelector,\r\n        mirror,\r\n        sampling: sampling.canvas,\r\n        dataURLOptions,\r\n    });\r\n    const shadowDomManager = new ShadowDomManager({\r\n        mutationCb: wrappedMutationEmit,\r\n        scrollCb: wrappedScrollEmit,\r\n        bypassOptions: {\r\n            onMutation,\r\n            blockClass,\r\n            blockSelector,\r\n            unblockSelector,\r\n            maskAllText,\r\n            maskTextClass,\r\n            unmaskTextClass,\r\n            maskTextSelector,\r\n            unmaskTextSelector,\r\n            inlineStylesheet,\r\n            maskInputOptions,\r\n            dataURLOptions,\r\n            maskAttributeFn,\r\n            maskTextFn,\r\n            maskInputFn,\r\n            recordCanvas,\r\n            inlineImages,\r\n            sampling,\r\n            slimDOMOptions,\r\n            iframeManager,\r\n            stylesheetManager,\r\n            canvasManager,\r\n            keepIframeSrcFn,\r\n            processedNodeManager,\r\n        },\r\n        mirror,\r\n    });\r\n    takeFullSnapshot = (isCheckout = false) => {\r\n        wrappedEmit(wrapEvent({\r\n            type: EventType.Meta,\r\n            data: {\r\n                href: window.location.href,\r\n                width: getWindowWidth(),\r\n                height: getWindowHeight(),\r\n            },\r\n        }), isCheckout);\r\n        stylesheetManager.reset();\r\n        shadowDomManager.init();\r\n        mutationBuffers.forEach((buf) => buf.lock());\r\n        const node = snapshot(document, {\r\n            mirror,\r\n            blockClass,\r\n            blockSelector,\r\n            unblockSelector,\r\n            maskAllText,\r\n            maskTextClass,\r\n            unmaskTextClass,\r\n            maskTextSelector,\r\n            unmaskTextSelector,\r\n            inlineStylesheet,\r\n            maskAllInputs: maskInputOptions,\r\n            maskAttributeFn,\r\n            maskInputFn,\r\n            maskTextFn,\r\n            slimDOM: slimDOMOptions,\r\n            dataURLOptions,\r\n            recordCanvas,\r\n            inlineImages,\r\n            onSerialize: (n) => {\r\n                if (isSerializedIframe(n, mirror)) {\r\n                    iframeManager.addIframe(n);\r\n                }\r\n                if (isSerializedStylesheet(n, mirror)) {\r\n                    stylesheetManager.trackLinkElement(n);\r\n                }\r\n                if (hasShadowRoot(n)) {\r\n                    shadowDomManager.addShadowRoot(n.shadowRoot, document);\r\n                }\r\n            },\r\n            onIframeLoad: (iframe, childSn) => {\r\n                iframeManager.attachIframe(iframe, childSn);\r\n                shadowDomManager.observeAttachShadow(iframe);\r\n            },\r\n            onStylesheetLoad: (linkEl, childSn) => {\r\n                stylesheetManager.attachLinkElement(linkEl, childSn);\r\n            },\r\n            keepIframeSrcFn,\r\n        });\r\n        if (!node) {\r\n            return console.warn('Failed to snapshot the document');\r\n        }\r\n        wrappedEmit(wrapEvent({\r\n            type: EventType.FullSnapshot,\r\n            data: {\r\n                node,\r\n                initialOffset: getWindowScroll(window),\r\n            },\r\n        }), isCheckout);\r\n        mutationBuffers.forEach((buf) => buf.unlock());\r\n        if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)\r\n            stylesheetManager.adoptStyleSheets(document.adoptedStyleSheets, mirror.getId(document));\r\n    };\r\n    try {\r\n        const handlers = [];\r\n        const observe = (doc) => {\r\n            var _a;\r\n            return callbackWrapper(initObservers)({\r\n                onMutation,\r\n                mutationCb: wrappedMutationEmit,\r\n                mousemoveCb: (positions, source) => wrappedEmit(wrapEvent({\r\n                    type: EventType.IncrementalSnapshot,\r\n                    data: {\r\n                        source,\r\n                        positions,\r\n                    },\r\n                })),\r\n                mouseInteractionCb: (d) => wrappedEmit(wrapEvent({\r\n                    type: EventType.IncrementalSnapshot,\r\n                    data: Object.assign({ source: IncrementalSource.MouseInteraction }, d),\r\n                })),\r\n                scrollCb: wrappedScrollEmit,\r\n                viewportResizeCb: (d) => wrappedEmit(wrapEvent({\r\n                    type: EventType.IncrementalSnapshot,\r\n                    data: Object.assign({ source: IncrementalSource.ViewportResize }, d),\r\n                })),\r\n                inputCb: (v) => wrappedEmit(wrapEvent({\r\n                    type: EventType.IncrementalSnapshot,\r\n                    data: Object.assign({ source: IncrementalSource.Input }, v),\r\n                })),\r\n                mediaInteractionCb: (p) => wrappedEmit(wrapEvent({\r\n                    type: EventType.IncrementalSnapshot,\r\n                    data: Object.assign({ source: IncrementalSource.MediaInteraction }, p),\r\n                })),\r\n                styleSheetRuleCb: (r) => wrappedEmit(wrapEvent({\r\n                    type: EventType.IncrementalSnapshot,\r\n                    data: Object.assign({ source: IncrementalSource.StyleSheetRule }, r),\r\n                })),\r\n                styleDeclarationCb: (r) => wrappedEmit(wrapEvent({\r\n                    type: EventType.IncrementalSnapshot,\r\n                    data: Object.assign({ source: IncrementalSource.StyleDeclaration }, r),\r\n                })),\r\n                canvasMutationCb: wrappedCanvasMutationEmit,\r\n                fontCb: (p) => wrappedEmit(wrapEvent({\r\n                    type: EventType.IncrementalSnapshot,\r\n                    data: Object.assign({ source: IncrementalSource.Font }, p),\r\n                })),\r\n                selectionCb: (p) => {\r\n                    wrappedEmit(wrapEvent({\r\n                        type: EventType.IncrementalSnapshot,\r\n                        data: Object.assign({ source: IncrementalSource.Selection }, p),\r\n                    }));\r\n                },\r\n                customElementCb: (c) => {\r\n                    wrappedEmit(wrapEvent({\r\n                        type: EventType.IncrementalSnapshot,\r\n                        data: Object.assign({ source: IncrementalSource.CustomElement }, c),\r\n                    }));\r\n                },\r\n                blockClass,\r\n                ignoreClass,\r\n                ignoreSelector,\r\n                maskAllText,\r\n                maskTextClass,\r\n                unmaskTextClass,\r\n                maskTextSelector,\r\n                unmaskTextSelector,\r\n                maskInputOptions,\r\n                inlineStylesheet,\r\n                sampling,\r\n                recordCanvas,\r\n                inlineImages,\r\n                userTriggeredOnInput,\r\n                collectFonts,\r\n                doc,\r\n                maskAttributeFn,\r\n                maskInputFn,\r\n                maskTextFn,\r\n                keepIframeSrcFn,\r\n                blockSelector,\r\n                unblockSelector,\r\n                slimDOMOptions,\r\n                dataURLOptions,\r\n                mirror,\r\n                iframeManager,\r\n                stylesheetManager,\r\n                shadowDomManager,\r\n                processedNodeManager,\r\n                canvasManager,\r\n                ignoreCSSAttributes,\r\n                plugins: ((_a = plugins === null || plugins === void 0 ? void 0 : plugins.filter((p) => p.observer)) === null || _a === void 0 ? void 0 : _a.map((p) => ({\r\n                    observer: p.observer,\r\n                    options: p.options,\r\n                    callback: (payload) => wrappedEmit(wrapEvent({\r\n                        type: EventType.Plugin,\r\n                        data: {\r\n                            plugin: p.name,\r\n                            payload,\r\n                        },\r\n                    })),\r\n                }))) || [],\r\n            }, hooks);\r\n        };\r\n        iframeManager.addLoadListener((iframeEl) => {\r\n            try {\r\n                handlers.push(observe(iframeEl.contentDocument));\r\n            }\r\n            catch (error) {\r\n                console.warn(error);\r\n            }\r\n        });\r\n        const init = () => {\r\n            takeFullSnapshot();\r\n            handlers.push(observe(document));\r\n            recording = true;\r\n        };\r\n        if (document.readyState === 'interactive' ||\r\n            document.readyState === 'complete') {\r\n            init();\r\n        }\r\n        else {\r\n            handlers.push(on('DOMContentLoaded', () => {\r\n                wrappedEmit(wrapEvent({\r\n                    type: EventType.DomContentLoaded,\r\n                    data: {},\r\n                }));\r\n                if (recordAfter === 'DOMContentLoaded')\r\n                    init();\r\n            }));\r\n            handlers.push(on('load', () => {\r\n                wrappedEmit(wrapEvent({\r\n                    type: EventType.Load,\r\n                    data: {},\r\n                }));\r\n                if (recordAfter === 'load')\r\n                    init();\r\n            }, window));\r\n        }\r\n        return () => {\r\n            handlers.forEach((h) => h());\r\n            processedNodeManager.destroy();\r\n            recording = false;\r\n            unregisterErrorHandler();\r\n        };\r\n    }\r\n    catch (error) {\r\n        console.warn(error);\r\n    }\r\n}\r\nrecord.addCustomEvent = (tag, payload) => {\r\n    if (!recording) {\r\n        throw new Error('please add custom event after start recording');\r\n    }\r\n    wrappedEmit(wrapEvent({\r\n        type: EventType.Custom,\r\n        data: {\r\n            tag,\r\n            payload,\r\n        },\r\n    }));\r\n};\r\nrecord.freezePage = () => {\r\n    mutationBuffers.forEach((buf) => buf.freeze());\r\n};\r\nrecord.takeFullSnapshot = (isCheckout) => {\r\n    if (!recording) {\r\n        throw new Error('please take full snapshot after start recording');\r\n    }\r\n    takeFullSnapshot(isCheckout);\r\n};\r\nrecord.mirror = mirror;\n\nexport { record as default };\n","/**\n * Converts a timestamp to ms, if it was in s, or keeps it as ms.\n */\nexport function timestampToMs(timestamp: number): number {\n  const isMs = timestamp > 9999999999;\n  return isMs ? timestamp : timestamp * 1000;\n}\n\n/**\n * Converts a timestamp to s, if it was in ms, or keeps it as s.\n */\nexport function timestampToS(timestamp: number): number {\n  const isMs = timestamp > 9999999999;\n  return isMs ? timestamp / 1000 : timestamp;\n}\n","import { EventType } from '@sentry-internal/rrweb';\nimport type { Breadcrumb } from '@sentry/types';\nimport { normalize } from '@sentry/utils';\n\nimport type { ReplayContainer } from '../../types';\n\n/**\n * Add a breadcrumb event to replay.\n */\nexport function addBreadcrumbEvent(replay: ReplayContainer, breadcrumb: Breadcrumb): void {\n  if (breadcrumb.category === 'sentry.transaction') {\n    return;\n  }\n\n  if (['ui.click', 'ui.input'].includes(breadcrumb.category as string)) {\n    replay.triggerUserActivity();\n  } else {\n    replay.checkAndHandleExpiredSession();\n  }\n\n  replay.addUpdate(() => {\n    void replay.throttledAddEvent({\n      type: EventType.Custom,\n      // TODO: We were converting from ms to seconds for breadcrumbs, spans,\n      // but maybe we should just keep them as milliseconds\n      timestamp: (breadcrumb.timestamp || 0) * 1000,\n      data: {\n        tag: 'breadcrumb',\n        // normalize to max. 10 depth and 1_000 properties per object\n        payload: normalize(breadcrumb, 10, 1_000),\n      },\n    });\n\n    // Do not flush after console log messages\n    return breadcrumb.category === 'console';\n  });\n}\n","import type { INode } from '@sentry-internal/rrweb-snapshot';\n\nexport interface DomHandlerData {\n  name: string;\n  event: Node | { target: EventTarget };\n}\n\nconst INTERACTIVE_SELECTOR = 'button,a';\n\n/**\n * For clicks, we check if the target is inside of a button or link\n * If so, we use this as the target instead\n * This is useful because if you click on the image in <button><img></button>,\n * The target will be the image, not the button, which we don't want here\n */\nexport function getClickTargetNode(event: DomHandlerData['event'] | MouseEvent): Node | INode | null {\n  const target = getTargetNode(event);\n\n  if (!target || !(target instanceof Element)) {\n    return target;\n  }\n\n  const closestInteractive = target.closest(INTERACTIVE_SELECTOR);\n  return closestInteractive || target;\n}\n\n/** Get the event target node. */\nexport function getTargetNode(event: Node | { target: EventTarget | null }): Node | INode | null {\n  if (isEventWithTarget(event)) {\n    return event.target as Node | null;\n  }\n\n  return event;\n}\n\nfunction isEventWithTarget(event: unknown): event is { target: EventTarget | null } {\n  return typeof event === 'object' && !!event && 'target' in event;\n}\n","import { fill } from '@sentry/utils';\n\nimport { WINDOW } from '../../constants';\n\ntype WindowOpenHandler = () => void;\n\nlet handlers: undefined | WindowOpenHandler[];\n\n/**\n * Register a handler to be called when `window.open()` is called.\n * Returns a cleanup function.\n */\nexport function onWindowOpen(cb: WindowOpenHandler): () => void {\n  // Ensure to only register this once\n  if (!handlers) {\n    handlers = [];\n    monkeyPatchWindowOpen();\n  }\n\n  handlers.push(cb);\n\n  return () => {\n    const pos = handlers ? handlers.indexOf(cb) : -1;\n    if (pos > -1) {\n      (handlers as WindowOpenHandler[]).splice(pos, 1);\n    }\n  };\n}\n\nfunction monkeyPatchWindowOpen(): void {\n  fill(WINDOW, 'open', function (originalWindowOpen: () => void): () => void {\n    return function (...args: unknown[]): void {\n      if (handlers) {\n        try {\n          handlers.forEach(handler => handler());\n        } catch (e) {\n          // ignore errors in here\n        }\n      }\n\n      return originalWindowOpen.apply(WINDOW, args);\n    };\n  });\n}\n","import type { Breadcrumb } from '@sentry/types';\n\nimport { WINDOW } from '../constants';\nimport type {\n  ReplayClickDetector,\n  ReplayContainer,\n  ReplayMultiClickFrame,\n  ReplaySlowClickFrame,\n  SlowClickConfig,\n} from '../types';\nimport { timestampToS } from '../util/timestamp';\nimport { addBreadcrumbEvent } from './util/addBreadcrumbEvent';\nimport { getClickTargetNode } from './util/domUtils';\nimport { onWindowOpen } from './util/onWindowOpen';\n\ntype ClickBreadcrumb = Breadcrumb & {\n  timestamp: number;\n};\n\ninterface Click {\n  timestamp: number;\n  mutationAfter?: number;\n  scrollAfter?: number;\n  clickBreadcrumb: ClickBreadcrumb;\n  clickCount: number;\n  node: HTMLElement;\n}\n\n/** Handle a click. */\nexport function handleClick(clickDetector: ReplayClickDetector, clickBreadcrumb: Breadcrumb, node: HTMLElement): void {\n  clickDetector.handleClick(clickBreadcrumb, node);\n}\n\n/** A click detector class that can be used to detect slow or rage clicks on elements. */\nexport class ClickDetector implements ReplayClickDetector {\n  // protected for testing\n  protected _lastMutation: number;\n  protected _lastScroll: number;\n\n  private _clicks: Click[];\n  private _teardown: undefined | (() => void);\n\n  private _threshold: number;\n  private _scollTimeout: number;\n  private _timeout: number;\n  private _ignoreSelector: string;\n\n  private _replay: ReplayContainer;\n  private _checkClickTimeout?: ReturnType<typeof setTimeout>;\n  private _addBreadcrumbEvent: typeof addBreadcrumbEvent;\n\n  public constructor(\n    replay: ReplayContainer,\n    slowClickConfig: SlowClickConfig,\n    // Just for easier testing\n    _addBreadcrumbEvent = addBreadcrumbEvent,\n  ) {\n    this._lastMutation = 0;\n    this._lastScroll = 0;\n    this._clicks = [];\n\n    // We want everything in s, but options are in ms\n    this._timeout = slowClickConfig.timeout / 1000;\n    this._threshold = slowClickConfig.threshold / 1000;\n    this._scollTimeout = slowClickConfig.scrollTimeout / 1000;\n    this._replay = replay;\n    this._ignoreSelector = slowClickConfig.ignoreSelector;\n    this._addBreadcrumbEvent = _addBreadcrumbEvent;\n  }\n\n  /** Register click detection handlers on mutation or scroll. */\n  public addListeners(): void {\n    const mutationHandler = (): void => {\n      this._lastMutation = nowInSeconds();\n    };\n\n    const scrollHandler = (): void => {\n      this._lastScroll = nowInSeconds();\n    };\n\n    const cleanupWindowOpen = onWindowOpen(() => {\n      // Treat window.open as mutation\n      this._lastMutation = nowInSeconds();\n    });\n\n    const clickHandler = (event: MouseEvent): void => {\n      if (!event.target) {\n        return;\n      }\n\n      const node = getClickTargetNode(event);\n      if (node) {\n        this._handleMultiClick(node as HTMLElement);\n      }\n    };\n\n    const obs = new MutationObserver(mutationHandler);\n\n    obs.observe(WINDOW.document.documentElement, {\n      attributes: true,\n      characterData: true,\n      childList: true,\n      subtree: true,\n    });\n\n    WINDOW.addEventListener('scroll', scrollHandler, { passive: true });\n    WINDOW.addEventListener('click', clickHandler, { passive: true });\n\n    this._teardown = () => {\n      WINDOW.removeEventListener('scroll', scrollHandler);\n      WINDOW.removeEventListener('click', clickHandler);\n      cleanupWindowOpen();\n\n      obs.disconnect();\n      this._clicks = [];\n      this._lastMutation = 0;\n      this._lastScroll = 0;\n    };\n  }\n\n  /** Clean up listeners. */\n  public removeListeners(): void {\n    if (this._teardown) {\n      this._teardown();\n    }\n\n    if (this._checkClickTimeout) {\n      clearTimeout(this._checkClickTimeout);\n    }\n  }\n\n  /** Handle a click */\n  public handleClick(breadcrumb: Breadcrumb, node: HTMLElement): void {\n    if (ignoreElement(node, this._ignoreSelector) || !isClickBreadcrumb(breadcrumb)) {\n      return;\n    }\n\n    const newClick: Click = {\n      timestamp: timestampToS(breadcrumb.timestamp),\n      clickBreadcrumb: breadcrumb,\n      // Set this to 0 so we know it originates from the click breadcrumb\n      clickCount: 0,\n      node,\n    };\n\n    // If there was a click in the last 1s on the same element, ignore it - only keep a single reference per second\n    if (\n      this._clicks.some(click => click.node === newClick.node && Math.abs(click.timestamp - newClick.timestamp) < 1)\n    ) {\n      return;\n    }\n\n    this._clicks.push(newClick);\n\n    // If this is the first new click, set a timeout to check for multi clicks\n    if (this._clicks.length === 1) {\n      this._scheduleCheckClicks();\n    }\n  }\n\n  /** Count multiple clicks on elements. */\n  private _handleMultiClick(node: HTMLElement): void {\n    this._getClicks(node).forEach(click => {\n      click.clickCount++;\n    });\n  }\n\n  /** Get all pending clicks for a given node. */\n  private _getClicks(node: HTMLElement): Click[] {\n    return this._clicks.filter(click => click.node === node);\n  }\n\n  /** Check the clicks that happened. */\n  private _checkClicks(): void {\n    const timedOutClicks: Click[] = [];\n\n    const now = nowInSeconds();\n\n    this._clicks.forEach(click => {\n      if (!click.mutationAfter && this._lastMutation) {\n        click.mutationAfter = click.timestamp <= this._lastMutation ? this._lastMutation - click.timestamp : undefined;\n      }\n      if (!click.scrollAfter && this._lastScroll) {\n        click.scrollAfter = click.timestamp <= this._lastScroll ? this._lastScroll - click.timestamp : undefined;\n      }\n\n      // All of these are in seconds!\n      if (click.timestamp + this._timeout <= now) {\n        timedOutClicks.push(click);\n      }\n    });\n\n    // Remove \"old\" clicks\n    for (const click of timedOutClicks) {\n      const pos = this._clicks.indexOf(click);\n\n      if (pos > -1) {\n        this._generateBreadcrumbs(click);\n        this._clicks.splice(pos, 1);\n      }\n    }\n\n    // Trigger new check, unless no clicks left\n    if (this._clicks.length) {\n      this._scheduleCheckClicks();\n    }\n  }\n\n  /** Generate matching breadcrumb(s) for the click. */\n  private _generateBreadcrumbs(click: Click): void {\n    const replay = this._replay;\n    const hadScroll = click.scrollAfter && click.scrollAfter <= this._scollTimeout;\n    const hadMutation = click.mutationAfter && click.mutationAfter <= this._threshold;\n\n    const isSlowClick = !hadScroll && !hadMutation;\n    const { clickCount, clickBreadcrumb } = click;\n\n    // Slow click\n    if (isSlowClick) {\n      // If `mutationAfter` is set, it means a mutation happened after the threshold, but before the timeout\n      // If not, it means we just timed out without scroll & mutation\n      const timeAfterClickMs = Math.min(click.mutationAfter || this._timeout, this._timeout) * 1000;\n      const endReason = timeAfterClickMs < this._timeout * 1000 ? 'mutation' : 'timeout';\n\n      const breadcrumb: ReplaySlowClickFrame = {\n        type: 'default',\n        message: clickBreadcrumb.message,\n        timestamp: clickBreadcrumb.timestamp,\n        category: 'ui.slowClickDetected',\n        data: {\n          ...clickBreadcrumb.data,\n          url: WINDOW.location.href,\n          route: replay.getCurrentRoute(),\n          timeAfterClickMs,\n          endReason,\n          // If clickCount === 0, it means multiClick was not correctly captured here\n          // - we still want to send 1 in this case\n          clickCount: clickCount || 1,\n        },\n      };\n\n      this._addBreadcrumbEvent(replay, breadcrumb);\n      return;\n    }\n\n    // Multi click\n    if (clickCount > 1) {\n      const breadcrumb: ReplayMultiClickFrame = {\n        type: 'default',\n        message: clickBreadcrumb.message,\n        timestamp: clickBreadcrumb.timestamp,\n        category: 'ui.multiClick',\n        data: {\n          ...clickBreadcrumb.data,\n          url: WINDOW.location.href,\n          route: replay.getCurrentRoute(),\n          clickCount,\n          metric: true,\n        },\n      };\n\n      this._addBreadcrumbEvent(replay, breadcrumb);\n    }\n  }\n\n  /** Schedule to check current clicks. */\n  private _scheduleCheckClicks(): void {\n    if (this._checkClickTimeout) {\n      clearTimeout(this._checkClickTimeout);\n    }\n\n    this._checkClickTimeout = setTimeout(() => this._checkClicks(), 1000);\n  }\n}\n\nconst SLOW_CLICK_TAGS = ['A', 'BUTTON', 'INPUT'];\n\n/** exported for tests only */\nexport function ignoreElement(node: HTMLElement, ignoreSelector: string): boolean {\n  if (!SLOW_CLICK_TAGS.includes(node.tagName)) {\n    return true;\n  }\n\n  // If <input> tag, we only want to consider input[type='submit'] & input[type='button']\n  if (node.tagName === 'INPUT' && !['submit', 'button'].includes(node.getAttribute('type') || '')) {\n    return true;\n  }\n\n  // If <a> tag, detect special variants that may not lead to an action\n  // If target !== _self, we may open the link somewhere else, which would lead to no action\n  // Also, when downloading a file, we may not leave the page, but still not trigger an action\n  if (\n    node.tagName === 'A' &&\n    (node.hasAttribute('download') || (node.hasAttribute('target') && node.getAttribute('target') !== '_self'))\n  ) {\n    return true;\n  }\n\n  if (ignoreSelector && node.matches(ignoreSelector)) {\n    return true;\n  }\n\n  return false;\n}\n\nfunction isClickBreadcrumb(breadcrumb: Breadcrumb): breadcrumb is ClickBreadcrumb {\n  return !!(breadcrumb.data && typeof breadcrumb.data.nodeId === 'number' && breadcrumb.timestamp);\n}\n\n// This is good enough for us, and is easier to test/mock than `timestampInSeconds`\nfunction nowInSeconds(): number {\n  return Date.now() / 1000;\n}\n","import type { ReplayBreadcrumbFrame } from '../types/replayFrame';\n\n/**\n * Create a breadcrumb for a replay.\n */\nexport function createBreadcrumb(\n  breadcrumb: Omit<ReplayBreadcrumbFrame, 'timestamp' | 'type'> & Partial<Pick<ReplayBreadcrumbFrame, 'timestamp'>>,\n): ReplayBreadcrumbFrame {\n  return {\n    timestamp: Date.now() / 1000,\n    type: 'default',\n    ...breadcrumb,\n  };\n}\n","var NodeType;\r\n(function (NodeType) {\r\n    NodeType[NodeType[\"Document\"] = 0] = \"Document\";\r\n    NodeType[NodeType[\"DocumentType\"] = 1] = \"DocumentType\";\r\n    NodeType[NodeType[\"Element\"] = 2] = \"Element\";\r\n    NodeType[NodeType[\"Text\"] = 3] = \"Text\";\r\n    NodeType[NodeType[\"CDATA\"] = 4] = \"CDATA\";\r\n    NodeType[NodeType[\"Comment\"] = 5] = \"Comment\";\r\n})(NodeType || (NodeType = {}));\n\nfunction isElement(n) {\r\n    return n.nodeType === n.ELEMENT_NODE;\r\n}\r\nfunction isShadowRoot(n) {\r\n    const host = n === null || n === void 0 ? void 0 : n.host;\r\n    return Boolean((host === null || host === void 0 ? void 0 : host.shadowRoot) === n);\r\n}\r\nfunction isNativeShadowDom(shadowRoot) {\r\n    return Object.prototype.toString.call(shadowRoot) === '[object ShadowRoot]';\r\n}\r\nfunction fixBrowserCompatibilityIssuesInCSS(cssText) {\r\n    if (cssText.includes(' background-clip: text;') &&\r\n        !cssText.includes(' -webkit-background-clip: text;')) {\r\n        cssText = cssText.replace(' background-clip: text;', ' -webkit-background-clip: text; background-clip: text;');\r\n    }\r\n    return cssText;\r\n}\r\nfunction escapeImportStatement(rule) {\r\n    const { cssText } = rule;\r\n    if (cssText.split('\"').length < 3)\r\n        return cssText;\r\n    const statement = ['@import', `url(${JSON.stringify(rule.href)})`];\r\n    if (rule.layerName === '') {\r\n        statement.push(`layer`);\r\n    }\r\n    else if (rule.layerName) {\r\n        statement.push(`layer(${rule.layerName})`);\r\n    }\r\n    if (rule.supportsText) {\r\n        statement.push(`supports(${rule.supportsText})`);\r\n    }\r\n    if (rule.media.length) {\r\n        statement.push(rule.media.mediaText);\r\n    }\r\n    return statement.join(' ') + ';';\r\n}\r\nfunction stringifyStylesheet(s) {\r\n    try {\r\n        const rules = s.rules || s.cssRules;\r\n        return rules\r\n            ? fixBrowserCompatibilityIssuesInCSS(Array.from(rules, stringifyRule).join(''))\r\n            : null;\r\n    }\r\n    catch (error) {\r\n        return null;\r\n    }\r\n}\r\nfunction stringifyRule(rule) {\r\n    let importStringified;\r\n    if (isCSSImportRule(rule)) {\r\n        try {\r\n            importStringified =\r\n                stringifyStylesheet(rule.styleSheet) ||\r\n                    escapeImportStatement(rule);\r\n        }\r\n        catch (error) {\r\n        }\r\n    }\r\n    else if (isCSSStyleRule(rule) && rule.selectorText.includes(':')) {\r\n        return fixSafariColons(rule.cssText);\r\n    }\r\n    return importStringified || rule.cssText;\r\n}\r\nfunction fixSafariColons(cssStringified) {\r\n    const regex = /(\\[(?:[\\w-]+)[^\\\\])(:(?:[\\w-]+)\\])/gm;\r\n    return cssStringified.replace(regex, '$1\\\\$2');\r\n}\r\nfunction isCSSImportRule(rule) {\r\n    return 'styleSheet' in rule;\r\n}\r\nfunction isCSSStyleRule(rule) {\r\n    return 'selectorText' in rule;\r\n}\r\nclass Mirror {\r\n    constructor() {\r\n        this.idNodeMap = new Map();\r\n        this.nodeMetaMap = new WeakMap();\r\n    }\r\n    getId(n) {\r\n        var _a;\r\n        if (!n)\r\n            return -1;\r\n        const id = (_a = this.getMeta(n)) === null || _a === void 0 ? void 0 : _a.id;\r\n        return id !== null && id !== void 0 ? id : -1;\r\n    }\r\n    getNode(id) {\r\n        return this.idNodeMap.get(id) || null;\r\n    }\r\n    getIds() {\r\n        return Array.from(this.idNodeMap.keys());\r\n    }\r\n    getMeta(n) {\r\n        return this.nodeMetaMap.get(n) || null;\r\n    }\r\n    removeNodeFromMap(n) {\r\n        const id = this.getId(n);\r\n        this.idNodeMap.delete(id);\r\n        if (n.childNodes) {\r\n            n.childNodes.forEach((childNode) => this.removeNodeFromMap(childNode));\r\n        }\r\n    }\r\n    has(id) {\r\n        return this.idNodeMap.has(id);\r\n    }\r\n    hasNode(node) {\r\n        return this.nodeMetaMap.has(node);\r\n    }\r\n    add(n, meta) {\r\n        const id = meta.id;\r\n        this.idNodeMap.set(id, n);\r\n        this.nodeMetaMap.set(n, meta);\r\n    }\r\n    replace(id, n) {\r\n        const oldNode = this.getNode(id);\r\n        if (oldNode) {\r\n            const meta = this.nodeMetaMap.get(oldNode);\r\n            if (meta)\r\n                this.nodeMetaMap.set(n, meta);\r\n        }\r\n        this.idNodeMap.set(id, n);\r\n    }\r\n    reset() {\r\n        this.idNodeMap = new Map();\r\n        this.nodeMetaMap = new WeakMap();\r\n    }\r\n}\r\nfunction createMirror() {\r\n    return new Mirror();\r\n}\r\nfunction shouldMaskInput({ maskInputOptions, tagName, type, }) {\r\n    if (tagName === 'OPTION') {\r\n        tagName = 'SELECT';\r\n    }\r\n    return Boolean(maskInputOptions[tagName.toLowerCase()] ||\r\n        (type && maskInputOptions[type]) ||\r\n        type === 'password' ||\r\n        (tagName === 'INPUT' && !type && maskInputOptions['text']));\r\n}\r\nfunction maskInputValue({ isMasked, element, value, maskInputFn, }) {\r\n    let text = value || '';\r\n    if (!isMasked) {\r\n        return text;\r\n    }\r\n    if (maskInputFn) {\r\n        text = maskInputFn(text, element);\r\n    }\r\n    return '*'.repeat(text.length);\r\n}\r\nfunction toLowerCase(str) {\r\n    return str.toLowerCase();\r\n}\r\nfunction toUpperCase(str) {\r\n    return str.toUpperCase();\r\n}\r\nconst ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';\r\nfunction is2DCanvasBlank(canvas) {\r\n    const ctx = canvas.getContext('2d');\r\n    if (!ctx)\r\n        return true;\r\n    const chunkSize = 50;\r\n    for (let x = 0; x < canvas.width; x += chunkSize) {\r\n        for (let y = 0; y < canvas.height; y += chunkSize) {\r\n            const getImageData = ctx.getImageData;\r\n            const originalGetImageData = ORIGINAL_ATTRIBUTE_NAME in getImageData\r\n                ? getImageData[ORIGINAL_ATTRIBUTE_NAME]\r\n                : getImageData;\r\n            const pixelBuffer = new Uint32Array(originalGetImageData.call(ctx, x, y, Math.min(chunkSize, canvas.width - x), Math.min(chunkSize, canvas.height - y)).data.buffer);\r\n            if (pixelBuffer.some((pixel) => pixel !== 0))\r\n                return false;\r\n        }\r\n    }\r\n    return true;\r\n}\r\nfunction isNodeMetaEqual(a, b) {\r\n    if (!a || !b || a.type !== b.type)\r\n        return false;\r\n    if (a.type === NodeType.Document)\r\n        return a.compatMode === b.compatMode;\r\n    else if (a.type === NodeType.DocumentType)\r\n        return (a.name === b.name &&\r\n            a.publicId === b.publicId &&\r\n            a.systemId === b.systemId);\r\n    else if (a.type === NodeType.Comment ||\r\n        a.type === NodeType.Text ||\r\n        a.type === NodeType.CDATA)\r\n        return a.textContent === b.textContent;\r\n    else if (a.type === NodeType.Element)\r\n        return (a.tagName === b.tagName &&\r\n            JSON.stringify(a.attributes) ===\r\n                JSON.stringify(b.attributes) &&\r\n            a.isSVG === b.isSVG &&\r\n            a.needBlock === b.needBlock);\r\n    return false;\r\n}\r\nfunction getInputType(element) {\r\n    const type = element.type;\r\n    return element.hasAttribute('data-rr-is-password')\r\n        ? 'password'\r\n        : type\r\n            ?\r\n                toLowerCase(type)\r\n            : null;\r\n}\r\nfunction getInputValue(el, tagName, type) {\r\n    if (tagName === 'INPUT' && (type === 'radio' || type === 'checkbox')) {\r\n        return el.getAttribute('value') || '';\r\n    }\r\n    return el.value;\r\n}\n\nlet _id = 1;\r\nconst tagNameRegex = new RegExp('[^a-z0-9-_:]');\r\nconst IGNORED_NODE = -2;\r\nfunction genId() {\r\n    return _id++;\r\n}\r\nfunction getValidTagName(element) {\r\n    if (element instanceof HTMLFormElement) {\r\n        return 'form';\r\n    }\r\n    const processedTagName = toLowerCase(element.tagName);\r\n    if (tagNameRegex.test(processedTagName)) {\r\n        return 'div';\r\n    }\r\n    return processedTagName;\r\n}\r\nfunction extractOrigin(url) {\r\n    let origin = '';\r\n    if (url.indexOf('//') > -1) {\r\n        origin = url.split('/').slice(0, 3).join('/');\r\n    }\r\n    else {\r\n        origin = url.split('/')[0];\r\n    }\r\n    origin = origin.split('?')[0];\r\n    return origin;\r\n}\r\nlet canvasService;\r\nlet canvasCtx;\r\nconst URL_IN_CSS_REF = /url\\((?:(')([^']*)'|(\")(.*?)\"|([^)]*))\\)/gm;\r\nconst URL_PROTOCOL_MATCH = /^(?:[a-z+]+:)?\\/\\//i;\r\nconst URL_WWW_MATCH = /^www\\..*/i;\r\nconst DATA_URI = /^(data:)([^,]*),(.*)/i;\r\nfunction absoluteToStylesheet(cssText, href) {\r\n    return (cssText || '').replace(URL_IN_CSS_REF, (origin, quote1, path1, quote2, path2, path3) => {\r\n        const filePath = path1 || path2 || path3;\r\n        const maybeQuote = quote1 || quote2 || '';\r\n        if (!filePath) {\r\n            return origin;\r\n        }\r\n        if (URL_PROTOCOL_MATCH.test(filePath) || URL_WWW_MATCH.test(filePath)) {\r\n            return `url(${maybeQuote}${filePath}${maybeQuote})`;\r\n        }\r\n        if (DATA_URI.test(filePath)) {\r\n            return `url(${maybeQuote}${filePath}${maybeQuote})`;\r\n        }\r\n        if (filePath[0] === '/') {\r\n            return `url(${maybeQuote}${extractOrigin(href) + filePath}${maybeQuote})`;\r\n        }\r\n        const stack = href.split('/');\r\n        const parts = filePath.split('/');\r\n        stack.pop();\r\n        for (const part of parts) {\r\n            if (part === '.') {\r\n                continue;\r\n            }\r\n            else if (part === '..') {\r\n                stack.pop();\r\n            }\r\n            else {\r\n                stack.push(part);\r\n            }\r\n        }\r\n        return `url(${maybeQuote}${stack.join('/')}${maybeQuote})`;\r\n    });\r\n}\r\nconst SRCSET_NOT_SPACES = /^[^ \\t\\n\\r\\u000c]+/;\r\nconst SRCSET_COMMAS_OR_SPACES = /^[, \\t\\n\\r\\u000c]+/;\r\nfunction getAbsoluteSrcsetString(doc, attributeValue) {\r\n    if (attributeValue.trim() === '') {\r\n        return attributeValue;\r\n    }\r\n    let pos = 0;\r\n    function collectCharacters(regEx) {\r\n        let chars;\r\n        const match = regEx.exec(attributeValue.substring(pos));\r\n        if (match) {\r\n            chars = match[0];\r\n            pos += chars.length;\r\n            return chars;\r\n        }\r\n        return '';\r\n    }\r\n    const output = [];\r\n    while (true) {\r\n        collectCharacters(SRCSET_COMMAS_OR_SPACES);\r\n        if (pos >= attributeValue.length) {\r\n            break;\r\n        }\r\n        let url = collectCharacters(SRCSET_NOT_SPACES);\r\n        if (url.slice(-1) === ',') {\r\n            url = absoluteToDoc(doc, url.substring(0, url.length - 1));\r\n            output.push(url);\r\n        }\r\n        else {\r\n            let descriptorsStr = '';\r\n            url = absoluteToDoc(doc, url);\r\n            let inParens = false;\r\n            while (true) {\r\n                const c = attributeValue.charAt(pos);\r\n                if (c === '') {\r\n                    output.push((url + descriptorsStr).trim());\r\n                    break;\r\n                }\r\n                else if (!inParens) {\r\n                    if (c === ',') {\r\n                        pos += 1;\r\n                        output.push((url + descriptorsStr).trim());\r\n                        break;\r\n                    }\r\n                    else if (c === '(') {\r\n                        inParens = true;\r\n                    }\r\n                }\r\n                else {\r\n                    if (c === ')') {\r\n                        inParens = false;\r\n                    }\r\n                }\r\n                descriptorsStr += c;\r\n                pos += 1;\r\n            }\r\n        }\r\n    }\r\n    return output.join(', ');\r\n}\r\nfunction absoluteToDoc(doc, attributeValue) {\r\n    if (!attributeValue || attributeValue.trim() === '') {\r\n        return attributeValue;\r\n    }\r\n    const a = doc.createElement('a');\r\n    a.href = attributeValue;\r\n    return a.href;\r\n}\r\nfunction isSVGElement(el) {\r\n    return Boolean(el.tagName === 'svg' || el.ownerSVGElement);\r\n}\r\nfunction getHref() {\r\n    const a = document.createElement('a');\r\n    a.href = '';\r\n    return a.href;\r\n}\r\nfunction transformAttribute(doc, tagName, name, value, element, maskAttributeFn) {\r\n    if (!value) {\r\n        return value;\r\n    }\r\n    if (name === 'src' ||\r\n        (name === 'href' && !(tagName === 'use' && value[0] === '#'))) {\r\n        return absoluteToDoc(doc, value);\r\n    }\r\n    else if (name === 'xlink:href' && value[0] !== '#') {\r\n        return absoluteToDoc(doc, value);\r\n    }\r\n    else if (name === 'background' &&\r\n        (tagName === 'table' || tagName === 'td' || tagName === 'th')) {\r\n        return absoluteToDoc(doc, value);\r\n    }\r\n    else if (name === 'srcset') {\r\n        return getAbsoluteSrcsetString(doc, value);\r\n    }\r\n    else if (name === 'style') {\r\n        return absoluteToStylesheet(value, getHref());\r\n    }\r\n    else if (tagName === 'object' && name === 'data') {\r\n        return absoluteToDoc(doc, value);\r\n    }\r\n    if (typeof maskAttributeFn === 'function') {\r\n        return maskAttributeFn(name, value, element);\r\n    }\r\n    return value;\r\n}\r\nfunction ignoreAttribute(tagName, name, _value) {\r\n    return (tagName === 'video' || tagName === 'audio') && name === 'autoplay';\r\n}\r\nfunction _isBlockedElement(element, blockClass, blockSelector, unblockSelector) {\r\n    try {\r\n        if (unblockSelector && element.matches(unblockSelector)) {\r\n            return false;\r\n        }\r\n        if (typeof blockClass === 'string') {\r\n            if (element.classList.contains(blockClass)) {\r\n                return true;\r\n            }\r\n        }\r\n        else {\r\n            for (let eIndex = element.classList.length; eIndex--;) {\r\n                const className = element.classList[eIndex];\r\n                if (blockClass.test(className)) {\r\n                    return true;\r\n                }\r\n            }\r\n        }\r\n        if (blockSelector) {\r\n            return element.matches(blockSelector);\r\n        }\r\n    }\r\n    catch (e) {\r\n    }\r\n    return false;\r\n}\r\nfunction elementClassMatchesRegex(el, regex) {\r\n    for (let eIndex = el.classList.length; eIndex--;) {\r\n        const className = el.classList[eIndex];\r\n        if (regex.test(className)) {\r\n            return true;\r\n        }\r\n    }\r\n    return false;\r\n}\r\nfunction classMatchesRegex(node, regex, checkAncestors) {\r\n    if (!node)\r\n        return false;\r\n    if (checkAncestors) {\r\n        return (distanceToMatch(node, (node) => elementClassMatchesRegex(node, regex)) >= 0);\r\n    }\r\n    else if (node.nodeType === node.ELEMENT_NODE) {\r\n        return elementClassMatchesRegex(node, regex);\r\n    }\r\n    return false;\r\n}\r\nfunction distanceToMatch(node, matchPredicate, limit = Infinity, distance = 0) {\r\n    if (!node)\r\n        return -1;\r\n    if (node.nodeType !== node.ELEMENT_NODE)\r\n        return -1;\r\n    if (distance > limit)\r\n        return -1;\r\n    if (matchPredicate(node))\r\n        return distance;\r\n    return distanceToMatch(node.parentNode, matchPredicate, limit, distance + 1);\r\n}\r\nfunction createMatchPredicate(className, selector) {\r\n    return (node) => {\r\n        const el = node;\r\n        if (el === null)\r\n            return false;\r\n        if (className) {\r\n            if (typeof className === 'string') {\r\n                if (el.matches(`.${className}`))\r\n                    return true;\r\n            }\r\n            else if (elementClassMatchesRegex(el, className)) {\r\n                return true;\r\n            }\r\n        }\r\n        if (selector && el.matches(selector))\r\n            return true;\r\n        return false;\r\n    };\r\n}\r\nfunction needMaskingText(node, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, maskAllText) {\r\n    try {\r\n        const el = node.nodeType === node.ELEMENT_NODE\r\n            ? node\r\n            : node.parentElement;\r\n        if (el === null)\r\n            return false;\r\n        let maskDistance = -1;\r\n        let unmaskDistance = -1;\r\n        if (maskAllText) {\r\n            unmaskDistance = distanceToMatch(el, createMatchPredicate(unmaskTextClass, unmaskTextSelector));\r\n            if (unmaskDistance < 0) {\r\n                return true;\r\n            }\r\n            maskDistance = distanceToMatch(el, createMatchPredicate(maskTextClass, maskTextSelector), unmaskDistance >= 0 ? unmaskDistance : Infinity);\r\n        }\r\n        else {\r\n            maskDistance = distanceToMatch(el, createMatchPredicate(maskTextClass, maskTextSelector));\r\n            if (maskDistance < 0) {\r\n                return false;\r\n            }\r\n            unmaskDistance = distanceToMatch(el, createMatchPredicate(unmaskTextClass, unmaskTextSelector), maskDistance >= 0 ? maskDistance : Infinity);\r\n        }\r\n        return maskDistance >= 0\r\n            ? unmaskDistance >= 0\r\n                ? maskDistance <= unmaskDistance\r\n                : true\r\n            : unmaskDistance >= 0\r\n                ? false\r\n                : !!maskAllText;\r\n    }\r\n    catch (e) {\r\n    }\r\n    return !!maskAllText;\r\n}\r\nfunction onceIframeLoaded(iframeEl, listener, iframeLoadTimeout) {\r\n    const win = iframeEl.contentWindow;\r\n    if (!win) {\r\n        return;\r\n    }\r\n    let fired = false;\r\n    let readyState;\r\n    try {\r\n        readyState = win.document.readyState;\r\n    }\r\n    catch (error) {\r\n        return;\r\n    }\r\n    if (readyState !== 'complete') {\r\n        const timer = setTimeout(() => {\r\n            if (!fired) {\r\n                listener();\r\n                fired = true;\r\n            }\r\n        }, iframeLoadTimeout);\r\n        iframeEl.addEventListener('load', () => {\r\n            clearTimeout(timer);\r\n            fired = true;\r\n            listener();\r\n        });\r\n        return;\r\n    }\r\n    const blankUrl = 'about:blank';\r\n    if (win.location.href !== blankUrl ||\r\n        iframeEl.src === blankUrl ||\r\n        iframeEl.src === '') {\r\n        setTimeout(listener, 0);\r\n        return iframeEl.addEventListener('load', listener);\r\n    }\r\n    iframeEl.addEventListener('load', listener);\r\n}\r\nfunction onceStylesheetLoaded(link, listener, styleSheetLoadTimeout) {\r\n    let fired = false;\r\n    let styleSheetLoaded;\r\n    try {\r\n        styleSheetLoaded = link.sheet;\r\n    }\r\n    catch (error) {\r\n        return;\r\n    }\r\n    if (styleSheetLoaded)\r\n        return;\r\n    const timer = setTimeout(() => {\r\n        if (!fired) {\r\n            listener();\r\n            fired = true;\r\n        }\r\n    }, styleSheetLoadTimeout);\r\n    link.addEventListener('load', () => {\r\n        clearTimeout(timer);\r\n        fired = true;\r\n        listener();\r\n    });\r\n}\r\nfunction serializeNode(n, options) {\r\n    const { doc, mirror, blockClass, blockSelector, unblockSelector, maskAllText, maskAttributeFn, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, inlineStylesheet, maskInputOptions = {}, maskTextFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, newlyAddedElement = false, } = options;\r\n    const rootId = getRootId(doc, mirror);\r\n    switch (n.nodeType) {\r\n        case n.DOCUMENT_NODE:\r\n            if (n.compatMode !== 'CSS1Compat') {\r\n                return {\r\n                    type: NodeType.Document,\r\n                    childNodes: [],\r\n                    compatMode: n.compatMode,\r\n                };\r\n            }\r\n            else {\r\n                return {\r\n                    type: NodeType.Document,\r\n                    childNodes: [],\r\n                };\r\n            }\r\n        case n.DOCUMENT_TYPE_NODE:\r\n            return {\r\n                type: NodeType.DocumentType,\r\n                name: n.name,\r\n                publicId: n.publicId,\r\n                systemId: n.systemId,\r\n                rootId,\r\n            };\r\n        case n.ELEMENT_NODE:\r\n            return serializeElementNode(n, {\r\n                doc,\r\n                blockClass,\r\n                blockSelector,\r\n                unblockSelector,\r\n                inlineStylesheet,\r\n                maskAttributeFn,\r\n                maskInputOptions,\r\n                maskInputFn,\r\n                dataURLOptions,\r\n                inlineImages,\r\n                recordCanvas,\r\n                keepIframeSrcFn,\r\n                newlyAddedElement,\r\n                rootId,\r\n                maskAllText,\r\n                maskTextClass,\r\n                unmaskTextClass,\r\n                maskTextSelector,\r\n                unmaskTextSelector,\r\n            });\r\n        case n.TEXT_NODE:\r\n            return serializeTextNode(n, {\r\n                maskAllText,\r\n                maskTextClass,\r\n                unmaskTextClass,\r\n                maskTextSelector,\r\n                unmaskTextSelector,\r\n                maskTextFn,\r\n                maskInputOptions,\r\n                maskInputFn,\r\n                rootId,\r\n            });\r\n        case n.CDATA_SECTION_NODE:\r\n            return {\r\n                type: NodeType.CDATA,\r\n                textContent: '',\r\n                rootId,\r\n            };\r\n        case n.COMMENT_NODE:\r\n            return {\r\n                type: NodeType.Comment,\r\n                textContent: n.textContent || '',\r\n                rootId,\r\n            };\r\n        default:\r\n            return false;\r\n    }\r\n}\r\nfunction getRootId(doc, mirror) {\r\n    if (!mirror.hasNode(doc))\r\n        return undefined;\r\n    const docId = mirror.getId(doc);\r\n    return docId === 1 ? undefined : docId;\r\n}\r\nfunction serializeTextNode(n, options) {\r\n    var _a;\r\n    const { maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, maskTextFn, maskInputOptions, maskInputFn, rootId, } = options;\r\n    const parentTagName = n.parentNode && n.parentNode.tagName;\r\n    let textContent = n.textContent;\r\n    const isStyle = parentTagName === 'STYLE' ? true : undefined;\r\n    const isScript = parentTagName === 'SCRIPT' ? true : undefined;\r\n    const isTextarea = parentTagName === 'TEXTAREA' ? true : undefined;\r\n    if (isStyle && textContent) {\r\n        try {\r\n            if (n.nextSibling || n.previousSibling) {\r\n            }\r\n            else if ((_a = n.parentNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) {\r\n                textContent = stringifyStylesheet(n.parentNode.sheet);\r\n            }\r\n        }\r\n        catch (err) {\r\n            console.warn(`Cannot get CSS styles from text's parentNode. Error: ${err}`, n);\r\n        }\r\n        textContent = absoluteToStylesheet(textContent, getHref());\r\n    }\r\n    if (isScript) {\r\n        textContent = 'SCRIPT_PLACEHOLDER';\r\n    }\r\n    const forceMask = needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, maskAllText);\r\n    if (!isStyle && !isScript && !isTextarea && textContent && forceMask) {\r\n        textContent = maskTextFn\r\n            ? maskTextFn(textContent)\r\n            : textContent.replace(/[\\S]/g, '*');\r\n    }\r\n    if (isTextarea && textContent && (maskInputOptions.textarea || forceMask)) {\r\n        textContent = maskInputFn\r\n            ? maskInputFn(textContent, n.parentNode)\r\n            : textContent.replace(/[\\S]/g, '*');\r\n    }\r\n    if (parentTagName === 'OPTION' && textContent) {\r\n        const isInputMasked = shouldMaskInput({\r\n            type: null,\r\n            tagName: parentTagName,\r\n            maskInputOptions,\r\n        });\r\n        textContent = maskInputValue({\r\n            isMasked: needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, isInputMasked),\r\n            element: n,\r\n            value: textContent,\r\n            maskInputFn,\r\n        });\r\n    }\r\n    return {\r\n        type: NodeType.Text,\r\n        textContent: textContent || '',\r\n        isStyle,\r\n        rootId,\r\n    };\r\n}\r\nfunction serializeElementNode(n, options) {\r\n    const { doc, blockClass, blockSelector, unblockSelector, inlineStylesheet, maskInputOptions = {}, maskAttributeFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, newlyAddedElement = false, rootId, maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, } = options;\r\n    const needBlock = _isBlockedElement(n, blockClass, blockSelector, unblockSelector);\r\n    const tagName = getValidTagName(n);\r\n    let attributes = {};\r\n    const len = n.attributes.length;\r\n    for (let i = 0; i < len; i++) {\r\n        const attr = n.attributes[i];\r\n        if (!ignoreAttribute(tagName, attr.name, attr.value)) {\r\n            attributes[attr.name] = transformAttribute(doc, tagName, toLowerCase(attr.name), attr.value, n, maskAttributeFn);\r\n        }\r\n    }\r\n    if (tagName === 'link' && inlineStylesheet) {\r\n        const stylesheet = Array.from(doc.styleSheets).find((s) => {\r\n            return s.href === n.href;\r\n        });\r\n        let cssText = null;\r\n        if (stylesheet) {\r\n            cssText = stringifyStylesheet(stylesheet);\r\n        }\r\n        if (cssText) {\r\n            delete attributes.rel;\r\n            delete attributes.href;\r\n            attributes._cssText = absoluteToStylesheet(cssText, stylesheet.href);\r\n        }\r\n    }\r\n    if (tagName === 'style' &&\r\n        n.sheet &&\r\n        !(n.innerText || n.textContent || '').trim().length) {\r\n        const cssText = stringifyStylesheet(n.sheet);\r\n        if (cssText) {\r\n            attributes._cssText = absoluteToStylesheet(cssText, getHref());\r\n        }\r\n    }\r\n    if (tagName === 'input' ||\r\n        tagName === 'textarea' ||\r\n        tagName === 'select' ||\r\n        tagName === 'option') {\r\n        const el = n;\r\n        const type = getInputType(el);\r\n        const value = getInputValue(el, toUpperCase(tagName), type);\r\n        const checked = el.checked;\r\n        if (type !== 'submit' && type !== 'button' && value) {\r\n            const forceMask = needMaskingText(el, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, shouldMaskInput({\r\n                type,\r\n                tagName: toUpperCase(tagName),\r\n                maskInputOptions,\r\n            }));\r\n            attributes.value = maskInputValue({\r\n                isMasked: forceMask,\r\n                element: el,\r\n                value,\r\n                maskInputFn,\r\n            });\r\n        }\r\n        if (checked) {\r\n            attributes.checked = checked;\r\n        }\r\n    }\r\n    if (tagName === 'option') {\r\n        if (n.selected && !maskInputOptions['select']) {\r\n            attributes.selected = true;\r\n        }\r\n        else {\r\n            delete attributes.selected;\r\n        }\r\n    }\r\n    if (tagName === 'canvas' && recordCanvas) {\r\n        if (n.__context === '2d') {\r\n            if (!is2DCanvasBlank(n)) {\r\n                attributes.rr_dataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n            }\r\n        }\r\n        else if (!('__context' in n)) {\r\n            const canvasDataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n            const blankCanvas = document.createElement('canvas');\r\n            blankCanvas.width = n.width;\r\n            blankCanvas.height = n.height;\r\n            const blankCanvasDataURL = blankCanvas.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n            if (canvasDataURL !== blankCanvasDataURL) {\r\n                attributes.rr_dataURL = canvasDataURL;\r\n            }\r\n        }\r\n    }\r\n    if (tagName === 'img' && inlineImages) {\r\n        if (!canvasService) {\r\n            canvasService = doc.createElement('canvas');\r\n            canvasCtx = canvasService.getContext('2d');\r\n        }\r\n        const image = n;\r\n        const oldValue = image.crossOrigin;\r\n        image.crossOrigin = 'anonymous';\r\n        const recordInlineImage = () => {\r\n            image.removeEventListener('load', recordInlineImage);\r\n            try {\r\n                canvasService.width = image.naturalWidth;\r\n                canvasService.height = image.naturalHeight;\r\n                canvasCtx.drawImage(image, 0, 0);\r\n                attributes.rr_dataURL = canvasService.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n            }\r\n            catch (err) {\r\n                console.warn(`Cannot inline img src=${image.currentSrc}! Error: ${err}`);\r\n            }\r\n            oldValue\r\n                ? (attributes.crossOrigin = oldValue)\r\n                : image.removeAttribute('crossorigin');\r\n        };\r\n        if (image.complete && image.naturalWidth !== 0)\r\n            recordInlineImage();\r\n        else\r\n            image.addEventListener('load', recordInlineImage);\r\n    }\r\n    if (tagName === 'audio' || tagName === 'video') {\r\n        attributes.rr_mediaState = n.paused\r\n            ? 'paused'\r\n            : 'played';\r\n        attributes.rr_mediaCurrentTime = n.currentTime;\r\n    }\r\n    if (!newlyAddedElement) {\r\n        if (n.scrollLeft) {\r\n            attributes.rr_scrollLeft = n.scrollLeft;\r\n        }\r\n        if (n.scrollTop) {\r\n            attributes.rr_scrollTop = n.scrollTop;\r\n        }\r\n    }\r\n    if (needBlock) {\r\n        const { width, height } = n.getBoundingClientRect();\r\n        attributes = {\r\n            class: attributes.class,\r\n            rr_width: `${width}px`,\r\n            rr_height: `${height}px`,\r\n        };\r\n    }\r\n    if (tagName === 'iframe' && !keepIframeSrcFn(attributes.src)) {\r\n        if (!n.contentDocument) {\r\n            attributes.rr_src = attributes.src;\r\n        }\r\n        delete attributes.src;\r\n    }\r\n    let isCustomElement;\r\n    try {\r\n        if (customElements.get(tagName))\r\n            isCustomElement = true;\r\n    }\r\n    catch (e) {\r\n    }\r\n    return {\r\n        type: NodeType.Element,\r\n        tagName,\r\n        attributes,\r\n        childNodes: [],\r\n        isSVG: isSVGElement(n) || undefined,\r\n        needBlock,\r\n        rootId,\r\n        isCustom: isCustomElement,\r\n    };\r\n}\r\nfunction lowerIfExists(maybeAttr) {\r\n    if (maybeAttr === undefined || maybeAttr === null) {\r\n        return '';\r\n    }\r\n    else {\r\n        return maybeAttr.toLowerCase();\r\n    }\r\n}\r\nfunction slimDOMExcluded(sn, slimDOMOptions) {\r\n    if (slimDOMOptions.comment && sn.type === NodeType.Comment) {\r\n        return true;\r\n    }\r\n    else if (sn.type === NodeType.Element) {\r\n        if (slimDOMOptions.script &&\r\n            (sn.tagName === 'script' ||\r\n                (sn.tagName === 'link' &&\r\n                    (sn.attributes.rel === 'preload' ||\r\n                        sn.attributes.rel === 'modulepreload') &&\r\n                    sn.attributes.as === 'script') ||\r\n                (sn.tagName === 'link' &&\r\n                    sn.attributes.rel === 'prefetch' &&\r\n                    typeof sn.attributes.href === 'string' &&\r\n                    sn.attributes.href.endsWith('.js')))) {\r\n            return true;\r\n        }\r\n        else if (slimDOMOptions.headFavicon &&\r\n            ((sn.tagName === 'link' && sn.attributes.rel === 'shortcut icon') ||\r\n                (sn.tagName === 'meta' &&\r\n                    (lowerIfExists(sn.attributes.name).match(/^msapplication-tile(image|color)$/) ||\r\n                        lowerIfExists(sn.attributes.name) === 'application-name' ||\r\n                        lowerIfExists(sn.attributes.rel) === 'icon' ||\r\n                        lowerIfExists(sn.attributes.rel) === 'apple-touch-icon' ||\r\n                        lowerIfExists(sn.attributes.rel) === 'shortcut icon')))) {\r\n            return true;\r\n        }\r\n        else if (sn.tagName === 'meta') {\r\n            if (slimDOMOptions.headMetaDescKeywords &&\r\n                lowerIfExists(sn.attributes.name).match(/^description|keywords$/)) {\r\n                return true;\r\n            }\r\n            else if (slimDOMOptions.headMetaSocial &&\r\n                (lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) ||\r\n                    lowerIfExists(sn.attributes.name).match(/^(og|twitter):/) ||\r\n                    lowerIfExists(sn.attributes.name) === 'pinterest')) {\r\n                return true;\r\n            }\r\n            else if (slimDOMOptions.headMetaRobots &&\r\n                (lowerIfExists(sn.attributes.name) === 'robots' ||\r\n                    lowerIfExists(sn.attributes.name) === 'googlebot' ||\r\n                    lowerIfExists(sn.attributes.name) === 'bingbot')) {\r\n                return true;\r\n            }\r\n            else if (slimDOMOptions.headMetaHttpEquiv &&\r\n                sn.attributes['http-equiv'] !== undefined) {\r\n                return true;\r\n            }\r\n            else if (slimDOMOptions.headMetaAuthorship &&\r\n                (lowerIfExists(sn.attributes.name) === 'author' ||\r\n                    lowerIfExists(sn.attributes.name) === 'generator' ||\r\n                    lowerIfExists(sn.attributes.name) === 'framework' ||\r\n                    lowerIfExists(sn.attributes.name) === 'publisher' ||\r\n                    lowerIfExists(sn.attributes.name) === 'progid' ||\r\n                    lowerIfExists(sn.attributes.property).match(/^article:/) ||\r\n                    lowerIfExists(sn.attributes.property).match(/^product:/))) {\r\n                return true;\r\n            }\r\n            else if (slimDOMOptions.headMetaVerification &&\r\n                (lowerIfExists(sn.attributes.name) === 'google-site-verification' ||\r\n                    lowerIfExists(sn.attributes.name) === 'yandex-verification' ||\r\n                    lowerIfExists(sn.attributes.name) === 'csrf-token' ||\r\n                    lowerIfExists(sn.attributes.name) === 'p:domain_verify' ||\r\n                    lowerIfExists(sn.attributes.name) === 'verify-v1' ||\r\n                    lowerIfExists(sn.attributes.name) === 'verification' ||\r\n                    lowerIfExists(sn.attributes.name) === 'shopify-checkout-api-token')) {\r\n                return true;\r\n            }\r\n        }\r\n    }\r\n    return false;\r\n}\r\nfunction serializeNodeWithId(n, options) {\r\n    const { doc, mirror, blockClass, blockSelector, unblockSelector, maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, skipChild = false, inlineStylesheet = true, maskInputOptions = {}, maskAttributeFn, maskTextFn, maskInputFn, slimDOMOptions, dataURLOptions = {}, inlineImages = false, recordCanvas = false, onSerialize, onIframeLoad, iframeLoadTimeout = 5000, onStylesheetLoad, stylesheetLoadTimeout = 5000, keepIframeSrcFn = () => false, newlyAddedElement = false, } = options;\r\n    let { preserveWhiteSpace = true } = options;\r\n    const _serializedNode = serializeNode(n, {\r\n        doc,\r\n        mirror,\r\n        blockClass,\r\n        blockSelector,\r\n        maskAllText,\r\n        unblockSelector,\r\n        maskTextClass,\r\n        unmaskTextClass,\r\n        maskTextSelector,\r\n        unmaskTextSelector,\r\n        inlineStylesheet,\r\n        maskInputOptions,\r\n        maskAttributeFn,\r\n        maskTextFn,\r\n        maskInputFn,\r\n        dataURLOptions,\r\n        inlineImages,\r\n        recordCanvas,\r\n        keepIframeSrcFn,\r\n        newlyAddedElement,\r\n    });\r\n    if (!_serializedNode) {\r\n        console.warn(n, 'not serialized');\r\n        return null;\r\n    }\r\n    let id;\r\n    if (mirror.hasNode(n)) {\r\n        id = mirror.getId(n);\r\n    }\r\n    else if (slimDOMExcluded(_serializedNode, slimDOMOptions) ||\r\n        (!preserveWhiteSpace &&\r\n            _serializedNode.type === NodeType.Text &&\r\n            !_serializedNode.isStyle &&\r\n            !_serializedNode.textContent.replace(/^\\s+|\\s+$/gm, '').length)) {\r\n        id = IGNORED_NODE;\r\n    }\r\n    else {\r\n        id = genId();\r\n    }\r\n    const serializedNode = Object.assign(_serializedNode, { id });\r\n    mirror.add(n, serializedNode);\r\n    if (id === IGNORED_NODE) {\r\n        return null;\r\n    }\r\n    if (onSerialize) {\r\n        onSerialize(n);\r\n    }\r\n    let recordChild = !skipChild;\r\n    if (serializedNode.type === NodeType.Element) {\r\n        recordChild = recordChild && !serializedNode.needBlock;\r\n        delete serializedNode.needBlock;\r\n        const shadowRoot = n.shadowRoot;\r\n        if (shadowRoot && isNativeShadowDom(shadowRoot))\r\n            serializedNode.isShadowHost = true;\r\n    }\r\n    if ((serializedNode.type === NodeType.Document ||\r\n        serializedNode.type === NodeType.Element) &&\r\n        recordChild) {\r\n        if (slimDOMOptions.headWhitespace &&\r\n            serializedNode.type === NodeType.Element &&\r\n            serializedNode.tagName === 'head') {\r\n            preserveWhiteSpace = false;\r\n        }\r\n        const bypassOptions = {\r\n            doc,\r\n            mirror,\r\n            blockClass,\r\n            blockSelector,\r\n            maskAllText,\r\n            unblockSelector,\r\n            maskTextClass,\r\n            unmaskTextClass,\r\n            maskTextSelector,\r\n            unmaskTextSelector,\r\n            skipChild,\r\n            inlineStylesheet,\r\n            maskInputOptions,\r\n            maskAttributeFn,\r\n            maskTextFn,\r\n            maskInputFn,\r\n            slimDOMOptions,\r\n            dataURLOptions,\r\n            inlineImages,\r\n            recordCanvas,\r\n            preserveWhiteSpace,\r\n            onSerialize,\r\n            onIframeLoad,\r\n            iframeLoadTimeout,\r\n            onStylesheetLoad,\r\n            stylesheetLoadTimeout,\r\n            keepIframeSrcFn,\r\n        };\r\n        for (const childN of Array.from(n.childNodes)) {\r\n            const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\r\n            if (serializedChildNode) {\r\n                serializedNode.childNodes.push(serializedChildNode);\r\n            }\r\n        }\r\n        if (isElement(n) && n.shadowRoot) {\r\n            for (const childN of Array.from(n.shadowRoot.childNodes)) {\r\n                const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\r\n                if (serializedChildNode) {\r\n                    isNativeShadowDom(n.shadowRoot) &&\r\n                        (serializedChildNode.isShadow = true);\r\n                    serializedNode.childNodes.push(serializedChildNode);\r\n                }\r\n            }\r\n        }\r\n    }\r\n    if (n.parentNode &&\r\n        isShadowRoot(n.parentNode) &&\r\n        isNativeShadowDom(n.parentNode)) {\r\n        serializedNode.isShadow = true;\r\n    }\r\n    if (serializedNode.type === NodeType.Element &&\r\n        serializedNode.tagName === 'iframe') {\r\n        onceIframeLoaded(n, () => {\r\n            const iframeDoc = n.contentDocument;\r\n            if (iframeDoc && onIframeLoad) {\r\n                const serializedIframeNode = serializeNodeWithId(iframeDoc, {\r\n                    doc: iframeDoc,\r\n                    mirror,\r\n                    blockClass,\r\n                    blockSelector,\r\n                    unblockSelector,\r\n                    maskAllText,\r\n                    maskTextClass,\r\n                    unmaskTextClass,\r\n                    maskTextSelector,\r\n                    unmaskTextSelector,\r\n                    skipChild: false,\r\n                    inlineStylesheet,\r\n                    maskInputOptions,\r\n                    maskAttributeFn,\r\n                    maskTextFn,\r\n                    maskInputFn,\r\n                    slimDOMOptions,\r\n                    dataURLOptions,\r\n                    inlineImages,\r\n                    recordCanvas,\r\n                    preserveWhiteSpace,\r\n                    onSerialize,\r\n                    onIframeLoad,\r\n                    iframeLoadTimeout,\r\n                    onStylesheetLoad,\r\n                    stylesheetLoadTimeout,\r\n                    keepIframeSrcFn,\r\n                });\r\n                if (serializedIframeNode) {\r\n                    onIframeLoad(n, serializedIframeNode);\r\n                }\r\n            }\r\n        }, iframeLoadTimeout);\r\n    }\r\n    if (serializedNode.type === NodeType.Element &&\r\n        serializedNode.tagName === 'link' &&\r\n        serializedNode.attributes.rel === 'stylesheet') {\r\n        onceStylesheetLoaded(n, () => {\r\n            if (onStylesheetLoad) {\r\n                const serializedLinkNode = serializeNodeWithId(n, {\r\n                    doc,\r\n                    mirror,\r\n                    blockClass,\r\n                    blockSelector,\r\n                    unblockSelector,\r\n                    maskAllText,\r\n                    maskTextClass,\r\n                    unmaskTextClass,\r\n                    maskTextSelector,\r\n                    unmaskTextSelector,\r\n                    skipChild: false,\r\n                    inlineStylesheet,\r\n                    maskInputOptions,\r\n                    maskAttributeFn,\r\n                    maskTextFn,\r\n                    maskInputFn,\r\n                    slimDOMOptions,\r\n                    dataURLOptions,\r\n                    inlineImages,\r\n                    recordCanvas,\r\n                    preserveWhiteSpace,\r\n                    onSerialize,\r\n                    onIframeLoad,\r\n                    iframeLoadTimeout,\r\n                    onStylesheetLoad,\r\n                    stylesheetLoadTimeout,\r\n                    keepIframeSrcFn,\r\n                });\r\n                if (serializedLinkNode) {\r\n                    onStylesheetLoad(n, serializedLinkNode);\r\n                }\r\n            }\r\n        }, stylesheetLoadTimeout);\r\n    }\r\n    return serializedNode;\r\n}\r\nfunction snapshot(n, options) {\r\n    const { mirror = new Mirror(), blockClass = 'rr-block', blockSelector = null, unblockSelector = null, maskAllText = false, maskTextClass = 'rr-mask', unmaskTextClass = null, maskTextSelector = null, unmaskTextSelector = null, inlineStylesheet = true, inlineImages = false, recordCanvas = false, maskAllInputs = false, maskAttributeFn, maskTextFn, maskInputFn, slimDOM = false, dataURLOptions, preserveWhiteSpace, onSerialize, onIframeLoad, iframeLoadTimeout, onStylesheetLoad, stylesheetLoadTimeout, keepIframeSrcFn = () => false, } = options || {};\r\n    const maskInputOptions = maskAllInputs === true\r\n        ? {\r\n            color: true,\r\n            date: true,\r\n            'datetime-local': true,\r\n            email: true,\r\n            month: true,\r\n            number: true,\r\n            range: true,\r\n            search: true,\r\n            tel: true,\r\n            text: true,\r\n            time: true,\r\n            url: true,\r\n            week: true,\r\n            textarea: true,\r\n            select: true,\r\n        }\r\n        : maskAllInputs === false\r\n            ? {}\r\n            : maskAllInputs;\r\n    const slimDOMOptions = slimDOM === true || slimDOM === 'all'\r\n        ?\r\n            {\r\n                script: true,\r\n                comment: true,\r\n                headFavicon: true,\r\n                headWhitespace: true,\r\n                headMetaDescKeywords: slimDOM === 'all',\r\n                headMetaSocial: true,\r\n                headMetaRobots: true,\r\n                headMetaHttpEquiv: true,\r\n                headMetaAuthorship: true,\r\n                headMetaVerification: true,\r\n            }\r\n        : slimDOM === false\r\n            ? {}\r\n            : slimDOM;\r\n    return serializeNodeWithId(n, {\r\n        doc: n,\r\n        mirror,\r\n        blockClass,\r\n        blockSelector,\r\n        unblockSelector,\r\n        maskAllText,\r\n        maskTextClass,\r\n        unmaskTextClass,\r\n        maskTextSelector,\r\n        unmaskTextSelector,\r\n        skipChild: false,\r\n        inlineStylesheet,\r\n        maskInputOptions,\r\n        maskAttributeFn,\r\n        maskTextFn,\r\n        maskInputFn,\r\n        slimDOMOptions,\r\n        dataURLOptions,\r\n        inlineImages,\r\n        recordCanvas,\r\n        preserveWhiteSpace,\r\n        onSerialize,\r\n        onIframeLoad,\r\n        iframeLoadTimeout,\r\n        onStylesheetLoad,\r\n        stylesheetLoadTimeout,\r\n        keepIframeSrcFn,\r\n        newlyAddedElement: false,\r\n    });\r\n}\r\nfunction visitSnapshot(node, onVisit) {\r\n    function walk(current) {\r\n        onVisit(current);\r\n        if (current.type === NodeType.Document ||\r\n            current.type === NodeType.Element) {\r\n            current.childNodes.forEach(walk);\r\n        }\r\n    }\r\n    walk(node);\r\n}\r\nfunction cleanupSnapshot() {\r\n    _id = 1;\r\n}\n\nconst commentre = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\r\nfunction parse(css, options = {}) {\r\n    let lineno = 1;\r\n    let column = 1;\r\n    function updatePosition(str) {\r\n        const lines = str.match(/\\n/g);\r\n        if (lines) {\r\n            lineno += lines.length;\r\n        }\r\n        const i = str.lastIndexOf('\\n');\r\n        column = i === -1 ? column + str.length : str.length - i;\r\n    }\r\n    function position() {\r\n        const start = { line: lineno, column };\r\n        return (node) => {\r\n            node.position = new Position(start);\r\n            whitespace();\r\n            return node;\r\n        };\r\n    }\r\n    class Position {\r\n        constructor(start) {\r\n            this.start = start;\r\n            this.end = { line: lineno, column };\r\n            this.source = options.source;\r\n        }\r\n    }\r\n    Position.prototype.content = css;\r\n    const errorsList = [];\r\n    function error(msg) {\r\n        const err = new Error(`${options.source || ''}:${lineno}:${column}: ${msg}`);\r\n        err.reason = msg;\r\n        err.filename = options.source;\r\n        err.line = lineno;\r\n        err.column = column;\r\n        err.source = css;\r\n        if (options.silent) {\r\n            errorsList.push(err);\r\n        }\r\n        else {\r\n            throw err;\r\n        }\r\n    }\r\n    function stylesheet() {\r\n        const rulesList = rules();\r\n        return {\r\n            type: 'stylesheet',\r\n            stylesheet: {\r\n                source: options.source,\r\n                rules: rulesList,\r\n                parsingErrors: errorsList,\r\n            },\r\n        };\r\n    }\r\n    function open() {\r\n        return match(/^{\\s*/);\r\n    }\r\n    function close() {\r\n        return match(/^}/);\r\n    }\r\n    function rules() {\r\n        let node;\r\n        const rules = [];\r\n        whitespace();\r\n        comments(rules);\r\n        while (css.length && css.charAt(0) !== '}' && (node = atrule() || rule())) {\r\n            if (node) {\r\n                rules.push(node);\r\n                comments(rules);\r\n            }\r\n        }\r\n        return rules;\r\n    }\r\n    function match(re) {\r\n        const m = re.exec(css);\r\n        if (!m) {\r\n            return;\r\n        }\r\n        const str = m[0];\r\n        updatePosition(str);\r\n        css = css.slice(str.length);\r\n        return m;\r\n    }\r\n    function whitespace() {\r\n        match(/^\\s*/);\r\n    }\r\n    function comments(rules = []) {\r\n        let c;\r\n        while ((c = comment())) {\r\n            if (c) {\r\n                rules.push(c);\r\n            }\r\n            c = comment();\r\n        }\r\n        return rules;\r\n    }\r\n    function comment() {\r\n        const pos = position();\r\n        if ('/' !== css.charAt(0) || '*' !== css.charAt(1)) {\r\n            return;\r\n        }\r\n        let i = 2;\r\n        while ('' !== css.charAt(i) &&\r\n            ('*' !== css.charAt(i) || '/' !== css.charAt(i + 1))) {\r\n            ++i;\r\n        }\r\n        i += 2;\r\n        if ('' === css.charAt(i - 1)) {\r\n            return error('End of comment missing');\r\n        }\r\n        const str = css.slice(2, i - 2);\r\n        column += 2;\r\n        updatePosition(str);\r\n        css = css.slice(i);\r\n        column += 2;\r\n        return pos({\r\n            type: 'comment',\r\n            comment: str,\r\n        });\r\n    }\r\n    function selector() {\r\n        const m = match(/^([^{]+)/);\r\n        if (!m) {\r\n            return;\r\n        }\r\n        return trim(m[0])\r\n            .replace(/\\/\\*([^*]|[\\r\\n]|(\\*+([^*/]|[\\r\\n])))*\\*\\/+/g, '')\r\n            .replace(/\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'/g, (m) => {\r\n            return m.replace(/,/g, '\\u200C');\r\n        })\r\n            .split(/\\s*(?![^(]*\\)),\\s*/)\r\n            .map((s) => {\r\n            return s.replace(/\\u200C/g, ',');\r\n        });\r\n    }\r\n    function declaration() {\r\n        const pos = position();\r\n        const propMatch = match(/^(\\*?[-#\\/\\*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/);\r\n        if (!propMatch) {\r\n            return;\r\n        }\r\n        const prop = trim(propMatch[0]);\r\n        if (!match(/^:\\s*/)) {\r\n            return error(`property missing ':'`);\r\n        }\r\n        const val = match(/^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^\\)]*?\\)|[^};])+)/);\r\n        const ret = pos({\r\n            type: 'declaration',\r\n            property: prop.replace(commentre, ''),\r\n            value: val ? trim(val[0]).replace(commentre, '') : '',\r\n        });\r\n        match(/^[;\\s]*/);\r\n        return ret;\r\n    }\r\n    function declarations() {\r\n        const decls = [];\r\n        if (!open()) {\r\n            return error(`missing '{'`);\r\n        }\r\n        comments(decls);\r\n        let decl;\r\n        while ((decl = declaration())) {\r\n            if (decl !== false) {\r\n                decls.push(decl);\r\n                comments(decls);\r\n            }\r\n            decl = declaration();\r\n        }\r\n        if (!close()) {\r\n            return error(`missing '}'`);\r\n        }\r\n        return decls;\r\n    }\r\n    function keyframe() {\r\n        let m;\r\n        const vals = [];\r\n        const pos = position();\r\n        while ((m = match(/^((\\d+\\.\\d+|\\.\\d+|\\d+)%?|[a-z]+)\\s*/))) {\r\n            vals.push(m[1]);\r\n            match(/^,\\s*/);\r\n        }\r\n        if (!vals.length) {\r\n            return;\r\n        }\r\n        return pos({\r\n            type: 'keyframe',\r\n            values: vals,\r\n            declarations: declarations(),\r\n        });\r\n    }\r\n    function atkeyframes() {\r\n        const pos = position();\r\n        let m = match(/^@([-\\w]+)?keyframes\\s*/);\r\n        if (!m) {\r\n            return;\r\n        }\r\n        const vendor = m[1];\r\n        m = match(/^([-\\w]+)\\s*/);\r\n        if (!m) {\r\n            return error('@keyframes missing name');\r\n        }\r\n        const name = m[1];\r\n        if (!open()) {\r\n            return error(`@keyframes missing '{'`);\r\n        }\r\n        let frame;\r\n        let frames = comments();\r\n        while ((frame = keyframe())) {\r\n            frames.push(frame);\r\n            frames = frames.concat(comments());\r\n        }\r\n        if (!close()) {\r\n            return error(`@keyframes missing '}'`);\r\n        }\r\n        return pos({\r\n            type: 'keyframes',\r\n            name,\r\n            vendor,\r\n            keyframes: frames,\r\n        });\r\n    }\r\n    function atsupports() {\r\n        const pos = position();\r\n        const m = match(/^@supports *([^{]+)/);\r\n        if (!m) {\r\n            return;\r\n        }\r\n        const supports = trim(m[1]);\r\n        if (!open()) {\r\n            return error(`@supports missing '{'`);\r\n        }\r\n        const style = comments().concat(rules());\r\n        if (!close()) {\r\n            return error(`@supports missing '}'`);\r\n        }\r\n        return pos({\r\n            type: 'supports',\r\n            supports,\r\n            rules: style,\r\n        });\r\n    }\r\n    function athost() {\r\n        const pos = position();\r\n        const m = match(/^@host\\s*/);\r\n        if (!m) {\r\n            return;\r\n        }\r\n        if (!open()) {\r\n            return error(`@host missing '{'`);\r\n        }\r\n        const style = comments().concat(rules());\r\n        if (!close()) {\r\n            return error(`@host missing '}'`);\r\n        }\r\n        return pos({\r\n            type: 'host',\r\n            rules: style,\r\n        });\r\n    }\r\n    function atmedia() {\r\n        const pos = position();\r\n        const m = match(/^@media *([^{]+)/);\r\n        if (!m) {\r\n            return;\r\n        }\r\n        const media = trim(m[1]);\r\n        if (!open()) {\r\n            return error(`@media missing '{'`);\r\n        }\r\n        const style = comments().concat(rules());\r\n        if (!close()) {\r\n            return error(`@media missing '}'`);\r\n        }\r\n        return pos({\r\n            type: 'media',\r\n            media,\r\n            rules: style,\r\n        });\r\n    }\r\n    function atcustommedia() {\r\n        const pos = position();\r\n        const m = match(/^@custom-media\\s+(--[^\\s]+)\\s*([^{;]+);/);\r\n        if (!m) {\r\n            return;\r\n        }\r\n        return pos({\r\n            type: 'custom-media',\r\n            name: trim(m[1]),\r\n            media: trim(m[2]),\r\n        });\r\n    }\r\n    function atpage() {\r\n        const pos = position();\r\n        const m = match(/^@page */);\r\n        if (!m) {\r\n            return;\r\n        }\r\n        const sel = selector() || [];\r\n        if (!open()) {\r\n            return error(`@page missing '{'`);\r\n        }\r\n        let decls = comments();\r\n        let decl;\r\n        while ((decl = declaration())) {\r\n            decls.push(decl);\r\n            decls = decls.concat(comments());\r\n        }\r\n        if (!close()) {\r\n            return error(`@page missing '}'`);\r\n        }\r\n        return pos({\r\n            type: 'page',\r\n            selectors: sel,\r\n            declarations: decls,\r\n        });\r\n    }\r\n    function atdocument() {\r\n        const pos = position();\r\n        const m = match(/^@([-\\w]+)?document *([^{]+)/);\r\n        if (!m) {\r\n            return;\r\n        }\r\n        const vendor = trim(m[1]);\r\n        const doc = trim(m[2]);\r\n        if (!open()) {\r\n            return error(`@document missing '{'`);\r\n        }\r\n        const style = comments().concat(rules());\r\n        if (!close()) {\r\n            return error(`@document missing '}'`);\r\n        }\r\n        return pos({\r\n            type: 'document',\r\n            document: doc,\r\n            vendor,\r\n            rules: style,\r\n        });\r\n    }\r\n    function atfontface() {\r\n        const pos = position();\r\n        const m = match(/^@font-face\\s*/);\r\n        if (!m) {\r\n            return;\r\n        }\r\n        if (!open()) {\r\n            return error(`@font-face missing '{'`);\r\n        }\r\n        let decls = comments();\r\n        let decl;\r\n        while ((decl = declaration())) {\r\n            decls.push(decl);\r\n            decls = decls.concat(comments());\r\n        }\r\n        if (!close()) {\r\n            return error(`@font-face missing '}'`);\r\n        }\r\n        return pos({\r\n            type: 'font-face',\r\n            declarations: decls,\r\n        });\r\n    }\r\n    const atimport = _compileAtrule('import');\r\n    const atcharset = _compileAtrule('charset');\r\n    const atnamespace = _compileAtrule('namespace');\r\n    function _compileAtrule(name) {\r\n        const re = new RegExp('^@' + name + '\\\\s*([^;]+);');\r\n        return () => {\r\n            const pos = position();\r\n            const m = match(re);\r\n            if (!m) {\r\n                return;\r\n            }\r\n            const ret = { type: name };\r\n            ret[name] = m[1].trim();\r\n            return pos(ret);\r\n        };\r\n    }\r\n    function atrule() {\r\n        if (css[0] !== '@') {\r\n            return;\r\n        }\r\n        return (atkeyframes() ||\r\n            atmedia() ||\r\n            atcustommedia() ||\r\n            atsupports() ||\r\n            atimport() ||\r\n            atcharset() ||\r\n            atnamespace() ||\r\n            atdocument() ||\r\n            atpage() ||\r\n            athost() ||\r\n            atfontface());\r\n    }\r\n    function rule() {\r\n        const pos = position();\r\n        const sel = selector();\r\n        if (!sel) {\r\n            return error('selector missing');\r\n        }\r\n        comments();\r\n        return pos({\r\n            type: 'rule',\r\n            selectors: sel,\r\n            declarations: declarations(),\r\n        });\r\n    }\r\n    return addParent(stylesheet());\r\n}\r\nfunction trim(str) {\r\n    return str ? str.replace(/^\\s+|\\s+$/g, '') : '';\r\n}\r\nfunction addParent(obj, parent) {\r\n    const isNode = obj && typeof obj.type === 'string';\r\n    const childParent = isNode ? obj : parent;\r\n    for (const k of Object.keys(obj)) {\r\n        const value = obj[k];\r\n        if (Array.isArray(value)) {\r\n            value.forEach((v) => {\r\n                addParent(v, childParent);\r\n            });\r\n        }\r\n        else if (value && typeof value === 'object') {\r\n            addParent(value, childParent);\r\n        }\r\n    }\r\n    if (isNode) {\r\n        Object.defineProperty(obj, 'parent', {\r\n            configurable: true,\r\n            writable: true,\r\n            enumerable: false,\r\n            value: parent || null,\r\n        });\r\n    }\r\n    return obj;\r\n}\n\nconst tagMap = {\r\n    script: 'noscript',\r\n    altglyph: 'altGlyph',\r\n    altglyphdef: 'altGlyphDef',\r\n    altglyphitem: 'altGlyphItem',\r\n    animatecolor: 'animateColor',\r\n    animatemotion: 'animateMotion',\r\n    animatetransform: 'animateTransform',\r\n    clippath: 'clipPath',\r\n    feblend: 'feBlend',\r\n    fecolormatrix: 'feColorMatrix',\r\n    fecomponenttransfer: 'feComponentTransfer',\r\n    fecomposite: 'feComposite',\r\n    feconvolvematrix: 'feConvolveMatrix',\r\n    fediffuselighting: 'feDiffuseLighting',\r\n    fedisplacementmap: 'feDisplacementMap',\r\n    fedistantlight: 'feDistantLight',\r\n    fedropshadow: 'feDropShadow',\r\n    feflood: 'feFlood',\r\n    fefunca: 'feFuncA',\r\n    fefuncb: 'feFuncB',\r\n    fefuncg: 'feFuncG',\r\n    fefuncr: 'feFuncR',\r\n    fegaussianblur: 'feGaussianBlur',\r\n    feimage: 'feImage',\r\n    femerge: 'feMerge',\r\n    femergenode: 'feMergeNode',\r\n    femorphology: 'feMorphology',\r\n    feoffset: 'feOffset',\r\n    fepointlight: 'fePointLight',\r\n    fespecularlighting: 'feSpecularLighting',\r\n    fespotlight: 'feSpotLight',\r\n    fetile: 'feTile',\r\n    feturbulence: 'feTurbulence',\r\n    foreignobject: 'foreignObject',\r\n    glyphref: 'glyphRef',\r\n    lineargradient: 'linearGradient',\r\n    radialgradient: 'radialGradient',\r\n};\r\nfunction getTagName(n) {\r\n    let tagName = tagMap[n.tagName] ? tagMap[n.tagName] : n.tagName;\r\n    if (tagName === 'link' && n.attributes._cssText) {\r\n        tagName = 'style';\r\n    }\r\n    return tagName;\r\n}\r\nfunction escapeRegExp(str) {\r\n    return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\r\n}\r\nconst HOVER_SELECTOR = /([^\\\\]):hover/;\r\nconst HOVER_SELECTOR_GLOBAL = new RegExp(HOVER_SELECTOR.source, 'g');\r\nfunction addHoverClass(cssText, cache) {\r\n    const cachedStyle = cache === null || cache === void 0 ? void 0 : cache.stylesWithHoverClass.get(cssText);\r\n    if (cachedStyle)\r\n        return cachedStyle;\r\n    const ast = parse(cssText, {\r\n        silent: true,\r\n    });\r\n    if (!ast.stylesheet) {\r\n        return cssText;\r\n    }\r\n    const selectors = [];\r\n    ast.stylesheet.rules.forEach((rule) => {\r\n        if ('selectors' in rule) {\r\n            (rule.selectors || []).forEach((selector) => {\r\n                if (HOVER_SELECTOR.test(selector)) {\r\n                    selectors.push(selector);\r\n                }\r\n            });\r\n        }\r\n    });\r\n    if (selectors.length === 0) {\r\n        return cssText;\r\n    }\r\n    const selectorMatcher = new RegExp(selectors\r\n        .filter((selector, index) => selectors.indexOf(selector) === index)\r\n        .sort((a, b) => b.length - a.length)\r\n        .map((selector) => {\r\n        return escapeRegExp(selector);\r\n    })\r\n        .join('|'), 'g');\r\n    const result = cssText.replace(selectorMatcher, (selector) => {\r\n        const newSelector = selector.replace(HOVER_SELECTOR_GLOBAL, '$1.\\\\:hover');\r\n        return `${selector}, ${newSelector}`;\r\n    });\r\n    cache === null || cache === void 0 ? void 0 : cache.stylesWithHoverClass.set(cssText, result);\r\n    return result;\r\n}\r\nfunction createCache() {\r\n    const stylesWithHoverClass = new Map();\r\n    return {\r\n        stylesWithHoverClass,\r\n    };\r\n}\r\nfunction buildNode(n, options) {\r\n    var _a;\r\n    const { doc, hackCss, cache } = options;\r\n    switch (n.type) {\r\n        case NodeType.Document:\r\n            return doc.implementation.createDocument(null, '', null);\r\n        case NodeType.DocumentType:\r\n            return doc.implementation.createDocumentType(n.name || 'html', n.publicId, n.systemId);\r\n        case NodeType.Element: {\r\n            const tagName = getTagName(n);\r\n            let node;\r\n            if (n.isSVG) {\r\n                node = doc.createElementNS('http://www.w3.org/2000/svg', tagName);\r\n            }\r\n            else {\r\n                if (n.isCustom &&\r\n                    ((_a = doc.defaultView) === null || _a === void 0 ? void 0 : _a.customElements) &&\r\n                    !doc.defaultView.customElements.get(n.tagName))\r\n                    doc.defaultView.customElements.define(n.tagName, class extends doc.defaultView.HTMLElement {\r\n                    });\r\n                node = doc.createElement(tagName);\r\n            }\r\n            const specialAttributes = {};\r\n            for (const name in n.attributes) {\r\n                if (!Object.prototype.hasOwnProperty.call(n.attributes, name)) {\r\n                    continue;\r\n                }\r\n                let value = n.attributes[name];\r\n                if (tagName === 'option' &&\r\n                    name === 'selected' &&\r\n                    value === false) {\r\n                    continue;\r\n                }\r\n                if (value === null) {\r\n                    continue;\r\n                }\r\n                if (value === true)\r\n                    value = '';\r\n                if (name.startsWith('rr_')) {\r\n                    specialAttributes[name] = value;\r\n                    continue;\r\n                }\r\n                const isTextarea = tagName === 'textarea' && name === 'value';\r\n                const isRemoteOrDynamicCss = tagName === 'style' && name === '_cssText';\r\n                if (isRemoteOrDynamicCss && hackCss && typeof value === 'string') {\r\n                    value = addHoverClass(value, cache);\r\n                }\r\n                if ((isTextarea || isRemoteOrDynamicCss) && typeof value === 'string') {\r\n                    const child = doc.createTextNode(value);\r\n                    for (const c of Array.from(node.childNodes)) {\r\n                        if (c.nodeType === node.TEXT_NODE) {\r\n                            node.removeChild(c);\r\n                        }\r\n                    }\r\n                    node.appendChild(child);\r\n                    continue;\r\n                }\r\n                try {\r\n                    if (n.isSVG && name === 'xlink:href') {\r\n                        node.setAttributeNS('http://www.w3.org/1999/xlink', name, value.toString());\r\n                    }\r\n                    else if (name === 'onload' ||\r\n                        name === 'onclick' ||\r\n                        name.substring(0, 7) === 'onmouse') {\r\n                        node.setAttribute('_' + name, value.toString());\r\n                    }\r\n                    else if (tagName === 'meta' &&\r\n                        n.attributes['http-equiv'] === 'Content-Security-Policy' &&\r\n                        name === 'content') {\r\n                        node.setAttribute('csp-content', value.toString());\r\n                        continue;\r\n                    }\r\n                    else if (tagName === 'link' &&\r\n                        (n.attributes.rel === 'preload' ||\r\n                            n.attributes.rel === 'modulepreload') &&\r\n                        n.attributes.as === 'script') {\r\n                    }\r\n                    else if (tagName === 'link' &&\r\n                        n.attributes.rel === 'prefetch' &&\r\n                        typeof n.attributes.href === 'string' &&\r\n                        n.attributes.href.endsWith('.js')) {\r\n                    }\r\n                    else if (tagName === 'img' &&\r\n                        n.attributes.srcset &&\r\n                        n.attributes.rr_dataURL) {\r\n                        node.setAttribute('rrweb-original-srcset', n.attributes.srcset);\r\n                    }\r\n                    else {\r\n                        node.setAttribute(name, value.toString());\r\n                    }\r\n                }\r\n                catch (error) {\r\n                }\r\n            }\r\n            for (const name in specialAttributes) {\r\n                const value = specialAttributes[name];\r\n                if (tagName === 'canvas' && name === 'rr_dataURL') {\r\n                    const image = document.createElement('img');\r\n                    image.onload = () => {\r\n                        const ctx = node.getContext('2d');\r\n                        if (ctx) {\r\n                            ctx.drawImage(image, 0, 0, image.width, image.height);\r\n                        }\r\n                    };\r\n                    image.src = value.toString();\r\n                    if (node.RRNodeType)\r\n                        node.rr_dataURL = value.toString();\r\n                }\r\n                else if (tagName === 'img' && name === 'rr_dataURL') {\r\n                    const image = node;\r\n                    if (!image.currentSrc.startsWith('data:')) {\r\n                        image.setAttribute('rrweb-original-src', n.attributes.src);\r\n                        image.src = value.toString();\r\n                    }\r\n                }\r\n                if (name === 'rr_width') {\r\n                    node.style.width = value.toString();\r\n                }\r\n                else if (name === 'rr_height') {\r\n                    node.style.height = value.toString();\r\n                }\r\n                else if (name === 'rr_mediaCurrentTime' &&\r\n                    typeof value === 'number') {\r\n                    node.currentTime = value;\r\n                }\r\n                else if (name === 'rr_mediaState') {\r\n                    switch (value) {\r\n                        case 'played':\r\n                            node\r\n                                .play()\r\n                                .catch((e) => console.warn('media playback error', e));\r\n                            break;\r\n                        case 'paused':\r\n                            node.pause();\r\n                            break;\r\n                    }\r\n                }\r\n            }\r\n            if (n.isShadowHost) {\r\n                if (!node.shadowRoot) {\r\n                    node.attachShadow({ mode: 'open' });\r\n                }\r\n                else {\r\n                    while (node.shadowRoot.firstChild) {\r\n                        node.shadowRoot.removeChild(node.shadowRoot.firstChild);\r\n                    }\r\n                }\r\n            }\r\n            return node;\r\n        }\r\n        case NodeType.Text:\r\n            return doc.createTextNode(n.isStyle && hackCss\r\n                ? addHoverClass(n.textContent, cache)\r\n                : n.textContent);\r\n        case NodeType.CDATA:\r\n            return doc.createCDATASection(n.textContent);\r\n        case NodeType.Comment:\r\n            return doc.createComment(n.textContent);\r\n        default:\r\n            return null;\r\n    }\r\n}\r\nfunction buildNodeWithSN(n, options) {\r\n    const { doc, mirror, skipChild = false, hackCss = true, afterAppend, cache, } = options;\r\n    if (mirror.has(n.id)) {\r\n        const nodeInMirror = mirror.getNode(n.id);\r\n        const meta = mirror.getMeta(nodeInMirror);\r\n        if (isNodeMetaEqual(meta, n))\r\n            return mirror.getNode(n.id);\r\n    }\r\n    let node = buildNode(n, { doc, hackCss, cache });\r\n    if (!node) {\r\n        return null;\r\n    }\r\n    if (n.rootId && mirror.getNode(n.rootId) !== doc) {\r\n        mirror.replace(n.rootId, doc);\r\n    }\r\n    if (n.type === NodeType.Document) {\r\n        doc.close();\r\n        doc.open();\r\n        if (n.compatMode === 'BackCompat' &&\r\n            n.childNodes &&\r\n            n.childNodes[0].type !== NodeType.DocumentType) {\r\n            if (n.childNodes[0].type === NodeType.Element &&\r\n                'xmlns' in n.childNodes[0].attributes &&\r\n                n.childNodes[0].attributes.xmlns === 'http://www.w3.org/1999/xhtml') {\r\n                doc.write('<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"\">');\r\n            }\r\n            else {\r\n                doc.write('<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"\">');\r\n            }\r\n        }\r\n        node = doc;\r\n    }\r\n    mirror.add(node, n);\r\n    if ((n.type === NodeType.Document || n.type === NodeType.Element) &&\r\n        !skipChild) {\r\n        for (const childN of n.childNodes) {\r\n            const childNode = buildNodeWithSN(childN, {\r\n                doc,\r\n                mirror,\r\n                skipChild: false,\r\n                hackCss,\r\n                afterAppend,\r\n                cache,\r\n            });\r\n            if (!childNode) {\r\n                console.warn('Failed to rebuild', childN);\r\n                continue;\r\n            }\r\n            if (childN.isShadow && isElement(node) && node.shadowRoot) {\r\n                node.shadowRoot.appendChild(childNode);\r\n            }\r\n            else if (n.type === NodeType.Document &&\r\n                childN.type == NodeType.Element) {\r\n                const htmlElement = childNode;\r\n                let body = null;\r\n                htmlElement.childNodes.forEach((child) => {\r\n                    if (child.nodeName === 'BODY')\r\n                        body = child;\r\n                });\r\n                if (body) {\r\n                    htmlElement.removeChild(body);\r\n                    node.appendChild(childNode);\r\n                    htmlElement.appendChild(body);\r\n                }\r\n                else {\r\n                    node.appendChild(childNode);\r\n                }\r\n            }\r\n            else {\r\n                node.appendChild(childNode);\r\n            }\r\n            if (afterAppend) {\r\n                afterAppend(childNode, childN.id);\r\n            }\r\n        }\r\n    }\r\n    return node;\r\n}\r\nfunction visit(mirror, onVisit) {\r\n    function walk(node) {\r\n        onVisit(node);\r\n    }\r\n    for (const id of mirror.getIds()) {\r\n        if (mirror.has(id)) {\r\n            walk(mirror.getNode(id));\r\n        }\r\n    }\r\n}\r\nfunction handleScroll(node, mirror) {\r\n    const n = mirror.getMeta(node);\r\n    if ((n === null || n === void 0 ? void 0 : n.type) !== NodeType.Element) {\r\n        return;\r\n    }\r\n    const el = node;\r\n    for (const name in n.attributes) {\r\n        if (!(Object.prototype.hasOwnProperty.call(n.attributes, name) &&\r\n            name.startsWith('rr_'))) {\r\n            continue;\r\n        }\r\n        const value = n.attributes[name];\r\n        if (name === 'rr_scrollLeft') {\r\n            el.scrollLeft = value;\r\n        }\r\n        if (name === 'rr_scrollTop') {\r\n            el.scrollTop = value;\r\n        }\r\n    }\r\n}\r\nfunction rebuild(n, options) {\r\n    const { doc, onVisit, hackCss = true, afterAppend, cache, mirror = new Mirror(), } = options;\r\n    const node = buildNodeWithSN(n, {\r\n        doc,\r\n        mirror,\r\n        skipChild: false,\r\n        hackCss,\r\n        afterAppend,\r\n        cache,\r\n    });\r\n    visit(mirror, (visitedNode) => {\r\n        if (onVisit) {\r\n            onVisit(visitedNode);\r\n        }\r\n        handleScroll(visitedNode, mirror);\r\n    });\r\n    return node;\r\n}\n\nexport { IGNORED_NODE, Mirror, NodeType, addHoverClass, buildNodeWithSN, classMatchesRegex, cleanupSnapshot, createCache, createMatchPredicate, createMirror, distanceToMatch, escapeImportStatement, fixSafariColons, genId, getInputType, getInputValue, ignoreAttribute, is2DCanvasBlank, isCSSImportRule, isCSSStyleRule, isElement, isNativeShadowDom, isNodeMetaEqual, isShadowRoot, maskInputValue, needMaskingText, rebuild, serializeNodeWithId, shouldMaskInput, snapshot, stringifyRule, stringifyStylesheet, toLowerCase, toUpperCase, transformAttribute, visitSnapshot };\n","// Note that these are the serialized attributes and not attributes directly on\n// the DOM Node. Attributes we are interested in:\nconst ATTRIBUTES_TO_RECORD = new Set([\n  'id',\n  'class',\n  'aria-label',\n  'role',\n  'name',\n  'alt',\n  'title',\n  'data-test-id',\n  'data-testid',\n  'disabled',\n  'aria-disabled',\n]);\n\n/**\n * Inclusion list of attributes that we want to record from the DOM element\n */\nexport function getAttributesToRecord(attributes: Record<string, unknown>): Record<string, unknown> {\n  const obj: Record<string, unknown> = {};\n  for (const key in attributes) {\n    if (ATTRIBUTES_TO_RECORD.has(key)) {\n      let normalizedKey = key;\n\n      if (key === 'data-testid' || key === 'data-test-id') {\n        normalizedKey = 'testId';\n      }\n\n      obj[normalizedKey] = attributes[key];\n    }\n  }\n\n  return obj;\n}\n","import { record } from '@sentry-internal/rrweb';\nimport type { serializedElementNodeWithId, serializedNodeWithId } from '@sentry-internal/rrweb-snapshot';\nimport { NodeType } from '@sentry-internal/rrweb-snapshot';\nimport type { Breadcrumb } from '@sentry/types';\nimport { htmlTreeAsString } from '@sentry/utils';\n\nimport type { ReplayContainer } from '../types';\nimport { createBreadcrumb } from '../util/createBreadcrumb';\nimport { handleClick } from './handleClick';\nimport { addBreadcrumbEvent } from './util/addBreadcrumbEvent';\nimport type { DomHandlerData } from './util/domUtils';\nimport { getClickTargetNode, getTargetNode } from './util/domUtils';\nimport { getAttributesToRecord } from './util/getAttributesToRecord';\n\nexport const handleDomListener: (replay: ReplayContainer) => (handlerData: DomHandlerData) => void = (\n  replay: ReplayContainer,\n) => {\n  return (handlerData: DomHandlerData): void => {\n    if (!replay.isEnabled()) {\n      return;\n    }\n\n    const result = handleDom(handlerData);\n\n    if (!result) {\n      return;\n    }\n\n    const isClick = handlerData.name === 'click';\n    const event = isClick && (handlerData.event as PointerEvent);\n    // Ignore clicks if ctrl/alt/meta/shift keys are held down as they alter behavior of clicks (e.g. open in new tab)\n    if (\n      isClick &&\n      replay.clickDetector &&\n      event &&\n      !event.altKey &&\n      !event.metaKey &&\n      !event.ctrlKey &&\n      !event.shiftKey\n    ) {\n      handleClick(\n        replay.clickDetector,\n        result as Breadcrumb & { timestamp: number; data: { nodeId: number } },\n        getClickTargetNode(handlerData.event) as HTMLElement,\n      );\n    }\n\n    addBreadcrumbEvent(replay, result);\n  };\n};\n\n/** Get the base DOM breadcrumb. */\nexport function getBaseDomBreadcrumb(target: Node | null, message: string): Breadcrumb {\n  const nodeId = record.mirror.getId(target);\n  const node = nodeId && record.mirror.getNode(nodeId);\n  const meta = node && record.mirror.getMeta(node);\n  const element = meta && isElement(meta) ? meta : null;\n\n  return {\n    message,\n    data: element\n      ? {\n          nodeId,\n          node: {\n            id: nodeId,\n            tagName: element.tagName,\n            textContent: Array.from(element.childNodes)\n              .map((node: serializedNodeWithId) => node.type === NodeType.Text && node.textContent)\n              .filter(Boolean) // filter out empty values\n              .map(text => (text as string).trim())\n              .join(''),\n            attributes: getAttributesToRecord(element.attributes),\n          },\n        }\n      : {},\n  };\n}\n\n/**\n * An event handler to react to DOM events.\n * Exported for tests.\n */\nexport function handleDom(handlerData: DomHandlerData): Breadcrumb | null {\n  const { target, message } = getDomTarget(handlerData);\n\n  return createBreadcrumb({\n    category: `ui.${handlerData.name}`,\n    ...getBaseDomBreadcrumb(target, message),\n  });\n}\n\nfunction getDomTarget(handlerData: DomHandlerData): { target: Node | null; message: string } {\n  const isClick = handlerData.name === 'click';\n\n  let message: string | undefined;\n  let target: Node | null = null;\n\n  // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n  try {\n    target = isClick ? getClickTargetNode(handlerData.event) : getTargetNode(handlerData.event);\n    message = htmlTreeAsString(target, { maxStringLength: 200 }) || '<unknown>';\n  } catch (e) {\n    message = '<unknown>';\n  }\n\n  return { target, message };\n}\n\nfunction isElement(node: serializedNodeWithId): node is serializedElementNodeWithId {\n  return node.type === NodeType.Element;\n}\n","const NAVIGATION_ENTRY_KEYS: Array<keyof PerformanceNavigationTiming> = [\n  'name',\n  'type',\n  'startTime',\n  'transferSize',\n  'duration',\n];\n\nfunction isNavigationEntryEqual(a: PerformanceNavigationTiming) {\n  return function (b: PerformanceNavigationTiming) {\n    return NAVIGATION_ENTRY_KEYS.every(key => a[key] === b[key]);\n  };\n}\n\n/**\n * There are some difficulties diagnosing why there are duplicate navigation\n * entries. We've witnessed several intermittent results:\n * - duplicate entries have duration = 0\n * - duplicate entries are the same object reference\n * - none of the above\n *\n * Compare the values of several keys to determine if the entries are duplicates or not.\n */\n// TODO (high-prio): Figure out wth is returned here\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function dedupePerformanceEntries(\n  currentList: PerformanceEntryList,\n  newList: PerformanceEntryList,\n): PerformanceEntryList {\n  // Partition `currentList` into 3 different lists based on entryType\n  const [existingNavigationEntries, existingLcpEntries, existingEntries] = currentList.reduce(\n    (acc: [PerformanceNavigationTiming[], PerformancePaintTiming[], PerformanceEntryList], entry) => {\n      if (entry.entryType === 'navigation') {\n        acc[0].push(entry as PerformanceNavigationTiming);\n      } else if (entry.entryType === 'largest-contentful-paint') {\n        acc[1].push(entry as PerformancePaintTiming);\n      } else {\n        acc[2].push(entry);\n      }\n      return acc;\n    },\n    [[], [], []],\n  );\n\n  const newEntries: PerformanceEntryList = [];\n  const newNavigationEntries: PerformanceNavigationTiming[] = [];\n  let newLcpEntry: PerformancePaintTiming | undefined = existingLcpEntries.length\n    ? existingLcpEntries[existingLcpEntries.length - 1] // Take the last element as list is sorted\n    : undefined;\n\n  newList.forEach(entry => {\n    if (entry.entryType === 'largest-contentful-paint') {\n      // We want the latest LCP event only\n      if (!newLcpEntry || newLcpEntry.startTime < entry.startTime) {\n        newLcpEntry = entry;\n      }\n      return;\n    }\n\n    if (entry.entryType === 'navigation') {\n      const navigationEntry = entry as PerformanceNavigationTiming;\n\n      // Check if the navigation entry is contained in currentList or newList\n      if (\n        // Ignore any navigation entries with duration 0, as they are likely duplicates\n        entry.duration > 0 &&\n        // Ensure new entry does not already exist in existing entries\n        !existingNavigationEntries.find(isNavigationEntryEqual(navigationEntry)) &&\n        // Ensure new entry does not already exist in new list of navigation entries\n        !newNavigationEntries.find(isNavigationEntryEqual(navigationEntry))\n      ) {\n        newNavigationEntries.push(navigationEntry);\n      }\n\n      // Otherwise this navigation entry is considered a duplicate and is thrown away\n      return;\n    }\n\n    newEntries.push(entry);\n  });\n\n  // Re-combine and sort by startTime\n  return [\n    ...(newLcpEntry ? [newLcpEntry] : []),\n    ...existingNavigationEntries,\n    ...existingEntries,\n    ...newEntries,\n    ...newNavigationEntries,\n  ].sort((a, b) => a.startTime - b.startTime);\n}\n","import { getCurrentHub } from '@sentry/core';\nimport { logger } from '@sentry/utils';\n\n/**\n * Log a message in debug mode, and add a breadcrumb when _experiment.traceInternals is enabled.\n */\nexport function logInfo(message: string, shouldAddBreadcrumb?: boolean): void {\n  if (!__DEBUG_BUILD__) {\n    return;\n  }\n\n  logger.info(message);\n\n  if (shouldAddBreadcrumb) {\n    addBreadcrumb(message);\n  }\n}\n\n/**\n * Log a message, and add a breadcrumb in the next tick.\n * This is necessary when the breadcrumb may be added before the replay is initialized.\n */\nexport function logInfoNextTick(message: string, shouldAddBreadcrumb?: boolean): void {\n  if (!__DEBUG_BUILD__) {\n    return;\n  }\n\n  logger.info(message);\n\n  if (shouldAddBreadcrumb) {\n    // Wait a tick here to avoid race conditions for some initial logs\n    // which may be added before replay is initialized\n    setTimeout(() => {\n      addBreadcrumb(message);\n    }, 0);\n  }\n}\n\nfunction addBreadcrumb(message: string): void {\n  const hub = getCurrentHub();\n  hub.addBreadcrumb(\n    {\n      category: 'console',\n      data: {\n        logger: 'replay',\n      },\n      level: 'info',\n      message,\n    },\n    { level: 'info' },\n  );\n}\n","import { REPLAY_MAX_EVENT_BUFFER_SIZE } from '../constants';\n\n/** This error indicates that the event buffer size exceeded the limit.. */\nexport class EventBufferSizeExceededError extends Error {\n  public constructor() {\n    super(`Event buffer exceeded maximum size of ${REPLAY_MAX_EVENT_BUFFER_SIZE}.`);\n  }\n}\n","import { REPLAY_MAX_EVENT_BUFFER_SIZE } from '../constants';\nimport type { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';\nimport { timestampToMs } from '../util/timestamp';\nimport { EventBufferSizeExceededError } from './error';\n\n/**\n * A basic event buffer that does not do any compression.\n * Used as fallback if the compression worker cannot be loaded or is disabled.\n */\nexport class EventBufferArray implements EventBuffer {\n  /** All the events that are buffered to be sent. */\n  public events: RecordingEvent[];\n\n  /** @inheritdoc */\n  public hasCheckout: boolean;\n\n  private _totalSize: number;\n\n  public constructor() {\n    this.events = [];\n    this._totalSize = 0;\n    this.hasCheckout = false;\n  }\n\n  /** @inheritdoc */\n  public get hasEvents(): boolean {\n    return this.events.length > 0;\n  }\n\n  /** @inheritdoc */\n  public get type(): EventBufferType {\n    return 'sync';\n  }\n\n  /** @inheritdoc */\n  public destroy(): void {\n    this.events = [];\n  }\n\n  /** @inheritdoc */\n  public async addEvent(event: RecordingEvent): Promise<AddEventResult> {\n    const eventSize = JSON.stringify(event).length;\n    this._totalSize += eventSize;\n    if (this._totalSize > REPLAY_MAX_EVENT_BUFFER_SIZE) {\n      throw new EventBufferSizeExceededError();\n    }\n\n    this.events.push(event);\n  }\n\n  /** @inheritdoc */\n  public finish(): Promise<string> {\n    return new Promise<string>(resolve => {\n      // Make a copy of the events array reference and immediately clear the\n      // events member so that we do not lose new events while uploading\n      // attachment.\n      const eventsRet = this.events;\n      this.clear();\n      resolve(JSON.stringify(eventsRet));\n    });\n  }\n\n  /** @inheritdoc */\n  public clear(): void {\n    this.events = [];\n    this._totalSize = 0;\n    this.hasCheckout = false;\n  }\n\n  /** @inheritdoc */\n  public getEarliestTimestamp(): number | null {\n    const timestamp = this.events.map(event => event.timestamp).sort()[0];\n\n    if (!timestamp) {\n      return null;\n    }\n\n    return timestampToMs(timestamp);\n  }\n}\n","import { logger } from '@sentry/utils';\n\nimport type { WorkerRequest, WorkerResponse } from '../types';\nimport { logInfo } from '../util/log';\n\n/**\n * Event buffer that uses a web worker to compress events.\n * Exported only for testing.\n */\nexport class WorkerHandler {\n  private _worker: Worker;\n  private _id: number;\n  private _ensureReadyPromise?: Promise<void>;\n\n  public constructor(worker: Worker) {\n    this._worker = worker;\n    this._id = 0;\n  }\n\n  /**\n   * Ensure the worker is ready (or not).\n   * This will either resolve when the worker is ready, or reject if an error occured.\n   */\n  public ensureReady(): Promise<void> {\n    // Ensure we only check once\n    if (this._ensureReadyPromise) {\n      return this._ensureReadyPromise;\n    }\n\n    this._ensureReadyPromise = new Promise((resolve, reject) => {\n      this._worker.addEventListener(\n        'message',\n        ({ data }: MessageEvent) => {\n          if ((data as WorkerResponse).success) {\n            resolve();\n          } else {\n            reject();\n          }\n        },\n        { once: true },\n      );\n\n      this._worker.addEventListener(\n        'error',\n        error => {\n          reject(error);\n        },\n        { once: true },\n      );\n    });\n\n    return this._ensureReadyPromise;\n  }\n\n  /**\n   * Destroy the worker.\n   */\n  public destroy(): void {\n    logInfo('[Replay] Destroying compression worker');\n    this._worker.terminate();\n  }\n\n  /**\n   * Post message to worker and wait for response before resolving promise.\n   */\n  public postMessage<T>(method: WorkerRequest['method'], arg?: WorkerRequest['arg']): Promise<T> {\n    const id = this._getAndIncrementId();\n\n    return new Promise((resolve, reject) => {\n      const listener = ({ data }: MessageEvent): void => {\n        const response = data as WorkerResponse;\n        if (response.method !== method) {\n          return;\n        }\n\n        // There can be multiple listeners for a single method, the id ensures\n        // that the response matches the caller.\n        if (response.id !== id) {\n          return;\n        }\n\n        // At this point, we'll always want to remove listener regardless of result status\n        this._worker.removeEventListener('message', listener);\n\n        if (!response.success) {\n          // TODO: Do some error handling, not sure what\n          __DEBUG_BUILD__ && logger.error('[Replay]', response.response);\n\n          reject(new Error('Error in compression worker'));\n          return;\n        }\n\n        resolve(response.response as T);\n      };\n\n      // Note: we can't use `once` option because it's possible it needs to\n      // listen to multiple messages\n      this._worker.addEventListener('message', listener);\n      this._worker.postMessage({ id, method, arg });\n    });\n  }\n\n  /** Get the current ID and increment it for the next call. */\n  private _getAndIncrementId(): number {\n    return this._id++;\n  }\n}\n","import type { ReplayRecordingData } from '@sentry/types';\n\nimport { REPLAY_MAX_EVENT_BUFFER_SIZE } from '../constants';\nimport type { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';\nimport { timestampToMs } from '../util/timestamp';\nimport { EventBufferSizeExceededError } from './error';\nimport { WorkerHandler } from './WorkerHandler';\n\n/**\n * Event buffer that uses a web worker to compress events.\n * Exported only for testing.\n */\nexport class EventBufferCompressionWorker implements EventBuffer {\n  /** @inheritdoc */\n  public hasCheckout: boolean;\n\n  private _worker: WorkerHandler;\n  private _earliestTimestamp: number | null;\n  private _totalSize;\n\n  public constructor(worker: Worker) {\n    this._worker = new WorkerHandler(worker);\n    this._earliestTimestamp = null;\n    this._totalSize = 0;\n    this.hasCheckout = false;\n  }\n\n  /** @inheritdoc */\n  public get hasEvents(): boolean {\n    return !!this._earliestTimestamp;\n  }\n\n  /** @inheritdoc */\n  public get type(): EventBufferType {\n    return 'worker';\n  }\n\n  /**\n   * Ensure the worker is ready (or not).\n   * This will either resolve when the worker is ready, or reject if an error occured.\n   */\n  public ensureReady(): Promise<void> {\n    return this._worker.ensureReady();\n  }\n\n  /**\n   * Destroy the event buffer.\n   */\n  public destroy(): void {\n    this._worker.destroy();\n  }\n\n  /**\n   * Add an event to the event buffer.\n   *\n   * Returns true if event was successfuly received and processed by worker.\n   */\n  public addEvent(event: RecordingEvent): Promise<AddEventResult> {\n    const timestamp = timestampToMs(event.timestamp);\n    if (!this._earliestTimestamp || timestamp < this._earliestTimestamp) {\n      this._earliestTimestamp = timestamp;\n    }\n\n    const data = JSON.stringify(event);\n    this._totalSize += data.length;\n\n    if (this._totalSize > REPLAY_MAX_EVENT_BUFFER_SIZE) {\n      return Promise.reject(new EventBufferSizeExceededError());\n    }\n\n    return this._sendEventToWorker(data);\n  }\n\n  /**\n   * Finish the event buffer and return the compressed data.\n   */\n  public finish(): Promise<ReplayRecordingData> {\n    return this._finishRequest();\n  }\n\n  /** @inheritdoc */\n  public clear(): void {\n    this._earliestTimestamp = null;\n    this._totalSize = 0;\n    this.hasCheckout = false;\n\n    // We do not wait on this, as we assume the order of messages is consistent for the worker\n    void this._worker.postMessage('clear');\n  }\n\n  /** @inheritdoc */\n  public getEarliestTimestamp(): number | null {\n    return this._earliestTimestamp;\n  }\n\n  /**\n   * Send the event to the worker.\n   */\n  private _sendEventToWorker(data: string): Promise<AddEventResult> {\n    return this._worker.postMessage<void>('addEvent', data);\n  }\n\n  /**\n   * Finish the request and return the compressed data from the worker.\n   */\n  private async _finishRequest(): Promise<Uint8Array> {\n    const response = await this._worker.postMessage<Uint8Array>('finish');\n\n    this._earliestTimestamp = null;\n    this._totalSize = 0;\n\n    return response;\n  }\n}\n","import type { ReplayRecordingData } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport type { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';\nimport { logInfo } from '../util/log';\nimport { EventBufferArray } from './EventBufferArray';\nimport { EventBufferCompressionWorker } from './EventBufferCompressionWorker';\n\n/**\n * This proxy will try to use the compression worker, and fall back to use the simple buffer if an error occurs there.\n * This can happen e.g. if the worker cannot be loaded.\n * Exported only for testing.\n */\nexport class EventBufferProxy implements EventBuffer {\n  private _fallback: EventBufferArray;\n  private _compression: EventBufferCompressionWorker;\n  private _used: EventBuffer;\n  private _ensureWorkerIsLoadedPromise: Promise<void>;\n\n  public constructor(worker: Worker) {\n    this._fallback = new EventBufferArray();\n    this._compression = new EventBufferCompressionWorker(worker);\n    this._used = this._fallback;\n\n    this._ensureWorkerIsLoadedPromise = this._ensureWorkerIsLoaded();\n  }\n\n  /** @inheritdoc */\n  public get type(): EventBufferType {\n    return this._used.type;\n  }\n\n  /** @inheritDoc */\n  public get hasEvents(): boolean {\n    return this._used.hasEvents;\n  }\n\n  /** @inheritdoc */\n  public get hasCheckout(): boolean {\n    return this._used.hasCheckout;\n  }\n  /** @inheritdoc */\n  public set hasCheckout(value: boolean) {\n    this._used.hasCheckout = value;\n  }\n\n  /** @inheritDoc */\n  public destroy(): void {\n    this._fallback.destroy();\n    this._compression.destroy();\n  }\n\n  /** @inheritdoc */\n  public clear(): void {\n    return this._used.clear();\n  }\n\n  /** @inheritdoc */\n  public getEarliestTimestamp(): number | null {\n    return this._used.getEarliestTimestamp();\n  }\n\n  /**\n   * Add an event to the event buffer.\n   *\n   * Returns true if event was successfully added.\n   */\n  public addEvent(event: RecordingEvent): Promise<AddEventResult> {\n    return this._used.addEvent(event);\n  }\n\n  /** @inheritDoc */\n  public async finish(): Promise<ReplayRecordingData> {\n    // Ensure the worker is loaded, so the sent event is compressed\n    await this.ensureWorkerIsLoaded();\n\n    return this._used.finish();\n  }\n\n  /** Ensure the worker has loaded. */\n  public ensureWorkerIsLoaded(): Promise<void> {\n    return this._ensureWorkerIsLoadedPromise;\n  }\n\n  /** Actually check if the worker has been loaded. */\n  private async _ensureWorkerIsLoaded(): Promise<void> {\n    try {\n      await this._compression.ensureReady();\n    } catch (error) {\n      // If the worker fails to load, we fall back to the simple buffer.\n      // Nothing more to do from our side here\n      logInfo('[Replay] Failed to load the compression worker, falling back to simple buffer');\n      return;\n    }\n\n    // Now we need to switch over the array buffer to the compression worker\n    await this._switchToCompressionWorker();\n  }\n\n  /** Switch the used buffer to the compression worker. */\n  private async _switchToCompressionWorker(): Promise<void> {\n    const { events, hasCheckout } = this._fallback;\n\n    const addEventPromises: Promise<void>[] = [];\n    for (const event of events) {\n      addEventPromises.push(this._compression.addEvent(event));\n    }\n\n    this._compression.hasCheckout = hasCheckout;\n\n    // We switch over to the new buffer immediately - any further events will be added\n    // after the previously buffered ones\n    this._used = this._compression;\n\n    // Wait for original events to be re-added before resolving\n    try {\n      await Promise.all(addEventPromises);\n    } catch (error) {\n      __DEBUG_BUILD__ && logger.warn('[Replay] Failed to add events when switching buffers.', error);\n    }\n  }\n}\n","import { WINDOW } from '../constants';\n\n/** If sessionStorage is available. */\nexport function hasSessionStorage(): boolean {\n  try {\n    // This can throw, e.g. when being accessed in a sandboxed iframe\n    return 'sessionStorage' in WINDOW && !!WINDOW.sessionStorage;\n  } catch {\n    return false;\n  }\n}\n","/**\n * Given a sample rate, returns true if replay should be sampled.\n *\n * 1.0 = 100% sampling\n * 0.0 = 0% sampling\n */\nexport function isSampled(sampleRate?: number): boolean {\n  if (sampleRate === undefined) {\n    return false;\n  }\n\n  // Math.random() returns a number in range of 0 to 1 (inclusive of 0, but not 1)\n  return Math.random() < sampleRate;\n}\n","import { REPLAY_SESSION_KEY, WINDOW } from '../constants';\nimport type { Session } from '../types';\nimport { hasSessionStorage } from '../util/hasSessionStorage';\n\n/**\n * Save a session to session storage.\n */\nexport function saveSession(session: Session): void {\n  if (!hasSessionStorage()) {\n    return;\n  }\n\n  try {\n    WINDOW.sessionStorage.setItem(REPLAY_SESSION_KEY, JSON.stringify(session));\n  } catch {\n    // Ignore potential SecurityError exceptions\n  }\n}\n","import { uuid4 } from '@sentry/utils';\n\nimport type { Sampled, Session } from '../types';\n\n/**\n * Get a session with defaults & applied sampling.\n */\nexport function makeSession(session: Partial<Session> & { sampled: Sampled }): Session {\n  const now = Date.now();\n  const id = session.id || uuid4();\n  // Note that this means we cannot set a started/lastActivity of `0`, but this should not be relevant outside of tests.\n  const started = session.started || now;\n  const lastActivity = session.lastActivity || now;\n  const segmentId = session.segmentId || 0;\n  const sampled = session.sampled;\n  const previousSessionId = session.previousSessionId;\n\n  return {\n    id,\n    started,\n    lastActivity,\n    segmentId,\n    sampled,\n    previousSessionId,\n  };\n}\n","import type { Sampled, Session, SessionOptions } from '../types';\nimport { isSampled } from '../util/isSampled';\nimport { saveSession } from './saveSession';\nimport { makeSession } from './Session';\n\n/**\n * Get the sampled status for a session based on sample rates & current sampled status.\n */\nexport function getSessionSampleType(sessionSampleRate: number, allowBuffering: boolean): Sampled {\n  return isSampled(sessionSampleRate) ? 'session' : allowBuffering ? 'buffer' : false;\n}\n\n/**\n * Create a new session, which in its current implementation is a Sentry event\n * that all replays will be saved to as attachments. Currently, we only expect\n * one of these Sentry events per \"replay session\".\n */\nexport function createSession(\n  { sessionSampleRate, allowBuffering, stickySession = false }: SessionOptions,\n  { previousSessionId }: { previousSessionId?: string } = {},\n): Session {\n  const sampled = getSessionSampleType(sessionSampleRate, allowBuffering);\n  const session = makeSession({\n    sampled,\n    previousSessionId,\n  });\n\n  if (stickySession) {\n    saveSession(session);\n  }\n\n  return session;\n}\n","/**\n * Given an initial timestamp and an expiry duration, checks to see if current\n * time should be considered as expired.\n */\nexport function isExpired(\n  initialTime: null | number,\n  expiry: undefined | number,\n  targetTime: number = +new Date(),\n): boolean {\n  // Always expired if < 0\n  if (initialTime === null || expiry === undefined || expiry < 0) {\n    return true;\n  }\n\n  // Never expires if == 0\n  if (expiry === 0) {\n    return false;\n  }\n\n  return initialTime + expiry <= targetTime;\n}\n","import type { Session } from '../types';\nimport { isExpired } from './isExpired';\n\n/**\n * Checks to see if session is expired\n */\nexport function isSessionExpired(\n  session: Session,\n  {\n    maxReplayDuration,\n    sessionIdleExpire,\n    targetTime = Date.now(),\n  }: { maxReplayDuration: number; sessionIdleExpire: number; targetTime?: number },\n): boolean {\n  return (\n    // First, check that maximum session length has not been exceeded\n    isExpired(session.started, maxReplayDuration, targetTime) ||\n    // check that the idle timeout has not been exceeded (i.e. user has\n    // performed an action within the last `sessionIdleExpire` ms)\n    isExpired(session.lastActivity, sessionIdleExpire, targetTime)\n  );\n}\n","import type { Session } from '../types';\nimport { isSessionExpired } from '../util/isSessionExpired';\n\n/** If the session should be refreshed or not. */\nexport function shouldRefreshSession(\n  session: Session,\n  { sessionIdleExpire, maxReplayDuration }: { sessionIdleExpire: number; maxReplayDuration: number },\n): boolean {\n  // If not expired, all good, just keep the session\n  if (!isSessionExpired(session, { sessionIdleExpire, maxReplayDuration })) {\n    return false;\n  }\n\n  // If we are buffering & haven't ever flushed yet, always continue\n  if (session.sampled === 'buffer' && session.segmentId === 0) {\n    return false;\n  }\n\n  return true;\n}\n","import type { Session, SessionOptions } from '../types';\nimport { logInfoNextTick } from '../util/log';\nimport { createSession } from './createSession';\nimport { fetchSession } from './fetchSession';\nimport { shouldRefreshSession } from './shouldRefreshSession';\n\n/**\n * Get or create a session, when initializing the replay.\n * Returns a session that may be unsampled.\n */\nexport function loadOrCreateSession(\n  {\n    traceInternals,\n    sessionIdleExpire,\n    maxReplayDuration,\n    previousSessionId,\n  }: {\n    sessionIdleExpire: number;\n    maxReplayDuration: number;\n    traceInternals?: boolean;\n    previousSessionId?: string;\n  },\n  sessionOptions: SessionOptions,\n): Session {\n  const existingSession = sessionOptions.stickySession && fetchSession(traceInternals);\n\n  // No session exists yet, just create a new one\n  if (!existingSession) {\n    logInfoNextTick('[Replay] Creating new session', traceInternals);\n    return createSession(sessionOptions, { previousSessionId });\n  }\n\n  if (!shouldRefreshSession(existingSession, { sessionIdleExpire, maxReplayDuration })) {\n    return existingSession;\n  }\n\n  logInfoNextTick('[Replay] Session in sessionStorage is expired, creating new one...');\n  return createSession(sessionOptions, { previousSessionId: existingSession.id });\n}\n","import { REPLAY_SESSION_KEY, WINDOW } from '../constants';\nimport type { Session } from '../types';\nimport { hasSessionStorage } from '../util/hasSessionStorage';\nimport { logInfoNextTick } from '../util/log';\nimport { makeSession } from './Session';\n\n/**\n * Fetches a session from storage\n */\nexport function fetchSession(traceInternals?: boolean): Session | null {\n  if (!hasSessionStorage()) {\n    return null;\n  }\n\n  try {\n    // This can throw if cookies are disabled\n    const sessionStringFromStorage = WINDOW.sessionStorage.getItem(REPLAY_SESSION_KEY);\n\n    if (!sessionStringFromStorage) {\n      return null;\n    }\n\n    const sessionObj = JSON.parse(sessionStringFromStorage) as Session;\n\n    logInfoNextTick('[Replay] Loading existing session', traceInternals);\n\n    return makeSession(sessionObj);\n  } catch {\n    return null;\n  }\n}\n","import { EventType } from '@sentry-internal/rrweb';\nimport { getCurrentHub } from '@sentry/core';\nimport { logger } from '@sentry/utils';\n\nimport { EventBufferSizeExceededError } from '../eventBuffer/error';\nimport type { AddEventResult, RecordingEvent, ReplayContainer, ReplayFrameEvent, ReplayPluginOptions } from '../types';\nimport { logInfo } from './log';\nimport { timestampToMs } from './timestamp';\n\nfunction isCustomEvent(event: RecordingEvent): event is ReplayFrameEvent {\n  return event.type === EventType.Custom;\n}\n\n/**\n * Add an event to the event buffer.\n * In contrast to `addEvent`, this does not return a promise & does not wait for the adding of the event to succeed/fail.\n * Instead this returns `true` if we tried to add the event, else false.\n * It returns `false` e.g. if we are paused, disabled, or out of the max replay duration.\n *\n * `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.\n */\nexport function addEventSync(replay: ReplayContainer, event: RecordingEvent, isCheckout?: boolean): boolean {\n  if (!shouldAddEvent(replay, event)) {\n    return false;\n  }\n\n  void _addEvent(replay, event, isCheckout);\n\n  return true;\n}\n\n/**\n * Add an event to the event buffer.\n * Resolves to `null` if no event was added, else to `void`.\n *\n * `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.\n */\nexport function addEvent(\n  replay: ReplayContainer,\n  event: RecordingEvent,\n  isCheckout?: boolean,\n): Promise<AddEventResult | null> {\n  if (!shouldAddEvent(replay, event)) {\n    return Promise.resolve(null);\n  }\n\n  return _addEvent(replay, event, isCheckout);\n}\n\nasync function _addEvent(\n  replay: ReplayContainer,\n  event: RecordingEvent,\n  isCheckout?: boolean,\n): Promise<AddEventResult | null> {\n  if (!replay.eventBuffer) {\n    return null;\n  }\n\n  try {\n    if (isCheckout && replay.recordingMode === 'buffer') {\n      replay.eventBuffer.clear();\n    }\n\n    if (isCheckout) {\n      replay.eventBuffer.hasCheckout = true;\n    }\n\n    const replayOptions = replay.getOptions();\n\n    const eventAfterPossibleCallback = maybeApplyCallback(event, replayOptions.beforeAddRecordingEvent);\n\n    if (!eventAfterPossibleCallback) {\n      return;\n    }\n\n    return await replay.eventBuffer.addEvent(eventAfterPossibleCallback);\n  } catch (error) {\n    const reason = error && error instanceof EventBufferSizeExceededError ? 'addEventSizeExceeded' : 'addEvent';\n\n    __DEBUG_BUILD__ && logger.error(error);\n    await replay.stop({ reason });\n\n    const client = getCurrentHub().getClient();\n\n    if (client) {\n      client.recordDroppedEvent('internal_sdk_error', 'replay');\n    }\n  }\n}\n\n/** Exported only for tests. */\nexport function shouldAddEvent(replay: ReplayContainer, event: RecordingEvent): boolean {\n  if (!replay.eventBuffer || replay.isPaused() || !replay.isEnabled()) {\n    return false;\n  }\n\n  const timestampInMs = timestampToMs(event.timestamp);\n\n  // Throw out events that happen more than 5 minutes ago. This can happen if\n  // page has been left open and idle for a long period of time and user\n  // comes back to trigger a new session. The performance entries rely on\n  // `performance.timeOrigin`, which is when the page first opened.\n  if (timestampInMs + replay.timeouts.sessionIdlePause < Date.now()) {\n    return false;\n  }\n\n  // Throw out events that are +60min from the initial timestamp\n  if (timestampInMs > replay.getContext().initialTimestamp + replay.getOptions().maxReplayDuration) {\n    logInfo(\n      `[Replay] Skipping event with timestamp ${timestampInMs} because it is after maxReplayDuration`,\n      replay.getOptions()._experiments.traceInternals,\n    );\n    return false;\n  }\n\n  return true;\n}\n\nfunction maybeApplyCallback(\n  event: RecordingEvent,\n  callback: ReplayPluginOptions['beforeAddRecordingEvent'],\n): RecordingEvent | null | undefined {\n  try {\n    if (typeof callback === 'function' && isCustomEvent(event)) {\n      return callback(event);\n    }\n  } catch (error) {\n    __DEBUG_BUILD__ &&\n      logger.error('[Replay] An error occured in the `beforeAddRecordingEvent` callback, skipping the event...', error);\n    return null;\n  }\n\n  return event;\n}\n","import type { ErrorEvent, Event, ReplayEvent, TransactionEvent } from '@sentry/types';\n\n/** If the event is an error event */\nexport function isErrorEvent(event: Event): event is ErrorEvent {\n  return !event.type;\n}\n\n/** If the event is a transaction event */\nexport function isTransactionEvent(event: Event): event is TransactionEvent {\n  return event.type === 'transaction';\n}\n\n/** If the event is an replay event */\nexport function isReplayEvent(event: Event): event is ReplayEvent {\n  return event.type === 'replay_event';\n}\n","import { getCurrentHub } from '@sentry/core';\nimport type { ErrorEvent, Event, TransactionEvent, Transport, TransportMakeRequestResponse } from '@sentry/types';\n\nimport type { ReplayContainer } from '../types';\nimport { isErrorEvent, isTransactionEvent } from '../util/eventUtils';\n\ntype AfterSendEventCallback = (event: Event, sendResponse: TransportMakeRequestResponse | void) => void;\n\n/**\n * Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`.\n */\nexport function handleAfterSendEvent(replay: ReplayContainer): AfterSendEventCallback {\n  // Custom transports may still be returning `Promise<void>`, which means we cannot expect the status code to be available there\n  // TODO (v8): remove this check as it will no longer be necessary\n  const enforceStatusCode = isBaseTransportSend();\n\n  return (event: Event, sendResponse: TransportMakeRequestResponse | void) => {\n    if (!replay.isEnabled() || (!isErrorEvent(event) && !isTransactionEvent(event))) {\n      return;\n    }\n\n    const statusCode = sendResponse && sendResponse.statusCode;\n\n    // We only want to do stuff on successful error sending, otherwise you get error replays without errors attached\n    // If not using the base transport, we allow `undefined` response (as a custom transport may not implement this correctly yet)\n    // If we do use the base transport, we skip if we encountered an non-OK status code\n    if (enforceStatusCode && (!statusCode || statusCode < 200 || statusCode >= 300)) {\n      return;\n    }\n\n    if (isTransactionEvent(event)) {\n      handleTransactionEvent(replay, event);\n      return;\n    }\n\n    handleErrorEvent(replay, event);\n  };\n}\n\nfunction handleTransactionEvent(replay: ReplayContainer, event: TransactionEvent): void {\n  const replayContext = replay.getContext();\n\n  // Collect traceIds in _context regardless of `recordingMode`\n  // In error mode, _context gets cleared on every checkout\n  // We limit to max. 100 transactions linked\n  if (event.contexts && event.contexts.trace && event.contexts.trace.trace_id && replayContext.traceIds.size < 100) {\n    replayContext.traceIds.add(event.contexts.trace.trace_id as string);\n  }\n}\n\nfunction handleErrorEvent(replay: ReplayContainer, event: ErrorEvent): void {\n  const replayContext = replay.getContext();\n\n  // Add error to list of errorIds of replay. This is ok to do even if not\n  // sampled because context will get reset at next checkout.\n  // XXX: There is also a race condition where it's possible to capture an\n  // error to Sentry before Replay SDK has loaded, but response returns after\n  // it was loaded, and this gets called.\n  // We limit to max. 100 errors linked\n  if (event.event_id && replayContext.errorIds.size < 100) {\n    replayContext.errorIds.add(event.event_id);\n  }\n\n  // If error event is tagged with replay id it means it was sampled (when in buffer mode)\n  // Need to be very careful that this does not cause an infinite loop\n  if (replay.recordingMode === 'buffer' && event.tags && event.tags.replayId) {\n    setTimeout(() => {\n      // Capture current event buffer as new replay\n      void replay.sendBufferedReplayOrFlush();\n    });\n  }\n}\n\nfunction isBaseTransportSend(): boolean {\n  const client = getCurrentHub().getClient();\n  if (!client) {\n    return false;\n  }\n\n  const transport = client.getTransport();\n  if (!transport) {\n    return false;\n  }\n\n  return (\n    (transport.send as Transport['send'] & { __sentry__baseTransport__?: true }).__sentry__baseTransport__ || false\n  );\n}\n","import { EventType } from '@sentry-internal/rrweb';\n\nimport type { AddEventResult, AllEntryData, ReplayContainer, ReplayPerformanceEntry } from '../types';\n\n/**\n * Create a \"span\" for each performance entry.\n */\nexport function createPerformanceSpans(\n  replay: ReplayContainer,\n  entries: ReplayPerformanceEntry<AllEntryData>[],\n): Promise<AddEventResult | null>[] {\n  return entries.map(({ type, start, end, name, data }) => {\n    const response = replay.throttledAddEvent({\n      type: EventType.Custom,\n      timestamp: start,\n      data: {\n        tag: 'performanceSpan',\n        payload: {\n          op: type,\n          description: name,\n          startTimestamp: start,\n          endTimestamp: end,\n          data,\n        },\n      },\n    });\n\n    // If response is a string, it means its either THROTTLED or SKIPPED\n    return typeof response === 'string' ? Promise.resolve(null) : response;\n  });\n}\n","import type { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../../types';\nimport { createPerformanceSpans } from '../../util/createPerformanceSpans';\nimport { shouldFilterRequest } from '../../util/shouldFilterRequest';\n\n/** Add a performance entry breadcrumb */\nexport function addNetworkBreadcrumb(\n  replay: ReplayContainer,\n  result: ReplayPerformanceEntry<NetworkRequestData> | null,\n): void {\n  if (!replay.isEnabled()) {\n    return;\n  }\n\n  if (result === null) {\n    return;\n  }\n\n  if (shouldFilterRequest(replay, result.name)) {\n    return;\n  }\n\n  replay.addUpdate(() => {\n    createPerformanceSpans(replay, [result]);\n    // Returning true will cause `addUpdate` to not flush\n    // We do not want network requests to cause a flush. This will prevent\n    // recurring/polling requests from keeping the replay session alive.\n    return true;\n  });\n}\n","import { getCurrentHub, isSentryRequestUrl } from '@sentry/core';\n\nimport type { ReplayContainer } from '../types';\n\n/**\n * Check whether a given request URL should be filtered out. This is so we\n * don't log Sentry ingest requests.\n */\nexport function shouldFilterRequest(replay: ReplayContainer, url: string): boolean {\n  // If we enabled the `traceInternals` experiment, we want to trace everything\n  if (__DEBUG_BUILD__ && replay.getOptions()._experiments.traceInternals) {\n    return false;\n  }\n\n  return isSentryRequestUrl(url, getCurrentHub());\n}\n","export const OBJ = 10;\nexport const OBJ_KEY = 11;\nexport const OBJ_KEY_STR = 12;\nexport const OBJ_VAL = 13;\nexport const OBJ_VAL_STR = 14;\nexport const OBJ_VAL_COMPLETED = 15;\n\nexport const ARR = 20;\nexport const ARR_VAL = 21;\nexport const ARR_VAL_STR = 22;\nexport const ARR_VAL_COMPLETED = 23;\n\nexport type JsonToken =\n  | typeof OBJ\n  | typeof OBJ_KEY\n  | typeof OBJ_KEY_STR\n  | typeof OBJ_VAL\n  | typeof OBJ_VAL_STR\n  | typeof OBJ_VAL_COMPLETED\n  | typeof ARR\n  | typeof ARR_VAL\n  | typeof ARR_VAL_STR\n  | typeof ARR_VAL_COMPLETED;\n","import type { JsonToken } from './constants';\nimport {\n  ARR,\n  ARR_VAL,\n  ARR_VAL_COMPLETED,\n  ARR_VAL_STR,\n  OBJ,\n  OBJ_KEY,\n  OBJ_KEY_STR,\n  OBJ_VAL,\n  OBJ_VAL_COMPLETED,\n  OBJ_VAL_STR,\n} from './constants';\n\nconst ALLOWED_PRIMITIVES = ['true', 'false', 'null'];\n\n/**\n * Complete an incomplete JSON string.\n * This will ensure that the last element always has a `\"~~\"` to indicate it was truncated.\n * For example, `[1,2,` will be completed to `[1,2,\"~~\"]`\n * and `{\"aa\":\"b` will be completed to `{\"aa\":\"b~~\"}`\n */\nexport function completeJson(incompleteJson: string, stack: JsonToken[]): string {\n  if (!stack.length) {\n    return incompleteJson;\n  }\n\n  let json = incompleteJson;\n\n  // Most checks are only needed for the last step in the stack\n  const lastPos = stack.length - 1;\n  const lastStep = stack[lastPos];\n\n  json = _fixLastStep(json, lastStep);\n\n  // Complete remaining steps - just add closing brackets\n  for (let i = lastPos; i >= 0; i--) {\n    const step = stack[i];\n\n    switch (step) {\n      case OBJ:\n        json = `${json}}`;\n        break;\n      case ARR:\n        json = `${json}]`;\n        break;\n    }\n  }\n\n  return json;\n}\n\nfunction _fixLastStep(json: string, lastStep: JsonToken): string {\n  switch (lastStep) {\n    // Object cases\n    case OBJ:\n      return `${json}\"~~\":\"~~\"`;\n    case OBJ_KEY:\n      return `${json}:\"~~\"`;\n    case OBJ_KEY_STR:\n      return `${json}~~\":\"~~\"`;\n    case OBJ_VAL:\n      return _maybeFixIncompleteObjValue(json);\n    case OBJ_VAL_STR:\n      return `${json}~~\"`;\n    case OBJ_VAL_COMPLETED:\n      return `${json},\"~~\":\"~~\"`;\n\n    // Array cases\n    case ARR:\n      return `${json}\"~~\"`;\n    case ARR_VAL:\n      return _maybeFixIncompleteArrValue(json);\n    case ARR_VAL_STR:\n      return `${json}~~\"`;\n    case ARR_VAL_COMPLETED:\n      return `${json},\"~~\"`;\n  }\n\n  return json;\n}\n\nfunction _maybeFixIncompleteArrValue(json: string): string {\n  const pos = _findLastArrayDelimiter(json);\n\n  if (pos > -1) {\n    const part = json.slice(pos + 1);\n\n    if (ALLOWED_PRIMITIVES.includes(part.trim())) {\n      return `${json},\"~~\"`;\n    }\n\n    // Everything else is replaced with `\"~~\"`\n    return `${json.slice(0, pos + 1)}\"~~\"`;\n  }\n\n  // fallback, this shouldn't happen, to be save\n  return json;\n}\n\nfunction _findLastArrayDelimiter(json: string): number {\n  for (let i = json.length - 1; i >= 0; i--) {\n    const char = json[i];\n\n    if (char === ',' || char === '[') {\n      return i;\n    }\n  }\n\n  return -1;\n}\n\nfunction _maybeFixIncompleteObjValue(json: string): string {\n  const startPos = json.lastIndexOf(':');\n\n  const part = json.slice(startPos + 1);\n\n  if (ALLOWED_PRIMITIVES.includes(part.trim())) {\n    return `${json},\"~~\":\"~~\"`;\n  }\n\n  // Everything else is replaced with `\"~~\"`\n  // This also means we do not have incomplete numbers, e.g `[1` is replaced with `[\"~~\"]`\n  return `${json.slice(0, startPos + 1)}\"~~\"`;\n}\n","import type { JsonToken } from './constants';\nimport {\n  ARR,\n  ARR_VAL,\n  ARR_VAL_COMPLETED,\n  ARR_VAL_STR,\n  OBJ,\n  OBJ_KEY,\n  OBJ_KEY_STR,\n  OBJ_VAL,\n  OBJ_VAL_COMPLETED,\n  OBJ_VAL_STR,\n} from './constants';\n\n/**\n * Evaluate an (incomplete) JSON string.\n */\nexport function evaluateJson(json: string): JsonToken[] {\n  const stack: JsonToken[] = [];\n\n  for (let pos = 0; pos < json.length; pos++) {\n    _evaluateJsonPos(stack, json, pos);\n  }\n\n  return stack;\n}\n\nfunction _evaluateJsonPos(stack: JsonToken[], json: string, pos: number): void {\n  const curStep = stack[stack.length - 1];\n\n  const char = json[pos];\n\n  const whitespaceRegex = /\\s/;\n\n  if (whitespaceRegex.test(char)) {\n    return;\n  }\n\n  if (char === '\"' && !_isEscaped(json, pos)) {\n    _handleQuote(stack, curStep);\n    return;\n  }\n\n  switch (char) {\n    case '{':\n      _handleObj(stack, curStep);\n      break;\n    case '[':\n      _handleArr(stack, curStep);\n      break;\n    case ':':\n      _handleColon(stack, curStep);\n      break;\n    case ',':\n      _handleComma(stack, curStep);\n      break;\n    case '}':\n      _handleObjClose(stack, curStep);\n      break;\n    case ']':\n      _handleArrClose(stack, curStep);\n      break;\n  }\n}\n\nfunction _handleQuote(stack: JsonToken[], curStep: JsonToken): void {\n  // End of obj value\n  if (curStep === OBJ_VAL_STR) {\n    stack.pop();\n    stack.push(OBJ_VAL_COMPLETED);\n    return;\n  }\n\n  // End of arr value\n  if (curStep === ARR_VAL_STR) {\n    stack.pop();\n    stack.push(ARR_VAL_COMPLETED);\n    return;\n  }\n\n  // Start of obj value\n  if (curStep === OBJ_VAL) {\n    stack.push(OBJ_VAL_STR);\n    return;\n  }\n\n  // Start of arr value\n  if (curStep === ARR_VAL) {\n    stack.push(ARR_VAL_STR);\n    return;\n  }\n\n  // Start of obj key\n  if (curStep === OBJ) {\n    stack.push(OBJ_KEY_STR);\n    return;\n  }\n\n  // End of obj key\n  if (curStep === OBJ_KEY_STR) {\n    stack.pop();\n    stack.push(OBJ_KEY);\n    return;\n  }\n}\n\nfunction _handleObj(stack: JsonToken[], curStep: JsonToken): void {\n  // Initial object\n  if (!curStep) {\n    stack.push(OBJ);\n    return;\n  }\n\n  // New object as obj value\n  if (curStep === OBJ_VAL) {\n    stack.push(OBJ);\n    return;\n  }\n\n  // New object as array element\n  if (curStep === ARR_VAL) {\n    stack.push(OBJ);\n  }\n\n  // New object as first array element\n  if (curStep === ARR) {\n    stack.push(OBJ);\n    return;\n  }\n}\n\nfunction _handleArr(stack: JsonToken[], curStep: JsonToken): void {\n  // Initial array\n  if (!curStep) {\n    stack.push(ARR);\n    stack.push(ARR_VAL);\n    return;\n  }\n\n  // New array as obj value\n  if (curStep === OBJ_VAL) {\n    stack.push(ARR);\n    stack.push(ARR_VAL);\n    return;\n  }\n\n  // New array as array element\n  if (curStep === ARR_VAL) {\n    stack.push(ARR);\n    stack.push(ARR_VAL);\n  }\n\n  // New array as first array element\n  if (curStep === ARR) {\n    stack.push(ARR);\n    stack.push(ARR_VAL);\n    return;\n  }\n}\n\nfunction _handleColon(stack: JsonToken[], curStep: JsonToken): void {\n  if (curStep === OBJ_KEY) {\n    stack.pop();\n    stack.push(OBJ_VAL);\n  }\n}\n\nfunction _handleComma(stack: JsonToken[], curStep: JsonToken): void {\n  // Comma after obj value\n  if (curStep === OBJ_VAL) {\n    stack.pop();\n    return;\n  }\n  if (curStep === OBJ_VAL_COMPLETED) {\n    // Pop OBJ_VAL_COMPLETED & OBJ_VAL\n    stack.pop();\n    stack.pop();\n    return;\n  }\n\n  // Comma after arr value\n  if (curStep === ARR_VAL) {\n    // do nothing - basically we'd pop ARR_VAL but add it right back\n    return;\n  }\n\n  if (curStep === ARR_VAL_COMPLETED) {\n    // Pop ARR_VAL_COMPLETED\n    stack.pop();\n\n    // basically we'd pop ARR_VAL but add it right back\n    return;\n  }\n}\n\nfunction _handleObjClose(stack: JsonToken[], curStep: JsonToken): void {\n  // Empty object {}\n  if (curStep === OBJ) {\n    stack.pop();\n  }\n\n  // Object with element\n  if (curStep === OBJ_VAL) {\n    // Pop OBJ_VAL, OBJ\n    stack.pop();\n    stack.pop();\n  }\n\n  // Obj with element\n  if (curStep === OBJ_VAL_COMPLETED) {\n    // Pop OBJ_VAL_COMPLETED, OBJ_VAL, OBJ\n    stack.pop();\n    stack.pop();\n    stack.pop();\n  }\n\n  // if was obj value, complete it\n  if (stack[stack.length - 1] === OBJ_VAL) {\n    stack.push(OBJ_VAL_COMPLETED);\n  }\n\n  // if was arr value, complete it\n  if (stack[stack.length - 1] === ARR_VAL) {\n    stack.push(ARR_VAL_COMPLETED);\n  }\n}\n\nfunction _handleArrClose(stack: JsonToken[], curStep: JsonToken): void {\n  // Empty array []\n  if (curStep === ARR) {\n    stack.pop();\n  }\n\n  // Array with element\n  if (curStep === ARR_VAL) {\n    // Pop ARR_VAL, ARR\n    stack.pop();\n    stack.pop();\n  }\n\n  // Array with element\n  if (curStep === ARR_VAL_COMPLETED) {\n    // Pop ARR_VAL_COMPLETED, ARR_VAL, ARR\n    stack.pop();\n    stack.pop();\n    stack.pop();\n  }\n\n  // if was obj value, complete it\n  if (stack[stack.length - 1] === OBJ_VAL) {\n    stack.push(OBJ_VAL_COMPLETED);\n  }\n\n  // if was arr value, complete it\n  if (stack[stack.length - 1] === ARR_VAL) {\n    stack.push(ARR_VAL_COMPLETED);\n  }\n}\n\nfunction _isEscaped(str: string, pos: number): boolean {\n  const previousChar = str[pos - 1];\n\n  return previousChar === '\\\\' && !_isEscaped(str, pos - 1);\n}\n","/* eslint-disable max-lines */\n\nimport { completeJson } from './completeJson';\nimport { evaluateJson } from './evaluateJson';\n\n/**\n * Takes an incomplete JSON string, and returns a hopefully valid JSON string.\n * Note that this _can_ fail, so you should check the return value is valid JSON.\n */\nexport function fixJson(incompleteJson: string): string {\n  const stack = evaluateJson(incompleteJson);\n\n  return completeJson(incompleteJson, stack);\n}\n","import type { TextEncoderInternal } from '@sentry/types';\nimport { dropUndefinedKeys, stringMatchesSomePattern } from '@sentry/utils';\n\nimport { NETWORK_BODY_MAX_SIZE, WINDOW } from '../../constants';\nimport type {\n  NetworkBody,\n  NetworkMetaWarning,\n  NetworkRequestData,\n  ReplayNetworkRequestData,\n  ReplayNetworkRequestOrResponse,\n  ReplayPerformanceEntry,\n} from '../../types';\nimport { fixJson } from '../../util/truncateJson/fixJson';\n\n/** Get the size of a body. */\nexport function getBodySize(\n  body: RequestInit['body'],\n  textEncoder: TextEncoder | TextEncoderInternal,\n): number | undefined {\n  if (!body) {\n    return undefined;\n  }\n\n  try {\n    if (typeof body === 'string') {\n      return textEncoder.encode(body).length;\n    }\n\n    if (body instanceof URLSearchParams) {\n      return textEncoder.encode(body.toString()).length;\n    }\n\n    if (body instanceof FormData) {\n      const formDataStr = _serializeFormData(body);\n      return textEncoder.encode(formDataStr).length;\n    }\n\n    if (body instanceof Blob) {\n      return body.size;\n    }\n\n    if (body instanceof ArrayBuffer) {\n      return body.byteLength;\n    }\n\n    // Currently unhandled types: ArrayBufferView, ReadableStream\n  } catch {\n    // just return undefined\n  }\n\n  return undefined;\n}\n\n/** Convert a Content-Length header to number/undefined.  */\nexport function parseContentLengthHeader(header: string | null | undefined): number | undefined {\n  if (!header) {\n    return undefined;\n  }\n\n  const size = parseInt(header, 10);\n  return isNaN(size) ? undefined : size;\n}\n\n/** Get the string representation of a body. */\nexport function getBodyString(body: unknown): string | undefined {\n  if (typeof body === 'string') {\n    return body;\n  }\n\n  if (body instanceof URLSearchParams) {\n    return body.toString();\n  }\n\n  if (body instanceof FormData) {\n    return _serializeFormData(body);\n  }\n\n  return undefined;\n}\n\n/** Convert ReplayNetworkRequestData to a PerformanceEntry. */\nexport function makeNetworkReplayBreadcrumb(\n  type: string,\n  data: ReplayNetworkRequestData | null,\n): ReplayPerformanceEntry<NetworkRequestData> | null {\n  if (!data) {\n    return null;\n  }\n\n  const { startTimestamp, endTimestamp, url, method, statusCode, request, response } = data;\n\n  const result: ReplayPerformanceEntry<NetworkRequestData> = {\n    type,\n    start: startTimestamp / 1000,\n    end: endTimestamp / 1000,\n    name: url,\n    data: dropUndefinedKeys({\n      method,\n      statusCode,\n      request,\n      response,\n    }),\n  };\n\n  return result;\n}\n\n/** Get either a JSON network body, or a text representation. */\nexport function getNetworkBody(bodyText: string | undefined): NetworkBody | undefined {\n  if (!bodyText) {\n    return;\n  }\n\n  try {\n    return JSON.parse(bodyText);\n  } catch {\n    // return text\n  }\n\n  return bodyText;\n}\n\n/** Build the request or response part of a replay network breadcrumb that was skipped. */\nexport function buildSkippedNetworkRequestOrResponse(bodySize: number | undefined): ReplayNetworkRequestOrResponse {\n  return {\n    headers: {},\n    size: bodySize,\n    _meta: {\n      warnings: ['URL_SKIPPED'],\n    },\n  };\n}\n\n/** Build the request or response part of a replay network breadcrumb. */\nexport function buildNetworkRequestOrResponse(\n  headers: Record<string, string>,\n  bodySize: number | undefined,\n  body: string | undefined,\n): ReplayNetworkRequestOrResponse | undefined {\n  if (!bodySize && Object.keys(headers).length === 0) {\n    return undefined;\n  }\n\n  if (!bodySize) {\n    return {\n      headers,\n    };\n  }\n\n  if (!body) {\n    return {\n      headers,\n      size: bodySize,\n    };\n  }\n\n  const info: ReplayNetworkRequestOrResponse = {\n    headers,\n    size: bodySize,\n  };\n\n  const { body: normalizedBody, warnings } = normalizeNetworkBody(body);\n  info.body = normalizedBody;\n  if (warnings.length > 0) {\n    info._meta = {\n      warnings,\n    };\n  }\n\n  return info;\n}\n\n/** Filter a set of headers */\nexport function getAllowedHeaders(headers: Record<string, string>, allowedHeaders: string[]): Record<string, string> {\n  return Object.keys(headers).reduce((filteredHeaders: Record<string, string>, key: string) => {\n    const normalizedKey = key.toLowerCase();\n    // Avoid putting empty strings into the headers\n    if (allowedHeaders.includes(normalizedKey) && headers[key]) {\n      filteredHeaders[normalizedKey] = headers[key];\n    }\n    return filteredHeaders;\n  }, {});\n}\n\nfunction _serializeFormData(formData: FormData): string {\n  // This is a bit simplified, but gives us a decent estimate\n  // This converts e.g. { name: 'Anne Smith', age: 13 } to 'name=Anne+Smith&age=13'\n  // @ts-expect-error passing FormData to URLSearchParams actually works\n  return new URLSearchParams(formData).toString();\n}\n\nfunction normalizeNetworkBody(body: string | undefined): {\n  body: NetworkBody | undefined;\n  warnings: NetworkMetaWarning[];\n} {\n  if (!body || typeof body !== 'string') {\n    return {\n      body,\n      warnings: [],\n    };\n  }\n\n  const exceedsSizeLimit = body.length > NETWORK_BODY_MAX_SIZE;\n\n  if (_strIsProbablyJson(body)) {\n    try {\n      const json = exceedsSizeLimit ? fixJson(body.slice(0, NETWORK_BODY_MAX_SIZE)) : body;\n      const normalizedBody = JSON.parse(json);\n      return {\n        body: normalizedBody,\n        warnings: exceedsSizeLimit ? ['JSON_TRUNCATED'] : [],\n      };\n    } catch {\n      return {\n        body: exceedsSizeLimit ? `${body.slice(0, NETWORK_BODY_MAX_SIZE)}…` : body,\n        warnings: exceedsSizeLimit ? ['INVALID_JSON', 'TEXT_TRUNCATED'] : ['INVALID_JSON'],\n      };\n    }\n  }\n\n  return {\n    body: exceedsSizeLimit ? `${body.slice(0, NETWORK_BODY_MAX_SIZE)}…` : body,\n    warnings: exceedsSizeLimit ? ['TEXT_TRUNCATED'] : [],\n  };\n}\n\nfunction _strIsProbablyJson(str: string): boolean {\n  const first = str[0];\n  const last = str[str.length - 1];\n\n  // Simple check: If this does not start & end with {} or [], it's not JSON\n  return (first === '[' && last === ']') || (first === '{' && last === '}');\n}\n\n/** Match an URL against a list of strings/Regex. */\nexport function urlMatches(url: string, urls: (string | RegExp)[]): boolean {\n  const fullUrl = getFullUrl(url);\n\n  return stringMatchesSomePattern(fullUrl, urls);\n}\n\n/** exported for tests */\nexport function getFullUrl(url: string, baseURI = WINDOW.document.baseURI): string {\n  // Short circuit for common cases:\n  if (url.startsWith('http://') || url.startsWith('https://') || url.startsWith(WINDOW.location.origin)) {\n    return url;\n  }\n  const fixedUrl = new URL(url, baseURI);\n\n  // If these do not match, we are not dealing with a relative URL, so just return it\n  if (fixedUrl.origin !== new URL(baseURI).origin) {\n    return url;\n  }\n\n  const fullUrl = fixedUrl.href;\n\n  // Remove trailing slashes, if they don't match the original URL\n  if (!url.endsWith('/') && fullUrl.endsWith('/')) {\n    return fullUrl.slice(0, -1);\n  }\n\n  return fullUrl;\n}\n","import type { Breadcrumb, FetchBreadcrumbData, TextEncoderInternal } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport type {\n  FetchHint,\n  ReplayContainer,\n  ReplayNetworkOptions,\n  ReplayNetworkRequestData,\n  ReplayNetworkRequestOrResponse,\n} from '../../types';\nimport { addNetworkBreadcrumb } from './addNetworkBreadcrumb';\nimport {\n  buildNetworkRequestOrResponse,\n  buildSkippedNetworkRequestOrResponse,\n  getAllowedHeaders,\n  getBodySize,\n  getBodyString,\n  makeNetworkReplayBreadcrumb,\n  parseContentLengthHeader,\n  urlMatches,\n} from './networkUtils';\n\n/**\n * Capture a fetch breadcrumb to a replay.\n * This adds additional data (where approriate).\n */\nexport async function captureFetchBreadcrumbToReplay(\n  breadcrumb: Breadcrumb & { data: FetchBreadcrumbData },\n  hint: FetchHint,\n  options: ReplayNetworkOptions & {\n    textEncoder: TextEncoderInternal;\n    replay: ReplayContainer;\n  },\n): Promise<void> {\n  try {\n    const data = await _prepareFetchData(breadcrumb, hint, options);\n\n    // Create a replay performance entry from this breadcrumb\n    const result = makeNetworkReplayBreadcrumb('resource.fetch', data);\n    addNetworkBreadcrumb(options.replay, result);\n  } catch (error) {\n    __DEBUG_BUILD__ && logger.error('[Replay] Failed to capture fetch breadcrumb', error);\n  }\n}\n\n/**\n * Enrich a breadcrumb with additional data.\n * This has to be sync & mutate the given breadcrumb,\n * as the breadcrumb is afterwards consumed by other handlers.\n */\nexport function enrichFetchBreadcrumb(\n  breadcrumb: Breadcrumb & { data: FetchBreadcrumbData },\n  hint: FetchHint,\n  options: { textEncoder: TextEncoderInternal },\n): void {\n  const { input, response } = hint;\n\n  const body = _getFetchRequestArgBody(input);\n  const reqSize = getBodySize(body, options.textEncoder);\n\n  const resSize = response ? parseContentLengthHeader(response.headers.get('content-length')) : undefined;\n\n  if (reqSize !== undefined) {\n    breadcrumb.data.request_body_size = reqSize;\n  }\n  if (resSize !== undefined) {\n    breadcrumb.data.response_body_size = resSize;\n  }\n}\n\nasync function _prepareFetchData(\n  breadcrumb: Breadcrumb & { data: FetchBreadcrumbData },\n  hint: FetchHint,\n  options: ReplayNetworkOptions & {\n    textEncoder: TextEncoderInternal;\n  },\n): Promise<ReplayNetworkRequestData> {\n  const { startTimestamp, endTimestamp } = hint;\n\n  const {\n    url,\n    method,\n    status_code: statusCode = 0,\n    request_body_size: requestBodySize,\n    response_body_size: responseBodySize,\n  } = breadcrumb.data;\n\n  const captureDetails =\n    urlMatches(url, options.networkDetailAllowUrls) && !urlMatches(url, options.networkDetailDenyUrls);\n\n  const request = captureDetails\n    ? _getRequestInfo(options, hint.input, requestBodySize)\n    : buildSkippedNetworkRequestOrResponse(requestBodySize);\n  const response = await _getResponseInfo(captureDetails, options, hint.response, responseBodySize);\n\n  return {\n    startTimestamp,\n    endTimestamp,\n    url,\n    method,\n    statusCode,\n    request,\n    response,\n  };\n}\n\nfunction _getRequestInfo(\n  { networkCaptureBodies, networkRequestHeaders }: ReplayNetworkOptions,\n  input: FetchHint['input'],\n  requestBodySize?: number,\n): ReplayNetworkRequestOrResponse | undefined {\n  const headers = getRequestHeaders(input, networkRequestHeaders);\n\n  if (!networkCaptureBodies) {\n    return buildNetworkRequestOrResponse(headers, requestBodySize, undefined);\n  }\n\n  // We only want to transmit string or string-like bodies\n  const requestBody = _getFetchRequestArgBody(input);\n  const bodyStr = getBodyString(requestBody);\n  return buildNetworkRequestOrResponse(headers, requestBodySize, bodyStr);\n}\n\nasync function _getResponseInfo(\n  captureDetails: boolean,\n  {\n    networkCaptureBodies,\n    textEncoder,\n    networkResponseHeaders,\n  }: ReplayNetworkOptions & {\n    textEncoder: TextEncoderInternal;\n  },\n  response: Response,\n  responseBodySize?: number,\n): Promise<ReplayNetworkRequestOrResponse | undefined> {\n  if (!captureDetails && responseBodySize !== undefined) {\n    return buildSkippedNetworkRequestOrResponse(responseBodySize);\n  }\n\n  const headers = getAllHeaders(response.headers, networkResponseHeaders);\n\n  if (!networkCaptureBodies && responseBodySize !== undefined) {\n    return buildNetworkRequestOrResponse(headers, responseBodySize, undefined);\n  }\n\n  // Only clone the response if we need to\n  try {\n    // We have to clone this, as the body can only be read once\n    const res = response.clone();\n    const bodyText = await _parseFetchBody(res);\n\n    const size =\n      bodyText && bodyText.length && responseBodySize === undefined\n        ? getBodySize(bodyText, textEncoder)\n        : responseBodySize;\n\n    if (!captureDetails) {\n      return buildSkippedNetworkRequestOrResponse(size);\n    }\n\n    if (networkCaptureBodies) {\n      return buildNetworkRequestOrResponse(headers, size, bodyText);\n    }\n\n    return buildNetworkRequestOrResponse(headers, size, undefined);\n  } catch {\n    // fallback\n    return buildNetworkRequestOrResponse(headers, responseBodySize, undefined);\n  }\n}\n\nasync function _parseFetchBody(response: Response): Promise<string | undefined> {\n  try {\n    return await response.text();\n  } catch {\n    return undefined;\n  }\n}\n\nfunction _getFetchRequestArgBody(fetchArgs: unknown[] = []): RequestInit['body'] | undefined {\n  // We only support getting the body from the fetch options\n  if (fetchArgs.length !== 2 || typeof fetchArgs[1] !== 'object') {\n    return undefined;\n  }\n\n  return (fetchArgs[1] as RequestInit).body;\n}\n\nfunction getAllHeaders(headers: Headers, allowedHeaders: string[]): Record<string, string> {\n  const allHeaders: Record<string, string> = {};\n\n  allowedHeaders.forEach(header => {\n    if (headers.get(header)) {\n      allHeaders[header] = headers.get(header) as string;\n    }\n  });\n\n  return allHeaders;\n}\n\nfunction getRequestHeaders(fetchArgs: unknown[], allowedHeaders: string[]): Record<string, string> {\n  if (fetchArgs.length === 1 && typeof fetchArgs[0] !== 'string') {\n    return getHeadersFromOptions(fetchArgs[0] as Request | RequestInit, allowedHeaders);\n  }\n\n  if (fetchArgs.length === 2) {\n    return getHeadersFromOptions(fetchArgs[1] as Request | RequestInit, allowedHeaders);\n  }\n\n  return {};\n}\n\nfunction getHeadersFromOptions(\n  input: Request | RequestInit | undefined,\n  allowedHeaders: string[],\n): Record<string, string> {\n  if (!input) {\n    return {};\n  }\n\n  const headers = input.headers;\n\n  if (!headers) {\n    return {};\n  }\n\n  if (headers instanceof Headers) {\n    return getAllHeaders(headers, allowedHeaders);\n  }\n\n  // We do not support this, as it is not really documented (anymore?)\n  if (Array.isArray(headers)) {\n    return {};\n  }\n\n  return getAllowedHeaders(headers, allowedHeaders);\n}\n","import type { Breadcrumb, Scope } from '@sentry/types';\nimport { normalize } from '@sentry/utils';\n\nimport { CONSOLE_ARG_MAX_SIZE } from '../constants';\nimport type { ReplayContainer } from '../types';\nimport type { ReplayFrame } from '../types/replayFrame';\nimport { createBreadcrumb } from '../util/createBreadcrumb';\nimport { fixJson } from '../util/truncateJson/fixJson';\nimport { addBreadcrumbEvent } from './util/addBreadcrumbEvent';\n\nlet _LAST_BREADCRUMB: null | Breadcrumb = null;\n\ntype BreadcrumbWithCategory = Required<Pick<Breadcrumb, 'category'>>;\n\nfunction isBreadcrumbWithCategory(breadcrumb: Breadcrumb): breadcrumb is BreadcrumbWithCategory {\n  return !!breadcrumb.category;\n}\n\nexport const handleScopeListener: (replay: ReplayContainer) => (scope: Scope) => void =\n  (replay: ReplayContainer) =>\n  (scope: Scope): void => {\n    if (!replay.isEnabled()) {\n      return;\n    }\n\n    const result = handleScope(scope);\n\n    if (!result) {\n      return;\n    }\n\n    addBreadcrumbEvent(replay, result);\n  };\n\n/**\n * An event handler to handle scope changes.\n */\nexport function handleScope(scope: Scope): Breadcrumb | null {\n  // TODO (v8): Remove this guard. This was put in place because we introduced\n  // Scope.getLastBreadcrumb mid-v7 which caused incompatibilities with older SDKs.\n  // For now, we'll just return null if the method doesn't exist but we should eventually\n  // get rid of this guard.\n  const newBreadcrumb = scope.getLastBreadcrumb && scope.getLastBreadcrumb();\n\n  // Listener can be called when breadcrumbs have not changed, so we store the\n  // reference to the last crumb and only return a crumb if it has changed\n  if (_LAST_BREADCRUMB === newBreadcrumb || !newBreadcrumb) {\n    return null;\n  }\n\n  _LAST_BREADCRUMB = newBreadcrumb;\n\n  if (\n    !isBreadcrumbWithCategory(newBreadcrumb) ||\n    ['fetch', 'xhr', 'sentry.event', 'sentry.transaction'].includes(newBreadcrumb.category) ||\n    newBreadcrumb.category.startsWith('ui.')\n  ) {\n    return null;\n  }\n\n  if (newBreadcrumb.category === 'console') {\n    return normalizeConsoleBreadcrumb(newBreadcrumb);\n  }\n\n  return createBreadcrumb(newBreadcrumb);\n}\n\n/** exported for tests only */\nexport function normalizeConsoleBreadcrumb(\n  breadcrumb: Omit<Breadcrumb, 'category'> & BreadcrumbWithCategory,\n): ReplayFrame {\n  const args = breadcrumb.data && breadcrumb.data.arguments;\n\n  if (!Array.isArray(args) || args.length === 0) {\n    return createBreadcrumb(breadcrumb);\n  }\n\n  let isTruncated = false;\n\n  // Avoid giant args captures\n  const normalizedArgs = args.map(arg => {\n    if (!arg) {\n      return arg;\n    }\n    if (typeof arg === 'string') {\n      if (arg.length > CONSOLE_ARG_MAX_SIZE) {\n        isTruncated = true;\n        return `${arg.slice(0, CONSOLE_ARG_MAX_SIZE)}…`;\n      }\n\n      return arg;\n    }\n    if (typeof arg === 'object') {\n      try {\n        const normalizedArg = normalize(arg, 7);\n        const stringified = JSON.stringify(normalizedArg);\n        if (stringified.length > CONSOLE_ARG_MAX_SIZE) {\n          const fixedJson = fixJson(stringified.slice(0, CONSOLE_ARG_MAX_SIZE));\n          const json = JSON.parse(fixedJson);\n          // We only set this after JSON.parse() was successfull, so we know we didn't run into `catch`\n          isTruncated = true;\n          return json;\n        }\n        return normalizedArg;\n      } catch {\n        // fall back to default\n      }\n    }\n\n    return arg;\n  });\n\n  return createBreadcrumb({\n    ...breadcrumb,\n    data: {\n      ...breadcrumb.data,\n      arguments: normalizedArgs,\n      ...(isTruncated ? { _meta: { warnings: ['CONSOLE_ARG_TRUNCATED'] } } : {}),\n    },\n  });\n}\n","import type { BaseClient } from '@sentry/core';\nimport { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport type { Client, DynamicSamplingContext } from '@sentry/types';\nimport { addInstrumentationHandler } from '@sentry/utils';\n\nimport { handleAfterSendEvent } from '../coreHandlers/handleAfterSendEvent';\nimport { handleDomListener } from '../coreHandlers/handleDom';\nimport { handleGlobalEventListener } from '../coreHandlers/handleGlobalEvent';\nimport { handleHistorySpanListener } from '../coreHandlers/handleHistory';\nimport { handleNetworkBreadcrumbs } from '../coreHandlers/handleNetworkBreadcrumbs';\nimport { handleScopeListener } from '../coreHandlers/handleScope';\nimport type { ReplayContainer } from '../types';\n\n/**\n * Add global listeners that cannot be removed.\n */\nexport function addGlobalListeners(replay: ReplayContainer): void {\n  // Listeners from core SDK //\n  const scope = getCurrentHub().getScope();\n  const client = getCurrentHub().getClient();\n\n  scope.addScopeListener(handleScopeListener(replay));\n  addInstrumentationHandler('dom', handleDomListener(replay));\n  addInstrumentationHandler('history', handleHistorySpanListener(replay));\n  handleNetworkBreadcrumbs(replay);\n\n  // Tag all (non replay) events that get sent to Sentry with the current\n  // replay ID so that we can reference them later in the UI\n  const eventProcessor = handleGlobalEventListener(replay, !hasHooks(client));\n  if (client && client.addEventProcessor) {\n    client.addEventProcessor(eventProcessor);\n  } else {\n    addGlobalEventProcessor(eventProcessor);\n  }\n\n  // If a custom client has no hooks yet, we continue to use the \"old\" implementation\n  if (hasHooks(client)) {\n    client.on('afterSendEvent', handleAfterSendEvent(replay));\n    client.on('createDsc', (dsc: DynamicSamplingContext) => {\n      const replayId = replay.getSessionId();\n      // We do not want to set the DSC when in buffer mode, as that means the replay has not been sent (yet)\n      if (replayId && replay.isEnabled() && replay.recordingMode === 'session') {\n        dsc.replay_id = replayId;\n      }\n    });\n\n    client.on('startTransaction', transaction => {\n      replay.lastTransaction = transaction;\n    });\n\n    // We may be missing the initial startTransaction due to timing issues,\n    // so we capture it on finish again.\n    client.on('finishTransaction', transaction => {\n      replay.lastTransaction = transaction;\n    });\n  }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction hasHooks(client: Client | undefined): client is BaseClient<any> {\n  return !!(client && client.on);\n}\n","import { WINDOW } from '../constants';\nimport type { AddEventResult, MemoryData, ReplayContainer, ReplayPerformanceEntry } from '../types';\nimport { createPerformanceSpans } from './createPerformanceSpans';\n\ntype ReplayMemoryEntry = ReplayPerformanceEntry<MemoryData> & { data: { memory: MemoryInfo } };\n\ninterface MemoryInfo {\n  jsHeapSizeLimit: number;\n  totalJSHeapSize: number;\n  usedJSHeapSize: number;\n}\n\n/**\n * Create a \"span\" for the total amount of memory being used by JS objects\n * (including v8 internal objects).\n */\nexport async function addMemoryEntry(replay: ReplayContainer): Promise<Array<AddEventResult | null>> {\n  // window.performance.memory is a non-standard API and doesn't work on all browsers, so we try-catch this\n  try {\n    return Promise.all(\n      createPerformanceSpans(replay, [\n        // @ts-expect-error memory doesn't exist on type Performance as the API is non-standard (we check that it exists above)\n        createMemoryEntry(WINDOW.performance.memory),\n      ]),\n    );\n  } catch (error) {\n    // Do nothing\n    return [];\n  }\n}\n\nfunction createMemoryEntry(memoryEntry: MemoryInfo): ReplayMemoryEntry {\n  const { jsHeapSizeLimit, totalJSHeapSize, usedJSHeapSize } = memoryEntry;\n  // we don't want to use `getAbsoluteTime` because it adds the event time to the\n  // time origin, so we get the current timestamp instead\n  const time = Date.now() / 1000;\n  return {\n    type: 'memory',\n    name: 'memory',\n    start: time,\n    end: time,\n    data: {\n      memory: {\n        jsHeapSizeLimit,\n        totalJSHeapSize,\n        usedJSHeapSize,\n      },\n    },\n  };\n}\n","import { record } from '@sentry-internal/rrweb';\nimport { browserPerformanceTimeOrigin } from '@sentry/utils';\n\nimport { WINDOW } from '../constants';\nimport type {\n  AllPerformanceEntry,\n  AllPerformanceEntryData,\n  ExperimentalPerformanceResourceTiming,\n  LargestContentfulPaintData,\n  NavigationData,\n  PaintData,\n  ReplayPerformanceEntry,\n  ResourceData,\n} from '../types';\n\n// Map entryType -> function to normalize data for event\nconst ENTRY_TYPES: Record<\n  string,\n  (entry: AllPerformanceEntry) => null | ReplayPerformanceEntry<AllPerformanceEntryData>\n> = {\n  // @ts-expect-error TODO: entry type does not fit the create* functions entry type\n  resource: createResourceEntry,\n  paint: createPaintEntry,\n  // @ts-expect-error TODO: entry type does not fit the create* functions entry type\n  navigation: createNavigationEntry,\n  // @ts-expect-error TODO: entry type does not fit the create* functions entry type\n  ['largest-contentful-paint']: createLargestContentfulPaint,\n};\n\n/**\n * Create replay performance entries from the browser performance entries.\n */\nexport function createPerformanceEntries(\n  entries: AllPerformanceEntry[],\n): ReplayPerformanceEntry<AllPerformanceEntryData>[] {\n  return entries.map(createPerformanceEntry).filter(Boolean) as ReplayPerformanceEntry<AllPerformanceEntryData>[];\n}\n\nfunction createPerformanceEntry(entry: AllPerformanceEntry): ReplayPerformanceEntry<AllPerformanceEntryData> | null {\n  if (ENTRY_TYPES[entry.entryType] === undefined) {\n    return null;\n  }\n\n  return ENTRY_TYPES[entry.entryType](entry);\n}\n\nfunction getAbsoluteTime(time: number): number {\n  // browserPerformanceTimeOrigin can be undefined if `performance` or\n  // `performance.now` doesn't exist, but this is already checked by this integration\n  return ((browserPerformanceTimeOrigin || WINDOW.performance.timeOrigin) + time) / 1000;\n}\n\nfunction createPaintEntry(entry: PerformancePaintTiming): ReplayPerformanceEntry<PaintData> {\n  const { duration, entryType, name, startTime } = entry;\n\n  const start = getAbsoluteTime(startTime);\n  return {\n    type: entryType,\n    name,\n    start,\n    end: start + duration,\n    data: undefined,\n  };\n}\n\nfunction createNavigationEntry(entry: PerformanceNavigationTiming): ReplayPerformanceEntry<NavigationData> | null {\n  const {\n    entryType,\n    name,\n    decodedBodySize,\n    duration,\n    domComplete,\n    encodedBodySize,\n    domContentLoadedEventStart,\n    domContentLoadedEventEnd,\n    domInteractive,\n    loadEventStart,\n    loadEventEnd,\n    redirectCount,\n    startTime,\n    transferSize,\n    type,\n  } = entry;\n\n  // Ignore entries with no duration, they do not seem to be useful and cause dupes\n  if (duration === 0) {\n    return null;\n  }\n\n  return {\n    type: `${entryType}.${type}`,\n    start: getAbsoluteTime(startTime),\n    end: getAbsoluteTime(domComplete),\n    name,\n    data: {\n      size: transferSize,\n      decodedBodySize,\n      encodedBodySize,\n      duration,\n      domInteractive,\n      domContentLoadedEventStart,\n      domContentLoadedEventEnd,\n      loadEventStart,\n      loadEventEnd,\n      domComplete,\n      redirectCount,\n    },\n  };\n}\n\nfunction createResourceEntry(\n  entry: ExperimentalPerformanceResourceTiming,\n): ReplayPerformanceEntry<ResourceData> | null {\n  const {\n    entryType,\n    initiatorType,\n    name,\n    responseEnd,\n    startTime,\n    decodedBodySize,\n    encodedBodySize,\n    responseStatus,\n    transferSize,\n  } = entry;\n\n  // Core SDK handles these\n  if (['fetch', 'xmlhttprequest'].includes(initiatorType)) {\n    return null;\n  }\n\n  return {\n    type: `${entryType}.${initiatorType}`,\n    start: getAbsoluteTime(startTime),\n    end: getAbsoluteTime(responseEnd),\n    name,\n    data: {\n      size: transferSize,\n      statusCode: responseStatus,\n      decodedBodySize,\n      encodedBodySize,\n    },\n  };\n}\n\nfunction createLargestContentfulPaint(\n  entry: PerformanceEntry & { size: number; element: Node },\n): ReplayPerformanceEntry<LargestContentfulPaintData> {\n  const { entryType, startTime, size } = entry;\n\n  let startTimeOrNavigationActivation = 0;\n\n  if (WINDOW.performance) {\n    const navEntry = WINDOW.performance.getEntriesByType('navigation')[0] as PerformanceNavigationTiming & {\n      activationStart: number;\n    };\n\n    // See https://github.com/GoogleChrome/web-vitals/blob/9f11c4c6578fb4c5ee6fa4e32b9d1d756475f135/src/lib/getActivationStart.ts#L21\n    startTimeOrNavigationActivation = (navEntry && navEntry.activationStart) || 0;\n  }\n\n  // value is in ms\n  const value = Math.max(startTime - startTimeOrNavigationActivation, 0);\n  // LCP doesn't have a \"duration\", it just happens at a single point in time.\n  // But the UI expects both, so use end (in seconds) for both timestamps.\n  const end = getAbsoluteTime(startTimeOrNavigationActivation) + value / 1000;\n\n  return {\n    type: entryType,\n    name: entryType,\n    start: end,\n    end,\n    data: {\n      value, // LCP \"duration\" in ms\n      size,\n      nodeId: record.mirror.getId(entry.element),\n    },\n  };\n}\n","import { EventType } from '@sentry-internal/rrweb';\nimport { logger } from '@sentry/utils';\n\nimport { saveSession } from '../session/saveSession';\nimport type { RecordingEvent, ReplayContainer, ReplayOptionFrameEvent } from '../types';\nimport { addEventSync } from './addEvent';\nimport { logInfo } from './log';\n\ntype RecordingEmitCallback = (event: RecordingEvent, isCheckout?: boolean) => void;\n\n/**\n * Handler for recording events.\n *\n * Adds to event buffer, and has varying flushing behaviors if the event was a checkout.\n */\nexport function getHandleRecordingEmit(replay: ReplayContainer): RecordingEmitCallback {\n  let hadFirstEvent = false;\n\n  return (event: RecordingEvent, _isCheckout?: boolean) => {\n    // If this is false, it means session is expired, create and a new session and wait for checkout\n    if (!replay.checkAndHandleExpiredSession()) {\n      __DEBUG_BUILD__ && logger.warn('[Replay] Received replay event after session expired.');\n\n      return;\n    }\n\n    // `_isCheckout` is only set when the checkout is due to `checkoutEveryNms`\n    // We also want to treat the first event as a checkout, so we handle this specifically here\n    const isCheckout = _isCheckout || !hadFirstEvent;\n    hadFirstEvent = true;\n\n    // The handler returns `true` if we do not want to trigger debounced flush, `false` if we want to debounce flush.\n    replay.addUpdate(() => {\n      // The session is always started immediately on pageload/init, but for\n      // error-only replays, it should reflect the most recent checkout\n      // when an error occurs. Clear any state that happens before this current\n      // checkout. This needs to happen before `addEvent()` which updates state\n      // dependent on this reset.\n      if (replay.recordingMode === 'buffer' && isCheckout) {\n        replay.setInitialState();\n      }\n\n      // If the event is not added (e.g. due to being paused, disabled, or out of the max replay duration),\n      // Skip all further steps\n      if (!addEventSync(replay, event, isCheckout)) {\n        // Return true to skip scheduling a debounced flush\n        return true;\n      }\n\n      // Different behavior for full snapshots (type=2), ignore other event types\n      // See https://github.com/rrweb-io/rrweb/blob/d8f9290ca496712aa1e7d472549480c4e7876594/packages/rrweb/src/types.ts#L16\n      if (!isCheckout) {\n        return false;\n      }\n\n      // Additionally, create a meta event that will capture certain SDK settings.\n      // In order to handle buffer mode, this needs to either be done when we\n      // receive checkout events or at flush time.\n      //\n      // `isCheckout` is always true, but want to be explicit that it should\n      // only be added for checkouts\n      addSettingsEvent(replay, isCheckout);\n\n      // If there is a previousSessionId after a full snapshot occurs, then\n      // the replay session was started due to session expiration. The new session\n      // is started before triggering a new checkout and contains the id\n      // of the previous session. Do not immediately flush in this case\n      // to avoid capturing only the checkout and instead the replay will\n      // be captured if they perform any follow-up actions.\n      if (replay.session && replay.session.previousSessionId) {\n        return true;\n      }\n\n      // When in buffer mode, make sure we adjust the session started date to the current earliest event of the buffer\n      // this should usually be the timestamp of the checkout event, but to be safe...\n      if (replay.recordingMode === 'buffer' && replay.session && replay.eventBuffer) {\n        const earliestEvent = replay.eventBuffer.getEarliestTimestamp();\n        if (earliestEvent) {\n          logInfo(\n            `[Replay] Updating session start time to earliest event in buffer to ${new Date(earliestEvent)}`,\n            replay.getOptions()._experiments.traceInternals,\n          );\n\n          replay.session.started = earliestEvent;\n\n          if (replay.getOptions().stickySession) {\n            saveSession(replay.session);\n          }\n        }\n      }\n\n      if (replay.recordingMode === 'session') {\n        // If the full snapshot is due to an initial load, we will not have\n        // a previous session ID. In this case, we want to buffer events\n        // for a set amount of time before flushing. This can help avoid\n        // capturing replays of users that immediately close the window.\n        void replay.flush();\n      }\n\n      return true;\n    });\n  };\n}\n\n/**\n * Exported for tests\n */\nexport function createOptionsEvent(replay: ReplayContainer): ReplayOptionFrameEvent {\n  const options = replay.getOptions();\n  return {\n    type: EventType.Custom,\n    timestamp: Date.now(),\n    data: {\n      tag: 'options',\n      payload: {\n        sessionSampleRate: options.sessionSampleRate,\n        errorSampleRate: options.errorSampleRate,\n        useCompressionOption: options.useCompression,\n        blockAllMedia: options.blockAllMedia,\n        maskAllText: options.maskAllText,\n        maskAllInputs: options.maskAllInputs,\n        useCompression: replay.eventBuffer ? replay.eventBuffer.type === 'worker' : false,\n        networkDetailHasUrls: options.networkDetailAllowUrls.length > 0,\n        networkCaptureBodies: options.networkCaptureBodies,\n        networkRequestHasHeaders: options.networkRequestHeaders.length > 0,\n        networkResponseHasHeaders: options.networkResponseHeaders.length > 0,\n      },\n    },\n  };\n}\n\n/**\n * Add a \"meta\" event that contains a simplified view on current configuration\n * options. This should only be included on the first segment of a recording.\n */\nfunction addSettingsEvent(replay: ReplayContainer, isCheckout?: boolean): void {\n  // Only need to add this event when sending the first segment\n  if (!isCheckout || !replay.session || replay.session.segmentId !== 0) {\n    return;\n  }\n\n  addEventSync(replay, createOptionsEvent(replay), false);\n}\n","import { getCurrentHub } from '@sentry/core';\nimport type { ReplayEvent, TransportMakeRequestResponse } from '@sentry/types';\n\nimport { REPLAY_EVENT_NAME, UNABLE_TO_SEND_REPLAY } from '../constants';\nimport type { SendReplayData } from '../types';\nimport { createReplayEnvelope } from './createReplayEnvelope';\nimport { logInfo } from './log';\nimport { prepareRecordingData } from './prepareRecordingData';\nimport { prepareReplayEvent } from './prepareReplayEvent';\n\n/**\n * Send replay attachment using `fetch()`\n */\nexport async function sendReplayRequest({\n  recordingData,\n  replayId,\n  segmentId: segment_id,\n  eventContext,\n  timestamp,\n  session,\n}: SendReplayData): Promise<void | TransportMakeRequestResponse> {\n  const preparedRecordingData = prepareRecordingData({\n    recordingData,\n    headers: {\n      segment_id,\n    },\n  });\n\n  const { urls, errorIds, traceIds, initialTimestamp } = eventContext;\n\n  const hub = getCurrentHub();\n  const client = hub.getClient();\n  const scope = hub.getScope();\n  const transport = client && client.getTransport();\n  const dsn = client && client.getDsn();\n\n  if (!client || !transport || !dsn || !session.sampled) {\n    return;\n  }\n\n  const baseEvent: ReplayEvent = {\n    type: REPLAY_EVENT_NAME,\n    replay_start_timestamp: initialTimestamp / 1000,\n    timestamp: timestamp / 1000,\n    error_ids: errorIds,\n    trace_ids: traceIds,\n    urls,\n    replay_id: replayId,\n    segment_id,\n    replay_type: session.sampled,\n  };\n\n  const replayEvent = await prepareReplayEvent({ scope, client, replayId, event: baseEvent });\n\n  if (!replayEvent) {\n    // Taken from baseclient's `_processEvent` method, where this is handled for errors/transactions\n    client.recordDroppedEvent('event_processor', 'replay', baseEvent);\n    logInfo('An event processor returned `null`, will not send event.');\n    return;\n  }\n\n  /*\n  For reference, the fully built event looks something like this:\n  {\n      \"type\": \"replay_event\",\n      \"timestamp\": 1670837008.634,\n      \"error_ids\": [\n          \"errorId\"\n      ],\n      \"trace_ids\": [\n          \"traceId\"\n      ],\n      \"urls\": [\n          \"https://example.com\"\n      ],\n      \"replay_id\": \"eventId\",\n      \"segment_id\": 3,\n      \"replay_type\": \"error\",\n      \"platform\": \"javascript\",\n      \"event_id\": \"eventId\",\n      \"environment\": \"production\",\n      \"sdk\": {\n          \"integrations\": [\n              \"BrowserTracing\",\n              \"Replay\"\n          ],\n          \"name\": \"sentry.javascript.browser\",\n          \"version\": \"7.25.0\"\n      },\n      \"sdkProcessingMetadata\": {},\n      \"contexts\": {\n      },\n  }\n  */\n\n  // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to\n  // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may\n  // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid\n  // of this `delete`, lest we miss putting it back in the next time the property is in use.)\n  delete replayEvent.sdkProcessingMetadata;\n\n  const envelope = createReplayEnvelope(replayEvent, preparedRecordingData, dsn, client.getOptions().tunnel);\n\n  let response: void | TransportMakeRequestResponse;\n\n  try {\n    response = await transport.send(envelope);\n  } catch (err) {\n    const error = new Error(UNABLE_TO_SEND_REPLAY);\n\n    try {\n      // In case browsers don't allow this property to be writable\n      // @ts-expect-error This needs lib es2022 and newer\n      error.cause = err;\n    } catch {\n      // nothing to do\n    }\n    throw error;\n  }\n\n  // TODO (v8): we can remove this guard once transport.send's type signature doesn't include void anymore\n  if (!response) {\n    return response;\n  }\n\n  // If the status code is invalid, we want to immediately stop & not retry\n  if (typeof response.statusCode === 'number' && (response.statusCode < 200 || response.statusCode >= 300)) {\n    throw new TransportStatusCodeError(response.statusCode);\n  }\n\n  return response;\n}\n\n/**\n * This error indicates that the transport returned an invalid status code.\n */\nexport class TransportStatusCodeError extends Error {\n  public constructor(statusCode: number) {\n    super(`Transport returned status code ${statusCode}`);\n  }\n}\n","import { captureException, setContext } from '@sentry/core';\n\nimport { RETRY_BASE_INTERVAL, RETRY_MAX_COUNT, UNABLE_TO_SEND_REPLAY } from '../constants';\nimport type { SendReplayData } from '../types';\nimport { sendReplayRequest, TransportStatusCodeError } from './sendReplayRequest';\n\n/**\n * Finalize and send the current replay event to Sentry\n */\nexport async function sendReplay(\n  replayData: SendReplayData,\n  retryConfig = {\n    count: 0,\n    interval: RETRY_BASE_INTERVAL,\n  },\n): Promise<unknown> {\n  const { recordingData, options } = replayData;\n\n  // short circuit if there's no events to upload (this shouldn't happen as _runFlush makes this check)\n  if (!recordingData.length) {\n    return;\n  }\n\n  try {\n    await sendReplayRequest(replayData);\n    return true;\n  } catch (err) {\n    if (err instanceof TransportStatusCodeError) {\n      throw err;\n    }\n\n    // Capture error for every failed replay\n    setContext('Replays', {\n      _retryCount: retryConfig.count,\n    });\n\n    if (__DEBUG_BUILD__ && options._experiments && options._experiments.captureExceptions) {\n      captureException(err);\n    }\n\n    // If an error happened here, it's likely that uploading the attachment\n    // failed, we'll can retry with the same events payload\n    if (retryConfig.count >= RETRY_MAX_COUNT) {\n      const error = new Error(`${UNABLE_TO_SEND_REPLAY} - max retries exceeded`);\n\n      try {\n        // In case browsers don't allow this property to be writable\n        // @ts-expect-error This needs lib es2022 and newer\n        error.cause = err;\n      } catch {\n        // nothing to do\n      }\n\n      throw error;\n    }\n\n    // will retry in intervals of 5, 10, 30\n    retryConfig.interval *= ++retryConfig.count;\n\n    return new Promise((resolve, reject) => {\n      setTimeout(async () => {\n        try {\n          await sendReplay(replayData, retryConfig);\n          resolve(true);\n        } catch (err) {\n          reject(err);\n        }\n      }, retryConfig.interval);\n    });\n  }\n}\n","import type { ReplayRecordingData } from '@sentry/types';\n\n/**\n * Prepare the recording data ready to be sent.\n */\nexport function prepareRecordingData({\n  recordingData,\n  headers,\n}: {\n  recordingData: ReplayRecordingData;\n  headers: Record<string, unknown>;\n}): ReplayRecordingData {\n  let payloadWithSequence;\n\n  // XXX: newline is needed to separate sequence id from events\n  const replayHeaders = `${JSON.stringify(headers)}\n`;\n\n  if (typeof recordingData === 'string') {\n    payloadWithSequence = `${replayHeaders}${recordingData}`;\n  } else {\n    const enc = new TextEncoder();\n    // XXX: newline is needed to separate sequence id from events\n    const sequence = enc.encode(replayHeaders);\n    // Merge the two Uint8Arrays\n    payloadWithSequence = new Uint8Array(sequence.length + recordingData.length);\n    payloadWithSequence.set(sequence);\n    payloadWithSequence.set(recordingData, sequence.length);\n  }\n\n  return payloadWithSequence;\n}\n","import type { Scope } from '@sentry/core';\nimport { prepareEvent } from '@sentry/core';\nimport type { IntegrationIndex } from '@sentry/core/build/types/integration';\nimport type { Client, EventHint, ReplayEvent } from '@sentry/types';\n\n/**\n * Prepare a replay event & enrich it with the SDK metadata.\n */\nexport async function prepareReplayEvent({\n  client,\n  scope,\n  replayId: event_id,\n  event,\n}: {\n  client: Client & { _integrations?: IntegrationIndex };\n  scope: Scope;\n  replayId: string;\n  event: ReplayEvent;\n}): Promise<ReplayEvent | null> {\n  const integrations =\n    typeof client._integrations === 'object' && client._integrations !== null && !Array.isArray(client._integrations)\n      ? Object.keys(client._integrations)\n      : undefined;\n\n  const eventHint: EventHint = { event_id, integrations };\n\n  if (client.emit) {\n    client.emit('preprocessEvent', event, eventHint);\n  }\n\n  const preparedEvent = (await prepareEvent(\n    client.getOptions(),\n    event,\n    eventHint,\n    scope,\n    client,\n  )) as ReplayEvent | null;\n\n  // If e.g. a global event processor returned null\n  if (!preparedEvent) {\n    return null;\n  }\n\n  // This normally happens in browser client \"_prepareEvent\"\n  // but since we do not use this private method from the client, but rather the plain import\n  // we need to do this manually.\n  preparedEvent.platform = preparedEvent.platform || 'javascript';\n\n  // extract the SDK name because `client._prepareEvent` doesn't add it to the event\n  const metadata = client.getSdkMetadata && client.getSdkMetadata();\n  const { name, version } = (metadata && metadata.sdk) || {};\n\n  preparedEvent.sdk = {\n    ...preparedEvent.sdk,\n    name: name || 'sentry.javascript.unknown',\n    version: version || '0.0.0',\n  };\n\n  return preparedEvent;\n}\n","import type { DsnComponents, ReplayEnvelope, ReplayEvent, ReplayRecordingData } from '@sentry/types';\nimport { createEnvelope, createEventEnvelopeHeaders, getSdkMetadataForEnvelopeHeader } from '@sentry/utils';\n\n/**\n * Create a replay envelope ready to be sent.\n * This includes both the replay event, as well as the recording data.\n */\nexport function createReplayEnvelope(\n  replayEvent: ReplayEvent,\n  recordingData: ReplayRecordingData,\n  dsn: DsnComponents,\n  tunnel?: string,\n): ReplayEnvelope {\n  return createEnvelope<ReplayEnvelope>(\n    createEventEnvelopeHeaders(replayEvent, getSdkMetadataForEnvelopeHeader(replayEvent), tunnel, dsn),\n    [\n      [{ type: 'replay_event' }, replayEvent],\n      [\n        {\n          type: 'replay_recording',\n          // If string then we need to encode to UTF8, otherwise will have\n          // wrong size. TextEncoder has similar browser support to\n          // MutationObserver, although it does not accept IE11.\n          length:\n            typeof recordingData === 'string' ? new TextEncoder().encode(recordingData).length : recordingData.length,\n        },\n        recordingData,\n      ],\n    ],\n  );\n}\n","export const THROTTLED = '__THROTTLED';\nexport const SKIPPED = '__SKIPPED';\n\n/**\n * Create a throttled function off a given function.\n * When calling the throttled function, it will call the original function only\n * if it hasn't been called more than `maxCount` times in the last `durationSeconds`.\n *\n * Returns `THROTTLED` if throttled for the first time, after that `SKIPPED`,\n * or else the return value of the original function.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function throttle<T extends (...rest: any[]) => any>(\n  fn: T,\n  maxCount: number,\n  durationSeconds: number,\n): (...rest: Parameters<T>) => ReturnType<T> | typeof THROTTLED | typeof SKIPPED {\n  const counter = new Map<number, number>();\n\n  const _cleanup = (now: number): void => {\n    const threshold = now - durationSeconds;\n    counter.forEach((_value, key) => {\n      if (key < threshold) {\n        counter.delete(key);\n      }\n    });\n  };\n\n  const _getTotalCount = (): number => {\n    return [...counter.values()].reduce((a, b) => a + b, 0);\n  };\n\n  let isThrottled = false;\n\n  return (...rest: Parameters<T>): ReturnType<T> | typeof THROTTLED | typeof SKIPPED => {\n    // Date in second-precision, which we use as basis for the throttling\n    const now = Math.floor(Date.now() / 1000);\n\n    // First, make sure to delete any old entries\n    _cleanup(now);\n\n    // If already over limit, do nothing\n    if (_getTotalCount() >= maxCount) {\n      const wasThrottled = isThrottled;\n      isThrottled = true;\n      return wasThrottled ? SKIPPED : THROTTLED;\n    }\n\n    isThrottled = false;\n    const count = counter.get(now) || 0;\n    counter.set(now, count + 1);\n\n    return fn(...rest);\n  };\n}\n","/* eslint-disable max-lines */ // TODO: We might want to split this file up\nimport { EventType, record } from '@sentry-internal/rrweb';\nimport { captureException, getCurrentHub } from '@sentry/core';\nimport type { ReplayRecordingMode, Transaction } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport {\n  BUFFER_CHECKOUT_TIME,\n  SESSION_IDLE_EXPIRE_DURATION,\n  SESSION_IDLE_PAUSE_DURATION,\n  SLOW_CLICK_SCROLL_TIMEOUT,\n  SLOW_CLICK_THRESHOLD,\n  WINDOW,\n} from './constants';\nimport { ClickDetector } from './coreHandlers/handleClick';\nimport { handleKeyboardEvent } from './coreHandlers/handleKeyboardEvent';\nimport { setupPerformanceObserver } from './coreHandlers/performanceObserver';\nimport { createEventBuffer } from './eventBuffer';\nimport { clearSession } from './session/clearSession';\nimport { loadOrCreateSession } from './session/loadOrCreateSession';\nimport { saveSession } from './session/saveSession';\nimport { shouldRefreshSession } from './session/shouldRefreshSession';\nimport type {\n  AddEventResult,\n  AddUpdateCallback,\n  AllPerformanceEntry,\n  EventBuffer,\n  InternalEventContext,\n  PopEventContext,\n  RecordingEvent,\n  RecordingOptions,\n  ReplayBreadcrumbFrame,\n  ReplayContainer as ReplayContainerInterface,\n  ReplayPluginOptions,\n  SendBufferedReplayOptions,\n  Session,\n  SlowClickConfig,\n  Timeouts,\n} from './types';\nimport { ReplayEventTypeCustom } from './types';\nimport { addEvent, addEventSync } from './util/addEvent';\nimport { addGlobalListeners } from './util/addGlobalListeners';\nimport { addMemoryEntry } from './util/addMemoryEntry';\nimport { createBreadcrumb } from './util/createBreadcrumb';\nimport { createPerformanceEntries } from './util/createPerformanceEntries';\nimport { createPerformanceSpans } from './util/createPerformanceSpans';\nimport { debounce } from './util/debounce';\nimport { getHandleRecordingEmit } from './util/handleRecordingEmit';\nimport { isExpired } from './util/isExpired';\nimport { isSessionExpired } from './util/isSessionExpired';\nimport { logInfo, logInfoNextTick } from './util/log';\nimport { sendReplay } from './util/sendReplay';\nimport type { SKIPPED } from './util/throttle';\nimport { throttle, THROTTLED } from './util/throttle';\n\n/**\n * The main replay container class, which holds all the state and methods for recording and sending replays.\n */\nexport class ReplayContainer implements ReplayContainerInterface {\n  public eventBuffer: EventBuffer | null;\n\n  /**\n   * List of PerformanceEntry from PerformanceObserver\n   */\n  public performanceEvents: AllPerformanceEntry[];\n\n  public session: Session | undefined;\n\n  public clickDetector: ClickDetector | undefined;\n\n  /**\n   * Recording can happen in one of three modes:\n   *   - session: Record the whole session, sending it continuously\n   *   - buffer: Always keep the last 60s of recording, requires:\n   *     - having replaysOnErrorSampleRate > 0 to capture replay when an error occurs\n   *     - or calling `flush()` to send the replay\n   */\n  public recordingMode: ReplayRecordingMode;\n\n  /**\n   * The current or last active transcation.\n   * This is only available when performance is enabled.\n   */\n  public lastTransaction?: Transaction;\n\n  /**\n   * These are here so we can overwrite them in tests etc.\n   * @hidden\n   */\n  public readonly timeouts: Timeouts;\n\n  private _throttledAddEvent: (\n    event: RecordingEvent,\n    isCheckout?: boolean,\n  ) => typeof THROTTLED | typeof SKIPPED | Promise<AddEventResult | null>;\n\n  /**\n   * Options to pass to `rrweb.record()`\n   */\n  private readonly _recordingOptions: RecordingOptions;\n\n  private readonly _options: ReplayPluginOptions;\n\n  private _performanceObserver: PerformanceObserver | undefined;\n\n  private _debouncedFlush: ReturnType<typeof debounce>;\n  private _flushLock: Promise<unknown> | undefined;\n\n  /**\n   * Timestamp of the last user activity. This lives across sessions.\n   */\n  private _lastActivity: number;\n\n  /**\n   * Is the integration currently active?\n   */\n  private _isEnabled: boolean;\n\n  /**\n   * Paused is a state where:\n   * - DOM Recording is not listening at all\n   * - Nothing will be added to event buffer (e.g. core SDK events)\n   */\n  private _isPaused: boolean;\n\n  /**\n   * Have we attached listeners to the core SDK?\n   * Note we have to track this as there is no way to remove instrumentation handlers.\n   */\n  private _hasInitializedCoreListeners: boolean;\n\n  /**\n   * Function to stop recording\n   */\n  private _stopRecording: ReturnType<typeof record> | undefined;\n\n  private _context: InternalEventContext;\n\n  public constructor({\n    options,\n    recordingOptions,\n  }: {\n    options: ReplayPluginOptions;\n    recordingOptions: RecordingOptions;\n  }) {\n    this.eventBuffer = null;\n    this.performanceEvents = [];\n    this.recordingMode = 'session';\n    this.timeouts = {\n      sessionIdlePause: SESSION_IDLE_PAUSE_DURATION,\n      sessionIdleExpire: SESSION_IDLE_EXPIRE_DURATION,\n    } as const;\n    this._lastActivity = Date.now();\n    this._isEnabled = false;\n    this._isPaused = false;\n    this._hasInitializedCoreListeners = false;\n    this._context = {\n      errorIds: new Set(),\n      traceIds: new Set(),\n      urls: [],\n      initialTimestamp: Date.now(),\n      initialUrl: '',\n    };\n\n    this._recordingOptions = recordingOptions;\n    this._options = options;\n\n    this._debouncedFlush = debounce(() => this._flush(), this._options.flushMinDelay, {\n      maxWait: this._options.flushMaxDelay,\n    });\n\n    this._throttledAddEvent = throttle(\n      (event: RecordingEvent, isCheckout?: boolean) => addEvent(this, event, isCheckout),\n      // Max 300 events...\n      300,\n      // ... per 5s\n      5,\n    );\n\n    const { slowClickTimeout, slowClickIgnoreSelectors } = this.getOptions();\n\n    const slowClickConfig: SlowClickConfig | undefined = slowClickTimeout\n      ? {\n          threshold: Math.min(SLOW_CLICK_THRESHOLD, slowClickTimeout),\n          timeout: slowClickTimeout,\n          scrollTimeout: SLOW_CLICK_SCROLL_TIMEOUT,\n          ignoreSelector: slowClickIgnoreSelectors ? slowClickIgnoreSelectors.join(',') : '',\n        }\n      : undefined;\n\n    if (slowClickConfig) {\n      this.clickDetector = new ClickDetector(this, slowClickConfig);\n    }\n  }\n\n  /** Get the event context. */\n  public getContext(): InternalEventContext {\n    return this._context;\n  }\n\n  /** If recording is currently enabled. */\n  public isEnabled(): boolean {\n    return this._isEnabled;\n  }\n\n  /** If recording is currently paused. */\n  public isPaused(): boolean {\n    return this._isPaused;\n  }\n\n  /** Get the replay integration options. */\n  public getOptions(): ReplayPluginOptions {\n    return this._options;\n  }\n\n  /**\n   * Initializes the plugin based on sampling configuration. Should not be\n   * called outside of constructor.\n   */\n  public initializeSampling(previousSessionId?: string): void {\n    const { errorSampleRate, sessionSampleRate } = this._options;\n\n    // If neither sample rate is > 0, then do nothing - user will need to call one of\n    // `start()` or `startBuffering` themselves.\n    if (errorSampleRate <= 0 && sessionSampleRate <= 0) {\n      return;\n    }\n\n    // Otherwise if there is _any_ sample rate set, try to load an existing\n    // session, or create a new one.\n    this._initializeSessionForSampling(previousSessionId);\n\n    if (!this.session) {\n      // This should not happen, something wrong has occurred\n      this._handleException(new Error('Unable to initialize and create session'));\n      return;\n    }\n\n    if (this.session.sampled === false) {\n      // This should only occur if `errorSampleRate` is 0 and was unsampled for\n      // session-based replay. In this case there is nothing to do.\n      return;\n    }\n\n    // If segmentId > 0, it means we've previously already captured this session\n    // In this case, we still want to continue in `session` recording mode\n    this.recordingMode = this.session.sampled === 'buffer' && this.session.segmentId === 0 ? 'buffer' : 'session';\n\n    logInfoNextTick(\n      `[Replay] Starting replay in ${this.recordingMode} mode`,\n      this._options._experiments.traceInternals,\n    );\n\n    this._initializeRecording();\n  }\n\n  /**\n   * Start a replay regardless of sampling rate. Calling this will always\n   * create a new session. Will throw an error if replay is already in progress.\n   *\n   * Creates or loads a session, attaches listeners to varying events (DOM,\n   * _performanceObserver, Recording, Sentry SDK, etc)\n   */\n  public start(): void {\n    if (this._isEnabled && this.recordingMode === 'session') {\n      throw new Error('Replay recording is already in progress');\n    }\n\n    if (this._isEnabled && this.recordingMode === 'buffer') {\n      throw new Error('Replay buffering is in progress, call `flush()` to save the replay');\n    }\n\n    logInfoNextTick('[Replay] Starting replay in session mode', this._options._experiments.traceInternals);\n\n    const session = loadOrCreateSession(\n      {\n        maxReplayDuration: this._options.maxReplayDuration,\n        sessionIdleExpire: this.timeouts.sessionIdleExpire,\n        traceInternals: this._options._experiments.traceInternals,\n      },\n      {\n        stickySession: this._options.stickySession,\n        // This is intentional: create a new session-based replay when calling `start()`\n        sessionSampleRate: 1,\n        allowBuffering: false,\n      },\n    );\n\n    this.session = session;\n\n    this._initializeRecording();\n  }\n\n  /**\n   * Start replay buffering. Buffers until `flush()` is called or, if\n   * `replaysOnErrorSampleRate` > 0, an error occurs.\n   */\n  public startBuffering(): void {\n    if (this._isEnabled) {\n      throw new Error('Replay recording is already in progress');\n    }\n\n    logInfoNextTick('[Replay] Starting replay in buffer mode', this._options._experiments.traceInternals);\n\n    const session = loadOrCreateSession(\n      {\n        sessionIdleExpire: this.timeouts.sessionIdleExpire,\n        maxReplayDuration: this._options.maxReplayDuration,\n        traceInternals: this._options._experiments.traceInternals,\n      },\n      {\n        stickySession: this._options.stickySession,\n        sessionSampleRate: 0,\n        allowBuffering: true,\n      },\n    );\n\n    this.session = session;\n\n    this.recordingMode = 'buffer';\n    this._initializeRecording();\n  }\n\n  /**\n   * Start recording.\n   *\n   * Note that this will cause a new DOM checkout\n   */\n  public startRecording(): void {\n    try {\n      this._stopRecording = record({\n        ...this._recordingOptions,\n        // When running in error sampling mode, we need to overwrite `checkoutEveryNms`\n        // Without this, it would record forever, until an error happens, which we don't want\n        // instead, we'll always keep the last 60 seconds of replay before an error happened\n        ...(this.recordingMode === 'buffer' && { checkoutEveryNms: BUFFER_CHECKOUT_TIME }),\n        emit: getHandleRecordingEmit(this),\n        onMutation: this._onMutationHandler,\n      });\n    } catch (err) {\n      this._handleException(err);\n    }\n  }\n\n  /**\n   * Stops the recording, if it was running.\n   *\n   * Returns true if it was previously stopped, or is now stopped,\n   * otherwise false.\n   */\n  public stopRecording(): boolean {\n    try {\n      if (this._stopRecording) {\n        this._stopRecording();\n        this._stopRecording = undefined;\n      }\n\n      return true;\n    } catch (err) {\n      this._handleException(err);\n      return false;\n    }\n  }\n\n  /**\n   * Currently, this needs to be manually called (e.g. for tests). Sentry SDK\n   * does not support a teardown\n   */\n  public async stop({ forceFlush = false, reason }: { forceFlush?: boolean; reason?: string } = {}): Promise<void> {\n    if (!this._isEnabled) {\n      return;\n    }\n\n    // We can't move `_isEnabled` after awaiting a flush, otherwise we can\n    // enter into an infinite loop when `stop()` is called while flushing.\n    this._isEnabled = false;\n\n    try {\n      logInfo(\n        `[Replay] Stopping Replay${reason ? ` triggered by ${reason}` : ''}`,\n        this._options._experiments.traceInternals,\n      );\n\n      this._removeListeners();\n      this.stopRecording();\n\n      this._debouncedFlush.cancel();\n      // See comment above re: `_isEnabled`, we \"force\" a flush, ignoring the\n      // `_isEnabled` state of the plugin since it was disabled above.\n      if (forceFlush) {\n        await this._flush({ force: true });\n      }\n\n      // After flush, destroy event buffer\n      this.eventBuffer && this.eventBuffer.destroy();\n      this.eventBuffer = null;\n\n      // Clear session from session storage, note this means if a new session\n      // is started after, it will not have `previousSessionId`\n      clearSession(this);\n    } catch (err) {\n      this._handleException(err);\n    }\n  }\n\n  /**\n   * Pause some replay functionality. See comments for `_isPaused`.\n   * This differs from stop as this only stops DOM recording, it is\n   * not as thorough of a shutdown as `stop()`.\n   */\n  public pause(): void {\n    if (this._isPaused) {\n      return;\n    }\n\n    this._isPaused = true;\n    this.stopRecording();\n\n    logInfo('[Replay] Pausing replay', this._options._experiments.traceInternals);\n  }\n\n  /**\n   * Resumes recording, see notes for `pause().\n   *\n   * Note that calling `startRecording()` here will cause a\n   * new DOM checkout.`\n   */\n  public resume(): void {\n    if (!this._isPaused || !this._checkSession()) {\n      return;\n    }\n\n    this._isPaused = false;\n    this.startRecording();\n\n    logInfo('[Replay] Resuming replay', this._options._experiments.traceInternals);\n  }\n\n  /**\n   * If not in \"session\" recording mode, flush event buffer which will create a new replay.\n   * Unless `continueRecording` is false, the replay will continue to record and\n   * behave as a \"session\"-based replay.\n   *\n   * Otherwise, queue up a flush.\n   */\n  public async sendBufferedReplayOrFlush({ continueRecording = true }: SendBufferedReplayOptions = {}): Promise<void> {\n    if (this.recordingMode === 'session') {\n      return this.flushImmediate();\n    }\n\n    const activityTime = Date.now();\n\n    logInfo('[Replay] Converting buffer to session', this._options._experiments.traceInternals);\n\n    // Allow flush to complete before resuming as a session recording, otherwise\n    // the checkout from `startRecording` may be included in the payload.\n    // Prefer to keep the error replay as a separate (and smaller) segment\n    // than the session replay.\n    await this.flushImmediate();\n\n    const hasStoppedRecording = this.stopRecording();\n\n    if (!continueRecording || !hasStoppedRecording) {\n      return;\n    }\n\n    // To avoid race conditions where this is called multiple times, we check here again that we are still buffering\n    if ((this.recordingMode as ReplayRecordingMode) === 'session') {\n      return;\n    }\n\n    // Re-start recording in session-mode\n    this.recordingMode = 'session';\n\n    // Once this session ends, we do not want to refresh it\n    if (this.session) {\n      this._updateUserActivity(activityTime);\n      this._updateSessionActivity(activityTime);\n      this._maybeSaveSession();\n    }\n\n    this.startRecording();\n  }\n\n  /**\n   * We want to batch uploads of replay events. Save events only if\n   * `<flushMinDelay>` milliseconds have elapsed since the last event\n   * *OR* if `<flushMaxDelay>` milliseconds have elapsed.\n   *\n   * Accepts a callback to perform side-effects and returns true to stop batch\n   * processing and hand back control to caller.\n   */\n  public addUpdate(cb: AddUpdateCallback): void {\n    // We need to always run `cb` (e.g. in the case of `this.recordingMode == 'buffer'`)\n    const cbResult = cb();\n\n    // If this option is turned on then we will only want to call `flush`\n    // explicitly\n    if (this.recordingMode === 'buffer') {\n      return;\n    }\n\n    // If callback is true, we do not want to continue with flushing -- the\n    // caller will need to handle it.\n    if (cbResult === true) {\n      return;\n    }\n\n    // addUpdate is called quite frequently - use _debouncedFlush so that it\n    // respects the flush delays and does not flush immediately\n    this._debouncedFlush();\n  }\n\n  /**\n   * Updates the user activity timestamp and resumes recording. This should be\n   * called in an event handler for a user action that we consider as the user\n   * being \"active\" (e.g. a mouse click).\n   */\n  public triggerUserActivity(): void {\n    this._updateUserActivity();\n\n    // This case means that recording was once stopped due to inactivity.\n    // Ensure that recording is resumed.\n    if (!this._stopRecording) {\n      // Create a new session, otherwise when the user action is flushed, it\n      // will get rejected due to an expired session.\n      if (!this._checkSession()) {\n        return;\n      }\n\n      // Note: This will cause a new DOM checkout\n      this.resume();\n      return;\n    }\n\n    // Otherwise... recording was never suspended, continue as normalish\n    this.checkAndHandleExpiredSession();\n\n    this._updateSessionActivity();\n  }\n\n  /**\n   * Updates the user activity timestamp *without* resuming\n   * recording. Some user events (e.g. keydown) can be create\n   * low-value replays that only contain the keypress as a\n   * breadcrumb. Instead this would require other events to\n   * create a new replay after a session has expired.\n   */\n  public updateUserActivity(): void {\n    this._updateUserActivity();\n    this._updateSessionActivity();\n  }\n\n  /**\n   * Only flush if `this.recordingMode === 'session'`\n   */\n  public conditionalFlush(): Promise<void> {\n    if (this.recordingMode === 'buffer') {\n      return Promise.resolve();\n    }\n\n    return this.flushImmediate();\n  }\n\n  /**\n   * Flush using debounce flush\n   */\n  public flush(): Promise<void> {\n    return this._debouncedFlush() as Promise<void>;\n  }\n\n  /**\n   * Always flush via `_debouncedFlush` so that we do not have flushes triggered\n   * from calling both `flush` and `_debouncedFlush`. Otherwise, there could be\n   * cases of mulitple flushes happening closely together.\n   */\n  public flushImmediate(): Promise<void> {\n    this._debouncedFlush();\n    // `.flush` is provided by the debounced function, analogously to lodash.debounce\n    return this._debouncedFlush.flush() as Promise<void>;\n  }\n\n  /**\n   * Cancels queued up flushes.\n   */\n  public cancelFlush(): void {\n    this._debouncedFlush.cancel();\n  }\n\n  /** Get the current sesion (=replay) ID */\n  public getSessionId(): string | undefined {\n    return this.session && this.session.id;\n  }\n\n  /**\n   * Checks if recording should be stopped due to user inactivity. Otherwise\n   * check if session is expired and create a new session if so. Triggers a new\n   * full snapshot on new session.\n   *\n   * Returns true if session is not expired, false otherwise.\n   * @hidden\n   */\n  public checkAndHandleExpiredSession(): boolean | void {\n    // Prevent starting a new session if the last user activity is older than\n    // SESSION_IDLE_PAUSE_DURATION. Otherwise non-user activity can trigger a new\n    // session+recording. This creates noisy replays that do not have much\n    // content in them.\n    if (\n      this._lastActivity &&\n      isExpired(this._lastActivity, this.timeouts.sessionIdlePause) &&\n      this.session &&\n      this.session.sampled === 'session'\n    ) {\n      // Pause recording only for session-based replays. Otherwise, resuming\n      // will create a new replay and will conflict with users who only choose\n      // to record error-based replays only. (e.g. the resumed replay will not\n      // contain a reference to an error)\n      this.pause();\n      return;\n    }\n\n    // --- There is recent user activity --- //\n    // This will create a new session if expired, based on expiry length\n    if (!this._checkSession()) {\n      // Check session handles the refreshing itself\n      return false;\n    }\n\n    return true;\n  }\n\n  /**\n   * Capture some initial state that can change throughout the lifespan of the\n   * replay. This is required because otherwise they would be captured at the\n   * first flush.\n   */\n  public setInitialState(): void {\n    const urlPath = `${WINDOW.location.pathname}${WINDOW.location.hash}${WINDOW.location.search}`;\n    const url = `${WINDOW.location.origin}${urlPath}`;\n\n    this.performanceEvents = [];\n\n    // Reset _context as well\n    this._clearContext();\n\n    this._context.initialUrl = url;\n    this._context.initialTimestamp = Date.now();\n    this._context.urls.push(url);\n  }\n\n  /**\n   * Add a breadcrumb event, that may be throttled.\n   * If it was throttled, we add a custom breadcrumb to indicate that.\n   */\n  public throttledAddEvent(\n    event: RecordingEvent,\n    isCheckout?: boolean,\n  ): typeof THROTTLED | typeof SKIPPED | Promise<AddEventResult | null> {\n    const res = this._throttledAddEvent(event, isCheckout);\n\n    // If this is THROTTLED, it means we have throttled the event for the first time\n    // In this case, we want to add a breadcrumb indicating that something was skipped\n    if (res === THROTTLED) {\n      const breadcrumb = createBreadcrumb({\n        category: 'replay.throttled',\n      });\n\n      this.addUpdate(() => {\n        // Return `false` if the event _was_ added, as that means we schedule a flush\n        return !addEventSync(this, {\n          type: ReplayEventTypeCustom,\n          timestamp: breadcrumb.timestamp || 0,\n          data: {\n            tag: 'breadcrumb',\n            payload: breadcrumb,\n            metric: true,\n          },\n        });\n      });\n    }\n\n    return res;\n  }\n\n  /**\n   * This will get the parametrized route name of the current page.\n   * This is only available if performance is enabled, and if an instrumented router is used.\n   */\n  public getCurrentRoute(): string | undefined {\n    const lastTransaction = this.lastTransaction || getCurrentHub().getScope().getTransaction();\n    if (!lastTransaction || !['route', 'custom'].includes(lastTransaction.metadata.source)) {\n      return undefined;\n    }\n\n    return lastTransaction.name;\n  }\n\n  /**\n   * Initialize and start all listeners to varying events (DOM,\n   * Performance Observer, Recording, Sentry SDK, etc)\n   */\n  private _initializeRecording(): void {\n    this.setInitialState();\n\n    // this method is generally called on page load or manually - in both cases\n    // we should treat it as an activity\n    this._updateSessionActivity();\n\n    this.eventBuffer = createEventBuffer({\n      useCompression: this._options.useCompression,\n    });\n\n    this._removeListeners();\n    this._addListeners();\n\n    // Need to set as enabled before we start recording, as `record()` can trigger a flush with a new checkout\n    this._isEnabled = true;\n    this._isPaused = false;\n\n    this.startRecording();\n  }\n\n  /** A wrapper to conditionally capture exceptions. */\n  private _handleException(error: unknown): void {\n    __DEBUG_BUILD__ && logger.error('[Replay]', error);\n\n    if (__DEBUG_BUILD__ && this._options._experiments && this._options._experiments.captureExceptions) {\n      captureException(error);\n    }\n  }\n\n  /**\n   * Loads (or refreshes) the current session.\n   */\n  private _initializeSessionForSampling(previousSessionId?: string): void {\n    // Whenever there is _any_ error sample rate, we always allow buffering\n    // Because we decide on sampling when an error occurs, we need to buffer at all times if sampling for errors\n    const allowBuffering = this._options.errorSampleRate > 0;\n\n    const session = loadOrCreateSession(\n      {\n        sessionIdleExpire: this.timeouts.sessionIdleExpire,\n        maxReplayDuration: this._options.maxReplayDuration,\n        traceInternals: this._options._experiments.traceInternals,\n        previousSessionId,\n      },\n      {\n        stickySession: this._options.stickySession,\n        sessionSampleRate: this._options.sessionSampleRate,\n        allowBuffering,\n      },\n    );\n\n    this.session = session;\n  }\n\n  /**\n   * Checks and potentially refreshes the current session.\n   * Returns false if session is not recorded.\n   */\n  private _checkSession(): boolean {\n    // If there is no session yet, we do not want to refresh anything\n    // This should generally not happen, but to be safe....\n    if (!this.session) {\n      return false;\n    }\n\n    const currentSession = this.session;\n\n    if (\n      shouldRefreshSession(currentSession, {\n        sessionIdleExpire: this.timeouts.sessionIdleExpire,\n        maxReplayDuration: this._options.maxReplayDuration,\n      })\n    ) {\n      void this._refreshSession(currentSession);\n      return false;\n    }\n\n    return true;\n  }\n\n  /**\n   * Refresh a session with a new one.\n   * This stops the current session (without forcing a flush, as that would never work since we are expired),\n   * and then does a new sampling based on the refreshed session.\n   */\n  private async _refreshSession(session: Session): Promise<void> {\n    if (!this._isEnabled) {\n      return;\n    }\n    await this.stop({ reason: 'refresh session' });\n    this.initializeSampling(session.id);\n  }\n\n  /**\n   * Adds listeners to record events for the replay\n   */\n  private _addListeners(): void {\n    try {\n      WINDOW.document.addEventListener('visibilitychange', this._handleVisibilityChange);\n      WINDOW.addEventListener('blur', this._handleWindowBlur);\n      WINDOW.addEventListener('focus', this._handleWindowFocus);\n      WINDOW.addEventListener('keydown', this._handleKeyboardEvent);\n\n      if (this.clickDetector) {\n        this.clickDetector.addListeners();\n      }\n\n      // There is no way to remove these listeners, so ensure they are only added once\n      if (!this._hasInitializedCoreListeners) {\n        addGlobalListeners(this);\n\n        this._hasInitializedCoreListeners = true;\n      }\n    } catch (err) {\n      this._handleException(err);\n    }\n\n    // PerformanceObserver //\n    if (!('PerformanceObserver' in WINDOW)) {\n      return;\n    }\n\n    this._performanceObserver = setupPerformanceObserver(this);\n  }\n\n  /**\n   * Cleans up listeners that were created in `_addListeners`\n   */\n  private _removeListeners(): void {\n    try {\n      WINDOW.document.removeEventListener('visibilitychange', this._handleVisibilityChange);\n\n      WINDOW.removeEventListener('blur', this._handleWindowBlur);\n      WINDOW.removeEventListener('focus', this._handleWindowFocus);\n      WINDOW.removeEventListener('keydown', this._handleKeyboardEvent);\n\n      if (this.clickDetector) {\n        this.clickDetector.removeListeners();\n      }\n\n      if (this._performanceObserver) {\n        this._performanceObserver.disconnect();\n        this._performanceObserver = undefined;\n      }\n    } catch (err) {\n      this._handleException(err);\n    }\n  }\n\n  /**\n   * Handle when visibility of the page content changes. Opening a new tab will\n   * cause the state to change to hidden because of content of current page will\n   * be hidden. Likewise, moving a different window to cover the contents of the\n   * page will also trigger a change to a hidden state.\n   */\n  private _handleVisibilityChange: () => void = () => {\n    if (WINDOW.document.visibilityState === 'visible') {\n      this._doChangeToForegroundTasks();\n    } else {\n      this._doChangeToBackgroundTasks();\n    }\n  };\n\n  /**\n   * Handle when page is blurred\n   */\n  private _handleWindowBlur: () => void = () => {\n    const breadcrumb = createBreadcrumb({\n      category: 'ui.blur',\n    });\n\n    // Do not count blur as a user action -- it's part of the process of them\n    // leaving the page\n    this._doChangeToBackgroundTasks(breadcrumb);\n  };\n\n  /**\n   * Handle when page is focused\n   */\n  private _handleWindowFocus: () => void = () => {\n    const breadcrumb = createBreadcrumb({\n      category: 'ui.focus',\n    });\n\n    // Do not count focus as a user action -- instead wait until they focus and\n    // interactive with page\n    this._doChangeToForegroundTasks(breadcrumb);\n  };\n\n  /** Ensure page remains active when a key is pressed. */\n  private _handleKeyboardEvent: (event: KeyboardEvent) => void = (event: KeyboardEvent) => {\n    handleKeyboardEvent(this, event);\n  };\n\n  /**\n   * Tasks to run when we consider a page to be hidden (via blurring and/or visibility)\n   */\n  private _doChangeToBackgroundTasks(breadcrumb?: ReplayBreadcrumbFrame): void {\n    if (!this.session) {\n      return;\n    }\n\n    const expired = isSessionExpired(this.session, {\n      maxReplayDuration: this._options.maxReplayDuration,\n      sessionIdleExpire: this.timeouts.sessionIdleExpire,\n    });\n\n    if (expired) {\n      return;\n    }\n\n    if (breadcrumb) {\n      this._createCustomBreadcrumb(breadcrumb);\n    }\n\n    // Send replay when the page/tab becomes hidden. There is no reason to send\n    // replay if it becomes visible, since no actions we care about were done\n    // while it was hidden\n    void this.conditionalFlush();\n  }\n\n  /**\n   * Tasks to run when we consider a page to be visible (via focus and/or visibility)\n   */\n  private _doChangeToForegroundTasks(breadcrumb?: ReplayBreadcrumbFrame): void {\n    if (!this.session) {\n      return;\n    }\n\n    const isSessionActive = this.checkAndHandleExpiredSession();\n\n    if (!isSessionActive) {\n      // If the user has come back to the page within SESSION_IDLE_PAUSE_DURATION\n      // ms, we will re-use the existing session, otherwise create a new\n      // session\n      logInfo('[Replay] Document has become active, but session has expired');\n      return;\n    }\n\n    if (breadcrumb) {\n      this._createCustomBreadcrumb(breadcrumb);\n    }\n  }\n\n  /**\n   * Trigger rrweb to take a full snapshot which will cause this plugin to\n   * create a new Replay event.\n   */\n  private _triggerFullSnapshot(checkout = true): void {\n    try {\n      logInfo('[Replay] Taking full rrweb snapshot');\n      record.takeFullSnapshot(checkout);\n    } catch (err) {\n      this._handleException(err);\n    }\n  }\n\n  /**\n   * Update user activity (across session lifespans)\n   */\n  private _updateUserActivity(_lastActivity: number = Date.now()): void {\n    this._lastActivity = _lastActivity;\n  }\n\n  /**\n   * Updates the session's last activity timestamp\n   */\n  private _updateSessionActivity(_lastActivity: number = Date.now()): void {\n    if (this.session) {\n      this.session.lastActivity = _lastActivity;\n      this._maybeSaveSession();\n    }\n  }\n\n  /**\n   * Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb\n   */\n  private _createCustomBreadcrumb(breadcrumb: ReplayBreadcrumbFrame): void {\n    this.addUpdate(() => {\n      void this.throttledAddEvent({\n        type: EventType.Custom,\n        timestamp: breadcrumb.timestamp || 0,\n        data: {\n          tag: 'breadcrumb',\n          payload: breadcrumb,\n        },\n      });\n    });\n  }\n\n  /**\n   * Observed performance events are added to `this.performanceEvents`. These\n   * are included in the replay event before it is finished and sent to Sentry.\n   */\n  private _addPerformanceEntries(): Promise<Array<AddEventResult | null>> {\n    // Copy and reset entries before processing\n    const entries = [...this.performanceEvents];\n    this.performanceEvents = [];\n\n    return Promise.all(createPerformanceSpans(this, createPerformanceEntries(entries)));\n  }\n\n  /**\n   * Clear _context\n   */\n  private _clearContext(): void {\n    // XXX: `initialTimestamp` and `initialUrl` do not get cleared\n    this._context.errorIds.clear();\n    this._context.traceIds.clear();\n    this._context.urls = [];\n  }\n\n  /** Update the initial timestamp based on the buffer content. */\n  private _updateInitialTimestampFromEventBuffer(): void {\n    const { session, eventBuffer } = this;\n    if (!session || !eventBuffer) {\n      return;\n    }\n\n    // we only ever update this on the initial segment\n    if (session.segmentId) {\n      return;\n    }\n\n    const earliestEvent = eventBuffer.getEarliestTimestamp();\n    if (earliestEvent && earliestEvent < this._context.initialTimestamp) {\n      this._context.initialTimestamp = earliestEvent;\n    }\n  }\n\n  /**\n   * Return and clear _context\n   */\n  private _popEventContext(): PopEventContext {\n    const _context = {\n      initialTimestamp: this._context.initialTimestamp,\n      initialUrl: this._context.initialUrl,\n      errorIds: Array.from(this._context.errorIds),\n      traceIds: Array.from(this._context.traceIds),\n      urls: this._context.urls,\n    };\n\n    this._clearContext();\n\n    return _context;\n  }\n\n  /**\n   * Flushes replay event buffer to Sentry.\n   *\n   * Performance events are only added right before flushing - this is\n   * due to the buffered performance observer events.\n   *\n   * Should never be called directly, only by `flush`\n   */\n  private async _runFlush(): Promise<void> {\n    const replayId = this.getSessionId();\n\n    if (!this.session || !this.eventBuffer || !replayId) {\n      __DEBUG_BUILD__ && logger.error('[Replay] No session or eventBuffer found to flush.');\n      return;\n    }\n\n    await this._addPerformanceEntries();\n\n    // Check eventBuffer again, as it could have been stopped in the meanwhile\n    if (!this.eventBuffer || !this.eventBuffer.hasEvents) {\n      return;\n    }\n\n    // Only attach memory event if eventBuffer is not empty\n    await addMemoryEntry(this);\n\n    // Check eventBuffer again, as it could have been stopped in the meanwhile\n    if (!this.eventBuffer) {\n      return;\n    }\n\n    // if this changed in the meanwhile, e.g. because the session was refreshed or similar, we abort here\n    if (replayId !== this.getSessionId()) {\n      return;\n    }\n\n    try {\n      // This uses the data from the eventBuffer, so we need to call this before `finish()\n      this._updateInitialTimestampFromEventBuffer();\n\n      const timestamp = Date.now();\n\n      // Check total duration again, to avoid sending outdated stuff\n      // We leave 30s wiggle room to accomodate late flushing etc.\n      // This _could_ happen when the browser is suspended during flushing, in which case we just want to stop\n      if (timestamp - this._context.initialTimestamp > this._options.maxReplayDuration + 30_000) {\n        throw new Error('Session is too long, not sending replay');\n      }\n\n      const eventContext = this._popEventContext();\n      // Always increment segmentId regardless of outcome of sending replay\n      const segmentId = this.session.segmentId++;\n      this._maybeSaveSession();\n\n      // Note this empties the event buffer regardless of outcome of sending replay\n      const recordingData = await this.eventBuffer.finish();\n\n      await sendReplay({\n        replayId,\n        recordingData,\n        segmentId,\n        eventContext,\n        session: this.session,\n        options: this.getOptions(),\n        timestamp,\n      });\n    } catch (err) {\n      this._handleException(err);\n\n      // This means we retried 3 times and all of them failed,\n      // or we ran into a problem we don't want to retry, like rate limiting.\n      // In this case, we want to completely stop the replay - otherwise, we may get inconsistent segments\n      void this.stop({ reason: 'sendReplay' });\n\n      const client = getCurrentHub().getClient();\n\n      if (client) {\n        client.recordDroppedEvent('send_error', 'replay');\n      }\n    }\n  }\n\n  /**\n   * Flush recording data to Sentry. Creates a lock so that only a single flush\n   * can be active at a time. Do not call this directly.\n   */\n  private _flush = async ({\n    force = false,\n  }: {\n    /**\n     * If true, flush while ignoring the `_isEnabled` state of\n     * Replay integration. (By default, flush is noop if integration\n     * is stopped).\n     */\n    force?: boolean;\n  } = {}): Promise<void> => {\n    if (!this._isEnabled && !force) {\n      // This can happen if e.g. the replay was stopped because of exceeding the retry limit\n      return;\n    }\n\n    if (!this.checkAndHandleExpiredSession()) {\n      __DEBUG_BUILD__ && logger.error('[Replay] Attempting to finish replay event after session expired.');\n      return;\n    }\n\n    if (!this.session) {\n      __DEBUG_BUILD__ && logger.error('[Replay] No session found to flush.');\n      return;\n    }\n\n    const start = this.session.started;\n    const now = Date.now();\n    const duration = now - start;\n\n    // A flush is about to happen, cancel any queued flushes\n    this._debouncedFlush.cancel();\n\n    // If session is too short, or too long (allow some wiggle room over maxReplayDuration), do not send it\n    // This _should_ not happen, but it may happen if flush is triggered due to a page activity change or similar\n    const tooShort = duration < this._options.minReplayDuration;\n    const tooLong = duration > this._options.maxReplayDuration + 5_000;\n    if (tooShort || tooLong) {\n      logInfo(\n        `[Replay] Session duration (${Math.floor(duration / 1000)}s) is too ${\n          tooShort ? 'short' : 'long'\n        }, not sending replay.`,\n        this._options._experiments.traceInternals,\n      );\n\n      if (tooShort) {\n        this._debouncedFlush();\n      }\n      return;\n    }\n\n    const eventBuffer = this.eventBuffer;\n    if (eventBuffer && this.session.segmentId === 0 && !eventBuffer.hasCheckout) {\n      logInfo('[Replay] Flushing initial segment without checkout.', this._options._experiments.traceInternals);\n      // TODO FN: Evaluate if we want to stop here, or remove this again?\n    }\n\n    // this._flushLock acts as a lock so that future calls to `_flush()`\n    // will be blocked until this promise resolves\n    if (!this._flushLock) {\n      this._flushLock = this._runFlush();\n      await this._flushLock;\n      this._flushLock = undefined;\n      return;\n    }\n\n    // Wait for previous flush to finish, then call the debounced `_flush()`.\n    // It's possible there are other flush requests queued and waiting for it\n    // to resolve. We want to reduce all outstanding requests (as well as any\n    // new flush requests that occur within a second of the locked flush\n    // completing) into a single flush.\n\n    try {\n      await this._flushLock;\n    } catch (err) {\n      __DEBUG_BUILD__ && logger.error(err);\n    } finally {\n      this._debouncedFlush();\n    }\n  };\n\n  /** Save the session, if it is sticky */\n  private _maybeSaveSession(): void {\n    if (this.session && this._options.stickySession) {\n      saveSession(this.session);\n    }\n  }\n\n  /** Handler for rrweb.record.onMutation */\n  private _onMutationHandler = (mutations: unknown[]): boolean => {\n    const count = mutations.length;\n\n    const mutationLimit = this._options.mutationLimit;\n    const mutationBreadcrumbLimit = this._options.mutationBreadcrumbLimit;\n    const overMutationLimit = mutationLimit && count > mutationLimit;\n\n    // Create a breadcrumb if a lot of mutations happen at the same time\n    // We can show this in the UI as an information with potential performance improvements\n    if (count > mutationBreadcrumbLimit || overMutationLimit) {\n      const breadcrumb = createBreadcrumb({\n        category: 'replay.mutations',\n        data: {\n          count,\n          limit: overMutationLimit,\n        },\n      });\n      this._createCustomBreadcrumb(breadcrumb);\n    }\n\n    // Stop replay if over the mutation limit\n    if (overMutationLimit) {\n      void this.stop({ reason: 'mutationLimit', forceFlush: this.recordingMode === 'session' });\n      return false;\n    }\n\n    // `true` means we use the regular mutation handling by rrweb\n    return true;\n  };\n}\n","type DebouncedCallback = {\n  (): void | unknown;\n  flush: () => void | unknown;\n  cancel: () => void;\n};\ntype CallbackFunction = () => unknown;\ntype DebounceOptions = { maxWait?: number };\n\n/**\n * Heavily simplified debounce function based on lodash.debounce.\n *\n * This function takes a callback function (@param fun) and delays its invocation\n * by @param wait milliseconds. Optionally, a maxWait can be specified in @param options,\n * which ensures that the callback is invoked at least once after the specified max. wait time.\n *\n * @param func the function whose invocation is to be debounced\n * @param wait the minimum time until the function is invoked after it was called once\n * @param options the options object, which can contain the `maxWait` property\n *\n * @returns the debounced version of the function, which needs to be called at least once to start the\n *          debouncing process. Subsequent calls will reset the debouncing timer and, in case @paramfunc\n *          was already invoked in the meantime, return @param func's return value.\n *          The debounced function has two additional properties:\n *          - `flush`: Invokes the debounced function immediately and returns its return value\n *          - `cancel`: Cancels the debouncing process and resets the debouncing timer\n */\nexport function debounce(func: CallbackFunction, wait: number, options?: DebounceOptions): DebouncedCallback {\n  let callbackReturnValue: unknown;\n\n  let timerId: ReturnType<typeof setTimeout> | undefined;\n  let maxTimerId: ReturnType<typeof setTimeout> | undefined;\n\n  const maxWait = options && options.maxWait ? Math.max(options.maxWait, wait) : 0;\n\n  function invokeFunc(): unknown {\n    cancelTimers();\n    callbackReturnValue = func();\n    return callbackReturnValue;\n  }\n\n  function cancelTimers(): void {\n    timerId !== undefined && clearTimeout(timerId);\n    maxTimerId !== undefined && clearTimeout(maxTimerId);\n    timerId = maxTimerId = undefined;\n  }\n\n  function flush(): unknown {\n    if (timerId !== undefined || maxTimerId !== undefined) {\n      return invokeFunc();\n    }\n    return callbackReturnValue;\n  }\n\n  function debounced(): unknown {\n    if (timerId) {\n      clearTimeout(timerId);\n    }\n    timerId = setTimeout(invokeFunc, wait);\n\n    if (maxWait && maxTimerId === undefined) {\n      maxTimerId = setTimeout(invokeFunc, maxWait);\n    }\n\n    return callbackReturnValue;\n  }\n\n  debounced.cancel = cancelTimers;\n  debounced.flush = flush;\n  return debounced;\n}\n","import { REPLAY_SESSION_KEY, WINDOW } from '../../src/constants';\nimport type { ReplayContainer } from '../../src/types';\nimport { hasSessionStorage } from '../util/hasSessionStorage';\n\n/**\n * Removes the session from Session Storage and unsets session in replay instance\n */\nexport function clearSession(replay: ReplayContainer): void {\n  deleteSession();\n  replay.session = undefined;\n}\n\n/**\n * Deletes a session from storage\n */\nfunction deleteSession(): void {\n  if (!hasSessionStorage()) {\n    return;\n  }\n\n  try {\n    WINDOW.sessionStorage.removeItem(REPLAY_SESSION_KEY);\n  } catch {\n    // Ignore potential SecurityError exceptions\n  }\n}\n","type ClassOption = string | RegExp;\n\n/** Duplicate this from @sentry-internal/rrweb so we can export this as well. */\nexport const ReplayEventTypeDomContentLoaded = 0;\nexport const ReplayEventTypeLoad = 1;\nexport const ReplayEventTypeFullSnapshot = 2;\nexport const ReplayEventTypeIncrementalSnapshot = 3;\nexport const ReplayEventTypeMeta = 4;\nexport const ReplayEventTypeCustom = 5;\nexport const ReplayEventTypePlugin = 6;\n\nexport type ReplayEventType =\n  | typeof ReplayEventTypeDomContentLoaded\n  | typeof ReplayEventTypeLoad\n  | typeof ReplayEventTypeFullSnapshot\n  | typeof ReplayEventTypeIncrementalSnapshot\n  | typeof ReplayEventTypeMeta\n  | typeof ReplayEventTypeCustom\n  | typeof ReplayEventTypePlugin;\n\n/**\n * This is a partial copy of rrweb's eventWithTime type which only contains the properties\n * we specifcally need in the SDK.\n */\nexport type ReplayEventWithTime = {\n  type: ReplayEventType;\n  data: unknown;\n  timestamp: number;\n  delay?: number;\n};\n\n/**\n * This is a partial copy of rrweb's recording options which only contains the properties\n * we specifically us in the SDK. Users can specify additional properties, hence we add the\n * Record<string, unknown> union type.\n */\nexport type RrwebRecordOptions = {\n  maskAllText?: boolean;\n  maskAllInputs?: boolean;\n  blockClass?: ClassOption;\n  ignoreClass?: string;\n  maskTextClass?: ClassOption;\n  maskTextSelector?: string;\n  blockSelector?: string;\n  maskInputOptions?: Record<string, boolean>;\n} & Record<string, unknown>;\n","import { getWorkerURL } from '@sentry-internal/replay-worker';\n\nimport type { EventBuffer } from '../types';\nimport { logInfo } from '../util/log';\nimport { EventBufferArray } from './EventBufferArray';\nimport { EventBufferProxy } from './EventBufferProxy';\n\ninterface CreateEventBufferParams {\n  useCompression: boolean;\n}\n\n/**\n * Create an event buffer for replays.\n */\nexport function createEventBuffer({ useCompression }: CreateEventBufferParams): EventBuffer {\n  // eslint-disable-next-line no-restricted-globals\n  if (useCompression && window.Worker) {\n    try {\n      const workerUrl = getWorkerURL();\n\n      logInfo('[Replay] Using compression worker');\n      const worker = new Worker(workerUrl);\n      return new EventBufferProxy(worker);\n    } catch (error) {\n      logInfo('[Replay] Failed to create compression worker');\n      // Fall back to use simple event buffer array\n    }\n  }\n\n  logInfo('[Replay] Using simple buffer');\n  return new EventBufferArray();\n}\n","import r from\"./worker\";function e(){const e=new Blob([r]);return URL.createObjectURL(e)}export{e as getWorkerURL};\n","export default `/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */\nfunction t(t){let e=t.length;for(;--e>=0;)t[e]=0}const e=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),a=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),n=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Array(576);t(s);const r=new Array(60);t(r);const o=new Array(512);t(o);const l=new Array(256);t(l);const h=new Array(29);t(h);const d=new Array(30);function _(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let f,c,u;function w(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}t(d);const m=t=>t<256?o[t]:o[256+(t>>>7)],b=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},g=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,b(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},p=(t,e,a)=>{g(t,a[2*e],a[2*e+1])},k=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},v=(t,e,a)=>{const i=new Array(16);let n,s,r=0;for(n=1;n<=15;n++)r=r+a[n-1]<<1,i[n]=r;for(s=0;s<=e;s++){let e=t[2*s+1];0!==e&&(t[2*s]=k(i[e]++,e))}},y=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},x=t=>{t.bi_valid>8?b(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},z=(t,e,a,i)=>{const n=2*e,s=2*a;return t[n]<t[s]||t[n]===t[s]&&i[e]<=i[a]},A=(t,e,a)=>{const i=t.heap[a];let n=a<<1;for(;n<=t.heap_len&&(n<t.heap_len&&z(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!z(e,i,t.heap[n],t.depth));)t.heap[a]=t.heap[n],a=n,n<<=1;t.heap[a]=i},E=(t,i,n)=>{let s,r,o,_,f=0;if(0!==t.sym_next)do{s=255&t.pending_buf[t.sym_buf+f++],s+=(255&t.pending_buf[t.sym_buf+f++])<<8,r=t.pending_buf[t.sym_buf+f++],0===s?p(t,r,i):(o=l[r],p(t,o+256+1,i),_=e[o],0!==_&&(r-=h[o],g(t,r,_)),s--,o=m(s),p(t,o,n),_=a[o],0!==_&&(s-=d[o],g(t,s,_)))}while(f<t.sym_next);p(t,256,i)},R=(t,e)=>{const a=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,s=e.stat_desc.elems;let r,o,l,h=-1;for(t.heap_len=0,t.heap_max=573,r=0;r<s;r++)0!==a[2*r]?(t.heap[++t.heap_len]=h=r,t.depth[r]=0):a[2*r+1]=0;for(;t.heap_len<2;)l=t.heap[++t.heap_len]=h<2?++h:0,a[2*l]=1,t.depth[l]=0,t.opt_len--,n&&(t.static_len-=i[2*l+1]);for(e.max_code=h,r=t.heap_len>>1;r>=1;r--)A(t,a,r);l=s;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],A(t,a,1),o=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=o,a[2*l]=a[2*r]+a[2*o],t.depth[l]=(t.depth[r]>=t.depth[o]?t.depth[r]:t.depth[o])+1,a[2*r+1]=a[2*o+1]=l,t.heap[1]=l++,A(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,s=e.stat_desc.has_stree,r=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length;let h,d,_,f,c,u,w=0;for(f=0;f<=15;f++)t.bl_count[f]=0;for(a[2*t.heap[t.heap_max]+1]=0,h=t.heap_max+1;h<573;h++)d=t.heap[h],f=a[2*a[2*d+1]+1]+1,f>l&&(f=l,w++),a[2*d+1]=f,d>i||(t.bl_count[f]++,c=0,d>=o&&(c=r[d-o]),u=a[2*d],t.opt_len+=u*(f+c),s&&(t.static_len+=u*(n[2*d+1]+c)));if(0!==w){do{for(f=l-1;0===t.bl_count[f];)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[l]--,w-=2}while(w>0);for(f=l;0!==f;f--)for(d=t.bl_count[f];0!==d;)_=t.heap[--h],_>i||(a[2*_+1]!==f&&(t.opt_len+=(f-a[2*_+1])*a[2*_],a[2*_+1]=f),d--)}})(t,e),v(a,h,t.bl_count)},Z=(t,e,a)=>{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=r,r=e[2*(i+1)+1],++o<l&&n===r||(o<h?t.bl_tree[2*n]+=o:0!==n?(n!==s&&t.bl_tree[2*n]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,s=n,0===r?(l=138,h=3):n===r?(l=6,h=3):(l=7,h=4))},U=(t,e,a)=>{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),i=0;i<=a;i++)if(n=r,r=e[2*(i+1)+1],!(++o<l&&n===r)){if(o<h)do{p(t,n,t.bl_tree)}while(0!=--o);else 0!==n?(n!==s&&(p(t,n,t.bl_tree),o--),p(t,16,t.bl_tree),g(t,o-3,2)):o<=10?(p(t,17,t.bl_tree),g(t,o-3,3)):(p(t,18,t.bl_tree),g(t,o-11,7));o=0,s=n,0===r?(l=138,h=3):n===r?(l=6,h=3):(l=7,h=4)}};let S=!1;const D=(t,e,a,i)=>{g(t,0+(i?1:0),3),x(t),b(t,a),b(t,~a),a&&t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a};var T=(t,e,a,i)=>{let o,l,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),R(t,t.l_desc),R(t,t.d_desc),h=(t=>{let e;for(Z(t,t.dyn_ltree,t.l_desc.max_code),Z(t,t.dyn_dtree,t.d_desc.max_code),R(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*n[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),o=t.opt_len+3+7>>>3,l=t.static_len+3+7>>>3,l<=o&&(o=l)):o=l=a+5,a+4<=o&&-1!==e?D(t,e,a,i):4===t.strategy||l===o?(g(t,2+(i?1:0),3),E(t,s,r)):(g(t,4+(i?1:0),3),((t,e,a,i)=>{let s;for(g(t,e-257,5),g(t,a-1,5),g(t,i-4,4),s=0;s<i;s++)g(t,t.bl_tree[2*n[s]+1],3);U(t,t.dyn_ltree,e-1),U(t,t.dyn_dtree,a-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,h+1),E(t,t.dyn_ltree,t.dyn_dtree)),y(t),i&&x(t)},O={_tr_init:t=>{S||((()=>{let t,n,w,m,b;const g=new Array(16);for(w=0,m=0;m<28;m++)for(h[m]=w,t=0;t<1<<e[m];t++)l[w++]=m;for(l[w-1]=m,b=0,m=0;m<16;m++)for(d[m]=b,t=0;t<1<<a[m];t++)o[b++]=m;for(b>>=7;m<30;m++)for(d[m]=b<<7,t=0;t<1<<a[m]-7;t++)o[256+b++]=m;for(n=0;n<=15;n++)g[n]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,g[8]++;for(;t<=255;)s[2*t+1]=9,t++,g[9]++;for(;t<=279;)s[2*t+1]=7,t++,g[7]++;for(;t<=287;)s[2*t+1]=8,t++,g[8]++;for(v(s,287,g),t=0;t<30;t++)r[2*t+1]=5,r[2*t]=k(t,5);f=new _(s,e,257,286,15),c=new _(r,a,0,30,15),u=new _(new Array(0),i,0,19,7)})(),S=!0),t.l_desc=new w(t.dyn_ltree,f),t.d_desc=new w(t.dyn_dtree,c),t.bl_desc=new w(t.bl_tree,u),t.bi_buf=0,t.bi_valid=0,y(t)},_tr_stored_block:D,_tr_flush_block:T,_tr_tally:(t,e,a)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=a,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(l[a]+256+1)]++,t.dyn_dtree[2*m(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{g(t,2,3),p(t,256,s),(t=>{16===t.bi_valid?(b(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var F=(t,e,a,i)=>{let n=65535&t|0,s=t>>>16&65535|0,r=0;for(;0!==a;){r=a>2e3?2e3:a,a-=r;do{n=n+e[i++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16|0};const L=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var N=(t,e,a,i)=>{const n=L,s=i+a;t^=-1;for(let a=i;a<s;a++)t=t>>>8^n[255&(t^e[a])];return-1^t},I={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"},B={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:C,_tr_stored_block:H,_tr_flush_block:M,_tr_tally:j,_tr_align:K}=O,{Z_NO_FLUSH:P,Z_PARTIAL_FLUSH:Y,Z_FULL_FLUSH:G,Z_FINISH:X,Z_BLOCK:W,Z_OK:q,Z_STREAM_END:J,Z_STREAM_ERROR:Q,Z_DATA_ERROR:V,Z_BUF_ERROR:$,Z_DEFAULT_COMPRESSION:tt,Z_FILTERED:et,Z_HUFFMAN_ONLY:at,Z_RLE:it,Z_FIXED:nt,Z_DEFAULT_STRATEGY:st,Z_UNKNOWN:rt,Z_DEFLATED:ot}=B,lt=(t,e)=>(t.msg=I[e],e),ht=t=>2*t-(t>4?9:0),dt=t=>{let e=t.length;for(;--e>=0;)t[e]=0},_t=t=>{let e,a,i,n=t.w_size;e=t.hash_size,i=e;do{a=t.head[--i],t.head[i]=a>=n?a-n:0}while(--e);e=n,i=e;do{a=t.prev[--i],t.prev[i]=a>=n?a-n:0}while(--e)};let ft=(t,e,a)=>(e<<t.hash_shift^a)&t.hash_mask;const ct=t=>{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},ut=(t,e)=>{M(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,ct(t.strm)},wt=(t,e)=>{t.pending_buf[t.pending++]=e},mt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},bt=(t,e,a,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),a),1===t.state.wrap?t.adler=F(t.adler,e,n,a):2===t.state.wrap&&(t.adler=N(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)},gt=(t,e)=>{let a,i,n=t.max_chain_length,s=t.strstart,r=t.prev_length,o=t.nice_match;const l=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+258;let c=h[s+r-1],u=h[s+r];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(a=e,h[a+r]===u&&h[a+r-1]===c&&h[a]===h[s]&&h[++a]===h[s+1]){s+=2,a++;do{}while(h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&s<f);if(i=258-(f-s),s=f-258,i>r){if(t.match_start=e,r=i,i>=o)break;c=h[s+r-1],u=h[s+r]}}}while((e=_[e&d])>l&&0!=--n);return r<=t.lookahead?r:t.lookahead},pt=t=>{const e=t.w_size;let a,i,n;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-262)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),_t(t),i+=e),0===t.strm.avail_in)break;if(a=bt(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=a,t.lookahead+t.insert>=3)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=ft(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=ft(t,t.ins_h,t.window[n+3-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)},kt=(t,e)=>{let a,i,n,s=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r=0,o=t.strm.avail_in;do{if(a=65535,n=t.bi_valid+42>>3,t.strm.avail_out<n)break;if(n=t.strm.avail_out-n,i=t.strstart-t.block_start,a>i+t.strm.avail_in&&(a=i+t.strm.avail_in),a>n&&(a=n),a<s&&(0===a&&e!==X||e===P||a!==i+t.strm.avail_in))break;r=e===X&&a===i+t.strm.avail_in?1:0,H(t,0,0,r),t.pending_buf[t.pending-4]=a,t.pending_buf[t.pending-3]=a>>8,t.pending_buf[t.pending-2]=~a,t.pending_buf[t.pending-1]=~a>>8,ct(t.strm),i&&(i>a&&(i=a),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,a-=i),a&&(bt(t.strm,t.strm.output,t.strm.next_out,a),t.strm.next_out+=a,t.strm.avail_out-=a,t.strm.total_out+=a)}while(0===r);return o-=t.strm.avail_in,o&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),r?4:e!==P&&e!==X&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(n=t.window_size-t.strstart,t.strm.avail_in>n&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,n+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),n>t.strm.avail_in&&(n=t.strm.avail_in),n&&(bt(t.strm,t.window,t.strstart,n),t.strstart+=n,t.insert+=n>t.w_size-t.insert?t.w_size-t.insert:n),t.high_water<t.strstart&&(t.high_water=t.strstart),n=t.bi_valid+42>>3,n=t.pending_buf_size-n>65535?65535:t.pending_buf_size-n,s=n>t.w_size?t.w_size:n,i=t.strstart-t.block_start,(i>=s||(i||e===X)&&e!==P&&0===t.strm.avail_in&&i<=n)&&(a=i>n?n:i,r=e===X&&0===t.strm.avail_in&&a===i?1:0,H(t,t.block_start,a,r),t.block_start+=a,ct(t.strm)),r?3:1)},vt=(t,e)=>{let a,i;for(;;){if(t.lookahead<262){if(pt(t),t.lookahead<262&&e===P)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-262&&(t.match_length=gt(t,a)),t.match_length>=3)if(i=j(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=ft(t,t.ins_h,t.window[t.strstart+1]);else i=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2},yt=(t,e)=>{let a,i,n;for(;;){if(t.lookahead<262){if(pt(t),t.lookahead<262&&e===P)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-262&&(t.match_length=gt(t,a),t.match_length<=5&&(t.strategy===et||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=j(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(ut(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=j(t,0,t.window[t.strstart-1]),i&&ut(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=j(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2};function xt(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}const zt=[new xt(0,0,0,0,kt),new xt(4,4,8,4,vt),new xt(4,5,16,8,vt),new xt(4,6,32,32,vt),new xt(4,4,16,16,yt),new xt(8,16,32,32,yt),new xt(8,16,128,128,yt),new xt(8,32,128,256,yt),new xt(32,128,258,1024,yt),new xt(32,258,258,4096,yt)];function At(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ot,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),dt(this.dyn_ltree),dt(this.dyn_dtree),dt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),dt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),dt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Et=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||42!==e.status&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&113!==e.status&&666!==e.status?1:0},Rt=t=>{if(Et(t))return lt(t,Q);t.total_in=t.total_out=0,t.data_type=rt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=-2,C(e),q},Zt=t=>{const e=Rt(t);var a;return e===q&&((a=t.state).window_size=2*a.w_size,dt(a.head),a.max_lazy_match=zt[a.level].max_lazy,a.good_match=zt[a.level].good_length,a.nice_match=zt[a.level].nice_length,a.max_chain_length=zt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},Ut=(t,e,a,i,n,s)=>{if(!t)return Q;let r=1;if(e===tt&&(e=6),i<0?(r=0,i=-i):i>15&&(r=2,i-=16),n<1||n>9||a!==ot||i<8||i>15||e<0||e>9||s<0||s>nt||8===i&&1!==r)return lt(t,Q);8===i&&(i=9);const o=new At;return t.state=o,o.strm=t,o.status=42,o.wrap=r,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=n+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<n+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=3*(o.lit_bufsize-1),o.level=e,o.strategy=s,o.method=a,Zt(t)};var St={deflateInit:(t,e)=>Ut(t,e,ot,15,8,st),deflateInit2:Ut,deflateReset:Zt,deflateResetKeep:Rt,deflateSetHeader:(t,e)=>Et(t)||2!==t.state.wrap?Q:(t.state.gzhead=e,q),deflate:(t,e)=>{if(Et(t)||e>W||e<0)return t?lt(t,Q):Q;const a=t.state;if(!t.output||0!==t.avail_in&&!t.input||666===a.status&&e!==X)return lt(t,0===t.avail_out?$:Q);const i=a.last_flush;if(a.last_flush=e,0!==a.pending){if(ct(t),0===t.avail_out)return a.last_flush=-1,q}else if(0===t.avail_in&&ht(e)<=ht(i)&&e!==X)return lt(t,$);if(666===a.status&&0!==t.avail_in)return lt(t,$);if(42===a.status&&0===a.wrap&&(a.status=113),42===a.status){let e=ot+(a.w_bits-8<<4)<<8,i=-1;if(i=a.strategy>=at||a.level<2?0:a.level<6?1:6===a.level?2:3,e|=i<<6,0!==a.strstart&&(e|=32),e+=31-e%31,mt(a,e),0!==a.strstart&&(mt(a,t.adler>>>16),mt(a,65535&t.adler)),t.adler=1,a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q}if(57===a.status)if(t.adler=0,wt(a,31),wt(a,139),wt(a,8),a.gzhead)wt(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),wt(a,255&a.gzhead.time),wt(a,a.gzhead.time>>8&255),wt(a,a.gzhead.time>>16&255),wt(a,a.gzhead.time>>24&255),wt(a,9===a.level?2:a.strategy>=at||a.level<2?4:0),wt(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(wt(a,255&a.gzhead.extra.length),wt(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(t.adler=N(t.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(wt(a,0),wt(a,0),wt(a,0),wt(a,0),wt(a,0),wt(a,9===a.level?2:a.strategy>=at||a.level<2?4:0),wt(a,3),a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q;if(69===a.status){if(a.gzhead.extra){let e=a.pending,i=(65535&a.gzhead.extra.length)-a.gzindex;for(;a.pending+i>a.pending_buf_size;){let n=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+n),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>e&&(t.adler=N(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex+=n,ct(t),0!==a.pending)return a.last_flush=-1,q;e=0,i-=n}let n=new Uint8Array(a.gzhead.extra);a.pending_buf.set(n.subarray(a.gzindex,a.gzindex+i),a.pending),a.pending+=i,a.gzhead.hcrc&&a.pending>e&&(t.adler=N(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex=0}a.status=73}if(73===a.status){if(a.gzhead.name){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),ct(t),0!==a.pending)return a.last_flush=-1,q;i=0}e=a.gzindex<a.gzhead.name.length?255&a.gzhead.name.charCodeAt(a.gzindex++):0,wt(a,e)}while(0!==e);a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),a.gzindex=0}a.status=91}if(91===a.status){if(a.gzhead.comment){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),ct(t),0!==a.pending)return a.last_flush=-1,q;i=0}e=a.gzindex<a.gzhead.comment.length?255&a.gzhead.comment.charCodeAt(a.gzindex++):0,wt(a,e)}while(0!==e);a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i))}a.status=103}if(103===a.status){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(ct(t),0!==a.pending))return a.last_flush=-1,q;wt(a,255&t.adler),wt(a,t.adler>>8&255),t.adler=0}if(a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q}if(0!==t.avail_in||0!==a.lookahead||e!==P&&666!==a.status){let i=0===a.level?kt(a,e):a.strategy===at?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(pt(t),0===t.lookahead)){if(e===P)return 1;break}if(t.match_length=0,a=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2})(a,e):a.strategy===it?((t,e)=>{let a,i,n,s;const r=t.window;for(;;){if(t.lookahead<=258){if(pt(t),t.lookahead<=258&&e===P)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,i=r[n],i===r[++n]&&i===r[++n]&&i===r[++n])){s=t.strstart+258;do{}while(i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&n<s);t.match_length=258-(s-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=j(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2})(a,e):zt[a.level].func(a,e);if(3!==i&&4!==i||(a.status=666),1===i||3===i)return 0===t.avail_out&&(a.last_flush=-1),q;if(2===i&&(e===Y?K(a):e!==W&&(H(a,0,0,!1),e===G&&(dt(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),ct(t),0===t.avail_out))return a.last_flush=-1,q}return e!==X?q:a.wrap<=0?J:(2===a.wrap?(wt(a,255&t.adler),wt(a,t.adler>>8&255),wt(a,t.adler>>16&255),wt(a,t.adler>>24&255),wt(a,255&t.total_in),wt(a,t.total_in>>8&255),wt(a,t.total_in>>16&255),wt(a,t.total_in>>24&255)):(mt(a,t.adler>>>16),mt(a,65535&t.adler)),ct(t),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?q:J)},deflateEnd:t=>{if(Et(t))return Q;const e=t.state.status;return t.state=null,113===e?lt(t,V):q},deflateSetDictionary:(t,e)=>{let a=e.length;if(Et(t))return Q;const i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return Q;if(1===n&&(t.adler=F(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(dt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(a-i.w_size,a),0),e=t,a=i.w_size}const s=t.avail_in,r=t.next_in,o=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,pt(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=ft(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,pt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=r,t.input=o,t.avail_in=s,i.wrap=n,q},deflateInfo:\"pako deflate (from Nodeca project)\"};const Dt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Tt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if(\"object\"!=typeof a)throw new TypeError(a+\"must be non-object\");for(const e in a)Dt(a,e)&&(t[e]=a[e])}}return t},Ot=t=>{let e=0;for(let a=0,i=t.length;a<i;a++)e+=t[a].length;const a=new Uint8Array(e);for(let e=0,i=0,n=t.length;e<n;e++){let n=t[e];a.set(n,i),i+=n.length}return a};let Ft=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Ft=!1}const Lt=new Uint8Array(256);for(let t=0;t<256;t++)Lt[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Lt[254]=Lt[254]=1;var Nt=t=>{if(\"function\"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,i,n,s,r=t.length,o=0;for(n=0;n<r;n++)a=t.charCodeAt(n),55296==(64512&a)&&n+1<r&&(i=t.charCodeAt(n+1),56320==(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),n++)),o+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(o),s=0,n=0;s<o;n++)a=t.charCodeAt(n),55296==(64512&a)&&n+1<r&&(i=t.charCodeAt(n+1),56320==(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),n++)),a<128?e[s++]=a:a<2048?(e[s++]=192|a>>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},It=(t,e)=>{const a=e||t.length;if(\"function\"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let i,n;const s=new Array(2*a);for(n=0,i=0;i<a;){let e=t[i++];if(e<128){s[n++]=e;continue}let r=Lt[e];if(r>4)s[n++]=65533,i+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&i<a;)e=e<<6|63&t[i++],r--;r>1?s[n++]=65533:e<65536?s[n++]=e:(e-=65536,s[n++]=55296|e>>10&1023,s[n++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Ft)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let a=\"\";for(let i=0;i<e;i++)a+=String.fromCharCode(t[i]);return a})(s,n)},Bt=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let a=e-1;for(;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Lt[t[a]]>e?a:e};var Ct=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0};const Ht=Object.prototype.toString,{Z_NO_FLUSH:Mt,Z_SYNC_FLUSH:jt,Z_FULL_FLUSH:Kt,Z_FINISH:Pt,Z_OK:Yt,Z_STREAM_END:Gt,Z_DEFAULT_COMPRESSION:Xt,Z_DEFAULT_STRATEGY:Wt,Z_DEFLATED:qt}=B;function Jt(t){this.options=Tt({level:Xt,method:qt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Wt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new Ct,this.strm.avail_out=0;let a=St.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==Yt)throw new Error(I[a]);if(e.header&&St.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t=\"string\"==typeof e.dictionary?Nt(e.dictionary):\"[object ArrayBuffer]\"===Ht.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=St.deflateSetDictionary(this.strm,t),a!==Yt)throw new Error(I[a]);this._dict_set=!0}}function Qt(t,e){const a=new Jt(e);if(a.push(t,!0),a.err)throw a.msg||I[a.err];return a.result}Jt.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?Pt:Mt,\"string\"==typeof t?a.input=Nt(t):\"[object ArrayBuffer]\"===Ht.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),(s===jt||s===Kt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=St.deflate(a,s),n===Gt)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=St.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Yt;if(0!==a.avail_out){if(s>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},Jt.prototype.onData=function(t){this.chunks.push(t)},Jt.prototype.onEnd=function(t){t===Yt&&(this.result=Ot(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Vt={Deflate:Jt,deflate:Qt,deflateRaw:function(t,e){return(e=e||{}).raw=!0,Qt(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,Qt(t,e)},constants:B};var $t=function(t,e){let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,v,y,x,z,A;const E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,s=n-(e-t.avail_out),r=n+(t.avail_out-257),o=E.dmax,l=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,c=E.bits,u=E.lencode,w=E.distcode,m=(1<<E.lenbits)-1,b=(1<<E.distbits)-1;t:do{c<15&&(f+=z[a++]<<c,c+=8,f+=z[a++]<<c,c+=8),g=u[f&m];e:for(;;){if(p=g>>>24,f>>>=p,c-=p,p=g>>>16&255,0===p)A[n++]=65535&g;else{if(!(16&p)){if(0==(64&p)){g=u[(65535&g)+(f&(1<<p)-1)];continue e}if(32&p){E.mode=16191;break t}t.msg=\"invalid literal/length code\",E.mode=16209;break t}k=65535&g,p&=15,p&&(c<p&&(f+=z[a++]<<c,c+=8),k+=f&(1<<p)-1,f>>>=p,c-=p),c<15&&(f+=z[a++]<<c,c+=8,f+=z[a++]<<c,c+=8),g=w[f&b];a:for(;;){if(p=g>>>24,f>>>=p,c-=p,p=g>>>16&255,!(16&p)){if(0==(64&p)){g=w[(65535&g)+(f&(1<<p)-1)];continue a}t.msg=\"invalid distance code\",E.mode=16209;break t}if(v=65535&g,p&=15,c<p&&(f+=z[a++]<<c,c+=8,c<p&&(f+=z[a++]<<c,c+=8)),v+=f&(1<<p)-1,v>o){t.msg=\"invalid distance too far back\",E.mode=16209;break t}if(f>>>=p,c-=p,p=n-s,v>p){if(p=v-p,p>h&&E.sane){t.msg=\"invalid distance too far back\",E.mode=16209;break t}if(y=0,x=_,0===d){if(y+=l-p,p<k){k-=p;do{A[n++]=_[y++]}while(--p);y=n-v,x=A}}else if(d<p){if(y+=l+d-p,p-=d,p<k){k-=p;do{A[n++]=_[y++]}while(--p);if(y=0,d<k){p=d,k-=p;do{A[n++]=_[y++]}while(--p);y=n-v,x=A}}}else if(y+=d-p,p<k){k-=p;do{A[n++]=_[y++]}while(--p);y=n-v,x=A}for(;k>2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],k-=3;k&&(A[n++]=x[y++],k>1&&(A[n++]=x[y++]))}else{y=n-v;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],k-=3}while(k>2);k&&(A[n++]=A[y++],k>1&&(A[n++]=A[y++]))}break}}break}}while(a<i&&n<r);k=c>>3,a-=k,c-=k<<3,f&=(1<<c)-1,t.next_in=a,t.next_out=n,t.avail_in=a<i?i-a+5:5-(a-i),t.avail_out=n<r?r-n+257:257-(n-r),E.hold=f,E.bits=c};const te=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),ee=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),ae=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ie=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var ne=(t,e,a,i,n,s,r,o)=>{const l=o.bits;let h,d,_,f,c,u,w=0,m=0,b=0,g=0,p=0,k=0,v=0,y=0,x=0,z=0,A=null;const E=new Uint16Array(16),R=new Uint16Array(16);let Z,U,S,D=null;for(w=0;w<=15;w++)E[w]=0;for(m=0;m<i;m++)E[e[a+m]]++;for(p=l,g=15;g>=1&&0===E[g];g--);if(p>g&&(p=g),0===g)return n[s++]=20971520,n[s++]=20971520,o.bits=1,0;for(b=1;b<g&&0===E[b];b++);for(p<b&&(p=b),y=1,w=1;w<=15;w++)if(y<<=1,y-=E[w],y<0)return-1;if(y>0&&(0===t||1!==g))return-1;for(R[1]=0,w=1;w<15;w++)R[w+1]=R[w]+E[w];for(m=0;m<i;m++)0!==e[a+m]&&(r[R[e[a+m]]++]=m);if(0===t?(A=D=r,u=20):1===t?(A=te,D=ee,u=257):(A=ae,D=ie,u=0),z=0,m=0,w=b,c=s,k=p,v=0,_=-1,x=1<<p,f=x-1,1===t&&x>852||2===t&&x>592)return 1;for(;;){Z=w-v,r[m]+1<u?(U=0,S=r[m]):r[m]>=u?(U=D[r[m]-u],S=A[r[m]-u]):(U=96,S=0),h=1<<w-v,d=1<<k,b=d;do{d-=h,n[c+(z>>v)+d]=Z<<24|U<<16|S|0}while(0!==d);for(h=1<<w-1;z&h;)h>>=1;if(0!==h?(z&=h-1,z+=h):z=0,m++,0==--E[w]){if(w===g)break;w=e[a+r[m]]}if(w>p&&(z&f)!==_){for(0===v&&(v=p),c+=b,k=w-v,y=1<<k;k+v<g&&(y-=E[k+v],!(y<=0));)k++,y<<=1;if(x+=1<<k,1===t&&x>852||2===t&&x>592)return 1;_=z&f,n[_]=p<<24|k<<16|c-s|0}}return 0!==z&&(n[c+z]=w-v<<24|64<<16|0),o.bits=p,0};const{Z_FINISH:se,Z_BLOCK:re,Z_TREES:oe,Z_OK:le,Z_STREAM_END:he,Z_NEED_DICT:de,Z_STREAM_ERROR:_e,Z_DATA_ERROR:fe,Z_MEM_ERROR:ce,Z_BUF_ERROR:ue,Z_DEFLATED:we}=B,me=16209,be=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function ge(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const pe=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<16180||e.mode>16211?1:0},ke=t=>{if(pe(t))return _e;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg=\"\",e.wrap&&(t.adler=1&e.wrap),e.mode=16180,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,le},ve=t=>{if(pe(t))return _e;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,ke(t)},ye=(t,e)=>{let a;if(pe(t))return _e;const i=t.state;return e<0?(a=0,e=-e):(a=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?_e:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,ve(t))},xe=(t,e)=>{if(!t)return _e;const a=new ge;t.state=a,a.strm=t,a.window=null,a.mode=16180;const i=ye(t,e);return i!==le&&(t.state=null),i};let ze,Ae,Ee=!0;const Re=t=>{if(Ee){ze=new Int32Array(512),Ae=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ne(1,t.lens,0,288,ze,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ne(2,t.lens,0,32,Ae,0,t.work,{bits:5}),Ee=!1}t.lencode=ze,t.lenbits=9,t.distcode=Ae,t.distbits=5},Ze=(t,e,a,i)=>{let n;const s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),i>=s.wsize?(s.window.set(e.subarray(a-s.wsize,a),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(e.subarray(a-i,a-i+n),s.wnext),(i-=n)?(s.window.set(e.subarray(a-i,a),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=n))),0};var Ue={inflateReset:ve,inflateReset2:ye,inflateResetKeep:ke,inflateInit:t=>xe(t,15),inflateInit2:xe,inflate:(t,e)=>{let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,v,y,x,z=0;const A=new Uint8Array(4);let E,R;const Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(pe(t)||!t.output||!t.input&&0!==t.avail_in)return _e;a=t.state,16191===a.mode&&(a.mode=16192),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,_=o,f=l,x=le;t:for(;;)switch(a.mode){case 16180:if(0===a.wrap){a.mode=16192;break}for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(2&a.wrap&&35615===h){0===a.wbits&&(a.wbits=15),a.check=0,A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0),h=0,d=0,a.mode=16181;break}if(a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg=\"incorrect header check\",a.mode=me;break}if((15&h)!==we){t.msg=\"unknown compression method\",a.mode=me;break}if(h>>>=4,d-=4,y=8+(15&h),0===a.wbits&&(a.wbits=y),y>15||y>a.wbits){t.msg=\"invalid window size\",a.mode=me;break}a.dmax=1<<a.wbits,a.flags=0,t.adler=a.check=1,a.mode=512&h?16189:16191,h=0,d=0;break;case 16181:for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(a.flags=h,(255&a.flags)!==we){t.msg=\"unknown compression method\",a.mode=me;break}if(57344&a.flags){t.msg=\"unknown header flags set\",a.mode=me;break}a.head&&(a.head.text=h>>8&1),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0,a.mode=16182;case 16182:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.head&&(a.head.time=h),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,A[2]=h>>>16&255,A[3]=h>>>24&255,a.check=N(a.check,A,4,0)),h=0,d=0,a.mode=16183;case 16183:for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.head&&(a.head.xflags=255&h,a.head.os=h>>8),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0,a.mode=16184;case 16184:if(1024&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.length=h,a.head&&(a.head.extra_len=h),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=16185;case 16185:if(1024&a.flags&&(c=a.length,c>o&&(c=o),c&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(s,s+c),y)),512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,a.length-=c),a.length))break t;a.length=0,a.mode=16186;case 16186:if(2048&a.flags){if(0===o)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&c<o);if(512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,y)break t}else a.head&&(a.head.name=null);a.length=0,a.mode=16187;case 16187:if(4096&a.flags){if(0===o)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.comment+=String.fromCharCode(y))}while(y&&c<o);if(512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,y)break t}else a.head&&(a.head.comment=null);a.mode=16188;case 16188:if(512&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(4&a.wrap&&h!==(65535&a.check)){t.msg=\"header crc mismatch\",a.mode=me;break}h=0,d=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=16191;break;case 16189:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}t.adler=a.check=be(h),h=0,d=0,a.mode=16190;case 16190:if(0===a.havedict)return t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,de;t.adler=a.check=1,a.mode=16191;case 16191:if(e===re||e===oe)break t;case 16192:if(a.last){h>>>=7&d,d-=7&d,a.mode=16206;break}for(;d<3;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}switch(a.last=1&h,h>>>=1,d-=1,3&h){case 0:a.mode=16193;break;case 1:if(Re(a),a.mode=16199,e===oe){h>>>=2,d-=2;break t}break;case 2:a.mode=16196;break;case 3:t.msg=\"invalid block type\",a.mode=me}h>>>=2,d-=2;break;case 16193:for(h>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if((65535&h)!=(h>>>16^65535)){t.msg=\"invalid stored block lengths\",a.mode=me;break}if(a.length=65535&h,h=0,d=0,a.mode=16194,e===oe)break t;case 16194:a.mode=16195;case 16195:if(c=a.length,c){if(c>o&&(c=o),c>l&&(c=l),0===c)break t;n.set(i.subarray(s,s+c),r),o-=c,s+=c,l-=c,r+=c,a.length-=c;break}a.mode=16191;break;case 16196:for(;d<14;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(a.nlen=257+(31&h),h>>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg=\"too many length or distance symbols\",a.mode=me;break}a.have=0,a.mode=16197;case 16197:for(;a.have<a.ncode;){for(;d<3;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.lens[Z[a.have++]]=7&h,h>>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,E={bits:a.lenbits},x=ne(0,a.lens,0,19,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg=\"invalid code lengths set\",a.mode=me;break}a.have=0,a.mode=16198;case 16198:for(;a.have<a.nlen+a.ndist;){for(;z=a.lencode[h&(1<<a.lenbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(g<16)h>>>=m,d-=m,a.lens[a.have++]=g;else{if(16===g){for(R=m+2;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(h>>>=m,d-=m,0===a.have){t.msg=\"invalid bit length repeat\",a.mode=me;break}y=a.lens[a.have-1],c=3+(3&h),h>>>=2,d-=2}else if(17===g){for(R=m+3;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=m,d-=m,y=0,c=3+(7&h),h>>>=3,d-=3}else{for(R=m+7;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=m,d-=m,y=0,c=11+(127&h),h>>>=7,d-=7}if(a.have+c>a.nlen+a.ndist){t.msg=\"invalid bit length repeat\",a.mode=me;break}for(;c--;)a.lens[a.have++]=y}}if(a.mode===me)break;if(0===a.lens[256]){t.msg=\"invalid code -- missing end-of-block\",a.mode=me;break}if(a.lenbits=9,E={bits:a.lenbits},x=ne(1,a.lens,0,a.nlen,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg=\"invalid literal/lengths set\",a.mode=me;break}if(a.distbits=6,a.distcode=a.distdyn,E={bits:a.distbits},x=ne(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,E),a.distbits=E.bits,x){t.msg=\"invalid distances set\",a.mode=me;break}if(a.mode=16199,e===oe)break t;case 16199:a.mode=16200;case 16200:if(o>=6&&l>=258){t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,$t(t,f),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,16191===a.mode&&(a.back=-1);break}for(a.back=0;z=a.lencode[h&(1<<a.lenbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(b&&0==(240&b)){for(p=m,k=b,v=g;z=a.lencode[v+((h&(1<<p+k)-1)>>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,a.length=g,0===b){a.mode=16205;break}if(32&b){a.back=-1,a.mode=16191;break}if(64&b){t.msg=\"invalid literal/length code\",a.mode=me;break}a.extra=15&b,a.mode=16201;case 16201:if(a.extra){for(R=a.extra;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.length+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=16202;case 16202:for(;z=a.distcode[h&(1<<a.distbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(0==(240&b)){for(p=m,k=b,v=g;z=a.distcode[v+((h&(1<<p+k)-1)>>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,64&b){t.msg=\"invalid distance code\",a.mode=me;break}a.offset=g,a.extra=15&b,a.mode=16203;case 16203:if(a.extra){for(R=a.extra;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.offset+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg=\"invalid distance too far back\",a.mode=me;break}a.mode=16204;case 16204:if(0===l)break t;if(c=f-l,a.offset>c){if(c=a.offset-c,c>a.whave&&a.sane){t.msg=\"invalid distance too far back\",a.mode=me;break}c>a.wnext?(c-=a.wnext,u=a.wsize-c):u=a.wnext-c,c>a.length&&(c=a.length),w=a.window}else w=n,u=r-a.offset,c=a.length;c>l&&(c=l),l-=c,a.length-=c;do{n[r++]=w[u++]}while(--c);0===a.length&&(a.mode=16200);break;case 16205:if(0===l)break t;n[r++]=a.length,l--,a.mode=16200;break;case 16206:if(a.wrap){for(;d<32;){if(0===o)break t;o--,h|=i[s++]<<d,d+=8}if(f-=l,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?N(a.check,n,f,r-f):F(a.check,n,f,r-f)),f=l,4&a.wrap&&(a.flags?h:be(h))!==a.check){t.msg=\"incorrect data check\",a.mode=me;break}h=0,d=0}a.mode=16207;case 16207:if(a.wrap&&a.flags){for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(4&a.wrap&&h!==(4294967295&a.total)){t.msg=\"incorrect length check\",a.mode=me;break}h=0,d=0}a.mode=16208;case 16208:x=he;break t;case me:x=fe;break t;case 16210:return ce;default:return _e}return t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,(a.wsize||f!==t.avail_out&&a.mode<me&&(a.mode<16206||e!==se))&&Ze(t,t.output,t.next_out,f-t.avail_out),_-=t.avail_in,f-=t.avail_out,t.total_in+=_,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?N(a.check,n,f,t.next_out-f):F(a.check,n,f,t.next_out-f)),t.data_type=a.bits+(a.last?64:0)+(16191===a.mode?128:0)+(16199===a.mode||16194===a.mode?256:0),(0===_&&0===f||e===se)&&x===le&&(x=ue),x},inflateEnd:t=>{if(pe(t))return _e;let e=t.state;return e.window&&(e.window=null),t.state=null,le},inflateGetHeader:(t,e)=>{if(pe(t))return _e;const a=t.state;return 0==(2&a.wrap)?_e:(a.head=e,e.done=!1,le)},inflateSetDictionary:(t,e)=>{const a=e.length;let i,n,s;return pe(t)?_e:(i=t.state,0!==i.wrap&&16190!==i.mode?_e:16190===i.mode&&(n=1,n=F(n,e,a,0),n!==i.check)?fe:(s=Ze(t,e,a,a),s?(i.mode=16210,ce):(i.havedict=1,le)))},inflateInfo:\"pako inflate (from Nodeca project)\"};var Se=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=\"\",this.comment=\"\",this.hcrc=0,this.done=!1};const De=Object.prototype.toString,{Z_NO_FLUSH:Te,Z_FINISH:Oe,Z_OK:Fe,Z_STREAM_END:Le,Z_NEED_DICT:Ne,Z_STREAM_ERROR:Ie,Z_DATA_ERROR:Be,Z_MEM_ERROR:Ce}=B;function He(t){this.options=Tt({chunkSize:65536,windowBits:15,to:\"\"},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new Ct,this.strm.avail_out=0;let a=Ue.inflateInit2(this.strm,e.windowBits);if(a!==Fe)throw new Error(I[a]);if(this.header=new Se,Ue.inflateGetHeader(this.strm,this.header),e.dictionary&&(\"string\"==typeof e.dictionary?e.dictionary=Nt(e.dictionary):\"[object ArrayBuffer]\"===De.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Ue.inflateSetDictionary(this.strm,e.dictionary),a!==Fe)))throw new Error(I[a])}He.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize,n=this.options.dictionary;let s,r,o;if(this.ended)return!1;for(r=e===~~e?e:!0===e?Oe:Te,\"[object ArrayBuffer]\"===De.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),s=Ue.inflate(a,r),s===Ne&&n&&(s=Ue.inflateSetDictionary(a,n),s===Fe?s=Ue.inflate(a,r):s===Be&&(s=Ne));a.avail_in>0&&s===Le&&a.state.wrap>0&&0!==t[a.next_in];)Ue.inflateReset(a),s=Ue.inflate(a,r);switch(s){case Ie:case Be:case Ne:case Ce:return this.onEnd(s),this.ended=!0,!1}if(o=a.avail_out,a.next_out&&(0===a.avail_out||s===Le))if(\"string\"===this.options.to){let t=Bt(a.output,a.next_out),e=a.next_out-t,n=It(a.output,t);a.next_out=e,a.avail_out=i-e,e&&a.output.set(a.output.subarray(t,t+e),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(s!==Fe||0!==o){if(s===Le)return s=Ue.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},He.prototype.onData=function(t){this.chunks.push(t)},He.prototype.onEnd=function(t){t===Fe&&(\"string\"===this.options.to?this.result=this.chunks.join(\"\"):this.result=Ot(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const{Deflate:Me,deflate:je,deflateRaw:Ke,gzip:Pe}=Vt;var Ye=Me,Ge=je,Xe=B;const We=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error(\"Adding invalid event\");const e=this._hasEvents?\",\":\"\";this.deflate.push(e+t,Xe.Z_SYNC_FLUSH),this._hasEvents=!0}finish(){if(this.deflate.push(\"]\",Xe.Z_FINISH),this.deflate.err)throw this.deflate.err;const t=this.deflate.result;return this._init(),t}_init(){this._hasEvents=!1,this.deflate=new Ye,this.deflate.push(\"[\",Xe.Z_NO_FLUSH)}},qe={clear:()=>{We.clear()},addEvent:t=>We.addEvent(t),finish:()=>We.finish(),compress:t=>function(t){return Ge(t)}(t)};addEventListener(\"message\",(function(t){const e=t.data.method,a=t.data.id,i=t.data.arg;if(e in qe&&\"function\"==typeof qe[e])try{const t=qe[e](i);postMessage({id:a,method:e,success:!0,response:t})}catch(t){postMessage({id:a,method:e,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:\"init\",success:!0,response:void 0});`;\n","import type { HistoryData, ReplayContainer, ReplayPerformanceEntry } from '../types';\nimport { createPerformanceSpans } from '../util/createPerformanceSpans';\n\ninterface HistoryHandlerData {\n  from: string;\n  to: string;\n}\n\nfunction handleHistory(handlerData: HistoryHandlerData): ReplayPerformanceEntry<HistoryData> {\n  const { from, to } = handlerData;\n\n  const now = Date.now() / 1000;\n\n  return {\n    type: 'navigation.push',\n    start: now,\n    end: now,\n    name: to,\n    data: {\n      previous: from,\n    },\n  };\n}\n\n/**\n * Returns a listener to be added to `addInstrumentationHandler('history', listener)`.\n */\nexport function handleHistorySpanListener(replay: ReplayContainer): (handlerData: HistoryHandlerData) => void {\n  return (handlerData: HistoryHandlerData) => {\n    if (!replay.isEnabled()) {\n      return;\n    }\n\n    const result = handleHistory(handlerData);\n\n    if (result === null) {\n      return;\n    }\n\n    // Need to collect visited URLs\n    replay.getContext().urls.push(result.name);\n    replay.triggerUserActivity();\n\n    replay.addUpdate(() => {\n      createPerformanceSpans(replay, [result]);\n      // Returning false to flush\n      return false;\n    });\n  };\n}\n","import { getCurrentHub } from '@sentry/core';\nimport type {\n  Breadcrumb,\n  BreadcrumbHint,\n  FetchBreadcrumbData,\n  TextEncoderInternal,\n  XhrBreadcrumbData,\n} from '@sentry/types';\nimport { addInstrumentationHandler, logger } from '@sentry/utils';\n\nimport type { FetchHint, ReplayContainer, ReplayNetworkOptions, XhrHint } from '../types';\nimport { handleFetchSpanListener } from './handleFetch';\nimport { handleXhrSpanListener } from './handleXhr';\nimport { captureFetchBreadcrumbToReplay, enrichFetchBreadcrumb } from './util/fetchUtils';\nimport { captureXhrBreadcrumbToReplay, enrichXhrBreadcrumb } from './util/xhrUtils';\n\ninterface ExtendedNetworkBreadcrumbsOptions extends ReplayNetworkOptions {\n  replay: ReplayContainer;\n  textEncoder: TextEncoderInternal;\n}\n\n/**\n * This method does two things:\n * - It enriches the regular XHR/fetch breadcrumbs with request/response size data\n * - It captures the XHR/fetch breadcrumbs to the replay\n *   (enriching it with further data that is _not_ added to the regular breadcrumbs)\n */\nexport function handleNetworkBreadcrumbs(replay: ReplayContainer): void {\n  const client = getCurrentHub().getClient();\n\n  try {\n    const textEncoder = new TextEncoder();\n\n    const {\n      networkDetailAllowUrls,\n      networkDetailDenyUrls,\n      networkCaptureBodies,\n      networkRequestHeaders,\n      networkResponseHeaders,\n    } = replay.getOptions();\n\n    const options: ExtendedNetworkBreadcrumbsOptions = {\n      replay,\n      textEncoder,\n      networkDetailAllowUrls,\n      networkDetailDenyUrls,\n      networkCaptureBodies,\n      networkRequestHeaders,\n      networkResponseHeaders,\n    };\n\n    if (client && client.on) {\n      client.on('beforeAddBreadcrumb', (breadcrumb, hint) => beforeAddNetworkBreadcrumb(options, breadcrumb, hint));\n    } else {\n      // Fallback behavior\n      addInstrumentationHandler('fetch', handleFetchSpanListener(replay));\n      addInstrumentationHandler('xhr', handleXhrSpanListener(replay));\n    }\n  } catch {\n    // Do nothing\n  }\n}\n\n/** just exported for tests */\nexport function beforeAddNetworkBreadcrumb(\n  options: ExtendedNetworkBreadcrumbsOptions,\n  breadcrumb: Breadcrumb,\n  hint?: BreadcrumbHint,\n): void {\n  if (!breadcrumb.data) {\n    return;\n  }\n\n  try {\n    if (_isXhrBreadcrumb(breadcrumb) && _isXhrHint(hint)) {\n      // This has to be sync, as we need to ensure the breadcrumb is enriched in the same tick\n      // Because the hook runs synchronously, and the breadcrumb is afterwards passed on\n      // So any async mutations to it will not be reflected in the final breadcrumb\n      enrichXhrBreadcrumb(breadcrumb, hint, options);\n\n      void captureXhrBreadcrumbToReplay(breadcrumb, hint, options);\n    }\n\n    if (_isFetchBreadcrumb(breadcrumb) && _isFetchHint(hint)) {\n      // This has to be sync, as we need to ensure the breadcrumb is enriched in the same tick\n      // Because the hook runs synchronously, and the breadcrumb is afterwards passed on\n      // So any async mutations to it will not be reflected in the final breadcrumb\n      enrichFetchBreadcrumb(breadcrumb, hint, options);\n\n      void captureFetchBreadcrumbToReplay(breadcrumb, hint, options);\n    }\n  } catch (e) {\n    __DEBUG_BUILD__ && logger.warn('Error when enriching network breadcrumb');\n  }\n}\n\nfunction _isXhrBreadcrumb(breadcrumb: Breadcrumb): breadcrumb is Breadcrumb & { data: XhrBreadcrumbData } {\n  return breadcrumb.category === 'xhr';\n}\n\nfunction _isFetchBreadcrumb(breadcrumb: Breadcrumb): breadcrumb is Breadcrumb & { data: FetchBreadcrumbData } {\n  return breadcrumb.category === 'fetch';\n}\n\nfunction _isXhrHint(hint?: BreadcrumbHint): hint is XhrHint {\n  return hint && hint.xhr;\n}\n\nfunction _isFetchHint(hint?: BreadcrumbHint): hint is FetchHint {\n  return hint && hint.response;\n}\n","import type { Breadcrumb, TextEncoderInternal, XhrBreadcrumbData } from '@sentry/types';\nimport { logger, SENTRY_XHR_DATA_KEY } from '@sentry/utils';\n\nimport type { ReplayContainer, ReplayNetworkOptions, ReplayNetworkRequestData, XhrHint } from '../../types';\nimport { addNetworkBreadcrumb } from './addNetworkBreadcrumb';\nimport {\n  buildNetworkRequestOrResponse,\n  buildSkippedNetworkRequestOrResponse,\n  getAllowedHeaders,\n  getBodySize,\n  getBodyString,\n  makeNetworkReplayBreadcrumb,\n  parseContentLengthHeader,\n  urlMatches,\n} from './networkUtils';\n\n/**\n * Capture an XHR breadcrumb to a replay.\n * This adds additional data (where approriate).\n */\nexport async function captureXhrBreadcrumbToReplay(\n  breadcrumb: Breadcrumb & { data: XhrBreadcrumbData },\n  hint: XhrHint,\n  options: ReplayNetworkOptions & { replay: ReplayContainer },\n): Promise<void> {\n  try {\n    const data = _prepareXhrData(breadcrumb, hint, options);\n\n    // Create a replay performance entry from this breadcrumb\n    const result = makeNetworkReplayBreadcrumb('resource.xhr', data);\n    addNetworkBreadcrumb(options.replay, result);\n  } catch (error) {\n    __DEBUG_BUILD__ && logger.error('[Replay] Failed to capture fetch breadcrumb', error);\n  }\n}\n\n/**\n * Enrich a breadcrumb with additional data.\n * This has to be sync & mutate the given breadcrumb,\n * as the breadcrumb is afterwards consumed by other handlers.\n */\nexport function enrichXhrBreadcrumb(\n  breadcrumb: Breadcrumb & { data: XhrBreadcrumbData },\n  hint: XhrHint,\n  options: { textEncoder: TextEncoderInternal },\n): void {\n  const { xhr, input } = hint;\n\n  const reqSize = getBodySize(input, options.textEncoder);\n  const resSize = xhr.getResponseHeader('content-length')\n    ? parseContentLengthHeader(xhr.getResponseHeader('content-length'))\n    : getBodySize(xhr.response, options.textEncoder);\n\n  if (reqSize !== undefined) {\n    breadcrumb.data.request_body_size = reqSize;\n  }\n  if (resSize !== undefined) {\n    breadcrumb.data.response_body_size = resSize;\n  }\n}\n\nfunction _prepareXhrData(\n  breadcrumb: Breadcrumb & { data: XhrBreadcrumbData },\n  hint: XhrHint,\n  options: ReplayNetworkOptions,\n): ReplayNetworkRequestData | null {\n  const { startTimestamp, endTimestamp, input, xhr } = hint;\n\n  const {\n    url,\n    method,\n    status_code: statusCode = 0,\n    request_body_size: requestBodySize,\n    response_body_size: responseBodySize,\n  } = breadcrumb.data;\n\n  if (!url) {\n    return null;\n  }\n\n  if (!urlMatches(url, options.networkDetailAllowUrls) || urlMatches(url, options.networkDetailDenyUrls)) {\n    const request = buildSkippedNetworkRequestOrResponse(requestBodySize);\n    const response = buildSkippedNetworkRequestOrResponse(responseBodySize);\n    return {\n      startTimestamp,\n      endTimestamp,\n      url,\n      method,\n      statusCode,\n      request,\n      response,\n    };\n  }\n\n  const xhrInfo = xhr[SENTRY_XHR_DATA_KEY];\n  const networkRequestHeaders = xhrInfo\n    ? getAllowedHeaders(xhrInfo.request_headers, options.networkRequestHeaders)\n    : {};\n  const networkResponseHeaders = getAllowedHeaders(getResponseHeaders(xhr), options.networkResponseHeaders);\n\n  const request = buildNetworkRequestOrResponse(\n    networkRequestHeaders,\n    requestBodySize,\n    options.networkCaptureBodies ? getBodyString(input) : undefined,\n  );\n  const response = buildNetworkRequestOrResponse(\n    networkResponseHeaders,\n    responseBodySize,\n    options.networkCaptureBodies ? hint.xhr.responseText : undefined,\n  );\n\n  return {\n    startTimestamp,\n    endTimestamp,\n    url,\n    method,\n    statusCode,\n    request,\n    response,\n  };\n}\n\nfunction getResponseHeaders(xhr: XMLHttpRequest): Record<string, string> {\n  const headers = xhr.getAllResponseHeaders();\n\n  if (!headers) {\n    return {};\n  }\n\n  return headers.split('\\r\\n').reduce((acc: Record<string, string>, line: string) => {\n    const [key, value] = line.split(': ');\n    acc[key.toLowerCase()] = value;\n    return acc;\n  }, {});\n}\n","import type { HandlerDataFetch } from '@sentry/types';\n\nimport type { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../types';\nimport { addNetworkBreadcrumb } from './util/addNetworkBreadcrumb';\n\n/** only exported for tests */\nexport function handleFetch(handlerData: HandlerDataFetch): null | ReplayPerformanceEntry<NetworkRequestData> {\n  const { startTimestamp, endTimestamp, fetchData, response } = handlerData;\n\n  if (!endTimestamp) {\n    return null;\n  }\n\n  // This is only used as a fallback, so we know the body sizes are never set here\n  const { method, url } = fetchData;\n\n  return {\n    type: 'resource.fetch',\n    start: startTimestamp / 1000,\n    end: endTimestamp / 1000,\n    name: url,\n    data: {\n      method,\n      statusCode: response ? (response as Response).status : undefined,\n    },\n  };\n}\n\n/**\n * Returns a listener to be added to `addInstrumentationHandler('fetch', listener)`.\n */\nexport function handleFetchSpanListener(replay: ReplayContainer): (handlerData: HandlerDataFetch) => void {\n  return (handlerData: HandlerDataFetch) => {\n    if (!replay.isEnabled()) {\n      return;\n    }\n\n    const result = handleFetch(handlerData);\n\n    addNetworkBreadcrumb(replay, result);\n  };\n}\n","import type { HandlerDataXhr } from '@sentry/types';\nimport { SENTRY_XHR_DATA_KEY } from '@sentry/utils';\n\nimport type { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../types';\nimport { addNetworkBreadcrumb } from './util/addNetworkBreadcrumb';\n\n/** only exported for tests */\nexport function handleXhr(handlerData: HandlerDataXhr): ReplayPerformanceEntry<NetworkRequestData> | null {\n  const { startTimestamp, endTimestamp, xhr } = handlerData;\n\n  const sentryXhrData = xhr[SENTRY_XHR_DATA_KEY];\n\n  if (!startTimestamp || !endTimestamp || !sentryXhrData) {\n    return null;\n  }\n\n  // This is only used as a fallback, so we know the body sizes are never set here\n  const { method, url, status_code: statusCode } = sentryXhrData;\n\n  if (url === undefined) {\n    return null;\n  }\n\n  return {\n    type: 'resource.xhr',\n    name: url,\n    start: startTimestamp / 1000,\n    end: endTimestamp / 1000,\n    data: {\n      method,\n      statusCode,\n    },\n  };\n}\n\n/**\n * Returns a listener to be added to `addInstrumentationHandler('xhr', listener)`.\n */\nexport function handleXhrSpanListener(replay: ReplayContainer): (handlerData: HandlerDataXhr) => void {\n  return (handlerData: HandlerDataXhr) => {\n    if (!replay.isEnabled()) {\n      return;\n    }\n\n    const result = handleXhr(handlerData);\n\n    addNetworkBreadcrumb(replay, result);\n  };\n}\n","import type { Event, EventHint } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport type { ReplayContainer } from '../types';\nimport { isErrorEvent, isReplayEvent, isTransactionEvent } from '../util/eventUtils';\nimport { isRrwebError } from '../util/isRrwebError';\nimport { handleAfterSendEvent } from './handleAfterSendEvent';\nimport { shouldSampleForBufferEvent } from './util/shouldSampleForBufferEvent';\n\n/**\n * Returns a listener to be added to `addGlobalEventProcessor(listener)`.\n */\nexport function handleGlobalEventListener(\n  replay: ReplayContainer,\n  includeAfterSendEventHandling = false,\n): (event: Event, hint: EventHint) => Event | null {\n  const afterSendHandler = includeAfterSendEventHandling ? handleAfterSendEvent(replay) : undefined;\n\n  return Object.assign(\n    (event: Event, hint: EventHint) => {\n      // Do nothing if replay has been disabled\n      if (!replay.isEnabled()) {\n        return event;\n      }\n\n      if (isReplayEvent(event)) {\n        // Replays have separate set of breadcrumbs, do not include breadcrumbs\n        // from core SDK\n        delete event.breadcrumbs;\n        return event;\n      }\n\n      // We only want to handle errors & transactions, nothing else\n      if (!isErrorEvent(event) && !isTransactionEvent(event)) {\n        return event;\n      }\n\n      // Ensure we do not add replay_id if the session is expired\n      const isSessionActive = replay.checkAndHandleExpiredSession();\n      if (!isSessionActive) {\n        return event;\n      }\n\n      // Unless `captureExceptions` is enabled, we want to ignore errors coming from rrweb\n      // As there can be a bunch of stuff going wrong in internals there, that we don't want to bubble up to users\n      if (isRrwebError(event, hint) && !replay.getOptions()._experiments.captureExceptions) {\n        __DEBUG_BUILD__ && logger.log('[Replay] Ignoring error from rrweb internals', event);\n        return null;\n      }\n\n      // When in buffer mode, we decide to sample here.\n      // Later, in `handleAfterSendEvent`, if the replayId is set, we know that we sampled\n      // And convert the buffer session to a full session\n      const isErrorEventSampled = shouldSampleForBufferEvent(replay, event);\n\n      // Tag errors if it has been sampled in buffer mode, or if it is session mode\n      // Only tag transactions if in session mode\n      const shouldTagReplayId = isErrorEventSampled || replay.recordingMode === 'session';\n\n      if (shouldTagReplayId) {\n        event.tags = { ...event.tags, replayId: replay.getSessionId() };\n      }\n\n      // In cases where a custom client is used that does not support the new hooks (yet),\n      // we manually call this hook method here\n      if (afterSendHandler) {\n        // Pretend the error had a 200 response so we always capture it\n        afterSendHandler(event, { statusCode: 200 });\n      }\n\n      return event;\n    },\n    { id: 'Replay' },\n  );\n}\n","import type { Event, EventHint } from '@sentry/types';\n\n/**\n * Returns true if we think the given event is an error originating inside of rrweb.\n */\nexport function isRrwebError(event: Event, hint: EventHint): boolean {\n  if (event.type || !event.exception || !event.exception.values || !event.exception.values.length) {\n    return false;\n  }\n\n  // @ts-expect-error this may be set by rrweb when it finds errors\n  if (hint.originalException && hint.originalException.__rrweb__) {\n    return true;\n  }\n\n  // Check if any exception originates from rrweb\n  return event.exception.values.some(exception => {\n    if (!exception.stacktrace || !exception.stacktrace.frames || !exception.stacktrace.frames.length) {\n      return false;\n    }\n\n    return exception.stacktrace.frames.some(frame => frame.filename && frame.filename.includes('/rrweb/src/'));\n  });\n}\n","import type { Event } from '@sentry/types';\n\nimport { UNABLE_TO_SEND_REPLAY } from '../../constants';\nimport type { ReplayContainer } from '../../types';\nimport { isSampled } from '../../util/isSampled';\n\n/**\n * Determine if event should be sampled (only applies in buffer mode).\n * When an event is captured by `hanldleGlobalEvent`, when in buffer mode\n * we determine if we want to sample the error or not.\n */\nexport function shouldSampleForBufferEvent(replay: ReplayContainer, event: Event): boolean {\n  if (replay.recordingMode !== 'buffer') {\n    return false;\n  }\n\n  // ignore this error because otherwise we could loop indefinitely with\n  // trying to capture replay and failing\n  if (event.message === UNABLE_TO_SEND_REPLAY) {\n    return false;\n  }\n\n  // Require the event to be an error event & to have an exception\n  if (!event.exception || event.type) {\n    return false;\n  }\n\n  return isSampled(replay.getOptions().errorSampleRate);\n}\n","import type { AllPerformanceEntry, ReplayContainer } from '../types';\nimport { dedupePerformanceEntries } from '../util/dedupePerformanceEntries';\n\n/**\n * Sets up a PerformanceObserver to listen to all performance entry types.\n */\nexport function setupPerformanceObserver(replay: ReplayContainer): PerformanceObserver {\n  const performanceObserverHandler = (list: PerformanceObserverEntryList): void => {\n    // For whatever reason the observer was returning duplicate navigation\n    // entries (the other entry types were not duplicated).\n    const newPerformanceEntries = dedupePerformanceEntries(\n      replay.performanceEvents,\n      list.getEntries() as AllPerformanceEntry[],\n    );\n    replay.performanceEvents = newPerformanceEntries;\n  };\n\n  const performanceObserver = new PerformanceObserver(performanceObserverHandler);\n\n  [\n    'element',\n    'event',\n    'first-input',\n    'largest-contentful-paint',\n    'layout-shift',\n    'longtask',\n    'navigation',\n    'paint',\n    'resource',\n  ].forEach(type => {\n    try {\n      performanceObserver.observe({\n        type,\n        buffered: true,\n      });\n    } catch {\n      // This can throw if an entry type is not supported in the browser.\n      // Ignore these errors.\n    }\n  });\n\n  return performanceObserver;\n}\n","import type { Breadcrumb } from '@sentry/types';\nimport { htmlTreeAsString } from '@sentry/utils';\n\nimport type { ReplayContainer } from '../types';\nimport { createBreadcrumb } from '../util/createBreadcrumb';\nimport { getBaseDomBreadcrumb } from './handleDom';\nimport { addBreadcrumbEvent } from './util/addBreadcrumbEvent';\n\n/** Handle keyboard events & create breadcrumbs. */\nexport function handleKeyboardEvent(replay: ReplayContainer, event: KeyboardEvent): void {\n  if (!replay.isEnabled()) {\n    return;\n  }\n\n  // Update user activity, but do not restart recording as it can create\n  // noisy/low-value replays (e.g. user comes back from idle, hits alt-tab, new\n  // session with a single \"keydown\" breadcrumb is created)\n  replay.updateUserActivity();\n\n  const breadcrumb = getKeyboardBreadcrumb(event);\n\n  if (!breadcrumb) {\n    return;\n  }\n\n  addBreadcrumbEvent(replay, breadcrumb);\n}\n\n/** exported only for tests */\nexport function getKeyboardBreadcrumb(event: KeyboardEvent): Breadcrumb | null {\n  const { metaKey, shiftKey, ctrlKey, altKey, key, target } = event;\n\n  // never capture for input fields\n  if (!target || isInputElement(target as HTMLElement) || !key) {\n    return null;\n  }\n\n  // Note: We do not consider shift here, as that means \"uppercase\"\n  const hasModifierKey = metaKey || ctrlKey || altKey;\n  const isCharacterKey = key.length === 1; // other keys like Escape, Tab, etc have a longer length\n\n  // Do not capture breadcrumb if only a word key is pressed\n  // This could leak e.g. user input\n  if (!hasModifierKey && isCharacterKey) {\n    return null;\n  }\n\n  const message = htmlTreeAsString(target, { maxStringLength: 200 }) || '<unknown>';\n  const baseBreadcrumb = getBaseDomBreadcrumb(target as Node, message);\n\n  return createBreadcrumb({\n    category: 'ui.keyDown',\n    message,\n    data: {\n      ...baseBreadcrumb.data,\n      metaKey,\n      shiftKey,\n      ctrlKey,\n      altKey,\n      key,\n    },\n  });\n}\n\nfunction isInputElement(target: HTMLElement): boolean {\n  return target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable;\n}\n","import type { DeprecatedPrivacyOptions, ReplayIntegrationPrivacyOptions } from '../types';\n\ntype GetPrivacyOptions = Required<Omit<ReplayIntegrationPrivacyOptions, 'maskFn'>> &\n  Omit<DeprecatedPrivacyOptions, 'maskInputOptions'>;\ninterface GetPrivacyReturn {\n  maskTextSelector: string;\n  unmaskTextSelector: string;\n  blockSelector: string;\n  unblockSelector: string;\n  ignoreSelector: string;\n\n  blockClass?: RegExp;\n  maskTextClass?: RegExp;\n}\n\nfunction getOption(\n  selectors: string[],\n  defaultSelectors: string[],\n  deprecatedClassOption?: string | RegExp,\n  deprecatedSelectorOption?: string,\n): string {\n  const deprecatedSelectors = typeof deprecatedSelectorOption === 'string' ? deprecatedSelectorOption.split(',') : [];\n\n  const allSelectors = [\n    ...selectors,\n    // @deprecated\n    ...deprecatedSelectors,\n\n    // sentry defaults\n    ...defaultSelectors,\n  ];\n\n  // @deprecated\n  if (typeof deprecatedClassOption !== 'undefined') {\n    // NOTE: No support for RegExp\n    if (typeof deprecatedClassOption === 'string') {\n      allSelectors.push(`.${deprecatedClassOption}`);\n    }\n\n    // eslint-disable-next-line no-console\n    console.warn(\n      '[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.',\n    );\n  }\n\n  return allSelectors.join(',');\n}\n\n/**\n * Returns privacy related configuration for use in rrweb\n */\nexport function getPrivacyOptions({\n  mask,\n  unmask,\n  block,\n  unblock,\n  ignore,\n\n  // eslint-disable-next-line deprecation/deprecation\n  blockClass,\n  // eslint-disable-next-line deprecation/deprecation\n  blockSelector,\n  // eslint-disable-next-line deprecation/deprecation\n  maskTextClass,\n  // eslint-disable-next-line deprecation/deprecation\n  maskTextSelector,\n  // eslint-disable-next-line deprecation/deprecation\n  ignoreClass,\n}: GetPrivacyOptions): GetPrivacyReturn {\n  const defaultBlockedElements = ['base[href=\"/\"]'];\n\n  const maskSelector = getOption(mask, ['.sentry-mask', '[data-sentry-mask]'], maskTextClass, maskTextSelector);\n  const unmaskSelector = getOption(unmask, ['.sentry-unmask', '[data-sentry-unmask]']);\n\n  const options: GetPrivacyReturn = {\n    // We are making the decision to make text and input selectors the same\n    maskTextSelector: maskSelector,\n    unmaskTextSelector: unmaskSelector,\n\n    blockSelector: getOption(\n      block,\n      ['.sentry-block', '[data-sentry-block]', ...defaultBlockedElements],\n      blockClass,\n      blockSelector,\n    ),\n    unblockSelector: getOption(unblock, ['.sentry-unblock', '[data-sentry-unblock]']),\n    ignoreSelector: getOption(ignore, ['.sentry-ignore', '[data-sentry-ignore]', 'input[type=\"file\"]'], ignoreClass),\n  };\n\n  if (blockClass instanceof RegExp) {\n    options.blockClass = blockClass;\n  }\n\n  if (maskTextClass instanceof RegExp) {\n    options.maskTextClass = maskTextClass;\n  }\n\n  return options;\n}\n","import { isNodeEnv } from '@sentry/utils';\n\n/**\n * Returns true if we are in the browser.\n */\nexport function isBrowser(): boolean {\n  // eslint-disable-next-line no-restricted-globals\n  return typeof window !== 'undefined' && (!isNodeEnv() || isElectronNodeRenderer());\n}\n\ntype ElectronProcess = { type?: string };\n\n// Electron renderers with nodeIntegration enabled are detected as Node.js so we specifically test for them\nfunction isElectronNodeRenderer(): boolean {\n  return typeof process !== 'undefined' && (process as ElectronProcess).type === 'renderer';\n}\n","import { getCurrentHub } from '@sentry/core';\nimport type { BrowserClientReplayOptions, Integration } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\n\nimport {\n  DEFAULT_FLUSH_MAX_DELAY,\n  DEFAULT_FLUSH_MIN_DELAY,\n  MAX_REPLAY_DURATION,\n  MIN_REPLAY_DURATION,\n  MIN_REPLAY_DURATION_LIMIT,\n} from './constants';\nimport { ReplayContainer } from './replay';\nimport type { RecordingOptions, ReplayConfiguration, ReplayPluginOptions, SendBufferedReplayOptions } from './types';\nimport { getPrivacyOptions } from './util/getPrivacyOptions';\nimport { isBrowser } from './util/isBrowser';\nimport { maskAttribute } from './util/maskAttribute';\n\nconst MEDIA_SELECTORS =\n  'img,image,svg,video,object,picture,embed,map,audio,link[rel=\"icon\"],link[rel=\"apple-touch-icon\"]';\n\nconst DEFAULT_NETWORK_HEADERS = ['content-length', 'content-type', 'accept'];\n\nlet _initialized = false;\n\ntype InitialReplayPluginOptions = Omit<ReplayPluginOptions, 'sessionSampleRate' | 'errorSampleRate'> &\n  Partial<Pick<ReplayPluginOptions, 'sessionSampleRate' | 'errorSampleRate'>>;\n\n/**\n * The main replay integration class, to be passed to `init({  integrations: [] })`.\n */\nexport class Replay implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Replay';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string;\n\n  /**\n   * Options to pass to `rrweb.record()`\n   */\n  private readonly _recordingOptions: RecordingOptions;\n\n  /**\n   * Initial options passed to the replay integration, merged with default values.\n   * Note: `sessionSampleRate` and `errorSampleRate` are not required here, as they\n   * can only be finally set when setupOnce() is called.\n   *\n   * @private\n   */\n  private readonly _initialOptions: InitialReplayPluginOptions;\n\n  private _replay?: ReplayContainer;\n\n  public constructor({\n    flushMinDelay = DEFAULT_FLUSH_MIN_DELAY,\n    flushMaxDelay = DEFAULT_FLUSH_MAX_DELAY,\n    minReplayDuration = MIN_REPLAY_DURATION,\n    maxReplayDuration = MAX_REPLAY_DURATION,\n    stickySession = true,\n    useCompression = true,\n    _experiments = {},\n    sessionSampleRate,\n    errorSampleRate,\n    maskAllText = true,\n    maskAllInputs = true,\n    blockAllMedia = true,\n\n    mutationBreadcrumbLimit = 750,\n    mutationLimit = 10_000,\n\n    slowClickTimeout = 7_000,\n    slowClickIgnoreSelectors = [],\n\n    networkDetailAllowUrls = [],\n    networkDetailDenyUrls = [],\n    networkCaptureBodies = true,\n    networkRequestHeaders = [],\n    networkResponseHeaders = [],\n\n    mask = [],\n    maskAttributes = ['title', 'placeholder'],\n    unmask = [],\n    block = [],\n    unblock = [],\n    ignore = [],\n    maskFn,\n\n    beforeAddRecordingEvent,\n\n    // eslint-disable-next-line deprecation/deprecation\n    blockClass,\n    // eslint-disable-next-line deprecation/deprecation\n    blockSelector,\n    // eslint-disable-next-line deprecation/deprecation\n    maskInputOptions,\n    // eslint-disable-next-line deprecation/deprecation\n    maskTextClass,\n    // eslint-disable-next-line deprecation/deprecation\n    maskTextSelector,\n    // eslint-disable-next-line deprecation/deprecation\n    ignoreClass,\n  }: ReplayConfiguration = {}) {\n    this.name = Replay.id;\n\n    const privacyOptions = getPrivacyOptions({\n      mask,\n      unmask,\n      block,\n      unblock,\n      ignore,\n      blockClass,\n      blockSelector,\n      maskTextClass,\n      maskTextSelector,\n      ignoreClass,\n    });\n\n    this._recordingOptions = {\n      maskAllInputs,\n      maskAllText,\n      maskInputOptions: { ...(maskInputOptions || {}), password: true },\n      maskTextFn: maskFn,\n      maskInputFn: maskFn,\n      maskAttributeFn: (key: string, value: string, el: HTMLElement): string =>\n        maskAttribute({\n          maskAttributes,\n          maskAllText,\n          privacyOptions,\n          key,\n          value,\n          el,\n        }),\n\n      ...privacyOptions,\n\n      // Our defaults\n      slimDOMOptions: 'all',\n      inlineStylesheet: true,\n      // Disable inline images as it will increase segment/replay size\n      inlineImages: false,\n      // collect fonts, but be aware that `sentry.io` needs to be an allowed\n      // origin for playback\n      collectFonts: true,\n      errorHandler: (err: Error) => {\n        try {\n          // @ts-expect-error Set this so that replay SDK can ignore errors originating from rrweb\n          err.__rrweb__ = true;\n        } catch {\n          // avoid any potential hazards here\n        }\n        // return true to suppress throwing the error inside of rrweb\n        return true;\n      },\n    };\n\n    this._initialOptions = {\n      flushMinDelay,\n      flushMaxDelay,\n      minReplayDuration: Math.min(minReplayDuration, MIN_REPLAY_DURATION_LIMIT),\n      maxReplayDuration: Math.min(maxReplayDuration, MAX_REPLAY_DURATION),\n      stickySession,\n      sessionSampleRate,\n      errorSampleRate,\n      useCompression,\n      blockAllMedia,\n      maskAllInputs,\n      maskAllText,\n      mutationBreadcrumbLimit,\n      mutationLimit,\n      slowClickTimeout,\n      slowClickIgnoreSelectors,\n      networkDetailAllowUrls,\n      networkDetailDenyUrls,\n      networkCaptureBodies,\n      networkRequestHeaders: _getMergedNetworkHeaders(networkRequestHeaders),\n      networkResponseHeaders: _getMergedNetworkHeaders(networkResponseHeaders),\n      beforeAddRecordingEvent,\n\n      _experiments,\n    };\n\n    if (typeof sessionSampleRate === 'number') {\n      // eslint-disable-next-line\n      console.warn(\n        `[Replay] You are passing \\`sessionSampleRate\\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \\`replaysSessionSampleRate\\` directly in the SDK init options, e.g.:\nSentry.init({ replaysSessionSampleRate: ${sessionSampleRate} })`,\n      );\n\n      this._initialOptions.sessionSampleRate = sessionSampleRate;\n    }\n\n    if (typeof errorSampleRate === 'number') {\n      // eslint-disable-next-line\n      console.warn(\n        `[Replay] You are passing \\`errorSampleRate\\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \\`replaysOnErrorSampleRate\\` directly in the SDK init options, e.g.:\nSentry.init({ replaysOnErrorSampleRate: ${errorSampleRate} })`,\n      );\n\n      this._initialOptions.errorSampleRate = errorSampleRate;\n    }\n\n    if (this._initialOptions.blockAllMedia) {\n      // `blockAllMedia` is a more user friendly option to configure blocking\n      // embedded media elements\n      this._recordingOptions.blockSelector = !this._recordingOptions.blockSelector\n        ? MEDIA_SELECTORS\n        : `${this._recordingOptions.blockSelector},${MEDIA_SELECTORS}`;\n    }\n\n    if (this._isInitialized && isBrowser()) {\n      throw new Error('Multiple Sentry Session Replay instances are not supported');\n    }\n\n    this._isInitialized = true;\n  }\n\n  /** If replay has already been initialized */\n  protected get _isInitialized(): boolean {\n    return _initialized;\n  }\n\n  /** Update _isInitialized */\n  protected set _isInitialized(value: boolean) {\n    _initialized = value;\n  }\n\n  /**\n   * Setup and initialize replay container\n   */\n  public setupOnce(): void {\n    if (!isBrowser()) {\n      return;\n    }\n\n    this._setup();\n\n    // Once upon a time, we tried to create a transaction in `setupOnce` and it would\n    // potentially create a transaction before some native SDK integrations have run\n    // and applied their own global event processor. An example is:\n    // https://github.com/getsentry/sentry-javascript/blob/b47ceafbdac7f8b99093ce6023726ad4687edc48/packages/browser/src/integrations/useragent.ts\n    //\n    // So we call `this._initialize()` in next event loop as a workaround to wait for other\n    // global event processors to finish. This is no longer needed, but keeping it\n    // here to avoid any future issues.\n    setTimeout(() => this._initialize());\n  }\n\n  /**\n   * Start a replay regardless of sampling rate. Calling this will always\n   * create a new session. Will throw an error if replay is already in progress.\n   *\n   * Creates or loads a session, attaches listeners to varying events (DOM,\n   * PerformanceObserver, Recording, Sentry SDK, etc)\n   */\n  public start(): void {\n    if (!this._replay) {\n      return;\n    }\n\n    this._replay.start();\n  }\n\n  /**\n   * Start replay buffering. Buffers until `flush()` is called or, if\n   * `replaysOnErrorSampleRate` > 0, until an error occurs.\n   */\n  public startBuffering(): void {\n    if (!this._replay) {\n      return;\n    }\n\n    this._replay.startBuffering();\n  }\n\n  /**\n   * Currently, this needs to be manually called (e.g. for tests). Sentry SDK\n   * does not support a teardown\n   */\n  public stop(): Promise<void> {\n    if (!this._replay) {\n      return Promise.resolve();\n    }\n\n    return this._replay.stop({ forceFlush: this._replay.recordingMode === 'session' });\n  }\n\n  /**\n   * If not in \"session\" recording mode, flush event buffer which will create a new replay.\n   * Unless `continueRecording` is false, the replay will continue to record and\n   * behave as a \"session\"-based replay.\n   *\n   * Otherwise, queue up a flush.\n   */\n  public flush(options?: SendBufferedReplayOptions): Promise<void> {\n    if (!this._replay || !this._replay.isEnabled()) {\n      return Promise.resolve();\n    }\n\n    return this._replay.sendBufferedReplayOrFlush(options);\n  }\n\n  /**\n   * Get the current session ID.\n   */\n  public getReplayId(): string | undefined {\n    if (!this._replay || !this._replay.isEnabled()) {\n      return;\n    }\n\n    return this._replay.getSessionId();\n  }\n  /**\n   * Initializes replay.\n   */\n  protected _initialize(): void {\n    if (!this._replay) {\n      return;\n    }\n\n    this._replay.initializeSampling();\n  }\n\n  /** Setup the integration. */\n  private _setup(): void {\n    // Client is not available in constructor, so we need to wait until setupOnce\n    const finalOptions = loadReplayOptionsFromClient(this._initialOptions);\n\n    this._replay = new ReplayContainer({\n      options: finalOptions,\n      recordingOptions: this._recordingOptions,\n    });\n  }\n}\n\n/** Parse Replay-related options from SDK options */\nfunction loadReplayOptionsFromClient(initialOptions: InitialReplayPluginOptions): ReplayPluginOptions {\n  const client = getCurrentHub().getClient();\n  const opt = client && (client.getOptions() as BrowserClientReplayOptions);\n\n  const finalOptions = { sessionSampleRate: 0, errorSampleRate: 0, ...dropUndefinedKeys(initialOptions) };\n\n  if (!opt) {\n    // eslint-disable-next-line no-console\n    console.warn('SDK client is not available.');\n    return finalOptions;\n  }\n\n  if (\n    initialOptions.sessionSampleRate == null && // TODO remove once deprecated rates are removed\n    initialOptions.errorSampleRate == null && // TODO remove once deprecated rates are removed\n    opt.replaysSessionSampleRate == null &&\n    opt.replaysOnErrorSampleRate == null\n  ) {\n    // eslint-disable-next-line no-console\n    console.warn(\n      'Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.',\n    );\n  }\n\n  if (typeof opt.replaysSessionSampleRate === 'number') {\n    finalOptions.sessionSampleRate = opt.replaysSessionSampleRate;\n  }\n\n  if (typeof opt.replaysOnErrorSampleRate === 'number') {\n    finalOptions.errorSampleRate = opt.replaysOnErrorSampleRate;\n  }\n\n  return finalOptions;\n}\n\nfunction _getMergedNetworkHeaders(headers: string[]): string[] {\n  return [...DEFAULT_NETWORK_HEADERS, ...headers.map(header => header.toLowerCase())];\n}\n","import type { getPrivacyOptions } from './getPrivacyOptions';\n\ninterface MaskAttributeParams {\n  maskAttributes: string[];\n  maskAllText: boolean;\n  privacyOptions: ReturnType<typeof getPrivacyOptions>;\n  key: string;\n  value: string;\n  el: HTMLElement;\n}\n\n/**\n * Masks an attribute if necessary, otherwise return attribute value as-is.\n */\nexport function maskAttribute({\n  el,\n  key,\n  maskAttributes,\n  maskAllText,\n  privacyOptions,\n  value,\n}: MaskAttributeParams): string {\n  // We only mask attributes if `maskAllText` is true\n  if (!maskAllText) {\n    return value;\n  }\n\n  // unmaskTextSelector takes precendence\n  if (privacyOptions.unmaskTextSelector && el.matches(privacyOptions.unmaskTextSelector)) {\n    return value;\n  }\n\n  if (\n    maskAttributes.includes(key) ||\n    // Need to mask `value` attribute for `<input>` if it's a button-like\n    // type\n    (key === 'value' && el.tagName === 'INPUT' && ['submit', 'button'].includes(el.getAttribute('type') || ''))\n  ) {\n    return value.replace(/[\\S]/g, '*');\n  }\n\n  return value;\n}\n","import { GLOBAL_OBJ } from '@sentry/utils';\n\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Metric, ReportCallback } from '../types';\n\nexport const bindReporter = (\n  callback: ReportCallback,\n  metric: Metric,\n  reportAllChanges?: boolean,\n): ((forceReport?: boolean) => void) => {\n  let prevValue: number;\n  let delta: number;\n  return (forceReport?: boolean) => {\n    if (metric.value >= 0) {\n      if (forceReport || reportAllChanges) {\n        delta = metric.value - (prevValue || 0);\n\n        // Report the metric if there's a non-zero delta or if no previous\n        // value exists (which can happen in the case of the document becoming\n        // hidden when the metric value is 0).\n        // See: https://github.com/GoogleChrome/web-vitals/issues/14\n        if (delta || prevValue === undefined) {\n          prevValue = metric.value;\n          metric.delta = delta;\n          callback(metric);\n        }\n      }\n    }\n  };\n};\n","/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\nimport type { NavigationTimingPolyfillEntry } from '../types';\n\nconst getNavigationEntryFromPerformanceTiming = (): NavigationTimingPolyfillEntry => {\n  // eslint-disable-next-line deprecation/deprecation\n  const timing = WINDOW.performance.timing;\n  // eslint-disable-next-line deprecation/deprecation\n  const type = WINDOW.performance.navigation.type;\n\n  const navigationEntry: { [key: string]: number | string } = {\n    entryType: 'navigation',\n    startTime: 0,\n    type: type == 2 ? 'back_forward' : type === 1 ? 'reload' : 'navigate',\n  };\n\n  for (const key in timing) {\n    if (key !== 'navigationStart' && key !== 'toJSON') {\n      // eslint-disable-next-line deprecation/deprecation\n      navigationEntry[key] = Math.max((timing[key as keyof PerformanceTiming] as number) - timing.navigationStart, 0);\n    }\n  }\n  return navigationEntry as unknown as NavigationTimingPolyfillEntry;\n};\n\nexport const getNavigationEntry = (): PerformanceNavigationTiming | NavigationTimingPolyfillEntry | undefined => {\n  if (WINDOW.__WEB_VITALS_POLYFILL__) {\n    return (\n      WINDOW.performance &&\n      ((performance.getEntriesByType && performance.getEntriesByType('navigation')[0]) ||\n        getNavigationEntryFromPerformanceTiming())\n    );\n  } else {\n    return WINDOW.performance && performance.getEntriesByType && performance.getEntriesByType('navigation')[0];\n  }\n};\n","/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getNavigationEntry } from './getNavigationEntry';\n\nexport const getActivationStart = (): number => {\n  const navEntry = getNavigationEntry();\n  return (navEntry && navEntry.activationStart) || 0;\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\nimport type { Metric } from '../types';\nimport { generateUniqueID } from './generateUniqueID';\nimport { getActivationStart } from './getActivationStart';\nimport { getNavigationEntry } from './getNavigationEntry';\n\nexport const initMetric = (name: Metric['name'], value?: number): Metric => {\n  const navEntry = getNavigationEntry();\n  let navigationType: Metric['navigationType'] = 'navigate';\n\n  if (navEntry) {\n    if (WINDOW.document.prerendering || getActivationStart() > 0) {\n      navigationType = 'prerender';\n    } else {\n      navigationType = navEntry.type.replace(/_/g, '-') as Metric['navigationType'];\n    }\n  }\n\n  return {\n    name,\n    value: typeof value === 'undefined' ? -1 : value,\n    rating: 'good', // Will be updated if the value changes.\n    delta: 0,\n    entries: [],\n    id: generateUniqueID(),\n    navigationType,\n  };\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Performantly generate a unique, 30-char string by combining a version\n * number, the current timestamp with a 13-digit number integer.\n * @return {string}\n */\nexport const generateUniqueID = (): string => {\n  return `v3-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`;\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { FirstInputPolyfillEntry, NavigationTimingPolyfillEntry, PerformancePaintTiming } from '../types';\n\nexport interface PerformanceEntryHandler {\n  (entry: PerformanceEntry): void;\n}\n\ninterface PerformanceEntryMap {\n  event: PerformanceEventTiming[];\n  paint: PerformancePaintTiming[];\n  'layout-shift': LayoutShift[];\n  'largest-contentful-paint': LargestContentfulPaint[];\n  'first-input': PerformanceEventTiming[] | FirstInputPolyfillEntry[];\n  navigation: PerformanceNavigationTiming[] | NavigationTimingPolyfillEntry[];\n  resource: PerformanceResourceTiming[];\n  longtask: PerformanceEntry[];\n}\n\n/**\n * Takes a performance entry type and a callback function, and creates a\n * `PerformanceObserver` instance that will observe the specified entry type\n * with buffering enabled and call the callback _for each entry_.\n *\n * This function also feature-detects entry support and wraps the logic in a\n * try/catch to avoid errors in unsupporting browsers.\n */\nexport const observe = <K extends keyof PerformanceEntryMap>(\n  type: K,\n  callback: (entries: PerformanceEntryMap[K]) => void,\n  opts?: PerformanceObserverInit,\n): PerformanceObserver | undefined => {\n  try {\n    if (PerformanceObserver.supportedEntryTypes.includes(type)) {\n      const po = new PerformanceObserver(list => {\n        callback(list.getEntries() as PerformanceEntryMap[K]);\n      });\n      po.observe(\n        Object.assign(\n          {\n            type,\n            buffered: true,\n          },\n          opts || {},\n        ) as PerformanceObserverInit,\n      );\n      return po;\n    }\n  } catch (e) {\n    // Do nothing.\n  }\n  return;\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\n\nexport interface OnHiddenCallback {\n  (event: Event): void;\n}\n\nexport const onHidden = (cb: OnHiddenCallback, once?: boolean): void => {\n  const onHiddenOrPageHide = (event: Event): void => {\n    if (event.type === 'pagehide' || WINDOW.document.visibilityState === 'hidden') {\n      cb(event);\n      if (once) {\n        removeEventListener('visibilitychange', onHiddenOrPageHide, true);\n        removeEventListener('pagehide', onHiddenOrPageHide, true);\n      }\n    }\n  };\n  addEventListener('visibilitychange', onHiddenOrPageHide, true);\n  // Some browsers have buggy implementations of visibilitychange,\n  // so we use pagehide in addition, just to be safe.\n  addEventListener('pagehide', onHiddenOrPageHide, true);\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\nimport { onHidden } from './onHidden';\n\nlet firstHiddenTime = -1;\n\nconst initHiddenTime = (): number => {\n  // If the document is hidden and not prerendering, assume it was always\n  // hidden and the page was loaded in the background.\n  return WINDOW.document.visibilityState === 'hidden' && !WINDOW.document.prerendering ? 0 : Infinity;\n};\n\nconst trackChanges = (): void => {\n  // Update the time if/when the document becomes hidden.\n  onHidden(({ timeStamp }) => {\n    firstHiddenTime = timeStamp;\n  }, true);\n};\n\nexport const getVisibilityWatcher = (): {\n  readonly firstHiddenTime: number;\n} => {\n  if (firstHiddenTime < 0) {\n    // If the document is hidden when this code runs, assume it was hidden\n    // since navigation start. This isn't a perfect heuristic, but it's the\n    // best we can do until an API is available to support querying past\n    // visibilityState.\n    firstHiddenTime = initHiddenTime();\n    trackChanges();\n  }\n  return {\n    get firstHiddenTime() {\n      return firstHiddenTime;\n    },\n  };\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bindReporter } from './lib/bindReporter';\nimport { getActivationStart } from './lib/getActivationStart';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport type { LCPMetric, ReportCallback, StopListening } from './types';\n\nconst reportedMetricIDs: Record<string, boolean> = {};\n\n/**\n * Calculates the [LCP](https://web.dev/lcp/) value for the current page and\n * calls the `callback` function once the value is ready (along with the\n * relevant `largest-contentful-paint` performance entry used to determine the\n * value). The reported value is a `DOMHighResTimeStamp`.\n */\nexport const onLCP = (onReport: ReportCallback): StopListening | undefined => {\n  const visibilityWatcher = getVisibilityWatcher();\n  const metric = initMetric('LCP');\n  let report: ReturnType<typeof bindReporter>;\n\n  const handleEntries = (entries: LCPMetric['entries']): void => {\n    const lastEntry = entries[entries.length - 1] as LargestContentfulPaint;\n    if (lastEntry) {\n      // The startTime attribute returns the value of the renderTime if it is\n      // not 0, and the value of the loadTime otherwise. The activationStart\n      // reference is used because LCP should be relative to page activation\n      // rather than navigation start if the page was prerendered.\n      const value = Math.max(lastEntry.startTime - getActivationStart(), 0);\n\n      // Only report if the page wasn't hidden prior to LCP.\n      if (value < visibilityWatcher.firstHiddenTime) {\n        metric.value = value;\n        metric.entries = [lastEntry];\n        report();\n      }\n    }\n  };\n\n  const po = observe('largest-contentful-paint', handleEntries);\n\n  if (po) {\n    report = bindReporter(onReport, metric);\n\n    const stopListening = (): void => {\n      if (!reportedMetricIDs[metric.id]) {\n        handleEntries(po.takeRecords() as LCPMetric['entries']);\n        po.disconnect();\n        reportedMetricIDs[metric.id] = true;\n        report(true);\n      }\n    };\n\n    // Stop listening after input. Note: while scrolling is an input that\n    // stop LCP observation, it's unreliable since it can be programmatically\n    // generated. See: https://github.com/GoogleChrome/web-vitals/issues/75\n    ['keydown', 'click'].forEach(type => {\n      addEventListener(type, stopListening, { once: true, capture: true });\n    });\n\n    onHidden(stopListening, true);\n\n    return stopListening;\n  }\n\n  return;\n};\n","import type { Transaction } from '@sentry/core';\nimport type { Span, SpanContext } from '@sentry/types';\n\n/**\n * Checks if a given value is a valid measurement value.\n */\nexport function isMeasurementValue(value: unknown): value is number {\n  return typeof value === 'number' && isFinite(value);\n}\n\n/**\n * Helper function to start child on transactions. This function will make sure that the transaction will\n * use the start timestamp of the created child span if it is earlier than the transactions actual\n * start timestamp.\n */\nexport function _startChild(transaction: Transaction, { startTimestamp, ...ctx }: SpanContext): Span {\n  if (startTimestamp && transaction.startTimestamp > startTimestamp) {\n    transaction.startTimestamp = startTimestamp;\n  }\n\n  return transaction.startChild({\n    startTimestamp,\n    ...ctx,\n  });\n}\n","/* eslint-disable max-lines */\nimport type { IdleTransaction, Transaction } from '@sentry/core';\nimport { getActiveTransaction } from '@sentry/core';\nimport type { Measurements } from '@sentry/types';\nimport { browserPerformanceTimeOrigin, htmlTreeAsString, logger } from '@sentry/utils';\n\nimport { WINDOW } from '../types';\nimport { onCLS } from '../web-vitals/getCLS';\nimport { onFID } from '../web-vitals/getFID';\nimport { onLCP } from '../web-vitals/getLCP';\nimport { getVisibilityWatcher } from '../web-vitals/lib/getVisibilityWatcher';\nimport { observe } from '../web-vitals/lib/observe';\nimport type { NavigatorDeviceMemory, NavigatorNetworkInformation } from '../web-vitals/types';\nimport { _startChild, isMeasurementValue } from './utils';\n\n/**\n * Converts from milliseconds to seconds\n * @param time time in ms\n */\nfunction msToSec(time: number): number {\n  return time / 1000;\n}\n\nfunction getBrowserPerformanceAPI(): Performance | undefined {\n  // @ts-expect-error we want to make sure all of these are available, even if TS is sure they are\n  return WINDOW && WINDOW.addEventListener && WINDOW.performance;\n}\n\nlet _performanceCursor: number = 0;\n\nlet _measurements: Measurements = {};\nlet _lcpEntry: LargestContentfulPaint | undefined;\nlet _clsEntry: LayoutShift | undefined;\n\n/**\n * Start tracking web vitals\n *\n * @returns A function that forces web vitals collection\n */\nexport function startTrackingWebVitals(): () => void {\n  const performance = getBrowserPerformanceAPI();\n  if (performance && browserPerformanceTimeOrigin) {\n    // @ts-expect-error we want to make sure all of these are available, even if TS is sure they are\n    if (performance.mark) {\n      WINDOW.performance.mark('sentry-tracing-init');\n    }\n    _trackFID();\n    const clsCallback = _trackCLS();\n    const lcpCallback = _trackLCP();\n\n    return (): void => {\n      if (clsCallback) {\n        clsCallback();\n      }\n      if (lcpCallback) {\n        lcpCallback();\n      }\n    };\n  }\n\n  return () => undefined;\n}\n\n/**\n * Start tracking long tasks.\n */\nexport function startTrackingLongTasks(): void {\n  const entryHandler = (entries: PerformanceEntry[]): void => {\n    for (const entry of entries) {\n      const transaction = getActiveTransaction() as IdleTransaction | undefined;\n      if (!transaction) {\n        return;\n      }\n      const startTime = msToSec((browserPerformanceTimeOrigin as number) + entry.startTime);\n      const duration = msToSec(entry.duration);\n\n      transaction.startChild({\n        description: 'Main UI thread blocked',\n        op: 'ui.long-task',\n        origin: 'auto.ui.browser.metrics',\n        startTimestamp: startTime,\n        endTimestamp: startTime + duration,\n      });\n    }\n  };\n\n  observe('longtask', entryHandler);\n}\n\n/**\n * Start tracking interaction events.\n */\nexport function startTrackingInteractions(): void {\n  const entryHandler = (entries: PerformanceEventTiming[]): void => {\n    for (const entry of entries) {\n      const transaction = getActiveTransaction() as IdleTransaction | undefined;\n      if (!transaction) {\n        return;\n      }\n\n      if (entry.name === 'click') {\n        const startTime = msToSec((browserPerformanceTimeOrigin as number) + entry.startTime);\n        const duration = msToSec(entry.duration);\n\n        transaction.startChild({\n          description: htmlTreeAsString(entry.target),\n          op: `ui.interaction.${entry.name}`,\n          origin: 'auto.ui.browser.metrics',\n          startTimestamp: startTime,\n          endTimestamp: startTime + duration,\n        });\n      }\n    }\n  };\n\n  observe('event', entryHandler, { durationThreshold: 0 });\n}\n\n/** Starts tracking the Cumulative Layout Shift on the current page. */\nfunction _trackCLS(): ReturnType<typeof onCLS> {\n  // See:\n  // https://web.dev/evolving-cls/\n  // https://web.dev/cls-web-tooling/\n  return onCLS(metric => {\n    const entry = metric.entries.pop();\n    if (!entry) {\n      return;\n    }\n\n    __DEBUG_BUILD__ && logger.log('[Measurements] Adding CLS');\n    _measurements['cls'] = { value: metric.value, unit: '' };\n    _clsEntry = entry as LayoutShift;\n  });\n}\n\n/** Starts tracking the Largest Contentful Paint on the current page. */\nfunction _trackLCP(): ReturnType<typeof onLCP> {\n  return onLCP(metric => {\n    const entry = metric.entries.pop();\n    if (!entry) {\n      return;\n    }\n\n    __DEBUG_BUILD__ && logger.log('[Measurements] Adding LCP');\n    _measurements['lcp'] = { value: metric.value, unit: 'millisecond' };\n    _lcpEntry = entry as LargestContentfulPaint;\n  });\n}\n\n/** Starts tracking the First Input Delay on the current page. */\nfunction _trackFID(): void {\n  onFID(metric => {\n    const entry = metric.entries.pop();\n    if (!entry) {\n      return;\n    }\n\n    const timeOrigin = msToSec(browserPerformanceTimeOrigin as number);\n    const startTime = msToSec(entry.startTime);\n    __DEBUG_BUILD__ && logger.log('[Measurements] Adding FID');\n    _measurements['fid'] = { value: metric.value, unit: 'millisecond' };\n    _measurements['mark.fid'] = { value: timeOrigin + startTime, unit: 'second' };\n  });\n}\n\n/** Add performance related spans to a transaction */\nexport function addPerformanceEntries(transaction: Transaction): void {\n  const performance = getBrowserPerformanceAPI();\n  if (!performance || !WINDOW.performance.getEntries || !browserPerformanceTimeOrigin) {\n    // Gatekeeper if performance API not available\n    return;\n  }\n\n  __DEBUG_BUILD__ && logger.log('[Tracing] Adding & adjusting spans using Performance API');\n  const timeOrigin = msToSec(browserPerformanceTimeOrigin);\n\n  const performanceEntries = performance.getEntries();\n\n  let responseStartTimestamp: number | undefined;\n  let requestStartTimestamp: number | undefined;\n\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  performanceEntries.slice(_performanceCursor).forEach((entry: Record<string, any>) => {\n    const startTime = msToSec(entry.startTime);\n    const duration = msToSec(entry.duration);\n\n    if (transaction.op === 'navigation' && timeOrigin + startTime < transaction.startTimestamp) {\n      return;\n    }\n\n    switch (entry.entryType) {\n      case 'navigation': {\n        _addNavigationSpans(transaction, entry, timeOrigin);\n        responseStartTimestamp = timeOrigin + msToSec(entry.responseStart);\n        requestStartTimestamp = timeOrigin + msToSec(entry.requestStart);\n        break;\n      }\n      case 'mark':\n      case 'paint':\n      case 'measure': {\n        _addMeasureSpans(transaction, entry, startTime, duration, timeOrigin);\n\n        // capture web vitals\n        const firstHidden = getVisibilityWatcher();\n        // Only report if the page wasn't hidden prior to the web vital.\n        const shouldRecord = entry.startTime < firstHidden.firstHiddenTime;\n\n        if (entry.name === 'first-paint' && shouldRecord) {\n          __DEBUG_BUILD__ && logger.log('[Measurements] Adding FP');\n          _measurements['fp'] = { value: entry.startTime, unit: 'millisecond' };\n        }\n        if (entry.name === 'first-contentful-paint' && shouldRecord) {\n          __DEBUG_BUILD__ && logger.log('[Measurements] Adding FCP');\n          _measurements['fcp'] = { value: entry.startTime, unit: 'millisecond' };\n        }\n        break;\n      }\n      case 'resource': {\n        const resourceName = (entry.name as string).replace(WINDOW.location.origin, '');\n        _addResourceSpans(transaction, entry, resourceName, startTime, duration, timeOrigin);\n        break;\n      }\n      default:\n      // Ignore other entry types.\n    }\n  });\n\n  _performanceCursor = Math.max(performanceEntries.length - 1, 0);\n\n  _trackNavigator(transaction);\n\n  // Measurements are only available for pageload transactions\n  if (transaction.op === 'pageload') {\n    // Generate TTFB (Time to First Byte), which measured as the time between the beginning of the transaction and the\n    // start of the response in milliseconds\n    if (typeof responseStartTimestamp === 'number') {\n      __DEBUG_BUILD__ && logger.log('[Measurements] Adding TTFB');\n      _measurements['ttfb'] = {\n        value: (responseStartTimestamp - transaction.startTimestamp) * 1000,\n        unit: 'millisecond',\n      };\n\n      if (typeof requestStartTimestamp === 'number' && requestStartTimestamp <= responseStartTimestamp) {\n        // Capture the time spent making the request and receiving the first byte of the response.\n        // This is the time between the start of the request and the start of the response in milliseconds.\n        _measurements['ttfb.requestTime'] = {\n          value: (responseStartTimestamp - requestStartTimestamp) * 1000,\n          unit: 'millisecond',\n        };\n      }\n    }\n\n    ['fcp', 'fp', 'lcp'].forEach(name => {\n      if (!_measurements[name] || timeOrigin >= transaction.startTimestamp) {\n        return;\n      }\n      // The web vitals, fcp, fp, lcp, and ttfb, all measure relative to timeOrigin.\n      // Unfortunately, timeOrigin is not captured within the transaction span data, so these web vitals will need\n      // to be adjusted to be relative to transaction.startTimestamp.\n      const oldValue = _measurements[name].value;\n      const measurementTimestamp = timeOrigin + msToSec(oldValue);\n\n      // normalizedValue should be in milliseconds\n      const normalizedValue = Math.abs((measurementTimestamp - transaction.startTimestamp) * 1000);\n      const delta = normalizedValue - oldValue;\n\n      __DEBUG_BUILD__ &&\n        logger.log(`[Measurements] Normalized ${name} from ${oldValue} to ${normalizedValue} (${delta})`);\n      _measurements[name].value = normalizedValue;\n    });\n\n    const fidMark = _measurements['mark.fid'];\n    if (fidMark && _measurements['fid']) {\n      // create span for FID\n      _startChild(transaction, {\n        description: 'first input delay',\n        endTimestamp: fidMark.value + msToSec(_measurements['fid'].value),\n        op: 'ui.action',\n        origin: 'auto.ui.browser.metrics',\n        startTimestamp: fidMark.value,\n      });\n\n      // Delete mark.fid as we don't want it to be part of final payload\n      delete _measurements['mark.fid'];\n    }\n\n    // If FCP is not recorded we should not record the cls value\n    // according to the new definition of CLS.\n    if (!('fcp' in _measurements)) {\n      delete _measurements.cls;\n    }\n\n    Object.keys(_measurements).forEach(measurementName => {\n      transaction.setMeasurement(\n        measurementName,\n        _measurements[measurementName].value,\n        _measurements[measurementName].unit,\n      );\n    });\n\n    _tagMetricInfo(transaction);\n  }\n\n  _lcpEntry = undefined;\n  _clsEntry = undefined;\n  _measurements = {};\n}\n\n/** Create measure related spans */\nexport function _addMeasureSpans(\n  transaction: Transaction,\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  entry: Record<string, any>,\n  startTime: number,\n  duration: number,\n  timeOrigin: number,\n): number {\n  const measureStartTimestamp = timeOrigin + startTime;\n  const measureEndTimestamp = measureStartTimestamp + duration;\n\n  _startChild(transaction, {\n    description: entry.name as string,\n    endTimestamp: measureEndTimestamp,\n    op: entry.entryType as string,\n    origin: 'auto.resource.browser.metrics',\n    startTimestamp: measureStartTimestamp,\n  });\n\n  return measureStartTimestamp;\n}\n\n/** Instrument navigation entries */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _addNavigationSpans(transaction: Transaction, entry: Record<string, any>, timeOrigin: number): void {\n  ['unloadEvent', 'redirect', 'domContentLoadedEvent', 'loadEvent', 'connect'].forEach(event => {\n    _addPerformanceNavigationTiming(transaction, entry, event, timeOrigin);\n  });\n  _addPerformanceNavigationTiming(transaction, entry, 'secureConnection', timeOrigin, 'TLS/SSL', 'connectEnd');\n  _addPerformanceNavigationTiming(transaction, entry, 'fetch', timeOrigin, 'cache', 'domainLookupStart');\n  _addPerformanceNavigationTiming(transaction, entry, 'domainLookup', timeOrigin, 'DNS');\n  _addRequest(transaction, entry, timeOrigin);\n}\n\n/** Create performance navigation related spans */\nfunction _addPerformanceNavigationTiming(\n  transaction: Transaction,\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  entry: Record<string, any>,\n  event: string,\n  timeOrigin: number,\n  description?: string,\n  eventEnd?: string,\n): void {\n  const end = eventEnd ? (entry[eventEnd] as number | undefined) : (entry[`${event}End`] as number | undefined);\n  const start = entry[`${event}Start`] as number | undefined;\n  if (!start || !end) {\n    return;\n  }\n  _startChild(transaction, {\n    op: 'browser',\n    origin: 'auto.browser.browser.metrics',\n    description: description || event,\n    startTimestamp: timeOrigin + msToSec(start),\n    endTimestamp: timeOrigin + msToSec(end),\n  });\n}\n\n/** Create request and response related spans */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _addRequest(transaction: Transaction, entry: Record<string, any>, timeOrigin: number): void {\n  _startChild(transaction, {\n    op: 'browser',\n    origin: 'auto.browser.browser.metrics',\n    description: 'request',\n    startTimestamp: timeOrigin + msToSec(entry.requestStart as number),\n    endTimestamp: timeOrigin + msToSec(entry.responseEnd as number),\n  });\n\n  _startChild(transaction, {\n    op: 'browser',\n    origin: 'auto.browser.browser.metrics',\n    description: 'response',\n    startTimestamp: timeOrigin + msToSec(entry.responseStart as number),\n    endTimestamp: timeOrigin + msToSec(entry.responseEnd as number),\n  });\n}\n\nexport interface ResourceEntry extends Record<string, unknown> {\n  initiatorType?: string;\n  transferSize?: number;\n  encodedBodySize?: number;\n  decodedBodySize?: number;\n  renderBlockingStatus?: string;\n}\n\n/** Create resource-related spans */\nexport function _addResourceSpans(\n  transaction: Transaction,\n  entry: ResourceEntry,\n  resourceName: string,\n  startTime: number,\n  duration: number,\n  timeOrigin: number,\n): void {\n  // we already instrument based on fetch and xhr, so we don't need to\n  // duplicate spans here.\n  if (entry.initiatorType === 'xmlhttprequest' || entry.initiatorType === 'fetch') {\n    return;\n  }\n\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const data: Record<string, any> = {};\n  if ('transferSize' in entry) {\n    data['http.response_transfer_size'] = entry.transferSize;\n  }\n  if ('encodedBodySize' in entry) {\n    data['http.response_content_length'] = entry.encodedBodySize;\n  }\n  if ('decodedBodySize' in entry) {\n    data['http.decoded_response_content_length'] = entry.decodedBodySize;\n  }\n  if ('renderBlockingStatus' in entry) {\n    data['resource.render_blocking_status'] = entry.renderBlockingStatus;\n  }\n\n  const startTimestamp = timeOrigin + startTime;\n  const endTimestamp = startTimestamp + duration;\n\n  _startChild(transaction, {\n    description: resourceName,\n    endTimestamp,\n    op: entry.initiatorType ? `resource.${entry.initiatorType}` : 'resource.other',\n    origin: 'auto.resource.browser.metrics',\n    startTimestamp,\n    data,\n  });\n}\n\n/**\n * Capture the information of the user agent.\n */\nfunction _trackNavigator(transaction: Transaction): void {\n  const navigator = WINDOW.navigator as null | (Navigator & NavigatorNetworkInformation & NavigatorDeviceMemory);\n  if (!navigator) {\n    return;\n  }\n\n  // track network connectivity\n  const connection = navigator.connection;\n  if (connection) {\n    if (connection.effectiveType) {\n      transaction.setTag('effectiveConnectionType', connection.effectiveType);\n    }\n\n    if (connection.type) {\n      transaction.setTag('connectionType', connection.type);\n    }\n\n    if (isMeasurementValue(connection.rtt)) {\n      _measurements['connection.rtt'] = { value: connection.rtt, unit: 'millisecond' };\n    }\n  }\n\n  if (isMeasurementValue(navigator.deviceMemory)) {\n    transaction.setTag('deviceMemory', `${navigator.deviceMemory} GB`);\n  }\n\n  if (isMeasurementValue(navigator.hardwareConcurrency)) {\n    transaction.setTag('hardwareConcurrency', String(navigator.hardwareConcurrency));\n  }\n}\n\n/** Add LCP / CLS data to transaction to allow debugging */\nfunction _tagMetricInfo(transaction: Transaction): void {\n  if (_lcpEntry) {\n    __DEBUG_BUILD__ && logger.log('[Measurements] Adding LCP Data');\n\n    // Capture Properties of the LCP element that contributes to the LCP.\n\n    if (_lcpEntry.element) {\n      transaction.setTag('lcp.element', htmlTreeAsString(_lcpEntry.element));\n    }\n\n    if (_lcpEntry.id) {\n      transaction.setTag('lcp.id', _lcpEntry.id);\n    }\n\n    if (_lcpEntry.url) {\n      // Trim URL to the first 200 characters.\n      transaction.setTag('lcp.url', _lcpEntry.url.trim().slice(0, 200));\n    }\n\n    transaction.setTag('lcp.size', _lcpEntry.size);\n  }\n\n  // See: https://developer.mozilla.org/en-US/docs/Web/API/LayoutShift\n  if (_clsEntry && _clsEntry.sources) {\n    __DEBUG_BUILD__ && logger.log('[Measurements] Adding CLS Data');\n    _clsEntry.sources.forEach((source, index) =>\n      transaction.setTag(`cls.source.${index + 1}`, htmlTreeAsString(source.node)),\n    );\n  }\n}\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bindReporter } from './lib/bindReporter';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport type { FIDMetric, PerformanceEventTiming, ReportCallback } from './types';\n\n/**\n * Calculates the [FID](https://web.dev/fid/) value for the current page and\n * calls the `callback` function once the value is ready, along with the\n * relevant `first-input` performance entry used to determine the value. The\n * reported value is a `DOMHighResTimeStamp`.\n *\n * _**Important:** since FID is only reported after the user interacts with the\n * page, it's possible that it will not be reported for some page loads._\n */\nexport const onFID = (onReport: ReportCallback): void => {\n  const visibilityWatcher = getVisibilityWatcher();\n  const metric = initMetric('FID');\n  // eslint-disable-next-line prefer-const\n  let report: ReturnType<typeof bindReporter>;\n\n  const handleEntry = (entry: PerformanceEventTiming): void => {\n    // Only report if the page wasn't hidden prior to the first input.\n    if (entry.startTime < visibilityWatcher.firstHiddenTime) {\n      metric.value = entry.processingStart - entry.startTime;\n      metric.entries.push(entry);\n      report(true);\n    }\n  };\n\n  const handleEntries = (entries: FIDMetric['entries']): void => {\n    (entries as PerformanceEventTiming[]).forEach(handleEntry);\n  };\n\n  const po = observe('first-input', handleEntries);\n  report = bindReporter(onReport, metric);\n\n  if (po) {\n    onHidden(() => {\n      handleEntries(po.takeRecords() as FIDMetric['entries']);\n      po.disconnect();\n    }, true);\n  }\n};\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bindReporter } from './lib/bindReporter';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport type { CLSMetric, ReportCallback, StopListening } from './types';\n\n/**\n * Calculates the [CLS](https://web.dev/cls/) value for the current page and\n * calls the `callback` function once the value is ready to be reported, along\n * with all `layout-shift` performance entries that were used in the metric\n * value calculation. The reported value is a `double` (corresponding to a\n * [layout shift score](https://web.dev/cls/#layout-shift-score)).\n *\n * If the `reportAllChanges` configuration option is set to `true`, the\n * `callback` function will be called as soon as the value is initially\n * determined as well as any time the value changes throughout the page\n * lifespan.\n *\n * _**Important:** CLS should be continually monitored for changes throughout\n * the entire lifespan of a page—including if the user returns to the page after\n * it's been hidden/backgrounded. However, since browsers often [will not fire\n * additional callbacks once the user has backgrounded a\n * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),\n * `callback` is always called when the page's visibility state changes to\n * hidden. As a result, the `callback` function might be called multiple times\n * during the same page load._\n */\nexport const onCLS = (onReport: ReportCallback): StopListening | undefined => {\n  const metric = initMetric('CLS', 0);\n  let report: ReturnType<typeof bindReporter>;\n\n  let sessionValue = 0;\n  let sessionEntries: PerformanceEntry[] = [];\n\n  // const handleEntries = (entries: Metric['entries']) => {\n  const handleEntries = (entries: LayoutShift[]): void => {\n    entries.forEach(entry => {\n      // Only count layout shifts without recent user input.\n      if (!entry.hadRecentInput) {\n        const firstSessionEntry = sessionEntries[0];\n        const lastSessionEntry = sessionEntries[sessionEntries.length - 1];\n\n        // If the entry occurred less than 1 second after the previous entry and\n        // less than 5 seconds after the first entry in the session, include the\n        // entry in the current session. Otherwise, start a new session.\n        if (\n          sessionValue &&\n          sessionEntries.length !== 0 &&\n          entry.startTime - lastSessionEntry.startTime < 1000 &&\n          entry.startTime - firstSessionEntry.startTime < 5000\n        ) {\n          sessionValue += entry.value;\n          sessionEntries.push(entry);\n        } else {\n          sessionValue = entry.value;\n          sessionEntries = [entry];\n        }\n\n        // If the current session value is larger than the current CLS value,\n        // update CLS and the entries contributing to it.\n        if (sessionValue > metric.value) {\n          metric.value = sessionValue;\n          metric.entries = sessionEntries;\n          if (report) {\n            report();\n          }\n        }\n      }\n    });\n  };\n\n  const po = observe('layout-shift', handleEntries);\n  if (po) {\n    report = bindReporter(onReport, metric);\n\n    const stopListening = (): void => {\n      handleEntries(po.takeRecords() as CLSMetric['entries']);\n      report(true);\n    };\n\n    onHidden(stopListening);\n\n    return stopListening;\n  }\n\n  return;\n};\n","/* eslint-disable max-lines */\nimport { getCurrentHub, getDynamicSamplingContextFromClient, hasTracingEnabled } from '@sentry/core';\nimport type { Client, Scope, Span } from '@sentry/types';\nimport {\n  addInstrumentationHandler,\n  BAGGAGE_HEADER_NAME,\n  browserPerformanceTimeOrigin,\n  dynamicSamplingContextToSentryBaggageHeader,\n  generateSentryTraceHeader,\n  isInstanceOf,\n  SENTRY_XHR_DATA_KEY,\n  stringMatchesSomePattern,\n} from '@sentry/utils';\n\nexport const DEFAULT_TRACE_PROPAGATION_TARGETS = ['localhost', /^\\/(?!\\/)/];\n\n/** Options for Request Instrumentation */\nexport interface RequestInstrumentationOptions {\n  /**\n   * @deprecated Will be removed in v8.\n   * Use `shouldCreateSpanForRequest` to control span creation and `tracePropagationTargets` to control\n   * trace header attachment.\n   */\n  tracingOrigins: Array<string | RegExp>;\n\n  /**\n   * List of strings and/or regexes used to determine which outgoing requests will have `sentry-trace` and `baggage`\n   * headers attached.\n   *\n   * @deprecated Use the top-level `tracePropagationTargets` option in `Sentry.init` instead.\n   * This option will be removed in v8.\n   *\n   * Default: ['localhost', /^\\//] @see {DEFAULT_TRACE_PROPAGATION_TARGETS}\n   */\n  tracePropagationTargets: Array<string | RegExp>;\n\n  /**\n   * Flag to disable patching all together for fetch requests.\n   *\n   * Default: true\n   */\n  traceFetch: boolean;\n\n  /**\n   * Flag to disable patching all together for xhr requests.\n   *\n   * Default: true\n   */\n  traceXHR: boolean;\n\n  /**\n   * If true, Sentry will capture http timings and add them to the corresponding http spans.\n   *\n   * Default: true\n   */\n  enableHTTPTimings: boolean;\n\n  /**\n   * This function will be called before creating a span for a request with the given url.\n   * Return false if you don't want a span for the given url.\n   *\n   * Default: (url: string) => true\n   */\n  shouldCreateSpanForRequest?(this: void, url: string): boolean;\n}\n\n/** Data returned from fetch callback */\nexport interface FetchData {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  args: any[]; // the arguments passed to the fetch call itself\n  fetchData?: {\n    method: string;\n    url: string;\n    // span_id\n    __span?: string;\n  };\n\n  // TODO Should this be unknown instead? If we vendor types, make it a Response\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  response?: any;\n  error?: unknown;\n\n  startTimestamp: number;\n  endTimestamp?: number;\n}\n\n/** Data returned from XHR request */\nexport interface XHRData {\n  xhr?: {\n    [SENTRY_XHR_DATA_KEY]?: {\n      method: string;\n      url: string;\n      status_code: number;\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      data: Record<string, any>;\n    };\n    __sentry_xhr_span_id__?: string;\n    setRequestHeader?: (key: string, val: string) => void;\n    getRequestHeader?: (key: string) => string;\n    __sentry_own_request__?: boolean;\n  };\n  startTimestamp: number;\n  endTimestamp?: number;\n}\n\ntype PolymorphicRequestHeaders =\n  | Record<string, string | undefined>\n  | Array<[string, string]>\n  // the below is not preicsely the Header type used in Request, but it'll pass duck-typing\n  | {\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      [key: string]: any;\n      append: (key: string, value: string) => void;\n      get: (key: string) => string | null | undefined;\n    };\n\nexport const defaultRequestInstrumentationOptions: RequestInstrumentationOptions = {\n  traceFetch: true,\n  traceXHR: true,\n  enableHTTPTimings: true,\n  // TODO (v8): Remove this property\n  tracingOrigins: DEFAULT_TRACE_PROPAGATION_TARGETS,\n  tracePropagationTargets: DEFAULT_TRACE_PROPAGATION_TARGETS,\n};\n\n/** Registers span creators for xhr and fetch requests  */\nexport function instrumentOutgoingRequests(_options?: Partial<RequestInstrumentationOptions>): void {\n  const {\n    traceFetch,\n    traceXHR,\n    // eslint-disable-next-line deprecation/deprecation\n    tracePropagationTargets,\n    // eslint-disable-next-line deprecation/deprecation\n    tracingOrigins,\n    shouldCreateSpanForRequest,\n    enableHTTPTimings,\n  } = {\n    traceFetch: defaultRequestInstrumentationOptions.traceFetch,\n    traceXHR: defaultRequestInstrumentationOptions.traceXHR,\n    ..._options,\n  };\n\n  const shouldCreateSpan =\n    typeof shouldCreateSpanForRequest === 'function' ? shouldCreateSpanForRequest : (_: string) => true;\n\n  // TODO(v8) Remove tracingOrigins here\n  // The only reason we're passing it in here is because this instrumentOutgoingRequests function is publicly exported\n  // and we don't want to break the API. We can remove it in v8.\n  const shouldAttachHeadersWithTargets = (url: string): boolean =>\n    shouldAttachHeaders(url, tracePropagationTargets || tracingOrigins);\n\n  const spans: Record<string, Span> = {};\n\n  if (traceFetch) {\n    addInstrumentationHandler('fetch', (handlerData: FetchData) => {\n      const createdSpan = fetchCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);\n      if (enableHTTPTimings && createdSpan) {\n        addHTTPTimings(createdSpan);\n      }\n    });\n  }\n\n  if (traceXHR) {\n    addInstrumentationHandler('xhr', (handlerData: XHRData) => {\n      const createdSpan = xhrCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);\n      if (enableHTTPTimings && createdSpan) {\n        addHTTPTimings(createdSpan);\n      }\n    });\n  }\n}\n\nfunction isPerformanceResourceTiming(entry: PerformanceEntry): entry is PerformanceResourceTiming {\n  return (\n    entry.entryType === 'resource' &&\n    'initiatorType' in entry &&\n    typeof (entry as PerformanceResourceTiming).nextHopProtocol === 'string' &&\n    (entry.initiatorType === 'fetch' || entry.initiatorType === 'xmlhttprequest')\n  );\n}\n\n/**\n * Creates a temporary observer to listen to the next fetch/xhr resourcing timings,\n * so that when timings hit their per-browser limit they don't need to be removed.\n *\n * @param span A span that has yet to be finished, must contain `url` on data.\n */\nfunction addHTTPTimings(span: Span): void {\n  const url = span.data.url;\n  const observer = new PerformanceObserver(list => {\n    const entries = list.getEntries();\n    entries.forEach(entry => {\n      if (isPerformanceResourceTiming(entry) && entry.name.endsWith(url)) {\n        const spanData = resourceTimingEntryToSpanData(entry);\n        spanData.forEach(data => span.setData(...data));\n        observer.disconnect();\n      }\n    });\n  });\n  observer.observe({\n    entryTypes: ['resource'],\n  });\n}\n\n/**\n * Converts ALPN protocol ids to name and version.\n *\n * (https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids)\n * @param nextHopProtocol PerformanceResourceTiming.nextHopProtocol\n */\nexport function extractNetworkProtocol(nextHopProtocol: string): { name: string; version: string } {\n  let name = 'unknown';\n  let version = 'unknown';\n  let _name = '';\n  for (const char of nextHopProtocol) {\n    // http/1.1 etc.\n    if (char === '/') {\n      [name, version] = nextHopProtocol.split('/');\n      break;\n    }\n    // h2, h3 etc.\n    if (!isNaN(Number(char))) {\n      name = _name === 'h' ? 'http' : _name;\n      version = nextHopProtocol.split(_name)[1];\n      break;\n    }\n    _name += char;\n  }\n  if (_name === nextHopProtocol) {\n    // webrtc, ftp, etc.\n    name = _name;\n  }\n  return { name, version };\n}\n\nfunction getAbsoluteTime(time: number = 0): number {\n  return ((browserPerformanceTimeOrigin || performance.timeOrigin) + time) / 1000;\n}\n\nfunction resourceTimingEntryToSpanData(resourceTiming: PerformanceResourceTiming): [string, string | number][] {\n  const { name, version } = extractNetworkProtocol(resourceTiming.nextHopProtocol);\n\n  const timingSpanData: [string, string | number][] = [];\n\n  timingSpanData.push(['network.protocol.version', version], ['network.protocol.name', name]);\n\n  if (!browserPerformanceTimeOrigin) {\n    return timingSpanData;\n  }\n  return [\n    ...timingSpanData,\n    ['http.request.redirect_start', getAbsoluteTime(resourceTiming.redirectStart)],\n    ['http.request.fetch_start', getAbsoluteTime(resourceTiming.fetchStart)],\n    ['http.request.domain_lookup_start', getAbsoluteTime(resourceTiming.domainLookupStart)],\n    ['http.request.domain_lookup_end', getAbsoluteTime(resourceTiming.domainLookupEnd)],\n    ['http.request.connect_start', getAbsoluteTime(resourceTiming.connectStart)],\n    ['http.request.secure_connection_start', getAbsoluteTime(resourceTiming.secureConnectionStart)],\n    ['http.request.connection_end', getAbsoluteTime(resourceTiming.connectEnd)],\n    ['http.request.request_start', getAbsoluteTime(resourceTiming.requestStart)],\n    ['http.request.response_start', getAbsoluteTime(resourceTiming.responseStart)],\n    ['http.request.response_end', getAbsoluteTime(resourceTiming.responseEnd)],\n  ];\n}\n\n/**\n * A function that determines whether to attach tracing headers to a request.\n * This was extracted from `instrumentOutgoingRequests` to make it easier to test shouldAttachHeaders.\n * We only export this fuction for testing purposes.\n */\nexport function shouldAttachHeaders(url: string, tracePropagationTargets: (string | RegExp)[] | undefined): boolean {\n  return stringMatchesSomePattern(url, tracePropagationTargets || DEFAULT_TRACE_PROPAGATION_TARGETS);\n}\n\n/**\n * Create and track fetch request spans\n *\n * @returns Span if a span was created, otherwise void.\n */\nexport function fetchCallback(\n  handlerData: FetchData,\n  shouldCreateSpan: (url: string) => boolean,\n  shouldAttachHeaders: (url: string) => boolean,\n  spans: Record<string, Span>,\n): Span | undefined {\n  if (!hasTracingEnabled() || !handlerData.fetchData) {\n    return undefined;\n  }\n\n  const shouldCreateSpanResult = shouldCreateSpan(handlerData.fetchData.url);\n\n  if (handlerData.endTimestamp && shouldCreateSpanResult) {\n    const spanId = handlerData.fetchData.__span;\n    if (!spanId) return;\n\n    const span = spans[spanId];\n    if (span) {\n      if (handlerData.response) {\n        // TODO (kmclb) remove this once types PR goes through\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        span.setHttpStatus(handlerData.response.status);\n\n        const contentLength: string =\n          // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n          handlerData.response && handlerData.response.headers && handlerData.response.headers.get('content-length');\n\n        const contentLengthNum = parseInt(contentLength);\n        if (contentLengthNum > 0) {\n          span.setData('http.response_content_length', contentLengthNum);\n        }\n      } else if (handlerData.error) {\n        span.setStatus('internal_error');\n      }\n      span.finish();\n\n      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n      delete spans[spanId];\n    }\n    return undefined;\n  }\n\n  const hub = getCurrentHub();\n  const scope = hub.getScope();\n  const client = hub.getClient();\n  const parentSpan = scope.getSpan();\n\n  const { method, url } = handlerData.fetchData;\n\n  const span =\n    shouldCreateSpanResult && parentSpan\n      ? parentSpan.startChild({\n          data: {\n            url,\n            type: 'fetch',\n            'http.method': method,\n          },\n          description: `${method} ${url}`,\n          op: 'http.client',\n          origin: 'auto.http.browser',\n        })\n      : undefined;\n\n  if (span) {\n    handlerData.fetchData.__span = span.spanId;\n    spans[span.spanId] = span;\n  }\n\n  if (shouldAttachHeaders(handlerData.fetchData.url) && client) {\n    const request: string | Request = handlerData.args[0];\n\n    // In case the user hasn't set the second argument of a fetch call we default it to `{}`.\n    handlerData.args[1] = handlerData.args[1] || {};\n\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    const options: { [key: string]: any } = handlerData.args[1];\n\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n    options.headers = addTracingHeadersToFetchRequest(request, client, scope, options, span);\n  }\n\n  return span;\n}\n\n/**\n * Adds sentry-trace and baggage headers to the various forms of fetch headers\n */\nexport function addTracingHeadersToFetchRequest(\n  request: string | unknown, // unknown is actually type Request but we can't export DOM types from this package,\n  client: Client,\n  scope: Scope,\n  options: {\n    headers?:\n      | {\n          [key: string]: string[] | string | undefined;\n        }\n      | PolymorphicRequestHeaders;\n  },\n  requestSpan?: Span,\n): PolymorphicRequestHeaders | undefined {\n  const span = requestSpan || scope.getSpan();\n\n  const transaction = span && span.transaction;\n\n  const { traceId, sampled, dsc } = scope.getPropagationContext();\n\n  const sentryTraceHeader = span ? span.toTraceparent() : generateSentryTraceHeader(traceId, undefined, sampled);\n  const dynamicSamplingContext = transaction\n    ? transaction.getDynamicSamplingContext()\n    : dsc\n    ? dsc\n    : getDynamicSamplingContextFromClient(traceId, client, scope);\n\n  const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);\n\n  const headers =\n    typeof Request !== 'undefined' && isInstanceOf(request, Request) ? (request as Request).headers : options.headers;\n\n  if (!headers) {\n    return { 'sentry-trace': sentryTraceHeader, baggage: sentryBaggageHeader };\n  } else if (typeof Headers !== 'undefined' && isInstanceOf(headers, Headers)) {\n    const newHeaders = new Headers(headers as Headers);\n\n    newHeaders.append('sentry-trace', sentryTraceHeader);\n\n    if (sentryBaggageHeader) {\n      // If the same header is appended multiple times the browser will merge the values into a single request header.\n      // Its therefore safe to simply push a \"baggage\" entry, even though there might already be another baggage header.\n      newHeaders.append(BAGGAGE_HEADER_NAME, sentryBaggageHeader);\n    }\n\n    return newHeaders as PolymorphicRequestHeaders;\n  } else if (Array.isArray(headers)) {\n    const newHeaders = [...headers, ['sentry-trace', sentryTraceHeader]];\n\n    if (sentryBaggageHeader) {\n      // If there are multiple entries with the same key, the browser will merge the values into a single request header.\n      // Its therefore safe to simply push a \"baggage\" entry, even though there might already be another baggage header.\n      newHeaders.push([BAGGAGE_HEADER_NAME, sentryBaggageHeader]);\n    }\n\n    return newHeaders as PolymorphicRequestHeaders;\n  } else {\n    const existingBaggageHeader = 'baggage' in headers ? headers.baggage : undefined;\n    const newBaggageHeaders: string[] = [];\n\n    if (Array.isArray(existingBaggageHeader)) {\n      newBaggageHeaders.push(...existingBaggageHeader);\n    } else if (existingBaggageHeader) {\n      newBaggageHeaders.push(existingBaggageHeader);\n    }\n\n    if (sentryBaggageHeader) {\n      newBaggageHeaders.push(sentryBaggageHeader);\n    }\n\n    return {\n      ...(headers as Exclude<typeof headers, Headers>),\n      'sentry-trace': sentryTraceHeader,\n      baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined,\n    };\n  }\n}\n\n/**\n * Create and track xhr request spans\n *\n * @returns Span if a span was created, otherwise void.\n */\n// eslint-disable-next-line complexity\nexport function xhrCallback(\n  handlerData: XHRData,\n  shouldCreateSpan: (url: string) => boolean,\n  shouldAttachHeaders: (url: string) => boolean,\n  spans: Record<string, Span>,\n): Span | undefined {\n  const xhr = handlerData.xhr;\n  const sentryXhrData = xhr && xhr[SENTRY_XHR_DATA_KEY];\n\n  if (!hasTracingEnabled() || (xhr && xhr.__sentry_own_request__) || !xhr || !sentryXhrData) {\n    return undefined;\n  }\n\n  const shouldCreateSpanResult = shouldCreateSpan(sentryXhrData.url);\n\n  // check first if the request has finished and is tracked by an existing span which should now end\n  if (handlerData.endTimestamp && shouldCreateSpanResult) {\n    const spanId = xhr.__sentry_xhr_span_id__;\n    if (!spanId) return;\n\n    const span = spans[spanId];\n    if (span) {\n      span.setHttpStatus(sentryXhrData.status_code);\n      span.finish();\n\n      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n      delete spans[spanId];\n    }\n    return undefined;\n  }\n\n  const hub = getCurrentHub();\n  const scope = hub.getScope();\n  const parentSpan = scope.getSpan();\n\n  const span =\n    shouldCreateSpanResult && parentSpan\n      ? parentSpan.startChild({\n          data: {\n            ...sentryXhrData.data,\n            type: 'xhr',\n            'http.method': sentryXhrData.method,\n            url: sentryXhrData.url,\n          },\n          description: `${sentryXhrData.method} ${sentryXhrData.url}`,\n          op: 'http.client',\n          origin: 'auto.http.browser',\n        })\n      : undefined;\n\n  if (span) {\n    xhr.__sentry_xhr_span_id__ = span.spanId;\n    spans[xhr.__sentry_xhr_span_id__] = span;\n  }\n\n  if (xhr.setRequestHeader && shouldAttachHeaders(sentryXhrData.url)) {\n    if (span) {\n      const transaction = span && span.transaction;\n      const dynamicSamplingContext = transaction && transaction.getDynamicSamplingContext();\n      const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);\n      setHeaderOnXhr(xhr, span.toTraceparent(), sentryBaggageHeader);\n    } else {\n      const client = hub.getClient();\n      const { traceId, sampled, dsc } = scope.getPropagationContext();\n      const sentryTraceHeader = generateSentryTraceHeader(traceId, undefined, sampled);\n      const dynamicSamplingContext =\n        dsc || (client ? getDynamicSamplingContextFromClient(traceId, client, scope) : undefined);\n      const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);\n      setHeaderOnXhr(xhr, sentryTraceHeader, sentryBaggageHeader);\n    }\n  }\n\n  return span;\n}\n\nfunction setHeaderOnXhr(\n  xhr: NonNullable<XHRData['xhr']>,\n  sentryTraceHeader: string,\n  sentryBaggageHeader: string | undefined,\n): void {\n  try {\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    xhr.setRequestHeader!('sentry-trace', sentryTraceHeader);\n    if (sentryBaggageHeader) {\n      // From MDN: \"If this method is called several times with the same header, the values are merged into one single request header.\"\n      // We can therefore simply set a baggage header without checking what was there before\n      // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/setRequestHeader\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n      xhr.setRequestHeader!(BAGGAGE_HEADER_NAME, sentryBaggageHeader);\n    }\n  } catch (_) {\n    // Error: InvalidStateError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.\n  }\n}\n","/* eslint-disable max-lines */\nimport type { Hub, IdleTransaction } from '@sentry/core';\nimport { addTracingExtensions, getActiveTransaction, startIdleTransaction, TRACING_DEFAULTS } from '@sentry/core';\nimport type { EventProcessor, Integration, Transaction, TransactionContext, TransactionSource } from '@sentry/types';\nimport { getDomElement, logger, tracingContextFromHeaders } from '@sentry/utils';\n\nimport { registerBackgroundTabDetection } from './backgroundtab';\nimport {\n  addPerformanceEntries,\n  startTrackingInteractions,\n  startTrackingLongTasks,\n  startTrackingWebVitals,\n} from './metrics';\nimport type { RequestInstrumentationOptions } from './request';\nimport { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './request';\nimport { instrumentRoutingWithDefaults } from './router';\nimport { WINDOW } from './types';\n\nexport const BROWSER_TRACING_INTEGRATION_ID = 'BrowserTracing';\n\n/** Options for Browser Tracing integration */\nexport interface BrowserTracingOptions extends RequestInstrumentationOptions {\n  /**\n   * The time to wait in ms until the transaction will be finished during an idle state. An idle state is defined\n   * by a moment where there are no in-progress spans.\n   *\n   * The transaction will use the end timestamp of the last finished span as the endtime for the transaction.\n   * If there are still active spans when this the `idleTimeout` is set, the `idleTimeout` will get reset.\n   * Time is in ms.\n   *\n   * Default: 1000\n   */\n  idleTimeout: number;\n\n  /**\n   * The max duration for a transaction. If a transaction duration hits the `finalTimeout` value, it\n   * will be finished.\n   * Time is in ms.\n   *\n   * Default: 30000\n   */\n  finalTimeout: number;\n\n  /**\n   * The heartbeat interval. If no new spans are started or open spans are finished within 3 heartbeats,\n   * the transaction will be finished.\n   * Time is in ms.\n   *\n   * Default: 5000\n   */\n  heartbeatInterval: number;\n\n  /**\n   * Flag to enable/disable creation of `navigation` transaction on history changes.\n   *\n   * Default: true\n   */\n  startTransactionOnLocationChange: boolean;\n\n  /**\n   * Flag to enable/disable creation of `pageload` transaction on first pageload.\n   *\n   * Default: true\n   */\n  startTransactionOnPageLoad: boolean;\n\n  /**\n   * Flag Transactions where tabs moved to background with \"cancelled\". Browser background tab timing is\n   * not suited towards doing precise measurements of operations. By default, we recommend that this option\n   * be enabled as background transactions can mess up your statistics in nondeterministic ways.\n   *\n   * Default: true\n   */\n  markBackgroundTransactions: boolean;\n\n  /**\n   * If true, Sentry will capture long tasks and add them to the corresponding transaction.\n   *\n   * Default: true\n   */\n  enableLongTask: boolean;\n\n  /**\n   * _metricOptions allows the user to send options to change how metrics are collected.\n   *\n   * _metricOptions is currently experimental.\n   *\n   * Default: undefined\n   */\n  _metricOptions?: Partial<{\n    /**\n     * @deprecated This property no longer has any effect and will be removed in v8.\n     */\n    _reportAllChanges: boolean;\n  }>;\n\n  /**\n   * _experiments allows the user to send options to define how this integration works.\n   * Note that the `enableLongTask` options is deprecated in favor of the option at the top level, and will be removed in v8.\n   *\n   * TODO (v8): Remove enableLongTask\n   *\n   * Default: undefined\n   */\n  _experiments: Partial<{\n    enableLongTask: boolean;\n    enableInteractions: boolean;\n    onStartRouteTransaction: (t: Transaction | undefined, ctx: TransactionContext, getCurrentHub: () => Hub) => void;\n  }>;\n\n  /**\n   * beforeNavigate is called before a pageload/navigation transaction is created and allows users to modify transaction\n   * context data, or drop the transaction entirely (by setting `sampled = false` in the context).\n   *\n   * Note: For legacy reasons, transactions can also be dropped by returning `undefined`.\n   *\n   * @param context: The context data which will be passed to `startTransaction` by default\n   *\n   * @returns A (potentially) modified context object, with `sampled = false` if the transaction should be dropped.\n   */\n  beforeNavigate?(this: void, context: TransactionContext): TransactionContext | undefined;\n\n  /**\n   * Instrumentation that creates routing change transactions. By default creates\n   * pageload and navigation transactions.\n   */\n  routingInstrumentation<T extends Transaction>(\n    this: void,\n    customStartTransaction: (context: TransactionContext) => T | undefined,\n    startTransactionOnPageLoad?: boolean,\n    startTransactionOnLocationChange?: boolean,\n  ): void;\n}\n\nconst DEFAULT_BROWSER_TRACING_OPTIONS: BrowserTracingOptions = {\n  ...TRACING_DEFAULTS,\n  markBackgroundTransactions: true,\n  routingInstrumentation: instrumentRoutingWithDefaults,\n  startTransactionOnLocationChange: true,\n  startTransactionOnPageLoad: true,\n  enableLongTask: true,\n  _experiments: {},\n  ...defaultRequestInstrumentationOptions,\n};\n\n/**\n * The Browser Tracing integration automatically instruments browser pageload/navigation\n * actions as transactions, and captures requests, metrics and errors as spans.\n *\n * The integration can be configured with a variety of options, and can be extended to use\n * any routing library. This integration uses {@see IdleTransaction} to create transactions.\n */\nexport class BrowserTracing implements Integration {\n  // This class currently doesn't have a static `id` field like the other integration classes, because it prevented\n  // @sentry/tracing from being treeshaken. Tree shakers do not like static fields, because they behave like side effects.\n  // TODO: Come up with a better plan, than using static fields on integration classes, and use that plan on all\n  // integrations.\n\n  /** Browser Tracing integration options */\n  public options: BrowserTracingOptions;\n\n  /**\n   * @inheritDoc\n   */\n  public name: string;\n\n  private _getCurrentHub?: () => Hub;\n\n  private _latestRouteName?: string;\n  private _latestRouteSource?: TransactionSource;\n\n  private _collectWebVitals: () => void;\n\n  private _hasSetTracePropagationTargets: boolean;\n\n  public constructor(_options?: Partial<BrowserTracingOptions>) {\n    this.name = BROWSER_TRACING_INTEGRATION_ID;\n    this._hasSetTracePropagationTargets = false;\n\n    addTracingExtensions();\n\n    if (__DEBUG_BUILD__) {\n      this._hasSetTracePropagationTargets = !!(\n        _options &&\n        // eslint-disable-next-line deprecation/deprecation\n        (_options.tracePropagationTargets || _options.tracingOrigins)\n      );\n    }\n\n    this.options = {\n      ...DEFAULT_BROWSER_TRACING_OPTIONS,\n      ..._options,\n    };\n\n    // Special case: enableLongTask can be set in _experiments\n    // TODO (v8): Remove this in v8\n    if (this.options._experiments.enableLongTask !== undefined) {\n      this.options.enableLongTask = this.options._experiments.enableLongTask;\n    }\n\n    // TODO (v8): remove this block after tracingOrigins is removed\n    // Set tracePropagationTargets to tracingOrigins if specified by the user\n    // In case both are specified, tracePropagationTargets takes precedence\n    // eslint-disable-next-line deprecation/deprecation\n    if (_options && !_options.tracePropagationTargets && _options.tracingOrigins) {\n      // eslint-disable-next-line deprecation/deprecation\n      this.options.tracePropagationTargets = _options.tracingOrigins;\n    }\n\n    this._collectWebVitals = startTrackingWebVitals();\n    if (this.options.enableLongTask) {\n      startTrackingLongTasks();\n    }\n    if (this.options._experiments.enableInteractions) {\n      startTrackingInteractions();\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    this._getCurrentHub = getCurrentHub;\n    const hub = getCurrentHub();\n    const client = hub.getClient();\n    const clientOptions = client && client.getOptions();\n\n    const {\n      routingInstrumentation: instrumentRouting,\n      startTransactionOnLocationChange,\n      startTransactionOnPageLoad,\n      markBackgroundTransactions,\n      traceFetch,\n      traceXHR,\n      shouldCreateSpanForRequest,\n      enableHTTPTimings,\n      _experiments,\n    } = this.options;\n\n    const clientOptionsTracePropagationTargets = clientOptions && clientOptions.tracePropagationTargets;\n    // There are three ways to configure tracePropagationTargets:\n    // 1. via top level client option `tracePropagationTargets`\n    // 2. via BrowserTracing option `tracePropagationTargets`\n    // 3. via BrowserTracing option `tracingOrigins` (deprecated)\n    //\n    // To avoid confusion, favour top level client option `tracePropagationTargets`, and fallback to\n    // BrowserTracing option `tracePropagationTargets` and then `tracingOrigins` (deprecated).\n    // This is done as it minimizes bundle size (we don't have to have undefined checks).\n    //\n    // If both 1 and either one of 2 or 3 are set (from above), we log out a warning.\n    // eslint-disable-next-line deprecation/deprecation\n    const tracePropagationTargets = clientOptionsTracePropagationTargets || this.options.tracePropagationTargets;\n    if (__DEBUG_BUILD__ && this._hasSetTracePropagationTargets && clientOptionsTracePropagationTargets) {\n      logger.warn(\n        '[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used.',\n      );\n    }\n\n    instrumentRouting(\n      (context: TransactionContext) => {\n        const transaction = this._createRouteTransaction(context);\n\n        this.options._experiments.onStartRouteTransaction &&\n          this.options._experiments.onStartRouteTransaction(transaction, context, getCurrentHub);\n\n        return transaction;\n      },\n      startTransactionOnPageLoad,\n      startTransactionOnLocationChange,\n    );\n\n    if (markBackgroundTransactions) {\n      registerBackgroundTabDetection();\n    }\n\n    if (_experiments.enableInteractions) {\n      this._registerInteractionListener();\n    }\n\n    instrumentOutgoingRequests({\n      traceFetch,\n      traceXHR,\n      tracePropagationTargets,\n      shouldCreateSpanForRequest,\n      enableHTTPTimings,\n    });\n  }\n\n  /** Create routing idle transaction. */\n  private _createRouteTransaction(context: TransactionContext): Transaction | undefined {\n    if (!this._getCurrentHub) {\n      __DEBUG_BUILD__ &&\n        logger.warn(`[Tracing] Did not create ${context.op} transaction because _getCurrentHub is invalid.`);\n      return undefined;\n    }\n\n    const hub = this._getCurrentHub();\n\n    const { beforeNavigate, idleTimeout, finalTimeout, heartbeatInterval } = this.options;\n\n    const isPageloadTransaction = context.op === 'pageload';\n\n    const sentryTrace = isPageloadTransaction ? getMetaContent('sentry-trace') : '';\n    const baggage = isPageloadTransaction ? getMetaContent('baggage') : '';\n    const { traceparentData, dynamicSamplingContext, propagationContext } = tracingContextFromHeaders(\n      sentryTrace,\n      baggage,\n    );\n\n    const expandedContext: TransactionContext = {\n      ...context,\n      ...traceparentData,\n      metadata: {\n        ...context.metadata,\n        dynamicSamplingContext: traceparentData && !dynamicSamplingContext ? {} : dynamicSamplingContext,\n      },\n      trimEnd: true,\n    };\n\n    const modifiedContext = typeof beforeNavigate === 'function' ? beforeNavigate(expandedContext) : expandedContext;\n\n    // For backwards compatibility reasons, beforeNavigate can return undefined to \"drop\" the transaction (prevent it\n    // from being sent to Sentry).\n    const finalContext = modifiedContext === undefined ? { ...expandedContext, sampled: false } : modifiedContext;\n\n    // If `beforeNavigate` set a custom name, record that fact\n    finalContext.metadata =\n      finalContext.name !== expandedContext.name\n        ? { ...finalContext.metadata, source: 'custom' }\n        : finalContext.metadata;\n\n    this._latestRouteName = finalContext.name;\n    this._latestRouteSource = finalContext.metadata && finalContext.metadata.source;\n\n    if (finalContext.sampled === false) {\n      __DEBUG_BUILD__ &&\n        logger.log(`[Tracing] Will not send ${finalContext.op} transaction because of beforeNavigate.`);\n    }\n\n    __DEBUG_BUILD__ && logger.log(`[Tracing] Starting ${finalContext.op} transaction on scope`);\n\n    const { location } = WINDOW;\n\n    const idleTransaction = startIdleTransaction(\n      hub,\n      finalContext,\n      idleTimeout,\n      finalTimeout,\n      true,\n      { location }, // for use in the tracesSampler\n      heartbeatInterval,\n    );\n\n    const scope = hub.getScope();\n\n    // If it's a pageload and there is a meta tag set\n    // use the traceparentData as the propagation context\n    if (isPageloadTransaction && traceparentData) {\n      scope.setPropagationContext(propagationContext);\n    } else {\n      // Navigation transactions should set a new propagation context based on the\n      // created idle transaction.\n      scope.setPropagationContext({\n        traceId: idleTransaction.traceId,\n        spanId: idleTransaction.spanId,\n        parentSpanId: idleTransaction.parentSpanId,\n        sampled: idleTransaction.sampled,\n      });\n    }\n\n    idleTransaction.registerBeforeFinishCallback(transaction => {\n      this._collectWebVitals();\n      addPerformanceEntries(transaction);\n    });\n\n    return idleTransaction as Transaction;\n  }\n\n  /** Start listener for interaction transactions */\n  private _registerInteractionListener(): void {\n    let inflightInteractionTransaction: IdleTransaction | undefined;\n    const registerInteractionTransaction = (): void => {\n      const { idleTimeout, finalTimeout, heartbeatInterval } = this.options;\n      const op = 'ui.action.click';\n\n      const currentTransaction = getActiveTransaction();\n      if (currentTransaction && currentTransaction.op && ['navigation', 'pageload'].includes(currentTransaction.op)) {\n        __DEBUG_BUILD__ &&\n          logger.warn(\n            `[Tracing] Did not create ${op} transaction because a pageload or navigation transaction is in progress.`,\n          );\n        return undefined;\n      }\n\n      if (inflightInteractionTransaction) {\n        inflightInteractionTransaction.setFinishReason('interactionInterrupted');\n        inflightInteractionTransaction.finish();\n        inflightInteractionTransaction = undefined;\n      }\n\n      if (!this._getCurrentHub) {\n        __DEBUG_BUILD__ && logger.warn(`[Tracing] Did not create ${op} transaction because _getCurrentHub is invalid.`);\n        return undefined;\n      }\n\n      if (!this._latestRouteName) {\n        __DEBUG_BUILD__ &&\n          logger.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`);\n        return undefined;\n      }\n\n      const hub = this._getCurrentHub();\n      const { location } = WINDOW;\n\n      const context: TransactionContext = {\n        name: this._latestRouteName,\n        op,\n        trimEnd: true,\n        metadata: {\n          source: this._latestRouteSource || 'url',\n        },\n      };\n\n      inflightInteractionTransaction = startIdleTransaction(\n        hub,\n        context,\n        idleTimeout,\n        finalTimeout,\n        true,\n        { location }, // for use in the tracesSampler\n        heartbeatInterval,\n      );\n    };\n\n    ['click'].forEach(type => {\n      addEventListener(type, registerInteractionTransaction, { once: false, capture: true });\n    });\n  }\n}\n\n/** Returns the value of a meta tag */\nexport function getMetaContent(metaName: string): string | undefined {\n  // Can't specify generic to `getDomElement` because tracing can be used\n  // in a variety of environments, have to disable `no-unsafe-member-access`\n  // as a result.\n  const metaTag = getDomElement(`meta[name=${metaName}]`);\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n  return metaTag ? metaTag.getAttribute('content') : undefined;\n}\n","import type { Transaction, TransactionContext } from '@sentry/types';\nimport { addInstrumentationHandler, browserPerformanceTimeOrigin, logger } from '@sentry/utils';\n\nimport { WINDOW } from './types';\n\n/**\n * Default function implementing pageload and navigation transactions\n */\nexport function instrumentRoutingWithDefaults<T extends Transaction>(\n  customStartTransaction: (context: TransactionContext) => T | undefined,\n  startTransactionOnPageLoad: boolean = true,\n  startTransactionOnLocationChange: boolean = true,\n): void {\n  if (!WINDOW || !WINDOW.location) {\n    __DEBUG_BUILD__ && logger.warn('Could not initialize routing instrumentation due to invalid location');\n    return;\n  }\n\n  let startingUrl: string | undefined = WINDOW.location.href;\n\n  let activeTransaction: T | undefined;\n  if (startTransactionOnPageLoad) {\n    activeTransaction = customStartTransaction({\n      name: WINDOW.location.pathname,\n      // pageload should always start at timeOrigin (and needs to be in s, not ms)\n      startTimestamp: browserPerformanceTimeOrigin ? browserPerformanceTimeOrigin / 1000 : undefined,\n      op: 'pageload',\n      origin: 'auto.pageload.browser',\n      metadata: { source: 'url' },\n    });\n  }\n\n  if (startTransactionOnLocationChange) {\n    addInstrumentationHandler('history', ({ to, from }: { to: string; from?: string }) => {\n      /**\n       * This early return is there to account for some cases where a navigation transaction starts right after\n       * long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't\n       * create an uneccessary navigation transaction.\n       *\n       * This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also\n       * only be caused in certain development environments where the usage of a hot module reloader is causing\n       * errors.\n       */\n      if (from === undefined && startingUrl && startingUrl.indexOf(to) !== -1) {\n        startingUrl = undefined;\n        return;\n      }\n\n      if (from !== to) {\n        startingUrl = undefined;\n        if (activeTransaction) {\n          __DEBUG_BUILD__ && logger.log(`[Tracing] Finishing current transaction with op: ${activeTransaction.op}`);\n          // If there's an open transaction on the scope, we need to finish it before creating an new one.\n          activeTransaction.finish();\n        }\n        activeTransaction = customStartTransaction({\n          name: WINDOW.location.pathname,\n          op: 'navigation',\n          origin: 'auto.navigation.browser',\n          metadata: { source: 'url' },\n        });\n      }\n    });\n  }\n}\n","import type { IdleTransaction, SpanStatusType } from '@sentry/core';\nimport { getActiveTransaction } from '@sentry/core';\nimport { logger } from '@sentry/utils';\n\nimport { WINDOW } from './types';\n\n/**\n * Add a listener that cancels and finishes a transaction when the global\n * document is hidden.\n */\nexport function registerBackgroundTabDetection(): void {\n  if (WINDOW && WINDOW.document) {\n    WINDOW.document.addEventListener('visibilitychange', () => {\n      const activeTransaction = getActiveTransaction() as IdleTransaction;\n      if (WINDOW.document.hidden && activeTransaction) {\n        const statusType: SpanStatusType = 'cancelled';\n\n        __DEBUG_BUILD__ &&\n          logger.log(\n            `[Tracing] Transaction: ${statusType} -> since tab moved to the background, op: ${activeTransaction.op}`,\n          );\n        // We should not set status if it is already set, this prevent important statuses like\n        // error or data loss from being overwritten on transaction.\n        if (!activeTransaction.status) {\n          activeTransaction.setStatus(statusType);\n        }\n        activeTransaction.setTag('visibilitychange', 'document.hidden');\n        activeTransaction.finish();\n      }\n    });\n  } else {\n    __DEBUG_BUILD__ &&\n      logger.warn('[Tracing] Could not set up background tab detection due to lack of global document');\n  }\n}\n","import type { Envelope, InternalBaseTransportOptions, Transport, TransportMakeRequestResponse } from '@sentry/types';\nimport { envelopeContainsItemType, logger, parseRetryAfterHeader } from '@sentry/utils';\n\nexport const MIN_DELAY = 100; // 100 ms\nexport const START_DELAY = 5_000; // 5 seconds\nconst MAX_DELAY = 3.6e6; // 1 hour\n\nfunction log(msg: string, error?: Error): void {\n  __DEBUG_BUILD__ && logger.info(`[Offline]: ${msg}`, error);\n}\n\nexport interface OfflineStore {\n  insert(env: Envelope): Promise<void>;\n  pop(): Promise<Envelope | undefined>;\n}\n\nexport type CreateOfflineStore = (options: OfflineTransportOptions) => OfflineStore;\n\nexport interface OfflineTransportOptions extends InternalBaseTransportOptions {\n  /**\n   * A function that creates the offline store instance.\n   */\n  createStore?: CreateOfflineStore;\n\n  /**\n   * Flush the offline store shortly after startup.\n   *\n   * Defaults: false\n   */\n  flushAtStartup?: boolean;\n\n  /**\n   * Called before an event is stored.\n   *\n   * Return false to drop the envelope rather than store it.\n   *\n   * @param envelope The envelope that failed to send.\n   * @param error The error that occurred.\n   * @param retryDelay The current retry delay in milliseconds.\n   */\n  shouldStore?: (envelope: Envelope, error: Error, retryDelay: number) => boolean | Promise<boolean>;\n}\n\ntype Timer = number | { unref?: () => void };\n\n/**\n * Wraps a transport and stores and retries events when they fail to send.\n *\n * @param createTransport The transport to wrap.\n */\nexport function makeOfflineTransport<TO>(\n  createTransport: (options: TO) => Transport,\n): (options: TO & OfflineTransportOptions) => Transport {\n  return options => {\n    const transport = createTransport(options);\n    const store = options.createStore ? options.createStore(options) : undefined;\n\n    let retryDelay = START_DELAY;\n    let flushTimer: Timer | undefined;\n\n    function shouldQueue(env: Envelope, error: Error, retryDelay: number): boolean | Promise<boolean> {\n      // We don't queue Session Replay envelopes because they are:\n      // - Ordered and Replay relies on the response status to know when they're successfully sent.\n      // - Likely to fill the queue quickly and block other events from being sent.\n      // We also want to drop client reports because they can be generated when we retry sending events while offline.\n      if (envelopeContainsItemType(env, ['replay_event', 'replay_recording', 'client_report'])) {\n        return false;\n      }\n\n      if (options.shouldStore) {\n        return options.shouldStore(env, error, retryDelay);\n      }\n\n      return true;\n    }\n\n    function flushIn(delay: number): void {\n      if (!store) {\n        return;\n      }\n\n      if (flushTimer) {\n        clearTimeout(flushTimer as ReturnType<typeof setTimeout>);\n      }\n\n      flushTimer = setTimeout(async () => {\n        flushTimer = undefined;\n\n        const found = await store.pop();\n        if (found) {\n          log('Attempting to send previously queued event');\n          void send(found).catch(e => {\n            log('Failed to retry sending', e);\n          });\n        }\n      }, delay) as Timer;\n\n      // We need to unref the timer in node.js, otherwise the node process never exit.\n      if (typeof flushTimer !== 'number' && flushTimer.unref) {\n        flushTimer.unref();\n      }\n    }\n\n    function flushWithBackOff(): void {\n      if (flushTimer) {\n        return;\n      }\n\n      flushIn(retryDelay);\n\n      retryDelay = Math.min(retryDelay * 2, MAX_DELAY);\n    }\n\n    async function send(envelope: Envelope): Promise<void | TransportMakeRequestResponse> {\n      try {\n        const result = await transport.send(envelope);\n\n        let delay = MIN_DELAY;\n\n        if (result) {\n          // If there's a retry-after header, use that as the next delay.\n          if (result.headers && result.headers['retry-after']) {\n            delay = parseRetryAfterHeader(result.headers['retry-after']);\n          } // If we have a server error, return now so we don't flush the queue.\n          else if ((result.statusCode || 0) >= 400) {\n            return result;\n          }\n        }\n\n        flushIn(delay);\n        retryDelay = START_DELAY;\n        return result;\n      } catch (e) {\n        if (store && (await shouldQueue(envelope, e as Error, retryDelay))) {\n          await store.insert(envelope);\n          flushWithBackOff();\n          log('Error sending. Event queued', e as Error);\n          return {};\n        } else {\n          throw e;\n        }\n      }\n    }\n\n    if (options.flushAtStartup) {\n      flushWithBackOff();\n    }\n\n    return {\n      send,\n      flush: t => transport.flush(t),\n    };\n  };\n}\n","import type { OfflineStore, OfflineTransportOptions } from '@sentry/core';\nimport { makeOfflineTransport } from '@sentry/core';\nimport type { Envelope, InternalBaseTransportOptions, Transport } from '@sentry/types';\nimport type { TextDecoderInternal } from '@sentry/utils';\nimport { parseEnvelope, serializeEnvelope } from '@sentry/utils';\n\n// 'Store', 'promisifyRequest' and 'createStore' were originally copied from the 'idb-keyval' package before being\n// modified and simplified: https://github.com/jakearchibald/idb-keyval\n//\n// At commit: 0420a704fd6cbb4225429c536b1f61112d012fca\n// Original licence:\n\n// Copyright 2016, Jake Archibald\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//   http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\ntype Store = <T>(callback: (store: IDBObjectStore) => T | PromiseLike<T>) => Promise<T>;\n\nfunction promisifyRequest<T = undefined>(request: IDBRequest<T> | IDBTransaction): Promise<T> {\n  return new Promise<T>((resolve, reject) => {\n    // @ts-expect-error - file size hacks\n    request.oncomplete = request.onsuccess = () => resolve(request.result);\n    // @ts-expect-error - file size hacks\n    request.onabort = request.onerror = () => reject(request.error);\n  });\n}\n\n/** Create or open an IndexedDb store */\nexport function createStore(dbName: string, storeName: string): Store {\n  const request = indexedDB.open(dbName);\n  request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n  const dbp = promisifyRequest(request);\n\n  return callback => dbp.then(db => callback(db.transaction(storeName, 'readwrite').objectStore(storeName)));\n}\n\nfunction keys(store: IDBObjectStore): Promise<number[]> {\n  return promisifyRequest(store.getAllKeys() as IDBRequest<number[]>);\n}\n\n/** Insert into the store */\nexport function insert(store: Store, value: Uint8Array | string, maxQueueSize: number): Promise<void> {\n  return store(store => {\n    return keys(store).then(keys => {\n      if (keys.length >= maxQueueSize) {\n        return;\n      }\n\n      // We insert with an incremented key so that the entries are popped in order\n      store.put(value, Math.max(...keys, 0) + 1);\n      return promisifyRequest(store.transaction);\n    });\n  });\n}\n\n/** Pop the oldest value from the store */\nexport function pop(store: Store): Promise<Uint8Array | string | undefined> {\n  return store(store => {\n    return keys(store).then(keys => {\n      if (keys.length === 0) {\n        return undefined;\n      }\n\n      return promisifyRequest(store.get(keys[0])).then(value => {\n        store.delete(keys[0]);\n        return promisifyRequest(store.transaction).then(() => value);\n      });\n    });\n  });\n}\n\nexport interface BrowserOfflineTransportOptions extends OfflineTransportOptions {\n  /**\n   * Name of indexedDb database to store envelopes in\n   * Default: 'sentry-offline'\n   */\n  dbName?: string;\n  /**\n   * Name of indexedDb object store to store envelopes in\n   * Default: 'queue'\n   */\n  storeName?: string;\n  /**\n   * Maximum number of envelopes to store\n   * Default: 30\n   */\n  maxQueueSize?: number;\n  /**\n   * Only required for testing on node.js\n   * @ignore\n   */\n  textDecoder?: TextDecoderInternal;\n}\n\nfunction createIndexedDbStore(options: BrowserOfflineTransportOptions): OfflineStore {\n  let store: Store | undefined;\n\n  // Lazily create the store only when it's needed\n  function getStore(): Store {\n    if (store == undefined) {\n      store = createStore(options.dbName || 'sentry-offline', options.storeName || 'queue');\n    }\n\n    return store;\n  }\n\n  return {\n    insert: async (env: Envelope) => {\n      try {\n        const serialized = await serializeEnvelope(env, options.textEncoder);\n        await insert(getStore(), serialized, options.maxQueueSize || 30);\n      } catch (_) {\n        //\n      }\n    },\n    pop: async () => {\n      try {\n        const deserialized = await pop(getStore());\n        if (deserialized) {\n          return parseEnvelope(\n            deserialized,\n            options.textEncoder || new TextEncoder(),\n            options.textDecoder || new TextDecoder(),\n          );\n        }\n      } catch (_) {\n        //\n      }\n\n      return undefined;\n    },\n  };\n}\n\nfunction makeIndexedDbOfflineTransport<T>(\n  createTransport: (options: T) => Transport,\n): (options: T & BrowserOfflineTransportOptions) => Transport {\n  return options => createTransport({ ...options, createStore: createIndexedDbStore });\n}\n\n/**\n * Creates a transport that uses IndexedDb to store events when offline.\n */\nexport function makeBrowserOfflineTransport<T extends InternalBaseTransportOptions>(\n  createTransport: (options: T) => Transport,\n): (options: T & BrowserOfflineTransportOptions) => Transport {\n  return makeIndexedDbOfflineTransport<T>(makeOfflineTransport(createTransport));\n}\n","/* eslint-disable max-lines */\n\nimport { DEFAULT_ENVIRONMENT, getCurrentHub } from '@sentry/core';\nimport type { DebugImage, Envelope, Event, StackFrame, StackParser } from '@sentry/types';\nimport type { Profile, ThreadCpuProfile } from '@sentry/types/src/profiling';\nimport { browserPerformanceTimeOrigin, forEachEnvelopeItem, GLOBAL_OBJ, logger, uuid4 } from '@sentry/utils';\n\nimport { WINDOW } from '../helpers';\nimport type { JSSelfProfile, JSSelfProfileStack } from './jsSelfProfiling';\n\nconst MS_TO_NS = 1e6;\n// Use 0 as main thread id which is identical to threadId in node:worker_threads\n// where main logs 0 and workers seem to log in increments of 1\nconst THREAD_ID_STRING = String(0);\nconst THREAD_NAME = 'main';\n\n// Machine properties (eval only once)\nlet OS_PLATFORM = '';\nlet OS_PLATFORM_VERSION = '';\nlet OS_ARCH = '';\nlet OS_BROWSER = (WINDOW.navigator && WINDOW.navigator.userAgent) || '';\nlet OS_MODEL = '';\nconst OS_LOCALE =\n  (WINDOW.navigator && WINDOW.navigator.language) ||\n  (WINDOW.navigator && WINDOW.navigator.languages && WINDOW.navigator.languages[0]) ||\n  '';\n\ntype UAData = {\n  platform?: string;\n  architecture?: string;\n  model?: string;\n  platformVersion?: string;\n  fullVersionList?: {\n    brand: string;\n    version: string;\n  }[];\n};\n\ninterface UserAgentData {\n  getHighEntropyValues: (keys: string[]) => Promise<UAData>;\n}\n\nfunction isUserAgentData(data: unknown): data is UserAgentData {\n  return typeof data === 'object' && data !== null && 'getHighEntropyValues' in data;\n}\n\n// @ts-expect-error userAgentData is not part of the navigator interface yet\nconst userAgentData = WINDOW.navigator && WINDOW.navigator.userAgentData;\n\nif (isUserAgentData(userAgentData)) {\n  userAgentData\n    .getHighEntropyValues(['architecture', 'model', 'platform', 'platformVersion', 'fullVersionList'])\n    .then((ua: UAData) => {\n      OS_PLATFORM = ua.platform || '';\n      OS_ARCH = ua.architecture || '';\n      OS_MODEL = ua.model || '';\n      OS_PLATFORM_VERSION = ua.platformVersion || '';\n\n      if (ua.fullVersionList && ua.fullVersionList.length > 0) {\n        const firstUa = ua.fullVersionList[ua.fullVersionList.length - 1];\n        OS_BROWSER = `${firstUa.brand} ${firstUa.version}`;\n      }\n    })\n    .catch(e => void e);\n}\n\nfunction isProcessedJSSelfProfile(profile: ThreadCpuProfile | JSSelfProfile): profile is JSSelfProfile {\n  return !('thread_metadata' in profile);\n}\n\n// Enriches the profile with threadId of the current thread.\n// This is done in node as we seem to not be able to get the info from C native code.\n/**\n *\n */\nexport function enrichWithThreadInformation(profile: ThreadCpuProfile | JSSelfProfile): ThreadCpuProfile {\n  if (!isProcessedJSSelfProfile(profile)) {\n    return profile;\n  }\n\n  return convertJSSelfProfileToSampledFormat(profile);\n}\n\n// Profile is marked as optional because it is deleted from the metadata\n// by the integration before the event is processed by other integrations.\nexport interface ProfiledEvent extends Event {\n  sdkProcessingMetadata: {\n    profile?: JSSelfProfile;\n  };\n}\n\nfunction getTraceId(event: Event): string {\n  const traceId: unknown = event && event.contexts && event.contexts['trace'] && event.contexts['trace']['trace_id'];\n  // Log a warning if the profile has an invalid traceId (should be uuidv4).\n  // All profiles and transactions are rejected if this is the case and we want to\n  // warn users that this is happening if they enable debug flag\n  if (typeof traceId === 'string' && traceId.length !== 32) {\n    if (__DEBUG_BUILD__) {\n      logger.log(`[Profiling] Invalid traceId: ${traceId} on profiled event`);\n    }\n  }\n  if (typeof traceId !== 'string') {\n    return '';\n  }\n\n  return traceId;\n}\n/**\n * Creates a profiling event envelope from a Sentry event. If profile does not pass\n * validation, returns null.\n * @param event\n * @param dsn\n * @param metadata\n * @param tunnel\n * @returns {EventEnvelope | null}\n */\n\n/**\n * Creates a profiling event envelope from a Sentry event.\n */\nexport function createProfilePayload(\n  event: ProfiledEvent,\n  processedProfile: JSSelfProfile,\n  profile_id: string,\n): Profile {\n  if (event.type !== 'transaction') {\n    // createProfilingEventEnvelope should only be called for transactions,\n    // we type guard this behavior with isProfiledTransactionEvent.\n    throw new TypeError('Profiling events may only be attached to transactions, this should never occur.');\n  }\n\n  if (processedProfile === undefined || processedProfile === null) {\n    throw new TypeError(\n      `Cannot construct profiling event envelope without a valid profile. Got ${processedProfile} instead.`,\n    );\n  }\n\n  const traceId = getTraceId(event);\n  const enrichedThreadProfile = enrichWithThreadInformation(processedProfile);\n  const transactionStartMs = typeof event.start_timestamp === 'number' ? event.start_timestamp * 1000 : Date.now();\n  const transactionEndMs = typeof event.timestamp === 'number' ? event.timestamp * 1000 : Date.now();\n\n  const profile: Profile = {\n    event_id: profile_id,\n    timestamp: new Date(transactionStartMs).toISOString(),\n    platform: 'javascript',\n    version: '1',\n    release: event.release || '',\n    environment: event.environment || DEFAULT_ENVIRONMENT,\n    runtime: {\n      name: 'javascript',\n      version: WINDOW.navigator.userAgent,\n    },\n    os: {\n      name: OS_PLATFORM,\n      version: OS_PLATFORM_VERSION,\n      build_number: OS_BROWSER,\n    },\n    device: {\n      locale: OS_LOCALE,\n      model: OS_MODEL,\n      manufacturer: OS_BROWSER,\n      architecture: OS_ARCH,\n      is_emulator: false,\n    },\n    debug_meta: {\n      images: applyDebugMetadata(processedProfile.resources),\n    },\n    profile: enrichedThreadProfile,\n    transactions: [\n      {\n        name: event.transaction || '',\n        id: event.event_id || uuid4(),\n        trace_id: traceId,\n        active_thread_id: THREAD_ID_STRING,\n        relative_start_ns: '0',\n        relative_end_ns: ((transactionEndMs - transactionStartMs) * 1e6).toFixed(0),\n      },\n    ],\n  };\n\n  return profile;\n}\n\n/**\n *\n */\nexport function isProfiledTransactionEvent(event: Event): event is ProfiledEvent {\n  return !!(event.sdkProcessingMetadata && event.sdkProcessingMetadata['profile']);\n}\n\n/**\n * Converts a JSSelfProfile to a our sampled format.\n * Does not currently perform stack indexing.\n */\nexport function convertJSSelfProfileToSampledFormat(input: JSSelfProfile): Profile['profile'] {\n  let EMPTY_STACK_ID: undefined | number = undefined;\n  let STACK_ID = 0;\n\n  // Initialize the profile that we will fill with data\n  const profile: Profile['profile'] = {\n    samples: [],\n    stacks: [],\n    frames: [],\n    thread_metadata: {\n      [THREAD_ID_STRING]: { name: THREAD_NAME },\n    },\n  };\n\n  if (!input.samples.length) {\n    return profile;\n  }\n\n  // We assert samples.length > 0 above and timestamp should always be present\n  const start = input.samples[0].timestamp;\n  // The JS SDK might change it's time origin based on some heuristic (see See packages/utils/src/time.ts)\n  // when that happens, we need to ensure we are correcting the profile timings so the two timelines stay in sync.\n  // Since JS self profiling time origin is always initialized to performance.timeOrigin, we need to adjust for\n  // the drift between the SDK selected value and our profile time origin.\n  const origin =\n    typeof performance.timeOrigin === 'number' ? performance.timeOrigin : browserPerformanceTimeOrigin || 0;\n  const adjustForOriginChange = origin - (browserPerformanceTimeOrigin || origin);\n\n  for (let i = 0; i < input.samples.length; i++) {\n    const jsSample = input.samples[i];\n\n    // If sample has no stack, add an empty sample\n    if (jsSample.stackId === undefined) {\n      if (EMPTY_STACK_ID === undefined) {\n        EMPTY_STACK_ID = STACK_ID;\n        profile.stacks[EMPTY_STACK_ID] = [];\n        STACK_ID++;\n      }\n\n      profile['samples'][i] = {\n        // convert ms timestamp to ns\n        elapsed_since_start_ns: ((jsSample.timestamp + adjustForOriginChange - start) * MS_TO_NS).toFixed(0),\n        stack_id: EMPTY_STACK_ID,\n        thread_id: THREAD_ID_STRING,\n      };\n      continue;\n    }\n\n    let stackTop: JSSelfProfileStack | undefined = input.stacks[jsSample.stackId];\n\n    // Functions in top->down order (root is last)\n    // We follow the stackTop.parentId trail and collect each visited frameId\n    const stack: number[] = [];\n\n    while (stackTop) {\n      stack.push(stackTop.frameId);\n\n      const frame = input.frames[stackTop.frameId];\n\n      // If our frame has not been indexed yet, index it\n      if (profile.frames[stackTop.frameId] === undefined) {\n        profile.frames[stackTop.frameId] = {\n          function: frame.name,\n          abs_path: typeof frame.resourceId === 'number' ? input.resources[frame.resourceId] : undefined,\n          lineno: frame.line,\n          colno: frame.column,\n        };\n      }\n\n      stackTop = stackTop.parentId === undefined ? undefined : input.stacks[stackTop.parentId];\n    }\n\n    const sample: Profile['profile']['samples'][0] = {\n      // convert ms timestamp to ns\n      elapsed_since_start_ns: ((jsSample.timestamp + adjustForOriginChange - start) * MS_TO_NS).toFixed(0),\n      stack_id: STACK_ID,\n      thread_id: THREAD_ID_STRING,\n    };\n\n    profile['stacks'][STACK_ID] = stack;\n    profile['samples'][i] = sample;\n    STACK_ID++;\n  }\n\n  return profile;\n}\n\n/**\n * Adds items to envelope if they are not already present - mutates the envelope.\n * @param envelope\n */\nexport function addProfilesToEnvelope(envelope: Envelope, profiles: Profile[]): Envelope {\n  if (!profiles.length) {\n    return envelope;\n  }\n\n  for (const profile of profiles) {\n    // @ts-expect-error untyped envelope\n    envelope[1].push([{ type: 'profile' }, profile]);\n  }\n  return envelope;\n}\n\n/**\n * Finds transactions with profile_id context in the envelope\n * @param envelope\n * @returns\n */\nexport function findProfiledTransactionsFromEnvelope(envelope: Envelope): Event[] {\n  const events: Event[] = [];\n\n  forEachEnvelopeItem(envelope, (item, type) => {\n    if (type !== 'transaction') {\n      return;\n    }\n\n    for (let j = 1; j < item.length; j++) {\n      const event = item[j] as Event;\n\n      if (event && event.contexts && event.contexts['profile'] && event.contexts['profile']['profile_id']) {\n        events.push(item[j] as Event);\n      }\n    }\n  });\n\n  return events;\n}\n\nconst debugIdStackParserCache = new WeakMap<StackParser, Map<string, StackFrame[]>>();\n/**\n * Applies debug meta data to an event from a list of paths to resources (sourcemaps)\n */\nexport function applyDebugMetadata(resource_paths: ReadonlyArray<string>): DebugImage[] {\n  const debugIdMap = GLOBAL_OBJ._sentryDebugIds;\n\n  if (!debugIdMap) {\n    return [];\n  }\n\n  const hub = getCurrentHub();\n  if (!hub) {\n    return [];\n  }\n  const client = hub.getClient();\n  if (!client) {\n    return [];\n  }\n  const options = client.getOptions();\n  if (!options) {\n    return [];\n  }\n  const stackParser = options.stackParser;\n  if (!stackParser) {\n    return [];\n  }\n\n  let debugIdStackFramesCache: Map<string, StackFrame[]>;\n  const cachedDebugIdStackFrameCache = debugIdStackParserCache.get(stackParser);\n  if (cachedDebugIdStackFrameCache) {\n    debugIdStackFramesCache = cachedDebugIdStackFrameCache;\n  } else {\n    debugIdStackFramesCache = new Map<string, StackFrame[]>();\n    debugIdStackParserCache.set(stackParser, debugIdStackFramesCache);\n  }\n\n  // Build a map of filename -> debug_id\n  const filenameDebugIdMap = Object.keys(debugIdMap).reduce<Record<string, string>>((acc, debugIdStackTrace) => {\n    let parsedStack: StackFrame[];\n\n    const cachedParsedStack = debugIdStackFramesCache.get(debugIdStackTrace);\n    if (cachedParsedStack) {\n      parsedStack = cachedParsedStack;\n    } else {\n      parsedStack = stackParser(debugIdStackTrace);\n      debugIdStackFramesCache.set(debugIdStackTrace, parsedStack);\n    }\n\n    for (let i = parsedStack.length - 1; i >= 0; i--) {\n      const stackFrame = parsedStack[i];\n      const file = stackFrame && stackFrame.filename;\n\n      if (stackFrame && file) {\n        acc[file] = debugIdMap[debugIdStackTrace] as string;\n        break;\n      }\n    }\n    return acc;\n  }, {});\n\n  const images: DebugImage[] = [];\n  for (const path of resource_paths) {\n    if (path && filenameDebugIdMap[path]) {\n      images.push({\n        type: 'sourcemap',\n        code_file: path,\n        debug_id: filenameDebugIdMap[path] as string,\n      });\n    }\n  }\n\n  return images;\n}\n\n/**\n * Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1).\n */\nexport function isValidSampleRate(rate: unknown): boolean {\n  // we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck\n  if ((typeof rate !== 'number' && typeof rate !== 'boolean') || (typeof rate === 'number' && isNaN(rate))) {\n    __DEBUG_BUILD__ &&\n      logger.warn(\n        `[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(\n          rate,\n        )} of type ${JSON.stringify(typeof rate)}.`,\n      );\n    return false;\n  }\n\n  // Boolean sample rates are always valid\n  if (rate === true || rate === false) {\n    return true;\n  }\n\n  // in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false\n  if (rate < 0 || rate > 1) {\n    __DEBUG_BUILD__ &&\n      logger.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${rate}.`);\n    return false;\n  }\n  return true;\n}\n\nfunction isValidProfile(profile: JSSelfProfile): profile is JSSelfProfile & { profile_id: string } {\n  if (profile.samples.length < 2) {\n    if (__DEBUG_BUILD__) {\n      // Log a warning if the profile has less than 2 samples so users can know why\n      // they are not seeing any profiling data and we cant avoid the back and forth\n      // of asking them to provide us with a dump of the profile data.\n      logger.log('[Profiling] Discarding profile because it contains less than 2 samples');\n    }\n    return false;\n  }\n\n  if (!profile.frames.length) {\n    if (__DEBUG_BUILD__) {\n      logger.log('[Profiling] Discarding profile because it contains no frames');\n    }\n    return false;\n  }\n\n  return true;\n}\n\n/**\n * Creates a profiling envelope item, if the profile does not pass validation, returns null.\n * @param event\n * @returns {Profile | null}\n */\nexport function createProfilingEvent(profile_id: string, profile: JSSelfProfile, event: ProfiledEvent): Profile | null {\n  if (!isValidProfile(profile)) {\n    return null;\n  }\n\n  return createProfilePayload(event, profile, profile_id);\n}\n\nexport const PROFILE_MAP: Map<string, JSSelfProfile> = new Map();\n/**\n *\n */\nexport function addProfileToMap(profile_id: string, profile: JSSelfProfile): void {\n  PROFILE_MAP.set(profile_id, profile);\n\n  if (PROFILE_MAP.size > 30) {\n    const last: string = PROFILE_MAP.keys().next().value;\n    PROFILE_MAP.delete(last);\n  }\n}\n","/* eslint-disable complexity */\nimport { getCurrentHub } from '@sentry/core';\nimport type { Transaction } from '@sentry/types';\nimport { logger, uuid4 } from '@sentry/utils';\n\nimport { WINDOW } from '../helpers';\nimport type { JSSelfProfile, JSSelfProfiler, JSSelfProfilerConstructor } from './jsSelfProfiling';\nimport { addProfileToMap, isValidSampleRate } from './utils';\n\nexport const MAX_PROFILE_DURATION_MS = 30_000;\n// Keep a flag value to avoid re-initializing the profiler constructor. If it fails\n// once, it will always fail and this allows us to early return.\nlet PROFILING_CONSTRUCTOR_FAILED = false;\n\n/**\n * Check if profiler constructor is available.\n * @param maybeProfiler\n */\nfunction isJSProfilerSupported(maybeProfiler: unknown): maybeProfiler is typeof JSSelfProfilerConstructor {\n  return typeof maybeProfiler === 'function';\n}\n\n/**\n * Safety wrapper for startTransaction for the unlikely case that transaction starts before tracing is imported -\n * if that happens we want to avoid throwing an error from profiling code.\n * see https://github.com/getsentry/sentry-javascript/issues/4731.\n *\n * @experimental\n */\nexport function onProfilingStartRouteTransaction(transaction: Transaction | undefined): Transaction | undefined {\n  if (!transaction) {\n    if (__DEBUG_BUILD__) {\n      logger.log('[Profiling] Transaction is undefined, skipping profiling');\n    }\n    return transaction;\n  }\n\n  return wrapTransactionWithProfiling(transaction);\n}\n\n/**\n * Wraps startTransaction and stopTransaction with profiling related logic.\n * startProfiling is called after the call to startTransaction in order to avoid our own code from\n * being profiled. Because of that same reason, stopProfiling is called before the call to stopTransaction.\n */\nexport function wrapTransactionWithProfiling(transaction: Transaction): Transaction {\n  // Feature support check first\n  const JSProfilerConstructor = WINDOW.Profiler;\n\n  if (!isJSProfilerSupported(JSProfilerConstructor)) {\n    if (__DEBUG_BUILD__) {\n      logger.log(\n        '[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.',\n      );\n    }\n    return transaction;\n  }\n\n  // If constructor failed once, it will always fail, so we can early return.\n  if (PROFILING_CONSTRUCTOR_FAILED) {\n    if (__DEBUG_BUILD__) {\n      logger.log('[Profiling] Profiling has been disabled for the duration of the current user session.');\n    }\n    return transaction;\n  }\n\n  const client = getCurrentHub().getClient();\n  const options = client && client.getOptions();\n  if (!options) {\n    __DEBUG_BUILD__ && logger.log('[Profiling] Profiling disabled, no options found.');\n    return transaction;\n  }\n\n  // @ts-expect-error profilesSampleRate is not part of the browser options yet\n  const profilesSampleRate: number | boolean | undefined = options.profilesSampleRate;\n\n  // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The\n  // only valid values are booleans or numbers between 0 and 1.)\n  if (!isValidSampleRate(profilesSampleRate)) {\n    __DEBUG_BUILD__ && logger.warn('[Profiling] Discarding profile because of invalid sample rate.');\n    return transaction;\n  }\n\n  // if the function returned 0 (or false), or if `profileSampleRate` is 0, it's a sign the profile should be dropped\n  if (!profilesSampleRate) {\n    __DEBUG_BUILD__ &&\n      logger.log(\n        '[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0',\n      );\n    return transaction;\n  }\n\n  // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is\n  // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false.\n  const sampled = profilesSampleRate === true ? true : Math.random() < profilesSampleRate;\n  // Check if we should sample this profile\n  if (!sampled) {\n    __DEBUG_BUILD__ &&\n      logger.log(\n        `[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(\n          profilesSampleRate,\n        )})`,\n      );\n    return transaction;\n  }\n\n  // From initial testing, it seems that the minimum value for sampleInterval is 10ms.\n  const samplingIntervalMS = 10;\n  // Start the profiler\n  const maxSamples = Math.floor(MAX_PROFILE_DURATION_MS / samplingIntervalMS);\n  let profiler: JSSelfProfiler | undefined;\n\n  // Attempt to initialize the profiler constructor, if it fails, we disable profiling for the current user session.\n  // This is likely due to a missing 'Document-Policy': 'js-profiling' header. We do not want to throw an error if this happens\n  // as we risk breaking the user's application, so just disable profiling and log an error.\n  try {\n    profiler = new JSProfilerConstructor({ sampleInterval: samplingIntervalMS, maxBufferSize: maxSamples });\n  } catch (e) {\n    if (__DEBUG_BUILD__) {\n      logger.log(\n        \"[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header.\",\n      );\n      logger.log('[Profiling] Disabling profiling for current user session.');\n    }\n    PROFILING_CONSTRUCTOR_FAILED = true;\n  }\n\n  // We failed to construct the profiler, fallback to original transaction - there is no need to log\n  // anything as we already did that in the try/catch block.\n  if (!profiler) {\n    return transaction;\n  }\n\n  if (__DEBUG_BUILD__) {\n    logger.log(`[Profiling] started profiling transaction: ${transaction.name || transaction.description}`);\n  }\n\n  // We create \"unique\" transaction names to avoid concurrent transactions with same names\n  // from being ignored by the profiler. From here on, only this transaction name should be used when\n  // calling the profiler methods. Note: we log the original name to the user to avoid confusion.\n  const profileId = uuid4();\n\n  // A couple of important things to note here:\n  // `CpuProfilerBindings.stopProfiling` will be scheduled to run in 30seconds in order to exceed max profile duration.\n  // Whichever of the two (transaction.finish/timeout) is first to run, the profiling will be stopped and the gathered profile\n  // will be processed when the original transaction is finished. Since onProfileHandler can be invoked multiple times in the\n  // event of an error or user mistake (calling transaction.finish multiple times), it is important that the behavior of onProfileHandler\n  // is idempotent as we do not want any timings or profiles to be overriden by the last call to onProfileHandler.\n  // After the original finish method is called, the event will be reported through the integration and delegated to transport.\n  const processedProfile: JSSelfProfile | null = null;\n\n  /**\n   * Idempotent handler for profile stop\n   */\n  async function onProfileHandler(): Promise<null> {\n    // Check if the profile exists and return it the behavior has to be idempotent as users may call transaction.finish multiple times.\n    if (!transaction) {\n      return null;\n    }\n    // Satisfy the type checker, but profiler will always be defined here.\n    if (!profiler) {\n      return null;\n    }\n    if (processedProfile) {\n      if (__DEBUG_BUILD__) {\n        logger.log(\n          '[Profiling] profile for:',\n          transaction.name || transaction.description,\n          'already exists, returning early',\n        );\n      }\n      return null;\n    }\n\n    // This is temporary - we will use the collected span data to evaluate\n    // if deferring txn.finish until profiler resolves is a viable approach.\n    const stopProfilerSpan = transaction.startChild({\n      description: 'profiler.stop',\n      op: 'profiler',\n      origin: 'auto.profiler.browser',\n    });\n\n    return profiler\n      .stop()\n      .then((p: JSSelfProfile): null => {\n        stopProfilerSpan.finish();\n\n        if (maxDurationTimeoutID) {\n          WINDOW.clearTimeout(maxDurationTimeoutID);\n          maxDurationTimeoutID = undefined;\n        }\n\n        if (__DEBUG_BUILD__) {\n          logger.log(`[Profiling] stopped profiling of transaction: ${transaction.name || transaction.description}`);\n        }\n\n        // In case of an overlapping transaction, stopProfiling may return null and silently ignore the overlapping profile.\n        if (!p) {\n          if (__DEBUG_BUILD__) {\n            logger.log(\n              `[Profiling] profiler returned null profile for: ${transaction.name || transaction.description}`,\n              'this may indicate an overlapping transaction or a call to stopProfiling with a profile title that was never started',\n            );\n          }\n          return null;\n        }\n\n        addProfileToMap(profileId, p);\n        return null;\n      })\n      .catch(error => {\n        stopProfilerSpan.finish();\n        if (__DEBUG_BUILD__) {\n          logger.log('[Profiling] error while stopping profiler:', error);\n        }\n        return null;\n      });\n  }\n\n  // Enqueue a timeout to prevent profiles from running over max duration.\n  let maxDurationTimeoutID: number | undefined = WINDOW.setTimeout(() => {\n    if (__DEBUG_BUILD__) {\n      logger.log(\n        '[Profiling] max profile duration elapsed, stopping profiling for:',\n        transaction.name || transaction.description,\n      );\n    }\n    // If the timeout exceeds, we want to stop profiling, but not finish the transaction\n    void onProfileHandler();\n  }, MAX_PROFILE_DURATION_MS);\n\n  // We need to reference the original finish call to avoid creating an infinite loop\n  const originalFinish = transaction.finish.bind(transaction);\n\n  /**\n   * Wraps startTransaction and stopTransaction with profiling related logic.\n   * startProfiling is called after the call to startTransaction in order to avoid our own code from\n   * being profiled. Because of that same reason, stopProfiling is called before the call to stopTransaction.\n   */\n  function profilingWrappedTransactionFinish(): Transaction {\n    if (!transaction) {\n      return originalFinish();\n    }\n    // onProfileHandler should always return the same profile even if this is called multiple times.\n    // Always call onProfileHandler to ensure stopProfiling is called and the timeout is cleared.\n    void onProfileHandler().then(\n      () => {\n        transaction.setContext('profile', { profile_id: profileId });\n        originalFinish();\n      },\n      () => {\n        // If onProfileHandler fails, we still want to call the original finish method.\n        originalFinish();\n      },\n    );\n\n    return transaction;\n  }\n\n  transaction.finish = profilingWrappedTransactionFinish;\n  return transaction;\n}\n","import type { EventProcessor, Hub, Integration, Transaction } from '@sentry/types';\nimport type { Profile } from '@sentry/types/src/profiling';\nimport { logger } from '@sentry/utils';\n\nimport type { BrowserClient } from './../client';\nimport { wrapTransactionWithProfiling } from './hubextensions';\nimport type { ProfiledEvent } from './utils';\nimport {\n  addProfilesToEnvelope,\n  createProfilingEvent,\n  findProfiledTransactionsFromEnvelope,\n  PROFILE_MAP,\n} from './utils';\n\n/**\n * Browser profiling integration. Stores any event that has contexts[\"profile\"][\"profile_id\"]\n * This exists because we do not want to await async profiler.stop calls as transaction.finish is called\n * in a synchronous context. Instead, we handle sending the profile async from the promise callback and\n * rely on being able to pull the event from the cache when we need to construct the envelope. This makes the\n * integration less reliable as we might be dropping profiles when the cache is full.\n *\n * @experimental\n */\nexport class BrowserProfilingIntegration implements Integration {\n  public static id: string = 'BrowserProfilingIntegration';\n\n  public readonly name: string;\n\n  public getCurrentHub?: () => Hub;\n\n  public constructor() {\n    this.name = BrowserProfilingIntegration.id;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    this.getCurrentHub = getCurrentHub;\n    const client = this.getCurrentHub().getClient() as BrowserClient;\n\n    if (client && typeof client.on === 'function') {\n      client.on('startTransaction', (transaction: Transaction) => {\n        wrapTransactionWithProfiling(transaction);\n      });\n\n      client.on('beforeEnvelope', (envelope): void => {\n        // if not profiles are in queue, there is nothing to add to the envelope.\n        if (!PROFILE_MAP['size']) {\n          return;\n        }\n\n        const profiledTransactionEvents = findProfiledTransactionsFromEnvelope(envelope);\n        if (!profiledTransactionEvents.length) {\n          return;\n        }\n\n        const profilesToAddToEnvelope: Profile[] = [];\n\n        for (const profiledTransaction of profiledTransactionEvents) {\n          const context = profiledTransaction && profiledTransaction.contexts;\n          const profile_id = context && context['profile'] && (context['profile']['profile_id'] as string);\n\n          if (!profile_id) {\n            __DEBUG_BUILD__ &&\n              logger.log('[Profiling] cannot find profile for a transaction without a profile context');\n            continue;\n          }\n\n          // Remove the profile from the transaction context before sending, relay will take care of the rest.\n          if (context && context['profile']) {\n            delete context.profile;\n          }\n\n          const profile = PROFILE_MAP.get(profile_id);\n          if (!profile) {\n            __DEBUG_BUILD__ && logger.log(`[Profiling] Could not retrieve profile for transaction: ${profile_id}`);\n            continue;\n          }\n\n          PROFILE_MAP.delete(profile_id);\n          const profileEvent = createProfilingEvent(profile_id, profile, profiledTransaction as ProfiledEvent);\n\n          if (profileEvent) {\n            profilesToAddToEnvelope.push(profileEvent);\n          }\n        }\n\n        addProfilesToEnvelope(envelope, profilesToAddToEnvelope);\n      });\n    } else {\n      logger.warn('[Profiling] Client does not support hooks, profiling will be disabled');\n    }\n  }\n}\n","export * from './exports';\n\nimport { Integrations as CoreIntegrations } from '@sentry/core';\n\nimport { WINDOW } from './helpers';\nimport * as BrowserIntegrations from './integrations';\n\nlet windowIntegrations = {};\n\n// This block is needed to add compatibility with the integrations packages when used with a CDN\nif (WINDOW.Sentry && WINDOW.Sentry.Integrations) {\n  windowIntegrations = WINDOW.Sentry.Integrations;\n}\n\nconst INTEGRATIONS = {\n  ...windowIntegrations,\n  ...CoreIntegrations,\n  ...BrowserIntegrations,\n};\n\nexport { INTEGRATIONS as Integrations };\n\nexport { Replay } from '@sentry/replay';\nexport type {\n  ReplayEventType,\n  ReplayEventWithTime,\n  ReplayBreadcrumbFrame,\n  ReplayBreadcrumbFrameEvent,\n  ReplayOptionFrameEvent,\n  ReplayFrame,\n  ReplayFrameEvent,\n  ReplaySpanFrame,\n  ReplaySpanFrameEvent,\n} from '@sentry/replay';\n\nexport {\n  BrowserTracing,\n  defaultRequestInstrumentationOptions,\n  instrumentOutgoingRequests,\n} from '@sentry-internal/tracing';\nexport type { RequestInstrumentationOptions } from '@sentry-internal/tracing';\nexport {\n  addTracingExtensions,\n  setMeasurement,\n  extractTraceparentData,\n  getActiveTransaction,\n  spanStatusfromHttpCode,\n  trace,\n  makeMultiplexedTransport,\n  ModuleMetadata,\n} from '@sentry/core';\nexport type { SpanStatusType } from '@sentry/core';\nexport type { Span } from '@sentry/types';\nexport { makeBrowserOfflineTransport } from './transports/offline';\nexport { onProfilingStartRouteTransaction } from './profiling/hubextensions';\nexport { BrowserProfilingIntegration } from './profiling/integration';\n","/**\n * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,\n * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.\n *\n * Note: This file was originally called `global.ts`, but was changed to unblock users which might be doing\n * string replaces with bundlers like Vite for `global` (would break imports that rely on importing from utils/src/global).\n *\n * Why worldwide?\n *\n * Why not?\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { Integration } from '@sentry/types';\n\n/** Internal global with common properties and Sentry extensions  */\nexport interface InternalGlobal {\n  navigator?: { userAgent?: string };\n  console: Console;\n  Sentry?: {\n    Integrations?: Integration[];\n  };\n  SENTRY_ENVIRONMENT?: string;\n  SENTRY_DSN?: string;\n  SENTRY_RELEASE?: {\n    id?: string;\n  };\n  __SENTRY__: {\n    globalEventProcessors: any;\n    hub: any;\n    logger: any;\n    extensions?: {\n      /** Extension methods for the hub, which are bound to the current Hub instance */\n      // eslint-disable-next-line @typescript-eslint/ban-types\n      [key: string]: Function;\n    };\n  };\n}\n\n// The code below for 'isGlobalObj' and 'GLOBAL_OBJ' was copied from core-js before modification\n// https://github.com/zloirock/core-js/blob/1b944df55282cdc99c90db5f49eb0b6eda2cc0a3/packages/core-js/internals/global.js\n// core-js has the following licence:\n//\n// Copyright (c) 2014-2022 Denis Pushkarev\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/** Returns 'obj' if it's the global object, otherwise returns undefined */\nfunction isGlobalObj(obj: { Math?: Math }): any | undefined {\n  return obj && obj.Math == Math ? obj : undefined;\n}\n\n/** Get's the global object for the current JavaScript runtime */\nexport const GLOBAL_OBJ: InternalGlobal =\n  (typeof globalThis == 'object' && isGlobalObj(globalThis)) ||\n  // eslint-disable-next-line no-restricted-globals\n  (typeof window == 'object' && isGlobalObj(window)) ||\n  (typeof self == 'object' && isGlobalObj(self)) ||\n  (typeof global == 'object' && isGlobalObj(global)) ||\n  (function (this: any) {\n    return this;\n  })() ||\n  {};\n\n/**\n * @deprecated Use GLOBAL_OBJ instead or WINDOW from @sentry/browser. This will be removed in v8\n */\nexport function getGlobalObject<T>(): T & InternalGlobal {\n  return GLOBAL_OBJ as T & InternalGlobal;\n}\n\n/**\n * Returns a global singleton contained in the global `__SENTRY__` object.\n *\n * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory\n * function and added to the `__SENTRY__` object.\n *\n * @param name name of the global singleton on __SENTRY__\n * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__`\n * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value\n * @returns the singleton\n */\nexport function getGlobalSingleton<T>(name: keyof InternalGlobal['__SENTRY__'], creator: () => T, obj?: unknown): T {\n  const gbl = (obj || GLOBAL_OBJ) as InternalGlobal;\n  const __SENTRY__ = (gbl.__SENTRY__ = gbl.__SENTRY__ || {});\n  const singleton = __SENTRY__[name] || (__SENTRY__[name] = creator());\n  return singleton;\n}\n","import { WrappedFunction } from '@sentry/types';\n\nimport { getGlobalSingleton, GLOBAL_OBJ } from './worldwide';\n\n/** Prefix for logging strings */\nconst PREFIX = 'Sentry Logger ';\n\nexport const CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert', 'trace'] as const;\nexport type ConsoleLevel = typeof CONSOLE_LEVELS[number];\n\ntype LoggerMethod = (...args: unknown[]) => void;\ntype LoggerConsoleMethods = Record<typeof CONSOLE_LEVELS[number], LoggerMethod>;\n\n/** JSDoc */\ninterface Logger extends LoggerConsoleMethods {\n  disable(): void;\n  enable(): void;\n}\n\n/**\n * Temporarily disable sentry console instrumentations.\n *\n * @param callback The function to run against the original `console` messages\n * @returns The results of the callback\n */\nexport function consoleSandbox<T>(callback: () => T): T {\n  if (!('console' in GLOBAL_OBJ)) {\n    return callback();\n  }\n\n  const originalConsole = GLOBAL_OBJ.console as Console & Record<string, unknown>;\n  const wrappedLevels: Partial<LoggerConsoleMethods> = {};\n\n  // Restore all wrapped console methods\n  CONSOLE_LEVELS.forEach(level => {\n    // TODO(v7): Remove this check as it's only needed for Node 6\n    const originalWrappedFunc =\n      originalConsole[level] && (originalConsole[level] as WrappedFunction).__sentry_original__;\n    if (level in originalConsole && originalWrappedFunc) {\n      wrappedLevels[level] = originalConsole[level] as LoggerConsoleMethods[typeof level];\n      originalConsole[level] = originalWrappedFunc as Console[typeof level];\n    }\n  });\n\n  try {\n    return callback();\n  } finally {\n    // Revert restoration to wrapped state\n    Object.keys(wrappedLevels).forEach(level => {\n      originalConsole[level] = wrappedLevels[level as typeof CONSOLE_LEVELS[number]];\n    });\n  }\n}\n\nfunction makeLogger(): Logger {\n  let enabled = false;\n  const logger: Partial<Logger> = {\n    enable: () => {\n      enabled = true;\n    },\n    disable: () => {\n      enabled = false;\n    },\n  };\n\n  if (__DEBUG_BUILD__) {\n    CONSOLE_LEVELS.forEach(name => {\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      logger[name] = (...args: any[]) => {\n        if (enabled) {\n          consoleSandbox(() => {\n            GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);\n          });\n        }\n      };\n    });\n  } else {\n    CONSOLE_LEVELS.forEach(name => {\n      logger[name] = () => undefined;\n    });\n  }\n\n  return logger as Logger;\n}\n\n// Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used\nlet logger: Logger;\nif (__DEBUG_BUILD__) {\n  logger = getGlobalSingleton('logger', makeLogger);\n} else {\n  logger = makeLogger();\n}\n\nexport { logger };\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\nimport { PolymorphicEvent, Primitive } from '@sentry/types';\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst objectToString = Object.prototype.toString;\n\n/**\n * Checks whether given value's type is one of a few Error or Error-like\n * {@link isError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isError(wat: unknown): wat is Error {\n  switch (objectToString.call(wat)) {\n    case '[object Error]':\n    case '[object Exception]':\n    case '[object DOMException]':\n      return true;\n    default:\n      return isInstanceOf(wat, Error);\n  }\n}\n/**\n * Checks whether given value is an instance of the given built-in class.\n *\n * @param wat The value to be checked\n * @param className\n * @returns A boolean representing the result.\n */\nfunction isBuiltin(wat: unknown, className: string): boolean {\n  return objectToString.call(wat) === `[object ${className}]`;\n}\n\n/**\n * Checks whether given value's type is ErrorEvent\n * {@link isErrorEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isErrorEvent(wat: unknown): boolean {\n  return isBuiltin(wat, 'ErrorEvent');\n}\n\n/**\n * Checks whether given value's type is DOMError\n * {@link isDOMError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMError(wat: unknown): boolean {\n  return isBuiltin(wat, 'DOMError');\n}\n\n/**\n * Checks whether given value's type is DOMException\n * {@link isDOMException}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMException(wat: unknown): boolean {\n  return isBuiltin(wat, 'DOMException');\n}\n\n/**\n * Checks whether given value's type is a string\n * {@link isString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isString(wat: unknown): wat is string {\n  return isBuiltin(wat, 'String');\n}\n\n/**\n * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)\n * {@link isPrimitive}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPrimitive(wat: unknown): wat is Primitive {\n  return wat === null || (typeof wat !== 'object' && typeof wat !== 'function');\n}\n\n/**\n * Checks whether given value's type is an object literal\n * {@link isPlainObject}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPlainObject(wat: unknown): wat is Record<string, unknown> {\n  return isBuiltin(wat, 'Object');\n}\n\n/**\n * Checks whether given value's type is an Event instance\n * {@link isEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isEvent(wat: unknown): wat is PolymorphicEvent {\n  return typeof Event !== 'undefined' && isInstanceOf(wat, Event);\n}\n\n/**\n * Checks whether given value's type is an Element instance\n * {@link isElement}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isElement(wat: unknown): boolean {\n  return typeof Element !== 'undefined' && isInstanceOf(wat, Element);\n}\n\n/**\n * Checks whether given value's type is an regexp\n * {@link isRegExp}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isRegExp(wat: unknown): wat is RegExp {\n  return isBuiltin(wat, 'RegExp');\n}\n\n/**\n * Checks whether given value has a then function.\n * @param wat A value to be checked.\n */\nexport function isThenable(wat: any): wat is PromiseLike<any> {\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n  return Boolean(wat && wat.then && typeof wat.then === 'function');\n}\n\n/**\n * Checks whether given value's type is a SyntheticEvent\n * {@link isSyntheticEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isSyntheticEvent(wat: unknown): boolean {\n  return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;\n}\n\n/**\n * Checks whether given value is NaN\n * {@link isNaN}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isNaN(wat: unknown): boolean {\n  return typeof wat === 'number' && wat !== wat;\n}\n\n/**\n * Checks whether given value's type is an instance of provided constructor.\n * {@link isInstanceOf}.\n *\n * @param wat A value to be checked.\n * @param base A constructor to be used in a check.\n * @returns A boolean representing the result.\n */\nexport function isInstanceOf(wat: any, base: any): boolean {\n  try {\n    return wat instanceof base;\n  } catch (_e) {\n    return false;\n  }\n}\n","import { isString } from './is';\nimport { getGlobalObject } from './worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject<Window>();\n\nconst DEFAULT_MAX_STRING_LENGTH = 80;\n\n/**\n * Given a child DOM element, returns a query-selector statement describing that\n * and its ancestors\n * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nexport function htmlTreeAsString(\n  elem: unknown,\n  options: string[] | { keyAttrs?: string[]; maxStringLength?: number } = {},\n): string {\n  type SimpleNode = {\n    parentNode: SimpleNode;\n  } | null;\n\n  // try/catch both:\n  // - accessing event.target (see getsentry/raven-js#838, #768)\n  // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly\n  // - can throw an exception in some circumstances.\n  try {\n    let currentElem = elem as SimpleNode;\n    const MAX_TRAVERSE_HEIGHT = 5;\n    const out = [];\n    let height = 0;\n    let len = 0;\n    const separator = ' > ';\n    const sepLength = separator.length;\n    let nextStr;\n    const keyAttrs = Array.isArray(options) ? options : options.keyAttrs;\n    const maxStringLength = (!Array.isArray(options) && options.maxStringLength) || DEFAULT_MAX_STRING_LENGTH;\n\n    while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {\n      nextStr = _htmlElementAsString(currentElem, keyAttrs);\n      // bail out if\n      // - nextStr is the 'html' element\n      // - the length of the string that would be created exceeds maxStringLength\n      //   (ignore this limit if we are on the first iteration)\n      if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength)) {\n        break;\n      }\n\n      out.push(nextStr);\n\n      len += nextStr.length;\n      currentElem = currentElem.parentNode;\n    }\n\n    return out.reverse().join(separator);\n  } catch (_oO) {\n    return '<unknown>';\n  }\n}\n\n/**\n * Returns a simple, query-selector representation of a DOM element\n * e.g. [HTMLElement] => input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nfunction _htmlElementAsString(el: unknown, keyAttrs?: string[]): string {\n  const elem = el as {\n    tagName?: string;\n    id?: string;\n    className?: string;\n    getAttribute(key: string): string;\n  };\n\n  const out = [];\n  let className;\n  let classes;\n  let key;\n  let attr;\n  let i;\n\n  if (!elem || !elem.tagName) {\n    return '';\n  }\n\n  out.push(elem.tagName.toLowerCase());\n\n  // Pairs of attribute keys defined in `serializeAttribute` and their values on element.\n  const keyAttrPairs =\n    keyAttrs && keyAttrs.length\n      ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])\n      : null;\n\n  if (keyAttrPairs && keyAttrPairs.length) {\n    keyAttrPairs.forEach(keyAttrPair => {\n      out.push(`[${keyAttrPair[0]}=\"${keyAttrPair[1]}\"]`);\n    });\n  } else {\n    if (elem.id) {\n      out.push(`#${elem.id}`);\n    }\n\n    // eslint-disable-next-line prefer-const\n    className = elem.className;\n    if (className && isString(className)) {\n      classes = className.split(/\\s+/);\n      for (i = 0; i < classes.length; i++) {\n        out.push(`.${classes[i]}`);\n      }\n    }\n  }\n  const allowedAttrs = ['type', 'name', 'title', 'alt'];\n  for (i = 0; i < allowedAttrs.length; i++) {\n    key = allowedAttrs[i];\n    attr = elem.getAttribute(key);\n    if (attr) {\n      out.push(`[${key}=\"${attr}\"]`);\n    }\n  }\n  return out.join('');\n}\n\n/**\n * A safe form of location.href\n */\nexport function getLocationHref(): string {\n  try {\n    return WINDOW.document.location.href;\n  } catch (oO) {\n    return '';\n  }\n}\n\n/**\n * Gets a DOM element by using document.querySelector.\n *\n * This wrapper will first check for the existance of the function before\n * actually calling it so that we don't have to take care of this check,\n * every time we want to access the DOM.\n *\n * Reason: DOM/querySelector is not available in all environments.\n *\n * We have to cast to any because utils can be consumed by a variety of environments,\n * and we don't want to break TS users. If you know what element will be selected by\n * `document.querySelector`, specify it as part of the generic call. For example,\n * `const element = getDomElement<Element>('selector');`\n *\n * @param selector the selector string passed on to document.querySelector\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getDomElement<E = any>(selector: string): E | null {\n  if (WINDOW.document && WINDOW.document.querySelector) {\n    return WINDOW.document.querySelector(selector) as unknown as E;\n  }\n  return null;\n}\n","/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { WrappedFunction } from '@sentry/types';\n\nimport { htmlTreeAsString } from './browser';\nimport { isElement, isError, isEvent, isInstanceOf, isPlainObject, isPrimitive } from './is';\nimport { truncate } from './string';\n\n/**\n * Replace a method in an object with a wrapped version of itself.\n *\n * @param source An object that contains a method to be wrapped.\n * @param name The name of the method to be wrapped.\n * @param replacementFactory A higher-order function that takes the original version of the given method and returns a\n * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to\n * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, <other\n * args>)` or `origMethod.apply(this, [<other args>])` (rather than being called directly), again to preserve `this`.\n * @returns void\n */\nexport function fill(source: { [key: string]: any }, name: string, replacementFactory: (...args: any[]) => any): void {\n  if (!(name in source)) {\n    return;\n  }\n\n  const original = source[name] as () => any;\n  const wrapped = replacementFactory(original) as WrappedFunction;\n\n  // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n  // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n  if (typeof wrapped === 'function') {\n    try {\n      markFunctionWrapped(wrapped, original);\n    } catch (_Oo) {\n      // This can throw if multiple fill happens on a global object like XMLHttpRequest\n      // Fixes https://github.com/getsentry/sentry-javascript/issues/2043\n    }\n  }\n\n  source[name] = wrapped;\n}\n\n/**\n * Defines a non-enumerable property on the given object.\n *\n * @param obj The object on which to set the property\n * @param name The name of the property to be set\n * @param value The value to which to set the property\n */\nexport function addNonEnumerableProperty(obj: { [key: string]: unknown }, name: string, value: unknown): void {\n  Object.defineProperty(obj, name, {\n    // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it\n    value: value,\n    writable: true,\n    configurable: true,\n  });\n}\n\n/**\n * Remembers the original function on the wrapped function and\n * patches up the prototype.\n *\n * @param wrapped the wrapper function\n * @param original the original function that gets wrapped\n */\nexport function markFunctionWrapped(wrapped: WrappedFunction, original: WrappedFunction): void {\n  const proto = original.prototype || {};\n  wrapped.prototype = original.prototype = proto;\n  addNonEnumerableProperty(wrapped, '__sentry_original__', original);\n}\n\n/**\n * This extracts the original function if available.  See\n * `markFunctionWrapped` for more information.\n *\n * @param func the function to unwrap\n * @returns the unwrapped version of the function if available.\n */\nexport function getOriginalFunction(func: WrappedFunction): WrappedFunction | undefined {\n  return func.__sentry_original__;\n}\n\n/**\n * Encodes given object into url-friendly format\n *\n * @param object An object that contains serializable values\n * @returns string Encoded\n */\nexport function urlEncode(object: { [key: string]: any }): string {\n  return Object.keys(object)\n    .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`)\n    .join('&');\n}\n\n/**\n * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their\n * non-enumerable properties attached.\n *\n * @param value Initial source that we have to transform in order for it to be usable by the serializer\n * @returns An Event or Error turned into an object - or the value argurment itself, when value is neither an Event nor\n *  an Error.\n */\nexport function convertToPlainObject<V extends unknown>(\n  value: V,\n):\n  | {\n      [ownProps: string]: unknown;\n      type: string;\n      target: string;\n      currentTarget: string;\n      detail?: unknown;\n    }\n  | {\n      [ownProps: string]: unknown;\n      message: string;\n      name: string;\n      stack?: string;\n    }\n  | V {\n  if (isError(value)) {\n    return {\n      message: value.message,\n      name: value.name,\n      stack: value.stack,\n      ...getOwnProperties(value),\n    };\n  } else if (isEvent(value)) {\n    const newObj: {\n      [ownProps: string]: unknown;\n      type: string;\n      target: string;\n      currentTarget: string;\n      detail?: unknown;\n    } = {\n      type: value.type,\n      target: serializeEventTarget(value.target),\n      currentTarget: serializeEventTarget(value.currentTarget),\n      ...getOwnProperties(value),\n    };\n\n    if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {\n      newObj.detail = value.detail;\n    }\n\n    return newObj;\n  } else {\n    return value;\n  }\n}\n\n/** Creates a string representation of the target of an `Event` object */\nfunction serializeEventTarget(target: unknown): string {\n  try {\n    return isElement(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target);\n  } catch (_oO) {\n    return '<unknown>';\n  }\n}\n\n/** Filters out all but an object's own properties */\nfunction getOwnProperties(obj: unknown): { [key: string]: unknown } {\n  if (typeof obj === 'object' && obj !== null) {\n    const extractedProps: { [key: string]: unknown } = {};\n    for (const property in obj) {\n      if (Object.prototype.hasOwnProperty.call(obj, property)) {\n        extractedProps[property] = (obj as Record<string, unknown>)[property];\n      }\n    }\n    return extractedProps;\n  } else {\n    return {};\n  }\n}\n\n/**\n * Given any captured exception, extract its keys and create a sorted\n * and truncated list that will be used inside the event message.\n * eg. `Non-error exception captured with keys: foo, bar, baz`\n */\nexport function extractExceptionKeysForMessage(exception: Record<string, unknown>, maxLength: number = 40): string {\n  const keys = Object.keys(convertToPlainObject(exception));\n  keys.sort();\n\n  if (!keys.length) {\n    return '[object has no keys]';\n  }\n\n  if (keys[0].length >= maxLength) {\n    return truncate(keys[0], maxLength);\n  }\n\n  for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {\n    const serialized = keys.slice(0, includedKeys).join(', ');\n    if (serialized.length > maxLength) {\n      continue;\n    }\n    if (includedKeys === keys.length) {\n      return serialized;\n    }\n    return truncate(serialized, maxLength);\n  }\n\n  return '';\n}\n\n/**\n * Given any object, return a new object having removed all fields whose value was `undefined`.\n * Works recursively on objects and arrays.\n *\n * Attention: This function keeps circular references in the returned object.\n */\nexport function dropUndefinedKeys<T>(inputValue: T): T {\n  // This map keeps track of what already visited nodes map to.\n  // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular\n  // references as the input object.\n  const memoizationMap = new Map<unknown, unknown>();\n\n  // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API\n  return _dropUndefinedKeys(inputValue, memoizationMap);\n}\n\nfunction _dropUndefinedKeys<T>(inputValue: T, memoizationMap: Map<unknown, unknown>): T {\n  if (isPlainObject(inputValue)) {\n    // If this node has already been visited due to a circular reference, return the object it was mapped to in the new object\n    const memoVal = memoizationMap.get(inputValue);\n    if (memoVal !== undefined) {\n      return memoVal as T;\n    }\n\n    const returnValue: { [key: string]: any } = {};\n    // Store the mapping of this value in case we visit it again, in case of circular data\n    memoizationMap.set(inputValue, returnValue);\n\n    for (const key of Object.keys(inputValue)) {\n      if (typeof inputValue[key] !== 'undefined') {\n        returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap);\n      }\n    }\n\n    return returnValue as T;\n  }\n\n  if (Array.isArray(inputValue)) {\n    // If this node has already been visited due to a circular reference, return the array it was mapped to in the new object\n    const memoVal = memoizationMap.get(inputValue);\n    if (memoVal !== undefined) {\n      return memoVal as T;\n    }\n\n    const returnValue: unknown[] = [];\n    // Store the mapping of this value in case we visit it again, in case of circular data\n    memoizationMap.set(inputValue, returnValue);\n\n    inputValue.forEach((item: unknown) => {\n      returnValue.push(_dropUndefinedKeys(item, memoizationMap));\n    });\n\n    return returnValue as unknown as T;\n  }\n\n  return inputValue;\n}\n\n/**\n * Ensure that something is an object.\n *\n * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper\n * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives.\n *\n * @param wat The subject of the objectification\n * @returns A version of `wat` which can safely be used with `Object` class methods\n */\nexport function objectify(wat: unknown): typeof Object {\n  let objectified;\n  switch (true) {\n    case wat === undefined || wat === null:\n      objectified = new String(wat);\n      break;\n\n    // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason\n    // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as\n    // an object in order to wrap it.\n    case typeof wat === 'symbol' || typeof wat === 'bigint':\n      objectified = Object(wat);\n      break;\n\n    // this will catch the remaining primitives: `String`, `Number`, and `Boolean`\n    case isPrimitive(wat):\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n      objectified = new (wat as any).constructor(wat);\n      break;\n\n    // by process of elimination, at this point we know that `wat` must already be an object\n    default:\n      objectified = wat;\n      break;\n  }\n  return objectified;\n}\n","/* eslint-disable deprecation/deprecation */\nimport { Severity, SeverityLevel } from '@sentry/types';\n\n// Note: Ideally the `SeverityLevel` type would be derived from `validSeverityLevels`, but that would mean either\n//\n// a) moving `validSeverityLevels` to `@sentry/types`,\n// b) moving the`SeverityLevel` type here, or\n// c) importing `validSeverityLevels` from here into `@sentry/types`.\n//\n// Option A would make `@sentry/types` a runtime dependency of `@sentry/utils` (not good), and options B and C would\n// create a circular dependency between `@sentry/types` and `@sentry/utils` (also not good). So a TODO accompanying the\n// type, reminding anyone who changes it to change this list also, will have to do.\n\nexport const validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug'];\n\n/**\n * Converts a string-based level into a member of the deprecated {@link Severity} enum.\n *\n * @deprecated `severityFromString` is deprecated. Please use `severityLevelFromString` instead.\n *\n * @param level String representation of Severity\n * @returns Severity\n */\nexport function severityFromString(level: Severity | SeverityLevel | string): Severity {\n  return severityLevelFromString(level) as Severity;\n}\n\n/**\n * Converts a string-based level into a `SeverityLevel`, normalizing it along the way.\n *\n * @param level String representation of desired `SeverityLevel`.\n * @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level.\n */\nexport function severityLevelFromString(level: SeverityLevel | string): SeverityLevel {\n  return (level === 'warn' ? 'warning' : validSeverityLevels.includes(level) ? level : 'log') as SeverityLevel;\n}\n","import { isRegExp, isString } from './is';\n\n/**\n * Truncates given string to the maximum characters count\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string (0 = unlimited)\n * @returns string Encoded\n */\nexport function truncate(str: string, max: number = 0): string {\n  if (typeof str !== 'string' || max === 0) {\n    return str;\n  }\n  return str.length <= max ? str : `${str.substr(0, max)}...`;\n}\n\n/**\n * This is basically just `trim_line` from\n * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\nexport function snipLine(line: string, colno: number): string {\n  let newLine = line;\n  const lineLength = newLine.length;\n  if (lineLength <= 150) {\n    return newLine;\n  }\n  if (colno > lineLength) {\n    // eslint-disable-next-line no-param-reassign\n    colno = lineLength;\n  }\n\n  let start = Math.max(colno - 60, 0);\n  if (start < 5) {\n    start = 0;\n  }\n\n  let end = Math.min(start + 140, lineLength);\n  if (end > lineLength - 5) {\n    end = lineLength;\n  }\n  if (end === lineLength) {\n    start = Math.max(end - 140, 0);\n  }\n\n  newLine = newLine.slice(start, end);\n  if (start > 0) {\n    newLine = `'{snip} ${newLine}`;\n  }\n  if (end < lineLength) {\n    newLine += ' {snip}';\n  }\n\n  return newLine;\n}\n\n/**\n * Join values in array\n * @param input array of values to be joined together\n * @param delimiter string to be placed in-between values\n * @returns Joined values\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function safeJoin(input: any[], delimiter?: string): string {\n  if (!Array.isArray(input)) {\n    return '';\n  }\n\n  const output = [];\n  // eslint-disable-next-line @typescript-eslint/prefer-for-of\n  for (let i = 0; i < input.length; i++) {\n    const value = input[i];\n    try {\n      output.push(String(value));\n    } catch (e) {\n      output.push('[value cannot be serialized]');\n    }\n  }\n\n  return output.join(delimiter);\n}\n\n/**\n * Checks if the given value matches a regex or string\n *\n * @param value The string to test\n * @param pattern Either a regex or a string against which `value` will be matched\n * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match\n * `pattern` if it contains `pattern`. Only applies to string-type patterns.\n */\nexport function isMatchingPattern(\n  value: string,\n  pattern: RegExp | string,\n  requireExactStringMatch: boolean = false,\n): boolean {\n  if (!isString(value)) {\n    return false;\n  }\n\n  if (isRegExp(pattern)) {\n    return pattern.test(value);\n  }\n  if (isString(pattern)) {\n    return requireExactStringMatch ? value === pattern : value.includes(pattern);\n  }\n\n  return false;\n}\n\n/**\n * Test the given string against an array of strings and regexes. By default, string matching is done on a\n * substring-inclusion basis rather than a strict equality basis\n *\n * @param testString The string to test\n * @param patterns The patterns against which to test the string\n * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to\n * count. If false, `testString` will match a string pattern if it contains that pattern.\n * @returns\n */\nexport function stringMatchesSomePattern(\n  testString: string,\n  patterns: Array<string | RegExp> = [],\n  requireExactStringMatch: boolean = false,\n): boolean {\n  return patterns.some(pattern => isMatchingPattern(testString, pattern, requireExactStringMatch));\n}\n\n/**\n * Given a string, escape characters which have meaning in the regex grammar, such that the result is safe to feed to\n * `new RegExp()`.\n *\n * Based on https://github.com/sindresorhus/escape-string-regexp. Vendored to a) reduce the size by skipping the runtime\n * type-checking, and b) ensure it gets down-compiled for old versions of Node (the published package only supports Node\n * 12+).\n *\n * @param regexString The string to escape\n * @returns An version of the string with all special regex characters escaped\n */\nexport function escapeStringForRegex(regexString: string): string {\n  // escape the hyphen separately so we can also replace it with a unicode literal hyphen, to avoid the problems\n  // discussed in https://github.com/sindresorhus/escape-string-regexp/issues/20.\n  return regexString.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&').replace(/-/g, '\\\\x2d');\n}\n","import { EventProcessor, Hub, Integration } from '@sentry/types';\nimport { CONSOLE_LEVELS, fill, GLOBAL_OBJ, safeJoin, severityLevelFromString } from '@sentry/utils';\n\n/** Send Console API calls as Sentry Events */\nexport class CaptureConsole implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'CaptureConsole';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = CaptureConsole.id;\n\n  /**\n   * @inheritDoc\n   */\n  private readonly _levels: readonly string[] = CONSOLE_LEVELS;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: { levels?: string[] } = {}) {\n    if (options.levels) {\n      this._levels = options.levels;\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    if (!('console' in GLOBAL_OBJ)) {\n      return;\n    }\n\n    this._levels.forEach((level: string) => {\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n      if (!(level in (GLOBAL_OBJ as any).console)) {\n        return;\n      }\n\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n      fill((GLOBAL_OBJ as any).console, level, (originalConsoleMethod: () => any) => (...args: any[]): void => {\n        const hub = getCurrentHub();\n\n        if (hub.getIntegration(CaptureConsole)) {\n          hub.withScope(scope => {\n            scope.setLevel(severityLevelFromString(level));\n            scope.setExtra('arguments', args);\n            scope.addEventProcessor(event => {\n              event.logger = 'console';\n              return event;\n            });\n\n            let message = safeJoin(args, ' ');\n            if (level === 'assert') {\n              if (args[0] === false) {\n                message = `Assertion failed: ${safeJoin(args.slice(1), ' ') || 'console.assert'}`;\n                scope.setExtra('arguments', args.slice(1));\n                hub.captureMessage(message);\n              }\n            } else if (level === 'error' && args[0] instanceof Error) {\n              hub.captureException(args[0]);\n            } else {\n              hub.captureMessage(message);\n            }\n          });\n        }\n\n        // this fails for some browsers. :(\n        if (originalConsoleMethod) {\n          originalConsoleMethod.apply(GLOBAL_OBJ.console, args);\n        }\n      });\n    });\n  }\n}\n","import { Event, EventHint, EventProcessor, Hub, Integration } from '@sentry/types';\nimport { consoleSandbox } from '@sentry/utils';\n\ninterface DebugOptions {\n  /** Controls whether console output created by this integration should be stringified. Default: `false` */\n  stringify?: boolean;\n  /** Controls whether a debugger should be launched before an event is sent. Default: `false` */\n  debugger?: boolean;\n}\n\n/**\n * Integration to debug sent Sentry events.\n * This integration should not be used in production\n */\nexport class Debug implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Debug';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Debug.id;\n\n  private readonly _options: DebugOptions;\n\n  public constructor(options?: DebugOptions) {\n    this._options = {\n      debugger: false,\n      stringify: false,\n      ...options,\n    };\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    addGlobalEventProcessor((event: Event, hint: EventHint) => {\n      const self = getCurrentHub().getIntegration(Debug);\n      if (self) {\n        if (self._options.debugger) {\n          // eslint-disable-next-line no-debugger\n          debugger;\n        }\n\n        /* eslint-disable no-console */\n        consoleSandbox(() => {\n          if (self._options.stringify) {\n            console.log(JSON.stringify(event, null, 2));\n            if (Object.keys(hint).length) {\n              console.log(JSON.stringify(hint, null, 2));\n            }\n          } else {\n            console.log(event);\n            if (Object.keys(hint).length) {\n              console.log(hint);\n            }\n          }\n        });\n        /* eslint-enable no-console */\n      }\n      return event;\n    });\n  }\n}\n","import { Event, EventProcessor, Exception, Hub, Integration, StackFrame } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\n/** Deduplication filter */\nexport class Dedupe implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Dedupe';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Dedupe.id;\n\n  /**\n   * @inheritDoc\n   */\n  private _previousEvent?: Event;\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    const eventProcessor: EventProcessor = currentEvent => {\n      const self = getCurrentHub().getIntegration(Dedupe);\n      if (self) {\n        // Juuust in case something goes wrong\n        try {\n          if (_shouldDropEvent(currentEvent, self._previousEvent)) {\n            __DEBUG_BUILD__ && logger.warn('Event dropped due to being a duplicate of previously captured event.');\n            return null;\n          }\n        } catch (_oO) {\n          return (self._previousEvent = currentEvent);\n        }\n\n        return (self._previousEvent = currentEvent);\n      }\n      return currentEvent;\n    };\n\n    eventProcessor.id = this.name;\n    addGlobalEventProcessor(eventProcessor);\n  }\n}\n\n/** JSDoc */\nexport function _shouldDropEvent(currentEvent: Event, previousEvent?: Event): boolean {\n  if (!previousEvent) {\n    return false;\n  }\n\n  if (_isSameMessageEvent(currentEvent, previousEvent)) {\n    return true;\n  }\n\n  if (_isSameExceptionEvent(currentEvent, previousEvent)) {\n    return true;\n  }\n\n  return false;\n}\n\n/** JSDoc */\nfunction _isSameMessageEvent(currentEvent: Event, previousEvent: Event): boolean {\n  const currentMessage = currentEvent.message;\n  const previousMessage = previousEvent.message;\n\n  // If neither event has a message property, they were both exceptions, so bail out\n  if (!currentMessage && !previousMessage) {\n    return false;\n  }\n\n  // If only one event has a stacktrace, but not the other one, they are not the same\n  if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) {\n    return false;\n  }\n\n  if (currentMessage !== previousMessage) {\n    return false;\n  }\n\n  if (!_isSameFingerprint(currentEvent, previousEvent)) {\n    return false;\n  }\n\n  if (!_isSameStacktrace(currentEvent, previousEvent)) {\n    return false;\n  }\n\n  return true;\n}\n\n/** JSDoc */\nfunction _isSameExceptionEvent(currentEvent: Event, previousEvent: Event): boolean {\n  const previousException = _getExceptionFromEvent(previousEvent);\n  const currentException = _getExceptionFromEvent(currentEvent);\n\n  if (!previousException || !currentException) {\n    return false;\n  }\n\n  if (previousException.type !== currentException.type || previousException.value !== currentException.value) {\n    return false;\n  }\n\n  if (!_isSameFingerprint(currentEvent, previousEvent)) {\n    return false;\n  }\n\n  if (!_isSameStacktrace(currentEvent, previousEvent)) {\n    return false;\n  }\n\n  return true;\n}\n\n/** JSDoc */\nfunction _isSameStacktrace(currentEvent: Event, previousEvent: Event): boolean {\n  let currentFrames = _getFramesFromEvent(currentEvent);\n  let previousFrames = _getFramesFromEvent(previousEvent);\n\n  // If neither event has a stacktrace, they are assumed to be the same\n  if (!currentFrames && !previousFrames) {\n    return true;\n  }\n\n  // If only one event has a stacktrace, but not the other one, they are not the same\n  if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) {\n    return false;\n  }\n\n  currentFrames = currentFrames as StackFrame[];\n  previousFrames = previousFrames as StackFrame[];\n\n  // If number of frames differ, they are not the same\n  if (previousFrames.length !== currentFrames.length) {\n    return false;\n  }\n\n  // Otherwise, compare the two\n  for (let i = 0; i < previousFrames.length; i++) {\n    const frameA = previousFrames[i];\n    const frameB = currentFrames[i];\n\n    if (\n      frameA.filename !== frameB.filename ||\n      frameA.lineno !== frameB.lineno ||\n      frameA.colno !== frameB.colno ||\n      frameA.function !== frameB.function\n    ) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\n/** JSDoc */\nfunction _isSameFingerprint(currentEvent: Event, previousEvent: Event): boolean {\n  let currentFingerprint = currentEvent.fingerprint;\n  let previousFingerprint = previousEvent.fingerprint;\n\n  // If neither event has a fingerprint, they are assumed to be the same\n  if (!currentFingerprint && !previousFingerprint) {\n    return true;\n  }\n\n  // If only one event has a fingerprint, but not the other one, they are not the same\n  if ((currentFingerprint && !previousFingerprint) || (!currentFingerprint && previousFingerprint)) {\n    return false;\n  }\n\n  currentFingerprint = currentFingerprint as string[];\n  previousFingerprint = previousFingerprint as string[];\n\n  // Otherwise, compare the two\n  try {\n    return !!(currentFingerprint.join('') === previousFingerprint.join(''));\n  } catch (_oO) {\n    return false;\n  }\n}\n\n/** JSDoc */\nfunction _getExceptionFromEvent(event: Event): Exception | undefined {\n  return event.exception && event.exception.values && event.exception.values[0];\n}\n\n/** JSDoc */\nfunction _getFramesFromEvent(event: Event): StackFrame[] | undefined {\n  const exception = event.exception;\n\n  if (exception) {\n    try {\n      // @ts-ignore Object could be undefined\n      return exception.values[0].stacktrace.frames;\n    } catch (_oO) {\n      return undefined;\n    }\n  }\n  return undefined;\n}\n","import { StackFrame, StackLineParser, StackLineParserFn, StackParser } from '@sentry/types';\n\nconst STACKTRACE_LIMIT = 50;\n\n/**\n * Creates a stack parser with the supplied line parsers\n *\n * StackFrames are returned in the correct order for Sentry Exception\n * frames and with Sentry SDK internal frames removed from the top and bottom\n *\n */\nexport function createStackParser(...parsers: StackLineParser[]): StackParser {\n  const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map(p => p[1]);\n\n  return (stack: string, skipFirst: number = 0): StackFrame[] => {\n    const frames: StackFrame[] = [];\n\n    for (const line of stack.split('\\n').slice(skipFirst)) {\n      // https://github.com/getsentry/sentry-javascript/issues/5459\n      // Remove webpack (error: *) wrappers\n      const cleanedLine = line.replace(/\\(error: (.*)\\)/, '$1');\n\n      for (const parser of sortedParsers) {\n        const frame = parser(cleanedLine);\n\n        if (frame) {\n          frames.push(frame);\n          break;\n        }\n      }\n    }\n\n    return stripSentryFramesAndReverse(frames);\n  };\n}\n\n/**\n * Gets a stack parser implementation from Options.stackParser\n * @see Options\n *\n * If options contains an array of line parsers, it is converted into a parser\n */\nexport function stackParserFromStackParserOptions(stackParser: StackParser | StackLineParser[]): StackParser {\n  if (Array.isArray(stackParser)) {\n    return createStackParser(...stackParser);\n  }\n  return stackParser;\n}\n\n/**\n * @hidden\n */\nexport function stripSentryFramesAndReverse(stack: StackFrame[]): StackFrame[] {\n  if (!stack.length) {\n    return [];\n  }\n\n  let localStack = stack;\n\n  const firstFrameFunction = localStack[0].function || '';\n  const lastFrameFunction = localStack[localStack.length - 1].function || '';\n\n  // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)\n  if (firstFrameFunction.indexOf('captureMessage') !== -1 || firstFrameFunction.indexOf('captureException') !== -1) {\n    localStack = localStack.slice(1);\n  }\n\n  // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)\n  if (lastFrameFunction.indexOf('sentryWrapped') !== -1) {\n    localStack = localStack.slice(0, -1);\n  }\n\n  // The frame where the crash happened, should be the last entry in the array\n  return localStack\n    .slice(0, STACKTRACE_LIMIT)\n    .map(frame => ({\n      ...frame,\n      filename: frame.filename || localStack[0].filename,\n      function: frame.function || '?',\n    }))\n    .reverse();\n}\n\nconst defaultFunctionName = '<anonymous>';\n\n/**\n * Safely extract function name from itself\n */\nexport function getFunctionName(fn: unknown): string {\n  try {\n    if (!fn || typeof fn !== 'function') {\n      return defaultFunctionName;\n    }\n    return fn.name || defaultFunctionName;\n  } catch (e) {\n    // Just accessing custom props in some Selenium environments\n    // can cause a \"Permission denied\" exception (see raven-js#495).\n    return defaultFunctionName;\n  }\n}\n\ntype GetModuleFn = (filename: string | undefined) => string | undefined;\n\n// eslint-disable-next-line complexity\nfunction node(getModule?: GetModuleFn): StackLineParserFn {\n  const FILENAME_MATCH = /^\\s*[-]{4,}$/;\n  const FULL_MATCH = /at (?:async )?(?:(.+?)\\s+\\()?(?:(.+):(\\d+):(\\d+)?|([^)]+))\\)?/;\n\n  // eslint-disable-next-line complexity\n  return (line: string) => {\n    if (line.match(FILENAME_MATCH)) {\n      return {\n        filename: line,\n      };\n    }\n\n    const lineMatch = line.match(FULL_MATCH);\n    if (!lineMatch) {\n      return undefined;\n    }\n\n    let object: string | undefined;\n    let method: string | undefined;\n    let functionName: string | undefined;\n    let typeName: string | undefined;\n    let methodName: string | undefined;\n\n    if (lineMatch[1]) {\n      functionName = lineMatch[1];\n\n      let methodStart = functionName.lastIndexOf('.');\n      if (functionName[methodStart - 1] === '.') {\n        methodStart--;\n      }\n\n      if (methodStart > 0) {\n        object = functionName.substr(0, methodStart);\n        method = functionName.substr(methodStart + 1);\n        const objectEnd = object.indexOf('.Module');\n        if (objectEnd > 0) {\n          functionName = functionName.substr(objectEnd + 1);\n          object = object.substr(0, objectEnd);\n        }\n      }\n      typeName = undefined;\n    }\n\n    if (method) {\n      typeName = object;\n      methodName = method;\n    }\n\n    if (method === '<anonymous>') {\n      methodName = undefined;\n      functionName = undefined;\n    }\n\n    if (functionName === undefined) {\n      methodName = methodName || '<anonymous>';\n      functionName = typeName ? `${typeName}.${methodName}` : methodName;\n    }\n\n    const filename = lineMatch[2]?.startsWith('file://') ? lineMatch[2].substr(7) : lineMatch[2];\n    const isNative = lineMatch[5] === 'native';\n    const isInternal =\n      isNative || (filename && !filename.startsWith('/') && !filename.startsWith('.') && filename.indexOf(':\\\\') !== 1);\n\n    // in_app is all that's not an internal Node function or a module within node_modules\n    // note that isNative appears to return true even for node core libraries\n    // see https://github.com/getsentry/raven-node/issues/176\n    const in_app = !isInternal && filename !== undefined && !filename.includes('node_modules/');\n\n    return {\n      filename,\n      module: getModule?.(filename),\n      function: functionName,\n      lineno: parseInt(lineMatch[3], 10) || undefined,\n      colno: parseInt(lineMatch[4], 10) || undefined,\n      in_app,\n    };\n  };\n}\n\n/**\n * Node.js stack line parser\n *\n * This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`.\n * This allows it to be used without referencing or importing any node specific code which causes bundlers to complain\n */\nexport function nodeStackLineParser(getModule?: GetModuleFn): StackLineParser {\n  return [90, node(getModule)];\n}\n","import { Primitive } from '@sentry/types';\n\nimport { isNaN, isSyntheticEvent } from './is';\nimport { memoBuilder, MemoFunc } from './memo';\nimport { convertToPlainObject } from './object';\nimport { getFunctionName } from './stacktrace';\n\ntype Prototype = { constructor: (...args: unknown[]) => unknown };\n// This is a hack to placate TS, relying on the fact that technically, arrays are objects with integer keys. Normally we\n// think of those keys as actual numbers, but `arr['0']` turns out to work just as well as `arr[0]`, and doing it this\n// way lets us use a single type in the places where behave as if we are only dealing with objects, even if some of them\n// might be arrays.\ntype ObjOrArray<T> = { [key: string]: T };\n\n/**\n * Recursively normalizes the given object.\n *\n * - Creates a copy to prevent original input mutation\n * - Skips non-enumerable properties\n * - When stringifying, calls `toJSON` if implemented\n * - Removes circular references\n * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format\n * - Translates known global objects/classes to a string representations\n * - Takes care of `Error` object serialization\n * - Optionally limits depth of final output\n * - Optionally limits number of properties/elements included in any single object/array\n *\n * @param input The object to be normalized.\n * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.)\n * @param maxProperties The max number of elements or properties to be included in any single array or\n * object in the normallized output.\n * @returns A normalized version of the object, or `\"**non-serializable**\"` if any errors are thrown during normalization.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function normalize(input: unknown, depth: number = +Infinity, maxProperties: number = +Infinity): any {\n  try {\n    // since we're at the outermost level, we don't provide a key\n    return visit('', input, depth, maxProperties);\n  } catch (err) {\n    return { ERROR: `**non-serializable** (${err})` };\n  }\n}\n\n/** JSDoc */\nexport function normalizeToSize<T>(\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  object: { [key: string]: any },\n  // Default Node.js REPL depth\n  depth: number = 3,\n  // 100kB, as 200kB is max payload size, so half sounds reasonable\n  maxSize: number = 100 * 1024,\n): T {\n  const normalized = normalize(object, depth);\n\n  if (jsonSize(normalized) > maxSize) {\n    return normalizeToSize(object, depth - 1, maxSize);\n  }\n\n  return normalized as T;\n}\n\n/**\n * Visits a node to perform normalization on it\n *\n * @param key The key corresponding to the given node\n * @param value The node to be visited\n * @param depth Optional number indicating the maximum recursion depth\n * @param maxProperties Optional maximum number of properties/elements included in any single object/array\n * @param memo Optional Memo class handling decycling\n */\nfunction visit(\n  key: string,\n  value: unknown,\n  depth: number = +Infinity,\n  maxProperties: number = +Infinity,\n  memo: MemoFunc = memoBuilder(),\n): Primitive | ObjOrArray<unknown> {\n  const [memoize, unmemoize] = memo;\n\n  // Get the simple cases out of the way first\n  if (value === null || (['number', 'boolean', 'string'].includes(typeof value) && !isNaN(value))) {\n    return value as Primitive;\n  }\n\n  const stringified = stringifyValue(key, value);\n\n  // Anything we could potentially dig into more (objects or arrays) will have come back as `\"[object XXXX]\"`.\n  // Everything else will have already been serialized, so if we don't see that pattern, we're done.\n  if (!stringified.startsWith('[object ')) {\n    return stringified;\n  }\n\n  // From here on, we can assert that `value` is either an object or an array.\n\n  // Do not normalize objects that we know have already been normalized. As a general rule, the\n  // \"__sentry_skip_normalization__\" property should only be used sparingly and only should only be set on objects that\n  // have already been normalized.\n  if ((value as ObjOrArray<unknown>)['__sentry_skip_normalization__']) {\n    return value as ObjOrArray<unknown>;\n  }\n\n  // We're also done if we've reached the max depth\n  if (depth === 0) {\n    // At this point we know `serialized` is a string of the form `\"[object XXXX]\"`. Clean it up so it's just `\"[XXXX]\"`.\n    return stringified.replace('object ', '');\n  }\n\n  // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now.\n  if (memoize(value)) {\n    return '[Circular ~]';\n  }\n\n  // If the value has a `toJSON` method, we call it to extract more information\n  const valueWithToJSON = value as unknown & { toJSON?: () => unknown };\n  if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') {\n    try {\n      const jsonValue = valueWithToJSON.toJSON();\n      // We need to normalize the return value of `.toJSON()` in case it has circular references\n      return visit('', jsonValue, depth - 1, maxProperties, memo);\n    } catch (err) {\n      // pass (The built-in `toJSON` failed, but we can still try to do it ourselves)\n    }\n  }\n\n  // At this point we know we either have an object or an array, we haven't seen it before, and we're going to recurse\n  // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each\n  // property/entry, and keep track of the number of items we add to it.\n  const normalized = (Array.isArray(value) ? [] : {}) as ObjOrArray<unknown>;\n  let numAdded = 0;\n\n  // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant\n  // properties are non-enumerable and otherwise would get missed.\n  const visitable = convertToPlainObject(value as ObjOrArray<unknown>);\n\n  for (const visitKey in visitable) {\n    // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.\n    if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) {\n      continue;\n    }\n\n    if (numAdded >= maxProperties) {\n      normalized[visitKey] = '[MaxProperties ~]';\n      break;\n    }\n\n    // Recursively visit all the child nodes\n    const visitValue = visitable[visitKey];\n    normalized[visitKey] = visit(visitKey, visitValue, depth - 1, maxProperties, memo);\n\n    numAdded++;\n  }\n\n  // Once we've visited all the branches, remove the parent from memo storage\n  unmemoize(value);\n\n  // Return accumulated values\n  return normalized;\n}\n\n// TODO remove this in v7 (this means the method will no longer be exported, under any name)\nexport { visit as walk };\n\n/**\n * Stringify the given value. Handles various known special values and types.\n *\n * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn\n * the number 1231 into \"[Object Number]\", nor on `null`, as it will throw.\n *\n * @param value The value to stringify\n * @returns A stringified representation of the given value\n */\nfunction stringifyValue(\n  key: unknown,\n  // this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for\n  // our internal use, it'll do\n  value: Exclude<unknown, string | number | boolean | null>,\n): string {\n  try {\n    if (key === 'domain' && value && typeof value === 'object' && (value as { _events: unknown })._events) {\n      return '[Domain]';\n    }\n\n    if (key === 'domainEmitter') {\n      return '[DomainEmitter]';\n    }\n\n    // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first\n    // which won't throw if they are not present.\n\n    if (typeof global !== 'undefined' && value === global) {\n      return '[Global]';\n    }\n\n    // eslint-disable-next-line no-restricted-globals\n    if (typeof window !== 'undefined' && value === window) {\n      return '[Window]';\n    }\n\n    // eslint-disable-next-line no-restricted-globals\n    if (typeof document !== 'undefined' && value === document) {\n      return '[Document]';\n    }\n\n    // React's SyntheticEvent thingy\n    if (isSyntheticEvent(value)) {\n      return '[SyntheticEvent]';\n    }\n\n    if (typeof value === 'number' && value !== value) {\n      return '[NaN]';\n    }\n\n    // this catches `undefined` (but not `null`, which is a primitive and can be serialized on its own)\n    if (value === void 0) {\n      return '[undefined]';\n    }\n\n    if (typeof value === 'function') {\n      return `[Function: ${getFunctionName(value)}]`;\n    }\n\n    if (typeof value === 'symbol') {\n      return `[${String(value)}]`;\n    }\n\n    // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion\n    if (typeof value === 'bigint') {\n      return `[BigInt: ${String(value)}]`;\n    }\n\n    // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting\n    // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as\n    // `\"[object Object]\"`. If we instead look at the constructor's name (which is the same as the name of the class),\n    // we can make sure that only plain objects come out that way.\n    return `[object ${(Object.getPrototypeOf(value) as Prototype).constructor.name}]`;\n  } catch (err) {\n    return `**non-serializable** (${err})`;\n  }\n}\n\n/** Calculates bytes size of input string */\nfunction utf8Length(value: string): number {\n  // eslint-disable-next-line no-bitwise\n  return ~-encodeURI(value).split(/%..|./).length;\n}\n\n/** Calculates bytes size of input object */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction jsonSize(value: any): number {\n  return utf8Length(JSON.stringify(value));\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport type MemoFunc = [\n  // memoize\n  (obj: any) => boolean,\n  // unmemoize\n  (obj: any) => void,\n];\n\n/**\n * Helper to decycle json objects\n */\nexport function memoBuilder(): MemoFunc {\n  const hasWeakSet = typeof WeakSet === 'function';\n  const inner: any = hasWeakSet ? new WeakSet() : [];\n  function memoize(obj: any): boolean {\n    if (hasWeakSet) {\n      if (inner.has(obj)) {\n        return true;\n      }\n      inner.add(obj);\n      return false;\n    }\n    // eslint-disable-next-line @typescript-eslint/prefer-for-of\n    for (let i = 0; i < inner.length; i++) {\n      const value = inner[i];\n      if (value === obj) {\n        return true;\n      }\n    }\n    inner.push(obj);\n    return false;\n  }\n\n  function unmemoize(obj: any): void {\n    if (hasWeakSet) {\n      inner.delete(obj);\n    } else {\n      for (let i = 0; i < inner.length; i++) {\n        if (inner[i] === obj) {\n          inner.splice(i, 1);\n          break;\n        }\n      }\n    }\n  }\n  return [memoize, unmemoize];\n}\n","import { Contexts, Event, EventHint, EventProcessor, ExtendedError, Hub, Integration } from '@sentry/types';\nimport { addNonEnumerableProperty, isError, isPlainObject, logger, normalize } from '@sentry/utils';\n\n/** JSDoc */\ninterface ExtraErrorDataOptions {\n  depth?: number;\n}\n\n/** Patch toString calls to return proper name for wrapped functions */\nexport class ExtraErrorData implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'ExtraErrorData';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = ExtraErrorData.id;\n\n  /** JSDoc */\n  private readonly _options: ExtraErrorDataOptions;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options?: ExtraErrorDataOptions) {\n    this._options = {\n      depth: 3,\n      ...options,\n    };\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    addGlobalEventProcessor((event: Event, hint: EventHint) => {\n      const self = getCurrentHub().getIntegration(ExtraErrorData);\n      if (!self) {\n        return event;\n      }\n      return self.enhanceEventWithErrorData(event, hint);\n    });\n  }\n\n  /**\n   * Attaches extracted information from the Error object to extra field in the Event\n   */\n  public enhanceEventWithErrorData(event: Event, hint: EventHint = {}): Event {\n    if (!hint.originalException || !isError(hint.originalException)) {\n      return event;\n    }\n    const exceptionName = (hint.originalException as ExtendedError).name || hint.originalException.constructor.name;\n\n    const errorData = this._extractErrorData(hint.originalException as ExtendedError);\n\n    if (errorData) {\n      const contexts: Contexts = {\n        ...event.contexts,\n      };\n\n      const normalizedErrorData = normalize(errorData, this._options.depth);\n\n      if (isPlainObject(normalizedErrorData)) {\n        // We mark the error data as \"already normalized\" here, because we don't want other normalization procedures to\n        // potentially truncate the data we just already normalized, with a certain depth setting.\n        addNonEnumerableProperty(normalizedErrorData, '__sentry_skip_normalization__', true);\n        contexts[exceptionName] = normalizedErrorData;\n      }\n\n      return {\n        ...event,\n        contexts,\n      };\n    }\n\n    return event;\n  }\n\n  /**\n   * Extract extra information from the Error object\n   */\n  private _extractErrorData(error: ExtendedError): Record<string, unknown> | null {\n    // We are trying to enhance already existing event, so no harm done if it won't succeed\n    try {\n      const nativeKeys = [\n        'name',\n        'message',\n        'stack',\n        'line',\n        'column',\n        'fileName',\n        'lineNumber',\n        'columnNumber',\n        'toJSON',\n      ];\n\n      const extraErrorInfo: Record<string, unknown> = {};\n\n      // We want only enumerable properties, thus `getOwnPropertyNames` is redundant here, as we filter keys anyway.\n      for (const key of Object.keys(error)) {\n        if (nativeKeys.indexOf(key) !== -1) {\n          continue;\n        }\n        const value = error[key];\n        extraErrorInfo[key] = isError(value) ? value.toString() : value;\n      }\n\n      // Check if someone attached `toJSON` method to grab even more properties (eg. axios is doing that)\n      if (typeof error.toJSON === 'function') {\n        const serializedError = error.toJSON() as Record<string, unknown>;\n\n        for (const key of Object.keys(serializedError)) {\n          const value = serializedError[key];\n          extraErrorInfo[key] = isError(value) ? value.toString() : value;\n        }\n      }\n\n      return extraErrorInfo;\n    } catch (oO) {\n      __DEBUG_BUILD__ && logger.error('Unable to extract extra data from the Error object:', oO);\n    }\n\n    return null;\n  }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport { Event, EventProcessor, Hub, Integration } from '@sentry/types';\nimport { GLOBAL_OBJ, logger, normalize, uuid4 } from '@sentry/utils';\nimport localForage from 'localforage';\n\nconst WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\ntype LocalForage = {\n  setItem<T>(key: string, value: T, callback?: (err: any, value: T) => void): Promise<T>;\n  iterate<T, U>(\n    iteratee: (value: T, key: string, iterationNumber: number) => U,\n    callback?: (err: any, result: U) => void,\n  ): Promise<U>;\n  removeItem(key: string, callback?: (err: any) => void): Promise<void>;\n  length(): Promise<number>;\n};\n\nexport type Item = { key: string; value: Event };\n\n/**\n * cache offline errors and send when connected\n */\nexport class Offline implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Offline';\n\n  /**\n   * @inheritDoc\n   */\n  public readonly name: string = Offline.id;\n\n  /**\n   * the current hub instance\n   */\n  public hub?: Hub;\n\n  /**\n   * maximum number of events to store while offline\n   */\n  public maxStoredEvents: number;\n\n  /**\n   * event cache\n   */\n  public offlineEventStore: LocalForage;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: { maxStoredEvents?: number } = {}) {\n    this.maxStoredEvents = options.maxStoredEvents || 30; // set a reasonable default\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    this.offlineEventStore = localForage.createInstance({\n      name: 'sentry/offlineEventStore',\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    this.hub = getCurrentHub();\n\n    if ('addEventListener' in WINDOW) {\n      WINDOW.addEventListener('online', () => {\n        void this._sendEvents().catch(() => {\n          __DEBUG_BUILD__ && logger.warn('could not send cached events');\n        });\n      });\n    }\n\n    const eventProcessor: EventProcessor = event => {\n      if (this.hub && this.hub.getIntegration(Offline)) {\n        // cache if we are positively offline\n        if ('navigator' in WINDOW && 'onLine' in WINDOW.navigator && !WINDOW.navigator.onLine) {\n          __DEBUG_BUILD__ && logger.log('Event dropped due to being a offline - caching instead');\n\n          void this._cacheEvent(event)\n            .then((_event: Event): Promise<void> => this._enforceMaxEvents())\n            .catch((_error): void => {\n              __DEBUG_BUILD__ && logger.warn('could not cache event while offline');\n            });\n\n          // return null on success or failure, because being offline will still result in an error\n          return null;\n        }\n      }\n\n      return event;\n    };\n\n    eventProcessor.id = this.name;\n    addGlobalEventProcessor(eventProcessor);\n\n    // if online now, send any events stored in a previous offline session\n    if ('navigator' in WINDOW && 'onLine' in WINDOW.navigator && WINDOW.navigator.onLine) {\n      void this._sendEvents().catch(() => {\n        __DEBUG_BUILD__ && logger.warn('could not send cached events');\n      });\n    }\n  }\n\n  /**\n   * cache an event to send later\n   * @param event an event\n   */\n  private async _cacheEvent(event: Event): Promise<Event> {\n    return this.offlineEventStore.setItem<Event>(uuid4(), normalize(event));\n  }\n\n  /**\n   * purge excess events if necessary\n   */\n  private async _enforceMaxEvents(): Promise<void> {\n    const events: Array<{ event: Event; cacheKey: string }> = [];\n\n    return this.offlineEventStore\n      .iterate<Event, void>((event: Event, cacheKey: string, _index: number): void => {\n        // aggregate events\n        events.push({ cacheKey, event });\n      })\n      .then(\n        (): Promise<void> =>\n          // this promise resolves when the iteration is finished\n          this._purgeEvents(\n            // purge all events past maxStoredEvents in reverse chronological order\n            events\n              .sort((a, b) => (b.event.timestamp || 0) - (a.event.timestamp || 0))\n              .slice(this.maxStoredEvents < events.length ? this.maxStoredEvents : events.length)\n              .map(event => event.cacheKey),\n          ),\n      )\n      .catch((_error): void => {\n        __DEBUG_BUILD__ && logger.warn('could not enforce max events');\n      });\n  }\n\n  /**\n   * purge event from cache\n   */\n  private async _purgeEvent(cacheKey: string): Promise<void> {\n    return this.offlineEventStore.removeItem(cacheKey);\n  }\n\n  /**\n   * purge events from cache\n   */\n  private async _purgeEvents(cacheKeys: string[]): Promise<void> {\n    // trail with .then to ensure the return type as void and not void|void[]\n    return Promise.all(cacheKeys.map(cacheKey => this._purgeEvent(cacheKey))).then();\n  }\n\n  /**\n   * send all events\n   */\n  private async _sendEvents(): Promise<void> {\n    return this.offlineEventStore.iterate<Event, void>((event: Event, cacheKey: string, _index: number): void => {\n      if (this.hub) {\n        this.hub.captureEvent(event);\n\n        void this._purgeEvent(cacheKey).catch((_error): void => {\n          __DEBUG_BUILD__ && logger.warn('could not purge event from cache');\n        });\n      } else {\n        __DEBUG_BUILD__ && logger.warn('no hub found - could not send cached event');\n      }\n    });\n  }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Event, Exception, Mechanism, StackFrame } from '@sentry/types';\n\nimport { addNonEnumerableProperty } from './object';\nimport { snipLine } from './string';\nimport { GLOBAL_OBJ } from './worldwide';\n\ninterface CryptoInternal {\n  getRandomValues(array: Uint8Array): Uint8Array;\n  randomUUID?(): string;\n}\n\n/** An interface for common properties on global */\ninterface CryptoGlobal {\n  msCrypto?: CryptoInternal;\n  crypto?: CryptoInternal;\n}\n\n/**\n * UUID4 generator\n *\n * @returns string Generated UUID4.\n */\nexport function uuid4(): string {\n  const gbl = GLOBAL_OBJ as typeof GLOBAL_OBJ & CryptoGlobal;\n  const crypto = gbl.crypto || gbl.msCrypto;\n\n  if (crypto && crypto.randomUUID) {\n    return crypto.randomUUID().replace(/-/g, '');\n  }\n\n  const getRandomByte =\n    crypto && crypto.getRandomValues ? () => crypto.getRandomValues(new Uint8Array(1))[0] : () => Math.random() * 16;\n\n  // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n  // Concatenating the following numbers as strings results in '10000000100040008000100000000000'\n  return (([1e7] as unknown as string) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, c =>\n    // eslint-disable-next-line no-bitwise\n    ((c as unknown as number) ^ ((getRandomByte() & 15) >> ((c as unknown as number) / 4))).toString(16),\n  );\n}\n\nfunction getFirstException(event: Event): Exception | undefined {\n  return event.exception && event.exception.values ? event.exception.values[0] : undefined;\n}\n\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\nexport function getEventDescription(event: Event): string {\n  const { message, event_id: eventId } = event;\n  if (message) {\n    return message;\n  }\n\n  const firstException = getFirstException(event);\n  if (firstException) {\n    if (firstException.type && firstException.value) {\n      return `${firstException.type}: ${firstException.value}`;\n    }\n    return firstException.type || firstException.value || eventId || '<unknown>';\n  }\n  return eventId || '<unknown>';\n}\n\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\nexport function addExceptionTypeValue(event: Event, value?: string, type?: string): void {\n  const exception = (event.exception = event.exception || {});\n  const values = (exception.values = exception.values || []);\n  const firstException = (values[0] = values[0] || {});\n  if (!firstException.value) {\n    firstException.value = value || '';\n  }\n  if (!firstException.type) {\n    firstException.type = type || 'Error';\n  }\n}\n\n/**\n * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed.\n *\n * @param event The event to modify.\n * @param newMechanism Mechanism data to add to the event.\n * @hidden\n */\nexport function addExceptionMechanism(event: Event, newMechanism?: Partial<Mechanism>): void {\n  const firstException = getFirstException(event);\n  if (!firstException) {\n    return;\n  }\n\n  const defaultMechanism = { type: 'generic', handled: true };\n  const currentMechanism = firstException.mechanism;\n  firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism };\n\n  if (newMechanism && 'data' in newMechanism) {\n    const mergedData = { ...(currentMechanism && currentMechanism.data), ...newMechanism.data };\n    firstException.mechanism.data = mergedData;\n  }\n}\n\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst SEMVER_REGEXP =\n  /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n\n/**\n * Represents Semantic Versioning object\n */\ninterface SemVer {\n  major?: number;\n  minor?: number;\n  patch?: number;\n  prerelease?: string;\n  buildmetadata?: string;\n}\n\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\nexport function parseSemver(input: string): SemVer {\n  const match = input.match(SEMVER_REGEXP) || [];\n  const major = parseInt(match[1], 10);\n  const minor = parseInt(match[2], 10);\n  const patch = parseInt(match[3], 10);\n  return {\n    buildmetadata: match[5],\n    major: isNaN(major) ? undefined : major,\n    minor: isNaN(minor) ? undefined : minor,\n    patch: isNaN(patch) ? undefined : patch,\n    prerelease: match[4],\n  };\n}\n\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\nexport function addContextToFrame(lines: string[], frame: StackFrame, linesOfContext: number = 5): void {\n  const lineno = frame.lineno || 0;\n  const maxLines = lines.length;\n  const sourceLine = Math.max(Math.min(maxLines, lineno - 1), 0);\n\n  frame.pre_context = lines\n    .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)\n    .map((line: string) => snipLine(line, 0));\n\n  frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);\n\n  frame.post_context = lines\n    .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)\n    .map((line: string) => snipLine(line, 0));\n}\n\n/**\n * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object\n * in question), and marks it captured if not.\n *\n * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and\n * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so\n * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because\n * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not\n * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This\n * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we\n * see it.\n *\n * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on\n * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent\n * object wrapper forms so that this check will always work. However, because we need to flag the exact object which\n * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification\n * must be done before the exception captured.\n *\n * @param A thrown exception to check or flag as having been seen\n * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)\n */\nexport function checkOrSetAlreadyCaught(exception: unknown): boolean {\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n  if (exception && (exception as any).__sentry_captured__) {\n    return true;\n  }\n\n  try {\n    // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the\n    // `ExtraErrorData` integration\n    addNonEnumerableProperty(exception as { [key: string]: unknown }, '__sentry_captured__', true);\n  } catch (err) {\n    // `exception` is a primitive, so we can't mark it seen\n  }\n\n  return false;\n}\n\n/**\n * Checks whether the given input is already an array, and if it isn't, wraps it in one.\n *\n * @param maybeArray Input to turn into an array, if necessary\n * @returns The input, if already an array, or an array with the input as the only element, if not\n */\nexport function arrayify<T = unknown>(maybeArray: T | T[]): T[] {\n  return Array.isArray(maybeArray) ? maybeArray : [maybeArray];\n}\n","import { logger } from './logger';\nimport { getGlobalObject } from './worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject<Window>();\n\n/**\n * Tells whether current environment supports ErrorEvent objects\n * {@link supportsErrorEvent}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsErrorEvent(): boolean {\n  try {\n    new ErrorEvent('');\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\n/**\n * Tells whether current environment supports DOMError objects\n * {@link supportsDOMError}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsDOMError(): boolean {\n  try {\n    // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError':\n    // 1 argument required, but only 0 present.\n    // @ts-ignore It really needs 1 argument, not 0.\n    new DOMError('');\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\n/**\n * Tells whether current environment supports DOMException objects\n * {@link supportsDOMException}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsDOMException(): boolean {\n  try {\n    new DOMException('');\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\n/**\n * Tells whether current environment supports Fetch API\n * {@link supportsFetch}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsFetch(): boolean {\n  if (!('fetch' in WINDOW)) {\n    return false;\n  }\n\n  try {\n    new Headers();\n    new Request('http://www.example.com');\n    new Response();\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n/**\n * isNativeFetch checks if the given function is a native implementation of fetch()\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function isNativeFetch(func: Function): boolean {\n  return func && /^function fetch\\(\\)\\s+\\{\\s+\\[native code\\]\\s+\\}$/.test(func.toString());\n}\n\n/**\n * Tells whether current environment supports Fetch API natively\n * {@link supportsNativeFetch}.\n *\n * @returns true if `window.fetch` is natively implemented, false otherwise\n */\nexport function supportsNativeFetch(): boolean {\n  if (!supportsFetch()) {\n    return false;\n  }\n\n  // Fast path to avoid DOM I/O\n  // eslint-disable-next-line @typescript-eslint/unbound-method\n  if (isNativeFetch(WINDOW.fetch)) {\n    return true;\n  }\n\n  // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension)\n  // so create a \"pure\" iframe to see if that has native fetch\n  let result = false;\n  const doc = WINDOW.document;\n  // eslint-disable-next-line deprecation/deprecation\n  if (doc && typeof (doc.createElement as unknown) === 'function') {\n    try {\n      const sandbox = doc.createElement('iframe');\n      sandbox.hidden = true;\n      doc.head.appendChild(sandbox);\n      if (sandbox.contentWindow && sandbox.contentWindow.fetch) {\n        // eslint-disable-next-line @typescript-eslint/unbound-method\n        result = isNativeFetch(sandbox.contentWindow.fetch);\n      }\n      doc.head.removeChild(sandbox);\n    } catch (err) {\n      __DEBUG_BUILD__ &&\n        logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err);\n    }\n  }\n\n  return result;\n}\n\n/**\n * Tells whether current environment supports ReportingObserver API\n * {@link supportsReportingObserver}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsReportingObserver(): boolean {\n  return 'ReportingObserver' in WINDOW;\n}\n\n/**\n * Tells whether current environment supports Referrer Policy API\n * {@link supportsReferrerPolicy}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsReferrerPolicy(): boolean {\n  // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'\n  // (see https://caniuse.com/#feat=referrer-policy),\n  // it doesn't. And it throws an exception instead of ignoring this parameter...\n  // REF: https://github.com/getsentry/raven-js/issues/1233\n\n  if (!supportsFetch()) {\n    return false;\n  }\n\n  try {\n    new Request('_', {\n      referrerPolicy: 'origin' as ReferrerPolicy,\n    });\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\n/**\n * Tells whether current environment supports History API\n * {@link supportsHistory}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsHistory(): boolean {\n  // NOTE: in Chrome App environment, touching history.pushState, *even inside\n  //       a try/catch block*, will cause Chrome to output an error to console.error\n  // borrowed from: https://github.com/angular/angular.js/pull/13945/files\n  /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const chrome = (WINDOW as any).chrome;\n  const isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n  /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n  const hasHistoryApi = 'history' in WINDOW && !!WINDOW.history.pushState && !!WINDOW.history.replaceState;\n\n  return !isChromePackagedApp && hasHistoryApi;\n}\n","import { EventProcessor, Hub, Integration } from '@sentry/types';\nimport { GLOBAL_OBJ, supportsReportingObserver } from '@sentry/utils';\n\nconst WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\ninterface Report {\n  [key: string]: unknown;\n  type: ReportTypes;\n  url: string;\n  body?: ReportBody;\n}\n\ntype ReportTypes = 'crash' | 'deprecation' | 'intervention';\n\ntype ReportBody = CrashReportBody | DeprecationReportBody | InterventionReportBody;\n\ninterface CrashReportBody {\n  [key: string]: unknown;\n  crashId: string;\n  reason?: string;\n}\n\ninterface DeprecationReportBody {\n  [key: string]: unknown;\n  id: string;\n  anticipatedRemoval?: Date;\n  message: string;\n  sourceFile?: string;\n  lineNumber?: number;\n  columnNumber?: number;\n}\n\ninterface InterventionReportBody {\n  [key: string]: unknown;\n  id: string;\n  message: string;\n  sourceFile?: string;\n  lineNumber?: number;\n  columnNumber?: number;\n}\n\n/** Reporting API integration - https://w3c.github.io/reporting/ */\nexport class ReportingObserver implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'ReportingObserver';\n\n  /**\n   * @inheritDoc\n   */\n  public readonly name: string = ReportingObserver.id;\n\n  /**\n   * Returns current hub.\n   */\n  private _getCurrentHub?: () => Hub;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(\n    private readonly _options: {\n      types?: ReportTypes[];\n    } = {\n      types: ['crash', 'deprecation', 'intervention'],\n    },\n  ) {}\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    if (!supportsReportingObserver()) {\n      return;\n    }\n\n    this._getCurrentHub = getCurrentHub;\n\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n    const observer = new (WINDOW as any).ReportingObserver(this.handler.bind(this), {\n      buffered: true,\n      types: this._options.types,\n    });\n\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    observer.observe();\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public handler(reports: Report[]): void {\n    const hub = this._getCurrentHub && this._getCurrentHub();\n    if (!hub || !hub.getIntegration(ReportingObserver)) {\n      return;\n    }\n    for (const report of reports) {\n      hub.withScope(scope => {\n        scope.setExtra('url', report.url);\n\n        const label = `ReportingObserver [${report.type}]`;\n        let details = 'No details available';\n\n        if (report.body) {\n          // Object.keys doesn't work on ReportBody, as all properties are inheirted\n          const plainBody: {\n            [key: string]: unknown;\n          } = {};\n\n          // eslint-disable-next-line guard-for-in\n          for (const prop in report.body) {\n            plainBody[prop] = report.body[prop];\n          }\n\n          scope.setExtra('body', plainBody);\n\n          if (report.type === 'crash') {\n            const body = report.body as CrashReportBody;\n            // A fancy way to create a message out of crashId OR reason OR both OR fallback\n            details = [body.crashId || '', body.reason || ''].join(' ').trim() || details;\n          } else {\n            const body = report.body as DeprecationReportBody | InterventionReportBody;\n            details = body.message || details;\n          }\n        }\n\n        hub.captureMessage(`${label}: ${details}`);\n      });\n    }\n  }\n}\n","// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript\n// https://raw.githubusercontent.com/calvinmetcalf/rollup-plugin-node-builtins/master/src/es6/path.js\n\n/** JSDoc */\nfunction normalizeArray(parts: string[], allowAboveRoot?: boolean): string[] {\n  // if the path tries to go above the root, `up` ends up > 0\n  let up = 0;\n  for (let i = parts.length - 1; i >= 0; i--) {\n    const last = parts[i];\n    if (last === '.') {\n      parts.splice(i, 1);\n    } else if (last === '..') {\n      parts.splice(i, 1);\n      up++;\n    } else if (up) {\n      parts.splice(i, 1);\n      up--;\n    }\n  }\n\n  // if the path is allowed to go above the root, restore leading ..s\n  if (allowAboveRoot) {\n    for (; up--; up) {\n      parts.unshift('..');\n    }\n  }\n\n  return parts;\n}\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nconst splitPathRe = /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^/]+?|)(\\.[^./]*|))(?:[/]*)$/;\n/** JSDoc */\nfunction splitPath(filename: string): string[] {\n  const parts = splitPathRe.exec(filename);\n  return parts ? parts.slice(1) : [];\n}\n\n// path.resolve([from ...], to)\n// posix version\n/** JSDoc */\nexport function resolve(...args: string[]): string {\n  let resolvedPath = '';\n  let resolvedAbsolute = false;\n\n  for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n    const path = i >= 0 ? args[i] : '/';\n\n    // Skip empty entries\n    if (!path) {\n      continue;\n    }\n\n    resolvedPath = `${path}/${resolvedPath}`;\n    resolvedAbsolute = path.charAt(0) === '/';\n  }\n\n  // At this point the path should be resolved to a full absolute path, but\n  // handle relative paths to be safe (might happen when process.cwd() fails)\n\n  // Normalize the path\n  resolvedPath = normalizeArray(\n    resolvedPath.split('/').filter(p => !!p),\n    !resolvedAbsolute,\n  ).join('/');\n\n  return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';\n}\n\n/** JSDoc */\nfunction trim(arr: string[]): string[] {\n  let start = 0;\n  for (; start < arr.length; start++) {\n    if (arr[start] !== '') {\n      break;\n    }\n  }\n\n  let end = arr.length - 1;\n  for (; end >= 0; end--) {\n    if (arr[end] !== '') {\n      break;\n    }\n  }\n\n  if (start > end) {\n    return [];\n  }\n  return arr.slice(start, end - start + 1);\n}\n\n// path.relative(from, to)\n// posix version\n/** JSDoc */\nexport function relative(from: string, to: string): string {\n  /* eslint-disable no-param-reassign */\n  from = resolve(from).substr(1);\n  to = resolve(to).substr(1);\n  /* eslint-enable no-param-reassign */\n\n  const fromParts = trim(from.split('/'));\n  const toParts = trim(to.split('/'));\n\n  const length = Math.min(fromParts.length, toParts.length);\n  let samePartsLength = length;\n  for (let i = 0; i < length; i++) {\n    if (fromParts[i] !== toParts[i]) {\n      samePartsLength = i;\n      break;\n    }\n  }\n\n  let outputParts = [];\n  for (let i = samePartsLength; i < fromParts.length; i++) {\n    outputParts.push('..');\n  }\n\n  outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n  return outputParts.join('/');\n}\n\n// path.normalize(path)\n// posix version\n/** JSDoc */\nexport function normalizePath(path: string): string {\n  const isPathAbsolute = isAbsolute(path);\n  const trailingSlash = path.substr(-1) === '/';\n\n  // Normalize the path\n  let normalizedPath = normalizeArray(\n    path.split('/').filter(p => !!p),\n    !isPathAbsolute,\n  ).join('/');\n\n  if (!normalizedPath && !isPathAbsolute) {\n    normalizedPath = '.';\n  }\n  if (normalizedPath && trailingSlash) {\n    normalizedPath += '/';\n  }\n\n  return (isPathAbsolute ? '/' : '') + normalizedPath;\n}\n\n// posix version\n/** JSDoc */\nexport function isAbsolute(path: string): boolean {\n  return path.charAt(0) === '/';\n}\n\n// posix version\n/** JSDoc */\nexport function join(...args: string[]): string {\n  return normalizePath(args.join('/'));\n}\n\n/** JSDoc */\nexport function dirname(path: string): string {\n  const result = splitPath(path);\n  const root = result[0];\n  let dir = result[1];\n\n  if (!root && !dir) {\n    // No dirname whatsoever\n    return '.';\n  }\n\n  if (dir) {\n    // It has a dirname, strip trailing slash\n    dir = dir.substr(0, dir.length - 1);\n  }\n\n  return root + dir;\n}\n\n/** JSDoc */\nexport function basename(path: string, ext?: string): string {\n  let f = splitPath(path)[2];\n  if (ext && f.substr(ext.length * -1) === ext) {\n    f = f.substr(0, f.length - ext.length);\n  }\n  return f;\n}\n","import { Event, EventProcessor, Hub, Integration, StackFrame, Stacktrace } from '@sentry/types';\nimport { basename, relative } from '@sentry/utils';\n\ntype StackFrameIteratee = (frame: StackFrame) => StackFrame;\n\n/** Rewrite event frames paths */\nexport class RewriteFrames implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'RewriteFrames';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = RewriteFrames.id;\n\n  /**\n   * @inheritDoc\n   */\n  private readonly _root?: string;\n\n  /**\n   * @inheritDoc\n   */\n  private readonly _prefix: string = 'app:///';\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: { root?: string; prefix?: string; iteratee?: StackFrameIteratee } = {}) {\n    if (options.root) {\n      this._root = options.root;\n    }\n    if (options.prefix) {\n      this._prefix = options.prefix;\n    }\n    if (options.iteratee) {\n      this._iteratee = options.iteratee;\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    addGlobalEventProcessor(event => {\n      const self = getCurrentHub().getIntegration(RewriteFrames);\n      if (self) {\n        return self.process(event);\n      }\n      return event;\n    });\n  }\n\n  /** JSDoc */\n  public process(originalEvent: Event): Event {\n    let processedEvent = originalEvent;\n\n    if (originalEvent.exception && Array.isArray(originalEvent.exception.values)) {\n      processedEvent = this._processExceptionsEvent(processedEvent);\n    }\n\n    return processedEvent;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  private readonly _iteratee: StackFrameIteratee = (frame: StackFrame) => {\n    if (!frame.filename) {\n      return frame;\n    }\n    // Check if the frame filename begins with `/` or a Windows-style prefix such as `C:\\`\n    const isWindowsFrame = /^[A-Z]:\\\\/.test(frame.filename);\n    const startsWithSlash = /^\\//.test(frame.filename);\n    if (isWindowsFrame || startsWithSlash) {\n      const filename = isWindowsFrame\n        ? frame.filename\n            .replace(/^[A-Z]:/, '') // remove Windows-style prefix\n            .replace(/\\\\/g, '/') // replace all `\\\\` instances with `/`\n        : frame.filename;\n      const base = this._root ? relative(this._root, filename) : basename(filename);\n      frame.filename = `${this._prefix}${base}`;\n    }\n    return frame;\n  };\n\n  /** JSDoc */\n  private _processExceptionsEvent(event: Event): Event {\n    try {\n      return {\n        ...event,\n        exception: {\n          ...event.exception,\n          // The check for this is performed inside `process` call itself, safe to skip here\n          // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n          values: event.exception!.values!.map(value => ({\n            ...value,\n            ...(value.stacktrace && { stacktrace: this._processStacktrace(value.stacktrace) }),\n          })),\n        },\n      };\n    } catch (_oO) {\n      return event;\n    }\n  }\n\n  /** JSDoc */\n  private _processStacktrace(stacktrace?: Stacktrace): Stacktrace {\n    return {\n      ...stacktrace,\n      frames: stacktrace && stacktrace.frames && stacktrace.frames.map(f => this._iteratee(f)),\n    };\n  }\n}\n","import { Event, EventProcessor, Hub, Integration } from '@sentry/types';\n\n/** This function adds duration since Sentry was initialized till the time event was sent */\nexport class SessionTiming implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'SessionTiming';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = SessionTiming.id;\n\n  /** Exact time Client was initialized expressed in milliseconds since Unix Epoch. */\n  protected readonly _startTime: number = Date.now();\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    addGlobalEventProcessor(event => {\n      const self = getCurrentHub().getIntegration(SessionTiming);\n      if (self) {\n        return self.process(event);\n      }\n      return event;\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public process(event: Event): Event {\n    const now = Date.now();\n\n    return {\n      ...event,\n      extra: {\n        ...event.extra,\n        ['session:start']: this._startTime,\n        ['session:duration']: now - this._startTime,\n        ['session:end']: now,\n      },\n    };\n  }\n}\n","import { Event, EventProcessor, Hub, Integration, StackFrame } from '@sentry/types';\n\n/** Add node transaction to the event */\nexport class Transaction implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Transaction';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Transaction.id;\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    addGlobalEventProcessor(event => {\n      const self = getCurrentHub().getIntegration(Transaction);\n      if (self) {\n        return self.process(event);\n      }\n      return event;\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public process(event: Event): Event {\n    const frames = this._getFramesFromEvent(event);\n\n    // use for loop so we don't have to reverse whole frames array\n    for (let i = frames.length - 1; i >= 0; i--) {\n      const frame = frames[i];\n\n      if (frame.in_app === true) {\n        event.transaction = this._getTransaction(frame);\n        break;\n      }\n    }\n\n    return event;\n  }\n\n  /** JSDoc */\n  private _getFramesFromEvent(event: Event): StackFrame[] {\n    const exception = event.exception && event.exception.values && event.exception.values[0];\n    return (exception && exception.stacktrace && exception.stacktrace.frames) || [];\n  }\n\n  /** JSDoc */\n  private _getTransaction(frame: StackFrame): string {\n    return frame.module || frame.function ? `${frame.module || '?'}/${frame.function || '?'}` : '<unknown>';\n  }\n}\n","import type { Event, EventHint, Exception, ExtendedError, StackParser } from '@sentry/types';\n\nimport { isInstanceOf } from './is';\nimport { truncate } from './string';\n\n/**\n * Creates exceptions inside `event.exception.values` for errors that are nested on properties based on the `key` parameter.\n */\nexport function applyAggregateErrorsToEvent(\n  exceptionFromErrorImplementation: (stackParser: StackParser, ex: Error) => Exception,\n  parser: StackParser,\n  maxValueLimit: number = 250,\n  key: string,\n  limit: number,\n  event: Event,\n  hint?: EventHint,\n): void {\n  if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n    return;\n  }\n\n  // Generally speaking the last item in `event.exception.values` is the exception originating from the original Error\n  const originalException: Exception | undefined =\n    event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : undefined;\n\n  // We only create exception grouping if there is an exception in the event.\n  if (originalException) {\n    event.exception.values = truncateAggregateExceptions(\n      aggregateExceptionsFromError(\n        exceptionFromErrorImplementation,\n        parser,\n        limit,\n        hint.originalException as ExtendedError,\n        key,\n        event.exception.values,\n        originalException,\n        0,\n      ),\n      maxValueLimit,\n    );\n  }\n}\n\nfunction aggregateExceptionsFromError(\n  exceptionFromErrorImplementation: (stackParser: StackParser, ex: Error) => Exception,\n  parser: StackParser,\n  limit: number,\n  error: ExtendedError,\n  key: string,\n  prevExceptions: Exception[],\n  exception: Exception,\n  exceptionId: number,\n): Exception[] {\n  if (prevExceptions.length >= limit + 1) {\n    return prevExceptions;\n  }\n\n  let newExceptions = [...prevExceptions];\n\n  if (isInstanceOf(error[key], Error)) {\n    applyExceptionGroupFieldsForParentException(exception, exceptionId);\n    const newException = exceptionFromErrorImplementation(parser, error[key]);\n    const newExceptionId = newExceptions.length;\n    applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId);\n    newExceptions = aggregateExceptionsFromError(\n      exceptionFromErrorImplementation,\n      parser,\n      limit,\n      error[key],\n      key,\n      [newException, ...newExceptions],\n      newException,\n      newExceptionId,\n    );\n  }\n\n  // This will create exception grouping for AggregateErrors\n  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError\n  if (Array.isArray(error.errors)) {\n    error.errors.forEach((childError, i) => {\n      if (isInstanceOf(childError, Error)) {\n        applyExceptionGroupFieldsForParentException(exception, exceptionId);\n        const newException = exceptionFromErrorImplementation(parser, childError);\n        const newExceptionId = newExceptions.length;\n        applyExceptionGroupFieldsForChildException(newException, `errors[${i}]`, newExceptionId, exceptionId);\n        newExceptions = aggregateExceptionsFromError(\n          exceptionFromErrorImplementation,\n          parser,\n          limit,\n          childError,\n          key,\n          [newException, ...newExceptions],\n          newException,\n          newExceptionId,\n        );\n      }\n    });\n  }\n\n  return newExceptions;\n}\n\nfunction applyExceptionGroupFieldsForParentException(exception: Exception, exceptionId: number): void {\n  // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default.\n  exception.mechanism = exception.mechanism || { type: 'generic', handled: true };\n\n  exception.mechanism = {\n    ...exception.mechanism,\n    is_exception_group: true,\n    exception_id: exceptionId,\n  };\n}\n\nfunction applyExceptionGroupFieldsForChildException(\n  exception: Exception,\n  source: string,\n  exceptionId: number,\n  parentId: number | undefined,\n): void {\n  // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default.\n  exception.mechanism = exception.mechanism || { type: 'generic', handled: true };\n\n  exception.mechanism = {\n    ...exception.mechanism,\n    type: 'chained',\n    source,\n    exception_id: exceptionId,\n    parent_id: parentId,\n  };\n}\n\n/**\n * Truncate the message (exception.value) of all exceptions in the event.\n * Because this event processor is ran after `applyClientOptions`,\n * we need to truncate the message of the added exceptions here.\n */\nfunction truncateAggregateExceptions(exceptions: Exception[], maxValueLength: number): Exception[] {\n  return exceptions.map(exception => {\n    if (exception.value) {\n      exception.value = truncate(exception.value, maxValueLength);\n    }\n    return exception;\n  });\n}\n","import type { DynamicSamplingContext } from '@sentry/types';\n\nimport { isString } from './is';\nimport { logger } from './logger';\n\nexport const BAGGAGE_HEADER_NAME = 'baggage';\n\nexport const SENTRY_BAGGAGE_KEY_PREFIX = 'sentry-';\n\nexport const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/;\n\n/**\n * Max length of a serialized baggage string\n *\n * https://www.w3.org/TR/baggage/#limits\n */\nexport const MAX_BAGGAGE_STRING_LENGTH = 8192;\n\n/**\n * Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the \"sentry-\" prefixed values\n * from it.\n *\n * @param baggageHeader A very bread definition of a baggage header as it might appear in various frameworks.\n * @returns The Dynamic Sampling Context that was found on `baggageHeader`, if there was any, `undefined` otherwise.\n */\nexport function baggageHeaderToDynamicSamplingContext(\n  // Very liberal definition of what any incoming header might look like\n  baggageHeader: string | string[] | number | null | undefined | boolean,\n): Partial<DynamicSamplingContext> | undefined {\n  if (!isString(baggageHeader) && !Array.isArray(baggageHeader)) {\n    return undefined;\n  }\n\n  // Intermediary object to store baggage key value pairs of incoming baggage headers on.\n  // It is later used to read Sentry-DSC-values from.\n  let baggageObject: Readonly<Record<string, string>> = {};\n\n  if (Array.isArray(baggageHeader)) {\n    // Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it\n    baggageObject = baggageHeader.reduce<Record<string, string>>((acc, curr) => {\n      const currBaggageObject = baggageHeaderToObject(curr);\n      return {\n        ...acc,\n        ...currBaggageObject,\n      };\n    }, {});\n  } else {\n    // Return undefined if baggage header is an empty string (technically an empty baggage header is not spec conform but\n    // this is how we choose to handle it)\n    if (!baggageHeader) {\n      return undefined;\n    }\n\n    baggageObject = baggageHeaderToObject(baggageHeader);\n  }\n\n  // Read all \"sentry-\" prefixed values out of the baggage object and put it onto a dynamic sampling context object.\n  const dynamicSamplingContext = Object.entries(baggageObject).reduce<Record<string, string>>((acc, [key, value]) => {\n    if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) {\n      const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length);\n      acc[nonPrefixedKey] = value;\n    }\n    return acc;\n  }, {});\n\n  // Only return a dynamic sampling context object if there are keys in it.\n  // A keyless object means there were no sentry values on the header, which means that there is no DSC.\n  if (Object.keys(dynamicSamplingContext).length > 0) {\n    return dynamicSamplingContext as Partial<DynamicSamplingContext>;\n  } else {\n    return undefined;\n  }\n}\n\n/**\n * Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with \"sentry-\".\n *\n * @param dynamicSamplingContext The Dynamic Sampling Context to turn into a header. For convenience and compatibility\n * with the `getDynamicSamplingContext` method on the Transaction class ,this argument can also be `undefined`. If it is\n * `undefined` the function will return `undefined`.\n * @returns a baggage header, created from `dynamicSamplingContext`, or `undefined` either if `dynamicSamplingContext`\n * was `undefined`, or if `dynamicSamplingContext` didn't contain any values.\n */\nexport function dynamicSamplingContextToSentryBaggageHeader(\n  // this also takes undefined for convenience and bundle size in other places\n  dynamicSamplingContext?: Partial<DynamicSamplingContext>,\n): string | undefined {\n  if (!dynamicSamplingContext) {\n    return undefined;\n  }\n\n  // Prefix all DSC keys with \"sentry-\" and put them into a new object\n  const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce<Record<string, string>>(\n    (acc, [dscKey, dscValue]) => {\n      if (dscValue) {\n        acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue;\n      }\n      return acc;\n    },\n    {},\n  );\n\n  return objectToBaggageHeader(sentryPrefixedDSC);\n}\n\n/**\n * Will parse a baggage header, which is a simple key-value map, into a flat object.\n *\n * @param baggageHeader The baggage header to parse.\n * @returns a flat object containing all the key-value pairs from `baggageHeader`.\n */\nfunction baggageHeaderToObject(baggageHeader: string): Record<string, string> {\n  return baggageHeader\n    .split(',')\n    .map(baggageEntry => baggageEntry.split('=').map(keyOrValue => decodeURIComponent(keyOrValue.trim())))\n    .reduce<Record<string, string>>((acc, [key, value]) => {\n      acc[key] = value;\n      return acc;\n    }, {});\n}\n\n/**\n * Turns a flat object (key-value pairs) into a baggage header, which is also just key-value pairs.\n *\n * @param object The object to turn into a baggage header.\n * @returns a baggage header string, or `undefined` if the object didn't have any values, since an empty baggage header\n * is not spec compliant.\n */\nfunction objectToBaggageHeader(object: Record<string, string>): string | undefined {\n  if (Object.keys(object).length === 0) {\n    // An empty baggage header is not spec compliant: We return undefined.\n    return undefined;\n  }\n\n  return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => {\n    const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`;\n    const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`;\n    if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) {\n      __DEBUG_BUILD__ &&\n        logger.warn(\n          `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`,\n        );\n      return baggageHeader;\n    } else {\n      return newBaggageHeader;\n    }\n  }, '');\n}\n","import type { ClientReport, ClientReportEnvelope, ClientReportItem } from '@sentry/types';\n\nimport { createEnvelope } from './envelope';\nimport { dateTimestampInSeconds } from './time';\n\n/**\n * Creates client report envelope\n * @param discarded_events An array of discard events\n * @param dsn A DSN that can be set on the header. Optional.\n */\nexport function createClientReportEnvelope(\n  discarded_events: ClientReport['discarded_events'],\n  dsn?: string,\n  timestamp?: number,\n): ClientReportEnvelope {\n  const clientReportItem: ClientReportItem = [\n    { type: 'client_report' },\n    {\n      timestamp: timestamp || dateTimestampInSeconds(),\n      discarded_events,\n    },\n  ];\n  return createEnvelope<ClientReportEnvelope>(dsn ? { dsn } : {}, [clientReportItem]);\n}\n","import type { DsnComponents, DsnLike, DsnProtocol } from '@sentry/types';\n\nimport { logger } from './logger';\n\n/** Regular expression used to parse a Dsn. */\nconst DSN_REGEX = /^(?:(\\w+):)\\/\\/(?:(\\w+)(?::(\\w+)?)?@)([\\w.-]+)(?::(\\d+))?\\/(.+)/;\n\nfunction isValidProtocol(protocol?: string): protocol is DsnProtocol {\n  return protocol === 'http' || protocol === 'https';\n}\n\n/**\n * Renders the string representation of this Dsn.\n *\n * By default, this will render the public representation without the password\n * component. To get the deprecated private representation, set `withPassword`\n * to true.\n *\n * @param withPassword When set to true, the password will be included.\n */\nexport function dsnToString(dsn: DsnComponents, withPassword: boolean = false): string {\n  const { host, path, pass, port, projectId, protocol, publicKey } = dsn;\n  return (\n    `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` +\n    `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}`\n  );\n}\n\n/**\n * Parses a Dsn from a given string.\n *\n * @param str A Dsn as string\n * @returns Dsn as DsnComponents or undefined if @param str is not a valid DSN string\n */\nexport function dsnFromString(str: string): DsnComponents | undefined {\n  const match = DSN_REGEX.exec(str);\n\n  if (!match) {\n    // This should be logged to the console\n    // eslint-disable-next-line no-console\n    console.error(`Invalid Sentry Dsn: ${str}`);\n    return undefined;\n  }\n\n  const [protocol, publicKey, pass = '', host, port = '', lastPath] = match.slice(1);\n  let path = '';\n  let projectId = lastPath;\n\n  const split = projectId.split('/');\n  if (split.length > 1) {\n    path = split.slice(0, -1).join('/');\n    projectId = split.pop() as string;\n  }\n\n  if (projectId) {\n    const projectMatch = projectId.match(/^\\d+/);\n    if (projectMatch) {\n      projectId = projectMatch[0];\n    }\n  }\n\n  return dsnFromComponents({ host, pass, path, projectId, port, protocol: protocol as DsnProtocol, publicKey });\n}\n\nfunction dsnFromComponents(components: DsnComponents): DsnComponents {\n  return {\n    protocol: components.protocol,\n    publicKey: components.publicKey || '',\n    pass: components.pass || '',\n    host: components.host,\n    port: components.port || '',\n    path: components.path || '',\n    projectId: components.projectId,\n  };\n}\n\nfunction validateDsn(dsn: DsnComponents): boolean {\n  if (!__DEBUG_BUILD__) {\n    return true;\n  }\n\n  const { port, projectId, protocol } = dsn;\n\n  const requiredComponents: ReadonlyArray<keyof DsnComponents> = ['protocol', 'publicKey', 'host', 'projectId'];\n  const hasMissingRequiredComponent = requiredComponents.find(component => {\n    if (!dsn[component]) {\n      logger.error(`Invalid Sentry Dsn: ${component} missing`);\n      return true;\n    }\n    return false;\n  });\n\n  if (hasMissingRequiredComponent) {\n    return false;\n  }\n\n  if (!projectId.match(/^\\d+$/)) {\n    logger.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);\n    return false;\n  }\n\n  if (!isValidProtocol(protocol)) {\n    logger.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);\n    return false;\n  }\n\n  if (port && isNaN(parseInt(port, 10))) {\n    logger.error(`Invalid Sentry Dsn: Invalid port ${port}`);\n    return false;\n  }\n\n  return true;\n}\n\n/**\n * Creates a valid Sentry Dsn object, identifying a Sentry instance and project.\n * @returns a valid DsnComponents object or `undefined` if @param from is an invalid DSN source\n */\nexport function makeDsn(from: DsnLike): DsnComponents | undefined {\n  const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from);\n  if (!components || !validateDsn(components)) {\n    return undefined;\n  }\n  return components;\n}\n","/*\n * This module exists for optimizations in the build process through rollup and terser.  We define some global\n * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these\n * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will\n * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to\n * `logger` and preventing node-related code from appearing in browser bundles.\n *\n * Attention:\n * This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by\n * users. These flags should live in their respective packages, as we identified user tooling (specifically webpack)\n * having issues tree-shaking these constants across package boundaries.\n * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want\n * users to be able to shake away expressions that it guards.\n */\n\ndeclare const __SENTRY_BROWSER_BUNDLE__: boolean | undefined;\n\nexport type SdkSource = 'npm' | 'cdn' | 'loader';\n\n/**\n * Figures out if we're building a browser bundle.\n *\n * @returns true if this is a browser bundle build.\n */\nexport function isBrowserBundle(): boolean {\n  return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__;\n}\n\n/**\n * Get source of SDK.\n */\nexport function getSDKSource(): SdkSource {\n  // @ts-expect-error __SENTRY_SDK_SOURCE__ is injected by rollup during build process\n  return __SENTRY_SDK_SOURCE__;\n}\n","import type { ConsoleLevel } from './logger';\n\n/** An error emitted by Sentry SDKs and related utilities. */\nexport class SentryError extends Error {\n  /** Display name of this error instance. */\n  public name: string;\n\n  public logLevel: ConsoleLevel;\n\n  public constructor(public message: string, logLevel: ConsoleLevel = 'warn') {\n    super(message);\n\n    this.name = new.target.prototype.constructor.name;\n    // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line\n    // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes\n    // instances of `SentryError` fail `obj instanceof SentryError` checks.\n    Object.setPrototypeOf(this, new.target.prototype);\n    this.logLevel = logLevel;\n  }\n}\n","// TODO: Remove this file once equivalent integration is used everywhere\n\n/* eslint-disable complexity */\n/**\n * The functions here, which enrich an event with request data, are mostly for use in Node, but are safe for use in a\n * browser context. They live here in `@sentry/utils` rather than in `@sentry/node` so that they can be used in\n * frameworks (like nextjs), which, because of SSR, run the same code in both Node and browser contexts.\n *\n * TODO (v8 / #5257): Remove the note below\n * Note that for now, the tests for this code have to live in `@sentry/node`, since they test both these functions and\n * the backwards-compatibility-preserving wrappers which still live in `handlers.ts` there.\n */\n\n/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type {\n  Event,\n  ExtractedNodeRequestData,\n  PolymorphicRequest,\n  Transaction,\n  TransactionSource,\n} from '@sentry/types';\n\nimport { isPlainObject, isString } from './is';\nimport { normalize } from './normalize';\nimport { stripUrlQueryAndFragment } from './url';\n\nconst DEFAULT_INCLUDES = {\n  ip: false,\n  request: true,\n  transaction: true,\n  user: true,\n};\nconst DEFAULT_REQUEST_INCLUDES = ['cookies', 'data', 'headers', 'method', 'query_string', 'url'];\nconst DEFAULT_USER_INCLUDES = ['id', 'username', 'email'];\n\ntype InjectedNodeDeps = {\n  cookie: {\n    parse: (cookieStr: string) => Record<string, string>;\n  };\n  url: {\n    parse: (urlStr: string) => {\n      query: string | null;\n    };\n  };\n};\n\n/**\n * Sets parameterized route as transaction name e.g.: `GET /users/:id`\n * Also adds more context data on the transaction from the request\n */\nexport function addRequestDataToTransaction(\n  transaction: Transaction | undefined,\n  req: PolymorphicRequest,\n  deps?: InjectedNodeDeps,\n): void {\n  if (!transaction) return;\n  if (!transaction.metadata.source || transaction.metadata.source === 'url') {\n    // Attempt to grab a parameterized route off of the request\n    transaction.setName(...extractPathForTransaction(req, { path: true, method: true }));\n  }\n  transaction.setData('url', req.originalUrl || req.url);\n  if (req.baseUrl) {\n    transaction.setData('baseUrl', req.baseUrl);\n  }\n  transaction.setData('query', extractQueryParams(req, deps));\n}\n\n/**\n * Extracts a complete and parameterized path from the request object and uses it to construct transaction name.\n * If the parameterized transaction name cannot be extracted, we fall back to the raw URL.\n *\n * Additionally, this function determines and returns the transaction name source\n *\n * eg. GET /mountpoint/user/:id\n *\n * @param req A request object\n * @param options What to include in the transaction name (method, path, or a custom route name to be\n *                used instead of the request's route)\n *\n * @returns A tuple of the fully constructed transaction name [0] and its source [1] (can be either 'route' or 'url')\n */\nexport function extractPathForTransaction(\n  req: PolymorphicRequest,\n  options: { path?: boolean; method?: boolean; customRoute?: string } = {},\n): [string, TransactionSource] {\n  const method = req.method && req.method.toUpperCase();\n\n  let path = '';\n  let source: TransactionSource = 'url';\n\n  // Check to see if there's a parameterized route we can use (as there is in Express)\n  if (options.customRoute || req.route) {\n    path = options.customRoute || `${req.baseUrl || ''}${req.route && req.route.path}`;\n    source = 'route';\n  }\n\n  // Otherwise, just take the original URL\n  else if (req.originalUrl || req.url) {\n    path = stripUrlQueryAndFragment(req.originalUrl || req.url || '');\n  }\n\n  let name = '';\n  if (options.method && method) {\n    name += method;\n  }\n  if (options.method && options.path) {\n    name += ' ';\n  }\n  if (options.path && path) {\n    name += path;\n  }\n\n  return [name, source];\n}\n\ntype TransactionNamingScheme = 'path' | 'methodPath' | 'handler';\n\n/** JSDoc */\nfunction extractTransaction(req: PolymorphicRequest, type: boolean | TransactionNamingScheme): string {\n  switch (type) {\n    case 'path': {\n      return extractPathForTransaction(req, { path: true })[0];\n    }\n    case 'handler': {\n      return (req.route && req.route.stack && req.route.stack[0] && req.route.stack[0].name) || '<anonymous>';\n    }\n    case 'methodPath':\n    default: {\n      return extractPathForTransaction(req, { path: true, method: true })[0];\n    }\n  }\n}\n\n/** JSDoc */\nfunction extractUserData(\n  user: {\n    [key: string]: any;\n  },\n  keys: boolean | string[],\n): { [key: string]: any } {\n  const extractedUser: { [key: string]: any } = {};\n  const attributes = Array.isArray(keys) ? keys : DEFAULT_USER_INCLUDES;\n\n  attributes.forEach(key => {\n    if (user && key in user) {\n      extractedUser[key] = user[key];\n    }\n  });\n\n  return extractedUser;\n}\n\n/**\n * Normalize data from the request object, accounting for framework differences.\n *\n * @param req The request object from which to extract data\n * @param options.include An optional array of keys to include in the normalized data. Defaults to\n * DEFAULT_REQUEST_INCLUDES if not provided.\n * @param options.deps Injected, platform-specific dependencies\n * @returns An object containing normalized request data\n */\nexport function extractRequestData(\n  req: PolymorphicRequest,\n  options?: {\n    include?: string[];\n    deps?: InjectedNodeDeps;\n  },\n): ExtractedNodeRequestData {\n  const { include = DEFAULT_REQUEST_INCLUDES, deps } = options || {};\n  const requestData: { [key: string]: any } = {};\n\n  // headers:\n  //   node, express, koa, nextjs: req.headers\n  const headers = (req.headers || {}) as {\n    host?: string;\n    cookie?: string;\n  };\n  // method:\n  //   node, express, koa, nextjs: req.method\n  const method = req.method;\n  // host:\n  //   express: req.hostname in > 4 and req.host in < 4\n  //   koa: req.host\n  //   node, nextjs: req.headers.host\n  const host = req.hostname || req.host || headers.host || '<no host>';\n  // protocol:\n  //   node, nextjs: <n/a>\n  //   express, koa: req.protocol\n  const protocol = req.protocol === 'https' || (req.socket && req.socket.encrypted) ? 'https' : 'http';\n  // url (including path and query string):\n  //   node, express: req.originalUrl\n  //   koa, nextjs: req.url\n  const originalUrl = req.originalUrl || req.url || '';\n  // absolute url\n  const absoluteUrl = `${protocol}://${host}${originalUrl}`;\n  include.forEach(key => {\n    switch (key) {\n      case 'headers': {\n        requestData.headers = headers;\n        break;\n      }\n      case 'method': {\n        requestData.method = method;\n        break;\n      }\n      case 'url': {\n        requestData.url = absoluteUrl;\n        break;\n      }\n      case 'cookies': {\n        // cookies:\n        //   node, express, koa: req.headers.cookie\n        //   vercel, sails.js, express (w/ cookie middleware), nextjs: req.cookies\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        requestData.cookies =\n          // TODO (v8 / #5257): We're only sending the empty object for backwards compatibility, so the last bit can\n          // come off in v8\n          req.cookies || (headers.cookie && deps && deps.cookie && deps.cookie.parse(headers.cookie)) || {};\n        break;\n      }\n      case 'query_string': {\n        // query string:\n        //   node: req.url (raw)\n        //   express, koa, nextjs: req.query\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        requestData.query_string = extractQueryParams(req, deps);\n        break;\n      }\n      case 'data': {\n        if (method === 'GET' || method === 'HEAD') {\n          break;\n        }\n        // body data:\n        //   express, koa, nextjs: req.body\n        //\n        //   when using node by itself, you have to read the incoming stream(see\n        //   https://nodejs.dev/learn/get-http-request-body-data-using-nodejs); if a user is doing that, we can't know\n        //   where they're going to store the final result, so they'll have to capture this data themselves\n        if (req.body !== undefined) {\n          requestData.data = isString(req.body) ? req.body : JSON.stringify(normalize(req.body));\n        }\n        break;\n      }\n      default: {\n        if ({}.hasOwnProperty.call(req, key)) {\n          requestData[key] = (req as { [key: string]: any })[key];\n        }\n      }\n    }\n  });\n\n  return requestData;\n}\n\n/**\n * Options deciding what parts of the request to use when enhancing an event\n */\nexport interface AddRequestDataToEventOptions {\n  /** Flags controlling whether each type of data should be added to the event */\n  include?: {\n    ip?: boolean;\n    request?: boolean | string[];\n    transaction?: boolean | TransactionNamingScheme;\n    user?: boolean | string[];\n  };\n\n  /** Injected platform-specific dependencies */\n  deps?: {\n    cookie: {\n      parse: (cookieStr: string) => Record<string, string>;\n    };\n    url: {\n      parse: (urlStr: string) => {\n        query: string | null;\n      };\n    };\n  };\n}\n\n/**\n * Add data from the given request to the given event\n *\n * @param event The event to which the request data will be added\n * @param req Request object\n * @param options.include Flags to control what data is included\n * @param options.deps Injected platform-specific dependencies\n * @hidden\n */\nexport function addRequestDataToEvent(\n  event: Event,\n  req: PolymorphicRequest,\n  options?: AddRequestDataToEventOptions,\n): Event {\n  const include = {\n    ...DEFAULT_INCLUDES,\n    ...(options && options.include),\n  };\n\n  if (include.request) {\n    const extractedRequestData = Array.isArray(include.request)\n      ? extractRequestData(req, { include: include.request, deps: options && options.deps })\n      : extractRequestData(req, { deps: options && options.deps });\n\n    event.request = {\n      ...event.request,\n      ...extractedRequestData,\n    };\n  }\n\n  if (include.user) {\n    const extractedUser = req.user && isPlainObject(req.user) ? extractUserData(req.user, include.user) : {};\n\n    if (Object.keys(extractedUser).length) {\n      event.user = {\n        ...event.user,\n        ...extractedUser,\n      };\n    }\n  }\n\n  // client ip:\n  //   node, nextjs: req.socket.remoteAddress\n  //   express, koa: req.ip\n  if (include.ip) {\n    const ip = req.ip || (req.socket && req.socket.remoteAddress);\n    if (ip) {\n      event.user = {\n        ...event.user,\n        ip_address: ip,\n      };\n    }\n  }\n\n  if (include.transaction && !event.transaction) {\n    // TODO do we even need this anymore?\n    // TODO make this work for nextjs\n    event.transaction = extractTransaction(req, include.transaction);\n  }\n\n  return event;\n}\n\nfunction extractQueryParams(\n  req: PolymorphicRequest,\n  deps?: InjectedNodeDeps,\n): string | Record<string, unknown> | undefined {\n  // url (including path and query string):\n  //   node, express: req.originalUrl\n  //   koa, nextjs: req.url\n  let originalUrl = req.originalUrl || req.url || '';\n\n  if (!originalUrl) {\n    return;\n  }\n\n  // The `URL` constructor can't handle internal URLs of the form `/some/path/here`, so stick a dummy protocol and\n  // hostname on the beginning. Since the point here is just to grab the query string, it doesn't matter what we use.\n  if (originalUrl.startsWith('/')) {\n    originalUrl = `http://dogs.are.great${originalUrl}`;\n  }\n\n  return (\n    req.query ||\n    (typeof URL !== undefined && new URL(originalUrl).search.replace('?', '')) ||\n    // In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node\n    (deps && deps.url && deps.url.parse(originalUrl).query) ||\n    undefined\n  );\n}\n","import type { Integration } from '@sentry/types';\n\nexport type UserIntegrationsFunction = (integrations: Integration[]) => Integration[];\nexport type UserIntegrations = Integration[] | UserIntegrationsFunction;\nexport type IntegrationWithExclusionOption = Integration & {\n  /**\n   * Allow the user to exclude this integration by not returning it from a function provided as the `integrations` option\n   * in `Sentry.init()`. Meant to be used with default integrations, the idea being that if a user has actively filtered\n   * an integration out, we should be able to respect that choice if we wish.\n   */\n  allowExclusionByUser?: boolean;\n};\n\ntype ForcedIntegrationOptions = {\n  [keyPath: string]: unknown;\n};\n\n/**\n * Recursively traverses an object to update an existing nested key.\n * Note: The provided key path must include existing properties,\n * the function will not create objects while traversing.\n *\n * @param obj An object to update\n * @param value The value to update the nested key with\n * @param keyPath The path to the key to update ex. fizz.buzz.foo\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setNestedKey(obj: Record<string, any>, keyPath: string, value: unknown): void {\n  // Ex. foo.bar.zoop will extract foo and bar.zoop\n  const match = keyPath.match(/([a-z_]+)\\.(.*)/i);\n  // The match will be null when there's no more recursing to do, i.e., when we've reached the right level of the object\n  if (match === null) {\n    obj[keyPath] = value;\n  } else {\n    // `match[1]` is the initial segment of the path, and `match[2]` is the remainder of the path\n    const innerObj = obj[match[1]];\n    setNestedKey(innerObj, match[2], value);\n  }\n}\n\n/**\n * Enforces inclusion of a given integration with specified options in an integration array originally determined by the\n * user, by either including the given default instance or by patching an existing user instance with the given options.\n *\n * Ideally this would happen when integrations are set up, but there isn't currently a mechanism there for merging\n * options from a default integration instance with those from a user-provided instance of the same integration, only\n * for allowing the user to override a default instance entirely. (TODO: Fix that.)\n *\n * @param defaultIntegrationInstance An instance of the integration with the correct options already set\n * @param userIntegrations Integrations defined by the user.\n * @param forcedOptions Options with which to patch an existing user-derived instance on the integration.\n * @returns A final integrations array.\n */\nexport function addOrUpdateIntegration<T extends UserIntegrations>(\n  defaultIntegrationInstance: Integration,\n  userIntegrations: T,\n  forcedOptions: ForcedIntegrationOptions = {},\n): T {\n  return (\n    Array.isArray(userIntegrations)\n      ? addOrUpdateIntegrationInArray(defaultIntegrationInstance, userIntegrations, forcedOptions)\n      : addOrUpdateIntegrationInFunction(\n          defaultIntegrationInstance,\n          // Somehow TS can't figure out that not being an array makes this necessarily a function\n          userIntegrations as UserIntegrationsFunction,\n          forcedOptions,\n        )\n  ) as T;\n}\n\nfunction addOrUpdateIntegrationInArray(\n  defaultIntegrationInstance: Integration,\n  userIntegrations: Integration[],\n  forcedOptions: ForcedIntegrationOptions,\n): Integration[] {\n  const userInstance = userIntegrations.find(integration => integration.name === defaultIntegrationInstance.name);\n\n  if (userInstance) {\n    for (const [keyPath, value] of Object.entries(forcedOptions)) {\n      setNestedKey(userInstance, keyPath, value);\n    }\n\n    return userIntegrations;\n  }\n\n  return [...userIntegrations, defaultIntegrationInstance];\n}\n\nfunction addOrUpdateIntegrationInFunction(\n  defaultIntegrationInstance: IntegrationWithExclusionOption,\n  userIntegrationsFunc: UserIntegrationsFunction,\n  forcedOptions: ForcedIntegrationOptions,\n): UserIntegrationsFunction {\n  const wrapper: UserIntegrationsFunction = defaultIntegrations => {\n    const userFinalIntegrations = userIntegrationsFunc(defaultIntegrations);\n\n    // There are instances where we want the user to be able to prevent an integration from appearing at all, which they\n    // would do by providing a function which filters out the integration in question. If that's happened in one of\n    // those cases, don't add our default back in.\n    if (defaultIntegrationInstance.allowExclusionByUser) {\n      const userFinalInstance = userFinalIntegrations.find(\n        integration => integration.name === defaultIntegrationInstance.name,\n      );\n      if (!userFinalInstance) {\n        return userFinalIntegrations;\n      }\n    }\n\n    return addOrUpdateIntegrationInArray(defaultIntegrationInstance, userFinalIntegrations, forcedOptions);\n  };\n\n  return wrapper;\n}\n","/**\n * Creates a cache that evicts keys in fifo order\n * @param size {Number}\n */\nexport function makeFifoCache<Key extends string, Value>(\n  size: number,\n): {\n  get: (key: Key) => Value | undefined;\n  add: (key: Key, value: Value) => void;\n  delete: (key: Key) => boolean;\n  clear: () => void;\n  size: () => number;\n} {\n  // Maintain a fifo queue of keys, we cannot rely on Object.keys as the browser may not support it.\n  let evictionOrder: Key[] = [];\n  let cache: Record<string, Value> = {};\n\n  return {\n    add(key: Key, value: Value) {\n      while (evictionOrder.length >= size) {\n        // shift is O(n) but this is small size and only happens if we are\n        // exceeding the cache size so it should be fine.\n        const evictCandidate = evictionOrder.shift();\n\n        if (evictCandidate !== undefined) {\n          // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n          delete cache[evictCandidate];\n        }\n      }\n\n      // in case we have a collision, delete the old key.\n      if (cache[key]) {\n        this.delete(key);\n      }\n\n      evictionOrder.push(key);\n      cache[key] = value;\n    },\n    clear() {\n      cache = {};\n      evictionOrder = [];\n    },\n    get(key: Key): Value | undefined {\n      return cache[key];\n    },\n    size() {\n      return evictionOrder.length;\n    },\n    // Delete cache key and return true if it existed, false otherwise.\n    delete(key: Key): boolean {\n      if (!cache[key]) {\n        return false;\n      }\n\n      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n      delete cache[key];\n\n      for (let i = 0; i < evictionOrder.length; i++) {\n        if (evictionOrder[i] === key) {\n          evictionOrder.splice(i, 1);\n          break;\n        }\n      }\n\n      return true;\n    },\n  };\n}\n","import type {\n  Event,\n  EventHint,\n  Exception,\n  Hub,\n  Mechanism,\n  Severity,\n  SeverityLevel,\n  StackFrame,\n  StackParser,\n} from '@sentry/types';\n\nimport { isError, isPlainObject } from './is';\nimport { addExceptionMechanism, addExceptionTypeValue } from './misc';\nimport { normalizeToSize } from './normalize';\nimport { extractExceptionKeysForMessage } from './object';\n\n/**\n * Extracts stack frames from the error.stack string\n */\nexport function parseStackFrames(stackParser: StackParser, error: Error): StackFrame[] {\n  return stackParser(error.stack || '', 1);\n}\n\n/**\n * Extracts stack frames from the error and builds a Sentry Exception\n */\nexport function exceptionFromError(stackParser: StackParser, error: Error): Exception {\n  const exception: Exception = {\n    type: error.name || error.constructor.name,\n    value: error.message,\n  };\n\n  const frames = parseStackFrames(stackParser, error);\n  if (frames.length) {\n    exception.stacktrace = { frames };\n  }\n\n  return exception;\n}\n\nfunction getMessageForObject(exception: object): string {\n  if ('name' in exception && typeof exception.name === 'string') {\n    let message = `'${exception.name}' captured as exception`;\n\n    if ('message' in exception && typeof exception.message === 'string') {\n      message += ` with message '${exception.message}'`;\n    }\n\n    return message;\n  } else if ('message' in exception && typeof exception.message === 'string') {\n    return exception.message;\n  } else {\n    // This will allow us to group events based on top-level keys\n    // which is much better than creating new group when any key/value change\n    return `Object captured as exception with keys: ${extractExceptionKeysForMessage(\n      exception as Record<string, unknown>,\n    )}`;\n  }\n}\n\n/**\n * Builds and Event from a Exception\n * @hidden\n */\nexport function eventFromUnknownInput(\n  getCurrentHub: () => Hub,\n  stackParser: StackParser,\n  exception: unknown,\n  hint?: EventHint,\n): Event {\n  let ex: unknown = exception;\n  const providedMechanism: Mechanism | undefined =\n    hint && hint.data && (hint.data as { mechanism: Mechanism }).mechanism;\n  const mechanism: Mechanism = providedMechanism || {\n    handled: true,\n    type: 'generic',\n  };\n\n  if (!isError(exception)) {\n    if (isPlainObject(exception)) {\n      const hub = getCurrentHub();\n      const client = hub.getClient();\n      const normalizeDepth = client && client.getOptions().normalizeDepth;\n      hub.configureScope(scope => {\n        scope.setExtra('__serialized__', normalizeToSize(exception, normalizeDepth));\n      });\n\n      const message = getMessageForObject(exception);\n      ex = (hint && hint.syntheticException) || new Error(message);\n      (ex as Error).message = message;\n    } else {\n      // This handles when someone does: `throw \"something awesome\";`\n      // We use synthesized Error here so we can extract a (rough) stack trace.\n      ex = (hint && hint.syntheticException) || new Error(exception as string);\n      (ex as Error).message = exception as string;\n    }\n    mechanism.synthetic = true;\n  }\n\n  const event = {\n    exception: {\n      values: [exceptionFromError(stackParser, ex as Error)],\n    },\n  };\n\n  addExceptionTypeValue(event, undefined, undefined);\n  addExceptionMechanism(event, mechanism);\n\n  return {\n    ...event,\n    event_id: hint && hint.event_id,\n  };\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nexport function eventFromMessage(\n  stackParser: StackParser,\n  message: string,\n  // eslint-disable-next-line deprecation/deprecation\n  level: Severity | SeverityLevel = 'info',\n  hint?: EventHint,\n  attachStacktrace?: boolean,\n): Event {\n  const event: Event = {\n    event_id: hint && hint.event_id,\n    level,\n    message,\n  };\n\n  if (attachStacktrace && hint && hint.syntheticException) {\n    const frames = parseStackFrames(stackParser, hint.syntheticException);\n    if (frames.length) {\n      event.exception = {\n        values: [\n          {\n            value: message,\n            stacktrace: { frames },\n          },\n        ],\n      };\n    }\n  }\n\n  return event;\n}\n","// Based on https://github.com/sindresorhus/escape-string-regexp but with modifications to:\n//   a) reduce the size by skipping the runtime type - checking\n//   b) ensure it gets down - compiled for old versions of Node(the published package only supports Node 12+).\n//\n// MIT License\n//\n// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n// documentation files(the \"Software\"), to deal in the Software without restriction, including without limitation\n// the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and\n// to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n// the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n// IN THE SOFTWARE.\n\n/**\n * Given a string, escape characters which have meaning in the regex grammar, such that the result is safe to feed to\n * `new RegExp()`.\n *\n * @param regexString The string to escape\n * @returns An version of the string with all special regex characters escaped\n */\nexport function escapeStringForRegex(regexString: string): string {\n  // escape the hyphen separately so we can also replace it with a unicode literal hyphen, to avoid the problems\n  // discussed in https://github.com/sindresorhus/escape-string-regexp/issues/20.\n  return regexString.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&').replace(/-/g, '\\\\x2d');\n}\n","/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport type {\n  HandlerDataFetch,\n  HandlerDataXhr,\n  SentryWrappedXMLHttpRequest,\n  SentryXhrData,\n  WrappedFunction,\n} from '@sentry/types';\n\nimport { isString } from './is';\nimport type { ConsoleLevel } from './logger';\nimport { CONSOLE_LEVELS, logger, originalConsoleMethods } from './logger';\nimport { fill } from './object';\nimport { getFunctionName } from './stacktrace';\nimport { supportsHistory, supportsNativeFetch } from './supports';\nimport { getGlobalObject, GLOBAL_OBJ } from './worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject<Window>();\n\nexport const SENTRY_XHR_DATA_KEY = '__sentry_xhr_v2__';\n\nexport type InstrumentHandlerType =\n  | 'console'\n  | 'dom'\n  | 'fetch'\n  | 'history'\n  | 'sentry'\n  | 'xhr'\n  | 'error'\n  | 'unhandledrejection';\nexport type InstrumentHandlerCallback = (data: any) => void;\n\n/**\n * Instrument native APIs to call handlers that can be used to create breadcrumbs, APM spans etc.\n *  - Console API\n *  - Fetch API\n *  - XHR API\n *  - History API\n *  - DOM API (click/typing)\n *  - Error API\n *  - UnhandledRejection API\n */\n\nconst handlers: { [key in InstrumentHandlerType]?: InstrumentHandlerCallback[] } = {};\nconst instrumented: { [key in InstrumentHandlerType]?: boolean } = {};\n\n/** Instruments given API */\nfunction instrument(type: InstrumentHandlerType): void {\n  if (instrumented[type]) {\n    return;\n  }\n\n  instrumented[type] = true;\n\n  switch (type) {\n    case 'console':\n      instrumentConsole();\n      break;\n    case 'dom':\n      instrumentDOM();\n      break;\n    case 'xhr':\n      instrumentXHR();\n      break;\n    case 'fetch':\n      instrumentFetch();\n      break;\n    case 'history':\n      instrumentHistory();\n      break;\n    case 'error':\n      instrumentError();\n      break;\n    case 'unhandledrejection':\n      instrumentUnhandledRejection();\n      break;\n    default:\n      __DEBUG_BUILD__ && logger.warn('unknown instrumentation type:', type);\n      return;\n  }\n}\n\n/**\n * Add handler that will be called when given type of instrumentation triggers.\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addInstrumentationHandler(type: InstrumentHandlerType, callback: InstrumentHandlerCallback): void {\n  handlers[type] = handlers[type] || [];\n  (handlers[type] as InstrumentHandlerCallback[]).push(callback);\n  instrument(type);\n}\n\n/**\n * Reset all instrumentation handlers.\n * This can be used by tests to ensure we have a clean slate of instrumentation handlers.\n */\nexport function resetInstrumentationHandlers(): void {\n  Object.keys(handlers).forEach(key => {\n    handlers[key as InstrumentHandlerType] = undefined;\n  });\n}\n\n/** JSDoc */\nfunction triggerHandlers(type: InstrumentHandlerType, data: any): void {\n  if (!type || !handlers[type]) {\n    return;\n  }\n\n  for (const handler of handlers[type] || []) {\n    try {\n      handler(data);\n    } catch (e) {\n      __DEBUG_BUILD__ &&\n        logger.error(\n          `Error while triggering instrumentation handler.\\nType: ${type}\\nName: ${getFunctionName(handler)}\\nError:`,\n          e,\n        );\n    }\n  }\n}\n\n/** JSDoc */\nfunction instrumentConsole(): void {\n  if (!('console' in GLOBAL_OBJ)) {\n    return;\n  }\n\n  CONSOLE_LEVELS.forEach(function (level: ConsoleLevel): void {\n    if (!(level in GLOBAL_OBJ.console)) {\n      return;\n    }\n\n    fill(GLOBAL_OBJ.console, level, function (originalConsoleMethod: () => any): Function {\n      originalConsoleMethods[level] = originalConsoleMethod;\n\n      return function (...args: any[]): void {\n        triggerHandlers('console', { args, level });\n\n        const log = originalConsoleMethods[level];\n        log && log.apply(GLOBAL_OBJ.console, args);\n      };\n    });\n  });\n}\n\n/** JSDoc */\nfunction instrumentFetch(): void {\n  if (!supportsNativeFetch()) {\n    return;\n  }\n\n  fill(GLOBAL_OBJ, 'fetch', function (originalFetch: () => void): () => void {\n    return function (...args: any[]): void {\n      const { method, url } = parseFetchArgs(args);\n\n      const handlerData: HandlerDataFetch = {\n        args,\n        fetchData: {\n          method,\n          url,\n        },\n        startTimestamp: Date.now(),\n      };\n\n      triggerHandlers('fetch', {\n        ...handlerData,\n      });\n\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n      return originalFetch.apply(GLOBAL_OBJ, args).then(\n        (response: Response) => {\n          triggerHandlers('fetch', {\n            ...handlerData,\n            endTimestamp: Date.now(),\n            response,\n          });\n          return response;\n        },\n        (error: Error) => {\n          triggerHandlers('fetch', {\n            ...handlerData,\n            endTimestamp: Date.now(),\n            error,\n          });\n          // NOTE: If you are a Sentry user, and you are seeing this stack frame,\n          //       it means the sentry.javascript SDK caught an error invoking your application code.\n          //       This is expected behavior and NOT indicative of a bug with sentry.javascript.\n          throw error;\n        },\n      );\n    };\n  });\n}\n\nfunction hasProp<T extends string>(obj: unknown, prop: T): obj is Record<string, string> {\n  return !!obj && typeof obj === 'object' && !!(obj as Record<string, string>)[prop];\n}\n\ntype FetchResource = string | { toString(): string } | { url: string };\n\nfunction getUrlFromResource(resource: FetchResource): string {\n  if (typeof resource === 'string') {\n    return resource;\n  }\n\n  if (!resource) {\n    return '';\n  }\n\n  if (hasProp(resource, 'url')) {\n    return resource.url;\n  }\n\n  if (resource.toString) {\n    return resource.toString();\n  }\n\n  return '';\n}\n\n/**\n * Parses the fetch arguments to find the used Http method and the url of the request\n */\nexport function parseFetchArgs(fetchArgs: unknown[]): { method: string; url: string } {\n  if (fetchArgs.length === 0) {\n    return { method: 'GET', url: '' };\n  }\n\n  if (fetchArgs.length === 2) {\n    const [url, options] = fetchArgs as [FetchResource, object];\n\n    return {\n      url: getUrlFromResource(url),\n      method: hasProp(options, 'method') ? String(options.method).toUpperCase() : 'GET',\n    };\n  }\n\n  const arg = fetchArgs[0];\n  return {\n    url: getUrlFromResource(arg as FetchResource),\n    method: hasProp(arg, 'method') ? String(arg.method).toUpperCase() : 'GET',\n  };\n}\n\n/** JSDoc */\nexport function instrumentXHR(): void {\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n  if (!(WINDOW as any).XMLHttpRequest) {\n    return;\n  }\n\n  const xhrproto = XMLHttpRequest.prototype;\n\n  fill(xhrproto, 'open', function (originalOpen: () => void): () => void {\n    return function (this: XMLHttpRequest & SentryWrappedXMLHttpRequest, ...args: any[]): void {\n      const url = args[1];\n      const xhrInfo: SentryXhrData = (this[SENTRY_XHR_DATA_KEY] = {\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        method: isString(args[0]) ? args[0].toUpperCase() : args[0],\n        url: args[1],\n        request_headers: {},\n      });\n\n      // if Sentry key appears in URL, don't capture it as a request\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n      if (isString(url) && xhrInfo.method === 'POST' && url.match(/sentry_key/)) {\n        this.__sentry_own_request__ = true;\n      }\n\n      const onreadystatechangeHandler: () => void = () => {\n        // For whatever reason, this is not the same instance here as from the outer method\n        const xhrInfo = this[SENTRY_XHR_DATA_KEY];\n\n        if (!xhrInfo) {\n          return;\n        }\n\n        if (this.readyState === 4) {\n          try {\n            // touching statusCode in some platforms throws\n            // an exception\n            xhrInfo.status_code = this.status;\n          } catch (e) {\n            /* do nothing */\n          }\n\n          triggerHandlers('xhr', {\n            args: args as [string, string],\n            endTimestamp: Date.now(),\n            startTimestamp: Date.now(),\n            xhr: this,\n          } as HandlerDataXhr);\n        }\n      };\n\n      if ('onreadystatechange' in this && typeof this.onreadystatechange === 'function') {\n        fill(this, 'onreadystatechange', function (original: WrappedFunction): Function {\n          return function (this: SentryWrappedXMLHttpRequest, ...readyStateArgs: any[]): void {\n            onreadystatechangeHandler();\n            return original.apply(this, readyStateArgs);\n          };\n        });\n      } else {\n        this.addEventListener('readystatechange', onreadystatechangeHandler);\n      }\n\n      // Intercepting `setRequestHeader` to access the request headers of XHR instance.\n      // This will only work for user/library defined headers, not for the default/browser-assigned headers.\n      // Request cookies are also unavailable for XHR, as `Cookie` header can't be defined by `setRequestHeader`.\n      fill(this, 'setRequestHeader', function (original: WrappedFunction): Function {\n        return function (this: SentryWrappedXMLHttpRequest, ...setRequestHeaderArgs: unknown[]): void {\n          const [header, value] = setRequestHeaderArgs as [string, string];\n\n          const xhrInfo = this[SENTRY_XHR_DATA_KEY];\n\n          if (xhrInfo) {\n            xhrInfo.request_headers[header.toLowerCase()] = value;\n          }\n\n          return original.apply(this, setRequestHeaderArgs);\n        };\n      });\n\n      return originalOpen.apply(this, args);\n    };\n  });\n\n  fill(xhrproto, 'send', function (originalSend: () => void): () => void {\n    return function (this: XMLHttpRequest & SentryWrappedXMLHttpRequest, ...args: any[]): void {\n      const sentryXhrData = this[SENTRY_XHR_DATA_KEY];\n      if (sentryXhrData && args[0] !== undefined) {\n        sentryXhrData.body = args[0];\n      }\n\n      triggerHandlers('xhr', {\n        args,\n        startTimestamp: Date.now(),\n        xhr: this,\n      });\n\n      return originalSend.apply(this, args);\n    };\n  });\n}\n\nlet lastHref: string;\n\n/** JSDoc */\nfunction instrumentHistory(): void {\n  if (!supportsHistory()) {\n    return;\n  }\n\n  const oldOnPopState = WINDOW.onpopstate;\n  WINDOW.onpopstate = function (this: WindowEventHandlers, ...args: any[]): any {\n    const to = WINDOW.location.href;\n    // keep track of the current URL state, as we always receive only the updated state\n    const from = lastHref;\n    lastHref = to;\n    triggerHandlers('history', {\n      from,\n      to,\n    });\n    if (oldOnPopState) {\n      // Apparently this can throw in Firefox when incorrectly implemented plugin is installed.\n      // https://github.com/getsentry/sentry-javascript/issues/3344\n      // https://github.com/bugsnag/bugsnag-js/issues/469\n      try {\n        return oldOnPopState.apply(this, args);\n      } catch (_oO) {\n        // no-empty\n      }\n    }\n  };\n\n  /** @hidden */\n  function historyReplacementFunction(originalHistoryFunction: () => void): () => void {\n    return function (this: History, ...args: any[]): void {\n      const url = args.length > 2 ? args[2] : undefined;\n      if (url) {\n        // coerce to string (this is what pushState does)\n        const from = lastHref;\n        const to = String(url);\n        // keep track of the current URL state, as we always receive only the updated state\n        lastHref = to;\n        triggerHandlers('history', {\n          from,\n          to,\n        });\n      }\n      return originalHistoryFunction.apply(this, args);\n    };\n  }\n\n  fill(WINDOW.history, 'pushState', historyReplacementFunction);\n  fill(WINDOW.history, 'replaceState', historyReplacementFunction);\n}\n\nconst debounceDuration = 1000;\nlet debounceTimerID: number | undefined;\nlet lastCapturedEvent: Event | undefined;\n\n/**\n * Decide whether the current event should finish the debounce of previously captured one.\n * @param previous previously captured event\n * @param current event to be captured\n */\nfunction shouldShortcircuitPreviousDebounce(previous: Event | undefined, current: Event): boolean {\n  // If there was no previous event, it should always be swapped for the new one.\n  if (!previous) {\n    return true;\n  }\n\n  // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress.\n  if (previous.type !== current.type) {\n    return true;\n  }\n\n  try {\n    // If both events have the same type, it's still possible that actions were performed on different targets.\n    // e.g. 2 clicks on different buttons.\n    if (previous.target !== current.target) {\n      return true;\n    }\n  } catch (e) {\n    // just accessing `target` property can throw an exception in some rare circumstances\n    // see: https://github.com/getsentry/sentry-javascript/issues/838\n  }\n\n  // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_\n  // to which an event listener was attached), we treat them as the same action, as we want to capture\n  // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box.\n  return false;\n}\n\n/**\n * Decide whether an event should be captured.\n * @param event event to be captured\n */\nfunction shouldSkipDOMEvent(event: Event): boolean {\n  // We are only interested in filtering `keypress` events for now.\n  if (event.type !== 'keypress') {\n    return false;\n  }\n\n  try {\n    const target = event.target as HTMLElement;\n\n    if (!target || !target.tagName) {\n      return true;\n    }\n\n    // Only consider keypress events on actual input elements. This will disregard keypresses targeting body\n    // e.g.tabbing through elements, hotkeys, etc.\n    if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n      return false;\n    }\n  } catch (e) {\n    // just accessing `target` property can throw an exception in some rare circumstances\n    // see: https://github.com/getsentry/sentry-javascript/issues/838\n  }\n\n  return true;\n}\n\n/**\n * Wraps addEventListener to capture UI breadcrumbs\n * @param handler function that will be triggered\n * @param globalListener indicates whether event was captured by the global event listener\n * @returns wrapped breadcrumb events handler\n * @hidden\n */\nfunction makeDOMEventHandler(handler: Function, globalListener: boolean = false): (event: Event) => void {\n  return (event: Event): void => {\n    // It's possible this handler might trigger multiple times for the same\n    // event (e.g. event propagation through node ancestors).\n    // Ignore if we've already captured that event.\n    if (!event || lastCapturedEvent === event) {\n      return;\n    }\n\n    // We always want to skip _some_ events.\n    if (shouldSkipDOMEvent(event)) {\n      return;\n    }\n\n    const name = event.type === 'keypress' ? 'input' : event.type;\n\n    // If there is no debounce timer, it means that we can safely capture the new event and store it for future comparisons.\n    if (debounceTimerID === undefined) {\n      handler({\n        event: event,\n        name,\n        global: globalListener,\n      });\n      lastCapturedEvent = event;\n    }\n    // If there is a debounce awaiting, see if the new event is different enough to treat it as a unique one.\n    // If that's the case, emit the previous event and store locally the newly-captured DOM event.\n    else if (shouldShortcircuitPreviousDebounce(lastCapturedEvent, event)) {\n      handler({\n        event: event,\n        name,\n        global: globalListener,\n      });\n      lastCapturedEvent = event;\n    }\n\n    // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together.\n    clearTimeout(debounceTimerID);\n    debounceTimerID = WINDOW.setTimeout(() => {\n      debounceTimerID = undefined;\n    }, debounceDuration);\n  };\n}\n\ntype AddEventListener = (\n  type: string,\n  listener: EventListenerOrEventListenerObject,\n  options?: boolean | AddEventListenerOptions,\n) => void;\ntype RemoveEventListener = (\n  type: string,\n  listener: EventListenerOrEventListenerObject,\n  options?: boolean | EventListenerOptions,\n) => void;\n\ntype InstrumentedElement = Element & {\n  __sentry_instrumentation_handlers__?: {\n    [key in 'click' | 'keypress']?: {\n      handler?: Function;\n      /** The number of custom listeners attached to this element */\n      refCount: number;\n    };\n  };\n};\n\n/** JSDoc */\nexport function instrumentDOM(): void {\n  if (!WINDOW.document) {\n    return;\n  }\n\n  // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom\n  // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before\n  // we instrument `addEventListener` so that we don't end up attaching this handler twice.\n  const triggerDOMHandler = triggerHandlers.bind(null, 'dom');\n  const globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true);\n  WINDOW.document.addEventListener('click', globalDOMEventHandler, false);\n  WINDOW.document.addEventListener('keypress', globalDOMEventHandler, false);\n\n  // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled\n  // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That\n  // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler\n  // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still\n  // guaranteed to fire at least once.)\n  ['EventTarget', 'Node'].forEach((target: string) => {\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    const proto = (WINDOW as any)[target] && (WINDOW as any)[target].prototype;\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n    if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n      return;\n    }\n\n    fill(proto, 'addEventListener', function (originalAddEventListener: AddEventListener): AddEventListener {\n      return function (\n        this: Element,\n        type: string,\n        listener: EventListenerOrEventListenerObject,\n        options?: boolean | AddEventListenerOptions,\n      ): AddEventListener {\n        if (type === 'click' || type == 'keypress') {\n          try {\n            const el = this as InstrumentedElement;\n            const handlers = (el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {});\n            const handlerForType = (handlers[type] = handlers[type] || { refCount: 0 });\n\n            if (!handlerForType.handler) {\n              const handler = makeDOMEventHandler(triggerDOMHandler);\n              handlerForType.handler = handler;\n              originalAddEventListener.call(this, type, handler, options);\n            }\n\n            handlerForType.refCount++;\n          } catch (e) {\n            // Accessing dom properties is always fragile.\n            // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n          }\n        }\n\n        return originalAddEventListener.call(this, type, listener, options);\n      };\n    });\n\n    fill(\n      proto,\n      'removeEventListener',\n      function (originalRemoveEventListener: RemoveEventListener): RemoveEventListener {\n        return function (\n          this: Element,\n          type: string,\n          listener: EventListenerOrEventListenerObject,\n          options?: boolean | EventListenerOptions,\n        ): () => void {\n          if (type === 'click' || type == 'keypress') {\n            try {\n              const el = this as InstrumentedElement;\n              const handlers = el.__sentry_instrumentation_handlers__ || {};\n              const handlerForType = handlers[type];\n\n              if (handlerForType) {\n                handlerForType.refCount--;\n                // If there are no longer any custom handlers of the current type on this element, we can remove ours, too.\n                if (handlerForType.refCount <= 0) {\n                  originalRemoveEventListener.call(this, type, handlerForType.handler, options);\n                  handlerForType.handler = undefined;\n                  delete handlers[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n                }\n\n                // If there are no longer any custom handlers of any type on this element, cleanup everything.\n                if (Object.keys(handlers).length === 0) {\n                  delete el.__sentry_instrumentation_handlers__;\n                }\n              }\n            } catch (e) {\n              // Accessing dom properties is always fragile.\n              // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n            }\n          }\n\n          return originalRemoveEventListener.call(this, type, listener, options);\n        };\n      },\n    );\n  });\n}\n\nlet _oldOnErrorHandler: (typeof WINDOW)['onerror'] | null = null;\n/** JSDoc */\nfunction instrumentError(): void {\n  _oldOnErrorHandler = WINDOW.onerror;\n\n  WINDOW.onerror = function (msg: unknown, url: unknown, line: unknown, column: unknown, error: unknown): boolean {\n    triggerHandlers('error', {\n      column,\n      error,\n      line,\n      msg,\n      url,\n    });\n\n    if (_oldOnErrorHandler && !_oldOnErrorHandler.__SENTRY_LOADER__) {\n      // eslint-disable-next-line prefer-rest-params\n      return _oldOnErrorHandler.apply(this, arguments);\n    }\n\n    return false;\n  };\n\n  WINDOW.onerror.__SENTRY_INSTRUMENTED__ = true;\n}\n\nlet _oldOnUnhandledRejectionHandler: (typeof WINDOW)['onunhandledrejection'] | null = null;\n/** JSDoc */\nfunction instrumentUnhandledRejection(): void {\n  _oldOnUnhandledRejectionHandler = WINDOW.onunhandledrejection;\n\n  WINDOW.onunhandledrejection = function (e: any): boolean {\n    triggerHandlers('unhandledrejection', e);\n\n    if (_oldOnUnhandledRejectionHandler && !_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__) {\n      // eslint-disable-next-line prefer-rest-params\n      return _oldOnUnhandledRejectionHandler.apply(this, arguments);\n    }\n\n    return true;\n  };\n\n  WINDOW.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;\n}\n","// This code was originally forked from https://github.com/felixge/node-stack-trace\n// Since then it has been highly modified to fit our needs.\n\n// Copyright (c) 2011 Felix Geisendörfer (felix@debuggable.com)//\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions://\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.//\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport type { StackLineParserFn } from '@sentry/types';\n\nexport type GetModuleFn = (filename: string | undefined) => string | undefined;\n\n/**\n * Does this filename look like it's part of the app code?\n */\nexport function filenameIsInApp(filename: string, isNative: boolean = false): boolean {\n  const isInternal =\n    isNative ||\n    (filename &&\n      // It's not internal if it's an absolute linux path\n      !filename.startsWith('/') &&\n      // It's not internal if it's an absolute windows path\n      !filename.includes(':\\\\') &&\n      // It's not internal if the path is starting with a dot\n      !filename.startsWith('.') &&\n      // It's not internal if the frame has a protocol. In node, this is usually the case if the file got pre-processed with a bundler like webpack\n      !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\\-+])*:\\/\\//)); // Schema from: https://stackoverflow.com/a/3641782\n\n  // in_app is all that's not an internal Node function or a module within node_modules\n  // note that isNative appears to return true even for node core libraries\n  // see https://github.com/getsentry/raven-node/issues/176\n\n  return !isInternal && filename !== undefined && !filename.includes('node_modules/');\n}\n\n/** Node Stack line parser */\n// eslint-disable-next-line complexity\nexport function node(getModule?: GetModuleFn): StackLineParserFn {\n  const FILENAME_MATCH = /^\\s*[-]{4,}$/;\n  const FULL_MATCH = /at (?:async )?(?:(.+?)\\s+\\()?(?:(.+):(\\d+):(\\d+)?|([^)]+))\\)?/;\n\n  // eslint-disable-next-line complexity\n  return (line: string) => {\n    const lineMatch = line.match(FULL_MATCH);\n\n    if (lineMatch) {\n      let object: string | undefined;\n      let method: string | undefined;\n      let functionName: string | undefined;\n      let typeName: string | undefined;\n      let methodName: string | undefined;\n\n      if (lineMatch[1]) {\n        functionName = lineMatch[1];\n\n        let methodStart = functionName.lastIndexOf('.');\n        if (functionName[methodStart - 1] === '.') {\n          methodStart--;\n        }\n\n        if (methodStart > 0) {\n          object = functionName.slice(0, methodStart);\n          method = functionName.slice(methodStart + 1);\n          const objectEnd = object.indexOf('.Module');\n          if (objectEnd > 0) {\n            functionName = functionName.slice(objectEnd + 1);\n            object = object.slice(0, objectEnd);\n          }\n        }\n        typeName = undefined;\n      }\n\n      if (method) {\n        typeName = object;\n        methodName = method;\n      }\n\n      if (method === '<anonymous>') {\n        methodName = undefined;\n        functionName = undefined;\n      }\n\n      if (functionName === undefined) {\n        methodName = methodName || '<anonymous>';\n        functionName = typeName ? `${typeName}.${methodName}` : methodName;\n      }\n\n      let filename = lineMatch[2] && lineMatch[2].startsWith('file://') ? lineMatch[2].slice(7) : lineMatch[2];\n      const isNative = lineMatch[5] === 'native';\n\n      if (!filename && lineMatch[5] && !isNative) {\n        filename = lineMatch[5];\n      }\n\n      return {\n        filename,\n        module: getModule ? getModule(filename) : undefined,\n        function: functionName,\n        lineno: parseInt(lineMatch[3], 10) || undefined,\n        colno: parseInt(lineMatch[4], 10) || undefined,\n        in_app: filenameIsInApp(filename, isNative),\n      };\n    }\n\n    if (line.match(FILENAME_MATCH)) {\n      return {\n        filename: line,\n      };\n    }\n\n    return undefined;\n  };\n}\n","/**\n * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,\n * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.\n */\n\nimport { isBrowserBundle } from './env';\n\n/**\n * Checks whether we're in the Node.js or Browser environment\n *\n * @returns Answer to given question\n */\nexport function isNodeEnv(): boolean {\n  // explicitly check for browser bundles as those can be optimized statically\n  // by terser/rollup.\n  return (\n    !isBrowserBundle() &&\n    Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'\n  );\n}\n\n/**\n * Requires a module which is protected against bundler minification.\n *\n * @param request The module path to resolve\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\nexport function dynamicRequire(mod: any, request: string): any {\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n  return mod.require(request);\n}\n\n/**\n * Helper for dynamically loading module that should work with linked dependencies.\n * The problem is that we _should_ be using `require(require.resolve(moduleName, { paths: [cwd()] }))`\n * However it's _not possible_ to do that with Webpack, as it has to know all the dependencies during\n * build time. `require.resolve` is also not available in any other way, so we cannot create,\n * a fake helper like we do with `dynamicRequire`.\n *\n * We always prefer to use local package, thus the value is not returned early from each `try/catch` block.\n * That is to mimic the behavior of `require.resolve` exactly.\n *\n * @param moduleName module name to require\n * @returns possibly required module\n */\nexport function loadModule<T>(moduleName: string): T | undefined {\n  let mod: T | undefined;\n\n  try {\n    mod = dynamicRequire(module, moduleName);\n  } catch (e) {\n    // no-empty\n  }\n\n  try {\n    const { cwd } = dynamicRequire(module, 'process');\n    mod = dynamicRequire(module, `${cwd()}/node_modules/${moduleName}`) as T;\n  } catch (e) {\n    // no-empty\n  }\n\n  return mod;\n}\n","import { SentryError } from './error';\nimport { rejectedSyncPromise, resolvedSyncPromise, SyncPromise } from './syncpromise';\n\nexport interface PromiseBuffer<T> {\n  // exposes the internal array so tests can assert on the state of it.\n  // XXX: this really should not be public api.\n  $: Array<PromiseLike<T>>;\n  add(taskProducer: () => PromiseLike<T>): PromiseLike<T>;\n  drain(timeout?: number): PromiseLike<boolean>;\n}\n\n/**\n * Creates an new PromiseBuffer object with the specified limit\n * @param limit max number of promises that can be stored in the buffer\n */\nexport function makePromiseBuffer<T>(limit?: number): PromiseBuffer<T> {\n  const buffer: Array<PromiseLike<T>> = [];\n\n  function isReady(): boolean {\n    return limit === undefined || buffer.length < limit;\n  }\n\n  /**\n   * Remove a promise from the queue.\n   *\n   * @param task Can be any PromiseLike<T>\n   * @returns Removed promise.\n   */\n  function remove(task: PromiseLike<T>): PromiseLike<T> {\n    return buffer.splice(buffer.indexOf(task), 1)[0];\n  }\n\n  /**\n   * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment.\n   *\n   * @param taskProducer A function producing any PromiseLike<T>; In previous versions this used to be `task:\n   *        PromiseLike<T>`, but under that model, Promises were instantly created on the call-site and their executor\n   *        functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By\n   *        requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer\n   *        limit check.\n   * @returns The original promise.\n   */\n  function add(taskProducer: () => PromiseLike<T>): PromiseLike<T> {\n    if (!isReady()) {\n      return rejectedSyncPromise(new SentryError('Not adding Promise because buffer limit was reached.'));\n    }\n\n    // start the task and add its promise to the queue\n    const task = taskProducer();\n    if (buffer.indexOf(task) === -1) {\n      buffer.push(task);\n    }\n    void task\n      .then(() => remove(task))\n      // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike`\n      // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't\n      // have promises, so TS has to polyfill when down-compiling.)\n      .then(null, () =>\n        remove(task).then(null, () => {\n          // We have to add another catch here because `remove()` starts a new promise chain.\n        }),\n      );\n    return task;\n  }\n\n  /**\n   * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first.\n   *\n   * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or\n   * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to\n   * `true`.\n   * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and\n   * `false` otherwise\n   */\n  function drain(timeout?: number): PromiseLike<boolean> {\n    return new SyncPromise<boolean>((resolve, reject) => {\n      let counter = buffer.length;\n\n      if (!counter) {\n        return resolve(true);\n      }\n\n      // wait for `timeout` ms and then resolve to `false` (if not cancelled first)\n      const capturedSetTimeout = setTimeout(() => {\n        if (timeout && timeout > 0) {\n          resolve(false);\n        }\n      }, timeout);\n\n      // if all promises resolve in time, cancel the timer and resolve to `true`\n      buffer.forEach(item => {\n        void resolvedSyncPromise(item).then(() => {\n          if (!--counter) {\n            clearTimeout(capturedSetTimeout);\n            resolve(true);\n          }\n        }, reject);\n      });\n    });\n  }\n\n  return {\n    $: buffer,\n    add,\n    drain,\n  };\n}\n","import type { TransportMakeRequestResponse } from '@sentry/types';\n\n// Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend\nexport type RateLimits = Record<string, number>;\n\nexport const DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds\n\n/**\n * Extracts Retry-After value from the request header or returns default value\n * @param header string representation of 'Retry-After' header\n * @param now current unix timestamp\n *\n */\nexport function parseRetryAfterHeader(header: string, now: number = Date.now()): number {\n  const headerDelay = parseInt(`${header}`, 10);\n  if (!isNaN(headerDelay)) {\n    return headerDelay * 1000;\n  }\n\n  const headerDate = Date.parse(`${header}`);\n  if (!isNaN(headerDate)) {\n    return headerDate - now;\n  }\n\n  return DEFAULT_RETRY_AFTER;\n}\n\n/**\n * Gets the time that the given category is disabled until for rate limiting.\n * In case no category-specific limit is set but a general rate limit across all categories is active,\n * that time is returned.\n *\n * @return the time in ms that the category is disabled until or 0 if there's no active rate limit.\n */\nexport function disabledUntil(limits: RateLimits, category: string): number {\n  return limits[category] || limits.all || 0;\n}\n\n/**\n * Checks if a category is rate limited\n */\nexport function isRateLimited(limits: RateLimits, category: string, now: number = Date.now()): boolean {\n  return disabledUntil(limits, category) > now;\n}\n\n/**\n * Update ratelimits from incoming headers.\n *\n * @return the updated RateLimits object.\n */\nexport function updateRateLimits(\n  limits: RateLimits,\n  { statusCode, headers }: TransportMakeRequestResponse,\n  now: number = Date.now(),\n): RateLimits {\n  const updatedRateLimits: RateLimits = {\n    ...limits,\n  };\n\n  // \"The name is case-insensitive.\"\n  // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get\n  const rateLimitHeader = headers && headers['x-sentry-rate-limits'];\n  const retryAfterHeader = headers && headers['retry-after'];\n\n  if (rateLimitHeader) {\n    /**\n     * rate limit headers are of the form\n     *     <header>,<header>,..\n     * where each <header> is of the form\n     *     <retry_after>: <categories>: <scope>: <reason_code>\n     * where\n     *     <retry_after> is a delay in seconds\n     *     <categories> is the event type(s) (error, transaction, etc) being rate limited and is of the form\n     *         <category>;<category>;...\n     *     <scope> is what's being limited (org, project, or key) - ignored by SDK\n     *     <reason_code> is an arbitrary string like \"org_quota\" - ignored by SDK\n     */\n    for (const limit of rateLimitHeader.trim().split(',')) {\n      const [retryAfter, categories] = limit.split(':', 2);\n      const headerDelay = parseInt(retryAfter, 10);\n      const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default\n      if (!categories) {\n        updatedRateLimits.all = now + delay;\n      } else {\n        for (const category of categories.split(';')) {\n          updatedRateLimits[category] = now + delay;\n        }\n      }\n    }\n  } else if (retryAfterHeader) {\n    updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now);\n  } else if (statusCode === 429) {\n    updatedRateLimits.all = now + 60 * 1000;\n  }\n\n  return updatedRateLimits;\n}\n","/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/typedef */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { isThenable } from './is';\n\n/** SyncPromise internal states */\nconst enum States {\n  /** Pending */\n  PENDING = 0,\n  /** Resolved / OK */\n  RESOLVED = 1,\n  /** Rejected / Error */\n  REJECTED = 2,\n}\n\n// Overloads so we can call resolvedSyncPromise without arguments and generic argument\nexport function resolvedSyncPromise(): PromiseLike<void>;\nexport function resolvedSyncPromise<T>(value: T | PromiseLike<T>): PromiseLike<T>;\n\n/**\n * Creates a resolved sync promise.\n *\n * @param value the value to resolve the promise with\n * @returns the resolved sync promise\n */\nexport function resolvedSyncPromise<T>(value?: T | PromiseLike<T>): PromiseLike<T> {\n  return new SyncPromise(resolve => {\n    resolve(value);\n  });\n}\n\n/**\n * Creates a rejected sync promise.\n *\n * @param value the value to reject the promise with\n * @returns the rejected sync promise\n */\nexport function rejectedSyncPromise<T = never>(reason?: any): PromiseLike<T> {\n  return new SyncPromise((_, reject) => {\n    reject(reason);\n  });\n}\n\n/**\n * Thenable class that behaves like a Promise and follows it's interface\n * but is not async internally\n */\nclass SyncPromise<T> implements PromiseLike<T> {\n  private _state: States;\n  private _handlers: Array<[boolean, (value: T) => void, (reason: any) => any]>;\n  private _value: any;\n\n  public constructor(\n    executor: (resolve: (value?: T | PromiseLike<T> | null) => void, reject: (reason?: any) => void) => void,\n  ) {\n    this._state = States.PENDING;\n    this._handlers = [];\n\n    try {\n      executor(this._resolve, this._reject);\n    } catch (e) {\n      this._reject(e);\n    }\n  }\n\n  /** JSDoc */\n  public then<TResult1 = T, TResult2 = never>(\n    onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,\n    onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null,\n  ): PromiseLike<TResult1 | TResult2> {\n    return new SyncPromise((resolve, reject) => {\n      this._handlers.push([\n        false,\n        result => {\n          if (!onfulfilled) {\n            // TODO: ¯\\_(ツ)_/¯\n            // TODO: FIXME\n            resolve(result as any);\n          } else {\n            try {\n              resolve(onfulfilled(result));\n            } catch (e) {\n              reject(e);\n            }\n          }\n        },\n        reason => {\n          if (!onrejected) {\n            reject(reason);\n          } else {\n            try {\n              resolve(onrejected(reason));\n            } catch (e) {\n              reject(e);\n            }\n          }\n        },\n      ]);\n      this._executeHandlers();\n    });\n  }\n\n  /** JSDoc */\n  public catch<TResult = never>(\n    onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null,\n  ): PromiseLike<T | TResult> {\n    return this.then(val => val, onrejected);\n  }\n\n  /** JSDoc */\n  public finally<TResult>(onfinally?: (() => void) | null): PromiseLike<TResult> {\n    return new SyncPromise<TResult>((resolve, reject) => {\n      let val: TResult | any;\n      let isRejected: boolean;\n\n      return this.then(\n        value => {\n          isRejected = false;\n          val = value;\n          if (onfinally) {\n            onfinally();\n          }\n        },\n        reason => {\n          isRejected = true;\n          val = reason;\n          if (onfinally) {\n            onfinally();\n          }\n        },\n      ).then(() => {\n        if (isRejected) {\n          reject(val);\n          return;\n        }\n\n        resolve(val as unknown as any);\n      });\n    });\n  }\n\n  /** JSDoc */\n  private readonly _resolve = (value?: T | PromiseLike<T> | null) => {\n    this._setResult(States.RESOLVED, value);\n  };\n\n  /** JSDoc */\n  private readonly _reject = (reason?: any) => {\n    this._setResult(States.REJECTED, reason);\n  };\n\n  /** JSDoc */\n  private readonly _setResult = (state: States, value?: T | PromiseLike<T> | any) => {\n    if (this._state !== States.PENDING) {\n      return;\n    }\n\n    if (isThenable(value)) {\n      void (value as PromiseLike<T>).then(this._resolve, this._reject);\n      return;\n    }\n\n    this._state = state;\n    this._value = value;\n\n    this._executeHandlers();\n  };\n\n  /** JSDoc */\n  private readonly _executeHandlers = () => {\n    if (this._state === States.PENDING) {\n      return;\n    }\n\n    const cachedHandlers = this._handlers.slice();\n    this._handlers = [];\n\n    cachedHandlers.forEach(handler => {\n      if (handler[0]) {\n        return;\n      }\n\n      if (this._state === States.RESOLVED) {\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\n        handler[1](this._value as unknown as any);\n      }\n\n      if (this._state === States.REJECTED) {\n        handler[2](this._value);\n      }\n\n      handler[0] = true;\n    });\n  };\n}\n\nexport { SyncPromise };\n","import { dynamicRequire, isNodeEnv } from './node';\nimport { getGlobalObject } from './worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject<Window>();\n\n/**\n * An object that can return the current timestamp in seconds since the UNIX epoch.\n */\ninterface TimestampSource {\n  nowSeconds(): number;\n}\n\n/**\n * A TimestampSource implementation for environments that do not support the Performance Web API natively.\n *\n * Note that this TimestampSource does not use a monotonic clock. A call to `nowSeconds` may return a timestamp earlier\n * than a previously returned value. We do not try to emulate a monotonic behavior in order to facilitate debugging. It\n * is more obvious to explain \"why does my span have negative duration\" than \"why my spans have zero duration\".\n */\nconst dateTimestampSource: TimestampSource = {\n  nowSeconds: () => Date.now() / 1000,\n};\n\n/**\n * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance}\n * for accessing a high-resolution monotonic clock.\n */\ninterface Performance {\n  /**\n   * The millisecond timestamp at which measurement began, measured in Unix time.\n   */\n  timeOrigin: number;\n  /**\n   * Returns the current millisecond timestamp, where 0 represents the start of measurement.\n   */\n  now(): number;\n}\n\n/**\n * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not\n * support the API.\n *\n * Wrapping the native API works around differences in behavior from different browsers.\n */\nfunction getBrowserPerformance(): Performance | undefined {\n  const { performance } = WINDOW;\n  if (!performance || !performance.now) {\n    return undefined;\n  }\n\n  // Replace performance.timeOrigin with our own timeOrigin based on Date.now().\n  //\n  // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin +\n  // performance.now() gives a date arbitrarily in the past.\n  //\n  // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is\n  // undefined.\n  //\n  // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to\n  // interact with data coming out of performance entries.\n  //\n  // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that\n  // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes\n  // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have\n  // observed skews that can be as long as days, weeks or months.\n  //\n  // See https://github.com/getsentry/sentry-javascript/issues/2590.\n  //\n  // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload\n  // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation\n  // transactions of long-lived web pages.\n  const timeOrigin = Date.now() - performance.now();\n\n  return {\n    now: () => performance.now(),\n    timeOrigin,\n  };\n}\n\n/**\n * Returns the native Performance API implementation from Node.js. Returns undefined in old Node.js versions that don't\n * implement the API.\n */\nfunction getNodePerformance(): Performance | undefined {\n  try {\n    const perfHooks = dynamicRequire(module, 'perf_hooks') as { performance: Performance };\n    return perfHooks.performance;\n  } catch (_) {\n    return undefined;\n  }\n}\n\n/**\n * The Performance API implementation for the current platform, if available.\n */\nconst platformPerformance: Performance | undefined = isNodeEnv() ? getNodePerformance() : getBrowserPerformance();\n\nconst timestampSource: TimestampSource =\n  platformPerformance === undefined\n    ? dateTimestampSource\n    : {\n        nowSeconds: () => (platformPerformance.timeOrigin + platformPerformance.now()) / 1000,\n      };\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using the Date API.\n */\nexport const dateTimestampInSeconds: () => number = dateTimestampSource.nowSeconds.bind(dateTimestampSource);\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the\n * availability of the Performance API.\n *\n * See `usingPerformanceAPI` to test whether the Performance API is used.\n *\n * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is\n * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The\n * skew can grow to arbitrary amounts like days, weeks or months.\n * See https://github.com/getsentry/sentry-javascript/issues/2590.\n */\nexport const timestampInSeconds: () => number = timestampSource.nowSeconds.bind(timestampSource);\n\n/**\n * Re-exported with an old name for backwards-compatibility.\n * TODO (v8): Remove this\n *\n * @deprecated Use `timestampInSeconds` instead.\n */\nexport const timestampWithMs = timestampInSeconds;\n\n/**\n * A boolean that is true when timestampInSeconds uses the Performance API to produce monotonic timestamps.\n */\nexport const usingPerformanceAPI = platformPerformance !== undefined;\n\n/**\n * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only.\n */\nexport let _browserPerformanceTimeOriginMode: string;\n\n/**\n * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the\n * performance API is available.\n */\nexport const browserPerformanceTimeOrigin = ((): number | undefined => {\n  // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or\n  // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin\n  // data as reliable if they are within a reasonable threshold of the current time.\n\n  const { performance } = WINDOW;\n  if (!performance || !performance.now) {\n    _browserPerformanceTimeOriginMode = 'none';\n    return undefined;\n  }\n\n  const threshold = 3600 * 1000;\n  const performanceNow = performance.now();\n  const dateNow = Date.now();\n\n  // if timeOrigin isn't available set delta to threshold so it isn't used\n  const timeOriginDelta = performance.timeOrigin\n    ? Math.abs(performance.timeOrigin + performanceNow - dateNow)\n    : threshold;\n  const timeOriginIsReliable = timeOriginDelta < threshold;\n\n  // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin\n  // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.\n  // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always\n  // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the\n  // Date API.\n  // eslint-disable-next-line deprecation/deprecation\n  const navigationStart = performance.timing && performance.timing.navigationStart;\n  const hasNavigationStart = typeof navigationStart === 'number';\n  // if navigationStart isn't available set delta to threshold so it isn't used\n  const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;\n  const navigationStartIsReliable = navigationStartDelta < threshold;\n\n  if (timeOriginIsReliable || navigationStartIsReliable) {\n    // Use the more reliable time origin\n    if (timeOriginDelta <= navigationStartDelta) {\n      _browserPerformanceTimeOriginMode = 'timeOrigin';\n      return performance.timeOrigin;\n    } else {\n      _browserPerformanceTimeOriginMode = 'navigationStart';\n      return navigationStart;\n    }\n  }\n\n  // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date.\n  _browserPerformanceTimeOriginMode = 'dateNow';\n  return dateNow;\n})();\n","import type { DynamicSamplingContext, PropagationContext, TraceparentData } from '@sentry/types';\n\nimport { baggageHeaderToDynamicSamplingContext } from './baggage';\nimport { uuid4 } from './misc';\n\nexport const TRACEPARENT_REGEXP = new RegExp(\n  '^[ \\\\t]*' + // whitespace\n    '([0-9a-f]{32})?' + // trace_id\n    '-?([0-9a-f]{16})?' + // span_id\n    '-?([01])?' + // sampled\n    '[ \\\\t]*$', // whitespace\n);\n\n/**\n * Extract transaction context data from a `sentry-trace` header.\n *\n * @param traceparent Traceparent string\n *\n * @returns Object containing data from the header, or undefined if traceparent string is malformed\n */\nexport function extractTraceparentData(traceparent?: string): TraceparentData | undefined {\n  if (!traceparent) {\n    return undefined;\n  }\n\n  const matches = traceparent.match(TRACEPARENT_REGEXP);\n  if (!matches) {\n    return undefined;\n  }\n\n  let parentSampled: boolean | undefined;\n  if (matches[3] === '1') {\n    parentSampled = true;\n  } else if (matches[3] === '0') {\n    parentSampled = false;\n  }\n\n  return {\n    traceId: matches[1],\n    parentSampled,\n    parentSpanId: matches[2],\n  };\n}\n\n/**\n * Create tracing context from incoming headers.\n */\nexport function tracingContextFromHeaders(\n  sentryTrace: Parameters<typeof extractTraceparentData>[0],\n  baggage: Parameters<typeof baggageHeaderToDynamicSamplingContext>[0],\n): {\n  traceparentData: ReturnType<typeof extractTraceparentData>;\n  dynamicSamplingContext: ReturnType<typeof baggageHeaderToDynamicSamplingContext>;\n  propagationContext: PropagationContext;\n} {\n  const traceparentData = extractTraceparentData(sentryTrace);\n  const dynamicSamplingContext = baggageHeaderToDynamicSamplingContext(baggage);\n\n  const { traceId, parentSpanId, parentSampled } = traceparentData || {};\n\n  const propagationContext: PropagationContext = {\n    traceId: traceId || uuid4(),\n    spanId: uuid4().substring(16),\n    sampled: parentSampled,\n  };\n\n  if (parentSpanId) {\n    propagationContext.parentSpanId = parentSpanId;\n  }\n\n  if (dynamicSamplingContext) {\n    propagationContext.dsc = dynamicSamplingContext as DynamicSamplingContext;\n  }\n\n  return {\n    traceparentData,\n    dynamicSamplingContext,\n    propagationContext,\n  };\n}\n\n/**\n * Create sentry-trace header from span context values.\n */\nexport function generateSentryTraceHeader(\n  traceId: string = uuid4(),\n  spanId: string = uuid4().substring(16),\n  sampled?: boolean,\n): string {\n  let sampledString = '';\n  if (sampled !== undefined) {\n    sampledString = sampled ? '-1' : '-0';\n  }\n  return `${traceId}-${spanId}${sampledString}`;\n}\n","type PartialURL = {\n  host?: string;\n  path?: string;\n  protocol?: string;\n  relative?: string;\n  search?: string;\n  hash?: string;\n};\n\n/**\n * Parses string form of URL into an object\n * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B\n * // intentionally using regex and not <a/> href parsing trick because React Native and other\n * // environments where DOM might not be available\n * @returns parsed URL object\n */\nexport function parseUrl(url: string): PartialURL {\n  if (!url) {\n    return {};\n  }\n\n  const match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\n  if (!match) {\n    return {};\n  }\n\n  // coerce to undefined values to empty string so we don't get 'undefined'\n  const query = match[6] || '';\n  const fragment = match[8] || '';\n  return {\n    host: match[4],\n    path: match[5],\n    protocol: match[2],\n    search: query,\n    hash: fragment,\n    relative: match[5] + query + fragment, // everything minus origin\n  };\n}\n\n/**\n * Strip the query string and fragment off of a given URL or path (if present)\n *\n * @param urlPath Full URL or path, including possible query string and/or fragment\n * @returns URL or path without query string or fragment\n */\nexport function stripUrlQueryAndFragment(urlPath: string): string {\n  // eslint-disable-next-line no-useless-escape\n  return urlPath.split(/[\\?#]/, 1)[0];\n}\n\n/**\n * Returns number of URL segments of a passed string URL.\n */\nexport function getNumberOfUrlSegments(url: string): number {\n  // split at '/' or at '\\/' to split regex urls correctly\n  return url.split(/\\\\?\\//).filter(s => s.length > 0 && s !== ',').length;\n}\n\n/**\n * Takes a URL object and returns a sanitized string which is safe to use as span description\n * see: https://develop.sentry.dev/sdk/data-handling/#structuring-data\n */\nexport function getSanitizedUrlString(url: PartialURL): string {\n  const { protocol, host, path } = url;\n\n  const filteredHost =\n    (host &&\n      host\n        // Always filter out authority\n        .replace(/^.*@/, '[filtered]:[filtered]@')\n        // Don't show standard :80 (http) and :443 (https) ports to reduce the noise\n        .replace(':80', '')\n        .replace(':443', '')) ||\n    '';\n\n  return `${protocol ? `${protocol}://` : ''}${filteredHost}${path}`;\n}\n","// Based on https://github.com/angular/angular.js/pull/13945/files\n// The MIT License\n\n// Copyright (c) 2010-2016 Google, Inc. http://angularjs.org\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport { getGlobalObject } from '../worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject<Window>();\n\n/**\n * Tells whether current environment supports History API\n * {@link supportsHistory}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsHistory(): boolean {\n  // NOTE: in Chrome App environment, touching history.pushState, *even inside\n  //       a try/catch block*, will cause Chrome to output an error to console.error\n  // borrowed from: https://github.com/angular/angular.js/pull/13945/files\n  /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const chrome = (WINDOW as any).chrome;\n  const isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n  /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n  const hasHistoryApi = 'history' in WINDOW && !!WINDOW.history.pushState && !!WINDOW.history.replaceState;\n\n  return !isChromePackagedApp && hasHistoryApi;\n}\n","/*\r\n *  big.js v6.0.3\r\n *  A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.\r\n *  Copyright (c) 2020 Michael Mclaughlin\r\n *  https://github.com/MikeMcl/big.js/LICENCE.md\r\n */\r\n;(function (GLOBAL) {\r\n  'use strict';\r\n  var Big,\r\n\r\n\r\n/************************************** EDITABLE DEFAULTS *****************************************/\r\n\r\n\r\n    // The default values below must be integers within the stated ranges.\r\n\r\n    /*\r\n     * The maximum number of decimal places (DP) of the results of operations involving division:\r\n     * div and sqrt, and pow with negative exponents.\r\n     */\r\n    DP = 20,            // 0 to MAX_DP\r\n\r\n    /*\r\n     * The rounding mode (RM) used when rounding to the above decimal places.\r\n     *\r\n     *  0  Towards zero (i.e. truncate, no rounding).       (ROUND_DOWN)\r\n     *  1  To nearest neighbour. If equidistant, round up.  (ROUND_HALF_UP)\r\n     *  2  To nearest neighbour. If equidistant, to even.   (ROUND_HALF_EVEN)\r\n     *  3  Away from zero.                                  (ROUND_UP)\r\n     */\r\n    RM = 1,             // 0, 1, 2 or 3\r\n\r\n    // The maximum value of DP and Big.DP.\r\n    MAX_DP = 1E6,       // 0 to 1000000\r\n\r\n    // The maximum magnitude of the exponent argument to the pow method.\r\n    MAX_POWER = 1E6,    // 1 to 1000000\r\n\r\n    /*\r\n     * The negative exponent (NE) at and beneath which toString returns exponential notation.\r\n     * (JavaScript numbers: -7)\r\n     * -1000000 is the minimum recommended exponent value of a Big.\r\n     */\r\n    NE = -7,            // 0 to -1000000\r\n\r\n    /*\r\n     * The positive exponent (PE) at and above which toString returns exponential notation.\r\n     * (JavaScript numbers: 21)\r\n     * 1000000 is the maximum recommended exponent value of a Big, but this limit is not enforced.\r\n     */\r\n    PE = 21,            // 0 to 1000000\r\n\r\n    /*\r\n     * When true, an error will be thrown if a primitive number is passed to the Big constructor,\r\n     * or if valueOf is called, or if toNumber is called on a Big which cannot be converted to a\r\n     * primitive number without a loss of precision.\r\n     */\r\n    STRICT = false,     // true or false\r\n\r\n\r\n/**************************************************************************************************/\r\n\r\n\r\n    // Error messages.\r\n    NAME = '[big.js] ',\r\n    INVALID = NAME + 'Invalid ',\r\n    INVALID_DP = INVALID + 'decimal places',\r\n    INVALID_RM = INVALID + 'rounding mode',\r\n    DIV_BY_ZERO = NAME + 'Division by zero',\r\n\r\n    // The shared prototype object.\r\n    P = {},\r\n    UNDEFINED = void 0,\r\n    NUMERIC = /^-?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i;\r\n\r\n\r\n  /*\r\n   * Create and return a Big constructor.\r\n   */\r\n  function _Big_() {\r\n\r\n    /*\r\n     * The Big constructor and exported function.\r\n     * Create and return a new instance of a Big number object.\r\n     *\r\n     * n {number|string|Big} A numeric value.\r\n     */\r\n    function Big(n) {\r\n      var x = this;\r\n\r\n      // Enable constructor usage without new.\r\n      if (!(x instanceof Big)) return n === UNDEFINED ? _Big_() : new Big(n);\r\n\r\n      // Duplicate.\r\n      if (n instanceof Big) {\r\n        x.s = n.s;\r\n        x.e = n.e;\r\n        x.c = n.c.slice();\r\n      } else {\r\n        if (typeof n !== 'string') {\r\n          if (Big.strict === true) {\r\n            throw TypeError(INVALID + 'number');\r\n          }\r\n\r\n          // Minus zero?\r\n          n = n === 0 && 1 / n < 0 ? '-0' : String(n);\r\n        }\r\n\r\n        parse(x, n);\r\n      }\r\n\r\n      // Retain a reference to this Big constructor.\r\n      // Shadow Big.prototype.constructor which points to Object.\r\n      x.constructor = Big;\r\n    }\r\n\r\n    Big.prototype = P;\r\n    Big.DP = DP;\r\n    Big.RM = RM;\r\n    Big.NE = NE;\r\n    Big.PE = PE;\r\n    Big.strict = STRICT;\r\n\r\n    return Big;\r\n  }\r\n\r\n\r\n  /*\r\n   * Parse the number or string value passed to a Big constructor.\r\n   *\r\n   * x {Big} A Big number instance.\r\n   * n {number|string} A numeric value.\r\n   */\r\n  function parse(x, n) {\r\n    var e, i, nl;\r\n\r\n    if (!NUMERIC.test(n)) {\r\n      throw Error(INVALID + 'number');\r\n    }\r\n\r\n    // Determine sign.\r\n    x.s = n.charAt(0) == '-' ? (n = n.slice(1), -1) : 1;\r\n\r\n    // Decimal point?\r\n    if ((e = n.indexOf('.')) > -1) n = n.replace('.', '');\r\n\r\n    // Exponential form?\r\n    if ((i = n.search(/e/i)) > 0) {\r\n\r\n      // Determine exponent.\r\n      if (e < 0) e = i;\r\n      e += +n.slice(i + 1);\r\n      n = n.substring(0, i);\r\n    } else if (e < 0) {\r\n\r\n      // Integer.\r\n      e = n.length;\r\n    }\r\n\r\n    nl = n.length;\r\n\r\n    // Determine leading zeros.\r\n    for (i = 0; i < nl && n.charAt(i) == '0';) ++i;\r\n\r\n    if (i == nl) {\r\n\r\n      // Zero.\r\n      x.c = [x.e = 0];\r\n    } else {\r\n\r\n      // Determine trailing zeros.\r\n      for (; nl > 0 && n.charAt(--nl) == '0';);\r\n      x.e = e - i - 1;\r\n      x.c = [];\r\n\r\n      // Convert string to array of digits without leading/trailing zeros.\r\n      for (e = 0; i <= nl;) x.c[e++] = +n.charAt(i++);\r\n    }\r\n\r\n    return x;\r\n  }\r\n\r\n\r\n  /*\r\n   * Round Big x to a maximum of sd significant digits using rounding mode rm.\r\n   *\r\n   * x {Big} The Big to round.\r\n   * sd {number} Significant digits: integer, 0 to MAX_DP inclusive.\r\n   * rm {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\r\n   * [more] {boolean} Whether the result of division was truncated.\r\n   */\r\n  function round(x, sd, rm, more) {\r\n    var xc = x.c;\r\n\r\n    if (rm === UNDEFINED) rm = Big.RM;\r\n    if (rm !== 0 && rm !== 1 && rm !== 2 && rm !== 3) {\r\n      throw Error(INVALID_RM);\r\n    }\r\n\r\n    if (sd < 1) {\r\n      more =\r\n        rm === 3 && (more || !!xc[0]) || sd === 0 && (\r\n        rm === 1 && xc[0] >= 5 ||\r\n        rm === 2 && (xc[0] > 5 || xc[0] === 5 && (more || xc[1] !== UNDEFINED))\r\n      );\r\n\r\n      xc.length = 1;\r\n\r\n      if (more) {\r\n\r\n        // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n        x.e = x.e - sd + 1;\r\n        xc[0] = 1;\r\n      } else {\r\n\r\n        // Zero.\r\n        xc[0] = x.e = 0;\r\n      }\r\n    } else if (sd < xc.length) {\r\n\r\n      // xc[sd] is the digit after the digit that may be rounded up.\r\n      more =\r\n        rm === 1 && xc[sd] >= 5 ||\r\n        rm === 2 && (xc[sd] > 5 || xc[sd] === 5 &&\r\n          (more || xc[sd + 1] !== UNDEFINED || xc[sd - 1] & 1)) ||\r\n        rm === 3 && (more || !!xc[0]);\r\n\r\n      // Remove any digits after the required precision.\r\n      xc.length = sd--;\r\n\r\n      // Round up?\r\n      if (more) {\r\n\r\n        // Rounding up may mean the previous digit has to be rounded up.\r\n        for (; ++xc[sd] > 9;) {\r\n          xc[sd] = 0;\r\n          if (!sd--) {\r\n            ++x.e;\r\n            xc.unshift(1);\r\n          }\r\n        }\r\n      }\r\n\r\n      // Remove trailing zeros.\r\n      for (sd = xc.length; !xc[--sd];) xc.pop();\r\n    }\r\n\r\n    return x;\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a string representing the value of Big x in normal or exponential notation.\r\n   * Handles P.toExponential, P.toFixed, P.toJSON, P.toPrecision, P.toString and P.valueOf.\r\n   */\r\n  function stringify(x, doExponential, isNonzero) {\r\n    var e = x.e,\r\n      s = x.c.join(''),\r\n      n = s.length;\r\n\r\n    // Exponential notation?\r\n    if (doExponential) {\r\n      s = s.charAt(0) + (n > 1 ? '.' + s.slice(1) : '') + (e < 0 ? 'e' : 'e+') + e;\r\n\r\n    // Normal notation.\r\n    } else if (e < 0) {\r\n      for (; ++e;) s = '0' + s;\r\n      s = '0.' + s;\r\n    } else if (e > 0) {\r\n      if (++e > n) {\r\n        for (e -= n; e--;) s += '0';\r\n      } else if (e < n) {\r\n        s = s.slice(0, e) + '.' + s.slice(e);\r\n      }\r\n    } else if (n > 1) {\r\n      s = s.charAt(0) + '.' + s.slice(1);\r\n    }\r\n\r\n    return x.s < 0 && isNonzero ? '-' + s : s;\r\n  }\r\n\r\n\r\n  // Prototype/instance methods\r\n\r\n\r\n  /*\r\n   * Return a new Big whose value is the absolute value of this Big.\r\n   */\r\n  P.abs = function () {\r\n    var x = new this.constructor(this);\r\n    x.s = 1;\r\n    return x;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return 1 if the value of this Big is greater than the value of Big y,\r\n   *       -1 if the value of this Big is less than the value of Big y, or\r\n   *        0 if they have the same value.\r\n   */\r\n  P.cmp = function (y) {\r\n    var isneg,\r\n      x = this,\r\n      xc = x.c,\r\n      yc = (y = new x.constructor(y)).c,\r\n      i = x.s,\r\n      j = y.s,\r\n      k = x.e,\r\n      l = y.e;\r\n\r\n    // Either zero?\r\n    if (!xc[0] || !yc[0]) return !xc[0] ? !yc[0] ? 0 : -j : i;\r\n\r\n    // Signs differ?\r\n    if (i != j) return i;\r\n\r\n    isneg = i < 0;\r\n\r\n    // Compare exponents.\r\n    if (k != l) return k > l ^ isneg ? 1 : -1;\r\n\r\n    j = (k = xc.length) < (l = yc.length) ? k : l;\r\n\r\n    // Compare digit by digit.\r\n    for (i = -1; ++i < j;) {\r\n      if (xc[i] != yc[i]) return xc[i] > yc[i] ^ isneg ? 1 : -1;\r\n    }\r\n\r\n    // Compare lengths.\r\n    return k == l ? 0 : k > l ^ isneg ? 1 : -1;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Big whose value is the value of this Big divided by the value of Big y, rounded,\r\n   * if necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.\r\n   */\r\n  P.div = function (y) {\r\n    var x = this,\r\n      Big = x.constructor,\r\n      a = x.c,                  // dividend\r\n      b = (y = new Big(y)).c,   // divisor\r\n      k = x.s == y.s ? 1 : -1,\r\n      dp = Big.DP;\r\n\r\n    if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\r\n      throw Error(INVALID_DP);\r\n    }\r\n\r\n    // Divisor is zero?\r\n    if (!b[0]) {\r\n      throw Error(DIV_BY_ZERO);\r\n    }\r\n\r\n    // Dividend is 0? Return +-0.\r\n    if (!a[0]) {\r\n      y.s = k;\r\n      y.c = [y.e = 0];\r\n      return y;\r\n    }\r\n\r\n    var bl, bt, n, cmp, ri,\r\n      bz = b.slice(),\r\n      ai = bl = b.length,\r\n      al = a.length,\r\n      r = a.slice(0, bl),   // remainder\r\n      rl = r.length,\r\n      q = y,                // quotient\r\n      qc = q.c = [],\r\n      qi = 0,\r\n      p = dp + (q.e = x.e - y.e) + 1;    // precision of the result\r\n\r\n    q.s = k;\r\n    k = p < 0 ? 0 : p;\r\n\r\n    // Create version of divisor with leading zero.\r\n    bz.unshift(0);\r\n\r\n    // Add zeros to make remainder as long as divisor.\r\n    for (; rl++ < bl;) r.push(0);\r\n\r\n    do {\r\n\r\n      // n is how many times the divisor goes into current remainder.\r\n      for (n = 0; n < 10; n++) {\r\n\r\n        // Compare divisor and remainder.\r\n        if (bl != (rl = r.length)) {\r\n          cmp = bl > rl ? 1 : -1;\r\n        } else {\r\n          for (ri = -1, cmp = 0; ++ri < bl;) {\r\n            if (b[ri] != r[ri]) {\r\n              cmp = b[ri] > r[ri] ? 1 : -1;\r\n              break;\r\n            }\r\n          }\r\n        }\r\n\r\n        // If divisor < remainder, subtract divisor from remainder.\r\n        if (cmp < 0) {\r\n\r\n          // Remainder can't be more than 1 digit longer than divisor.\r\n          // Equalise lengths using divisor with extra leading zero?\r\n          for (bt = rl == bl ? b : bz; rl;) {\r\n            if (r[--rl] < bt[rl]) {\r\n              ri = rl;\r\n              for (; ri && !r[--ri];) r[ri] = 9;\r\n              --r[ri];\r\n              r[rl] += 10;\r\n            }\r\n            r[rl] -= bt[rl];\r\n          }\r\n\r\n          for (; !r[0];) r.shift();\r\n        } else {\r\n          break;\r\n        }\r\n      }\r\n\r\n      // Add the digit n to the result array.\r\n      qc[qi++] = cmp ? n : ++n;\r\n\r\n      // Update the remainder.\r\n      if (r[0] && cmp) r[rl] = a[ai] || 0;\r\n      else r = [a[ai]];\r\n\r\n    } while ((ai++ < al || r[0] !== UNDEFINED) && k--);\r\n\r\n    // Leading zero? Do not remove if result is simply zero (qi == 1).\r\n    if (!qc[0] && qi != 1) {\r\n\r\n      // There can't be more than one zero.\r\n      qc.shift();\r\n      q.e--;\r\n      p--;\r\n    }\r\n\r\n    // Round?\r\n    if (qi > p) round(q, p, Big.RM, r[0] !== UNDEFINED);\r\n\r\n    return q;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Big is equal to the value of Big y, otherwise return false.\r\n   */\r\n  P.eq = function (y) {\r\n    return this.cmp(y) === 0;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Big is greater than the value of Big y, otherwise return\r\n   * false.\r\n   */\r\n  P.gt = function (y) {\r\n    return this.cmp(y) > 0;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Big is greater than or equal to the value of Big y, otherwise\r\n   * return false.\r\n   */\r\n  P.gte = function (y) {\r\n    return this.cmp(y) > -1;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Big is less than the value of Big y, otherwise return false.\r\n   */\r\n  P.lt = function (y) {\r\n    return this.cmp(y) < 0;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Big is less than or equal to the value of Big y, otherwise\r\n   * return false.\r\n   */\r\n  P.lte = function (y) {\r\n    return this.cmp(y) < 1;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Big whose value is the value of this Big minus the value of Big y.\r\n   */\r\n  P.minus = P.sub = function (y) {\r\n    var i, j, t, xlty,\r\n      x = this,\r\n      Big = x.constructor,\r\n      a = x.s,\r\n      b = (y = new Big(y)).s;\r\n\r\n    // Signs differ?\r\n    if (a != b) {\r\n      y.s = -b;\r\n      return x.plus(y);\r\n    }\r\n\r\n    var xc = x.c.slice(),\r\n      xe = x.e,\r\n      yc = y.c,\r\n      ye = y.e;\r\n\r\n    // Either zero?\r\n    if (!xc[0] || !yc[0]) {\r\n      if (yc[0]) {\r\n        y.s = -b;\r\n      } else if (xc[0]) {\r\n        y = new Big(x);\r\n      } else {\r\n        y.s = 1;\r\n      }\r\n      return y;\r\n    }\r\n\r\n    // Determine which is the bigger number. Prepend zeros to equalise exponents.\r\n    if (a = xe - ye) {\r\n\r\n      if (xlty = a < 0) {\r\n        a = -a;\r\n        t = xc;\r\n      } else {\r\n        ye = xe;\r\n        t = yc;\r\n      }\r\n\r\n      t.reverse();\r\n      for (b = a; b--;) t.push(0);\r\n      t.reverse();\r\n    } else {\r\n\r\n      // Exponents equal. Check digit by digit.\r\n      j = ((xlty = xc.length < yc.length) ? xc : yc).length;\r\n\r\n      for (a = b = 0; b < j; b++) {\r\n        if (xc[b] != yc[b]) {\r\n          xlty = xc[b] < yc[b];\r\n          break;\r\n        }\r\n      }\r\n    }\r\n\r\n    // x < y? Point xc to the array of the bigger number.\r\n    if (xlty) {\r\n      t = xc;\r\n      xc = yc;\r\n      yc = t;\r\n      y.s = -y.s;\r\n    }\r\n\r\n    /*\r\n     * Append zeros to xc if shorter. No need to add zeros to yc if shorter as subtraction only\r\n     * needs to start at yc.length.\r\n     */\r\n    if ((b = (j = yc.length) - (i = xc.length)) > 0) for (; b--;) xc[i++] = 0;\r\n\r\n    // Subtract yc from xc.\r\n    for (b = i; j > a;) {\r\n      if (xc[--j] < yc[j]) {\r\n        for (i = j; i && !xc[--i];) xc[i] = 9;\r\n        --xc[i];\r\n        xc[j] += 10;\r\n      }\r\n\r\n      xc[j] -= yc[j];\r\n    }\r\n\r\n    // Remove trailing zeros.\r\n    for (; xc[--b] === 0;) xc.pop();\r\n\r\n    // Remove leading zeros and adjust exponent accordingly.\r\n    for (; xc[0] === 0;) {\r\n      xc.shift();\r\n      --ye;\r\n    }\r\n\r\n    if (!xc[0]) {\r\n\r\n      // n - n = +0\r\n      y.s = 1;\r\n\r\n      // Result must be zero.\r\n      xc = [ye = 0];\r\n    }\r\n\r\n    y.c = xc;\r\n    y.e = ye;\r\n\r\n    return y;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Big whose value is the value of this Big modulo the value of Big y.\r\n   */\r\n  P.mod = function (y) {\r\n    var ygtx,\r\n      x = this,\r\n      Big = x.constructor,\r\n      a = x.s,\r\n      b = (y = new Big(y)).s;\r\n\r\n    if (!y.c[0]) {\r\n      throw Error(DIV_BY_ZERO);\r\n    }\r\n\r\n    x.s = y.s = 1;\r\n    ygtx = y.cmp(x) == 1;\r\n    x.s = a;\r\n    y.s = b;\r\n\r\n    if (ygtx) return new Big(x);\r\n\r\n    a = Big.DP;\r\n    b = Big.RM;\r\n    Big.DP = Big.RM = 0;\r\n    x = x.div(y);\r\n    Big.DP = a;\r\n    Big.RM = b;\r\n\r\n    return this.minus(x.times(y));\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Big whose value is the value of this Big plus the value of Big y.\r\n   */\r\n  P.plus = P.add = function (y) {\r\n    var e, k, t,\r\n      x = this,\r\n      Big = x.constructor;\r\n\r\n    y = new Big(y);\r\n\r\n    // Signs differ?\r\n    if (x.s != y.s) {\r\n      y.s = -y.s;\r\n      return x.minus(y);\r\n    }\r\n\r\n    var xe = x.e,\r\n      xc = x.c,\r\n      ye = y.e,\r\n      yc = y.c;\r\n\r\n    // Either zero?\r\n    if (!xc[0] || !yc[0]) {\r\n      if (!yc[0]) {\r\n        if (xc[0]) {\r\n          y = new Big(x);\r\n        } else {\r\n          y.s = x.s;\r\n        }\r\n      }\r\n      return y;\r\n    }\r\n\r\n    xc = xc.slice();\r\n\r\n    // Prepend zeros to equalise exponents.\r\n    // Note: reverse faster than unshifts.\r\n    if (e = xe - ye) {\r\n      if (e > 0) {\r\n        ye = xe;\r\n        t = yc;\r\n      } else {\r\n        e = -e;\r\n        t = xc;\r\n      }\r\n\r\n      t.reverse();\r\n      for (; e--;) t.push(0);\r\n      t.reverse();\r\n    }\r\n\r\n    // Point xc to the longer array.\r\n    if (xc.length - yc.length < 0) {\r\n      t = yc;\r\n      yc = xc;\r\n      xc = t;\r\n    }\r\n\r\n    e = yc.length;\r\n\r\n    // Only start adding at yc.length - 1 as the further digits of xc can be left as they are.\r\n    for (k = 0; e; xc[e] %= 10) k = (xc[--e] = xc[e] + yc[e] + k) / 10 | 0;\r\n\r\n    // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n\r\n    if (k) {\r\n      xc.unshift(k);\r\n      ++ye;\r\n    }\r\n\r\n    // Remove trailing zeros.\r\n    for (e = xc.length; xc[--e] === 0;) xc.pop();\r\n\r\n    y.c = xc;\r\n    y.e = ye;\r\n\r\n    return y;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a Big whose value is the value of this Big raised to the power n.\r\n   * If n is negative, round to a maximum of Big.DP decimal places using rounding\r\n   * mode Big.RM.\r\n   *\r\n   * n {number} Integer, -MAX_POWER to MAX_POWER inclusive.\r\n   */\r\n  P.pow = function (n) {\r\n    var x = this,\r\n      one = new x.constructor('1'),\r\n      y = one,\r\n      isneg = n < 0;\r\n\r\n    if (n !== ~~n || n < -MAX_POWER || n > MAX_POWER) {\r\n      throw Error(INVALID + 'exponent');\r\n    }\r\n\r\n    if (isneg) n = -n;\r\n\r\n    for (;;) {\r\n      if (n & 1) y = y.times(x);\r\n      n >>= 1;\r\n      if (!n) break;\r\n      x = x.times(x);\r\n    }\r\n\r\n    return isneg ? one.div(y) : y;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Big whose value is the value of this Big rounded to a maximum precision of sd\r\n   * significant digits using rounding mode rm, or Big.RM if rm is not specified.\r\n   *\r\n   * sd {number} Significant digits: integer, 1 to MAX_DP inclusive.\r\n   * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\r\n   */\r\n  P.prec = function (sd, rm) {\r\n    if (sd !== ~~sd || sd < 1 || sd > MAX_DP) {\r\n      throw Error(INVALID + 'precision');\r\n    }\r\n    return round(new this.constructor(this), sd, rm);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Big whose value is the value of this Big rounded to a maximum of dp decimal places\r\n   * using rounding mode rm, or Big.RM if rm is not specified.\r\n   * If dp is negative, round to an integer which is a multiple of 10**-dp.\r\n   * If dp is not specified, round to 0 decimal places.\r\n   *\r\n   * dp? {number} Integer, -MAX_DP to MAX_DP inclusive.\r\n   * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\r\n   */\r\n  P.round = function (dp, rm) {\r\n    if (dp === UNDEFINED) dp = 0;\r\n    else if (dp !== ~~dp || dp < -MAX_DP || dp > MAX_DP) {\r\n      throw Error(INVALID_DP);\r\n    }\r\n    return round(new this.constructor(this), dp + this.e + 1, rm);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Big whose value is the square root of the value of this Big, rounded, if\r\n   * necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.\r\n   */\r\n  P.sqrt = function () {\r\n    var r, c, t,\r\n      x = this,\r\n      Big = x.constructor,\r\n      s = x.s,\r\n      e = x.e,\r\n      half = new Big('0.5');\r\n\r\n    // Zero?\r\n    if (!x.c[0]) return new Big(x);\r\n\r\n    // Negative?\r\n    if (s < 0) {\r\n      throw Error(NAME + 'No square root');\r\n    }\r\n\r\n    // Estimate.\r\n    s = Math.sqrt(x + '');\r\n\r\n    // Math.sqrt underflow/overflow?\r\n    // Re-estimate: pass x coefficient to Math.sqrt as integer, then adjust the result exponent.\r\n    if (s === 0 || s === 1 / 0) {\r\n      c = x.c.join('');\r\n      if (!(c.length + e & 1)) c += '0';\r\n      s = Math.sqrt(c);\r\n      e = ((e + 1) / 2 | 0) - (e < 0 || e & 1);\r\n      r = new Big((s == 1 / 0 ? '5e' : (s = s.toExponential()).slice(0, s.indexOf('e') + 1)) + e);\r\n    } else {\r\n      r = new Big(s + '');\r\n    }\r\n\r\n    e = r.e + (Big.DP += 4);\r\n\r\n    // Newton-Raphson iteration.\r\n    do {\r\n      t = r;\r\n      r = half.times(t.plus(x.div(t)));\r\n    } while (t.c.slice(0, e).join('') !== r.c.slice(0, e).join(''));\r\n\r\n    return round(r, (Big.DP -= 4) + r.e + 1, Big.RM);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Big whose value is the value of this Big times the value of Big y.\r\n   */\r\n  P.times = P.mul = function (y) {\r\n    var c,\r\n      x = this,\r\n      Big = x.constructor,\r\n      xc = x.c,\r\n      yc = (y = new Big(y)).c,\r\n      a = xc.length,\r\n      b = yc.length,\r\n      i = x.e,\r\n      j = y.e;\r\n\r\n    // Determine sign of result.\r\n    y.s = x.s == y.s ? 1 : -1;\r\n\r\n    // Return signed 0 if either 0.\r\n    if (!xc[0] || !yc[0]) {\r\n      y.c = [y.e = 0];\r\n      return y;\r\n    }\r\n\r\n    // Initialise exponent of result as x.e + y.e.\r\n    y.e = i + j;\r\n\r\n    // If array xc has fewer digits than yc, swap xc and yc, and lengths.\r\n    if (a < b) {\r\n      c = xc;\r\n      xc = yc;\r\n      yc = c;\r\n      j = a;\r\n      a = b;\r\n      b = j;\r\n    }\r\n\r\n    // Initialise coefficient array of result with zeros.\r\n    for (c = new Array(j = a + b); j--;) c[j] = 0;\r\n\r\n    // Multiply.\r\n\r\n    // i is initially xc.length.\r\n    for (i = b; i--;) {\r\n      b = 0;\r\n\r\n      // a is yc.length.\r\n      for (j = a + i; j > i;) {\r\n\r\n        // Current sum of products at this digit position, plus carry.\r\n        b = c[j] + yc[i] * xc[j - i - 1] + b;\r\n        c[j--] = b % 10;\r\n\r\n        // carry\r\n        b = b / 10 | 0;\r\n      }\r\n\r\n      c[j] = b;\r\n    }\r\n\r\n    // Increment result exponent if there is a final carry, otherwise remove leading zero.\r\n    if (b) ++y.e;\r\n    else c.shift();\r\n\r\n    // Remove trailing zeros.\r\n    for (i = c.length; !c[--i];) c.pop();\r\n    y.c = c;\r\n\r\n    return y;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a string representing the value of this Big in exponential notation rounded to dp fixed\r\n   * decimal places using rounding mode rm, or Big.RM if rm is not specified.\r\n   *\r\n   * dp? {number} Decimal places: integer, 0 to MAX_DP inclusive.\r\n   * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\r\n   */\r\n  P.toExponential = function (dp, rm) {\r\n    var x = this,\r\n      n = x.c[0];\r\n\r\n    if (dp !== UNDEFINED) {\r\n      if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\r\n        throw Error(INVALID_DP);\r\n      }\r\n      x = round(new x.constructor(x), ++dp, rm);\r\n      for (; x.c.length < dp;) x.c.push(0);\r\n    }\r\n\r\n    return stringify(x, true, !!n);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a string representing the value of this Big in normal notation rounded to dp fixed\r\n   * decimal places using rounding mode rm, or Big.RM if rm is not specified.\r\n   *\r\n   * dp? {number} Decimal places: integer, 0 to MAX_DP inclusive.\r\n   * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\r\n   *\r\n   * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\r\n   * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\r\n   */\r\n  P.toFixed = function (dp, rm) {\r\n    var x = this,\r\n      n = x.c[0];\r\n\r\n    if (dp !== UNDEFINED) {\r\n      if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\r\n        throw Error(INVALID_DP);\r\n      }\r\n      x = round(new x.constructor(x), dp + x.e + 1, rm);\r\n\r\n      // x.e may have changed if the value is rounded up.\r\n      for (dp = dp + x.e + 1; x.c.length < dp;) x.c.push(0);\r\n    }\r\n\r\n    return stringify(x, false, !!n);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a string representing the value of this Big.\r\n   * Return exponential notation if this Big has a positive exponent equal to or greater than\r\n   * Big.PE, or a negative exponent equal to or less than Big.NE.\r\n   * Omit the sign for negative zero.\r\n   */\r\n  P.toJSON = P.toString = function () {\r\n    var x = this,\r\n      Big = x.constructor;\r\n    return stringify(x, x.e <= Big.NE || x.e >= Big.PE, !!x.c[0]);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return the value of this Big as a primitve number.\r\n   */\r\n  P.toNumber = function () {\r\n    var n = Number(stringify(this, true, true));\r\n    if (this.constructor.strict === true && !this.eq(n.toString())) {\r\n      throw Error(NAME + 'Imprecise conversion');\r\n    }\r\n    return n;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a string representing the value of this Big rounded to sd significant digits using\r\n   * rounding mode rm, or Big.RM if rm is not specified.\r\n   * Use exponential notation if sd is less than the number of digits necessary to represent\r\n   * the integer part of the value in normal notation.\r\n   *\r\n   * sd {number} Significant digits: integer, 1 to MAX_DP inclusive.\r\n   * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\r\n   */\r\n  P.toPrecision = function (sd, rm) {\r\n    var x = this,\r\n      Big = x.constructor,\r\n      n = x.c[0];\r\n\r\n    if (sd !== UNDEFINED) {\r\n      if (sd !== ~~sd || sd < 1 || sd > MAX_DP) {\r\n        throw Error(INVALID + 'precision');\r\n      }\r\n      x = round(new Big(x), sd, rm);\r\n      for (; x.c.length < sd;) x.c.push(0);\r\n    }\r\n\r\n    return stringify(x, sd <= x.e || x.e <= Big.NE || x.e >= Big.PE, !!n);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a string representing the value of this Big.\r\n   * Return exponential notation if this Big has a positive exponent equal to or greater than\r\n   * Big.PE, or a negative exponent equal to or less than Big.NE.\r\n   * Include the sign for negative zero.\r\n   */\r\n  P.valueOf = function () {\r\n    var x = this,\r\n      Big = x.constructor;\r\n    if (Big.strict === true) {\r\n      throw Error(NAME + 'valueOf disallowed');\r\n    }\r\n    return stringify(x, x.e <= Big.NE || x.e >= Big.PE, true);\r\n  };\r\n\r\n\r\n  // Export\r\n\r\n\r\n  Big = _Big_();\r\n\r\n  Big['default'] = Big.Big = Big;\r\n\r\n  //AMD.\r\n  if (typeof define === 'function' && define.amd) {\r\n    define(function () { return Big; });\r\n\r\n  // Node and other CommonJS-like environments that support module.exports.\r\n  } else if (typeof module !== 'undefined' && module.exports) {\r\n    module.exports = Big;\r\n\r\n  //Browser.\r\n  } else {\r\n    GLOBAL.Big = Big;\r\n  }\r\n})(this);\r\n","import TrackedAsyncData from '../tracked-async-data';\n\n/**\n  Given a `Promise`, return a `TrackedAsyncData` object which exposes the state\n  of the promise, as well as the resolved value or thrown error once the promise\n  resolves or fails.\n\n  The function and helper accept any data, so you may use it freely in contexts\n  where you are receiving data which may or may not be a `Promise`.\n\n  ## Example\n\n  Given a backing class like this:\n\n  ```js\n  import Component from '@glimmer/component';\n  import { cached } from 'ember-cached-decorator-polyfill';\n  import { load } from 'ember-tracked-data/helpers/load';\n\n  export default class ExtraInfo extends Component {\n    @cached\n    get someData() {return load(fetch('some-url', this.args.someArg));\n    }\n  }\n  ```\n\n  You can use the result in your template like this:\n\n  ```hbs\n  {{#if this.someData.isLoading}}\n    loading...\n  {{else if this.someData.isLoaded}}\n    {{this.someData.value}}\n  {{else if this.someData.isError}}\n    Whoops! Something went wrong: {{this.someData.error}}\n  {{/if}}\n  ```\n\n  You can also use the helper directly in your template:\n\n  ```hbs\n  {{#let (load @somePromise) as |data|}}\n    {{#if data.isLoading}}\n      <LoadingSpinner />\n    {{else if data.isLoaded}}\n      <SomeComponent @data={{data.value}} />\n    {{else if data.isError}}\n      <Error @cause={{data.error}} />\n    {{/if}}\n  {{/let}}\n  ```\n\n  @param data The (async) data we want to operate on: a value or a `Promise` of\n    a value.\n  @returns An object containing the state(, value, and error).\n  @note Prefer to use `TrackedAsyncData` directly! This function is provided\n    simply for symmetry with the helper and backwards compatibility.\n */\nfunction load<T>(data: T | Promise<T>): TrackedAsyncData<T> {\n  return new TrackedAsyncData(data);\n}\nexport { load, load as default };\n","import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { deprecate } from '@ember/debug';\nimport { buildWaiter } from '@ember/test-waiters';\n\nconst waiter = buildWaiter('ember-async-data');\n\n/** A very cheap representation of the of a promise. */\ntype StateRepr<T> =\n  | [tag: 'PENDING']\n  | [tag: 'RESOLVED', value: T]\n  | [tag: 'REJECTED', error: unknown];\n\n// We only need a single instance of the pending state in our system, since it\n// is otherwise unparameterized (unlike the resolved and rejected states).\nconst PENDING = ['PENDING'] as [tag: 'PENDING'];\n\n// This class exists so that the state can be *wholly* private to outside\n// consumers, but its tracked internals can be both read and written directly by\n// `TrackedAsyncData` itself. The initial state of every `TrackedAsyncData` is\n// `PENDING`, though it may immediately become resolved for some `Promise`\n// instances (e.g. with a `Promise.resolve`).\nclass State<T> {\n  @tracked data: StateRepr<T> = PENDING;\n}\n\n// NOTE: this class is the implementation behind the types; the public types\n// layer on additional safety. See below! Additionally, the docs for the class\n// itself are applied to the export, not to the class, so that they will appear\n// when users refer to *that*.\nclass _TrackedAsyncData<T> {\n  #token: unknown;\n\n  /**\n    @param promise The promise to load.\n   */\n  constructor(data: T | Promise<T>) {\n    if (this.constructor !== _TrackedAsyncData) {\n      throw new Error('tracked-async-data cannot be subclassed');\n    }\n\n    if (!isPromiseLike(data)) {\n      this.#state.data = ['RESOLVED', data];\n      return;\n    }\n\n    const promise = data;\n    this.#token = waiter.beginAsync();\n\n    // Otherwise, we know that haven't yet handled that promise anywhere in the\n    // system, so we continue creating a new instance.\n    promise.then(\n      (value) => {\n        this.#state.data = ['RESOLVED', value];\n        waiter.endAsync(this.#token);\n      },\n      (error) => {\n        this.#state.data = ['REJECTED', error];\n        waiter.endAsync(this.#token);\n      }\n    );\n  }\n\n  /**\n    The internal state management for the promise.\n\n    - `readonly` so it cannot be mutated by the class itself after instantiation\n    - uses true native privacy so it cannot even be read (and therefore *cannot*\n      be depended upon) by consumers.\n   */\n  readonly #state = new State<T>();\n\n  /**\n   * The resolution state of the promise.\n   */\n  @dependentKeyCompat\n  get state(): State<T>['data'][0] {\n    return this.#state.data[0];\n  }\n\n  /**\n    The value of the resolved promise.\n\n    @note It is only valid to access `error` when `.isError` is true, that is,\n      when `TrackedAsyncData.state` is `\"ERROR\"`.\n    @warning You should not rely on this returning `T | null`! In a future\n      breaking change which drops support for pre-Octane idioms, it will *only*\n      return `T` and will *throw* if you access it when the state is wrong.\n   */\n  @dependentKeyCompat\n  get value(): T | null {\n    deprecate(\n      \"Accessing `value` when TrackedAsyncData is not in the resolved state is not supported and will throw an error in the future. Always check that `.state` is `'RESOLVED'` or that `.isResolved` is `true` before accessing this property.\",\n      this.#state.data[0] === 'RESOLVED',\n      {\n        id: 'tracked-async-data::invalid-value-access',\n        for: 'ember-async-data',\n        since: {\n          available: '1.0.0',\n          enabled: '1.0.0',\n        },\n        until: '2.0.0',\n      }\n    );\n\n    return this.#state.data[0] === 'RESOLVED' ? this.#state.data[1] : null;\n  }\n\n  /**\n    The error of the rejected promise.\n\n    @note It is only valid to access `error` when `.isError` is true, that is,\n      when `TrackedAsyncData.state` is `\"ERROR\"`.\n    @warning You should not rely on this returning `null` when the state is not\n      `\"ERROR\"`! In a future breaking change which drops support for pre-Octane\n      idioms, it will *only* return `E` and will *throw* if you access it when\n      the state is wrong.\n   */\n  @dependentKeyCompat\n  get error(): unknown {\n    deprecate(\n      \"Accessing `error` when TrackedAsyncData is not in the rejected state is not supported and will throw an error in the future. Always check that `.state` is `'REJECTED'` or that `.isRejected` is `true` before accessing this property.\",\n      this.#state.data[0] === 'REJECTED',\n      {\n        id: 'tracked-async-data::invalid-error-access',\n        for: 'ember-async-data',\n        since: {\n          available: '1.0.0',\n          enabled: '1.0.0',\n        },\n        until: '2.0.0',\n      }\n    );\n\n    return this.#state.data[0] === 'REJECTED' ? this.#state.data[1] : null;\n  }\n\n  /**\n    Is the state `\"PENDING\"`.\n   */\n  @dependentKeyCompat\n  get isPending(): boolean {\n    return this.state === 'PENDING';\n  }\n\n  /** Is the state `\"RESOLVED\"`? */\n  @dependentKeyCompat\n  get isResolved(): boolean {\n    return this.state === 'RESOLVED';\n  }\n\n  /** Is the state `\"REJECTED\"`? */\n  @dependentKeyCompat\n  get isRejected(): boolean {\n    return this.state === 'REJECTED';\n  }\n\n  // SAFETY: casts are safe because we uphold these invariants elsewhere in the\n  // class. It would be great if we could guarantee them statically, but getters\n  // do not return information about the state of the class well.\n  toJSON(): JSONRepr<T> {\n    const { isPending, isResolved, isRejected } = this;\n    if (isPending) {\n      return { isPending, isResolved, isRejected } as JSONRepr<T>;\n    } else if (isResolved) {\n      return {\n        isPending,\n        isResolved,\n        value: this.value,\n        isRejected,\n      } as JSONRepr<T>;\n    } else {\n      return {\n        isPending,\n        isResolved,\n        isRejected,\n        error: this.error,\n      } as JSONRepr<T>;\n    }\n  }\n\n  toString(): string {\n    return JSON.stringify(this.toJSON(), null, 2);\n  }\n}\n\n/**\n  The JSON representation of a `TrackedAsyncData`, useful for e.g. logging.\n\n  Note that you cannot reconstruct a `TrackedAsyncData` *from* this, because it\n  is impossible to get the original promise when in a pending state!\n */\nexport type JSONRepr<T> =\n  | { isPending: true; isResolved: false; isRejected: false }\n  | { isPending: false; isResolved: true; isRejected: false; value: T }\n  | { isPending: false; isResolved: false; isRejected: true; error: unknown };\n\n// The exported type is the intersection of three narrowed interfaces. Doing it\n// this way has two nice benefits:\n//\n// 1.  It allows narrowing to work. For example:\n//\n//     ```ts\n//     let data = new TrackedAsyncData(Promise.resolve(\"hello\"));\n//     if (data.isPending) {\n//       data.value;  // null\n//       data.error;  // null\n//     } else if (data.isPending) {\n//       data.value;  // null\n//       data.error;  // null\n//     } else if (data.isRejected) {\n//       data.value;  // null\n//       data.error;  // unknown, can now be narrowed\n//     }\n//     ```\n//\n//     This dramatically improves the usability of the type in type-aware\n//     contexts (including with templates when using Glint!)\n//\n// 2.  Using `interface extends` means that (a) it is guaranteed to be a subtype\n//     of the `_TrackedAsyncData` type, (b) that the docstrings applied to the\n//     base type still work, and (c) that the types which are *common* to the\n//     shared implementations (i.e. `.toJSON()` and `.toString()`) are shared\n//     automatically.\n\ninterface Pending<T> extends _TrackedAsyncData<T> {\n  state: 'PENDING';\n  isPending: true;\n  isResolved: false;\n  isRejected: false;\n  value: null;\n  error: null;\n}\n\ninterface Resolved<T> extends _TrackedAsyncData<T> {\n  state: 'RESOLVED';\n  isPending: false;\n  isResolved: true;\n  isRejected: false;\n  value: T;\n  error: null;\n}\n\ninterface Rejected<T> extends _TrackedAsyncData<T> {\n  state: 'REJECTED';\n  isPending: false;\n  isResolved: false;\n  isRejected: true;\n  value: null;\n  error: unknown;\n}\n\n/**\n  An autotracked `Promise` handler, representing asynchronous data.\n\n  Given a `Promise` instance, a `TrackedAsyncData` behaves exactly lik the\n  original `Promise`, except that it makes the state of the `Promise` visible\n  via tracked state, so you can check whether the promise is pending, resolved,\n  or rejected; and so you can get the value if it has resolved or the error if\n  it has rejected.\n\n  Every `Promise` in the system is guaranteed to be associated with at most a\n  single `TrackedAsyncData`.\n\n  ## Example\n\n  ```ts\n  import Component from '@glimmer/component';\n  import { cached } from '@glimmer/tracking';\n  import { inject as service } from '@ember/service';\n  import TrackedAsyncData from 'ember-async-data/tracked-async-data';\n\n  export default class SmartProfile extends Component<{ id: number }> {\n    @service store;\n\n    @cached\n    get someData() {\n      let recordPromise = this.store.findRecord('user', this.args.id);\n      return new TrackedAsyncData(recordPromise);\n    }\n  }\n  ```\n\n  And a corresponding template:\n\n  ```hbs\n  {{#if this.someData.isResolved}}\n    <PresentTheData @data={{this.someData.data}} />\n  {{else if this.someData.isPending}}\n    <LoadingSpinner />\n  {{else if this.someData.isRejected}}\n    <p>\n      Whoops! Looks like something went wrong!\n      {{this.someData.error.message}}\n    </p>\n  {{/if}}\n  ```\n */\ntype TrackedAsyncData<T> = Pending<T> | Resolved<T> | Rejected<T>;\nconst TrackedAsyncData = _TrackedAsyncData as new <T>(\n  data: T | Promise<T>\n) => TrackedAsyncData<T>;\nexport default TrackedAsyncData;\n\n/** Utility type to check whether the string `key` is a property on an object */\nfunction has<K extends PropertyKey, T extends object>(\n  key: K,\n  t: T\n): t is T & Record<K, unknown> {\n  return key in t;\n}\n\nfunction isPromiseLike(data: unknown): data is PromiseLike<unknown> {\n  return (\n    typeof data === 'object' &&\n    data !== null &&\n    has('then', data) &&\n    typeof data.then === 'function'\n  );\n}\n","// https://github.com/zeppelin/ember-click-outside/issues/23\n\nconst proto = typeof Element !== 'undefined' ? Element.prototype : {};\nconst vendor =\n  proto.matches ||\n  proto.matchesSelector ||\n  proto.webkitMatchesSelector ||\n  proto.mozMatchesSelector ||\n  proto.msMatchesSelector ||\n  proto.oMatchesSelector;\n\nexport function matches(el, selector) {\n  if (!el || el.nodeType !== 1) return false;\n  if (vendor) return vendor.call(el, selector);\n  var nodes = el.parentNode.querySelectorAll(selector);\n  for (var i = 0; i < nodes.length; i++) {\n    if (nodes[i] == el) return true;\n  }\n  return false;\n}\n","import { matches } from './-private/matches-selector';\n\nexport function closest(element, selector) {\n  if (matches(element, selector)) {\n    return element;\n  }\n\n  while (element.parentNode) {\n    element = element.parentNode;\n\n    if (matches(element, selector)) {\n      return element;\n    }\n  }\n}\n\nexport const documentOrBodyContains = (element) => {\n  // https://github.com/zeppelin/ember-click-outside/issues/30\n  if (typeof document.contains === 'function') {\n    return document.contains(element);\n  } else {\n    return document.body.contains(element);\n  }\n};\n\nexport const ios = () => {\n  return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\n};\n","import { next, cancel } from '@ember/runloop';\nimport { registerDestructor } from '@ember/destroyable';\nimport Modifier from 'ember-modifier';\n\nimport { closest, documentOrBodyContains, ios } from '../utils';\n\nexport default class ClickOutsideModifier extends Modifier {\n  didSetup = false;\n  action = null;\n  capture = null;\n  eventHandler = null;\n  eventType = 'click';\n  exceptSelector = null;\n\n  cancelOutsideListenerSetup = null;\n\n  constructor() {\n    super(...arguments);\n    registerDestructor(this, this.cleanup);\n  }\n\n  modify(element, [action], { capture, eventType, exceptSelector }) {\n    if (!this.didSetup) {\n      if (ios()) {\n        document.body.style.cursor = 'pointer';\n      }\n\n      this.didSetup = true;\n    } else {\n      this._destroy();\n    }\n    this._init({\n      element,\n      action,\n      capture,\n      eventType,\n      exceptSelector,\n    });\n  }\n\n  cleanup = () => {\n    this._destroy();\n\n    if (ios()) {\n      document.body.style.cursor = '';\n    }\n  };\n\n  _init({ element, action, capture, eventType, exceptSelector }) {\n    if (!action) {\n      return;\n    }\n\n    this.action = action;\n    this.exceptSelector = exceptSelector;\n    this.capture = capture;\n\n    if (eventType) {\n      this.eventType = eventType;\n    }\n\n    this.eventHandler = this._createHandler(\n      element,\n      this.action,\n      this.exceptSelector\n    );\n    this.cancelOutsideListenerSetup = next(this, this._addClickOutsideListener);\n  }\n\n  _destroy() {\n    if (!this.action) {\n      return;\n    }\n\n    cancel(this.cancelOutsideListenerSetup);\n    this._removeClickOutsideListener();\n  }\n\n  _addClickOutsideListener() {\n    let { capture, eventHandler, eventType } = this;\n    document.addEventListener(eventType, eventHandler, { capture });\n  }\n\n  _removeClickOutsideListener() {\n    let { capture, eventHandler, eventType } = this;\n    document.removeEventListener(eventType, eventHandler, { capture });\n  }\n\n  _createHandler(element, action, exceptSelector) {\n    return (e) => {\n      if (exceptSelector && closest(e.target, exceptSelector)) {\n        return;\n      }\n\n      let path = e.path || (e.composedPath && e.composedPath());\n\n      if (path) {\n        path.includes(element) || action(e);\n      } else {\n        // Check if the click target still is in the DOM.\n        // If not, there is no way to know if it was inside the element or not.\n        let isRemoved = !e.target || !documentOrBodyContains(e.target);\n\n        // Check the element is found as a parent of the click target.\n        let isInside = element === e.target || element.contains(e.target);\n\n        if (!isRemoved && !isInside) {\n          action(e);\n        }\n      }\n    };\n  }\n}\n","import { later } from '@ember/runloop';\n\n/**\n * Function that returns a promise that resolves after DOM changes\n * have been flushed and after a browser repaint.\n *\n * @function nextTick\n * @export nextTick\n * @return {Promise} the promise\n */\nexport function nextTick() {\n  return new Promise((resolve) => {\n    window.requestAnimationFrame(() => resolve());\n  });\n}\n\n/**\n * Function that returns a promise that resolves after `ms` milliseconds.\n *\n * @function sleep\n * @export sleep\n * @param {number} ms number of milliseconds after which the promise will resolve\n * @return {Promise} the promise that will resolve after `ms` milliseconds\n */\nexport function sleep(ms) {\n  return new Promise((resolve) => {\n    later(() => resolve(), ms);\n  });\n}\n\n/**\n * Computes the time a css animation will take.\n * Uses `getComputedStyle` to get durations and delays.\n *\n * @function computeTimeout\n * @export computeTimeout\n * @param {Element} element element used calculate the animation duration based on `getComputedStyle`\n * @return {number} the calculated animation duration + delay\n */\nexport function computeTimeout(element) {\n  let {\n    transitionDuration,\n    transitionDelay,\n    animationDuration,\n    animationDelay,\n    animationIterationCount,\n  } = window.getComputedStyle(element);\n\n  // `getComputedStyle` returns durations and delays in the Xs format.\n  // Conveniently if `parseFloat` encounters a character other than a sign (+ or -),\n  // numeral (0-9), a decimal point, or an exponent, it returns the value up to that point\n  // and ignores that character and all succeeding characters.\n\n  let maxDelay = Math.max(\n    parseFloat(animationDelay),\n    parseFloat(transitionDelay)\n  );\n  let maxDuration = Math.max(\n    parseFloat(animationDuration) * parseFloat(animationIterationCount),\n    parseFloat(transitionDuration)\n  );\n\n  return (maxDelay + maxDuration) * 1000;\n}\n","import Modifier from 'ember-modifier';\nimport { registerDestructor } from '@ember/destroyable';\nimport {\n  dependencySatisfies,\n  getOwnConfig,\n  macroCondition,\n} from '@embroider/macros';\nimport { buildWaiter } from '@ember/test-waiters';\n\nimport { nextTick, sleep, computeTimeout } from '../utils/transition-utils';\n\nlet waiter;\n\nif (macroCondition(getOwnConfig()?.useTestWaiters)) {\n  waiter = buildWaiter('ember-css-transitions');\n} else {\n  waiter = {\n    beginAsync() {\n      /* fake */\n    },\n    endAsync() {\n      /* fake */\n    },\n  };\n}\n\nlet modifier;\n\nif (macroCondition(dependencySatisfies('ember-modifier', '>=3.2.0 || 4.x'))) {\n  /**\n    Modifier that applies classes. Usage:\n\n    ```hbs\n    <div {{css-transition name=\"example\"}}>\n    <p>Hello world</p>\n    </div>\n    ```\n\n    @class CssTransitionModifier\n    @argument {Function} [didTransitionIn]\n    @argument {Function} [didTransitionOut]\n    @public\n   */\n  class CssTransitionModifier extends Modifier {\n    element = null;\n    clone = null;\n    parentElement = null;\n    nextElementSibling = null;\n    installed = false;\n    finishedTransitionIn = false;\n    isEnabled = true;\n    parentSelector;\n\n    /**\n     * @property el\n     * @type {(HTMLElement|undefined)}\n     * @private\n     * @readonly\n     */\n    get el() {\n      return this.clone || this.element;\n    }\n\n    /**\n     * @property didTransitionIn\n     * @type {(Function|undefined)}\n     * @private\n     */\n    didTransitionIn;\n\n    /**\n     * @property didTransitionOut\n     * @type {(Function|undefined)}\n     * @private\n     */\n    didTransitionOut;\n\n    /**\n     * @property transitionName\n     * @type {(String|undefined)}\n     * @private\n     */\n    transitionName;\n\n    /**\n     * @property enterClass\n     * @type {(String|undefined)}\n     * @private\n     */\n    enterClass;\n\n    /**\n     * @property enterActiveClass\n     * @type {(String|undefined)}\n     * @private\n     */\n    enterActiveClass;\n\n    /**\n     * @property enterToClass\n     * @type {(String|undefined)}\n     * @private\n     */\n    enterToClass;\n\n    /**\n     * @property leaveClass\n     * @type {(String|undefined)}\n     * @private\n     */\n    leaveClass;\n\n    /**\n     * @property leaveActiveClass\n     * @type {(String|undefined)}\n     * @private\n     */\n    leaveActiveClass;\n\n    /**\n     * @property leaveToClass\n     * @type {(String|undefined)}\n     * @private\n     */\n    leaveToClass;\n\n    constructor(owner, args) {\n      super(owner, args);\n\n      registerDestructor(this, () => {\n        if (this.isEnabled === false || !this.finishedTransitionIn) {\n          return;\n        }\n\n        this.guardedRun(this.transitionOut);\n      });\n    }\n\n    modify(element, positional, named) {\n      this.element = element;\n\n      this.setupProperties(positional, named);\n\n      if (named.isEnabled === false || this.installed) {\n        return;\n      }\n\n      this.installed = true;\n      let el = this.getElementToClone();\n      this.parentElement = el.parentElement;\n      this.nextElementSibling = el.nextElementSibling;\n\n      this.guardedRun(this.transitionIn);\n    }\n\n    setupProperties(positional, named) {\n      this.isEnabled = named.isEnabled !== false;\n      this.transitionName = positional[0] || named.name;\n      this.didTransitionIn = named.didTransitionIn;\n      this.didTransitionOut = named.didTransitionOut;\n      this.parentSelector = named.parentSelector;\n\n      this.enterClass =\n        named.enterClass ||\n        (this.transitionName && `${this.transitionName}-enter`);\n\n      this.enterActiveClass =\n        named.enterActiveClass ||\n        (this.transitionName && `${this.transitionName}-enter-active`);\n\n      this.enterToClass =\n        named.enterToClass ||\n        (this.transitionName && `${this.transitionName}-enter-to`);\n\n      this.leaveClass =\n        named.leaveClass ||\n        (this.transitionName && `${this.transitionName}-leave`);\n\n      this.leaveActiveClass =\n        named.leaveActiveClass ||\n        (this.transitionName && `${this.transitionName}-leave-active`);\n\n      this.leaveToClass =\n        named.leaveToClass ||\n        (this.transitionName && `${this.transitionName}-leave-to`);\n    }\n\n    /**\n     * Adds a clone to the parentElement, so it can be transitioned out.\n     *\n     * @private\n     * @method addClone\n     */\n    addClone() {\n      let original = this.getElementToClone();\n      let parentElement = original.parentElement || this.parentElement;\n      let nextElementSibling =\n        original.nextElementSibling || this.nextElementSibling;\n\n      if (\n        nextElementSibling &&\n        nextElementSibling.parentElement !== parentElement\n      ) {\n        nextElementSibling = null;\n      }\n\n      let clone = original.cloneNode(true);\n\n      clone.setAttribute('id', `${original.id}_clone`);\n\n      parentElement.insertBefore(clone, nextElementSibling);\n\n      this.clone = clone;\n    }\n\n    /**\n     * Finds the correct element to clone. If `parentSelector` is present, we will\n     * use the closest parent element that matches that selector. Otherwise, we use\n     * the element's immediate parentElement directly.\n     *\n     * @private\n     * @method getElementToClone\n     */\n    getElementToClone() {\n      if (this.parentSelector) {\n        return this.element.closest(this.parentSelector);\n      } else {\n        return this.element;\n      }\n    }\n\n    /**\n     * Removes the clone from the parentElement\n     *\n     * @private\n     * @method removeClone\n     */\n    removeClone() {\n      if (this.clone.isConnected && this.clone.parentNode !== null) {\n        this.clone.parentNode.removeChild(this.clone);\n      }\n    }\n\n    *transitionIn() {\n      if (this.enterClass) {\n        yield* this.transition({\n          className: this.enterClass,\n          activeClassName: this.enterActiveClass,\n          toClassName: this.enterToClass,\n        });\n\n        if (this.didTransitionIn) {\n          this.didTransitionIn();\n        }\n      }\n\n      this.finishedTransitionIn = true;\n    }\n\n    *transitionOut() {\n      if (this.leaveClass) {\n        // We can't stop ember from removing the element\n        // so we clone the element to animate it out\n        this.addClone();\n\n        yield nextTick();\n\n        yield* this.transition({\n          className: this.leaveClass,\n          activeClassName: this.leaveActiveClass,\n          toClassName: this.leaveToClass,\n        });\n\n        this.removeClone();\n\n        if (this.didTransitionOut) {\n          this.didTransitionOut();\n        }\n\n        this.clone = null;\n      }\n    }\n\n    /**\n     * Transitions the element.\n     *\n     * @private\n     * @method transition\n     * @param {Object} args\n     * @param {String} args.className the class representing the starting state\n     * @param {String} args.activeClassName the class applied during the entire transition. This class can be used to define the duration, delay and easing curve.\n     * @param {String} args.toClassName the class representing the finished state\n     * @return {Generator}\n     */\n    *transition({ className, activeClassName, toClassName }) {\n      let element = this.el;\n\n      // add first class right away\n      this.addClass(className);\n      this.addClass(activeClassName);\n\n      yield nextTick();\n\n      // This is for to force a repaint,\n      // which is necessary in order to transition styles when adding a class name.\n      element.scrollTop;\n\n      // after repaint\n      this.addClass(toClassName);\n      this.removeClass(className);\n\n      // wait for ember to apply classes\n      // set timeout for animation end\n      yield sleep(computeTimeout(element) || 0);\n\n      this.removeClass(toClassName);\n      this.removeClass(activeClassName);\n    }\n\n    /**\n     * Add classNames to el.\n     *\n     * @private\n     * @method addClass\n     * @param {String} className\n     */\n    addClass(className) {\n      this.el.classList.add(...className.trim().split(/\\s+/));\n    }\n\n    /**\n     * Remove classNames from el.\n     *\n     * @private\n     * @method removeClass\n     * @param {String} className\n     */\n    removeClass(className) {\n      this.el.classList.remove(...className.trim().split(/\\s+/));\n    }\n\n    async guardedRun(f, ...args) {\n      const token = waiter.beginAsync();\n\n      let gen = f.call(this, ...args);\n      let isDone = false;\n\n      // stop if the function doesn't have anything else to yield\n      // or if the element is no longer present\n      while (!isDone && this.el) {\n        let { value, done } = gen.next();\n        isDone = done;\n        await value;\n      }\n\n      waiter.endAsync(token);\n    }\n  }\n\n  modifier = CssTransitionModifier;\n} else {\n  modifier = class extends Modifier {\n    clone = null;\n    parentElement = null;\n    nextElementSibling = null;\n    installed = false;\n\n    /**\n     * @property el\n     * @type {(HTMLElement|undefined)}\n     * @private\n     * @readonly\n     */\n    get el() {\n      return this.clone || this.element;\n    }\n\n    /**\n     * @property transitionName\n     * @type {(String|undefined)}\n     * @private\n     * @readonly\n     */\n    get transitionName() {\n      return this.args.positional[0] || this.args.named.name;\n    }\n\n    /**\n     * @property enterClass\n     * @type {(String|undefined)}\n     * @private\n     * @readonly\n     */\n    get enterClass() {\n      return (\n        this.args.named.enterClass ||\n        (this.transitionName && `${this.transitionName}-enter`)\n      );\n    }\n\n    /**\n     * @property enterActiveClass\n     * @type {(String|undefined)}\n     * @private\n     * @readonly\n     */\n    get enterActiveClass() {\n      return (\n        this.args.named.enterActiveClass ||\n        (this.transitionName && `${this.transitionName}-enter-active`)\n      );\n    }\n\n    /**\n     * @property enterToClass\n     * @type {(String|undefined)}\n     * @private\n     * @readonly\n     */\n    get enterToClass() {\n      return (\n        this.args.named.enterToClass ||\n        (this.transitionName && `${this.transitionName}-enter-to`)\n      );\n    }\n\n    /**\n     * @property leaveClass\n     * @type {(String|undefined)}\n     * @private\n     * @readonly\n     */\n    get leaveClass() {\n      return (\n        this.args.named.leaveClass ||\n        (this.transitionName && `${this.transitionName}-leave`)\n      );\n    }\n\n    /**\n     * @property leaveActiveClass\n     * @type {(String|undefined)}\n     * @private\n     * @readonly\n     */\n    get leaveActiveClass() {\n      return (\n        this.args.named.leaveActiveClass ||\n        (this.transitionName && `${this.transitionName}-leave-active`)\n      );\n    }\n\n    /**\n     * @property leaveToClass\n     * @type {(String|undefined)}\n     * @private\n     * @readonly\n     */\n    get leaveToClass() {\n      return (\n        this.args.named.leaveToClass ||\n        (this.transitionName && `${this.transitionName}-leave-to`)\n      );\n    }\n\n    didInstall() {\n      if (this.args.named.isEnabled === false) {\n        return;\n      }\n\n      let el = this.getElementToClone();\n      this.parentElement = el.parentElement;\n      this.nextElementSibling = el.nextElementSibling;\n\n      this.guardedRun(this.transitionIn);\n    }\n\n    willRemove() {\n      if (this.args.named.isEnabled === false || !this.installed) {\n        return;\n      }\n\n      this.guardedRun(this.transitionOut);\n    }\n\n    /**\n     * Adds a clone to the parentElement so it can be transitioned out\n     *\n     * @private\n     * @method addClone\n     */\n    addClone() {\n      let original = this.getElementToClone();\n      let parentElement = original.parentElement || this.parentElement;\n      let nextElementSibling =\n        original.nextElementSibling || this.nextElementSibling;\n\n      if (\n        nextElementSibling &&\n        nextElementSibling.parentElement !== parentElement\n      ) {\n        nextElementSibling = null;\n      }\n\n      let clone = original.cloneNode(true);\n\n      clone.setAttribute('id', `${original.id}_clone`);\n\n      parentElement.insertBefore(clone, nextElementSibling);\n\n      this.clone = clone;\n    }\n\n    /**\n     * Finds the correct element to clone. If `parentSelector` is present, we will\n     * use the closest parent element that matches that selector. Otherwise we use\n     * the element's immediate parentElement directly.\n     *\n     * @private\n     * @method getElementToClone\n     */\n    getElementToClone() {\n      if (this.args.named.parentSelector) {\n        return this.element.closest(this.args.named.parentSelector);\n      } else {\n        return this.element;\n      }\n    }\n\n    /**\n     * Removes the clone from the parentElement\n     *\n     * @private\n     * @method removeClone\n     */\n    removeClone() {\n      if (this.clone.isConnected && this.clone.parentNode !== null) {\n        this.clone.parentNode.removeChild(this.clone);\n      }\n    }\n\n    *transitionIn() {\n      if (this.enterClass) {\n        yield* this.transition({\n          className: this.enterClass,\n          activeClassName: this.enterActiveClass,\n          toClassName: this.enterToClass,\n        });\n\n        if (this.args.named.didTransitionIn) {\n          this.args.named.didTransitionIn();\n        }\n      }\n\n      this.installed = true;\n    }\n\n    *transitionOut() {\n      if (this.leaveClass) {\n        // We can't stop ember from removing the element\n        // so we clone the element to animate it out\n        this.addClone();\n\n        yield nextTick();\n\n        yield* this.transition({\n          className: this.leaveClass,\n          activeClassName: this.leaveActiveClass,\n          toClassName: this.leaveToClass,\n        });\n\n        this.removeClone();\n\n        if (this.args.named.didTransitionOut) {\n          this.args.named.didTransitionOut();\n        }\n\n        this.clone = null;\n      }\n    }\n\n    /**\n     * Transitions the element.\n     *\n     * @private\n     * @method transition\n     * @param {Object} args\n     * @param {String} args.className the class representing the starting state\n     * @param {String} args.activeClassName the class applied during the entire transition. This class can be used to define the duration, delay and easing curve.\n     * @param {String} args.toClassName the class representing the finished state\n     * @return {Generator}\n     */\n    *transition({ className, activeClassName, toClassName }) {\n      let element = this.el;\n\n      // add first class right away\n      this.addClass(className);\n      this.addClass(activeClassName);\n\n      yield nextTick();\n\n      // This is for to force a repaint,\n      // which is necessary in order to transition styles when adding a class name.\n      element.scrollTop;\n\n      // after repaint\n      this.addClass(toClassName);\n      this.removeClass(className);\n\n      // wait for ember to apply classes\n      // set timeout for animation end\n      yield sleep(computeTimeout(element) || 0);\n\n      this.removeClass(toClassName);\n      this.removeClass(activeClassName);\n    }\n\n    /**\n     * Add classNames to el.\n     *\n     * @private\n     * @method addClass\n     * @param {String} className\n     */\n    addClass(className) {\n      this.el.classList.add(...className.trim().split(/\\s+/));\n    }\n\n    /**\n     * Remove classNames from el.\n     *\n     * @private\n     * @method removeClass\n     * @param {String} className\n     */\n    removeClass(className) {\n      this.el.classList.remove(...className.trim().split(/\\s+/));\n    }\n\n    async guardedRun(f, ...args) {\n      const token = waiter.beginAsync();\n\n      let gen = f.call(this, ...args);\n      let isDone = false;\n\n      // stop if the function doesn't have anything else to yield\n      // or if the element is no longer present\n      while (!isDone && this.el) {\n        let { value, done } = gen.next();\n        isDone = done;\n        await value;\n      }\n\n      waiter.endAsync(token);\n    }\n  };\n}\n\nexport default modifier;\n","function _initializerDefineProperty(e, i, r, l) {\n  r && Object.defineProperty(e, i, {\n    enumerable: r.enumerable,\n    configurable: r.configurable,\n    writable: r.writable,\n    value: r.initializer ? r.initializer.call(l) : void 0\n  });\n}\nexport { _initializerDefineProperty as default };","function _typeof(o) {\n  \"@babel/helpers - typeof\";\n\n  return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n    return typeof o;\n  } : function (o) {\n    return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n  }, _typeof(o);\n}\nexport { _typeof as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n    value: t,\n    enumerable: !0,\n    configurable: !0,\n    writable: !0\n  }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n  var i = toPrimitive(t, \"string\");\n  return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n  if (\"object\" != _typeof(t) || !t) return t;\n  var e = t[Symbol.toPrimitive];\n  if (void 0 !== e) {\n    var i = e.call(t, r || \"default\");\n    if (\"object\" != _typeof(i)) return i;\n    throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n  }\n  return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","function _applyDecoratedDescriptor(i, e, r, n, l) {\n  var a = {};\n  return Object.keys(n).forEach(function (i) {\n    a[i] = n[i];\n  }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) {\n    return n(i, e, r) || r;\n  }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a;\n}\nexport { _applyDecoratedDescriptor as default };","import { modifier } from 'ember-modifier';\n\nexport interface CaptureEventsModifierSignature {\n  Element: HTMLElement;\n  Args: {\n    Named: {\n      /*\n       * @internal\n       */\n      event: 'focusout' | 'change' | 'input' | undefined;\n\n      /*\n       * @internal\n       */\n      triggerValidation(): void;\n    };\n  };\n}\n\nconst CaptureEventsModifier = modifier<CaptureEventsModifierSignature>(\n  (element, _pos, { event, triggerValidation }) => {\n    if (event) {\n      element.addEventListener(event, triggerValidation, { passive: true });\n\n      return () => {\n        element.removeEventListener(event, triggerValidation);\n      };\n    }\n  }\n);\n\nexport default CaptureEventsModifier;\n","import type { ErrorRecord, FormData, FormKey, ValidationError } from './types';\n\nexport function mergeErrorRecord<\n  DATA extends FormData,\n  KEY extends FormKey<DATA> = FormKey<DATA>\n>(\n  ...records: Array<ErrorRecord<DATA, KEY> | undefined>\n): ErrorRecord<DATA, KEY> {\n  const errors: ErrorRecord<DATA, KEY> = {};\n\n  for (const record of records) {\n    if (!record) {\n      continue;\n    }\n\n    for (const [name, fieldErrors] of Object.entries(record) as [\n      // TS does not infer the types correctly here, fieldErrors would be unknown, not sure why\n      KEY,\n      ValidationError<DATA[KEY]>[]\n    ][]) {\n      const existingFieldErrors = errors[name];\n\n      errors[name] = existingFieldErrors\n        ? [...existingFieldErrors, ...fieldErrors]\n        : fieldErrors;\n    }\n  }\n\n  return errors;\n}\n\n// this is copy pasted from https://github.com/emberjs/ember.js/blob/60d2e0cddb353aea0d6e36a72fda971010d92355/packages/%40ember/-internals/glimmer/lib/helpers/unique-id.ts\n// Unfortunately due to https://github.com/emberjs/ember.js/issues/20165 we cannot use the built-in version in template tags\nexport function uniqueId() {\n  // @ts-expect-error this one-liner abuses weird JavaScript semantics that\n  // TypeScript (legitimately) doesn't like, but they're nonetheless valid and\n  // specced.\n  return ([3e7] + -1e3 + -4e3 + -2e3 + -1e11).replace(/[0-3]/g, (a) =>\n    ((a * 4) ^ ((Math.random() * 16) >> (a & 2))).toString(16)\n  );\n}\n","import Component from '@glimmer/component';\nimport { on } from '@ember/modifier';\nimport { action } from '@ember/object';\n\nexport interface HeadlessFormControlCheckboxComponentSignature {\n  Element: HTMLInputElement;\n  Args: {\n    // the following are private arguments curried by the component helper, so users will never have to use those\n\n    /*\n     * @internal\n     */\n    value: boolean;\n\n    /*\n     * @internal\n     */\n    name: string;\n\n    /*\n     * @internal\n     */\n    fieldId: string;\n\n    /*\n     * @internal\n     */\n    setValue: (value: boolean) => void;\n\n    /*\n     * @internal\n     */\n    invalid: boolean;\n\n    /*\n     * @internal\n     */\n    errorId: string;\n  };\n}\n\nexport default class HeadlessFormControlCheckboxComponent extends Component<HeadlessFormControlCheckboxComponentSignature> {\n  @action\n  handleInput(e: Event | InputEvent): void {\n    this.args.setValue((e.target as HTMLInputElement).checked);\n  }\n\n  [__GLIMMER_TEMPLATE(`\n    <input\n      name={{@name}}\n      type=\"checkbox\"\n      checked={{@value}}\n      id={{@fieldId}}\n      aria-invalid={{if @invalid \"true\"}}\n      ...attributes\n      {{on \"click\" this.handleInput}}\n    />\n  `, { strictMode: true, scope: () => ({on}) })]\n}\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hlY2tib3guanMiLCJzb3VyY2VzIjpbImNoZWNrYm94Lmd0cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgQ29tcG9uZW50IGZyb20gJ0BnbGltbWVyL2NvbXBvbmVudCc7XG5pbXBvcnQgeyBvbiB9IGZyb20gJ0BlbWJlci9tb2RpZmllcic7XG5pbXBvcnQgeyBhY3Rpb24gfSBmcm9tICdAZW1iZXIvb2JqZWN0JztcblxuZXhwb3J0IGludGVyZmFjZSBIZWFkbGVzc0Zvcm1Db250cm9sQ2hlY2tib3hDb21wb25lbnRTaWduYXR1cmUge1xuICBFbGVtZW50OiBIVE1MSW5wdXRFbGVtZW50O1xuICBBcmdzOiB7XG4gICAgLy8gdGhlIGZvbGxvd2luZyBhcmUgcHJpdmF0ZSBhcmd1bWVudHMgY3VycmllZCBieSB0aGUgY29tcG9uZW50IGhlbHBlciwgc28gdXNlcnMgd2lsbCBuZXZlciBoYXZlIHRvIHVzZSB0aG9zZVxuXG4gICAgLypcbiAgICAgKiBAaW50ZXJuYWxcbiAgICAgKi9cbiAgICB2YWx1ZTogYm9vbGVhbjtcblxuICAgIC8qXG4gICAgICogQGludGVybmFsXG4gICAgICovXG4gICAgbmFtZTogc3RyaW5nO1xuXG4gICAgLypcbiAgICAgKiBAaW50ZXJuYWxcbiAgICAgKi9cbiAgICBmaWVsZElkOiBzdHJpbmc7XG5cbiAgICAvKlxuICAgICAqIEBpbnRlcm5hbFxuICAgICAqL1xuICAgIHNldFZhbHVlOiAodmFsdWU6IGJvb2xlYW4pID0+IHZvaWQ7XG5cbiAgICAvKlxuICAgICAqIEBpbnRlcm5hbFxuICAgICAqL1xuICAgIGludmFsaWQ6IGJvb2xlYW47XG5cbiAgICAvKlxuICAgICAqIEBpbnRlcm5hbF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ENBQUMsQ0FBQyxDQUFDO0FBQzVILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ1QsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQzVDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQy9ELENBQUMsQ0FBQyxDQUFDO0FBQ0g7QUFDQSxDQUFDLENBQUMscUJBQVU7QUFDWjs7Ozs7Ozs7O0NBU0MsQ0FBQyw4Q0FBVztBQUNiLENBQUM7In0=","import Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport { on } from '@ember/modifier';\nimport { action } from '@ember/object';\n\n// Possible values for the input type, see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n// for the sake of completeness, we list all here, with some commented out that are better handled elsewhere, or not at all...\nexport type InputType =\n  // | 'button' - not useful as a control component\n  // | 'checkbox' - handled separately, for handling `checked` correctly and operating with true boolean values\n  | 'color'\n  | 'date'\n  | 'datetime-local'\n  | 'email'\n  // | 'file' - would need special handling\n  | 'hidden'\n  // | 'image' - not useful as a control component\n  | 'month'\n  | 'number'\n  | 'password'\n  // | 'radio' - handled separately, for handling groups or radio buttons\n  | 'range'\n  // | 'reset' - would need special handling\n  | 'search'\n  // | 'submit' - not useful as a control component\n  | 'tel'\n  | 'text'\n  | 'time'\n  | 'url'\n  | 'week';\n\nexport interface HeadlessFormControlInputComponentSignature {\n  Element: HTMLInputElement;\n  Args: {\n    /**\n     * The `type` of the `<input>` element, by default `text`.\n     *\n     * Note that certain types should not be used, as they have dedicated control components:\n     * - `checkbox`\n     * - `radio`\n     *\n     * Also these types are not useful to use as input controls:\n     * - `button`\n     * - `file`\n     * - `image`\n     * - `reset`\n     * - `submit`\n     *\n     * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n     */\n    type?: InputType;\n\n    // the following are private arguments curried by the component helper, so users will never have to use those\n\n    /*\n     * @internal\n     */\n    value: string | number;\n\n    /*\n     * @internal\n     */\n    name: string;\n\n    /*\n     * @internal\n     */\n    fieldId: string;\n\n    /*\n     * @internal\n     */\n    setValue: (value: string | number) => void;\n\n    /*\n     * @internal\n     */\n    invalid: boolean;\n\n    /*\n     * @internal\n     */\n    errorId: string;\n  };\n}\n\nexport default class HeadlessFormControlInputComponent extends Component<HeadlessFormControlInputComponentSignature> {\n  constructor(\n    owner: unknown,\n    args: HeadlessFormControlInputComponentSignature['Args']\n  ) {\n    assert(\n      `input component does not support @type=\"${args.type}\" as there is a dedicated component for this. Please use the \\`field.${args.type}\\` instead!`,\n      args.type === undefined ||\n        // TS would guard us against using an unsupported `InputType`, but for JS consumers we add a dev-only runtime check here\n        !['checkbox', 'radio'].includes(args.type as string)\n    );\n\n    super(owner, args);\n  }\n\n  get type(): InputType {\n    return this.args.type ?? 'text';\n  }\n\n  @action\n  handleInput(e: Event | InputEvent): void {\n    assert('Expected HTMLInputElement', e.target instanceof HTMLInputElement);\n    this.args.setValue(\n      this.type === 'number' ? parseFloat(e.target.value) : e.target.value\n    );\n  }\n  [__GLIMMER_TEMPLATE(`\n    <input\n      name={{@name}}\n      type={{@type}}\n      value={{@value}}\n      id={{@fieldId}}\n      aria-invalid={{if @invalid \"true\"}}\n      aria-describedby={{if @invalid @errorId}}\n      ...attributes\n      {{on \"input\" this.handleInput}}\n    />\n  `, { strictMode: true, scope: () => ({on}) })]\n}\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5wdXQuanMiLCJzb3VyY2VzIjpbImlucHV0Lmd0cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgQ29tcG9uZW50IGZyb20gJ0BnbGltbWVyL2NvbXBvbmVudCc7XG5pbXBvcnQgeyBhc3NlcnQgfSBmcm9tICdAZW1iZXIvZGVidWcnO1xuaW1wb3J0IHsgb24gfSBmcm9tICdAZW1iZXIvbW9kaWZpZXInO1xuaW1wb3J0IHsgYWN0aW9uIH0gZnJvbSAnQGVtYmVyL29iamVjdCc7XG5cbi8vIFBvc3NpYmxlIHZhbHVlcyBmb3IgdGhlIGlucHV0IHR5cGUsIHNlZSBodHRwczovL2RldmVsb3Blci5tb3ppbGxhLm9yZy9lbi1VUy9kb2NzL1dlYi9IVE1ML0VsZW1lbnQvaW5wdXQjaW5wdXRfdHlwZXNcbi8vIGZvciB0aGUgc2FrZSBvZiBjb21wbGV0ZW5lc3MsIHdlIGxpc3QgYWxsIGhlcmUsIHdpdGggc29tZSBjb21tZW50ZWQgb3V0IHRoYXQgYXJlIGJldHRlciBoYW5kbGVkIGVsc2V3aGVyZSwgb3Igbm90IGF0IGFsbC4uLlxuZXhwb3J0IHR5cGUgS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eadlessFormControlRadioGroupLabelComponentSignature {\n  Element: HTMLDivElement;\n  Args: {\n    // the following are private arguments curried by the component helper, so users will never have to use those\n\n    /**\n     * @internal\n     */\n    id: string;\n  };\n  Blocks: {\n    default: [];\n  };\n}\n\nconst HeadlessFormControlRadioGroupLabelComponent: TemplateOnlyComponent<HeadlessFormControlRadioGroupLabelComponentSignature> =\n  [__GLIMMER_TEMPLATE(`<div id={{@id}} ...attributes>{{yield}}</div>`, { strictMode: true })];\n\nexport default HeadlessFormControlRadioGroupLabelComponent;\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGFiZWwuanMiLCJzb3VyY2VzIjpbImxhYmVsLmd0cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IFRlbXBsYXRlT25seUNvbXBvbmVudCB9IGZyb20gJ0BlbWJlci9jb21wb25lbnQvdGVtcGxhdGUtb25seSc7XG5cbmV4cG9ydCBpbnRlcmZhY2UgSGVhZGxlc3NGb3JtQ29udHJvbFJhZGlvR3JvdXBMYWJlbENvbXBvbmVudFNpZ25hdHVyZSB7XG4gIEVsZW1lbnQ6IEhUTUxEaXZFbGVtZW50O1xuICBBcmdzOiB7XG4gICAgLy8gdGhlIGZvbGxvd2luZyBhcmUgcHJpdmF0ZSBhcmd1bWVudHMgY3VycmllZCBieSB0aGUgY29tcG9uZW50IGhlbHBlciwgc28gdXNlcnMgd2lsbCBuZXZlciBoYXZlIHRvIHVzZSB0aG9zZVxuXG4gICAgLyoqXG4gICAgICogQGludGVybmFsXG4gICAgICovXG4gICAgaWQ6IHN0cmluZztcbiAgfTtcbiAgQmxvY2tzOiB7XG4gICAgZGVmYXVsdDogW107XG4gIH07XG59XG5cbmNvbnN0IEhlYWRsZXNzRm9ybUNvbnRyb2xSYWRpb0dyb3VwTGFiZWxDb21wb25lbnQ6IFRlbXBsYXRlT25seUNvbXBvbmVudDxIZWFkbGVzc0Zvcm1Db250c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FDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQzsifQ==","import type { TemplateOnlyComponent } from '@ember/component/template-only';\n\nexport interface HeadlessFormLabelComponentSignature {\n  Element: HTMLLabelElement;\n  Args: {\n    // the following are private arguments curried by the component helper, so users will never have to use those\n\n    /*\n     * @internal\n     */\n    fieldId: string;\n  };\n  Blocks: {\n    default: [];\n  };\n}\n\nconst HeadlessFormLabelComponent: TemplateOnlyComponent<HeadlessFormLabelComponentSignature> =\n  [__GLIMMER_TEMPLATE(`\n    <label for={{@fieldId}} ...attributes>\n      {{yield}}\n    </label>\n  `, { strictMode: true })];\n\nexport default HeadlessFormLabelComponent;\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGFiZWwuanMiLCJzb3VyY2VzIjpbImxhYmVsLmd0cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IFRlbXBsYXRlT25seUNvbXBvbmVudCB9IGZyb20gJ0BlbWJlci9jb21wb25lbnQvdGVtcGxhdGUtb25seSc7XG5cbmV4cG9ydCBpbnRlcmZhY2UgSGVhZGxlc3NGb3JtTGFiZWxDb21wb25lbnRTaWduYXR1cmUge1xuICBFbGVtZW50OiBIVE1MTGFiZWxFbGVtZW50O1xuICBBcmdzOiB7XG4gICAgLy8gdGhlIGZvbGxvd2luZyBhcmUgcHJpdmF0ZSBhcmd1bWVudHMgY3VycmllZCBieSB0aGUgY29tcG9uZW50IGhlbHBlciwgc28gdXNlcnMgd2lsbCBuZXZlciBoYXZlIHRvIHVzZSB0aG9zZVxuXG4gICAgLypcbiAgICAgKiBAaW50ZXJuYWxcbiAgICAgKi9cbiAgICBmaWVsZElkOiBzdHJpbmc7XG4gIH07XG4gIEJsb2Nrczoge1xuICAgIGRlZmF1bHQ6I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LENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDOUYsQ0FBQyxDQUFDLHFCQUFVO0FBQ1o7OztDQUdDLENBQUMseUJBQVcsQ0FBQztBQUNkO0FBQ0EsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7In0=","import { fn } from '@ember/helper';\nimport { on } from '@ember/modifier';\n\nimport type { TemplateOnlyComponent } from '@ember/component/template-only';\n\nexport interface HeadlessFormControlRadioInputComponentSignature {\n  Element: HTMLInputElement;\n  Args: {\n    // the following are private arguments curried by the component helper, so users will never have to use those\n\n    /*\n     * @internal\n     */\n    value: string;\n\n    /*\n     * @internal\n     */\n    name: string;\n\n    /*\n     * @internal\n     */\n    checked: boolean;\n\n    /*\n     * @internal\n     */\n    fieldId: string;\n\n    /*\n     * @internal\n     */\n    setValue: (value: string) => void;\n  };\n}\n\nconst HeadlessFormControlRadioInputComponent: TemplateOnlyComponent<HeadlessFormControlRadioInputComponentSignature> =\n  [__GLIMMER_TEMPLATE(`\n    <input\n      name={{@name}}\n      type=\"radio\"\n      value={{@value}}\n      checked={{@checked}}\n      id={{@fieldId}}\n      ...attributes\n      {{on \"change\" (fn @setValue @value)}}\n    />\n  `, { strictMode: true, scope: () => ({on,fn}) })];\n\nexport default HeadlessFormControlRadioInputComponent;\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5wdXQuanMiLCJzb3VyY2VzIjpbImlucHV0Lmd0cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBmbiB9IGZyb20gJ0BlbWJlci9oZWxwZXInO1xuaW1wb3J0IHsgb24gfSBmcm9tICdAZW1iZXIvbW9kaWZpZXInO1xuXG5pbXBvcnQgdHlwZSB7IFRlbXBsYXRlT25seUNvbXBvbmVudCB9IGZyb20gJ0BlbWJlci9jb21wb25lbnQvdGVtcGxhdGUtb25seSc7XG5cbmV4cG9ydCBpbnRlcmZhY2UgSGVhZGxlc3NGb3JtQ29udHJvbFJhZGlvSW5wdXRDb21wb25lbnRTaWduYXR1cmUge1xuICBFbGVtZW50OiBIVE1MSW5wdXRFbGVtZW50O1xuICBBcmdzOiB7XG4gICAgLy8gdGhlIGZvbGxvd2luZyBhcmUgcHJpdmF0ZSBhcmd1bWVudHMgY3VycmllZCBieSB0aGUgY29tcG9uZW50IGhlbHBlciwgc28gdXNlcnMgd2lsbCBuZXZlciBoYXZlIHRvIHVzZSB0aG9zZVxuXG4gICAgLypcbiAgICAgKiBAaW50ZXJuYWxcbiAgICAgKi9cbiAgICB2YWx1ZTogc3RyaW5nO1xuXG4gICA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Ozs7Ozs7O0NBU0MsQ0FBQyxpREFBVyxDQUFDO0FBQ2Q7QUFDQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQzsifQ==","import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\n\nimport { uniqueId } from '../../../utils';\nimport HeadlessFormLabelComponent from '../../label';\nimport HeadlessFormControlRadioInputComponent from './radio/input';\n\nimport type { WithBoundArgs } from '@glint/template';\n\nexport interface HeadlessFormControlRadioComponentSignature {\n  Args: {\n    /**\n     * The value of this individual radio control. All the radios that belong to the same field (have the same name) should have distinct values.\n     */\n    value: string;\n\n    // the following are private arguments curried by the component helper, so users will never have to use those\n\n    /*\n     * @internal\n     */\n    name: string;\n\n    /*\n     * @internal\n     */\n    selected: string;\n\n    /*\n     * @internal\n     */\n    setValue: (value: string) => void;\n  };\n  Blocks: {\n    default: [\n      {\n        /**\n         * Yielded component that renders the `<label>` of this single radio element.\n         */\n        Label: WithBoundArgs<typeof HeadlessFormLabelComponent, 'fieldId'>;\n\n        /**\n         * Yielded component that renders the `<input type=\"radio\">` element.\n         */\n        Input: WithBoundArgs<\n          typeof HeadlessFormControlRadioInputComponent,\n          'fieldId' | 'value' | 'setValue' | 'checked' | 'name'\n        >;\n      }\n    ];\n  };\n}\n\nexport default class HeadlessFormControlRadioComponent extends Component<HeadlessFormControlRadioComponentSignature> {\n  get isChecked(): boolean {\n    return this.args.selected === this.args.value;\n  }\n\n  [__GLIMMER_TEMPLATE(`\n    {{#let (uniqueId) as |uuid|}}\n      {{yield\n        (hash\n          Label=(component HeadlessFormLabelComponent fieldId=uuid)\n          Input=(component\n            HeadlessFormControlRadioInputComponent\n            name=@name\n            fieldId=uuid\n            value=@value\n            checked=this.isChecked\n            setValue=@setValue\n          )\n        )\n      }}\n    {{/let}}\n  `, { strictMode: true, scope: () => ({uniqueId,hash,HeadlessFormLabelComponent,HeadlessFormControlRadioInputComponent}) })]\n}\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmFkaW8uanMiLCJzb3VyY2VzIjpbInJhZGlvLmd0cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgQ29tcG9uZW50IGZyb20gJ0BnbGltbWVyL2NvbXBvbmVudCc7XG5pbXBvcnQgeyBoYXNoIH0gZnJvbSAnQGVtYmVyL2hlbHBlcic7XG5cbmltcG9ydCB7IHVuaXF1ZUlkIH0gZnJvbSAnLi4vLi4vLi4vdXRpbHMnO1xuaW1wb3J0IEhlYWRsZXNzRm9ybUxhYmVsQ29tcG9uZW50IGZyb20gJy4uLy4uL2xhYmVsJztcbmltcG9ydCBIZWFkbGVzc0Zvcm1Db250cm9sUmFkaW9JbnB1dENvbXBvbmVudCBmcm9tICcuL3JhZGlvL2lucHV0JztcblxuaW1wb3J0IHR5cGUgeyBXaXRoQm91bmRBcmdzIH0gZnJvbSAnQGdsaW50L3RlbXBsYXRlJztcblxuZXhwb3J0IGludGVyZmFjZSBIZWFkbGVzc0Zvcm1Db250cm9sUmFkaW9Db21wb25lbnRTaWduYXR1cmUge1xuICBBcmdzOiB7XG4gICAgLyoqXG4gICAgICogVGhlIHZhbHVlIG9mIHRoaXMgaW5kaXZpZHVhbCByYWRpbyBjb250cm9sLiBBbGwgdGhlIHJhZGlvcyB0aGF0IGJlbG9uZyB0byB0aGUgc2F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QUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDbEQsQ0FBQyxDQUFDLENBQUM7QUFDSDtBQUNBLENBQUMsQ0FBQyxxQkFBVTtBQUNaOzs7Ozs7Ozs7Ozs7Ozs7Q0FlQyxDQUFDLDJIQUFXO0FBQ2IsQ0FBQzsifQ==","import { hash } from '@ember/helper';\n\nimport { uniqueId } from '../../utils';\nimport HeadlessFormControlRadioGroupLabelComponent from './radio-group/label';\nimport HeadlessFormControlRadioComponent from './radio-group/radio';\n\nimport type { TemplateOnlyComponent } from '@ember/component/template-only';\nimport type { WithBoundArgs } from '@glint/template';\n\nexport interface HeadlessFormControlRadioGroupComponentSignature {\n  Element: HTMLDivElement;\n  Args: {\n    // the following are private arguments curried by the component helper, so users will never have to use those\n\n    /*\n     * @internal\n     */\n    name: string;\n\n    /*\n     * @internal\n     */\n    selected: string;\n\n    /*\n     * @internal\n     */\n    setValue: (value: string) => void;\n\n    /*\n     * @internal\n     */\n    invalid: boolean;\n\n    /*\n     * @internal\n     */\n    errorId: string;\n  };\n  Blocks: {\n    default: [\n      {\n        /**\n         * Yielded component that renders the `<input type=\"radio\">` element.\n         */\n        Radio: WithBoundArgs<\n          typeof HeadlessFormControlRadioComponent,\n          'name' | 'selected' | 'setValue'\n        >;\n\n        Label: WithBoundArgs<\n          typeof HeadlessFormControlRadioGroupLabelComponent,\n          'id'\n        >;\n      }\n    ];\n  };\n}\n\nconst HeadlessFormControlRadioGroupComponent: TemplateOnlyComponent<HeadlessFormControlRadioGroupComponentSignature> =\n  [__GLIMMER_TEMPLATE(`\n    {{#let (uniqueId) as |labelId|}}\n      <div\n        role=\"radiogroup\"\n        aria-labelledby={{labelId}}\n        aria-invalid={{if @invalid \"true\"}}\n        aria-describedby={{if @invalid @errorId}}\n        ...attributes\n      >\n        {{yield\n          (hash\n            Radio=(component\n              HeadlessFormControlRadioComponent\n              name=@name\n              selected=@selected\n              setValue=@setValue\n            )\n            Label=(component\n              HeadlessFormControlRadioGroupLabelComponent id=labelId\n            )\n          )\n        }}\n      </div>\n    {{/let}}\n  `, { strictMode: true, scope: () => ({uniqueId,hash,HeadlessFormControlRadioComponent,HeadlessFormControlRadioGroupLabelComponent}) })];\n\nexport default HeadlessFormControlRadioGroupComponent;\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmFkaW8tZ3JvdXAuanMiLCJzb3VyY2VzIjpbInJhZGlvLWdyb3VwLmd0cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBoYXNoIH0gZnJvbSAnQGVtYmVyL2hlbHBlcic7XG5cbmltcG9ydCB7IHVuaXF1ZUlkIH0gZnJvbSAnLi4vLi4vdXRpbHMnO1xuaW1wb3J0IEhlYWRsZXNzRm9ybUNvbnRyb2xSYWRpb0dyb3VwTGFiZWxDb21wb25lbnQgZnJvbSAnLi9yYWRpby1ncm91cC9sYWJlbCc7XG5pbXBvcnQgSGVhZGxlc3NGb3JtQ29udHJvbFJhZGlvQ29tcG9uZW50IGZyb20gJy4vcmFkaW8tZ3JvdXAvcmFkaW8nO1xuXG5pbXBvcnQgdHlwZSB7IFRlbXBsYXRlT25seUNvbXBvbmVudCB9IGZyb20gJ0BlbWJlci9jb21wb25lbnQvdGVtcGxhdGUtb25seSc7XG5pbXBvcnQgdHlwZSB7IFdpdGhCb3VuZEFyZ3MgfSBmcm9tICdAZ2xpbnQvdGVtcGxhdGUnO1xuXG5leHBvcnQgaW50ZXJmYWNlIEhlYWRsZXNzRm9ybUNvbnRyb2xSYWRpb0dyb3VwQ29tcG9uZW50U2lnbmF0dXJlIHtcbiAgRWxlbWVudDogSFRNTERpdkVsZW1lbnQ7XG4gIEFyZ3M6IHtcbiAgICAvLyB0aGUgZm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UMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUN0SCxDQUFDLENBQUMscUJBQVU7QUFDWjs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Q0F1QkMsQ0FBQyx1SUFBVyxDQUFDO0FBQ2Q7QUFDQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQzsifQ==","import Component from '@glimmer/component';\n\nexport interface HeadlessFormControlSelectOptionComponentSignature {\n  Element: HTMLOptionElement;\n  Args: {\n    /**\n     * The select's value when this option is selected\n     */\n    value: string;\n\n    // the following are private arguments curried by the component helper, so users will never have to use those\n\n    /*\n     * @internal\n     */\n    selected: string;\n  };\n  Blocks: {\n    default: [];\n  };\n}\n\nexport default class HeadlessFormControlSelectOptionComponent extends Component<HeadlessFormControlSelectOptionComponentSignature> {\n  get isSelected(): boolean {\n    return this.args.selected === this.args.value;\n  }\n\n  [__GLIMMER_TEMPLATE(`\n    {{!\nEmber seems to insist to set \\`selected\\` as a property instead of an attribute.\nBut an attribute is needed if you want to use this with SSR/FastBoot, so the selected option is preselected before JS has loaded.\nUsing this wonky workaround for now.\nSee https://github.com/emberjs/ember.js/issues/19115\n}}\n    {{#if this.isSelected}}\n      <option value={{@value}} selected ...attributes>{{yield}}</option>\n    {{else}}\n      <option value={{@value}} ...attributes>{{yield}}</option>\n    {{/if}}\n  `, { strictMode: true })]\n}\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uLmpzIiwic291cmNlcyI6WyJvcHRpb24uZ3RzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBDb21wb25lbnQgZnJvbSAnQGdsaW1tZXIvY29tcG9uZW50JztcblxuZXhwb3J0IGludGVyZmFjZSBIZWFkbGVzc0Zvcm1Db250cm9sU2VsZWN0T3B0aW9uQ29tcG9uZW50U2lnbmF0dXJlIHtcbiAgRWxlbWVudDogSFRNTE9wdGlvbkVsZW1lbnQ7XG4gIEFyZ3M6IHtcbiAgICAvKipcbiAgICAgKiBUaGUgc2VsZWN0J3MgdmFsdWUgd2hlbiB0aGlzIG9wdGlvbiBpcyBzZWxlY3RlZFxuICAgICAqL1xuICAgIHZhbHVlOiBzdHJpbmc7XG5cbiAgICAvLyB0aGUgZm9sbG93aW5nIGFyZSBwcml2YXRlIGFyZ3VtZW50cyBjdXJyaWVkIGJ5IHRoZSBjb21wb25lbnQgaGVscGVyLCBzbyB1c2VycyB3aWxsIG5ldmVyIGhhdmUgdG8gdXNlIHRob3NlXG5cbiAgICAvKlxuICAgICAqIEBpbnRlcm5hbFxuICAgICAqL1xuICAgIHNlbGVjdGVkOiBzdHJpbmc7XG4gIH07XG4gIEJsb2Nrczoge1xuICAgIGRlZmF1bHQ6IFtdO1xuICB9O1xufVxuXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBIZWFkbGVzc0Zvcm1Db250cm9sU2VsZWN0T3B0aW9uQ29tcG9uZW50IGV4dGV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QyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsRCxDQUFDLENBQUMsQ0FBQztBQUNIO0FBQ0EsQ0FBQyxDQUFDLHFCQUFVO0FBQ1o7Ozs7Ozs7Ozs7O0NBV0MsQ0FBQyx5QkFBVztBQUNiLENBQUM7In0=","import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport { action } from '@ember/object';\n\nimport HeadlessFormControlSelectOptionComponent from './select/option';\n\nimport type { WithBoundArgs } from '@glint/template';\n\nexport interface HeadlessFormControlSelectComponentSignature {\n  Element: HTMLSelectElement;\n  Args: {\n    // the following are private arguments curried by the component helper, so users will never have to use those\n\n    /*\n     * @internal\n     */\n    value: string;\n\n    /*\n     * @internal\n     */\n    name: string;\n\n    /*\n     * @internal\n     */\n    fieldId: string;\n\n    /*\n     * @internal\n     */\n    setValue: (value: string) => void;\n\n    /*\n     * @internal\n     */\n    invalid: boolean;\n\n    /*\n     * @internal\n     */\n    errorId: string;\n  };\n  Blocks: {\n    default: [\n      {\n        Option: WithBoundArgs<\n          typeof HeadlessFormControlSelectOptionComponent,\n          'selected'\n        >;\n      }\n    ];\n  };\n}\n\nexport default class HeadlessFormControlSelectComponent extends Component<HeadlessFormControlSelectComponentSignature> {\n  @action\n  handleInput(e: Event | InputEvent): void {\n    this.args.setValue((e.target as HTMLSelectElement).value);\n  }\n\n  [__GLIMMER_TEMPLATE(`\n    <select\n      name={{@name}}\n      value={{@value}}\n      id={{@fieldId}}\n      aria-invalid={{if @invalid \"true\"}}\n      aria-describedby={{if @invalid @errorId}}\n      ...attributes\n      {{on \"input\" this.handleInput}}\n    >\n      {{yield\n        (hash\n          Option=(component\n            HeadlessFormControlSelectOptionComponent selected=@value\n          )\n        )\n      }}\n    </select>\n  `, { strictMode: true, scope: () => ({on,hash,HeadlessFormControlSelectOptionComponent}) })]\n}\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VsZWN0LmpzIiwic291cmNlcyI6WyJzZWxlY3QuZ3RzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBDb21wb25lbnQgZnJvbSAnQGdsaW1tZXIvY29tcG9uZW50JztcbmltcG9ydCB7IGhhc2ggfSBmcm9tICdAZW1iZXIvaGVscGVyJztcbmltcG9ydCB7IG9uIH0gZnJvbSAnQGVtYmVyL21vZGlmaWVyJztcbmltcG9ydCB7IGFjdGlvbiB9IGZyb20gJ0BlbWJlci9vYmplY3QnO1xuXG5pbXBvcnQgSGVhZGxlc3NGb3JtQ29udHJvbFNlbGVjdE9wdGlvbkNvbXBvbmVudCBmcm9tICcuL3NlbGVjdC9vcHRpb24nO1xuXG5pbXBvcnQgdHlwZSB7IFdpdGhCb3VuZEFyZ3MgfSBmcm9tICdAZ2xpbnQvdGVtcGxhdGUnO1xuXG5leHBvcnQgaW50ZXJmYWNlIEhlYWRsZXNzRm9ybUNvbnRyb2xTZWxlY3RDb21wb25lbnRTaWduYXR1cmUge1xuICBFbGVtZW50OiBIVE1MU2VsZWN0RWxlbWVudDtcbiAgQXJnczoge1xuICAgIC8vIHRoZSBmb2xsb3dpbmcgYXJlIHByaXZhdGUgYXJndW1lbnRzIGN1cnJpZWQgYnkgdGhlIGNvbXBvbmVudCBoZWxwZXIsIHNvIHVzZXJzIHdpbGwgbmV2ZXIgaGF2ZSB0byB1c2UgdGhvc2VcblxuICAgIC8qXG4gICAgICogQGludGVybmFsXG4gICAgICovXG4gICAgdmFsdWU6IHN0cmluZztcblxuICAgIC8qXG4gICAgICogQGludGVybmFsXG4gICAgICovXG4gICAgbmFtZTogc3RyaW5nO1xuXG4gICAgLypcbiAgICAgKiBAaW50ZXJuYWxcbiAgICAgKi9cbiAgICBmaWVsZElkOiBzdHJpbmc7XG5cbiAgICAvKlxuICAgICAqIEBpbnRlcm5hbFxuICAgICAqL1xuICAgIHNldFZhbHVlOiAodmFsdWU6IHN0cmluZykgPT4gdm9pZDtcblxuICAgIC8qXG4gICAgICogQGludGVybmFsXG4gICAgICovXG4gICAgaW52YWxpZDogYm9vbGVhbjtcblxuICAgIC8qXG4gICAgICogQGludGVybmFsXG4gICAgICovXG4gICAgZXJyb3JJZDogc3RyaW5nO1xuICB9O1xuICBCbG9ja3M6IHtcbiAgICBkZWZhdWx0OiBbXG4gICAgICB7XG4gICAgICAgIE9wdGlvbjogV2l0aEJvdW5kQXJnczxcbiAgICAgICAgICB0eXBlb2YgSGVhZGxlc3NGb3JtQ29udHJvbFNlbGVjdE9wdGlvbkNvbXBvbmVudCxcbiAgICAgICAgICAnc2VsZWN0ZWQnXG4gICAgICAgID47XG4gICAgICB9XG4gICAgXTtcbiAgfTtcbn1cblxuZXhwb3J0IGRlZmF1bHQgY2xhc3MgSGVhZGxlc3NGb3JtQ29udHJvbFNlbGVjdENvbXBvbmVudCBleHRlbmRzIENvbXBvbmVudDxIZWFkbGVzc0Zvcm1Db250cm9sU2VsZWN0Q29tcG9uZW50U2lnbmF0dXJlPiB7XG4gIEBhY3Rpb25cbiAgaGFuZGxlSW5wdXQoZTogRXZlbnQgfCBJbnB1dEV2ZW50KTogdm9pZCB7XG4gICAgdGhpcy5hcmdzLnNldFZhbHVlKChlLnRhcmdldCBhcyBIVE1MU2VsZWN0RWxlbWVudCkudmFsdWUpO1xuICB9XG5cbiAgPHRlbXBsYXRlPlxuICAgIDxzZWxlY3RcbiAgICAgIG5hbWU9e3tAbmFtZX19XG4gICAgICB2Y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LENBQUMsQ0FBQyxDQUFDO0FBQ3hILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ1QsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQzVDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUM5RCxDQUFDLENBQUMsQ0FBQztBQUNIO0FBQ0EsQ0FBQyxDQUFDLHFCQUFVO0FBQ1o7Ozs7Ozs7Ozs7Ozs7Ozs7O0NBaUJDLENBQUMsNEZBQVc7QUFDYixDQUFDOyJ9","import Component from '@glimmer/component';\nimport { on } from '@ember/modifier';\nimport { action } from '@ember/object';\n\nexport interface HeadlessFormControlTextareaComponentSignature {\n  Element: HTMLTextAreaElement;\n  Args: {\n    // the following are private arguments curried by the component helper, so users will never have to use those\n\n    /*\n     * @internal\n     */\n    value: string;\n\n    /*\n     * @internal\n     */\n    name: string;\n\n    /*\n     * @internal\n     */\n    fieldId: string;\n\n    /*\n     * @internal\n     */\n    setValue: (value: string) => void;\n\n    /*\n     * @internal\n     */\n    invalid: boolean;\n\n    /*\n     * @internal\n     */\n    errorId: string;\n  };\n}\n\nexport default class HeadlessFormControlTextareaComponent extends Component<HeadlessFormControlTextareaComponentSignature> {\n  @action\n  handleInput(e: Event | InputEvent): void {\n    this.args.setValue((e.target as HTMLTextAreaElement).value);\n  }\n\n  [__GLIMMER_TEMPLATE(`\n    <textarea\n      name={{@name}}\n      id={{@fieldId}}\n      aria-invalid={{if @invalid \"true\"}}\n      aria-describedby={{if @invalid @errorId}}\n      ...attributes\n      {{on \"input\" this.handleInput}}\n    >{{@value}}</textarea>\n  `, { strictMode: true, scope: () => ({on}) })]\n}\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGV4dGFyZWEuanMiLCJzb3VyY2VzIjpbInRleHRhcmVhLmd0cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgQ29tcG9uZW50IGZyb20gJ0BnbGltbWVyL2NvbXBvbmVudCc7XG5pbXBvcnQgeyBvbiB9IGZyb20gJ0BlbWJlci9tb2RpZmllcic7XG5pbXBvcnQgeyBhY3Rpb24gfSBmcm9tICdAZW1iZXIvb2JqZWN0JztcblxuZXhwb3J0IGludGVyZmFjZSBIZWFkbGVzc0Zvcm1Db250cm9sVGV4dGFyZWFDb21wb25lbnRTaWduYXR1cmUge1xuICBFbGVtZW50OiBIVE1MVGV4dEFyZWFFbGVtZW50O1xuICBBcmdzOiB7XG4gICAgLy8gdGhlIGZvbGxvd2luZyBhcmUgcHJpdmF0ZSBhcmd1bWVudHMgY3VycmllZCBieSB0aGUgY29tcG9uZW50IGhlbHBlciwgc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yxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ2hFLENBQUMsQ0FBQyxDQUFDO0FBQ0g7QUFDQSxDQUFDLENBQUMscUJBQVU7QUFDWjs7Ozs7Ozs7Q0FRQyxDQUFDLDhDQUFXO0FBQ2IsQ0FBQzsifQ==","import Component from '@glimmer/component';\n\nimport type { ValidationError } from '../types';\n\nexport interface HeadlessFormErrorsComponentSignature<VALUE> {\n  Element: HTMLDivElement;\n  Args: {\n    // the following are private arguments curried by the component helper, so users will never have to use those\n\n    /*\n     * @internal\n     */\n    errors: ValidationError<VALUE>[];\n\n    /*\n     * @internal\n     */\n    id: string;\n  };\n  Blocks: {\n    default?: [ValidationError<VALUE>[]];\n  };\n}\n\n// eslint-disable-next-line ember/no-empty-glimmer-component-classes -- unfortunately we cannot use templateOnlyComponent() here, as it is not possible to type that as a generic type, like templateOnlyComponent<HeadlessFormErrorsComponentSignature<VALUE>>\nexport default class HeadlessFormErrorsComponent<VALUE> extends Component<\n  HeadlessFormErrorsComponentSignature<VALUE>\n> {\n  [__GLIMMER_TEMPLATE(`\n    <div id={{@id}} aria-live=\"assertive\" ...attributes>\n      {{#if (has-block)}}\n        {{yield @errors}}\n      {{else}}\n        {{#each @errors as |e|}}\n          {{#if e.message}}\n            {{e.message}}<br />\n          {{/if}}\n        {{/each}}\n      {{/if}}\n    </div>\n  `, { strictMode: true })]\n}\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,e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QUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDMUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDN0MsQ0FBQyxDQUFDLENBQUM7QUFDSCxDQUFDLENBQUMscUJBQVU7QUFDWjs7Ozs7Ozs7Ozs7Q0FXQyxDQUFDLHlCQUFXO0FBQ2IsQ0FBQzsifQ==","import Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport { fn, hash } from '@ember/helper';\nimport { action, get } from '@ember/object';\n\nimport CaptureEventsModifier from '../modifiers/capture-events';\nimport { uniqueId } from '../utils';\nimport CheckboxComponent from './control/checkbox';\nimport InputComponent from './control/input';\nimport RadioGroupComponent from './control/radio-group';\nimport SelectComponent from './control/select';\nimport TextareaComponent from './control/textarea';\nimport ErrorsComponent from './errors';\nimport LabelComponent from './label';\n\nimport type { CaptureEventsModifierSignature } from '../modifiers/capture-events';\nimport type {\n  ErrorRecord,\n  FieldValidateCallback,\n  FormData,\n  FormKey,\n  RegisterFieldCallback,\n  UnregisterFieldCallback,\n  UserData,\n  ValidationError,\n} from '../types';\nimport type { ModifierLike, WithBoundArgs } from '@glint/template';\n\nexport interface HeadlessFormFieldComponentSignature<\n  DATA extends UserData,\n  KEY extends FormKey<FormData<DATA>> = FormKey<FormData<DATA>>\n> {\n  Args: {\n    /**\n     * The name of your field, which must match a property of the `@data` passed to the form\n     */\n    name: KEY;\n\n    /**\n     * Provide a custom validation function, that operates only on this specific field. Eventual validation errors are merged with native validation errors to determine the effective set of errors rendered for the field.\n     *\n     * Return undefined when no validation errors are present, otherwise an array of (one or multiple) `ValidationError`s.\n     */\n    validate?: FieldValidateCallback<FormData<DATA>, KEY>;\n\n    // the following are private arguments curried by the component helper, so users will never have to use those\n\n    /*\n     * @internal\n     */\n    data: FormData<DATA>;\n\n    /*\n     * @internal\n     */\n    set: (key: KEY, value: DATA[KEY]) => void;\n\n    /*\n     * @internal\n     */\n    errors?: ErrorRecord<DATA, KEY>;\n\n    /*\n     * @internal\n     */\n    registerField: RegisterFieldCallback<FormData<DATA>, KEY>;\n\n    /*\n     * @internal\n     */\n    unregisterField: UnregisterFieldCallback<FormData<DATA>, KEY>;\n\n    /*\n     * @internal\n     */\n    triggerValidationFor(name: KEY): Promise<void>;\n\n    /*\n     * @internal\n     */\n    fieldValidationEvent: 'focusout' | 'change' | 'input' | undefined;\n\n    /*\n     * @internal\n     */\n    fieldRevalidationEvent: 'focusout' | 'change' | 'input' | undefined;\n  };\n  Blocks: {\n    default: [\n      {\n        /**\n         * Yielded component that renders the `<label>` element.\n         */\n        Label: WithBoundArgs<typeof LabelComponent, 'fieldId'>;\n\n        /**\n         * Yielded control component that renders an `<input>` element.\n         */\n        Input: WithBoundArgs<\n          typeof InputComponent,\n          'name' | 'fieldId' | 'value' | 'setValue' | 'invalid' | 'errorId'\n        >;\n\n        /**\n         * Yielded control component that renders an `<input type=\"checkbox\">` element.\n         */\n        Checkbox: WithBoundArgs<\n          typeof CheckboxComponent,\n          'name' | 'fieldId' | 'value' | 'setValue' | 'invalid' | 'errorId'\n        >;\n\n        /**\n         * Yielded control component that renders a single radio control.\n         *\n         * Use multiple to define a radio group. It further yields components to render `Input` and `Label`.\n         */\n        RadioGroup: WithBoundArgs<\n          typeof RadioGroupComponent,\n          'name' | 'selected' | 'setValue' | 'invalid' | 'errorId'\n        >;\n\n        /**\n         * Yielded control component that renders a `<select>` element.\n         */\n        Select: WithBoundArgs<\n          typeof SelectComponent,\n          'name' | 'fieldId' | 'value' | 'setValue' | 'invalid' | 'errorId'\n        >;\n\n        /**\n         * Yielded control component that renders a `<textarea>` element.\n         */\n        Textarea: WithBoundArgs<\n          typeof TextareaComponent,\n          'name' | 'fieldId' | 'value' | 'setValue' | 'invalid' | 'errorId'\n        >;\n\n        /**\n         * The current value of the field's form data.\n         *\n         * If you don't use one of the supplied control components, then use this to pass the value to your custom component.\n         */\n        value: DATA[KEY];\n\n        /**\n         * Action to update the (internal) form data for this field.\n         *\n         * If you don't use one of the supplied control components, then use this to update the value whenever your custom component's value has changed.\n         */\n        setValue: (value: DATA[KEY]) => void;\n\n        /**\n         * Unique ID of this field, used to associate the control with its label.\n         *\n         * If you don't use the supplied components, then you can use this as the `id` of the control and the `for` attribute of the `<label>`.\n         */\n        id: string;\n\n        /**\n         * Unique error ID of this field, used to associate the control with its validation error message.\n         *\n         * If you don't use the supplied components, then you can use this as the `id` of the validation error element and the `aria-errormessage` or `aria-describedby` attribute of the control.\n         */\n        errorId: string;\n\n        /**\n         * Yielded component that renders all validation error messages if there are any.\n         *\n         * In non-block mode it will render all messages by default. In block-mode, it yields all `ValidationError` objects for you to customize the rendering.\n         */\n        Errors?: WithBoundArgs<\n          typeof ErrorsComponent<DATA[KEY]>,\n          'errors' | 'id'\n        >;\n\n        /**\n         * Will be `true` when validation was triggered and this field is invalid.\n         *\n         * You can use this to customize your markup, e.g. apply HTML classes for error styling.\n         */\n        isInvalid: boolean;\n\n        /**\n         * An array of raw ValidationError objects, for custom rendering of error output\n         */\n        rawErrors?: ValidationError<DATA[KEY]>[];\n\n        /**\n         * When calling this action, validation will be triggered.\n         *\n         * Can be used for custom controls that don't emit the `@validateOn` events that would normally trigger a dynamic validation.\n         */\n        triggerValidation: () => void;\n\n        /**\n         * Yielded modifier that when applied to the control element or any other element wrapping it will be able to recognize the `@validateOn` events and associate them to this field.\n         *\n         * This is only needed for very special cases, where the control is not a native form control or does not have the `@name` of the field assigned to the `name` attribute of the control.\n         */\n        captureEvents: WithBoundArgs<\n          ModifierLike<CaptureEventsModifierSignature>,\n          'event' | 'triggerValidation'\n        >;\n      }\n    ];\n  };\n}\n\nexport default class HeadlessFormFieldComponent<\n  DATA extends FormData,\n  KEY extends FormKey<FormData<DATA>> = FormKey<FormData<DATA>>\n> extends Component<HeadlessFormFieldComponentSignature<DATA, KEY>> {\n  LabelComponent = LabelComponent;\n  InputComponent = InputComponent;\n  CheckboxComponent = CheckboxComponent;\n  ErrorsComponent = ErrorsComponent<DATA[KEY]>;\n  SelectComponent = SelectComponent;\n  TextareaComponent = TextareaComponent;\n  RadioGroupComponent = RadioGroupComponent;\n  CaptureEventsModifier = CaptureEventsModifier;\n\n  constructor(\n    owner: unknown,\n    args: HeadlessFormFieldComponentSignature<DATA, KEY>['Args']\n  ) {\n    super(owner, args);\n\n    assert(\n      'Nested property paths in @name are not supported.',\n      typeof this.args.name !== 'string' || !this.args.name.includes('.')\n    );\n\n    this.args.registerField(this.args.name, {\n      validate: this.args.validate,\n    });\n  }\n\n  willDestroy(): void {\n    this.args.unregisterField(this.args.name);\n\n    super.willDestroy();\n  }\n\n  get value(): DATA[KEY] {\n    // when @mutableData is set, data is something we don't control, i.e. might require old-school get() to be on the safe side\n    // we do not want to support nested property paths for now though, see the constructor assertion!\n    return get(this.args.data, this.args.name) as DATA[KEY];\n  }\n\n  get errors(): ValidationError<DATA[KEY]>[] | undefined {\n    return this.args.errors?.[this.args.name];\n  }\n\n  get hasErrors(): boolean {\n    return this.errors !== undefined;\n  }\n\n  get valueAsString(): string | undefined {\n    assert(\n      `Only string values are expected for ${String(\n        this.args.name\n      )}, but you passed ${typeof this.value}`,\n      typeof this.value === 'undefined' || typeof this.value === 'string'\n    );\n\n    return this.value;\n  }\n\n  get valueAsStringOrNumber(): string | number | undefined {\n    assert(\n      `Only string or number values are expected for ${String(\n        this.args.name\n      )}, but you passed ${typeof this.value}`,\n      typeof this.value === 'undefined' ||\n        typeof this.value === 'string' ||\n        typeof this.value === 'number'\n    );\n\n    return this.value;\n  }\n\n  get valueAsBoolean(): boolean | undefined {\n    assert(\n      `Only boolean values are expected for ${String(\n        this.args.name\n      )}, but you passed ${typeof this.value}`,\n      typeof this.value === 'undefined' || typeof this.value === 'boolean'\n    );\n\n    return this.value;\n  }\n\n  @action\n  setValue(value: unknown): void {\n    this.args.set(this.args.name, value as DATA[KEY]);\n  }\n\n  [__GLIMMER_TEMPLATE(`\n    {{#let\n      (uniqueId)\n      (uniqueId)\n      (fn @set @name)\n      (fn @triggerValidationFor @name)\n      as |fieldId errorId setValue triggerValidation|\n    }}\n      {{yield\n        (hash\n          Label=(component this.LabelComponent fieldId=fieldId)\n          Input=(component\n            this.InputComponent\n            name=@name\n            fieldId=fieldId\n            errorId=errorId\n            value=this.valueAsStringOrNumber\n            setValue=this.setValue\n            invalid=this.hasErrors\n          )\n          Checkbox=(component\n            this.CheckboxComponent\n            name=@name\n            fieldId=fieldId\n            errorId=errorId\n            value=this.valueAsBoolean\n            setValue=this.setValue\n            invalid=this.hasErrors\n          )\n          Select=(component\n            this.SelectComponent\n            name=@name\n            fieldId=fieldId\n            errorId=errorId\n            value=this.valueAsString\n            setValue=this.setValue\n            invalid=this.hasErrors\n          )\n          Textarea=(component\n            this.TextareaComponent\n            name=@name\n            fieldId=fieldId\n            errorId=errorId\n            value=this.valueAsString\n            setValue=this.setValue\n            invalid=this.hasErrors\n          )\n          RadioGroup=(component\n            this.RadioGroupComponent\n            name=@name\n            errorId=errorId\n            selected=this.valueAsString\n            setValue=this.setValue\n            invalid=this.hasErrors\n          )\n          value=this.value\n          setValue=setValue\n          id=fieldId\n          errorId=errorId\n          Errors=(if\n            this.errors\n            (component this.ErrorsComponent errors=this.errors id=errorId)\n          )\n          isInvalid=this.hasErrors\n          rawErrors=this.errors\n          triggerValidation=triggerValidation\n          captureEvents=(modifier\n            this.CaptureEventsModifier\n            event=(if\n              this.hasErrors @fieldRevalidationEvent @fieldValidationEvent\n            )\n            triggerValidation=triggerValidation\n          )\n        )\n      }}\n    {{/let}}\n  `, { strictMode: true, scope: () => ({uniqueId,fn,hash}) })]\n}\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmllbGQuanMiLCJzb3VyY2VzIjpbImZpZWxkLmd0cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgQ29tcG9uZW50IGZyb20gJ0BnbGltbWVyL2NvbXBvbmVudCc7XG5pbXBvcnQgeyBhc3NlcnQgfSBmcm9tICdAZW1iZXIvZGVidWcnO1xuaW1wb3J0IHsgZm4sIGhhc2ggfSBmcm9tICdAZW1iZXIvaGVscGVyJztcbmltcG9ydCB7IGFjdGlvbiwgZ2V0IH0gZnJvbSAnQGVtYmVyL29iamVjdCc7XG5cbmltcG9ydCBDYXB0dXJlRXZlbnRzTW9kaWZpZXIgZnJvbSAnLi4vbW9kaWZpZXJzL2NhcHR1cmUtZXZlbnRzJztcbmltcG9ydCB7IHVuaXF1ZUlkIH0gZnJvbSAnLi4vdXRpbHMnO1xuaW1wb3J0IENoZWNrYm94Q29tcG9uZW50IGZyb20gJy4vY29udHJvbC9jaGVja2JveCc7XG5pbXBvcnQgSW5wdXRDb21wb25lbnQgZnJvbSAnLi9jb250cm9sL2lucHV0JztcbmltcG9ydCBSYWRpb0dyb3VwQ29tcG9uZW50IGZyb20gJy4vY29udHJvbC9yYWRpby1ncm91cCc7XG5pbXBvcnQgU2VsZWN0Q29tcG9uZW50IGZyb20gJy4vY29udHJvbC9zZWxlY3QnO1xuaW1wb3J0IFRleHRhcmVhQ29tcG9uZW50IGZyb20gJy4vY29udHJvbC90ZXh0YXJlYSc7XG5pbXBvcnQgRXJyb3JzQ29tcG9uZW50IGZyb20gJy4vZXJyb3JzJztcbmltcG9ydCBMYWJlbENvbXBvbmVudCBmcm9tICcuL2xhYmVsJztcblxuaW1wb3J0IHR5cGUgeyBDYXB0dXJlRXZlbnRzTW9kaWZpZXJTaWduYXR1cmUgfSBmcm9tICcuLi9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ncy5zZXQodGhpcy5hcmdzLm5hbWUsIHZhbHVlIGFzIERBVEFbS0VZXSk7XG4gIH1cblxuICA8dGVtcGxhdGU+XG4gICAge3sjbGV0XG4gICAgICAodW5pcXVlSWQpXG4gICAgICAodW5pcXVlSWQpXG4gICAgICAoZm4gQHNldCBAbmFtZSlcbiAgICAgIChmbiBAdHJpZ2dlclZhbGlkYXRpb25Gb3IgQG5hbWUpXG4gICAgICBhcyB8ZmllbGRJZCBlcnJvcklkIHNldFZhbHVlIHRyaWdnZXJWYWxpZGF0aW9ufFxuICAgIH19XG4gICAgICB7e3lpZWxkXG4gICAgICAgIChoYXNoXG4gICAgICAgICAgTGFiZWw9KGNvbXBvbmVudCB0aGlzLkxhYmVsQ29tcG9uZW50IGZpZWxkSWQ9ZmllbGRJZClcbiAgICAgICAgICBJbnB1dD0oY29tcG9uZW50XG4gICAgICAgICAgICB0aGlzLklucHV0Q29tcG9uZW50XG4gICAgICAgICAgICBuYW1lPUBuYW1lXG4gICAgICAgICAgICBmaWVsZElkPWZpZWxkSWRcbiAgICAgICAgICAgIGVycm9ySWQ9ZXJyb3JJZFxuICAgICAgICAgICAgdmFsdWU9dGhpcy52YWx1ZUFzU3RyaW5nT3JOdW1iZXJcbiAgICAgICAgICAgIHNldFZhbHVlPXRoaXMuc2V0VmFsdWVcbiAgICAgICAgICAgIGludmFsaWQ9dGhpcy5oYXNFcnJvcnNcbiAgICAgICAgICApXG4gICAgICAgICAgQ2hlY2tib3g9KGNvbXBvbmVudFxuICAgICAgICAgICAgdGhpcy5DaGVja2JveENvbXBvbmVudFxuICAgICAgICAgICAgbmFtZT1AbmFtZVxuICAgICAgICAgICAgZmllbGRJZD1maWVsZElkXG4gICAgICAgICAgICBlcnJvcklkPWVycm9ySWRcbiAgICAgICAgICAgIHZhbHVlPXRoaXMudmFsdWVBc0Jvb2xlYW5cbiAgICAgICAgICAgIHNldFZhbHVlPXRoaXMuc2V0VmFsdWVcbiAgICAgICAgICAgIGludmFsaWQ9dGhpcy5oYXNFcnJvcnNcbiAgICAgICAgICApXG4gICAgICAgICAgU2VsZWN0PShjb21wb25lbnRcbiAgICAgICAgICAgIHRoaXMuU2VsZWN0Q29tcG9uZW50XG4gICAgICAgICAgICBuYW1lPUBuYW1lXG4gICAgICAgICAgICBmaWVsZElkPWZpZWxkSWRcbiAgICAgICAgICAgIGVycm9ySWQ9ZXJyb3JJZFxuICAgICAgICAgICAgdmFsdWU9dGhpcy52YWx1ZUFzU3RyaW5nXG4gICAgICAgICAgICBzZXRWYWx1ZT10aGlzLnNldFZhbHVlXG4gICAgICAgICAgICBpbnZhbGlkPXRoaXMuaGFzRXJyb3JzXG4gICAgICAgICAgKVxuICAgICAgICAgIFRleHRhcmVhPShjb21wb25lbnRcbiAgICAgICAgICAgIHRoaXMuVGV4dGFyZWFDb21wb25lbnRcbiAgICAgICAgICAgIG5hbWU9QG5hbWVcbiAgICAgICAgICAgIGZpZWxkSWQ9ZmllbGRJZFxuICAgICAgICAgICAgZXJyb3JJZD1lcnJvcklkXG4gICAgICAgICAgICB2YWx1ZT10aGlzLnZhbHVlQXNTdHJpbmdcbiAgICAgICAgICAgIHNldFZhbHVlPXRoaXMuc2V0VmFsdWVcbiAgICAgICAgICAgIGludmFsaWQ9dGhpcy5oYXNFcnJvcnNcbiAgICAgICAgICApXG4gICAgICAgICAgUmFkaW9Hcm91cD0oY29tcG9uZW50XG4gICAgICAgICAgICB0aGlzLlJhZGlvR3JvdXBDb21wb25lbnRcbiAgICAgICAgICAgIG5hbWU9QG5hbWVcbiAgICAgICAgICAgIGVycm9ySWQ9ZXJyb3JJZFxuICAgICAgICAgICAgc2VsZWN0ZWQ9dGhpcy52YWx1ZUFzU3RyaW5nXG4gICAgICAgICAgICBzZXRWYWx1ZT10aGlzLnNldFZhbHVlXG4gICAgICAgICAgICBpbnZhbGlkPXRoaXMuaGFzRXJyb3JzXG4gICAgICAgICAgKVxuICAgICAgICAgIHZhbHVlPXRoaXMudmFsdWVcbiAgICAgICA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BQUNBLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ1QsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUN0RCxDQUFDLENBQUMsQ0FBQztBQUNIO0FBQ0EsQ0FBQyxDQUFDLHFCQUFVO0FBQ1o7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztDQTJFQyxDQUFDLDREQUFXO0FBQ2IsQ0FBQzsifQ==","import Component from '@glimmer/component';\nimport { cached, tracked } from '@glimmer/tracking';\nimport { assert, warn } from '@ember/debug';\nimport { hash } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport { action, set } from '@ember/object';\n\nimport { TrackedAsyncData } from 'ember-async-data';\nimport { modifier as elementModifier } from 'ember-modifier';\nimport { TrackedObject } from 'tracked-built-ins';\n\nimport FieldComponent from '../-private/components/field';\nimport { mergeErrorRecord } from '../-private/utils';\n\nimport type {\n  ErrorRecord,\n  FieldRegistrationData,\n  FieldValidateCallback,\n  FormData,\n  FormKey,\n  FormValidateCallback,\n  UserData,\n  ValidationError,\n} from '../-private/types';\nimport type { WithBoundArgs } from '@glint/template';\n\ntype ValidateOn = 'change' | 'focusout' | 'submit' | 'input';\n\nexport interface HeadlessFormComponentSignature<\n  DATA extends UserData,\n  SUBMISSION_VALUE\n> {\n  Element: HTMLFormElement;\n  Args: {\n    /**\n     * The initial data the form will use to pre-populate the fields.\n     *\n     * Make sure the type of it matches what you expect the form to represent, i.e. the names of all form fields match the properties of the data and their respective types!\n     */\n    data?: DATA;\n\n    /**\n     * By default the data you pass as `@data` is never mutated by the form component, you will only receive the updated data (a copy) on successful submission via `@onSubmit`.\n     * Setting this to `'mutable'` will mutate the data whenever the user updates a field. This is especially useful when the data already has some \"buffering\" behavior, like with `ember-changeset`.\n     */\n    dataMode?: 'mutable' | 'immutable';\n\n    /**\n     * Specify when to dynamically validate a field before even submitting the whole form. By default this is `submit`, which means no dynamic validation happens. Another common setting is to validate on `focusout`.\n     */\n    validateOn?: ValidateOn;\n\n    /**\n     * Specify when to revalidate a previously validated field that is invalid. By default this happens on `change`. Another common setting is to revalidate on `input`.\n     * Mind that text-based inputs don't emit the `change` event on every key stroke, but only on focusing out. Changing this to `input` would make text-based inputs revalidate on every key stroke.\n     */\n    revalidateOn?: ValidateOn;\n\n    /**\n     * Provide a custom validation function, that operates on all fields of the form. Eventual validation errors are merged with native validation errors to determine the effective set of errors rendered in the form.\n     *\n     * Return undefined when no validation errors are present, otherwise an `ErrorRecord` mapping (one or multiple) `ValidationError`s to each invalid field.\n     */\n    validate?: FormValidateCallback<DATA>;\n\n    /**\n     * Allows you to opt-out of native validation.\n     *\n     * This can be useful if all of the validation logic is already handled by the `@validate` hooks, but you have form controls that have validation requirements (e.g. `email` type) that would cause the native validation to interfere.\n     */\n    ignoreNativeValidation?: boolean;\n\n    /**\n     * Called when the user has submitted the form and no validation errors have been determined. Receives the new form data, or in case of `@dataMode=\"mutable\"` the original data object.\n     */\n    onSubmit?: (\n      data: FormData<DATA>\n    ) => SUBMISSION_VALUE | Promise<SUBMISSION_VALUE>;\n\n    /**\n     * Called when the user tried to submit the form, but validation failed. Receives the new data (or in case of `@dataMode=\"mutable\"` the original data object), and the record of validation errors by field.\n     */\n    onInvalid?: (\n      data: FormData<DATA>,\n      errors: ErrorRecord<FormData<DATA>>\n    ) => void;\n  };\n  Blocks: {\n    default: [\n      {\n        /**\n         * Field component to define the fields of your form. It yields the further components for the form control, label and validation error.\n         */\n        Field: WithBoundArgs<\n          typeof FieldComponent<DATA>,\n          | 'data'\n          | 'set'\n          | 'errors'\n          | 'registerField'\n          | 'unregisterField'\n          | 'triggerValidationFor'\n          | 'fieldValidationEvent'\n          | 'fieldRevalidationEvent'\n        >;\n\n        /**\n         * The (async) validation state as `TrackedAsyncData`.\n         *\n         * Use derived state like `.isPending` to render the UI conditionally.\n         */\n        validationState?: TrackedAsyncData<ErrorRecord<DATA>>;\n\n        /**\n         * The (async) submission state as `TrackedAsyncData`.\n         *\n         * Use derived state like `.isPending` to render the UI conditionally.\n         */\n        submissionState?: TrackedAsyncData<SUBMISSION_VALUE>;\n\n        /**\n         * Will be true if at least one form field is invalid.\n         */\n        isInvalid: boolean;\n\n        /**\n         * An ErrorRecord, for custom rendering of error output\n         */\n        rawErrors?: ErrorRecord<DATA>;\n\n        /**\n         * Yielded action that will trigger form validation and submission, same as when triggering the native `submit` event on the form.\n         */\n        submit: () => void;\n\n        /**\n         * Yielded action that will reset form state, same as when triggering the native `reset` event on the form.\n         */\n        reset: () => void;\n      }\n    ];\n  };\n}\n\n/**\n * This internal data structure maintains information about each field that is registered to the form by `registerField`.\n */\nclass FieldData<\n  DATA extends FormData,\n  KEY extends FormKey<DATA> = FormKey<DATA>\n> {\n  constructor(fieldRegistration: FieldRegistrationData<DATA, KEY>) {\n    this.validate = fieldRegistration.validate;\n  }\n\n  /**\n   * tracked state that enabled a dynamic validation of a field *before* the whole form is submitted, e.g. by `@validateOn=\"blur\" and the blur event being triggered for that particular field.\n   */\n  @tracked validationEnabled = false;\n\n  /**\n   * The *field* level validation callback passed to the field as in `<form.field @name=\"foo\" @validate={{this.validateCallback}}>`\n   */\n  validate?: FieldValidateCallback<DATA, KEY>;\n}\n\n/**\n * Headless form component.\n *\n * @example\n * Usage example:\n *\n * ```hbs\n * <HeadlessForm\n *   @data={{this.data}}\n *   @validateOn=\"focusout\"\n *   @revalidateOn=\"input\"\n *   @onSubmit={{this.doSomething}}\n *   as |form|\n * >\n *   <form.Field @name=\"firstName\" as |field|>\n *     <div>\n *       <field.Label>First name</field.Label>\n *       <field.Input\n *         required\n *       />\n *       <field.errors />\n *     </div>\n *   </form.Field>\n *\n *   <button\n *     type=\"submit\"\n *   >Submit</button>\n * </HeadlessForm>\n * ```\n */\nexport default class HeadlessFormComponent<\n  DATA extends UserData,\n  SUBMISSION_VALUE\n> extends Component<HeadlessFormComponentSignature<DATA, SUBMISSION_VALUE>> {\n  FieldComponent = FieldComponent<DATA>;\n\n  formElement?: HTMLFormElement;\n\n  registerForm = elementModifier((el: HTMLFormElement, _p: []) => {\n    this.formElement = el;\n  });\n\n  /**\n   * A copy of the passed `@data` stored internally, which is only passed back to the component consumer after a (successful) form submission.\n   */\n  internalData: DATA = new TrackedObject({}) as DATA;\n\n  @cached\n  get effectiveData(): DATA {\n    const obj: DATA = this.args.data ?? ({} as DATA);\n\n    if (this.args.dataMode === 'mutable') {\n      return obj;\n    }\n\n    const { internalData } = this;\n\n    return new Proxy(obj, {\n      get(target, prop) {\n        return prop in internalData\n          ? internalData[prop as keyof DATA]\n          : Reflect.get(target, prop);\n      },\n      set(target, property, value) {\n        return Reflect.set(internalData, property, value);\n      },\n\n      has(target, prop) {\n        return prop in internalData ? true : Reflect.has(target, prop);\n      },\n\n      getOwnPropertyDescriptor(target, prop) {\n        return Reflect.getOwnPropertyDescriptor(\n          prop in internalData ? internalData : target,\n          prop\n        );\n      },\n\n      ownKeys(target) {\n        return (\n          [...Reflect.ownKeys(target), ...Reflect.ownKeys(internalData)]\n            // return only unique values\n            .filter((value, index, array) => array.indexOf(value) === index)\n        );\n      },\n\n      deleteProperty(target, prop) {\n        if (prop in internalData) {\n          delete internalData[prop as keyof DATA];\n        }\n\n        return true;\n      },\n    });\n  }\n\n  fields = new Map<FormKey<FormData<DATA>>, FieldData<FormData<DATA>>>();\n\n  @tracked validationState?: TrackedAsyncData<ErrorRecord<DATA>>;\n  @tracked submissionState?: TrackedAsyncData<SUBMISSION_VALUE>;\n\n  /**\n   * When this is set to true by submitting the form, eventual validation errors are show for *all* field, regardless of their individual dynamic validation status in `FieldData#validationEnabled`\n   */\n  @tracked showAllValidations = false;\n\n  get validateOn(): ValidateOn {\n    return this.args.validateOn ?? 'submit';\n  }\n\n  get revalidateOn(): ValidateOn {\n    return this.args.revalidateOn ?? 'change';\n  }\n\n  /**\n   * Return the event type that will be listened on for dynamic validation (i.e. *before* submitting)\n   */\n  get fieldValidationEvent(): 'focusout' | 'change' | 'input' | undefined {\n    const { validateOn } = this;\n\n    return validateOn === 'submit'\n      ? // no need for dynamic validation, as validation always happens on submit\n        undefined\n      : validateOn;\n  }\n\n  /**\n   * Return the event type that will be listened on for dynamic *re*validation, i.e. updating the validation status of a field that has been previously marked as invalid\n   */\n  get fieldRevalidationEvent(): 'focusout' | 'change' | 'input' | undefined {\n    const { validateOn, revalidateOn } = this;\n\n    return revalidateOn === 'submit'\n      ? // no need for dynamic validation, as validation always happens on submit\n        undefined\n      : // when validation happens more frequently than revalidation, then we can ignore revalidation, because the validation handler will already cover us\n      validateOn === 'input' ||\n        (validateOn === 'change' && revalidateOn === 'focusout') ||\n        validateOn === revalidateOn\n      ? undefined\n      : revalidateOn;\n  }\n\n  /**\n   * Return true if validation has happened (by submitting or by an `@validateOn` event being triggered) and at least one field is invalid\n   */\n  get hasValidationErrors(): boolean {\n    const { validationState } = this;\n\n    // Only consider validation errors for which we actually have a field rendered\n    return validationState?.isResolved\n      ? Object.keys(validationState.value).some((name) =>\n          this.fields.has(name as FormKey<FormData<DATA>>)\n        )\n      : false;\n  }\n\n  /**\n   * Call the passed validation callbacks, defined both on the whole form as well as on field level, and return the merged result for all fields.\n   */\n  async validate(): Promise<ErrorRecord<FormData<DATA>>> {\n    const nativeValidation =\n      this.args.ignoreNativeValidation !== true ? this.validateNative() : {};\n    const customFormValidation = await this.args.validate?.(\n      this.effectiveData,\n      Array.from(this.fields.keys())\n    );\n    const customFieldValidations: ErrorRecord<FormData<DATA>>[] = [];\n\n    for (const [name, field] of this.fields) {\n      const fieldValidationResult = await field.validate?.(\n        this.effectiveData[name],\n        name,\n        this.effectiveData\n      );\n\n      if (fieldValidationResult) {\n        customFieldValidations.push({\n          [name]: fieldValidationResult,\n        } as ErrorRecord<FormData<DATA>>);\n      }\n    }\n\n    return mergeErrorRecord(\n      nativeValidation,\n      customFormValidation,\n      ...customFieldValidations\n    );\n  }\n\n  async _validate(): Promise<ErrorRecord<FormData<DATA>>> {\n    const promise = this.validate();\n\n    this.validationState = new TrackedAsyncData(promise);\n\n    return promise;\n  }\n\n  validateNative(): ErrorRecord<FormData<DATA>> | undefined {\n    const form = this.formElement;\n\n    assert(\n      'Form element expected to be present. If you see this, please report it as a bug to ember-headless-form!',\n      form\n    );\n\n    if (form.checkValidity()) {\n      return;\n    }\n\n    const errors: ErrorRecord<FormData<DATA>> = {};\n\n    for (const el of form.elements) {\n      // This is just to make TS happy, as we need to access properties on el that only form elements have, but elements in `form.elements` are just typed as plain `Element`. Should never occur in reality.\n      assert(\n        'Unexpected form element. If you see this, please report it as a bug to ember-headless-form!',\n        el instanceof HTMLInputElement ||\n          el instanceof HTMLTextAreaElement ||\n          el instanceof HTMLSelectElement ||\n          el instanceof HTMLButtonElement ||\n          el instanceof HTMLFieldSetElement ||\n          el instanceof HTMLObjectElement ||\n          el instanceof HTMLOutputElement\n      );\n\n      if (el.validity.valid) {\n        continue;\n      }\n\n      const name = el.name as FormKey<FormData<DATA>>;\n\n      if (this.fields.has(name)) {\n        errors[name] = [\n          {\n            type: 'native',\n            value: this.effectiveData[name],\n            message: el.validationMessage,\n          },\n        ];\n      } else {\n        warn(\n          `An invalid form element with name \"${name}\" was detected, but this name is not used as a form field. It will be ignored for validation. Make sure to apply the correct name to custom form elements that participate in form validation!`,\n          { id: 'headless-form.invalid-control-for-unknown-field' }\n        );\n      }\n    }\n\n    return errors;\n  }\n\n  /**\n   * Return a mapping of field to validation errors, for all fields that are invalid *and* for which validation errors should be visible.\n   * Validation errors will be visible for a certain field, if validation errors for *all* fields are visible, which is the case when trying to submit the form,\n   * or when that field has triggered the event given by `@validateOn` for showing validation errors before submitting, e.g. on blur.\n   */\n  get visibleErrors(): ErrorRecord<FormData<DATA>> | undefined {\n    if (!this.validationState?.isResolved) {\n      return undefined;\n    }\n\n    const visibleErrors: ErrorRecord<FormData<DATA>> = {};\n\n    for (const [field, errors] of Object.entries(\n      this.validationState.value\n    ) as [\n      FormKey<FormData<DATA>>,\n      ValidationError<FormData<DATA>[FormKey<FormData<DATA>>]>[]\n    ][]) {\n      if (this.showErrorsFor(field)) {\n        visibleErrors[field] = errors;\n      }\n    }\n\n    return visibleErrors;\n  }\n\n  /**\n   * Given a field name, return if eventual errors for the field should be visible. See `visibleErrors` for further details.\n   */\n  showErrorsFor(field: FormKey<FormData<DATA>>): boolean {\n    return (\n      this.showAllValidations ||\n      (this.fields.get(field)?.validationEnabled ?? false)\n    );\n  }\n\n  @action\n  async onSubmit(e?: Event): Promise<void> {\n    e?.preventDefault();\n\n    await this._validate();\n    this.showAllValidations = true;\n\n    if (!this.hasValidationErrors) {\n      if (this.args.onSubmit) {\n        this.submissionState = new TrackedAsyncData(\n          this.args.onSubmit(this.effectiveData)\n        );\n      }\n    } else {\n      assert(\n        'Validation errors expected to be present. If you see this, please report it as a bug to ember-headless-form!',\n        // Do *not* use optional chaining due to https://github.com/ember-cli/babel-plugin-debug-macros/issues/89\n        this.validationState && this.validationState.isResolved\n      );\n      this.args.onInvalid?.(this.effectiveData, this.validationState.value);\n    }\n  }\n\n  @action\n  async onReset(e?: Event): Promise<void> {\n    e?.preventDefault();\n\n    for (const key of Object.keys(this.internalData)) {\n      delete this.internalData[key as keyof DATA];\n    }\n\n    this.validationState = undefined;\n    this.submissionState = undefined;\n  }\n\n  @action\n  registerField(\n    name: FormKey<FormData<DATA>>,\n    field: FieldRegistrationData<FormData<DATA>>\n  ): void {\n    assert(\n      `You passed @name=\"${String(\n        name\n      )}\" to the form field, but this is already in use. Names of form fields must be unique!`,\n      !this.fields.has(name)\n    );\n    this.fields.set(name, new FieldData(field));\n  }\n\n  @action\n  unregisterField(name: FormKey<FormData<DATA>>): void {\n    this.fields.delete(name);\n  }\n\n  @action\n  set<KEY extends FormKey<FormData<DATA>>>(key: KEY, value: DATA[KEY]): void {\n    // when @mutableData is set, our effectiveData is something we don't control, i.e. might require old-school set() to be on the safe side\n    set(this.effectiveData, key, value);\n  }\n\n  /**\n   * Handle the `@validateOn` event for a certain field, e.g. \"blur\".\n   * Associating the event with a field is done by looking at the event target's `name` attribute, which must match one of the `<form.field @name=\"...\">` invocations by the user's template.\n   * Validation will be triggered, and the particular field will be marked to show eventual validation errors.\n   */\n  @action\n  async handleFieldValidation(e: Event | string): Promise<void> {\n    let name: string;\n\n    if (typeof e === 'string') {\n      name = e;\n    } else {\n      const { target } = e;\n\n      name = (target as HTMLInputElement).name;\n    }\n\n    if (name) {\n      const field = this.fields.get(name as FormKey<FormData<DATA>>);\n\n      if (field) {\n        await this._validate();\n        field.validationEnabled = true;\n      }\n    } else if (e instanceof Event) {\n      warn(\n        `An event of type \"${e.type}\" was received by headless-form, which is supposed to trigger validations for a certain field. But the name of that field could not be determined. Make sure that your control element has a \\`name\\` attribute matching the field, or use the yielded \\`{{field.captureEvents}}\\` to capture the events.`,\n        { id: 'headless-form.validation-event-for-unknown-field' }\n      );\n    }\n  }\n\n  /**\n   * Handle the `@revalidateOn` event for a certain field, e.g. \"blur\".\n   * Associating the event with a field is done by looking at the event target's `name` attribute, which must match one of the `<form.field @name=\"...\">` invocations by the user's template.\n   * When a field has been already marked to show validation errors by `@validateOn`, then for revalidation another validation will be triggered.\n   *\n   * The use case here is to allow this to happen more frequently than the initial validation, e.g. `@validateOn=\"blur\" @revalidateOn=\"change\"`.\n   */\n  @action\n  async handleFieldRevalidation(e: Event): Promise<void> {\n    const { target } = e;\n    const { name } = target as HTMLInputElement;\n\n    if (name) {\n      if (this.showErrorsFor(name as FormKey<FormData<DATA>>)) {\n        await this._validate();\n      }\n    } else {\n      warn(\n        `An event of type \"${e.type}\" was received by headless-form, which is supposed to trigger validations for a certain field. But the name of that field could not be determined. Make sure that your control element has a \\`name\\` attribute matching the field, or use the yielded \\`{{field.captureEvents}}\\` to capture the events.`,\n        { id: 'headless-form.validation-event-for-unknown-field' }\n      );\n    }\n  }\n\n  onValidation = elementModifier(\n    (\n      el: HTMLFormElement,\n      [eventName, handler]: [string | undefined, (e: Event) => void]\n    ) => {\n      if (eventName) {\n        el.addEventListener(eventName, handler);\n\n        return () => el.removeEventListener(eventName, handler);\n      }\n    }\n  );\n\n  [__GLIMMER_TEMPLATE(`\n    <form\n      novalidate\n      ...attributes\n      {{this.registerForm}}\n      {{on \"submit\" this.onSubmit}}\n      {{on \"reset\" this.onReset}}\n      {{this.onValidation this.fieldValidationEvent this.handleFieldValidation}}\n      {{this.onValidation\n        this.fieldRevalidationEvent\n        this.handleFieldRevalidation\n      }}\n    >\n      {{yield\n        (hash\n          Field=(component\n            this.FieldComponent\n            data=this.effectiveData\n            set=this.set\n            errors=this.visibleErrors\n            registerField=this.registerField\n            unregisterField=this.unregisterField\n            triggerValidationFor=this.handleFieldValidation\n            fieldValidationEvent=this.fieldValidationEvent\n            fieldRevalidationEvent=this.fieldRevalidationEvent\n          )\n          validationState=this.validationState\n          submissionState=this.submissionState\n          isInvalid=this.hasValidationErrors\n          rawErrors=this.visibleErrors\n          submit=this.onSubmit\n          reset=this.onReset\n        )\n      }}\n    </form>\n  `, { strictMode: true, scope: () => ({on,hash}) })]\n}\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGVhZGxlc3MtZm9ybS5qcyIsInNvdXJjZXMiOlsiaGVhZGxlc3MtZm9ybS5ndHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IENvbXBvbmVudCBmcm9tICdAZ2xpbW1lci9jb21wb25lbnQnO1xuaW1wb3J0IHsgY2FjaGVkLCB0cmFja2VkIH0gZnJvbSAnQGdsaW1tZXIvdHJhY2tpbmcnO1xuaW1wb3J0IHsgYXNzZXJ0LCB3YXJuIH0gZnJvbSAnQGVtYmVyL2RlYnVnJztcbmltcG9ydCB7IGhhc2ggfSBmcm9tICdAZW1iZXIvaGVscGVyJztcbmltcG9ydCB7IG9uIH0gZnJvbSAnQGVtYmVyL21vZGlmaWVyJztcbmltcG9ydCB7IGFjdGlvbiwgc2V0IH0gZnJvbSAnQGVtYmVyL29iamVjdCc7XG5cbmltcG9ydCB7IFRyYWNrZWRBc3luY0RhdGEgfSBmcm9tICdlbWJlci1hc3luYy1kYXRhJztcbmltcG9ydCB7IG1vZGlmaWVyIGFzIGVsZW1lbnRNb2RpZmllciB9IGZyb20gJ2VtYmVyLW1vZGlmaWVyJztcbmltcG9ydCB7IFRyYWNrZWRPYmplY3QgfSBmcm9tICd0cmFja2VkLWJ1aWx0LWlucyc7XG5cbmltcG9ydCBGaWVsZENvbXBvbmVudCBmcm9tICcuLi8tcHJpdmF0ZS9jb21wb25lbnRzL2ZpZWxkJztcbmltcG9ydCB7IG1lcmdlRXJyb3JSZWNvcmQgfSBmcm9tICcuLi8tcHJpdmF0ZS91dGlscyc7XG5cbmltcG9ydCB0eXBlIHtcbiAgRXJ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iAgICAgICAgICA6IFJlZmxlY3QuZ2V0KHRhcmdldCwgcHJvcCk7XG4gICAgICB9LFxuICAgICAgc2V0KHRhcmdldCwgcHJvcGVydHksIHZhbHVlKSB7XG4gICAgICAgIHJldHVybiBSZWZsZWN0LnNldChpbnRlcm5hbERhdGEsIHByb3BlcnR5LCB2YWx1ZSk7XG4gICAgICB9LFxuXG4gICAgICBoYXModGFyZ2V0LCBwcm9wKSB7XG4gICAgICAgIHJldHVybiBwcm9wIGluIGludGVybmFsRGF0YSA/IHRydWUgOiBSZWZsZWN0Lmhhcyh0YXJnZXQsIHByb3ApO1xuICAgICAgfSxcblxuICAgICAgZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKHRhcmdldCwgcHJvcCkge1xuICAgICAgICByZXR1cm4gUmVmbGVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoXG4gICAgICAgICAgcHJvcCBpbiBpbnRlcm5hbERhdGEgPyBpbnRlcm5hbERhdGEgOiB0YXJnZXQsXG4gICAgICAgICAgcHJvcFxuICAgICAgICApO1xuICAgICAgfSxcblxuICAgICAgb3duS2V5cyh0YXJnZXQpIHtcbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICBbLi4uUmVmbGVjdC5vd25LZXlzKHRhcmdldCksIC4uLlJlZmxlY3Qub3duS2V5cyhpbnRlcm5hbERhdGEpXVxuICAgICAgICAgICAgLy8gcmV0dXJuIG9ubHkgdW5pcXVlIHZhbHVlc1xuICAgICAgICAgICAgLmZpbHRlcigodmFsdWUsIGluZGV4LCBhcnJheSkgPT4gYXJyYXkuaW5kZXhPZih2YWx1ZSkgPT09IGluZGV4KVxuICAgICAgICApO1xuICAgICAgfSxcblxuICAgICAgZGVsZXRlUHJvcGVydHkodGFyZ2V0LCBwcm9wKSB7XG4gICAgICAgIGlmIChwcm9wIGluIGludGVybmFsRGF0YSkge1xuICAgICAgICAgIGRlbGV0ZSBpbnRlcm5hbERhdGFbcHJvcCBhcyBrZXlvZiBE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QUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNoRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ1AsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ0wsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNKO0FBQ0EsQ0FBQyxDQUFDLHFCQUFVO0FBQ1o7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Q0FrQ0MsQ0FBQyxtREFBVztBQUNiLENBQUM7In0=","function _defineProperty(obj, key, value) {\n  if (key in obj) {\n    Object.defineProperty(obj, key, {\n      value: value,\n      enumerable: true,\n      configurable: true,\n      writable: true\n    });\n  } else {\n    obj[key] = value;\n  }\n\n  return obj;\n}\n\nfunction _initializerDefineProperty(target, property, descriptor, context) {\n  if (!descriptor) return;\n  Object.defineProperty(target, property, {\n    enumerable: descriptor.enumerable,\n    configurable: descriptor.configurable,\n    writable: descriptor.writable,\n    value: descriptor.initializer ? descriptor.initializer.call(context) : void 0\n  });\n}\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {\n  var desc = {};\n  Object.keys(descriptor).forEach(function (key) {\n    desc[key] = descriptor[key];\n  });\n  desc.enumerable = !!desc.enumerable;\n  desc.configurable = !!desc.configurable;\n\n  if ('value' in desc || desc.initializer) {\n    desc.writable = true;\n  }\n\n  desc = decorators.slice().reverse().reduce(function (desc, decorator) {\n    return decorator(target, property, desc) || desc;\n  }, desc);\n\n  if (context && desc.initializer !== void 0) {\n    desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n    desc.initializer = undefined;\n  }\n\n  if (desc.initializer === void 0) {\n    Object.defineProperty(target, property, desc);\n    desc = null;\n  }\n\n  return desc;\n}\n\nexport { _defineProperty as _, _applyDecoratedDescriptor as a, _initializerDefineProperty as b };\n","const SHIFT_KEY_MAP = {\n  A: 'a',\n  B: 'b',\n  C: 'c',\n  D: 'd',\n  E: 'e',\n  F: 'f',\n  G: 'g',\n  H: 'h',\n  I: 'i',\n  J: 'j',\n  K: 'k',\n  L: 'l',\n  M: 'm',\n  N: 'n',\n  O: 'o',\n  P: 'p',\n  Q: 'q',\n  R: 'r',\n  S: 's',\n  T: 't',\n  U: 'u',\n  V: 'v',\n  W: 'w',\n  X: 'x',\n  Y: 'y',\n  Z: 'z',\n  '!': '1',\n  '@': '2',\n  '#': '3',\n  $: '4',\n  '%': '5',\n  '^': '6',\n  '&': '7',\n  '*': '8',\n  '(': '9',\n  ')': '0',\n  _: '-',\n  '+': '=',\n  '<': ',',\n  '>': '.',\n  '?': '/',\n  ':': ';',\n  '\"': \"'\",\n  '~': '`',\n  '{': '[',\n  '}': ']',\n  '|': '\\\\'\n};\nconst MAC_ALT_KEY_MAP = {\n  å: 'a',\n  b: 'b',\n  ç: 'c',\n  '∂': 'd',\n  // 'Dead': 'e',\n  ƒ: 'f',\n  '©': 'g',\n  '˙': 'h',\n  // 'Dead': 'i',\n  '∆': 'j',\n  '˚': 'k',\n  '¬': 'l',\n  µ: 'm',\n  // 'Dead': 'n',\n  ø: 'o',\n  π: 'p',\n  œ: 'q',\n  '®': 'r',\n  ß: 's',\n  '†': 't',\n  // 'Dead': 'u',\n  '√': 'v',\n  '∑': 'w',\n  '≈': 'x',\n  '¥': 'y',\n  Ω: 'z',\n  '¡': '1',\n  '™': '2',\n  '£': '3',\n  '¢': '4',\n  '∞': '5',\n  '§': '6',\n  '¶': '7',\n  '•': '8',\n  ª: '9',\n  º: '0',\n  '–': '-',\n  '≠': '=',\n  '≤': ',',\n  '≥': '.',\n  '÷': '/',\n  '…': ';',\n  æ: \"'\",\n  // 'Dead': '`',\n  '“': '[',\n  '‘': ']',\n  '«': '\\\\'\n};\nconst MAC_SHIFT_ALT_KEY_MAP = {\n  Å: 'a',\n  ı: 'b',\n  // 'Dead': 'c',\n  Î: 'd',\n  // 'Dead': 'e',\n  Ï: 'f',\n  '˝': 'g',\n  Ó: 'h',\n  ˆ: 'i',\n  Ô: 'j',\n  '': 'k',\n  Ò: 'l',\n  Â: 'm',\n  '˜': 'n',\n  Ø: 'o',\n  // 'Dead': 'p',\n  Œ: 'q',\n  '‰': 'r',\n  Í: 's',\n  ˇ: 't',\n  '¨': 'u',\n  '◊': 'v',\n  '„': 'w',\n  '˛': 'x',\n  Á: 'y',\n  '¸': 'z',\n  '⁄': '1',\n  '€': '2',\n  '‹': '3',\n  '›': '4',\n  ﬁ: '5',\n  ﬂ: '6',\n  '‡': '7',\n  '°': '8',\n  '·': '9',\n  '‚': '0',\n  '—': '-',\n  '±': '=',\n  '¯': ',',\n  '˘': '.',\n  '¿': '/',\n  Ú: ';',\n  Æ: \"'\",\n  '`': '`',\n  '”': '[',\n  '’': ']',\n  '»': '\\\\'\n};\n\nexport { MAC_ALT_KEY_MAP, MAC_SHIFT_ALT_KEY_MAP, SHIFT_KEY_MAP };\n","var validModifiers = ['alt', 'ctrl', 'meta', 'shift', 'cmd'];\n\nexport { validModifiers as default };\n","import { helper } from '@ember/component/helper';\nimport { assert } from '@ember/debug';\nimport isKey from '../utils/is-key.js';\nimport listenerName from '../utils/listener-name.js';\nimport '../utils/keyboard-listener.js';\nimport '../_rollupPluginBabelHelpers-30c82890.js';\nimport '../utils/platform.js';\nimport '../fixtures/key-maps.js';\nimport '../fixtures/modifiers-array.js';\nimport '../utils/get-mouse-name.js';\nimport '@ember/utils';\nimport '../utils/get-cmd-key.js';\n\nvar ifKey = helper(function ifKey([keyCombo, callback]\n/*, named*/\n) {\n  return function (event) {\n    assert('ember-keyboard: You must pass a function as the second argument to the `if-key` helper', typeof callback === 'function');\n    assert('ember-keyboard: The `if-key` helper expects to be invoked with a KeyboardEvent', event instanceof KeyboardEvent);\n\n    if (isKey(listenerName(event.type, keyCombo), event)) {\n      callback(event);\n    }\n  };\n});\n\nexport { ifKey as default };\n","import { a as _applyDecoratedDescriptor, b as _initializerDefineProperty, _ as _defineProperty } from '../_rollupPluginBabelHelpers-30c82890.js';\nimport Helper from '@ember/component/helper';\nimport { assert } from '@ember/debug';\nimport { inject } from '@ember/service';\nimport listenerName from '../utils/listener-name.js';\nimport '../utils/get-cmd-key.js';\n\nvar _class2, _descriptor;\n\nlet _class = (_class2 = class _class2 extends Helper {\n  constructor(...args) {\n    super(...args);\n\n    _initializerDefineProperty(this, \"keyboard\", _descriptor, this);\n\n    _defineProperty(this, \"keyCombo\", void 0);\n\n    _defineProperty(this, \"callback\", void 0);\n\n    _defineProperty(this, \"keyboardActivated\", true);\n\n    _defineProperty(this, \"keyboardPriority\", 0);\n\n    _defineProperty(this, \"eventName\", 'keydown');\n\n    _defineProperty(this, \"keyboardHandlers\", void 0);\n  }\n\n  compute([keyCombo, callback], {\n    event = 'keydown',\n    activated = true,\n    priority = 0\n  }) {\n    assert('ember-keyboard: You must pass a function as the second argument to the `on-key` helper', typeof callback === 'function');\n    this.keyCombo = keyCombo;\n    this.callback = callback;\n    this.eventName = event;\n    this.keyboardActivated = activated;\n    this.keyboardPriority = priority;\n    this.keyboardHandlers = {};\n    this.keyboardHandlers[listenerName(event, keyCombo)] = callback;\n    this.keyboard.register(this);\n  }\n\n  willDestroy() {\n    this.keyboard.unregister(this);\n    super.willDestroy(...arguments);\n  }\n\n}, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, \"keyboard\", [inject], {\n  configurable: true,\n  enumerable: true,\n  writable: true,\n  initializer: null\n})), _class2);\n\nexport { _class as default };\n","import { isNone } from '@ember/utils';\n\nfunction getMouseName(buttonCode) {\n  if (isNone(buttonCode)) return;\n\n  switch (buttonCode) {\n    case 'left':\n      return 0;\n\n    case 'middle':\n      return 1;\n\n    case 'right':\n      return 2;\n  }\n}\n\nexport { getMouseName as default };\n","import { _ as _defineProperty, a as _applyDecoratedDescriptor, b as _initializerDefineProperty } from '../_rollupPluginBabelHelpers-30c82890.js';\nimport { inject } from '@ember/service';\nimport { registerDestructor } from '@ember/destroyable';\n\nfunction populateKeyboardHandlers(responder) {\n  responder.keyboardHandlers = responder.keyboardHandlers || {};\n\n  if (!responder.keyboardHandlerNames) {\n    responder.keyboardHandlerNames = {};\n\n    for (let propertyName in responder) {\n      let propertyValue = responder[propertyName];\n\n      if (typeof propertyValue === 'function' && propertyValue._emberKeyboardOnKeyDecoratorData) {\n        for (let listenerName of propertyValue._emberKeyboardOnKeyDecoratorData.listenerNames || []) {\n          responder.keyboardHandlerNames[listenerName] = propertyName;\n        }\n      }\n    }\n  }\n\n  for (let [listenerName, methodName] of Object.entries(responder.keyboardHandlerNames || {})) {\n    responder.keyboardHandlers[listenerName] = responder[methodName].bind(responder);\n  }\n}\n\nfunction keyResponder(opts = {}) {\n  const createClass = function (DecoratedClass) {\n    var _class, _descriptor, _class2;\n\n    if (opts.priority === undefined) {\n      opts.priority = 0;\n    }\n\n    if (opts.activated === undefined) {\n      opts.activated = true;\n    }\n\n    return _class = (_class2 = class ClassAsKeyResponder extends DecoratedClass {\n      get keyboardPriority() {\n        if (super.keyboardPriority === undefined) {\n          return opts.priority;\n        }\n\n        return super.keyboardPriority;\n      }\n\n      set keyboardPriority(val) {\n        super.keyboardPriority = val;\n      }\n\n      get keyboardActivated() {\n        if (super.keyboardActivated === undefined) {\n          return opts.activated;\n        }\n\n        return super.keyboardActivated;\n      }\n\n      set keyboardActivated(val) {\n        super.keyboardActivated = val;\n      }\n\n      constructor() {\n        super(...arguments);\n\n        _initializerDefineProperty(this, \"keyboard\", _descriptor, this);\n\n        populateKeyboardHandlers(this);\n        this.keyboard.register(this);\n        registerDestructor(this, () => {\n          this.keyboard.unregister(this);\n        });\n      }\n\n    }, _defineProperty(_class2, \"name\", `${DecoratedClass.name}WithKeyResponder`), _class2), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"keyboard\", [inject], {\n      configurable: true,\n      enumerable: true,\n      writable: true,\n      initializer: null\n    })), _class;\n  };\n\n  if (typeof opts === 'function') {\n    return createClass(opts);\n  } else {\n    return function (DecoratedClass) {\n      return createClass(DecoratedClass);\n    };\n  }\n}\n\nexport { keyResponder as default };\n","import listenerName from '../utils/listener-name.js';\nimport '../utils/get-cmd-key.js';\n\nconst DEFAULT_EVENT_NAME = 'keydown';\nfunction onKey(keyCombo, opts = {}) {\n  if (typeof arguments[1] === 'function') {\n    return onKeyClassic(keyCombo, {\n      event: DEFAULT_EVENT_NAME\n    }, arguments[1]);\n  }\n\n  if (!opts.event) {\n    opts.event = DEFAULT_EVENT_NAME;\n  }\n\n  if (typeof arguments[2] === 'function') {\n    return onKeyClassic(keyCombo, opts, arguments[2]);\n  } else {\n    return onKeyDecorator(keyCombo, opts);\n  }\n}\n\nfunction onKeyDecorator(keyCombo, opts) {\n  // ES6 class\n  return function (target, property, descriptor) {\n    if (!Object.prototype.hasOwnProperty.call(target, 'keyboardHandlerNames')) {\n      let parentKeyboardHandlerNames = target.parentKeyboardHandlerNames; // we need to assign because of the way mixins copy actions down when inheriting\n\n      target.keyboardHandlerNames = parentKeyboardHandlerNames ? Object.assign({}, parentKeyboardHandlerNames) : {};\n    }\n\n    target.keyboardHandlerNames[listenerName(opts.event, keyCombo)] = property;\n    return descriptor;\n  };\n}\n\nfunction onKeyClassic(keyCombo, opts, handler) {\n  if (!handler._emberKeyboardOnKeyDecoratorData) {\n    handler._emberKeyboardOnKeyDecoratorData = {\n      listenerNames: []\n    };\n  }\n\n  handler._emberKeyboardOnKeyDecoratorData.listenerNames.push(listenerName(opts.event, keyCombo));\n\n  return handler;\n}\n\nexport { onKey as default };\n","import listenerName from '../utils/listener-name.js';\nimport validMouseButtons from '../fixtures/mouse-buttons-array.js';\nimport validModifiers from '../fixtures/modifiers-array.js';\nimport '../utils/get-cmd-key.js';\n\nconst validKeys = validMouseButtons.concat(validModifiers);\n\nconst validateKeys = function validateKeys(keys) {\n  keys.forEach(key => {\n    if (validKeys.indexOf(key) === -1) {\n      /* eslint no-console: [\"error\", { allow: [\"error\"] }] */\n      console.error(`\\`${key}\\` is not a valid key name`);\n    }\n  });\n};\n\nconst formattedListener = function formattedListener(type, keysString) {\n  const keys = keysString !== undefined ? keysString.split('+') : [];\n  validateKeys(keys);\n  return listenerName(type, keys);\n};\n\nfunction click(keys) {\n  return formattedListener('click', keys);\n}\nfunction mouseDown(keys) {\n  return formattedListener('mousedown', keys);\n}\nfunction mouseUp(keys) {\n  return formattedListener('mouseup', keys);\n}\n\nexport { click, mouseDown, mouseUp };\n","var validMouseButtons = ['left', 'middle', 'right'];\n\nexport { validMouseButtons as default };\n","import listenerName from '../utils/listener-name.js';\nimport validModifiers from '../fixtures/modifiers-array.js';\nimport '../utils/get-cmd-key.js';\n\nfunction validateKeys(keysString) {\n  const keys = keysString !== undefined ? keysString.split('+') : [];\n  keys.forEach(key => {\n    if (validModifiers.indexOf(key) === -1) {\n      /* eslint no-console: [\"error\", { allow: [\"error\"] }] */\n      console.error(`\\`${key}\\` is not a valid key name`);\n    }\n  });\n}\n\nconst formattedListener = function formattedListener(type, keysString) {\n  validateKeys(keysString);\n  return listenerName(type, keysString);\n};\n\nfunction touchEnd(keys) {\n  return formattedListener('touchEnd', keys);\n}\nfunction touchStart(keys) {\n  return formattedListener('touchstart', keys);\n}\n\nexport { touchEnd, touchStart };\n","import KeyboardListener from './keyboard-listener.js';\nimport '../_rollupPluginBabelHelpers-30c82890.js';\nimport './platform.js';\nimport '@ember/debug';\n\nconst triggerKeyEvent = function triggerKeyEvent(eventType, keyCombo, element) {\n  let keyboardListener = KeyboardListener.parse(`${eventType}:${keyCombo}`);\n  const event = keyboardListener.createMatchingKeyboardEvent();\n  element.dispatchEvent(event);\n};\n\nconst triggerKeyDown = function triggerKeyDown(keyCombo, element = document) {\n  triggerKeyEvent('keydown', keyCombo, element);\n};\n\nconst triggerKeyPress = function triggerKeyPress(keyCombo, element = document) {\n  triggerKeyEvent('keypress', keyCombo, element);\n};\n\nconst triggerKeyUp = function triggerKeyUp(keyCombo, element = document) {\n  triggerKeyEvent('keyup', keyCombo, element);\n};\n\nexport { triggerKeyDown, triggerKeyPress, triggerKeyUp };\n","export { default as getMouseCode } from './utils/get-mouse-code.js';\nexport { default as keyResponder } from './decorators/key-responder.js';\nexport { default as onKey } from './decorators/on-key.js';\nexport { keyDown, keyPress, keyUp } from './listeners/key-events.js';\nexport { click, mouseDown, mouseUp } from './listeners/mouse-events.js';\nexport { touchEnd, touchStart } from './listeners/touch-events.js';\nexport { triggerKeyDown, triggerKeyPress, triggerKeyUp } from './utils/trigger-event.js';\nimport '@ember/utils';\nimport './_rollupPluginBabelHelpers-30c82890.js';\nimport '@ember/service';\nimport '@ember/destroyable';\nimport './utils/listener-name.js';\nimport './utils/get-cmd-key.js';\nimport './fixtures/mouse-buttons-array.js';\nimport './fixtures/modifiers-array.js';\nimport './utils/keyboard-listener.js';\nimport './utils/platform.js';\nimport '@ember/debug';\n\nfunction getCode() {\n  throw new Error('ember-keyboard: `getCode` has been removed. There is no longer a need for this function as you can directly specify `key` and/or `code` values');\n}\n\nfunction getKeyCode() {\n  throw new Error('ember-keyboard: `getKeyCode` has been removed. There is no longer a need for this function as you can directly specify `key` and/or `code` values');\n}\n\nexport { getCode, getKeyCode };\n","import listenerName from '../utils/listener-name.js';\nimport '../utils/get-cmd-key.js';\n\nfunction keyDown(keyCombo) {\n  return listenerName('keydown', keyCombo);\n}\nfunction keyPress(keyCombo) {\n  return listenerName('keypress', keyCombo);\n}\nfunction keyUp(keyCombo) {\n  return listenerName('keyup', keyCombo);\n}\n\nexport { keyDown, keyPress, keyUp };\n","import { a as _applyDecoratedDescriptor, b as _initializerDefineProperty, _ as _defineProperty } from '../_rollupPluginBabelHelpers-30c82890.js';\nimport Modifier from 'ember-modifier';\nimport { inject } from '@ember/service';\nimport { action } from '@ember/object';\nimport { registerDestructor } from '@ember/destroyable';\nimport { macroCondition, dependencySatisfies } from '@embroider/macros';\nimport listenerName from '../utils/listener-name.js';\nimport isKey from '../utils/is-key.js';\nimport '../utils/get-cmd-key.js';\nimport '../utils/keyboard-listener.js';\nimport '../utils/platform.js';\nimport '@ember/debug';\nimport '../fixtures/key-maps.js';\nimport '../fixtures/modifiers-array.js';\nimport '../utils/get-mouse-name.js';\nimport '@ember/utils';\n\nconst ONLY_WHEN_FOCUSED_TAG_NAMES = ['input', 'select', 'textarea'];\nlet modifier;\n\nif (macroCondition(dependencySatisfies('ember-modifier', '>=3.2.0 || 4.x'))) {\n  var _class, _descriptor;\n\n  /**\n   * This is an element modifier to trigger some behavior when\n   * specified key combo is pressed. When used with a form element\n   * (input, textarea, or select), the action fires only when element\n   * has focus. When used with another element type, it will trigger the\n   * passed action, OR if no action is passed, it will trigger a `click`\n   * on the element. This allows for easy declaration of keyboard shortcuts\n   * for anything clickable: In the following example, we trigger a\n   * click on the button when the B key is pressed:\n   *\n   * <button\n   *    type=\"button\"\n   *    {{on-key 'b'}}>\n   *   Click me, or press \"B\"\n   * </button>\n   */\n  modifier = (_class = class OnKeyModifier extends Modifier {\n    constructor(owner, args) {\n      super(owner, args);\n\n      _initializerDefineProperty(this, \"keyboard\", _descriptor, this);\n\n      _defineProperty(this, \"element\", void 0);\n\n      _defineProperty(this, \"keyboardPriority\", 0);\n\n      _defineProperty(this, \"activatedParamValue\", true);\n\n      _defineProperty(this, \"eventName\", 'keydown');\n\n      _defineProperty(this, \"onlyWhenFocused\", true);\n\n      _defineProperty(this, \"listenerName\", void 0);\n\n      _defineProperty(this, \"removeEventListeners\", () => {\n        if (this.onlyWhenFocused) {\n          this.element.removeEventListener('click', this.onFocus, true);\n          this.element.removeEventListener('focus', this.onFocus, true);\n          this.element.removeEventListener('focusout', this.onFocusOut, true);\n        }\n      });\n\n      this.keyboard.register(this);\n      registerDestructor(this, () => {\n        this.removeEventListeners();\n        this.keyboard.unregister(this);\n      });\n    }\n\n    modify(element, positional, named) {\n      this.element = element;\n      this.removeEventListeners();\n      this.setupProperties(positional, named);\n\n      if (this.onlyWhenFocused) {\n        this.addEventListeners();\n      }\n    }\n\n    setupProperties(positional, named) {\n      let [keyCombo, callback] = positional;\n      let {\n        activated,\n        event,\n        priority,\n        onlyWhenFocused\n      } = named;\n      this.keyCombo = keyCombo;\n      this.callback = callback;\n      this.eventName = event || 'keydown';\n      this.activatedParamValue = 'activated' in named ? !!activated : undefined;\n      this.keyboardPriority = priority ? parseInt(priority, 10) : 0;\n      this.listenerName = listenerName(this.eventName, this.keyCombo);\n\n      if (onlyWhenFocused !== undefined) {\n        this.onlyWhenFocused = onlyWhenFocused;\n      } else {\n        this.onlyWhenFocused = ONLY_WHEN_FOCUSED_TAG_NAMES.includes(this.element.tagName.toLowerCase());\n      }\n    }\n\n    addEventListeners() {\n      this.element.addEventListener('click', this.onFocus, true);\n      this.element.addEventListener('focus', this.onFocus, true);\n      this.element.addEventListener('focusout', this.onFocusOut, true);\n    }\n\n    onFocus() {\n      this.isFocused = true;\n    }\n\n    onFocusOut() {\n      this.isFocused = false;\n    }\n\n    get keyboardActivated() {\n      if (this.activatedParamValue === false) {\n        return false;\n      }\n\n      if (this.onlyWhenFocused) {\n        return this.isFocused;\n      }\n\n      return true;\n    }\n\n    get keyboardFirstResponder() {\n      if (this.onlyWhenFocused) {\n        return this.isFocused;\n      }\n\n      return false;\n    }\n\n    canHandleKeyboardEvent(event) {\n      return isKey(this.listenerName, event);\n    }\n\n    handleKeyboardEvent(event, ekEvent) {\n      if (isKey(this.listenerName, event)) {\n        if (this.callback) {\n          this.callback(event, ekEvent);\n        } else {\n          this.element.click();\n        }\n      }\n    }\n\n  }, (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"keyboard\", [inject], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: null\n  }), _applyDecoratedDescriptor(_class.prototype, \"onFocus\", [action], Object.getOwnPropertyDescriptor(_class.prototype, \"onFocus\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"onFocusOut\", [action], Object.getOwnPropertyDescriptor(_class.prototype, \"onFocusOut\"), _class.prototype)), _class);\n} else {\n  var _class3, _descriptor2;\n\n  modifier = (_class3 = class OnKeyModifier extends Modifier {\n    constructor(...args) {\n      super(...args);\n\n      _initializerDefineProperty(this, \"keyboard\", _descriptor2, this);\n\n      _defineProperty(this, \"keyboardPriority\", 0);\n\n      _defineProperty(this, \"activatedParamValue\", true);\n\n      _defineProperty(this, \"eventName\", 'keydown');\n\n      _defineProperty(this, \"onlyWhenFocused\", true);\n\n      _defineProperty(this, \"listenerName\", void 0);\n    }\n\n    didReceiveArguments() {\n      let [keyCombo, callback] = this.args.positional;\n      let {\n        activated,\n        event,\n        priority\n      } = this.args.named;\n      this.keyCombo = keyCombo;\n      this.callback = callback;\n      this.eventName = event || 'keydown';\n      this.activatedParamValue = Object.keys(this.args.named).includes('activated') ? !!activated : undefined;\n      this.keyboardPriority = priority ? parseInt(priority, 10) : 0;\n      this.listenerName = listenerName(this.eventName, this.keyCombo);\n\n      if (this.args.named.onlyWhenFocused !== undefined) {\n        this.onlyWhenFocused = this.args.named.onlyWhenFocused;\n      } else {\n        this.onlyWhenFocused = ONLY_WHEN_FOCUSED_TAG_NAMES.includes(this.element.tagName.toLowerCase());\n      }\n    }\n\n    didInstall() {\n      this.keyboard.register(this);\n\n      if (this.onlyWhenFocused) {\n        this.element.addEventListener('click', this.onFocus, true);\n        this.element.addEventListener('focus', this.onFocus, true);\n        this.element.addEventListener('focusout', this.onFocusOut, true);\n      }\n    }\n\n    willRemove() {\n      if (this.onlyWhenFocused) {\n        this.element.removeEventListener('click', this.onFocus, true);\n        this.element.removeEventListener('focus', this.onFocus, true);\n        this.element.removeEventListener('focusout', this.onFocusOut, true);\n      }\n\n      this.keyboard.unregister(this);\n    }\n\n    onFocus() {\n      this.isFocused = true;\n    }\n\n    onFocusOut() {\n      this.isFocused = false;\n    }\n\n    get keyboardActivated() {\n      if (this.activatedParamValue === false) {\n        return false;\n      }\n\n      if (this.onlyWhenFocused) {\n        return this.isFocused;\n      }\n\n      return true;\n    }\n\n    get keyboardFirstResponder() {\n      if (this.onlyWhenFocused) {\n        return this.isFocused;\n      }\n\n      return false;\n    }\n\n    canHandleKeyboardEvent(event) {\n      return isKey(this.listenerName, event);\n    }\n\n    handleKeyboardEvent(event, ekEvent) {\n      if (isKey(this.listenerName, event)) {\n        if (this.callback) {\n          this.callback(event, ekEvent);\n        } else {\n          this.element.click();\n        }\n      }\n    }\n\n  }, (_descriptor2 = _applyDecoratedDescriptor(_class3.prototype, \"keyboard\", [inject], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: null\n  }), _applyDecoratedDescriptor(_class3.prototype, \"onFocus\", [action], Object.getOwnPropertyDescriptor(_class3.prototype, \"onFocus\"), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, \"onFocusOut\", [action], Object.getOwnPropertyDescriptor(_class3.prototype, \"onFocusOut\"), _class3.prototype)), _class3);\n}\n\nvar modifier$1 = modifier;\n\nexport { modifier$1 as default };\n","import { a as _applyDecoratedDescriptor, _ as _defineProperty } from '../_rollupPluginBabelHelpers-30c82890.js';\nimport Service from '@ember/service';\nimport { getOwner } from '@ember/application';\nimport { action } from '@ember/object';\nimport { run } from '@ember/runloop';\nimport { keyDown, keyPress, keyUp } from '../listeners/key-events.js';\nimport { handleKeyEventWithPropagation } from '../utils/handle-key-event.js';\nimport { reverseCompareProp } from '../utils/sort.js';\nimport '../utils/listener-name.js';\nimport '../utils/get-cmd-key.js';\nimport '../utils/is-key.js';\nimport '../utils/keyboard-listener.js';\nimport '../utils/platform.js';\nimport '@ember/debug';\nimport '../fixtures/key-maps.js';\nimport '../fixtures/modifiers-array.js';\nimport '../utils/get-mouse-name.js';\nimport '@ember/utils';\n\nvar _class;\nlet KeyboardService = (_class = class KeyboardService extends Service {\n  get activeResponders() {\n    let {\n      registeredResponders\n    } = this;\n    return Array.from(registeredResponders).filter(r => r.keyboardActivated);\n  }\n\n  get sortedResponders() {\n    return this.activeResponders.sort((a, b) => {\n      return reverseCompareProp(a, b, 'keyboardPriority');\n    });\n  }\n\n  get firstResponders() {\n    return this.sortedResponders.filter(r => r.keyboardFirstResponder);\n  }\n\n  get normalResponders() {\n    return this.sortedResponders.filter(r => !r.keyboardFirstResponder);\n  }\n\n  constructor(...args) {\n    super(...args);\n\n    _defineProperty(this, \"registeredResponders\", new Set());\n\n    if (typeof FastBoot !== 'undefined') {\n      return;\n    }\n\n    const config = getOwner(this).resolveRegistration('config:environment') || {};\n    let emberKeyboardConfig = config.emberKeyboard || {};\n\n    if (emberKeyboardConfig.disableOnInputFields) {\n      this._disableOnInput = true;\n    }\n\n    this._listeners = emberKeyboardConfig.listeners || ['keyUp', 'keyDown', 'keyPress'];\n    this._listeners = this._listeners.map(listener => listener.toLowerCase());\n\n    this._listeners.forEach(type => {\n      document.addEventListener(type, this._respond);\n    });\n  }\n\n  willDestroy(...args) {\n    super.willDestroy(...args);\n\n    if (typeof FastBoot !== 'undefined') {\n      return;\n    }\n\n    this._listeners.forEach(type => {\n      document.removeEventListener(type, this._respond);\n    });\n  }\n\n  _respond(event) {\n    if (this._disableOnInput && event.target) {\n      const target = event.composedPath()[0] ?? event.target;\n      const tag = target.tagName;\n      const isContentEditable = target.getAttribute && target.getAttribute('contenteditable') != null;\n\n      if (isContentEditable || tag === 'TEXTAREA' || tag === 'INPUT') {\n        return;\n      }\n    }\n\n    run(() => {\n      let {\n        firstResponders,\n        normalResponders\n      } = this;\n      handleKeyEventWithPropagation(event, {\n        firstResponders,\n        normalResponders\n      });\n    });\n  }\n\n  register(responder) {\n    this.registeredResponders.add(responder);\n  }\n\n  unregister(responder) {\n    this.registeredResponders.delete(responder);\n  }\n\n  keyDown(...args) {\n    return keyDown(...args);\n  }\n\n  keyPress(...args) {\n    return keyPress(...args);\n  }\n\n  keyUp(...args) {\n    return keyUp(...args);\n  }\n\n}, (_applyDecoratedDescriptor(_class.prototype, \"_respond\", [action], Object.getOwnPropertyDescriptor(_class.prototype, \"_respond\"), _class.prototype)), _class);\n\nexport { KeyboardService as default };\n","import isKey from './is-key.js';\nimport './keyboard-listener.js';\nimport '../_rollupPluginBabelHelpers-30c82890.js';\nimport './platform.js';\nimport '@ember/debug';\nimport '../fixtures/key-maps.js';\nimport '../fixtures/modifiers-array.js';\nimport './get-mouse-name.js';\nimport '@ember/utils';\n\nfunction handleKeyEventWithPropagation(event, {\n  firstResponders,\n  normalResponders\n}) {\n  let isImmediatePropagationStopped = false;\n  let isPropagationStopped = false;\n  const ekEvent = {\n    stopImmediatePropagation() {\n      isImmediatePropagationStopped = true;\n    },\n\n    stopPropagation() {\n      isPropagationStopped = true;\n    }\n\n  };\n\n  for (const responder of firstResponders) {\n    triggerResponderListener(responder, event, ekEvent);\n\n    if (isImmediatePropagationStopped) {\n      break;\n    }\n  }\n\n  if (isPropagationStopped) {\n    return;\n  }\n\n  isImmediatePropagationStopped = false;\n  let previousPriorityLevel = Number.POSITIVE_INFINITY;\n\n  for (const responder of normalResponders) {\n    const currentPriorityLevel = Number(responder.keyboardPriority);\n\n    if (isImmediatePropagationStopped && currentPriorityLevel === previousPriorityLevel) {\n      continue;\n    }\n\n    if (currentPriorityLevel < previousPriorityLevel) {\n      if (isPropagationStopped) {\n        return;\n      }\n\n      isImmediatePropagationStopped = false;\n      previousPriorityLevel = currentPriorityLevel;\n    }\n\n    triggerResponderListener(responder, event, ekEvent);\n  }\n  /* eslint-enable no-unused-vars */\n\n}\n\nfunction triggerResponderListener(responder, event, ekEvent = null) {\n  if (responder.handleKeyboardEvent) {\n    if (responder.canHandleKeyboardEvent && !responder.canHandleKeyboardEvent(event)) {\n      return;\n    }\n\n    responder.handleKeyboardEvent(event, ekEvent);\n    return;\n  }\n\n  if (responder.keyboardHandlers) {\n    Object.keys(responder.keyboardHandlers).forEach(responderListenerName => {\n      if (isKey(responderListenerName, event)) {\n        if (ekEvent) {\n          responder.keyboardHandlers[responderListenerName](event, ekEvent);\n        } else {\n          responder.keyboardHandlers[responderListenerName](event);\n        }\n      }\n    });\n    return;\n  }\n\n  throw new Error('A responder registered with the ember-keyboard service must implement either `keyboardHandlers` (property returning a dictionary of listenerNames to handler functions), or `handleKeyboardEvent(event)`)');\n}\n\nexport { handleKeyEventWithPropagation };\n","import { get } from '@ember/object';\n\nfunction compare(a, b) {\n  let diff = a - b;\n  return (diff > 0) - (diff < 0);\n}\nfunction compareProp(a, b, propName, convertValue) {\n  return compare(convertValue ? convertValue(get(a, propName)) : get(a, propName), convertValue ? convertValue(get(b, propName)) : get(b, propName));\n}\nfunction reverseCompareProp(a, b, propName, convertValue = null) {\n  return compareProp(b, a, propName, convertValue);\n}\n\nexport { compare, compareProp, reverseCompareProp };\n","import { isNone } from '@ember/utils';\n\nfunction getMouseName(buttonCode) {\n  if (isNone(buttonCode)) return;\n\n  switch (buttonCode) {\n    case 0:\n      return 'left';\n\n    case 1:\n      return 'middle';\n\n    case 2:\n      return 'right';\n  }\n}\n\nexport { getMouseName as default };\n","import KeyboardListener from './keyboard-listener.js';\nimport getPlatform from './platform.js';\nimport { SHIFT_KEY_MAP, MAC_ALT_KEY_MAP, MAC_SHIFT_ALT_KEY_MAP } from '../fixtures/key-maps.js';\nimport validModifiers from '../fixtures/modifiers-array.js';\nimport getMouseName from './get-mouse-name.js';\nimport '../_rollupPluginBabelHelpers-30c82890.js';\nimport '@ember/debug';\nimport '@ember/utils';\n\nconst ALL_SYMBOL = '_all';\nfunction isKey(listenerOrListenerName, event, platform = getPlatform()) {\n  let listener;\n\n  if (listenerOrListenerName instanceof KeyboardListener) {\n    listener = listenerOrListenerName;\n  } else if (typeof listenerOrListenerName === 'string') {\n    listener = KeyboardListener.parse(listenerOrListenerName, platform);\n  } else {\n    throw new Error('Expected a `string` or `KeyCombo` as `keyComboOrKeyComboString` argument to `isKey`');\n  }\n\n  if (listener.type !== event.type) {\n    return false;\n  }\n\n  if (isAll(listener)) {\n    return true;\n  }\n\n  if (modifiersMatch(listener, event) && (keyOrCodeMatches(listener, event) || mouseButtonMatches(listener, event))) {\n    return true;\n  }\n\n  return specialCaseMatches(listener, event, platform);\n}\n\nfunction isAll(listener) {\n  return listener.keyOrCode === ALL_SYMBOL && listener.altKey === false && listener.ctrlKey === false && listener.metaKey === false && listener.shiftKey === false;\n}\n\nfunction modifiersMatch(listener, keyboardEvent) {\n  return listener.type === keyboardEvent.type && listener.altKey === keyboardEvent.altKey && listener.ctrlKey === keyboardEvent.ctrlKey && listener.metaKey === keyboardEvent.metaKey && listener.shiftKey === keyboardEvent.shiftKey;\n}\n\nfunction keyOrCodeMatches(listener, keyboardEvent) {\n  if (!(keyboardEvent instanceof KeyboardEvent)) {\n    return false;\n  }\n\n  if (listener.keyOrCode === ALL_SYMBOL) {\n    return true;\n  }\n\n  return listener.keyOrCode === keyboardEvent.code || listener.keyOrCode === keyboardEvent.key;\n}\n\nfunction mouseButtonMatches(listener, mouseEvent) {\n  if (!(mouseEvent instanceof MouseEvent)) {\n    return false;\n  }\n\n  if (listener.keyOrCode === ALL_SYMBOL) {\n    return true;\n  }\n\n  return listener.keyOrCode === getMouseName(mouseEvent.button);\n}\n\nfunction specialCaseMatches(keyboardListener, keyboardEvent, platform) {\n  if (onlyModifiers([], keyboardListener) && onlyModifiers(['shift'], keyboardEvent)) {\n    return keyboardEvent.key === keyboardListener.keyOrCode;\n  }\n\n  if (onlyModifiers(['shift'], keyboardListener) && onlyModifiers(['shift'], keyboardEvent)) {\n    return rootKeyForShiftKey(keyboardEvent.key) === keyboardListener.keyOrCode;\n  }\n\n  if (platform === 'Macintosh' && onlyModifiers(['alt'], keyboardListener) && onlyModifiers(['alt'], keyboardEvent)) {\n    return rootKeyForMacAltKey(keyboardEvent.key) === keyboardListener.keyOrCode;\n  }\n\n  if (platform === 'Macintosh' && onlyModifiers(['shift', 'alt'], keyboardListener) && onlyModifiers(['shift', 'alt'], keyboardEvent)) {\n    return rootKeyForMacShiftAltKey(keyboardEvent.key) === keyboardListener.keyOrCode;\n  }\n\n  return false;\n}\n\nconst ALL_MODIFIERS_EXCEPT_CMD = validModifiers.filter(m => m != 'cmd');\n\nfunction onlyModifiers(names, obj) {\n  for (let modifier of ALL_MODIFIERS_EXCEPT_CMD) {\n    if (names.includes(modifier) && !obj[`${modifier}Key`]) {\n      return false;\n    }\n\n    if (!names.includes(modifier) && obj[`${modifier}Key`]) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\nfunction rootKeyForShiftKey(key) {\n  return SHIFT_KEY_MAP[key] || key;\n}\n\nfunction rootKeyForMacAltKey(key) {\n  return MAC_ALT_KEY_MAP[key] || key;\n}\n\nfunction rootKeyForMacShiftAltKey(key) {\n  return MAC_SHIFT_ALT_KEY_MAP[key] || key;\n}\n\nexport { isKey as default };\n","import { _ as _defineProperty } from '../_rollupPluginBabelHelpers-30c82890.js';\nimport getPlatform from './platform.js';\nimport '@ember/debug';\n\nconst ALT_REGEX = /^alt$/i;\nconst SHIFT_REGEX = /^shift$/i;\nconst CTRL_REGEX = /^ctrl$/i;\nconst META_REGEX = /^meta$/i;\nconst CMD_REGEX = /^cmd$/i;\nclass KeyboardListener {\n  // keydown, keyup, keypress\n  constructor(platform = getPlatform()) {\n    _defineProperty(this, \"type\", void 0);\n\n    _defineProperty(this, \"altKey\", false);\n\n    _defineProperty(this, \"ctrlKey\", false);\n\n    _defineProperty(this, \"shiftKey\", false);\n\n    _defineProperty(this, \"metaKey\", false);\n\n    _defineProperty(this, \"keyOrCode\", void 0);\n\n    _defineProperty(this, \"platform\", void 0);\n\n    this.platform = platform;\n  }\n\n  static parse(s, platform = getPlatform()) {\n    let keyboardListener = new KeyboardListener(platform);\n    let [eventType, ...keyCombo] = s.split(':');\n    keyCombo = keyCombo.join(':'); // allow keyCombo contain semicolon\n\n    keyboardListener.type = eventType;\n\n    if (keyCombo === '+') {\n      keyboardListener.keyOrCode = keyCombo;\n      return keyboardListener;\n    }\n\n    keyCombo.split('+').forEach(part => {\n      if (ALT_REGEX.test(part)) {\n        keyboardListener.altKey = true;\n      } else if (CTRL_REGEX.test(part)) {\n        keyboardListener.ctrlKey = true;\n      } else if (META_REGEX.test(part)) {\n        keyboardListener.metaKey = true;\n      } else if (SHIFT_REGEX.test(part)) {\n        keyboardListener.shiftKey = true;\n      } else if (CMD_REGEX.test(part)) {\n        if (platform.indexOf('Mac') > -1) {\n          keyboardListener.metaKey = true;\n        } else {\n          keyboardListener.ctrlKey = true;\n        }\n      } else {\n        keyboardListener.keyOrCode = part;\n      }\n    });\n    return keyboardListener;\n  }\n\n  createMatchingKeyboardEvent(opts = {}) {\n    return new KeyboardEvent(this.type, Object.assign({\n      // one of these next two will be incorrect. For test usage, if usually\n      // doesn't matter, but you can pass in correct values via opts if needed.\n      key: this.keyOrCode,\n      code: this.keyOrCode,\n      altKey: this.altKey,\n      ctrlKey: this.ctrlKey,\n      metaKey: this.metaKey,\n      shiftKey: this.shiftKey\n    }, opts));\n  }\n\n}\n\nexport { KeyboardListener as default };\n","import getCmdKey from './get-cmd-key.js';\n\nfunction sortedKeys(keyArray) {\n  return keyArray.sort().join('+');\n}\n\nfunction listenerName(type, keyArrayOrString = []) {\n  let keyArray = keyArrayOrString;\n\n  if (typeof keyArrayOrString === 'string') {\n    keyArray = keyArrayOrString.split('+');\n  }\n\n  if (keyArray.indexOf('cmd') > -1) {\n    keyArray[keyArray.indexOf('cmd')] = getCmdKey();\n  }\n\n  let keys = sortedKeys(keyArray || []);\n\n  if (keys === '') {\n    keys = '_all';\n  }\n\n  return `${type}:${keys}`;\n}\n\nexport { listenerName as default };\n","function getCmdKey (platform) {\n  if (typeof FastBoot === 'undefined') {\n    if (platform === undefined) {\n      platform = navigator.platform;\n    }\n\n    if (platform.indexOf('Mac') > -1) {\n      return 'meta';\n    } else {\n      return 'ctrl';\n    }\n  }\n}\n\nexport { getCmdKey as default };\n","import { runInDebug } from '@ember/debug';\n\nlet platform;\nfunction getPlatform(userAgent = navigator.userAgent) {\n  // allow mocking of userAgent in tests, memoize for speed in production\n  runInDebug(() => {\n    platform = null;\n  });\n\n  if (!platform) {\n    let osName = 'Unknown OS';\n    if (userAgent.indexOf('Win') != -1) osName = 'Windows';\n    if (userAgent.indexOf('Mac') != -1) osName = 'Macintosh';\n    if (userAgent.indexOf('Linux') != -1) osName = 'Linux';\n    if (userAgent.indexOf('Android') != -1) osName = 'Android';\n    if (userAgent.indexOf('like Mac') != -1) osName = 'iOS';\n    platform = osName;\n  }\n\n  return platform;\n}\n\nexport { getPlatform as default };\n","export default function _defineProperty(obj, key, value) {\n  if (key in obj) {\n    Object.defineProperty(obj, key, {\n      value: value,\n      enumerable: true,\n      configurable: true,\n      writable: true\n    });\n  } else {\n    obj[key] = value;\n  }\n  return obj;\n}","import { capabilities } from '@ember/modifier';\nimport { destroy } from '@ember/destroyable';\nimport { dependencySatisfies } from '@embroider/macros';\nimport type Owner from '@ember/owner';\n\nimport ClassBasedModifier from './modifier';\nimport { ArgsFor, ElementFor } from '../signature';\n\n/**\n * The state bucket used throughout the life-cycle of the modifier. Basically a\n * state *machine*, where the framework calls us with the version we hand back\n * to it at each phase. The two states are the two `extends` versions of this\n * below.\n *\n * @internal\n */\ninterface State<S> {\n  instance: ClassBasedModifier<S>;\n}\n\n/**\n * The `State` after calling `createModifier`, and therefore the state available\n * at the start of `InstallModifier`.\n * @internal\n */\ninterface CreatedState<S> extends State<S> {\n  element: null;\n}\n\n/**\n * The `State` after calling `installModifier`, and therefore the state\n * available in all `updateModifier` calls and in `destroyModifier`.\n * @internal\n */\ninterface InstalledState<S> extends State<S> {\n  element: ElementFor<S>;\n}\n\n// Wraps the unsafe (b/c it mutates, rather than creating new state) code that\n// TS does not yet understand.\nfunction installElement<S>(\n  state: CreatedState<S>,\n  element: ElementFor<S>\n): InstalledState<S> {\n  // SAFETY: this cast represents how we are actually handling the state machine\n  // transition: from this point forward in the lifecycle of the modifier, it\n  // always behaves as `InstalledState<S>`. It is safe because, and *only*\n  // because, we immediately initialize `element`. (We cannot create a new state\n  // from the old one because the modifier manager API expects mutation of a\n  // single state bucket rather than updating it at hook calls.)\n  const installedState = state as State<S> as InstalledState<S>;\n  installedState.element = element;\n  return installedState;\n}\n\nexport default class ClassBasedModifierManager<S> {\n  capabilities = capabilities(\n    dependencySatisfies('ember-source', '>=3.22.0') ? '3.22' : '3.13'\n  );\n\n  constructor(private owner: Owner) {}\n\n  createModifier(\n    modifierClass: typeof ClassBasedModifier,\n    args: ArgsFor<S>\n  ): CreatedState<S> {\n    const instance = new modifierClass(this.owner, args);\n    return { instance, element: null };\n  }\n\n  installModifier(\n    createdState: CreatedState<S>,\n    element: ElementFor<S>,\n    args: ArgsFor<S>\n  ): void {\n    const state = installElement(createdState, element);\n    state.instance.modify(element, args.positional, args.named);\n  }\n\n  updateModifier(state: InstalledState<S>, args: ArgsFor<S>): void {\n    state.instance.modify(state.element, args.positional, args.named);\n  }\n\n  destroyModifier({ instance }: InstalledState<S>): void {\n    destroy(instance);\n  }\n}\n","import { setOwner } from '@ember/application';\nimport { setModifierManager } from '@ember/modifier';\nimport type Owner from '@ember/owner';\nimport Manager from './modifier-manager';\nimport {\n  ElementFor,\n  ArgsFor,\n  DefaultSignature,\n  PositionalArgs,\n  NamedArgs,\n} from '../signature';\nimport Opaque from '../opaque';\n\n// Preserve the signature on a class-based modifier so it can be plucked off\n// later (by e.g. Glint), using interface merging with an opaque item to\n// preserve it in the type system. The fact that it's an empty interface is\n// actually the point: it *only* hooks the type parameter into the opaque\n// (nominal) type. Note that this is distinct from the function-based modifier\n// type intentionally, because it is actually the static class side of a\n// class-based modifier which corresponds to the result of calling `modifier()`\n// with a callback defining a function-based modifier.\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport default interface ClassBasedModifier<S = DefaultSignature>\n  extends Opaque<S> {}\n\n/**\n * A base class for modifiers which need more capabilities than function-based\n * modifiers. Useful if, for example:\n *\n * 1. You need to inject services and access them\n * 2. You need fine-grained control of updates, either for performance or\n *    convenience reasons, and don't want to teardown the state of your modifier\n *    every time only to set it up again.\n * 3. You need to store some local state within your modifier.\n *\n * The lifecycle hooks of class modifiers are tracked. When they run, they any\n * values they access will be added to the modifier, and the modifier will\n * update if any of those values change.\n */\nexport default class ClassBasedModifier<S = DefaultSignature> {\n  // `args` is passed here for the sake of subclasses to have access to args in\n  // their constructors while having constructors which are properly asssignable\n  // for the superclass.\n  /**\n   *\n   * @param owner An instance of an Owner (for service injection etc.).\n   * @param args The positional and named arguments passed to the modifier.\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  constructor(owner: Owner, args: ArgsFor<S>) {\n    setOwner(this, owner);\n  }\n\n  /**\n   * Called when the modifier is installed and any time any tracked state used\n   * in the modifier changes.\n   *\n   * If you need to do first-time-only setup, create a class field representing\n   * the initialization state and check it when running the hook. That is also\n   * where and when you should use `registerDestructor` for any teardown you\n   * need to do. For example:\n   *\n   * ```js\n   * function disconnect(instance) {\n   *  instance.observer?.disconnect();\n   * }\n   *\n   * class IntersectionObserver extends Modifier {\n   *   observer;\n   *\n   *   constructor(owner, args) {\n   *     super(owner, args);\n   *     registerDestructor(this, disconnect);\n   *   }\n   *\n   *   modify(element, callback, options) {\n   *     disconnect(this);\n   *\n   *     this.observer = new IntersectionObserver(callback, options);\n   *     this.observer.observe(element);\n   *   }\n   * }\n   * ```\n   *\n   * @param element The element to which the modifier is applied.\n   * @param positional The positional arguments to the modifier.\n   * @param named The named arguments to the modifier.\n   */\n  modify(\n    /* eslint-disable @typescript-eslint/no-unused-vars */\n    element: ElementFor<S>,\n    positional: PositionalArgs<S>,\n    named: NamedArgs<S>\n    /* eslint-enable @typescript-eslint/no-unused-vars */\n  ): void {\n    /* no op, for subclassing */\n  }\n}\n\nsetModifierManager((owner) => new Manager(owner), ClassBasedModifier);\n","import { setModifierManager } from '@ember/modifier';\nimport {\n  ElementFor,\n  EmptyObject,\n  NamedArgs,\n  PositionalArgs,\n} from '../signature';\nimport Modifier from '../class-based/modifier';\nimport FunctionBasedModifierManager from './modifier-manager';\n\n// Provide a singleton manager.\nconst MANAGER = new FunctionBasedModifierManager();\n\n// This type exists to provide a non-user-constructible, non-subclassable\n// type representing the conceptual \"instance type\" of a function modifier.\n// The abstract field of type `never` prevents subclassing in userspace of\n// the value returned from `modifier()`. By extending `Modifier<S>`, any\n// augmentations of the `Modifier` type performed by tools like Glint will\n// also apply to function-based modifiers as well.\nexport declare abstract class FunctionBasedModifierInstance<\n  S\n> extends Modifier<S> {\n  protected abstract __concrete__: never;\n}\n\n// This provides a type whose only purpose here is to represent the runtime\n// type of a function-based modifier: a virtually opaque item. The fact that it's\n// a bare constructor type allows `modifier()` to preserve type parameters from\n// a generic function it's passed, and by making it abstract and impossible to\n// subclass (see above) we prevent users from attempting to instantiate the return\n// value from a `modifier()` call.\nexport type FunctionBasedModifier<S> =\n  abstract new () => FunctionBasedModifierInstance<S>;\n\n/**\n * The (optional) return type for a modifier which needs to perform some kind of\n * cleanup or teardown -- for example, removing an event listener from an\n * element besides the one passed into the modifier.\n */\nexport type Teardown = () => unknown;\n\n/**\n * An API for writing simple modifiers.\n *\n * This function runs the first time when the element the modifier was applied\n * to is inserted into the DOM, and it *autotracks* while running. Any values\n * that it accesses will be tracked, including any of its arguments that it\n * accesses, and if any of them changes, the function will run again.\n *\n * **Note:** this will *not* automatically rerun because an argument changes. It\n * will only rerun if it is *using* that argument (the same as with auto-tracked\n * state in general).\n *\n * The modifier can also optionally return a *destructor*. The destructor\n * function will be run just before the next update, and when the element is\n * being removed entirely. It should generally clean up the changes that the\n * modifier made in the first place.\n *\n * @param fn The function which defines the modifier.\n */\n// This overload allows users to write types directly on the callback passed to\n// the `modifier` function and infer the resulting type correctly.\nexport default function modifier<\n  E extends Element,\n  P extends unknown[],\n  N = EmptyObject\n>(\n  fn: (element: E, positional: P, named: N) => void | Teardown\n): FunctionBasedModifier<{\n  Args: {\n    Positional: P;\n    Named: N;\n  };\n  Element: E;\n}>;\n\n/**\n * An API for writing simple modifiers.\n *\n * This function runs the first time when the element the modifier was applied\n * to is inserted into the DOM, and it *autotracks* while running. Any values\n * that it accesses will be tracked, including any of its arguments that it\n * accesses, and if any of them changes, the function will run again.\n *\n * **Note:** this will *not* automatically rerun because an argument changes. It\n * will only rerun if it is *using* that argument (the same as with auto-tracked\n * state in general).\n *\n * The modifier can also optionally return a *destructor*. The destructor\n * function will be run just before the next update, and when the element is\n * being removed entirely. It should generally clean up the changes that the\n * modifier made in the first place.\n *\n * @param fn The function which defines the modifier.\n */\n// This overload allows users to provide a `Signature` type explicitly at the\n// modifier definition site, e.g. `modifier<Sig>((el, pos, named) => {...})`.\n// **Note:** this overload must appear second, since TS' inference engine will\n// not correctly infer the type of `S` here from the types on the supplied\n// callback.\nexport default function modifier<S>(\n  fn: (\n    element: ElementFor<S>,\n    positional: PositionalArgs<S>,\n    named: NamedArgs<S>\n  ) => void | Teardown\n): FunctionBasedModifier<{\n  Element: ElementFor<S>;\n  Args: {\n    Named: NamedArgs<S>;\n    Positional: PositionalArgs<S>;\n  };\n}>;\n\n// This is the runtime signature; it performs no inference whatsover and just\n// uses the simplest version of the invocation possible since, for the case of\n// setting it on the modifier manager, we don't *need* any of that info, and\n// the two previous overloads capture all invocations from a type perspective.\nexport default function modifier(\n  fn: (\n    element: Element,\n    positional: unknown[],\n    named: object\n  ) => void | Teardown\n): FunctionBasedModifier<{\n  Element: Element;\n  Args: {\n    Named: object;\n    Positional: unknown[];\n  };\n}> {\n  // SAFETY: the cast here is a *lie*, but it is a useful one. The actual return\n  // type of `setModifierManager` today is `void`; we pretend it actually\n  // returns an opaque `Modifier` type so that we can provide a result from this\n  // type which is useful to TS-aware tooling (e.g. Glint).\n  return setModifierManager(\n    () => MANAGER,\n    fn\n  ) as unknown as FunctionBasedModifier<{\n    Element: Element;\n    Args: {\n      Named: object;\n      Positional: unknown[];\n    };\n  }>;\n}\n\n/**\n * @internal\n */\nexport type FunctionBasedModifierDefinition<S> = (\n  element: ElementFor<S>,\n  positional: PositionalArgs<S>,\n  named: NamedArgs<S>\n) => void | Teardown;\n","import { capabilities } from '@ember/modifier';\nimport { dependencySatisfies } from '@embroider/macros';\nimport type { FunctionBasedModifierDefinition, Teardown } from './modifier';\nimport type { ArgsFor, ElementFor } from '../signature';\n\ninterface State<S> {\n  instance: FunctionBasedModifierDefinition<S>;\n}\n\ninterface CreatedState<S> extends State<S> {\n  element: null;\n}\n\ninterface InstalledState<S> extends State<S> {\n  element: ElementFor<S>;\n  teardown?: Teardown;\n}\n\n// Wraps the unsafe (b/c it mutates, rather than creating new state) code that\n// TS does not yet understand.\nfunction installElement<S>(\n  state: CreatedState<S>,\n  element: ElementFor<S>\n): InstalledState<S> {\n  // SAFETY: this cast represents how we are actually handling the state machine\n  // transition: from this point forward in the lifecycle of the modifier, it\n  // always behaves as `InstalledState<S>`. It is safe because, and *only*\n  // because, we immediately initialize `element`. (We cannot create a new state\n  // from the old one because the modifier manager API expects mutation of a\n  // single state bucket rather than updating it at hook calls.)\n  const installedState = state as State<S> as InstalledState<S>;\n  installedState.element = element;\n  return installedState;\n}\n\nexport default class FunctionBasedModifierManager<S> {\n  capabilities = capabilities(\n    dependencySatisfies('ember-source', '>=3.22.0') ? '3.22' : '3.13'\n  );\n\n  createModifier(\n    instance: FunctionBasedModifierDefinition<S>\n  ): CreatedState<S> {\n    return { element: null, instance };\n  }\n\n  installModifier(\n    createdState: CreatedState<S>,\n    element: ElementFor<S>,\n    args: ArgsFor<S>\n  ): void {\n    const state = installElement(createdState, element);\n\n    const { positional, named } = args;\n    const teardown = createdState.instance(element, positional, named);\n    if (typeof teardown === 'function') {\n      state.teardown = teardown;\n    }\n  }\n\n  updateModifier(state: InstalledState<S>, args: ArgsFor<S>): void {\n    if (typeof state.teardown === 'function') {\n      state.teardown();\n    }\n\n    const teardown = state.instance(state.element, args.positional, args.named);\n    if (typeof teardown === 'function') {\n      state.teardown = teardown;\n    }\n  }\n\n  destroyModifier(state: InstalledState<S>): void {\n    if (typeof state.teardown === 'function') {\n      state.teardown();\n    }\n  }\n}\n","import { isBlank } from '@ember/utils';\n\nfunction computeFn (cb) {\n  return function (params, hash) {\n    if (!params || params && params.length === 0) {\n      throw new TypeError('ember-moment: Invalid Number of arguments, expected at least 1');\n    }\n\n    const datetime = params[0];\n    let allowEmpty = hash.allowEmpty || hash['allow-empty'];\n\n    if (allowEmpty === undefined || allowEmpty === null) {\n      allowEmpty = this.globalAllowEmpty;\n    }\n\n    if (isBlank(datetime)) {\n      if (allowEmpty) {\n        return;\n      }\n      /* eslint-disable no-console */\n\n\n      console.warn(`ember-moment: an empty value (null, undefined, or \"\") was passed to ember-moment helper`);\n    }\n\n    return cb.apply(this, arguments);\n  };\n}\n\nexport { computeFn as c };\n","import { run } from '@ember/runloop';\nimport Helper from '@ember/component/helper';\nimport { observer } from '@ember/object';\nimport { inject } from '@ember/service';\n\nvar BaseHelper = Helper.extend({\n  moment: inject(),\n  disableInterval: false,\n\n  get globalAllowEmpty() {\n    return this.moment.__config__.allowEmpty;\n  },\n\n  supportsGlobalAllowEmpty: true,\n  // eslint-disable-next-line ember/no-observers\n  localeOrTimeZoneChanged: observer('moment.locale', 'moment.timeZone', function () {\n    this.recompute();\n  }),\n\n  compute(value, {\n    interval\n  }) {\n    if (this.disableInterval) {\n      return;\n    }\n\n    this.clearTimer();\n\n    if (interval) {\n      /*\n       * NOTE: intentionally a setTimeout so tests do not block on it\n       * as the run loop queue is never clear so tests will stay locked waiting\n       * for queue to clear.\n       */\n      this.intervalTimer = setTimeout(() => {\n        run(() => this.recompute());\n      }, parseInt(interval, 10));\n    }\n  },\n\n  morphMoment(time, {\n    locale,\n    timeZone\n  }) {\n    const momentService = this.moment;\n    locale = locale || momentService.locale;\n    timeZone = timeZone || momentService.timeZone;\n\n    if (locale && time.locale) {\n      time = time.locale(locale);\n    }\n\n    if (timeZone && time.tz) {\n      time = time.tz(timeZone);\n    }\n\n    return time;\n  },\n\n  clearTimer() {\n    clearTimeout(this.intervalTimer);\n  },\n\n  destroy() {\n    this.clearTimer();\n\n    this._super(...arguments);\n  }\n\n});\n\nexport { BaseHelper as default };\n","import BaseHelper from './-base.js';\nimport { c as computeFn } from '../helper-compute-36ed98e8.js';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/object';\nimport '@ember/service';\nimport '@ember/utils';\n\nvar isAfter = BaseHelper.extend({\n  compute: computeFn(function (params, {\n    precision,\n    locale,\n    timeZone\n  }) {\n    this._super(...arguments);\n\n    const moment = this.moment;\n    const {\n      length\n    } = params;\n    const args = [];\n    const comparisonArgs = [];\n\n    if (length === 1) {\n      comparisonArgs.push(params[0]);\n    } else if (length === 2) {\n      args.push(params[0]);\n      comparisonArgs.push(params[1]);\n    }\n\n    return this.morphMoment(moment.moment(...args), {\n      locale,\n      timeZone\n    }).isAfter(...comparisonArgs, precision);\n  })\n});\n\nexport { isAfter as default };\n","import { c as computeFn } from '../helper-compute-36ed98e8.js';\nimport BaseHelper from './-base.js';\nimport '@ember/utils';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/object';\nimport '@ember/service';\n\nvar isBefore = BaseHelper.extend({\n  compute: computeFn(function (params, {\n    precision,\n    locale,\n    timeZone\n  }) {\n    this._super(...arguments);\n\n    const moment = this.moment;\n    const {\n      length\n    } = params;\n    const args = [];\n    const comparisonArgs = [];\n\n    if (length === 1) {\n      comparisonArgs.push(params[0]);\n    } else if (length === 2) {\n      args.push(params[0]);\n      comparisonArgs.push(params[1]);\n    }\n\n    return this.morphMoment(moment.moment(...args), {\n      locale,\n      timeZone\n    }).isBefore(...comparisonArgs, precision);\n  })\n});\n\nexport { isBefore as default };\n","import { c as computeFn } from '../helper-compute-36ed98e8.js';\nimport BaseHelper from './-base.js';\nimport '@ember/utils';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/object';\nimport '@ember/service';\n\nvar isBetween = BaseHelper.extend({\n  compute: computeFn(function (params, {\n    precision,\n    inclusivity,\n    locale,\n    timeZone\n  }) {\n    this._super(...arguments);\n\n    const moment = this.moment;\n\n    const _params = [].concat(params);\n\n    const {\n      length\n    } = params;\n\n    if (length < 2 || length > 3) {\n      throw new TypeError('ember-moment: Invalid Number of arguments, expected 2 or 3');\n    }\n\n    const args = [];\n\n    if (length > 2) {\n      args.push(_params.shift());\n    }\n\n    return this.morphMoment(moment.moment(...args), {\n      locale,\n      timeZone\n    }).isBetween(..._params, precision, inclusivity);\n  })\n});\n\nexport { isBetween as default };\n","import { c as computeFn } from '../helper-compute-36ed98e8.js';\nimport BaseHelper from './-base.js';\nimport '@ember/utils';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/object';\nimport '@ember/service';\n\nvar isSameOrAfter = BaseHelper.extend({\n  compute: computeFn(function (params, {\n    precision,\n    locale,\n    timeZone\n  }) {\n    this._super(...arguments);\n\n    const moment = this.moment;\n    const {\n      length\n    } = params;\n    const args = [];\n    const comparisonArgs = [];\n\n    if (length === 1) {\n      comparisonArgs.push(params[0]);\n    } else if (length === 2) {\n      args.push(params[0]);\n      comparisonArgs.push(params[1]);\n    }\n\n    return this.morphMoment(moment.moment(...args), {\n      locale,\n      timeZone\n    }).isSameOrAfter(...comparisonArgs, precision);\n  })\n});\n\nexport { isSameOrAfter as default };\n","import { c as computeFn } from '../helper-compute-36ed98e8.js';\nimport BaseHelper from './-base.js';\nimport '@ember/utils';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/object';\nimport '@ember/service';\n\nvar isSameOrBefore = BaseHelper.extend({\n  compute: computeFn(function (params, {\n    precision,\n    locale,\n    timeZone\n  }) {\n    this._super(...arguments);\n\n    const moment = this.moment;\n    const {\n      length\n    } = params;\n    const args = [];\n    const comparisonArgs = [];\n\n    if (length === 1) {\n      comparisonArgs.push(params[0]);\n    } else if (length === 2) {\n      args.push(params[0]);\n      comparisonArgs.push(params[1]);\n    }\n\n    return this.morphMoment(moment.moment(...args), {\n      locale,\n      timeZone\n    }).isSameOrBefore(...comparisonArgs, precision);\n  })\n});\n\nexport { isSameOrBefore as default };\n","import { c as computeFn } from '../helper-compute-36ed98e8.js';\nimport BaseHelper from './-base.js';\nimport '@ember/utils';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/object';\nimport '@ember/service';\n\nvar isSame = BaseHelper.extend({\n  compute: computeFn(function (params, {\n    precision,\n    locale,\n    timeZone\n  }) {\n    this._super(...arguments);\n\n    const moment = this.moment;\n    const {\n      length\n    } = params;\n    const args = [];\n    const comparisonArgs = [];\n\n    if (length === 1) {\n      comparisonArgs.push(params[0]);\n    } else if (length === 2) {\n      args.push(params[0]);\n      comparisonArgs.push(params[1]);\n    }\n\n    return this.morphMoment(moment.moment(...args), {\n      locale,\n      timeZone\n    }).isSame(...comparisonArgs, precision);\n  })\n});\n\nexport { isSame as default };\n","import { typeOf } from '@ember/utils';\nimport { c as computeFn } from '../helper-compute-36ed98e8.js';\nimport BaseHelper from './-base.js';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/object';\nimport '@ember/service';\n\nvar momentAdd = BaseHelper.extend({\n  compute: computeFn(function (params, {\n    precision,\n    locale,\n    timeZone\n  }) {\n    this._super(...arguments);\n\n    const moment = this.moment;\n    const {\n      length\n    } = params;\n    const args = [];\n    const additionArgs = [];\n\n    if (length === 1) {\n      additionArgs.push(params[0]);\n    } else if (length === 2 && typeOf(params[0]) === 'number' && typeOf(params[1]) === 'string') {\n      additionArgs.push(...params);\n    } else {\n      args.push(params[0]);\n      additionArgs.push(...params.slice(1));\n    }\n\n    return this.morphMoment(moment.moment(...args), {\n      locale,\n      timeZone\n    }).add(...additionArgs, precision);\n  })\n});\n\nexport { momentAdd as default };\n","import { c as computeFn } from '../helper-compute-36ed98e8.js';\nimport BaseHelper from './-base.js';\nimport '@ember/utils';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/object';\nimport '@ember/service';\n\nvar momentCalendar = BaseHelper.extend({\n  compute: computeFn(function (params, formatHash = {}) {\n    this._super(...arguments);\n\n    if (!params || params && params.length > 3) {\n      throw new TypeError('ember-moment: Invalid Number of arguments, at most 3');\n    }\n\n    const moment = this.moment;\n    const {\n      locale,\n      timeZone\n    } = formatHash;\n    const [date, referenceTime, formats] = params;\n    const mergedFormats = { ...formatHash,\n      locale: null,\n      timeZone: null,\n      ...formats\n    };\n    return this.morphMoment(moment.moment(date), {\n      locale,\n      timeZone\n    }).calendar(referenceTime, mergedFormats);\n  })\n});\n\nexport { momentCalendar as default };\n","import { c as computeFn } from '../helper-compute-36ed98e8.js';\nimport BaseHelper from './-base.js';\nimport '@ember/utils';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/object';\nimport '@ember/service';\n\nvar momentDiff = BaseHelper.extend({\n  compute: computeFn(function (params, {\n    precision,\n    float,\n    locale,\n    timeZone\n  }) {\n    this._super(...arguments);\n\n    if (!params || params && params.length !== 2) {\n      throw new TypeError('ember-moment: Invalid Number of arguments, must be 2');\n    }\n\n    const moment = this.moment;\n    const [dateA, dateB] = params;\n    return this.morphMoment(moment.moment(dateB), {\n      locale,\n      timeZone\n    }).diff(dateA, precision, float);\n  })\n});\n\nexport { momentDiff as default };\n","import BaseHelper from './-base.js';\nimport { momentOrMomentTimezone } from '../index.js';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/object';\nimport '@ember/service';\nimport '@embroider/macros';\n\nvar momentDuration = BaseHelper.extend({\n  compute(params, {\n    locale,\n    timeZone\n  }) {\n    this._super(...arguments);\n\n    const momentService = this.moment;\n\n    if (!params || params && params.length > 2) {\n      throw new TypeError('ember-moment: Invalid Number of arguments, at most 2');\n    }\n\n    const result = momentService.moment(momentOrMomentTimezone.duration(...params));\n    return this.morphMoment(result._i, {\n      locale,\n      timeZone\n    }).humanize();\n  }\n\n});\n\nexport { momentDuration as default };\n","import { isEmpty } from '@ember/utils';\nimport { observer, get } from '@ember/object';\nimport { c as computeFn } from '../helper-compute-36ed98e8.js';\nimport BaseHelper from './-base.js';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/service';\n\nvar momentFormat = BaseHelper.extend({\n  // eslint-disable-next-line ember/no-observers\n  defaultFormatDidChange: observer('moment.defaultFormat', function () {\n    this.recompute();\n  }),\n  compute: computeFn(function (params, {\n    locale,\n    timeZone\n  }) {\n    this._super(...arguments);\n\n    const moment = this.moment;\n    const {\n      length\n    } = params;\n\n    if (length > 3) {\n      throw new TypeError('ember-moment: Invalid number of arguments, expected at most 3');\n    }\n\n    const args = [];\n    const formatArgs = []; // eslint-disable-next-line ember/no-get\n\n    const defaultFormat = get(this, 'moment.defaultFormat');\n    args.push(params[0]);\n\n    if (length === 1 && !isEmpty(defaultFormat)) {\n      formatArgs.push(defaultFormat);\n    } else if (length === 2) {\n      formatArgs.push(params[1]);\n    } else if (length > 2) {\n      args.push(params[2]);\n      formatArgs.push(params[1]);\n    }\n\n    return this.morphMoment(moment.moment(...args), {\n      locale,\n      timeZone\n    }).format(...formatArgs);\n  })\n});\n\nexport { momentFormat as default };\n","import { c as computeFn } from '../helper-compute-36ed98e8.js';\nimport BaseHelper from './-base.js';\nimport '@ember/utils';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/object';\nimport '@ember/service';\n\nvar momentFromNow = BaseHelper.extend({\n  compute: computeFn(function (params, {\n    hideAffix,\n    locale,\n    timeZone\n  }) {\n    this._super(...arguments);\n\n    const moment = this.moment;\n    return this.morphMoment(moment.moment(...params), {\n      locale,\n      timeZone\n    }).fromNow(hideAffix);\n  })\n});\n\nexport { momentFromNow as default };\n","import { c as computeFn } from '../helper-compute-36ed98e8.js';\nimport BaseHelper from './-base.js';\nimport '@ember/utils';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/object';\nimport '@ember/service';\n\nvar momentFrom = BaseHelper.extend({\n  compute: computeFn(function ([datetime, ...params], {\n    hideAffix,\n    locale,\n    timeZone\n  }) {\n    this._super(...arguments);\n\n    const moment = this.moment;\n    return this.morphMoment(moment.moment(datetime), {\n      locale,\n      timeZone\n    }).from(...params, hideAffix);\n  })\n});\n\nexport { momentFrom as default };\n","import { typeOf } from '@ember/utils';\nimport { c as computeFn } from '../helper-compute-36ed98e8.js';\nimport BaseHelper from './-base.js';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/object';\nimport '@ember/service';\n\nvar momentSubtract = BaseHelper.extend({\n  compute: computeFn(function (params, {\n    precision,\n    locale,\n    timeZone\n  }) {\n    this._super(...arguments);\n\n    const moment = this.moment;\n    const {\n      length\n    } = params;\n    const args = [];\n    const subtractionArgs = [];\n\n    if (length === 1) {\n      subtractionArgs.push(params[0]);\n    } else if (length === 2 && typeOf(params[0]) === 'number' && typeOf(params[1]) === 'string') {\n      subtractionArgs.push(...params);\n    } else {\n      args.push(params[0]);\n      subtractionArgs.push(...params.slice(1));\n    }\n\n    return this.morphMoment(moment.moment(...args), {\n      locale,\n      timeZone\n    }).subtract(...subtractionArgs, precision);\n  })\n});\n\nexport { momentSubtract as default };\n","import { c as computeFn } from '../helper-compute-36ed98e8.js';\nimport BaseHelper from './-base.js';\nimport '@ember/utils';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/object';\nimport '@ember/service';\n\nvar momentToDate = BaseHelper.extend({\n  compute: computeFn(function (params, {\n    hidePrefix,\n    locale,\n    timeZone\n  }) {\n    this._super(...arguments);\n\n    const moment = this.moment;\n    return this.morphMoment(moment.moment(), {\n      locale,\n      timeZone\n    }).to(...params, hidePrefix);\n  })\n});\n\nexport { momentToDate as default };\n","import { c as computeFn } from '../helper-compute-36ed98e8.js';\nimport BaseHelper from './-base.js';\nimport '@ember/utils';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/object';\nimport '@ember/service';\n\nvar momentToNow = BaseHelper.extend({\n  compute: computeFn(function (params, {\n    hideAffix,\n    locale,\n    timeZone\n  }) {\n    this._super(...arguments);\n\n    const moment = this.moment;\n    const hide = hideAffix;\n    return this.morphMoment(moment.moment(...params), {\n      locale,\n      timeZone\n    }).toNow(hide);\n  })\n});\n\nexport { momentToNow as default };\n","import { c as computeFn } from '../helper-compute-36ed98e8.js';\nimport BaseHelper from './-base.js';\nimport '@ember/utils';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/object';\nimport '@ember/service';\n\nvar momentTo = BaseHelper.extend({\n  compute: computeFn(function ([datetime, ...params], {\n    hideAffix,\n    locale,\n    timeZone\n  }) {\n    this._super(...arguments);\n\n    const moment = this.moment;\n    return this.morphMoment(moment.moment(datetime), {\n      locale,\n      timeZone\n    }).to(...params, hideAffix);\n  })\n});\n\nexport { momentTo as default };\n","import BaseHelper from './-base.js';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/object';\nimport '@ember/service';\n\nvar moment = BaseHelper.extend({\n  compute(params, {\n    locale,\n    timeZone\n  }) {\n    this._super(...arguments);\n\n    const moment = this.moment;\n    return this.morphMoment(moment.moment(...params), {\n      locale,\n      timeZone\n    });\n  }\n\n});\n\nexport { moment as default };\n","import { momentOrMomentTimezone } from '../index.js';\nimport BaseHelper from './-base.js';\nimport '@embroider/macros';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/object';\nimport '@ember/service';\n\nvar now = BaseHelper.extend({\n  compute() {\n    this._super(...arguments);\n\n    const momentService = this.moment;\n    return momentService.moment(momentOrMomentTimezone.now());\n  }\n\n});\n\nexport { now as default };\n","import { momentOrMomentTimezone } from '../index.js';\nimport BaseHelper from './-base.js';\nimport '@embroider/macros';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/object';\nimport '@ember/service';\n\nvar unix = BaseHelper.extend({\n  compute([unixTimeStamp]) {\n    this._super(...arguments);\n\n    return this.moment.moment(momentOrMomentTimezone.unix(unixTimeStamp));\n  }\n\n});\n\nexport { unix as default };\n","import { momentOrMomentTimezone } from '../index.js';\nimport BaseHelper from './-base.js';\nimport '@embroider/macros';\nimport '@ember/runloop';\nimport '@ember/component/helper';\nimport '@ember/object';\nimport '@ember/service';\n\nvar utc = BaseHelper.extend({\n  compute([utcTime, format]) {\n    this._super(...arguments);\n\n    return this.moment.utc(momentOrMomentTimezone.utc(utcTime, format));\n  }\n\n});\n\nexport { utc as default };\n","import { macroCondition, dependencySatisfies, importSync } from '@embroider/macros';\n\n//\n// Apps shouldn't need to use this, because they should pick one or the other\n// and import it directly.\n//\n// An addon that depends on ember-moment and needs moment-timezone should\n// declare a peerDep on moment-timezone and import moment-timezone directly, and\n// therefore the addon should not need to use this.\n//\n// An addon that depends on ember-moment and doesn't care about timezone\n// features should declare optional peerDeps on both moment and moment-timezone,\n// allowing the app to pick either. In this scenario, the addon may want to use\n// this to get convenient access to whichever the app picked.\n\nconst momentOrMomentTimezone = (() => {\n  if (macroCondition(dependencySatisfies('moment-timezone', '*'))) {\n    return importSync('moment-timezone').default;\n  } else if (macroCondition(dependencySatisfies('moment', '*'))) {\n    return importSync('moment').default;\n  } else {\n    throw new Error(`ember-moment was unable to detect either moment-timezone or moment. Please add one of those to your app.`);\n  }\n})();\n\nexport { momentOrMomentTimezone };\n","import Service from '@ember/service';\nimport Evented from '@ember/object/evented';\nimport { getOwner } from '@ember/application';\nimport { momentOrMomentTimezone } from '../index.js';\nimport { computed, set, setProperties } from '@ember/object';\nimport '@embroider/macros';\n\nvar moment = Service.extend(Evented, {\n  _timeZone: null,\n  locale: null,\n  localeOptions: null,\n  defaultFormat: null,\n\n  init() {\n    this._super();\n\n    this.defaultFormat = this.__config__.outputFormat;\n  },\n\n  __config__: computed(function () {\n    let config = getOwner(this).factoryFor('config:environment').class || {};\n    return config['ember-moment'] || {};\n  }).readOnly(),\n  timeZone: computed('_timeZone', {\n    get() {\n      return this._timeZone;\n    },\n\n    set(propertyKey, timeZone) {\n      if (!momentOrMomentTimezone.tz) {\n        /* eslint-disable no-console */\n        console.warn('[ember-moment] attempted to set timezone, but moment-timezone is not setup.');\n        return;\n      }\n\n      set(this, '_timeZone', timeZone);\n      return timeZone;\n    }\n\n  }),\n\n  setLocale(locale) {\n    this.changeLocale(locale);\n  },\n\n  updateLocale(locale, localeOptions = {}) {\n    this.changeLocale(locale, localeOptions);\n  },\n\n  changeLocale(locale, localeOptions = {}) {\n    setProperties(this, {\n      locale,\n      localeOptions\n    });\n    momentOrMomentTimezone.updateLocale(locale, localeOptions);\n    this.trigger('localeChanged', locale);\n  },\n\n  setTimeZone(timeZone) {\n    this.changeTimeZone(timeZone);\n  },\n\n  changeTimeZone(timeZone) {\n    set(this, 'timeZone', timeZone);\n    this.trigger('timeZoneChanged', timeZone);\n  },\n\n  isMoment(obj) {\n    return momentOrMomentTimezone.isMoment(obj);\n  },\n\n  moment() {\n    let momentObj = momentOrMomentTimezone(...arguments);\n    let {\n      locale,\n      timeZone\n    } = this;\n\n    if (locale && momentObj.locale) {\n      momentObj = momentObj.locale(locale);\n    }\n\n    if (timeZone && momentObj.tz) {\n      momentObj = momentObj.tz(timeZone);\n    }\n\n    return momentObj;\n  },\n\n  utc() {\n    let momentObj = momentOrMomentTimezone.utc(...arguments);\n    let {\n      locale\n    } = this;\n\n    if (locale && momentObj.locale) {\n      momentObj = momentObj.locale(locale);\n    }\n\n    return momentObj;\n  }\n\n});\n\nexport { moment as default };\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"<input\\n  {{pikaday\\n    @options\\n    value=this.value\\n    onSelect=this.onSelect\\n    setDefaultDate=true\\n    defaultDate=@defaultDate\\n    onOpen=@onOpen\\n    onDraw=this.onDraw\\n    onClose=this.onClose\\n    format=this.format\\n    minDate=@minDate\\n    maxDate=@maxDate\\n    theme=@theme\\n    yearRange=this.yearRange\\n    i18n=this.i18n\\n    firstDay=this.firstDay\\n    container=@container\\n    bound=@bound\\n    register=@register\\n  }}\\n  {{on \\'change\\' this.didChange}}\\n  type=\\'text\\'\\n  readonly={{@readonly}}\\n  placeholder={{@placeholder}}\\n  required={{@required}}\\n  disabled={{@disabled}}\\n  autocomplete={{@autocomplete}}\\n  ...attributes\\n/>\")","import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { findMoment } from '../find-moment';\nconst moment = findMoment();\n\nexport default class PikadayInputComponent extends Component {\n  constructor(owner, args) {\n    super(owner, args);\n  }\n\n  get moment() {\n    return this.args.moment || moment;\n  }\n\n  get format() {\n    return this.args.format || 'DD.MM.YYYY';\n  }\n\n  get value() {\n    let { value, useUTC } = this.args;\n    let moment = this.moment;\n    if (useUTC && value) {\n      let format = 'YYYY-MM-DD';\n      value = moment(moment.utc(value).format(format), format).toDate();\n    }\n    return value;\n  }\n\n  get yearRange() {\n    const yearRange = this.args.yearRange;\n    if (!yearRange) {\n      return 10;\n    }\n    if (yearRange.indexOf(',') > -1) {\n      const yearArray = yearRange.split(',');\n      if (yearArray[1] === 'currentYear') {\n        yearArray[1] = new Date().getFullYear();\n      }\n      return yearArray;\n    } else {\n      return yearRange;\n    }\n  }\n\n  get i18n() {\n    let i18n = this.args.i18n;\n    if (!i18n) {\n      return undefined;\n    }\n    if (!i18n.t) {\n      return i18n;\n    }\n    return {\n      previousMonth: i18n.t('previousMonth').toString(),\n      nextMonth: i18n.t('nextMonth').toString(),\n      months: i18n.t('months').toString().split(','),\n      weekdays: i18n.t('weekdays').toString().split(','),\n      weekdaysShort: i18n.t('weekdaysShort').toString().split(','),\n    };\n  }\n\n  get firstDay() {\n    return this.args.firstDay == null ? 1 : parseInt(this.args.firstDay, 10);\n  }\n\n  @action\n  onClose() {\n    if (this.isDestroying) {\n      return;\n    }\n    if (!this.#heardValue) {\n      this.onSelect(null);\n    }\n    this.args.onClose?.();\n  }\n\n  #heardValue;\n\n  @action\n  onDraw() {\n    // this is here because apparently the classic behavior is to pass no\n    // arguments to the onDraw callback, but Pikaday's own ownDraw has an\n    // argument.\n    this.args.onDraw?.();\n  }\n\n  @action\n  didChange(event) {\n    this.#heardValue = event.target.value;\n  }\n\n  @action\n  onSelect(date) {\n    if (this.args.useUTC && date) {\n      date = this.moment\n        .utc([date.getFullYear(), date.getMonth(), date.getDate()])\n        .toDate();\n    }\n    this.args.onSelection?.(date);\n  }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"<div ...attributes>\\n  {{#if this.container}}\\n    <PikadayInput\\n      type=\\'hidden\\'\\n      class=\\'ember-pikaday-input\\'\\n      @bound={{false}}\\n      @container={{this.container}}\\n      @defaultDate={{@defaultDate}}\\n      @onSelection={{@onSelection}}\\n      @options={{@options}}\\n      @maxDate={{@maxDate}}\\n      @minDate={{@minDate}}\\n      @onOpen={{@onOpen}}\\n      @theme={{@theme}}\\n      @readonly={{@readonly}}\\n      @placeholder={{@placeholder}}\\n      @required={{@required}}\\n      @disabled={{@disabled}}\\n      @autocomplete={{@autocomplete}}\\n      @value={{@value}}\\n      @format={{@format}}\\n      @useUTC={{@useUTC}}\\n      @yearRange={{@yearRange}}\\n      @i18n={{@i18n}}\\n      @firstDay={{@firstDay}}\\n      @onClose={{@onClose}}\\n      @onDraw={{@onDraw}}\\n      @register={{@register}}\\n    />\\n  {{/if}}\\n  <div {{this.setContainer}} class=\\'ember-pikaday-container\\'></div>\\n</div>\")","import Component from '@glimmer/component';\nimport { modifier } from 'ember-modifier';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class PikadayInputlessComponent extends Component {\n  @tracked container;\n  constructor(owner, args) {\n    super(owner, args);\n    this.setContainer = modifier(\n      (element) => {\n        this.container = element;\n      },\n      { eager: false }\n    );\n  }\n}\n","import {\n  dependencySatisfies,\n  macroCondition,\n  importSync,\n} from '@embroider/macros';\n\nexport function maybeFindMoment() {\n  if (macroCondition(dependencySatisfies('moment-timezone', '*'))) {\n    return importSync('moment-timezone').default;\n  } else if (macroCondition(dependencySatisfies('moment', '*'))) {\n    return importSync('moment').default;\n  } else {\n    return undefined;\n  }\n}\n\nexport function findMoment() {\n  let moment = maybeFindMoment();\n  if (moment) {\n    return moment;\n  }\n  throw new Error(\n    `You're trying to use a feature of ember-pikaday that depends on moment or moment-timezone, but neither was found`\n  );\n}\n","import { registerDestructor } from '@ember/destroyable';\nimport Modifier from 'ember-modifier';\nimport makePikaday from '../../vendor/pikaday';\nimport { maybeFindMoment } from '../find-moment';\nconst Pikaday = makePikaday(maybeFindMoment());\n\nexport default class PikadayModifier extends Modifier {\n  #pikaday;\n  #observer;\n\n  constructor(owner, args) {\n    super(owner, args);\n\n    registerDestructor(this, () => {\n      this.#pikaday.destroy();\n      this.#observer.disconnect();\n    });\n  }\n\n  getPikadayOptions(element, positional, named) {\n    let opts = {\n      // Our element is Pikaday's field\n      field: element,\n\n      // All other named arguments go through to Pikaday\n      ...named,\n\n      // We also optionally accept a bag of arguments as the first positional\n      // argument, because it's hard to do argument splatting in hbs. These are\n      // taking precedence over the named arguments.\n      ...positional[0],\n    };\n\n    if (!opts.i18n) {\n      // Pikaday doesn't like it if you pass an empty value for i18n, whereas\n      // it's hard in HBS to conditionally include a named argument, so we\n      // drop it here.\n      delete opts.i18n;\n    }\n    return opts;\n  }\n\n  modify(element, positional, named) {\n    const pikadayOptions = this.getPikadayOptions(element, positional, named);\n\n    if (!this.#pikaday) {\n      this.#pikaday = new Pikaday(pikadayOptions);\n      let { value, register } = named;\n      if (value) {\n        this.#pikaday.setDate(value, true);\n      }\n      this.syncDisabled(element);\n      this.#observer = new MutationObserver(() => this.syncDisabled(element));\n      this.#observer.observe(element, { attributes: true });\n      register?.(this.#pikaday);\n    } else {\n      let { value, minDate, maxDate } = named;\n      let valueAltered = false;\n      this.#pikaday.setMinDate(copyDate(minDate));\n      if (minDate && value && value < minDate) {\n        value = minDate;\n        valueAltered = true;\n      }\n\n      this.#pikaday.setMaxDate(copyDate(maxDate));\n      if (maxDate && value && value > maxDate) {\n        value = maxDate;\n        valueAltered = true;\n      }\n\n      this.#pikaday.setDate(value, !valueAltered);\n      this.#pikaday.config(pikadayOptions);\n    }\n  }\n\n  syncDisabled(element) {\n    if (element.hasAttribute('disabled')) {\n      this.#pikaday.hide();\n    }\n  }\n}\n\n// apparently Pikaday mutates Dates that you pass it for minDate and maxDate. <sigh>\nfunction copyDate(date) {\n  if (date) {\n    return new Date(date.getTime());\n  } else {\n    return date;\n  }\n}\n","/*!\n * Pikaday\n *\n * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/Pikaday/Pikaday\n * \n * Packaging modified by Edward Faulkner for easier integration with ES-module build tooling.\n */\n\nexport default function factory(moment)\n{\n    'use strict';\n\n    /**\n     * feature detection and helper functions\n     */\n    var hasMoment = typeof moment === 'function',\n\n    hasEventListeners = !!window.addEventListener,\n\n    document = window.document,\n\n    sto = window.setTimeout,\n\n    addEvent = function(el, e, callback, capture)\n    {\n        if (hasEventListeners) {\n            el.addEventListener(e, callback, !!capture);\n        } else {\n            el.attachEvent('on' + e, callback);\n        }\n    },\n\n    removeEvent = function(el, e, callback, capture)\n    {\n        if (hasEventListeners) {\n            el.removeEventListener(e, callback, !!capture);\n        } else {\n            el.detachEvent('on' + e, callback);\n        }\n    },\n\n    trim = function(str)\n    {\n        return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g,'');\n    },\n\n    hasClass = function(el, cn)\n    {\n        return (' ' + el.className + ' ').indexOf(' ' + cn + ' ') !== -1;\n    },\n\n    addClass = function(el, cn)\n    {\n        if (!hasClass(el, cn)) {\n            el.className = (el.className === '') ? cn : el.className + ' ' + cn;\n        }\n    },\n\n    removeClass = function(el, cn)\n    {\n        el.className = trim((' ' + el.className + ' ').replace(' ' + cn + ' ', ' '));\n    },\n\n    isArray = function(obj)\n    {\n        return (/Array/).test(Object.prototype.toString.call(obj));\n    },\n\n    isDate = function(obj)\n    {\n        return (/Date/).test(Object.prototype.toString.call(obj)) && !isNaN(obj.getTime());\n    },\n\n    isWeekend = function(date)\n    {\n        var day = date.getDay();\n        return day === 0 || day === 6;\n    },\n\n    isLeapYear = function(year)\n    {\n        // solution lifted from date.js (MIT license): https://github.com/datejs/Datejs\n        return ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n    },\n\n    getDaysInMonth = function(year, month)\n    {\n        return [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];\n    },\n\n    setToStartOfDay = function(date)\n    {\n        if (isDate(date)) date.setHours(0,0,0,0);\n    },\n\n    compareDates = function(a,b)\n    {\n        // weak date comparison (use setToStartOfDay(date) to ensure correct result)\n        return a.getTime() === b.getTime();\n    },\n\n    extend = function(to, from, overwrite)\n    {\n        var prop, hasProp;\n        for (prop in from) {\n            hasProp = to[prop] !== undefined;\n            if (hasProp && typeof from[prop] === 'object' && from[prop] !== null && from[prop].nodeName === undefined) {\n                if (isDate(from[prop])) {\n                    if (overwrite) {\n                        to[prop] = new Date(from[prop].getTime());\n                    }\n                }\n                else if (isArray(from[prop])) {\n                    if (overwrite) {\n                        to[prop] = from[prop].slice(0);\n                    }\n                } else {\n                    to[prop] = extend({}, from[prop], overwrite);\n                }\n            } else if (overwrite || !hasProp) {\n                to[prop] = from[prop];\n            }\n        }\n        return to;\n    },\n\n    fireEvent = function(el, eventName, data)\n    {\n        var ev;\n\n        if (document.createEvent) {\n            ev = document.createEvent('HTMLEvents');\n            ev.initEvent(eventName, true, false);\n            ev = extend(ev, data);\n            el.dispatchEvent(ev);\n        } else if (document.createEventObject) {\n            ev = document.createEventObject();\n            ev = extend(ev, data);\n            el.fireEvent('on' + eventName, ev);\n        }\n    },\n\n    adjustCalendar = function(calendar) {\n        if (calendar.month < 0) {\n            calendar.year -= Math.ceil(Math.abs(calendar.month)/12);\n            calendar.month += 12;\n        }\n        if (calendar.month > 11) {\n            calendar.year += Math.floor(Math.abs(calendar.month)/12);\n            calendar.month -= 12;\n        }\n        return calendar;\n    },\n\n    /**\n     * defaults and localisation\n     */\n    defaults = {\n\n        // bind the picker to a form field\n        field: null,\n\n        // automatically show/hide the picker on `field` focus (default `true` if `field` is set)\n        bound: undefined,\n\n        // data-attribute on the input field with an aria assistance text (only applied when `bound` is set)\n        ariaLabel: 'Use the arrow keys to pick a date',\n\n        // position of the datepicker, relative to the field (default to bottom & left)\n        // ('bottom' & 'left' keywords are not used, 'top' & 'right' are modifier on the bottom/left position)\n        position: 'bottom left',\n\n        // automatically fit in the viewport even if it means repositioning from the position option\n        reposition: true,\n\n        // the default output format for `.toString()` and `field` value\n        format: 'YYYY-MM-DD',\n\n        // the toString function which gets passed a current date object and format\n        // and returns a string\n        toString: null,\n\n        // used to create date object from current input string\n        parse: null,\n\n        // the initial date to view when first opened\n        defaultDate: null,\n\n        // make the `defaultDate` the initial selected value\n        setDefaultDate: false,\n\n        // first day of week (0: Sunday, 1: Monday etc)\n        firstDay: 0,\n\n        // minimum number of days in the week that gets week number one\n        // default ISO 8601, week 01 is the week with the first Thursday (4)\n        firstWeekOfYearMinDays: 4,\n\n        // the default flag for moment's strict date parsing\n        formatStrict: false,\n\n        // the minimum/earliest date that can be selected\n        minDate: null,\n        // the maximum/latest date that can be selected\n        maxDate: null,\n\n        // number of years either side, or array of upper/lower range\n        yearRange: 10,\n\n        // show week numbers at head of row\n        showWeekNumber: false,\n\n        // Week picker mode\n        pickWholeWeek: false,\n\n        // used internally (don't config outside)\n        minYear: 0,\n        maxYear: 9999,\n        minMonth: undefined,\n        maxMonth: undefined,\n\n        startRange: null,\n        endRange: null,\n\n        isRTL: false,\n\n        // Additional text to append to the year in the calendar title\n        yearSuffix: '',\n\n        // Render the month after year in the calendar title\n        showMonthAfterYear: false,\n\n        // Render days of the calendar grid that fall in the next or previous month\n        showDaysInNextAndPreviousMonths: false,\n\n        // Allows user to select days that fall in the next or previous month\n        enableSelectionDaysInNextAndPreviousMonths: false,\n\n        // how many months are visible\n        numberOfMonths: 1,\n\n        // when numberOfMonths is used, this will help you to choose where the main calendar will be (default `left`, can be set to `right`)\n        // only used for the first display or when a selected date is not visible\n        mainCalendar: 'left',\n\n        // Specify a DOM element to render the calendar in\n        container: undefined,\n\n        // Blur field when date is selected\n        blurFieldOnSelect : true,\n\n        // internationalization\n        i18n: {\n            previousMonth : 'Previous Month',\n            nextMonth     : 'Next Month',\n            months        : ['January','February','March','April','May','June','July','August','September','October','November','December'],\n            weekdays      : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],\n            weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']\n        },\n\n        // Theme Classname\n        theme: null,\n\n        // events array\n        events: [],\n\n        // callback function\n        onSelect: null,\n        onOpen: null,\n        onClose: null,\n        onDraw: null,\n\n        // Enable keyboard input\n        keyboardInput: true\n    },\n\n\n    /**\n     * templating functions to abstract HTML rendering\n     */\n    renderDayName = function(opts, day, abbr)\n    {\n        day += opts.firstDay;\n        while (day >= 7) {\n            day -= 7;\n        }\n        return abbr ? opts.i18n.weekdaysShort[day] : opts.i18n.weekdays[day];\n    },\n\n    renderDay = function(opts)\n    {\n        var arr = [];\n        var ariaSelected = 'false';\n        if (opts.isEmpty) {\n            if (opts.showDaysInNextAndPreviousMonths) {\n                arr.push('is-outside-current-month');\n\n                if(!opts.enableSelectionDaysInNextAndPreviousMonths) {\n                    arr.push('is-selection-disabled');\n                }\n\n            } else {\n                return '<td class=\"is-empty\"></td>';\n            }\n        }\n        if (opts.isDisabled) {\n            arr.push('is-disabled');\n        }\n        if (opts.isToday) {\n            arr.push('is-today');\n        }\n        if (opts.isSelected) {\n            arr.push('is-selected');\n            ariaSelected = 'true';\n        }\n        if (opts.hasEvent) {\n            arr.push('has-event');\n        }\n        if (opts.isInRange) {\n            arr.push('is-inrange');\n        }\n        if (opts.isStartRange) {\n            arr.push('is-startrange');\n        }\n        if (opts.isEndRange) {\n            arr.push('is-endrange');\n        }\n        return '<td data-day=\"' + opts.day + '\" class=\"' + arr.join(' ') + '\" aria-selected=\"' + ariaSelected + '\">' +\n                 '<button class=\"pika-button pika-day\" type=\"button\" ' +\n                    'data-pika-year=\"' + opts.year + '\" data-pika-month=\"' + opts.month + '\" data-pika-day=\"' + opts.day + '\">' +\n                        opts.day +\n                 '</button>' +\n               '</td>';\n    },\n\n    isoWeek = function(date, firstWeekOfYearMinDays) {\n        // Ensure we're at the start of the day.\n        date.setHours(0, 0, 0, 0);\n\n        // Thursday in current week decides the year because January 4th\n        // is always in the first week according to ISO8601.\n        var yearDay        = date.getDate(),\n            weekDay        = date.getDay(),\n            dayInFirstWeek = firstWeekOfYearMinDays,\n            dayShift       = dayInFirstWeek - 1, // counting starts at 0\n            daysPerWeek    = 7,\n            prevWeekDay    = function(day) { return (day + daysPerWeek - 1) % daysPerWeek; };\n\n        // Adjust to Thursday in week 1 and count number of weeks from date to week 1.\n        date.setDate(yearDay + dayShift - prevWeekDay(weekDay));\n\n        var jan4th      = new Date(date.getFullYear(), 0, dayInFirstWeek),\n            msPerDay    = 24 * 60 * 60 * 1000,\n            daysBetween = (date.getTime() - jan4th.getTime()) / msPerDay,\n            weekNum     = 1 + Math.round((daysBetween - dayShift + prevWeekDay(jan4th.getDay())) / daysPerWeek);\n\n        return weekNum;\n    },\n\n    renderWeek = function (d, m, y, firstWeekOfYearMinDays) {\n        var date = new Date(y, m, d),\n            week = hasMoment ? moment(date).isoWeek() : isoWeek(date, firstWeekOfYearMinDays);\n\n        return '<td class=\"pika-week\">' + week + '</td>';\n    },\n\n    renderRow = function(days, isRTL, pickWholeWeek, isRowSelected)\n    {\n        return '<tr class=\"pika-row' + (pickWholeWeek ? ' pick-whole-week' : '') + (isRowSelected ? ' is-selected' : '') + '\">' + (isRTL ? days.reverse() : days).join('') + '</tr>';\n    },\n\n    renderBody = function(rows)\n    {\n        return '<tbody>' + rows.join('') + '</tbody>';\n    },\n\n    renderHead = function(opts)\n    {\n        var i, arr = [];\n        if (opts.showWeekNumber) {\n            arr.push('<th></th>');\n        }\n        for (i = 0; i < 7; i++) {\n            arr.push('<th scope=\"col\"><abbr title=\"' + renderDayName(opts, i) + '\">' + renderDayName(opts, i, true) + '</abbr></th>');\n        }\n        return '<thead><tr>' + (opts.isRTL ? arr.reverse() : arr).join('') + '</tr></thead>';\n    },\n\n    renderTitle = function(instance, c, year, month, refYear, randId)\n    {\n        var i, j, arr,\n            opts = instance._o,\n            isMinYear = year === opts.minYear,\n            isMaxYear = year === opts.maxYear,\n            html = '<div id=\"' + randId + '\" class=\"pika-title\" role=\"heading\" aria-live=\"assertive\">',\n            monthHtml,\n            yearHtml,\n            prev = true,\n            next = true;\n\n        for (arr = [], i = 0; i < 12; i++) {\n            arr.push('<option value=\"' + (year === refYear ? i - c : 12 + i - c) + '\"' +\n                (i === month ? ' selected=\"selected\"': '') +\n                ((isMinYear && i < opts.minMonth) || (isMaxYear && i > opts.maxMonth) ? ' disabled=\"disabled\"' : '') + '>' +\n                opts.i18n.months[i] + '</option>');\n        }\n\n        monthHtml = '<div class=\"pika-label\">' + opts.i18n.months[month] + '<select class=\"pika-select pika-select-month\" tabindex=\"-1\">' + arr.join('') + '</select></div>';\n\n        if (isArray(opts.yearRange)) {\n            i = opts.yearRange[0];\n            j = opts.yearRange[1] + 1;\n        } else {\n            i = year - opts.yearRange;\n            j = 1 + year + opts.yearRange;\n        }\n\n        for (arr = []; i < j && i <= opts.maxYear; i++) {\n            if (i >= opts.minYear) {\n                arr.push('<option value=\"' + i + '\"' + (i === year ? ' selected=\"selected\"': '') + '>' + (i) + '</option>');\n            }\n        }\n        yearHtml = '<div class=\"pika-label\">' + year + opts.yearSuffix + '<select class=\"pika-select pika-select-year\" tabindex=\"-1\">' + arr.join('') + '</select></div>';\n\n        if (opts.showMonthAfterYear) {\n            html += yearHtml + monthHtml;\n        } else {\n            html += monthHtml + yearHtml;\n        }\n\n        if (isMinYear && (month === 0 || opts.minMonth >= month)) {\n            prev = false;\n        }\n\n        if (isMaxYear && (month === 11 || opts.maxMonth <= month)) {\n            next = false;\n        }\n\n        if (c === 0) {\n            html += '<button class=\"pika-prev' + (prev ? '' : ' is-disabled') + '\" type=\"button\">' + opts.i18n.previousMonth + '</button>';\n        }\n        if (c === (instance._o.numberOfMonths - 1) ) {\n            html += '<button class=\"pika-next' + (next ? '' : ' is-disabled') + '\" type=\"button\">' + opts.i18n.nextMonth + '</button>';\n        }\n\n        return html += '</div>';\n    },\n\n    renderTable = function(opts, data, randId)\n    {\n        return '<table cellpadding=\"0\" cellspacing=\"0\" class=\"pika-table\" role=\"grid\" aria-labelledby=\"' + randId + '\">' + renderHead(opts) + renderBody(data) + '</table>';\n    },\n\n\n    /**\n     * Pikaday constructor\n     */\n    Pikaday = function(options)\n    {\n        var self = this,\n            opts = self.config(options);\n\n        self._onMouseDown = function(e)\n        {\n            if (!self._v) {\n                return;\n            }\n            e = e || window.event;\n            var target = e.target || e.srcElement;\n            if (!target) {\n                return;\n            }\n\n            if (!hasClass(target, 'is-disabled')) {\n                if (hasClass(target, 'pika-button') && !hasClass(target, 'is-empty') && !hasClass(target.parentNode, 'is-disabled')) {\n                    self.setDate(new Date(target.getAttribute('data-pika-year'), target.getAttribute('data-pika-month'), target.getAttribute('data-pika-day')));\n                    if (opts.bound) {\n                        sto(function() {\n                            self.hide();\n                            if (opts.blurFieldOnSelect && opts.field) {\n                                opts.field.blur();\n                            }\n                        }, 100);\n                    }\n                }\n                else if (hasClass(target, 'pika-prev')) {\n                    self.prevMonth();\n                }\n                else if (hasClass(target, 'pika-next')) {\n                    self.nextMonth();\n                }\n            }\n            if (!hasClass(target, 'pika-select')) {\n                // if this is touch event prevent mouse events emulation\n                if (e.preventDefault) {\n                    e.preventDefault();\n                } else {\n                    e.returnValue = false;\n                    return false;\n                }\n            } else {\n                self._c = true;\n            }\n        };\n\n        self._onChange = function(e)\n        {\n            e = e || window.event;\n            var target = e.target || e.srcElement;\n            if (!target) {\n                return;\n            }\n            if (hasClass(target, 'pika-select-month')) {\n                self.gotoMonth(target.value);\n            }\n            else if (hasClass(target, 'pika-select-year')) {\n                self.gotoYear(target.value);\n            }\n        };\n\n        self._onKeyChange = function(e)\n        {\n            e = e || window.event;\n\n            if (self.isVisible()) {\n\n                switch(e.keyCode){\n                    case 13:\n                    case 27:\n                        if (opts.field) {\n                            opts.field.blur();\n                        }\n                        break;\n                    case 37:\n                        self.adjustDate('subtract', 1);\n                        break;\n                    case 38:\n                        self.adjustDate('subtract', 7);\n                        break;\n                    case 39:\n                        self.adjustDate('add', 1);\n                        break;\n                    case 40:\n                        self.adjustDate('add', 7);\n                        break;\n                    case 8:\n                    case 46:\n                        self.setDate(null);\n                        break;\n                }\n            }\n        };\n\n        self._parseFieldValue = function()\n        {\n            if (opts.parse) {\n                return opts.parse(opts.field.value, opts.format);\n            } else if (hasMoment) {\n                var date = moment(opts.field.value, opts.format, opts.formatStrict);\n                return (date && date.isValid()) ? date.toDate() : null;\n            } else {\n                return new Date(Date.parse(opts.field.value));\n            }\n        };\n\n        self._onInputChange = function(e)\n        {\n            var date;\n\n            if (e.firedBy === self) {\n                return;\n            }\n            date = self._parseFieldValue();\n            if (isDate(date)) {\n              self.setDate(date);\n            }\n            if (!self._v) {\n                self.show();\n            }\n        };\n\n        self._onInputFocus = function()\n        {\n            self.show();\n        };\n\n        self._onInputClick = function()\n        {\n            self.show();\n        };\n\n        self._onInputBlur = function()\n        {\n            // IE allows pika div to gain focus; catch blur the input field\n            var pEl = document.activeElement;\n            do {\n                if (hasClass(pEl, 'pika-single')) {\n                    return;\n                }\n            }\n            while ((pEl = pEl.parentNode));\n\n            if (!self._c) {\n                self._b = sto(function() {\n                    self.hide();\n                }, 50);\n            }\n            self._c = false;\n        };\n\n        self._onClick = function(e)\n        {\n            e = e || window.event;\n            var target = e.target || e.srcElement,\n                pEl = target;\n            if (!target) {\n                return;\n            }\n            if (!hasEventListeners && hasClass(target, 'pika-select')) {\n                if (!target.onchange) {\n                    target.setAttribute('onchange', 'return;');\n                    addEvent(target, 'change', self._onChange);\n                }\n            }\n            do {\n                if (hasClass(pEl, 'pika-single') || pEl === opts.trigger) {\n                    return;\n                }\n            }\n            while ((pEl = pEl.parentNode));\n            if (self._v && target !== opts.trigger && pEl !== opts.trigger) {\n                self.hide();\n            }\n        };\n\n        self.el = document.createElement('div');\n        self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : '') + (opts.theme ? ' ' + opts.theme : '');\n\n        addEvent(self.el, 'mousedown', self._onMouseDown, true);\n        addEvent(self.el, 'touchend', self._onMouseDown, true);\n        addEvent(self.el, 'change', self._onChange);\n\n        if (opts.keyboardInput) {\n            addEvent(document, 'keydown', self._onKeyChange);\n        }\n\n        if (opts.field) {\n            if (opts.container) {\n                opts.container.appendChild(self.el);\n            } else if (opts.bound) {\n                document.body.appendChild(self.el);\n            } else {\n                opts.field.parentNode.insertBefore(self.el, opts.field.nextSibling);\n            }\n            addEvent(opts.field, 'change', self._onInputChange);\n\n            if (!opts.defaultDate) {\n                opts.defaultDate = self._parseFieldValue();\n                opts.setDefaultDate = true;\n            }\n        }\n\n        var defDate = opts.defaultDate;\n\n        if (isDate(defDate)) {\n            if (opts.setDefaultDate) {\n                self.setDate(defDate, true);\n            } else {\n                self.gotoDate(defDate);\n            }\n        } else {\n            self.gotoDate(new Date());\n        }\n\n        if (opts.bound) {\n            this.hide();\n            self.el.className += ' is-bound';\n            addEvent(opts.trigger, 'click', self._onInputClick);\n            addEvent(opts.trigger, 'focus', self._onInputFocus);\n            addEvent(opts.trigger, 'blur', self._onInputBlur);\n        } else {\n            this.show();\n        }\n    };\n\n\n    /**\n     * public Pikaday API\n     */\n    Pikaday.prototype = {\n\n\n        /**\n         * configure functionality\n         */\n        config: function(options)\n        {\n            if (!this._o) {\n                this._o = extend({}, defaults, true);\n            }\n\n            var opts = extend(this._o, options, true);\n\n            opts.isRTL = !!opts.isRTL;\n\n            opts.field = (opts.field && opts.field.nodeName) ? opts.field : null;\n\n            opts.theme = (typeof opts.theme) === 'string' && opts.theme ? opts.theme : null;\n\n            opts.bound = !!(opts.bound !== undefined ? opts.field && opts.bound : opts.field);\n\n            opts.trigger = (opts.trigger && opts.trigger.nodeName) ? opts.trigger : opts.field;\n\n            opts.disableWeekends = !!opts.disableWeekends;\n\n            opts.disableDayFn = (typeof opts.disableDayFn) === 'function' ? opts.disableDayFn : null;\n\n            var nom = parseInt(opts.numberOfMonths, 10) || 1;\n            opts.numberOfMonths = nom > 4 ? 4 : nom;\n\n            if (!isDate(opts.minDate)) {\n                opts.minDate = false;\n            }\n            if (!isDate(opts.maxDate)) {\n                opts.maxDate = false;\n            }\n            if ((opts.minDate && opts.maxDate) && opts.maxDate < opts.minDate) {\n                opts.maxDate = opts.minDate = false;\n            }\n            if (opts.minDate) {\n                this.setMinDate(opts.minDate);\n            }\n            if (opts.maxDate) {\n                this.setMaxDate(opts.maxDate);\n            }\n\n            if (isArray(opts.yearRange)) {\n                var fallback = new Date().getFullYear() - 10;\n                opts.yearRange[0] = parseInt(opts.yearRange[0], 10) || fallback;\n                opts.yearRange[1] = parseInt(opts.yearRange[1], 10) || fallback;\n            } else {\n                opts.yearRange = Math.abs(parseInt(opts.yearRange, 10)) || defaults.yearRange;\n                if (opts.yearRange > 100) {\n                    opts.yearRange = 100;\n                }\n            }\n\n            return opts;\n        },\n\n        /**\n         * return a formatted string of the current selection (using Moment.js if available)\n         */\n        toString: function(format)\n        {\n            format = format || this._o.format;\n            if (!isDate(this._d)) {\n                return '';\n            }\n            if (this._o.toString) {\n              return this._o.toString(this._d, format);\n            }\n            if (hasMoment) {\n              return moment(this._d).format(format);\n            }\n            return this._d.toDateString();\n        },\n\n        /**\n         * return a Moment.js object of the current selection (if available)\n         */\n        getMoment: function()\n        {\n            return hasMoment ? moment(this._d) : null;\n        },\n\n        /**\n         * set the current selection from a Moment.js object (if available)\n         */\n        setMoment: function(date, preventOnSelect)\n        {\n            if (hasMoment && moment.isMoment(date)) {\n                this.setDate(date.toDate(), preventOnSelect);\n            }\n        },\n\n        /**\n         * return a Date object of the current selection\n         */\n        getDate: function()\n        {\n            return isDate(this._d) ? new Date(this._d.getTime()) : null;\n        },\n\n        /**\n         * set the current selection\n         */\n        setDate: function(date, preventOnSelect)\n        {\n            if (!date) {\n                this._d = null;\n\n                if (this._o.field) {\n                    this._o.field.value = '';\n                    fireEvent(this._o.field, 'change', { firedBy: this });\n                }\n\n                return this.draw();\n            }\n            if (typeof date === 'string') {\n                date = new Date(Date.parse(date));\n            }\n            if (!isDate(date)) {\n                return;\n            }\n\n            var min = this._o.minDate,\n                max = this._o.maxDate;\n\n            if (isDate(min) && date < min) {\n                date = min;\n            } else if (isDate(max) && date > max) {\n                date = max;\n            }\n\n            this._d = new Date(date.getTime());\n            setToStartOfDay(this._d);\n            this.gotoDate(this._d);\n\n            if (this._o.field) {\n                this._o.field.value = this.toString();\n                fireEvent(this._o.field, 'change', { firedBy: this });\n            }\n            if (!preventOnSelect && typeof this._o.onSelect === 'function') {\n                this._o.onSelect.call(this, this.getDate());\n            }\n        },\n\n        /**\n         * clear and reset the date\n         */\n        clear: function()\n        {\n            this.setDate(null);\n        },\n\n        /**\n         * change view to a specific date\n         */\n        gotoDate: function(date)\n        {\n            var newCalendar = true;\n\n            if (!isDate(date)) {\n                return;\n            }\n\n            if (this.calendars) {\n                var firstVisibleDate = new Date(this.calendars[0].year, this.calendars[0].month, 1),\n                    lastVisibleDate = new Date(this.calendars[this.calendars.length-1].year, this.calendars[this.calendars.length-1].month, 1),\n                    visibleDate = date.getTime();\n                // get the end of the month\n                lastVisibleDate.setMonth(lastVisibleDate.getMonth()+1);\n                lastVisibleDate.setDate(lastVisibleDate.getDate()-1);\n                newCalendar = (visibleDate < firstVisibleDate.getTime() || lastVisibleDate.getTime() < visibleDate);\n            }\n\n            if (newCalendar) {\n                this.calendars = [{\n                    month: date.getMonth(),\n                    year: date.getFullYear()\n                }];\n                if (this._o.mainCalendar === 'right') {\n                    this.calendars[0].month += 1 - this._o.numberOfMonths;\n                }\n            }\n\n            this.adjustCalendars();\n        },\n\n        adjustDate: function(sign, days) {\n\n            var day = this.getDate() || new Date();\n            var difference = parseInt(days)*24*60*60*1000;\n\n            var newDay;\n\n            if (sign === 'add') {\n                newDay = new Date(day.valueOf() + difference);\n            } else if (sign === 'subtract') {\n                newDay = new Date(day.valueOf() - difference);\n            }\n\n            this.setDate(newDay);\n        },\n\n        adjustCalendars: function() {\n            this.calendars[0] = adjustCalendar(this.calendars[0]);\n            for (var c = 1; c < this._o.numberOfMonths; c++) {\n                this.calendars[c] = adjustCalendar({\n                    month: this.calendars[0].month + c,\n                    year: this.calendars[0].year\n                });\n            }\n            this.draw();\n        },\n\n        gotoToday: function()\n        {\n            this.gotoDate(new Date());\n        },\n\n        /**\n         * change view to a specific month (zero-index, e.g. 0: January)\n         */\n        gotoMonth: function(month)\n        {\n            if (!isNaN(month)) {\n                this.calendars[0].month = parseInt(month, 10);\n                this.adjustCalendars();\n            }\n        },\n\n        nextMonth: function()\n        {\n            this.calendars[0].month++;\n            this.adjustCalendars();\n        },\n\n        prevMonth: function()\n        {\n            this.calendars[0].month--;\n            this.adjustCalendars();\n        },\n\n        /**\n         * change view to a specific full year (e.g. \"2012\")\n         */\n        gotoYear: function(year)\n        {\n            if (!isNaN(year)) {\n                this.calendars[0].year = parseInt(year, 10);\n                this.adjustCalendars();\n            }\n        },\n\n        /**\n         * change the minDate\n         */\n        setMinDate: function(value)\n        {\n            if(value instanceof Date) {\n                setToStartOfDay(value);\n                this._o.minDate = value;\n                this._o.minYear  = value.getFullYear();\n                this._o.minMonth = value.getMonth();\n            } else {\n                this._o.minDate = defaults.minDate;\n                this._o.minYear  = defaults.minYear;\n                this._o.minMonth = defaults.minMonth;\n                this._o.startRange = defaults.startRange;\n            }\n\n            this.draw();\n        },\n\n        /**\n         * change the maxDate\n         */\n        setMaxDate: function(value)\n        {\n            if(value instanceof Date) {\n                setToStartOfDay(value);\n                this._o.maxDate = value;\n                this._o.maxYear = value.getFullYear();\n                this._o.maxMonth = value.getMonth();\n            } else {\n                this._o.maxDate = defaults.maxDate;\n                this._o.maxYear = defaults.maxYear;\n                this._o.maxMonth = defaults.maxMonth;\n                this._o.endRange = defaults.endRange;\n            }\n\n            this.draw();\n        },\n\n        setStartRange: function(value)\n        {\n            this._o.startRange = value;\n        },\n\n        setEndRange: function(value)\n        {\n            this._o.endRange = value;\n        },\n\n        /**\n         * refresh the HTML\n         */\n        draw: function(force)\n        {\n            if (!this._v && !force) {\n                return;\n            }\n            var opts = this._o,\n                minYear = opts.minYear,\n                maxYear = opts.maxYear,\n                minMonth = opts.minMonth,\n                maxMonth = opts.maxMonth,\n                html = '',\n                randId;\n\n            if (this._y <= minYear) {\n                this._y = minYear;\n                if (!isNaN(minMonth) && this._m < minMonth) {\n                    this._m = minMonth;\n                }\n            }\n            if (this._y >= maxYear) {\n                this._y = maxYear;\n                if (!isNaN(maxMonth) && this._m > maxMonth) {\n                    this._m = maxMonth;\n                }\n            }\n\n            for (var c = 0; c < opts.numberOfMonths; c++) {\n                randId = 'pika-title-' + Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 2);\n                html += '<div class=\"pika-lendar\">' + renderTitle(this, c, this.calendars[c].year, this.calendars[c].month, this.calendars[0].year, randId) + this.render(this.calendars[c].year, this.calendars[c].month, randId) + '</div>';\n            }\n\n            this.el.innerHTML = html;\n\n            if (opts.bound) {\n                if(opts.field.type !== 'hidden') {\n                    sto(function() {\n                        opts.trigger.focus();\n                    }, 1);\n                }\n            }\n\n            if (typeof this._o.onDraw === 'function') {\n                this._o.onDraw(this);\n            }\n\n            if (opts.bound) {\n                // let the screen reader user know to use arrow keys\n                opts.field.setAttribute('aria-label', opts.ariaLabel);\n            }\n        },\n\n        adjustPosition: function()\n        {\n            var field, pEl, width, height, viewportWidth, viewportHeight, scrollTop, left, top, clientRect, leftAligned, bottomAligned;\n\n            if (this._o.container) return;\n\n            this.el.style.position = 'absolute';\n\n            field = this._o.trigger;\n            pEl = field;\n            width = this.el.offsetWidth;\n            height = this.el.offsetHeight;\n            viewportWidth = window.innerWidth || document.documentElement.clientWidth;\n            viewportHeight = window.innerHeight || document.documentElement.clientHeight;\n            scrollTop = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;\n            leftAligned = true;\n            bottomAligned = true;\n\n            if (typeof field.getBoundingClientRect === 'function') {\n                clientRect = field.getBoundingClientRect();\n                left = clientRect.left + window.pageXOffset;\n                top = clientRect.bottom + window.pageYOffset;\n            } else {\n                left = pEl.offsetLeft;\n                top  = pEl.offsetTop + pEl.offsetHeight;\n                while((pEl = pEl.offsetParent)) {\n                    left += pEl.offsetLeft;\n                    top  += pEl.offsetTop;\n                }\n            }\n\n            // default position is bottom & left\n            if ((this._o.reposition && left + width > viewportWidth) ||\n                (\n                    this._o.position.indexOf('right') > -1 &&\n                    left - width + field.offsetWidth > 0\n                )\n            ) {\n                left = left - width + field.offsetWidth;\n                leftAligned = false;\n            }\n            if ((this._o.reposition && top + height > viewportHeight + scrollTop) ||\n                (\n                    this._o.position.indexOf('top') > -1 &&\n                    top - height - field.offsetHeight > 0\n                )\n            ) {\n                top = top - height - field.offsetHeight;\n                bottomAligned = false;\n            }\n            \n            if (left < 0) {\n                left = 0;\n            }\n\n            if (top < 0) {\n                top = 0;\n            }\n\n            this.el.style.left = left + 'px';\n            this.el.style.top = top + 'px';\n\n            addClass(this.el, leftAligned ? 'left-aligned' : 'right-aligned');\n            addClass(this.el, bottomAligned ? 'bottom-aligned' : 'top-aligned');\n            removeClass(this.el, !leftAligned ? 'left-aligned' : 'right-aligned');\n            removeClass(this.el, !bottomAligned ? 'bottom-aligned' : 'top-aligned');\n        },\n\n        /**\n         * render HTML for a particular month\n         */\n        render: function(year, month, randId)\n        {\n            var opts   = this._o,\n                now    = new Date(),\n                days   = getDaysInMonth(year, month),\n                before = new Date(year, month, 1).getDay(),\n                data   = [],\n                row    = [];\n            setToStartOfDay(now);\n            if (opts.firstDay > 0) {\n                before -= opts.firstDay;\n                if (before < 0) {\n                    before += 7;\n                }\n            }\n            var previousMonth = month === 0 ? 11 : month - 1,\n                nextMonth = month === 11 ? 0 : month + 1,\n                yearOfPreviousMonth = month === 0 ? year - 1 : year,\n                yearOfNextMonth = month === 11 ? year + 1 : year,\n                daysInPreviousMonth = getDaysInMonth(yearOfPreviousMonth, previousMonth);\n            var cells = days + before,\n                after = cells;\n            while(after > 7) {\n                after -= 7;\n            }\n            cells += 7 - after;\n            var isWeekSelected = false;\n            for (var i = 0, r = 0; i < cells; i++)\n            {\n                var day = new Date(year, month, 1 + (i - before)),\n                    isSelected = isDate(this._d) ? compareDates(day, this._d) : false,\n                    isToday = compareDates(day, now),\n                    hasEvent = opts.events.indexOf(day.toDateString()) !== -1 ? true : false,\n                    isEmpty = i < before || i >= (days + before),\n                    dayNumber = 1 + (i - before),\n                    monthNumber = month,\n                    yearNumber = year,\n                    isStartRange = opts.startRange && compareDates(opts.startRange, day),\n                    isEndRange = opts.endRange && compareDates(opts.endRange, day),\n                    isInRange = opts.startRange && opts.endRange && opts.startRange < day && day < opts.endRange,\n                    isDisabled = (opts.minDate && day < opts.minDate) ||\n                                 (opts.maxDate && day > opts.maxDate) ||\n                                 (opts.disableWeekends && isWeekend(day)) ||\n                                 (opts.disableDayFn && opts.disableDayFn(day));\n\n                if (isEmpty) {\n                    if (i < before) {\n                        dayNumber = daysInPreviousMonth + dayNumber;\n                        monthNumber = previousMonth;\n                        yearNumber = yearOfPreviousMonth;\n                    } else {\n                        dayNumber = dayNumber - days;\n                        monthNumber = nextMonth;\n                        yearNumber = yearOfNextMonth;\n                    }\n                }\n\n                var dayConfig = {\n                        day: dayNumber,\n                        month: monthNumber,\n                        year: yearNumber,\n                        hasEvent: hasEvent,\n                        isSelected: isSelected,\n                        isToday: isToday,\n                        isDisabled: isDisabled,\n                        isEmpty: isEmpty,\n                        isStartRange: isStartRange,\n                        isEndRange: isEndRange,\n                        isInRange: isInRange,\n                        showDaysInNextAndPreviousMonths: opts.showDaysInNextAndPreviousMonths,\n                        enableSelectionDaysInNextAndPreviousMonths: opts.enableSelectionDaysInNextAndPreviousMonths\n                    };\n\n                if (opts.pickWholeWeek && isSelected) {\n                    isWeekSelected = true;\n                }\n\n                row.push(renderDay(dayConfig));\n\n                if (++r === 7) {\n                    if (opts.showWeekNumber) {\n                        row.unshift(renderWeek(i - before, month, year, opts.firstWeekOfYearMinDays));\n                    }\n                    data.push(renderRow(row, opts.isRTL, opts.pickWholeWeek, isWeekSelected));\n                    row = [];\n                    r = 0;\n                    isWeekSelected = false;\n                }\n            }\n            return renderTable(opts, data, randId);\n        },\n\n        isVisible: function()\n        {\n            return this._v;\n        },\n\n        show: function()\n        {\n            if (!this.isVisible()) {\n                this._v = true;\n                this.draw();\n                removeClass(this.el, 'is-hidden');\n                if (this._o.bound) {\n                    addEvent(document, 'click', this._onClick);\n                    this.adjustPosition();\n                }\n                if (typeof this._o.onOpen === 'function') {\n                    this._o.onOpen.call(this);\n                }\n            }\n        },\n\n        hide: function()\n        {\n            var v = this._v;\n            if (v !== false) {\n                if (this._o.bound) {\n                    removeEvent(document, 'click', this._onClick);\n                }\n\n                if (!this._o.container) {\n                    this.el.style.position = 'static'; // reset\n                    this.el.style.left = 'auto';\n                    this.el.style.top = 'auto';\n                }\n                addClass(this.el, 'is-hidden');\n                this._v = false;\n                if (v !== undefined && typeof this._o.onClose === 'function') {\n                    this._o.onClose.call(this);\n                }\n            }\n        },\n\n        /**\n         * GAME OVER\n         */\n        destroy: function()\n        {\n            var opts = this._o;\n\n            this.hide();\n            removeEvent(this.el, 'mousedown', this._onMouseDown, true);\n            removeEvent(this.el, 'touchend', this._onMouseDown, true);\n            removeEvent(this.el, 'change', this._onChange);\n            if (opts.keyboardInput) {\n                removeEvent(document, 'keydown', this._onKeyChange);\n            }\n            if (opts.field) {\n                removeEvent(opts.field, 'change', this._onInputChange);\n                if (opts.bound) {\n                    removeEvent(opts.trigger, 'click', this._onInputClick);\n                    removeEvent(opts.trigger, 'focus', this._onInputFocus);\n                    removeEvent(opts.trigger, 'blur', this._onInputBlur);\n                }\n            }\n            if (this.el.parentNode) {\n                this.el.parentNode.removeChild(this.el);\n            }\n        }\n\n    };\n\n    return Pikaday;\n}\n","function _initializerDefineProperty(target, property, descriptor, context) {\n  if (!descriptor) return;\n  Object.defineProperty(target, property, {\n    enumerable: descriptor.enumerable,\n    configurable: descriptor.configurable,\n    writable: descriptor.writable,\n    value: descriptor.initializer ? descriptor.initializer.call(context) : void 0\n  });\n}\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {\n  var desc = {};\n  Object.keys(descriptor).forEach(function (key) {\n    desc[key] = descriptor[key];\n  });\n  desc.enumerable = !!desc.enumerable;\n  desc.configurable = !!desc.configurable;\n\n  if ('value' in desc || desc.initializer) {\n    desc.writable = true;\n  }\n\n  desc = decorators.slice().reverse().reduce(function (desc, decorator) {\n    return decorator(target, property, desc) || desc;\n  }, desc);\n\n  if (context && desc.initializer !== void 0) {\n    desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n    desc.initializer = undefined;\n  }\n\n  if (desc.initializer === void 0) {\n    Object.defineProperty(target, property, desc);\n    desc = null;\n  }\n\n  return desc;\n}\n\nexport { _applyDecoratedDescriptor as _, _initializerDefineProperty as a };\n","import { _ as _applyDecoratedDescriptor, a as _initializerDefineProperty } from '../_rollupPluginBabelHelpers-7db585ca.js';\nimport { inject } from '@ember/service';\nimport Helper from '@ember/component/helper';\nimport handleQueryParams from '../utils/handle-query-params.js';\nimport trackActiveRoute from '../utils/track-active-route.js';\n\nvar _class, _descriptor;\nlet IsActiveHelper = (_class = class IsActiveHelper extends Helper {\n  constructor(...args) {\n    super(...args);\n\n    _initializerDefineProperty(this, \"router\", _descriptor, this);\n  }\n\n  compute(_params) {\n    trackActiveRoute(this.router);\n    let params = handleQueryParams(_params);\n    return this.router.isActive(...params);\n  }\n\n}, (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"router\", [inject], {\n  configurable: true,\n  enumerable: true,\n  writable: true,\n  initializer: null\n})), _class);\n\nexport { IsActiveHelper as default };\n","import { _ as _applyDecoratedDescriptor, a as _initializerDefineProperty } from '../_rollupPluginBabelHelpers-7db585ca.js';\nimport { inject } from '@ember/service';\nimport Helper from '@ember/component/helper';\nimport handleQueryParams from '../utils/handle-query-params.js';\n\nvar _class, _descriptor;\nlet ReplaceWithHelper = (_class = class ReplaceWithHelper extends Helper {\n  constructor(...args) {\n    super(...args);\n\n    _initializerDefineProperty(this, \"router\", _descriptor, this);\n  }\n\n  compute(_params) {\n    return maybeEvent => {\n      if (maybeEvent !== undefined && typeof maybeEvent.preventDefault === 'function') {\n        maybeEvent.preventDefault();\n      }\n\n      let params = handleQueryParams(_params);\n      return this.router.replaceWith(...params);\n    };\n  }\n\n}, (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"router\", [inject], {\n  configurable: true,\n  enumerable: true,\n  writable: true,\n  initializer: null\n})), _class);\n\nexport { ReplaceWithHelper as default };\n","import { _ as _applyDecoratedDescriptor, a as _initializerDefineProperty } from '../_rollupPluginBabelHelpers-7db585ca.js';\nimport Helper from '@ember/component/helper';\nimport { inject } from '@ember/service';\n\nvar _class, _descriptor;\nlet RootURLHelper = (_class = class RootURLHelper extends Helper {\n  constructor(...args) {\n    super(...args);\n\n    _initializerDefineProperty(this, \"router\", _descriptor, this);\n  }\n\n  compute() {\n    return this.router.rootURL;\n  }\n\n}, (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"router\", [inject], {\n  configurable: true,\n  enumerable: true,\n  writable: true,\n  initializer: null\n})), _class);\n\nexport { RootURLHelper as default };\n","import { _ as _applyDecoratedDescriptor, a as _initializerDefineProperty } from '../_rollupPluginBabelHelpers-7db585ca.js';\nimport { inject } from '@ember/service';\nimport Helper from '@ember/component/helper';\nimport RouteParams from '../utils/route-params.js';\nimport '../utils/handle-query-params.js';\nimport '../utils/track-active-route.js';\n\nvar _class, _descriptor;\nlet RouteParamsHelper = (_class = class RouteParamsHelper extends Helper {\n  constructor(...args) {\n    super(...args);\n\n    _initializerDefineProperty(this, \"router\", _descriptor, this);\n  }\n\n  compute(params) {\n    return new RouteParams(this.router, params);\n  }\n\n}, (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"router\", [inject], {\n  configurable: true,\n  enumerable: true,\n  writable: true,\n  initializer: null\n})), _class);\n\nexport { RouteParamsHelper as default };\n","import handleQueryParams from './handle-query-params.js';\nimport trackActiveRoute from './track-active-route.js';\n\nclass RouteParams {\n  constructor(router, params) {\n    this._router = router;\n    this._inputParams = params;\n    this._transitionTo = undefined;\n    this._replaceWith = undefined;\n    this._processedParams = undefined;\n  }\n\n  get isActive() {\n    trackActiveRoute(this._router);\n    return this._router.isActive(...this._params);\n  }\n\n  get url() {\n    return this._router.urlFor(...this._params);\n  }\n\n  get transitionTo() {\n    if (this._transitionTo === undefined) {\n      this._transitionTo = maybeEvent => {\n        if (maybeEvent !== undefined && typeof maybeEvent.preventDefault === 'function') {\n          maybeEvent.preventDefault();\n        }\n\n        return this._router.transitionTo(...this._params);\n      };\n    }\n\n    return this._transitionTo;\n  }\n\n  get replaceWith() {\n    if (this._replaceWith === undefined) {\n      this._replaceWith = () => {\n        return this._router.replaceWith(...this._params);\n      };\n    }\n\n    return this._replaceWith;\n  }\n\n  get _params() {\n    if (!this._processedParams) {\n      this._processedParams = handleQueryParams(this._inputParams);\n    }\n\n    return this._processedParams;\n  }\n\n}\n\nexport { RouteParams as default };\n","import { _ as _applyDecoratedDescriptor, a as _initializerDefineProperty } from '../_rollupPluginBabelHelpers-7db585ca.js';\nimport { inject } from '@ember/service';\nimport Helper from '@ember/component/helper';\nimport handleQueryParams from '../utils/handle-query-params.js';\n\nvar _class, _descriptor;\nlet TransitionToHelper = (_class = class TransitionToHelper extends Helper {\n  constructor(...args) {\n    super(...args);\n\n    _initializerDefineProperty(this, \"router\", _descriptor, this);\n  }\n\n  compute(_params) {\n    return maybeEvent => {\n      if (maybeEvent !== undefined && typeof maybeEvent.preventDefault === 'function') {\n        maybeEvent.preventDefault();\n      }\n\n      let params = handleQueryParams(_params);\n      return this.router.transitionTo(...params);\n    };\n  }\n\n}, (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"router\", [inject], {\n  configurable: true,\n  enumerable: true,\n  writable: true,\n  initializer: null\n})), _class);\n\nexport { TransitionToHelper as default };\n","import { _ as _applyDecoratedDescriptor, a as _initializerDefineProperty } from '../_rollupPluginBabelHelpers-7db585ca.js';\nimport { inject } from '@ember/service';\nimport Helper from '@ember/component/helper';\nimport handleQueryParams from '../utils/handle-query-params.js';\n\nvar _class, _descriptor;\nlet UrlForHelper = (_class = class UrlForHelper extends Helper {\n  constructor(...args) {\n    super(...args);\n\n    _initializerDefineProperty(this, \"router\", _descriptor, this);\n  }\n\n  compute(_params) {\n    let params = handleQueryParams(_params);\n    return this.router.urlFor(...params);\n  }\n\n}, (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"router\", [inject], {\n  configurable: true,\n  enumerable: true,\n  writable: true,\n  initializer: null\n})), _class);\n\nexport { UrlForHelper as default };\n","function handleQueryParams (params) {\n  let possibleQueryParams = params[params.length - 1];\n\n  if (possibleQueryParams && possibleQueryParams.isQueryParams) {\n    // ensure to handle potentially frozen arrays\n    params = params.slice();\n    params[params.length - 1] = {\n      queryParams: possibleQueryParams.values\n    };\n  }\n\n  return params;\n}\n\nexport { handleQueryParams as default };\n","function trackActiveRoute(router) {\n  // ensure we recompute anytime `router.currentURL` changes\n  router.currentURL; // ensure we recompute whenever the `router.currentRouteName` changes\n  // this is slightly overlapping with router.currentURL but there are\n  // cases where route.currentURL doesn't change but the\n  // router.currentRouteName has (e.g. loading and error states)\n\n  router.currentRouteName;\n}\n\nexport { trackActiveRoute as default };\n","'use strict';\n//parse Empty Node as self closing node\nconst buildOptions = require('./util').buildOptions;\n\nconst defaultOptions = {\n  attributeNamePrefix: '@_',\n  attrNodeName: false,\n  textNodeName: '#text',\n  ignoreAttributes: true,\n  cdataTagName: false,\n  cdataPositionChar: '\\\\c',\n  format: false,\n  indentBy: '  ',\n  supressEmptyNode: false,\n  tagValueProcessor: function(a) {\n    return a;\n  },\n  attrValueProcessor: function(a) {\n    return a;\n  },\n};\n\nconst props = [\n  'attributeNamePrefix',\n  'attrNodeName',\n  'textNodeName',\n  'ignoreAttributes',\n  'cdataTagName',\n  'cdataPositionChar',\n  'format',\n  'indentBy',\n  'supressEmptyNode',\n  'tagValueProcessor',\n  'attrValueProcessor',\n  'rootNodeName', //when array as root\n];\n\nfunction Parser(options) {\n  this.options = buildOptions(options, defaultOptions, props);\n  if (this.options.ignoreAttributes || this.options.attrNodeName) {\n    this.isAttribute = function(/*a*/) {\n      return false;\n    };\n  } else {\n    this.attrPrefixLen = this.options.attributeNamePrefix.length;\n    this.isAttribute = isAttribute;\n  }\n  if (this.options.cdataTagName) {\n    this.isCDATA = isCDATA;\n  } else {\n    this.isCDATA = function(/*a*/) {\n      return false;\n    };\n  }\n  this.replaceCDATAstr = replaceCDATAstr;\n  this.replaceCDATAarr = replaceCDATAarr;\n\n  this.processTextOrObjNode = processTextOrObjNode\n\n  if (this.options.format) {\n    this.indentate = indentate;\n    this.tagEndChar = '>\\n';\n    this.newLine = '\\n';\n  } else {\n    this.indentate = function() {\n      return '';\n    };\n    this.tagEndChar = '>';\n    this.newLine = '';\n  }\n\n  if (this.options.supressEmptyNode) {\n    this.buildTextNode = buildEmptyTextNode;\n    this.buildObjNode = buildEmptyObjNode;\n  } else {\n    this.buildTextNode = buildTextValNode;\n    this.buildObjNode = buildObjectNode;\n  }\n\n  this.buildTextValNode = buildTextValNode;\n  this.buildObjectNode = buildObjectNode;\n}\n\nParser.prototype.parse = function(jObj) {\n  if(Array.isArray(jObj) && this.options.rootNodeName && this.options.rootNodeName.length > 1){\n    jObj = {\n      [this.options.rootNodeName] : jObj\n    }\n  }\n  return this.j2x(jObj, 0).val;\n};\n\nParser.prototype.j2x = function(jObj, level) {\n  let attrStr = '';\n  let val = '';\n  for (let key in jObj) {\n    if (typeof jObj[key] === 'undefined') {\n      // supress undefined node\n    } else if (jObj[key] === null) {\n      val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;\n    } else if (jObj[key] instanceof Date) {\n      val += this.buildTextNode(jObj[key], key, '', level);\n    } else if (typeof jObj[key] !== 'object') {\n      //premitive type\n      const attr = this.isAttribute(key);\n      if (attr) {\n        attrStr += ' ' + attr + '=\"' + this.options.attrValueProcessor('' + jObj[key]) + '\"';\n      } else if (this.isCDATA(key)) {\n        if (jObj[this.options.textNodeName]) {\n          val += this.replaceCDATAstr(jObj[this.options.textNodeName], jObj[key]);\n        } else {\n          val += this.replaceCDATAstr('', jObj[key]);\n        }\n      } else {\n        //tag value\n        if (key === this.options.textNodeName) {\n          if (jObj[this.options.cdataTagName]) {\n            //value will added while processing cdata\n          } else {\n            val += this.options.tagValueProcessor('' + jObj[key]);\n          }\n        } else {\n          val += this.buildTextNode(jObj[key], key, '', level);\n        }\n      }\n    } else if (Array.isArray(jObj[key])) {\n      //repeated nodes\n      if (this.isCDATA(key)) {\n        val += this.indentate(level);\n        if (jObj[this.options.textNodeName]) {\n          val += this.replaceCDATAarr(jObj[this.options.textNodeName], jObj[key]);\n        } else {\n          val += this.replaceCDATAarr('', jObj[key]);\n        }\n      } else {\n        //nested nodes\n        const arrLen = jObj[key].length;\n        for (let j = 0; j < arrLen; j++) {\n          const item = jObj[key][j];\n          if (typeof item === 'undefined') {\n            // supress undefined node\n          } else if (item === null) {\n            val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;\n          } else if (typeof item === 'object') {\n            val += this.processTextOrObjNode(item, key, level)\n          } else {\n            val += this.buildTextNode(item, key, '', level);\n          }\n        }\n      }\n    } else {\n      //nested node\n      if (this.options.attrNodeName && key === this.options.attrNodeName) {\n        const Ks = Object.keys(jObj[key]);\n        const L = Ks.length;\n        for (let j = 0; j < L; j++) {\n          attrStr += ' ' + Ks[j] + '=\"' + this.options.attrValueProcessor('' + jObj[key][Ks[j]]) + '\"';\n        }\n      } else {\n        val += this.processTextOrObjNode(jObj[key], key, level)\n      }\n    }\n  }\n  return {attrStr: attrStr, val: val};\n};\n\nfunction processTextOrObjNode (object, key, level) {\n  const result = this.j2x(object, level + 1);\n  if (object[this.options.textNodeName] !== undefined && Object.keys(object).length === 1) {\n    return this.buildTextNode(result.val, key, result.attrStr, level);\n  } else {\n    return this.buildObjNode(result.val, key, result.attrStr, level);\n  }\n}\n\nfunction replaceCDATAstr(str, cdata) {\n  str = this.options.tagValueProcessor('' + str);\n  if (this.options.cdataPositionChar === '' || str === '') {\n    return str + '<![CDATA[' + cdata + ']]' + this.tagEndChar;\n  } else {\n    return str.replace(this.options.cdataPositionChar, '<![CDATA[' + cdata + ']]' + this.tagEndChar);\n  }\n}\n\nfunction replaceCDATAarr(str, cdata) {\n  str = this.options.tagValueProcessor('' + str);\n  if (this.options.cdataPositionChar === '' || str === '') {\n    return str + '<![CDATA[' + cdata.join(']]><![CDATA[') + ']]' + this.tagEndChar;\n  } else {\n    for (let v in cdata) {\n      str = str.replace(this.options.cdataPositionChar, '<![CDATA[' + cdata[v] + ']]>');\n    }\n    return str + this.newLine;\n  }\n}\n\nfunction buildObjectNode(val, key, attrStr, level) {\n  if (attrStr && val.indexOf('<') === -1) {\n    return (\n      this.indentate(level) +\n      '<' +\n      key +\n      attrStr +\n      '>' +\n      val +\n      //+ this.newLine\n      // + this.indentate(level)\n      '</' +\n      key +\n      this.tagEndChar\n    );\n  } else {\n    return (\n      this.indentate(level) +\n      '<' +\n      key +\n      attrStr +\n      this.tagEndChar +\n      val +\n      //+ this.newLine\n      this.indentate(level) +\n      '</' +\n      key +\n      this.tagEndChar\n    );\n  }\n}\n\nfunction buildEmptyObjNode(val, key, attrStr, level) {\n  if (val !== '') {\n    return this.buildObjectNode(val, key, attrStr, level);\n  } else {\n    return this.indentate(level) + '<' + key + attrStr + '/' + this.tagEndChar;\n    //+ this.newLine\n  }\n}\n\nfunction buildTextValNode(val, key, attrStr, level) {\n  return (\n    this.indentate(level) +\n    '<' +\n    key +\n    attrStr +\n    '>' +\n    this.options.tagValueProcessor(val) +\n    '</' +\n    key +\n    this.tagEndChar\n  );\n}\n\nfunction buildEmptyTextNode(val, key, attrStr, level) {\n  if (val !== '') {\n    return this.buildTextValNode(val, key, attrStr, level);\n  } else {\n    return this.indentate(level) + '<' + key + attrStr + '/' + this.tagEndChar;\n  }\n}\n\nfunction indentate(level) {\n  return this.options.indentBy.repeat(level);\n}\n\nfunction isAttribute(name /*, options*/) {\n  if (name.startsWith(this.options.attributeNamePrefix)) {\n    return name.substr(this.attrPrefixLen);\n  } else {\n    return false;\n  }\n}\n\nfunction isCDATA(name) {\n  return name === this.options.cdataTagName;\n}\n\n//formatting\n//indentation\n//\\n after each closing or self closing tag\n\nmodule.exports = Parser;\n","'use strict';\nconst char = function(a) {\n  return String.fromCharCode(a);\n};\n\nconst chars = {\n  nilChar: char(176),\n  missingChar: char(201),\n  nilPremitive: char(175),\n  missingPremitive: char(200),\n\n  emptyChar: char(178),\n  emptyValue: char(177), //empty Premitive\n\n  boundryChar: char(179),\n\n  objStart: char(198),\n  arrStart: char(204),\n  arrayEnd: char(185),\n};\n\nconst charsArr = [\n  chars.nilChar,\n  chars.nilPremitive,\n  chars.missingChar,\n  chars.missingPremitive,\n  chars.boundryChar,\n  chars.emptyChar,\n  chars.emptyValue,\n  chars.arrayEnd,\n  chars.objStart,\n  chars.arrStart,\n];\n\nconst _e = function(node, e_schema, options) {\n  if (typeof e_schema === 'string') {\n    //premitive\n    if (node && node[0] && node[0].val !== undefined) {\n      return getValue(node[0].val, e_schema);\n    } else {\n      return getValue(node, e_schema);\n    }\n  } else {\n    const hasValidData = hasData(node);\n    if (hasValidData === true) {\n      let str = '';\n      if (Array.isArray(e_schema)) {\n        //attributes can't be repeated. hence check in children tags only\n        str += chars.arrStart;\n        const itemSchema = e_schema[0];\n        //const itemSchemaType = itemSchema;\n        const arr_len = node.length;\n\n        if (typeof itemSchema === 'string') {\n          for (let arr_i = 0; arr_i < arr_len; arr_i++) {\n            const r = getValue(node[arr_i].val, itemSchema);\n            str = processValue(str, r);\n          }\n        } else {\n          for (let arr_i = 0; arr_i < arr_len; arr_i++) {\n            const r = _e(node[arr_i], itemSchema, options);\n            str = processValue(str, r);\n          }\n        }\n        str += chars.arrayEnd; //indicates that next item is not array item\n      } else {\n        //object\n        str += chars.objStart;\n        const keys = Object.keys(e_schema);\n        if (Array.isArray(node)) {\n          node = node[0];\n        }\n        for (let i in keys) {\n          const key = keys[i];\n          //a property defined in schema can be present either in attrsMap or children tags\n          //options.textNodeName will not present in both maps, take it's value from val\n          //options.attrNodeName will be present in attrsMap\n          let r;\n          if (!options.ignoreAttributes && node.attrsMap && node.attrsMap[key]) {\n            r = _e(node.attrsMap[key], e_schema[key], options);\n          } else if (key === options.textNodeName) {\n            r = _e(node.val, e_schema[key], options);\n          } else {\n            r = _e(node.child[key], e_schema[key], options);\n          }\n          str = processValue(str, r);\n        }\n      }\n      return str;\n    } else {\n      return hasValidData;\n    }\n  }\n};\n\nconst getValue = function(a /*, type*/) {\n  switch (a) {\n    case undefined:\n      return chars.missingPremitive;\n    case null:\n      return chars.nilPremitive;\n    case '':\n      return chars.emptyValue;\n    default:\n      return a;\n  }\n};\n\nconst processValue = function(str, r) {\n  if (!isAppChar(r[0]) && !isAppChar(str[str.length - 1])) {\n    str += chars.boundryChar;\n  }\n  return str + r;\n};\n\nconst isAppChar = function(ch) {\n  return charsArr.indexOf(ch) !== -1;\n};\n\nfunction hasData(jObj) {\n  if (jObj === undefined) {\n    return chars.missingChar;\n  } else if (jObj === null) {\n    return chars.nilChar;\n  } else if (\n    jObj.child &&\n    Object.keys(jObj.child).length === 0 &&\n    (!jObj.attrsMap || Object.keys(jObj.attrsMap).length === 0)\n  ) {\n    return chars.emptyChar;\n  } else {\n    return true;\n  }\n}\n\nconst x2j = require('./xmlstr2xmlnode');\nconst buildOptions = require('./util').buildOptions;\n\nconst convert2nimn = function(node, e_schema, options) {\n  options = buildOptions(options, x2j.defaultOptions, x2j.props);\n  return _e(node, e_schema, options);\n};\n\nexports.convert2nimn = convert2nimn;\n","'use strict';\n\nconst util = require('./util');\n\nconst convertToJson = function(node, options, parentTagName) {\n  const jObj = {};\n\n  // when no child node or attr is present\n  if (!options.alwaysCreateTextNode && (!node.child || util.isEmptyObject(node.child)) && (!node.attrsMap || util.isEmptyObject(node.attrsMap))) {\n    return util.isExist(node.val) ? node.val : '';\n  }\n\n  // otherwise create a textnode if node has some text\n  if (util.isExist(node.val) && !(typeof node.val === 'string' && (node.val === '' || node.val === options.cdataPositionChar))) {\n    const asArray = util.isTagNameInArrayMode(node.tagname, options.arrayMode, parentTagName)\n    jObj[options.textNodeName] = asArray ? [node.val] : node.val;\n  }\n\n  util.merge(jObj, node.attrsMap, options.arrayMode);\n\n  const keys = Object.keys(node.child);\n  for (let index = 0; index < keys.length; index++) {\n    const tagName = keys[index];\n    if (node.child[tagName] && node.child[tagName].length > 1) {\n      jObj[tagName] = [];\n      for (let tag in node.child[tagName]) {\n        if (node.child[tagName].hasOwnProperty(tag)) {\n          jObj[tagName].push(convertToJson(node.child[tagName][tag], options, tagName));\n        }\n      }\n    } else {\n      const result = convertToJson(node.child[tagName][0], options, tagName);\n      const asArray = (options.arrayMode === true && typeof result === 'object') || util.isTagNameInArrayMode(tagName, options.arrayMode, parentTagName);\n      jObj[tagName] = asArray ? [result] : result;\n    }\n  }\n\n  //add value\n  return jObj;\n};\n\nexports.convertToJson = convertToJson;\n","'use strict';\n\nconst util = require('./util');\nconst buildOptions = require('./util').buildOptions;\nconst x2j = require('./xmlstr2xmlnode');\n\n//TODO: do it later\nconst convertToJsonString = function(node, options) {\n  options = buildOptions(options, x2j.defaultOptions, x2j.props);\n\n  options.indentBy = options.indentBy || '';\n  return _cToJsonStr(node, options, 0);\n};\n\nconst _cToJsonStr = function(node, options, level) {\n  let jObj = '{';\n\n  //traver through all the children\n  const keys = Object.keys(node.child);\n\n  for (let index = 0; index < keys.length; index++) {\n    const tagname = keys[index];\n    if (node.child[tagname] && node.child[tagname].length > 1) {\n      jObj += '\"' + tagname + '\" : [ ';\n      for (let tag in node.child[tagname]) {\n        jObj += _cToJsonStr(node.child[tagname][tag], options) + ' , ';\n      }\n      jObj = jObj.substr(0, jObj.length - 1) + ' ] '; //remove extra comma in last\n    } else {\n      jObj += '\"' + tagname + '\" : ' + _cToJsonStr(node.child[tagname][0], options) + ' ,';\n    }\n  }\n  util.merge(jObj, node.attrsMap);\n  //add attrsMap as new children\n  if (util.isEmptyObject(jObj)) {\n    return util.isExist(node.val) ? node.val : '';\n  } else {\n    if (util.isExist(node.val)) {\n      if (!(typeof node.val === 'string' && (node.val === '' || node.val === options.cdataPositionChar))) {\n        jObj += '\"' + options.textNodeName + '\" : ' + stringval(node.val);\n      }\n    }\n  }\n  //add value\n  if (jObj[jObj.length - 1] === ',') {\n    jObj = jObj.substr(0, jObj.length - 2);\n  }\n  return jObj + '}';\n};\n\nfunction stringval(v) {\n  if (v === true || v === false || !isNaN(v)) {\n    return v;\n  } else {\n    return '\"' + v + '\"';\n  }\n}\n\nfunction indentate(options, level) {\n  return options.indentBy.repeat(level);\n}\n\nexports.convertToJsonString = convertToJsonString;\n","'use strict';\n\nconst nodeToJson = require('./node2json');\nconst xmlToNodeobj = require('./xmlstr2xmlnode');\nconst x2xmlnode = require('./xmlstr2xmlnode');\nconst buildOptions = require('./util').buildOptions;\nconst validator = require('./validator');\n\nexports.parse = function(xmlData, givenOptions = {}, validationOption) {\n  if( validationOption){\n    if(validationOption === true) validationOption = {}\n    \n    const result = validator.validate(xmlData, validationOption);\n    if (result !== true) {\n      throw Error( result.err.msg)\n    }\n  }\n  if(givenOptions.parseTrueNumberOnly \n    && givenOptions.parseNodeValue !== false\n    && !givenOptions.numParseOptions){\n    \n      givenOptions.numParseOptions = {\n        leadingZeros: false,\n      }\n  }\n  let options = buildOptions(givenOptions, x2xmlnode.defaultOptions, x2xmlnode.props);\n\n  const traversableObj = xmlToNodeobj.getTraversalObj(xmlData, options)\n  //print(traversableObj, \"  \");\n  return nodeToJson.convertToJson(traversableObj, options);\n};\nexports.convertTonimn = require('./nimndata').convert2nimn;\nexports.getTraversalObj = xmlToNodeobj.getTraversalObj;\nexports.convertToJson = nodeToJson.convertToJson;\nexports.convertToJsonString = require('./node2json_str').convertToJsonString;\nexports.validate = validator.validate;\nexports.j2xParser = require('./json2xml');\nexports.parseToNimn = function(xmlData, schema, options) {\n  return exports.convertTonimn(exports.getTraversalObj(xmlData, options), schema, options);\n};\n\n\nfunction print(xmlNode, indentation){\n  if(xmlNode){\n    console.log(indentation + \"{\")\n    console.log(indentation + \"  \\\"tagName\\\": \\\"\" + xmlNode.tagname + \"\\\", \");\n    if(xmlNode.parent){\n      console.log(indentation + \"  \\\"parent\\\": \\\"\" + xmlNode.parent.tagname  + \"\\\", \");\n    }\n    console.log(indentation + \"  \\\"val\\\": \\\"\" + xmlNode.val  + \"\\\", \");\n    console.log(indentation + \"  \\\"attrs\\\": \" + JSON.stringify(xmlNode.attrsMap,null,4)  + \", \");\n\n    if(xmlNode.child){\n      console.log(indentation + \"\\\"child\\\": {\")\n      const indentation2 = indentation + indentation;\n      Object.keys(xmlNode.child).forEach( function(key) {\n        const node = xmlNode.child[key];\n\n        if(Array.isArray(node)){\n          console.log(indentation +  \"\\\"\"+key+\"\\\" :[\")\n          node.forEach( function(item,index) {\n            //console.log(indentation + \" \\\"\"+index+\"\\\" : [\")\n            print(item, indentation2);\n          })\n          console.log(indentation + \"],\")  \n        }else{\n          console.log(indentation + \" \\\"\"+key+\"\\\" : {\")\n          print(node, indentation2);\n          console.log(indentation + \"},\")  \n        }\n      });\n      console.log(indentation + \"},\")\n    }\n    console.log(indentation + \"},\")\n  }\n}\n","'use strict';\n\nconst nameStartChar = ':A-Za-z_\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD';\nconst nameChar = nameStartChar + '\\\\-.\\\\d\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040';\nconst nameRegexp = '[' + nameStartChar + '][' + nameChar + ']*'\nconst regexName = new RegExp('^' + nameRegexp + '$');\n\nconst getAllMatches = function(string, regex) {\n  const matches = [];\n  let match = regex.exec(string);\n  while (match) {\n    const allmatches = [];\n    allmatches.startIndex = regex.lastIndex - match[0].length;\n    const len = match.length;\n    for (let index = 0; index < len; index++) {\n      allmatches.push(match[index]);\n    }\n    matches.push(allmatches);\n    match = regex.exec(string);\n  }\n  return matches;\n};\n\nconst isName = function(string) {\n  const match = regexName.exec(string);\n  return !(match === null || typeof match === 'undefined');\n};\n\nexports.isExist = function(v) {\n  return typeof v !== 'undefined';\n};\n\nexports.isEmptyObject = function(obj) {\n  return Object.keys(obj).length === 0;\n};\n\n/**\n * Copy all the properties of a into b.\n * @param {*} target\n * @param {*} a\n */\nexports.merge = function(target, a, arrayMode) {\n  if (a) {\n    const keys = Object.keys(a); // will return an array of own properties\n    const len = keys.length; //don't make it inline\n    for (let i = 0; i < len; i++) {\n      if (arrayMode === 'strict') {\n        target[keys[i]] = [ a[keys[i]] ];\n      } else {\n        target[keys[i]] = a[keys[i]];\n      }\n    }\n  }\n};\n/* exports.merge =function (b,a){\n  return Object.assign(b,a);\n} */\n\nexports.getValue = function(v) {\n  if (exports.isExist(v)) {\n    return v;\n  } else {\n    return '';\n  }\n};\n\n// const fakeCall = function(a) {return a;};\n// const fakeCallNoReturn = function() {};\n\nexports.buildOptions = function(options, defaultOptions, props) {\n  let newOptions = {};\n  if (!options) {\n    return defaultOptions; //if there are not options\n  }\n\n  for (let i = 0; i < props.length; i++) {\n    if (options[props[i]] !== undefined) {\n      newOptions[props[i]] = options[props[i]];\n    } else {\n      newOptions[props[i]] = defaultOptions[props[i]];\n    }\n  }\n  return newOptions;\n};\n\n/**\n * Check if a tag name should be treated as array\n *\n * @param tagName the node tagname\n * @param arrayMode the array mode option\n * @param parentTagName the parent tag name\n * @returns {boolean} true if node should be parsed as array\n */\nexports.isTagNameInArrayMode = function (tagName, arrayMode, parentTagName) {\n  if (arrayMode === false) {\n    return false;\n  } else if (arrayMode instanceof RegExp) {\n    return arrayMode.test(tagName);\n  } else if (typeof arrayMode === 'function') {\n    return !!arrayMode(tagName, parentTagName);\n  }\n\n  return arrayMode === \"strict\";\n}\n\nexports.isName = isName;\nexports.getAllMatches = getAllMatches;\nexports.nameRegexp = nameRegexp;\n","'use strict';\n\nconst util = require('./util');\n\nconst defaultOptions = {\n  allowBooleanAttributes: false, //A tag can have attributes without any value\n};\n\nconst props = ['allowBooleanAttributes'];\n\n//const tagsPattern = new RegExp(\"<\\\\/?([\\\\w:\\\\-_\\.]+)\\\\s*\\/?>\",\"g\");\nexports.validate = function (xmlData, options) {\n  options = util.buildOptions(options, defaultOptions, props);\n\n  //xmlData = xmlData.replace(/(\\r\\n|\\n|\\r)/gm,\"\");//make it single line\n  //xmlData = xmlData.replace(/(^\\s*<\\?xml.*?\\?>)/g,\"\");//Remove XML starting tag\n  //xmlData = xmlData.replace(/(<!DOCTYPE[\\s\\w\\\"\\.\\/\\-\\:]+(\\[.*\\])*\\s*>)/g,\"\");//Remove DOCTYPE\n  const tags = [];\n  let tagFound = false;\n\n  //indicates that the root tag has been closed (aka. depth 0 has been reached)\n  let reachedRoot = false;\n\n  if (xmlData[0] === '\\ufeff') {\n    // check for byte order mark (BOM)\n    xmlData = xmlData.substr(1);\n  }\n\n  for (let i = 0; i < xmlData.length; i++) {\n\n    if (xmlData[i] === '<' && xmlData[i+1] === '?') {\n      i+=2;\n      i = readPI(xmlData,i);\n      if (i.err) return i;\n    }else if (xmlData[i] === '<') {\n      //starting of tag\n      //read until you reach to '>' avoiding any '>' in attribute value\n      let tagStartPos = i;\n      i++;\n      \n      if (xmlData[i] === '!') {\n        i = readCommentAndCDATA(xmlData, i);\n        continue;\n      } else {\n        let closingTag = false;\n        if (xmlData[i] === '/') {\n          //closing tag\n          closingTag = true;\n          i++;\n        }\n        //read tagname\n        let tagName = '';\n        for (; i < xmlData.length &&\n          xmlData[i] !== '>' &&\n          xmlData[i] !== ' ' &&\n          xmlData[i] !== '\\t' &&\n          xmlData[i] !== '\\n' &&\n          xmlData[i] !== '\\r'; i++\n        ) {\n          tagName += xmlData[i];\n        }\n        tagName = tagName.trim();\n        //console.log(tagName);\n\n        if (tagName[tagName.length - 1] === '/') {\n          //self closing tag without attributes\n          tagName = tagName.substring(0, tagName.length - 1);\n          //continue;\n          i--;\n        }\n        if (!validateTagName(tagName)) {\n          let msg;\n          if (tagName.trim().length === 0) {\n            msg = \"Invalid space after '<'.\";\n          } else {\n            msg = \"Tag '\"+tagName+\"' is an invalid name.\";\n          }\n          return getErrorObject('InvalidTag', msg, getLineNumberForPosition(xmlData, i));\n        }\n\n        const result = readAttributeStr(xmlData, i);\n        if (result === false) {\n          return getErrorObject('InvalidAttr', \"Attributes for '\"+tagName+\"' have open quote.\", getLineNumberForPosition(xmlData, i));\n        }\n        let attrStr = result.value;\n        i = result.index;\n\n        if (attrStr[attrStr.length - 1] === '/') {\n          //self closing tag\n          const attrStrStart = i - attrStr.length;\n          attrStr = attrStr.substring(0, attrStr.length - 1);\n          const isValid = validateAttributeString(attrStr, options);\n          if (isValid === true) {\n            tagFound = true;\n            //continue; //text may presents after self closing tag\n          } else {\n            //the result from the nested function returns the position of the error within the attribute\n            //in order to get the 'true' error line, we need to calculate the position where the attribute begins (i - attrStr.length) and then add the position within the attribute\n            //this gives us the absolute index in the entire xml, which we can use to find the line at last\n            return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line));\n          }\n        } else if (closingTag) {\n          if (!result.tagClosed) {\n            return getErrorObject('InvalidTag', \"Closing tag '\"+tagName+\"' doesn't have proper closing.\", getLineNumberForPosition(xmlData, i));\n          } else if (attrStr.trim().length > 0) {\n            return getErrorObject('InvalidTag', \"Closing tag '\"+tagName+\"' can't have attributes or invalid starting.\", getLineNumberForPosition(xmlData, tagStartPos));\n          } else {\n            const otg = tags.pop();\n            if (tagName !== otg.tagName) {\n              let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos);\n              return getErrorObject('InvalidTag',\n                \"Expected closing tag '\"+otg.tagName+\"' (opened in line \"+openPos.line+\", col \"+openPos.col+\") instead of closing tag '\"+tagName+\"'.\",\n                getLineNumberForPosition(xmlData, tagStartPos));\n            }\n\n            //when there are no more tags, we reached the root level.\n            if (tags.length == 0) {\n              reachedRoot = true;\n            }\n          }\n        } else {\n          const isValid = validateAttributeString(attrStr, options);\n          if (isValid !== true) {\n            //the result from the nested function returns the position of the error within the attribute\n            //in order to get the 'true' error line, we need to calculate the position where the attribute begins (i - attrStr.length) and then add the position within the attribute\n            //this gives us the absolute index in the entire xml, which we can use to find the line at last\n            return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line));\n          }\n\n          //if the root level has been reached before ...\n          if (reachedRoot === true) {\n            return getErrorObject('InvalidXml', 'Multiple possible root nodes found.', getLineNumberForPosition(xmlData, i));\n          } else {\n            tags.push({tagName, tagStartPos});\n          }\n          tagFound = true;\n        }\n\n        //skip tag text value\n        //It may include comments and CDATA value\n        for (i++; i < xmlData.length; i++) {\n          if (xmlData[i] === '<') {\n            if (xmlData[i + 1] === '!') {\n              //comment or CADATA\n              i++;\n              i = readCommentAndCDATA(xmlData, i);\n              continue;\n            } else if (xmlData[i+1] === '?') {\n              i = readPI(xmlData, ++i);\n              if (i.err) return i;\n            } else{\n              break;\n            }\n          } else if (xmlData[i] === '&') {\n            const afterAmp = validateAmpersand(xmlData, i);\n            if (afterAmp == -1)\n              return getErrorObject('InvalidChar', \"char '&' is not expected.\", getLineNumberForPosition(xmlData, i));\n            i = afterAmp;\n          }\n        } //end of reading tag text value\n        if (xmlData[i] === '<') {\n          i--;\n        }\n      }\n    } else {\n      if (xmlData[i] === ' ' || xmlData[i] === '\\t' || xmlData[i] === '\\n' || xmlData[i] === '\\r') {\n        continue;\n      }\n      return getErrorObject('InvalidChar', \"char '\"+xmlData[i]+\"' is not expected.\", getLineNumberForPosition(xmlData, i));\n    }\n  }\n\n  if (!tagFound) {\n    return getErrorObject('InvalidXml', 'Start tag expected.', 1);\n  }else if (tags.length == 1) {\n      return getErrorObject('InvalidTag', \"Unclosed tag '\"+tags[0].tagName+\"'.\", getLineNumberForPosition(xmlData, tags[0].tagStartPos));\n  }else if (tags.length > 0) {\n      return getErrorObject('InvalidXml', \"Invalid '\"+\n          JSON.stringify(tags.map(t => t.tagName), null, 4).replace(/\\r?\\n/g, '')+\n          \"' found.\", {line: 1, col: 1});\n  }\n\n  return true;\n};\n\n/**\n * Read Processing insstructions and skip\n * @param {*} xmlData\n * @param {*} i\n */\nfunction readPI(xmlData, i) {\n  const start = i;\n  for (; i < xmlData.length; i++) {\n    if (xmlData[i] == '?' || xmlData[i] == ' ') {\n      //tagname\n      const tagname = xmlData.substr(start, i - start);\n      if (i > 5 && tagname === 'xml') {\n        return getErrorObject('InvalidXml', 'XML declaration allowed only at the start of the document.', getLineNumberForPosition(xmlData, i));\n      } else if (xmlData[i] == '?' && xmlData[i + 1] == '>') {\n        //check if valid attribut string\n        i++;\n        break;\n      } else {\n        continue;\n      }\n    }\n  }\n  return i;\n}\n\nfunction readCommentAndCDATA(xmlData, i) {\n  if (xmlData.length > i + 5 && xmlData[i + 1] === '-' && xmlData[i + 2] === '-') {\n    //comment\n    for (i += 3; i < xmlData.length; i++) {\n      if (xmlData[i] === '-' && xmlData[i + 1] === '-' && xmlData[i + 2] === '>') {\n        i += 2;\n        break;\n      }\n    }\n  } else if (\n    xmlData.length > i + 8 &&\n    xmlData[i + 1] === 'D' &&\n    xmlData[i + 2] === 'O' &&\n    xmlData[i + 3] === 'C' &&\n    xmlData[i + 4] === 'T' &&\n    xmlData[i + 5] === 'Y' &&\n    xmlData[i + 6] === 'P' &&\n    xmlData[i + 7] === 'E'\n  ) {\n    let angleBracketsCount = 1;\n    for (i += 8; i < xmlData.length; i++) {\n      if (xmlData[i] === '<') {\n        angleBracketsCount++;\n      } else if (xmlData[i] === '>') {\n        angleBracketsCount--;\n        if (angleBracketsCount === 0) {\n          break;\n        }\n      }\n    }\n  } else if (\n    xmlData.length > i + 9 &&\n    xmlData[i + 1] === '[' &&\n    xmlData[i + 2] === 'C' &&\n    xmlData[i + 3] === 'D' &&\n    xmlData[i + 4] === 'A' &&\n    xmlData[i + 5] === 'T' &&\n    xmlData[i + 6] === 'A' &&\n    xmlData[i + 7] === '['\n  ) {\n    for (i += 8; i < xmlData.length; i++) {\n      if (xmlData[i] === ']' && xmlData[i + 1] === ']' && xmlData[i + 2] === '>') {\n        i += 2;\n        break;\n      }\n    }\n  }\n\n  return i;\n}\n\nconst doubleQuote = '\"';\nconst singleQuote = \"'\";\n\n/**\n * Keep reading xmlData until '<' is found outside the attribute value.\n * @param {string} xmlData\n * @param {number} i\n */\nfunction readAttributeStr(xmlData, i) {\n  let attrStr = '';\n  let startChar = '';\n  let tagClosed = false;\n  for (; i < xmlData.length; i++) {\n    if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) {\n      if (startChar === '') {\n        startChar = xmlData[i];\n      } else if (startChar !== xmlData[i]) {\n        //if vaue is enclosed with double quote then single quotes are allowed inside the value and vice versa\n      } else {\n        startChar = '';\n      }\n    } else if (xmlData[i] === '>') {\n      if (startChar === '') {\n        tagClosed = true;\n        break;\n      }\n    }\n    attrStr += xmlData[i];\n  }\n  if (startChar !== '') {\n    return false;\n  }\n\n  return {\n    value: attrStr,\n    index: i,\n    tagClosed: tagClosed\n  };\n}\n\n/**\n * Select all the attributes whether valid or invalid.\n */\nconst validAttrStrRegxp = new RegExp('(\\\\s*)([^\\\\s=]+)(\\\\s*=)?(\\\\s*([\\'\"])(([\\\\s\\\\S])*?)\\\\5)?', 'g');\n\n//attr, =\"sd\", a=\"amit's\", a=\"sd\"b=\"saf\", ab  cd=\"\"\n\nfunction validateAttributeString(attrStr, options) {\n  //console.log(\"start:\"+attrStr+\":end\");\n\n  //if(attrStr.trim().length === 0) return true; //empty string\n\n  const matches = util.getAllMatches(attrStr, validAttrStrRegxp);\n  const attrNames = {};\n\n  for (let i = 0; i < matches.length; i++) {\n    if (matches[i][1].length === 0) {\n      //nospace before attribute name: a=\"sd\"b=\"saf\"\n      return getErrorObject('InvalidAttr', \"Attribute '\"+matches[i][2]+\"' has no space in starting.\", getPositionFromMatch(matches[i]))\n    } else if (matches[i][3] === undefined && !options.allowBooleanAttributes) {\n      //independent attribute: ab\n      return getErrorObject('InvalidAttr', \"boolean attribute '\"+matches[i][2]+\"' is not allowed.\", getPositionFromMatch(matches[i]));\n    }\n    /* else if(matches[i][6] === undefined){//attribute without value: ab=\n                    return { err: { code:\"InvalidAttr\",msg:\"attribute \" + matches[i][2] + \" has no value assigned.\"}};\n                } */\n    const attrName = matches[i][2];\n    if (!validateAttrName(attrName)) {\n      return getErrorObject('InvalidAttr', \"Attribute '\"+attrName+\"' is an invalid name.\", getPositionFromMatch(matches[i]));\n    }\n    if (!attrNames.hasOwnProperty(attrName)) {\n      //check for duplicate attribute.\n      attrNames[attrName] = 1;\n    } else {\n      return getErrorObject('InvalidAttr', \"Attribute '\"+attrName+\"' is repeated.\", getPositionFromMatch(matches[i]));\n    }\n  }\n\n  return true;\n}\n\nfunction validateNumberAmpersand(xmlData, i) {\n  let re = /\\d/;\n  if (xmlData[i] === 'x') {\n    i++;\n    re = /[\\da-fA-F]/;\n  }\n  for (; i < xmlData.length; i++) {\n    if (xmlData[i] === ';')\n      return i;\n    if (!xmlData[i].match(re))\n      break;\n  }\n  return -1;\n}\n\nfunction validateAmpersand(xmlData, i) {\n  // https://www.w3.org/TR/xml/#dt-charref\n  i++;\n  if (xmlData[i] === ';')\n    return -1;\n  if (xmlData[i] === '#') {\n    i++;\n    return validateNumberAmpersand(xmlData, i);\n  }\n  let count = 0;\n  for (; i < xmlData.length; i++, count++) {\n    if (xmlData[i].match(/\\w/) && count < 20)\n      continue;\n    if (xmlData[i] === ';')\n      break;\n    return -1;\n  }\n  return i;\n}\n\nfunction getErrorObject(code, message, lineNumber) {\n  return {\n    err: {\n      code: code,\n      msg: message,\n      line: lineNumber.line || lineNumber,\n      col: lineNumber.col,\n    },\n  };\n}\n\nfunction validateAttrName(attrName) {\n  return util.isName(attrName);\n}\n\n// const startsWithXML = /^xml/i;\n\nfunction validateTagName(tagname) {\n  return util.isName(tagname) /* && !tagname.match(startsWithXML) */;\n}\n\n//this function returns the line number for the character at the given index\nfunction getLineNumberForPosition(xmlData, index) {\n  const lines = xmlData.substring(0, index).split(/\\r?\\n/);\n  return {\n    line: lines.length,\n\n    // column number is last line's length + 1, because column numbering starts at 1:\n    col: lines[lines.length - 1].length + 1\n  };\n}\n\n//this function returns the position of the first character of match within attrStr\nfunction getPositionFromMatch(match) {\n  return match.startIndex + match[1].length;\n}\n","'use strict';\n\nmodule.exports = function(tagname, parent, val) {\n  this.tagname = tagname;\n  this.parent = parent;\n  this.child = {}; //child tags\n  this.attrsMap = {}; //attributes map\n  this.val = val; //text only\n  this.addChild = function(child) {\n    if (Array.isArray(this.child[child.tagname])) {\n      //already presents\n      this.child[child.tagname].push(child);\n    } else {\n      this.child[child.tagname] = [child];\n    }\n  };\n};\n","'use strict';\n\nconst util = require('./util');\nconst buildOptions = require('./util').buildOptions;\nconst xmlNode = require('./xmlNode');\nconst toNumber = require(\"strnum\");\n\nconst regx =\n  '<((!\\\\[CDATA\\\\[([\\\\s\\\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\\\/)(NAME)\\\\s*>))([^<]*)'\n  .replace(/NAME/g, util.nameRegexp);\n\n//const tagsRegx = new RegExp(\"<(\\\\/?[\\\\w:\\\\-\\._]+)([^>]*)>(\\\\s*\"+cdataRegx+\")*([^<]+)?\",\"g\");\n//const tagsRegx = new RegExp(\"<(\\\\/?)((\\\\w*:)?([\\\\w:\\\\-\\._]+))([^>]*)>([^<]*)(\"+cdataRegx+\"([^<]*))*([^<]+)?\",\"g\");\n\n//polyfill\nif (!Number.parseInt && window.parseInt) {\n  Number.parseInt = window.parseInt;\n}\nif (!Number.parseFloat && window.parseFloat) {\n  Number.parseFloat = window.parseFloat;\n}\n\nconst defaultOptions = {\n  attributeNamePrefix: '@_',\n  attrNodeName: false,\n  textNodeName: '#text',\n  ignoreAttributes: true,\n  ignoreNameSpace: false,\n  allowBooleanAttributes: false, //a tag can have attributes without any value\n  //ignoreRootElement : false,\n  parseNodeValue: true,\n  parseAttributeValue: false,\n  arrayMode: false,\n  trimValues: true, //Trim string values of tag and attributes\n  cdataTagName: false,\n  cdataPositionChar: '\\\\c',\n  numParseOptions: {\n    hex: true,\n    leadingZeros: true\n  },\n  tagValueProcessor: function(a, tagName) {\n    return a;\n  },\n  attrValueProcessor: function(a, attrName) {\n    return a;\n  },\n  stopNodes: [],\n  alwaysCreateTextNode: false\n  //decodeStrict: false,\n};\n\nexports.defaultOptions = defaultOptions;\n\nconst props = [\n  'attributeNamePrefix',\n  'attrNodeName',\n  'textNodeName',\n  'ignoreAttributes',\n  'ignoreNameSpace',\n  'allowBooleanAttributes',\n  'parseNodeValue',\n  'parseAttributeValue',\n  'arrayMode',\n  'trimValues',\n  'cdataTagName',\n  'cdataPositionChar',\n  'tagValueProcessor',\n  'attrValueProcessor',\n  'parseTrueNumberOnly',\n  'numParseOptions',\n  'stopNodes',\n  'alwaysCreateTextNode'\n];\nexports.props = props;\n\n/**\n * Trim -> valueProcessor -> parse value\n * @param {string} tagName\n * @param {string} val\n * @param {object} options\n */\nfunction processTagValue(tagName, val, options) {\n  if (val) {\n    if (options.trimValues) {\n      val = val.trim();\n    }\n    val = options.tagValueProcessor(val, tagName);\n    val = parseValue(val, options.parseNodeValue, options.numParseOptions);\n  }\n\n  return val;\n}\n\nfunction resolveNameSpace(tagname, options) {\n  if (options.ignoreNameSpace) {\n    const tags = tagname.split(':');\n    const prefix = tagname.charAt(0) === '/' ? '/' : '';\n    if (tags[0] === 'xmlns') {\n      return '';\n    }\n    if (tags.length === 2) {\n      tagname = prefix + tags[1];\n    }\n  }\n  return tagname;\n}\n\nfunction parseValue(val, shouldParse, options) {\n  if (shouldParse && typeof val === 'string') {\n    //console.log(options)\n    const newval = val.trim();\n    if(newval === 'true' ) return true;\n    else if(newval === 'false' ) return false;\n    else return toNumber(val, options);\n  } else {\n    if (util.isExist(val)) {\n      return val;\n    } else {\n      return '';\n    }\n  }\n}\n\n//TODO: change regex to capture NS\n//const attrsRegx = new RegExp(\"([\\\\w\\\\-\\\\.\\\\:]+)\\\\s*=\\\\s*(['\\\"])((.|\\n)*?)\\\\2\",\"gm\");\nconst attrsRegx = new RegExp('([^\\\\s=]+)\\\\s*(=\\\\s*([\\'\"])(.*?)\\\\3)?', 'g');\n\nfunction buildAttributesMap(attrStr, options) {\n  if (!options.ignoreAttributes && typeof attrStr === 'string') {\n    attrStr = attrStr.replace(/\\r?\\n/g, ' ');\n    //attrStr = attrStr || attrStr.trim();\n\n    const matches = util.getAllMatches(attrStr, attrsRegx);\n    const len = matches.length; //don't make it inline\n    const attrs = {};\n    for (let i = 0; i < len; i++) {\n      const attrName = resolveNameSpace(matches[i][1], options);\n      if (attrName.length) {\n        if (matches[i][4] !== undefined) {\n          if (options.trimValues) {\n            matches[i][4] = matches[i][4].trim();\n          }\n          matches[i][4] = options.attrValueProcessor(matches[i][4], attrName);\n          attrs[options.attributeNamePrefix + attrName] = parseValue(\n            matches[i][4],\n            options.parseAttributeValue,\n            options.numParseOptions\n          );\n        } else if (options.allowBooleanAttributes) {\n          attrs[options.attributeNamePrefix + attrName] = true;\n        }\n      }\n    }\n    if (!Object.keys(attrs).length) {\n      return;\n    }\n    if (options.attrNodeName) {\n      const attrCollection = {};\n      attrCollection[options.attrNodeName] = attrs;\n      return attrCollection;\n    }\n    return attrs;\n  }\n}\n\nconst getTraversalObj = function(xmlData, options) {\n  xmlData = xmlData.replace(/\\r\\n?/g, \"\\n\");\n  options = buildOptions(options, defaultOptions, props);\n  const xmlObj = new xmlNode('!xml');\n  let currentNode = xmlObj;\n  let textData = \"\";\n\n//function match(xmlData){\n  for(let i=0; i< xmlData.length; i++){\n    const ch = xmlData[i];\n    if(ch === '<'){\n      if( xmlData[i+1] === '/') {//Closing Tag\n        const closeIndex = findClosingIndex(xmlData, \">\", i, \"Closing Tag is not closed.\")\n        let tagName = xmlData.substring(i+2,closeIndex).trim();\n\n        if(options.ignoreNameSpace){\n          const colonIndex = tagName.indexOf(\":\");\n          if(colonIndex !== -1){\n            tagName = tagName.substr(colonIndex+1);\n          }\n        }\n\n        /* if (currentNode.parent) {\n          currentNode.parent.val = util.getValue(currentNode.parent.val) + '' + processTagValue2(tagName, textData , options);\n        } */\n        if(currentNode){\n          if(currentNode.val){\n            currentNode.val = util.getValue(currentNode.val) + '' + processTagValue(tagName, textData , options);\n          }else{\n            currentNode.val = processTagValue(tagName, textData , options);\n          }\n        }\n\n        if (options.stopNodes.length && options.stopNodes.includes(currentNode.tagname)) {\n          currentNode.child = []\n          if (currentNode.attrsMap == undefined) { currentNode.attrsMap = {}}\n          currentNode.val = xmlData.substr(currentNode.startIndex + 1, i - currentNode.startIndex - 1)\n        }\n        currentNode = currentNode.parent;\n        textData = \"\";\n        i = closeIndex;\n      } else if( xmlData[i+1] === '?') {\n        i = findClosingIndex(xmlData, \"?>\", i, \"Pi Tag is not closed.\")\n      } else if(xmlData.substr(i + 1, 3) === '!--') {\n        i = findClosingIndex(xmlData, \"-->\", i, \"Comment is not closed.\")\n      } else if( xmlData.substr(i + 1, 2) === '!D') {\n        const closeIndex = findClosingIndex(xmlData, \">\", i, \"DOCTYPE is not closed.\")\n        const tagExp = xmlData.substring(i, closeIndex);\n        if(tagExp.indexOf(\"[\") >= 0){\n          i = xmlData.indexOf(\"]>\", i) + 1;\n        }else{\n          i = closeIndex;\n        }\n      }else if(xmlData.substr(i + 1, 2) === '![') {\n        const closeIndex = findClosingIndex(xmlData, \"]]>\", i, \"CDATA is not closed.\") - 2\n        const tagExp = xmlData.substring(i + 9,closeIndex);\n\n        //considerations\n        //1. CDATA will always have parent node\n        //2. A tag with CDATA is not a leaf node so it's value would be string type.\n        if(textData){\n          currentNode.val = util.getValue(currentNode.val) + '' + processTagValue(currentNode.tagname, textData , options);\n          textData = \"\";\n        }\n\n        if (options.cdataTagName) {\n          //add cdata node\n          const childNode = new xmlNode(options.cdataTagName, currentNode, tagExp);\n          currentNode.addChild(childNode);\n          //for backtracking\n          currentNode.val = util.getValue(currentNode.val) + options.cdataPositionChar;\n          //add rest value to parent node\n          if (tagExp) {\n            childNode.val = tagExp;\n          }\n        } else {\n          currentNode.val = (currentNode.val || '') + (tagExp || '');\n        }\n\n        i = closeIndex + 2;\n      }else {//Opening tag\n        const result = closingIndexForOpeningTag(xmlData, i+1)\n        let tagExp = result.data;\n        const closeIndex = result.index;\n        const separatorIndex = tagExp.indexOf(\" \");\n        let tagName = tagExp;\n        let shouldBuildAttributesMap = true;\n        if(separatorIndex !== -1){\n          tagName = tagExp.substr(0, separatorIndex).replace(/\\s\\s*$/, '');\n          tagExp = tagExp.substr(separatorIndex + 1);\n        }\n\n        if(options.ignoreNameSpace){\n          const colonIndex = tagName.indexOf(\":\");\n          if(colonIndex !== -1){\n            tagName = tagName.substr(colonIndex+1);\n            shouldBuildAttributesMap = tagName !== result.data.substr(colonIndex + 1);\n          }\n        }\n\n        //save text to parent node\n        if (currentNode && textData) {\n          if(currentNode.tagname !== '!xml'){\n            currentNode.val = util.getValue(currentNode.val) + '' + processTagValue( currentNode.tagname, textData, options);\n          }\n        }\n\n        if(tagExp.length > 0 && tagExp.lastIndexOf(\"/\") === tagExp.length - 1){//selfClosing tag\n\n          if(tagName[tagName.length - 1] === \"/\"){ //remove trailing '/'\n            tagName = tagName.substr(0, tagName.length - 1);\n            tagExp = tagName;\n          }else{\n            tagExp = tagExp.substr(0, tagExp.length - 1);\n          }\n\n          const childNode = new xmlNode(tagName, currentNode, '');\n          if(tagName !== tagExp){\n            childNode.attrsMap = buildAttributesMap(tagExp, options);\n          }\n          currentNode.addChild(childNode);\n        }else{//opening tag\n\n          const childNode = new xmlNode( tagName, currentNode );\n          if (options.stopNodes.length && options.stopNodes.includes(childNode.tagname)) {\n            childNode.startIndex=closeIndex;\n          }\n          if(tagName !== tagExp && shouldBuildAttributesMap){\n            childNode.attrsMap = buildAttributesMap(tagExp, options);\n          }\n          currentNode.addChild(childNode);\n          currentNode = childNode;\n        }\n        textData = \"\";\n        i = closeIndex;\n      }\n    }else{\n      textData += xmlData[i];\n    }\n  }\n  return xmlObj;\n}\n\nfunction closingIndexForOpeningTag(data, i){\n  let attrBoundary;\n  let tagExp = \"\";\n  for (let index = i; index < data.length; index++) {\n    let ch = data[index];\n    if (attrBoundary) {\n        if (ch === attrBoundary) attrBoundary = \"\";//reset\n    } else if (ch === '\"' || ch === \"'\") {\n        attrBoundary = ch;\n    } else if (ch === '>') {\n        return {\n          data: tagExp,\n          index: index\n        }\n    } else if (ch === '\\t') {\n      ch = \" \"\n    }\n    tagExp += ch;\n  }\n}\n\nfunction findClosingIndex(xmlData, str, i, errMsg){\n  const closingIndex = xmlData.indexOf(str, i);\n  if(closingIndex === -1){\n    throw new Error(errMsg)\n  }else{\n    return closingIndex + str.length - 1;\n  }\n}\n\nexports.getTraversalObj = getTraversalObj;\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { registerVersion } from '@firebase/app';\nimport { name, version } from '../package.json';\n\nregisterVersion(name, version, 'app');\nexport * from '@firebase/app';\n","import { tabbable, focusable, isFocusable, isTabbable } from 'tabbable';\n\nconst activeFocusTraps = {\n  activateTrap(trapStack, trap) {\n    if (trapStack.length > 0) {\n      const activeTrap = trapStack[trapStack.length - 1];\n      if (activeTrap !== trap) {\n        activeTrap.pause();\n      }\n    }\n\n    const trapIndex = trapStack.indexOf(trap);\n    if (trapIndex === -1) {\n      trapStack.push(trap);\n    } else {\n      // move this existing trap to the front of the queue\n      trapStack.splice(trapIndex, 1);\n      trapStack.push(trap);\n    }\n  },\n\n  deactivateTrap(trapStack, trap) {\n    const trapIndex = trapStack.indexOf(trap);\n    if (trapIndex !== -1) {\n      trapStack.splice(trapIndex, 1);\n    }\n\n    if (trapStack.length > 0) {\n      trapStack[trapStack.length - 1].unpause();\n    }\n  },\n};\n\nconst isSelectableInput = function (node) {\n  return (\n    node.tagName &&\n    node.tagName.toLowerCase() === 'input' &&\n    typeof node.select === 'function'\n  );\n};\n\nconst isEscapeEvent = function (e) {\n  return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;\n};\n\nconst isTabEvent = function (e) {\n  return e.key === 'Tab' || e.keyCode === 9;\n};\n\n// checks for TAB by default\nconst isKeyForward = function (e) {\n  return isTabEvent(e) && !e.shiftKey;\n};\n\n// checks for SHIFT+TAB by default\nconst isKeyBackward = function (e) {\n  return isTabEvent(e) && e.shiftKey;\n};\n\nconst delay = function (fn) {\n  return setTimeout(fn, 0);\n};\n\n// Array.find/findIndex() are not supported on IE; this replicates enough\n//  of Array.findIndex() for our needs\nconst findIndex = function (arr, fn) {\n  let idx = -1;\n\n  arr.every(function (value, i) {\n    if (fn(value)) {\n      idx = i;\n      return false; // break\n    }\n\n    return true; // next\n  });\n\n  return idx;\n};\n\n/**\n * Get an option's value when it could be a plain value, or a handler that provides\n *  the value.\n * @param {*} value Option's value to check.\n * @param {...*} [params] Any parameters to pass to the handler, if `value` is a function.\n * @returns {*} The `value`, or the handler's returned value.\n */\nconst valueOrHandler = function (value, ...params) {\n  return typeof value === 'function' ? value(...params) : value;\n};\n\nconst getActualTarget = function (event) {\n  // NOTE: If the trap is _inside_ a shadow DOM, event.target will always be the\n  //  shadow host. However, event.target.composedPath() will be an array of\n  //  nodes \"clicked\" from inner-most (the actual element inside the shadow) to\n  //  outer-most (the host HTML document). If we have access to composedPath(),\n  //  then use its first element; otherwise, fall back to event.target (and\n  //  this only works for an _open_ shadow DOM; otherwise,\n  //  composedPath()[0] === event.target always).\n  return event.target.shadowRoot && typeof event.composedPath === 'function'\n    ? event.composedPath()[0]\n    : event.target;\n};\n\n// NOTE: this must be _outside_ `createFocusTrap()` to make sure all traps in this\n//  current instance use the same stack if `userOptions.trapStack` isn't specified\nconst internalTrapStack = [];\n\nconst createFocusTrap = function (elements, userOptions) {\n  // SSR: a live trap shouldn't be created in this type of environment so this\n  //  should be safe code to execute if the `document` option isn't specified\n  const doc = userOptions?.document || document;\n\n  const trapStack = userOptions?.trapStack || internalTrapStack;\n\n  const config = {\n    returnFocusOnDeactivate: true,\n    escapeDeactivates: true,\n    delayInitialFocus: true,\n    isKeyForward,\n    isKeyBackward,\n    ...userOptions,\n  };\n\n  const state = {\n    // containers given to createFocusTrap()\n    // @type {Array<HTMLElement>}\n    containers: [],\n\n    // list of objects identifying tabbable nodes in `containers` in the trap\n    // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap\n    //  is active, but the trap should never get to a state where there isn't at least one group\n    //  with at least one tabbable node in it (that would lead to an error condition that would\n    //  result in an error being thrown)\n    // @type {Array<{\n    //   container: HTMLElement,\n    //   tabbableNodes: Array<HTMLElement>, // empty if none\n    //   focusableNodes: Array<HTMLElement>, // empty if none\n    //   firstTabbableNode: HTMLElement|null,\n    //   lastTabbableNode: HTMLElement|null,\n    //   nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined\n    // }>}\n    containerGroups: [], // same order/length as `containers` list\n\n    // references to objects in `containerGroups`, but only those that actually have\n    //  tabbable nodes in them\n    // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__\n    //  the same length\n    tabbableGroups: [],\n\n    nodeFocusedBeforeActivation: null,\n    mostRecentlyFocusedNode: null,\n    active: false,\n    paused: false,\n\n    // timer ID for when delayInitialFocus is true and initial focus in this trap\n    //  has been delayed during activation\n    delayInitialFocusTimer: undefined,\n  };\n\n  let trap; // eslint-disable-line prefer-const -- some private functions reference it, and its methods reference private functions, so we must declare here and define later\n\n  /**\n   * Gets a configuration option value.\n   * @param {Object|undefined} configOverrideOptions If true, and option is defined in this set,\n   *  value will be taken from this object. Otherwise, value will be taken from base configuration.\n   * @param {string} optionName Name of the option whose value is sought.\n   * @param {string|undefined} [configOptionName] Name of option to use __instead of__ `optionName`\n   *  IIF `configOverrideOptions` is not defined. Otherwise, `optionName` is used.\n   */\n  const getOption = (configOverrideOptions, optionName, configOptionName) => {\n    return configOverrideOptions &&\n      configOverrideOptions[optionName] !== undefined\n      ? configOverrideOptions[optionName]\n      : config[configOptionName || optionName];\n  };\n\n  /**\n   * Finds the index of the container that contains the element.\n   * @param {HTMLElement} element\n   * @returns {number} Index of the container in either `state.containers` or\n   *  `state.containerGroups` (the order/length of these lists are the same); -1\n   *  if the element isn't found.\n   */\n  const findContainerIndex = function (element) {\n    // NOTE: search `containerGroups` because it's possible a group contains no tabbable\n    //  nodes, but still contains focusable nodes (e.g. if they all have `tabindex=-1`)\n    //  and we still need to find the element in there\n    return state.containerGroups.findIndex(\n      ({ container, tabbableNodes }) =>\n        container.contains(element) ||\n        // fall back to explicit tabbable search which will take into consideration any\n        //  web components if the `tabbableOptions.getShadowRoot` option was used for\n        //  the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't\n        //  look inside web components even if open)\n        tabbableNodes.find((node) => node === element)\n    );\n  };\n\n  /**\n   * Gets the node for the given option, which is expected to be an option that\n   *  can be either a DOM node, a string that is a selector to get a node, `false`\n   *  (if a node is explicitly NOT given), or a function that returns any of these\n   *  values.\n   * @param {string} optionName\n   * @returns {undefined | false | HTMLElement | SVGElement} Returns\n   *  `undefined` if the option is not specified; `false` if the option\n   *  resolved to `false` (node explicitly not given); otherwise, the resolved\n   *  DOM node.\n   * @throws {Error} If the option is set, not `false`, and is not, or does not\n   *  resolve to a node.\n   */\n  const getNodeForOption = function (optionName, ...params) {\n    let optionValue = config[optionName];\n\n    if (typeof optionValue === 'function') {\n      optionValue = optionValue(...params);\n    }\n\n    if (optionValue === true) {\n      optionValue = undefined; // use default value\n    }\n\n    if (!optionValue) {\n      if (optionValue === undefined || optionValue === false) {\n        return optionValue;\n      }\n      // else, empty string (invalid), null (invalid), 0 (invalid)\n\n      throw new Error(\n        `\\`${optionName}\\` was specified but was not a node, or did not return a node`\n      );\n    }\n\n    let node = optionValue; // could be HTMLElement, SVGElement, or non-empty string at this point\n\n    if (typeof optionValue === 'string') {\n      node = doc.querySelector(optionValue); // resolve to node, or null if fails\n      if (!node) {\n        throw new Error(\n          `\\`${optionName}\\` as selector refers to no known node`\n        );\n      }\n    }\n\n    return node;\n  };\n\n  const getInitialFocusNode = function () {\n    let node = getNodeForOption('initialFocus');\n\n    // false explicitly indicates we want no initialFocus at all\n    if (node === false) {\n      return false;\n    }\n\n    if (node === undefined) {\n      // option not specified: use fallback options\n      if (findContainerIndex(doc.activeElement) >= 0) {\n        node = doc.activeElement;\n      } else {\n        const firstTabbableGroup = state.tabbableGroups[0];\n        const firstTabbableNode =\n          firstTabbableGroup && firstTabbableGroup.firstTabbableNode;\n\n        // NOTE: `fallbackFocus` option function cannot return `false` (not supported)\n        node = firstTabbableNode || getNodeForOption('fallbackFocus');\n      }\n    }\n\n    if (!node) {\n      throw new Error(\n        'Your focus-trap needs to have at least one focusable element'\n      );\n    }\n\n    return node;\n  };\n\n  const updateTabbableNodes = function () {\n    state.containerGroups = state.containers.map((container) => {\n      const tabbableNodes = tabbable(container, config.tabbableOptions);\n\n      // NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes\n      //  are a superset of tabbable nodes\n      const focusableNodes = focusable(container, config.tabbableOptions);\n\n      return {\n        container,\n        tabbableNodes,\n        focusableNodes,\n        firstTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[0] : null,\n        lastTabbableNode:\n          tabbableNodes.length > 0\n            ? tabbableNodes[tabbableNodes.length - 1]\n            : null,\n\n        /**\n         * Finds the __tabbable__ node that follows the given node in the specified direction,\n         *  in this container, if any.\n         * @param {HTMLElement} node\n         * @param {boolean} [forward] True if going in forward tab order; false if going\n         *  in reverse.\n         * @returns {HTMLElement|undefined} The next tabbable node, if any.\n         */\n        nextTabbableNode(node, forward = true) {\n          // NOTE: If tabindex is positive (in order to manipulate the tab order separate\n          //  from the DOM order), this __will not work__ because the list of focusableNodes,\n          //  while it contains tabbable nodes, does not sort its nodes in any order other\n          //  than DOM order, because it can't: Where would you place focusable (but not\n          //  tabbable) nodes in that order? They have no order, because they aren't tabbale...\n          // Support for positive tabindex is already broken and hard to manage (possibly\n          //  not supportable, TBD), so this isn't going to make things worse than they\n          //  already are, and at least makes things better for the majority of cases where\n          //  tabindex is either 0/unset or negative.\n          // FYI, positive tabindex issue: https://github.com/focus-trap/focus-trap/issues/375\n          const nodeIdx = focusableNodes.findIndex((n) => n === node);\n          if (nodeIdx < 0) {\n            return undefined;\n          }\n\n          if (forward) {\n            return focusableNodes\n              .slice(nodeIdx + 1)\n              .find((n) => isTabbable(n, config.tabbableOptions));\n          }\n\n          return focusableNodes\n            .slice(0, nodeIdx)\n            .reverse()\n            .find((n) => isTabbable(n, config.tabbableOptions));\n        },\n      };\n    });\n\n    state.tabbableGroups = state.containerGroups.filter(\n      (group) => group.tabbableNodes.length > 0\n    );\n\n    // throw if no groups have tabbable nodes and we don't have a fallback focus node either\n    if (\n      state.tabbableGroups.length <= 0 &&\n      !getNodeForOption('fallbackFocus') // returning false not supported for this option\n    ) {\n      throw new Error(\n        'Your focus-trap must have at least one container with at least one tabbable node in it at all times'\n      );\n    }\n  };\n\n  const tryFocus = function (node) {\n    if (node === false) {\n      return;\n    }\n\n    if (node === doc.activeElement) {\n      return;\n    }\n\n    if (!node || !node.focus) {\n      tryFocus(getInitialFocusNode());\n      return;\n    }\n\n    node.focus({ preventScroll: !!config.preventScroll });\n    state.mostRecentlyFocusedNode = node;\n\n    if (isSelectableInput(node)) {\n      node.select();\n    }\n  };\n\n  const getReturnFocusNode = function (previousActiveElement) {\n    const node = getNodeForOption('setReturnFocus', previousActiveElement);\n    return node ? node : node === false ? false : previousActiveElement;\n  };\n\n  // This needs to be done on mousedown and touchstart instead of click\n  // so that it precedes the focus event.\n  const checkPointerDown = function (e) {\n    const target = getActualTarget(e);\n\n    if (findContainerIndex(target) >= 0) {\n      // allow the click since it ocurred inside the trap\n      return;\n    }\n\n    if (valueOrHandler(config.clickOutsideDeactivates, e)) {\n      // immediately deactivate the trap\n      trap.deactivate({\n        // if, on deactivation, we should return focus to the node originally-focused\n        //  when the trap was activated (or the configured `setReturnFocus` node),\n        //  then assume it's also OK to return focus to the outside node that was\n        //  just clicked, causing deactivation, as long as that node is focusable;\n        //  if it isn't focusable, then return focus to the original node focused\n        //  on activation (or the configured `setReturnFocus` node)\n        // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,\n        //  which will result in the outside click setting focus to the node\n        //  that was clicked, whether it's focusable or not; by setting\n        //  `returnFocus: true`, we'll attempt to re-focus the node originally-focused\n        //  on activation (or the configured `setReturnFocus` node)\n        returnFocus:\n          config.returnFocusOnDeactivate &&\n          !isFocusable(target, config.tabbableOptions),\n      });\n      return;\n    }\n\n    // This is needed for mobile devices.\n    // (If we'll only let `click` events through,\n    // then on mobile they will be blocked anyways if `touchstart` is blocked.)\n    if (valueOrHandler(config.allowOutsideClick, e)) {\n      // allow the click outside the trap to take place\n      return;\n    }\n\n    // otherwise, prevent the click\n    e.preventDefault();\n  };\n\n  // In case focus escapes the trap for some strange reason, pull it back in.\n  const checkFocusIn = function (e) {\n    const target = getActualTarget(e);\n    const targetContained = findContainerIndex(target) >= 0;\n\n    // In Firefox when you Tab out of an iframe the Document is briefly focused.\n    if (targetContained || target instanceof Document) {\n      if (targetContained) {\n        state.mostRecentlyFocusedNode = target;\n      }\n    } else {\n      // escaped! pull it back in to where it just left\n      e.stopImmediatePropagation();\n      tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());\n    }\n  };\n\n  // Hijack key nav events on the first and last focusable nodes of the trap,\n  // in order to prevent focus from escaping. If it escapes for even a\n  // moment it can end up scrolling the page and causing confusion so we\n  // kind of need to capture the action at the keydown phase.\n  const checkKeyNav = function (event, isBackward = false) {\n    const target = getActualTarget(event);\n    updateTabbableNodes();\n\n    let destinationNode = null;\n\n    if (state.tabbableGroups.length > 0) {\n      // make sure the target is actually contained in a group\n      // NOTE: the target may also be the container itself if it's focusable\n      //  with tabIndex='-1' and was given initial focus\n      const containerIndex = findContainerIndex(target);\n      const containerGroup =\n        containerIndex >= 0 ? state.containerGroups[containerIndex] : undefined;\n\n      if (containerIndex < 0) {\n        // target not found in any group: quite possible focus has escaped the trap,\n        //  so bring it back into...\n        if (isBackward) {\n          // ...the last node in the last group\n          destinationNode =\n            state.tabbableGroups[state.tabbableGroups.length - 1]\n              .lastTabbableNode;\n        } else {\n          // ...the first node in the first group\n          destinationNode = state.tabbableGroups[0].firstTabbableNode;\n        }\n      } else if (isBackward) {\n        // REVERSE\n\n        // is the target the first tabbable node in a group?\n        let startOfGroupIndex = findIndex(\n          state.tabbableGroups,\n          ({ firstTabbableNode }) => target === firstTabbableNode\n        );\n\n        if (\n          startOfGroupIndex < 0 &&\n          (containerGroup.container === target ||\n            (isFocusable(target, config.tabbableOptions) &&\n              !isTabbable(target, config.tabbableOptions) &&\n              !containerGroup.nextTabbableNode(target, false)))\n        ) {\n          // an exception case where the target is either the container itself, or\n          //  a non-tabbable node that was given focus (i.e. tabindex is negative\n          //  and user clicked on it or node was programmatically given focus)\n          //  and is not followed by any other tabbable node, in which\n          //  case, we should handle shift+tab as if focus were on the container's\n          //  first tabbable node, and go to the last tabbable node of the LAST group\n          startOfGroupIndex = containerIndex;\n        }\n\n        if (startOfGroupIndex >= 0) {\n          // YES: then shift+tab should go to the last tabbable node in the\n          //  previous group (and wrap around to the last tabbable node of\n          //  the LAST group if it's the first tabbable node of the FIRST group)\n          const destinationGroupIndex =\n            startOfGroupIndex === 0\n              ? state.tabbableGroups.length - 1\n              : startOfGroupIndex - 1;\n\n          const destinationGroup = state.tabbableGroups[destinationGroupIndex];\n          destinationNode = destinationGroup.lastTabbableNode;\n        } else if (!isTabEvent(event)) {\n          // user must have customized the nav keys so we have to move focus manually _within_\n          //  the active group: do this based on the order determined by tabbable()\n          destinationNode = containerGroup.nextTabbableNode(target, false);\n        }\n      } else {\n        // FORWARD\n\n        // is the target the last tabbable node in a group?\n        let lastOfGroupIndex = findIndex(\n          state.tabbableGroups,\n          ({ lastTabbableNode }) => target === lastTabbableNode\n        );\n\n        if (\n          lastOfGroupIndex < 0 &&\n          (containerGroup.container === target ||\n            (isFocusable(target, config.tabbableOptions) &&\n              !isTabbable(target, config.tabbableOptions) &&\n              !containerGroup.nextTabbableNode(target)))\n        ) {\n          // an exception case where the target is the container itself, or\n          //  a non-tabbable node that was given focus (i.e. tabindex is negative\n          //  and user clicked on it or node was programmatically given focus)\n          //  and is not followed by any other tabbable node, in which\n          //  case, we should handle tab as if focus were on the container's\n          //  last tabbable node, and go to the first tabbable node of the FIRST group\n          lastOfGroupIndex = containerIndex;\n        }\n\n        if (lastOfGroupIndex >= 0) {\n          // YES: then tab should go to the first tabbable node in the next\n          //  group (and wrap around to the first tabbable node of the FIRST\n          //  group if it's the last tabbable node of the LAST group)\n          const destinationGroupIndex =\n            lastOfGroupIndex === state.tabbableGroups.length - 1\n              ? 0\n              : lastOfGroupIndex + 1;\n\n          const destinationGroup = state.tabbableGroups[destinationGroupIndex];\n          destinationNode = destinationGroup.firstTabbableNode;\n        } else if (!isTabEvent(event)) {\n          // user must have customized the nav keys so we have to move focus manually _within_\n          //  the active group: do this based on the order determined by tabbable()\n          destinationNode = containerGroup.nextTabbableNode(target);\n        }\n      }\n    } else {\n      // no groups available\n      // NOTE: the fallbackFocus option does not support returning false to opt-out\n      destinationNode = getNodeForOption('fallbackFocus');\n    }\n\n    if (destinationNode) {\n      if (isTabEvent(event)) {\n        // since tab natively moves focus, we wouldn't have a destination node unless we\n        //  were on the edge of a container and had to move to the next/previous edge, in\n        //  which case we want to prevent default to keep the browser from moving focus\n        //  to where it normally would\n        event.preventDefault();\n      }\n      tryFocus(destinationNode);\n    }\n    // else, let the browser take care of [shift+]tab and move the focus\n  };\n\n  const checkKey = function (event) {\n    if (\n      isEscapeEvent(event) &&\n      valueOrHandler(config.escapeDeactivates, event) !== false\n    ) {\n      event.preventDefault();\n      trap.deactivate();\n      return;\n    }\n\n    if (config.isKeyForward(event) || config.isKeyBackward(event)) {\n      checkKeyNav(event, config.isKeyBackward(event));\n    }\n  };\n\n  const checkClick = function (e) {\n    const target = getActualTarget(e);\n\n    if (findContainerIndex(target) >= 0) {\n      return;\n    }\n\n    if (valueOrHandler(config.clickOutsideDeactivates, e)) {\n      return;\n    }\n\n    if (valueOrHandler(config.allowOutsideClick, e)) {\n      return;\n    }\n\n    e.preventDefault();\n    e.stopImmediatePropagation();\n  };\n\n  //\n  // EVENT LISTENERS\n  //\n\n  const addListeners = function () {\n    if (!state.active) {\n      return;\n    }\n\n    // There can be only one listening focus trap at a time\n    activeFocusTraps.activateTrap(trapStack, trap);\n\n    // Delay ensures that the focused element doesn't capture the event\n    // that caused the focus trap activation.\n    state.delayInitialFocusTimer = config.delayInitialFocus\n      ? delay(function () {\n          tryFocus(getInitialFocusNode());\n        })\n      : tryFocus(getInitialFocusNode());\n\n    doc.addEventListener('focusin', checkFocusIn, true);\n    doc.addEventListener('mousedown', checkPointerDown, {\n      capture: true,\n      passive: false,\n    });\n    doc.addEventListener('touchstart', checkPointerDown, {\n      capture: true,\n      passive: false,\n    });\n    doc.addEventListener('click', checkClick, {\n      capture: true,\n      passive: false,\n    });\n    doc.addEventListener('keydown', checkKey, {\n      capture: true,\n      passive: false,\n    });\n\n    return trap;\n  };\n\n  const removeListeners = function () {\n    if (!state.active) {\n      return;\n    }\n\n    doc.removeEventListener('focusin', checkFocusIn, true);\n    doc.removeEventListener('mousedown', checkPointerDown, true);\n    doc.removeEventListener('touchstart', checkPointerDown, true);\n    doc.removeEventListener('click', checkClick, true);\n    doc.removeEventListener('keydown', checkKey, true);\n\n    return trap;\n  };\n\n  //\n  // TRAP DEFINITION\n  //\n\n  trap = {\n    get active() {\n      return state.active;\n    },\n\n    get paused() {\n      return state.paused;\n    },\n\n    activate(activateOptions) {\n      if (state.active) {\n        return this;\n      }\n\n      const onActivate = getOption(activateOptions, 'onActivate');\n      const onPostActivate = getOption(activateOptions, 'onPostActivate');\n      const checkCanFocusTrap = getOption(activateOptions, 'checkCanFocusTrap');\n\n      if (!checkCanFocusTrap) {\n        updateTabbableNodes();\n      }\n\n      state.active = true;\n      state.paused = false;\n      state.nodeFocusedBeforeActivation = doc.activeElement;\n\n      if (onActivate) {\n        onActivate();\n      }\n\n      const finishActivation = () => {\n        if (checkCanFocusTrap) {\n          updateTabbableNodes();\n        }\n        addListeners();\n        if (onPostActivate) {\n          onPostActivate();\n        }\n      };\n\n      if (checkCanFocusTrap) {\n        checkCanFocusTrap(state.containers.concat()).then(\n          finishActivation,\n          finishActivation\n        );\n        return this;\n      }\n\n      finishActivation();\n      return this;\n    },\n\n    deactivate(deactivateOptions) {\n      if (!state.active) {\n        return this;\n      }\n\n      const options = {\n        onDeactivate: config.onDeactivate,\n        onPostDeactivate: config.onPostDeactivate,\n        checkCanReturnFocus: config.checkCanReturnFocus,\n        ...deactivateOptions,\n      };\n\n      clearTimeout(state.delayInitialFocusTimer); // noop if undefined\n      state.delayInitialFocusTimer = undefined;\n\n      removeListeners();\n      state.active = false;\n      state.paused = false;\n\n      activeFocusTraps.deactivateTrap(trapStack, trap);\n\n      const onDeactivate = getOption(options, 'onDeactivate');\n      const onPostDeactivate = getOption(options, 'onPostDeactivate');\n      const checkCanReturnFocus = getOption(options, 'checkCanReturnFocus');\n      const returnFocus = getOption(\n        options,\n        'returnFocus',\n        'returnFocusOnDeactivate'\n      );\n\n      if (onDeactivate) {\n        onDeactivate();\n      }\n\n      const finishDeactivation = () => {\n        delay(() => {\n          if (returnFocus) {\n            tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));\n          }\n          if (onPostDeactivate) {\n            onPostDeactivate();\n          }\n        });\n      };\n\n      if (returnFocus && checkCanReturnFocus) {\n        checkCanReturnFocus(\n          getReturnFocusNode(state.nodeFocusedBeforeActivation)\n        ).then(finishDeactivation, finishDeactivation);\n        return this;\n      }\n\n      finishDeactivation();\n      return this;\n    },\n\n    pause() {\n      if (state.paused || !state.active) {\n        return this;\n      }\n\n      state.paused = true;\n      removeListeners();\n\n      return this;\n    },\n\n    unpause() {\n      if (!state.paused || !state.active) {\n        return this;\n      }\n\n      state.paused = false;\n      updateTabbableNodes();\n      addListeners();\n\n      return this;\n    },\n\n    updateContainerElements(containerElements) {\n      const elementsAsArray = [].concat(containerElements).filter(Boolean);\n\n      state.containers = elementsAsArray.map((element) =>\n        typeof element === 'string' ? doc.querySelector(element) : element\n      );\n\n      if (state.active) {\n        updateTabbableNodes();\n      }\n\n      return this;\n    },\n  };\n\n  // initialize container elements\n  trap.updateContainerElements(elements);\n\n  return trap;\n};\n\nexport { createFocusTrap };\n","export default function _typeof(obj) {\n  \"@babel/helpers - typeof\";\n\n  return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n    return typeof obj;\n  } : function (obj) {\n    return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n  }, _typeof(obj);\n}","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Much of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// Many optimizations have been made, so the bundle size is ultimately smaller but performance is similar.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n    var u = ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([c], { type: 'text/javascript' })));\n    var w = new Worker(u);\n    w.onerror = function (e) { return cb(e.error, null); };\n    w.onmessage = function (e) { return cb(null, e.data); };\n    w.postMessage(msg, transfer);\n    return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, u32 = Uint32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\n// see fleb note\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n    var b = new u16(31);\n    for (var i = 0; i < 31; ++i) {\n        b[i] = start += 1 << eb[i - 1];\n    }\n    // numbers here are at max 18 bits\n    var r = new u32(b[30]);\n    for (var i = 1; i < 30; ++i) {\n        for (var j = b[i]; j < b[i + 1]; ++j) {\n            r[j] = ((j - b[i]) << 5) | i;\n        }\n    }\n    return [b, r];\n};\nvar _a = freb(fleb, 2), fl = _a[0], revfl = _a[1];\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b[0], revfd = _b[1];\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n    // reverse table algorithm from SO\n    var x = ((i & 0xAAAA) >>> 1) | ((i & 0x5555) << 1);\n    x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n    x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n    rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n    var s = cd.length;\n    // index\n    var i = 0;\n    // u16 \"map\": index -> # of codes with bit length = index\n    var l = new u16(mb);\n    // length of cd must be 288 (total # of codes)\n    for (; i < s; ++i)\n        ++l[cd[i] - 1];\n    // u16 \"map\": index -> minimum code for bit length = index\n    var le = new u16(mb);\n    for (i = 0; i < mb; ++i) {\n        le[i] = (le[i - 1] + l[i - 1]) << 1;\n    }\n    var co;\n    if (r) {\n        // u16 \"map\": index -> number of actual bits, symbol for code\n        co = new u16(1 << mb);\n        // bits to remove for reverser\n        var rvb = 15 - mb;\n        for (i = 0; i < s; ++i) {\n            // ignore 0 lengths\n            if (cd[i]) {\n                // num encoding both symbol and bits read\n                var sv = (i << 4) | cd[i];\n                // free bits\n                var r_1 = mb - cd[i];\n                // start value\n                var v = le[cd[i] - 1]++ << r_1;\n                // m is end value\n                for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n                    // every 16 bit value starting with the code yields the same result\n                    co[rev[v] >>> rvb] = sv;\n                }\n            }\n        }\n    }\n    else {\n        co = new u16(s);\n        for (i = 0; i < s; ++i)\n            co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n    }\n    return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n    flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n    flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n    flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n    flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n    fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n    var m = a[0];\n    for (var i = 1; i < a.length; ++i) {\n        if (a[i] > m)\n            m = a[i];\n    }\n    return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n    var o = (p / 8) >> 0;\n    return ((d[o] | (d[o + 1] << 8)) >>> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n    var o = (p / 8) >> 0;\n    return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >>> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p / 8) >> 0) + (p & 7 && 1); };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n    if (s == null || s < 0)\n        s = 0;\n    if (e == null || e > v.length)\n        e = v.length;\n    // can't use .constructor in case user-supplied\n    var n = new (v instanceof u16 ? u16 : v instanceof u32 ? u32 : u8)(e - s);\n    n.set(v.subarray(s, e));\n    return n;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n    // source length\n    var sl = dat.length;\n    // have to estimate size\n    var noBuf = !buf || st;\n    // no state\n    var noSt = !st || st.i;\n    if (!st)\n        st = {};\n    // Assumes roughly 33% compression ratio average\n    if (!buf)\n        buf = new u8(sl * 3);\n    // ensure buffer can fit at least l elements\n    var cbuf = function (l) {\n        var bl = buf.length;\n        // need to increase size to fit\n        if (l > bl) {\n            // Double or set to necessary, whichever is greater\n            var nbuf = new u8(Math.max(bl * 2, l));\n            nbuf.set(buf);\n            buf = nbuf;\n        }\n    };\n    //  last chunk         bitpos           bytes\n    var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n    // total bits\n    var tbts = sl * 8;\n    do {\n        if (!lm) {\n            // BFINAL - this is only 1 when last chunk is next\n            st.f = final = bits(dat, pos, 1);\n            // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n            var type = bits(dat, pos + 1, 3);\n            pos += 3;\n            if (!type) {\n                // go to end of byte boundary\n                var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n                if (t > sl) {\n                    if (noSt)\n                        throw 'unexpected EOF';\n                    break;\n                }\n                // ensure size\n                if (noBuf)\n                    cbuf(bt + l);\n                // Copy over uncompressed data\n                buf.set(dat.subarray(s, t), bt);\n                // Get new bitpos, update byte count\n                st.b = bt += l, st.p = pos = t * 8;\n                continue;\n            }\n            else if (type == 1)\n                lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n            else if (type == 2) {\n                //  literal                            lengths\n                var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n                var tl = hLit + bits(dat, pos + 5, 31) + 1;\n                pos += 14;\n                // length+distance tree\n                var ldt = new u8(tl);\n                // code length tree\n                var clt = new u8(19);\n                for (var i = 0; i < hcLen; ++i) {\n                    // use index map to get real code\n                    clt[clim[i]] = bits(dat, pos + i * 3, 7);\n                }\n                pos += hcLen * 3;\n                // code lengths bits\n                var clb = max(clt), clbmsk = (1 << clb) - 1;\n                if (!noSt && pos + tl * (clb + 7) > tbts)\n                    break;\n                // code lengths map\n                var clm = hMap(clt, clb, 1);\n                for (var i = 0; i < tl;) {\n                    var r = clm[bits(dat, pos, clbmsk)];\n                    // bits read\n                    pos += r & 15;\n                    // symbol\n                    var s = r >>> 4;\n                    // code length to copy\n                    if (s < 16) {\n                        ldt[i++] = s;\n                    }\n                    else {\n                        //  copy   count\n                        var c = 0, n = 0;\n                        if (s == 16)\n                            n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n                        else if (s == 17)\n                            n = 3 + bits(dat, pos, 7), pos += 3;\n                        else if (s == 18)\n                            n = 11 + bits(dat, pos, 127), pos += 7;\n                        while (n--)\n                            ldt[i++] = c;\n                    }\n                }\n                //    length tree                 distance tree\n                var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n                // max length bits\n                lbt = max(lt);\n                // max dist bits\n                dbt = max(dt);\n                lm = hMap(lt, lbt, 1);\n                dm = hMap(dt, dbt, 1);\n            }\n            else\n                throw 'invalid block type';\n            if (pos > tbts)\n                throw 'unexpected EOF';\n        }\n        // Make sure the buffer can hold this + the largest possible addition\n        // Maximum chunk size (practically, theoretically infinite) is 2^17;\n        if (noBuf)\n            cbuf(bt + 131072);\n        var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n        var mxa = lbt + dbt + 18;\n        while (noSt || pos + mxa < tbts) {\n            // bits read, code\n            var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n            pos += c & 15;\n            if (pos > tbts)\n                throw 'unexpected EOF';\n            if (!c)\n                throw 'invalid length/literal';\n            if (sym < 256)\n                buf[bt++] = sym;\n            else if (sym == 256) {\n                lm = null;\n                break;\n            }\n            else {\n                var add = sym - 254;\n                // no extra bits needed if less\n                if (sym > 264) {\n                    // index\n                    var i = sym - 257, b = fleb[i];\n                    add = bits(dat, pos, (1 << b) - 1) + fl[i];\n                    pos += b;\n                }\n                // dist\n                var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n                if (!d)\n                    throw 'invalid distance';\n                pos += d & 15;\n                var dt = fd[dsym];\n                if (dsym > 3) {\n                    var b = fdeb[dsym];\n                    dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n                }\n                if (pos > tbts)\n                    throw 'unexpected EOF';\n                if (noBuf)\n                    cbuf(bt + 131072);\n                var end = bt + add;\n                for (; bt < end; bt += 4) {\n                    buf[bt] = buf[bt - dt];\n                    buf[bt + 1] = buf[bt + 1 - dt];\n                    buf[bt + 2] = buf[bt + 2 - dt];\n                    buf[bt + 3] = buf[bt + 3 - dt];\n                }\n                bt = end;\n            }\n        }\n        st.l = lm, st.p = pos, st.b = bt;\n        if (lm)\n            final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n    } while (!final);\n    return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n    v <<= p & 7;\n    var o = (p / 8) >> 0;\n    d[o] |= v;\n    d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n    v <<= p & 7;\n    var o = (p / 8) >> 0;\n    d[o] |= v;\n    d[o + 1] |= v >>> 8;\n    d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n    // Need extra info to make a tree\n    var t = [];\n    for (var i = 0; i < d.length; ++i) {\n        if (d[i])\n            t.push({ s: i, f: d[i] });\n    }\n    var s = t.length;\n    var t2 = t.slice();\n    if (!s)\n        return [new u8(0), 0];\n    if (s == 1) {\n        var v = new u8(t[0].s + 1);\n        v[t[0].s] = 1;\n        return [v, 1];\n    }\n    t.sort(function (a, b) { return a.f - b.f; });\n    // after i2 reaches last ind, will be stopped\n    // freq must be greater than largest possible number of symbols\n    t.push({ s: -1, f: 25001 });\n    var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n    t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n    // efficient algorithm from UZIP.js\n    // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n    // symbols that combined have high freq, will start processing i2 (high-freq,\n    // non-composite) symbols instead\n    // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n    while (i1 != s - 1) {\n        l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n        r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n        t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n    }\n    var maxSym = t2[0].s;\n    for (var i = 1; i < s; ++i) {\n        if (t2[i].s > maxSym)\n            maxSym = t2[i].s;\n    }\n    // code lengths\n    var tr = new u16(maxSym + 1);\n    // max bits in tree\n    var mbt = ln(t[i1 - 1], tr, 0);\n    if (mbt > mb) {\n        // more algorithms from UZIP.js\n        // TODO: find out how this code works (debt)\n        //  ind    debt\n        var i = 0, dt = 0;\n        //    left            cost\n        var lft = mbt - mb, cst = 1 << lft;\n        t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n        for (; i < s; ++i) {\n            var i2_1 = t2[i].s;\n            if (tr[i2_1] > mb) {\n                dt += cst - (1 << (mbt - tr[i2_1]));\n                tr[i2_1] = mb;\n            }\n            else\n                break;\n        }\n        dt >>>= lft;\n        while (dt > 0) {\n            var i2_2 = t2[i].s;\n            if (tr[i2_2] < mb)\n                dt -= 1 << (mb - tr[i2_2]++ - 1);\n            else\n                ++i;\n        }\n        for (; i >= 0 && dt; --i) {\n            var i2_3 = t2[i].s;\n            if (tr[i2_3] == mb) {\n                --tr[i2_3];\n                ++dt;\n            }\n        }\n        mbt = mb;\n    }\n    return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n    return n.s == -1\n        ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n        : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n    var s = c.length;\n    // Note that the semicolon was intentional\n    while (s && !c[--s])\n        ;\n    var cl = new u16(++s);\n    //  ind      num         streak\n    var cli = 0, cln = c[0], cls = 1;\n    var w = function (v) { cl[cli++] = v; };\n    for (var i = 1; i <= s; ++i) {\n        if (c[i] == cln && i != s)\n            ++cls;\n        else {\n            if (!cln && cls > 2) {\n                for (; cls > 138; cls -= 138)\n                    w(32754);\n                if (cls > 2) {\n                    w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n                    cls = 0;\n                }\n            }\n            else if (cls > 3) {\n                w(cln), --cls;\n                for (; cls > 6; cls -= 6)\n                    w(8304);\n                if (cls > 2)\n                    w(((cls - 3) << 5) | 8208), cls = 0;\n            }\n            while (cls--)\n                w(cln);\n            cls = 1;\n            cln = c[i];\n        }\n    }\n    return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n    var l = 0;\n    for (var i = 0; i < cl.length; ++i)\n        l += cf[i] * cl[i];\n    return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n    // no need to write 00 as type: TypedArray defaults to 0\n    var s = dat.length;\n    var o = shft(pos + 2);\n    out[o] = s & 255;\n    out[o + 1] = s >>> 8;\n    out[o + 2] = out[o] ^ 255;\n    out[o + 3] = out[o + 1] ^ 255;\n    for (var i = 0; i < s; ++i)\n        out[o + i + 4] = dat[i];\n    return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n    wbits(out, p++, final);\n    ++lf[256];\n    var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n    var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n    var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n    var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n    var lcfreq = new u16(19);\n    for (var i = 0; i < lclt.length; ++i)\n        lcfreq[lclt[i] & 31]++;\n    for (var i = 0; i < lcdt.length; ++i)\n        lcfreq[lcdt[i] & 31]++;\n    var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n    var nlcc = 19;\n    for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n        ;\n    var flen = (bl + 5) << 3;\n    var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n    var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n    if (flen <= ftlen && flen <= dtlen)\n        return wfblk(out, p, dat.subarray(bs, bs + bl));\n    var lm, ll, dm, dl;\n    wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n    if (dtlen < ftlen) {\n        lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n        var llm = hMap(lct, mlcb, 0);\n        wbits(out, p, nlc - 257);\n        wbits(out, p + 5, ndc - 1);\n        wbits(out, p + 10, nlcc - 4);\n        p += 14;\n        for (var i = 0; i < nlcc; ++i)\n            wbits(out, p + 3 * i, lct[clim[i]]);\n        p += 3 * nlcc;\n        var lcts = [lclt, lcdt];\n        for (var it = 0; it < 2; ++it) {\n            var clct = lcts[it];\n            for (var i = 0; i < clct.length; ++i) {\n                var len = clct[i] & 31;\n                wbits(out, p, llm[len]), p += lct[len];\n                if (len > 15)\n                    wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n            }\n        }\n    }\n    else {\n        lm = flm, ll = flt, dm = fdm, dl = fdt;\n    }\n    for (var i = 0; i < li; ++i) {\n        if (syms[i] > 255) {\n            var len = (syms[i] >>> 18) & 31;\n            wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n            if (len > 7)\n                wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n            var dst = syms[i] & 31;\n            wbits16(out, p, dm[dst]), p += dl[dst];\n            if (dst > 3)\n                wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n        }\n        else {\n            wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n        }\n    }\n    wbits16(out, p, lm[256]);\n    return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n    var s = dat.length;\n    var o = new u8(pre + s + 5 * (1 + Math.floor(s / 7000)) + post);\n    // writing to this writes to the output buffer\n    var w = o.subarray(pre, o.length - post);\n    var pos = 0;\n    if (!lvl || s < 8) {\n        for (var i = 0; i <= s; i += 65535) {\n            // end\n            var e = i + 65535;\n            if (e < s) {\n                // write full block\n                pos = wfblk(w, pos, dat.subarray(i, e));\n            }\n            else {\n                // write final block\n                w[i] = lst;\n                pos = wfblk(w, pos, dat.subarray(i, s));\n            }\n        }\n    }\n    else {\n        var opt = deo[lvl - 1];\n        var n = opt >>> 13, c = opt & 8191;\n        var msk_1 = (1 << plvl) - 1;\n        //    prev 2-byte val map    curr 2-byte val map\n        var prev = new u16(32768), head = new u16(msk_1 + 1);\n        var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n        var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n        // 24576 is an arbitrary number of maximum symbols per block\n        // 424 buffer for last block\n        var syms = new u32(25000);\n        // length/literal freq   distance freq\n        var lf = new u16(288), df = new u16(32);\n        //  l/lcnt  exbits  index  l/lind  waitdx  bitpos\n        var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n        for (; i < s; ++i) {\n            // hash value\n            var hv = hsh(i);\n            // index mod 32768\n            var imod = i & 32767;\n            // previous index with this value\n            var pimod = head[hv];\n            prev[imod] = pimod;\n            head[hv] = imod;\n            // We always should modify head and prev, but only add symbols if\n            // this data is not yet processed (\"wait\" for wait index)\n            if (wi <= i) {\n                // bytes remaining\n                var rem = s - i;\n                if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n                    pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n                    li = lc_1 = eb = 0, bs = i;\n                    for (var j = 0; j < 286; ++j)\n                        lf[j] = 0;\n                    for (var j = 0; j < 30; ++j)\n                        df[j] = 0;\n                }\n                //  len    dist   chain\n                var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n                if (rem > 2 && hv == hsh(i - dif)) {\n                    var maxn = Math.min(n, rem) - 1;\n                    var maxd = Math.min(32767, i);\n                    // max possible length\n                    // not capped at dif because decompressors implement \"rolling\" index population\n                    var ml = Math.min(258, rem);\n                    while (dif <= maxd && --ch_1 && imod != pimod) {\n                        if (dat[i + l] == dat[i + l - dif]) {\n                            var nl = 0;\n                            for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n                                ;\n                            if (nl > l) {\n                                l = nl, d = dif;\n                                // break out early when we reach \"nice\" (we are satisfied enough)\n                                if (nl > maxn)\n                                    break;\n                                // now, find the rarest 2-byte sequence within this\n                                // length of literals and search for that instead.\n                                // Much faster than just using the start\n                                var mmd = Math.min(dif, nl - 2);\n                                var md = 0;\n                                for (var j = 0; j < mmd; ++j) {\n                                    var ti = (i - dif + j + 32768) & 32767;\n                                    var pti = prev[ti];\n                                    var cd = (ti - pti + 32768) & 32767;\n                                    if (cd > md)\n                                        md = cd, pimod = ti;\n                                }\n                            }\n                        }\n                        // check the previous match\n                        imod = pimod, pimod = prev[imod];\n                        dif += (imod - pimod + 32768) & 32767;\n                    }\n                }\n                // d will be nonzero only when a match was found\n                if (d) {\n                    // store both dist and len data in one Uint32\n                    // Make sure this is recognized as a len/dist with 28th bit (2^28)\n                    syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n                    var lin = revfl[l] & 31, din = revfd[d] & 31;\n                    eb += fleb[lin] + fdeb[din];\n                    ++lf[257 + lin];\n                    ++df[din];\n                    wi = i + l;\n                    ++lc_1;\n                }\n                else {\n                    syms[li++] = dat[i];\n                    ++lf[dat[i]];\n                }\n            }\n        }\n        pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n        // this is the easiest way to avoid needing to maintain state\n        if (!lst)\n            pos = wfblk(w, pos, et);\n    }\n    return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n    var t = new u32(256);\n    for (var i = 0; i < 256; ++i) {\n        var c = i, k = 9;\n        while (--k)\n            c = ((c & 1) && 0xEDB88320) ^ (c >>> 1);\n        t[i] = c;\n    }\n    return t;\n})();\n// CRC32\nvar crc = function () {\n    var c = 0xFFFFFFFF;\n    return {\n        p: function (d) {\n            // closures have awful performance\n            var cr = c;\n            for (var i = 0; i < d.length; ++i)\n                cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n            c = cr;\n        },\n        d: function () { return c ^ 0xFFFFFFFF; }\n    };\n};\n// Alder32\nvar adler = function () {\n    var a = 1, b = 0;\n    return {\n        p: function (d) {\n            // closures have awful performance\n            var n = a, m = b;\n            var l = d.length;\n            for (var i = 0; i != l;) {\n                var e = Math.min(i + 5552, l);\n                for (; i < e; ++i)\n                    n += d[i], m += n;\n                n %= 65521, m %= 65521;\n            }\n            a = n, b = m;\n        },\n        d: function () { return ((a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8)) + ((a & 255) << 23) * 2; }\n    };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n    return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n    var o = {};\n    for (var k in a)\n        o[k] = a[k];\n    for (var k in b)\n        o[k] = b[k];\n    return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n    var dt = fn();\n    var st = fn.toString();\n    var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/ /g, '').split(',');\n    for (var i = 0; i < dt.length; ++i) {\n        var v = dt[i], k = ks[i];\n        if (typeof v == 'function') {\n            fnStr += ';' + k + '=';\n            var st_1 = v.toString();\n            if (v.prototype) {\n                // for global objects\n                if (st_1.indexOf('[native code]') != -1) {\n                    var spInd = st_1.indexOf(' ', 8) + 1;\n                    fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n                }\n                else {\n                    fnStr += st_1;\n                    for (var t in v.prototype)\n                        fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n                }\n            }\n            else\n                fnStr += st_1;\n        }\n        else\n            td[k] = v;\n    }\n    return [fnStr, td];\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n    var tl = [];\n    for (var k in v) {\n        if (v[k] instanceof u8 || v[k] instanceof u16 || v[k] instanceof u32)\n            tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n    }\n    return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n    var _a;\n    if (!ch[id]) {\n        var fnStr = '', td_1 = {}, m = fns.length - 1;\n        for (var i = 0; i < m; ++i)\n            _a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];\n        ch[id] = wcln(fns[m], fnStr, td_1);\n    }\n    var td = mrg({}, ch[id][1]);\n    return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, hMap, max, bits, bits16, shft, slc, inflt, inflateSync, pbf, gu8]; };\nvar bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zlv]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get u8\nvar gu8 = function (o) { return o && o.size && new u8(o.size); };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n    var w = wrkr(fns, init, id, function (err, dat) {\n        w.terminate();\n        cb(err, dat);\n    });\n    if (!opts.consume)\n        dat = new u8(dat);\n    w.postMessage([dat, opts], [dat.buffer]);\n    return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n    strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n    return function (ev) { return strm.push(ev.data[0], ev.data[1]); };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id) {\n    var t;\n    var w = wrkr(fns, init, id, function (err, dat) {\n        if (err)\n            w.terminate(), strm.ondata.call(strm, err);\n        else {\n            if (dat[1])\n                w.terminate();\n            strm.ondata.call(strm, err, dat[0], dat[1]);\n        }\n    });\n    w.postMessage(opts);\n    strm.push = function (d, f) {\n        if (t)\n            throw 'stream finished';\n        if (!strm.ondata)\n            throw 'no stream handler';\n        w.postMessage([d, t = f], [d.buffer]);\n    };\n    strm.terminate = function () { w.terminate(); };\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16)) + (d[b + 3] << 23) * 2; };\n// write bytes\nvar wbytes = function (d, b, v) {\n    for (; v; ++b)\n        d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n    var fn = o.filename;\n    c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n    if (o.mtime != 0)\n        wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n    if (fn) {\n        c[3] = 8;\n        for (var i = 0; i <= fn.length; ++i)\n            c[i + 10] = fn.charCodeAt(i);\n    }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n    if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n        throw 'invalid gzip data';\n    var flg = d[3];\n    var st = 10;\n    if (flg & 4)\n        st += d[10] | (d[11] << 8) + 2;\n    for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n        ;\n    return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n    var l = d.length;\n    return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) + (2 * (d[l - 1] << 23));\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };\n// zlib header\nvar zlh = function (c, o) {\n    var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n    c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n    if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n        throw 'invalid zlib data';\n    if (d[1] & 32)\n        throw 'invalid zlib data: preset dictionaries not supported';\n};\nfunction AsyncCmpStrm(opts, cb) {\n    if (!cb && typeof opts == 'function')\n        cb = opts, opts = {};\n    this.ondata = cb;\n    return opts;\n}\n// zlib footer: -4 to -0 is Adler32\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n    function Deflate(opts, cb) {\n        if (!cb && typeof opts == 'function')\n            cb = opts, opts = {};\n        this.ondata = cb;\n        this.o = opts || {};\n    }\n    Deflate.prototype.p = function (c, f) {\n        this.ondata(dopt(c, this.o, 0, 0, !f), f);\n    };\n    /**\n     * Pushes a chunk to be deflated\n     * @param chunk The chunk to push\n     * @param final Whether this is the last chunk\n     */\n    Deflate.prototype.push = function (chunk, final) {\n        if (this.d)\n            throw 'stream finished';\n        if (!this.ondata)\n            throw 'no stream handler';\n        this.d = final;\n        this.p(chunk, final || false);\n    };\n    return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n    function AsyncDeflate(opts, cb) {\n        astrmify([\n            bDflt,\n            function () { return [astrm, Deflate]; }\n        ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n            var strm = new Deflate(ev.data);\n            onmessage = astrm(strm);\n        }, 6);\n    }\n    return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n    if (!cb)\n        cb = opts, opts = {};\n    if (typeof cb != 'function')\n        throw 'no callback';\n    return cbify(data, opts, [\n        bDflt,\n    ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n    if (opts === void 0) { opts = {}; }\n    return dopt(data, opts, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n    /**\n     * Creates an inflation stream\n     * @param cb The callback to call whenever data is inflated\n     */\n    function Inflate(cb) {\n        this.s = {};\n        this.p = new u8(0);\n        this.ondata = cb;\n    }\n    Inflate.prototype.e = function (c) {\n        if (this.d)\n            throw 'stream finished';\n        if (!this.ondata)\n            throw 'no stream handler';\n        var l = this.p.length;\n        var n = new u8(l + c.length);\n        n.set(this.p), n.set(c, l), this.p = n;\n    };\n    Inflate.prototype.c = function (final) {\n        this.d = this.s.i = final || false;\n        var bts = this.s.b;\n        var dt = inflt(this.p, this.o, this.s);\n        this.ondata(slc(dt, bts, this.s.b), this.d);\n        this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n        this.p = slc(this.p, (this.s.p / 8) >> 0), this.s.p &= 7;\n    };\n    /**\n     * Pushes a chunk to be inflated\n     * @param chunk The chunk to push\n     * @param final Whether this is the final chunk\n     */\n    Inflate.prototype.push = function (chunk, final) {\n        this.e(chunk), this.c(final);\n    };\n    return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n    /**\n     * Creates an asynchronous inflation stream\n     * @param cb The callback to call whenever data is deflated\n     */\n    function AsyncInflate(cb) {\n        this.ondata = cb;\n        astrmify([\n            bInflt,\n            function () { return [astrm, Inflate]; }\n        ], this, 0, function () {\n            var strm = new Inflate();\n            onmessage = astrm(strm);\n        }, 7);\n    }\n    return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n    if (!cb)\n        cb = opts, opts = {};\n    if (typeof cb != 'function')\n        throw 'no callback';\n    return cbify(data, opts, [\n        bInflt\n    ], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, out) {\n    return inflt(data, out);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n    function Gzip(opts, cb) {\n        this.c = crc();\n        this.l = 0;\n        this.v = 1;\n        Deflate.call(this, opts, cb);\n    }\n    /**\n     * Pushes a chunk to be GZIPped\n     * @param chunk The chunk to push\n     * @param final Whether this is the last chunk\n     */\n    Gzip.prototype.push = function (chunk, final) {\n        Deflate.prototype.push.call(this, chunk, final);\n    };\n    Gzip.prototype.p = function (c, f) {\n        this.c.p(c);\n        this.l += c.length;\n        var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);\n        if (this.v)\n            gzh(raw, this.o), this.v = 0;\n        if (f)\n            wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n        this.ondata(raw, f);\n    };\n    return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n    function AsyncGzip(opts, cb) {\n        astrmify([\n            bDflt,\n            gze,\n            function () { return [astrm, Deflate, Gzip]; }\n        ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n            var strm = new Gzip(ev.data);\n            onmessage = astrm(strm);\n        }, 8);\n    }\n    return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n    if (!cb)\n        cb = opts, opts = {};\n    if (typeof cb != 'function')\n        throw 'no callback';\n    return cbify(data, opts, [\n        bDflt,\n        gze,\n        function () { return [gzipSync]; }\n    ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n    if (opts === void 0) { opts = {}; }\n    var c = crc(), l = data.length;\n    c.p(data);\n    var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n    return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n    /**\n     * Creates a GUNZIP stream\n     * @param cb The callback to call whenever data is inflated\n     */\n    function Gunzip(cb) {\n        this.v = 1;\n        Inflate.call(this, cb);\n    }\n    /**\n     * Pushes a chunk to be GUNZIPped\n     * @param chunk The chunk to push\n     * @param final Whether this is the last chunk\n     */\n    Gunzip.prototype.push = function (chunk, final) {\n        Inflate.prototype.e.call(this, chunk);\n        if (this.v) {\n            var s = gzs(this.p);\n            if (s >= this.p.length && !final)\n                return;\n            this.p = this.p.subarray(s), this.v = 0;\n        }\n        if (final) {\n            if (this.p.length < 8)\n                throw 'invalid gzip stream';\n            this.p = this.p.subarray(0, -8);\n        }\n        // necessary to prevent TS from using the closure value\n        // This allows for workerization to function correctly\n        Inflate.prototype.c.call(this, final);\n    };\n    return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n    /**\n     * Creates an asynchronous GUNZIP stream\n     * @param cb The callback to call whenever data is deflated\n     */\n    function AsyncGunzip(cb) {\n        this.ondata = cb;\n        astrmify([\n            bInflt,\n            guze,\n            function () { return [astrm, Inflate, Gunzip]; }\n        ], this, 0, function () {\n            var strm = new Gunzip();\n            onmessage = astrm(strm);\n        }, 9);\n    }\n    return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n    if (!cb)\n        cb = opts, opts = {};\n    if (typeof cb != 'function')\n        throw 'no callback';\n    return cbify(data, opts, [\n        bInflt,\n        guze,\n        function () { return [gunzipSync]; }\n    ], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, out) {\n    return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n    function Zlib(opts, cb) {\n        this.c = adler();\n        this.v = 1;\n        Deflate.call(this, opts, cb);\n    }\n    /**\n     * Pushes a chunk to be zlibbed\n     * @param chunk The chunk to push\n     * @param final Whether this is the last chunk\n     */\n    Zlib.prototype.push = function (chunk, final) {\n        Deflate.prototype.push.call(this, chunk, final);\n    };\n    Zlib.prototype.p = function (c, f) {\n        this.c.p(c);\n        var raw = dopt(c, this.o, this.v && 2, f && 4, !f);\n        if (this.v)\n            zlh(raw, this.o), this.v = 0;\n        if (f)\n            wbytes(raw, raw.length - 4, this.c.d());\n        this.ondata(raw, f);\n    };\n    return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n    function AsyncZlib(opts, cb) {\n        astrmify([\n            bDflt,\n            zle,\n            function () { return [astrm, Deflate, Zlib]; }\n        ], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {\n            var strm = new Zlib(ev.data);\n            onmessage = astrm(strm);\n        }, 10);\n    }\n    return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n    if (!cb)\n        cb = opts, opts = {};\n    if (typeof cb != 'function')\n        throw 'no callback';\n    return cbify(data, opts, [\n        bDflt,\n        zle,\n        function () { return [zlibSync]; }\n    ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n    if (opts === void 0) { opts = {}; }\n    var a = adler();\n    a.p(data);\n    var d = dopt(data, opts, 2, 4);\n    return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n    /**\n     * Creates a Zlib decompression stream\n     * @param cb The callback to call whenever data is inflated\n     */\n    function Unzlib(cb) {\n        this.v = 1;\n        Inflate.call(this, cb);\n    }\n    /**\n     * Pushes a chunk to be unzlibbed\n     * @param chunk The chunk to push\n     * @param final Whether this is the last chunk\n     */\n    Unzlib.prototype.push = function (chunk, final) {\n        Inflate.prototype.e.call(this, chunk);\n        if (this.v) {\n            if (this.p.length < 2 && !final)\n                return;\n            this.p = this.p.subarray(2), this.v = 0;\n        }\n        if (final) {\n            if (this.p.length < 4)\n                throw 'invalid zlib stream';\n            this.p = this.p.subarray(0, -4);\n        }\n        // necessary to prevent TS from using the closure value\n        // This allows for workerization to function correctly\n        Inflate.prototype.c.call(this, final);\n    };\n    return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n    /**\n     * Creates an asynchronous Zlib decompression stream\n     * @param cb The callback to call whenever data is deflated\n     */\n    function AsyncUnzlib(cb) {\n        this.ondata = cb;\n        astrmify([\n            bInflt,\n            zule,\n            function () { return [astrm, Inflate, Unzlib]; }\n        ], this, 0, function () {\n            var strm = new Unzlib();\n            onmessage = astrm(strm);\n        }, 11);\n    }\n    return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n    if (!cb)\n        cb = opts, opts = {};\n    if (typeof cb != 'function')\n        throw 'no callback';\n    return cbify(data, opts, [\n        bInflt,\n        zule,\n        function () { return [unzlibSync]; }\n    ], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, out) {\n    return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n    /**\n     * Creates a decompression stream\n     * @param cb The callback to call whenever data is decompressed\n     */\n    function Decompress(cb) {\n        this.G = Gunzip;\n        this.I = Inflate;\n        this.Z = Unzlib;\n        this.ondata = cb;\n    }\n    /**\n     * Pushes a chunk to be decompressed\n     * @param chunk The chunk to push\n     * @param final Whether this is the last chunk\n     */\n    Decompress.prototype.push = function (chunk, final) {\n        if (!this.ondata)\n            throw 'no stream handler';\n        if (!this.s) {\n            if (this.p && this.p.length) {\n                var n = new u8(this.p.length + chunk.length);\n                n.set(this.p), n.set(chunk, this.p.length);\n            }\n            else\n                this.p = chunk;\n            if (this.p.length > 2) {\n                var _this_1 = this;\n                var cb = function () { _this_1.ondata.apply(_this_1, arguments); };\n                this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n                    ? new this.G(cb)\n                    : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n                        ? new this.I(cb)\n                        : new this.Z(cb);\n                this.s.push(this.p, final);\n                this.p = null;\n            }\n        }\n        else\n            this.s.push(chunk, final);\n    };\n    return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n    /**\n   * Creates an asynchronous decompression stream\n   * @param cb The callback to call whenever data is decompressed\n   */\n    function AsyncDecompress(cb) {\n        this.G = AsyncGunzip;\n        this.I = AsyncInflate;\n        this.Z = AsyncUnzlib;\n        this.ondata = cb;\n    }\n    /**\n     * Pushes a chunk to be decompressed\n     * @param chunk The chunk to push\n     * @param final Whether this is the last chunk\n     */\n    AsyncDecompress.prototype.push = function (chunk, final) {\n        Decompress.prototype.push.call(this, chunk, final);\n    };\n    return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n    if (!cb)\n        cb = opts, opts = {};\n    if (typeof cb != 'function')\n        throw 'no callback';\n    return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n        ? gunzip(data, opts, cb)\n        : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n            ? inflate(data, opts, cb)\n            : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, out) {\n    return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n        ? gunzipSync(data, out)\n        : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n            ? inflateSync(data, out)\n            : unzlibSync(data, out);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n    for (var k in d) {\n        var val = d[k], n = p + k;\n        if (val instanceof u8)\n            t[n] = [val, o];\n        else if (Array.isArray(val))\n            t[n] = [val[0], mrg(o, val[1])];\n        else\n            fltn(val, n + '/', t, o);\n    }\n};\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n *               not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n    var l = str.length;\n    if (!latin1 && typeof TextEncoder != 'undefined')\n        return new TextEncoder().encode(str);\n    var ar = new u8(str.length + (str.length >>> 1));\n    var ai = 0;\n    var w = function (v) { ar[ai++] = v; };\n    for (var i = 0; i < l; ++i) {\n        if (ai + 5 > ar.length) {\n            var n = new u8(ai + 8 + ((l - i) << 1));\n            n.set(ar);\n            ar = n;\n        }\n        var c = str.charCodeAt(i);\n        if (c < 128 || latin1)\n            w(c);\n        else if (c < 2048)\n            w(192 | (c >>> 6)), w(128 | (c & 63));\n        else if (c > 55295 && c < 57344)\n            c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n                w(240 | (c >>> 18)), w(128 | ((c >>> 12) & 63)), w(128 | ((c >>> 6) & 63)), w(128 | (c & 63));\n        else\n            w(224 | (c >>> 12)), w(128 | ((c >>> 6) & 63)), w(128 | (c & 63));\n    }\n    return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n *               not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n    var r = '';\n    if (!latin1 && typeof TextDecoder != 'undefined')\n        return new TextDecoder().decode(dat);\n    for (var i = 0; i < dat.length;) {\n        var c = dat[i++];\n        if (c < 128 || latin1)\n            r += String.fromCharCode(c);\n        else if (c < 224)\n            r += String.fromCharCode((c & 31) << 6 | (dat[i++] & 63));\n        else if (c < 240)\n            r += String.fromCharCode((c & 15) << 12 | (dat[i++] & 63) << 6 | (dat[i++] & 63));\n        else\n            c = ((c & 15) << 18 | (dat[i++] & 63) << 12 | (dat[i++] & 63) << 6 | (dat[i++] & 63)) - 65536,\n                r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n    }\n    return r;\n}\n;\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n    var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl;\n    var _a = z ? z64e(d, es) : [b4(d, b + 20), b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n    return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n    for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n        ;\n    return [b4(d, b + 12), b4(d, b + 4), b4(d, b + 20)];\n};\n// write zip header\nvar wzh = function (d, b, c, cmp, su, fn, u, o, ce, t) {\n    var fl = fn.length, l = cmp.length;\n    wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n    if (ce != null)\n        d[b] = 20, b += 2;\n    d[b] = 20, b += 2; // spec compliance? what's that?\n    d[b++] = (t == 8 && (o.level == 1 ? 6 : o.level < 6 ? 4 : o.level == 9 ? 2 : 0)), d[b++] = u && 8;\n    d[b] = t, b += 2;\n    var dt = new Date(o.mtime || Date.now()), y = dt.getFullYear() - 1980;\n    if (y < 0 || y > 119)\n        throw 'date not in range 1980-2099';\n    wbytes(d, b, ((y << 24) * 2) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1));\n    b += 4;\n    wbytes(d, b, c);\n    wbytes(d, b + 4, l);\n    wbytes(d, b + 8, su);\n    wbytes(d, b + 12, fl), b += 16; // skip extra field, comment\n    if (ce != null)\n        wbytes(d, b += 10, ce), b += 4;\n    d.set(fn, b);\n    b += fl;\n    if (ce == null)\n        d.set(cmp, b);\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n    wbytes(o, b, 0x6054B50); // skip disk\n    wbytes(o, b + 8, c);\n    wbytes(o, b + 10, c);\n    wbytes(o, b + 12, d);\n    wbytes(o, b + 16, e);\n};\nexport function zip(data, opts, cb) {\n    if (!cb)\n        cb = opts, opts = {};\n    if (typeof cb != 'function')\n        throw 'no callback';\n    var r = {};\n    fltn(data, '', r, opts);\n    var k = Object.keys(r);\n    var lft = k.length, o = 0, tot = 0;\n    var slft = lft, files = new Array(lft);\n    var term = [];\n    var tAll = function () {\n        for (var i = 0; i < term.length; ++i)\n            term[i]();\n    };\n    var cbf = function () {\n        var out = new u8(tot + 22), oe = o, cdl = tot - o;\n        tot = 0;\n        for (var i = 0; i < slft; ++i) {\n            var f = files[i];\n            try {\n                wzh(out, tot, f.c, f.d, f.m, f.n, f.u, f.p, null, f.t);\n                wzh(out, o, f.c, f.d, f.m, f.n, f.u, f.p, tot, f.t), o += 46 + f.n.length, tot += 30 + f.n.length + f.d.length;\n            }\n            catch (e) {\n                return cb(e, null);\n            }\n        }\n        wzf(out, o, files.length, cdl, oe);\n        cb(null, out);\n    };\n    if (!lft)\n        cbf();\n    var _loop_1 = function (i) {\n        var fn = k[i];\n        var _a = r[fn], file = _a[0], p = _a[1];\n        var c = crc(), m = file.length;\n        c.p(file);\n        var n = strToU8(fn), s = n.length;\n        var t = p.level == 0 ? 0 : 8;\n        var cbl = function (e, d) {\n            if (e) {\n                tAll();\n                cb(e, null);\n            }\n            else {\n                var l = d.length;\n                files[i] = {\n                    t: t,\n                    d: d,\n                    m: m,\n                    c: c.d(),\n                    u: fn.length != l,\n                    n: n,\n                    p: p\n                };\n                o += 30 + s + l;\n                tot += 76 + 2 * s + l;\n                if (!--lft)\n                    cbf();\n            }\n        };\n        if (n.length > 65535)\n            cbl('filename too long', null);\n        if (!t)\n            cbl(null, file);\n        else if (m < 160000) {\n            try {\n                cbl(null, deflateSync(file, p));\n            }\n            catch (e) {\n                cbl(e, null);\n            }\n        }\n        else\n            term.push(deflate(file, p, cbl));\n    };\n    // Cannot use lft because it can decrease\n    for (var i = 0; i < slft; ++i) {\n        _loop_1(i);\n    }\n    return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n    if (opts === void 0) { opts = {}; }\n    var r = {};\n    var files = [];\n    fltn(data, '', r, opts);\n    var o = 0;\n    var tot = 0;\n    for (var fn in r) {\n        var _a = r[fn], file = _a[0], p = _a[1];\n        var t = p.level == 0 ? 0 : 8;\n        var n = strToU8(fn), s = n.length;\n        if (n.length > 65535)\n            throw 'filename too long';\n        var d = t ? deflateSync(file, p) : file, l = d.length;\n        var c = crc();\n        c.p(file);\n        files.push({\n            t: t,\n            d: d,\n            m: file.length,\n            c: c.d(),\n            u: fn.length != s,\n            n: n,\n            o: o,\n            p: p\n        });\n        o += 30 + s + l;\n        tot += 76 + 2 * s + l;\n    }\n    var out = new u8(tot + 22), oe = o, cdl = tot - o;\n    for (var i = 0; i < files.length; ++i) {\n        var f = files[i];\n        wzh(out, f.o, f.c, f.d, f.m, f.n, f.u, f.p, null, f.t);\n        wzh(out, o, f.c, f.d, f.m, f.n, f.u, f.p, f.o, f.t), o += 46 + f.n.length;\n    }\n    wzf(out, o, files.length, cdl, oe);\n    return out;\n}\n/**\n * Asynchronously decompresses a ZIP archive\n * @param data The raw compressed ZIP file\n * @param cb The callback to call with the decompressed files\n * @returns A function that can be used to immediately terminate the unzipping\n */\nexport function unzip(data, cb) {\n    if (typeof cb != 'function')\n        throw 'no callback';\n    var term = [];\n    var tAll = function () {\n        for (var i = 0; i < term.length; ++i)\n            term[i]();\n    };\n    var files = {};\n    var e = data.length - 22;\n    for (; b4(data, e) != 0x6054B50; --e) {\n        if (!e || data.length - e > 65558) {\n            cb('invalid zip file', null);\n            return;\n        }\n    }\n    ;\n    var lft = b2(data, e + 8);\n    if (!lft)\n        cb(null, {});\n    var c = lft;\n    var o = b4(data, e + 16);\n    var z = o == 4294967295;\n    if (z) {\n        e = b4(data, e - 12);\n        if (b4(data, e) != 0x6064B50)\n            throw 'invalid zip file';\n        c = lft = b4(data, e + 32);\n        o = b4(data, e + 48);\n    }\n    var _loop_2 = function (i) {\n        var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n        o = no;\n        var cbl = function (e, d) {\n            if (e) {\n                tAll();\n                cb(e, null);\n            }\n            else {\n                files[fn] = d;\n                if (!--lft)\n                    cb(null, files);\n            }\n        };\n        if (!c_1)\n            cbl(null, slc(data, b, b + sc));\n        else if (c_1 == 8) {\n            var infl = data.subarray(b, b + sc);\n            if (sc < 320000) {\n                try {\n                    cbl(null, inflateSync(infl, new u8(su)));\n                }\n                catch (e) {\n                    cbl(e, null);\n                }\n            }\n            else\n                term.push(inflate(infl, { size: su }, cbl));\n        }\n        else\n            cbl('unknown compression type ' + c_1, null);\n    };\n    for (var i = 0; i < c; ++i) {\n        _loop_2(i);\n    }\n    return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @returns The decompressed files\n */\nexport function unzipSync(data) {\n    var files = {};\n    var e = data.length - 22;\n    for (; b4(data, e) != 0x6054B50; --e) {\n        if (!e || data.length - e > 65558)\n            throw 'invalid zip file';\n    }\n    ;\n    var c = b2(data, e + 8);\n    if (!c)\n        return {};\n    var o = b4(data, e + 16);\n    var z = o == 4294967295;\n    if (z) {\n        e = b4(data, e - 12);\n        if (b4(data, e) != 0x6064B50)\n            throw 'invalid zip file';\n        c = b4(data, e + 32);\n        o = b4(data, e + 48);\n    }\n    for (var i = 0; i < c; ++i) {\n        var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n        o = no;\n        if (!c_2)\n            files[fn] = slc(data, b, b + sc);\n        else if (c_2 == 8)\n            files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));\n        else\n            throw 'unknown compression type ' + c_2;\n    }\n    return files;\n}\n","export var globalObject = (function() {\n  return \"undefined\" !== typeof window\n    ? window\n    : \"undefined\" !== typeof global\n    ? global\n    : \"undefined\" !== typeof self\n    ? self\n    : this;\n})();\n","import { globalObject } from \"./globalObject.js\";\n\nfunction consoleLog() {\n  if (globalObject.console && typeof globalObject.console.log === \"function\") {\n    globalObject.console.log.apply(globalObject.console, arguments);\n  }\n}\n\nfunction consoleWarn(str) {\n  if (globalObject.console) {\n    if (typeof globalObject.console.warn === \"function\") {\n      globalObject.console.warn.apply(globalObject.console, arguments);\n    } else {\n      consoleLog.call(null, arguments);\n    }\n  }\n}\n\nfunction consoleError(str) {\n  if (globalObject.console) {\n    if (typeof globalObject.console.error === \"function\") {\n      globalObject.console.error.apply(globalObject.console, arguments);\n    } else {\n      consoleLog(str);\n    }\n  }\n}\nexport var console = {\n  log: consoleLog,\n  warn: consoleWarn,\n  error: consoleError\n};\n","/**\n * @license\n * FileSaver.js\n * A saveAs() FileSaver implementation.\n *\n * By Eli Grey, http://eligrey.com\n *\n * License : https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md (MIT)\n * source  : http://purl.eligrey.com/github/FileSaver.js\n */\n\nimport { globalObject as _global } from \"./globalObject.js\";\nimport { console } from \"./console.js\";\n\nfunction bom(blob, opts) {\n  if (typeof opts === \"undefined\") opts = { autoBom: false };\n  else if (typeof opts !== \"object\") {\n    console.warn(\"Deprecated: Expected third argument to be a object\");\n    opts = { autoBom: !opts };\n  }\n\n  // prepend BOM for UTF-8 XML and text/* types (including HTML)\n  // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF\n  if (\n    opts.autoBom &&\n    /^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(\n      blob.type\n    )\n  ) {\n    return new Blob([String.fromCharCode(0xfeff), blob], { type: blob.type });\n  }\n  return blob;\n}\n\nfunction download(url, name, opts) {\n  var xhr = new XMLHttpRequest();\n  xhr.open(\"GET\", url);\n  xhr.responseType = \"blob\";\n  xhr.onload = function() {\n    saveAs(xhr.response, name, opts);\n  };\n  xhr.onerror = function() {\n    console.error(\"could not download file\");\n  };\n  xhr.send();\n}\n\nfunction corsEnabled(url) {\n  var xhr = new XMLHttpRequest();\n  // use sync to avoid popup blocker\n  xhr.open(\"HEAD\", url, false);\n  try {\n    xhr.send();\n  } catch (e) {}\n  return xhr.status >= 200 && xhr.status <= 299;\n}\n\n// `a.click()` doesn't work for all browsers (#465)\nfunction click(node) {\n  try {\n    node.dispatchEvent(new MouseEvent(\"click\"));\n  } catch (e) {\n    var evt = document.createEvent(\"MouseEvents\");\n    evt.initMouseEvent(\n      \"click\",\n      true,\n      true,\n      window,\n      0,\n      0,\n      0,\n      80,\n      20,\n      false,\n      false,\n      false,\n      false,\n      0,\n      null\n    );\n    node.dispatchEvent(evt);\n  }\n}\n\nvar saveAs =\n  _global.saveAs ||\n  // probably in some web worker\n  (typeof window !== \"object\" || window !== _global\n    ? function saveAs() {\n        /* noop */\n      }\n    : // Use download attribute first if possible (#193 Lumia mobile) unless this is a native app\n    typeof HTMLAnchorElement !== \"undefined\" &&\n      \"download\" in HTMLAnchorElement.prototype\n    ? function saveAs(blob, name, opts) {\n        var URL = _global.URL || _global.webkitURL;\n        var a = document.createElement(\"a\");\n        name = name || blob.name || \"download\";\n\n        a.download = name;\n        a.rel = \"noopener\"; // tabnabbing\n\n        // TODO: detect chrome extensions & packaged apps\n        // a.target = '_blank'\n\n        if (typeof blob === \"string\") {\n          // Support regular links\n          a.href = blob;\n          if (a.origin !== location.origin) {\n            corsEnabled(a.href)\n              ? download(blob, name, opts)\n              : click(a, (a.target = \"_blank\"));\n          } else {\n            click(a);\n          }\n        } else {\n          // Support blobs\n          a.href = URL.createObjectURL(blob);\n          setTimeout(function() {\n            URL.revokeObjectURL(a.href);\n          }, 4e4); // 40s\n          setTimeout(function() {\n            click(a);\n          }, 0);\n        }\n      }\n    : // Use msSaveOrOpenBlob as a second approach\n    \"msSaveOrOpenBlob\" in navigator\n    ? function saveAs(blob, name, opts) {\n        name = name || blob.name || \"download\";\n\n        if (typeof blob === \"string\") {\n          if (corsEnabled(blob)) {\n            download(blob, name, opts);\n          } else {\n            var a = document.createElement(\"a\");\n            a.href = blob;\n            a.target = \"_blank\";\n            setTimeout(function() {\n              click(a);\n            });\n          }\n        } else {\n          navigator.msSaveOrOpenBlob(bom(blob, opts), name);\n        }\n      }\n    : // Fallback to using FileReader and a popup\n      function saveAs(blob, name, opts, popup) {\n        // Open a popup immediately do go around popup blocker\n        // Mostly only available on user interaction and the fileReader is async so...\n        popup = popup || open(\"\", \"_blank\");\n        if (popup) {\n          popup.document.title = popup.document.body.innerText =\n            \"downloading...\";\n        }\n\n        if (typeof blob === \"string\") return download(blob, name, opts);\n\n        var force = blob.type === \"application/octet-stream\";\n        var isSafari =\n          /constructor/i.test(_global.HTMLElement) || _global.safari;\n        var isChromeIOS = /CriOS\\/[\\d]+/.test(navigator.userAgent);\n\n        if (\n          (isChromeIOS || (force && isSafari)) &&\n          typeof FileReader === \"object\"\n        ) {\n          // Safari doesn't allow downloading of blob URLs\n          var reader = new FileReader();\n          reader.onloadend = function() {\n            var url = reader.result;\n            url = isChromeIOS\n              ? url\n              : url.replace(/^data:[^;]*;/, \"data:attachment/file;\");\n            if (popup) popup.location.href = url;\n            else location = url;\n            popup = null; // reverse-tabnabbing #460\n          };\n          reader.readAsDataURL(blob);\n        } else {\n          var URL = _global.URL || _global.webkitURL;\n          var url = URL.createObjectURL(blob);\n          if (popup) popup.location = url;\n          else location.href = url;\n          popup = null; // reverse-tabnabbing #460\n          setTimeout(function() {\n            URL.revokeObjectURL(url);\n          }, 4e4); // 40s\n        }\n      });\n\nexport { saveAs };\n","import { globalObject } from \"./globalObject.js\";\n\nvar atob, btoa;\n\n(function() {\n  atob = globalObject.atob.bind(globalObject);\n  btoa = globalObject.btoa.bind(globalObject);\n  return;\n\n})();\n\nexport { atob, btoa };\n","/**\n * A class to parse color values\n * @author Stoyan Stefanov <sstoo@gmail.com>\n * {@link   http://www.phpied.com/rgb-color-parser-in-javascript/}\n * @license Use it if you like it\n */\n\nfunction RGBColor(color_string) {\n  color_string = color_string || \"\";\n  this.ok = false;\n\n  // strip any leading #\n  if (color_string.charAt(0) == \"#\") {\n    // remove # if any\n    color_string = color_string.substr(1, 6);\n  }\n\n  color_string = color_string.replace(/ /g, \"\");\n  color_string = color_string.toLowerCase();\n\n  var channels;\n\n  // before getting into regexps, try simple matches\n  // and overwrite the input\n  var simple_colors = {\n    aliceblue: \"f0f8ff\",\n    antiquewhite: \"faebd7\",\n    aqua: \"00ffff\",\n    aquamarine: \"7fffd4\",\n    azure: \"f0ffff\",\n    beige: \"f5f5dc\",\n    bisque: \"ffe4c4\",\n    black: \"000000\",\n    blanchedalmond: \"ffebcd\",\n    blue: \"0000ff\",\n    blueviolet: \"8a2be2\",\n    brown: \"a52a2a\",\n    burlywood: \"deb887\",\n    cadetblue: \"5f9ea0\",\n    chartreuse: \"7fff00\",\n    chocolate: \"d2691e\",\n    coral: \"ff7f50\",\n    cornflowerblue: \"6495ed\",\n    cornsilk: \"fff8dc\",\n    crimson: \"dc143c\",\n    cyan: \"00ffff\",\n    darkblue: \"00008b\",\n    darkcyan: \"008b8b\",\n    darkgoldenrod: \"b8860b\",\n    darkgray: \"a9a9a9\",\n    darkgreen: \"006400\",\n    darkkhaki: \"bdb76b\",\n    darkmagenta: \"8b008b\",\n    darkolivegreen: \"556b2f\",\n    darkorange: \"ff8c00\",\n    darkorchid: \"9932cc\",\n    darkred: \"8b0000\",\n    darksalmon: \"e9967a\",\n    darkseagreen: \"8fbc8f\",\n    darkslateblue: \"483d8b\",\n    darkslategray: \"2f4f4f\",\n    darkturquoise: \"00ced1\",\n    darkviolet: \"9400d3\",\n    deeppink: \"ff1493\",\n    deepskyblue: \"00bfff\",\n    dimgray: \"696969\",\n    dodgerblue: \"1e90ff\",\n    feldspar: \"d19275\",\n    firebrick: \"b22222\",\n    floralwhite: \"fffaf0\",\n    forestgreen: \"228b22\",\n    fuchsia: \"ff00ff\",\n    gainsboro: \"dcdcdc\",\n    ghostwhite: \"f8f8ff\",\n    gold: \"ffd700\",\n    goldenrod: \"daa520\",\n    gray: \"808080\",\n    green: \"008000\",\n    greenyellow: \"adff2f\",\n    honeydew: \"f0fff0\",\n    hotpink: \"ff69b4\",\n    indianred: \"cd5c5c\",\n    indigo: \"4b0082\",\n    ivory: \"fffff0\",\n    khaki: \"f0e68c\",\n    lavender: \"e6e6fa\",\n    lavenderblush: \"fff0f5\",\n    lawngreen: \"7cfc00\",\n    lemonchiffon: \"fffacd\",\n    lightblue: \"add8e6\",\n    lightcoral: \"f08080\",\n    lightcyan: \"e0ffff\",\n    lightgoldenrodyellow: \"fafad2\",\n    lightgrey: \"d3d3d3\",\n    lightgreen: \"90ee90\",\n    lightpink: \"ffb6c1\",\n    lightsalmon: \"ffa07a\",\n    lightseagreen: \"20b2aa\",\n    lightskyblue: \"87cefa\",\n    lightslateblue: \"8470ff\",\n    lightslategray: \"778899\",\n    lightsteelblue: \"b0c4de\",\n    lightyellow: \"ffffe0\",\n    lime: \"00ff00\",\n    limegreen: \"32cd32\",\n    linen: \"faf0e6\",\n    magenta: \"ff00ff\",\n    maroon: \"800000\",\n    mediumaquamarine: \"66cdaa\",\n    mediumblue: \"0000cd\",\n    mediumorchid: \"ba55d3\",\n    mediumpurple: \"9370d8\",\n    mediumseagreen: \"3cb371\",\n    mediumslateblue: \"7b68ee\",\n    mediumspringgreen: \"00fa9a\",\n    mediumturquoise: \"48d1cc\",\n    mediumvioletred: \"c71585\",\n    midnightblue: \"191970\",\n    mintcream: \"f5fffa\",\n    mistyrose: \"ffe4e1\",\n    moccasin: \"ffe4b5\",\n    navajowhite: \"ffdead\",\n    navy: \"000080\",\n    oldlace: \"fdf5e6\",\n    olive: \"808000\",\n    olivedrab: \"6b8e23\",\n    orange: \"ffa500\",\n    orangered: \"ff4500\",\n    orchid: \"da70d6\",\n    palegoldenrod: \"eee8aa\",\n    palegreen: \"98fb98\",\n    paleturquoise: \"afeeee\",\n    palevioletred: \"d87093\",\n    papayawhip: \"ffefd5\",\n    peachpuff: \"ffdab9\",\n    peru: \"cd853f\",\n    pink: \"ffc0cb\",\n    plum: \"dda0dd\",\n    powderblue: \"b0e0e6\",\n    purple: \"800080\",\n    red: \"ff0000\",\n    rosybrown: \"bc8f8f\",\n    royalblue: \"4169e1\",\n    saddlebrown: \"8b4513\",\n    salmon: \"fa8072\",\n    sandybrown: \"f4a460\",\n    seagreen: \"2e8b57\",\n    seashell: \"fff5ee\",\n    sienna: \"a0522d\",\n    silver: \"c0c0c0\",\n    skyblue: \"87ceeb\",\n    slateblue: \"6a5acd\",\n    slategray: \"708090\",\n    snow: \"fffafa\",\n    springgreen: \"00ff7f\",\n    steelblue: \"4682b4\",\n    tan: \"d2b48c\",\n    teal: \"008080\",\n    thistle: \"d8bfd8\",\n    tomato: \"ff6347\",\n    turquoise: \"40e0d0\",\n    violet: \"ee82ee\",\n    violetred: \"d02090\",\n    wheat: \"f5deb3\",\n    white: \"ffffff\",\n    whitesmoke: \"f5f5f5\",\n    yellow: \"ffff00\",\n    yellowgreen: \"9acd32\"\n  };\n  color_string = simple_colors[color_string] || color_string;\n\n  // array of color definition objects\n  var color_defs = [\n    {\n      re: /^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,\n      example: [\"rgb(123, 234, 45)\", \"rgb(255,234,245)\"],\n      process: function(bits) {\n        return [parseInt(bits[1]), parseInt(bits[2]), parseInt(bits[3])];\n      }\n    },\n    {\n      re: /^(\\w{2})(\\w{2})(\\w{2})$/,\n      example: [\"#00ff00\", \"336699\"],\n      process: function(bits) {\n        return [\n          parseInt(bits[1], 16),\n          parseInt(bits[2], 16),\n          parseInt(bits[3], 16)\n        ];\n      }\n    },\n    {\n      re: /^(\\w{1})(\\w{1})(\\w{1})$/,\n      example: [\"#fb0\", \"f0f\"],\n      process: function(bits) {\n        return [\n          parseInt(bits[1] + bits[1], 16),\n          parseInt(bits[2] + bits[2], 16),\n          parseInt(bits[3] + bits[3], 16)\n        ];\n      }\n    }\n  ];\n\n  // search through the definitions to find a match\n  for (var i = 0; i < color_defs.length; i++) {\n    var re = color_defs[i].re;\n    var processor = color_defs[i].process;\n    var bits = re.exec(color_string);\n    if (bits) {\n      channels = processor(bits);\n      this.r = channels[0];\n      this.g = channels[1];\n      this.b = channels[2];\n      this.ok = true;\n    }\n  }\n\n  // validate/cleanup values\n  this.r = this.r < 0 || isNaN(this.r) ? 0 : this.r > 255 ? 255 : this.r;\n  this.g = this.g < 0 || isNaN(this.g) ? 0 : this.g > 255 ? 255 : this.g;\n  this.b = this.b < 0 || isNaN(this.b) ? 0 : this.b > 255 ? 255 : this.b;\n\n  // some getters\n  this.toRGB = function() {\n    return \"rgb(\" + this.r + \", \" + this.g + \", \" + this.b + \")\";\n  };\n  this.toHex = function() {\n    var r = this.r.toString(16);\n    var g = this.g.toString(16);\n    var b = this.b.toString(16);\n    if (r.length == 1) r = \"0\" + r;\n    if (g.length == 1) g = \"0\" + g;\n    if (b.length == 1) b = \"0\" + b;\n    return \"#\" + r + g + b;\n  };\n}\n\nexport { RGBColor };\n","/**\n * @license\n * Joseph Myers does not specify a particular license for his work.\n *\n * Author: Joseph Myers\n * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js\n *\n * Modified by: Owen Leong\n */\n\nfunction md5cycle(x, k) {\n  var a = x[0],\n    b = x[1],\n    c = x[2],\n    d = x[3];\n\n  a = ff(a, b, c, d, k[0], 7, -680876936);\n  d = ff(d, a, b, c, k[1], 12, -389564586);\n  c = ff(c, d, a, b, k[2], 17, 606105819);\n  b = ff(b, c, d, a, k[3], 22, -1044525330);\n  a = ff(a, b, c, d, k[4], 7, -176418897);\n  d = ff(d, a, b, c, k[5], 12, 1200080426);\n  c = ff(c, d, a, b, k[6], 17, -1473231341);\n  b = ff(b, c, d, a, k[7], 22, -45705983);\n  a = ff(a, b, c, d, k[8], 7, 1770035416);\n  d = ff(d, a, b, c, k[9], 12, -1958414417);\n  c = ff(c, d, a, b, k[10], 17, -42063);\n  b = ff(b, c, d, a, k[11], 22, -1990404162);\n  a = ff(a, b, c, d, k[12], 7, 1804603682);\n  d = ff(d, a, b, c, k[13], 12, -40341101);\n  c = ff(c, d, a, b, k[14], 17, -1502002290);\n  b = ff(b, c, d, a, k[15], 22, 1236535329);\n\n  a = gg(a, b, c, d, k[1], 5, -165796510);\n  d = gg(d, a, b, c, k[6], 9, -1069501632);\n  c = gg(c, d, a, b, k[11], 14, 643717713);\n  b = gg(b, c, d, a, k[0], 20, -373897302);\n  a = gg(a, b, c, d, k[5], 5, -701558691);\n  d = gg(d, a, b, c, k[10], 9, 38016083);\n  c = gg(c, d, a, b, k[15], 14, -660478335);\n  b = gg(b, c, d, a, k[4], 20, -405537848);\n  a = gg(a, b, c, d, k[9], 5, 568446438);\n  d = gg(d, a, b, c, k[14], 9, -1019803690);\n  c = gg(c, d, a, b, k[3], 14, -187363961);\n  b = gg(b, c, d, a, k[8], 20, 1163531501);\n  a = gg(a, b, c, d, k[13], 5, -1444681467);\n  d = gg(d, a, b, c, k[2], 9, -51403784);\n  c = gg(c, d, a, b, k[7], 14, 1735328473);\n  b = gg(b, c, d, a, k[12], 20, -1926607734);\n\n  a = hh(a, b, c, d, k[5], 4, -378558);\n  d = hh(d, a, b, c, k[8], 11, -2022574463);\n  c = hh(c, d, a, b, k[11], 16, 1839030562);\n  b = hh(b, c, d, a, k[14], 23, -35309556);\n  a = hh(a, b, c, d, k[1], 4, -1530992060);\n  d = hh(d, a, b, c, k[4], 11, 1272893353);\n  c = hh(c, d, a, b, k[7], 16, -155497632);\n  b = hh(b, c, d, a, k[10], 23, -1094730640);\n  a = hh(a, b, c, d, k[13], 4, 681279174);\n  d = hh(d, a, b, c, k[0], 11, -358537222);\n  c = hh(c, d, a, b, k[3], 16, -722521979);\n  b = hh(b, c, d, a, k[6], 23, 76029189);\n  a = hh(a, b, c, d, k[9], 4, -640364487);\n  d = hh(d, a, b, c, k[12], 11, -421815835);\n  c = hh(c, d, a, b, k[15], 16, 530742520);\n  b = hh(b, c, d, a, k[2], 23, -995338651);\n\n  a = ii(a, b, c, d, k[0], 6, -198630844);\n  d = ii(d, a, b, c, k[7], 10, 1126891415);\n  c = ii(c, d, a, b, k[14], 15, -1416354905);\n  b = ii(b, c, d, a, k[5], 21, -57434055);\n  a = ii(a, b, c, d, k[12], 6, 1700485571);\n  d = ii(d, a, b, c, k[3], 10, -1894986606);\n  c = ii(c, d, a, b, k[10], 15, -1051523);\n  b = ii(b, c, d, a, k[1], 21, -2054922799);\n  a = ii(a, b, c, d, k[8], 6, 1873313359);\n  d = ii(d, a, b, c, k[15], 10, -30611744);\n  c = ii(c, d, a, b, k[6], 15, -1560198380);\n  b = ii(b, c, d, a, k[13], 21, 1309151649);\n  a = ii(a, b, c, d, k[4], 6, -145523070);\n  d = ii(d, a, b, c, k[11], 10, -1120210379);\n  c = ii(c, d, a, b, k[2], 15, 718787259);\n  b = ii(b, c, d, a, k[9], 21, -343485551);\n\n  x[0] = add32(a, x[0]);\n  x[1] = add32(b, x[1]);\n  x[2] = add32(c, x[2]);\n  x[3] = add32(d, x[3]);\n}\n\nfunction cmn(q, a, b, x, s, t) {\n  a = add32(add32(a, q), add32(x, t));\n  return add32((a << s) | (a >>> (32 - s)), b);\n}\n\nfunction ff(a, b, c, d, x, s, t) {\n  return cmn((b & c) | (~b & d), a, b, x, s, t);\n}\n\nfunction gg(a, b, c, d, x, s, t) {\n  return cmn((b & d) | (c & ~d), a, b, x, s, t);\n}\n\nfunction hh(a, b, c, d, x, s, t) {\n  return cmn(b ^ c ^ d, a, b, x, s, t);\n}\n\nfunction ii(a, b, c, d, x, s, t) {\n  return cmn(c ^ (b | ~d), a, b, x, s, t);\n}\n\nfunction md51(s) {\n  // txt = '';\n  var n = s.length,\n    state = [1732584193, -271733879, -1732584194, 271733878],\n    i;\n  for (i = 64; i <= s.length; i += 64) {\n    md5cycle(state, md5blk(s.substring(i - 64, i)));\n  }\n  s = s.substring(i - 64);\n  var tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n  for (i = 0; i < s.length; i++)\n    tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);\n  tail[i >> 2] |= 0x80 << (i % 4 << 3);\n  if (i > 55) {\n    md5cycle(state, tail);\n    for (i = 0; i < 16; i++) tail[i] = 0;\n  }\n  tail[14] = n * 8;\n  md5cycle(state, tail);\n  return state;\n}\n\n/* there needs to be support for Unicode here,\n * unless we pretend that we can redefine the MD-5\n * algorithm for multi-byte characters (perhaps\n * by adding every four 16-bit characters and\n * shortening the sum to 32 bits). Otherwise\n * I suggest performing MD-5 as if every character\n * was two bytes--e.g., 0040 0025 = @%--but then\n * how will an ordinary MD-5 sum be matched?\n * There is no way to standardize text to something\n * like UTF-8 before transformation; speed cost is\n * utterly prohibitive. The JavaScript standard\n * itself needs to look at this: it should start\n * providing access to strings as preformed UTF-8\n * 8-bit unsigned value arrays.\n */\nfunction md5blk(s) {\n  /* I figured global was faster.   */\n  var md5blks = [],\n    i; /* Andy King said do it this way. */\n  for (i = 0; i < 64; i += 4) {\n    md5blks[i >> 2] =\n      s.charCodeAt(i) +\n      (s.charCodeAt(i + 1) << 8) +\n      (s.charCodeAt(i + 2) << 16) +\n      (s.charCodeAt(i + 3) << 24);\n  }\n  return md5blks;\n}\n\nvar hex_chr = \"0123456789abcdef\".split(\"\");\n\nfunction rhex(n) {\n  var s = \"\",\n    j = 0;\n  for (; j < 4; j++)\n    s += hex_chr[(n >> (j * 8 + 4)) & 0x0f] + hex_chr[(n >> (j * 8)) & 0x0f];\n  return s;\n}\n\nfunction hex(x) {\n  for (var i = 0; i < x.length; i++) x[i] = rhex(x[i]);\n  return x.join(\"\");\n}\n\n// Converts a 4-byte number to byte string\nfunction singleToByteString(n) {\n  return String.fromCharCode(\n    (n & 0xff) >> 0,\n    (n & 0xff00) >> 8,\n    (n & 0xff0000) >> 16,\n    (n & 0xff000000) >> 24\n  );\n}\n\n// Converts an array of numbers to a byte string\nfunction toByteString(x) {\n  return x.map(singleToByteString).join(\"\");\n}\n\n// Returns the MD5 hash as a byte string\nfunction md5Bin(s) {\n  return toByteString(md51(s));\n}\n\n// Returns MD5 hash as a hex string\nfunction md5(s) {\n  return hex(md51(s));\n}\n\nvar md5Check = md5(\"hello\") != \"5d41402abc4b2a76b9719d911017c592\";\n\nfunction add32(a, b) {\n  if (md5Check) {\n    /* if the md5Check does not match\n     the expected value, we're dealing\n     with an old browser and need\n     this function. */\n    var lsw = (a & 0xffff) + (b & 0xffff),\n      msw = (a >> 16) + (b >> 16) + (lsw >> 16);\n    return (msw << 16) | (lsw & 0xffff);\n  } else {\n    /* this function is much faster,\n    so if possible we use it. Some IEs\n    are the only ones I know of that\n    need the idiotic second function,\n    generated by an if clause.  */\n    return (a + b) & 0xffffffff;\n  }\n}\n\nexport { md5, md5Bin };\n","/**\r\n * @license\r\n * FPDF is released under a permissive license: there is no usage restriction.\r\n * You may embed it freely in your application (commercial or not), with or\r\n * without modifications.\r\n *\r\n * Reference: http://www.fpdf.org/en/script/script37.php\r\n */\r\n\r\nfunction repeat(str, num) {\r\n  return new Array(num + 1).join(str);\r\n}\r\n\r\n/**\r\n * Converts a byte string to a hex string\r\n *\r\n * @name rc4\r\n * @function\r\n * @param {string} key Byte string of encryption key\r\n * @param {string} data Byte string of data to be encrypted\r\n * @returns {string} Encrypted string\r\n */\r\nfunction rc4(key, data) {\r\n  var lastKey, lastState;\r\n  if (key !== lastKey) {\r\n    var k = repeat(key, ((256 / key.length) >> 0) + 1);\r\n    var state = [];\r\n    for (var i = 0; i < 256; i++) {\r\n      state[i] = i;\r\n    }\r\n    var j = 0;\r\n    for (var i = 0; i < 256; i++) {\r\n      var t = state[i];\r\n      j = (j + t + k.charCodeAt(i)) % 256;\r\n      state[i] = state[j];\r\n      state[j] = t;\r\n    }\r\n    lastKey = key;\r\n    lastState = state;\r\n  } else {\r\n    state = lastState;\r\n  }\r\n  var length = data.length;\r\n  var a = 0;\r\n  var b = 0;\r\n  var out = \"\";\r\n  for (var i = 0; i < length; i++) {\r\n    a = (a + 1) % 256;\r\n    t = state[a];\r\n    b = (b + t) % 256;\r\n    state[a] = state[b];\r\n    state[b] = t;\r\n    k = state[(state[a] + state[b]) % 256];\r\n    out += String.fromCharCode(data.charCodeAt(i) ^ k);\r\n  }\r\n  return out;\r\n}\r\n\r\nexport { rc4 };\r\n","/**\r\n * @license\r\n * Licensed under the MIT License.\r\n * http://opensource.org/licenses/mit-license\r\n * Author: Owen Leong (@owenl131)\r\n * Date: 15 Oct 2020\r\n * References:\r\n * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt\r\n * https://github.com/foliojs/pdfkit/blob/master/lib/security.js\r\n * http://www.fpdf.org/en/script/script37.php\r\n */\r\n\r\nimport { md5Bin } from \"./md5.js\";\r\nimport { rc4 } from \"./rc4.js\";\r\n\r\nvar permissionOptions = {\r\n  print: 4,\r\n  modify: 8,\r\n  copy: 16,\r\n  \"annot-forms\": 32\r\n};\r\n\r\n/**\r\n * Initializes encryption settings\r\n *\r\n * @name constructor\r\n * @function\r\n * @param {Array} permissions Permissions allowed for user, \"print\", \"modify\", \"copy\" and \"annot-forms\".\r\n * @param {String} userPassword Permissions apply to this user. Leaving this empty means the document\r\n *                              is not password protected but viewer has the above permissions.\r\n * @param {String} ownerPassword Owner has full functionalities to the file.\r\n * @param {String} fileId As hex string, should be same as the file ID in the trailer.\r\n * @example\r\n * var security = new PDFSecurity([\"print\"])\r\n */\r\nfunction PDFSecurity(permissions, userPassword, ownerPassword, fileId) {\r\n  this.v = 1; // algorithm 1, future work can add in more recent encryption schemes\r\n  this.r = 2; // revision 2\r\n\r\n  // set flags for what functionalities the user can access\r\n  let protection = 192;\r\n  permissions.forEach(function(perm) {\r\n    if (typeof permissionOptions.perm !== \"undefined\") {\r\n      throw new Error(\"Invalid permission: \" + perm);\r\n    }\r\n    protection += permissionOptions[perm];\r\n  });\r\n\r\n  // padding is used to pad the passwords to 32 bytes, also is hashed and stored in the final PDF\r\n  this.padding =\r\n    \"\\x28\\xBF\\x4E\\x5E\\x4E\\x75\\x8A\\x41\\x64\\x00\\x4E\\x56\\xFF\\xFA\\x01\\x08\" +\r\n    \"\\x2E\\x2E\\x00\\xB6\\xD0\\x68\\x3E\\x80\\x2F\\x0C\\xA9\\xFE\\x64\\x53\\x69\\x7A\";\r\n  let paddedUserPassword = (userPassword + this.padding).substr(0, 32);\r\n  let paddedOwnerPassword = (ownerPassword + this.padding).substr(0, 32);\r\n\r\n  this.O = this.processOwnerPassword(paddedUserPassword, paddedOwnerPassword);\r\n  this.P = -((protection ^ 255) + 1);\r\n  this.encryptionKey = md5Bin(\r\n    paddedUserPassword +\r\n      this.O +\r\n      this.lsbFirstWord(this.P) +\r\n      this.hexToBytes(fileId)\r\n  ).substr(0, 5);\r\n  this.U = rc4(this.encryptionKey, this.padding);\r\n}\r\n\r\n/**\r\n * Breaks down a 4-byte number into its individual bytes, with the least significant bit first\r\n *\r\n * @name lsbFirstWord\r\n * @function\r\n * @param {number} data 32-bit number\r\n * @returns {Array}\r\n */\r\nPDFSecurity.prototype.lsbFirstWord = function(data) {\r\n  return String.fromCharCode(\r\n    (data >> 0) & 0xff,\r\n    (data >> 8) & 0xff,\r\n    (data >> 16) & 0xff,\r\n    (data >> 24) & 0xff\r\n  );\r\n};\r\n\r\n/**\r\n * Converts a byte string to a hex string\r\n *\r\n * @name toHexString\r\n * @function\r\n * @param {String} byteString Byte string\r\n * @returns {String}\r\n */\r\nPDFSecurity.prototype.toHexString = function(byteString) {\r\n  return byteString\r\n    .split(\"\")\r\n    .map(function(byte) {\r\n      return (\"0\" + (byte.charCodeAt(0) & 0xff).toString(16)).slice(-2);\r\n    })\r\n    .join(\"\");\r\n};\r\n\r\n/**\r\n * Converts a hex string to a byte string\r\n *\r\n * @name hexToBytes\r\n * @function\r\n * @param {String} hex Hex string\r\n * @returns {String}\r\n */\r\nPDFSecurity.prototype.hexToBytes = function(hex) {\r\n  for (var bytes = [], c = 0; c < hex.length; c += 2)\r\n    bytes.push(String.fromCharCode(parseInt(hex.substr(c, 2), 16)));\r\n  return bytes.join(\"\");\r\n};\r\n\r\n/**\r\n * Computes the 'O' field in the encryption dictionary\r\n *\r\n * @name processOwnerPassword\r\n * @function\r\n * @param {String} paddedUserPassword Byte string of padded user password\r\n * @param {String} paddedOwnerPassword Byte string of padded owner password\r\n * @returns {String}\r\n */\r\nPDFSecurity.prototype.processOwnerPassword = function(\r\n  paddedUserPassword,\r\n  paddedOwnerPassword\r\n) {\r\n  let key = md5Bin(paddedOwnerPassword).substr(0, 5);\r\n  return rc4(key, paddedUserPassword);\r\n};\r\n\r\n/**\r\n * Returns an encryptor function which can take in a byte string and returns the encrypted version\r\n *\r\n * @name encryptor\r\n * @function\r\n * @param {number} objectId\r\n * @param {number} generation Not sure what this is for, you can set it to 0\r\n * @returns {Function}\r\n * @example\r\n * out(\"stream\");\r\n * encryptor = security.encryptor(object.id, 0);\r\n * out(encryptor(data));\r\n * out(\"endstream\");\r\n */\r\nPDFSecurity.prototype.encryptor = function(objectId, generation) {\r\n  let key = md5Bin(\r\n    this.encryptionKey +\r\n      String.fromCharCode(\r\n        objectId & 0xff,\r\n        (objectId >> 8) & 0xff,\r\n        (objectId >> 16) & 0xff,\r\n        generation & 0xff,\r\n        (generation >> 8) & 0xff\r\n      )\r\n  ).substr(0, 10);\r\n  return function(data) {\r\n    return rc4(key, data);\r\n  };\r\n};\r\n\r\nexport { PDFSecurity };\r\n","/**\n * Convert string to `PDF Name Object`.\n * Detail: PDF Reference 1.3 - Chapter 3.2.4 Name Object\n * @param str\n */\nfunction toPDFName(str) {\n  // eslint-disable-next-line no-control-regex\n  if (/[^\\u0000-\\u00ff]/.test(str)) {\n    // non ascii string\n    throw new Error(\n      \"Invalid PDF Name Object: \" + str + \", Only accept ASCII characters.\"\n    );\n  }\n  var result = \"\",\n    strLength = str.length;\n  for (var i = 0; i < strLength; i++) {\n    var charCode = str.charCodeAt(i);\n    if (\n      charCode < 0x21 ||\n      charCode === 0x23 /* # */ ||\n      charCode === 0x25 /* % */ ||\n      charCode === 0x28 /* ( */ ||\n      charCode === 0x29 /* ) */ ||\n      charCode === 0x2f /* / */ ||\n      charCode === 0x3c /* < */ ||\n      charCode === 0x3e /* > */ ||\n      charCode === 0x5b /* [ */ ||\n      charCode === 0x5d /* ] */ ||\n      charCode === 0x7b /* { */ ||\n      charCode === 0x7d /* } */ ||\n      charCode > 0x7e\n    ) {\n      // Char    CharCode    hexStr   paddingHexStr    Result\n      // \"\\t\"    9           9        09               #09\n      // \" \"     32          20       20               #20\n      // \"©\"     169         a9       a9               #a9\n      var hexStr = charCode.toString(16),\n        paddingHexStr = (\"0\" + hexStr).slice(-2);\n\n      result += \"#\" + paddingHexStr;\n    } else {\n      // Other ASCII printable characters between 0x21 <= X <= 0x7e\n      result += str[i];\n    }\n  }\n  return result;\n}\n\nexport { toPDFName };\n","/* eslint-disable no-console */\r\n\r\nimport { saveAs } from \"./libs/FileSaver.js\";\r\nimport { globalObject } from \"./libs/globalObject.js\";\r\nimport { RGBColor } from \"./libs/rgbcolor.js\";\r\nimport { btoa } from \"./libs/AtobBtoa.js\";\r\nimport { console } from \"./libs/console.js\";\r\nimport { PDFSecurity } from \"./libs/pdfsecurity.js\";\r\nimport { toPDFName } from \"./libs/pdfname.js\";\r\n/**\r\n * jsPDF's Internal PubSub Implementation.\r\n * Backward compatible rewritten on 2014 by\r\n * Diego Casorran, https://github.com/diegocr\r\n *\r\n * @class\r\n * @name PubSub\r\n * @ignore\r\n */\r\nfunction PubSub(context) {\r\n  if (typeof context !== \"object\") {\r\n    throw new Error(\r\n      \"Invalid Context passed to initialize PubSub (jsPDF-module)\"\r\n    );\r\n  }\r\n  var topics = {};\r\n\r\n  this.subscribe = function(topic, callback, once) {\r\n    once = once || false;\r\n    if (\r\n      typeof topic !== \"string\" ||\r\n      typeof callback !== \"function\" ||\r\n      typeof once !== \"boolean\"\r\n    ) {\r\n      throw new Error(\r\n        \"Invalid arguments passed to PubSub.subscribe (jsPDF-module)\"\r\n      );\r\n    }\r\n\r\n    if (!topics.hasOwnProperty(topic)) {\r\n      topics[topic] = {};\r\n    }\r\n\r\n    var token = Math.random().toString(35);\r\n    topics[topic][token] = [callback, !!once];\r\n\r\n    return token;\r\n  };\r\n\r\n  this.unsubscribe = function(token) {\r\n    for (var topic in topics) {\r\n      if (topics[topic][token]) {\r\n        delete topics[topic][token];\r\n        if (Object.keys(topics[topic]).length === 0) {\r\n          delete topics[topic];\r\n        }\r\n        return true;\r\n      }\r\n    }\r\n    return false;\r\n  };\r\n\r\n  this.publish = function(topic) {\r\n    if (topics.hasOwnProperty(topic)) {\r\n      var args = Array.prototype.slice.call(arguments, 1),\r\n        tokens = [];\r\n\r\n      for (var token in topics[topic]) {\r\n        var sub = topics[topic][token];\r\n        try {\r\n          sub[0].apply(context, args);\r\n        } catch (ex) {\r\n          if (globalObject.console) {\r\n            console.error(\"jsPDF PubSub Error\", ex.message, ex);\r\n          }\r\n        }\r\n        if (sub[1]) tokens.push(token);\r\n      }\r\n      if (tokens.length) tokens.forEach(this.unsubscribe);\r\n    }\r\n  };\r\n\r\n  this.getTopics = function() {\r\n    return topics;\r\n  };\r\n}\r\n\r\nfunction GState(parameters) {\r\n  if (!(this instanceof GState)) {\r\n    return new GState(parameters);\r\n  }\r\n\r\n  /**\r\n   * @name GState#opacity\r\n   * @type {any}\r\n   */\r\n  /**\r\n   * @name GState#stroke-opacity\r\n   * @type {any}\r\n   */\r\n  var supported = \"opacity,stroke-opacity\".split(\",\");\r\n  for (var p in parameters) {\r\n    if (parameters.hasOwnProperty(p) && supported.indexOf(p) >= 0) {\r\n      this[p] = parameters[p];\r\n    }\r\n  }\r\n  /**\r\n   * @name GState#id\r\n   * @type {string}\r\n   */\r\n  this.id = \"\"; // set by addGState()\r\n  /**\r\n   * @name GState#objectNumber\r\n   * @type {number}\r\n   */\r\n  this.objectNumber = -1; // will be set by putGState()\r\n}\r\n\r\nGState.prototype.equals = function equals(other) {\r\n  var ignore = \"id,objectNumber,equals\";\r\n  var p;\r\n  if (!other || typeof other !== typeof this) return false;\r\n  var count = 0;\r\n  for (p in this) {\r\n    if (ignore.indexOf(p) >= 0) continue;\r\n    if (this.hasOwnProperty(p) && !other.hasOwnProperty(p)) return false;\r\n    if (this[p] !== other[p]) return false;\r\n    count++;\r\n  }\r\n  for (p in other) {\r\n    if (other.hasOwnProperty(p) && ignore.indexOf(p) < 0) count--;\r\n  }\r\n  return count === 0;\r\n};\r\n\r\nfunction Pattern(gState, matrix) {\r\n  this.gState = gState;\r\n  this.matrix = matrix;\r\n\r\n  this.id = \"\"; // set by addPattern()\r\n  this.objectNumber = -1; // will be set by putPattern()\r\n}\r\n\r\nfunction ShadingPattern(type, coords, colors, gState, matrix) {\r\n  if (!(this instanceof ShadingPattern)) {\r\n    return new ShadingPattern(type, coords, colors, gState, matrix);\r\n  }\r\n\r\n  // see putPattern() for information how they are realized\r\n  this.type = type === \"axial\" ? 2 : 3;\r\n  this.coords = coords;\r\n  this.colors = colors;\r\n\r\n  Pattern.call(this, gState, matrix);\r\n}\r\n\r\nfunction TilingPattern(boundingBox, xStep, yStep, gState, matrix) {\r\n  if (!(this instanceof TilingPattern)) {\r\n    return new TilingPattern(boundingBox, xStep, yStep, gState, matrix);\r\n  }\r\n\r\n  this.boundingBox = boundingBox;\r\n  this.xStep = xStep;\r\n  this.yStep = yStep;\r\n\r\n  this.stream = \"\"; // set by endTilingPattern();\r\n\r\n  this.cloneIndex = 0;\r\n\r\n  Pattern.call(this, gState, matrix);\r\n}\r\n\r\n/**\r\n * Creates new jsPDF document object instance.\r\n * @name jsPDF\r\n * @class\r\n * @param {Object} [options] - Collection of settings initializing the jsPDF-instance\r\n * @param {string} [options.orientation=portrait] - Orientation of the first page. Possible values are \"portrait\" or \"landscape\" (or shortcuts \"p\" or \"l\").<br />\r\n * @param {string} [options.unit=mm] Measurement unit (base unit) to be used when coordinates are specified.<br />\r\n * Possible values are \"pt\" (points), \"mm\", \"cm\", \"in\", \"px\", \"pc\", \"em\" or \"ex\". Note that in order to get the correct scaling for \"px\"\r\n * units, you need to enable the hotfix \"px_scaling\" by setting options.hotfixes = [\"px_scaling\"].\r\n * @param {string/Array} [options.format=a4] The format of the first page. Can be:<ul><li>a0 - a10</li><li>b0 - b10</li><li>c0 - c10</li><li>dl</li><li>letter</li><li>government-letter</li><li>legal</li><li>junior-legal</li><li>ledger</li><li>tabloid</li><li>credit-card</li></ul><br />\r\n * Default is \"a4\". If you want to use your own format just pass instead of one of the above predefined formats the size as an number-array, e.g. [595.28, 841.89]\r\n * @param {boolean} [options.putOnlyUsedFonts=false] Only put fonts into the PDF, which were used.\r\n * @param {boolean} [options.compress=false] Compress the generated PDF.\r\n * @param {number} [options.precision=16] Precision of the element-positions.\r\n * @param {number} [options.userUnit=1.0] Not to be confused with the base unit. Please inform yourself before you use it.\r\n * @param {string[]} [options.hotfixes] An array of strings to enable hotfixes such as correct pixel scaling.\r\n * @param {Object} [options.encryption]\r\n * @param {string} [options.encryption.userPassword] Password for the user bound by the given permissions list.\r\n * @param {string} [options.encryption.ownerPassword] Both userPassword and ownerPassword should be set for proper authentication.\r\n * @param {string[]} [options.encryption.userPermissions] Array of permissions \"print\", \"modify\", \"copy\", \"annot-forms\", accessible by the user.\r\n * @param {number|\"smart\"} [options.floatPrecision=16]\r\n * @returns {jsPDF} jsPDF-instance\r\n * @description\r\n * ```\r\n * {\r\n *  orientation: 'p',\r\n *  unit: 'mm',\r\n *  format: 'a4',\r\n *  putOnlyUsedFonts:true,\r\n *  floatPrecision: 16 // or \"smart\", default is 16\r\n * }\r\n * ```\r\n *\r\n * @constructor\r\n */\r\nfunction jsPDF(options) {\r\n  var orientation = typeof arguments[0] === \"string\" ? arguments[0] : \"p\";\r\n  var unit = arguments[1];\r\n  var format = arguments[2];\r\n  var compressPdf = arguments[3];\r\n  var filters = [];\r\n  var userUnit = 1.0;\r\n  var precision;\r\n  var floatPrecision = 16;\r\n  var defaultPathOperation = \"S\";\r\n  var encryptionOptions = null;\r\n\r\n  options = options || {};\r\n\r\n  if (typeof options === \"object\") {\r\n    orientation = options.orientation;\r\n    unit = options.unit || unit;\r\n    format = options.format || format;\r\n    compressPdf = options.compress || options.compressPdf || compressPdf;\r\n    encryptionOptions = options.encryption || null;\r\n    if (encryptionOptions !== null) {\r\n      encryptionOptions.userPassword = encryptionOptions.userPassword || \"\";\r\n      encryptionOptions.ownerPassword = encryptionOptions.ownerPassword || \"\";\r\n      encryptionOptions.userPermissions =\r\n        encryptionOptions.userPermissions || [];\r\n    }\r\n    userUnit =\r\n      typeof options.userUnit === \"number\" ? Math.abs(options.userUnit) : 1.0;\r\n    if (typeof options.precision !== \"undefined\") {\r\n      precision = options.precision;\r\n    }\r\n    if (typeof options.floatPrecision !== \"undefined\") {\r\n      floatPrecision = options.floatPrecision;\r\n    }\r\n    defaultPathOperation = options.defaultPathOperation || \"S\";\r\n  }\r\n\r\n  filters =\r\n    options.filters || (compressPdf === true ? [\"FlateEncode\"] : filters);\r\n\r\n  unit = unit || \"mm\";\r\n  orientation = (\"\" + (orientation || \"P\")).toLowerCase();\r\n  var putOnlyUsedFonts = options.putOnlyUsedFonts || false;\r\n  var usedFonts = {};\r\n\r\n  var API = {\r\n    internal: {},\r\n    __private__: {}\r\n  };\r\n\r\n  API.__private__.PubSub = PubSub;\r\n\r\n  var pdfVersion = \"1.3\";\r\n  var getPdfVersion = (API.__private__.getPdfVersion = function() {\r\n    return pdfVersion;\r\n  });\r\n\r\n  API.__private__.setPdfVersion = function(value) {\r\n    pdfVersion = value;\r\n  };\r\n\r\n  // Size in pt of various paper formats\r\n  var pageFormats = {\r\n    a0: [2383.94, 3370.39],\r\n    a1: [1683.78, 2383.94],\r\n    a2: [1190.55, 1683.78],\r\n    a3: [841.89, 1190.55],\r\n    a4: [595.28, 841.89],\r\n    a5: [419.53, 595.28],\r\n    a6: [297.64, 419.53],\r\n    a7: [209.76, 297.64],\r\n    a8: [147.4, 209.76],\r\n    a9: [104.88, 147.4],\r\n    a10: [73.7, 104.88],\r\n    b0: [2834.65, 4008.19],\r\n    b1: [2004.09, 2834.65],\r\n    b2: [1417.32, 2004.09],\r\n    b3: [1000.63, 1417.32],\r\n    b4: [708.66, 1000.63],\r\n    b5: [498.9, 708.66],\r\n    b6: [354.33, 498.9],\r\n    b7: [249.45, 354.33],\r\n    b8: [175.75, 249.45],\r\n    b9: [124.72, 175.75],\r\n    b10: [87.87, 124.72],\r\n    c0: [2599.37, 3676.54],\r\n    c1: [1836.85, 2599.37],\r\n    c2: [1298.27, 1836.85],\r\n    c3: [918.43, 1298.27],\r\n    c4: [649.13, 918.43],\r\n    c5: [459.21, 649.13],\r\n    c6: [323.15, 459.21],\r\n    c7: [229.61, 323.15],\r\n    c8: [161.57, 229.61],\r\n    c9: [113.39, 161.57],\r\n    c10: [79.37, 113.39],\r\n    dl: [311.81, 623.62],\r\n    letter: [612, 792],\r\n    \"government-letter\": [576, 756],\r\n    legal: [612, 1008],\r\n    \"junior-legal\": [576, 360],\r\n    ledger: [1224, 792],\r\n    tabloid: [792, 1224],\r\n    \"credit-card\": [153, 243]\r\n  };\r\n\r\n  API.__private__.getPageFormats = function() {\r\n    return pageFormats;\r\n  };\r\n\r\n  var getPageFormat = (API.__private__.getPageFormat = function(value) {\r\n    return pageFormats[value];\r\n  });\r\n\r\n  format = format || \"a4\";\r\n\r\n  var ApiMode = {\r\n    COMPAT: \"compat\",\r\n    ADVANCED: \"advanced\"\r\n  };\r\n  var apiMode = ApiMode.COMPAT;\r\n\r\n  function advancedAPI() {\r\n    // prepend global change of basis matrix\r\n    // (Now, instead of converting every coordinate to the pdf coordinate system, we apply a matrix\r\n    // that does this job for us (however, texts, images and similar objects must be drawn bottom up))\r\n    this.saveGraphicsState();\r\n    out(\r\n      new Matrix(\r\n        scaleFactor,\r\n        0,\r\n        0,\r\n        -scaleFactor,\r\n        0,\r\n        getPageHeight() * scaleFactor\r\n      ).toString() + \" cm\"\r\n    );\r\n    this.setFontSize(this.getFontSize() / scaleFactor);\r\n\r\n    // The default in MrRio's implementation is \"S\" (stroke), whereas the default in the yWorks implementation\r\n    // was \"n\" (none). Although this has nothing to do with transforms, we should use the API switch here.\r\n    defaultPathOperation = \"n\";\r\n\r\n    apiMode = ApiMode.ADVANCED;\r\n  }\r\n\r\n  function compatAPI() {\r\n    this.restoreGraphicsState();\r\n    defaultPathOperation = \"S\";\r\n    apiMode = ApiMode.COMPAT;\r\n  }\r\n\r\n  /**\r\n   * @function combineFontStyleAndFontWeight\r\n   * @param {string} fontStyle Fontstyle or variant. Example: \"italic\".\r\n   * @param {number | string} fontWeight Weight of the Font. Example: \"normal\" | 400\r\n   * @returns {string}\r\n   * @private\r\n   */\r\n  var combineFontStyleAndFontWeight = (API.__private__.combineFontStyleAndFontWeight = function(\r\n    fontStyle,\r\n    fontWeight\r\n  ) {\r\n    if (\r\n      (fontStyle == \"bold\" && fontWeight == \"normal\") ||\r\n      (fontStyle == \"bold\" && fontWeight == 400) ||\r\n      (fontStyle == \"normal\" && fontWeight == \"italic\") ||\r\n      (fontStyle == \"bold\" && fontWeight == \"italic\")\r\n    ) {\r\n      throw new Error(\"Invalid Combination of fontweight and fontstyle\");\r\n    }\r\n    if (fontWeight) {\r\n      fontStyle =\r\n        fontWeight == 400 || fontWeight === \"normal\"\r\n          ? fontStyle === \"italic\"\r\n            ? \"italic\"\r\n            : \"normal\"\r\n          : (fontWeight == 700 || fontWeight === \"bold\") &&\r\n            fontStyle === \"normal\"\r\n          ? \"bold\"\r\n          : (fontWeight == 700 ? \"bold\" : fontWeight) + \"\" + fontStyle;\r\n    }\r\n    return fontStyle;\r\n  });\r\n\r\n  /**\r\n   * @callback ApiSwitchBody\r\n   * @param {jsPDF} pdf\r\n   */\r\n\r\n  /**\r\n   * For compatibility reasons jsPDF offers two API modes which differ in the way they convert between the the usual\r\n   * screen coordinates and the PDF coordinate system.\r\n   *   - \"compat\": Offers full compatibility across all plugins but does not allow arbitrary transforms\r\n   *   - \"advanced\": Allows arbitrary transforms and more advanced features like pattern fills. Some plugins might\r\n   *     not support this mode, though.\r\n   * Initial mode is \"compat\".\r\n   *\r\n   * You can either provide a callback to the body argument, which means that jsPDF will automatically switch back to\r\n   * the original API mode afterwards; or you can omit the callback and switch back manually using {@link compatAPI}.\r\n   *\r\n   * Note, that the calls to {@link saveGraphicsState} and {@link restoreGraphicsState} need to be balanced within the\r\n   * callback or between calls of this method and its counterpart {@link compatAPI}. Calls to {@link beginFormObject}\r\n   * or {@link beginTilingPattern} need to be closed by their counterparts before switching back to \"compat\" API mode.\r\n   *\r\n   * @param {ApiSwitchBody=} body When provided, this callback will be called after the API mode has been switched.\r\n   * The API mode will be switched back automatically afterwards.\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name advancedAPI\r\n   */\r\n  API.advancedAPI = function(body) {\r\n    var doSwitch = apiMode === ApiMode.COMPAT;\r\n\r\n    if (doSwitch) {\r\n      advancedAPI.call(this);\r\n    }\r\n\r\n    if (typeof body !== \"function\") {\r\n      return this;\r\n    }\r\n\r\n    body(this);\r\n\r\n    if (doSwitch) {\r\n      compatAPI.call(this);\r\n    }\r\n\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Switches to \"compat\" API mode. See {@link advancedAPI} for more details.\r\n   *\r\n   * @param {ApiSwitchBody=} body When provided, this callback will be called after the API mode has been switched.\r\n   * The API mode will be switched back automatically afterwards.\r\n   * @return {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name compatApi\r\n   */\r\n  API.compatAPI = function(body) {\r\n    var doSwitch = apiMode === ApiMode.ADVANCED;\r\n\r\n    if (doSwitch) {\r\n      compatAPI.call(this);\r\n    }\r\n\r\n    if (typeof body !== \"function\") {\r\n      return this;\r\n    }\r\n\r\n    body(this);\r\n\r\n    if (doSwitch) {\r\n      advancedAPI.call(this);\r\n    }\r\n\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * @return {boolean} True iff the current API mode is \"advanced\". See {@link advancedAPI}.\r\n   * @memberof jsPDF#\r\n   * @name isAdvancedAPI\r\n   */\r\n  API.isAdvancedAPI = function() {\r\n    return apiMode === ApiMode.ADVANCED;\r\n  };\r\n\r\n  var advancedApiModeTrap = function(methodName) {\r\n    if (apiMode !== ApiMode.ADVANCED) {\r\n      throw new Error(\r\n        methodName +\r\n          \" is only available in 'advanced' API mode. \" +\r\n          \"You need to call advancedAPI() first.\"\r\n      );\r\n    }\r\n  };\r\n\r\n  var roundToPrecision = (API.roundToPrecision = API.__private__.roundToPrecision = function(\r\n    number,\r\n    parmPrecision\r\n  ) {\r\n    var tmpPrecision = precision || parmPrecision;\r\n    if (isNaN(number) || isNaN(tmpPrecision)) {\r\n      throw new Error(\"Invalid argument passed to jsPDF.roundToPrecision\");\r\n    }\r\n    return number.toFixed(tmpPrecision).replace(/0+$/, \"\");\r\n  });\r\n\r\n  // high precision float\r\n  var hpf;\r\n  if (typeof floatPrecision === \"number\") {\r\n    hpf = API.hpf = API.__private__.hpf = function(number) {\r\n      if (isNaN(number)) {\r\n        throw new Error(\"Invalid argument passed to jsPDF.hpf\");\r\n      }\r\n      return roundToPrecision(number, floatPrecision);\r\n    };\r\n  } else if (floatPrecision === \"smart\") {\r\n    hpf = API.hpf = API.__private__.hpf = function(number) {\r\n      if (isNaN(number)) {\r\n        throw new Error(\"Invalid argument passed to jsPDF.hpf\");\r\n      }\r\n      if (number > -1 && number < 1) {\r\n        return roundToPrecision(number, 16);\r\n      } else {\r\n        return roundToPrecision(number, 5);\r\n      }\r\n    };\r\n  } else {\r\n    hpf = API.hpf = API.__private__.hpf = function(number) {\r\n      if (isNaN(number)) {\r\n        throw new Error(\"Invalid argument passed to jsPDF.hpf\");\r\n      }\r\n      return roundToPrecision(number, 16);\r\n    };\r\n  }\r\n  var f2 = (API.f2 = API.__private__.f2 = function(number) {\r\n    if (isNaN(number)) {\r\n      throw new Error(\"Invalid argument passed to jsPDF.f2\");\r\n    }\r\n    return roundToPrecision(number, 2);\r\n  });\r\n\r\n  var f3 = (API.__private__.f3 = function(number) {\r\n    if (isNaN(number)) {\r\n      throw new Error(\"Invalid argument passed to jsPDF.f3\");\r\n    }\r\n    return roundToPrecision(number, 3);\r\n  });\r\n\r\n  var scale = (API.scale = API.__private__.scale = function(number) {\r\n    if (isNaN(number)) {\r\n      throw new Error(\"Invalid argument passed to jsPDF.scale\");\r\n    }\r\n    if (apiMode === ApiMode.COMPAT) {\r\n      return number * scaleFactor;\r\n    } else if (apiMode === ApiMode.ADVANCED) {\r\n      return number;\r\n    }\r\n  });\r\n\r\n  var transformY = function(y) {\r\n    if (apiMode === ApiMode.COMPAT) {\r\n      return getPageHeight() - y;\r\n    } else if (apiMode === ApiMode.ADVANCED) {\r\n      return y;\r\n    }\r\n  };\r\n\r\n  var transformScaleY = function(y) {\r\n    return scale(transformY(y));\r\n  };\r\n\r\n  /**\r\n   * @name setPrecision\r\n   * @memberof jsPDF#\r\n   * @function\r\n   * @instance\r\n   * @param {string} precision\r\n   * @returns {jsPDF}\r\n   */\r\n  API.__private__.setPrecision = API.setPrecision = function(value) {\r\n    if (typeof parseInt(value, 10) === \"number\") {\r\n      precision = parseInt(value, 10);\r\n    }\r\n  };\r\n\r\n  var fileId = \"00000000000000000000000000000000\";\r\n\r\n  var getFileId = (API.__private__.getFileId = function() {\r\n    return fileId;\r\n  });\r\n\r\n  var setFileId = (API.__private__.setFileId = function(value) {\r\n    if (typeof value !== \"undefined\" && /^[a-fA-F0-9]{32}$/.test(value)) {\r\n      fileId = value.toUpperCase();\r\n    } else {\r\n      fileId = fileId\r\n        .split(\"\")\r\n        .map(function() {\r\n          return \"ABCDEF0123456789\".charAt(Math.floor(Math.random() * 16));\r\n        })\r\n        .join(\"\");\r\n    }\r\n\r\n    if (encryptionOptions !== null) {\r\n      encryption = new PDFSecurity(\r\n        encryptionOptions.userPermissions,\r\n        encryptionOptions.userPassword,\r\n        encryptionOptions.ownerPassword,\r\n        fileId\r\n      );\r\n    }\r\n    return fileId;\r\n  });\r\n\r\n  /**\r\n   * @name setFileId\r\n   * @memberof jsPDF#\r\n   * @function\r\n   * @instance\r\n   * @param {string} value GUID.\r\n   * @returns {jsPDF}\r\n   */\r\n  API.setFileId = function(value) {\r\n    setFileId(value);\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * @name getFileId\r\n   * @memberof jsPDF#\r\n   * @function\r\n   * @instance\r\n   *\r\n   * @returns {string} GUID.\r\n   */\r\n  API.getFileId = function() {\r\n    return getFileId();\r\n  };\r\n\r\n  var creationDate;\r\n\r\n  var convertDateToPDFDate = (API.__private__.convertDateToPDFDate = function(\r\n    parmDate\r\n  ) {\r\n    var result = \"\";\r\n    var tzoffset = parmDate.getTimezoneOffset(),\r\n      tzsign = tzoffset < 0 ? \"+\" : \"-\",\r\n      tzhour = Math.floor(Math.abs(tzoffset / 60)),\r\n      tzmin = Math.abs(tzoffset % 60),\r\n      timeZoneString = [tzsign, padd2(tzhour), \"'\", padd2(tzmin), \"'\"].join(\"\");\r\n\r\n    result = [\r\n      \"D:\",\r\n      parmDate.getFullYear(),\r\n      padd2(parmDate.getMonth() + 1),\r\n      padd2(parmDate.getDate()),\r\n      padd2(parmDate.getHours()),\r\n      padd2(parmDate.getMinutes()),\r\n      padd2(parmDate.getSeconds()),\r\n      timeZoneString\r\n    ].join(\"\");\r\n    return result;\r\n  });\r\n\r\n  var convertPDFDateToDate = (API.__private__.convertPDFDateToDate = function(\r\n    parmPDFDate\r\n  ) {\r\n    var year = parseInt(parmPDFDate.substr(2, 4), 10);\r\n    var month = parseInt(parmPDFDate.substr(6, 2), 10) - 1;\r\n    var date = parseInt(parmPDFDate.substr(8, 2), 10);\r\n    var hour = parseInt(parmPDFDate.substr(10, 2), 10);\r\n    var minutes = parseInt(parmPDFDate.substr(12, 2), 10);\r\n    var seconds = parseInt(parmPDFDate.substr(14, 2), 10);\r\n    // var timeZoneHour = parseInt(parmPDFDate.substr(16, 2), 10);\r\n    // var timeZoneMinutes = parseInt(parmPDFDate.substr(20, 2), 10);\r\n\r\n    var resultingDate = new Date(year, month, date, hour, minutes, seconds, 0);\r\n    return resultingDate;\r\n  });\r\n\r\n  var setCreationDate = (API.__private__.setCreationDate = function(date) {\r\n    var tmpCreationDateString;\r\n    var regexPDFCreationDate = /^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\\+0[0-9]|\\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/;\r\n    if (typeof date === \"undefined\") {\r\n      date = new Date();\r\n    }\r\n\r\n    if (date instanceof Date) {\r\n      tmpCreationDateString = convertDateToPDFDate(date);\r\n    } else if (regexPDFCreationDate.test(date)) {\r\n      tmpCreationDateString = date;\r\n    } else {\r\n      throw new Error(\"Invalid argument passed to jsPDF.setCreationDate\");\r\n    }\r\n    creationDate = tmpCreationDateString;\r\n    return creationDate;\r\n  });\r\n\r\n  var getCreationDate = (API.__private__.getCreationDate = function(type) {\r\n    var result = creationDate;\r\n    if (type === \"jsDate\") {\r\n      result = convertPDFDateToDate(creationDate);\r\n    }\r\n    return result;\r\n  });\r\n\r\n  /**\r\n   * @name setCreationDate\r\n   * @memberof jsPDF#\r\n   * @function\r\n   * @instance\r\n   * @param {Object} date\r\n   * @returns {jsPDF}\r\n   */\r\n  API.setCreationDate = function(date) {\r\n    setCreationDate(date);\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * @name getCreationDate\r\n   * @memberof jsPDF#\r\n   * @function\r\n   * @instance\r\n   * @param {Object} type\r\n   * @returns {Object}\r\n   */\r\n  API.getCreationDate = function(type) {\r\n    return getCreationDate(type);\r\n  };\r\n\r\n  var padd2 = (API.__private__.padd2 = function(number) {\r\n    return (\"0\" + parseInt(number)).slice(-2);\r\n  });\r\n\r\n  var padd2Hex = (API.__private__.padd2Hex = function(hexString) {\r\n    hexString = hexString.toString();\r\n    return (\"00\" + hexString).substr(hexString.length);\r\n  });\r\n\r\n  var objectNumber = 0; // 'n' Current object number\r\n  var offsets = []; // List of offsets. Activated and reset by buildDocument(). Pupulated by various calls buildDocument makes.\r\n  var content = [];\r\n  var contentLength = 0;\r\n  var additionalObjects = [];\r\n\r\n  var pages = [];\r\n  var currentPage;\r\n  var hasCustomDestination = false;\r\n  var outputDestination = content;\r\n\r\n  var resetDocument = function() {\r\n    //reset fields relevant for objectNumber generation and xref.\r\n    objectNumber = 0;\r\n    contentLength = 0;\r\n    content = [];\r\n    offsets = [];\r\n    additionalObjects = [];\r\n\r\n    rootDictionaryObjId = newObjectDeferred();\r\n    resourceDictionaryObjId = newObjectDeferred();\r\n  };\r\n\r\n  API.__private__.setCustomOutputDestination = function(destination) {\r\n    hasCustomDestination = true;\r\n    outputDestination = destination;\r\n  };\r\n  var setOutputDestination = function(destination) {\r\n    if (!hasCustomDestination) {\r\n      outputDestination = destination;\r\n    }\r\n  };\r\n\r\n  API.__private__.resetCustomOutputDestination = function() {\r\n    hasCustomDestination = false;\r\n    outputDestination = content;\r\n  };\r\n\r\n  var out = (API.__private__.out = function(string) {\r\n    string = string.toString();\r\n    contentLength += string.length + 1;\r\n    outputDestination.push(string);\r\n\r\n    return outputDestination;\r\n  });\r\n\r\n  var write = (API.__private__.write = function(value) {\r\n    return out(\r\n      arguments.length === 1\r\n        ? value.toString()\r\n        : Array.prototype.join.call(arguments, \" \")\r\n    );\r\n  });\r\n\r\n  var getArrayBuffer = (API.__private__.getArrayBuffer = function(data) {\r\n    var len = data.length,\r\n      ab = new ArrayBuffer(len),\r\n      u8 = new Uint8Array(ab);\r\n\r\n    while (len--) u8[len] = data.charCodeAt(len);\r\n    return ab;\r\n  });\r\n\r\n  var standardFonts = [\r\n    [\"Helvetica\", \"helvetica\", \"normal\", \"WinAnsiEncoding\"],\r\n    [\"Helvetica-Bold\", \"helvetica\", \"bold\", \"WinAnsiEncoding\"],\r\n    [\"Helvetica-Oblique\", \"helvetica\", \"italic\", \"WinAnsiEncoding\"],\r\n    [\"Helvetica-BoldOblique\", \"helvetica\", \"bolditalic\", \"WinAnsiEncoding\"],\r\n    [\"Courier\", \"courier\", \"normal\", \"WinAnsiEncoding\"],\r\n    [\"Courier-Bold\", \"courier\", \"bold\", \"WinAnsiEncoding\"],\r\n    [\"Courier-Oblique\", \"courier\", \"italic\", \"WinAnsiEncoding\"],\r\n    [\"Courier-BoldOblique\", \"courier\", \"bolditalic\", \"WinAnsiEncoding\"],\r\n    [\"Times-Roman\", \"times\", \"normal\", \"WinAnsiEncoding\"],\r\n    [\"Times-Bold\", \"times\", \"bold\", \"WinAnsiEncoding\"],\r\n    [\"Times-Italic\", \"times\", \"italic\", \"WinAnsiEncoding\"],\r\n    [\"Times-BoldItalic\", \"times\", \"bolditalic\", \"WinAnsiEncoding\"],\r\n    [\"ZapfDingbats\", \"zapfdingbats\", \"normal\", null],\r\n    [\"Symbol\", \"symbol\", \"normal\", null]\r\n  ];\r\n\r\n  API.__private__.getStandardFonts = function() {\r\n    return standardFonts;\r\n  };\r\n\r\n  var activeFontSize = options.fontSize || 16;\r\n\r\n  /**\r\n   * Sets font size for upcoming text elements.\r\n   *\r\n   * @param {number} size Font size in points.\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name setFontSize\r\n   */\r\n  API.__private__.setFontSize = API.setFontSize = function(size) {\r\n    if (apiMode === ApiMode.ADVANCED) {\r\n      activeFontSize = size / scaleFactor;\r\n    } else {\r\n      activeFontSize = size;\r\n    }\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Gets the fontsize for upcoming text elements.\r\n   *\r\n   * @function\r\n   * @instance\r\n   * @returns {number}\r\n   * @memberof jsPDF#\r\n   * @name getFontSize\r\n   */\r\n  var getFontSize = (API.__private__.getFontSize = API.getFontSize = function() {\r\n    if (apiMode === ApiMode.COMPAT) {\r\n      return activeFontSize;\r\n    } else {\r\n      return activeFontSize * scaleFactor;\r\n    }\r\n  });\r\n\r\n  var R2L = options.R2L || false;\r\n\r\n  /**\r\n   * Set value of R2L functionality.\r\n   *\r\n   * @param {boolean} value\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF} jsPDF-instance\r\n   * @memberof jsPDF#\r\n   * @name setR2L\r\n   */\r\n  API.__private__.setR2L = API.setR2L = function(value) {\r\n    R2L = value;\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Get value of R2L functionality.\r\n   *\r\n   * @function\r\n   * @instance\r\n   * @returns {boolean} jsPDF-instance\r\n   * @memberof jsPDF#\r\n   * @name getR2L\r\n   */\r\n  API.__private__.getR2L = API.getR2L = function() {\r\n    return R2L;\r\n  };\r\n\r\n  var zoomMode; // default: 1;\r\n\r\n  var setZoomMode = (API.__private__.setZoomMode = function(zoom) {\r\n    var validZoomModes = [\r\n      undefined,\r\n      null,\r\n      \"fullwidth\",\r\n      \"fullheight\",\r\n      \"fullpage\",\r\n      \"original\"\r\n    ];\r\n\r\n    if (/^(?:\\d+\\.\\d*|\\d*\\.\\d+|\\d+)%$/.test(zoom)) {\r\n      zoomMode = zoom;\r\n    } else if (!isNaN(zoom)) {\r\n      zoomMode = parseInt(zoom, 10);\r\n    } else if (validZoomModes.indexOf(zoom) !== -1) {\r\n      zoomMode = zoom;\r\n    } else {\r\n      throw new Error(\r\n        'zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. \"' +\r\n          zoom +\r\n          '\" is not recognized.'\r\n      );\r\n    }\r\n  });\r\n\r\n  API.__private__.getZoomMode = function() {\r\n    return zoomMode;\r\n  };\r\n\r\n  var pageMode; // default: 'UseOutlines';\r\n  var setPageMode = (API.__private__.setPageMode = function(pmode) {\r\n    var validPageModes = [\r\n      undefined,\r\n      null,\r\n      \"UseNone\",\r\n      \"UseOutlines\",\r\n      \"UseThumbs\",\r\n      \"FullScreen\"\r\n    ];\r\n\r\n    if (validPageModes.indexOf(pmode) == -1) {\r\n      throw new Error(\r\n        'Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. \"' +\r\n          pmode +\r\n          '\" is not recognized.'\r\n      );\r\n    }\r\n    pageMode = pmode;\r\n  });\r\n\r\n  API.__private__.getPageMode = function() {\r\n    return pageMode;\r\n  };\r\n\r\n  var layoutMode; // default: 'continuous';\r\n  var setLayoutMode = (API.__private__.setLayoutMode = function(layout) {\r\n    var validLayoutModes = [\r\n      undefined,\r\n      null,\r\n      \"continuous\",\r\n      \"single\",\r\n      \"twoleft\",\r\n      \"tworight\",\r\n      \"two\"\r\n    ];\r\n\r\n    if (validLayoutModes.indexOf(layout) == -1) {\r\n      throw new Error(\r\n        'Layout mode must be one of continuous, single, twoleft, tworight. \"' +\r\n          layout +\r\n          '\" is not recognized.'\r\n      );\r\n    }\r\n    layoutMode = layout;\r\n  });\r\n\r\n  API.__private__.getLayoutMode = function() {\r\n    return layoutMode;\r\n  };\r\n\r\n  /**\r\n   * Set the display mode options of the page like zoom and layout.\r\n   *\r\n   * @name setDisplayMode\r\n   * @memberof jsPDF#\r\n   * @function\r\n   * @instance\r\n   * @param {integer|String} zoom   You can pass an integer or percentage as\r\n   * a string. 2 will scale the document up 2x, '200%' will scale up by the\r\n   * same amount. You can also set it to 'fullwidth', 'fullheight',\r\n   * 'fullpage', or 'original'.\r\n   *\r\n   * Only certain PDF readers support this, such as Adobe Acrobat.\r\n   *\r\n   * @param {string} layout Layout mode can be: 'continuous' - this is the\r\n   * default continuous scroll. 'single' - the single page mode only shows one\r\n   * page at a time. 'twoleft' - two column left mode, first page starts on\r\n   * the left, and 'tworight' - pages are laid out in two columns, with the\r\n   * first page on the right. This would be used for books.\r\n   * @param {string} pmode 'UseOutlines' - it shows the\r\n   * outline of the document on the left. 'UseThumbs' - shows thumbnails along\r\n   * the left. 'FullScreen' - prompts the user to enter fullscreen mode.\r\n   *\r\n   * @returns {jsPDF}\r\n   */\r\n  API.__private__.setDisplayMode = API.setDisplayMode = function(\r\n    zoom,\r\n    layout,\r\n    pmode\r\n  ) {\r\n    setZoomMode(zoom);\r\n    setLayoutMode(layout);\r\n    setPageMode(pmode);\r\n    return this;\r\n  };\r\n\r\n  var documentProperties = {\r\n    title: \"\",\r\n    subject: \"\",\r\n    author: \"\",\r\n    keywords: \"\",\r\n    creator: \"\"\r\n  };\r\n\r\n  API.__private__.getDocumentProperty = function(key) {\r\n    if (Object.keys(documentProperties).indexOf(key) === -1) {\r\n      throw new Error(\"Invalid argument passed to jsPDF.getDocumentProperty\");\r\n    }\r\n    return documentProperties[key];\r\n  };\r\n\r\n  API.__private__.getDocumentProperties = function() {\r\n    return documentProperties;\r\n  };\r\n\r\n  /**\r\n   * Adds a properties to the PDF document.\r\n   *\r\n   * @param {Object} A property_name-to-property_value object structure.\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name setDocumentProperties\r\n   */\r\n  API.__private__.setDocumentProperties = API.setProperties = API.setDocumentProperties = function(\r\n    properties\r\n  ) {\r\n    // copying only those properties we can render.\r\n    for (var property in documentProperties) {\r\n      if (documentProperties.hasOwnProperty(property) && properties[property]) {\r\n        documentProperties[property] = properties[property];\r\n      }\r\n    }\r\n    return this;\r\n  };\r\n\r\n  API.__private__.setDocumentProperty = function(key, value) {\r\n    if (Object.keys(documentProperties).indexOf(key) === -1) {\r\n      throw new Error(\"Invalid arguments passed to jsPDF.setDocumentProperty\");\r\n    }\r\n    return (documentProperties[key] = value);\r\n  };\r\n\r\n  var fonts = {}; // collection of font objects, where key is fontKey - a dynamically created label for a given font.\r\n  var fontmap = {}; // mapping structure fontName > fontStyle > font key - performance layer. See addFont()\r\n  var activeFontKey; // will be string representing the KEY of the font as combination of fontName + fontStyle\r\n  var fontStateStack = []; //\r\n  var patterns = {}; // collection of pattern objects\r\n  var patternMap = {}; // see fonts\r\n  var gStates = {}; // collection of graphic state objects\r\n  var gStatesMap = {}; // see fonts\r\n  var activeGState = null;\r\n  var scaleFactor; // Scale factor\r\n  var page = 0;\r\n  var pagesContext = [];\r\n  var events = new PubSub(API);\r\n  var hotfixes = options.hotfixes || [];\r\n\r\n  var renderTargets = {};\r\n  var renderTargetMap = {};\r\n  var renderTargetStack = [];\r\n  var pageX;\r\n  var pageY;\r\n  var pageMatrix; // only used for FormObjects\r\n\r\n  /**\r\n   * A matrix object for 2D homogenous transformations: <br>\r\n   * | a b 0 | <br>\r\n   * | c d 0 | <br>\r\n   * | e f 1 | <br>\r\n   * pdf multiplies matrices righthand: v' = v x m1 x m2 x ...\r\n   *\r\n   * @class\r\n   * @name Matrix\r\n   * @param {number} sx\r\n   * @param {number} shy\r\n   * @param {number} shx\r\n   * @param {number} sy\r\n   * @param {number} tx\r\n   * @param {number} ty\r\n   * @constructor\r\n   */\r\n  var Matrix = function(sx, shy, shx, sy, tx, ty) {\r\n    if (!(this instanceof Matrix)) {\r\n      return new Matrix(sx, shy, shx, sy, tx, ty);\r\n    }\r\n\r\n    if (isNaN(sx)) sx = 1;\r\n    if (isNaN(shy)) shy = 0;\r\n    if (isNaN(shx)) shx = 0;\r\n    if (isNaN(sy)) sy = 1;\r\n    if (isNaN(tx)) tx = 0;\r\n    if (isNaN(ty)) ty = 0;\r\n\r\n    this._matrix = [sx, shy, shx, sy, tx, ty];\r\n  };\r\n\r\n  /**\r\n   * @name sx\r\n   * @memberof Matrix#\r\n   */\r\n  Object.defineProperty(Matrix.prototype, \"sx\", {\r\n    get: function() {\r\n      return this._matrix[0];\r\n    },\r\n    set: function(value) {\r\n      this._matrix[0] = value;\r\n    }\r\n  });\r\n\r\n  /**\r\n   * @name shy\r\n   * @memberof Matrix#\r\n   */\r\n  Object.defineProperty(Matrix.prototype, \"shy\", {\r\n    get: function() {\r\n      return this._matrix[1];\r\n    },\r\n    set: function(value) {\r\n      this._matrix[1] = value;\r\n    }\r\n  });\r\n\r\n  /**\r\n   * @name shx\r\n   * @memberof Matrix#\r\n   */\r\n  Object.defineProperty(Matrix.prototype, \"shx\", {\r\n    get: function() {\r\n      return this._matrix[2];\r\n    },\r\n    set: function(value) {\r\n      this._matrix[2] = value;\r\n    }\r\n  });\r\n\r\n  /**\r\n   * @name sy\r\n   * @memberof Matrix#\r\n   */\r\n  Object.defineProperty(Matrix.prototype, \"sy\", {\r\n    get: function() {\r\n      return this._matrix[3];\r\n    },\r\n    set: function(value) {\r\n      this._matrix[3] = value;\r\n    }\r\n  });\r\n\r\n  /**\r\n   * @name tx\r\n   * @memberof Matrix#\r\n   */\r\n  Object.defineProperty(Matrix.prototype, \"tx\", {\r\n    get: function() {\r\n      return this._matrix[4];\r\n    },\r\n    set: function(value) {\r\n      this._matrix[4] = value;\r\n    }\r\n  });\r\n\r\n  /**\r\n   * @name ty\r\n   * @memberof Matrix#\r\n   */\r\n  Object.defineProperty(Matrix.prototype, \"ty\", {\r\n    get: function() {\r\n      return this._matrix[5];\r\n    },\r\n    set: function(value) {\r\n      this._matrix[5] = value;\r\n    }\r\n  });\r\n\r\n  Object.defineProperty(Matrix.prototype, \"a\", {\r\n    get: function() {\r\n      return this._matrix[0];\r\n    },\r\n    set: function(value) {\r\n      this._matrix[0] = value;\r\n    }\r\n  });\r\n\r\n  Object.defineProperty(Matrix.prototype, \"b\", {\r\n    get: function() {\r\n      return this._matrix[1];\r\n    },\r\n    set: function(value) {\r\n      this._matrix[1] = value;\r\n    }\r\n  });\r\n\r\n  Object.defineProperty(Matrix.prototype, \"c\", {\r\n    get: function() {\r\n      return this._matrix[2];\r\n    },\r\n    set: function(value) {\r\n      this._matrix[2] = value;\r\n    }\r\n  });\r\n\r\n  Object.defineProperty(Matrix.prototype, \"d\", {\r\n    get: function() {\r\n      return this._matrix[3];\r\n    },\r\n    set: function(value) {\r\n      this._matrix[3] = value;\r\n    }\r\n  });\r\n\r\n  Object.defineProperty(Matrix.prototype, \"e\", {\r\n    get: function() {\r\n      return this._matrix[4];\r\n    },\r\n    set: function(value) {\r\n      this._matrix[4] = value;\r\n    }\r\n  });\r\n\r\n  Object.defineProperty(Matrix.prototype, \"f\", {\r\n    get: function() {\r\n      return this._matrix[5];\r\n    },\r\n    set: function(value) {\r\n      this._matrix[5] = value;\r\n    }\r\n  });\r\n\r\n  /**\r\n   * @name rotation\r\n   * @memberof Matrix#\r\n   */\r\n  Object.defineProperty(Matrix.prototype, \"rotation\", {\r\n    get: function() {\r\n      return Math.atan2(this.shx, this.sx);\r\n    }\r\n  });\r\n\r\n  /**\r\n   * @name scaleX\r\n   * @memberof Matrix#\r\n   */\r\n  Object.defineProperty(Matrix.prototype, \"scaleX\", {\r\n    get: function() {\r\n      return this.decompose().scale.sx;\r\n    }\r\n  });\r\n\r\n  /**\r\n   * @name scaleY\r\n   * @memberof Matrix#\r\n   */\r\n  Object.defineProperty(Matrix.prototype, \"scaleY\", {\r\n    get: function() {\r\n      return this.decompose().scale.sy;\r\n    }\r\n  });\r\n\r\n  /**\r\n   * @name isIdentity\r\n   * @memberof Matrix#\r\n   */\r\n  Object.defineProperty(Matrix.prototype, \"isIdentity\", {\r\n    get: function() {\r\n      if (this.sx !== 1) {\r\n        return false;\r\n      }\r\n      if (this.shy !== 0) {\r\n        return false;\r\n      }\r\n      if (this.shx !== 0) {\r\n        return false;\r\n      }\r\n      if (this.sy !== 1) {\r\n        return false;\r\n      }\r\n      if (this.tx !== 0) {\r\n        return false;\r\n      }\r\n      if (this.ty !== 0) {\r\n        return false;\r\n      }\r\n      return true;\r\n    }\r\n  });\r\n\r\n  /**\r\n   * Join the Matrix Values to a String\r\n   *\r\n   * @function join\r\n   * @param {string} separator Specifies a string to separate each pair of adjacent elements of the array. The separator is converted to a string if necessary. If omitted, the array elements are separated with a comma (\",\"). If separator is an empty string, all elements are joined without any characters in between them.\r\n   * @returns {string} A string with all array elements joined.\r\n   * @memberof Matrix#\r\n   */\r\n  Matrix.prototype.join = function(separator) {\r\n    return [this.sx, this.shy, this.shx, this.sy, this.tx, this.ty]\r\n      .map(hpf)\r\n      .join(separator);\r\n  };\r\n\r\n  /**\r\n   * Multiply the matrix with given Matrix\r\n   *\r\n   * @function multiply\r\n   * @param matrix\r\n   * @returns {Matrix}\r\n   * @memberof Matrix#\r\n   */\r\n  Matrix.prototype.multiply = function(matrix) {\r\n    var sx = matrix.sx * this.sx + matrix.shy * this.shx;\r\n    var shy = matrix.sx * this.shy + matrix.shy * this.sy;\r\n    var shx = matrix.shx * this.sx + matrix.sy * this.shx;\r\n    var sy = matrix.shx * this.shy + matrix.sy * this.sy;\r\n    var tx = matrix.tx * this.sx + matrix.ty * this.shx + this.tx;\r\n    var ty = matrix.tx * this.shy + matrix.ty * this.sy + this.ty;\r\n\r\n    return new Matrix(sx, shy, shx, sy, tx, ty);\r\n  };\r\n\r\n  /**\r\n   * @function decompose\r\n   * @memberof Matrix#\r\n   */\r\n  Matrix.prototype.decompose = function() {\r\n    var a = this.sx;\r\n    var b = this.shy;\r\n    var c = this.shx;\r\n    var d = this.sy;\r\n    var e = this.tx;\r\n    var f = this.ty;\r\n\r\n    var scaleX = Math.sqrt(a * a + b * b);\r\n    a /= scaleX;\r\n    b /= scaleX;\r\n\r\n    var shear = a * c + b * d;\r\n    c -= a * shear;\r\n    d -= b * shear;\r\n\r\n    var scaleY = Math.sqrt(c * c + d * d);\r\n    c /= scaleY;\r\n    d /= scaleY;\r\n    shear /= scaleY;\r\n\r\n    if (a * d < b * c) {\r\n      a = -a;\r\n      b = -b;\r\n      shear = -shear;\r\n      scaleX = -scaleX;\r\n    }\r\n\r\n    return {\r\n      scale: new Matrix(scaleX, 0, 0, scaleY, 0, 0),\r\n      translate: new Matrix(1, 0, 0, 1, e, f),\r\n      rotate: new Matrix(a, b, -b, a, 0, 0),\r\n      skew: new Matrix(1, 0, shear, 1, 0, 0)\r\n    };\r\n  };\r\n\r\n  /**\r\n   * @function toString\r\n   * @memberof Matrix#\r\n   */\r\n  Matrix.prototype.toString = function(parmPrecision) {\r\n    return this.join(\" \");\r\n  };\r\n\r\n  /**\r\n   * @function inversed\r\n   * @memberof Matrix#\r\n   */\r\n  Matrix.prototype.inversed = function() {\r\n    var a = this.sx,\r\n      b = this.shy,\r\n      c = this.shx,\r\n      d = this.sy,\r\n      e = this.tx,\r\n      f = this.ty;\r\n\r\n    var quot = 1 / (a * d - b * c);\r\n\r\n    var aInv = d * quot;\r\n    var bInv = -b * quot;\r\n    var cInv = -c * quot;\r\n    var dInv = a * quot;\r\n    var eInv = -aInv * e - cInv * f;\r\n    var fInv = -bInv * e - dInv * f;\r\n\r\n    return new Matrix(aInv, bInv, cInv, dInv, eInv, fInv);\r\n  };\r\n\r\n  /**\r\n   * @function applyToPoint\r\n   * @memberof Matrix#\r\n   */\r\n  Matrix.prototype.applyToPoint = function(pt) {\r\n    var x = pt.x * this.sx + pt.y * this.shx + this.tx;\r\n    var y = pt.x * this.shy + pt.y * this.sy + this.ty;\r\n    return new Point(x, y);\r\n  };\r\n\r\n  /**\r\n   * @function applyToRectangle\r\n   * @memberof Matrix#\r\n   */\r\n  Matrix.prototype.applyToRectangle = function(rect) {\r\n    var pt1 = this.applyToPoint(rect);\r\n    var pt2 = this.applyToPoint(new Point(rect.x + rect.w, rect.y + rect.h));\r\n    return new Rectangle(pt1.x, pt1.y, pt2.x - pt1.x, pt2.y - pt1.y);\r\n  };\r\n\r\n  /**\r\n   * Clone the Matrix\r\n   *\r\n   * @function clone\r\n   * @memberof Matrix#\r\n   * @name clone\r\n   * @instance\r\n   */\r\n  Matrix.prototype.clone = function() {\r\n    var sx = this.sx;\r\n    var shy = this.shy;\r\n    var shx = this.shx;\r\n    var sy = this.sy;\r\n    var tx = this.tx;\r\n    var ty = this.ty;\r\n\r\n    return new Matrix(sx, shy, shx, sy, tx, ty);\r\n  };\r\n\r\n  API.Matrix = Matrix;\r\n\r\n  /**\r\n   * Multiplies two matrices. (see {@link Matrix})\r\n   * @param {Matrix} m1\r\n   * @param {Matrix} m2\r\n   * @memberof jsPDF#\r\n   * @name matrixMult\r\n   */\r\n  var matrixMult = (API.matrixMult = function(m1, m2) {\r\n    return m2.multiply(m1);\r\n  });\r\n\r\n  /**\r\n   * The identity matrix (equivalent to new Matrix(1, 0, 0, 1, 0, 0)).\r\n   * @type {Matrix}\r\n   * @memberof! jsPDF#\r\n   * @name identityMatrix\r\n   */\r\n  var identityMatrix = new Matrix(1, 0, 0, 1, 0, 0);\r\n  API.unitMatrix = API.identityMatrix = identityMatrix;\r\n\r\n  /**\r\n   * Adds a new pattern for later use.\r\n   * @param {String} key The key by it can be referenced later. The keys must be unique!\r\n   * @param {API.Pattern} pattern The pattern\r\n   */\r\n  var addPattern = function(key, pattern) {\r\n    // only add it if it is not already present (the keys provided by the user must be unique!)\r\n    if (patternMap[key]) return;\r\n\r\n    var prefix = pattern instanceof ShadingPattern ? \"Sh\" : \"P\";\r\n    var patternKey = prefix + (Object.keys(patterns).length + 1).toString(10);\r\n    pattern.id = patternKey;\r\n\r\n    patternMap[key] = patternKey;\r\n    patterns[patternKey] = pattern;\r\n\r\n    events.publish(\"addPattern\", pattern);\r\n  };\r\n\r\n  /**\r\n   * A pattern describing a shading pattern.\r\n   *\r\n   * Only available in \"advanced\" API mode.\r\n   *\r\n   * @param {String} type One of \"axial\" or \"radial\"\r\n   * @param {Array<Number>} coords Either [x1, y1, x2, y2] for \"axial\" type describing the two interpolation points\r\n   * or [x1, y1, r, x2, y2, r2] for \"radial\" describing inner and the outer circle.\r\n   * @param {Array<Object>} colors An array of objects with the fields \"offset\" and \"color\". \"offset\" describes\r\n   * the offset in parameter space [0, 1]. \"color\" is an array of length 3 describing RGB values in [0, 255].\r\n   * @param {GState=} gState An additional graphics state that gets applied to the pattern (optional).\r\n   * @param {Matrix=} matrix A matrix that describes the transformation between the pattern coordinate system\r\n   * and the use coordinate system (optional).\r\n   * @constructor\r\n   * @extends API.Pattern\r\n   */\r\n  API.ShadingPattern = ShadingPattern;\r\n\r\n  /**\r\n   * A PDF Tiling pattern.\r\n   *\r\n   * Only available in \"advanced\" API mode.\r\n   *\r\n   * @param {Array.<Number>} boundingBox The bounding box at which one pattern cell gets clipped.\r\n   * @param {Number} xStep Horizontal spacing between pattern cells.\r\n   * @param {Number} yStep Vertical spacing between pattern cells.\r\n   * @param {API.GState=} gState An additional graphics state that gets applied to the pattern (optional).\r\n   * @param {Matrix=} matrix A matrix that describes the transformation between the pattern coordinate system\r\n   * and the use coordinate system (optional).\r\n   * @constructor\r\n   * @extends API.Pattern\r\n   */\r\n  API.TilingPattern = TilingPattern;\r\n\r\n  /**\r\n   * Adds a new {@link API.ShadingPattern} for later use. Only available in \"advanced\" API mode.\r\n   * @param {String} key\r\n   * @param {Pattern} pattern\r\n   * @function\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name addPattern\r\n   */\r\n  API.addShadingPattern = function(key, pattern) {\r\n    advancedApiModeTrap(\"addShadingPattern()\");\r\n\r\n    addPattern(key, pattern);\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Begins a new tiling pattern. All subsequent render calls are drawn to this pattern until {@link API.endTilingPattern}\r\n   * gets called. Only available in \"advanced\" API mode.\r\n   * @param {API.Pattern} pattern\r\n   * @memberof jsPDF#\r\n   * @name beginTilingPattern\r\n   */\r\n  API.beginTilingPattern = function(pattern) {\r\n    advancedApiModeTrap(\"beginTilingPattern()\");\r\n\r\n    beginNewRenderTarget(\r\n      pattern.boundingBox[0],\r\n      pattern.boundingBox[1],\r\n      pattern.boundingBox[2] - pattern.boundingBox[0],\r\n      pattern.boundingBox[3] - pattern.boundingBox[1],\r\n      pattern.matrix\r\n    );\r\n  };\r\n\r\n  /**\r\n   * Ends a tiling pattern and sets the render target to the one active before {@link API.beginTilingPattern} has been called.\r\n   *\r\n   * Only available in \"advanced\" API mode.\r\n   *\r\n   * @param {string} key A unique key that is used to reference this pattern at later use.\r\n   * @param {API.Pattern} pattern The pattern to end.\r\n   * @memberof jsPDF#\r\n   * @name endTilingPattern\r\n   */\r\n  API.endTilingPattern = function(key, pattern) {\r\n    advancedApiModeTrap(\"endTilingPattern()\");\r\n\r\n    // retrieve the stream\r\n    pattern.stream = pages[currentPage].join(\"\\n\");\r\n\r\n    addPattern(key, pattern);\r\n\r\n    events.publish(\"endTilingPattern\", pattern);\r\n\r\n    // restore state from stack\r\n    renderTargetStack.pop().restore();\r\n  };\r\n\r\n  var newObject = (API.__private__.newObject = function() {\r\n    var oid = newObjectDeferred();\r\n    newObjectDeferredBegin(oid, true);\r\n    return oid;\r\n  });\r\n\r\n  // Does not output the object.  The caller must call newObjectDeferredBegin(oid) before outputing any data\r\n  var newObjectDeferred = (API.__private__.newObjectDeferred = function() {\r\n    objectNumber++;\r\n    offsets[objectNumber] = function() {\r\n      return contentLength;\r\n    };\r\n    return objectNumber;\r\n  });\r\n\r\n  var newObjectDeferredBegin = function(oid, doOutput) {\r\n    doOutput = typeof doOutput === \"boolean\" ? doOutput : false;\r\n    offsets[oid] = contentLength;\r\n    if (doOutput) {\r\n      out(oid + \" 0 obj\");\r\n    }\r\n    return oid;\r\n  };\r\n  // Does not output the object until after the pages have been output.\r\n  // Returns an object containing the objectId and content.\r\n  // All pages have been added so the object ID can be estimated to start right after.\r\n  // This does not modify the current objectNumber;  It must be updated after the newObjects are output.\r\n  var newAdditionalObject = (API.__private__.newAdditionalObject = function() {\r\n    var objId = newObjectDeferred();\r\n    var obj = {\r\n      objId: objId,\r\n      content: \"\"\r\n    };\r\n    additionalObjects.push(obj);\r\n    return obj;\r\n  });\r\n\r\n  var rootDictionaryObjId = newObjectDeferred();\r\n  var resourceDictionaryObjId = newObjectDeferred();\r\n\r\n  /////////////////////\r\n  // Private functions\r\n  /////////////////////\r\n\r\n  var decodeColorString = (API.__private__.decodeColorString = function(color) {\r\n    var colorEncoded = color.split(\" \");\r\n    if (\r\n      colorEncoded.length === 2 &&\r\n      (colorEncoded[1] === \"g\" || colorEncoded[1] === \"G\")\r\n    ) {\r\n      // convert grayscale value to rgb so that it can be converted to hex for consistency\r\n      var floatVal = parseFloat(colorEncoded[0]);\r\n      colorEncoded = [floatVal, floatVal, floatVal, \"r\"];\r\n    } else if (\r\n      colorEncoded.length === 5 &&\r\n      (colorEncoded[4] === \"k\" || colorEncoded[4] === \"K\")\r\n    ) {\r\n      // convert CMYK values to rbg so that it can be converted to hex for consistency\r\n      var red = (1.0 - colorEncoded[0]) * (1.0 - colorEncoded[3]);\r\n      var green = (1.0 - colorEncoded[1]) * (1.0 - colorEncoded[3]);\r\n      var blue = (1.0 - colorEncoded[2]) * (1.0 - colorEncoded[3]);\r\n\r\n      colorEncoded = [red, green, blue, \"r\"];\r\n    }\r\n    var colorAsRGB = \"#\";\r\n    for (var i = 0; i < 3; i++) {\r\n      colorAsRGB += (\r\n        \"0\" + Math.floor(parseFloat(colorEncoded[i]) * 255).toString(16)\r\n      ).slice(-2);\r\n    }\r\n    return colorAsRGB;\r\n  });\r\n\r\n  var encodeColorString = (API.__private__.encodeColorString = function(\r\n    options\r\n  ) {\r\n    var color;\r\n\r\n    if (typeof options === \"string\") {\r\n      options = {\r\n        ch1: options\r\n      };\r\n    }\r\n    var ch1 = options.ch1;\r\n    var ch2 = options.ch2;\r\n    var ch3 = options.ch3;\r\n    var ch4 = options.ch4;\r\n    var letterArray =\r\n      options.pdfColorType === \"draw\" ? [\"G\", \"RG\", \"K\"] : [\"g\", \"rg\", \"k\"];\r\n\r\n    if (typeof ch1 === \"string\" && ch1.charAt(0) !== \"#\") {\r\n      var rgbColor = new RGBColor(ch1);\r\n      if (rgbColor.ok) {\r\n        ch1 = rgbColor.toHex();\r\n      } else if (!/^\\d*\\.?\\d*$/.test(ch1)) {\r\n        throw new Error(\r\n          'Invalid color \"' + ch1 + '\" passed to jsPDF.encodeColorString.'\r\n        );\r\n      }\r\n    }\r\n    //convert short rgb to long form\r\n    if (typeof ch1 === \"string\" && /^#[0-9A-Fa-f]{3}$/.test(ch1)) {\r\n      ch1 = \"#\" + ch1[1] + ch1[1] + ch1[2] + ch1[2] + ch1[3] + ch1[3];\r\n    }\r\n\r\n    if (typeof ch1 === \"string\" && /^#[0-9A-Fa-f]{6}$/.test(ch1)) {\r\n      var hex = parseInt(ch1.substr(1), 16);\r\n      ch1 = (hex >> 16) & 255;\r\n      ch2 = (hex >> 8) & 255;\r\n      ch3 = hex & 255;\r\n    }\r\n\r\n    if (\r\n      typeof ch2 === \"undefined\" ||\r\n      (typeof ch4 === \"undefined\" && ch1 === ch2 && ch2 === ch3)\r\n    ) {\r\n      // Gray color space.\r\n      if (typeof ch1 === \"string\") {\r\n        color = ch1 + \" \" + letterArray[0];\r\n      } else {\r\n        switch (options.precision) {\r\n          case 2:\r\n            color = f2(ch1 / 255) + \" \" + letterArray[0];\r\n            break;\r\n          case 3:\r\n          default:\r\n            color = f3(ch1 / 255) + \" \" + letterArray[0];\r\n        }\r\n      }\r\n    } else if (typeof ch4 === \"undefined\" || typeof ch4 === \"object\") {\r\n      // assume RGBA\r\n      if (ch4 && !isNaN(ch4.a)) {\r\n        //TODO Implement transparency.\r\n        //WORKAROUND use white for now, if transparent, otherwise handle as rgb\r\n        if (ch4.a === 0) {\r\n          color = [\"1.\", \"1.\", \"1.\", letterArray[1]].join(\" \");\r\n          return color;\r\n        }\r\n      }\r\n      // assume RGB\r\n      if (typeof ch1 === \"string\") {\r\n        color = [ch1, ch2, ch3, letterArray[1]].join(\" \");\r\n      } else {\r\n        switch (options.precision) {\r\n          case 2:\r\n            color = [\r\n              f2(ch1 / 255),\r\n              f2(ch2 / 255),\r\n              f2(ch3 / 255),\r\n              letterArray[1]\r\n            ].join(\" \");\r\n            break;\r\n          default:\r\n          case 3:\r\n            color = [\r\n              f3(ch1 / 255),\r\n              f3(ch2 / 255),\r\n              f3(ch3 / 255),\r\n              letterArray[1]\r\n            ].join(\" \");\r\n        }\r\n      }\r\n    } else {\r\n      // assume CMYK\r\n      if (typeof ch1 === \"string\") {\r\n        color = [ch1, ch2, ch3, ch4, letterArray[2]].join(\" \");\r\n      } else {\r\n        switch (options.precision) {\r\n          case 2:\r\n            color = [f2(ch1), f2(ch2), f2(ch3), f2(ch4), letterArray[2]].join(\r\n              \" \"\r\n            );\r\n            break;\r\n          case 3:\r\n          default:\r\n            color = [f3(ch1), f3(ch2), f3(ch3), f3(ch4), letterArray[2]].join(\r\n              \" \"\r\n            );\r\n        }\r\n      }\r\n    }\r\n    return color;\r\n  });\r\n\r\n  var getFilters = (API.__private__.getFilters = function() {\r\n    return filters;\r\n  });\r\n\r\n  var putStream = (API.__private__.putStream = function(options) {\r\n    options = options || {};\r\n    var data = options.data || \"\";\r\n    var filters = options.filters || getFilters();\r\n    var alreadyAppliedFilters = options.alreadyAppliedFilters || [];\r\n    var addLength1 = options.addLength1 || false;\r\n    var valueOfLength1 = data.length;\r\n    var objectId = options.objectId;\r\n    var encryptor = function(data) {\r\n      return data;\r\n    };\r\n    if (encryptionOptions !== null && typeof objectId == \"undefined\") {\r\n      throw new Error(\r\n        \"ObjectId must be passed to putStream for file encryption\"\r\n      );\r\n    }\r\n    if (encryptionOptions !== null) {\r\n      encryptor = encryption.encryptor(objectId, 0);\r\n    }\r\n\r\n    var processedData = {};\r\n    if (filters === true) {\r\n      filters = [\"FlateEncode\"];\r\n    }\r\n    var keyValues = options.additionalKeyValues || [];\r\n    if (typeof jsPDF.API.processDataByFilters !== \"undefined\") {\r\n      processedData = jsPDF.API.processDataByFilters(data, filters);\r\n    } else {\r\n      processedData = { data: data, reverseChain: [] };\r\n    }\r\n    var filterAsString =\r\n      processedData.reverseChain +\r\n      (Array.isArray(alreadyAppliedFilters)\r\n        ? alreadyAppliedFilters.join(\" \")\r\n        : alreadyAppliedFilters.toString());\r\n\r\n    if (processedData.data.length !== 0) {\r\n      keyValues.push({\r\n        key: \"Length\",\r\n        value: processedData.data.length\r\n      });\r\n      if (addLength1 === true) {\r\n        keyValues.push({\r\n          key: \"Length1\",\r\n          value: valueOfLength1\r\n        });\r\n      }\r\n    }\r\n\r\n    if (filterAsString.length != 0) {\r\n      if (filterAsString.split(\"/\").length - 1 === 1) {\r\n        keyValues.push({\r\n          key: \"Filter\",\r\n          value: filterAsString\r\n        });\r\n      } else {\r\n        keyValues.push({\r\n          key: \"Filter\",\r\n          value: \"[\" + filterAsString + \"]\"\r\n        });\r\n\r\n        for (var j = 0; j < keyValues.length; j += 1) {\r\n          if (keyValues[j].key === \"DecodeParms\") {\r\n            var decodeParmsArray = [];\r\n\r\n            for (\r\n              var i = 0;\r\n              i < processedData.reverseChain.split(\"/\").length - 1;\r\n              i += 1\r\n            ) {\r\n              decodeParmsArray.push(\"null\");\r\n            }\r\n\r\n            decodeParmsArray.push(keyValues[j].value);\r\n            keyValues[j].value = \"[\" + decodeParmsArray.join(\" \") + \"]\";\r\n          }\r\n        }\r\n      }\r\n    }\r\n\r\n    out(\"<<\");\r\n    for (var k = 0; k < keyValues.length; k++) {\r\n      out(\"/\" + keyValues[k].key + \" \" + keyValues[k].value);\r\n    }\r\n    out(\">>\");\r\n    if (processedData.data.length !== 0) {\r\n      out(\"stream\");\r\n      out(encryptor(processedData.data));\r\n      out(\"endstream\");\r\n    }\r\n  });\r\n\r\n  var putPage = (API.__private__.putPage = function(page) {\r\n    var pageNumber = page.number;\r\n    var data = page.data;\r\n    var pageObjectNumber = page.objId;\r\n    var pageContentsObjId = page.contentsObjId;\r\n\r\n    newObjectDeferredBegin(pageObjectNumber, true);\r\n    out(\"<</Type /Page\");\r\n    out(\"/Parent \" + page.rootDictionaryObjId + \" 0 R\");\r\n    out(\"/Resources \" + page.resourceDictionaryObjId + \" 0 R\");\r\n    out(\r\n      \"/MediaBox [\" +\r\n        parseFloat(hpf(page.mediaBox.bottomLeftX)) +\r\n        \" \" +\r\n        parseFloat(hpf(page.mediaBox.bottomLeftY)) +\r\n        \" \" +\r\n        hpf(page.mediaBox.topRightX) +\r\n        \" \" +\r\n        hpf(page.mediaBox.topRightY) +\r\n        \"]\"\r\n    );\r\n    if (page.cropBox !== null) {\r\n      out(\r\n        \"/CropBox [\" +\r\n          hpf(page.cropBox.bottomLeftX) +\r\n          \" \" +\r\n          hpf(page.cropBox.bottomLeftY) +\r\n          \" \" +\r\n          hpf(page.cropBox.topRightX) +\r\n          \" \" +\r\n          hpf(page.cropBox.topRightY) +\r\n          \"]\"\r\n      );\r\n    }\r\n\r\n    if (page.bleedBox !== null) {\r\n      out(\r\n        \"/BleedBox [\" +\r\n          hpf(page.bleedBox.bottomLeftX) +\r\n          \" \" +\r\n          hpf(page.bleedBox.bottomLeftY) +\r\n          \" \" +\r\n          hpf(page.bleedBox.topRightX) +\r\n          \" \" +\r\n          hpf(page.bleedBox.topRightY) +\r\n          \"]\"\r\n      );\r\n    }\r\n\r\n    if (page.trimBox !== null) {\r\n      out(\r\n        \"/TrimBox [\" +\r\n          hpf(page.trimBox.bottomLeftX) +\r\n          \" \" +\r\n          hpf(page.trimBox.bottomLeftY) +\r\n          \" \" +\r\n          hpf(page.trimBox.topRightX) +\r\n          \" \" +\r\n          hpf(page.trimBox.topRightY) +\r\n          \"]\"\r\n      );\r\n    }\r\n\r\n    if (page.artBox !== null) {\r\n      out(\r\n        \"/ArtBox [\" +\r\n          hpf(page.artBox.bottomLeftX) +\r\n          \" \" +\r\n          hpf(page.artBox.bottomLeftY) +\r\n          \" \" +\r\n          hpf(page.artBox.topRightX) +\r\n          \" \" +\r\n          hpf(page.artBox.topRightY) +\r\n          \"]\"\r\n      );\r\n    }\r\n\r\n    if (typeof page.userUnit === \"number\" && page.userUnit !== 1.0) {\r\n      out(\"/UserUnit \" + page.userUnit);\r\n    }\r\n\r\n    events.publish(\"putPage\", {\r\n      objId: pageObjectNumber,\r\n      pageContext: pagesContext[pageNumber],\r\n      pageNumber: pageNumber,\r\n      page: data\r\n    });\r\n    out(\"/Contents \" + pageContentsObjId + \" 0 R\");\r\n    out(\">>\");\r\n    out(\"endobj\");\r\n    // Page content\r\n    var pageContent = data.join(\"\\n\");\r\n\r\n    if (apiMode === ApiMode.ADVANCED) {\r\n      // if the user forgot to switch back to COMPAT mode, we must balance the graphics stack again\r\n      pageContent += \"\\nQ\";\r\n    }\r\n\r\n    newObjectDeferredBegin(pageContentsObjId, true);\r\n    putStream({\r\n      data: pageContent,\r\n      filters: getFilters(),\r\n      objectId: pageContentsObjId\r\n    });\r\n    out(\"endobj\");\r\n    return pageObjectNumber;\r\n  });\r\n\r\n  var putPages = (API.__private__.putPages = function() {\r\n    var n,\r\n      i,\r\n      pageObjectNumbers = [];\r\n\r\n    for (n = 1; n <= page; n++) {\r\n      pagesContext[n].objId = newObjectDeferred();\r\n      pagesContext[n].contentsObjId = newObjectDeferred();\r\n    }\r\n\r\n    for (n = 1; n <= page; n++) {\r\n      pageObjectNumbers.push(\r\n        putPage({\r\n          number: n,\r\n          data: pages[n],\r\n          objId: pagesContext[n].objId,\r\n          contentsObjId: pagesContext[n].contentsObjId,\r\n          mediaBox: pagesContext[n].mediaBox,\r\n          cropBox: pagesContext[n].cropBox,\r\n          bleedBox: pagesContext[n].bleedBox,\r\n          trimBox: pagesContext[n].trimBox,\r\n          artBox: pagesContext[n].artBox,\r\n          userUnit: pagesContext[n].userUnit,\r\n          rootDictionaryObjId: rootDictionaryObjId,\r\n          resourceDictionaryObjId: resourceDictionaryObjId\r\n        })\r\n      );\r\n    }\r\n    newObjectDeferredBegin(rootDictionaryObjId, true);\r\n    out(\"<</Type /Pages\");\r\n    var kids = \"/Kids [\";\r\n    for (i = 0; i < page; i++) {\r\n      kids += pageObjectNumbers[i] + \" 0 R \";\r\n    }\r\n    out(kids + \"]\");\r\n    out(\"/Count \" + page);\r\n    out(\">>\");\r\n    out(\"endobj\");\r\n    events.publish(\"postPutPages\");\r\n  });\r\n\r\n  var putFont = function(font) {\r\n    events.publish(\"putFont\", {\r\n      font: font,\r\n      out: out,\r\n      newObject: newObject,\r\n      putStream: putStream\r\n    });\r\n\r\n    if (font.isAlreadyPutted !== true) {\r\n      font.objectNumber = newObject();\r\n      out(\"<<\");\r\n      out(\"/Type /Font\");\r\n      out(\"/BaseFont /\" + toPDFName(font.postScriptName));\r\n      out(\"/Subtype /Type1\");\r\n      if (typeof font.encoding === \"string\") {\r\n        out(\"/Encoding /\" + font.encoding);\r\n      }\r\n      out(\"/FirstChar 32\");\r\n      out(\"/LastChar 255\");\r\n      out(\">>\");\r\n      out(\"endobj\");\r\n    }\r\n  };\r\n\r\n  var putFonts = function() {\r\n    for (var fontKey in fonts) {\r\n      if (fonts.hasOwnProperty(fontKey)) {\r\n        if (\r\n          putOnlyUsedFonts === false ||\r\n          (putOnlyUsedFonts === true && usedFonts.hasOwnProperty(fontKey))\r\n        ) {\r\n          putFont(fonts[fontKey]);\r\n        }\r\n      }\r\n    }\r\n  };\r\n\r\n  var putXObject = function(xObject) {\r\n    xObject.objectNumber = newObject();\r\n\r\n    var options = [];\r\n    options.push({ key: \"Type\", value: \"/XObject\" });\r\n    options.push({ key: \"Subtype\", value: \"/Form\" });\r\n    options.push({\r\n      key: \"BBox\",\r\n      value:\r\n        \"[\" +\r\n        [\r\n          hpf(xObject.x),\r\n          hpf(xObject.y),\r\n          hpf(xObject.x + xObject.width),\r\n          hpf(xObject.y + xObject.height)\r\n        ].join(\" \") +\r\n        \"]\"\r\n    });\r\n    options.push({\r\n      key: \"Matrix\",\r\n      value: \"[\" + xObject.matrix.toString() + \"]\"\r\n    });\r\n    // TODO: /Resources\r\n\r\n    var stream = xObject.pages[1].join(\"\\n\");\r\n    putStream({\r\n      data: stream,\r\n      additionalKeyValues: options,\r\n      objectId: xObject.objectNumber\r\n    });\r\n    out(\"endobj\");\r\n  };\r\n\r\n  var putXObjects = function() {\r\n    for (var xObjectKey in renderTargets) {\r\n      if (renderTargets.hasOwnProperty(xObjectKey)) {\r\n        putXObject(renderTargets[xObjectKey]);\r\n      }\r\n    }\r\n  };\r\n\r\n  var interpolateAndEncodeRGBStream = function(colors, numberSamples) {\r\n    var tValues = [];\r\n    var t;\r\n    var dT = 1.0 / (numberSamples - 1);\r\n    for (t = 0.0; t < 1.0; t += dT) {\r\n      tValues.push(t);\r\n    }\r\n    tValues.push(1.0);\r\n    // add first and last control point if not present\r\n    if (colors[0].offset != 0.0) {\r\n      var c0 = {\r\n        offset: 0.0,\r\n        color: colors[0].color\r\n      };\r\n      colors.unshift(c0);\r\n    }\r\n    if (colors[colors.length - 1].offset != 1.0) {\r\n      var c1 = {\r\n        offset: 1.0,\r\n        color: colors[colors.length - 1].color\r\n      };\r\n      colors.push(c1);\r\n    }\r\n    var out = \"\";\r\n    var index = 0;\r\n\r\n    for (var i = 0; i < tValues.length; i++) {\r\n      t = tValues[i];\r\n      while (t > colors[index + 1].offset) index++;\r\n      var a = colors[index].offset;\r\n      var b = colors[index + 1].offset;\r\n      var d = (t - a) / (b - a);\r\n\r\n      var aColor = colors[index].color;\r\n      var bColor = colors[index + 1].color;\r\n\r\n      out +=\r\n        padd2Hex(Math.round((1 - d) * aColor[0] + d * bColor[0]).toString(16)) +\r\n        padd2Hex(Math.round((1 - d) * aColor[1] + d * bColor[1]).toString(16)) +\r\n        padd2Hex(Math.round((1 - d) * aColor[2] + d * bColor[2]).toString(16));\r\n    }\r\n    return out.trim();\r\n  };\r\n\r\n  var putShadingPattern = function(pattern, numberSamples) {\r\n    /*\r\n       Axial patterns shade between the two points specified in coords, radial patterns between the inner\r\n       and outer circle.\r\n       The user can specify an array (colors) that maps t-Values in [0, 1] to RGB colors. These are now\r\n       interpolated to equidistant samples and written to pdf as a sample (type 0) function.\r\n       */\r\n    // The number of color samples that should be used to describe the shading.\r\n    // The higher, the more accurate the gradient will be.\r\n    numberSamples || (numberSamples = 21);\r\n    var funcObjectNumber = newObject();\r\n    var stream = interpolateAndEncodeRGBStream(pattern.colors, numberSamples);\r\n\r\n    var options = [];\r\n    options.push({ key: \"FunctionType\", value: \"0\" });\r\n    options.push({ key: \"Domain\", value: \"[0.0 1.0]\" });\r\n    options.push({ key: \"Size\", value: \"[\" + numberSamples + \"]\" });\r\n    options.push({ key: \"BitsPerSample\", value: \"8\" });\r\n    options.push({ key: \"Range\", value: \"[0.0 1.0 0.0 1.0 0.0 1.0]\" });\r\n    options.push({ key: \"Decode\", value: \"[0.0 1.0 0.0 1.0 0.0 1.0]\" });\r\n\r\n    putStream({\r\n      data: stream,\r\n      additionalKeyValues: options,\r\n      alreadyAppliedFilters: [\"/ASCIIHexDecode\"],\r\n      objectId: funcObjectNumber\r\n    });\r\n    out(\"endobj\");\r\n\r\n    pattern.objectNumber = newObject();\r\n    out(\"<< /ShadingType \" + pattern.type);\r\n    out(\"/ColorSpace /DeviceRGB\");\r\n    var coords =\r\n      \"/Coords [\" +\r\n      hpf(parseFloat(pattern.coords[0])) +\r\n      \" \" + // x1\r\n      hpf(parseFloat(pattern.coords[1])) +\r\n      \" \"; // y1\r\n    if (pattern.type === 2) {\r\n      // axial\r\n      coords +=\r\n        hpf(parseFloat(pattern.coords[2])) +\r\n        \" \" + // x2\r\n        hpf(parseFloat(pattern.coords[3])); // y2\r\n    } else {\r\n      // radial\r\n      coords +=\r\n        hpf(parseFloat(pattern.coords[2])) +\r\n        \" \" + // r1\r\n        hpf(parseFloat(pattern.coords[3])) +\r\n        \" \" + // x2\r\n        hpf(parseFloat(pattern.coords[4])) +\r\n        \" \" + // y2\r\n        hpf(parseFloat(pattern.coords[5])); // r2\r\n    }\r\n    coords += \"]\";\r\n    out(coords);\r\n\r\n    if (pattern.matrix) {\r\n      out(\"/Matrix [\" + pattern.matrix.toString() + \"]\");\r\n    }\r\n    out(\"/Function \" + funcObjectNumber + \" 0 R\");\r\n    out(\"/Extend [true true]\");\r\n    out(\">>\");\r\n    out(\"endobj\");\r\n  };\r\n\r\n  var putTilingPattern = function(pattern, deferredResourceDictionaryIds) {\r\n    var resourcesObjectId = newObjectDeferred();\r\n    var patternObjectId = newObject();\r\n\r\n    deferredResourceDictionaryIds.push({\r\n      resourcesOid: resourcesObjectId,\r\n      objectOid: patternObjectId\r\n    });\r\n\r\n    pattern.objectNumber = patternObjectId;\r\n    var options = [];\r\n    options.push({ key: \"Type\", value: \"/Pattern\" });\r\n    options.push({ key: \"PatternType\", value: \"1\" }); // tiling pattern\r\n    options.push({ key: \"PaintType\", value: \"1\" }); // colored tiling pattern\r\n    options.push({ key: \"TilingType\", value: \"1\" }); // constant spacing\r\n    options.push({\r\n      key: \"BBox\",\r\n      value: \"[\" + pattern.boundingBox.map(hpf).join(\" \") + \"]\"\r\n    });\r\n    options.push({ key: \"XStep\", value: hpf(pattern.xStep) });\r\n    options.push({ key: \"YStep\", value: hpf(pattern.yStep) });\r\n    options.push({ key: \"Resources\", value: resourcesObjectId + \" 0 R\" });\r\n    if (pattern.matrix) {\r\n      options.push({\r\n        key: \"Matrix\",\r\n        value: \"[\" + pattern.matrix.toString() + \"]\"\r\n      });\r\n    }\r\n\r\n    putStream({\r\n      data: pattern.stream,\r\n      additionalKeyValues: options,\r\n      objectId: pattern.objectNumber\r\n    });\r\n    out(\"endobj\");\r\n  };\r\n\r\n  var putPatterns = function(deferredResourceDictionaryIds) {\r\n    var patternKey;\r\n    for (patternKey in patterns) {\r\n      if (patterns.hasOwnProperty(patternKey)) {\r\n        if (patterns[patternKey] instanceof ShadingPattern) {\r\n          putShadingPattern(patterns[patternKey]);\r\n        } else if (patterns[patternKey] instanceof TilingPattern) {\r\n          putTilingPattern(patterns[patternKey], deferredResourceDictionaryIds);\r\n        }\r\n      }\r\n    }\r\n  };\r\n\r\n  var putGState = function(gState) {\r\n    gState.objectNumber = newObject();\r\n    out(\"<<\");\r\n    for (var p in gState) {\r\n      switch (p) {\r\n        case \"opacity\":\r\n          out(\"/ca \" + f2(gState[p]));\r\n          break;\r\n        case \"stroke-opacity\":\r\n          out(\"/CA \" + f2(gState[p]));\r\n          break;\r\n      }\r\n    }\r\n    out(\">>\");\r\n    out(\"endobj\");\r\n  };\r\n\r\n  var putGStates = function() {\r\n    var gStateKey;\r\n    for (gStateKey in gStates) {\r\n      if (gStates.hasOwnProperty(gStateKey)) {\r\n        putGState(gStates[gStateKey]);\r\n      }\r\n    }\r\n  };\r\n\r\n  var putXobjectDict = function() {\r\n    out(\"/XObject <<\");\r\n    for (var xObjectKey in renderTargets) {\r\n      if (\r\n        renderTargets.hasOwnProperty(xObjectKey) &&\r\n        renderTargets[xObjectKey].objectNumber >= 0\r\n      ) {\r\n        out(\r\n          \"/\" +\r\n            xObjectKey +\r\n            \" \" +\r\n            renderTargets[xObjectKey].objectNumber +\r\n            \" 0 R\"\r\n        );\r\n      }\r\n    }\r\n\r\n    // Loop through images, or other data objects\r\n    events.publish(\"putXobjectDict\");\r\n    out(\">>\");\r\n  };\r\n\r\n  var putEncryptionDict = function() {\r\n    encryption.oid = newObject();\r\n    out(\"<<\");\r\n    out(\"/Filter /Standard\");\r\n    out(\"/V \" + encryption.v);\r\n    out(\"/R \" + encryption.r);\r\n    out(\"/U <\" + encryption.toHexString(encryption.U) + \">\");\r\n    out(\"/O <\" + encryption.toHexString(encryption.O) + \">\");\r\n    out(\"/P \" + encryption.P);\r\n    out(\">>\");\r\n    out(\"endobj\");\r\n  };\r\n\r\n  var putFontDict = function() {\r\n    out(\"/Font <<\");\r\n\r\n    for (var fontKey in fonts) {\r\n      if (fonts.hasOwnProperty(fontKey)) {\r\n        if (\r\n          putOnlyUsedFonts === false ||\r\n          (putOnlyUsedFonts === true && usedFonts.hasOwnProperty(fontKey))\r\n        ) {\r\n          out(\"/\" + fontKey + \" \" + fonts[fontKey].objectNumber + \" 0 R\");\r\n        }\r\n      }\r\n    }\r\n    out(\">>\");\r\n  };\r\n\r\n  var putShadingPatternDict = function() {\r\n    if (Object.keys(patterns).length > 0) {\r\n      out(\"/Shading <<\");\r\n      for (var patternKey in patterns) {\r\n        if (\r\n          patterns.hasOwnProperty(patternKey) &&\r\n          patterns[patternKey] instanceof ShadingPattern &&\r\n          patterns[patternKey].objectNumber >= 0\r\n        ) {\r\n          out(\r\n            \"/\" + patternKey + \" \" + patterns[patternKey].objectNumber + \" 0 R\"\r\n          );\r\n        }\r\n      }\r\n\r\n      events.publish(\"putShadingPatternDict\");\r\n      out(\">>\");\r\n    }\r\n  };\r\n\r\n  var putTilingPatternDict = function(objectOid) {\r\n    if (Object.keys(patterns).length > 0) {\r\n      out(\"/Pattern <<\");\r\n      for (var patternKey in patterns) {\r\n        if (\r\n          patterns.hasOwnProperty(patternKey) &&\r\n          patterns[patternKey] instanceof API.TilingPattern &&\r\n          patterns[patternKey].objectNumber >= 0 &&\r\n          patterns[patternKey].objectNumber < objectOid // prevent cyclic dependencies\r\n        ) {\r\n          out(\r\n            \"/\" + patternKey + \" \" + patterns[patternKey].objectNumber + \" 0 R\"\r\n          );\r\n        }\r\n      }\r\n      events.publish(\"putTilingPatternDict\");\r\n      out(\">>\");\r\n    }\r\n  };\r\n\r\n  var putGStatesDict = function() {\r\n    if (Object.keys(gStates).length > 0) {\r\n      var gStateKey;\r\n      out(\"/ExtGState <<\");\r\n      for (gStateKey in gStates) {\r\n        if (\r\n          gStates.hasOwnProperty(gStateKey) &&\r\n          gStates[gStateKey].objectNumber >= 0\r\n        ) {\r\n          out(\"/\" + gStateKey + \" \" + gStates[gStateKey].objectNumber + \" 0 R\");\r\n        }\r\n      }\r\n\r\n      events.publish(\"putGStateDict\");\r\n      out(\">>\");\r\n    }\r\n  };\r\n\r\n  var putResourceDictionary = function(objectIds) {\r\n    newObjectDeferredBegin(objectIds.resourcesOid, true);\r\n    out(\"<<\");\r\n    out(\"/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]\");\r\n    putFontDict();\r\n    putShadingPatternDict();\r\n    putTilingPatternDict(objectIds.objectOid);\r\n    putGStatesDict();\r\n    putXobjectDict();\r\n    out(\">>\");\r\n    out(\"endobj\");\r\n  };\r\n\r\n  var putResources = function() {\r\n    // FormObjects, Patterns etc. might use other FormObjects/Patterns/Images\r\n    // which means their resource dictionaries must contain the already resolved\r\n    // object ids. For this reason we defer the serialization of the resource\r\n    // dicts until all objects have been serialized and have object ids.\r\n    //\r\n    // In order to prevent cyclic dependencies (which Adobe Reader doesn't like),\r\n    // we only put all oids that are smaller than the oid of the object the\r\n    // resource dict belongs to. This is correct behavior, since the streams\r\n    // may only use other objects that have already been defined and thus appear\r\n    // earlier in their respective collection.\r\n    // Currently, this only affects tiling patterns, but a (more) correct\r\n    // implementation of FormObjects would also define their own resource dicts.\r\n    var deferredResourceDictionaryIds = [];\r\n\r\n    putFonts();\r\n    putGStates();\r\n    putXObjects();\r\n    putPatterns(deferredResourceDictionaryIds);\r\n\r\n    events.publish(\"putResources\");\r\n    deferredResourceDictionaryIds.forEach(putResourceDictionary);\r\n    putResourceDictionary({\r\n      resourcesOid: resourceDictionaryObjId,\r\n      objectOid: Number.MAX_SAFE_INTEGER // output all objects\r\n    });\r\n    events.publish(\"postPutResources\");\r\n  };\r\n\r\n  var putAdditionalObjects = function() {\r\n    events.publish(\"putAdditionalObjects\");\r\n    for (var i = 0; i < additionalObjects.length; i++) {\r\n      var obj = additionalObjects[i];\r\n      newObjectDeferredBegin(obj.objId, true);\r\n      out(obj.content);\r\n      out(\"endobj\");\r\n    }\r\n    events.publish(\"postPutAdditionalObjects\");\r\n  };\r\n\r\n  var addFontToFontDictionary = function(font) {\r\n    fontmap[font.fontName] = fontmap[font.fontName] || {};\r\n    fontmap[font.fontName][font.fontStyle] = font.id;\r\n  };\r\n\r\n  var addFont = function(\r\n    postScriptName,\r\n    fontName,\r\n    fontStyle,\r\n    encoding,\r\n    isStandardFont\r\n  ) {\r\n    var font = {\r\n      id: \"F\" + (Object.keys(fonts).length + 1).toString(10),\r\n      postScriptName: postScriptName,\r\n      fontName: fontName,\r\n      fontStyle: fontStyle,\r\n      encoding: encoding,\r\n      isStandardFont: isStandardFont || false,\r\n      metadata: {}\r\n    };\r\n\r\n    events.publish(\"addFont\", {\r\n      font: font,\r\n      instance: this\r\n    });\r\n\r\n    fonts[font.id] = font;\r\n    addFontToFontDictionary(font);\r\n    return font.id;\r\n  };\r\n\r\n  var addFonts = function(arrayOfFonts) {\r\n    for (var i = 0, l = standardFonts.length; i < l; i++) {\r\n      var fontKey = addFont.call(\r\n        this,\r\n        arrayOfFonts[i][0],\r\n        arrayOfFonts[i][1],\r\n        arrayOfFonts[i][2],\r\n        standardFonts[i][3],\r\n        true\r\n      );\r\n\r\n      if (putOnlyUsedFonts === false) {\r\n        usedFonts[fontKey] = true;\r\n      }\r\n      // adding aliases for standard fonts, this time matching the capitalization\r\n      var parts = arrayOfFonts[i][0].split(\"-\");\r\n      addFontToFontDictionary({\r\n        id: fontKey,\r\n        fontName: parts[0],\r\n        fontStyle: parts[1] || \"\"\r\n      });\r\n    }\r\n    events.publish(\"addFonts\", {\r\n      fonts: fonts,\r\n      dictionary: fontmap\r\n    });\r\n  };\r\n\r\n  var SAFE = function __safeCall(fn) {\r\n    fn.foo = function __safeCallWrapper() {\r\n      try {\r\n        return fn.apply(this, arguments);\r\n      } catch (e) {\r\n        var stack = e.stack || \"\";\r\n        if (~stack.indexOf(\" at \")) stack = stack.split(\" at \")[1];\r\n        var m =\r\n          \"Error in function \" +\r\n          stack.split(\"\\n\")[0].split(\"<\")[0] +\r\n          \": \" +\r\n          e.message;\r\n        if (globalObject.console) {\r\n          globalObject.console.error(m, e);\r\n          if (globalObject.alert) alert(m);\r\n        } else {\r\n          throw new Error(m);\r\n        }\r\n      }\r\n    };\r\n    fn.foo.bar = fn;\r\n    return fn.foo;\r\n  };\r\n\r\n  var to8bitStream = function(text, flags) {\r\n    /**\r\n     * PDF 1.3 spec:\r\n     * \"For text strings encoded in Unicode, the first two bytes must be 254 followed by\r\n     * 255, representing the Unicode byte order marker, U+FEFF. (This sequence conflicts\r\n     * with the PDFDocEncoding character sequence thorn ydieresis, which is unlikely\r\n     * to be a meaningful beginning of a word or phrase.) The remainder of the\r\n     * string consists of Unicode character codes, according to the UTF-16 encoding\r\n     * specified in the Unicode standard, version 2.0. Commonly used Unicode values\r\n     * are represented as 2 bytes per character, with the high-order byte appearing first\r\n     * in the string.\"\r\n     *\r\n     * In other words, if there are chars in a string with char code above 255, we\r\n     * recode the string to UCS2 BE - string doubles in length and BOM is prepended.\r\n     *\r\n     * HOWEVER!\r\n     * Actual *content* (body) text (as opposed to strings used in document properties etc)\r\n     * does NOT expect BOM. There, it is treated as a literal GID (Glyph ID)\r\n     *\r\n     * Because of Adobe's focus on \"you subset your fonts!\" you are not supposed to have\r\n     * a font that maps directly Unicode (UCS2 / UTF16BE) code to font GID, but you could\r\n     * fudge it with \"Identity-H\" encoding and custom CIDtoGID map that mimics Unicode\r\n     * code page. There, however, all characters in the stream are treated as GIDs,\r\n     * including BOM, which is the reason we need to skip BOM in content text (i.e. that\r\n     * that is tied to a font).\r\n     *\r\n     * To signal this \"special\" PDFEscape / to8bitStream handling mode,\r\n     * API.text() function sets (unless you overwrite it with manual values\r\n     * given to API.text(.., flags) )\r\n     * flags.autoencode = true\r\n     * flags.noBOM = true\r\n     *\r\n     * ===================================================================================\r\n     * `flags` properties relied upon:\r\n     *   .sourceEncoding = string with encoding label.\r\n     *                     \"Unicode\" by default. = encoding of the incoming text.\r\n     *                     pass some non-existing encoding name\r\n     *                     (ex: 'Do not touch my strings! I know what I am doing.')\r\n     *                     to make encoding code skip the encoding step.\r\n     *   .outputEncoding = Either valid PDF encoding name\r\n     *                     (must be supported by jsPDF font metrics, otherwise no encoding)\r\n     *                     or a JS object, where key = sourceCharCode, value = outputCharCode\r\n     *                     missing keys will be treated as: sourceCharCode === outputCharCode\r\n     *   .noBOM\r\n     *       See comment higher above for explanation for why this is important\r\n     *   .autoencode\r\n     *       See comment higher above for explanation for why this is important\r\n     */\r\n\r\n    var i,\r\n      l,\r\n      sourceEncoding,\r\n      encodingBlock,\r\n      outputEncoding,\r\n      newtext,\r\n      isUnicode,\r\n      ch,\r\n      bch;\r\n\r\n    flags = flags || {};\r\n    sourceEncoding = flags.sourceEncoding || \"Unicode\";\r\n    outputEncoding = flags.outputEncoding;\r\n\r\n    // This 'encoding' section relies on font metrics format\r\n    // attached to font objects by, among others,\r\n    // \"Willow Systems' standard_font_metrics plugin\"\r\n    // see jspdf.plugin.standard_font_metrics.js for format\r\n    // of the font.metadata.encoding Object.\r\n    // It should be something like\r\n    //   .encoding = {'codePages':['WinANSI....'], 'WinANSI...':{code:code, ...}}\r\n    //   .widths = {0:width, code:width, ..., 'fof':divisor}\r\n    //   .kerning = {code:{previous_char_code:shift, ..., 'fof':-divisor},...}\r\n    if (\r\n      (flags.autoencode || outputEncoding) &&\r\n      fonts[activeFontKey].metadata &&\r\n      fonts[activeFontKey].metadata[sourceEncoding] &&\r\n      fonts[activeFontKey].metadata[sourceEncoding].encoding\r\n    ) {\r\n      encodingBlock = fonts[activeFontKey].metadata[sourceEncoding].encoding;\r\n\r\n      // each font has default encoding. Some have it clearly defined.\r\n      if (!outputEncoding && fonts[activeFontKey].encoding) {\r\n        outputEncoding = fonts[activeFontKey].encoding;\r\n      }\r\n\r\n      // Hmmm, the above did not work? Let's try again, in different place.\r\n      if (!outputEncoding && encodingBlock.codePages) {\r\n        outputEncoding = encodingBlock.codePages[0]; // let's say, first one is the default\r\n      }\r\n\r\n      if (typeof outputEncoding === \"string\") {\r\n        outputEncoding = encodingBlock[outputEncoding];\r\n      }\r\n      // we want output encoding to be a JS Object, where\r\n      // key = sourceEncoding's character code and\r\n      // value = outputEncoding's character code.\r\n      if (outputEncoding) {\r\n        isUnicode = false;\r\n        newtext = [];\r\n        for (i = 0, l = text.length; i < l; i++) {\r\n          ch = outputEncoding[text.charCodeAt(i)];\r\n          if (ch) {\r\n            newtext.push(String.fromCharCode(ch));\r\n          } else {\r\n            newtext.push(text[i]);\r\n          }\r\n\r\n          // since we are looping over chars anyway, might as well\r\n          // check for residual unicodeness\r\n          if (newtext[i].charCodeAt(0) >> 8) {\r\n            /* more than 255 */\r\n            isUnicode = true;\r\n          }\r\n        }\r\n        text = newtext.join(\"\");\r\n      }\r\n    }\r\n\r\n    i = text.length;\r\n    // isUnicode may be set to false above. Hence the triple-equal to undefined\r\n    while (isUnicode === undefined && i !== 0) {\r\n      if (text.charCodeAt(i - 1) >> 8) {\r\n        /* more than 255 */\r\n        isUnicode = true;\r\n      }\r\n      i--;\r\n    }\r\n    if (!isUnicode) {\r\n      return text;\r\n    }\r\n\r\n    newtext = flags.noBOM ? [] : [254, 255];\r\n    for (i = 0, l = text.length; i < l; i++) {\r\n      ch = text.charCodeAt(i);\r\n      bch = ch >> 8; // divide by 256\r\n      if (bch >> 8) {\r\n        /* something left after dividing by 256 second time */\r\n        throw new Error(\r\n          \"Character at position \" +\r\n            i +\r\n            \" of string '\" +\r\n            text +\r\n            \"' exceeds 16bits. Cannot be encoded into UCS-2 BE\"\r\n        );\r\n      }\r\n      newtext.push(bch);\r\n      newtext.push(ch - (bch << 8));\r\n    }\r\n    return String.fromCharCode.apply(undefined, newtext);\r\n  };\r\n\r\n  var pdfEscape = (API.__private__.pdfEscape = API.pdfEscape = function(\r\n    text,\r\n    flags\r\n  ) {\r\n    /**\r\n     * Replace '/', '(', and ')' with pdf-safe versions\r\n     *\r\n     * Doing to8bitStream does NOT make this PDF display unicode text. For that\r\n     * we also need to reference a unicode font and embed it - royal pain in the rear.\r\n     *\r\n     * There is still a benefit to to8bitStream - PDF simply cannot handle 16bit chars,\r\n     * which JavaScript Strings are happy to provide. So, while we still cannot display\r\n     * 2-byte characters property, at least CONDITIONALLY converting (entire string containing)\r\n     * 16bit chars to (USC-2-BE) 2-bytes per char + BOM streams we ensure that entire PDF\r\n     * is still parseable.\r\n     * This will allow immediate support for unicode in document properties strings.\r\n     */\r\n    return to8bitStream(text, flags)\r\n      .replace(/\\\\/g, \"\\\\\\\\\")\r\n      .replace(/\\(/g, \"\\\\(\")\r\n      .replace(/\\)/g, \"\\\\)\");\r\n  });\r\n\r\n  var beginPage = (API.__private__.beginPage = function(format) {\r\n    pages[++page] = [];\r\n    pagesContext[page] = {\r\n      objId: 0,\r\n      contentsObjId: 0,\r\n      userUnit: Number(userUnit),\r\n      artBox: null,\r\n      bleedBox: null,\r\n      cropBox: null,\r\n      trimBox: null,\r\n      mediaBox: {\r\n        bottomLeftX: 0,\r\n        bottomLeftY: 0,\r\n        topRightX: Number(format[0]),\r\n        topRightY: Number(format[1])\r\n      }\r\n    };\r\n    _setPage(page);\r\n    setOutputDestination(pages[currentPage]);\r\n  });\r\n\r\n  var _addPage = function(parmFormat, parmOrientation) {\r\n    var dimensions, width, height;\r\n\r\n    orientation = parmOrientation || orientation;\r\n\r\n    if (typeof parmFormat === \"string\") {\r\n      dimensions = getPageFormat(parmFormat.toLowerCase());\r\n      if (Array.isArray(dimensions)) {\r\n        width = dimensions[0];\r\n        height = dimensions[1];\r\n      }\r\n    }\r\n\r\n    if (Array.isArray(parmFormat)) {\r\n      width = parmFormat[0] * scaleFactor;\r\n      height = parmFormat[1] * scaleFactor;\r\n    }\r\n\r\n    if (isNaN(width)) {\r\n      width = format[0];\r\n      height = format[1];\r\n    }\r\n\r\n    if (width > 14400 || height > 14400) {\r\n      console.warn(\r\n        \"A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400\"\r\n      );\r\n      width = Math.min(14400, width);\r\n      height = Math.min(14400, height);\r\n    }\r\n\r\n    format = [width, height];\r\n\r\n    switch (orientation.substr(0, 1)) {\r\n      case \"l\":\r\n        if (height > width) {\r\n          format = [height, width];\r\n        }\r\n        break;\r\n      case \"p\":\r\n        if (width > height) {\r\n          format = [height, width];\r\n        }\r\n        break;\r\n    }\r\n\r\n    beginPage(format);\r\n\r\n    // Set line width\r\n    setLineWidth(lineWidth);\r\n    // Set draw color\r\n    out(strokeColor);\r\n    // resurrecting non-default line caps, joins\r\n    if (lineCapID !== 0) {\r\n      out(lineCapID + \" J\");\r\n    }\r\n    if (lineJoinID !== 0) {\r\n      out(lineJoinID + \" j\");\r\n    }\r\n    events.publish(\"addPage\", {\r\n      pageNumber: page\r\n    });\r\n  };\r\n\r\n  var _deletePage = function(n) {\r\n    if (n > 0 && n <= page) {\r\n      pages.splice(n, 1);\r\n      pagesContext.splice(n, 1);\r\n      page--;\r\n      if (currentPage > page) {\r\n        currentPage = page;\r\n      }\r\n      this.setPage(currentPage);\r\n    }\r\n  };\r\n\r\n  var _setPage = function(n) {\r\n    if (n > 0 && n <= page) {\r\n      currentPage = n;\r\n    }\r\n  };\r\n\r\n  var getNumberOfPages = (API.__private__.getNumberOfPages = API.getNumberOfPages = function() {\r\n    return pages.length - 1;\r\n  });\r\n\r\n  /**\r\n   * Returns a document-specific font key - a label assigned to a\r\n   * font name + font type combination at the time the font was added\r\n   * to the font inventory.\r\n   *\r\n   * Font key is used as label for the desired font for a block of text\r\n   * to be added to the PDF document stream.\r\n   * @private\r\n   * @function\r\n   * @param fontName {string} can be undefined on \"falthy\" to indicate \"use current\"\r\n   * @param fontStyle {string} can be undefined on \"falthy\" to indicate \"use current\"\r\n   * @returns {string} Font key.\r\n   * @ignore\r\n   */\r\n  var getFont = function(fontName, fontStyle, options) {\r\n    var key = undefined,\r\n      fontNameLowerCase;\r\n    options = options || {};\r\n\r\n    fontName =\r\n      fontName !== undefined ? fontName : fonts[activeFontKey].fontName;\r\n    fontStyle =\r\n      fontStyle !== undefined ? fontStyle : fonts[activeFontKey].fontStyle;\r\n    fontNameLowerCase = fontName.toLowerCase();\r\n\r\n    if (\r\n      fontmap[fontNameLowerCase] !== undefined &&\r\n      fontmap[fontNameLowerCase][fontStyle] !== undefined\r\n    ) {\r\n      key = fontmap[fontNameLowerCase][fontStyle];\r\n    } else if (\r\n      fontmap[fontName] !== undefined &&\r\n      fontmap[fontName][fontStyle] !== undefined\r\n    ) {\r\n      key = fontmap[fontName][fontStyle];\r\n    } else {\r\n      if (options.disableWarning === false) {\r\n        console.warn(\r\n          \"Unable to look up font label for font '\" +\r\n            fontName +\r\n            \"', '\" +\r\n            fontStyle +\r\n            \"'. Refer to getFontList() for available fonts.\"\r\n        );\r\n      }\r\n    }\r\n\r\n    if (!key && !options.noFallback) {\r\n      key = fontmap[\"times\"][fontStyle];\r\n      if (key == null) {\r\n        key = fontmap[\"times\"][\"normal\"];\r\n      }\r\n    }\r\n    return key;\r\n  };\r\n\r\n  var putInfo = (API.__private__.putInfo = function() {\r\n    var objectId = newObject();\r\n    var encryptor = function(data) {\r\n      return data;\r\n    };\r\n    if (encryptionOptions !== null) {\r\n      encryptor = encryption.encryptor(objectId, 0);\r\n    }\r\n    out(\"<<\");\r\n    out(\"/Producer (\" + pdfEscape(encryptor(\"jsPDF \" + jsPDF.version)) + \")\");\r\n    for (var key in documentProperties) {\r\n      if (documentProperties.hasOwnProperty(key) && documentProperties[key]) {\r\n        out(\r\n          \"/\" +\r\n            key.substr(0, 1).toUpperCase() +\r\n            key.substr(1) +\r\n            \" (\" +\r\n            pdfEscape(encryptor(documentProperties[key])) +\r\n            \")\"\r\n        );\r\n      }\r\n    }\r\n    out(\"/CreationDate (\" + pdfEscape(encryptor(creationDate)) + \")\");\r\n    out(\">>\");\r\n    out(\"endobj\");\r\n  });\r\n\r\n  var putCatalog = (API.__private__.putCatalog = function(options) {\r\n    options = options || {};\r\n    var tmpRootDictionaryObjId =\r\n      options.rootDictionaryObjId || rootDictionaryObjId;\r\n    newObject();\r\n    out(\"<<\");\r\n    out(\"/Type /Catalog\");\r\n    out(\"/Pages \" + tmpRootDictionaryObjId + \" 0 R\");\r\n    // PDF13ref Section 7.2.1\r\n    if (!zoomMode) zoomMode = \"fullwidth\";\r\n    switch (zoomMode) {\r\n      case \"fullwidth\":\r\n        out(\"/OpenAction [3 0 R /FitH null]\");\r\n        break;\r\n      case \"fullheight\":\r\n        out(\"/OpenAction [3 0 R /FitV null]\");\r\n        break;\r\n      case \"fullpage\":\r\n        out(\"/OpenAction [3 0 R /Fit]\");\r\n        break;\r\n      case \"original\":\r\n        out(\"/OpenAction [3 0 R /XYZ null null 1]\");\r\n        break;\r\n      default:\r\n        var pcn = \"\" + zoomMode;\r\n        if (pcn.substr(pcn.length - 1) === \"%\")\r\n          zoomMode = parseInt(zoomMode) / 100;\r\n        if (typeof zoomMode === \"number\") {\r\n          out(\"/OpenAction [3 0 R /XYZ null null \" + f2(zoomMode) + \"]\");\r\n        }\r\n    }\r\n    if (!layoutMode) layoutMode = \"continuous\";\r\n    switch (layoutMode) {\r\n      case \"continuous\":\r\n        out(\"/PageLayout /OneColumn\");\r\n        break;\r\n      case \"single\":\r\n        out(\"/PageLayout /SinglePage\");\r\n        break;\r\n      case \"two\":\r\n      case \"twoleft\":\r\n        out(\"/PageLayout /TwoColumnLeft\");\r\n        break;\r\n      case \"tworight\":\r\n        out(\"/PageLayout /TwoColumnRight\");\r\n        break;\r\n    }\r\n    if (pageMode) {\r\n      /**\r\n       * A name object specifying how the document should be displayed when opened:\r\n       * UseNone      : Neither document outline nor thumbnail images visible -- DEFAULT\r\n       * UseOutlines  : Document outline visible\r\n       * UseThumbs    : Thumbnail images visible\r\n       * FullScreen   : Full-screen mode, with no menu bar, window controls, or any other window visible\r\n       */\r\n      out(\"/PageMode /\" + pageMode);\r\n    }\r\n    events.publish(\"putCatalog\");\r\n    out(\">>\");\r\n    out(\"endobj\");\r\n  });\r\n\r\n  var putTrailer = (API.__private__.putTrailer = function() {\r\n    out(\"trailer\");\r\n    out(\"<<\");\r\n    out(\"/Size \" + (objectNumber + 1));\r\n    // Root and Info must be the last and second last objects written respectively\r\n    out(\"/Root \" + objectNumber + \" 0 R\");\r\n    out(\"/Info \" + (objectNumber - 1) + \" 0 R\");\r\n    if (encryptionOptions !== null) {\r\n      out(\"/Encrypt \" + encryption.oid + \" 0 R\");\r\n    }\r\n    out(\"/ID [ <\" + fileId + \"> <\" + fileId + \"> ]\");\r\n    out(\">>\");\r\n  });\r\n\r\n  var putHeader = (API.__private__.putHeader = function() {\r\n    out(\"%PDF-\" + pdfVersion);\r\n    out(\"%\\xBA\\xDF\\xAC\\xE0\");\r\n  });\r\n\r\n  var putXRef = (API.__private__.putXRef = function() {\r\n    var p = \"0000000000\";\r\n\r\n    out(\"xref\");\r\n    out(\"0 \" + (objectNumber + 1));\r\n    out(\"0000000000 65535 f \");\r\n    for (var i = 1; i <= objectNumber; i++) {\r\n      var offset = offsets[i];\r\n      if (typeof offset === \"function\") {\r\n        out((p + offsets[i]()).slice(-10) + \" 00000 n \");\r\n      } else {\r\n        if (typeof offsets[i] !== \"undefined\") {\r\n          out((p + offsets[i]).slice(-10) + \" 00000 n \");\r\n        } else {\r\n          out(\"0000000000 00000 n \");\r\n        }\r\n      }\r\n    }\r\n  });\r\n\r\n  var buildDocument = (API.__private__.buildDocument = function() {\r\n    resetDocument();\r\n    setOutputDestination(content);\r\n\r\n    events.publish(\"buildDocument\");\r\n\r\n    putHeader();\r\n    putPages();\r\n    putAdditionalObjects();\r\n    putResources();\r\n    if (encryptionOptions !== null) putEncryptionDict();\r\n    putInfo();\r\n    putCatalog();\r\n\r\n    var offsetOfXRef = contentLength;\r\n    putXRef();\r\n    putTrailer();\r\n    out(\"startxref\");\r\n    out(\"\" + offsetOfXRef);\r\n    out(\"%%EOF\");\r\n\r\n    setOutputDestination(pages[currentPage]);\r\n\r\n    return content.join(\"\\n\");\r\n  });\r\n\r\n  var getBlob = (API.__private__.getBlob = function(data) {\r\n    return new Blob([getArrayBuffer(data)], {\r\n      type: \"application/pdf\"\r\n    });\r\n  });\r\n\r\n  /**\r\n   * Generates the PDF document.\r\n   *\r\n   * If `type` argument is undefined, output is raw body of resulting PDF returned as a string.\r\n   *\r\n   * @param {string} type A string identifying one of the possible output types.<br/>\r\n   *                      Possible values are: <br/>\r\n   *                          'arraybuffer' -> (ArrayBuffer)<br/>\r\n   *                          'blob' -> (Blob)<br/>\r\n   *                          'bloburi'/'bloburl' -> (string)<br/>\r\n   *                          'datauristring'/'dataurlstring' -> (string)<br/>\r\n   *                          'datauri'/'dataurl' -> (undefined) -> change location to generated datauristring/dataurlstring<br/>\r\n   *                          'dataurlnewwindow' -> (window | null | undefined) throws error if global isn't a window object(node)<br/>\r\n   *                          'pdfobjectnewwindow' -> (window | null) throws error if global isn't a window object(node)<br/>\r\n   *                          'pdfjsnewwindow' -> (wind | null)\r\n   * @param {Object|string} options An object providing some additional signalling to PDF generator.<br/>\r\n   *                                Possible options are 'filename'.<br/>\r\n   *                                A string can be passed instead of {filename:string} and defaults to 'generated.pdf'\r\n   * @function\r\n   * @instance\r\n   * @returns {string|window|ArrayBuffer|Blob|jsPDF|null|undefined}\r\n   * @memberof jsPDF#\r\n   * @name output\r\n   */\r\n  var output = (API.output = API.__private__.output = SAFE(function output(\r\n    type,\r\n    options\r\n  ) {\r\n    options = options || {};\r\n\r\n    if (typeof options === \"string\") {\r\n      options = {\r\n        filename: options\r\n      };\r\n    } else {\r\n      options.filename = options.filename || \"generated.pdf\";\r\n    }\r\n\r\n    switch (type) {\r\n      case undefined:\r\n        return buildDocument();\r\n      case \"save\":\r\n        API.save(options.filename);\r\n        break;\r\n      case \"arraybuffer\":\r\n        return getArrayBuffer(buildDocument());\r\n      case \"blob\":\r\n        return getBlob(buildDocument());\r\n      case \"bloburi\":\r\n      case \"bloburl\":\r\n        // Developer is responsible of calling revokeObjectURL\r\n        if (\r\n          typeof globalObject.URL !== \"undefined\" &&\r\n          typeof globalObject.URL.createObjectURL === \"function\"\r\n        ) {\r\n          return (\r\n            (globalObject.URL &&\r\n              globalObject.URL.createObjectURL(getBlob(buildDocument()))) ||\r\n            void 0\r\n          );\r\n        } else {\r\n          console.warn(\r\n            \"bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.\"\r\n          );\r\n        }\r\n        break;\r\n      case \"datauristring\":\r\n      case \"dataurlstring\":\r\n        var dataURI = \"\";\r\n        var pdfDocument = buildDocument();\r\n        try {\r\n          dataURI = btoa(pdfDocument);\r\n        } catch (e) {\r\n          dataURI = btoa(unescape(encodeURIComponent(pdfDocument)));\r\n        }\r\n        return (\r\n          \"data:application/pdf;filename=\" +\r\n          options.filename +\r\n          \";base64,\" +\r\n          dataURI\r\n        );\r\n      case \"pdfobjectnewwindow\":\r\n        if (\r\n          Object.prototype.toString.call(globalObject) === \"[object Window]\"\r\n        ) {\r\n          var pdfObjectUrl =\r\n            \"https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js\";\r\n          var integrity =\r\n            ' integrity=\"sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==\" crossorigin=\"anonymous\"';\r\n\r\n          if (options.pdfObjectUrl) {\r\n            pdfObjectUrl = options.pdfObjectUrl;\r\n            integrity = \"\";\r\n          }\r\n\r\n          var htmlForNewWindow =\r\n            \"<html>\" +\r\n            '<style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><script src=\"' +\r\n            pdfObjectUrl +\r\n            '\"' +\r\n            integrity +\r\n            '></script><script >PDFObject.embed(\"' +\r\n            this.output(\"dataurlstring\") +\r\n            '\", ' +\r\n            JSON.stringify(options) +\r\n            \");</script></body></html>\";\r\n          var nW = globalObject.open();\r\n\r\n          if (nW !== null) {\r\n            nW.document.write(htmlForNewWindow);\r\n          }\r\n          return nW;\r\n        } else {\r\n          throw new Error(\r\n            \"The option pdfobjectnewwindow just works in a browser-environment.\"\r\n          );\r\n        }\r\n      case \"pdfjsnewwindow\":\r\n        if (\r\n          Object.prototype.toString.call(globalObject) === \"[object Window]\"\r\n        ) {\r\n          var pdfJsUrl = options.pdfJsUrl || \"examples/PDF.js/web/viewer.html\";\r\n          var htmlForPDFjsNewWindow =\r\n            \"<html>\" +\r\n            \"<style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style>\" +\r\n            '<body><iframe id=\"pdfViewer\" src=\"' +\r\n            pdfJsUrl +\r\n            \"?file=&downloadName=\" +\r\n            options.filename +\r\n            '\" width=\"500px\" height=\"400px\" />' +\r\n            \"</body></html>\";\r\n          var PDFjsNewWindow = globalObject.open();\r\n\r\n          if (PDFjsNewWindow !== null) {\r\n            PDFjsNewWindow.document.write(htmlForPDFjsNewWindow);\r\n            var scope = this;\r\n            PDFjsNewWindow.document.documentElement.querySelector(\r\n              \"#pdfViewer\"\r\n            ).onload = function() {\r\n              PDFjsNewWindow.document.title = options.filename;\r\n              PDFjsNewWindow.document.documentElement\r\n                .querySelector(\"#pdfViewer\")\r\n                .contentWindow.PDFViewerApplication.open(\r\n                  scope.output(\"bloburl\")\r\n                );\r\n            };\r\n          }\r\n          return PDFjsNewWindow;\r\n        } else {\r\n          throw new Error(\r\n            \"The option pdfjsnewwindow just works in a browser-environment.\"\r\n          );\r\n        }\r\n      case \"dataurlnewwindow\":\r\n        if (\r\n          Object.prototype.toString.call(globalObject) === \"[object Window]\"\r\n        ) {\r\n          var htmlForDataURLNewWindow =\r\n            \"<html>\" +\r\n            \"<style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style>\" +\r\n            \"<body>\" +\r\n            '<iframe src=\"' +\r\n            this.output(\"datauristring\", options) +\r\n            '\"></iframe>' +\r\n            \"</body></html>\";\r\n          var dataURLNewWindow = globalObject.open();\r\n          if (dataURLNewWindow !== null) {\r\n            dataURLNewWindow.document.write(htmlForDataURLNewWindow);\r\n            dataURLNewWindow.document.title = options.filename;\r\n          }\r\n          if (dataURLNewWindow || typeof safari === \"undefined\")\r\n            return dataURLNewWindow;\r\n        } else {\r\n          throw new Error(\r\n            \"The option dataurlnewwindow just works in a browser-environment.\"\r\n          );\r\n        }\r\n        break;\r\n      case \"datauri\":\r\n      case \"dataurl\":\r\n        return (globalObject.document.location.href = this.output(\r\n          \"datauristring\",\r\n          options\r\n        ));\r\n      default:\r\n        return null;\r\n    }\r\n  }));\r\n\r\n  /**\r\n   * Used to see if a supplied hotfix was requested when the pdf instance was created.\r\n   * @param {string} hotfixName - The name of the hotfix to check.\r\n   * @returns {boolean}\r\n   */\r\n  var hasHotfix = function(hotfixName) {\r\n    return (\r\n      Array.isArray(hotfixes) === true && hotfixes.indexOf(hotfixName) > -1\r\n    );\r\n  };\r\n\r\n  switch (unit) {\r\n    case \"pt\":\r\n      scaleFactor = 1;\r\n      break;\r\n    case \"mm\":\r\n      scaleFactor = 72 / 25.4;\r\n      break;\r\n    case \"cm\":\r\n      scaleFactor = 72 / 2.54;\r\n      break;\r\n    case \"in\":\r\n      scaleFactor = 72;\r\n      break;\r\n    case \"px\":\r\n      if (hasHotfix(\"px_scaling\") == true) {\r\n        scaleFactor = 72 / 96;\r\n      } else {\r\n        scaleFactor = 96 / 72;\r\n      }\r\n      break;\r\n    case \"pc\":\r\n      scaleFactor = 12;\r\n      break;\r\n    case \"em\":\r\n      scaleFactor = 12;\r\n      break;\r\n    case \"ex\":\r\n      scaleFactor = 6;\r\n      break;\r\n    default:\r\n      if (typeof unit === \"number\") {\r\n        scaleFactor = unit;\r\n      } else {\r\n        throw new Error(\"Invalid unit: \" + unit);\r\n      }\r\n  }\r\n\r\n  var encryption = null;\r\n  setCreationDate();\r\n  setFileId();\r\n\r\n  var getEncryptor = function(objectId) {\r\n    if (encryptionOptions !== null) {\r\n      return encryption.encryptor(objectId, 0);\r\n    }\r\n    return function(data) {\r\n      return data;\r\n    };\r\n  };\r\n\r\n  //---------------------------------------\r\n  // Public API\r\n\r\n  var getPageInfo = (API.__private__.getPageInfo = API.getPageInfo = function(\r\n    pageNumberOneBased\r\n  ) {\r\n    if (isNaN(pageNumberOneBased) || pageNumberOneBased % 1 !== 0) {\r\n      throw new Error(\"Invalid argument passed to jsPDF.getPageInfo\");\r\n    }\r\n    var objId = pagesContext[pageNumberOneBased].objId;\r\n    return {\r\n      objId: objId,\r\n      pageNumber: pageNumberOneBased,\r\n      pageContext: pagesContext[pageNumberOneBased]\r\n    };\r\n  });\r\n\r\n  var getPageInfoByObjId = (API.__private__.getPageInfoByObjId = function(\r\n    objId\r\n  ) {\r\n    if (isNaN(objId) || objId % 1 !== 0) {\r\n      throw new Error(\"Invalid argument passed to jsPDF.getPageInfoByObjId\");\r\n    }\r\n    for (var pageNumber in pagesContext) {\r\n      if (pagesContext[pageNumber].objId === objId) {\r\n        break;\r\n      }\r\n    }\r\n    return getPageInfo(pageNumber);\r\n  });\r\n\r\n  var getCurrentPageInfo = (API.__private__.getCurrentPageInfo = API.getCurrentPageInfo = function() {\r\n    return {\r\n      objId: pagesContext[currentPage].objId,\r\n      pageNumber: currentPage,\r\n      pageContext: pagesContext[currentPage]\r\n    };\r\n  });\r\n\r\n  /**\r\n   * Adds (and transfers the focus to) new page to the PDF document.\r\n   * @param format {String/Array} The format of the new page. Can be: <ul><li>a0 - a10</li><li>b0 - b10</li><li>c0 - c10</li><li>dl</li><li>letter</li><li>government-letter</li><li>legal</li><li>junior-legal</li><li>ledger</li><li>tabloid</li><li>credit-card</li></ul><br />\r\n   * Default is \"a4\". If you want to use your own format just pass instead of one of the above predefined formats the size as an number-array, e.g. [595.28, 841.89]\r\n   * @param orientation {string} Orientation of the new page. Possible values are \"portrait\" or \"landscape\" (or shortcuts \"p\" (Default), \"l\").\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   *\r\n   * @memberof jsPDF#\r\n   * @name addPage\r\n   */\r\n  API.addPage = function() {\r\n    _addPage.apply(this, arguments);\r\n    return this;\r\n  };\r\n  /**\r\n   * Adds (and transfers the focus to) new page to the PDF document.\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   *\r\n   * @memberof jsPDF#\r\n   * @name setPage\r\n   * @param {number} page Switch the active page to the page number specified (indexed starting at 1).\r\n   * @example\r\n   * doc = jsPDF()\r\n   * doc.addPage()\r\n   * doc.addPage()\r\n   * doc.text('I am on page 3', 10, 10)\r\n   * doc.setPage(1)\r\n   * doc.text('I am on page 1', 10, 10)\r\n   */\r\n  API.setPage = function() {\r\n    _setPage.apply(this, arguments);\r\n    setOutputDestination.call(this, pages[currentPage]);\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * @name insertPage\r\n   * @memberof jsPDF#\r\n   *\r\n   * @function\r\n   * @instance\r\n   * @param {Object} beforePage\r\n   * @returns {jsPDF}\r\n   */\r\n  API.insertPage = function(beforePage) {\r\n    this.addPage();\r\n    this.movePage(currentPage, beforePage);\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * @name movePage\r\n   * @memberof jsPDF#\r\n   * @function\r\n   * @instance\r\n   * @param {number} targetPage\r\n   * @param {number} beforePage\r\n   * @returns {jsPDF}\r\n   */\r\n  API.movePage = function(targetPage, beforePage) {\r\n    var tmpPages, tmpPagesContext;\r\n    if (targetPage > beforePage) {\r\n      tmpPages = pages[targetPage];\r\n      tmpPagesContext = pagesContext[targetPage];\r\n      for (var i = targetPage; i > beforePage; i--) {\r\n        pages[i] = pages[i - 1];\r\n        pagesContext[i] = pagesContext[i - 1];\r\n      }\r\n      pages[beforePage] = tmpPages;\r\n      pagesContext[beforePage] = tmpPagesContext;\r\n      this.setPage(beforePage);\r\n    } else if (targetPage < beforePage) {\r\n      tmpPages = pages[targetPage];\r\n      tmpPagesContext = pagesContext[targetPage];\r\n      for (var j = targetPage; j < beforePage; j++) {\r\n        pages[j] = pages[j + 1];\r\n        pagesContext[j] = pagesContext[j + 1];\r\n      }\r\n      pages[beforePage] = tmpPages;\r\n      pagesContext[beforePage] = tmpPagesContext;\r\n      this.setPage(beforePage);\r\n    }\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Deletes a page from the PDF.\r\n   * @name deletePage\r\n   * @memberof jsPDF#\r\n   * @function\r\n   * @param {number} targetPage\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   */\r\n  API.deletePage = function() {\r\n    _deletePage.apply(this, arguments);\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Adds text to page. Supports adding multiline text when 'text' argument is an Array of Strings.\r\n   *\r\n   * @function\r\n   * @instance\r\n   * @param {String|Array} text String or array of strings to be added to the page. Each line is shifted one line down per font, spacing settings declared before this call.\r\n   * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page.\r\n   * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page.\r\n   * @param {Object} [options] - Collection of settings signaling how the text must be encoded.\r\n   * @param {string} [options.align=left] - The alignment of the text, possible values: left, center, right, justify.\r\n   * @param {string} [options.baseline=alphabetic] - Sets text baseline used when drawing the text, possible values: alphabetic, ideographic, bottom, top, middle, hanging\r\n   * @param {number|Matrix} [options.angle=0] - Rotate the text clockwise or counterclockwise. Expects the angle in degree.\r\n   * @param {number} [options.rotationDirection=1] - Direction of the rotation. 0 = clockwise, 1 = counterclockwise.\r\n   * @param {number} [options.charSpace=0] - The space between each letter.\r\n   * @param {number} [options.horizontalScale=1] - Horizontal scale of the text as a factor of the regular size.\r\n   * @param {number} [options.lineHeightFactor=1.15] - The lineheight of each line.\r\n   * @param {Object} [options.flags] - Flags for to8bitStream.\r\n   * @param {boolean} [options.flags.noBOM=true] - Don't add BOM to Unicode-text.\r\n   * @param {boolean} [options.flags.autoencode=true] - Autoencode the Text.\r\n   * @param {number} [options.maxWidth=0] - Split the text by given width, 0 = no split.\r\n   * @param {string} [options.renderingMode=fill] - Set how the text should be rendered, possible values: fill, stroke, fillThenStroke, invisible, fillAndAddForClipping, strokeAndAddPathForClipping, fillThenStrokeAndAddToPathForClipping, addToPathForClipping.\r\n   * @param {boolean} [options.isInputVisual] - Option for the BidiEngine\r\n   * @param {boolean} [options.isOutputVisual] - Option for the BidiEngine\r\n   * @param {boolean} [options.isInputRtl] - Option for the BidiEngine\r\n   * @param {boolean} [options.isOutputRtl] - Option for the BidiEngine\r\n   * @param {boolean} [options.isSymmetricSwapping] - Option for the BidiEngine\r\n   * @param {number|Matrix} transform If transform is a number the text will be rotated by this value around the anchor set by x and y.\r\n   *\r\n   * If it is a Matrix, this matrix gets directly applied to the text, which allows shearing\r\n   * effects etc.; the x and y offsets are then applied AFTER the coordinate system has been established by this\r\n   * matrix. This means passing a rotation matrix that is equivalent to some rotation angle will in general yield a\r\n   * DIFFERENT result. A matrix is only allowed in \"advanced\" API mode.\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name text\r\n   */\r\n  API.__private__.text = API.text = function(text, x, y, options, transform) {\r\n    /*\r\n     * Inserts something like this into PDF\r\n     *   BT\r\n     *    /F1 16 Tf  % Font name + size\r\n     *    16 TL % How many units down for next line in multiline text\r\n     *    0 g % color\r\n     *    28.35 813.54 Td % position\r\n     *    (line one) Tj\r\n     *    T* (line two) Tj\r\n     *    T* (line three) Tj\r\n     *   ET\r\n     */\r\n    options = options || {};\r\n    var scope = options.scope || this;\r\n    var payload, da, angle, align, charSpace, maxWidth, flags, horizontalScale;\r\n\r\n    // Pre-August-2012 the order of arguments was function(x, y, text, flags)\r\n    // in effort to make all calls have similar signature like\r\n    //   function(data, coordinates... , miscellaneous)\r\n    // this method had its args flipped.\r\n    // code below allows backward compatibility with old arg order.\r\n    if (\r\n      typeof text === \"number\" &&\r\n      typeof x === \"number\" &&\r\n      (typeof y === \"string\" || Array.isArray(y))\r\n    ) {\r\n      var tmp = y;\r\n      y = x;\r\n      x = text;\r\n      text = tmp;\r\n    }\r\n\r\n    var transformationMatrix;\r\n\r\n    if (arguments[3] instanceof Matrix === false) {\r\n      flags = arguments[3];\r\n      angle = arguments[4];\r\n      align = arguments[5];\r\n\r\n      if (typeof flags !== \"object\" || flags === null) {\r\n        if (typeof angle === \"string\") {\r\n          align = angle;\r\n          angle = null;\r\n        }\r\n        if (typeof flags === \"string\") {\r\n          align = flags;\r\n          flags = null;\r\n        }\r\n        if (typeof flags === \"number\") {\r\n          angle = flags;\r\n          flags = null;\r\n        }\r\n        options = {\r\n          flags: flags,\r\n          angle: angle,\r\n          align: align\r\n        };\r\n      }\r\n    } else {\r\n      advancedApiModeTrap(\r\n        \"The transform parameter of text() with a Matrix value\"\r\n      );\r\n      transformationMatrix = transform;\r\n    }\r\n\r\n    if (isNaN(x) || isNaN(y) || typeof text === \"undefined\" || text === null) {\r\n      throw new Error(\"Invalid arguments passed to jsPDF.text\");\r\n    }\r\n\r\n    if (text.length === 0) {\r\n      return scope;\r\n    }\r\n\r\n    var xtra = \"\";\r\n    var isHex = false;\r\n    var lineHeight =\r\n      typeof options.lineHeightFactor === \"number\"\r\n        ? options.lineHeightFactor\r\n        : lineHeightFactor;\r\n    var scaleFactor = scope.internal.scaleFactor;\r\n\r\n    function ESC(s) {\r\n      s = s.split(\"\\t\").join(Array(options.TabLen || 9).join(\" \"));\r\n      return pdfEscape(s, flags);\r\n    }\r\n\r\n    function transformTextToSpecialArray(text) {\r\n      //we don't want to destroy original text array, so cloning it\r\n      var sa = text.concat();\r\n      var da = [];\r\n      var len = sa.length;\r\n      var curDa;\r\n      //we do array.join('text that must not be PDFescaped\")\r\n      //thus, pdfEscape each component separately\r\n      while (len--) {\r\n        curDa = sa.shift();\r\n        if (typeof curDa === \"string\") {\r\n          da.push(curDa);\r\n        } else {\r\n          if (\r\n            Array.isArray(text) &&\r\n            (curDa.length === 1 ||\r\n              (curDa[1] === undefined && curDa[2] === undefined))\r\n          ) {\r\n            da.push(curDa[0]);\r\n          } else {\r\n            da.push([curDa[0], curDa[1], curDa[2]]);\r\n          }\r\n        }\r\n      }\r\n      return da;\r\n    }\r\n\r\n    function processTextByFunction(text, processingFunction) {\r\n      var result;\r\n      if (typeof text === \"string\") {\r\n        result = processingFunction(text)[0];\r\n      } else if (Array.isArray(text)) {\r\n        //we don't want to destroy original text array, so cloning it\r\n        var sa = text.concat();\r\n        var da = [];\r\n        var len = sa.length;\r\n        var curDa;\r\n        var tmpResult;\r\n        //we do array.join('text that must not be PDFescaped\")\r\n        //thus, pdfEscape each component separately\r\n        while (len--) {\r\n          curDa = sa.shift();\r\n          if (typeof curDa === \"string\") {\r\n            da.push(processingFunction(curDa)[0]);\r\n          } else if (Array.isArray(curDa) && typeof curDa[0] === \"string\") {\r\n            tmpResult = processingFunction(curDa[0], curDa[1], curDa[2]);\r\n            da.push([tmpResult[0], tmpResult[1], tmpResult[2]]);\r\n          }\r\n        }\r\n        result = da;\r\n      }\r\n      return result;\r\n    }\r\n\r\n    //Check if text is of type String\r\n    var textIsOfTypeString = false;\r\n    var tmpTextIsOfTypeString = true;\r\n\r\n    if (typeof text === \"string\") {\r\n      textIsOfTypeString = true;\r\n    } else if (Array.isArray(text)) {\r\n      //we don't want to destroy original text array, so cloning it\r\n      var sa = text.concat();\r\n      da = [];\r\n      var len = sa.length;\r\n      var curDa;\r\n      //we do array.join('text that must not be PDFescaped\")\r\n      //thus, pdfEscape each component separately\r\n      while (len--) {\r\n        curDa = sa.shift();\r\n        if (\r\n          typeof curDa !== \"string\" ||\r\n          (Array.isArray(curDa) && typeof curDa[0] !== \"string\")\r\n        ) {\r\n          tmpTextIsOfTypeString = false;\r\n        }\r\n      }\r\n      textIsOfTypeString = tmpTextIsOfTypeString;\r\n    }\r\n    if (textIsOfTypeString === false) {\r\n      throw new Error(\r\n        'Type of text must be string or Array. \"' +\r\n          text +\r\n          '\" is not recognized.'\r\n      );\r\n    }\r\n\r\n    //If there are any newlines in text, we assume\r\n    //the user wanted to print multiple lines, so break the\r\n    //text up into an array. If the text is already an array,\r\n    //we assume the user knows what they are doing.\r\n    //Convert text into an array anyway to simplify\r\n    //later code.\r\n\r\n    if (typeof text === \"string\") {\r\n      if (text.match(/[\\r?\\n]/)) {\r\n        text = text.split(/\\r\\n|\\r|\\n/g);\r\n      } else {\r\n        text = [text];\r\n      }\r\n    }\r\n\r\n    //baseline\r\n    var height = activeFontSize / scope.internal.scaleFactor;\r\n    var descent = height * (lineHeight - 1);\r\n\r\n    switch (options.baseline) {\r\n      case \"bottom\":\r\n        y -= descent;\r\n        break;\r\n      case \"top\":\r\n        y += height - descent;\r\n        break;\r\n      case \"hanging\":\r\n        y += height - 2 * descent;\r\n        break;\r\n      case \"middle\":\r\n        y += height / 2 - descent;\r\n        break;\r\n      case \"ideographic\":\r\n      case \"alphabetic\":\r\n      default:\r\n        // do nothing, everything is fine\r\n        break;\r\n    }\r\n\r\n    //multiline\r\n    maxWidth = options.maxWidth || 0;\r\n\r\n    if (maxWidth > 0) {\r\n      if (typeof text === \"string\") {\r\n        text = scope.splitTextToSize(text, maxWidth);\r\n      } else if (Object.prototype.toString.call(text) === \"[object Array]\") {\r\n        text = text.reduce(function(acc, textLine) {\r\n          return acc.concat(scope.splitTextToSize(textLine, maxWidth));\r\n        }, []);\r\n      }\r\n    }\r\n\r\n    //creating Payload-Object to make text byRef\r\n    payload = {\r\n      text: text,\r\n      x: x,\r\n      y: y,\r\n      options: options,\r\n      mutex: {\r\n        pdfEscape: pdfEscape,\r\n        activeFontKey: activeFontKey,\r\n        fonts: fonts,\r\n        activeFontSize: activeFontSize\r\n      }\r\n    };\r\n    events.publish(\"preProcessText\", payload);\r\n\r\n    text = payload.text;\r\n    options = payload.options;\r\n\r\n    //angle\r\n    angle = options.angle;\r\n\r\n    if (\r\n      transformationMatrix instanceof Matrix === false &&\r\n      angle &&\r\n      typeof angle === \"number\"\r\n    ) {\r\n      angle *= Math.PI / 180;\r\n\r\n      if (options.rotationDirection === 0) {\r\n        angle = -angle;\r\n      }\r\n\r\n      if (apiMode === ApiMode.ADVANCED) {\r\n        angle = -angle;\r\n      }\r\n\r\n      var c = Math.cos(angle);\r\n      var s = Math.sin(angle);\r\n      transformationMatrix = new Matrix(c, s, -s, c, 0, 0);\r\n    } else if (angle && angle instanceof Matrix) {\r\n      transformationMatrix = angle;\r\n    }\r\n\r\n    if (apiMode === ApiMode.ADVANCED && !transformationMatrix) {\r\n      transformationMatrix = identityMatrix;\r\n    }\r\n\r\n    //charSpace\r\n\r\n    charSpace = options.charSpace || activeCharSpace;\r\n\r\n    if (typeof charSpace !== \"undefined\") {\r\n      xtra += hpf(scale(charSpace)) + \" Tc\\n\";\r\n      this.setCharSpace(this.getCharSpace() || 0);\r\n    }\r\n\r\n    horizontalScale = options.horizontalScale;\r\n    if (typeof horizontalScale !== \"undefined\") {\r\n      xtra += hpf(horizontalScale * 100) + \" Tz\\n\";\r\n    }\r\n\r\n    //lang\r\n\r\n    var lang = options.lang;\r\n\r\n    if (lang) {\r\n      //    xtra += \"/Lang (\" + lang +\")\\n\";\r\n    }\r\n\r\n    //renderingMode\r\n    var renderingMode = -1;\r\n    var parmRenderingMode =\r\n      typeof options.renderingMode !== \"undefined\"\r\n        ? options.renderingMode\r\n        : options.stroke;\r\n    var pageContext = scope.internal.getCurrentPageInfo().pageContext;\r\n\r\n    switch (parmRenderingMode) {\r\n      case 0:\r\n      case false:\r\n      case \"fill\":\r\n        renderingMode = 0;\r\n        break;\r\n      case 1:\r\n      case true:\r\n      case \"stroke\":\r\n        renderingMode = 1;\r\n        break;\r\n      case 2:\r\n      case \"fillThenStroke\":\r\n        renderingMode = 2;\r\n        break;\r\n      case 3:\r\n      case \"invisible\":\r\n        renderingMode = 3;\r\n        break;\r\n      case 4:\r\n      case \"fillAndAddForClipping\":\r\n        renderingMode = 4;\r\n        break;\r\n      case 5:\r\n      case \"strokeAndAddPathForClipping\":\r\n        renderingMode = 5;\r\n        break;\r\n      case 6:\r\n      case \"fillThenStrokeAndAddToPathForClipping\":\r\n        renderingMode = 6;\r\n        break;\r\n      case 7:\r\n      case \"addToPathForClipping\":\r\n        renderingMode = 7;\r\n        break;\r\n    }\r\n\r\n    var usedRenderingMode =\r\n      typeof pageContext.usedRenderingMode !== \"undefined\"\r\n        ? pageContext.usedRenderingMode\r\n        : -1;\r\n\r\n    //if the coder wrote it explicitly to use a specific\r\n    //renderingMode, then use it\r\n    if (renderingMode !== -1) {\r\n      xtra += renderingMode + \" Tr\\n\";\r\n      //otherwise check if we used the rendering Mode already\r\n      //if so then set the rendering Mode...\r\n    } else if (usedRenderingMode !== -1) {\r\n      xtra += \"0 Tr\\n\";\r\n    }\r\n\r\n    if (renderingMode !== -1) {\r\n      pageContext.usedRenderingMode = renderingMode;\r\n    }\r\n\r\n    //align\r\n    align = options.align || \"left\";\r\n    var leading = activeFontSize * lineHeight;\r\n    var pageWidth = scope.internal.pageSize.getWidth();\r\n    var activeFont = fonts[activeFontKey];\r\n    charSpace = options.charSpace || activeCharSpace;\r\n    maxWidth = options.maxWidth || 0;\r\n\r\n    var lineWidths;\r\n    flags = Object.assign({ autoencode: true, noBOM: true }, options.flags);\r\n\r\n    var wordSpacingPerLine = [];\r\n\r\n    if (Object.prototype.toString.call(text) === \"[object Array]\") {\r\n      da = transformTextToSpecialArray(text);\r\n      var newY;\r\n      if (align !== \"left\") {\r\n        lineWidths = da.map(function(v) {\r\n          return (\r\n            (scope.getStringUnitWidth(v, {\r\n              font: activeFont,\r\n              charSpace: charSpace,\r\n              fontSize: activeFontSize,\r\n              doKerning: false\r\n            }) *\r\n              activeFontSize) /\r\n            scaleFactor\r\n          );\r\n        });\r\n      }\r\n      //The first line uses the \"main\" Td setting,\r\n      //and the subsequent lines are offset by the\r\n      //previous line's x coordinate.\r\n      var prevWidth = 0;\r\n      var newX;\r\n      if (align === \"right\") {\r\n        //The passed in x coordinate defines the\r\n        //rightmost point of the text.\r\n        x -= lineWidths[0];\r\n        text = [];\r\n        len = da.length;\r\n        for (var i = 0; i < len; i++) {\r\n          if (i === 0) {\r\n            newX = getHorizontalCoordinate(x);\r\n            newY = getVerticalCoordinate(y);\r\n          } else {\r\n            newX = scale(prevWidth - lineWidths[i]);\r\n            newY = -leading;\r\n          }\r\n          text.push([da[i], newX, newY]);\r\n          prevWidth = lineWidths[i];\r\n        }\r\n      } else if (align === \"center\") {\r\n        //The passed in x coordinate defines\r\n        //the center point.\r\n        x -= lineWidths[0] / 2;\r\n        text = [];\r\n        len = da.length;\r\n        for (var j = 0; j < len; j++) {\r\n          if (j === 0) {\r\n            newX = getHorizontalCoordinate(x);\r\n            newY = getVerticalCoordinate(y);\r\n          } else {\r\n            newX = scale((prevWidth - lineWidths[j]) / 2);\r\n            newY = -leading;\r\n          }\r\n          text.push([da[j], newX, newY]);\r\n          prevWidth = lineWidths[j];\r\n        }\r\n      } else if (align === \"left\") {\r\n        text = [];\r\n        len = da.length;\r\n        for (var h = 0; h < len; h++) {\r\n          text.push(da[h]);\r\n        }\r\n      } else if (align === \"justify\") {\r\n        text = [];\r\n        len = da.length;\r\n        maxWidth = maxWidth !== 0 ? maxWidth : pageWidth;\r\n\r\n        for (var l = 0; l < len; l++) {\r\n          newY = l === 0 ? getVerticalCoordinate(y) : -leading;\r\n          newX = l === 0 ? getHorizontalCoordinate(x) : 0;\r\n          if (l < len - 1) {\r\n            wordSpacingPerLine.push(\r\n              hpf(\r\n                scale(\r\n                  (maxWidth - lineWidths[l]) / (da[l].split(\" \").length - 1)\r\n                )\r\n              )\r\n            );\r\n          } else {\r\n            wordSpacingPerLine.push(0);\r\n          }\r\n          text.push([da[l], newX, newY]);\r\n        }\r\n      } else {\r\n        throw new Error(\r\n          'Unrecognized alignment option, use \"left\", \"center\", \"right\" or \"justify\".'\r\n        );\r\n      }\r\n    }\r\n\r\n    //R2L\r\n    var doReversing = typeof options.R2L === \"boolean\" ? options.R2L : R2L;\r\n    if (doReversing === true) {\r\n      text = processTextByFunction(text, function(text, posX, posY) {\r\n        return [\r\n          text\r\n            .split(\"\")\r\n            .reverse()\r\n            .join(\"\"),\r\n          posX,\r\n          posY\r\n        ];\r\n      });\r\n    }\r\n\r\n    //creating Payload-Object to make text byRef\r\n    payload = {\r\n      text: text,\r\n      x: x,\r\n      y: y,\r\n      options: options,\r\n      mutex: {\r\n        pdfEscape: pdfEscape,\r\n        activeFontKey: activeFontKey,\r\n        fonts: fonts,\r\n        activeFontSize: activeFontSize\r\n      }\r\n    };\r\n    events.publish(\"postProcessText\", payload);\r\n\r\n    text = payload.text;\r\n    isHex = payload.mutex.isHex || false;\r\n\r\n    //Escaping\r\n    var activeFontEncoding = fonts[activeFontKey].encoding;\r\n\r\n    if (\r\n      activeFontEncoding === \"WinAnsiEncoding\" ||\r\n      activeFontEncoding === \"StandardEncoding\"\r\n    ) {\r\n      text = processTextByFunction(text, function(text, posX, posY) {\r\n        return [ESC(text), posX, posY];\r\n      });\r\n    }\r\n\r\n    da = transformTextToSpecialArray(text);\r\n\r\n    text = [];\r\n    var STRING = 0;\r\n    var ARRAY = 1;\r\n    var variant = Array.isArray(da[0]) ? ARRAY : STRING;\r\n    var posX;\r\n    var posY;\r\n    var content;\r\n    var wordSpacing = \"\";\r\n\r\n    var generatePosition = function(\r\n      parmPosX,\r\n      parmPosY,\r\n      parmTransformationMatrix\r\n    ) {\r\n      var position = \"\";\r\n      if (parmTransformationMatrix instanceof Matrix) {\r\n        // It is kind of more intuitive to apply a plain rotation around the text anchor set by x and y\r\n        // but when the user supplies an arbitrary transformation matrix, the x and y offsets should be applied\r\n        // in the coordinate system established by this matrix\r\n        if (typeof options.angle === \"number\") {\r\n          parmTransformationMatrix = matrixMult(\r\n            parmTransformationMatrix,\r\n            new Matrix(1, 0, 0, 1, parmPosX, parmPosY)\r\n          );\r\n        } else {\r\n          parmTransformationMatrix = matrixMult(\r\n            new Matrix(1, 0, 0, 1, parmPosX, parmPosY),\r\n            parmTransformationMatrix\r\n          );\r\n        }\r\n\r\n        if (apiMode === ApiMode.ADVANCED) {\r\n          parmTransformationMatrix = matrixMult(\r\n            new Matrix(1, 0, 0, -1, 0, 0),\r\n            parmTransformationMatrix\r\n          );\r\n        }\r\n\r\n        position = parmTransformationMatrix.join(\" \") + \" Tm\\n\";\r\n      } else {\r\n        position = hpf(parmPosX) + \" \" + hpf(parmPosY) + \" Td\\n\";\r\n      }\r\n      return position;\r\n    };\r\n\r\n    for (var lineIndex = 0; lineIndex < da.length; lineIndex++) {\r\n      wordSpacing = \"\";\r\n\r\n      switch (variant) {\r\n        case ARRAY:\r\n          content =\r\n            (isHex ? \"<\" : \"(\") + da[lineIndex][0] + (isHex ? \">\" : \")\");\r\n          posX = parseFloat(da[lineIndex][1]);\r\n          posY = parseFloat(da[lineIndex][2]);\r\n          break;\r\n        case STRING:\r\n          content = (isHex ? \"<\" : \"(\") + da[lineIndex] + (isHex ? \">\" : \")\");\r\n          posX = getHorizontalCoordinate(x);\r\n          posY = getVerticalCoordinate(y);\r\n          break;\r\n      }\r\n\r\n      if (\r\n        typeof wordSpacingPerLine !== \"undefined\" &&\r\n        typeof wordSpacingPerLine[lineIndex] !== \"undefined\"\r\n      ) {\r\n        wordSpacing = wordSpacingPerLine[lineIndex] + \" Tw\\n\";\r\n      }\r\n\r\n      if (lineIndex === 0) {\r\n        text.push(\r\n          wordSpacing +\r\n            generatePosition(posX, posY, transformationMatrix) +\r\n            content\r\n        );\r\n      } else if (variant === STRING) {\r\n        text.push(wordSpacing + content);\r\n      } else if (variant === ARRAY) {\r\n        text.push(\r\n          wordSpacing +\r\n            generatePosition(posX, posY, transformationMatrix) +\r\n            content\r\n        );\r\n      }\r\n    }\r\n\r\n    text = variant === STRING ? text.join(\" Tj\\nT* \") : text.join(\" Tj\\n\");\r\n    text += \" Tj\\n\";\r\n\r\n    var result = \"BT\\n/\";\r\n    result += activeFontKey + \" \" + activeFontSize + \" Tf\\n\"; // font face, style, size\r\n    result += hpf(activeFontSize * lineHeight) + \" TL\\n\"; // line spacing\r\n    result += textColor + \"\\n\";\r\n    result += xtra;\r\n    result += text;\r\n    result += \"ET\";\r\n\r\n    out(result);\r\n    usedFonts[activeFontKey] = true;\r\n    return scope;\r\n  };\r\n\r\n  // PDF supports these path painting and clip path operators:\r\n  //\r\n  // S - stroke\r\n  // s - close/stroke\r\n  // f (F) - fill non-zero\r\n  // f* - fill evenodd\r\n  // B - fill stroke nonzero\r\n  // B* - fill stroke evenodd\r\n  // b - close fill stroke nonzero\r\n  // b* - close fill stroke evenodd\r\n  // n - nothing (consume path)\r\n  // W - clip nonzero\r\n  // W* - clip evenodd\r\n  //\r\n  // In order to keep the API small, we omit the close-and-fill/stroke operators and provide a separate close()\r\n  // method.\r\n  /**\r\n   *\r\n   * @name clip\r\n   * @function\r\n   * @instance\r\n   * @param {string} rule Only possible value is 'evenodd'\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @description All .clip() after calling drawing ops with a style argument of null.\r\n   */\r\n  var clip = (API.__private__.clip = API.clip = function(rule) {\r\n    // Call .clip() after calling drawing ops with a style argument of null\r\n    // W is the PDF clipping op\r\n    if (\"evenodd\" === rule) {\r\n      out(\"W*\");\r\n    } else {\r\n      out(\"W\");\r\n    }\r\n    return this;\r\n  });\r\n\r\n  /**\r\n   * @name clipEvenOdd\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @description Modify the current clip path by intersecting it with the current path using the even-odd rule. Note\r\n   * that this will NOT consume the current path. In order to only use this path for clipping call\r\n   * {@link API.discardPath} afterwards.\r\n   */\r\n  API.clipEvenOdd = function() {\r\n    return clip(\"evenodd\");\r\n  };\r\n\r\n  /**\r\n   * Consumes the current path without any effect. Mainly used in combination with {@link clip} or\r\n   * {@link clipEvenOdd}. The PDF \"n\" operator.\r\n   * @name discardPath\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   */\r\n  API.__private__.discardPath = API.discardPath = function() {\r\n    out(\"n\");\r\n    return this;\r\n  };\r\n\r\n  var isValidStyle = (API.__private__.isValidStyle = function(style) {\r\n    var validStyleVariants = [\r\n      undefined,\r\n      null,\r\n      \"S\",\r\n      \"D\",\r\n      \"F\",\r\n      \"DF\",\r\n      \"FD\",\r\n      \"f\",\r\n      \"f*\",\r\n      \"B\",\r\n      \"B*\",\r\n      \"n\"\r\n    ];\r\n    var result = false;\r\n    if (validStyleVariants.indexOf(style) !== -1) {\r\n      result = true;\r\n    }\r\n    return result;\r\n  });\r\n\r\n  API.__private__.setDefaultPathOperation = API.setDefaultPathOperation = function(\r\n    operator\r\n  ) {\r\n    if (isValidStyle(operator)) {\r\n      defaultPathOperation = operator;\r\n    }\r\n    return this;\r\n  };\r\n\r\n  var getStyle = (API.__private__.getStyle = API.getStyle = function(style) {\r\n    // see path-painting operators in PDF spec\r\n    var op = defaultPathOperation; // stroke\r\n\r\n    switch (style) {\r\n      case \"D\":\r\n      case \"S\":\r\n        op = \"S\"; // stroke\r\n        break;\r\n      case \"F\":\r\n        op = \"f\"; // fill\r\n        break;\r\n      case \"FD\":\r\n      case \"DF\":\r\n        op = \"B\";\r\n        break;\r\n      case \"f\":\r\n      case \"f*\":\r\n      case \"B\":\r\n      case \"B*\":\r\n        /*\r\n               Allow direct use of these PDF path-painting operators:\r\n               - f    fill using nonzero winding number rule\r\n               - f*    fill using even-odd rule\r\n               - B    fill then stroke with fill using non-zero winding number rule\r\n               - B*    fill then stroke with fill using even-odd rule\r\n               */\r\n        op = style;\r\n        break;\r\n    }\r\n    return op;\r\n  });\r\n\r\n  /**\r\n   * Close the current path. The PDF \"h\" operator.\r\n   * @name close\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   */\r\n  var close = (API.close = function() {\r\n    out(\"h\");\r\n    return this;\r\n  });\r\n\r\n  /**\r\n   * Stroke the path. The PDF \"S\" operator.\r\n   * @name stroke\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   */\r\n  API.stroke = function() {\r\n    out(\"S\");\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Fill the current path using the nonzero winding number rule. If a pattern is provided, the path will be filled\r\n   * with this pattern, otherwise with the current fill color. Equivalent to the PDF \"f\" operator.\r\n   * @name fill\r\n   * @function\r\n   * @instance\r\n   * @param {PatternData=} pattern If provided the path will be filled with this pattern\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   */\r\n  API.fill = function(pattern) {\r\n    fillWithOptionalPattern(\"f\", pattern);\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Fill the current path using the even-odd rule. The PDF f* operator.\r\n   * @see API.fill\r\n   * @name fillEvenOdd\r\n   * @function\r\n   * @instance\r\n   * @param {PatternData=} pattern If provided the path will be filled with this pattern\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   */\r\n  API.fillEvenOdd = function(pattern) {\r\n    fillWithOptionalPattern(\"f*\", pattern);\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Fill using the nonzero winding number rule and then stroke the current Path. The PDF \"B\" operator.\r\n   * @see API.fill\r\n   * @name fillStroke\r\n   * @function\r\n   * @instance\r\n   * @param {PatternData=} pattern If provided the path will be stroked with this pattern\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   */\r\n  API.fillStroke = function(pattern) {\r\n    fillWithOptionalPattern(\"B\", pattern);\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Fill using the even-odd rule and then stroke the current Path. The PDF \"B\" operator.\r\n   * @see API.fill\r\n   * @name fillStrokeEvenOdd\r\n   * @function\r\n   * @instance\r\n   * @param {PatternData=} pattern If provided the path will be fill-stroked with this pattern\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   */\r\n  API.fillStrokeEvenOdd = function(pattern) {\r\n    fillWithOptionalPattern(\"B*\", pattern);\r\n    return this;\r\n  };\r\n\r\n  var fillWithOptionalPattern = function(style, pattern) {\r\n    if (typeof pattern === \"object\") {\r\n      fillWithPattern(pattern, style);\r\n    } else {\r\n      out(style);\r\n    }\r\n  };\r\n\r\n  var putStyle = function(style) {\r\n    if (\r\n      style === null ||\r\n      (apiMode === ApiMode.ADVANCED && style === undefined)\r\n    ) {\r\n      return;\r\n    }\r\n\r\n    style = getStyle(style);\r\n\r\n    // stroking / filling / both the path\r\n    out(style);\r\n  };\r\n\r\n  function cloneTilingPattern(patternKey, boundingBox, xStep, yStep, matrix) {\r\n    var clone = new TilingPattern(\r\n      boundingBox || this.boundingBox,\r\n      xStep || this.xStep,\r\n      yStep || this.yStep,\r\n      this.gState,\r\n      matrix || this.matrix\r\n    );\r\n    clone.stream = this.stream;\r\n    var key = patternKey + \"$$\" + this.cloneIndex++ + \"$$\";\r\n    addPattern(key, clone);\r\n    return clone;\r\n  }\r\n\r\n  var fillWithPattern = function(patternData, style) {\r\n    var patternId = patternMap[patternData.key];\r\n    var pattern = patterns[patternId];\r\n\r\n    if (pattern instanceof ShadingPattern) {\r\n      out(\"q\");\r\n\r\n      out(clipRuleFromStyle(style));\r\n\r\n      if (pattern.gState) {\r\n        API.setGState(pattern.gState);\r\n      }\r\n      out(patternData.matrix.toString() + \" cm\");\r\n      out(\"/\" + patternId + \" sh\");\r\n      out(\"Q\");\r\n    } else if (pattern instanceof TilingPattern) {\r\n      // pdf draws patterns starting at the bottom left corner and they are not affected by the global transformation,\r\n      // so we must flip them\r\n      var matrix = new Matrix(1, 0, 0, -1, 0, getPageHeight());\r\n\r\n      if (patternData.matrix) {\r\n        matrix = matrix.multiply(patternData.matrix || identityMatrix);\r\n        // we cannot apply a matrix to the pattern on use so we must abuse the pattern matrix and create new instances\r\n        // for each use\r\n        patternId = cloneTilingPattern.call(\r\n          pattern,\r\n          patternData.key,\r\n          patternData.boundingBox,\r\n          patternData.xStep,\r\n          patternData.yStep,\r\n          matrix\r\n        ).id;\r\n      }\r\n\r\n      out(\"q\");\r\n      out(\"/Pattern cs\");\r\n      out(\"/\" + patternId + \" scn\");\r\n\r\n      if (pattern.gState) {\r\n        API.setGState(pattern.gState);\r\n      }\r\n\r\n      out(style);\r\n      out(\"Q\");\r\n    }\r\n  };\r\n\r\n  var clipRuleFromStyle = function(style) {\r\n    switch (style) {\r\n      case \"f\":\r\n      case \"F\":\r\n        return \"W n\";\r\n      case \"f*\":\r\n        return \"W* n\";\r\n      case \"B\":\r\n        return \"W S\";\r\n      case \"B*\":\r\n        return \"W* S\";\r\n\r\n      // these two are for compatibility reasons (in the past, calling any primitive method with a shading pattern\r\n      // and \"n\"/\"S\" as style would still fill/fill and stroke the path)\r\n      case \"S\":\r\n        return \"W S\";\r\n      case \"n\":\r\n        return \"W n\";\r\n    }\r\n  };\r\n\r\n  /**\r\n   * Begin a new subpath by moving the current point to coordinates (x, y). The PDF \"m\" operator.\r\n   * @param {number} x\r\n   * @param {number} y\r\n   * @name moveTo\r\n   * @function\r\n   * @instance\r\n   * @memberof jsPDF#\r\n   * @returns {jsPDF}\r\n   */\r\n  var moveTo = (API.moveTo = function(x, y) {\r\n    out(hpf(scale(x)) + \" \" + hpf(transformScaleY(y)) + \" m\");\r\n    return this;\r\n  });\r\n\r\n  /**\r\n   * Append a straight line segment from the current point to the point (x, y). The PDF \"l\" operator.\r\n   * @param {number} x\r\n   * @param {number} y\r\n   * @memberof jsPDF#\r\n   * @name lineTo\r\n   * @function\r\n   * @instance\r\n   * @memberof jsPDF#\r\n   * @returns {jsPDF}\r\n   */\r\n  var lineTo = (API.lineTo = function(x, y) {\r\n    out(hpf(scale(x)) + \" \" + hpf(transformScaleY(y)) + \" l\");\r\n    return this;\r\n  });\r\n\r\n  /**\r\n   * Append a cubic Bézier curve to the current path. The curve shall extend from the current point to the point\r\n   * (x3, y3), using (x1, y1) and (x2, y2) as Bézier control points. The new current point shall be (x3, x3).\r\n   * @param {number} x1\r\n   * @param {number} y1\r\n   * @param {number} x2\r\n   * @param {number} y2\r\n   * @param {number} x3\r\n   * @param {number} y3\r\n   * @memberof jsPDF#\r\n   * @name curveTo\r\n   * @function\r\n   * @instance\r\n   * @memberof jsPDF#\r\n   * @returns {jsPDF}\r\n   */\r\n  var curveTo = (API.curveTo = function(x1, y1, x2, y2, x3, y3) {\r\n    out(\r\n      [\r\n        hpf(scale(x1)),\r\n        hpf(transformScaleY(y1)),\r\n        hpf(scale(x2)),\r\n        hpf(transformScaleY(y2)),\r\n        hpf(scale(x3)),\r\n        hpf(transformScaleY(y3)),\r\n        \"c\"\r\n      ].join(\" \")\r\n    );\r\n    return this;\r\n  });\r\n\r\n  /**\r\n   * Draw a line on the current page.\r\n   *\r\n   * @name line\r\n   * @function\r\n   * @instance\r\n   * @param {number} x1\r\n   * @param {number} y1\r\n   * @param {number} x2\r\n   * @param {number} y2\r\n   * @param {string} style A string specifying the painting style or null.  Valid styles include: 'S' [default] - stroke, 'F' - fill,  and 'DF' (or 'FD') -  fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument. default: 'S'\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   */\r\n  API.__private__.line = API.line = function(x1, y1, x2, y2, style) {\r\n    if (\r\n      isNaN(x1) ||\r\n      isNaN(y1) ||\r\n      isNaN(x2) ||\r\n      isNaN(y2) ||\r\n      !isValidStyle(style)\r\n    ) {\r\n      throw new Error(\"Invalid arguments passed to jsPDF.line\");\r\n    }\r\n    if (apiMode === ApiMode.COMPAT) {\r\n      return this.lines([[x2 - x1, y2 - y1]], x1, y1, [1, 1], style || \"S\");\r\n    } else {\r\n      return this.lines([[x2 - x1, y2 - y1]], x1, y1, [1, 1]).stroke();\r\n    }\r\n  };\r\n\r\n  /**\r\n   * @typedef {Object} PatternData\r\n   * {Matrix|undefined} matrix\r\n   * {Number|undefined} xStep\r\n   * {Number|undefined} yStep\r\n   * {Array.<Number>|undefined} boundingBox\r\n   */\r\n\r\n  /**\r\n   * Adds series of curves (straight lines or cubic bezier curves) to canvas, starting at `x`, `y` coordinates.\r\n   * All data points in `lines` are relative to last line origin.\r\n   * `x`, `y` become x1,y1 for first line / curve in the set.\r\n   * For lines you only need to specify [x2, y2] - (ending point) vector against x1, y1 starting point.\r\n   * For bezier curves you need to specify [x2,y2,x3,y3,x4,y4] - vectors to control points 1, 2, ending point. All vectors are against the start of the curve - x1,y1.\r\n   *\r\n   * @example .lines([[2,2],[-2,2],[1,1,2,2,3,3],[2,1]], 212,110, [1,1], 'F', false) // line, line, bezier curve, line\r\n   * @param {Array} lines Array of *vector* shifts as pairs (lines) or sextets (cubic bezier curves).\r\n   * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page\r\n   * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page\r\n   * @param {number} scale (Defaults to [1.0,1.0]) x,y Scaling factor for all vectors. Elements can be any floating number Sub-one makes drawing smaller. Over-one grows the drawing. Negative flips the direction.\r\n   * @param {string=} style A string specifying the painting style or null. Valid styles include:\r\n   * 'S' [default] - stroke,\r\n   * 'F' - fill,\r\n   * and 'DF' (or 'FD') -  fill then stroke.\r\n   * In \"compat\" API mode, a null value postpones setting the style so that a shape may be composed using multiple\r\n   * method calls. The last drawing method call used to define the shape should not have a null style argument.\r\n   *\r\n   * In \"advanced\" API mode this parameter is deprecated.\r\n   * @param {Boolean=} closed If true, the path is closed with a straight line from the end of the last curve to the starting point.\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name lines\r\n   */\r\n  API.__private__.lines = API.lines = function(\r\n    lines,\r\n    x,\r\n    y,\r\n    scale,\r\n    style,\r\n    closed\r\n  ) {\r\n    var scalex, scaley, i, l, leg, x2, y2, x3, y3, x4, y4, tmp;\r\n\r\n    // Pre-August-2012 the order of arguments was function(x, y, lines, scale, style)\r\n    // in effort to make all calls have similar signature like\r\n    //   function(content, coordinateX, coordinateY , miscellaneous)\r\n    // this method had its args flipped.\r\n    // code below allows backward compatibility with old arg order.\r\n    if (typeof lines === \"number\") {\r\n      tmp = y;\r\n      y = x;\r\n      x = lines;\r\n      lines = tmp;\r\n    }\r\n\r\n    scale = scale || [1, 1];\r\n    closed = closed || false;\r\n\r\n    if (\r\n      isNaN(x) ||\r\n      isNaN(y) ||\r\n      !Array.isArray(lines) ||\r\n      !Array.isArray(scale) ||\r\n      !isValidStyle(style) ||\r\n      typeof closed !== \"boolean\"\r\n    ) {\r\n      throw new Error(\"Invalid arguments passed to jsPDF.lines\");\r\n    }\r\n\r\n    // starting point\r\n    moveTo(x, y);\r\n\r\n    scalex = scale[0];\r\n    scaley = scale[1];\r\n    l = lines.length;\r\n    //, x2, y2 // bezier only. In page default measurement \"units\", *after* scaling\r\n    //, x3, y3 // bezier only. In page default measurement \"units\", *after* scaling\r\n    // ending point for all, lines and bezier. . In page default measurement \"units\", *after* scaling\r\n    x4 = x; // last / ending point = starting point for first item.\r\n    y4 = y; // last / ending point = starting point for first item.\r\n\r\n    for (i = 0; i < l; i++) {\r\n      leg = lines[i];\r\n      if (leg.length === 2) {\r\n        // simple line\r\n        x4 = leg[0] * scalex + x4; // here last x4 was prior ending point\r\n        y4 = leg[1] * scaley + y4; // here last y4 was prior ending point\r\n        lineTo(x4, y4);\r\n      } else {\r\n        // bezier curve\r\n        x2 = leg[0] * scalex + x4; // here last x4 is prior ending point\r\n        y2 = leg[1] * scaley + y4; // here last y4 is prior ending point\r\n        x3 = leg[2] * scalex + x4; // here last x4 is prior ending point\r\n        y3 = leg[3] * scaley + y4; // here last y4 is prior ending point\r\n        x4 = leg[4] * scalex + x4; // here last x4 was prior ending point\r\n        y4 = leg[5] * scaley + y4; // here last y4 was prior ending point\r\n        curveTo(x2, y2, x3, y3, x4, y4);\r\n      }\r\n    }\r\n\r\n    if (closed) {\r\n      close();\r\n    }\r\n\r\n    putStyle(style);\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Similar to {@link API.lines} but all coordinates are interpreted as absolute coordinates instead of relative.\r\n   * @param {Array<Object>} lines An array of {op: operator, c: coordinates} object, where op is one of \"m\" (move to), \"l\" (line to)\r\n   * \"c\" (cubic bezier curve) and \"h\" (close (sub)path)). c is an array of coordinates. \"m\" and \"l\" expect two, \"c\"\r\n   * six and \"h\" an empty array (or undefined).\r\n   * @function\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name path\r\n   */\r\n  API.path = function(lines) {\r\n    for (var i = 0; i < lines.length; i++) {\r\n      var leg = lines[i];\r\n      var coords = leg.c;\r\n      switch (leg.op) {\r\n        case \"m\":\r\n          moveTo(coords[0], coords[1]);\r\n          break;\r\n        case \"l\":\r\n          lineTo(coords[0], coords[1]);\r\n          break;\r\n        case \"c\":\r\n          curveTo.apply(this, coords);\r\n          break;\r\n        case \"h\":\r\n          close();\r\n          break;\r\n      }\r\n    }\r\n\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Adds a rectangle to PDF.\r\n   *\r\n   * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page\r\n   * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page\r\n   * @param {number} w Width (in units declared at inception of PDF document)\r\n   * @param {number} h Height (in units declared at inception of PDF document)\r\n   * @param {string=} style A string specifying the painting style or null. Valid styles include:\r\n   * 'S' [default] - stroke,\r\n   * 'F' - fill,\r\n   * and 'DF' (or 'FD') -  fill then stroke.\r\n   * In \"compat\" API mode, a null value postpones setting the style so that a shape may be composed using multiple\r\n   * method calls. The last drawing method call used to define the shape should not have a null style argument.\r\n   *\r\n   * In \"advanced\" API mode this parameter is deprecated.\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name rect\r\n   */\r\n  API.__private__.rect = API.rect = function(x, y, w, h, style) {\r\n    if (isNaN(x) || isNaN(y) || isNaN(w) || isNaN(h) || !isValidStyle(style)) {\r\n      throw new Error(\"Invalid arguments passed to jsPDF.rect\");\r\n    }\r\n    if (apiMode === ApiMode.COMPAT) {\r\n      h = -h;\r\n    }\r\n\r\n    out(\r\n      [\r\n        hpf(scale(x)),\r\n        hpf(transformScaleY(y)),\r\n        hpf(scale(w)),\r\n        hpf(scale(h)),\r\n        \"re\"\r\n      ].join(\" \")\r\n    );\r\n\r\n    putStyle(style);\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Adds a triangle to PDF.\r\n   *\r\n   * @param {number} x1 Coordinate (in units declared at inception of PDF document) against left edge of the page\r\n   * @param {number} y1 Coordinate (in units declared at inception of PDF document) against upper edge of the page\r\n   * @param {number} x2 Coordinate (in units declared at inception of PDF document) against left edge of the page\r\n   * @param {number} y2 Coordinate (in units declared at inception of PDF document) against upper edge of the page\r\n   * @param {number} x3 Coordinate (in units declared at inception of PDF document) against left edge of the page\r\n   * @param {number} y3 Coordinate (in units declared at inception of PDF document) against upper edge of the page\r\n   * @param {string=} style A string specifying the painting style or null. Valid styles include:\r\n   * 'S' [default] - stroke,\r\n   * 'F' - fill,\r\n   * and 'DF' (or 'FD') -  fill then stroke.\r\n   * In \"compat\" API mode, a null value postpones setting the style so that a shape may be composed using multiple\r\n   * method calls. The last drawing method call used to define the shape should not have a null style argument.\r\n   *\r\n   * In \"advanced\" API mode this parameter is deprecated.\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name triangle\r\n   */\r\n  API.__private__.triangle = API.triangle = function(\r\n    x1,\r\n    y1,\r\n    x2,\r\n    y2,\r\n    x3,\r\n    y3,\r\n    style\r\n  ) {\r\n    if (\r\n      isNaN(x1) ||\r\n      isNaN(y1) ||\r\n      isNaN(x2) ||\r\n      isNaN(y2) ||\r\n      isNaN(x3) ||\r\n      isNaN(y3) ||\r\n      !isValidStyle(style)\r\n    ) {\r\n      throw new Error(\"Invalid arguments passed to jsPDF.triangle\");\r\n    }\r\n    this.lines(\r\n      [\r\n        [x2 - x1, y2 - y1], // vector to point 2\r\n        [x3 - x2, y3 - y2], // vector to point 3\r\n        [x1 - x3, y1 - y3] // closing vector back to point 1\r\n      ],\r\n      x1,\r\n      y1, // start of path\r\n      [1, 1],\r\n      style,\r\n      true\r\n    );\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Adds a rectangle with rounded corners to PDF.\r\n   *\r\n   * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page\r\n   * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page\r\n   * @param {number} w Width (in units declared at inception of PDF document)\r\n   * @param {number} h Height (in units declared at inception of PDF document)\r\n   * @param {number} rx Radius along x axis (in units declared at inception of PDF document)\r\n   * @param {number} ry Radius along y axis (in units declared at inception of PDF document)\r\n   * @param {string=} style A string specifying the painting style or null. Valid styles include:\r\n   * 'S' [default] - stroke,\r\n   * 'F' - fill,\r\n   * and 'DF' (or 'FD') -  fill then stroke.\r\n   * In \"compat\" API mode, a null value postpones setting the style so that a shape may be composed using multiple\r\n   * method calls. The last drawing method call used to define the shape should not have a null style argument.\r\n   *\r\n   * In \"advanced\" API mode this parameter is deprecated.\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name roundedRect\r\n   */\r\n  API.__private__.roundedRect = API.roundedRect = function(\r\n    x,\r\n    y,\r\n    w,\r\n    h,\r\n    rx,\r\n    ry,\r\n    style\r\n  ) {\r\n    if (\r\n      isNaN(x) ||\r\n      isNaN(y) ||\r\n      isNaN(w) ||\r\n      isNaN(h) ||\r\n      isNaN(rx) ||\r\n      isNaN(ry) ||\r\n      !isValidStyle(style)\r\n    ) {\r\n      throw new Error(\"Invalid arguments passed to jsPDF.roundedRect\");\r\n    }\r\n    var MyArc = (4 / 3) * (Math.SQRT2 - 1);\r\n\r\n    rx = Math.min(rx, w * 0.5);\r\n    ry = Math.min(ry, h * 0.5);\r\n\r\n    this.lines(\r\n      [\r\n        [w - 2 * rx, 0],\r\n        [rx * MyArc, 0, rx, ry - ry * MyArc, rx, ry],\r\n        [0, h - 2 * ry],\r\n        [0, ry * MyArc, -(rx * MyArc), ry, -rx, ry],\r\n        [-w + 2 * rx, 0],\r\n        [-(rx * MyArc), 0, -rx, -(ry * MyArc), -rx, -ry],\r\n        [0, -h + 2 * ry],\r\n        [0, -(ry * MyArc), rx * MyArc, -ry, rx, -ry]\r\n      ],\r\n      x + rx,\r\n      y, // start of path\r\n      [1, 1],\r\n      style,\r\n      true\r\n    );\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Adds an ellipse to PDF.\r\n   *\r\n   * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page\r\n   * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page\r\n   * @param {number} rx Radius along x axis (in units declared at inception of PDF document)\r\n   * @param {number} ry Radius along y axis (in units declared at inception of PDF document)\r\n   * @param {string=} style A string specifying the painting style or null. Valid styles include:\r\n   * 'S' [default] - stroke,\r\n   * 'F' - fill,\r\n   * and 'DF' (or 'FD') -  fill then stroke.\r\n   * In \"compat\" API mode, a null value postpones setting the style so that a shape may be composed using multiple\r\n   * method calls. The last drawing method call used to define the shape should not have a null style argument.\r\n   *\r\n   * In \"advanced\" API mode this parameter is deprecated.\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name ellipse\r\n   */\r\n  API.__private__.ellipse = API.ellipse = function(x, y, rx, ry, style) {\r\n    if (\r\n      isNaN(x) ||\r\n      isNaN(y) ||\r\n      isNaN(rx) ||\r\n      isNaN(ry) ||\r\n      !isValidStyle(style)\r\n    ) {\r\n      throw new Error(\"Invalid arguments passed to jsPDF.ellipse\");\r\n    }\r\n    var lx = (4 / 3) * (Math.SQRT2 - 1) * rx,\r\n      ly = (4 / 3) * (Math.SQRT2 - 1) * ry;\r\n\r\n    moveTo(x + rx, y);\r\n    curveTo(x + rx, y - ly, x + lx, y - ry, x, y - ry);\r\n    curveTo(x - lx, y - ry, x - rx, y - ly, x - rx, y);\r\n    curveTo(x - rx, y + ly, x - lx, y + ry, x, y + ry);\r\n    curveTo(x + lx, y + ry, x + rx, y + ly, x + rx, y);\r\n\r\n    putStyle(style);\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Adds an circle to PDF.\r\n   *\r\n   * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page\r\n   * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page\r\n   * @param {number} r Radius (in units declared at inception of PDF document)\r\n   * @param {string=} style A string specifying the painting style or null. Valid styles include:\r\n   * 'S' [default] - stroke,\r\n   * 'F' - fill,\r\n   * and 'DF' (or 'FD') -  fill then stroke.\r\n   * In \"compat\" API mode, a null value postpones setting the style so that a shape may be composed using multiple\r\n   * method calls. The last drawing method call used to define the shape should not have a null style argument.\r\n   *\r\n   * In \"advanced\" API mode this parameter is deprecated.\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name circle\r\n   */\r\n  API.__private__.circle = API.circle = function(x, y, r, style) {\r\n    if (isNaN(x) || isNaN(y) || isNaN(r) || !isValidStyle(style)) {\r\n      throw new Error(\"Invalid arguments passed to jsPDF.circle\");\r\n    }\r\n    return this.ellipse(x, y, r, r, style);\r\n  };\r\n\r\n  /**\r\n   * Sets text font face, variant for upcoming text elements.\r\n   * See output of jsPDF.getFontList() for possible font names, styles.\r\n   *\r\n   * @param {string} fontName Font name or family. Example: \"times\".\r\n   * @param {string} fontStyle Font style or variant. Example: \"italic\".\r\n   * @param {number | string} fontWeight Weight of the Font. Example: \"normal\" | 400\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name setFont\r\n   */\r\n  API.setFont = function(fontName, fontStyle, fontWeight) {\r\n    if (fontWeight) {\r\n      fontStyle = combineFontStyleAndFontWeight(fontStyle, fontWeight);\r\n    }\r\n    activeFontKey = getFont(fontName, fontStyle, {\r\n      disableWarning: false\r\n    });\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Gets text font face, variant for upcoming text elements.\r\n   *\r\n   * @function\r\n   * @instance\r\n   * @returns {Object}\r\n   * @memberof jsPDF#\r\n   * @name getFont\r\n   */\r\n  var getFontEntry = (API.__private__.getFont = API.getFont = function() {\r\n    return fonts[getFont.apply(API, arguments)];\r\n  });\r\n\r\n  /**\r\n   * Returns an object - a tree of fontName to fontStyle relationships available to\r\n   * active PDF document.\r\n   *\r\n   * @public\r\n   * @function\r\n   * @instance\r\n   * @returns {Object} Like {'times':['normal', 'italic', ... ], 'arial':['normal', 'bold', ... ], ... }\r\n   * @memberof jsPDF#\r\n   * @name getFontList\r\n   */\r\n  API.__private__.getFontList = API.getFontList = function() {\r\n    var list = {},\r\n      fontName,\r\n      fontStyle;\r\n\r\n    for (fontName in fontmap) {\r\n      if (fontmap.hasOwnProperty(fontName)) {\r\n        list[fontName] = [];\r\n        for (fontStyle in fontmap[fontName]) {\r\n          if (fontmap[fontName].hasOwnProperty(fontStyle)) {\r\n            list[fontName].push(fontStyle);\r\n          }\r\n        }\r\n      }\r\n    }\r\n    return list;\r\n  };\r\n\r\n  /**\r\n   * Add a custom font to the current instance.\r\n   *\r\n   * @param {string} postScriptName PDF specification full name for the font.\r\n   * @param {string} id PDF-document-instance-specific label assinged to the font.\r\n   * @param {string} fontStyle Style of the Font.\r\n   * @param {number | string} fontWeight Weight of the Font.\r\n   * @param {Object} encoding Encoding_name-to-Font_metrics_object mapping.\r\n   * @function\r\n   * @instance\r\n   * @memberof jsPDF#\r\n   * @name addFont\r\n   * @returns {string} fontId\r\n   */\r\n  API.addFont = function(\r\n    postScriptName,\r\n    fontName,\r\n    fontStyle,\r\n    fontWeight,\r\n    encoding\r\n  ) {\r\n    var encodingOptions = [\r\n      \"StandardEncoding\",\r\n      \"MacRomanEncoding\",\r\n      \"Identity-H\",\r\n      \"WinAnsiEncoding\"\r\n    ];\r\n    if (arguments[3] && encodingOptions.indexOf(arguments[3]) !== -1) {\r\n      //IE 11 fix\r\n      encoding = arguments[3];\r\n    } else if (arguments[3] && encodingOptions.indexOf(arguments[3]) == -1) {\r\n      fontStyle = combineFontStyleAndFontWeight(fontStyle, fontWeight);\r\n    }\r\n    encoding = encoding || \"Identity-H\";\r\n    return addFont.call(this, postScriptName, fontName, fontStyle, encoding);\r\n  };\r\n\r\n  var lineWidth = options.lineWidth || 0.200025; // 2mm\r\n  /**\r\n   * Gets the line width, default: 0.200025.\r\n   *\r\n   * @function\r\n   * @instance\r\n   * @returns {number} lineWidth\r\n   * @memberof jsPDF#\r\n   * @name getLineWidth\r\n   */\r\n  var getLineWidth = (API.__private__.getLineWidth = API.getLineWidth = function() {\r\n    return lineWidth;\r\n  });\r\n\r\n  /**\r\n   * Sets line width for upcoming lines.\r\n   *\r\n   * @param {number} width Line width (in units declared at inception of PDF document).\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name setLineWidth\r\n   */\r\n  var setLineWidth = (API.__private__.setLineWidth = API.setLineWidth = function(\r\n    width\r\n  ) {\r\n    lineWidth = width;\r\n    out(hpf(scale(width)) + \" w\");\r\n    return this;\r\n  });\r\n\r\n  /**\r\n   * Sets the dash pattern for upcoming lines.\r\n   *\r\n   * To reset the settings simply call the method without any parameters.\r\n   * @param {Array<number>} dashArray An array containing 0-2 numbers. The first number sets the length of the\r\n   * dashes, the second number the length of the gaps. If the second number is missing, the gaps are considered\r\n   * to be as long as the dashes. An empty array means solid, unbroken lines.\r\n   * @param {number} dashPhase The phase lines start with.\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name setLineDashPattern\r\n   */\r\n  API.__private__.setLineDash = jsPDF.API.setLineDash = jsPDF.API.setLineDashPattern = function(\r\n    dashArray,\r\n    dashPhase\r\n  ) {\r\n    dashArray = dashArray || [];\r\n    dashPhase = dashPhase || 0;\r\n\r\n    if (isNaN(dashPhase) || !Array.isArray(dashArray)) {\r\n      throw new Error(\"Invalid arguments passed to jsPDF.setLineDash\");\r\n    }\r\n\r\n    dashArray = dashArray\r\n      .map(function(x) {\r\n        return hpf(scale(x));\r\n      })\r\n      .join(\" \");\r\n    dashPhase = hpf(scale(dashPhase));\r\n\r\n    out(\"[\" + dashArray + \"] \" + dashPhase + \" d\");\r\n    return this;\r\n  };\r\n\r\n  var lineHeightFactor;\r\n\r\n  var getLineHeight = (API.__private__.getLineHeight = API.getLineHeight = function() {\r\n    return activeFontSize * lineHeightFactor;\r\n  });\r\n\r\n  API.__private__.getLineHeight = API.getLineHeight = function() {\r\n    return activeFontSize * lineHeightFactor;\r\n  };\r\n\r\n  /**\r\n   * Sets the LineHeightFactor of proportion.\r\n   *\r\n   * @param {number} value LineHeightFactor value. Default: 1.15.\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name setLineHeightFactor\r\n   */\r\n  var setLineHeightFactor = (API.__private__.setLineHeightFactor = API.setLineHeightFactor = function(\r\n    value\r\n  ) {\r\n    value = value || 1.15;\r\n    if (typeof value === \"number\") {\r\n      lineHeightFactor = value;\r\n    }\r\n    return this;\r\n  });\r\n\r\n  /**\r\n   * Gets the LineHeightFactor, default: 1.15.\r\n   *\r\n   * @function\r\n   * @instance\r\n   * @returns {number} lineHeightFactor\r\n   * @memberof jsPDF#\r\n   * @name getLineHeightFactor\r\n   */\r\n  var getLineHeightFactor = (API.__private__.getLineHeightFactor = API.getLineHeightFactor = function() {\r\n    return lineHeightFactor;\r\n  });\r\n\r\n  setLineHeightFactor(options.lineHeight);\r\n\r\n  var getHorizontalCoordinate = (API.__private__.getHorizontalCoordinate = function(\r\n    value\r\n  ) {\r\n    return scale(value);\r\n  });\r\n\r\n  var getVerticalCoordinate = (API.__private__.getVerticalCoordinate = function(\r\n    value\r\n  ) {\r\n    if (apiMode === ApiMode.ADVANCED) {\r\n      return value;\r\n    } else {\r\n      var pageHeight =\r\n        pagesContext[currentPage].mediaBox.topRightY -\r\n        pagesContext[currentPage].mediaBox.bottomLeftY;\r\n      return pageHeight - scale(value);\r\n    }\r\n  });\r\n\r\n  var getHorizontalCoordinateString = (API.__private__.getHorizontalCoordinateString = API.getHorizontalCoordinateString = function(\r\n    value\r\n  ) {\r\n    return hpf(getHorizontalCoordinate(value));\r\n  });\r\n\r\n  var getVerticalCoordinateString = (API.__private__.getVerticalCoordinateString = API.getVerticalCoordinateString = function(\r\n    value\r\n  ) {\r\n    return hpf(getVerticalCoordinate(value));\r\n  });\r\n\r\n  var strokeColor = options.strokeColor || \"0 G\";\r\n\r\n  /**\r\n   *  Gets the stroke color for upcoming elements.\r\n   *\r\n   * @function\r\n   * @instance\r\n   * @returns {string} colorAsHex\r\n   * @memberof jsPDF#\r\n   * @name getDrawColor\r\n   */\r\n  API.__private__.getStrokeColor = API.getDrawColor = function() {\r\n    return decodeColorString(strokeColor);\r\n  };\r\n\r\n  /**\r\n   * Sets the stroke color for upcoming elements.\r\n   *\r\n   * Depending on the number of arguments given, Gray, RGB, or CMYK\r\n   * color space is implied.\r\n   *\r\n   * When only ch1 is given, \"Gray\" color space is implied and it\r\n   * must be a value in the range from 0.00 (solid black) to to 1.00 (white)\r\n   * if values are communicated as String types, or in range from 0 (black)\r\n   * to 255 (white) if communicated as Number type.\r\n   * The RGB-like 0-255 range is provided for backward compatibility.\r\n   *\r\n   * When only ch1,ch2,ch3 are given, \"RGB\" color space is implied and each\r\n   * value must be in the range from 0.00 (minimum intensity) to to 1.00\r\n   * (max intensity) if values are communicated as String types, or\r\n   * from 0 (min intensity) to to 255 (max intensity) if values are communicated\r\n   * as Number types.\r\n   * The RGB-like 0-255 range is provided for backward compatibility.\r\n   *\r\n   * When ch1,ch2,ch3,ch4 are given, \"CMYK\" color space is implied and each\r\n   * value must be a in the range from 0.00 (0% concentration) to to\r\n   * 1.00 (100% concentration)\r\n   *\r\n   * Because JavaScript treats fixed point numbers badly (rounds to\r\n   * floating point nearest to binary representation) it is highly advised to\r\n   * communicate the fractional numbers as String types, not JavaScript Number type.\r\n   *\r\n   * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'.\r\n   * @param {Number} ch2 Color channel value.\r\n   * @param {Number} ch3 Color channel value.\r\n   * @param {Number} ch4 Color channel value.\r\n   *\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name setDrawColor\r\n   */\r\n  API.__private__.setStrokeColor = API.setDrawColor = function(\r\n    ch1,\r\n    ch2,\r\n    ch3,\r\n    ch4\r\n  ) {\r\n    var options = {\r\n      ch1: ch1,\r\n      ch2: ch2,\r\n      ch3: ch3,\r\n      ch4: ch4,\r\n      pdfColorType: \"draw\",\r\n      precision: 2\r\n    };\r\n\r\n    strokeColor = encodeColorString(options);\r\n    out(strokeColor);\r\n    return this;\r\n  };\r\n\r\n  var fillColor = options.fillColor || \"0 g\";\r\n\r\n  /**\r\n   * Gets the fill color for upcoming elements.\r\n   *\r\n   * @function\r\n   * @instance\r\n   * @returns {string} colorAsHex\r\n   * @memberof jsPDF#\r\n   * @name getFillColor\r\n   */\r\n  API.__private__.getFillColor = API.getFillColor = function() {\r\n    return decodeColorString(fillColor);\r\n  };\r\n\r\n  /**\r\n   * Sets the fill color for upcoming elements.\r\n   *\r\n   * Depending on the number of arguments given, Gray, RGB, or CMYK\r\n   * color space is implied.\r\n   *\r\n   * When only ch1 is given, \"Gray\" color space is implied and it\r\n   * must be a value in the range from 0.00 (solid black) to to 1.00 (white)\r\n   * if values are communicated as String types, or in range from 0 (black)\r\n   * to 255 (white) if communicated as Number type.\r\n   * The RGB-like 0-255 range is provided for backward compatibility.\r\n   *\r\n   * When only ch1,ch2,ch3 are given, \"RGB\" color space is implied and each\r\n   * value must be in the range from 0.00 (minimum intensity) to to 1.00\r\n   * (max intensity) if values are communicated as String types, or\r\n   * from 0 (min intensity) to to 255 (max intensity) if values are communicated\r\n   * as Number types.\r\n   * The RGB-like 0-255 range is provided for backward compatibility.\r\n   *\r\n   * When ch1,ch2,ch3,ch4 are given, \"CMYK\" color space is implied and each\r\n   * value must be a in the range from 0.00 (0% concentration) to to\r\n   * 1.00 (100% concentration)\r\n   *\r\n   * Because JavaScript treats fixed point numbers badly (rounds to\r\n   * floating point nearest to binary representation) it is highly advised to\r\n   * communicate the fractional numbers as String types, not JavaScript Number type.\r\n   *\r\n   * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'.\r\n   * @param {Number} ch2 Color channel value.\r\n   * @param {Number} ch3 Color channel value.\r\n   * @param {Number} ch4 Color channel value.\r\n   *\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name setFillColor\r\n   */\r\n  API.__private__.setFillColor = API.setFillColor = function(\r\n    ch1,\r\n    ch2,\r\n    ch3,\r\n    ch4\r\n  ) {\r\n    var options = {\r\n      ch1: ch1,\r\n      ch2: ch2,\r\n      ch3: ch3,\r\n      ch4: ch4,\r\n      pdfColorType: \"fill\",\r\n      precision: 2\r\n    };\r\n\r\n    fillColor = encodeColorString(options);\r\n    out(fillColor);\r\n    return this;\r\n  };\r\n\r\n  var textColor = options.textColor || \"0 g\";\r\n  /**\r\n   * Gets the text color for upcoming elements.\r\n   *\r\n   * @function\r\n   * @instance\r\n   * @returns {string} colorAsHex\r\n   * @memberof jsPDF#\r\n   * @name getTextColor\r\n   */\r\n  var getTextColor = (API.__private__.getTextColor = API.getTextColor = function() {\r\n    return decodeColorString(textColor);\r\n  });\r\n  /**\r\n   * Sets the text color for upcoming elements.\r\n   *\r\n   * Depending on the number of arguments given, Gray, RGB, or CMYK\r\n   * color space is implied.\r\n   *\r\n   * When only ch1 is given, \"Gray\" color space is implied and it\r\n   * must be a value in the range from 0.00 (solid black) to to 1.00 (white)\r\n   * if values are communicated as String types, or in range from 0 (black)\r\n   * to 255 (white) if communicated as Number type.\r\n   * The RGB-like 0-255 range is provided for backward compatibility.\r\n   *\r\n   * When only ch1,ch2,ch3 are given, \"RGB\" color space is implied and each\r\n   * value must be in the range from 0.00 (minimum intensity) to to 1.00\r\n   * (max intensity) if values are communicated as String types, or\r\n   * from 0 (min intensity) to to 255 (max intensity) if values are communicated\r\n   * as Number types.\r\n   * The RGB-like 0-255 range is provided for backward compatibility.\r\n   *\r\n   * When ch1,ch2,ch3,ch4 are given, \"CMYK\" color space is implied and each\r\n   * value must be a in the range from 0.00 (0% concentration) to to\r\n   * 1.00 (100% concentration)\r\n   *\r\n   * Because JavaScript treats fixed point numbers badly (rounds to\r\n   * floating point nearest to binary representation) it is highly advised to\r\n   * communicate the fractional numbers as String types, not JavaScript Number type.\r\n   *\r\n   * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'.\r\n   * @param {Number} ch2 Color channel value.\r\n   * @param {Number} ch3 Color channel value.\r\n   * @param {Number} ch4 Color channel value.\r\n   *\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name setTextColor\r\n   */\r\n  API.__private__.setTextColor = API.setTextColor = function(\r\n    ch1,\r\n    ch2,\r\n    ch3,\r\n    ch4\r\n  ) {\r\n    var options = {\r\n      ch1: ch1,\r\n      ch2: ch2,\r\n      ch3: ch3,\r\n      ch4: ch4,\r\n      pdfColorType: \"text\",\r\n      precision: 3\r\n    };\r\n    textColor = encodeColorString(options);\r\n\r\n    return this;\r\n  };\r\n\r\n  var activeCharSpace = options.charSpace;\r\n\r\n  /**\r\n   * Get global value of CharSpace.\r\n   *\r\n   * @function\r\n   * @instance\r\n   * @returns {number} charSpace\r\n   * @memberof jsPDF#\r\n   * @name getCharSpace\r\n   */\r\n  var getCharSpace = (API.__private__.getCharSpace = API.getCharSpace = function() {\r\n    return parseFloat(activeCharSpace || 0);\r\n  });\r\n\r\n  /**\r\n   * Set global value of CharSpace.\r\n   *\r\n   * @param {number} charSpace\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF} jsPDF-instance\r\n   * @memberof jsPDF#\r\n   * @name setCharSpace\r\n   */\r\n  API.__private__.setCharSpace = API.setCharSpace = function(charSpace) {\r\n    if (isNaN(charSpace)) {\r\n      throw new Error(\"Invalid argument passed to jsPDF.setCharSpace\");\r\n    }\r\n    activeCharSpace = charSpace;\r\n    return this;\r\n  };\r\n\r\n  var lineCapID = 0;\r\n  /**\r\n   * Is an Object providing a mapping from human-readable to\r\n   * integer flag values designating the varieties of line cap\r\n   * and join styles.\r\n   *\r\n   * @memberof jsPDF#\r\n   * @name CapJoinStyles\r\n   */\r\n  API.CapJoinStyles = {\r\n    0: 0,\r\n    butt: 0,\r\n    but: 0,\r\n    miter: 0,\r\n    1: 1,\r\n    round: 1,\r\n    rounded: 1,\r\n    circle: 1,\r\n    2: 2,\r\n    projecting: 2,\r\n    project: 2,\r\n    square: 2,\r\n    bevel: 2\r\n  };\r\n\r\n  /**\r\n   * Sets the line cap styles.\r\n   * See {jsPDF.CapJoinStyles} for variants.\r\n   *\r\n   * @param {String|Number} style A string or number identifying the type of line cap.\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name setLineCap\r\n   */\r\n  API.__private__.setLineCap = API.setLineCap = function(style) {\r\n    var id = API.CapJoinStyles[style];\r\n    if (id === undefined) {\r\n      throw new Error(\r\n        \"Line cap style of '\" +\r\n          style +\r\n          \"' is not recognized. See or extend .CapJoinStyles property for valid styles\"\r\n      );\r\n    }\r\n    lineCapID = id;\r\n    out(id + \" J\");\r\n\r\n    return this;\r\n  };\r\n\r\n  var lineJoinID = 0;\r\n  /**\r\n   * Sets the line join styles.\r\n   * See {jsPDF.CapJoinStyles} for variants.\r\n   *\r\n   * @param {String|Number} style A string or number identifying the type of line join.\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name setLineJoin\r\n   */\r\n  API.__private__.setLineJoin = API.setLineJoin = function(style) {\r\n    var id = API.CapJoinStyles[style];\r\n    if (id === undefined) {\r\n      throw new Error(\r\n        \"Line join style of '\" +\r\n          style +\r\n          \"' is not recognized. See or extend .CapJoinStyles property for valid styles\"\r\n      );\r\n    }\r\n    lineJoinID = id;\r\n    out(id + \" j\");\r\n\r\n    return this;\r\n  };\r\n\r\n  var miterLimit;\r\n  /**\r\n   * Sets the miterLimit property, which effects the maximum miter length.\r\n   *\r\n   * @param {number} length The length of the miter\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name setLineMiterLimit\r\n   */\r\n  API.__private__.setLineMiterLimit = API.__private__.setMiterLimit = API.setLineMiterLimit = API.setMiterLimit = function(\r\n    length\r\n  ) {\r\n    length = length || 0;\r\n    if (isNaN(length)) {\r\n      throw new Error(\"Invalid argument passed to jsPDF.setLineMiterLimit\");\r\n    }\r\n    out(hpf(scale(length)) + \" M\");\r\n\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * An object representing a pdf graphics state.\r\n   * @class GState\r\n   */\r\n\r\n  /**\r\n   *\r\n   * @param parameters A parameter object that contains all properties this graphics state wants to set.\r\n   * Supported are: opacity, stroke-opacity\r\n   * @constructor\r\n   */\r\n  API.GState = GState;\r\n\r\n  /**\r\n   * Sets a either previously added {@link GState} (via {@link addGState}) or a new {@link GState}.\r\n   * @param {String|GState} gState If type is string, a previously added GState is used, if type is GState\r\n   * it will be added before use.\r\n   * @function\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name setGState\r\n   */\r\n  API.setGState = function(gState) {\r\n    if (typeof gState === \"string\") {\r\n      gState = gStates[gStatesMap[gState]];\r\n    } else {\r\n      gState = addGState(null, gState);\r\n    }\r\n\r\n    if (!gState.equals(activeGState)) {\r\n      out(\"/\" + gState.id + \" gs\");\r\n      activeGState = gState;\r\n    }\r\n  };\r\n\r\n  /**\r\n   * Adds a new Graphics State. Duplicates are automatically eliminated.\r\n   * @param {String} key Might also be null, if no later reference to this gState is needed\r\n   * @param {Object} gState The gState object\r\n   */\r\n  var addGState = function(key, gState) {\r\n    // only add it if it is not already present (the keys provided by the user must be unique!)\r\n    if (key && gStatesMap[key]) return;\r\n    var duplicate = false;\r\n    for (var s in gStates) {\r\n      if (gStates.hasOwnProperty(s)) {\r\n        if (gStates[s].equals(gState)) {\r\n          duplicate = true;\r\n          break;\r\n        }\r\n      }\r\n    }\r\n\r\n    if (duplicate) {\r\n      gState = gStates[s];\r\n    } else {\r\n      var gStateKey = \"GS\" + (Object.keys(gStates).length + 1).toString(10);\r\n      gStates[gStateKey] = gState;\r\n      gState.id = gStateKey;\r\n    }\r\n\r\n    // several user keys may point to the same GState object\r\n    key && (gStatesMap[key] = gState.id);\r\n\r\n    events.publish(\"addGState\", gState);\r\n\r\n    return gState;\r\n  };\r\n\r\n  /**\r\n   * Adds a new {@link GState} for later use. See {@link setGState}.\r\n   * @param {String} key\r\n   * @param {GState} gState\r\n   * @function\r\n   * @instance\r\n   * @returns {jsPDF}\r\n   *\r\n   * @memberof jsPDF#\r\n   * @name addGState\r\n   */\r\n  API.addGState = function(key, gState) {\r\n    addGState(key, gState);\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Saves the current graphics state (\"pushes it on the stack\"). It can be restored by {@link restoreGraphicsState}\r\n   * later. Here, the general pdf graphics state is meant, also including the current transformation matrix,\r\n   * fill and stroke colors etc.\r\n   * @function\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name saveGraphicsState\r\n   */\r\n  API.saveGraphicsState = function() {\r\n    out(\"q\");\r\n    // as we cannot set font key and size independently we must keep track of both\r\n    fontStateStack.push({\r\n      key: activeFontKey,\r\n      size: activeFontSize,\r\n      color: textColor\r\n    });\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Restores a previously saved graphics state saved by {@link saveGraphicsState} (\"pops the stack\").\r\n   * @function\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name restoreGraphicsState\r\n   */\r\n  API.restoreGraphicsState = function() {\r\n    out(\"Q\");\r\n\r\n    // restore previous font state\r\n    var fontState = fontStateStack.pop();\r\n    activeFontKey = fontState.key;\r\n    activeFontSize = fontState.size;\r\n    textColor = fontState.color;\r\n\r\n    activeGState = null;\r\n\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Appends this matrix to the left of all previously applied matrices.\r\n   *\r\n   * @param {Matrix} matrix\r\n   * @function\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name setCurrentTransformationMatrix\r\n   */\r\n  API.setCurrentTransformationMatrix = function(matrix) {\r\n    out(matrix.toString() + \" cm\");\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Inserts a debug comment into the generated pdf.\r\n   * @function\r\n   * @instance\r\n   * @param {String} text\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name comment\r\n   */\r\n  API.comment = function(text) {\r\n    out(\"#\" + text);\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Point\r\n   */\r\n  var Point = function(x, y) {\r\n    var _x = x || 0;\r\n    Object.defineProperty(this, \"x\", {\r\n      enumerable: true,\r\n      get: function() {\r\n        return _x;\r\n      },\r\n      set: function(value) {\r\n        if (!isNaN(value)) {\r\n          _x = parseFloat(value);\r\n        }\r\n      }\r\n    });\r\n\r\n    var _y = y || 0;\r\n    Object.defineProperty(this, \"y\", {\r\n      enumerable: true,\r\n      get: function() {\r\n        return _y;\r\n      },\r\n      set: function(value) {\r\n        if (!isNaN(value)) {\r\n          _y = parseFloat(value);\r\n        }\r\n      }\r\n    });\r\n\r\n    var _type = \"pt\";\r\n    Object.defineProperty(this, \"type\", {\r\n      enumerable: true,\r\n      get: function() {\r\n        return _type;\r\n      },\r\n      set: function(value) {\r\n        _type = value.toString();\r\n      }\r\n    });\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Rectangle\r\n   */\r\n  var Rectangle = function(x, y, w, h) {\r\n    Point.call(this, x, y);\r\n    this.type = \"rect\";\r\n\r\n    var _w = w || 0;\r\n    Object.defineProperty(this, \"w\", {\r\n      enumerable: true,\r\n      get: function() {\r\n        return _w;\r\n      },\r\n      set: function(value) {\r\n        if (!isNaN(value)) {\r\n          _w = parseFloat(value);\r\n        }\r\n      }\r\n    });\r\n\r\n    var _h = h || 0;\r\n    Object.defineProperty(this, \"h\", {\r\n      enumerable: true,\r\n      get: function() {\r\n        return _h;\r\n      },\r\n      set: function(value) {\r\n        if (!isNaN(value)) {\r\n          _h = parseFloat(value);\r\n        }\r\n      }\r\n    });\r\n\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * FormObject/RenderTarget\r\n   */\r\n\r\n  var RenderTarget = function() {\r\n    this.page = page;\r\n    this.currentPage = currentPage;\r\n    this.pages = pages.slice(0);\r\n    this.pagesContext = pagesContext.slice(0);\r\n    this.x = pageX;\r\n    this.y = pageY;\r\n    this.matrix = pageMatrix;\r\n    this.width = getPageWidth(currentPage);\r\n    this.height = getPageHeight(currentPage);\r\n    this.outputDestination = outputDestination;\r\n\r\n    this.id = \"\"; // set by endFormObject()\r\n    this.objectNumber = -1; // will be set by putXObject()\r\n  };\r\n\r\n  RenderTarget.prototype.restore = function() {\r\n    page = this.page;\r\n    currentPage = this.currentPage;\r\n    pagesContext = this.pagesContext;\r\n    pages = this.pages;\r\n    pageX = this.x;\r\n    pageY = this.y;\r\n    pageMatrix = this.matrix;\r\n    setPageWidth(currentPage, this.width);\r\n    setPageHeight(currentPage, this.height);\r\n    outputDestination = this.outputDestination;\r\n  };\r\n\r\n  var beginNewRenderTarget = function(x, y, width, height, matrix) {\r\n    // save current state\r\n    renderTargetStack.push(new RenderTarget());\r\n\r\n    // clear pages\r\n    page = currentPage = 0;\r\n    pages = [];\r\n    pageX = x;\r\n    pageY = y;\r\n\r\n    pageMatrix = matrix;\r\n\r\n    beginPage([width, height]);\r\n  };\r\n\r\n  var endFormObject = function(key) {\r\n    // only add it if it is not already present (the keys provided by the user must be unique!)\r\n    if (renderTargetMap[key]) {\r\n      renderTargetStack.pop().restore();\r\n      return;\r\n    }\r\n\r\n    // save the created xObject\r\n    var newXObject = new RenderTarget();\r\n\r\n    var xObjectId = \"Xo\" + (Object.keys(renderTargets).length + 1).toString(10);\r\n    newXObject.id = xObjectId;\r\n\r\n    renderTargetMap[key] = xObjectId;\r\n    renderTargets[xObjectId] = newXObject;\r\n\r\n    events.publish(\"addFormObject\", newXObject);\r\n\r\n    // restore state from stack\r\n    renderTargetStack.pop().restore();\r\n  };\r\n\r\n  /**\r\n   * Starts a new pdf form object, which means that all consequent draw calls target a new independent object\r\n   * until {@link endFormObject} is called. The created object can be referenced and drawn later using\r\n   * {@link doFormObject}. Nested form objects are possible.\r\n   * x, y, width, height set the bounding box that is used to clip the content.\r\n   *\r\n   * @param {number} x\r\n   * @param {number} y\r\n   * @param {number} width\r\n   * @param {number} height\r\n   * @param {Matrix} matrix The matrix that will be applied to convert the form objects coordinate system to\r\n   * the parent's.\r\n   * @function\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name beginFormObject\r\n   */\r\n  API.beginFormObject = function(x, y, width, height, matrix) {\r\n    // The user can set the output target to a new form object. Nested form objects are possible.\r\n    // Currently, they use the resource dictionary of the surrounding stream. This should be changed, as\r\n    // the PDF-Spec states:\r\n    // \"In PDF 1.2 and later versions, form XObjects may be independent of the content streams in which\r\n    // they appear, and this is strongly recommended although not requiredIn PDF 1.2 and later versions,\r\n    // form XObjects may be independent of the content streams in which they appear, and this is strongly\r\n    // recommended although not required\"\r\n    beginNewRenderTarget(x, y, width, height, matrix);\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Completes and saves the form object.\r\n   * @param {String} key The key by which this form object can be referenced.\r\n   * @function\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name endFormObject\r\n   */\r\n  API.endFormObject = function(key) {\r\n    endFormObject(key);\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Draws the specified form object by referencing to the respective pdf XObject created with\r\n   * {@link API.beginFormObject} and {@link endFormObject}.\r\n   * The location is determined by matrix.\r\n   *\r\n   * @param {String} key The key to the form object.\r\n   * @param {Matrix} matrix The matrix applied before drawing the form object.\r\n   * @function\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name doFormObject\r\n   */\r\n  API.doFormObject = function(key, matrix) {\r\n    var xObject = renderTargets[renderTargetMap[key]];\r\n    out(\"q\");\r\n    out(matrix.toString() + \" cm\");\r\n    out(\"/\" + xObject.id + \" Do\");\r\n    out(\"Q\");\r\n    return this;\r\n  };\r\n\r\n  /**\r\n   * Returns the form object specified by key.\r\n   * @param key {String}\r\n   * @returns {{x: number, y: number, width: number, height: number, matrix: Matrix}}\r\n   * @function\r\n   * @returns {jsPDF}\r\n   * @memberof jsPDF#\r\n   * @name getFormObject\r\n   */\r\n  API.getFormObject = function(key) {\r\n    var xObject = renderTargets[renderTargetMap[key]];\r\n    return {\r\n      x: xObject.x,\r\n      y: xObject.y,\r\n      width: xObject.width,\r\n      height: xObject.height,\r\n      matrix: xObject.matrix\r\n    };\r\n  };\r\n\r\n  /**\r\n   * Saves as PDF document. An alias of jsPDF.output('save', 'filename.pdf').\r\n   * Uses FileSaver.js-method saveAs.\r\n   *\r\n   * @memberof jsPDF#\r\n   * @name save\r\n   * @function\r\n   * @instance\r\n   * @param  {string} filename The filename including extension.\r\n   * @param  {Object} options An Object with additional options, possible options: 'returnPromise'.\r\n   * @returns {jsPDF|Promise} jsPDF-instance     */\r\n  API.save = function(filename, options) {\r\n    filename = filename || \"generated.pdf\";\r\n\r\n    options = options || {};\r\n    options.returnPromise = options.returnPromise || false;\r\n\r\n    if (options.returnPromise === false) {\r\n      saveAs(getBlob(buildDocument()), filename);\r\n      if (typeof saveAs.unload === \"function\") {\r\n        if (globalObject.setTimeout) {\r\n          setTimeout(saveAs.unload, 911);\r\n        }\r\n      }\r\n      return this;\r\n    } else {\r\n      return new Promise(function(resolve, reject) {\r\n        try {\r\n          var result = saveAs(getBlob(buildDocument()), filename);\r\n          if (typeof saveAs.unload === \"function\") {\r\n            if (globalObject.setTimeout) {\r\n              setTimeout(saveAs.unload, 911);\r\n            }\r\n          }\r\n          resolve(result);\r\n        } catch (e) {\r\n          reject(e.message);\r\n        }\r\n      });\r\n    }\r\n\r\n  };\r\n\r\n  // applying plugins (more methods) ON TOP of built-in API.\r\n  // this is intentional as we allow plugins to override\r\n  // built-ins\r\n  for (var plugin in jsPDF.API) {\r\n    if (jsPDF.API.hasOwnProperty(plugin)) {\r\n      if (plugin === \"events\" && jsPDF.API.events.length) {\r\n        (function(events, newEvents) {\r\n          // jsPDF.API.events is a JS Array of Arrays\r\n          // where each Array is a pair of event name, handler\r\n          // Events were added by plugins to the jsPDF instantiator.\r\n          // These are always added to the new instance and some ran\r\n          // during instantiation.\r\n          var eventname, handler_and_args, i;\r\n\r\n          for (i = newEvents.length - 1; i !== -1; i--) {\r\n            // subscribe takes 3 args: 'topic', function, runonce_flag\r\n            // if undefined, runonce is false.\r\n            // users can attach callback directly,\r\n            // or they can attach an array with [callback, runonce_flag]\r\n            // that's what the \"apply\" magic is for below.\r\n            eventname = newEvents[i][0];\r\n            handler_and_args = newEvents[i][1];\r\n            events.subscribe.apply(\r\n              events,\r\n              [eventname].concat(\r\n                typeof handler_and_args === \"function\"\r\n                  ? [handler_and_args]\r\n                  : handler_and_args\r\n              )\r\n            );\r\n          }\r\n        })(events, jsPDF.API.events);\r\n      } else {\r\n        API[plugin] = jsPDF.API[plugin];\r\n      }\r\n    }\r\n  }\r\n\r\n  var getPageWidth = (API.getPageWidth = function(pageNumber) {\r\n    pageNumber = pageNumber || currentPage;\r\n    return (\r\n      (pagesContext[pageNumber].mediaBox.topRightX -\r\n        pagesContext[pageNumber].mediaBox.bottomLeftX) /\r\n      scaleFactor\r\n    );\r\n  });\r\n\r\n  var setPageWidth = (API.setPageWidth = function(pageNumber, value) {\r\n    pagesContext[pageNumber].mediaBox.topRightX =\r\n      value * scaleFactor + pagesContext[pageNumber].mediaBox.bottomLeftX;\r\n  });\r\n\r\n  var getPageHeight = (API.getPageHeight = function(pageNumber) {\r\n    pageNumber = pageNumber || currentPage;\r\n    return (\r\n      (pagesContext[pageNumber].mediaBox.topRightY -\r\n        pagesContext[pageNumber].mediaBox.bottomLeftY) /\r\n      scaleFactor\r\n    );\r\n  });\r\n\r\n  var setPageHeight = (API.setPageHeight = function(pageNumber, value) {\r\n    pagesContext[pageNumber].mediaBox.topRightY =\r\n      value * scaleFactor + pagesContext[pageNumber].mediaBox.bottomLeftY;\r\n  });\r\n\r\n  /**\r\n   * Object exposing internal API to plugins\r\n   * @public\r\n   * @ignore\r\n   */\r\n  API.internal = {\r\n    pdfEscape: pdfEscape,\r\n    getStyle: getStyle,\r\n    getFont: getFontEntry,\r\n    getFontSize: getFontSize,\r\n    getCharSpace: getCharSpace,\r\n    getTextColor: getTextColor,\r\n    getLineHeight: getLineHeight,\r\n    getLineHeightFactor: getLineHeightFactor,\r\n    getLineWidth: getLineWidth,\r\n    write: write,\r\n    getHorizontalCoordinate: getHorizontalCoordinate,\r\n    getVerticalCoordinate: getVerticalCoordinate,\r\n    getCoordinateString: getHorizontalCoordinateString,\r\n    getVerticalCoordinateString: getVerticalCoordinateString,\r\n    collections: {},\r\n    newObject: newObject,\r\n    newAdditionalObject: newAdditionalObject,\r\n    newObjectDeferred: newObjectDeferred,\r\n    newObjectDeferredBegin: newObjectDeferredBegin,\r\n    getFilters: getFilters,\r\n    putStream: putStream,\r\n    events: events,\r\n    scaleFactor: scaleFactor,\r\n    pageSize: {\r\n      getWidth: function() {\r\n        return getPageWidth(currentPage);\r\n      },\r\n      setWidth: function(value) {\r\n        setPageWidth(currentPage, value);\r\n      },\r\n      getHeight: function() {\r\n        return getPageHeight(currentPage);\r\n      },\r\n      setHeight: function(value) {\r\n        setPageHeight(currentPage, value);\r\n      }\r\n    },\r\n    encryptionOptions: encryptionOptions,\r\n    encryption: encryption,\r\n    getEncryptor: getEncryptor,\r\n    output: output,\r\n    getNumberOfPages: getNumberOfPages,\r\n    pages: pages,\r\n    out: out,\r\n    f2: f2,\r\n    f3: f3,\r\n    getPageInfo: getPageInfo,\r\n    getPageInfoByObjId: getPageInfoByObjId,\r\n    getCurrentPageInfo: getCurrentPageInfo,\r\n    getPDFVersion: getPdfVersion,\r\n    Point: Point,\r\n    Rectangle: Rectangle,\r\n    Matrix: Matrix,\r\n    hasHotfix: hasHotfix //Expose the hasHotfix check so plugins can also check them.\r\n  };\r\n\r\n  Object.defineProperty(API.internal.pageSize, \"width\", {\r\n    get: function() {\r\n      return getPageWidth(currentPage);\r\n    },\r\n    set: function(value) {\r\n      setPageWidth(currentPage, value);\r\n    },\r\n    enumerable: true,\r\n    configurable: true\r\n  });\r\n  Object.defineProperty(API.internal.pageSize, \"height\", {\r\n    get: function() {\r\n      return getPageHeight(currentPage);\r\n    },\r\n    set: function(value) {\r\n      setPageHeight(currentPage, value);\r\n    },\r\n    enumerable: true,\r\n    configurable: true\r\n  });\r\n\r\n  //////////////////////////////////////////////////////\r\n  // continuing initialization of jsPDF Document object\r\n  //////////////////////////////////////////////////////\r\n  // Add the first page automatically\r\n  addFonts.call(API, standardFonts);\r\n  activeFontKey = \"F1\";\r\n  _addPage(format, orientation);\r\n\r\n  events.publish(\"initialized\");\r\n  return API;\r\n}\r\n\r\n/**\r\n * jsPDF.API is a STATIC property of jsPDF class.\r\n * jsPDF.API is an object you can add methods and properties to.\r\n * The methods / properties you add will show up in new jsPDF objects.\r\n *\r\n * One property is prepopulated. It is the 'events' Object. Plugin authors can add topics,\r\n * callbacks to this object. These will be reassigned to all new instances of jsPDF.\r\n *\r\n * @static\r\n * @public\r\n * @memberof jsPDF#\r\n * @name API\r\n *\r\n * @example\r\n * jsPDF.API.mymethod = function(){\r\n *   // 'this' will be ref to internal API object. see jsPDF source\r\n *   // , so you can refer to built-in methods like so:\r\n *   //     this.line(....)\r\n *   //     this.text(....)\r\n * }\r\n * var pdfdoc = new jsPDF()\r\n * pdfdoc.mymethod() // <- !!!!!!\r\n */\r\njsPDF.API = {\r\n  events: []\r\n};\r\n/**\r\n * The version of jsPDF.\r\n * @name version\r\n * @type {string}\r\n * @memberof jsPDF#\r\n */\r\njsPDF.version = \"0.0.0\";\r\n\r\nexport { jsPDF, ShadingPattern, TilingPattern, GState };\r\nexport default jsPDF;\r\n","/* global jsPDF */\n/**\n * @license\n * Copyright (c) 2016 Alexander Weidt,\n * https://github.com/BiggA94\n *\n * Licensed under the MIT License. http://opensource.org/licenses/mit-license\n */\n\n/**\n * jsPDF AcroForm Plugin\n * @module AcroForm\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\nvar jsPDFAPI = jsPDF.API;\nvar scaleFactor = 1;\n\nvar pdfEscape = function(value) {\n  return value\n    .replace(/\\\\/g, \"\\\\\\\\\")\n    .replace(/\\(/g, \"\\\\(\")\n    .replace(/\\)/g, \"\\\\)\");\n};\nvar pdfUnescape = function(value) {\n  return value\n    .replace(/\\\\\\\\/g, \"\\\\\")\n    .replace(/\\\\\\(/g, \"(\")\n    .replace(/\\\\\\)/g, \")\");\n};\n\nvar f2 = function(number) {\n  return number.toFixed(2); // Ie, %.2f\n};\n\nvar f5 = function(number) {\n  return number.toFixed(5); // Ie, %.2f\n};\n\njsPDFAPI.__acroform__ = {};\nvar inherit = function(child, parent) {\n  child.prototype = Object.create(parent.prototype);\n  child.prototype.constructor = child;\n};\n\nvar scale = function(x) {\n  return x * scaleFactor;\n};\n\nvar createFormXObject = function(formObject) {\n  var xobj = new AcroFormXObject();\n  var height = AcroFormAppearance.internal.getHeight(formObject) || 0;\n  var width = AcroFormAppearance.internal.getWidth(formObject) || 0;\n  xobj.BBox = [0, 0, Number(f2(width)), Number(f2(height))];\n  return xobj;\n};\n\n/**\n * Bit-Operations\n */\nvar setBit = (jsPDFAPI.__acroform__.setBit = function(number, bitPosition) {\n  number = number || 0;\n  bitPosition = bitPosition || 0;\n\n  if (isNaN(number) || isNaN(bitPosition)) {\n    throw new Error(\n      \"Invalid arguments passed to jsPDF.API.__acroform__.setBit\"\n    );\n  }\n  var bitMask = 1 << bitPosition;\n\n  number |= bitMask;\n\n  return number;\n});\n\nvar clearBit = (jsPDFAPI.__acroform__.clearBit = function(number, bitPosition) {\n  number = number || 0;\n  bitPosition = bitPosition || 0;\n\n  if (isNaN(number) || isNaN(bitPosition)) {\n    throw new Error(\n      \"Invalid arguments passed to jsPDF.API.__acroform__.clearBit\"\n    );\n  }\n  var bitMask = 1 << bitPosition;\n\n  number &= ~bitMask;\n\n  return number;\n});\n\nvar getBit = (jsPDFAPI.__acroform__.getBit = function(number, bitPosition) {\n  if (isNaN(number) || isNaN(bitPosition)) {\n    throw new Error(\n      \"Invalid arguments passed to jsPDF.API.__acroform__.getBit\"\n    );\n  }\n  return (number & (1 << bitPosition)) === 0 ? 0 : 1;\n});\n\n/*\n * Ff starts counting the bit position at 1 and not like javascript at 0\n */\nvar getBitForPdf = (jsPDFAPI.__acroform__.getBitForPdf = function(\n  number,\n  bitPosition\n) {\n  if (isNaN(number) || isNaN(bitPosition)) {\n    throw new Error(\n      \"Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf\"\n    );\n  }\n  return getBit(number, bitPosition - 1);\n});\n\nvar setBitForPdf = (jsPDFAPI.__acroform__.setBitForPdf = function(\n  number,\n  bitPosition\n) {\n  if (isNaN(number) || isNaN(bitPosition)) {\n    throw new Error(\n      \"Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf\"\n    );\n  }\n  return setBit(number, bitPosition - 1);\n});\n\nvar clearBitForPdf = (jsPDFAPI.__acroform__.clearBitForPdf = function(\n  number,\n  bitPosition\n) {\n  if (isNaN(number) || isNaN(bitPosition)) {\n    throw new Error(\n      \"Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf\"\n    );\n  }\n  return clearBit(number, bitPosition - 1);\n});\n\nvar calculateCoordinates = (jsPDFAPI.__acroform__.calculateCoordinates = function(\n  args,\n  scope\n) {\n  var getHorizontalCoordinate = scope.internal.getHorizontalCoordinate;\n  var getVerticalCoordinate = scope.internal.getVerticalCoordinate;\n  var x = args[0];\n  var y = args[1];\n  var w = args[2];\n  var h = args[3];\n\n  var coordinates = {};\n\n  coordinates.lowerLeft_X = getHorizontalCoordinate(x) || 0;\n  coordinates.lowerLeft_Y = getVerticalCoordinate(y + h) || 0;\n  coordinates.upperRight_X = getHorizontalCoordinate(x + w) || 0;\n  coordinates.upperRight_Y = getVerticalCoordinate(y) || 0;\n\n  return [\n    Number(f2(coordinates.lowerLeft_X)),\n    Number(f2(coordinates.lowerLeft_Y)),\n    Number(f2(coordinates.upperRight_X)),\n    Number(f2(coordinates.upperRight_Y))\n  ];\n});\n\nvar calculateAppearanceStream = function(formObject) {\n  if (formObject.appearanceStreamContent) {\n    return formObject.appearanceStreamContent;\n  }\n\n  if (!formObject.V && !formObject.DV) {\n    return;\n  }\n\n  // else calculate it\n\n  var stream = [];\n  var text = formObject._V || formObject.DV;\n  var calcRes = calculateX(formObject, text);\n  var fontKey = formObject.scope.internal.getFont(\n    formObject.fontName,\n    formObject.fontStyle\n  ).id;\n\n  //PDF 32000-1:2008, page 444\n  stream.push(\"/Tx BMC\");\n  stream.push(\"q\");\n  stream.push(\"BT\"); // Begin Text\n  stream.push(formObject.scope.__private__.encodeColorString(formObject.color));\n  stream.push(\"/\" + fontKey + \" \" + f2(calcRes.fontSize) + \" Tf\");\n  stream.push(\"1 0 0 1 0 0 Tm\"); // Transformation Matrix\n  stream.push(calcRes.text);\n  stream.push(\"ET\"); // End Text\n  stream.push(\"Q\");\n  stream.push(\"EMC\");\n\n  var appearanceStreamContent = createFormXObject(formObject);\n  appearanceStreamContent.scope = formObject.scope;\n  appearanceStreamContent.stream = stream.join(\"\\n\");\n  return appearanceStreamContent;\n};\n\nvar calculateX = function(formObject, text) {\n  var maxFontSize =\n    formObject.fontSize === 0 ? formObject.maxFontSize : formObject.fontSize;\n  var returnValue = {\n    text: \"\",\n    fontSize: \"\"\n  };\n  // Remove Brackets\n  text = text.substr(0, 1) == \"(\" ? text.substr(1) : text;\n  text =\n    text.substr(text.length - 1) == \")\"\n      ? text.substr(0, text.length - 1)\n      : text;\n  // split into array of words\n  var textSplit = text.split(\" \");\n  if (formObject.multiline) {\n    textSplit = textSplit.map(word => word.split(\"\\n\"));\n  } else {\n    textSplit = textSplit.map(word => [word]);\n  }\n\n  var fontSize = maxFontSize; // The Starting fontSize (The Maximum)\n  var lineSpacing = 2;\n  var borderPadding = 2;\n\n  var height = AcroFormAppearance.internal.getHeight(formObject) || 0;\n  height = height < 0 ? -height : height;\n  var width = AcroFormAppearance.internal.getWidth(formObject) || 0;\n  width = width < 0 ? -width : width;\n\n  var isSmallerThanWidth = function(i, lastLine, fontSize) {\n    if (i + 1 < textSplit.length) {\n      var tmp = lastLine + \" \" + textSplit[i + 1][0];\n      var TextWidth = calculateFontSpace(tmp, formObject, fontSize).width;\n      var FieldWidth = width - 2 * borderPadding;\n      return TextWidth <= FieldWidth;\n    } else {\n      return false;\n    }\n  };\n\n  fontSize++;\n  FontSize: while (fontSize > 0) {\n    text = \"\";\n    fontSize--;\n    var textHeight = calculateFontSpace(\"3\", formObject, fontSize).height;\n    var startY = formObject.multiline\n      ? height - fontSize\n      : (height - textHeight) / 2;\n    startY += lineSpacing;\n    var startX;\n\n    var lastY = startY;\n    var firstWordInLine = 0,\n      lastWordInLine = 0;\n    var lastLength;\n    var currWord = 0;\n\n    if (fontSize <= 0) {\n      // In case, the Text doesn't fit at all\n      fontSize = 12;\n      text = \"(...) Tj\\n\";\n      text +=\n        \"% Width of Text: \" +\n        calculateFontSpace(text, formObject, fontSize).width +\n        \", FieldWidth:\" +\n        width +\n        \"\\n\";\n      break;\n    }\n\n    var lastLine = \"\";\n    var lineCount = 0;\n    Line: for (var i = 0; i < textSplit.length; i++) {\n      if (textSplit.hasOwnProperty(i)) {\n        let isWithNewLine = false;\n        if (textSplit[i].length !== 1 && currWord !== textSplit[i].length - 1) {\n          if (\n            (textHeight + lineSpacing) * (lineCount + 2) + lineSpacing >\n            height\n          ) {\n            continue FontSize;\n          }\n\n          lastLine += textSplit[i][currWord];\n          isWithNewLine = true;\n          lastWordInLine = i;\n          i--;\n        } else {\n          lastLine += textSplit[i][currWord] + \" \";\n          lastLine =\n            lastLine.substr(lastLine.length - 1) == \" \"\n              ? lastLine.substr(0, lastLine.length - 1)\n              : lastLine;\n          var key = parseInt(i);\n          var nextLineIsSmaller = isSmallerThanWidth(key, lastLine, fontSize);\n          var isLastWord = i >= textSplit.length - 1;\n\n          if (nextLineIsSmaller && !isLastWord) {\n            lastLine += \" \";\n            currWord = 0;\n            continue; // Line\n          } else if (!nextLineIsSmaller && !isLastWord) {\n            if (!formObject.multiline) {\n              continue FontSize;\n            } else {\n              if (\n                (textHeight + lineSpacing) * (lineCount + 2) + lineSpacing >\n                height\n              ) {\n                // If the Text is higher than the\n                // FieldObject\n                continue FontSize;\n              }\n              lastWordInLine = key;\n              // go on\n            }\n          } else if (isLastWord) {\n            lastWordInLine = key;\n          } else {\n            if (\n              formObject.multiline &&\n              (textHeight + lineSpacing) * (lineCount + 2) + lineSpacing >\n                height\n            ) {\n              // If the Text is higher than the FieldObject\n              continue FontSize;\n            }\n          }\n        }\n        // Remove last blank\n\n        var line = \"\";\n\n        for (var x = firstWordInLine; x <= lastWordInLine; x++) {\n          var currLine = textSplit[x];\n          if (formObject.multiline) {\n            if (x === lastWordInLine) {\n              line += currLine[currWord] + \" \";\n              currWord = (currWord + 1) % currLine.length;\n              continue;\n            }\n            if (x === firstWordInLine) {\n              line += currLine[currLine.length - 1] + \" \";\n              continue;\n            }\n          }\n          line += currLine[0] + \" \";\n        }\n\n        // Remove last blank\n        line =\n          line.substr(line.length - 1) == \" \"\n            ? line.substr(0, line.length - 1)\n            : line;\n        // lastLength -= blankSpace.width;\n        lastLength = calculateFontSpace(line, formObject, fontSize).width;\n\n        // Calculate startX\n        switch (formObject.textAlign) {\n          case \"right\":\n            startX = width - lastLength - borderPadding;\n            break;\n          case \"center\":\n            startX = (width - lastLength) / 2;\n            break;\n          case \"left\":\n          default:\n            startX = borderPadding;\n            break;\n        }\n        text += f2(startX) + \" \" + f2(lastY) + \" Td\\n\";\n        text += \"(\" + pdfEscape(line) + \") Tj\\n\";\n        // reset X in PDF\n        text += -f2(startX) + \" 0 Td\\n\";\n\n        // After a Line, adjust y position\n        lastY = -(fontSize + lineSpacing);\n\n        // Reset for next iteration step\n        lastLength = 0;\n        firstWordInLine = isWithNewLine ? lastWordInLine : lastWordInLine + 1;\n        lineCount++;\n\n        lastLine = \"\";\n        continue Line;\n      }\n    }\n    break;\n  }\n\n  returnValue.text = text;\n  returnValue.fontSize = fontSize;\n\n  return returnValue;\n};\n\n/**\n * Small workaround for calculating the TextMetric approximately.\n *\n * @param text\n * @param fontsize\n * @returns {TextMetrics} (Has Height and Width)\n */\nvar calculateFontSpace = function(text, formObject, fontSize) {\n  var font = formObject.scope.internal.getFont(\n    formObject.fontName,\n    formObject.fontStyle\n  );\n  var width =\n    formObject.scope.getStringUnitWidth(text, {\n      font: font,\n      fontSize: parseFloat(fontSize),\n      charSpace: 0\n    }) * parseFloat(fontSize);\n  var height =\n    formObject.scope.getStringUnitWidth(\"3\", {\n      font: font,\n      fontSize: parseFloat(fontSize),\n      charSpace: 0\n    }) *\n    parseFloat(fontSize) *\n    1.5;\n  return { height: height, width: width };\n};\n\nvar acroformPluginTemplate = {\n  fields: [],\n  xForms: [],\n  /**\n   * acroFormDictionaryRoot contains information about the AcroForm\n   * Dictionary 0: The Event-Token, the AcroFormDictionaryCallback has\n   * 1: The Object ID of the Root\n   */\n  acroFormDictionaryRoot: null,\n  /**\n   * After the PDF gets evaluated, the reference to the root has to be\n   * reset, this indicates, whether the root has already been printed\n   * out\n   */\n  printedOut: false,\n  internal: null,\n  isInitialized: false\n};\n\nvar annotReferenceCallback = function(scope) {\n  //set objId to undefined and force it to get a new objId on buildDocument\n  scope.internal.acroformPlugin.acroFormDictionaryRoot.objId = undefined;\n  var fields = scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields;\n  for (var i in fields) {\n    if (fields.hasOwnProperty(i)) {\n      var formObject = fields[i];\n      //set objId to undefined and force it to get a new objId on buildDocument\n      formObject.objId = undefined;\n      // add Annot Reference!\n      if (formObject.hasAnnotation) {\n        // If theres an Annotation Widget in the Form Object, put the\n        // Reference in the /Annot array\n        createAnnotationReference(formObject, scope);\n      }\n    }\n  }\n};\n\nvar putForm = function(formObject) {\n  if (formObject.scope.internal.acroformPlugin.printedOut) {\n    formObject.scope.internal.acroformPlugin.printedOut = false;\n    formObject.scope.internal.acroformPlugin.acroFormDictionaryRoot = null;\n  }\n  formObject.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(\n    formObject\n  );\n};\n/**\n * Create the Reference to the widgetAnnotation, so that it gets referenced\n * in the Annot[] int the+ (Requires the Annotation Plugin)\n */\nvar createAnnotationReference = function(object, scope) {\n  var options = {\n    type: \"reference\",\n    object: object\n  };\n  var findEntry = function(entry) {\n    return entry.type === options.type && entry.object === options.object;\n  };\n  if (\n    scope.internal\n      .getPageInfo(object.page)\n      .pageContext.annotations.find(findEntry) === undefined\n  ) {\n    scope.internal\n      .getPageInfo(object.page)\n      .pageContext.annotations.push(options);\n  }\n};\n\n// Callbacks\n\nvar putCatalogCallback = function(scope) {\n  // Put reference to AcroForm to DocumentCatalog\n  if (\n    typeof scope.internal.acroformPlugin.acroFormDictionaryRoot !== \"undefined\"\n  ) {\n    // for safety, shouldn't normally be the case\n    scope.internal.write(\n      \"/AcroForm \" +\n        scope.internal.acroformPlugin.acroFormDictionaryRoot.objId +\n        \" \" +\n        0 +\n        \" R\"\n    );\n  } else {\n    throw new Error(\"putCatalogCallback: Root missing.\");\n  }\n};\n\n/**\n * Adds /Acroform X 0 R to Document Catalog, and creates the AcroForm\n * Dictionary\n */\nvar AcroFormDictionaryCallback = function(scope) {\n  // Remove event\n  scope.internal.events.unsubscribe(\n    scope.internal.acroformPlugin.acroFormDictionaryRoot._eventID\n  );\n  delete scope.internal.acroformPlugin.acroFormDictionaryRoot._eventID;\n  scope.internal.acroformPlugin.printedOut = true;\n};\n\n/**\n * Creates the single Fields and writes them into the Document\n *\n * If fieldArray is set, use the fields that are inside it instead of the\n * fields from the AcroRoot (for the FormXObjects...)\n */\nvar createFieldCallback = function(fieldArray, scope) {\n  var standardFields = !fieldArray;\n\n  if (!fieldArray) {\n    // in case there is no fieldArray specified, we want to print out\n    // the Fields of the AcroForm\n    // Print out Root\n    scope.internal.newObjectDeferredBegin(\n      scope.internal.acroformPlugin.acroFormDictionaryRoot.objId,\n      true\n    );\n    scope.internal.acroformPlugin.acroFormDictionaryRoot.putStream();\n  }\n\n  fieldArray =\n    fieldArray || scope.internal.acroformPlugin.acroFormDictionaryRoot.Kids;\n\n  for (var i in fieldArray) {\n    if (fieldArray.hasOwnProperty(i)) {\n      var fieldObject = fieldArray[i];\n      var keyValueList = [];\n      var oldRect = fieldObject.Rect;\n\n      if (fieldObject.Rect) {\n        fieldObject.Rect = calculateCoordinates(fieldObject.Rect, scope);\n      }\n\n      // Start Writing the Object\n      scope.internal.newObjectDeferredBegin(fieldObject.objId, true);\n\n      fieldObject.DA = AcroFormAppearance.createDefaultAppearanceStream(\n        fieldObject\n      );\n\n      if (\n        typeof fieldObject === \"object\" &&\n        typeof fieldObject.getKeyValueListForStream === \"function\"\n      ) {\n        keyValueList = fieldObject.getKeyValueListForStream();\n      }\n\n      fieldObject.Rect = oldRect;\n\n      if (\n        fieldObject.hasAppearanceStream &&\n        !fieldObject.appearanceStreamContent\n      ) {\n        // Calculate Appearance\n        var appearance = calculateAppearanceStream(fieldObject);\n        keyValueList.push({ key: \"AP\", value: \"<</N \" + appearance + \">>\" });\n\n        scope.internal.acroformPlugin.xForms.push(appearance);\n      }\n\n      // Assume AppearanceStreamContent is a Array with N,R,D (at least\n      // one of them!)\n      if (fieldObject.appearanceStreamContent) {\n        var appearanceStreamString = \"\";\n        // Iterate over N,R and D\n        for (var k in fieldObject.appearanceStreamContent) {\n          if (fieldObject.appearanceStreamContent.hasOwnProperty(k)) {\n            var value = fieldObject.appearanceStreamContent[k];\n            appearanceStreamString += \"/\" + k + \" \";\n            appearanceStreamString += \"<<\";\n            if (Object.keys(value).length >= 1 || Array.isArray(value)) {\n              // appearanceStream is an Array or Object!\n              for (var i in value) {\n                if (value.hasOwnProperty(i)) {\n                  var obj = value[i];\n                  if (typeof obj === \"function\") {\n                    // if Function is referenced, call it in order\n                    // to get the FormXObject\n                    obj = obj.call(scope, fieldObject);\n                  }\n                  appearanceStreamString += \"/\" + i + \" \" + obj + \" \";\n\n                  // In case the XForm is already used, e.g. OffState\n                  // of CheckBoxes, don't add it\n                  if (!(scope.internal.acroformPlugin.xForms.indexOf(obj) >= 0))\n                    scope.internal.acroformPlugin.xForms.push(obj);\n                }\n              }\n            } else {\n              obj = value;\n              if (typeof obj === \"function\") {\n                // if Function is referenced, call it in order to\n                // get the FormXObject\n                obj = obj.call(scope, fieldObject);\n              }\n              appearanceStreamString += \"/\" + i + \" \" + obj;\n              if (!(scope.internal.acroformPlugin.xForms.indexOf(obj) >= 0))\n                scope.internal.acroformPlugin.xForms.push(obj);\n            }\n            appearanceStreamString += \">>\";\n          }\n        }\n\n        // appearance stream is a normal Object..\n        keyValueList.push({\n          key: \"AP\",\n          value: \"<<\\n\" + appearanceStreamString + \">>\"\n        });\n      }\n\n      scope.internal.putStream({\n        additionalKeyValues: keyValueList,\n        objectId: fieldObject.objId\n      });\n\n      scope.internal.out(\"endobj\");\n    }\n  }\n  if (standardFields) {\n    createXFormObjectCallback(scope.internal.acroformPlugin.xForms, scope);\n  }\n};\n\nvar createXFormObjectCallback = function(fieldArray, scope) {\n  for (var i in fieldArray) {\n    if (fieldArray.hasOwnProperty(i)) {\n      var key = i;\n      var fieldObject = fieldArray[i];\n      // Start Writing the Object\n      scope.internal.newObjectDeferredBegin(fieldObject.objId, true);\n\n      if (\n        typeof fieldObject === \"object\" &&\n        typeof fieldObject.putStream === \"function\"\n      ) {\n        fieldObject.putStream();\n      }\n      delete fieldArray[key];\n    }\n  }\n};\n\nvar initializeAcroForm = function(scope, formObject) {\n  formObject.scope = scope;\n  if (\n    scope.internal !== undefined &&\n    (scope.internal.acroformPlugin === undefined ||\n      scope.internal.acroformPlugin.isInitialized === false)\n  ) {\n    AcroFormField.FieldNum = 0;\n    scope.internal.acroformPlugin = JSON.parse(\n      JSON.stringify(acroformPluginTemplate)\n    );\n    if (scope.internal.acroformPlugin.acroFormDictionaryRoot) {\n      throw new Error(\"Exception while creating AcroformDictionary\");\n    }\n    scaleFactor = scope.internal.scaleFactor;\n    // The Object Number of the AcroForm Dictionary\n    scope.internal.acroformPlugin.acroFormDictionaryRoot = new AcroFormDictionary();\n    scope.internal.acroformPlugin.acroFormDictionaryRoot.scope = scope;\n\n    // add Callback for creating the AcroForm Dictionary\n    scope.internal.acroformPlugin.acroFormDictionaryRoot._eventID = scope.internal.events.subscribe(\n      \"postPutResources\",\n      function() {\n        AcroFormDictionaryCallback(scope);\n      }\n    );\n\n    scope.internal.events.subscribe(\"buildDocument\", function() {\n      annotReferenceCallback(scope);\n    }); // buildDocument\n\n    // Register event, that is triggered when the DocumentCatalog is\n    // written, in order to add /AcroForm\n\n    scope.internal.events.subscribe(\"putCatalog\", function() {\n      putCatalogCallback(scope);\n    });\n\n    // Register event, that creates all Fields\n    scope.internal.events.subscribe(\"postPutPages\", function(fieldArray) {\n      createFieldCallback(fieldArray, scope);\n    });\n\n    scope.internal.acroformPlugin.isInitialized = true;\n  }\n};\n\n//PDF 32000-1:2008, page 26, 7.3.6\nvar arrayToPdfArray = (jsPDFAPI.__acroform__.arrayToPdfArray = function(\n  array,\n  objId,\n  scope\n) {\n  var encryptor = function(data) {\n    return data;\n  };\n  if (Array.isArray(array)) {\n    var content = \"[\";\n    for (var i = 0; i < array.length; i++) {\n      if (i !== 0) {\n        content += \" \";\n      }\n      switch (typeof array[i]) {\n        case \"boolean\":\n        case \"number\":\n        case \"object\":\n          content += array[i].toString();\n          break;\n        case \"string\":\n          if (array[i].substr(0, 1) !== \"/\") {\n            if (typeof objId !== \"undefined\" && scope)\n              encryptor = scope.internal.getEncryptor(objId);\n            content += \"(\" + pdfEscape(encryptor(array[i].toString())) + \")\";\n          } else {\n            content += array[i].toString();\n          }\n          break;\n      }\n    }\n    content += \"]\";\n    return content;\n  }\n  throw new Error(\n    \"Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray\"\n  );\n});\nfunction getMatches(string, regex, index) {\n  index || (index = 1); // default to the first capturing group\n  var matches = [];\n  var match;\n  while ((match = regex.exec(string))) {\n    matches.push(match[index]);\n  }\n  return matches;\n}\nvar pdfArrayToStringArray = function(array) {\n  var result = [];\n  if (typeof array === \"string\") {\n    result = getMatches(array, /\\((.*?)\\)/g);\n  }\n  return result;\n};\n\nvar toPdfString = function(string, objId, scope) {\n  var encryptor = function(data) {\n    return data;\n  };\n  if (typeof objId !== \"undefined\" && scope)\n    encryptor = scope.internal.getEncryptor(objId);\n  string = string || \"\";\n  string.toString();\n  string = \"(\" + pdfEscape(encryptor(string)) + \")\";\n  return string;\n};\n\n// ##########################\n// Classes\n// ##########################\n\n/**\n * @class AcroFormPDFObject\n * @classdesc A AcroFormPDFObject\n */\nvar AcroFormPDFObject = function() {\n  this._objId = undefined;\n  this._scope = undefined;\n\n  /**\n   * @name AcroFormPDFObject#objId\n   * @type {any}\n   */\n  Object.defineProperty(this, \"objId\", {\n    get: function() {\n      if (typeof this._objId === \"undefined\") {\n        if (typeof this.scope === \"undefined\") {\n          return undefined;\n        }\n        this._objId = this.scope.internal.newObjectDeferred();\n      }\n      return this._objId;\n    },\n    set: function(value) {\n      this._objId = value;\n    }\n  });\n  Object.defineProperty(this, \"scope\", {\n    value: this._scope,\n    writable: true\n  });\n};\n\n/**\n * @function AcroFormPDFObject.toString\n */\nAcroFormPDFObject.prototype.toString = function() {\n  return this.objId + \" 0 R\";\n};\n\nAcroFormPDFObject.prototype.putStream = function() {\n  var keyValueList = this.getKeyValueListForStream();\n  this.scope.internal.putStream({\n    data: this.stream,\n    additionalKeyValues: keyValueList,\n    objectId: this.objId\n  });\n  this.scope.internal.out(\"endobj\");\n};\n\n/**\n * Returns an key-value-List of all non-configurable Variables from the Object\n *\n * @name getKeyValueListForStream\n * @returns {string}\n */\nAcroFormPDFObject.prototype.getKeyValueListForStream = function() {\n  var keyValueList = [];\n  var keys = Object.getOwnPropertyNames(this).filter(function(key) {\n    return (\n      key != \"content\" &&\n      key != \"appearanceStreamContent\" &&\n      key != \"scope\" &&\n      key != \"objId\" &&\n      key.substring(0, 1) != \"_\"\n    );\n  });\n\n  for (var i in keys) {\n    if (Object.getOwnPropertyDescriptor(this, keys[i]).configurable === false) {\n      var key = keys[i];\n      var value = this[key];\n\n      if (value) {\n        if (Array.isArray(value)) {\n          keyValueList.push({\n            key: key,\n            value: arrayToPdfArray(value, this.objId, this.scope)\n          });\n        } else if (value instanceof AcroFormPDFObject) {\n          // In case it is a reference to another PDFObject,\n          // take the reference number\n          value.scope = this.scope;\n          keyValueList.push({ key: key, value: value.objId + \" 0 R\" });\n        } else if (typeof value !== \"function\") {\n          keyValueList.push({ key: key, value: value });\n        }\n      }\n    }\n  }\n  return keyValueList;\n};\n\nvar AcroFormXObject = function() {\n  AcroFormPDFObject.call(this);\n\n  Object.defineProperty(this, \"Type\", {\n    value: \"/XObject\",\n    configurable: false,\n    writable: true\n  });\n\n  Object.defineProperty(this, \"Subtype\", {\n    value: \"/Form\",\n    configurable: false,\n    writable: true\n  });\n\n  Object.defineProperty(this, \"FormType\", {\n    value: 1,\n    configurable: false,\n    writable: true\n  });\n\n  var _BBox = [];\n  Object.defineProperty(this, \"BBox\", {\n    configurable: false,\n    get: function() {\n      return _BBox;\n    },\n    set: function(value) {\n      _BBox = value;\n    }\n  });\n\n  Object.defineProperty(this, \"Resources\", {\n    value: \"2 0 R\",\n    configurable: false,\n    writable: true\n  });\n\n  var _stream;\n  Object.defineProperty(this, \"stream\", {\n    enumerable: false,\n    configurable: true,\n    set: function(value) {\n      _stream = value.trim();\n    },\n    get: function() {\n      if (_stream) {\n        return _stream;\n      } else {\n        return null;\n      }\n    }\n  });\n};\n\ninherit(AcroFormXObject, AcroFormPDFObject);\n\nvar AcroFormDictionary = function() {\n  AcroFormPDFObject.call(this);\n\n  var _Kids = [];\n\n  Object.defineProperty(this, \"Kids\", {\n    enumerable: false,\n    configurable: true,\n    get: function() {\n      if (_Kids.length > 0) {\n        return _Kids;\n      } else {\n        return undefined;\n      }\n    }\n  });\n  Object.defineProperty(this, \"Fields\", {\n    enumerable: false,\n    configurable: false,\n    get: function() {\n      return _Kids;\n    }\n  });\n\n  // Default Appearance\n  var _DA;\n  Object.defineProperty(this, \"DA\", {\n    enumerable: false,\n    configurable: false,\n    get: function() {\n      if (!_DA) {\n        return undefined;\n      }\n      var encryptor = function(data) {\n        return data;\n      };\n      if (this.scope) encryptor = this.scope.internal.getEncryptor(this.objId);\n      return \"(\" + pdfEscape(encryptor(_DA)) + \")\";\n    },\n    set: function(value) {\n      _DA = value;\n    }\n  });\n};\n\ninherit(AcroFormDictionary, AcroFormPDFObject);\n\n/**\n * The Field Object contains the Variables, that every Field needs\n *\n * @class AcroFormField\n * @classdesc An AcroForm FieldObject\n */\nvar AcroFormField = function() {\n  AcroFormPDFObject.call(this);\n\n  //Annotation-Flag See Table 165\n  var _F = 4;\n  Object.defineProperty(this, \"F\", {\n    enumerable: false,\n    configurable: false,\n    get: function() {\n      return _F;\n    },\n    set: function(value) {\n      if (!isNaN(value)) {\n        _F = value;\n      } else {\n        throw new Error(\n          'Invalid value \"' + value + '\" for attribute F supplied.'\n        );\n      }\n    }\n  });\n\n  /**\n   * (PDF 1.2) If set, print the annotation when the page is printed. If clear, never print the annotation, regardless of wether is is displayed on the screen.\n   * NOTE 2 This can be useful for annotations representing interactive pushbuttons, which would serve no meaningful purpose on the printed page.\n   *\n   * @name AcroFormField#showWhenPrinted\n   * @default true\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"showWhenPrinted\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(_F, 3));\n    },\n    set: function(value) {\n      if (Boolean(value) === true) {\n        this.F = setBitForPdf(_F, 3);\n      } else {\n        this.F = clearBitForPdf(_F, 3);\n      }\n    }\n  });\n\n  var _Ff = 0;\n  Object.defineProperty(this, \"Ff\", {\n    enumerable: false,\n    configurable: false,\n    get: function() {\n      return _Ff;\n    },\n    set: function(value) {\n      if (!isNaN(value)) {\n        _Ff = value;\n      } else {\n        throw new Error(\n          'Invalid value \"' + value + '\" for attribute Ff supplied.'\n        );\n      }\n    }\n  });\n\n  var _Rect = [];\n  Object.defineProperty(this, \"Rect\", {\n    enumerable: false,\n    configurable: false,\n    get: function() {\n      if (_Rect.length === 0) {\n        return undefined;\n      }\n      return _Rect;\n    },\n    set: function(value) {\n      if (typeof value !== \"undefined\") {\n        _Rect = value;\n      } else {\n        _Rect = [];\n      }\n    }\n  });\n\n  /**\n   * The x-position of the field.\n   *\n   * @name AcroFormField#x\n   * @default null\n   * @type {number}\n   */\n  Object.defineProperty(this, \"x\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      if (!_Rect || isNaN(_Rect[0])) {\n        return 0;\n      }\n      return _Rect[0];\n    },\n    set: function(value) {\n      _Rect[0] = value;\n    }\n  });\n\n  /**\n   * The y-position of the field.\n   *\n   * @name AcroFormField#y\n   * @default null\n   * @type {number}\n   */\n  Object.defineProperty(this, \"y\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      if (!_Rect || isNaN(_Rect[1])) {\n        return 0;\n      }\n      return _Rect[1];\n    },\n    set: function(value) {\n      _Rect[1] = value;\n    }\n  });\n\n  /**\n   * The width of the field.\n   *\n   * @name AcroFormField#width\n   * @default null\n   * @type {number}\n   */\n  Object.defineProperty(this, \"width\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      if (!_Rect || isNaN(_Rect[2])) {\n        return 0;\n      }\n      return _Rect[2];\n    },\n    set: function(value) {\n      _Rect[2] = value;\n    }\n  });\n\n  /**\n   * The height of the field.\n   *\n   * @name AcroFormField#height\n   * @default null\n   * @type {number}\n   */\n  Object.defineProperty(this, \"height\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      if (!_Rect || isNaN(_Rect[3])) {\n        return 0;\n      }\n      return _Rect[3];\n    },\n    set: function(value) {\n      _Rect[3] = value;\n    }\n  });\n\n  var _FT = \"\";\n  Object.defineProperty(this, \"FT\", {\n    enumerable: true,\n    configurable: false,\n    get: function() {\n      return _FT;\n    },\n    set: function(value) {\n      switch (value) {\n        case \"/Btn\":\n        case \"/Tx\":\n        case \"/Ch\":\n        case \"/Sig\":\n          _FT = value;\n          break;\n        default:\n          throw new Error(\n            'Invalid value \"' + value + '\" for attribute FT supplied.'\n          );\n      }\n    }\n  });\n\n  var _T = null;\n\n  Object.defineProperty(this, \"T\", {\n    enumerable: true,\n    configurable: false,\n    get: function() {\n      if (!_T || _T.length < 1) {\n        // In case of a Child from a Radio´Group, you don't need a FieldName\n        if (this instanceof AcroFormChildClass) {\n          return undefined;\n        }\n        _T = \"FieldObject\" + AcroFormField.FieldNum++;\n      }\n      var encryptor = function(data) {\n        return data;\n      };\n      if (this.scope) encryptor = this.scope.internal.getEncryptor(this.objId);\n      return \"(\" + pdfEscape(encryptor(_T)) + \")\";\n    },\n    set: function(value) {\n      _T = value.toString();\n    }\n  });\n\n  /**\n   * (Optional) The partial field name (see 12.7.3.2, “Field Names”).\n   *\n   * @name AcroFormField#fieldName\n   * @default null\n   * @type {string}\n   */\n  Object.defineProperty(this, \"fieldName\", {\n    configurable: true,\n    enumerable: true,\n    get: function() {\n      return _T;\n    },\n    set: function(value) {\n      _T = value;\n    }\n  });\n\n  var _fontName = \"helvetica\";\n  /**\n   * The fontName of the font to be used.\n   *\n   * @name AcroFormField#fontName\n   * @default 'helvetica'\n   * @type {string}\n   */\n  Object.defineProperty(this, \"fontName\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return _fontName;\n    },\n    set: function(value) {\n      _fontName = value;\n    }\n  });\n\n  var _fontStyle = \"normal\";\n  /**\n   * The fontStyle of the font to be used.\n   *\n   * @name AcroFormField#fontStyle\n   * @default 'normal'\n   * @type {string}\n   */\n  Object.defineProperty(this, \"fontStyle\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return _fontStyle;\n    },\n    set: function(value) {\n      _fontStyle = value;\n    }\n  });\n\n  var _fontSize = 0;\n  /**\n   * The fontSize of the font to be used.\n   *\n   * @name AcroFormField#fontSize\n   * @default 0 (for auto)\n   * @type {number}\n   */\n  Object.defineProperty(this, \"fontSize\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return _fontSize;\n    },\n    set: function(value) {\n      _fontSize = value;\n    }\n  });\n\n  var _maxFontSize = undefined;\n  /**\n   * The maximum fontSize of the font to be used.\n   *\n   * @name AcroFormField#maxFontSize\n   * @default 0 (for auto)\n   * @type {number}\n   */\n  Object.defineProperty(this, \"maxFontSize\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      if (_maxFontSize === undefined) {\n        // use the old default value here - the value is some kind of random as it depends on the scaleFactor (user unit)\n        // (\"50\" is transformed to the \"user space\" but then used in \"pdf space\")\n        return 50 / scaleFactor;\n      } else {\n        return _maxFontSize;\n      }\n    },\n    set: function(value) {\n      _maxFontSize = value;\n    }\n  });\n\n  var _color = \"black\";\n  /**\n   * The color of the text\n   *\n   * @name AcroFormField#color\n   * @default 'black'\n   * @type {string|rgba}\n   */\n  Object.defineProperty(this, \"color\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return _color;\n    },\n    set: function(value) {\n      _color = value;\n    }\n  });\n\n  var _DA = \"/F1 0 Tf 0 g\";\n  // Defines the default appearance (Needed for variable Text)\n  Object.defineProperty(this, \"DA\", {\n    enumerable: true,\n    configurable: false,\n    get: function() {\n      if (\n        !_DA ||\n        this instanceof AcroFormChildClass ||\n        this instanceof AcroFormTextField\n      ) {\n        return undefined;\n      }\n      return toPdfString(_DA, this.objId, this.scope);\n    },\n    set: function(value) {\n      value = value.toString();\n      _DA = value;\n    }\n  });\n\n  var _DV = null;\n  Object.defineProperty(this, \"DV\", {\n    enumerable: false,\n    configurable: false,\n    get: function() {\n      if (!_DV) {\n        return undefined;\n      }\n      if (this instanceof AcroFormButton === false) {\n        return toPdfString(_DV, this.objId, this.scope);\n      }\n      return _DV;\n    },\n    set: function(value) {\n      value = value.toString();\n      if (this instanceof AcroFormButton === false) {\n        if (value.substr(0, 1) === \"(\") {\n          _DV = pdfUnescape(value.substr(1, value.length - 2));\n        } else {\n          _DV = pdfUnescape(value);\n        }\n      } else {\n        _DV = value;\n      }\n    }\n  });\n\n  /**\n   * (Optional; inheritable) The default value to which the field reverts when a reset-form action is executed (see 12.7.5.3, “Reset-Form Action”). The format of this value is the same as that of value.\n   *\n   * @name AcroFormField#defaultValue\n   * @default null\n   * @type {any}\n   */\n  Object.defineProperty(this, \"defaultValue\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      if (this instanceof AcroFormButton === true) {\n        return pdfUnescape(_DV.substr(1, _DV.length - 1));\n      } else {\n        return _DV;\n      }\n    },\n    set: function(value) {\n      value = value.toString();\n      if (this instanceof AcroFormButton === true) {\n        _DV = \"/\" + value;\n      } else {\n        _DV = value;\n      }\n    }\n  });\n\n  var _V = null;\n  Object.defineProperty(this, \"_V\", {\n    enumerable: false,\n    configurable: false,\n    get: function() {\n      if (!_V) {\n        return undefined;\n      }\n      return _V;\n    },\n    set: function(value) {\n      this.V = value;\n    }\n  });\n  Object.defineProperty(this, \"V\", {\n    enumerable: false,\n    configurable: false,\n    get: function() {\n      if (!_V) {\n        return undefined;\n      }\n      if (this instanceof AcroFormButton === false) {\n        return toPdfString(_V, this.objId, this.scope);\n      }\n      return _V;\n    },\n    set: function(value) {\n      value = value.toString();\n      if (this instanceof AcroFormButton === false) {\n        if (value.substr(0, 1) === \"(\") {\n          _V = pdfUnescape(value.substr(1, value.length - 2));\n        } else {\n          _V = pdfUnescape(value);\n        }\n      } else {\n        _V = value;\n      }\n    }\n  });\n\n  /**\n   * (Optional; inheritable) The field’s value, whose format varies depending on the field type. See the descriptions of individual field types for further information.\n   *\n   * @name AcroFormField#value\n   * @default null\n   * @type {any}\n   */\n  Object.defineProperty(this, \"value\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      if (this instanceof AcroFormButton === true) {\n        return pdfUnescape(_V.substr(1, _V.length - 1));\n      } else {\n        return _V;\n      }\n    },\n    set: function(value) {\n      value = value.toString();\n      if (this instanceof AcroFormButton === true) {\n        _V = \"/\" + value;\n      } else {\n        _V = value;\n      }\n    }\n  });\n\n  /**\n   * Check if field has annotations\n   *\n   * @name AcroFormField#hasAnnotation\n   * @readonly\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"hasAnnotation\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return this.Rect;\n    }\n  });\n\n  Object.defineProperty(this, \"Type\", {\n    enumerable: true,\n    configurable: false,\n    get: function() {\n      return this.hasAnnotation ? \"/Annot\" : null;\n    }\n  });\n\n  Object.defineProperty(this, \"Subtype\", {\n    enumerable: true,\n    configurable: false,\n    get: function() {\n      return this.hasAnnotation ? \"/Widget\" : null;\n    }\n  });\n\n  var _hasAppearanceStream = false;\n  /**\n   * true if field has an appearanceStream\n   *\n   * @name AcroFormField#hasAppearanceStream\n   * @readonly\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"hasAppearanceStream\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return _hasAppearanceStream;\n    },\n    set: function(value) {\n      value = Boolean(value);\n      _hasAppearanceStream = value;\n    }\n  });\n\n  /**\n   * The page on which the AcroFormField is placed\n   *\n   * @name AcroFormField#page\n   * @type {number}\n   */\n  var _page;\n  Object.defineProperty(this, \"page\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      if (!_page) {\n        return undefined;\n      }\n      return _page;\n    },\n    set: function(value) {\n      _page = value;\n    }\n  });\n\n  /**\n   * If set, the user may not change the value of the field. Any associated widget annotations will not interact with the user; that is, they will not respond to mouse clicks or change their appearance in response to mouse motions. This flag is useful for fields whose values are computed or imported from a database.\n   *\n   * @name AcroFormField#readOnly\n   * @default false\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"readOnly\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(this.Ff, 1));\n    },\n    set: function(value) {\n      if (Boolean(value) === true) {\n        this.Ff = setBitForPdf(this.Ff, 1);\n      } else {\n        this.Ff = clearBitForPdf(this.Ff, 1);\n      }\n    }\n  });\n\n  /**\n   * If set, the field shall have a value at the time it is exported by a submitform action (see 12.7.5.2, “Submit-Form Action”).\n   *\n   * @name AcroFormField#required\n   * @default false\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"required\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(this.Ff, 2));\n    },\n    set: function(value) {\n      if (Boolean(value) === true) {\n        this.Ff = setBitForPdf(this.Ff, 2);\n      } else {\n        this.Ff = clearBitForPdf(this.Ff, 2);\n      }\n    }\n  });\n\n  /**\n   * If set, the field shall not be exported by a submit-form action (see 12.7.5.2, “Submit-Form Action”)\n   *\n   * @name AcroFormField#noExport\n   * @default false\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"noExport\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(this.Ff, 3));\n    },\n    set: function(value) {\n      if (Boolean(value) === true) {\n        this.Ff = setBitForPdf(this.Ff, 3);\n      } else {\n        this.Ff = clearBitForPdf(this.Ff, 3);\n      }\n    }\n  });\n\n  var _Q = null;\n  Object.defineProperty(this, \"Q\", {\n    enumerable: true,\n    configurable: false,\n    get: function() {\n      if (_Q === null) {\n        return undefined;\n      }\n      return _Q;\n    },\n    set: function(value) {\n      if ([0, 1, 2].indexOf(value) !== -1) {\n        _Q = value;\n      } else {\n        throw new Error(\n          'Invalid value \"' + value + '\" for attribute Q supplied.'\n        );\n      }\n    }\n  });\n\n  /**\n   * (Optional; inheritable) A code specifying the form of quadding (justification) that shall be used in displaying the text:\n   * 'left', 'center', 'right'\n   *\n   * @name AcroFormField#textAlign\n   * @default 'left'\n   * @type {string}\n   */\n  Object.defineProperty(this, \"textAlign\", {\n    get: function() {\n      var result;\n      switch (_Q) {\n        case 0:\n        default:\n          result = \"left\";\n          break;\n        case 1:\n          result = \"center\";\n          break;\n        case 2:\n          result = \"right\";\n          break;\n      }\n      return result;\n    },\n    configurable: true,\n    enumerable: true,\n    set: function(value) {\n      switch (value) {\n        case \"right\":\n        case 2:\n          _Q = 2;\n          break;\n        case \"center\":\n        case 1:\n          _Q = 1;\n          break;\n        case \"left\":\n        case 0:\n        default:\n          _Q = 0;\n      }\n    }\n  });\n};\n\ninherit(AcroFormField, AcroFormPDFObject);\n\n/**\n * @class AcroFormChoiceField\n * @extends AcroFormField\n */\nvar AcroFormChoiceField = function() {\n  AcroFormField.call(this);\n  // Field Type = Choice Field\n  this.FT = \"/Ch\";\n  // options\n  this.V = \"()\";\n\n  this.fontName = \"zapfdingbats\";\n  // Top Index\n  var _TI = 0;\n\n  Object.defineProperty(this, \"TI\", {\n    enumerable: true,\n    configurable: false,\n    get: function() {\n      return _TI;\n    },\n    set: function(value) {\n      _TI = value;\n    }\n  });\n\n  /**\n   * (Optional) For scrollable list boxes, the top index (the index in the Opt array of the first option visible in the list). Default value: 0.\n   *\n   * @name AcroFormChoiceField#topIndex\n   * @default 0\n   * @type {number}\n   */\n  Object.defineProperty(this, \"topIndex\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return _TI;\n    },\n    set: function(value) {\n      _TI = value;\n    }\n  });\n\n  var _Opt = [];\n  Object.defineProperty(this, \"Opt\", {\n    enumerable: true,\n    configurable: false,\n    get: function() {\n      return arrayToPdfArray(_Opt, this.objId, this.scope);\n    },\n    set: function(value) {\n      _Opt = pdfArrayToStringArray(value);\n    }\n  });\n\n  /**\n   * @memberof AcroFormChoiceField\n   * @name getOptions\n   * @function\n   * @instance\n   * @returns {array} array of Options\n   */\n  this.getOptions = function() {\n    return _Opt;\n  };\n\n  /**\n   * @memberof AcroFormChoiceField\n   * @name setOptions\n   * @function\n   * @instance\n   * @param {array} value\n   */\n  this.setOptions = function(value) {\n    _Opt = value;\n    if (this.sort) {\n      _Opt.sort();\n    }\n  };\n\n  /**\n   * @memberof AcroFormChoiceField\n   * @name addOption\n   * @function\n   * @instance\n   * @param {string} value\n   */\n  this.addOption = function(value) {\n    value = value || \"\";\n    value = value.toString();\n    _Opt.push(value);\n    if (this.sort) {\n      _Opt.sort();\n    }\n  };\n\n  /**\n   * @memberof AcroFormChoiceField\n   * @name removeOption\n   * @function\n   * @instance\n   * @param {string} value\n   * @param {boolean} allEntries (default: false)\n   */\n  this.removeOption = function(value, allEntries) {\n    allEntries = allEntries || false;\n    value = value || \"\";\n    value = value.toString();\n\n    while (_Opt.indexOf(value) !== -1) {\n      _Opt.splice(_Opt.indexOf(value), 1);\n      if (allEntries === false) {\n        break;\n      }\n    }\n  };\n\n  /**\n   * If set, the field is a combo box; if clear, the field is a list box.\n   *\n   * @name AcroFormChoiceField#combo\n   * @default false\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"combo\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(this.Ff, 18));\n    },\n    set: function(value) {\n      if (Boolean(value) === true) {\n        this.Ff = setBitForPdf(this.Ff, 18);\n      } else {\n        this.Ff = clearBitForPdf(this.Ff, 18);\n      }\n    }\n  });\n\n  /**\n   * If set, the combo box shall include an editable text box as well as a drop-down list; if clear, it shall include only a drop-down list. This flag shall be used only if the Combo flag is set.\n   *\n   * @name AcroFormChoiceField#edit\n   * @default false\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"edit\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(this.Ff, 19));\n    },\n    set: function(value) {\n      //PDF 32000-1:2008, page 444\n      if (this.combo === true) {\n        if (Boolean(value) === true) {\n          this.Ff = setBitForPdf(this.Ff, 19);\n        } else {\n          this.Ff = clearBitForPdf(this.Ff, 19);\n        }\n      }\n    }\n  });\n\n  /**\n   * If set, the field’s option items shall be sorted alphabetically. This flag is intended for use by writers, not by readers. Conforming readers shall display the options in the order in which they occur in the Opt array (see Table 231).\n   *\n   * @name AcroFormChoiceField#sort\n   * @default false\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"sort\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(this.Ff, 20));\n    },\n    set: function(value) {\n      if (Boolean(value) === true) {\n        this.Ff = setBitForPdf(this.Ff, 20);\n        _Opt.sort();\n      } else {\n        this.Ff = clearBitForPdf(this.Ff, 20);\n      }\n    }\n  });\n\n  /**\n   * (PDF 1.4) If set, more than one of the field’s option items may be selected simultaneously; if clear, at most one item shall be selected\n   *\n   * @name AcroFormChoiceField#multiSelect\n   * @default false\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"multiSelect\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(this.Ff, 22));\n    },\n    set: function(value) {\n      if (Boolean(value) === true) {\n        this.Ff = setBitForPdf(this.Ff, 22);\n      } else {\n        this.Ff = clearBitForPdf(this.Ff, 22);\n      }\n    }\n  });\n\n  /**\n   * (PDF 1.4) If set, text entered in the field shall not be spellchecked. This flag shall not be used unless the Combo and Edit flags are both set.\n   *\n   * @name AcroFormChoiceField#doNotSpellCheck\n   * @default false\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"doNotSpellCheck\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(this.Ff, 23));\n    },\n    set: function(value) {\n      if (Boolean(value) === true) {\n        this.Ff = setBitForPdf(this.Ff, 23);\n      } else {\n        this.Ff = clearBitForPdf(this.Ff, 23);\n      }\n    }\n  });\n\n  /**\n   * (PDF 1.5) If set, the new value shall be committed as soon as a selection is made (commonly with the pointing device). In this case, supplying a value for a field involves three actions: selecting the field for fill-in, selecting a choice for the fill-in value, and leaving that field, which finalizes or “commits” the data choice and triggers any actions associated with the entry or changing of this data. If this flag is on, then processing does not wait for leaving the field action to occur, but immediately proceeds to the third step.\n   * This option enables applications to perform an action once a selection is made, without requiring the user to exit the field. If clear, the new value is not committed until the user exits the field.\n   *\n   * @name AcroFormChoiceField#commitOnSelChange\n   * @default false\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"commitOnSelChange\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(this.Ff, 27));\n    },\n    set: function(value) {\n      if (Boolean(value) === true) {\n        this.Ff = setBitForPdf(this.Ff, 27);\n      } else {\n        this.Ff = clearBitForPdf(this.Ff, 27);\n      }\n    }\n  });\n\n  this.hasAppearanceStream = false;\n};\ninherit(AcroFormChoiceField, AcroFormField);\n\n/**\n * @class AcroFormListBox\n * @extends AcroFormChoiceField\n * @extends AcroFormField\n */\nvar AcroFormListBox = function() {\n  AcroFormChoiceField.call(this);\n  this.fontName = \"helvetica\";\n\n  //PDF 32000-1:2008, page 444\n  this.combo = false;\n};\ninherit(AcroFormListBox, AcroFormChoiceField);\n\n/**\n * @class AcroFormComboBox\n * @extends AcroFormListBox\n * @extends AcroFormChoiceField\n * @extends AcroFormField\n */\nvar AcroFormComboBox = function() {\n  AcroFormListBox.call(this);\n  this.combo = true;\n};\ninherit(AcroFormComboBox, AcroFormListBox);\n\n/**\n * @class AcroFormEditBox\n * @extends AcroFormComboBox\n * @extends AcroFormListBox\n * @extends AcroFormChoiceField\n * @extends AcroFormField\n */\nvar AcroFormEditBox = function() {\n  AcroFormComboBox.call(this);\n  this.edit = true;\n};\ninherit(AcroFormEditBox, AcroFormComboBox);\n\n/**\n * @class AcroFormButton\n * @extends AcroFormField\n */\nvar AcroFormButton = function() {\n  AcroFormField.call(this);\n  this.FT = \"/Btn\";\n\n  /**\n   * (Radio buttons only) If set, exactly one radio button shall be selected at all times; selecting the currently selected button has no effect. If clear, clicking the selected button deselects it, leaving no button selected.\n   *\n   * @name AcroFormButton#noToggleToOff\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"noToggleToOff\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(this.Ff, 15));\n    },\n    set: function(value) {\n      if (Boolean(value) === true) {\n        this.Ff = setBitForPdf(this.Ff, 15);\n      } else {\n        this.Ff = clearBitForPdf(this.Ff, 15);\n      }\n    }\n  });\n\n  /**\n   * If set, the field is a set of radio buttons; if clear, the field is a checkbox. This flag may be set only if the Pushbutton flag is clear.\n   *\n   * @name AcroFormButton#radio\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"radio\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(this.Ff, 16));\n    },\n    set: function(value) {\n      if (Boolean(value) === true) {\n        this.Ff = setBitForPdf(this.Ff, 16);\n      } else {\n        this.Ff = clearBitForPdf(this.Ff, 16);\n      }\n    }\n  });\n\n  /**\n   * If set, the field is a pushbutton that does not retain a permanent value.\n   *\n   * @name AcroFormButton#pushButton\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"pushButton\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(this.Ff, 17));\n    },\n    set: function(value) {\n      if (Boolean(value) === true) {\n        this.Ff = setBitForPdf(this.Ff, 17);\n      } else {\n        this.Ff = clearBitForPdf(this.Ff, 17);\n      }\n    }\n  });\n\n  /**\n   * (PDF 1.5) If set, a group of radio buttons within a radio button field that use the same value for the on state will turn on and off in unison; that is if one is checked, they are all checked. If clear, the buttons are mutually exclusive (the same behavior as HTML radio buttons).\n   *\n   * @name AcroFormButton#radioIsUnison\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"radioIsUnison\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(this.Ff, 26));\n    },\n    set: function(value) {\n      if (Boolean(value) === true) {\n        this.Ff = setBitForPdf(this.Ff, 26);\n      } else {\n        this.Ff = clearBitForPdf(this.Ff, 26);\n      }\n    }\n  });\n\n  var _MK = {};\n  Object.defineProperty(this, \"MK\", {\n    enumerable: false,\n    configurable: false,\n    get: function() {\n      var encryptor = function(data) {\n        return data;\n      };\n      if (this.scope) encryptor = this.scope.internal.getEncryptor(this.objId);\n      if (Object.keys(_MK).length !== 0) {\n        var result = [];\n        result.push(\"<<\");\n        var key;\n        for (key in _MK) {\n          result.push(\"/\" + key + \" (\" + pdfEscape(encryptor(_MK[key])) + \")\");\n        }\n        result.push(\">>\");\n        return result.join(\"\\n\");\n      }\n      return undefined;\n    },\n    set: function(value) {\n      if (typeof value === \"object\") {\n        _MK = value;\n      }\n    }\n  });\n\n  /**\n   * From the PDF reference:\n   * (Optional, button fields only) The widget annotation's normal caption which shall be displayed when it is not interacting with the user.\n   * Unlike the remaining entries listed in this Table which apply only to widget annotations associated with pushbutton fields (see Pushbuttons in 12.7.4.2, \"Button Fields\"), the CA entry may be used with any type of button field, including check boxes (see Check Boxes in 12.7.4.2, \"Button Fields\") and radio buttons (Radio Buttons in 12.7.4.2, \"Button Fields\").\n   *\n   * - '8' = Cross,\n   * - 'l' =  Circle,\n   * - '' = nothing\n   * @name AcroFormButton#caption\n   * @type {string}\n   */\n  Object.defineProperty(this, \"caption\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return _MK.CA || \"\";\n    },\n    set: function(value) {\n      if (typeof value === \"string\") {\n        _MK.CA = value;\n      }\n    }\n  });\n\n  var _AS;\n  Object.defineProperty(this, \"AS\", {\n    enumerable: false,\n    configurable: false,\n    get: function() {\n      return _AS;\n    },\n    set: function(value) {\n      _AS = value;\n    }\n  });\n\n  /**\n   * (Required if the appearance dictionary AP contains one or more subdictionaries; PDF 1.2) The annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary (see Section 12.5.5, \"Appearance Streams\")\n   *\n   * @name AcroFormButton#appearanceState\n   * @type {any}\n   */\n  Object.defineProperty(this, \"appearanceState\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return _AS.substr(1, _AS.length - 1);\n    },\n    set: function(value) {\n      _AS = \"/\" + value;\n    }\n  });\n};\ninherit(AcroFormButton, AcroFormField);\n\n/**\n * @class AcroFormPushButton\n * @extends AcroFormButton\n * @extends AcroFormField\n */\nvar AcroFormPushButton = function() {\n  AcroFormButton.call(this);\n  this.pushButton = true;\n};\ninherit(AcroFormPushButton, AcroFormButton);\n\n/**\n * @class AcroFormRadioButton\n * @extends AcroFormButton\n * @extends AcroFormField\n */\nvar AcroFormRadioButton = function() {\n  AcroFormButton.call(this);\n  this.radio = true;\n  this.pushButton = false;\n\n  var _Kids = [];\n  Object.defineProperty(this, \"Kids\", {\n    enumerable: true,\n    configurable: false,\n    get: function() {\n      return _Kids;\n    },\n    set: function(value) {\n      if (typeof value !== \"undefined\") {\n        _Kids = value;\n      } else {\n        _Kids = [];\n      }\n    }\n  });\n};\ninherit(AcroFormRadioButton, AcroFormButton);\n\n/**\n * The Child class of a RadioButton (the radioGroup) -> The single Buttons\n *\n * @class AcroFormChildClass\n * @extends AcroFormField\n * @ignore\n */\nvar AcroFormChildClass = function() {\n  AcroFormField.call(this);\n\n  var _parent;\n  Object.defineProperty(this, \"Parent\", {\n    enumerable: false,\n    configurable: false,\n    get: function() {\n      return _parent;\n    },\n    set: function(value) {\n      _parent = value;\n    }\n  });\n\n  var _optionName;\n  Object.defineProperty(this, \"optionName\", {\n    enumerable: false,\n    configurable: true,\n    get: function() {\n      return _optionName;\n    },\n    set: function(value) {\n      _optionName = value;\n    }\n  });\n\n  var _MK = {};\n  Object.defineProperty(this, \"MK\", {\n    enumerable: false,\n    configurable: false,\n    get: function() {\n      var encryptor = function(data) {\n        return data;\n      };\n      if (this.scope) encryptor = this.scope.internal.getEncryptor(this.objId);\n      var result = [];\n      result.push(\"<<\");\n      var key;\n      for (key in _MK) {\n        result.push(\"/\" + key + \" (\" + pdfEscape(encryptor(_MK[key])) + \")\");\n      }\n      result.push(\">>\");\n      return result.join(\"\\n\");\n    },\n    set: function(value) {\n      if (typeof value === \"object\") {\n        _MK = value;\n      }\n    }\n  });\n\n  /**\n   * From the PDF reference:\n   * (Optional, button fields only) The widget annotation's normal caption which shall be displayed when it is not interacting with the user.\n   * Unlike the remaining entries listed in this Table which apply only to widget annotations associated with pushbutton fields (see Pushbuttons in 12.7.4.2, \"Button Fields\"), the CA entry may be used with any type of button field, including check boxes (see Check Boxes in 12.7.4.2, \"Button Fields\") and radio buttons (Radio Buttons in 12.7.4.2, \"Button Fields\").\n   *\n   * - '8' = Cross,\n   * - 'l' =  Circle,\n   * - '' = nothing\n   * @name AcroFormButton#caption\n   * @type {string}\n   */\n  Object.defineProperty(this, \"caption\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return _MK.CA || \"\";\n    },\n    set: function(value) {\n      if (typeof value === \"string\") {\n        _MK.CA = value;\n      }\n    }\n  });\n\n  var _AS;\n  Object.defineProperty(this, \"AS\", {\n    enumerable: false,\n    configurable: false,\n    get: function() {\n      return _AS;\n    },\n    set: function(value) {\n      _AS = value;\n    }\n  });\n\n  /**\n   * (Required if the appearance dictionary AP contains one or more subdictionaries; PDF 1.2) The annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary (see Section 12.5.5, \"Appearance Streams\")\n   *\n   * @name AcroFormButton#appearanceState\n   * @type {any}\n   */\n  Object.defineProperty(this, \"appearanceState\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return _AS.substr(1, _AS.length - 1);\n    },\n    set: function(value) {\n      _AS = \"/\" + value;\n    }\n  });\n  this.caption = \"l\";\n  this.appearanceState = \"Off\";\n  // todo: set AppearanceType as variable that can be set from the\n  // outside...\n  this._AppearanceType = AcroFormAppearance.RadioButton.Circle;\n  // The Default appearanceType is the Circle\n  this.appearanceStreamContent = this._AppearanceType.createAppearanceStream(\n    this.optionName\n  );\n};\ninherit(AcroFormChildClass, AcroFormField);\n\nAcroFormRadioButton.prototype.setAppearance = function(appearance) {\n  if (!(\"createAppearanceStream\" in appearance && \"getCA\" in appearance)) {\n    throw new Error(\n      \"Couldn't assign Appearance to RadioButton. Appearance was Invalid!\"\n    );\n  }\n  for (var objId in this.Kids) {\n    if (this.Kids.hasOwnProperty(objId)) {\n      var child = this.Kids[objId];\n      child.appearanceStreamContent = appearance.createAppearanceStream(\n        child.optionName\n      );\n      child.caption = appearance.getCA();\n    }\n  }\n};\n\nAcroFormRadioButton.prototype.createOption = function(name) {\n  // Create new Child for RadioGroup\n  var child = new AcroFormChildClass();\n  child.Parent = this;\n  child.optionName = name;\n  // Add to Parent\n  this.Kids.push(child);\n\n  addField.call(this.scope, child);\n\n  return child;\n};\n\n/**\n * @class AcroFormCheckBox\n * @extends AcroFormButton\n * @extends AcroFormField\n */\nvar AcroFormCheckBox = function() {\n  AcroFormButton.call(this);\n\n  this.fontName = \"zapfdingbats\";\n  this.caption = \"3\";\n  this.appearanceState = \"On\";\n  this.value = \"On\";\n  this.textAlign = \"center\";\n  this.appearanceStreamContent = AcroFormAppearance.CheckBox.createAppearanceStream();\n};\ninherit(AcroFormCheckBox, AcroFormButton);\n\n/**\n * @class AcroFormTextField\n * @extends AcroFormField\n */\nvar AcroFormTextField = function() {\n  AcroFormField.call(this);\n  this.FT = \"/Tx\";\n\n  /**\n   * If set, the field may contain multiple lines of text; if clear, the field’s text shall be restricted to a single line.\n   *\n   * @name AcroFormTextField#multiline\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"multiline\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(this.Ff, 13));\n    },\n    set: function(value) {\n      if (Boolean(value) === true) {\n        this.Ff = setBitForPdf(this.Ff, 13);\n      } else {\n        this.Ff = clearBitForPdf(this.Ff, 13);\n      }\n    }\n  });\n\n  /**\n   * (PDF 1.4) If set, the text entered in the field represents the pathname of a file whose contents shall be submitted as the value of the field.\n   *\n   * @name AcroFormTextField#fileSelect\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"fileSelect\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(this.Ff, 21));\n    },\n    set: function(value) {\n      if (Boolean(value) === true) {\n        this.Ff = setBitForPdf(this.Ff, 21);\n      } else {\n        this.Ff = clearBitForPdf(this.Ff, 21);\n      }\n    }\n  });\n\n  /**\n   * (PDF 1.4) If set, text entered in the field shall not be spell-checked.\n   *\n   * @name AcroFormTextField#doNotSpellCheck\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"doNotSpellCheck\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(this.Ff, 23));\n    },\n    set: function(value) {\n      if (Boolean(value) === true) {\n        this.Ff = setBitForPdf(this.Ff, 23);\n      } else {\n        this.Ff = clearBitForPdf(this.Ff, 23);\n      }\n    }\n  });\n\n  /**\n   * (PDF 1.4) If set, the field shall not scroll (horizontally for single-line fields, vertically for multiple-line fields) to accommodate more text than fits within its annotation rectangle. Once the field is full, no further text shall be accepted for interactive form filling; for noninteractive form filling, the filler should take care not to add more character than will visibly fit in the defined area.\n   *\n   * @name AcroFormTextField#doNotScroll\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"doNotScroll\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(this.Ff, 24));\n    },\n    set: function(value) {\n      if (Boolean(value) === true) {\n        this.Ff = setBitForPdf(this.Ff, 24);\n      } else {\n        this.Ff = clearBitForPdf(this.Ff, 24);\n      }\n    }\n  });\n\n  /**\n   * (PDF 1.5) May be set only if the MaxLen entry is present in the text field dictionary (see Table 229) and if the Multiline, Password, and FileSelect flags are clear. If set, the field shall be automatically divided into as many equally spaced positions, or combs, as the value of MaxLen, and the text is laid out into those combs.\n   *\n   * @name AcroFormTextField#comb\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"comb\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(this.Ff, 25));\n    },\n    set: function(value) {\n      if (Boolean(value) === true) {\n        this.Ff = setBitForPdf(this.Ff, 25);\n      } else {\n        this.Ff = clearBitForPdf(this.Ff, 25);\n      }\n    }\n  });\n\n  /**\n   * (PDF 1.5) If set, the value of this field shall be a rich text string (see 12.7.3.4, “Rich Text Strings”). If the field has a value, the RV entry of the field dictionary (Table 222) shall specify the rich text string.\n   *\n   * @name AcroFormTextField#richText\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"richText\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(this.Ff, 26));\n    },\n    set: function(value) {\n      if (Boolean(value) === true) {\n        this.Ff = setBitForPdf(this.Ff, 26);\n      } else {\n        this.Ff = clearBitForPdf(this.Ff, 26);\n      }\n    }\n  });\n\n  var _MaxLen = null;\n  Object.defineProperty(this, \"MaxLen\", {\n    enumerable: true,\n    configurable: false,\n    get: function() {\n      return _MaxLen;\n    },\n    set: function(value) {\n      _MaxLen = value;\n    }\n  });\n\n  /**\n   * (Optional; inheritable) The maximum length of the field’s text, in characters.\n   *\n   * @name AcroFormTextField#maxLength\n   * @type {number}\n   */\n  Object.defineProperty(this, \"maxLength\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return _MaxLen;\n    },\n    set: function(value) {\n      if (Number.isInteger(value)) {\n        _MaxLen = value;\n      }\n    }\n  });\n\n  Object.defineProperty(this, \"hasAppearanceStream\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return this.V || this.DV;\n    }\n  });\n};\ninherit(AcroFormTextField, AcroFormField);\n\n/**\n * @class AcroFormPasswordField\n * @extends AcroFormTextField\n * @extends AcroFormField\n */\nvar AcroFormPasswordField = function() {\n  AcroFormTextField.call(this);\n\n  /**\n   * If set, the field is intended for entering a secure password that should not be echoed visibly to the screen. Characters typed from the keyboard shall instead be echoed in some unreadable form, such as asterisks or bullet characters.\n   * NOTE To protect password confidentiality, readers should never store the value of the text field in the PDF file if this flag is set.\n   *\n   * @name AcroFormTextField#password\n   * @type {boolean}\n   */\n  Object.defineProperty(this, \"password\", {\n    enumerable: true,\n    configurable: true,\n    get: function() {\n      return Boolean(getBitForPdf(this.Ff, 14));\n    },\n    set: function(value) {\n      if (Boolean(value) === true) {\n        this.Ff = setBitForPdf(this.Ff, 14);\n      } else {\n        this.Ff = clearBitForPdf(this.Ff, 14);\n      }\n    }\n  });\n  this.password = true;\n};\ninherit(AcroFormPasswordField, AcroFormTextField);\n\n// Contains Methods for creating standard appearances\nvar AcroFormAppearance = {\n  CheckBox: {\n    createAppearanceStream: function() {\n      var appearance = {\n        N: {\n          On: AcroFormAppearance.CheckBox.YesNormal\n        },\n        D: {\n          On: AcroFormAppearance.CheckBox.YesPushDown,\n          Off: AcroFormAppearance.CheckBox.OffPushDown\n        }\n      };\n\n      return appearance;\n    },\n    /**\n     * Returns the standard On Appearance for a CheckBox\n     *\n     * @returns {AcroFormXObject}\n     */\n    YesPushDown: function(formObject) {\n      var xobj = createFormXObject(formObject);\n      xobj.scope = formObject.scope;\n      var stream = [];\n      var fontKey = formObject.scope.internal.getFont(\n        formObject.fontName,\n        formObject.fontStyle\n      ).id;\n      var encodedColor = formObject.scope.__private__.encodeColorString(\n        formObject.color\n      );\n      var calcRes = calculateX(formObject, formObject.caption);\n      stream.push(\"0.749023 g\");\n      stream.push(\n        \"0 0 \" +\n          f2(AcroFormAppearance.internal.getWidth(formObject)) +\n          \" \" +\n          f2(AcroFormAppearance.internal.getHeight(formObject)) +\n          \" re\"\n      );\n      stream.push(\"f\");\n      stream.push(\"BMC\");\n      stream.push(\"q\");\n      stream.push(\"0 0 1 rg\");\n      stream.push(\n        \"/\" + fontKey + \" \" + f2(calcRes.fontSize) + \" Tf \" + encodedColor\n      );\n      stream.push(\"BT\");\n      stream.push(calcRes.text);\n      stream.push(\"ET\");\n      stream.push(\"Q\");\n      stream.push(\"EMC\");\n      xobj.stream = stream.join(\"\\n\");\n      return xobj;\n    },\n\n    YesNormal: function(formObject) {\n      var xobj = createFormXObject(formObject);\n      xobj.scope = formObject.scope;\n      var fontKey = formObject.scope.internal.getFont(\n        formObject.fontName,\n        formObject.fontStyle\n      ).id;\n      var encodedColor = formObject.scope.__private__.encodeColorString(\n        formObject.color\n      );\n      var stream = [];\n      var height = AcroFormAppearance.internal.getHeight(formObject);\n      var width = AcroFormAppearance.internal.getWidth(formObject);\n      var calcRes = calculateX(formObject, formObject.caption);\n      stream.push(\"1 g\");\n      stream.push(\"0 0 \" + f2(width) + \" \" + f2(height) + \" re\");\n      stream.push(\"f\");\n      stream.push(\"q\");\n      stream.push(\"0 0 1 rg\");\n      stream.push(\"0 0 \" + f2(width - 1) + \" \" + f2(height - 1) + \" re\");\n      stream.push(\"W\");\n      stream.push(\"n\");\n      stream.push(\"0 g\");\n      stream.push(\"BT\");\n      stream.push(\n        \"/\" + fontKey + \" \" + f2(calcRes.fontSize) + \" Tf \" + encodedColor\n      );\n      stream.push(calcRes.text);\n      stream.push(\"ET\");\n      stream.push(\"Q\");\n      xobj.stream = stream.join(\"\\n\");\n      return xobj;\n    },\n\n    /**\n     * Returns the standard Off Appearance for a CheckBox\n     *\n     * @returns {AcroFormXObject}\n     */\n    OffPushDown: function(formObject) {\n      var xobj = createFormXObject(formObject);\n      xobj.scope = formObject.scope;\n      var stream = [];\n      stream.push(\"0.749023 g\");\n      stream.push(\n        \"0 0 \" +\n          f2(AcroFormAppearance.internal.getWidth(formObject)) +\n          \" \" +\n          f2(AcroFormAppearance.internal.getHeight(formObject)) +\n          \" re\"\n      );\n      stream.push(\"f\");\n      xobj.stream = stream.join(\"\\n\");\n      return xobj;\n    }\n  },\n\n  RadioButton: {\n    Circle: {\n      createAppearanceStream: function(name) {\n        var appearanceStreamContent = {\n          D: {\n            Off: AcroFormAppearance.RadioButton.Circle.OffPushDown\n          },\n          N: {}\n        };\n        appearanceStreamContent.N[name] =\n          AcroFormAppearance.RadioButton.Circle.YesNormal;\n        appearanceStreamContent.D[name] =\n          AcroFormAppearance.RadioButton.Circle.YesPushDown;\n        return appearanceStreamContent;\n      },\n      getCA: function() {\n        return \"l\";\n      },\n\n      YesNormal: function(formObject) {\n        var xobj = createFormXObject(formObject);\n        xobj.scope = formObject.scope;\n        var stream = [];\n        // Make the Radius of the Circle relative to min(height, width) of formObject\n        var DotRadius =\n          AcroFormAppearance.internal.getWidth(formObject) <=\n          AcroFormAppearance.internal.getHeight(formObject)\n            ? AcroFormAppearance.internal.getWidth(formObject) / 4\n            : AcroFormAppearance.internal.getHeight(formObject) / 4;\n        // The Borderpadding...\n        DotRadius = Number((DotRadius * 0.9).toFixed(5));\n        var c = AcroFormAppearance.internal.Bezier_C;\n        var DotRadiusBezier = Number((DotRadius * c).toFixed(5));\n        /*\n         * The Following is a Circle created with Bezier-Curves.\n         */\n        stream.push(\"q\");\n        stream.push(\n          \"1 0 0 1 \" +\n            f5(AcroFormAppearance.internal.getWidth(formObject) / 2) +\n            \" \" +\n            f5(AcroFormAppearance.internal.getHeight(formObject) / 2) +\n            \" cm\"\n        );\n        stream.push(DotRadius + \" 0 m\");\n        stream.push(\n          DotRadius +\n            \" \" +\n            DotRadiusBezier +\n            \" \" +\n            DotRadiusBezier +\n            \" \" +\n            DotRadius +\n            \" 0 \" +\n            DotRadius +\n            \" c\"\n        );\n        stream.push(\n          \"-\" +\n            DotRadiusBezier +\n            \" \" +\n            DotRadius +\n            \" -\" +\n            DotRadius +\n            \" \" +\n            DotRadiusBezier +\n            \" -\" +\n            DotRadius +\n            \" 0 c\"\n        );\n        stream.push(\n          \"-\" +\n            DotRadius +\n            \" -\" +\n            DotRadiusBezier +\n            \" -\" +\n            DotRadiusBezier +\n            \" -\" +\n            DotRadius +\n            \" 0 -\" +\n            DotRadius +\n            \" c\"\n        );\n        stream.push(\n          DotRadiusBezier +\n            \" -\" +\n            DotRadius +\n            \" \" +\n            DotRadius +\n            \" -\" +\n            DotRadiusBezier +\n            \" \" +\n            DotRadius +\n            \" 0 c\"\n        );\n        stream.push(\"f\");\n        stream.push(\"Q\");\n        xobj.stream = stream.join(\"\\n\");\n        return xobj;\n      },\n      YesPushDown: function(formObject) {\n        var xobj = createFormXObject(formObject);\n        xobj.scope = formObject.scope;\n        var stream = [];\n        var DotRadius =\n          AcroFormAppearance.internal.getWidth(formObject) <=\n          AcroFormAppearance.internal.getHeight(formObject)\n            ? AcroFormAppearance.internal.getWidth(formObject) / 4\n            : AcroFormAppearance.internal.getHeight(formObject) / 4;\n        // The Borderpadding...\n        DotRadius = Number((DotRadius * 0.9).toFixed(5));\n        // Save results for later use; no need to waste\n        // processor ticks on doing math\n        var k = Number((DotRadius * 2).toFixed(5));\n        var kc = Number((k * AcroFormAppearance.internal.Bezier_C).toFixed(5));\n        var dc = Number(\n          (DotRadius * AcroFormAppearance.internal.Bezier_C).toFixed(5)\n        );\n\n        stream.push(\"0.749023 g\");\n        stream.push(\"q\");\n        stream.push(\n          \"1 0 0 1 \" +\n            f5(AcroFormAppearance.internal.getWidth(formObject) / 2) +\n            \" \" +\n            f5(AcroFormAppearance.internal.getHeight(formObject) / 2) +\n            \" cm\"\n        );\n        stream.push(k + \" 0 m\");\n        stream.push(k + \" \" + kc + \" \" + kc + \" \" + k + \" 0 \" + k + \" c\");\n        stream.push(\n          \"-\" + kc + \" \" + k + \" -\" + k + \" \" + kc + \" -\" + k + \" 0 c\"\n        );\n        stream.push(\n          \"-\" + k + \" -\" + kc + \" -\" + kc + \" -\" + k + \" 0 -\" + k + \" c\"\n        );\n        stream.push(kc + \" -\" + k + \" \" + k + \" -\" + kc + \" \" + k + \" 0 c\");\n        stream.push(\"f\");\n        stream.push(\"Q\");\n        stream.push(\"0 g\");\n        stream.push(\"q\");\n        stream.push(\n          \"1 0 0 1 \" +\n            f5(AcroFormAppearance.internal.getWidth(formObject) / 2) +\n            \" \" +\n            f5(AcroFormAppearance.internal.getHeight(formObject) / 2) +\n            \" cm\"\n        );\n        stream.push(DotRadius + \" 0 m\");\n        stream.push(\n          \"\" +\n            DotRadius +\n            \" \" +\n            dc +\n            \" \" +\n            dc +\n            \" \" +\n            DotRadius +\n            \" 0 \" +\n            DotRadius +\n            \" c\"\n        );\n        stream.push(\n          \"-\" +\n            dc +\n            \" \" +\n            DotRadius +\n            \" -\" +\n            DotRadius +\n            \" \" +\n            dc +\n            \" -\" +\n            DotRadius +\n            \" 0 c\"\n        );\n        stream.push(\n          \"-\" +\n            DotRadius +\n            \" -\" +\n            dc +\n            \" -\" +\n            dc +\n            \" -\" +\n            DotRadius +\n            \" 0 -\" +\n            DotRadius +\n            \" c\"\n        );\n        stream.push(\n          dc +\n            \" -\" +\n            DotRadius +\n            \" \" +\n            DotRadius +\n            \" -\" +\n            dc +\n            \" \" +\n            DotRadius +\n            \" 0 c\"\n        );\n        stream.push(\"f\");\n        stream.push(\"Q\");\n        xobj.stream = stream.join(\"\\n\");\n        return xobj;\n      },\n      OffPushDown: function(formObject) {\n        var xobj = createFormXObject(formObject);\n        xobj.scope = formObject.scope;\n        var stream = [];\n        var DotRadius =\n          AcroFormAppearance.internal.getWidth(formObject) <=\n          AcroFormAppearance.internal.getHeight(formObject)\n            ? AcroFormAppearance.internal.getWidth(formObject) / 4\n            : AcroFormAppearance.internal.getHeight(formObject) / 4;\n        // The Borderpadding...\n        DotRadius = Number((DotRadius * 0.9).toFixed(5));\n        // Save results for later use; no need to waste\n        // processor ticks on doing math\n        var k = Number((DotRadius * 2).toFixed(5));\n        var kc = Number((k * AcroFormAppearance.internal.Bezier_C).toFixed(5));\n\n        stream.push(\"0.749023 g\");\n        stream.push(\"q\");\n        stream.push(\n          \"1 0 0 1 \" +\n            f5(AcroFormAppearance.internal.getWidth(formObject) / 2) +\n            \" \" +\n            f5(AcroFormAppearance.internal.getHeight(formObject) / 2) +\n            \" cm\"\n        );\n        stream.push(k + \" 0 m\");\n        stream.push(k + \" \" + kc + \" \" + kc + \" \" + k + \" 0 \" + k + \" c\");\n        stream.push(\n          \"-\" + kc + \" \" + k + \" -\" + k + \" \" + kc + \" -\" + k + \" 0 c\"\n        );\n        stream.push(\n          \"-\" + k + \" -\" + kc + \" -\" + kc + \" -\" + k + \" 0 -\" + k + \" c\"\n        );\n        stream.push(kc + \" -\" + k + \" \" + k + \" -\" + kc + \" \" + k + \" 0 c\");\n        stream.push(\"f\");\n        stream.push(\"Q\");\n        xobj.stream = stream.join(\"\\n\");\n        return xobj;\n      }\n    },\n\n    Cross: {\n      /**\n       * Creates the Actual AppearanceDictionary-References\n       *\n       * @param {string} name\n       * @returns {Object}\n       * @ignore\n       */\n      createAppearanceStream: function(name) {\n        var appearanceStreamContent = {\n          D: {\n            Off: AcroFormAppearance.RadioButton.Cross.OffPushDown\n          },\n          N: {}\n        };\n        appearanceStreamContent.N[name] =\n          AcroFormAppearance.RadioButton.Cross.YesNormal;\n        appearanceStreamContent.D[name] =\n          AcroFormAppearance.RadioButton.Cross.YesPushDown;\n        return appearanceStreamContent;\n      },\n      getCA: function() {\n        return \"8\";\n      },\n\n      YesNormal: function(formObject) {\n        var xobj = createFormXObject(formObject);\n        xobj.scope = formObject.scope;\n        var stream = [];\n        var cross = AcroFormAppearance.internal.calculateCross(formObject);\n        stream.push(\"q\");\n        stream.push(\n          \"1 1 \" +\n            f2(AcroFormAppearance.internal.getWidth(formObject) - 2) +\n            \" \" +\n            f2(AcroFormAppearance.internal.getHeight(formObject) - 2) +\n            \" re\"\n        );\n        stream.push(\"W\");\n        stream.push(\"n\");\n        stream.push(f2(cross.x1.x) + \" \" + f2(cross.x1.y) + \" m\");\n        stream.push(f2(cross.x2.x) + \" \" + f2(cross.x2.y) + \" l\");\n        stream.push(f2(cross.x4.x) + \" \" + f2(cross.x4.y) + \" m\");\n        stream.push(f2(cross.x3.x) + \" \" + f2(cross.x3.y) + \" l\");\n        stream.push(\"s\");\n        stream.push(\"Q\");\n        xobj.stream = stream.join(\"\\n\");\n        return xobj;\n      },\n      YesPushDown: function(formObject) {\n        var xobj = createFormXObject(formObject);\n        xobj.scope = formObject.scope;\n        var cross = AcroFormAppearance.internal.calculateCross(formObject);\n        var stream = [];\n        stream.push(\"0.749023 g\");\n        stream.push(\n          \"0 0 \" +\n            f2(AcroFormAppearance.internal.getWidth(formObject)) +\n            \" \" +\n            f2(AcroFormAppearance.internal.getHeight(formObject)) +\n            \" re\"\n        );\n        stream.push(\"f\");\n        stream.push(\"q\");\n        stream.push(\n          \"1 1 \" +\n            f2(AcroFormAppearance.internal.getWidth(formObject) - 2) +\n            \" \" +\n            f2(AcroFormAppearance.internal.getHeight(formObject) - 2) +\n            \" re\"\n        );\n        stream.push(\"W\");\n        stream.push(\"n\");\n        stream.push(f2(cross.x1.x) + \" \" + f2(cross.x1.y) + \" m\");\n        stream.push(f2(cross.x2.x) + \" \" + f2(cross.x2.y) + \" l\");\n        stream.push(f2(cross.x4.x) + \" \" + f2(cross.x4.y) + \" m\");\n        stream.push(f2(cross.x3.x) + \" \" + f2(cross.x3.y) + \" l\");\n        stream.push(\"s\");\n        stream.push(\"Q\");\n        xobj.stream = stream.join(\"\\n\");\n        return xobj;\n      },\n      OffPushDown: function(formObject) {\n        var xobj = createFormXObject(formObject);\n        xobj.scope = formObject.scope;\n        var stream = [];\n        stream.push(\"0.749023 g\");\n        stream.push(\n          \"0 0 \" +\n            f2(AcroFormAppearance.internal.getWidth(formObject)) +\n            \" \" +\n            f2(AcroFormAppearance.internal.getHeight(formObject)) +\n            \" re\"\n        );\n        stream.push(\"f\");\n        xobj.stream = stream.join(\"\\n\");\n        return xobj;\n      }\n    }\n  },\n\n  /**\n   * Returns the standard Appearance\n   *\n   * @returns {AcroFormXObject}\n   */\n  createDefaultAppearanceStream: function(formObject) {\n    // Set Helvetica to Standard Font (size: auto)\n    // Color: Black\n    var fontKey = formObject.scope.internal.getFont(\n      formObject.fontName,\n      formObject.fontStyle\n    ).id;\n    var encodedColor = formObject.scope.__private__.encodeColorString(\n      formObject.color\n    );\n    var fontSize = formObject.fontSize;\n    var result = \"/\" + fontKey + \" \" + fontSize + \" Tf \" + encodedColor;\n    return result;\n  }\n};\n\nAcroFormAppearance.internal = {\n  Bezier_C: 0.551915024494,\n\n  calculateCross: function(formObject) {\n    var width = AcroFormAppearance.internal.getWidth(formObject);\n    var height = AcroFormAppearance.internal.getHeight(formObject);\n    var a = Math.min(width, height);\n\n    var cross = {\n      x1: {\n        // upperLeft\n        x: (width - a) / 2,\n        y: (height - a) / 2 + a // height - borderPadding\n      },\n      x2: {\n        // lowerRight\n        x: (width - a) / 2 + a,\n        y: (height - a) / 2 // borderPadding\n      },\n      x3: {\n        // lowerLeft\n        x: (width - a) / 2,\n        y: (height - a) / 2 // borderPadding\n      },\n      x4: {\n        // upperRight\n        x: (width - a) / 2 + a,\n        y: (height - a) / 2 + a // height - borderPadding\n      }\n    };\n\n    return cross;\n  }\n};\nAcroFormAppearance.internal.getWidth = function(formObject) {\n  var result = 0;\n  if (typeof formObject === \"object\") {\n    result = scale(formObject.Rect[2]);\n  }\n  return result;\n};\nAcroFormAppearance.internal.getHeight = function(formObject) {\n  var result = 0;\n  if (typeof formObject === \"object\") {\n    result = scale(formObject.Rect[3]);\n  }\n  return result;\n};\n\n// Public:\n\n/**\n * Add an AcroForm-Field to the jsPDF-instance\n *\n * @name addField\n * @function\n * @instance\n * @param {Object} fieldObject\n * @returns {jsPDF}\n */\nvar addField = (jsPDFAPI.addField = function(fieldObject) {\n  initializeAcroForm(this, fieldObject);\n\n  if (fieldObject instanceof AcroFormField) {\n    putForm(fieldObject);\n  } else {\n    throw new Error(\"Invalid argument passed to jsPDF.addField.\");\n  }\n  fieldObject.page = fieldObject.scope.internal.getCurrentPageInfo().pageNumber;\n  return this;\n});\n\njsPDFAPI.AcroFormChoiceField = AcroFormChoiceField;\njsPDFAPI.AcroFormListBox = AcroFormListBox;\njsPDFAPI.AcroFormComboBox = AcroFormComboBox;\njsPDFAPI.AcroFormEditBox = AcroFormEditBox;\njsPDFAPI.AcroFormButton = AcroFormButton;\njsPDFAPI.AcroFormPushButton = AcroFormPushButton;\njsPDFAPI.AcroFormRadioButton = AcroFormRadioButton;\njsPDFAPI.AcroFormCheckBox = AcroFormCheckBox;\njsPDFAPI.AcroFormTextField = AcroFormTextField;\njsPDFAPI.AcroFormPasswordField = AcroFormPasswordField;\njsPDFAPI.AcroFormAppearance = AcroFormAppearance;\n\njsPDFAPI.AcroForm = {\n  ChoiceField: AcroFormChoiceField,\n  ListBox: AcroFormListBox,\n  ComboBox: AcroFormComboBox,\n  EditBox: AcroFormEditBox,\n  Button: AcroFormButton,\n  PushButton: AcroFormPushButton,\n  RadioButton: AcroFormRadioButton,\n  CheckBox: AcroFormCheckBox,\n  TextField: AcroFormTextField,\n  PasswordField: AcroFormPasswordField,\n  Appearance: AcroFormAppearance\n};\n\njsPDF.AcroForm = {\n  ChoiceField: AcroFormChoiceField,\n  ListBox: AcroFormListBox,\n  ComboBox: AcroFormComboBox,\n  EditBox: AcroFormEditBox,\n  Button: AcroFormButton,\n  PushButton: AcroFormPushButton,\n  RadioButton: AcroFormRadioButton,\n  CheckBox: AcroFormCheckBox,\n  TextField: AcroFormTextField,\n  PasswordField: AcroFormPasswordField,\n  Appearance: AcroFormAppearance\n};\n\nvar AcroForm = jsPDF.AcroForm;\n\nexport {\n  AcroForm,\n  AcroFormChoiceField,\n  AcroFormListBox,\n  AcroFormComboBox,\n  AcroFormEditBox,\n  AcroFormButton,\n  AcroFormPushButton,\n  AcroFormRadioButton,\n  AcroFormCheckBox,\n  AcroFormTextField,\n  AcroFormPasswordField,\n  AcroFormAppearance\n};\n","/**\n * @license\n * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\n/**\n * jsPDF Annotations PlugIn\n *\n * There are many types of annotations in a PDF document. Annotations are placed\n * on a page at a particular location. They are not 'attached' to an object.\n * <br />\n * This plugin current supports <br />\n * <li> Goto Page (set pageNumber and top in options)\n * <li> Goto Name (set name and top in options)\n * <li> Goto URL (set url in options)\n * <p>\n * \tThe destination magnification factor can also be specified when goto is a page number or a named destination. (see documentation below)\n *  (set magFactor in options).  XYZ is the default.\n * </p>\n * <p>\n *  Links, Text, Popup, and FreeText are supported.\n * </p>\n * <p>\n * Options In PDF spec Not Implemented Yet\n * <li> link border\n * <li> named target\n * <li> page coordinates\n * <li> destination page scaling and layout\n * <li> actions other than URL and GotoPage\n * <li> background / hover actions\n * </p>\n * @name annotations\n * @module\n */\n\n/*\n    Destination Magnification Factors\n    See PDF 1.3 Page 386 for meanings and options\n\n    [supported]\n\tXYZ (options; left top zoom)\n\tFit (no options)\n\tFitH (options: top)\n\tFitV (options: left)\n\n\t[not supported]\n\tFitR\n\tFitB\n\tFitBH\n\tFitBV\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n(function(jsPDFAPI) {\n  \"use strict\";\n\n  var notEmpty = function(obj) {\n    if (typeof obj != \"undefined\") {\n      if (obj != \"\") {\n        return true;\n      }\n    }\n  };\n\n  jsPDF.API.events.push([\n    \"addPage\",\n    function(addPageData) {\n      var pageInfo = this.internal.getPageInfo(addPageData.pageNumber);\n      pageInfo.pageContext.annotations = [];\n    }\n  ]);\n\n  jsPDFAPI.events.push([\n    \"putPage\",\n    function(putPageData) {\n      var getHorizontalCoordinateString = this.internal.getCoordinateString;\n      var getVerticalCoordinateString = this.internal\n        .getVerticalCoordinateString;\n      var pageInfo = this.internal.getPageInfoByObjId(putPageData.objId);\n      var pageAnnos = putPageData.pageContext.annotations;\n\n      var anno, rect, line;\n      var found = false;\n      for (var a = 0; a < pageAnnos.length && !found; a++) {\n        anno = pageAnnos[a];\n        switch (anno.type) {\n          case \"link\":\n            if (\n              notEmpty(anno.options.url) ||\n              notEmpty(anno.options.pageNumber)\n            ) {\n              found = true;\n            }\n            break;\n          case \"reference\":\n          case \"text\":\n          case \"freetext\":\n            found = true;\n            break;\n        }\n      }\n      if (found == false) {\n        return;\n      }\n\n      this.internal.write(\"/Annots [\");\n      for (var i = 0; i < pageAnnos.length; i++) {\n        anno = pageAnnos[i];\n        var escape = this.internal.pdfEscape;\n        var encryptor = this.internal.getEncryptor(putPageData.objId);\n\n        switch (anno.type) {\n          case \"reference\":\n            // References to Widget Annotations (for AcroForm Fields)\n            this.internal.write(\" \" + anno.object.objId + \" 0 R \");\n            break;\n          case \"text\":\n            // Create a an object for both the text and the popup\n            var objText = this.internal.newAdditionalObject();\n            var objPopup = this.internal.newAdditionalObject();\n            var encryptorText = this.internal.getEncryptor(objText.objId);\n\n            var title = anno.title || \"Note\";\n            rect =\n              \"/Rect [\" +\n              getHorizontalCoordinateString(anno.bounds.x) +\n              \" \" +\n              getVerticalCoordinateString(anno.bounds.y + anno.bounds.h) +\n              \" \" +\n              getHorizontalCoordinateString(anno.bounds.x + anno.bounds.w) +\n              \" \" +\n              getVerticalCoordinateString(anno.bounds.y) +\n              \"] \";\n\n            line =\n              \"<</Type /Annot /Subtype /\" +\n              \"Text\" +\n              \" \" +\n              rect +\n              \"/Contents (\" +\n              escape(encryptorText(anno.contents)) +\n              \")\";\n            line += \" /Popup \" + objPopup.objId + \" 0 R\";\n            line += \" /P \" + pageInfo.objId + \" 0 R\";\n            line += \" /T (\" + escape(encryptorText(title)) + \") >>\";\n            objText.content = line;\n\n            var parent = objText.objId + \" 0 R\";\n            var popoff = 30;\n            rect =\n              \"/Rect [\" +\n              getHorizontalCoordinateString(anno.bounds.x + popoff) +\n              \" \" +\n              getVerticalCoordinateString(anno.bounds.y + anno.bounds.h) +\n              \" \" +\n              getHorizontalCoordinateString(\n                anno.bounds.x + anno.bounds.w + popoff\n              ) +\n              \" \" +\n              getVerticalCoordinateString(anno.bounds.y) +\n              \"] \";\n            line =\n              \"<</Type /Annot /Subtype /\" +\n              \"Popup\" +\n              \" \" +\n              rect +\n              \" /Parent \" +\n              parent;\n            if (anno.open) {\n              line += \" /Open true\";\n            }\n            line += \" >>\";\n            objPopup.content = line;\n\n            this.internal.write(objText.objId, \"0 R\", objPopup.objId, \"0 R\");\n\n            break;\n          case \"freetext\":\n            rect =\n              \"/Rect [\" +\n              getHorizontalCoordinateString(anno.bounds.x) +\n              \" \" +\n              getVerticalCoordinateString(anno.bounds.y) +\n              \" \" +\n              getHorizontalCoordinateString(anno.bounds.x + anno.bounds.w) +\n              \" \" +\n              getVerticalCoordinateString(anno.bounds.y + anno.bounds.h) +\n              \"] \";\n            var color = anno.color || \"#000000\";\n            line =\n              \"<</Type /Annot /Subtype /\" +\n              \"FreeText\" +\n              \" \" +\n              rect +\n              \"/Contents (\" +\n              escape(encryptor(anno.contents)) +\n              \")\";\n            line +=\n              \" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#\" +\n              color +\n              \")\";\n            line += \" /Border [0 0 0]\";\n            line += \" >>\";\n            this.internal.write(line);\n            break;\n          case \"link\":\n            if (anno.options.name) {\n              var loc = this.annotations._nameMap[anno.options.name];\n              anno.options.pageNumber = loc.page;\n              anno.options.top = loc.y;\n            } else {\n              if (!anno.options.top) {\n                anno.options.top = 0;\n              }\n            }\n\n            rect =\n              \"/Rect [\" +\n              anno.finalBounds.x +\n              \" \" +\n              anno.finalBounds.y +\n              \" \" +\n              anno.finalBounds.w +\n              \" \" +\n              anno.finalBounds.h +\n              \"] \";\n\n            line = \"\";\n            if (anno.options.url) {\n              line =\n                \"<</Type /Annot /Subtype /Link \" +\n                rect +\n                \"/Border [0 0 0] /A <</S /URI /URI (\" +\n                escape(encryptor(anno.options.url)) +\n                \") >>\";\n            } else if (anno.options.pageNumber) {\n              // first page is 0\n              var info = this.internal.getPageInfo(anno.options.pageNumber);\n              line =\n                \"<</Type /Annot /Subtype /Link \" +\n                rect +\n                \"/Border [0 0 0] /Dest [\" +\n                info.objId +\n                \" 0 R\";\n              anno.options.magFactor = anno.options.magFactor || \"XYZ\";\n              switch (anno.options.magFactor) {\n                case \"Fit\":\n                  line += \" /Fit]\";\n                  break;\n                case \"FitH\":\n                  line += \" /FitH \" + anno.options.top + \"]\";\n                  break;\n                case \"FitV\":\n                  anno.options.left = anno.options.left || 0;\n                  line += \" /FitV \" + anno.options.left + \"]\";\n                  break;\n                case \"XYZ\":\n                default:\n                  var top = getVerticalCoordinateString(anno.options.top);\n                  anno.options.left = anno.options.left || 0;\n                  // 0 or null zoom will not change zoom factor\n                  if (typeof anno.options.zoom === \"undefined\") {\n                    anno.options.zoom = 0;\n                  }\n                  line +=\n                    \" /XYZ \" +\n                    anno.options.left +\n                    \" \" +\n                    top +\n                    \" \" +\n                    anno.options.zoom +\n                    \"]\";\n                  break;\n              }\n            }\n\n            if (line != \"\") {\n              line += \" >>\";\n              this.internal.write(line);\n            }\n            break;\n        }\n      }\n      this.internal.write(\"]\");\n    }\n  ]);\n\n  /**\n   * @name createAnnotation\n   * @function\n   * @param {Object} options\n   */\n  jsPDFAPI.createAnnotation = function(options) {\n    var pageInfo = this.internal.getCurrentPageInfo();\n    switch (options.type) {\n      case \"link\":\n        this.link(\n          options.bounds.x,\n          options.bounds.y,\n          options.bounds.w,\n          options.bounds.h,\n          options\n        );\n        break;\n      case \"text\":\n      case \"freetext\":\n        pageInfo.pageContext.annotations.push(options);\n        break;\n    }\n  };\n\n  /**\n   * Create a link\n   *\n   * valid options\n   * <li> pageNumber or url [required]\n   * <p>If pageNumber is specified, top and zoom may also be specified</p>\n   * @name link\n   * @function\n   * @param {number} x\n   * @param {number} y\n   * @param {number} w\n   * @param {number} h\n   * @param {Object} options\n   */\n  jsPDFAPI.link = function(x, y, w, h, options) {\n    var pageInfo = this.internal.getCurrentPageInfo();\n    var getHorizontalCoordinateString = this.internal.getCoordinateString;\n    var getVerticalCoordinateString = this.internal.getVerticalCoordinateString;\n\n    pageInfo.pageContext.annotations.push({\n      finalBounds: {\n        x: getHorizontalCoordinateString(x),\n        y: getVerticalCoordinateString(y),\n        w: getHorizontalCoordinateString(x + w),\n        h: getVerticalCoordinateString(y + h)\n      },\n      options: options,\n      type: \"link\"\n    });\n  };\n\n  /**\n   * Currently only supports single line text.\n   * Returns the width of the text/link\n   *\n   * @name textWithLink\n   * @function\n   * @param {string} text\n   * @param {number} x\n   * @param {number} y\n   * @param {Object} options\n   * @returns {number} width the width of the text/link\n   */\n  jsPDFAPI.textWithLink = function(text, x, y, options) {\n    var totalLineWidth = this.getTextWidth(text);\n    var lineHeight = this.internal.getLineHeight() / this.internal.scaleFactor;\n    var linkHeight, linkWidth;\n\n    // Checking if maxWidth option is passed to determine lineWidth and number of lines for each line\n    if (options.maxWidth !== undefined) {\n      var { maxWidth } = options;\n      linkWidth = maxWidth;\n      var numOfLines = this.splitTextToSize(text, linkWidth).length;\n      linkHeight = Math.ceil(lineHeight * numOfLines);\n    } else {\n      linkWidth = totalLineWidth;\n      linkHeight = lineHeight;\n    }\n\n    this.text(text, x, y, options);\n\n    //TODO We really need the text baseline height to do this correctly.\n    // Or ability to draw text on top, bottom, center, or baseline.\n    y += lineHeight * 0.2;\n    //handle x position based on the align option\n    if (options.align === \"center\") {\n      x = x - totalLineWidth / 2; //since starting from center move the x position by half of text width\n    }\n    if (options.align === \"right\") {\n      x = x - totalLineWidth;\n    }\n    this.link(x, y - lineHeight, linkWidth, linkHeight, options);\n    return totalLineWidth;\n  };\n\n  //TODO move into external library\n  /**\n   * @name getTextWidth\n   * @function\n   * @param {string} text\n   * @returns {number} txtWidth\n   */\n  jsPDFAPI.getTextWidth = function(text) {\n    var fontSize = this.internal.getFontSize();\n    var txtWidth =\n      (this.getStringUnitWidth(text) * fontSize) / this.internal.scaleFactor;\n    return txtWidth;\n  };\n\n  return this;\n})(jsPDF.API);\n","function toLookup(arr) {\n  return arr.reduce(function(lookup, name, index) {\n    lookup[name] = index;\n\n    return lookup;\n  }, {});\n}\n\nvar fontStyleOrder = {\n  italic: [\"italic\", \"oblique\", \"normal\"],\n  oblique: [\"oblique\", \"italic\", \"normal\"],\n  normal: [\"normal\", \"oblique\", \"italic\"]\n};\n\nvar fontStretchOrder = [\n  \"ultra-condensed\",\n  \"extra-condensed\",\n  \"condensed\",\n  \"semi-condensed\",\n  \"normal\",\n  \"semi-expanded\",\n  \"expanded\",\n  \"extra-expanded\",\n  \"ultra-expanded\"\n];\n\n// For a given font-stretch value, we need to know where to start our search\n// from in the fontStretchOrder list.\nvar fontStretchLookup = toLookup(fontStretchOrder);\n\nvar fontWeights = [100, 200, 300, 400, 500, 600, 700, 800, 900];\nvar fontWeightsLookup = toLookup(fontWeights);\n\nfunction normalizeFontStretch(stretch) {\n  stretch = stretch || \"normal\";\n\n  return typeof fontStretchLookup[stretch] === \"number\" ? stretch : \"normal\";\n}\n\nfunction normalizeFontStyle(style) {\n  style = style || \"normal\";\n\n  return fontStyleOrder[style] ? style : \"normal\";\n}\n\nfunction normalizeFontWeight(weight) {\n  if (!weight) {\n    return 400;\n  }\n\n  if (typeof weight === \"number\") {\n    // Ignore values which aren't valid font-weights.\n    return weight >= 100 && weight <= 900 && weight % 100 === 0 ? weight : 400;\n  }\n\n  if (/^\\d00$/.test(weight)) {\n    return parseInt(weight);\n  }\n\n  switch (weight) {\n    case \"bold\":\n      return 700;\n\n    case \"normal\":\n    default:\n      return 400;\n  }\n}\n\nexport function normalizeFontFace(fontFace) {\n  var family = fontFace.family.replace(/\"|'/g, \"\").toLowerCase();\n\n  var style = normalizeFontStyle(fontFace.style);\n  var weight = normalizeFontWeight(fontFace.weight);\n  var stretch = normalizeFontStretch(fontFace.stretch);\n\n  return {\n    family: family,\n    style: style,\n    weight: weight,\n    stretch: stretch,\n    src: fontFace.src || [],\n\n    // The ref property maps this font-face to the font\n    // added by the .addFont() method.\n    ref: fontFace.ref || {\n      name: family,\n      style: [stretch, style, weight].join(\" \")\n    }\n  };\n}\n\n/**\n * Turns a list of font-faces into a map, for easier lookup when resolving\n * fonts.\n * @private\n */\nexport function buildFontFaceMap(fontFaces) {\n  var map = {};\n\n  for (var i = 0; i < fontFaces.length; ++i) {\n    var normalized = normalizeFontFace(fontFaces[i]);\n\n    var name = normalized.family;\n    var stretch = normalized.stretch;\n    var style = normalized.style;\n    var weight = normalized.weight;\n\n    map[name] = map[name] || {};\n\n    map[name][stretch] = map[name][stretch] || {};\n    map[name][stretch][style] = map[name][stretch][style] || {};\n    map[name][stretch][style][weight] = normalized;\n  }\n\n  return map;\n}\n\n/**\n * Searches a map of stretches, weights, etc. in the given direction and\n * then, if no match has been found, in the opposite directions.\n *\n * @param {Object.<string, any>} matchingSet A map of the various font variations.\n * @param {any[]} order The order of the different variations\n * @param {number} pivot The starting point of the search in the order list.\n * @param {number} dir The initial direction of the search (desc = -1, asc = 1)\n * @private\n */\n\nfunction searchFromPivot(matchingSet, order, pivot, dir) {\n  var i;\n\n  for (i = pivot; i >= 0 && i < order.length; i += dir) {\n    if (matchingSet[order[i]]) {\n      return matchingSet[order[i]];\n    }\n  }\n\n  for (i = pivot; i >= 0 && i < order.length; i -= dir) {\n    if (matchingSet[order[i]]) {\n      return matchingSet[order[i]];\n    }\n  }\n}\n\nfunction resolveFontStretch(stretch, matchingSet) {\n  if (matchingSet[stretch]) {\n    return matchingSet[stretch];\n  }\n\n  var pivot = fontStretchLookup[stretch];\n\n  // If the font-stretch value is normal or more condensed, we want to\n  // start with a descending search, otherwise we should do ascending.\n  var dir = pivot <= fontStretchLookup[\"normal\"] ? -1 : 1;\n  var match = searchFromPivot(matchingSet, fontStretchOrder, pivot, dir);\n\n  if (!match) {\n    // Since a font-family cannot exist without having at least one stretch value\n    // we should never reach this point.\n    throw new Error(\n      \"Could not find a matching font-stretch value for \" + stretch\n    );\n  }\n\n  return match;\n}\n\nfunction resolveFontStyle(fontStyle, matchingSet) {\n  if (matchingSet[fontStyle]) {\n    return matchingSet[fontStyle];\n  }\n\n  var ordering = fontStyleOrder[fontStyle];\n\n  for (var i = 0; i < ordering.length; ++i) {\n    if (matchingSet[ordering[i]]) {\n      return matchingSet[ordering[i]];\n    }\n  }\n\n  // Since a font-family cannot exist without having at least one style value\n  // we should never reach this point.\n  throw new Error(\"Could not find a matching font-style for \" + fontStyle);\n}\n\nfunction resolveFontWeight(weight, matchingSet) {\n  if (matchingSet[weight]) {\n    return matchingSet[weight];\n  }\n\n  if (weight === 400 && matchingSet[500]) {\n    return matchingSet[500];\n  }\n\n  if (weight === 500 && matchingSet[400]) {\n    return matchingSet[400];\n  }\n\n  var pivot = fontWeightsLookup[weight];\n\n  // If the font-stretch value is normal or more condensed, we want to\n  // start with a descending search, otherwise we should do ascending.\n  var dir = weight < 400 ? -1 : 1;\n  var match = searchFromPivot(matchingSet, fontWeights, pivot, dir);\n\n  if (!match) {\n    // Since a font-family cannot exist without having at least one stretch value\n    // we should never reach this point.\n    throw new Error(\n      \"Could not find a matching font-weight for value \" + weight\n    );\n  }\n\n  return match;\n}\n\nvar defaultGenericFontFamilies = {\n  \"sans-serif\": \"helvetica\",\n  fixed: \"courier\",\n  monospace: \"courier\",\n  terminal: \"courier\",\n  cursive: \"times\",\n  fantasy: \"times\",\n  serif: \"times\"\n};\n\nvar systemFonts = {\n  caption: \"times\",\n  icon: \"times\",\n  menu: \"times\",\n  \"message-box\": \"times\",\n  \"small-caption\": \"times\",\n  \"status-bar\": \"times\"\n};\n\nfunction ruleToString(rule) {\n  return [rule.stretch, rule.style, rule.weight, rule.family].join(\" \");\n}\n\nexport function resolveFontFace(fontFaceMap, rules, opts) {\n  opts = opts || {};\n\n  var defaultFontFamily = opts.defaultFontFamily || \"times\";\n  var genericFontFamilies = Object.assign(\n    {},\n    defaultGenericFontFamilies,\n    opts.genericFontFamilies || {}\n  );\n\n  var rule = null;\n  var matches = null;\n\n  for (var i = 0; i < rules.length; ++i) {\n    rule = normalizeFontFace(rules[i]);\n\n    if (genericFontFamilies[rule.family]) {\n      rule.family = genericFontFamilies[rule.family];\n    }\n\n    if (fontFaceMap.hasOwnProperty(rule.family)) {\n      matches = fontFaceMap[rule.family];\n\n      break;\n    }\n  }\n\n  // Always fallback to a known font family.\n  matches = matches || fontFaceMap[defaultFontFamily];\n\n  if (!matches) {\n    // At this point we should definitiely have a font family, but if we\n    // don't there is something wrong with our configuration\n    throw new Error(\n      \"Could not find a font-family for the rule '\" +\n        ruleToString(rule) +\n        \"' and default family '\" +\n        defaultFontFamily +\n        \"'.\"\n    );\n  }\n\n  matches = resolveFontStretch(rule.stretch, matches);\n  matches = resolveFontStyle(rule.style, matches);\n  matches = resolveFontWeight(rule.weight, matches);\n\n  if (!matches) {\n    // We should've fount\n    throw new Error(\n      \"Failed to resolve a font for the rule '\" + ruleToString(rule) + \"'.\"\n    );\n  }\n\n  return matches;\n}\n\n/**\n * Builds a style id for use with the addFont() method.\n * @param {FontFace} font\n * @private\n */\nexport function toStyleName(font) {\n  return [font.weight, font.style, font.stretch].join(\" \");\n}\n\nfunction eatWhiteSpace(input) {\n  return input.trimLeft();\n}\n\nfunction parseQuotedFontFamily(input, quote) {\n  var index = 0;\n\n  while (index < input.length) {\n    var current = input.charAt(index);\n\n    if (current === quote) {\n      return [input.substring(0, index), input.substring(index + 1)];\n    }\n\n    index += 1;\n  }\n\n  // Unexpected end of input\n  return null;\n}\n\nfunction parseNonQuotedFontFamily(input) {\n  // It implements part of the identifier parser here: https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\n  //\n  // NOTE: This parser pretty much ignores escaped identifiers and that there is a thing called unicode.\n  //\n  // Breakdown of regexp:\n  // -[a-z_]     - when identifier starts with a hyphen, you're not allowed to have another hyphen or a digit\n  // [a-z_]      - allow a-z and underscore at beginning of input\n  // [a-z0-9_-]* - after that, anything goes\n  var match = input.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);\n\n  // non quoted value contains illegal characters\n  if (match === null) {\n    return null;\n  }\n\n  return [match[0], input.substring(match[0].length)];\n}\n\nvar defaultFont = [\"times\"];\n\nexport function parseFontFamily(input) {\n  var result = [];\n  var ch, parsed;\n  var remaining = input.trim();\n\n  if (remaining === \"\") {\n    return defaultFont;\n  }\n\n  if (remaining in systemFonts) {\n    return [systemFonts[remaining]];\n  }\n\n  while (remaining !== \"\") {\n    parsed = null;\n    remaining = eatWhiteSpace(remaining);\n    ch = remaining.charAt(0);\n\n    switch (ch) {\n      case '\"':\n      case \"'\":\n        parsed = parseQuotedFontFamily(remaining.substring(1), ch);\n        break;\n\n      default:\n        parsed = parseNonQuotedFontFamily(remaining);\n        break;\n    }\n\n    if (parsed === null) {\n      return defaultFont;\n    }\n\n    result.push(parsed[0]);\n\n    remaining = eatWhiteSpace(parsed[1]);\n\n    // We expect end of input or a comma separator here\n    if (remaining !== \"\" && remaining.charAt(0) !== \",\") {\n      return defaultFont;\n    }\n\n    remaining = remaining.replace(/^,/, \"\");\n  }\n\n  return result;\n}\n","/** @license\n * jsPDF addImage plugin\n * Copyright (c) 2012 Jason Siefken, https://github.com/siefkenj/\n *               2013 Chris Dowling, https://github.com/gingerchris\n *               2013 Trinh Ho, https://github.com/ineedfat\n *               2013 Edwin Alejandro Perez, https://github.com/eaparango\n *               2013 Norah Smith, https://github.com/burnburnrocket\n *               2014 Diego Casorran, https://github.com/diegocr\n *               2014 James Robb, https://github.com/jamesbrobb\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n/**\n * @name addImage\n * @module\n */\n\nimport { jsPDF } from \"../jspdf.js\";\nimport { atob, btoa } from \"../libs/AtobBtoa.js\";\n\n(function(jsPDFAPI) {\n  \"use strict\";\n\n  var namespace = \"addImage_\";\n  jsPDFAPI.__addimage__ = {};\n\n  var UNKNOWN = \"UNKNOWN\";\n\n  // Heuristic selection of a good batch for large array .apply. Not limiting make the call overflow.\n  // With too small batch iteration will be slow as more calls are made,\n  // higher values cause larger and slower garbage collection.\n  var ARRAY_APPLY_BATCH = 8192;\n\n  var imageFileTypeHeaders = {\n    PNG: [[0x89, 0x50, 0x4e, 0x47]],\n    TIFF: [\n      [0x4d, 0x4d, 0x00, 0x2a], //Motorola\n      [0x49, 0x49, 0x2a, 0x00] //Intel\n    ],\n    JPEG: [\n      [\n        0xff,\n        0xd8,\n        0xff,\n        0xe0,\n        undefined,\n        undefined,\n        0x4a,\n        0x46,\n        0x49,\n        0x46,\n        0x00\n      ], //JFIF\n      [\n        0xff,\n        0xd8,\n        0xff,\n        0xe1,\n        undefined,\n        undefined,\n        0x45,\n        0x78,\n        0x69,\n        0x66,\n        0x00,\n        0x00\n      ], //Exif\n      [0xff, 0xd8, 0xff, 0xdb], //JPEG RAW\n      [0xff, 0xd8, 0xff, 0xee] //EXIF RAW\n    ],\n    JPEG2000: [[0x00, 0x00, 0x00, 0x0c, 0x6a, 0x50, 0x20, 0x20]],\n    GIF87a: [[0x47, 0x49, 0x46, 0x38, 0x37, 0x61]],\n    GIF89a: [[0x47, 0x49, 0x46, 0x38, 0x39, 0x61]],\n    WEBP: [\n      [\n        0x52,\n        0x49,\n        0x46,\n        0x46,\n        undefined,\n        undefined,\n        undefined,\n        undefined,\n        0x57,\n        0x45,\n        0x42,\n        0x50\n      ]\n    ],\n    BMP: [\n      [0x42, 0x4d], //BM - Windows 3.1x, 95, NT, ... etc.\n      [0x42, 0x41], //BA - OS/2 struct bitmap array\n      [0x43, 0x49], //CI - OS/2 struct color icon\n      [0x43, 0x50], //CP - OS/2 const color pointer\n      [0x49, 0x43], //IC - OS/2 struct icon\n      [0x50, 0x54] //PT - OS/2 pointer\n    ]\n  };\n\n  /**\n   * Recognize filetype of Image by magic-bytes\n   *\n   * https://en.wikipedia.org/wiki/List_of_file_signatures\n   *\n   * @name getImageFileTypeByImageData\n   * @public\n   * @function\n   * @param {string|arraybuffer} imageData imageData as binary String or arraybuffer\n   * @param {string} format format of file if filetype-recognition fails, e.g. 'JPEG'\n   *\n   * @returns {string} filetype of Image\n   */\n  var getImageFileTypeByImageData = (jsPDFAPI.__addimage__.getImageFileTypeByImageData = function(\n    imageData,\n    fallbackFormat\n  ) {\n    fallbackFormat = fallbackFormat || UNKNOWN;\n    var i;\n    var j;\n    var result = UNKNOWN;\n    var headerSchemata;\n    var compareResult;\n    var fileType;\n\n    if (\n      fallbackFormat === \"RGBA\" ||\n      (imageData.data !== undefined &&\n        imageData.data instanceof Uint8ClampedArray &&\n        \"height\" in imageData &&\n        \"width\" in imageData)\n    ) {\n      return \"RGBA\";\n    }\n\n    if (isArrayBufferView(imageData)) {\n      for (fileType in imageFileTypeHeaders) {\n        headerSchemata = imageFileTypeHeaders[fileType];\n        for (i = 0; i < headerSchemata.length; i += 1) {\n          compareResult = true;\n          for (j = 0; j < headerSchemata[i].length; j += 1) {\n            if (headerSchemata[i][j] === undefined) {\n              continue;\n            }\n            if (headerSchemata[i][j] !== imageData[j]) {\n              compareResult = false;\n              break;\n            }\n          }\n          if (compareResult === true) {\n            result = fileType;\n            break;\n          }\n        }\n      }\n    } else {\n      for (fileType in imageFileTypeHeaders) {\n        headerSchemata = imageFileTypeHeaders[fileType];\n        for (i = 0; i < headerSchemata.length; i += 1) {\n          compareResult = true;\n          for (j = 0; j < headerSchemata[i].length; j += 1) {\n            if (headerSchemata[i][j] === undefined) {\n              continue;\n            }\n            if (headerSchemata[i][j] !== imageData.charCodeAt(j)) {\n              compareResult = false;\n              break;\n            }\n          }\n          if (compareResult === true) {\n            result = fileType;\n            break;\n          }\n        }\n      }\n    }\n\n    if (result === UNKNOWN && fallbackFormat !== UNKNOWN) {\n      result = fallbackFormat;\n    }\n    return result;\n  });\n\n  // Image functionality ported from pdf.js\n  var putImage = function(image) {\n    var out = this.internal.write;\n    var putStream = this.internal.putStream;\n    var getFilters = this.internal.getFilters;\n\n    var filter = getFilters();\n    while (filter.indexOf(\"FlateEncode\") !== -1) {\n      filter.splice(filter.indexOf(\"FlateEncode\"), 1);\n    }\n\n    image.objectId = this.internal.newObject();\n\n    var additionalKeyValues = [];\n    additionalKeyValues.push({ key: \"Type\", value: \"/XObject\" });\n    additionalKeyValues.push({ key: \"Subtype\", value: \"/Image\" });\n    additionalKeyValues.push({ key: \"Width\", value: image.width });\n    additionalKeyValues.push({ key: \"Height\", value: image.height });\n\n    if (image.colorSpace === color_spaces.INDEXED) {\n      additionalKeyValues.push({\n        key: \"ColorSpace\",\n        value:\n          \"[/Indexed /DeviceRGB \" +\n          // if an indexed png defines more than one colour with transparency, we've created a sMask\n          (image.palette.length / 3 - 1) +\n          \" \" +\n          (\"sMask\" in image && typeof image.sMask !== \"undefined\"\n            ? image.objectId + 2\n            : image.objectId + 1) +\n          \" 0 R]\"\n      });\n    } else {\n      additionalKeyValues.push({\n        key: \"ColorSpace\",\n        value: \"/\" + image.colorSpace\n      });\n      if (image.colorSpace === color_spaces.DEVICE_CMYK) {\n        additionalKeyValues.push({ key: \"Decode\", value: \"[1 0 1 0 1 0 1 0]\" });\n      }\n    }\n    additionalKeyValues.push({\n      key: \"BitsPerComponent\",\n      value: image.bitsPerComponent\n    });\n    if (\n      \"decodeParameters\" in image &&\n      typeof image.decodeParameters !== \"undefined\"\n    ) {\n      additionalKeyValues.push({\n        key: \"DecodeParms\",\n        value: \"<<\" + image.decodeParameters + \">>\"\n      });\n    }\n    if (\"transparency\" in image && Array.isArray(image.transparency)) {\n      var transparency = \"\",\n        i = 0,\n        len = image.transparency.length;\n      for (; i < len; i++)\n        transparency +=\n          image.transparency[i] + \" \" + image.transparency[i] + \" \";\n\n      additionalKeyValues.push({\n        key: \"Mask\",\n        value: \"[\" + transparency + \"]\"\n      });\n    }\n    if (typeof image.sMask !== \"undefined\") {\n      additionalKeyValues.push({\n        key: \"SMask\",\n        value: image.objectId + 1 + \" 0 R\"\n      });\n    }\n\n    var alreadyAppliedFilters =\n      typeof image.filter !== \"undefined\" ? [\"/\" + image.filter] : undefined;\n\n    putStream({\n      data: image.data,\n      additionalKeyValues: additionalKeyValues,\n      alreadyAppliedFilters: alreadyAppliedFilters,\n      objectId: image.objectId\n    });\n\n    out(\"endobj\");\n\n    // Soft mask\n    if (\"sMask\" in image && typeof image.sMask !== \"undefined\") {\n      var decodeParameters =\n        \"/Predictor \" +\n        image.predictor +\n        \" /Colors 1 /BitsPerComponent \" +\n        image.bitsPerComponent +\n        \" /Columns \" +\n        image.width;\n      var sMask = {\n        width: image.width,\n        height: image.height,\n        colorSpace: \"DeviceGray\",\n        bitsPerComponent: image.bitsPerComponent,\n        decodeParameters: decodeParameters,\n        data: image.sMask\n      };\n      if (\"filter\" in image) {\n        sMask.filter = image.filter;\n      }\n      putImage.call(this, sMask);\n    }\n\n    //Palette\n    if (image.colorSpace === color_spaces.INDEXED) {\n      var objId = this.internal.newObject();\n      //out('<< /Filter / ' + img['f'] +' /Length ' + img['pal'].length + '>>');\n      //putStream(zlib.compress(img['pal']));\n      putStream({\n        data: arrayBufferToBinaryString(new Uint8Array(image.palette)),\n        objectId: objId\n      });\n      out(\"endobj\");\n    }\n  };\n  var putResourcesCallback = function() {\n    var images = this.internal.collections[namespace + \"images\"];\n    for (var i in images) {\n      putImage.call(this, images[i]);\n    }\n  };\n  var putXObjectsDictCallback = function() {\n    var images = this.internal.collections[namespace + \"images\"],\n      out = this.internal.write,\n      image;\n    for (var i in images) {\n      image = images[i];\n      out(\"/I\" + image.index, image.objectId, \"0\", \"R\");\n    }\n  };\n\n  var checkCompressValue = function(value) {\n    if (value && typeof value === \"string\") value = value.toUpperCase();\n    return value in jsPDFAPI.image_compression ? value : image_compression.NONE;\n  };\n\n  var initialize = function() {\n    if (!this.internal.collections[namespace + \"images\"]) {\n      this.internal.collections[namespace + \"images\"] = {};\n      this.internal.events.subscribe(\"putResources\", putResourcesCallback);\n      this.internal.events.subscribe(\"putXobjectDict\", putXObjectsDictCallback);\n    }\n  };\n\n  var getImages = function() {\n    var images = this.internal.collections[namespace + \"images\"];\n    initialize.call(this);\n    return images;\n  };\n  var getImageIndex = function() {\n    return Object.keys(this.internal.collections[namespace + \"images\"]).length;\n  };\n  var notDefined = function(value) {\n    return typeof value === \"undefined\" || value === null || value.length === 0;\n  };\n  var generateAliasFromImageData = function(imageData) {\n    if (typeof imageData === \"string\" || isArrayBufferView(imageData)) {\n      return sHashCode(imageData);\n    } else if (isArrayBufferView(imageData.data)) {\n      return sHashCode(imageData.data);\n    }\n\n    return null;\n  };\n\n  var isImageTypeSupported = function(type) {\n    return typeof jsPDFAPI[\"process\" + type.toUpperCase()] === \"function\";\n  };\n\n  var isDOMElement = function(object) {\n    return typeof object === \"object\" && object.nodeType === 1;\n  };\n\n  var getImageDataFromElement = function(element, format) {\n    //if element is an image which uses data url definition, just return the dataurl\n    if (element.nodeName === \"IMG\" && element.hasAttribute(\"src\")) {\n      var src = \"\" + element.getAttribute(\"src\");\n\n      //is base64 encoded dataUrl, directly process it\n      if (src.indexOf(\"data:image/\") === 0) {\n        return atob(\n          unescape(src)\n            .split(\"base64,\")\n            .pop()\n        );\n      }\n\n      //it is probably an url, try to load it\n      var tmpImageData = jsPDFAPI.loadFile(src, true);\n      if (tmpImageData !== undefined) {\n        return tmpImageData;\n      }\n    }\n\n    if (element.nodeName === \"CANVAS\") {\n      if (element.width === 0 || element.height === 0) {\n        throw new Error(\n          \"Given canvas must have data. Canvas width: \" +\n            element.width +\n            \", height: \" +\n            element.height\n        );\n      }\n      var mimeType;\n      switch (format) {\n        case \"PNG\":\n          mimeType = \"image/png\";\n          break;\n        case \"WEBP\":\n          mimeType = \"image/webp\";\n          break;\n        case \"JPEG\":\n        case \"JPG\":\n        default:\n          mimeType = \"image/jpeg\";\n          break;\n      }\n      return atob(\n        element\n          .toDataURL(mimeType, 1.0)\n          .split(\"base64,\")\n          .pop()\n      );\n    }\n  };\n\n  var checkImagesForAlias = function(alias) {\n    var images = this.internal.collections[namespace + \"images\"];\n    if (images) {\n      for (var e in images) {\n        if (alias === images[e].alias) {\n          return images[e];\n        }\n      }\n    }\n  };\n\n  var determineWidthAndHeight = function(width, height, image) {\n    if (!width && !height) {\n      width = -96;\n      height = -96;\n    }\n    if (width < 0) {\n      width = (-1 * image.width * 72) / width / this.internal.scaleFactor;\n    }\n    if (height < 0) {\n      height = (-1 * image.height * 72) / height / this.internal.scaleFactor;\n    }\n    if (width === 0) {\n      width = (height * image.width) / image.height;\n    }\n    if (height === 0) {\n      height = (width * image.height) / image.width;\n    }\n\n    return [width, height];\n  };\n\n  var writeImageToPDF = function(x, y, width, height, image, rotation) {\n    var dims = determineWidthAndHeight.call(this, width, height, image),\n      coord = this.internal.getCoordinateString,\n      vcoord = this.internal.getVerticalCoordinateString;\n\n    var images = getImages.call(this);\n\n    width = dims[0];\n    height = dims[1];\n    images[image.index] = image;\n\n    if (rotation) {\n      rotation *= Math.PI / 180;\n      var c = Math.cos(rotation);\n      var s = Math.sin(rotation);\n      //like in pdf Reference do it 4 digits instead of 2\n      var f4 = function(number) {\n        return number.toFixed(4);\n      };\n      var rotationTransformationMatrix = [\n        f4(c),\n        f4(s),\n        f4(s * -1),\n        f4(c),\n        0,\n        0,\n        \"cm\"\n      ];\n    }\n    this.internal.write(\"q\"); //Save graphics state\n    if (rotation) {\n      this.internal.write(\n        [1, \"0\", \"0\", 1, coord(x), vcoord(y + height), \"cm\"].join(\" \")\n      ); //Translate\n      this.internal.write(rotationTransformationMatrix.join(\" \")); //Rotate\n      this.internal.write(\n        [coord(width), \"0\", \"0\", coord(height), \"0\", \"0\", \"cm\"].join(\" \")\n      ); //Scale\n    } else {\n      this.internal.write(\n        [\n          coord(width),\n          \"0\",\n          \"0\",\n          coord(height),\n          coord(x),\n          vcoord(y + height),\n          \"cm\"\n        ].join(\" \")\n      ); //Translate and Scale\n    }\n\n    if (this.isAdvancedAPI()) {\n      // draw image bottom up when in \"advanced\" API mode\n      this.internal.write([1, 0, 0, -1, 0, 0, \"cm\"].join(\" \"));\n    }\n\n    this.internal.write(\"/I\" + image.index + \" Do\"); //Paint Image\n    this.internal.write(\"Q\"); //Restore graphics state\n  };\n\n  /**\n   * COLOR SPACES\n   */\n  var color_spaces = (jsPDFAPI.color_spaces = {\n    DEVICE_RGB: \"DeviceRGB\",\n    DEVICE_GRAY: \"DeviceGray\",\n    DEVICE_CMYK: \"DeviceCMYK\",\n    CAL_GREY: \"CalGray\",\n    CAL_RGB: \"CalRGB\",\n    LAB: \"Lab\",\n    ICC_BASED: \"ICCBased\",\n    INDEXED: \"Indexed\",\n    PATTERN: \"Pattern\",\n    SEPARATION: \"Separation\",\n    DEVICE_N: \"DeviceN\"\n  });\n\n  /**\n   * DECODE METHODS\n   */\n  jsPDFAPI.decode = {\n    DCT_DECODE: \"DCTDecode\",\n    FLATE_DECODE: \"FlateDecode\",\n    LZW_DECODE: \"LZWDecode\",\n    JPX_DECODE: \"JPXDecode\",\n    JBIG2_DECODE: \"JBIG2Decode\",\n    ASCII85_DECODE: \"ASCII85Decode\",\n    ASCII_HEX_DECODE: \"ASCIIHexDecode\",\n    RUN_LENGTH_DECODE: \"RunLengthDecode\",\n    CCITT_FAX_DECODE: \"CCITTFaxDecode\"\n  };\n\n  /**\n   * IMAGE COMPRESSION TYPES\n   */\n  var image_compression = (jsPDFAPI.image_compression = {\n    NONE: \"NONE\",\n    FAST: \"FAST\",\n    MEDIUM: \"MEDIUM\",\n    SLOW: \"SLOW\"\n  });\n\n  /**\n   * @name sHashCode\n   * @function\n   * @param {string} data\n   * @returns {string}\n   */\n  var sHashCode = (jsPDFAPI.__addimage__.sHashCode = function(data) {\n    var hash = 0,\n      i,\n      len;\n\n    if (typeof data === \"string\") {\n      len = data.length;\n      for (i = 0; i < len; i++) {\n        hash = (hash << 5) - hash + data.charCodeAt(i);\n        hash |= 0; // Convert to 32bit integer\n      }\n    } else if (isArrayBufferView(data)) {\n      len = data.byteLength / 2;\n      for (i = 0; i < len; i++) {\n        hash = (hash << 5) - hash + data[i];\n        hash |= 0; // Convert to 32bit integer\n      }\n    }\n    return hash;\n  });\n\n  /**\n   * Validates if given String is a valid Base64-String\n   *\n   * @name validateStringAsBase64\n   * @public\n   * @function\n   * @param {String} possible Base64-String\n   *\n   * @returns {boolean}\n   */\n  var validateStringAsBase64 = (jsPDFAPI.__addimage__.validateStringAsBase64 = function(\n    possibleBase64String\n  ) {\n    possibleBase64String = possibleBase64String || \"\";\n    possibleBase64String.toString().trim();\n\n    var result = true;\n\n    if (possibleBase64String.length === 0) {\n      result = false;\n    }\n\n    if (possibleBase64String.length % 4 !== 0) {\n      result = false;\n    }\n\n    if (\n      /^[A-Za-z0-9+/]+$/.test(\n        possibleBase64String.substr(0, possibleBase64String.length - 2)\n      ) === false\n    ) {\n      result = false;\n    }\n\n    if (\n      /^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(\n        possibleBase64String.substr(-2)\n      ) === false\n    ) {\n      result = false;\n    }\n    return result;\n  });\n\n  /**\n   * Strips out and returns info from a valid base64 data URI\n   *\n   * @name extractImageFromDataUrl\n   * @function\n   * @param {string} dataUrl a valid data URI of format 'data:[<MIME-type>][;base64],<data>'\n   * @returns {Array}an Array containing the following\n   * [0] the complete data URI\n   * [1] <MIME-type>\n   * [2] format - the second part of the mime-type i.e 'png' in 'image/png'\n   * [4] <data>\n   */\n  var extractImageFromDataUrl = (jsPDFAPI.__addimage__.extractImageFromDataUrl = function(\n    dataUrl\n  ) {\n    dataUrl = dataUrl || \"\";\n    var dataUrlParts = dataUrl.split(\"base64,\");\n    var result = null;\n\n    if (dataUrlParts.length === 2) {\n      var extractedInfo = /^data:(\\w*\\/\\w*);*(charset=(?!charset=)[\\w=-]*)*;*$/.exec(\n        dataUrlParts[0]\n      );\n      if (Array.isArray(extractedInfo)) {\n        result = {\n          mimeType: extractedInfo[1],\n          charset: extractedInfo[2],\n          data: dataUrlParts[1]\n        };\n      }\n    }\n    return result;\n  });\n\n  /**\n   * Check to see if ArrayBuffer is supported\n   *\n   * @name supportsArrayBuffer\n   * @function\n   * @returns {boolean}\n   */\n  var supportsArrayBuffer = (jsPDFAPI.__addimage__.supportsArrayBuffer = function() {\n    return (\n      typeof ArrayBuffer !== \"undefined\" && typeof Uint8Array !== \"undefined\"\n    );\n  });\n\n  /**\n   * Tests supplied object to determine if ArrayBuffer\n   *\n   * @name isArrayBuffer\n   * @function\n   * @param {Object} object an Object\n   *\n   * @returns {boolean}\n   */\n  jsPDFAPI.__addimage__.isArrayBuffer = function(object) {\n    return supportsArrayBuffer() && object instanceof ArrayBuffer;\n  };\n\n  /**\n   * Tests supplied object to determine if it implements the ArrayBufferView (TypedArray) interface\n   *\n   * @name isArrayBufferView\n   * @function\n   * @param {Object} object an Object\n   * @returns {boolean}\n   */\n  var isArrayBufferView = (jsPDFAPI.__addimage__.isArrayBufferView = function(\n    object\n  ) {\n    return (\n      supportsArrayBuffer() &&\n      typeof Uint32Array !== \"undefined\" &&\n      (object instanceof Int8Array ||\n        object instanceof Uint8Array ||\n        (typeof Uint8ClampedArray !== \"undefined\" &&\n          object instanceof Uint8ClampedArray) ||\n        object instanceof Int16Array ||\n        object instanceof Uint16Array ||\n        object instanceof Int32Array ||\n        object instanceof Uint32Array ||\n        object instanceof Float32Array ||\n        object instanceof Float64Array)\n    );\n  });\n\n  /**\n   * Convert Binary String to ArrayBuffer\n   *\n   * @name binaryStringToUint8Array\n   * @public\n   * @function\n   * @param {string} BinaryString with ImageData\n   * @returns {Uint8Array}\n   */\n  var binaryStringToUint8Array = (jsPDFAPI.__addimage__.binaryStringToUint8Array = function(\n    binary_string\n  ) {\n    var len = binary_string.length;\n    var bytes = new Uint8Array(len);\n    for (var i = 0; i < len; i++) {\n      bytes[i] = binary_string.charCodeAt(i);\n    }\n    return bytes;\n  });\n\n  /**\n   * Convert the Buffer to a Binary String\n   *\n   * @name arrayBufferToBinaryString\n   * @public\n   * @function\n   * @param {ArrayBuffer|ArrayBufferView} ArrayBuffer buffer or bufferView with ImageData\n   *\n   * @returns {String}\n   */\n  var arrayBufferToBinaryString = (jsPDFAPI.__addimage__.arrayBufferToBinaryString = function(\n    buffer\n  ) {\n    var out = \"\";\n    // There are calls with both ArrayBuffer and already converted Uint8Array or other BufferView.\n    // Do not copy the array if input is already an array.\n    var buf = isArrayBufferView(buffer) ? buffer : new Uint8Array(buffer);\n    for (var i = 0; i < buf.length; i += ARRAY_APPLY_BATCH) {\n      // Limit the amount of characters being parsed to prevent overflow.\n      // Note that while TextDecoder would be faster, it does not have the same\n      // functionality as fromCharCode with any provided encodings as of 3/2021.\n      out += String.fromCharCode.apply(\n        null,\n        buf.subarray(i, i + ARRAY_APPLY_BATCH)\n      );\n    }\n    return out;\n  });\n\n  /**\n   * Possible parameter for addImage, an RGBA buffer with size.\n   *\n   * @typedef {Object} RGBAData\n   * @property {Uint8ClampedArray} data - Single dimensional array of RGBA values. For example from canvas getImageData.\n   * @property {number} width - Image width as the data does not carry this information in itself.\n   * @property {number} height - Image height as the data does not carry this information in itself.\n   */\n\n  /**\n   * Adds an Image to the PDF.\n   *\n   * @name addImage\n   * @public\n   * @function\n   * @param {string|HTMLImageElement|HTMLCanvasElement|Uint8Array|RGBAData} imageData imageData as base64 encoded DataUrl or Image-HTMLElement or Canvas-HTMLElement or object containing RGBA array (like output from canvas.getImageData).\n   * @param {string} format format of file if filetype-recognition fails or in case of a Canvas-Element needs to be specified (default for Canvas is JPEG), e.g. 'JPEG', 'PNG', 'WEBP'\n   * @param {number} x x Coordinate (in units declared at inception of PDF document) against left edge of the page\n   * @param {number} y y Coordinate (in units declared at inception of PDF document) against upper edge of the page\n   * @param {number} width width of the image (in units declared at inception of PDF document)\n   * @param {number} height height of the Image (in units declared at inception of PDF document)\n   * @param {string} alias alias of the image (if used multiple times)\n   * @param {string} compression compression of the generated JPEG, can have the values 'NONE', 'FAST', 'MEDIUM' and 'SLOW'\n   * @param {number} rotation rotation of the image in degrees (0-359)\n   *\n   * @returns jsPDF\n   */\n  jsPDFAPI.addImage = function() {\n    var imageData, format, x, y, w, h, alias, compression, rotation;\n\n    imageData = arguments[0];\n    if (typeof arguments[1] === \"number\") {\n      format = UNKNOWN;\n      x = arguments[1];\n      y = arguments[2];\n      w = arguments[3];\n      h = arguments[4];\n      alias = arguments[5];\n      compression = arguments[6];\n      rotation = arguments[7];\n    } else {\n      format = arguments[1];\n      x = arguments[2];\n      y = arguments[3];\n      w = arguments[4];\n      h = arguments[5];\n      alias = arguments[6];\n      compression = arguments[7];\n      rotation = arguments[8];\n    }\n\n    if (\n      typeof imageData === \"object\" &&\n      !isDOMElement(imageData) &&\n      \"imageData\" in imageData\n    ) {\n      var options = imageData;\n\n      imageData = options.imageData;\n      format = options.format || format || UNKNOWN;\n      x = options.x || x || 0;\n      y = options.y || y || 0;\n      w = options.w || options.width || w;\n      h = options.h || options.height || h;\n      alias = options.alias || alias;\n      compression = options.compression || compression;\n      rotation = options.rotation || options.angle || rotation;\n    }\n\n    //If compression is not explicitly set, determine if we should use compression\n    var filter = this.internal.getFilters();\n    if (compression === undefined && filter.indexOf(\"FlateEncode\") !== -1) {\n      compression = \"SLOW\";\n    }\n\n    if (isNaN(x) || isNaN(y)) {\n      throw new Error(\"Invalid coordinates passed to jsPDF.addImage\");\n    }\n\n    initialize.call(this);\n\n    var image = processImageData.call(\n      this,\n      imageData,\n      format,\n      alias,\n      compression\n    );\n\n    writeImageToPDF.call(this, x, y, w, h, image, rotation);\n\n    return this;\n  };\n\n  var processImageData = function(imageData, format, alias, compression) {\n    var result, dataAsBinaryString;\n\n    if (\n      typeof imageData === \"string\" &&\n      getImageFileTypeByImageData(imageData) === UNKNOWN\n    ) {\n      imageData = unescape(imageData);\n      var tmpImageData = convertBase64ToBinaryString(imageData, false);\n\n      if (tmpImageData !== \"\") {\n        imageData = tmpImageData;\n      } else {\n        tmpImageData = jsPDFAPI.loadFile(imageData, true);\n        if (tmpImageData !== undefined) {\n          imageData = tmpImageData;\n        }\n      }\n    }\n\n    if (isDOMElement(imageData)) {\n      imageData = getImageDataFromElement(imageData, format);\n    }\n\n    format = getImageFileTypeByImageData(imageData, format);\n    if (!isImageTypeSupported(format)) {\n      throw new Error(\n        \"addImage does not support files of type '\" +\n          format +\n          \"', please ensure that a plugin for '\" +\n          format +\n          \"' support is added.\"\n      );\n    }\n\n    // now do the heavy lifting\n\n    if (notDefined(alias)) {\n      alias = generateAliasFromImageData(imageData);\n    }\n    result = checkImagesForAlias.call(this, alias);\n\n    if (!result) {\n      if (supportsArrayBuffer()) {\n        // no need to convert if imageData is already uint8array\n        if (!(imageData instanceof Uint8Array) && format !== \"RGBA\") {\n          dataAsBinaryString = imageData;\n          imageData = binaryStringToUint8Array(imageData);\n        }\n      }\n\n      result = this[\"process\" + format.toUpperCase()](\n        imageData,\n        getImageIndex.call(this),\n        alias,\n        checkCompressValue(compression),\n        dataAsBinaryString\n      );\n    }\n\n    if (!result) {\n      throw new Error(\"An unknown error occurred whilst processing the image.\");\n    }\n    return result;\n  };\n\n  /**\n   * @name convertBase64ToBinaryString\n   * @function\n   * @param {string} stringData\n   * @returns {string} binary string\n   */\n  var convertBase64ToBinaryString = (jsPDFAPI.__addimage__.convertBase64ToBinaryString = function(\n    stringData,\n    throwError\n  ) {\n    throwError = typeof throwError === \"boolean\" ? throwError : true;\n    var base64Info;\n    var imageData = \"\";\n    var rawData;\n\n    if (typeof stringData === \"string\") {\n      base64Info = extractImageFromDataUrl(stringData);\n      rawData = base64Info !== null ? base64Info.data : stringData;\n\n      try {\n        imageData = atob(rawData);\n      } catch (e) {\n        if (throwError) {\n          if (!validateStringAsBase64(rawData)) {\n            throw new Error(\n              \"Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString \"\n            );\n          } else {\n            throw new Error(\n              \"atob-Error in jsPDF.convertBase64ToBinaryString \" + e.message\n            );\n          }\n        }\n      }\n    }\n    return imageData;\n  });\n\n  /**\n   * @name getImageProperties\n   * @function\n   * @param {Object} imageData\n   * @returns {Object}\n   */\n  jsPDFAPI.getImageProperties = function(imageData) {\n    var image;\n    var tmpImageData = \"\";\n    var format;\n\n    if (isDOMElement(imageData)) {\n      imageData = getImageDataFromElement(imageData);\n    }\n\n    if (\n      typeof imageData === \"string\" &&\n      getImageFileTypeByImageData(imageData) === UNKNOWN\n    ) {\n      tmpImageData = convertBase64ToBinaryString(imageData, false);\n\n      if (tmpImageData === \"\") {\n        tmpImageData = jsPDFAPI.loadFile(imageData) || \"\";\n      }\n      imageData = tmpImageData;\n    }\n\n    format = getImageFileTypeByImageData(imageData);\n    if (!isImageTypeSupported(format)) {\n      throw new Error(\n        \"addImage does not support files of type '\" +\n          format +\n          \"', please ensure that a plugin for '\" +\n          format +\n          \"' support is added.\"\n      );\n    }\n\n    if (supportsArrayBuffer() && !(imageData instanceof Uint8Array)) {\n      imageData = binaryStringToUint8Array(imageData);\n    }\n\n    image = this[\"process\" + format.toUpperCase()](imageData);\n\n    if (!image) {\n      throw new Error(\"An unknown error occurred whilst processing the image\");\n    }\n\n    image.fileType = format;\n\n    return image;\n  };\n})(jsPDF.API);\n","/**\n * @license\n * Copyright (c) 2017 Aras Abbasi\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * jsPDF arabic parser PlugIn\n *\n * @name arabic\n * @module\n */\n(function(jsPDFAPI) {\n  \"use strict\";\n\n  /**\n   * Arabic shape substitutions: char code => (isolated, final, initial, medial).\n   * Arabic Substition A\n   */\n  var arabicSubstitionA = {\n    0x0621: [0xfe80], // ARABIC LETTER HAMZA\n    0x0622: [0xfe81, 0xfe82], // ARABIC LETTER ALEF WITH MADDA ABOVE\n    0x0623: [0xfe83, 0xfe84], // ARABIC LETTER ALEF WITH HAMZA ABOVE\n    0x0624: [0xfe85, 0xfe86], // ARABIC LETTER WAW WITH HAMZA ABOVE\n    0x0625: [0xfe87, 0xfe88], // ARABIC LETTER ALEF WITH HAMZA BELOW\n    0x0626: [0xfe89, 0xfe8a, 0xfe8b, 0xfe8c], // ARABIC LETTER YEH WITH HAMZA ABOVE\n    0x0627: [0xfe8d, 0xfe8e], // ARABIC LETTER ALEF\n    0x0628: [0xfe8f, 0xfe90, 0xfe91, 0xfe92], // ARABIC LETTER BEH\n    0x0629: [0xfe93, 0xfe94], // ARABIC LETTER TEH MARBUTA\n    0x062a: [0xfe95, 0xfe96, 0xfe97, 0xfe98], // ARABIC LETTER TEH\n    0x062b: [0xfe99, 0xfe9a, 0xfe9b, 0xfe9c], // ARABIC LETTER THEH\n    0x062c: [0xfe9d, 0xfe9e, 0xfe9f, 0xfea0], // ARABIC LETTER JEEM\n    0x062d: [0xfea1, 0xfea2, 0xfea3, 0xfea4], // ARABIC LETTER HAH\n    0x062e: [0xfea5, 0xfea6, 0xfea7, 0xfea8], // ARABIC LETTER KHAH\n    0x062f: [0xfea9, 0xfeaa], // ARABIC LETTER DAL\n    0x0630: [0xfeab, 0xfeac], // ARABIC LETTER THAL\n    0x0631: [0xfead, 0xfeae], // ARABIC LETTER REH\n    0x0632: [0xfeaf, 0xfeb0], // ARABIC LETTER ZAIN\n    0x0633: [0xfeb1, 0xfeb2, 0xfeb3, 0xfeb4], // ARABIC LETTER SEEN\n    0x0634: [0xfeb5, 0xfeb6, 0xfeb7, 0xfeb8], // ARABIC LETTER SHEEN\n    0x0635: [0xfeb9, 0xfeba, 0xfebb, 0xfebc], // ARABIC LETTER SAD\n    0x0636: [0xfebd, 0xfebe, 0xfebf, 0xfec0], // ARABIC LETTER DAD\n    0x0637: [0xfec1, 0xfec2, 0xfec3, 0xfec4], // ARABIC LETTER TAH\n    0x0638: [0xfec5, 0xfec6, 0xfec7, 0xfec8], // ARABIC LETTER ZAH\n    0x0639: [0xfec9, 0xfeca, 0xfecb, 0xfecc], // ARABIC LETTER AIN\n    0x063a: [0xfecd, 0xfece, 0xfecf, 0xfed0], // ARABIC LETTER GHAIN\n    0x0641: [0xfed1, 0xfed2, 0xfed3, 0xfed4], // ARABIC LETTER FEH\n    0x0642: [0xfed5, 0xfed6, 0xfed7, 0xfed8], // ARABIC LETTER QAF\n    0x0643: [0xfed9, 0xfeda, 0xfedb, 0xfedc], // ARABIC LETTER KAF\n    0x0644: [0xfedd, 0xfede, 0xfedf, 0xfee0], // ARABIC LETTER LAM\n    0x0645: [0xfee1, 0xfee2, 0xfee3, 0xfee4], // ARABIC LETTER MEEM\n    0x0646: [0xfee5, 0xfee6, 0xfee7, 0xfee8], // ARABIC LETTER NOON\n    0x0647: [0xfee9, 0xfeea, 0xfeeb, 0xfeec], // ARABIC LETTER HEH\n    0x0648: [0xfeed, 0xfeee], // ARABIC LETTER WAW\n    0x0649: [0xfeef, 0xfef0, 64488, 64489], // ARABIC LETTER ALEF MAKSURA\n    0x064a: [0xfef1, 0xfef2, 0xfef3, 0xfef4], // ARABIC LETTER YEH\n    0x0671: [0xfb50, 0xfb51], // ARABIC LETTER ALEF WASLA\n    0x0677: [0xfbdd], // ARABIC LETTER U WITH HAMZA ABOVE\n    0x0679: [0xfb66, 0xfb67, 0xfb68, 0xfb69], // ARABIC LETTER TTEH\n    0x067a: [0xfb5e, 0xfb5f, 0xfb60, 0xfb61], // ARABIC LETTER TTEHEH\n    0x067b: [0xfb52, 0xfb53, 0xfb54, 0xfb55], // ARABIC LETTER BEEH\n    0x067e: [0xfb56, 0xfb57, 0xfb58, 0xfb59], // ARABIC LETTER PEH\n    0x067f: [0xfb62, 0xfb63, 0xfb64, 0xfb65], // ARABIC LETTER TEHEH\n    0x0680: [0xfb5a, 0xfb5b, 0xfb5c, 0xfb5d], // ARABIC LETTER BEHEH\n    0x0683: [0xfb76, 0xfb77, 0xfb78, 0xfb79], // ARABIC LETTER NYEH\n    0x0684: [0xfb72, 0xfb73, 0xfb74, 0xfb75], // ARABIC LETTER DYEH\n    0x0686: [0xfb7a, 0xfb7b, 0xfb7c, 0xfb7d], // ARABIC LETTER TCHEH\n    0x0687: [0xfb7e, 0xfb7f, 0xfb80, 0xfb81], // ARABIC LETTER TCHEHEH\n    0x0688: [0xfb88, 0xfb89], // ARABIC LETTER DDAL\n    0x068c: [0xfb84, 0xfb85], // ARABIC LETTER DAHAL\n    0x068d: [0xfb82, 0xfb83], // ARABIC LETTER DDAHAL\n    0x068e: [0xfb86, 0xfb87], // ARABIC LETTER DUL\n    0x0691: [0xfb8c, 0xfb8d], // ARABIC LETTER RREH\n    0x0698: [0xfb8a, 0xfb8b], // ARABIC LETTER JEH\n    0x06a4: [0xfb6a, 0xfb6b, 0xfb6c, 0xfb6d], // ARABIC LETTER VEH\n    0x06a6: [0xfb6e, 0xfb6f, 0xfb70, 0xfb71], // ARABIC LETTER PEHEH\n    0x06a9: [0xfb8e, 0xfb8f, 0xfb90, 0xfb91], // ARABIC LETTER KEHEH\n    0x06ad: [0xfbd3, 0xfbd4, 0xfbd5, 0xfbd6], // ARABIC LETTER NG\n    0x06af: [0xfb92, 0xfb93, 0xfb94, 0xfb95], // ARABIC LETTER GAF\n    0x06b1: [0xfb9a, 0xfb9b, 0xfb9c, 0xfb9d], // ARABIC LETTER NGOEH\n    0x06b3: [0xfb96, 0xfb97, 0xfb98, 0xfb99], // ARABIC LETTER GUEH\n    0x06ba: [0xfb9e, 0xfb9f], // ARABIC LETTER NOON GHUNNA\n    0x06bb: [0xfba0, 0xfba1, 0xfba2, 0xfba3], // ARABIC LETTER RNOON\n    0x06be: [0xfbaa, 0xfbab, 0xfbac, 0xfbad], // ARABIC LETTER HEH DOACHASHMEE\n    0x06c0: [0xfba4, 0xfba5], // ARABIC LETTER HEH WITH YEH ABOVE\n    0x06c1: [0xfba6, 0xfba7, 0xfba8, 0xfba9], // ARABIC LETTER HEH GOAL\n    0x06c5: [0xfbe0, 0xfbe1], // ARABIC LETTER KIRGHIZ OE\n    0x06c6: [0xfbd9, 0xfbda], // ARABIC LETTER OE\n    0x06c7: [0xfbd7, 0xfbd8], // ARABIC LETTER U\n    0x06c8: [0xfbdb, 0xfbdc], // ARABIC LETTER YU\n    0x06c9: [0xfbe2, 0xfbe3], // ARABIC LETTER KIRGHIZ YU\n    0x06cb: [0xfbde, 0xfbdf], // ARABIC LETTER VE\n    0x06cc: [0xfbfc, 0xfbfd, 0xfbfe, 0xfbff], // ARABIC LETTER FARSI YEH\n    0x06d0: [0xfbe4, 0xfbe5, 0xfbe6, 0xfbe7], //ARABIC LETTER E\n    0x06d2: [0xfbae, 0xfbaf], // ARABIC LETTER YEH BARREE\n    0x06d3: [0xfbb0, 0xfbb1] // ARABIC LETTER YEH BARREE WITH HAMZA ABOVE\n  };\n\n  /*\n    var ligaturesSubstitutionA = {\n        0xFBEA: []// ARABIC LIGATURE YEH WITH HAMZA ABOVE WITH ALEF ISOLATED FORM\n    };\n    */\n\n  var ligatures = {\n    0xfedf: {\n      0xfe82: 0xfef5, // ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE ISOLATED FORM\n      0xfe84: 0xfef7, // ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE ISOLATED FORM\n      0xfe88: 0xfef9, // ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW ISOLATED FORM\n      0xfe8e: 0xfefb // ARABIC LIGATURE LAM WITH ALEF ISOLATED FORM\n    },\n    0xfee0: {\n      0xfe82: 0xfef6, // ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE FINAL FORM\n      0xfe84: 0xfef8, // ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE FINAL FORM\n      0xfe88: 0xfefa, // ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW FINAL FORM\n      0xfe8e: 0xfefc // ARABIC LIGATURE LAM WITH ALEF FINAL FORM\n    },\n    0xfe8d: { 0xfedf: { 0xfee0: { 0xfeea: 0xfdf2 } } }, // ALLAH\n    0x0651: {\n      0x064c: 0xfc5e, // Shadda + Dammatan\n      0x064d: 0xfc5f, // Shadda + Kasratan\n      0x064e: 0xfc60, // Shadda + Fatha\n      0x064f: 0xfc61, // Shadda + Damma\n      0x0650: 0xfc62 // Shadda + Kasra\n    }\n  };\n\n  var arabic_diacritics = {\n    1612: 64606, // Shadda + Dammatan\n    1613: 64607, // Shadda + Kasratan\n    1614: 64608, // Shadda + Fatha\n    1615: 64609, // Shadda + Damma\n    1616: 64610 // Shadda + Kasra\n  };\n\n  var alfletter = [1570, 1571, 1573, 1575];\n\n  var noChangeInForm = -1;\n  var isolatedForm = 0;\n  var finalForm = 1;\n  var initialForm = 2;\n  var medialForm = 3;\n\n  jsPDFAPI.__arabicParser__ = {};\n\n  //private\n  var isInArabicSubstitutionA = (jsPDFAPI.__arabicParser__.isInArabicSubstitutionA = function(\n    letter\n  ) {\n    return typeof arabicSubstitionA[letter.charCodeAt(0)] !== \"undefined\";\n  });\n\n  var isArabicLetter = (jsPDFAPI.__arabicParser__.isArabicLetter = function(\n    letter\n  ) {\n    return (\n      typeof letter === \"string\" &&\n      /^[\\u0600-\\u06FF\\u0750-\\u077F\\u08A0-\\u08FF\\uFB50-\\uFDFF\\uFE70-\\uFEFF]+$/.test(\n        letter\n      )\n    );\n  });\n\n  var isArabicEndLetter = (jsPDFAPI.__arabicParser__.isArabicEndLetter = function(\n    letter\n  ) {\n    return (\n      isArabicLetter(letter) &&\n      isInArabicSubstitutionA(letter) &&\n      arabicSubstitionA[letter.charCodeAt(0)].length <= 2\n    );\n  });\n\n  var isArabicAlfLetter = (jsPDFAPI.__arabicParser__.isArabicAlfLetter = function(\n    letter\n  ) {\n    return (\n      isArabicLetter(letter) && alfletter.indexOf(letter.charCodeAt(0)) >= 0\n    );\n  });\n\n  jsPDFAPI.__arabicParser__.arabicLetterHasIsolatedForm = function(letter) {\n    return (\n      isArabicLetter(letter) &&\n      isInArabicSubstitutionA(letter) &&\n      arabicSubstitionA[letter.charCodeAt(0)].length >= 1\n    );\n  };\n\n  var arabicLetterHasFinalForm = (jsPDFAPI.__arabicParser__.arabicLetterHasFinalForm = function(\n    letter\n  ) {\n    return (\n      isArabicLetter(letter) &&\n      isInArabicSubstitutionA(letter) &&\n      arabicSubstitionA[letter.charCodeAt(0)].length >= 2\n    );\n  });\n\n  jsPDFAPI.__arabicParser__.arabicLetterHasInitialForm = function(letter) {\n    return (\n      isArabicLetter(letter) &&\n      isInArabicSubstitutionA(letter) &&\n      arabicSubstitionA[letter.charCodeAt(0)].length >= 3\n    );\n  };\n\n  var arabicLetterHasMedialForm = (jsPDFAPI.__arabicParser__.arabicLetterHasMedialForm = function(\n    letter\n  ) {\n    return (\n      isArabicLetter(letter) &&\n      isInArabicSubstitutionA(letter) &&\n      arabicSubstitionA[letter.charCodeAt(0)].length == 4\n    );\n  });\n\n  var resolveLigatures = (jsPDFAPI.__arabicParser__.resolveLigatures = function(\n    letters\n  ) {\n    var i = 0;\n    var tmpLigatures = ligatures;\n    var result = \"\";\n    var effectedLetters = 0;\n\n    for (i = 0; i < letters.length; i += 1) {\n      if (typeof tmpLigatures[letters.charCodeAt(i)] !== \"undefined\") {\n        effectedLetters++;\n        tmpLigatures = tmpLigatures[letters.charCodeAt(i)];\n\n        if (typeof tmpLigatures === \"number\") {\n          result += String.fromCharCode(tmpLigatures);\n          tmpLigatures = ligatures;\n          effectedLetters = 0;\n        }\n        if (i === letters.length - 1) {\n          tmpLigatures = ligatures;\n          result += letters.charAt(i - (effectedLetters - 1));\n          i = i - (effectedLetters - 1);\n          effectedLetters = 0;\n        }\n      } else {\n        tmpLigatures = ligatures;\n        result += letters.charAt(i - effectedLetters);\n        i = i - effectedLetters;\n        effectedLetters = 0;\n      }\n    }\n\n    return result;\n  });\n\n  jsPDFAPI.__arabicParser__.isArabicDiacritic = function(letter) {\n    return (\n      letter !== undefined &&\n      arabic_diacritics[letter.charCodeAt(0)] !== undefined\n    );\n  };\n\n  var getCorrectForm = (jsPDFAPI.__arabicParser__.getCorrectForm = function(\n    currentChar,\n    beforeChar,\n    nextChar\n  ) {\n    if (!isArabicLetter(currentChar)) {\n      return -1;\n    }\n\n    if (isInArabicSubstitutionA(currentChar) === false) {\n      return noChangeInForm;\n    }\n    if (\n      !arabicLetterHasFinalForm(currentChar) ||\n      (!isArabicLetter(beforeChar) && !isArabicLetter(nextChar)) ||\n      (!isArabicLetter(nextChar) && isArabicEndLetter(beforeChar)) ||\n      (isArabicEndLetter(currentChar) && !isArabicLetter(beforeChar)) ||\n      (isArabicEndLetter(currentChar) && isArabicAlfLetter(beforeChar)) ||\n      (isArabicEndLetter(currentChar) && isArabicEndLetter(beforeChar))\n    ) {\n      return isolatedForm;\n    }\n\n    if (\n      arabicLetterHasMedialForm(currentChar) &&\n      isArabicLetter(beforeChar) &&\n      !isArabicEndLetter(beforeChar) &&\n      isArabicLetter(nextChar) &&\n      arabicLetterHasFinalForm(nextChar)\n    ) {\n      return medialForm;\n    }\n\n    if (isArabicEndLetter(currentChar) || !isArabicLetter(nextChar)) {\n      return finalForm;\n    }\n    return initialForm;\n  });\n\n  /**\n   * @name processArabic\n   * @function\n   * @param {string} text\n   * @returns {string}\n   */\n  var parseArabic = function(text) {\n    text = text || \"\";\n\n    var result = \"\";\n    var i = 0;\n    var j = 0;\n    var position = 0;\n    var currentLetter = \"\";\n    var prevLetter = \"\";\n    var nextLetter = \"\";\n\n    var words = text.split(\"\\\\s+\");\n    var newWords = [];\n    for (i = 0; i < words.length; i += 1) {\n      newWords.push(\"\");\n      for (j = 0; j < words[i].length; j += 1) {\n        currentLetter = words[i][j];\n        prevLetter = words[i][j - 1];\n        nextLetter = words[i][j + 1];\n        if (isArabicLetter(currentLetter)) {\n          position = getCorrectForm(currentLetter, prevLetter, nextLetter);\n          if (position !== -1) {\n            newWords[i] += String.fromCharCode(\n              arabicSubstitionA[currentLetter.charCodeAt(0)][position]\n            );\n          } else {\n            newWords[i] += currentLetter;\n          }\n        } else {\n          newWords[i] += currentLetter;\n        }\n      }\n\n      newWords[i] = resolveLigatures(newWords[i]);\n    }\n    result = newWords.join(\" \");\n\n    return result;\n  };\n\n  var processArabic = (jsPDFAPI.__arabicParser__.processArabic = jsPDFAPI.processArabic = function() {\n    var text =\n      typeof arguments[0] === \"string\" ? arguments[0] : arguments[0].text;\n    var tmpText = [];\n    var result;\n\n    if (Array.isArray(text)) {\n      var i = 0;\n      tmpText = [];\n      for (i = 0; i < text.length; i += 1) {\n        if (Array.isArray(text[i])) {\n          tmpText.push([parseArabic(text[i][0]), text[i][1], text[i][2]]);\n        } else {\n          tmpText.push([parseArabic(text[i])]);\n        }\n      }\n      result = tmpText;\n    } else {\n      result = parseArabic(text);\n    }\n    if (typeof arguments[0] === \"string\") {\n      return result;\n    } else {\n      arguments[0].text = result;\n      return arguments[0];\n    }\n  });\n\n  jsPDFAPI.events.push([\"preProcessText\", processArabic]);\n})(jsPDF.API);\n","/** @license\n * jsPDF Autoprint Plugin\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * @name autoprint\n * @module\n */\n(function(jsPDFAPI) {\n  \"use strict\";\n\n  /**\n   * Makes the PDF automatically open the print-Dialog when opened in a PDF-viewer.\n   *\n   * @name autoPrint\n   * @function\n   * @param {Object} options (optional) Set the attribute variant to 'non-conform' (default) or 'javascript' to activate different methods of automatic printing when opening in a PDF-viewer .\n   * @returns {jsPDF}\n   * @example\n   * var doc = new jsPDF();\n   * doc.text(10, 10, 'This is a test');\n   * doc.autoPrint({variant: 'non-conform'});\n   * doc.save('autoprint.pdf');\n   */\n  jsPDFAPI.autoPrint = function(options) {\n    \"use strict\";\n    var refAutoPrintTag;\n    options = options || {};\n    options.variant = options.variant || \"non-conform\";\n\n    switch (options.variant) {\n      case \"javascript\":\n        //https://github.com/Rob--W/pdf.js/commit/c676ecb5a0f54677b9f3340c3ef2cf42225453bb\n        this.addJS(\"print({});\");\n        break;\n      case \"non-conform\":\n      default:\n        this.internal.events.subscribe(\"postPutResources\", function() {\n          refAutoPrintTag = this.internal.newObject();\n          this.internal.out(\"<<\");\n          this.internal.out(\"/S /Named\");\n          this.internal.out(\"/Type /Action\");\n          this.internal.out(\"/N /Print\");\n          this.internal.out(\">>\");\n          this.internal.out(\"endobj\");\n        });\n\n        this.internal.events.subscribe(\"putCatalog\", function() {\n          this.internal.out(\"/OpenAction \" + refAutoPrintTag + \" 0 R\");\n        });\n        break;\n    }\n    return this;\n  };\n})(jsPDF.API);\n","/**\n * @license\n * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * jsPDF Canvas PlugIn\n * This plugin mimics the HTML5 Canvas\n *\n * The goal is to provide a way for current canvas users to print directly to a PDF.\n * @name canvas\n * @module\n */\n(function(jsPDFAPI) {\n  \"use strict\";\n\n  /**\n   * @class Canvas\n   * @classdesc A Canvas Wrapper for jsPDF\n   */\n  var Canvas = function() {\n    var jsPdfInstance = undefined;\n    Object.defineProperty(this, \"pdf\", {\n      get: function() {\n        return jsPdfInstance;\n      },\n      set: function(value) {\n        jsPdfInstance = value;\n      }\n    });\n\n    var _width = 150;\n    /**\n     * The height property is a positive integer reflecting the height HTML attribute of the <canvas> element interpreted in CSS pixels. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 150 is used.\n     * This is one of the two properties, the other being width, that controls the size of the canvas.\n     *\n     * @name width\n     */\n    Object.defineProperty(this, \"width\", {\n      get: function() {\n        return _width;\n      },\n      set: function(value) {\n        if (isNaN(value) || Number.isInteger(value) === false || value < 0) {\n          _width = 150;\n        } else {\n          _width = value;\n        }\n        if (this.getContext(\"2d\").pageWrapXEnabled) {\n          this.getContext(\"2d\").pageWrapX = _width + 1;\n        }\n      }\n    });\n\n    var _height = 300;\n    /**\n     * The width property is a positive integer reflecting the width HTML attribute of the <canvas> element interpreted in CSS pixels. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 300 is used.\n     * This is one of the two properties, the other being height, that controls the size of the canvas.\n     *\n     * @name height\n     */\n    Object.defineProperty(this, \"height\", {\n      get: function() {\n        return _height;\n      },\n      set: function(value) {\n        if (isNaN(value) || Number.isInteger(value) === false || value < 0) {\n          _height = 300;\n        } else {\n          _height = value;\n        }\n        if (this.getContext(\"2d\").pageWrapYEnabled) {\n          this.getContext(\"2d\").pageWrapY = _height + 1;\n        }\n      }\n    });\n\n    var _childNodes = [];\n    Object.defineProperty(this, \"childNodes\", {\n      get: function() {\n        return _childNodes;\n      },\n      set: function(value) {\n        _childNodes = value;\n      }\n    });\n\n    var _style = {};\n    Object.defineProperty(this, \"style\", {\n      get: function() {\n        return _style;\n      },\n      set: function(value) {\n        _style = value;\n      }\n    });\n\n    Object.defineProperty(this, \"parentNode\", {});\n  };\n\n  /**\n   * The getContext() method returns a drawing context on the canvas, or null if the context identifier is not supported.\n   *\n   * @name getContext\n   * @function\n   * @param {string} contextType Is a String containing the context identifier defining the drawing context associated to the canvas. Possible value is \"2d\", leading to the creation of a Context2D object representing a two-dimensional rendering context.\n   * @param {object} contextAttributes\n   */\n  Canvas.prototype.getContext = function(contextType, contextAttributes) {\n    contextType = contextType || \"2d\";\n    var key;\n\n    if (contextType !== \"2d\") {\n      return null;\n    }\n    for (key in contextAttributes) {\n      if (this.pdf.context2d.hasOwnProperty(key)) {\n        this.pdf.context2d[key] = contextAttributes[key];\n      }\n    }\n    this.pdf.context2d._canvas = this;\n    return this.pdf.context2d;\n  };\n\n  /**\n   * The toDataURL() method is just a stub to throw an error if accidently called.\n   *\n   * @name toDataURL\n   * @function\n   */\n  Canvas.prototype.toDataURL = function() {\n    throw new Error(\"toDataURL is not implemented.\");\n  };\n\n  jsPDFAPI.events.push([\n    \"initialized\",\n    function() {\n      this.canvas = new Canvas();\n      this.canvas.pdf = this;\n    }\n  ]);\n\n  return this;\n})(jsPDF.API);\n","/**\n * @license\n * ====================================================================\n * Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com\n *               2013 Eduardo Menezes de Morais, eduardo.morais@usp.br\n *               2013 Lee Driscoll, https://github.com/lsdriscoll\n *               2014 Juan Pablo Gaviria, https://github.com/juanpgaviria\n *               2014 James Hall, james@parall.ax\n *               2014 Diego Casorran, https://github.com/diegocr\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * ====================================================================\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * @name cell\n * @module\n */\n(function(jsPDFAPI) {\n  \"use strict\";\n\n  var NO_MARGINS = { left: 0, top: 0, bottom: 0, right: 0 };\n\n  var px2pt = (0.264583 * 72) / 25.4;\n  var printingHeaderRow = false;\n\n  var _initialize = function() {\n    if (typeof this.internal.__cell__ === \"undefined\") {\n      this.internal.__cell__ = {};\n      this.internal.__cell__.padding = 3;\n      this.internal.__cell__.headerFunction = undefined;\n      this.internal.__cell__.margins = Object.assign({}, NO_MARGINS);\n      this.internal.__cell__.margins.width = this.getPageWidth();\n      _reset.call(this);\n    }\n  };\n\n  var _reset = function() {\n    this.internal.__cell__.lastCell = new Cell();\n    this.internal.__cell__.pages = 1;\n  };\n\n  var Cell = function() {\n    var _x = arguments[0];\n    Object.defineProperty(this, \"x\", {\n      enumerable: true,\n      get: function() {\n        return _x;\n      },\n      set: function(value) {\n        _x = value;\n      }\n    });\n    var _y = arguments[1];\n    Object.defineProperty(this, \"y\", {\n      enumerable: true,\n      get: function() {\n        return _y;\n      },\n      set: function(value) {\n        _y = value;\n      }\n    });\n    var _width = arguments[2];\n    Object.defineProperty(this, \"width\", {\n      enumerable: true,\n      get: function() {\n        return _width;\n      },\n      set: function(value) {\n        _width = value;\n      }\n    });\n    var _height = arguments[3];\n    Object.defineProperty(this, \"height\", {\n      enumerable: true,\n      get: function() {\n        return _height;\n      },\n      set: function(value) {\n        _height = value;\n      }\n    });\n    var _text = arguments[4];\n    Object.defineProperty(this, \"text\", {\n      enumerable: true,\n      get: function() {\n        return _text;\n      },\n      set: function(value) {\n        _text = value;\n      }\n    });\n    var _lineNumber = arguments[5];\n    Object.defineProperty(this, \"lineNumber\", {\n      enumerable: true,\n      get: function() {\n        return _lineNumber;\n      },\n      set: function(value) {\n        _lineNumber = value;\n      }\n    });\n    var _align = arguments[6];\n    Object.defineProperty(this, \"align\", {\n      enumerable: true,\n      get: function() {\n        return _align;\n      },\n      set: function(value) {\n        _align = value;\n      }\n    });\n\n    return this;\n  };\n\n  Cell.prototype.clone = function() {\n    return new Cell(\n      this.x,\n      this.y,\n      this.width,\n      this.height,\n      this.text,\n      this.lineNumber,\n      this.align\n    );\n  };\n\n  Cell.prototype.toArray = function() {\n    return [\n      this.x,\n      this.y,\n      this.width,\n      this.height,\n      this.text,\n      this.lineNumber,\n      this.align\n    ];\n  };\n\n  /**\n   * @name setHeaderFunction\n   * @function\n   * @param {function} func\n   */\n  jsPDFAPI.setHeaderFunction = function(func) {\n    _initialize.call(this);\n    this.internal.__cell__.headerFunction =\n      typeof func === \"function\" ? func : undefined;\n    return this;\n  };\n\n  /**\n   * @name getTextDimensions\n   * @function\n   * @param {string} txt\n   * @returns {Object} dimensions\n   */\n  jsPDFAPI.getTextDimensions = function(text, options) {\n    _initialize.call(this);\n    options = options || {};\n    var fontSize = options.fontSize || this.getFontSize();\n    var font = options.font || this.getFont();\n    var scaleFactor = options.scaleFactor || this.internal.scaleFactor;\n    var width = 0;\n    var amountOfLines = 0;\n    var height = 0;\n    var tempWidth = 0;\n    var scope = this;\n\n    if (!Array.isArray(text) && typeof text !== \"string\") {\n      if (typeof text === \"number\") {\n        text = String(text);\n      } else {\n        throw new Error(\n          \"getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.\"\n        );\n      }\n    }\n\n    const maxWidth = options.maxWidth;\n    if (maxWidth > 0) {\n      if (typeof text === \"string\") {\n        text = this.splitTextToSize(text, maxWidth);\n      } else if (Object.prototype.toString.call(text) === \"[object Array]\") {\n        text = text.reduce(function(acc, textLine) {\n          return acc.concat(scope.splitTextToSize(textLine, maxWidth));\n        }, []);\n      }\n    } else {\n      // Without the else clause, it will not work if you do not pass along maxWidth\n      text = Array.isArray(text) ? text : [text];\n    }\n\n    for (var i = 0; i < text.length; i++) {\n      tempWidth = this.getStringUnitWidth(text[i], { font: font }) * fontSize;\n      if (width < tempWidth) {\n        width = tempWidth;\n      }\n    }\n\n    if (width !== 0) {\n      amountOfLines = text.length;\n    }\n\n    width = width / scaleFactor;\n    height = Math.max(\n      (amountOfLines * fontSize * this.getLineHeightFactor() -\n        fontSize * (this.getLineHeightFactor() - 1)) /\n        scaleFactor,\n      0\n    );\n    return { w: width, h: height };\n  };\n\n  /**\n   * @name cellAddPage\n   * @function\n   */\n  jsPDFAPI.cellAddPage = function() {\n    _initialize.call(this);\n\n    this.addPage();\n\n    var margins = this.internal.__cell__.margins || NO_MARGINS;\n    this.internal.__cell__.lastCell = new Cell(\n      margins.left,\n      margins.top,\n      undefined,\n      undefined\n    );\n    this.internal.__cell__.pages += 1;\n\n    return this;\n  };\n\n  /**\n   * @name cell\n   * @function\n   * @param {number} x\n   * @param {number} y\n   * @param {number} width\n   * @param {number} height\n   * @param {string} text\n   * @param {number} lineNumber lineNumber\n   * @param {string} align\n   * @return {jsPDF} jsPDF-instance\n   */\n  var cell = (jsPDFAPI.cell = function() {\n    var currentCell;\n\n    if (arguments[0] instanceof Cell) {\n      currentCell = arguments[0];\n    } else {\n      currentCell = new Cell(\n        arguments[0],\n        arguments[1],\n        arguments[2],\n        arguments[3],\n        arguments[4],\n        arguments[5]\n      );\n    }\n    _initialize.call(this);\n    var lastCell = this.internal.__cell__.lastCell;\n    var padding = this.internal.__cell__.padding;\n    var margins = this.internal.__cell__.margins || NO_MARGINS;\n    var tableHeaderRow = this.internal.__cell__.tableHeaderRow;\n    var printHeaders = this.internal.__cell__.printHeaders;\n    // If this is not the first cell, we must change its position\n    if (typeof lastCell.lineNumber !== \"undefined\") {\n      if (lastCell.lineNumber === currentCell.lineNumber) {\n        //Same line\n        currentCell.x = (lastCell.x || 0) + (lastCell.width || 0);\n        currentCell.y = lastCell.y || 0;\n      } else {\n        //New line\n        if (\n          lastCell.y + lastCell.height + currentCell.height + margins.bottom >\n          this.getPageHeight()\n        ) {\n          this.cellAddPage();\n          currentCell.y = margins.top;\n          if (printHeaders && tableHeaderRow) {\n            this.printHeaderRow(currentCell.lineNumber, true);\n            currentCell.y += tableHeaderRow[0].height;\n          }\n        } else {\n          currentCell.y = lastCell.y + lastCell.height || currentCell.y;\n        }\n      }\n    }\n\n    if (typeof currentCell.text[0] !== \"undefined\") {\n      this.rect(\n        currentCell.x,\n        currentCell.y,\n        currentCell.width,\n        currentCell.height,\n        printingHeaderRow === true ? \"FD\" : undefined\n      );\n      if (currentCell.align === \"right\") {\n        this.text(\n          currentCell.text,\n          currentCell.x + currentCell.width - padding,\n          currentCell.y + padding,\n          { align: \"right\", baseline: \"top\" }\n        );\n      } else if (currentCell.align === \"center\") {\n        this.text(\n          currentCell.text,\n          currentCell.x + currentCell.width / 2,\n          currentCell.y + padding,\n          {\n            align: \"center\",\n            baseline: \"top\",\n            maxWidth: currentCell.width - padding - padding\n          }\n        );\n      } else {\n        this.text(\n          currentCell.text,\n          currentCell.x + padding,\n          currentCell.y + padding,\n          {\n            align: \"left\",\n            baseline: \"top\",\n            maxWidth: currentCell.width - padding - padding\n          }\n        );\n      }\n    }\n    this.internal.__cell__.lastCell = currentCell;\n    return this;\n  });\n\n  /**\n     * Create a table from a set of data.\n     * @name table\n     * @function\n     * @param {Integer} [x] : left-position for top-left corner of table\n     * @param {Integer} [y] top-position for top-left corner of table\n     * @param {Object[]} [data] An array of objects containing key-value pairs corresponding to a row of data.\n     * @param {String[]} [headers] Omit or null to auto-generate headers at a performance cost\n\n     * @param {Object} [config.printHeaders] True to print column headers at the top of every page\n     * @param {Object} [config.autoSize] True to dynamically set the column widths to match the widest cell value\n     * @param {Object} [config.margins] margin values for left, top, bottom, and width\n     * @param {Object} [config.fontSize] Integer fontSize to use (optional)\n     * @param {Object} [config.padding] cell-padding in pt to use (optional)\n     * @param {Object} [config.headerBackgroundColor] default is #c8c8c8 (optional)\n     * @param {Object} [config.headerTextColor] default is #000 (optional)\n     * @param {Object} [config.rowStart] callback to handle before print each row (optional)\n     * @param {Object} [config.cellStart] callback to handle before print each cell (optional)\n     * @returns {jsPDF} jsPDF-instance\n     */\n\n  jsPDFAPI.table = function(x, y, data, headers, config) {\n    _initialize.call(this);\n    if (!data) {\n      throw new Error(\"No data for PDF table.\");\n    }\n\n    config = config || {};\n\n    var headerNames = [],\n      headerLabels = [],\n      headerAligns = [],\n      i,\n      columnMatrix = {},\n      columnWidths = {},\n      column,\n      columnMinWidths = [],\n      j,\n      tableHeaderConfigs = [],\n      //set up defaults. If a value is provided in config, defaults will be overwritten:\n      autoSize = config.autoSize || false,\n      printHeaders = config.printHeaders === false ? false : true,\n      fontSize =\n        config.css && typeof config.css[\"font-size\"] !== \"undefined\"\n          ? config.css[\"font-size\"] * 16\n          : config.fontSize || 12,\n      margins =\n        config.margins ||\n        Object.assign({ width: this.getPageWidth() }, NO_MARGINS),\n      padding = typeof config.padding === \"number\" ? config.padding : 3,\n      headerBackgroundColor = config.headerBackgroundColor || \"#c8c8c8\",\n      headerTextColor = config.headerTextColor || \"#000\";\n\n    _reset.call(this);\n\n    this.internal.__cell__.printHeaders = printHeaders;\n    this.internal.__cell__.margins = margins;\n    this.internal.__cell__.table_font_size = fontSize;\n    this.internal.__cell__.padding = padding;\n    this.internal.__cell__.headerBackgroundColor = headerBackgroundColor;\n    this.internal.__cell__.headerTextColor = headerTextColor;\n    this.setFontSize(fontSize);\n\n    // Set header values\n    if (headers === undefined || headers === null) {\n      // No headers defined so we derive from data\n      headerNames = Object.keys(data[0]);\n      headerLabels = headerNames;\n      headerAligns = headerNames.map(function() {\n        return \"left\";\n      });\n    } else if (Array.isArray(headers) && typeof headers[0] === \"object\") {\n      headerNames = headers.map(function(header) {\n        return header.name;\n      });\n      headerLabels = headers.map(function(header) {\n        return header.prompt || header.name || \"\";\n      });\n      headerAligns = headers.map(function(header) {\n        return header.align || \"left\";\n      });\n      // Split header configs into names and prompts\n      for (i = 0; i < headers.length; i += 1) {\n        columnWidths[headers[i].name] = headers[i].width * px2pt;\n      }\n    } else if (Array.isArray(headers) && typeof headers[0] === \"string\") {\n      headerNames = headers;\n      headerLabels = headerNames;\n      headerAligns = headerNames.map(function() {\n        return \"left\";\n      });\n    }\n\n    if (\n      autoSize ||\n      (Array.isArray(headers) && typeof headers[0] === \"string\")\n    ) {\n      var headerName;\n      for (i = 0; i < headerNames.length; i += 1) {\n        headerName = headerNames[i];\n\n        // Create a matrix of columns e.g., {column_title: [row1_Record, row2_Record]}\n\n        columnMatrix[headerName] = data.map(function(rec) {\n          return rec[headerName];\n        });\n\n        // get header width\n        this.setFont(undefined, \"bold\");\n        columnMinWidths.push(\n          this.getTextDimensions(headerLabels[i], {\n            fontSize: this.internal.__cell__.table_font_size,\n            scaleFactor: this.internal.scaleFactor\n          }).w\n        );\n        column = columnMatrix[headerName];\n\n        // get cell widths\n        this.setFont(undefined, \"normal\");\n        for (j = 0; j < column.length; j += 1) {\n          columnMinWidths.push(\n            this.getTextDimensions(column[j], {\n              fontSize: this.internal.__cell__.table_font_size,\n              scaleFactor: this.internal.scaleFactor\n            }).w\n          );\n        }\n\n        // get final column width\n        columnWidths[headerName] =\n          Math.max.apply(null, columnMinWidths) + padding + padding;\n\n        //have to reset\n        columnMinWidths = [];\n      }\n    }\n\n    // -- Construct the table\n\n    if (printHeaders) {\n      var row = {};\n      for (i = 0; i < headerNames.length; i += 1) {\n        row[headerNames[i]] = {};\n        row[headerNames[i]].text = headerLabels[i];\n        row[headerNames[i]].align = headerAligns[i];\n      }\n\n      var rowHeight = calculateLineHeight.call(this, row, columnWidths);\n\n      // Construct the header row\n      tableHeaderConfigs = headerNames.map(function(value) {\n        return new Cell(\n          x,\n          y,\n          columnWidths[value],\n          rowHeight,\n          row[value].text,\n          undefined,\n          row[value].align\n        );\n      });\n\n      // Store the table header config\n      this.setTableHeaderRow(tableHeaderConfigs);\n\n      // Print the header for the start of the table\n      this.printHeaderRow(1, false);\n    }\n\n    // Construct the data rows\n\n    var align = headers.reduce(function(pv, cv) {\n      pv[cv.name] = cv.align;\n      return pv;\n    }, {});\n    for (i = 0; i < data.length; i += 1) {\n      if (\"rowStart\" in config && config.rowStart instanceof Function) {\n        config.rowStart(\n          {\n            row: i,\n            data: data[i]\n          },\n          this\n        );\n      }\n      var lineHeight = calculateLineHeight.call(this, data[i], columnWidths);\n\n      for (j = 0; j < headerNames.length; j += 1) {\n        var cellData = data[i][headerNames[j]];\n        if (\"cellStart\" in config && config.cellStart instanceof Function) {\n          config.cellStart(\n            {\n              row: i,\n              col: j,\n              data: cellData\n            },\n            this\n          );\n        }\n        cell.call(\n          this,\n          new Cell(\n            x,\n            y,\n            columnWidths[headerNames[j]],\n            lineHeight,\n            cellData,\n            i + 2,\n            align[headerNames[j]]\n          )\n        );\n      }\n    }\n    this.internal.__cell__.table_x = x;\n    this.internal.__cell__.table_y = y;\n    return this;\n  };\n\n  /**\n   * Calculate the height for containing the highest column\n   *\n   * @name calculateLineHeight\n   * @function\n   * @param {Object[]} model is the line of data we want to calculate the height of\n   * @param {Integer[]} columnWidths is size of each column\n   * @returns {number} lineHeight\n   * @private\n   */\n  var calculateLineHeight = function calculateLineHeight(model, columnWidths) {\n    var padding = this.internal.__cell__.padding;\n    var fontSize = this.internal.__cell__.table_font_size;\n    var scaleFactor = this.internal.scaleFactor;\n\n    return Object.keys(model)\n      .map(function(key) {\n        var value = model[key];\n        return this.splitTextToSize(\n          value.hasOwnProperty(\"text\") ? value.text : value,\n          columnWidths[key] - padding - padding\n        );\n      }, this)\n      .map(function(value) {\n        return (\n          (this.getLineHeightFactor() * value.length * fontSize) / scaleFactor +\n          padding +\n          padding\n        );\n      }, this)\n      .reduce(function(pv, cv) {\n        return Math.max(pv, cv);\n      }, 0);\n  };\n\n  /**\n   * Store the config for outputting a table header\n   *\n   * @name setTableHeaderRow\n   * @function\n   * @param {Object[]} config\n   * An array of cell configs that would define a header row: Each config matches the config used by jsPDFAPI.cell\n   * except the lineNumber parameter is excluded\n   */\n  jsPDFAPI.setTableHeaderRow = function(config) {\n    _initialize.call(this);\n    this.internal.__cell__.tableHeaderRow = config;\n  };\n\n  /**\n   * Output the store header row\n   *\n   * @name printHeaderRow\n   * @function\n   * @param {number} lineNumber The line number to output the header at\n   * @param {boolean} new_page\n   */\n  jsPDFAPI.printHeaderRow = function(lineNumber, new_page) {\n    _initialize.call(this);\n    if (!this.internal.__cell__.tableHeaderRow) {\n      throw new Error(\"Property tableHeaderRow does not exist.\");\n    }\n\n    var tableHeaderCell;\n\n    printingHeaderRow = true;\n    if (typeof this.internal.__cell__.headerFunction === \"function\") {\n      var position = this.internal.__cell__.headerFunction(\n        this,\n        this.internal.__cell__.pages\n      );\n      this.internal.__cell__.lastCell = new Cell(\n        position[0],\n        position[1],\n        position[2],\n        position[3],\n        undefined,\n        -1\n      );\n    }\n    this.setFont(undefined, \"bold\");\n\n    var tempHeaderConf = [];\n    for (var i = 0; i < this.internal.__cell__.tableHeaderRow.length; i += 1) {\n      tableHeaderCell = this.internal.__cell__.tableHeaderRow[i].clone();\n      if (new_page) {\n        tableHeaderCell.y = this.internal.__cell__.margins.top || 0;\n        tempHeaderConf.push(tableHeaderCell);\n      }\n      tableHeaderCell.lineNumber = lineNumber;\n      var currentTextColor = this.getTextColor();\n      this.setTextColor(this.internal.__cell__.headerTextColor);\n      this.setFillColor(this.internal.__cell__.headerBackgroundColor);\n      cell.call(this, tableHeaderCell);\n      this.setTextColor(currentTextColor);\n    }\n    if (tempHeaderConf.length > 0) {\n      this.setTableHeaderRow(tempHeaderConf);\n    }\n    this.setFont(undefined, \"normal\");\n    printingHeaderRow = false;\n  };\n})(jsPDF.API);\n","/**\n * @license\n * ====================================================================\n * Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * ====================================================================\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * jsPDF JavaScript plugin\n *\n * @name javascript\n * @module\n */\n(function(jsPDFAPI) {\n  \"use strict\";\n  var jsNamesObj, jsJsObj, text;\n  /**\n   * @name addJS\n   * @function\n   * @param {string} javascript The javascript to be embedded into the PDF-file.\n   * @returns {jsPDF}\n   */\n  jsPDFAPI.addJS = function(javascript) {\n    text = javascript;\n    this.internal.events.subscribe(\"postPutResources\", function() {\n      jsNamesObj = this.internal.newObject();\n      this.internal.out(\"<<\");\n      this.internal.out(\"/Names [(EmbeddedJS) \" + (jsNamesObj + 1) + \" 0 R]\");\n      this.internal.out(\">>\");\n      this.internal.out(\"endobj\");\n\n      jsJsObj = this.internal.newObject();\n      this.internal.out(\"<<\");\n      this.internal.out(\"/S /JavaScript\");\n      this.internal.out(\"/JS (\" + text + \")\");\n      this.internal.out(\">>\");\n      this.internal.out(\"endobj\");\n    });\n    this.internal.events.subscribe(\"putCatalog\", function() {\n      if (jsNamesObj !== undefined && jsJsObj !== undefined) {\n        this.internal.out(\"/Names <</JavaScript \" + jsNamesObj + \" 0 R>>\");\n      }\n    });\n    return this;\n  };\n})(jsPDF.API);\n","/* eslint-disable no-fallthrough */\r\n/* eslint-disable no-console */\r\n/**\r\n * @license\r\n * jsPDF Context2D PlugIn Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv\r\n *\r\n * Licensed under the MIT License. http://opensource.org/licenses/mit-license\r\n */\r\n\r\nimport { jsPDF } from \"../jspdf.js\";\r\nimport { RGBColor } from \"../libs/rgbcolor.js\";\r\nimport { console } from \"../libs/console.js\";\r\nimport {\r\n  buildFontFaceMap,\r\n  parseFontFamily,\r\n  resolveFontFace\r\n} from \"../libs/fontFace.js\";\r\n\r\n/**\r\n * This plugin mimics the HTML5 CanvasRenderingContext2D.\r\n *\r\n * The goal is to provide a way for current canvas implementations to print directly to a PDF.\r\n *\r\n * @name context2d\r\n * @module\r\n */\r\n(function(jsPDFAPI) {\r\n  \"use strict\";\r\n  var ContextLayer = function(ctx) {\r\n    ctx = ctx || {};\r\n    this.isStrokeTransparent = ctx.isStrokeTransparent || false;\r\n    this.strokeOpacity = ctx.strokeOpacity || 1;\r\n    this.strokeStyle = ctx.strokeStyle || \"#000000\";\r\n    this.fillStyle = ctx.fillStyle || \"#000000\";\r\n    this.isFillTransparent = ctx.isFillTransparent || false;\r\n    this.fillOpacity = ctx.fillOpacity || 1;\r\n    this.font = ctx.font || \"10px sans-serif\";\r\n    this.textBaseline = ctx.textBaseline || \"alphabetic\";\r\n    this.textAlign = ctx.textAlign || \"left\";\r\n    this.lineWidth = ctx.lineWidth || 1;\r\n    this.lineJoin = ctx.lineJoin || \"miter\";\r\n    this.lineCap = ctx.lineCap || \"butt\";\r\n    this.path = ctx.path || [];\r\n    this.transform =\r\n      typeof ctx.transform !== \"undefined\"\r\n        ? ctx.transform.clone()\r\n        : new Matrix();\r\n    this.globalCompositeOperation = ctx.globalCompositeOperation || \"normal\";\r\n    this.globalAlpha = ctx.globalAlpha || 1.0;\r\n    this.clip_path = ctx.clip_path || [];\r\n    this.currentPoint = ctx.currentPoint || new Point();\r\n    this.miterLimit = ctx.miterLimit || 10.0;\r\n    this.lastPoint = ctx.lastPoint || new Point();\r\n    this.lineDashOffset = ctx.lineDashOffset || 0.0;\r\n    this.lineDash = ctx.lineDash || [];\r\n    this.margin = ctx.margin || [0, 0, 0, 0];\r\n    this.prevPageLastElemOffset = ctx.prevPageLastElemOffset || 0;\r\n\r\n    this.ignoreClearRect =\r\n      typeof ctx.ignoreClearRect === \"boolean\" ? ctx.ignoreClearRect : true;\r\n    return this;\r\n  };\r\n\r\n  //stub\r\n  var f2,\r\n    getHorizontalCoordinateString,\r\n    getVerticalCoordinateString,\r\n    getHorizontalCoordinate,\r\n    getVerticalCoordinate,\r\n    Point,\r\n    Rectangle,\r\n    Matrix,\r\n    _ctx;\r\n  jsPDFAPI.events.push([\r\n    \"initialized\",\r\n    function() {\r\n      this.context2d = new Context2D(this);\r\n\r\n      f2 = this.internal.f2;\r\n      getHorizontalCoordinateString = this.internal.getCoordinateString;\r\n      getVerticalCoordinateString = this.internal.getVerticalCoordinateString;\r\n      getHorizontalCoordinate = this.internal.getHorizontalCoordinate;\r\n      getVerticalCoordinate = this.internal.getVerticalCoordinate;\r\n      Point = this.internal.Point;\r\n      Rectangle = this.internal.Rectangle;\r\n      Matrix = this.internal.Matrix;\r\n      _ctx = new ContextLayer();\r\n    }\r\n  ]);\r\n\r\n  var Context2D = function(pdf) {\r\n    Object.defineProperty(this, \"canvas\", {\r\n      get: function() {\r\n        return { parentNode: false, style: false };\r\n      }\r\n    });\r\n\r\n    var _pdf = pdf;\r\n    Object.defineProperty(this, \"pdf\", {\r\n      get: function() {\r\n        return _pdf;\r\n      }\r\n    });\r\n\r\n    var _pageWrapXEnabled = false;\r\n    /**\r\n     * @name pageWrapXEnabled\r\n     * @type {boolean}\r\n     * @default false\r\n     */\r\n    Object.defineProperty(this, \"pageWrapXEnabled\", {\r\n      get: function() {\r\n        return _pageWrapXEnabled;\r\n      },\r\n      set: function(value) {\r\n        _pageWrapXEnabled = Boolean(value);\r\n      }\r\n    });\r\n\r\n    var _pageWrapYEnabled = false;\r\n    /**\r\n     * @name pageWrapYEnabled\r\n     * @type {boolean}\r\n     * @default true\r\n     */\r\n    Object.defineProperty(this, \"pageWrapYEnabled\", {\r\n      get: function() {\r\n        return _pageWrapYEnabled;\r\n      },\r\n      set: function(value) {\r\n        _pageWrapYEnabled = Boolean(value);\r\n      }\r\n    });\r\n\r\n    var _posX = 0;\r\n    /**\r\n     * @name posX\r\n     * @type {number}\r\n     * @default 0\r\n     */\r\n    Object.defineProperty(this, \"posX\", {\r\n      get: function() {\r\n        return _posX;\r\n      },\r\n      set: function(value) {\r\n        if (!isNaN(value)) {\r\n          _posX = value;\r\n        }\r\n      }\r\n    });\r\n\r\n    var _posY = 0;\r\n    /**\r\n     * @name posY\r\n     * @type {number}\r\n     * @default 0\r\n     */\r\n    Object.defineProperty(this, \"posY\", {\r\n      get: function() {\r\n        return _posY;\r\n      },\r\n      set: function(value) {\r\n        if (!isNaN(value)) {\r\n          _posY = value;\r\n        }\r\n      }\r\n    });\r\n\r\n    /**\r\n     * Gets or sets the page margin when using auto paging. Has no effect when {@link autoPaging} is off.\r\n     * @name margin\r\n     * @type {number|number[]}\r\n     * @default [0, 0, 0, 0]\r\n     */\r\n    Object.defineProperty(this, \"margin\", {\r\n      get: function() {\r\n        return _ctx.margin;\r\n      },\r\n      set: function(value) {\r\n        var margin;\r\n        if (typeof value === \"number\") {\r\n          margin = [value, value, value, value];\r\n        } else {\r\n          margin = new Array(4);\r\n          margin[0] = value[0];\r\n          margin[1] = value.length >= 2 ? value[1] : margin[0];\r\n          margin[2] = value.length >= 3 ? value[2] : margin[0];\r\n          margin[3] = value.length >= 4 ? value[3] : margin[1];\r\n        }\r\n        _ctx.margin = margin;\r\n      }\r\n    });\r\n\r\n    var _autoPaging = false;\r\n    /**\r\n     * Gets or sets the auto paging mode. When auto paging is enabled, the context2d will automatically draw on the\r\n     * next page if a shape or text chunk doesn't fit entirely on the current page. The context2d will create new\r\n     * pages if required.\r\n     *\r\n     * Context2d supports different modes:\r\n     * <ul>\r\n     * <li>\r\n     *   <code>false</code>: Auto paging is disabled.\r\n     * </li>\r\n     * <li>\r\n     *   <code>true</code> or <code>'slice'</code>: Will cut shapes or text chunks across page breaks. Will possibly\r\n     *   slice text in half, making it difficult to read.\r\n     * </li>\r\n     * <li>\r\n     *   <code>'text'</code>: Trys not to cut text in half across page breaks. Works best for documents consisting\r\n     *   mostly of a single column of text.\r\n     * </li>\r\n     * </ul>\r\n     * @name Context2D#autoPaging\r\n     * @type {boolean|\"slice\"|\"text\"}\r\n     * @default false\r\n     */\r\n    Object.defineProperty(this, \"autoPaging\", {\r\n      get: function() {\r\n        return _autoPaging;\r\n      },\r\n      set: function(value) {\r\n        _autoPaging = value;\r\n      }\r\n    });\r\n\r\n    var lastBreak = 0;\r\n    /**\r\n     * @name lastBreak\r\n     * @type {number}\r\n     * @default 0\r\n     */\r\n    Object.defineProperty(this, \"lastBreak\", {\r\n      get: function() {\r\n        return lastBreak;\r\n      },\r\n      set: function(value) {\r\n        lastBreak = value;\r\n      }\r\n    });\r\n\r\n    var pageBreaks = [];\r\n    /**\r\n     * Y Position of page breaks.\r\n     * @name pageBreaks\r\n     * @type {number}\r\n     * @default 0\r\n     */\r\n    Object.defineProperty(this, \"pageBreaks\", {\r\n      get: function() {\r\n        return pageBreaks;\r\n      },\r\n      set: function(value) {\r\n        pageBreaks = value;\r\n      }\r\n    });\r\n\r\n    /**\r\n     * @name ctx\r\n     * @type {object}\r\n     * @default {}\r\n     */\r\n    Object.defineProperty(this, \"ctx\", {\r\n      get: function() {\r\n        return _ctx;\r\n      },\r\n      set: function(value) {\r\n        if (value instanceof ContextLayer) {\r\n          _ctx = value;\r\n        }\r\n      }\r\n    });\r\n\r\n    /**\r\n     * @name path\r\n     * @type {array}\r\n     * @default []\r\n     */\r\n    Object.defineProperty(this, \"path\", {\r\n      get: function() {\r\n        return _ctx.path;\r\n      },\r\n      set: function(value) {\r\n        _ctx.path = value;\r\n      }\r\n    });\r\n\r\n    /**\r\n     * @name ctxStack\r\n     * @type {array}\r\n     * @default []\r\n     */\r\n    var _ctxStack = [];\r\n    Object.defineProperty(this, \"ctxStack\", {\r\n      get: function() {\r\n        return _ctxStack;\r\n      },\r\n      set: function(value) {\r\n        _ctxStack = value;\r\n      }\r\n    });\r\n\r\n    /**\r\n     * Sets or returns the color, gradient, or pattern used to fill the drawing\r\n     *\r\n     * @name fillStyle\r\n     * @default #000000\r\n     * @property {(color|gradient|pattern)} value The color of the drawing. Default value is #000000<br />\r\n     * A gradient object (linear or radial) used to fill the drawing (not supported by context2d)<br />\r\n     * A pattern object to use to fill the drawing (not supported by context2d)\r\n     */\r\n    Object.defineProperty(this, \"fillStyle\", {\r\n      get: function() {\r\n        return this.ctx.fillStyle;\r\n      },\r\n      set: function(value) {\r\n        var rgba;\r\n        rgba = getRGBA(value);\r\n\r\n        this.ctx.fillStyle = rgba.style;\r\n        this.ctx.isFillTransparent = rgba.a === 0;\r\n        this.ctx.fillOpacity = rgba.a;\r\n\r\n        this.pdf.setFillColor(rgba.r, rgba.g, rgba.b, { a: rgba.a });\r\n        this.pdf.setTextColor(rgba.r, rgba.g, rgba.b, { a: rgba.a });\r\n      }\r\n    });\r\n\r\n    /**\r\n     * Sets or returns the color, gradient, or pattern used for strokes\r\n     *\r\n     * @name strokeStyle\r\n     * @default #000000\r\n     * @property {color} color A CSS color value that indicates the stroke color of the drawing. Default value is #000000 (not supported by context2d)\r\n     * @property {gradient} gradient A gradient object (linear or radial) used to create a gradient stroke (not supported by context2d)\r\n     * @property {pattern} pattern A pattern object used to create a pattern stroke (not supported by context2d)\r\n     */\r\n    Object.defineProperty(this, \"strokeStyle\", {\r\n      get: function() {\r\n        return this.ctx.strokeStyle;\r\n      },\r\n      set: function(value) {\r\n        var rgba = getRGBA(value);\r\n\r\n        this.ctx.strokeStyle = rgba.style;\r\n        this.ctx.isStrokeTransparent = rgba.a === 0;\r\n        this.ctx.strokeOpacity = rgba.a;\r\n\r\n        if (rgba.a === 0) {\r\n          this.pdf.setDrawColor(255, 255, 255);\r\n        } else if (rgba.a === 1) {\r\n          this.pdf.setDrawColor(rgba.r, rgba.g, rgba.b);\r\n        } else {\r\n          this.pdf.setDrawColor(rgba.r, rgba.g, rgba.b);\r\n        }\r\n      }\r\n    });\r\n\r\n    /**\r\n     * Sets or returns the style of the end caps for a line\r\n     *\r\n     * @name lineCap\r\n     * @default butt\r\n     * @property {(butt|round|square)} lineCap butt A flat edge is added to each end of the line <br/>\r\n     * round A rounded end cap is added to each end of the line<br/>\r\n     * square A square end cap is added to each end of the line<br/>\r\n     */\r\n    Object.defineProperty(this, \"lineCap\", {\r\n      get: function() {\r\n        return this.ctx.lineCap;\r\n      },\r\n      set: function(value) {\r\n        if ([\"butt\", \"round\", \"square\"].indexOf(value) !== -1) {\r\n          this.ctx.lineCap = value;\r\n          this.pdf.setLineCap(value);\r\n        }\r\n      }\r\n    });\r\n\r\n    /**\r\n     * Sets or returns the current line width\r\n     *\r\n     * @name lineWidth\r\n     * @default 1\r\n     * @property {number} lineWidth The current line width, in pixels\r\n     */\r\n    Object.defineProperty(this, \"lineWidth\", {\r\n      get: function() {\r\n        return this.ctx.lineWidth;\r\n      },\r\n      set: function(value) {\r\n        if (!isNaN(value)) {\r\n          this.ctx.lineWidth = value;\r\n          this.pdf.setLineWidth(value);\r\n        }\r\n      }\r\n    });\r\n\r\n    /**\r\n     * Sets or returns the type of corner created, when two lines meet\r\n     */\r\n    Object.defineProperty(this, \"lineJoin\", {\r\n      get: function() {\r\n        return this.ctx.lineJoin;\r\n      },\r\n      set: function(value) {\r\n        if ([\"bevel\", \"round\", \"miter\"].indexOf(value) !== -1) {\r\n          this.ctx.lineJoin = value;\r\n          this.pdf.setLineJoin(value);\r\n        }\r\n      }\r\n    });\r\n\r\n    /**\r\n     * A number specifying the miter limit ratio in coordinate space units. Zero, negative, Infinity, and NaN values are ignored. The default value is 10.0.\r\n     *\r\n     * @name miterLimit\r\n     * @default 10\r\n     */\r\n    Object.defineProperty(this, \"miterLimit\", {\r\n      get: function() {\r\n        return this.ctx.miterLimit;\r\n      },\r\n      set: function(value) {\r\n        if (!isNaN(value)) {\r\n          this.ctx.miterLimit = value;\r\n          this.pdf.setMiterLimit(value);\r\n        }\r\n      }\r\n    });\r\n\r\n    Object.defineProperty(this, \"textBaseline\", {\r\n      get: function() {\r\n        return this.ctx.textBaseline;\r\n      },\r\n      set: function(value) {\r\n        this.ctx.textBaseline = value;\r\n      }\r\n    });\r\n\r\n    Object.defineProperty(this, \"textAlign\", {\r\n      get: function() {\r\n        return this.ctx.textAlign;\r\n      },\r\n      set: function(value) {\r\n        if ([\"right\", \"end\", \"center\", \"left\", \"start\"].indexOf(value) !== -1) {\r\n          this.ctx.textAlign = value;\r\n        }\r\n      }\r\n    });\r\n\r\n    var _fontFaceMap = null;\r\n\r\n    function getFontFaceMap(pdf, fontFaces) {\r\n      if (_fontFaceMap === null) {\r\n        var fontMap = pdf.getFontList();\r\n\r\n        var convertedFontFaces = convertToFontFaces(fontMap);\r\n\r\n        _fontFaceMap = buildFontFaceMap(convertedFontFaces.concat(fontFaces));\r\n      }\r\n\r\n      return _fontFaceMap;\r\n    }\r\n\r\n    function convertToFontFaces(fontMap) {\r\n      var fontFaces = [];\r\n\r\n      Object.keys(fontMap).forEach(function(family) {\r\n        var styles = fontMap[family];\r\n\r\n        styles.forEach(function(style) {\r\n          var fontFace = null;\r\n\r\n          switch (style) {\r\n            case \"bold\":\r\n              fontFace = {\r\n                family: family,\r\n                weight: \"bold\"\r\n              };\r\n              break;\r\n\r\n            case \"italic\":\r\n              fontFace = {\r\n                family: family,\r\n                style: \"italic\"\r\n              };\r\n              break;\r\n\r\n            case \"bolditalic\":\r\n              fontFace = {\r\n                family: family,\r\n                weight: \"bold\",\r\n                style: \"italic\"\r\n              };\r\n              break;\r\n\r\n            case \"\":\r\n            case \"normal\":\r\n              fontFace = {\r\n                family: family\r\n              };\r\n              break;\r\n          }\r\n\r\n          // If font-face is still null here, it is a font with some styling we don't recognize and\r\n          // cannot map or it is a font added via the fontFaces option of .html().\r\n          if (fontFace !== null) {\r\n            fontFace.ref = {\r\n              name: family,\r\n              style: style\r\n            };\r\n\r\n            fontFaces.push(fontFace);\r\n          }\r\n        });\r\n      });\r\n\r\n      return fontFaces;\r\n    }\r\n\r\n    var _fontFaces = null;\r\n    /**\r\n     * A map of available font-faces, as passed in the options of\r\n     * .html(). If set a limited implementation of the font style matching\r\n     * algorithm defined by https://www.w3.org/TR/css-fonts-3/#font-matching-algorithm\r\n     * will be used. If not set it will fallback to previous behavior.\r\n     */\r\n\r\n    Object.defineProperty(this, \"fontFaces\", {\r\n      get: function() {\r\n        return _fontFaces;\r\n      },\r\n      set: function(value) {\r\n        _fontFaceMap = null;\r\n        _fontFaces = value;\r\n      }\r\n    });\r\n\r\n    Object.defineProperty(this, \"font\", {\r\n      get: function() {\r\n        return this.ctx.font;\r\n      },\r\n      set: function(value) {\r\n        this.ctx.font = value;\r\n        var rx, matches;\r\n\r\n        //source: https://stackoverflow.com/a/10136041\r\n        // eslint-disable-next-line no-useless-escape\r\n        rx = /^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))(?:\\s*\\/\\s*(normal|[.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])))?\\s*([-_,\\\"\\'\\sa-z]+?)\\s*$/i;\r\n        matches = rx.exec(value);\r\n        if (matches !== null) {\r\n          var fontStyle = matches[1];\r\n          var fontVariant = matches[2];\r\n          var fontWeight = matches[3];\r\n          var fontSize = matches[4];\r\n          var lineHeight = matches[5];\r\n          var fontFamily = matches[6];\r\n        } else {\r\n          return;\r\n        }\r\n        var rxFontSize = /^([.\\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i;\r\n        var fontSizeUnit = rxFontSize.exec(fontSize)[2];\r\n\r\n        if (\"px\" === fontSizeUnit) {\r\n          fontSize = Math.floor(\r\n            parseFloat(fontSize) * this.pdf.internal.scaleFactor\r\n          );\r\n        } else if (\"em\" === fontSizeUnit) {\r\n          fontSize = Math.floor(parseFloat(fontSize) * this.pdf.getFontSize());\r\n        } else {\r\n          fontSize = Math.floor(\r\n            parseFloat(fontSize) * this.pdf.internal.scaleFactor\r\n          );\r\n        }\r\n\r\n        this.pdf.setFontSize(fontSize);\r\n        var parts = parseFontFamily(fontFamily);\r\n\r\n        if (this.fontFaces) {\r\n          var fontFaceMap = getFontFaceMap(this.pdf, this.fontFaces);\r\n\r\n          var rules = parts.map(function(ff) {\r\n            return {\r\n              family: ff,\r\n              stretch: \"normal\", // TODO: Extract font-stretch from font rule (perhaps write proper parser for it?)\r\n              weight: fontWeight,\r\n              style: fontStyle\r\n            };\r\n          });\r\n\r\n          var font = resolveFontFace(fontFaceMap, rules);\r\n          this.pdf.setFont(font.ref.name, font.ref.style);\r\n          return;\r\n        }\r\n\r\n        var style = \"\";\r\n        if (\r\n          fontWeight === \"bold\" ||\r\n          parseInt(fontWeight, 10) >= 700 ||\r\n          fontStyle === \"bold\"\r\n        ) {\r\n          style = \"bold\";\r\n        }\r\n\r\n        if (fontStyle === \"italic\") {\r\n          style += \"italic\";\r\n        }\r\n\r\n        if (style.length === 0) {\r\n          style = \"normal\";\r\n        }\r\n        var jsPdfFontName = \"\";\r\n\r\n        var fallbackFonts = {\r\n          arial: \"Helvetica\",\r\n          Arial: \"Helvetica\",\r\n          verdana: \"Helvetica\",\r\n          Verdana: \"Helvetica\",\r\n          helvetica: \"Helvetica\",\r\n          Helvetica: \"Helvetica\",\r\n          \"sans-serif\": \"Helvetica\",\r\n          fixed: \"Courier\",\r\n          monospace: \"Courier\",\r\n          terminal: \"Courier\",\r\n          cursive: \"Times\",\r\n          fantasy: \"Times\",\r\n          serif: \"Times\"\r\n        };\r\n\r\n        for (var i = 0; i < parts.length; i++) {\r\n          if (\r\n            this.pdf.internal.getFont(parts[i], style, {\r\n              noFallback: true,\r\n              disableWarning: true\r\n            }) !== undefined\r\n          ) {\r\n            jsPdfFontName = parts[i];\r\n            break;\r\n          } else if (\r\n            style === \"bolditalic\" &&\r\n            this.pdf.internal.getFont(parts[i], \"bold\", {\r\n              noFallback: true,\r\n              disableWarning: true\r\n            }) !== undefined\r\n          ) {\r\n            jsPdfFontName = parts[i];\r\n            style = \"bold\";\r\n          } else if (\r\n            this.pdf.internal.getFont(parts[i], \"normal\", {\r\n              noFallback: true,\r\n              disableWarning: true\r\n            }) !== undefined\r\n          ) {\r\n            jsPdfFontName = parts[i];\r\n            style = \"normal\";\r\n            break;\r\n          }\r\n        }\r\n        if (jsPdfFontName === \"\") {\r\n          for (var j = 0; j < parts.length; j++) {\r\n            if (fallbackFonts[parts[j]]) {\r\n              jsPdfFontName = fallbackFonts[parts[j]];\r\n              break;\r\n            }\r\n          }\r\n        }\r\n        jsPdfFontName = jsPdfFontName === \"\" ? \"Times\" : jsPdfFontName;\r\n        this.pdf.setFont(jsPdfFontName, style);\r\n      }\r\n    });\r\n\r\n    Object.defineProperty(this, \"globalCompositeOperation\", {\r\n      get: function() {\r\n        return this.ctx.globalCompositeOperation;\r\n      },\r\n      set: function(value) {\r\n        this.ctx.globalCompositeOperation = value;\r\n      }\r\n    });\r\n\r\n    Object.defineProperty(this, \"globalAlpha\", {\r\n      get: function() {\r\n        return this.ctx.globalAlpha;\r\n      },\r\n      set: function(value) {\r\n        this.ctx.globalAlpha = value;\r\n      }\r\n    });\r\n\r\n    /**\r\n     * A float specifying the amount of the line dash offset. The default value is 0.0.\r\n     *\r\n     * @name lineDashOffset\r\n     * @default 0.0\r\n     */\r\n    Object.defineProperty(this, \"lineDashOffset\", {\r\n      get: function() {\r\n        return this.ctx.lineDashOffset;\r\n      },\r\n      set: function(value) {\r\n        this.ctx.lineDashOffset = value;\r\n        setLineDash.call(this);\r\n      }\r\n    });\r\n\r\n    // Not HTML API\r\n    Object.defineProperty(this, \"lineDash\", {\r\n      get: function() {\r\n        return this.ctx.lineDash;\r\n      },\r\n      set: function(value) {\r\n        this.ctx.lineDash = value;\r\n        setLineDash.call(this);\r\n      }\r\n    });\r\n\r\n    // Not HTML API\r\n    Object.defineProperty(this, \"ignoreClearRect\", {\r\n      get: function() {\r\n        return this.ctx.ignoreClearRect;\r\n      },\r\n      set: function(value) {\r\n        this.ctx.ignoreClearRect = Boolean(value);\r\n      }\r\n    });\r\n  };\r\n\r\n  /**\r\n   * Sets the line dash pattern used when stroking lines.\r\n   * @name setLineDash\r\n   * @function\r\n   * @description It uses an array of values that specify alternating lengths of lines and gaps which describe the pattern.\r\n   */\r\n  Context2D.prototype.setLineDash = function(dashArray) {\r\n    this.lineDash = dashArray;\r\n  };\r\n\r\n  /**\r\n   * gets the current line dash pattern.\r\n   * @name getLineDash\r\n   * @function\r\n   * @returns {Array} An Array of numbers that specify distances to alternately draw a line and a gap (in coordinate space units). If the number, when setting the elements, is odd, the elements of the array get copied and concatenated. For example, setting the line dash to [5, 15, 25] will result in getting back [5, 15, 25, 5, 15, 25].\r\n   */\r\n  Context2D.prototype.getLineDash = function() {\r\n    if (this.lineDash.length % 2) {\r\n      // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/getLineDash#return_value\r\n      return this.lineDash.concat(this.lineDash);\r\n    } else {\r\n      // The copied value is returned to prevent contamination from outside.\r\n      return this.lineDash.slice();\r\n    }\r\n  };\r\n\r\n  Context2D.prototype.fill = function() {\r\n    pathPreProcess.call(this, \"fill\", false);\r\n  };\r\n\r\n  /**\r\n   * Actually draws the path you have defined\r\n   *\r\n   * @name stroke\r\n   * @function\r\n   * @description The stroke() method actually draws the path you have defined with all those moveTo() and lineTo() methods. The default color is black.\r\n   */\r\n  Context2D.prototype.stroke = function() {\r\n    pathPreProcess.call(this, \"stroke\", false);\r\n  };\r\n\r\n  /**\r\n   * Begins a path, or resets the current\r\n   *\r\n   * @name beginPath\r\n   * @function\r\n   * @description The beginPath() method begins a path, or resets the current path.\r\n   */\r\n  Context2D.prototype.beginPath = function() {\r\n    this.path = [\r\n      {\r\n        type: \"begin\"\r\n      }\r\n    ];\r\n  };\r\n\r\n  /**\r\n   * Moves the path to the specified point in the canvas, without creating a line\r\n   *\r\n   * @name moveTo\r\n   * @function\r\n   * @param x {Number} The x-coordinate of where to move the path to\r\n   * @param y {Number} The y-coordinate of where to move the path to\r\n   */\r\n  Context2D.prototype.moveTo = function(x, y) {\r\n    if (isNaN(x) || isNaN(y)) {\r\n      console.error(\"jsPDF.context2d.moveTo: Invalid arguments\", arguments);\r\n      throw new Error(\"Invalid arguments passed to jsPDF.context2d.moveTo\");\r\n    }\r\n\r\n    var pt = this.ctx.transform.applyToPoint(new Point(x, y));\r\n\r\n    this.path.push({\r\n      type: \"mt\",\r\n      x: pt.x,\r\n      y: pt.y\r\n    });\r\n    this.ctx.lastPoint = new Point(x, y);\r\n  };\r\n\r\n  /**\r\n   * Creates a path from the current point back to the starting point\r\n   *\r\n   * @name closePath\r\n   * @function\r\n   * @description The closePath() method creates a path from the current point back to the starting point.\r\n   */\r\n  Context2D.prototype.closePath = function() {\r\n    var pathBegin = new Point(0, 0);\r\n    var i = 0;\r\n    for (i = this.path.length - 1; i !== -1; i--) {\r\n      if (this.path[i].type === \"begin\") {\r\n        if (\r\n          typeof this.path[i + 1] === \"object\" &&\r\n          typeof this.path[i + 1].x === \"number\"\r\n        ) {\r\n          pathBegin = new Point(this.path[i + 1].x, this.path[i + 1].y);\r\n          break;\r\n        }\r\n      }\r\n    }\r\n    this.path.push({\r\n      type: \"close\"\r\n    });\r\n    this.ctx.lastPoint = new Point(pathBegin.x, pathBegin.y);\r\n  };\r\n\r\n  /**\r\n   * Adds a new point and creates a line to that point from the last specified point in the canvas\r\n   *\r\n   * @name lineTo\r\n   * @function\r\n   * @param x The x-coordinate of where to create the line to\r\n   * @param y The y-coordinate of where to create the line to\r\n   * @description The lineTo() method adds a new point and creates a line TO that point FROM the last specified point in the canvas (this method does not draw the line).\r\n   */\r\n  Context2D.prototype.lineTo = function(x, y) {\r\n    if (isNaN(x) || isNaN(y)) {\r\n      console.error(\"jsPDF.context2d.lineTo: Invalid arguments\", arguments);\r\n      throw new Error(\"Invalid arguments passed to jsPDF.context2d.lineTo\");\r\n    }\r\n\r\n    var pt = this.ctx.transform.applyToPoint(new Point(x, y));\r\n\r\n    this.path.push({\r\n      type: \"lt\",\r\n      x: pt.x,\r\n      y: pt.y\r\n    });\r\n    this.ctx.lastPoint = new Point(pt.x, pt.y);\r\n  };\r\n\r\n  /**\r\n   * Clips a region of any shape and size from the original canvas\r\n   *\r\n   * @name clip\r\n   * @function\r\n   * @description The clip() method clips a region of any shape and size from the original canvas.\r\n   */\r\n  Context2D.prototype.clip = function() {\r\n    this.ctx.clip_path = JSON.parse(JSON.stringify(this.path));\r\n    pathPreProcess.call(this, null, true);\r\n  };\r\n\r\n  /**\r\n   * Creates a cubic Bézier curve\r\n   *\r\n   * @name quadraticCurveTo\r\n   * @function\r\n   * @param cpx {Number} The x-coordinate of the Bézier control point\r\n   * @param cpy {Number} The y-coordinate of the Bézier control point\r\n   * @param x {Number} The x-coordinate of the ending point\r\n   * @param y {Number} The y-coordinate of the ending point\r\n   * @description The quadraticCurveTo() method adds a point to the current path by using the specified control points that represent a quadratic Bézier curve.<br /><br /> A quadratic Bézier curve requires two points. The first point is a control point that is used in the quadratic Bézier calculation and the second point is the ending point for the curve. The starting point for the curve is the last point in the current path. If a path does not exist, use the beginPath() and moveTo() methods to define a starting point.\r\n   */\r\n  Context2D.prototype.quadraticCurveTo = function(cpx, cpy, x, y) {\r\n    if (isNaN(x) || isNaN(y) || isNaN(cpx) || isNaN(cpy)) {\r\n      console.error(\r\n        \"jsPDF.context2d.quadraticCurveTo: Invalid arguments\",\r\n        arguments\r\n      );\r\n      throw new Error(\r\n        \"Invalid arguments passed to jsPDF.context2d.quadraticCurveTo\"\r\n      );\r\n    }\r\n\r\n    var pt0 = this.ctx.transform.applyToPoint(new Point(x, y));\r\n    var pt1 = this.ctx.transform.applyToPoint(new Point(cpx, cpy));\r\n\r\n    this.path.push({\r\n      type: \"qct\",\r\n      x1: pt1.x,\r\n      y1: pt1.y,\r\n      x: pt0.x,\r\n      y: pt0.y\r\n    });\r\n    this.ctx.lastPoint = new Point(pt0.x, pt0.y);\r\n  };\r\n\r\n  /**\r\n   * Creates a cubic Bézier curve\r\n   *\r\n   * @name bezierCurveTo\r\n   * @function\r\n   * @param cp1x {Number} The x-coordinate of the first Bézier control point\r\n   * @param cp1y {Number} The y-coordinate of the first Bézier control point\r\n   * @param cp2x {Number} The x-coordinate of the second Bézier control point\r\n   * @param cp2y {Number} The y-coordinate of the second Bézier control point\r\n   * @param x {Number} The x-coordinate of the ending point\r\n   * @param y {Number} The y-coordinate of the ending point\r\n   * @description The bezierCurveTo() method adds a point to the current path by using the specified control points that represent a cubic Bézier curve. <br /><br />A cubic bezier curve requires three points. The first two points are control points that are used in the cubic Bézier calculation and the last point is the ending point for the curve.  The starting point for the curve is the last point in the current path. If a path does not exist, use the beginPath() and moveTo() methods to define a starting point.\r\n   */\r\n  Context2D.prototype.bezierCurveTo = function(cp1x, cp1y, cp2x, cp2y, x, y) {\r\n    if (\r\n      isNaN(x) ||\r\n      isNaN(y) ||\r\n      isNaN(cp1x) ||\r\n      isNaN(cp1y) ||\r\n      isNaN(cp2x) ||\r\n      isNaN(cp2y)\r\n    ) {\r\n      console.error(\r\n        \"jsPDF.context2d.bezierCurveTo: Invalid arguments\",\r\n        arguments\r\n      );\r\n      throw new Error(\r\n        \"Invalid arguments passed to jsPDF.context2d.bezierCurveTo\"\r\n      );\r\n    }\r\n    var pt0 = this.ctx.transform.applyToPoint(new Point(x, y));\r\n    var pt1 = this.ctx.transform.applyToPoint(new Point(cp1x, cp1y));\r\n    var pt2 = this.ctx.transform.applyToPoint(new Point(cp2x, cp2y));\r\n\r\n    this.path.push({\r\n      type: \"bct\",\r\n      x1: pt1.x,\r\n      y1: pt1.y,\r\n      x2: pt2.x,\r\n      y2: pt2.y,\r\n      x: pt0.x,\r\n      y: pt0.y\r\n    });\r\n    this.ctx.lastPoint = new Point(pt0.x, pt0.y);\r\n  };\r\n\r\n  /**\r\n   * Creates an arc/curve (used to create circles, or parts of circles)\r\n   *\r\n   * @name arc\r\n   * @function\r\n   * @param x {Number} The x-coordinate of the center of the circle\r\n   * @param y {Number} The y-coordinate of the center of the circle\r\n   * @param radius {Number} The radius of the circle\r\n   * @param startAngle {Number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)\r\n   * @param endAngle {Number} The ending angle, in radians\r\n   * @param counterclockwise {Boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise.\r\n   * @description The arc() method creates an arc/curve (used to create circles, or parts of circles).\r\n   */\r\n  Context2D.prototype.arc = function(\r\n    x,\r\n    y,\r\n    radius,\r\n    startAngle,\r\n    endAngle,\r\n    counterclockwise\r\n  ) {\r\n    if (\r\n      isNaN(x) ||\r\n      isNaN(y) ||\r\n      isNaN(radius) ||\r\n      isNaN(startAngle) ||\r\n      isNaN(endAngle)\r\n    ) {\r\n      console.error(\"jsPDF.context2d.arc: Invalid arguments\", arguments);\r\n      throw new Error(\"Invalid arguments passed to jsPDF.context2d.arc\");\r\n    }\r\n    counterclockwise = Boolean(counterclockwise);\r\n\r\n    if (!this.ctx.transform.isIdentity) {\r\n      var xpt = this.ctx.transform.applyToPoint(new Point(x, y));\r\n      x = xpt.x;\r\n      y = xpt.y;\r\n\r\n      var x_radPt = this.ctx.transform.applyToPoint(new Point(0, radius));\r\n      var x_radPt0 = this.ctx.transform.applyToPoint(new Point(0, 0));\r\n      radius = Math.sqrt(\r\n        Math.pow(x_radPt.x - x_radPt0.x, 2) +\r\n          Math.pow(x_radPt.y - x_radPt0.y, 2)\r\n      );\r\n    }\r\n    if (Math.abs(endAngle - startAngle) >= 2 * Math.PI) {\r\n      startAngle = 0;\r\n      endAngle = 2 * Math.PI;\r\n    }\r\n\r\n    this.path.push({\r\n      type: \"arc\",\r\n      x: x,\r\n      y: y,\r\n      radius: radius,\r\n      startAngle: startAngle,\r\n      endAngle: endAngle,\r\n      counterclockwise: counterclockwise\r\n    });\r\n    // this.ctx.lastPoint(new Point(pt.x,pt.y));\r\n  };\r\n\r\n  /**\r\n   * Creates an arc/curve between two tangents\r\n   *\r\n   * @name arcTo\r\n   * @function\r\n   * @param x1 {Number} The x-coordinate of the first tangent\r\n   * @param y1 {Number} The y-coordinate of the first tangent\r\n   * @param x2 {Number} The x-coordinate of the second tangent\r\n   * @param y2 {Number} The y-coordinate of the second tangent\r\n   * @param radius The radius of the arc\r\n   * @description The arcTo() method creates an arc/curve between two tangents on the canvas.\r\n   */\r\n  // eslint-disable-next-line no-unused-vars\r\n  Context2D.prototype.arcTo = function(x1, y1, x2, y2, radius) {\r\n    throw new Error(\"arcTo not implemented.\");\r\n  };\r\n\r\n  /**\r\n   * Creates a rectangle\r\n   *\r\n   * @name rect\r\n   * @function\r\n   * @param x {Number} The x-coordinate of the upper-left corner of the rectangle\r\n   * @param y {Number} The y-coordinate of the upper-left corner of the rectangle\r\n   * @param w {Number} The width of the rectangle, in pixels\r\n   * @param h {Number} The height of the rectangle, in pixels\r\n   * @description The rect() method creates a rectangle.\r\n   */\r\n  Context2D.prototype.rect = function(x, y, w, h) {\r\n    if (isNaN(x) || isNaN(y) || isNaN(w) || isNaN(h)) {\r\n      console.error(\"jsPDF.context2d.rect: Invalid arguments\", arguments);\r\n      throw new Error(\"Invalid arguments passed to jsPDF.context2d.rect\");\r\n    }\r\n    this.moveTo(x, y);\r\n    this.lineTo(x + w, y);\r\n    this.lineTo(x + w, y + h);\r\n    this.lineTo(x, y + h);\r\n    this.lineTo(x, y);\r\n    this.lineTo(x + w, y);\r\n    this.lineTo(x, y);\r\n  };\r\n\r\n  /**\r\n   * Draws a \"filled\" rectangle\r\n   *\r\n   * @name fillRect\r\n   * @function\r\n   * @param x {Number} The x-coordinate of the upper-left corner of the rectangle\r\n   * @param y {Number} The y-coordinate of the upper-left corner of the rectangle\r\n   * @param w {Number} The width of the rectangle, in pixels\r\n   * @param h {Number} The height of the rectangle, in pixels\r\n   * @description The fillRect() method draws a \"filled\" rectangle. The default color of the fill is black.\r\n   */\r\n  Context2D.prototype.fillRect = function(x, y, w, h) {\r\n    if (isNaN(x) || isNaN(y) || isNaN(w) || isNaN(h)) {\r\n      console.error(\"jsPDF.context2d.fillRect: Invalid arguments\", arguments);\r\n      throw new Error(\"Invalid arguments passed to jsPDF.context2d.fillRect\");\r\n    }\r\n    if (isFillTransparent.call(this)) {\r\n      return;\r\n    }\r\n    var tmp = {};\r\n    if (this.lineCap !== \"butt\") {\r\n      tmp.lineCap = this.lineCap;\r\n      this.lineCap = \"butt\";\r\n    }\r\n    if (this.lineJoin !== \"miter\") {\r\n      tmp.lineJoin = this.lineJoin;\r\n      this.lineJoin = \"miter\";\r\n    }\r\n\r\n    this.beginPath();\r\n    this.rect(x, y, w, h);\r\n    this.fill();\r\n\r\n    if (tmp.hasOwnProperty(\"lineCap\")) {\r\n      this.lineCap = tmp.lineCap;\r\n    }\r\n    if (tmp.hasOwnProperty(\"lineJoin\")) {\r\n      this.lineJoin = tmp.lineJoin;\r\n    }\r\n  };\r\n\r\n  /**\r\n   *     Draws a rectangle (no fill)\r\n   *\r\n   * @name strokeRect\r\n   * @function\r\n   * @param x {Number} The x-coordinate of the upper-left corner of the rectangle\r\n   * @param y {Number} The y-coordinate of the upper-left corner of the rectangle\r\n   * @param w {Number} The width of the rectangle, in pixels\r\n   * @param h {Number} The height of the rectangle, in pixels\r\n   * @description The strokeRect() method draws a rectangle (no fill). The default color of the stroke is black.\r\n   */\r\n  Context2D.prototype.strokeRect = function strokeRect(x, y, w, h) {\r\n    if (isNaN(x) || isNaN(y) || isNaN(w) || isNaN(h)) {\r\n      console.error(\"jsPDF.context2d.strokeRect: Invalid arguments\", arguments);\r\n      throw new Error(\"Invalid arguments passed to jsPDF.context2d.strokeRect\");\r\n    }\r\n    if (isStrokeTransparent.call(this)) {\r\n      return;\r\n    }\r\n    this.beginPath();\r\n    this.rect(x, y, w, h);\r\n    this.stroke();\r\n  };\r\n\r\n  /**\r\n   * Clears the specified pixels within a given rectangle\r\n   *\r\n   * @name clearRect\r\n   * @function\r\n   * @param x {Number} The x-coordinate of the upper-left corner of the rectangle\r\n   * @param y {Number} The y-coordinate of the upper-left corner of the rectangle\r\n   * @param w {Number} The width of the rectangle to clear, in pixels\r\n   * @param h {Number} The height of the rectangle to clear, in pixels\r\n   * @description We cannot clear PDF commands that were already written to PDF, so we use white instead. <br />\r\n   * As a special case, read a special flag (ignoreClearRect) and do nothing if it is set.\r\n   * This results in all calls to clearRect() to do nothing, and keep the canvas transparent.\r\n   * This flag is stored in the save/restore context and is managed the same way as other drawing states.\r\n   *\r\n   */\r\n  Context2D.prototype.clearRect = function(x, y, w, h) {\r\n    if (isNaN(x) || isNaN(y) || isNaN(w) || isNaN(h)) {\r\n      console.error(\"jsPDF.context2d.clearRect: Invalid arguments\", arguments);\r\n      throw new Error(\"Invalid arguments passed to jsPDF.context2d.clearRect\");\r\n    }\r\n    if (this.ignoreClearRect) {\r\n      return;\r\n    }\r\n\r\n    this.fillStyle = \"#ffffff\";\r\n    this.fillRect(x, y, w, h);\r\n  };\r\n\r\n  /**\r\n   * Saves the state of the current context\r\n   *\r\n   * @name save\r\n   * @function\r\n   */\r\n  Context2D.prototype.save = function(doStackPush) {\r\n    doStackPush = typeof doStackPush === \"boolean\" ? doStackPush : true;\r\n    var tmpPageNumber = this.pdf.internal.getCurrentPageInfo().pageNumber;\r\n    for (var i = 0; i < this.pdf.internal.getNumberOfPages(); i++) {\r\n      this.pdf.setPage(i + 1);\r\n      this.pdf.internal.out(\"q\");\r\n    }\r\n    this.pdf.setPage(tmpPageNumber);\r\n\r\n    if (doStackPush) {\r\n      this.ctx.fontSize = this.pdf.internal.getFontSize();\r\n      var ctx = new ContextLayer(this.ctx);\r\n      this.ctxStack.push(this.ctx);\r\n      this.ctx = ctx;\r\n    }\r\n  };\r\n\r\n  /**\r\n   * Returns previously saved path state and attributes\r\n   *\r\n   * @name restore\r\n   * @function\r\n   */\r\n  Context2D.prototype.restore = function(doStackPop) {\r\n    doStackPop = typeof doStackPop === \"boolean\" ? doStackPop : true;\r\n    var tmpPageNumber = this.pdf.internal.getCurrentPageInfo().pageNumber;\r\n    for (var i = 0; i < this.pdf.internal.getNumberOfPages(); i++) {\r\n      this.pdf.setPage(i + 1);\r\n      this.pdf.internal.out(\"Q\");\r\n    }\r\n    this.pdf.setPage(tmpPageNumber);\r\n\r\n    if (doStackPop && this.ctxStack.length !== 0) {\r\n      this.ctx = this.ctxStack.pop();\r\n      this.fillStyle = this.ctx.fillStyle;\r\n      this.strokeStyle = this.ctx.strokeStyle;\r\n      this.font = this.ctx.font;\r\n      this.lineCap = this.ctx.lineCap;\r\n      this.lineWidth = this.ctx.lineWidth;\r\n      this.lineJoin = this.ctx.lineJoin;\r\n      this.lineDash = this.ctx.lineDash;\r\n      this.lineDashOffset = this.ctx.lineDashOffset;\r\n    }\r\n  };\r\n\r\n  /**\r\n   * @name toDataURL\r\n   * @function\r\n   */\r\n  Context2D.prototype.toDataURL = function() {\r\n    throw new Error(\"toDataUrl not implemented.\");\r\n  };\r\n\r\n  //helper functions\r\n\r\n  /**\r\n   * Get the decimal values of r, g, b and a\r\n   *\r\n   * @name getRGBA\r\n   * @function\r\n   * @private\r\n   * @ignore\r\n   */\r\n  var getRGBA = function(style) {\r\n    var rxRgb = /rgb\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)/;\r\n    var rxRgba = /rgba\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*([\\d.]+)\\s*\\)/;\r\n    var rxTransparent = /transparent|rgba\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*0+\\s*\\)/;\r\n\r\n    var r, g, b, a;\r\n\r\n    if (style.isCanvasGradient === true) {\r\n      style = style.getColor();\r\n    }\r\n\r\n    if (!style) {\r\n      return { r: 0, g: 0, b: 0, a: 0, style: style };\r\n    }\r\n\r\n    if (rxTransparent.test(style)) {\r\n      r = 0;\r\n      g = 0;\r\n      b = 0;\r\n      a = 0;\r\n    } else {\r\n      var matches = rxRgb.exec(style);\r\n      if (matches !== null) {\r\n        r = parseInt(matches[1]);\r\n        g = parseInt(matches[2]);\r\n        b = parseInt(matches[3]);\r\n        a = 1;\r\n      } else {\r\n        matches = rxRgba.exec(style);\r\n        if (matches !== null) {\r\n          r = parseInt(matches[1]);\r\n          g = parseInt(matches[2]);\r\n          b = parseInt(matches[3]);\r\n          a = parseFloat(matches[4]);\r\n        } else {\r\n          a = 1;\r\n\r\n          if (typeof style === \"string\" && style.charAt(0) !== \"#\") {\r\n            var rgbColor = new RGBColor(style);\r\n            if (rgbColor.ok) {\r\n              style = rgbColor.toHex();\r\n            } else {\r\n              style = \"#000000\";\r\n            }\r\n          }\r\n\r\n          if (style.length === 4) {\r\n            r = style.substring(1, 2);\r\n            r += r;\r\n            g = style.substring(2, 3);\r\n            g += g;\r\n            b = style.substring(3, 4);\r\n            b += b;\r\n          } else {\r\n            r = style.substring(1, 3);\r\n            g = style.substring(3, 5);\r\n            b = style.substring(5, 7);\r\n          }\r\n          r = parseInt(r, 16);\r\n          g = parseInt(g, 16);\r\n          b = parseInt(b, 16);\r\n        }\r\n      }\r\n    }\r\n    return { r: r, g: g, b: b, a: a, style: style };\r\n  };\r\n\r\n  /**\r\n   * @name isFillTransparent\r\n   * @function\r\n   * @private\r\n   * @ignore\r\n   * @returns {Boolean}\r\n   */\r\n  var isFillTransparent = function() {\r\n    return this.ctx.isFillTransparent || this.globalAlpha == 0;\r\n  };\r\n\r\n  /**\r\n   * @name isStrokeTransparent\r\n   * @function\r\n   * @private\r\n   * @ignore\r\n   * @returns {Boolean}\r\n   */\r\n  var isStrokeTransparent = function() {\r\n    return Boolean(this.ctx.isStrokeTransparent || this.globalAlpha == 0);\r\n  };\r\n\r\n  /**\r\n   * Draws \"filled\" text on the canvas\r\n   *\r\n   * @name fillText\r\n   * @function\r\n   * @param text {String} Specifies the text that will be written on the canvas\r\n   * @param x {Number} The x coordinate where to start painting the text (relative to the canvas)\r\n   * @param y {Number} The y coordinate where to start painting the text (relative to the canvas)\r\n   * @param maxWidth {Number} Optional. The maximum allowed width of the text, in pixels\r\n   * @description The fillText() method draws filled text on the canvas. The default color of the text is black.\r\n   */\r\n  Context2D.prototype.fillText = function(text, x, y, maxWidth) {\r\n    if (isNaN(x) || isNaN(y) || typeof text !== \"string\") {\r\n      console.error(\"jsPDF.context2d.fillText: Invalid arguments\", arguments);\r\n      throw new Error(\"Invalid arguments passed to jsPDF.context2d.fillText\");\r\n    }\r\n    maxWidth = isNaN(maxWidth) ? undefined : maxWidth;\r\n    if (isFillTransparent.call(this)) {\r\n      return;\r\n    }\r\n\r\n    var degs = rad2deg(this.ctx.transform.rotation);\r\n\r\n    // We only use X axis as scale hint\r\n    var scale = this.ctx.transform.scaleX;\r\n\r\n    putText.call(this, {\r\n      text: text,\r\n      x: x,\r\n      y: y,\r\n      scale: scale,\r\n      angle: degs,\r\n      align: this.textAlign,\r\n      maxWidth: maxWidth\r\n    });\r\n  };\r\n\r\n  /**\r\n   * Draws text on the canvas (no fill)\r\n   *\r\n   * @name strokeText\r\n   * @function\r\n   * @param text {String} Specifies the text that will be written on the canvas\r\n   * @param x {Number} The x coordinate where to start painting the text (relative to the canvas)\r\n   * @param y {Number} The y coordinate where to start painting the text (relative to the canvas)\r\n   * @param maxWidth {Number} Optional. The maximum allowed width of the text, in pixels\r\n   * @description The strokeText() method draws text (with no fill) on the canvas. The default color of the text is black.\r\n   */\r\n  Context2D.prototype.strokeText = function(text, x, y, maxWidth) {\r\n    if (isNaN(x) || isNaN(y) || typeof text !== \"string\") {\r\n      console.error(\"jsPDF.context2d.strokeText: Invalid arguments\", arguments);\r\n      throw new Error(\"Invalid arguments passed to jsPDF.context2d.strokeText\");\r\n    }\r\n    if (isStrokeTransparent.call(this)) {\r\n      return;\r\n    }\r\n\r\n    maxWidth = isNaN(maxWidth) ? undefined : maxWidth;\r\n\r\n    var degs = rad2deg(this.ctx.transform.rotation);\r\n    var scale = this.ctx.transform.scaleX;\r\n\r\n    putText.call(this, {\r\n      text: text,\r\n      x: x,\r\n      y: y,\r\n      scale: scale,\r\n      renderingMode: \"stroke\",\r\n      angle: degs,\r\n      align: this.textAlign,\r\n      maxWidth: maxWidth\r\n    });\r\n  };\r\n\r\n  /**\r\n   * Returns an object that contains the width of the specified text\r\n   *\r\n   * @name measureText\r\n   * @function\r\n   * @param text {String} The text to be measured\r\n   * @description The measureText() method returns an object that contains the width of the specified text, in pixels.\r\n   * @returns {Number}\r\n   */\r\n  Context2D.prototype.measureText = function(text) {\r\n    if (typeof text !== \"string\") {\r\n      console.error(\r\n        \"jsPDF.context2d.measureText: Invalid arguments\",\r\n        arguments\r\n      );\r\n      throw new Error(\r\n        \"Invalid arguments passed to jsPDF.context2d.measureText\"\r\n      );\r\n    }\r\n    var pdf = this.pdf;\r\n    var k = this.pdf.internal.scaleFactor;\r\n\r\n    var fontSize = pdf.internal.getFontSize();\r\n    var txtWidth =\r\n      (pdf.getStringUnitWidth(text) * fontSize) / pdf.internal.scaleFactor;\r\n    txtWidth *= Math.round(((k * 96) / 72) * 10000) / 10000;\r\n\r\n    var TextMetrics = function(options) {\r\n      options = options || {};\r\n      var _width = options.width || 0;\r\n      Object.defineProperty(this, \"width\", {\r\n        get: function() {\r\n          return _width;\r\n        }\r\n      });\r\n      return this;\r\n    };\r\n    return new TextMetrics({ width: txtWidth });\r\n  };\r\n\r\n  //Transformations\r\n\r\n  /**\r\n   * Scales the current drawing bigger or smaller\r\n   *\r\n   * @name scale\r\n   * @function\r\n   * @param scalewidth {Number} Scales the width of the current drawing (1=100%, 0.5=50%, 2=200%, etc.)\r\n   * @param scaleheight {Number} Scales the height of the current drawing (1=100%, 0.5=50%, 2=200%, etc.)\r\n   * @description The scale() method scales the current drawing, bigger or smaller.\r\n   */\r\n  Context2D.prototype.scale = function(scalewidth, scaleheight) {\r\n    if (isNaN(scalewidth) || isNaN(scaleheight)) {\r\n      console.error(\"jsPDF.context2d.scale: Invalid arguments\", arguments);\r\n      throw new Error(\"Invalid arguments passed to jsPDF.context2d.scale\");\r\n    }\r\n    var matrix = new Matrix(scalewidth, 0.0, 0.0, scaleheight, 0.0, 0.0);\r\n    this.ctx.transform = this.ctx.transform.multiply(matrix);\r\n  };\r\n\r\n  /**\r\n   * Rotates the current drawing\r\n   *\r\n   * @name rotate\r\n   * @function\r\n   * @param angle {Number} The rotation angle, in radians.\r\n   * @description To calculate from degrees to radians: degrees*Math.PI/180. <br />\r\n   * Example: to rotate 5 degrees, specify the following: 5*Math.PI/180\r\n   */\r\n  Context2D.prototype.rotate = function(angle) {\r\n    if (isNaN(angle)) {\r\n      console.error(\"jsPDF.context2d.rotate: Invalid arguments\", arguments);\r\n      throw new Error(\"Invalid arguments passed to jsPDF.context2d.rotate\");\r\n    }\r\n    var matrix = new Matrix(\r\n      Math.cos(angle),\r\n      Math.sin(angle),\r\n      -Math.sin(angle),\r\n      Math.cos(angle),\r\n      0.0,\r\n      0.0\r\n    );\r\n    this.ctx.transform = this.ctx.transform.multiply(matrix);\r\n  };\r\n\r\n  /**\r\n   * Remaps the (0,0) position on the canvas\r\n   *\r\n   * @name translate\r\n   * @function\r\n   * @param x {Number} The value to add to horizontal (x) coordinates\r\n   * @param y {Number} The value to add to vertical (y) coordinates\r\n   * @description The translate() method remaps the (0,0) position on the canvas.\r\n   */\r\n  Context2D.prototype.translate = function(x, y) {\r\n    if (isNaN(x) || isNaN(y)) {\r\n      console.error(\"jsPDF.context2d.translate: Invalid arguments\", arguments);\r\n      throw new Error(\"Invalid arguments passed to jsPDF.context2d.translate\");\r\n    }\r\n    var matrix = new Matrix(1.0, 0.0, 0.0, 1.0, x, y);\r\n    this.ctx.transform = this.ctx.transform.multiply(matrix);\r\n  };\r\n\r\n  /**\r\n   * Replaces the current transformation matrix for the drawing\r\n   *\r\n   * @name transform\r\n   * @function\r\n   * @param a {Number} Horizontal scaling\r\n   * @param b {Number} Horizontal skewing\r\n   * @param c {Number} Vertical skewing\r\n   * @param d {Number} Vertical scaling\r\n   * @param e {Number} Horizontal moving\r\n   * @param f {Number} Vertical moving\r\n   * @description Each object on the canvas has a current transformation matrix.<br /><br />The transform() method replaces the current transformation matrix. It multiplies the current transformation matrix with the matrix described by:<br /><br /><br /><br />a    c    e<br /><br />b    d    f<br /><br />0    0    1<br /><br />In other words, the transform() method lets you scale, rotate, move, and skew the current context.\r\n   */\r\n  Context2D.prototype.transform = function(a, b, c, d, e, f) {\r\n    if (isNaN(a) || isNaN(b) || isNaN(c) || isNaN(d) || isNaN(e) || isNaN(f)) {\r\n      console.error(\"jsPDF.context2d.transform: Invalid arguments\", arguments);\r\n      throw new Error(\"Invalid arguments passed to jsPDF.context2d.transform\");\r\n    }\r\n    var matrix = new Matrix(a, b, c, d, e, f);\r\n    this.ctx.transform = this.ctx.transform.multiply(matrix);\r\n  };\r\n\r\n  /**\r\n   * Resets the current transform to the identity matrix. Then runs transform()\r\n   *\r\n   * @name setTransform\r\n   * @function\r\n   * @param a {Number} Horizontal scaling\r\n   * @param b {Number} Horizontal skewing\r\n   * @param c {Number} Vertical skewing\r\n   * @param d {Number} Vertical scaling\r\n   * @param e {Number} Horizontal moving\r\n   * @param f {Number} Vertical moving\r\n   * @description Each object on the canvas has a current transformation matrix. <br /><br />The setTransform() method resets the current transform to the identity matrix, and then runs transform() with the same arguments.<br /><br />In other words, the setTransform() method lets you scale, rotate, move, and skew the current context.\r\n   */\r\n  Context2D.prototype.setTransform = function(a, b, c, d, e, f) {\r\n    a = isNaN(a) ? 1 : a;\r\n    b = isNaN(b) ? 0 : b;\r\n    c = isNaN(c) ? 0 : c;\r\n    d = isNaN(d) ? 1 : d;\r\n    e = isNaN(e) ? 0 : e;\r\n    f = isNaN(f) ? 0 : f;\r\n    this.ctx.transform = new Matrix(a, b, c, d, e, f);\r\n  };\r\n\r\n  /**\r\n   * Should only be used if pageWrapYEnabled is true\r\n   *\r\n   * @name setPageByYPosition\r\n   * @function\r\n   * @private\r\n   * @ignore\r\n   * @returns One-based Page Number\r\n   */\r\n  var setPageByYPosition = function(y) {\r\n    if (this.pageWrapYEnabled) {\r\n      this.lastBreak = 0;\r\n      var manualBreaks = 0;\r\n      var autoBreaks = 0;\r\n      for (var i = 0; i < this.pageBreaks.length; i++) {\r\n        if (y >= this.pageBreaks[i]) {\r\n          manualBreaks++;\r\n          if (this.lastBreak === 0) {\r\n            autoBreaks++;\r\n          }\r\n          var spaceBetweenLastBreak = this.pageBreaks[i] - this.lastBreak;\r\n          this.lastBreak = this.pageBreaks[i];\r\n          var pagesSinceLastBreak = Math.floor(\r\n            spaceBetweenLastBreak / this.pageWrapY\r\n          );\r\n          autoBreaks += pagesSinceLastBreak;\r\n        }\r\n      }\r\n      if (this.lastBreak === 0) {\r\n        var pagesSinceLastBreak = Math.floor(y / this.pageWrapY) + 1;\r\n        autoBreaks += pagesSinceLastBreak;\r\n      }\r\n      return autoBreaks + manualBreaks;\r\n    } else {\r\n      return this.pdf.internal.getCurrentPageInfo().pageNumber;\r\n    }\r\n  };\r\n\r\n  var hasMargins = function() {\r\n    return (\r\n      this.margin[0] > 0 ||\r\n      this.margin[1] > 0 ||\r\n      this.margin[2] > 0 ||\r\n      this.margin[3] > 0\r\n    );\r\n  };\r\n\r\n  /**\r\n   * Draws an image, canvas, or video onto the canvas\r\n   *\r\n   * @function\r\n   * @param img {} Specifies the image, canvas, or video element to use\r\n   * @param sx {Number} Optional. The x coordinate where to start clipping\r\n   * @param sy {Number} Optional. The y coordinate where to start clipping\r\n   * @param swidth {Number} Optional. The width of the clipped image\r\n   * @param sheight {Number} Optional. The height of the clipped image\r\n   * @param x {Number} The x coordinate where to place the image on the canvas\r\n   * @param y {Number} The y coordinate where to place the image on the canvas\r\n   * @param width {Number} Optional. The width of the image to use (stretch or reduce the image)\r\n   * @param height {Number} Optional. The height of the image to use (stretch or reduce the image)\r\n   */\r\n  Context2D.prototype.drawImage = function(\r\n    img,\r\n    sx,\r\n    sy,\r\n    swidth,\r\n    sheight,\r\n    x,\r\n    y,\r\n    width,\r\n    height\r\n  ) {\r\n    var imageProperties = this.pdf.getImageProperties(img);\r\n    var factorX = 1;\r\n    var factorY = 1;\r\n    var isClip;\r\n\r\n    var clipFactorX = 1;\r\n    var clipFactorY = 1;\r\n\r\n    if (typeof swidth !== \"undefined\" && typeof width !== \"undefined\") {\r\n      isClip = true;\r\n      clipFactorX = width / swidth;\r\n      clipFactorY = height / sheight;\r\n      factorX = ((imageProperties.width / swidth) * width) / swidth;\r\n      factorY = ((imageProperties.height / sheight) * height) / sheight;\r\n    }\r\n\r\n    //is sx and sy are set and x and y not, set x and y with values of sx and sy\r\n    if (typeof x === \"undefined\") {\r\n      x = sx;\r\n      y = sy;\r\n      sx = 0;\r\n      sy = 0;\r\n    }\r\n\r\n    if (typeof swidth !== \"undefined\" && typeof width === \"undefined\") {\r\n      width = swidth;\r\n      height = sheight;\r\n    }\r\n    if (typeof swidth === \"undefined\" && typeof width === \"undefined\") {\r\n      width = imageProperties.width;\r\n      height = imageProperties.height;\r\n    }\r\n\r\n    var decomposedTransformationMatrix = this.ctx.transform.decompose();\r\n    var angle = rad2deg(decomposedTransformationMatrix.rotate.shx);\r\n    var matrix = new Matrix();\r\n    matrix = matrix.multiply(decomposedTransformationMatrix.translate);\r\n    matrix = matrix.multiply(decomposedTransformationMatrix.skew);\r\n    matrix = matrix.multiply(decomposedTransformationMatrix.scale);\r\n    var xRect = matrix.applyToRectangle(\r\n      new Rectangle(\r\n        x - sx * clipFactorX,\r\n        y - sy * clipFactorY,\r\n        swidth * factorX,\r\n        sheight * factorY\r\n      )\r\n    );\r\n    var pageArray = getPagesByPath.call(this, xRect);\r\n    var pages = [];\r\n    for (var ii = 0; ii < pageArray.length; ii += 1) {\r\n      if (pages.indexOf(pageArray[ii]) === -1) {\r\n        pages.push(pageArray[ii]);\r\n      }\r\n    }\r\n\r\n    sortPages(pages);\r\n\r\n    var clipPath;\r\n    if (this.autoPaging) {\r\n      var min = pages[0];\r\n      var max = pages[pages.length - 1];\r\n      for (var i = min; i < max + 1; i++) {\r\n        this.pdf.setPage(i);\r\n\r\n        var pageWidthMinusMargins =\r\n          this.pdf.internal.pageSize.width - this.margin[3] - this.margin[1];\r\n        var topMargin = i === 1 ? this.posY + this.margin[0] : this.margin[0];\r\n        var firstPageHeight =\r\n          this.pdf.internal.pageSize.height -\r\n          this.posY -\r\n          this.margin[0] -\r\n          this.margin[2];\r\n        var pageHeightMinusMargins =\r\n          this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2];\r\n        var previousPageHeightSum =\r\n          i === 1 ? 0 : firstPageHeight + (i - 2) * pageHeightMinusMargins;\r\n\r\n        if (this.ctx.clip_path.length !== 0) {\r\n          var tmpPaths = this.path;\r\n          clipPath = JSON.parse(JSON.stringify(this.ctx.clip_path));\r\n          this.path = pathPositionRedo(\r\n            clipPath,\r\n            this.posX + this.margin[3],\r\n            -previousPageHeightSum + topMargin + this.ctx.prevPageLastElemOffset\r\n          );\r\n          drawPaths.call(this, \"fill\", true);\r\n          this.path = tmpPaths;\r\n        }\r\n        var tmpRect = JSON.parse(JSON.stringify(xRect));\r\n        tmpRect = pathPositionRedo(\r\n          [tmpRect],\r\n          this.posX + this.margin[3],\r\n          -previousPageHeightSum + topMargin + this.ctx.prevPageLastElemOffset\r\n        )[0];\r\n\r\n        const needsClipping = (i > min || i < max) && hasMargins.call(this);\r\n\r\n        if (needsClipping) {\r\n          this.pdf.saveGraphicsState();\r\n          this.pdf\r\n            .rect(\r\n              this.margin[3],\r\n              this.margin[0],\r\n              pageWidthMinusMargins,\r\n              pageHeightMinusMargins,\r\n              null\r\n            )\r\n            .clip()\r\n            .discardPath();\r\n        }\r\n        this.pdf.addImage(\r\n          img,\r\n          \"JPEG\",\r\n          tmpRect.x,\r\n          tmpRect.y,\r\n          tmpRect.w,\r\n          tmpRect.h,\r\n          null,\r\n          null,\r\n          angle\r\n        );\r\n        if (needsClipping) {\r\n          this.pdf.restoreGraphicsState();\r\n        }\r\n      }\r\n    } else {\r\n      this.pdf.addImage(\r\n        img,\r\n        \"JPEG\",\r\n        xRect.x,\r\n        xRect.y,\r\n        xRect.w,\r\n        xRect.h,\r\n        null,\r\n        null,\r\n        angle\r\n      );\r\n    }\r\n  };\r\n\r\n  var getPagesByPath = function(path, pageWrapX, pageWrapY) {\r\n    var result = [];\r\n    pageWrapX = pageWrapX || this.pdf.internal.pageSize.width;\r\n    pageWrapY =\r\n      pageWrapY ||\r\n      this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2];\r\n    var yOffset = this.posY + this.ctx.prevPageLastElemOffset;\r\n\r\n    switch (path.type) {\r\n      default:\r\n      case \"mt\":\r\n      case \"lt\":\r\n        result.push(Math.floor((path.y + yOffset) / pageWrapY) + 1);\r\n        break;\r\n      case \"arc\":\r\n        result.push(\r\n          Math.floor((path.y + yOffset - path.radius) / pageWrapY) + 1\r\n        );\r\n        result.push(\r\n          Math.floor((path.y + yOffset + path.radius) / pageWrapY) + 1\r\n        );\r\n        break;\r\n      case \"qct\":\r\n        var rectOfQuadraticCurve = getQuadraticCurveBoundary(\r\n          this.ctx.lastPoint.x,\r\n          this.ctx.lastPoint.y,\r\n          path.x1,\r\n          path.y1,\r\n          path.x,\r\n          path.y\r\n        );\r\n        result.push(\r\n          Math.floor((rectOfQuadraticCurve.y + yOffset) / pageWrapY) + 1\r\n        );\r\n        result.push(\r\n          Math.floor(\r\n            (rectOfQuadraticCurve.y + rectOfQuadraticCurve.h + yOffset) /\r\n              pageWrapY\r\n          ) + 1\r\n        );\r\n        break;\r\n      case \"bct\":\r\n        var rectOfBezierCurve = getBezierCurveBoundary(\r\n          this.ctx.lastPoint.x,\r\n          this.ctx.lastPoint.y,\r\n          path.x1,\r\n          path.y1,\r\n          path.x2,\r\n          path.y2,\r\n          path.x,\r\n          path.y\r\n        );\r\n        result.push(\r\n          Math.floor((rectOfBezierCurve.y + yOffset) / pageWrapY) + 1\r\n        );\r\n        result.push(\r\n          Math.floor(\r\n            (rectOfBezierCurve.y + rectOfBezierCurve.h + yOffset) / pageWrapY\r\n          ) + 1\r\n        );\r\n        break;\r\n      case \"rect\":\r\n        result.push(Math.floor((path.y + yOffset) / pageWrapY) + 1);\r\n        result.push(Math.floor((path.y + path.h + yOffset) / pageWrapY) + 1);\r\n    }\r\n\r\n    for (var i = 0; i < result.length; i += 1) {\r\n      while (this.pdf.internal.getNumberOfPages() < result[i]) {\r\n        addPage.call(this);\r\n      }\r\n    }\r\n    return result;\r\n  };\r\n\r\n  var addPage = function() {\r\n    var fillStyle = this.fillStyle;\r\n    var strokeStyle = this.strokeStyle;\r\n    var font = this.font;\r\n    var lineCap = this.lineCap;\r\n    var lineWidth = this.lineWidth;\r\n    var lineJoin = this.lineJoin;\r\n    this.pdf.addPage();\r\n    this.fillStyle = fillStyle;\r\n    this.strokeStyle = strokeStyle;\r\n    this.font = font;\r\n    this.lineCap = lineCap;\r\n    this.lineWidth = lineWidth;\r\n    this.lineJoin = lineJoin;\r\n  };\r\n\r\n  var pathPositionRedo = function(paths, x, y) {\r\n    for (var i = 0; i < paths.length; i++) {\r\n      switch (paths[i].type) {\r\n        case \"bct\":\r\n          paths[i].x2 += x;\r\n          paths[i].y2 += y;\r\n        case \"qct\":\r\n          paths[i].x1 += x;\r\n          paths[i].y1 += y;\r\n        case \"mt\":\r\n        case \"lt\":\r\n        case \"arc\":\r\n        default:\r\n          paths[i].x += x;\r\n          paths[i].y += y;\r\n      }\r\n    }\r\n    return paths;\r\n  };\r\n\r\n  var sortPages = function(pages) {\r\n    return pages.sort(function(a, b) {\r\n      return a - b;\r\n    });\r\n  };\r\n\r\n  var pathPreProcess = function(rule, isClip) {\r\n    var fillStyle = this.fillStyle;\r\n    var strokeStyle = this.strokeStyle;\r\n    var lineCap = this.lineCap;\r\n    var oldLineWidth = this.lineWidth;\r\n    var lineWidth = Math.abs(oldLineWidth * this.ctx.transform.scaleX);\r\n    var lineJoin = this.lineJoin;\r\n\r\n    var origPath = JSON.parse(JSON.stringify(this.path));\r\n    var xPath = JSON.parse(JSON.stringify(this.path));\r\n    var clipPath;\r\n    var tmpPath;\r\n    var pages = [];\r\n\r\n    for (var i = 0; i < xPath.length; i++) {\r\n      if (typeof xPath[i].x !== \"undefined\") {\r\n        var page = getPagesByPath.call(this, xPath[i]);\r\n\r\n        for (var ii = 0; ii < page.length; ii += 1) {\r\n          if (pages.indexOf(page[ii]) === -1) {\r\n            pages.push(page[ii]);\r\n          }\r\n        }\r\n      }\r\n    }\r\n\r\n    for (var j = 0; j < pages.length; j++) {\r\n      while (this.pdf.internal.getNumberOfPages() < pages[j]) {\r\n        addPage.call(this);\r\n      }\r\n    }\r\n    sortPages(pages);\r\n\r\n    if (this.autoPaging) {\r\n      var min = pages[0];\r\n      var max = pages[pages.length - 1];\r\n      for (var k = min; k < max + 1; k++) {\r\n        this.pdf.setPage(k);\r\n\r\n        this.fillStyle = fillStyle;\r\n        this.strokeStyle = strokeStyle;\r\n        this.lineCap = lineCap;\r\n        this.lineWidth = lineWidth;\r\n        this.lineJoin = lineJoin;\r\n\r\n        var pageWidthMinusMargins =\r\n          this.pdf.internal.pageSize.width - this.margin[3] - this.margin[1];\r\n        var topMargin = k === 1 ? this.posY + this.margin[0] : this.margin[0];\r\n        var firstPageHeight =\r\n          this.pdf.internal.pageSize.height -\r\n          this.posY -\r\n          this.margin[0] -\r\n          this.margin[2];\r\n        var pageHeightMinusMargins =\r\n          this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2];\r\n        var previousPageHeightSum =\r\n          k === 1 ? 0 : firstPageHeight + (k - 2) * pageHeightMinusMargins;\r\n\r\n        if (this.ctx.clip_path.length !== 0) {\r\n          var tmpPaths = this.path;\r\n          clipPath = JSON.parse(JSON.stringify(this.ctx.clip_path));\r\n          this.path = pathPositionRedo(\r\n            clipPath,\r\n            this.posX + this.margin[3],\r\n            -previousPageHeightSum + topMargin + this.ctx.prevPageLastElemOffset\r\n          );\r\n          drawPaths.call(this, rule, true);\r\n          this.path = tmpPaths;\r\n        }\r\n        tmpPath = JSON.parse(JSON.stringify(origPath));\r\n        this.path = pathPositionRedo(\r\n          tmpPath,\r\n          this.posX + this.margin[3],\r\n          -previousPageHeightSum + topMargin + this.ctx.prevPageLastElemOffset\r\n        );\r\n        if (isClip === false || k === 0) {\r\n          const needsClipping = (k > min || k < max) && hasMargins.call(this);\r\n          if (needsClipping) {\r\n            this.pdf.saveGraphicsState();\r\n            this.pdf\r\n              .rect(\r\n                this.margin[3],\r\n                this.margin[0],\r\n                pageWidthMinusMargins,\r\n                pageHeightMinusMargins,\r\n                null\r\n              )\r\n              .clip()\r\n              .discardPath();\r\n          }\r\n          drawPaths.call(this, rule, isClip);\r\n          if (needsClipping) {\r\n            this.pdf.restoreGraphicsState();\r\n          }\r\n        }\r\n        this.lineWidth = oldLineWidth;\r\n      }\r\n    } else {\r\n      this.lineWidth = lineWidth;\r\n      drawPaths.call(this, rule, isClip);\r\n      this.lineWidth = oldLineWidth;\r\n    }\r\n    this.path = origPath;\r\n  };\r\n\r\n  /**\r\n   * Processes the paths\r\n   *\r\n   * @function\r\n   * @param rule {String}\r\n   * @param isClip {Boolean}\r\n   * @private\r\n   * @ignore\r\n   */\r\n  var drawPaths = function(rule, isClip) {\r\n    if (rule === \"stroke\" && !isClip && isStrokeTransparent.call(this)) {\r\n      return;\r\n    }\r\n\r\n    if (rule !== \"stroke\" && !isClip && isFillTransparent.call(this)) {\r\n      return;\r\n    }\r\n\r\n    var moves = [];\r\n\r\n    //var alpha = (this.ctx.fillOpacity < 1) ? this.ctx.fillOpacity : this.ctx.globalAlpha;\r\n    var delta;\r\n    var xPath = this.path;\r\n    for (var i = 0; i < xPath.length; i++) {\r\n      var pt = xPath[i];\r\n\r\n      switch (pt.type) {\r\n        case \"begin\":\r\n          moves.push({\r\n            begin: true\r\n          });\r\n          break;\r\n\r\n        case \"close\":\r\n          moves.push({\r\n            close: true\r\n          });\r\n          break;\r\n\r\n        case \"mt\":\r\n          moves.push({\r\n            start: pt,\r\n            deltas: [],\r\n            abs: []\r\n          });\r\n          break;\r\n\r\n        case \"lt\":\r\n          var iii = moves.length;\r\n          if (xPath[i - 1] && !isNaN(xPath[i - 1].x)) {\r\n            delta = [pt.x - xPath[i - 1].x, pt.y - xPath[i - 1].y];\r\n            if (iii > 0) {\r\n              for (iii; iii >= 0; iii--) {\r\n                if (\r\n                  moves[iii - 1].close !== true &&\r\n                  moves[iii - 1].begin !== true\r\n                ) {\r\n                  moves[iii - 1].deltas.push(delta);\r\n                  moves[iii - 1].abs.push(pt);\r\n                  break;\r\n                }\r\n              }\r\n            }\r\n          }\r\n          break;\r\n\r\n        case \"bct\":\r\n          delta = [\r\n            pt.x1 - xPath[i - 1].x,\r\n            pt.y1 - xPath[i - 1].y,\r\n            pt.x2 - xPath[i - 1].x,\r\n            pt.y2 - xPath[i - 1].y,\r\n            pt.x - xPath[i - 1].x,\r\n            pt.y - xPath[i - 1].y\r\n          ];\r\n          moves[moves.length - 1].deltas.push(delta);\r\n          break;\r\n\r\n        case \"qct\":\r\n          var x1 = xPath[i - 1].x + (2.0 / 3.0) * (pt.x1 - xPath[i - 1].x);\r\n          var y1 = xPath[i - 1].y + (2.0 / 3.0) * (pt.y1 - xPath[i - 1].y);\r\n          var x2 = pt.x + (2.0 / 3.0) * (pt.x1 - pt.x);\r\n          var y2 = pt.y + (2.0 / 3.0) * (pt.y1 - pt.y);\r\n          var x3 = pt.x;\r\n          var y3 = pt.y;\r\n          delta = [\r\n            x1 - xPath[i - 1].x,\r\n            y1 - xPath[i - 1].y,\r\n            x2 - xPath[i - 1].x,\r\n            y2 - xPath[i - 1].y,\r\n            x3 - xPath[i - 1].x,\r\n            y3 - xPath[i - 1].y\r\n          ];\r\n          moves[moves.length - 1].deltas.push(delta);\r\n          break;\r\n\r\n        case \"arc\":\r\n          moves.push({\r\n            deltas: [],\r\n            abs: [],\r\n            arc: true\r\n          });\r\n\r\n          if (Array.isArray(moves[moves.length - 1].abs)) {\r\n            moves[moves.length - 1].abs.push(pt);\r\n          }\r\n          break;\r\n      }\r\n    }\r\n    var style;\r\n    if (!isClip) {\r\n      if (rule === \"stroke\") {\r\n        style = \"stroke\";\r\n      } else {\r\n        style = \"fill\";\r\n      }\r\n    } else {\r\n      style = null;\r\n    }\r\n\r\n    var began = false;\r\n    for (var k = 0; k < moves.length; k++) {\r\n      if (moves[k].arc) {\r\n        var arcs = moves[k].abs;\r\n\r\n        for (var ii = 0; ii < arcs.length; ii++) {\r\n          var arc = arcs[ii];\r\n\r\n          if (arc.type === \"arc\") {\r\n            drawArc.call(\r\n              this,\r\n              arc.x,\r\n              arc.y,\r\n              arc.radius,\r\n              arc.startAngle,\r\n              arc.endAngle,\r\n              arc.counterclockwise,\r\n              undefined,\r\n              isClip,\r\n              !began\r\n            );\r\n          } else {\r\n            drawLine.call(this, arc.x, arc.y);\r\n          }\r\n          began = true;\r\n        }\r\n      } else if (moves[k].close === true) {\r\n        this.pdf.internal.out(\"h\");\r\n        began = false;\r\n      } else if (moves[k].begin !== true) {\r\n        var x = moves[k].start.x;\r\n        var y = moves[k].start.y;\r\n        drawLines.call(this, moves[k].deltas, x, y);\r\n        began = true;\r\n      }\r\n    }\r\n\r\n    if (style) {\r\n      putStyle.call(this, style);\r\n    }\r\n    if (isClip) {\r\n      doClip.call(this);\r\n    }\r\n  };\r\n\r\n  var getBaseline = function(y) {\r\n    var height =\r\n      this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor;\r\n    var descent = height * (this.pdf.internal.getLineHeightFactor() - 1);\r\n    switch (this.ctx.textBaseline) {\r\n      case \"bottom\":\r\n        return y - descent;\r\n      case \"top\":\r\n        return y + height - descent;\r\n      case \"hanging\":\r\n        return y + height - 2 * descent;\r\n      case \"middle\":\r\n        return y + height / 2 - descent;\r\n      case \"ideographic\":\r\n        // TODO not implemented\r\n        return y;\r\n      case \"alphabetic\":\r\n      default:\r\n        return y;\r\n    }\r\n  };\r\n\r\n  var getTextBottom = function(yBaseLine) {\r\n    var height =\r\n      this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor;\r\n    var descent = height * (this.pdf.internal.getLineHeightFactor() - 1);\r\n    return yBaseLine + descent;\r\n  };\r\n\r\n  Context2D.prototype.createLinearGradient = function createLinearGradient() {\r\n    var canvasGradient = function canvasGradient() {};\r\n\r\n    canvasGradient.colorStops = [];\r\n    canvasGradient.addColorStop = function(offset, color) {\r\n      this.colorStops.push([offset, color]);\r\n    };\r\n\r\n    canvasGradient.getColor = function() {\r\n      if (this.colorStops.length === 0) {\r\n        return \"#000000\";\r\n      }\r\n\r\n      return this.colorStops[0][1];\r\n    };\r\n\r\n    canvasGradient.isCanvasGradient = true;\r\n    return canvasGradient;\r\n  };\r\n  Context2D.prototype.createPattern = function createPattern() {\r\n    return this.createLinearGradient();\r\n  };\r\n  Context2D.prototype.createRadialGradient = function createRadialGradient() {\r\n    return this.createLinearGradient();\r\n  };\r\n\r\n  /**\r\n   *\r\n   * @param x Edge point X\r\n   * @param y Edge point Y\r\n   * @param r Radius\r\n   * @param a1 start angle\r\n   * @param a2 end angle\r\n   * @param counterclockwise\r\n   * @param style\r\n   * @param isClip\r\n   */\r\n  var drawArc = function(\r\n    x,\r\n    y,\r\n    r,\r\n    a1,\r\n    a2,\r\n    counterclockwise,\r\n    style,\r\n    isClip,\r\n    includeMove\r\n  ) {\r\n    // http://hansmuller-flex.blogspot.com/2011/10/more-about-approximating-circular-arcs.html\r\n    var curves = createArc.call(this, r, a1, a2, counterclockwise);\r\n\r\n    for (var i = 0; i < curves.length; i++) {\r\n      var curve = curves[i];\r\n      if (i === 0) {\r\n        if (includeMove) {\r\n          doMove.call(this, curve.x1 + x, curve.y1 + y);\r\n        } else {\r\n          drawLine.call(this, curve.x1 + x, curve.y1 + y);\r\n        }\r\n      }\r\n      drawCurve.call(\r\n        this,\r\n        x,\r\n        y,\r\n        curve.x2,\r\n        curve.y2,\r\n        curve.x3,\r\n        curve.y3,\r\n        curve.x4,\r\n        curve.y4\r\n      );\r\n    }\r\n\r\n    if (!isClip) {\r\n      putStyle.call(this, style);\r\n    } else {\r\n      doClip.call(this);\r\n    }\r\n  };\r\n\r\n  var putStyle = function(style) {\r\n    switch (style) {\r\n      case \"stroke\":\r\n        this.pdf.internal.out(\"S\");\r\n        break;\r\n      case \"fill\":\r\n        this.pdf.internal.out(\"f\");\r\n        break;\r\n    }\r\n  };\r\n\r\n  var doClip = function() {\r\n    this.pdf.clip();\r\n    this.pdf.discardPath();\r\n  };\r\n\r\n  var doMove = function(x, y) {\r\n    this.pdf.internal.out(\r\n      getHorizontalCoordinateString(x) +\r\n        \" \" +\r\n        getVerticalCoordinateString(y) +\r\n        \" m\"\r\n    );\r\n  };\r\n\r\n  var putText = function(options) {\r\n    var textAlign;\r\n    switch (options.align) {\r\n      case \"right\":\r\n      case \"end\":\r\n        textAlign = \"right\";\r\n        break;\r\n      case \"center\":\r\n        textAlign = \"center\";\r\n        break;\r\n      case \"left\":\r\n      case \"start\":\r\n      default:\r\n        textAlign = \"left\";\r\n        break;\r\n    }\r\n\r\n    var textDimensions = this.pdf.getTextDimensions(options.text);\r\n    var yBaseLine = getBaseline.call(this, options.y);\r\n    var yBottom = getTextBottom.call(this, yBaseLine);\r\n    var yTop = yBottom - textDimensions.h;\r\n\r\n    var pt = this.ctx.transform.applyToPoint(new Point(options.x, yBaseLine));\r\n    var decomposedTransformationMatrix = this.ctx.transform.decompose();\r\n    var matrix = new Matrix();\r\n    matrix = matrix.multiply(decomposedTransformationMatrix.translate);\r\n    matrix = matrix.multiply(decomposedTransformationMatrix.skew);\r\n    matrix = matrix.multiply(decomposedTransformationMatrix.scale);\r\n\r\n    var baselineRect = this.ctx.transform.applyToRectangle(\r\n      new Rectangle(options.x, yBaseLine, textDimensions.w, textDimensions.h)\r\n    );\r\n    var textBounds = matrix.applyToRectangle(\r\n      new Rectangle(options.x, yTop, textDimensions.w, textDimensions.h)\r\n    );\r\n    var pageArray = getPagesByPath.call(this, textBounds);\r\n    var pages = [];\r\n    for (var ii = 0; ii < pageArray.length; ii += 1) {\r\n      if (pages.indexOf(pageArray[ii]) === -1) {\r\n        pages.push(pageArray[ii]);\r\n      }\r\n    }\r\n\r\n    sortPages(pages);\r\n\r\n    var clipPath, oldSize, oldLineWidth;\r\n    if (this.autoPaging) {\r\n      var min = pages[0];\r\n      var max = pages[pages.length - 1];\r\n      for (var i = min; i < max + 1; i++) {\r\n        this.pdf.setPage(i);\r\n\r\n        var topMargin = i === 1 ? this.posY + this.margin[0] : this.margin[0];\r\n        var firstPageHeight =\r\n          this.pdf.internal.pageSize.height -\r\n          this.posY -\r\n          this.margin[0] -\r\n          this.margin[2];\r\n        var pageHeightMinusBottomMargin =\r\n          this.pdf.internal.pageSize.height - this.margin[2];\r\n        var pageHeightMinusMargins =\r\n          pageHeightMinusBottomMargin - this.margin[0];\r\n        var pageWidthMinusRightMargin =\r\n          this.pdf.internal.pageSize.width - this.margin[1];\r\n        var pageWidthMinusMargins = pageWidthMinusRightMargin - this.margin[3];\r\n        var previousPageHeightSum =\r\n          i === 1 ? 0 : firstPageHeight + (i - 2) * pageHeightMinusMargins;\r\n\r\n        if (this.ctx.clip_path.length !== 0) {\r\n          var tmpPaths = this.path;\r\n          clipPath = JSON.parse(JSON.stringify(this.ctx.clip_path));\r\n          this.path = pathPositionRedo(\r\n            clipPath,\r\n            this.posX + this.margin[3],\r\n            -1 * previousPageHeightSum + topMargin\r\n          );\r\n          drawPaths.call(this, \"fill\", true);\r\n          this.path = tmpPaths;\r\n        }\r\n        var textBoundsOnPage = pathPositionRedo(\r\n          [JSON.parse(JSON.stringify(textBounds))],\r\n          this.posX + this.margin[3],\r\n          -previousPageHeightSum + topMargin + this.ctx.prevPageLastElemOffset\r\n        )[0];\r\n\r\n        if (options.scale >= 0.01) {\r\n          oldSize = this.pdf.internal.getFontSize();\r\n          this.pdf.setFontSize(oldSize * options.scale);\r\n          oldLineWidth = this.lineWidth;\r\n          this.lineWidth = oldLineWidth * options.scale;\r\n        }\r\n\r\n        var doSlice = this.autoPaging !== \"text\";\r\n\r\n        if (\r\n          doSlice ||\r\n          textBoundsOnPage.y + textBoundsOnPage.h <= pageHeightMinusBottomMargin\r\n        ) {\r\n          if (\r\n            doSlice ||\r\n            (textBoundsOnPage.y >= topMargin &&\r\n              textBoundsOnPage.x <= pageWidthMinusRightMargin)\r\n          ) {\r\n            var croppedText = doSlice\r\n              ? options.text\r\n              : this.pdf.splitTextToSize(\r\n                  options.text,\r\n                  options.maxWidth ||\r\n                    pageWidthMinusRightMargin - textBoundsOnPage.x\r\n                )[0];\r\n            var baseLineRectOnPage = pathPositionRedo(\r\n              [JSON.parse(JSON.stringify(baselineRect))],\r\n              this.posX + this.margin[3],\r\n              -previousPageHeightSum +\r\n                topMargin +\r\n                this.ctx.prevPageLastElemOffset\r\n            )[0];\r\n\r\n            const needsClipping =\r\n              doSlice && (i > min || i < max) && hasMargins.call(this);\r\n\r\n            if (needsClipping) {\r\n              this.pdf.saveGraphicsState();\r\n              this.pdf\r\n                .rect(\r\n                  this.margin[3],\r\n                  this.margin[0],\r\n                  pageWidthMinusMargins,\r\n                  pageHeightMinusMargins,\r\n                  null\r\n                )\r\n                .clip()\r\n                .discardPath();\r\n            }\r\n\r\n            this.pdf.text(\r\n              croppedText,\r\n              baseLineRectOnPage.x,\r\n              baseLineRectOnPage.y,\r\n              {\r\n                angle: options.angle,\r\n                align: textAlign,\r\n                renderingMode: options.renderingMode\r\n              }\r\n            );\r\n\r\n            if (needsClipping) {\r\n              this.pdf.restoreGraphicsState();\r\n            }\r\n          }\r\n        } else {\r\n          // This text is the last element of the page, but it got cut off due to the margin\r\n          // so we render it in the next page\r\n\r\n          if (textBoundsOnPage.y < pageHeightMinusBottomMargin) {\r\n            // As a result, all other elements have their y offset increased\r\n            this.ctx.prevPageLastElemOffset +=\r\n              pageHeightMinusBottomMargin - textBoundsOnPage.y;\r\n          }\r\n        }\r\n\r\n        if (options.scale >= 0.01) {\r\n          this.pdf.setFontSize(oldSize);\r\n          this.lineWidth = oldLineWidth;\r\n        }\r\n      }\r\n    } else {\r\n      if (options.scale >= 0.01) {\r\n        oldSize = this.pdf.internal.getFontSize();\r\n        this.pdf.setFontSize(oldSize * options.scale);\r\n        oldLineWidth = this.lineWidth;\r\n        this.lineWidth = oldLineWidth * options.scale;\r\n      }\r\n      this.pdf.text(options.text, pt.x + this.posX, pt.y + this.posY, {\r\n        angle: options.angle,\r\n        align: textAlign,\r\n        renderingMode: options.renderingMode,\r\n        maxWidth: options.maxWidth\r\n      });\r\n\r\n      if (options.scale >= 0.01) {\r\n        this.pdf.setFontSize(oldSize);\r\n        this.lineWidth = oldLineWidth;\r\n      }\r\n    }\r\n  };\r\n\r\n  var drawLine = function(x, y, prevX, prevY) {\r\n    prevX = prevX || 0;\r\n    prevY = prevY || 0;\r\n\r\n    this.pdf.internal.out(\r\n      getHorizontalCoordinateString(x + prevX) +\r\n        \" \" +\r\n        getVerticalCoordinateString(y + prevY) +\r\n        \" l\"\r\n    );\r\n  };\r\n\r\n  var drawLines = function(lines, x, y) {\r\n    return this.pdf.lines(lines, x, y, null, null);\r\n  };\r\n\r\n  var drawCurve = function(x, y, x1, y1, x2, y2, x3, y3) {\r\n    this.pdf.internal.out(\r\n      [\r\n        f2(getHorizontalCoordinate(x1 + x)),\r\n        f2(getVerticalCoordinate(y1 + y)),\r\n        f2(getHorizontalCoordinate(x2 + x)),\r\n        f2(getVerticalCoordinate(y2 + y)),\r\n        f2(getHorizontalCoordinate(x3 + x)),\r\n        f2(getVerticalCoordinate(y3 + y)),\r\n        \"c\"\r\n      ].join(\" \")\r\n    );\r\n  };\r\n\r\n  /**\r\n   * Return a array of objects that represent bezier curves which approximate the circular arc centered at the origin, from startAngle to endAngle (radians) with the specified radius.\r\n   *\r\n   * Each bezier curve is an object with four points, where x1,y1 and x4,y4 are the arc's end points and x2,y2 and x3,y3 are the cubic bezier's control points.\r\n   * @function createArc\r\n   */\r\n  var createArc = function(radius, startAngle, endAngle, anticlockwise) {\r\n    var EPSILON = 0.00001; // Roughly 1/1000th of a degree, see below\r\n    var twoPi = Math.PI * 2;\r\n    var halfPi = Math.PI / 2.0;\r\n\r\n    while (startAngle > endAngle) {\r\n      startAngle = startAngle - twoPi;\r\n    }\r\n    var totalAngle = Math.abs(endAngle - startAngle);\r\n    if (totalAngle < twoPi) {\r\n      if (anticlockwise) {\r\n        totalAngle = twoPi - totalAngle;\r\n      }\r\n    }\r\n\r\n    // Compute the sequence of arc curves, up to PI/2 at a time.\r\n    var curves = [];\r\n\r\n    // clockwise or counterclockwise\r\n    var sgn = anticlockwise ? -1 : +1;\r\n\r\n    var a1 = startAngle;\r\n    for (; totalAngle > EPSILON; ) {\r\n      var remain = sgn * Math.min(totalAngle, halfPi);\r\n      var a2 = a1 + remain;\r\n      curves.push(createSmallArc.call(this, radius, a1, a2));\r\n      totalAngle -= Math.abs(a2 - a1);\r\n      a1 = a2;\r\n    }\r\n\r\n    return curves;\r\n  };\r\n\r\n  /**\r\n   * Cubic bezier approximation of a circular arc centered at the origin, from (radians) a1 to a2, where a2-a1 < pi/2. The arc's radius is r.\r\n   *\r\n   * Returns an object with four points, where x1,y1 and x4,y4 are the arc's end points and x2,y2 and x3,y3 are the cubic bezier's control points.\r\n   *\r\n   * This algorithm is based on the approach described in: A. Riškus, \"Approximation of a Cubic Bezier Curve by Circular Arcs and Vice Versa,\" Information Technology and Control, 35(4), 2006 pp. 371-378.\r\n   */\r\n  var createSmallArc = function(r, a1, a2) {\r\n    var a = (a2 - a1) / 2.0;\r\n\r\n    var x4 = r * Math.cos(a);\r\n    var y4 = r * Math.sin(a);\r\n    var x1 = x4;\r\n    var y1 = -y4;\r\n\r\n    var q1 = x1 * x1 + y1 * y1;\r\n    var q2 = q1 + x1 * x4 + y1 * y4;\r\n    var k2 = ((4 / 3) * (Math.sqrt(2 * q1 * q2) - q2)) / (x1 * y4 - y1 * x4);\r\n\r\n    var x2 = x1 - k2 * y1;\r\n    var y2 = y1 + k2 * x1;\r\n    var x3 = x2;\r\n    var y3 = -y2;\r\n\r\n    var ar = a + a1;\r\n    var cos_ar = Math.cos(ar);\r\n    var sin_ar = Math.sin(ar);\r\n\r\n    return {\r\n      x1: r * Math.cos(a1),\r\n      y1: r * Math.sin(a1),\r\n      x2: x2 * cos_ar - y2 * sin_ar,\r\n      y2: x2 * sin_ar + y2 * cos_ar,\r\n      x3: x3 * cos_ar - y3 * sin_ar,\r\n      y3: x3 * sin_ar + y3 * cos_ar,\r\n      x4: r * Math.cos(a2),\r\n      y4: r * Math.sin(a2)\r\n    };\r\n  };\r\n\r\n  var rad2deg = function(value) {\r\n    return (value * 180) / Math.PI;\r\n  };\r\n\r\n  var getQuadraticCurveBoundary = function(sx, sy, cpx, cpy, ex, ey) {\r\n    var midX1 = sx + (cpx - sx) * 0.5;\r\n    var midY1 = sy + (cpy - sy) * 0.5;\r\n    var midX2 = ex + (cpx - ex) * 0.5;\r\n    var midY2 = ey + (cpy - ey) * 0.5;\r\n    var resultX1 = Math.min(sx, ex, midX1, midX2);\r\n    var resultX2 = Math.max(sx, ex, midX1, midX2);\r\n    var resultY1 = Math.min(sy, ey, midY1, midY2);\r\n    var resultY2 = Math.max(sy, ey, midY1, midY2);\r\n    return new Rectangle(\r\n      resultX1,\r\n      resultY1,\r\n      resultX2 - resultX1,\r\n      resultY2 - resultY1\r\n    );\r\n  };\r\n\r\n  //De Casteljau algorithm\r\n  var getBezierCurveBoundary = function(ax, ay, bx, by, cx, cy, dx, dy) {\r\n    var tobx = bx - ax;\r\n    var toby = by - ay;\r\n    var tocx = cx - bx;\r\n    var tocy = cy - by;\r\n    var todx = dx - cx;\r\n    var tody = dy - cy;\r\n    var precision = 40;\r\n    var d,\r\n      i,\r\n      px,\r\n      py,\r\n      qx,\r\n      qy,\r\n      rx,\r\n      ry,\r\n      tx,\r\n      ty,\r\n      sx,\r\n      sy,\r\n      x,\r\n      y,\r\n      minx,\r\n      miny,\r\n      maxx,\r\n      maxy,\r\n      toqx,\r\n      toqy,\r\n      torx,\r\n      tory,\r\n      totx,\r\n      toty;\r\n    for (i = 0; i < precision + 1; i++) {\r\n      d = i / precision;\r\n      px = ax + d * tobx;\r\n      py = ay + d * toby;\r\n      qx = bx + d * tocx;\r\n      qy = by + d * tocy;\r\n      rx = cx + d * todx;\r\n      ry = cy + d * tody;\r\n      toqx = qx - px;\r\n      toqy = qy - py;\r\n      torx = rx - qx;\r\n      tory = ry - qy;\r\n\r\n      sx = px + d * toqx;\r\n      sy = py + d * toqy;\r\n      tx = qx + d * torx;\r\n      ty = qy + d * tory;\r\n      totx = tx - sx;\r\n      toty = ty - sy;\r\n\r\n      x = sx + d * totx;\r\n      y = sy + d * toty;\r\n      if (i == 0) {\r\n        minx = x;\r\n        miny = y;\r\n        maxx = x;\r\n        maxy = y;\r\n      } else {\r\n        minx = Math.min(minx, x);\r\n        miny = Math.min(miny, y);\r\n        maxx = Math.max(maxx, x);\r\n        maxy = Math.max(maxy, y);\r\n      }\r\n    }\r\n    return new Rectangle(\r\n      Math.round(minx),\r\n      Math.round(miny),\r\n      Math.round(maxx - minx),\r\n      Math.round(maxy - miny)\r\n    );\r\n  };\r\n\r\n  var getPrevLineDashValue = function(lineDash, lineDashOffset) {\r\n    return JSON.stringify({\r\n      lineDash: lineDash,\r\n      lineDashOffset: lineDashOffset\r\n    });\r\n  };\r\n\r\n  var setLineDash = function() {\r\n    // Avoid unnecessary line dash declarations.\r\n    if (\r\n      !this.prevLineDash &&\r\n      !this.ctx.lineDash.length &&\r\n      !this.ctx.lineDashOffset\r\n    ) {\r\n      return;\r\n    }\r\n\r\n    // Avoid unnecessary line dash declarations.\r\n    const nextLineDash = getPrevLineDashValue(\r\n      this.ctx.lineDash,\r\n      this.ctx.lineDashOffset\r\n    );\r\n    if (this.prevLineDash !== nextLineDash) {\r\n      this.pdf.setLineDash(this.ctx.lineDash, this.ctx.lineDashOffset);\r\n      this.prevLineDash = nextLineDash;\r\n    }\r\n  };\r\n})(jsPDF.API);\r\n","/**\n * @license\n * jsPDF filters PlugIn\n * Copyright (c) 2014 Aras Abbasi\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\nimport { zlibSync } from \"../libs/fflate.js\";\n\n(function(jsPDFAPI) {\n  \"use strict\";\n\n  var ASCII85Encode = function(a) {\n    var b, c, d, e, f, g, h, i, j, k;\n    // eslint-disable-next-line no-control-regex\n    for (\n      !/[^\\x00-\\xFF]/.test(a),\n        b = \"\\x00\\x00\\x00\\x00\".slice(a.length % 4 || 4),\n        a += b,\n        c = [],\n        d = 0,\n        e = a.length;\n      e > d;\n      d += 4\n    )\n      (f =\n        (a.charCodeAt(d) << 24) +\n        (a.charCodeAt(d + 1) << 16) +\n        (a.charCodeAt(d + 2) << 8) +\n        a.charCodeAt(d + 3)),\n        0 !== f\n          ? ((k = f % 85),\n            (f = (f - k) / 85),\n            (j = f % 85),\n            (f = (f - j) / 85),\n            (i = f % 85),\n            (f = (f - i) / 85),\n            (h = f % 85),\n            (f = (f - h) / 85),\n            (g = f % 85),\n            c.push(g + 33, h + 33, i + 33, j + 33, k + 33))\n          : c.push(122);\n    return (\n      (function(a, b) {\n        for (var c = b; c > 0; c--) a.pop();\n      })(c, b.length),\n      String.fromCharCode.apply(String, c) + \"~>\"\n    );\n  };\n\n  var ASCII85Decode = function(a) {\n    var c,\n      d,\n      e,\n      f,\n      g,\n      h = String,\n      l = \"length\",\n      w = 255,\n      x = \"charCodeAt\",\n      y = \"slice\",\n      z = \"replace\";\n    for (\n      \"~>\" === a[y](-2),\n        a = a[y](0, -2)\n          [z](/\\s/g, \"\")\n          [z](\"z\", \"!!!!!\"),\n        c = \"uuuuu\"[y](a[l] % 5 || 5),\n        a += c,\n        e = [],\n        f = 0,\n        g = a[l];\n      g > f;\n      f += 5\n    )\n      (d =\n        52200625 * (a[x](f) - 33) +\n        614125 * (a[x](f + 1) - 33) +\n        7225 * (a[x](f + 2) - 33) +\n        85 * (a[x](f + 3) - 33) +\n        (a[x](f + 4) - 33)),\n        e.push(w & (d >> 24), w & (d >> 16), w & (d >> 8), w & d);\n    return (\n      (function(a, b) {\n        for (var c = b; c > 0; c--) a.pop();\n      })(e, c[l]),\n      h.fromCharCode.apply(h, e)\n    );\n  };\n\n  var ASCIIHexEncode = function(value) {\n    return (\n      value\n        .split(\"\")\n        .map(function(value) {\n          return (\"0\" + value.charCodeAt().toString(16)).slice(-2);\n        })\n        .join(\"\") + \">\"\n    );\n  };\n\n  var ASCIIHexDecode = function(value) {\n    var regexCheckIfHex = new RegExp(/^([0-9A-Fa-f]{2})+$/);\n    value = value.replace(/\\s/g, \"\");\n    if (value.indexOf(\">\") !== -1) {\n      value = value.substr(0, value.indexOf(\">\"));\n    }\n    if (value.length % 2) {\n      value += \"0\";\n    }\n    if (regexCheckIfHex.test(value) === false) {\n      return \"\";\n    }\n    var result = \"\";\n    for (var i = 0; i < value.length; i += 2) {\n      result += String.fromCharCode(\"0x\" + (value[i] + value[i + 1]));\n    }\n    return result;\n  };\n  /*\n  var FlatePredictors = {\n      None: 1,\n      TIFF: 2,\n      PNG_None: 10,\n      PNG_Sub: 11,\n      PNG_Up: 12,\n      PNG_Average: 13,\n      PNG_Paeth: 14,\n      PNG_Optimum: 15\n  };\n  */\n\n  var FlateEncode = function(data) {\n    var arr = new Uint8Array(data.length);\n    var i = data.length;\n    while (i--) {\n      arr[i] = data.charCodeAt(i);\n    }\n    arr = zlibSync(arr);\n    data = arr.reduce(function(data, byte) {\n      return data + String.fromCharCode(byte);\n    }, \"\");\n    return data;\n  };\n\n  jsPDFAPI.processDataByFilters = function(origData, filterChain) {\n    \"use strict\";\n    var i = 0;\n    var data = origData || \"\";\n    var reverseChain = [];\n    filterChain = filterChain || [];\n\n    if (typeof filterChain === \"string\") {\n      filterChain = [filterChain];\n    }\n\n    for (i = 0; i < filterChain.length; i += 1) {\n      switch (filterChain[i]) {\n        case \"ASCII85Decode\":\n        case \"/ASCII85Decode\":\n          data = ASCII85Decode(data);\n          reverseChain.push(\"/ASCII85Encode\");\n          break;\n        case \"ASCII85Encode\":\n        case \"/ASCII85Encode\":\n          data = ASCII85Encode(data);\n          reverseChain.push(\"/ASCII85Decode\");\n          break;\n        case \"ASCIIHexDecode\":\n        case \"/ASCIIHexDecode\":\n          data = ASCIIHexDecode(data);\n          reverseChain.push(\"/ASCIIHexEncode\");\n          break;\n        case \"ASCIIHexEncode\":\n        case \"/ASCIIHexEncode\":\n          data = ASCIIHexEncode(data);\n          reverseChain.push(\"/ASCIIHexDecode\");\n          break;\n        case \"FlateEncode\":\n        case \"/FlateEncode\":\n          data = FlateEncode(data);\n          reverseChain.push(\"/FlateDecode\");\n          break;\n        default:\n          throw new Error(\n            'The filter: \"' + filterChain[i] + '\" is not implemented'\n          );\n      }\n    }\n\n    return { data: data, reverseChain: reverseChain.reverse().join(\" \") };\n  };\n})(jsPDF.API);\n","/**\n * @license\n * jsPDF fileloading PlugIn\n * Copyright (c) 2018 Aras Abbasi (aras.abbasi@gmail.com)\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * @name fileloading\n * @module\n */\n(function(jsPDFAPI) {\n  \"use strict\";\n\n  /**\n   * @name loadFile\n   * @function\n   * @param {string} url\n   * @param {boolean} sync\n   * @param {function} callback\n   * @returns {string|undefined} result\n   */\n  jsPDFAPI.loadFile = function(url, sync, callback) {\n    return browserRequest(url, sync, callback);\n\n  };\n\n  /**\n   * @name loadImageFile\n   * @function\n   * @param {string} path\n   * @param {boolean} sync\n   * @param {function} callback\n   */\n  jsPDFAPI.loadImageFile = jsPDFAPI.loadFile;\n\n  function browserRequest(url, sync, callback) {\n    sync = sync === false ? false : true;\n    callback = typeof callback === \"function\" ? callback : function() {};\n    var result = undefined;\n\n    var xhr = function(url, sync, callback) {\n      var request = new XMLHttpRequest();\n      var i = 0;\n\n      var sanitizeUnicode = function(data) {\n        var dataLength = data.length;\n        var charArray = [];\n        var StringFromCharCode = String.fromCharCode;\n\n        //Transform Unicode to ASCII\n        for (i = 0; i < dataLength; i += 1) {\n          charArray.push(StringFromCharCode(data.charCodeAt(i) & 0xff));\n        }\n        return charArray.join(\"\");\n      };\n\n      request.open(\"GET\", url, !sync);\n      // XHR binary charset opt by Marcus Granado 2006 [http://mgran.blogspot.com]\n      request.overrideMimeType(\"text/plain; charset=x-user-defined\");\n\n      if (sync === false) {\n        request.onload = function() {\n          if (request.status === 200) {\n            callback(sanitizeUnicode(this.responseText));\n          } else {\n            callback(undefined);\n          }\n        };\n      }\n      request.send(null);\n\n      if (sync && request.status === 200) {\n        return sanitizeUnicode(request.responseText);\n      }\n    };\n    try {\n      result = xhr(url, sync, callback);\n      // eslint-disable-next-line no-empty\n    } catch (e) {}\n    return result;\n  }\n\n  function nodeReadFile(url, sync, callback) {\n    sync = sync === false ? false : true;\n    var result = undefined;\n\n    var fs = require(\"fs\");\n    var path = require(\"path\");\n\n    url = path.resolve(url);\n    if (sync) {\n      try {\n        result = fs.readFileSync(url, { encoding: \"latin1\" });\n      } catch (e) {\n        return undefined;\n      }\n    } else {\n      fs.readFile(url, { encoding: \"latin1\" }, function(err, data) {\n        if (!callback) {\n          return;\n        }\n        if (err) {\n          callback(undefined);\n        }\n        callback(data);\n      });\n    }\n\n    return result;\n  }\n})(jsPDF.API);\n","/**\n * @license\n * Copyright (c) 2018 Erik Koopmans\n * Released under the MIT License.\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\nimport { normalizeFontFace } from \"../libs/fontFace.js\";\nimport { globalObject } from \"../libs/globalObject.js\";\n\n/**\n * jsPDF html PlugIn\n *\n * @name html\n * @module\n */\n(function(jsPDFAPI) {\n  \"use strict\";\n\n  function loadHtml2Canvas() {\n    return (function() {\n      if (globalObject[\"html2canvas\"]) {\n        return Promise.resolve(globalObject[\"html2canvas\"]);\n      }\n\n      return import(\"html2canvas\");\n\n    })()\n      .catch(function(e) {\n        return Promise.reject(new Error(\"Could not load html2canvas: \" + e));\n      })\n      .then(function(html2canvas) {\n        return html2canvas.default ? html2canvas.default : html2canvas;\n      });\n  }\n\n  function loadDomPurify() {\n    return (function() {\n      if (globalObject[\"DOMPurify\"]) {\n        return Promise.resolve(globalObject[\"DOMPurify\"]);\n      }\n\n      return import(\"dompurify\");\n\n    })()\n      .catch(function(e) {\n        return Promise.reject(new Error(\"Could not load dompurify: \" + e));\n      })\n      .then(function(dompurify) {\n        return dompurify.default ? dompurify.default : dompurify;\n      });\n  }\n\n  /**\n   * Determine the type of a variable/object.\n   *\n   * @private\n   * @ignore\n   */\n  var objType = function(obj) {\n    var type = typeof obj;\n    if (type === \"undefined\") return \"undefined\";\n    else if (type === \"string\" || obj instanceof String) return \"string\";\n    else if (type === \"number\" || obj instanceof Number) return \"number\";\n    else if (type === \"function\" || obj instanceof Function) return \"function\";\n    else if (!!obj && obj.constructor === Array) return \"array\";\n    else if (obj && obj.nodeType === 1) return \"element\";\n    else if (type === \"object\") return \"object\";\n    else return \"unknown\";\n  };\n\n  /**\n   * Create an HTML element with optional className, innerHTML, and style.\n   *\n   * @private\n   * @ignore\n   */\n  var createElement = function(tagName, opt) {\n    var el = document.createElement(tagName);\n    if (opt.className) el.className = opt.className;\n    if (opt.innerHTML && opt.dompurify) {\n      el.innerHTML = opt.dompurify.sanitize(opt.innerHTML);\n    }\n    for (var key in opt.style) {\n      el.style[key] = opt.style[key];\n    }\n    return el;\n  };\n\n  /**\n   * Deep-clone a node and preserve contents/properties.\n   *\n   * @private\n   * @ignore\n   */\n  var cloneNode = function(node, javascriptEnabled) {\n    // Recursively clone the node.\n    var clone =\n      node.nodeType === 3\n        ? document.createTextNode(node.nodeValue)\n        : node.cloneNode(false);\n    for (var child = node.firstChild; child; child = child.nextSibling) {\n      if (\n        javascriptEnabled === true ||\n        child.nodeType !== 1 ||\n        child.nodeName !== \"SCRIPT\"\n      ) {\n        clone.appendChild(cloneNode(child, javascriptEnabled));\n      }\n    }\n\n    if (node.nodeType === 1) {\n      // Preserve contents/properties of special nodes.\n      if (node.nodeName === \"CANVAS\") {\n        clone.width = node.width;\n        clone.height = node.height;\n        clone.getContext(\"2d\").drawImage(node, 0, 0);\n      } else if (node.nodeName === \"TEXTAREA\" || node.nodeName === \"SELECT\") {\n        clone.value = node.value;\n      }\n\n      // Preserve the node's scroll position when it loads.\n      clone.addEventListener(\n        \"load\",\n        function() {\n          clone.scrollTop = node.scrollTop;\n          clone.scrollLeft = node.scrollLeft;\n        },\n        true\n      );\n    }\n\n    // Return the cloned node.\n    return clone;\n  };\n\n  /* ----- CONSTRUCTOR ----- */\n\n  var Worker = function Worker(opt) {\n    // Create the root parent for the proto chain, and the starting Worker.\n    var root = Object.assign(\n      Worker.convert(Promise.resolve()),\n      JSON.parse(JSON.stringify(Worker.template))\n    );\n    var self = Worker.convert(Promise.resolve(), root);\n\n    // Set progress, optional settings, and return.\n    self = self.setProgress(1, Worker, 1, [Worker]);\n    self = self.set(opt);\n    return self;\n  };\n\n  // Boilerplate for subclassing Promise.\n  Worker.prototype = Object.create(Promise.prototype);\n  Worker.prototype.constructor = Worker;\n\n  // Converts/casts promises into Workers.\n  Worker.convert = function convert(promise, inherit) {\n    // Uses prototypal inheritance to receive changes made to ancestors' properties.\n    promise.__proto__ = inherit || Worker.prototype;\n    return promise;\n  };\n\n  Worker.template = {\n    prop: {\n      src: null,\n      container: null,\n      overlay: null,\n      canvas: null,\n      img: null,\n      pdf: null,\n      pageSize: null,\n      callback: function() {}\n    },\n    progress: {\n      val: 0,\n      state: null,\n      n: 0,\n      stack: []\n    },\n    opt: {\n      filename: \"file.pdf\",\n      margin: [0, 0, 0, 0],\n      enableLinks: true,\n      x: 0,\n      y: 0,\n      html2canvas: {},\n      jsPDF: {},\n      backgroundColor: \"transparent\"\n    }\n  };\n\n  /* ----- FROM / TO ----- */\n\n  Worker.prototype.from = function from(src, type) {\n    function getType(src) {\n      switch (objType(src)) {\n        case \"string\":\n          return \"string\";\n        case \"element\":\n          return src.nodeName.toLowerCase() === \"canvas\" ? \"canvas\" : \"element\";\n        default:\n          return \"unknown\";\n      }\n    }\n\n    return this.then(function from_main() {\n      type = type || getType(src);\n      switch (type) {\n        case \"string\":\n          return this.then(loadDomPurify).then(function(dompurify) {\n            return this.set({\n              src: createElement(\"div\", {\n                innerHTML: src,\n                dompurify: dompurify\n              })\n            });\n          });\n        case \"element\":\n          return this.set({ src: src });\n        case \"canvas\":\n          return this.set({ canvas: src });\n        case \"img\":\n          return this.set({ img: src });\n        default:\n          return this.error(\"Unknown source type.\");\n      }\n    });\n  };\n\n  Worker.prototype.to = function to(target) {\n    // Route the 'to' request to the appropriate method.\n    switch (target) {\n      case \"container\":\n        return this.toContainer();\n      case \"canvas\":\n        return this.toCanvas();\n      case \"img\":\n        return this.toImg();\n      case \"pdf\":\n        return this.toPdf();\n      default:\n        return this.error(\"Invalid target.\");\n    }\n  };\n\n  Worker.prototype.toContainer = function toContainer() {\n    // Set up function prerequisites.\n    var prereqs = [\n      function checkSrc() {\n        return (\n          this.prop.src || this.error(\"Cannot duplicate - no source HTML.\")\n        );\n      },\n      function checkPageSize() {\n        return this.prop.pageSize || this.setPageSize();\n      }\n    ];\n    return this.thenList(prereqs).then(function toContainer_main() {\n      // Define the CSS styles for the container and its overlay parent.\n      var overlayCSS = {\n        position: \"fixed\",\n        overflow: \"hidden\",\n        zIndex: 1000,\n        left: \"-100000px\",\n        right: 0,\n        bottom: 0,\n        top: 0\n      };\n      var containerCSS = {\n        position: \"relative\",\n        display: \"inline-block\",\n        width:\n          (typeof this.opt.width === \"number\" &&\n          !isNaN(this.opt.width) &&\n          typeof this.opt.windowWidth === \"number\" &&\n          !isNaN(this.opt.windowWidth)\n            ? this.opt.windowWidth\n            : Math.max(\n                this.prop.src.clientWidth,\n                this.prop.src.scrollWidth,\n                this.prop.src.offsetWidth\n              )) + \"px\",\n        left: 0,\n        right: 0,\n        top: 0,\n        margin: \"auto\",\n        backgroundColor: this.opt.backgroundColor\n      }; // Set the overlay to hidden (could be changed in the future to provide a print preview).\n\n      var source = cloneNode(\n        this.prop.src,\n        this.opt.html2canvas.javascriptEnabled\n      );\n\n      if (source.tagName === \"BODY\") {\n        containerCSS.height =\n          Math.max(\n            document.body.scrollHeight,\n            document.body.offsetHeight,\n            document.documentElement.clientHeight,\n            document.documentElement.scrollHeight,\n            document.documentElement.offsetHeight\n          ) + \"px\";\n      }\n\n      this.prop.overlay = createElement(\"div\", {\n        className: \"html2pdf__overlay\",\n        style: overlayCSS\n      });\n      this.prop.container = createElement(\"div\", {\n        className: \"html2pdf__container\",\n        style: containerCSS\n      });\n      this.prop.container.appendChild(source);\n      this.prop.container.firstChild.appendChild(\n        createElement(\"div\", {\n          style: {\n            clear: \"both\",\n            border: \"0 none transparent\",\n            margin: 0,\n            padding: 0,\n            height: 0\n          }\n        })\n      );\n      this.prop.container.style.float = \"none\";\n      this.prop.overlay.appendChild(this.prop.container);\n      document.body.appendChild(this.prop.overlay);\n      this.prop.container.firstChild.style.position = \"relative\";\n      this.prop.container.height =\n        Math.max(\n          this.prop.container.firstChild.clientHeight,\n          this.prop.container.firstChild.scrollHeight,\n          this.prop.container.firstChild.offsetHeight\n        ) + \"px\";\n    });\n  };\n\n  Worker.prototype.toCanvas = function toCanvas() {\n    // Set up function prerequisites.\n    var prereqs = [\n      function checkContainer() {\n        return (\n          document.body.contains(this.prop.container) || this.toContainer()\n        );\n      }\n    ];\n\n    // Fulfill prereqs then create the canvas.\n    return this.thenList(prereqs)\n      .then(loadHtml2Canvas)\n      .then(function toCanvas_main(html2canvas) {\n        // Handle old-fashioned 'onrendered' argument.\n        var options = Object.assign({}, this.opt.html2canvas);\n        delete options.onrendered;\n\n        return html2canvas(this.prop.container, options);\n      })\n      .then(function toCanvas_post(canvas) {\n        // Handle old-fashioned 'onrendered' argument.\n        var onRendered = this.opt.html2canvas.onrendered || function() {};\n        onRendered(canvas);\n\n        this.prop.canvas = canvas;\n        document.body.removeChild(this.prop.overlay);\n      });\n  };\n\n  Worker.prototype.toContext2d = function toContext2d() {\n    // Set up function prerequisites.\n    var prereqs = [\n      function checkContainer() {\n        return (\n          document.body.contains(this.prop.container) || this.toContainer()\n        );\n      }\n    ];\n\n    // Fulfill prereqs then create the canvas.\n    return this.thenList(prereqs)\n      .then(loadHtml2Canvas)\n      .then(function toContext2d_main(html2canvas) {\n        // Handle old-fashioned 'onrendered' argument.\n\n        var pdf = this.opt.jsPDF;\n        var fontFaces = this.opt.fontFaces;\n\n        var scale =\n          typeof this.opt.width === \"number\" &&\n          !isNaN(this.opt.width) &&\n          typeof this.opt.windowWidth === \"number\" &&\n          !isNaN(this.opt.windowWidth)\n            ? this.opt.width / this.opt.windowWidth\n            : 1;\n\n        var options = Object.assign(\n          {\n            async: true,\n            allowTaint: true,\n            scale: scale,\n            scrollX: this.opt.scrollX || 0,\n            scrollY: this.opt.scrollY || 0,\n            backgroundColor: \"#ffffff\",\n            imageTimeout: 15000,\n            logging: true,\n            proxy: null,\n            removeContainer: true,\n            foreignObjectRendering: false,\n            useCORS: false\n          },\n          this.opt.html2canvas\n        );\n        delete options.onrendered;\n\n        pdf.context2d.autoPaging =\n          typeof this.opt.autoPaging === \"undefined\"\n            ? true\n            : this.opt.autoPaging;\n        pdf.context2d.posX = this.opt.x;\n        pdf.context2d.posY = this.opt.y;\n        pdf.context2d.margin = this.opt.margin;\n        pdf.context2d.fontFaces = fontFaces;\n\n        if (fontFaces) {\n          for (var i = 0; i < fontFaces.length; ++i) {\n            var font = fontFaces[i];\n            var src = font.src.find(function(src) {\n              return src.format === \"truetype\";\n            });\n\n            if (src) {\n              pdf.addFont(src.url, font.ref.name, font.ref.style);\n            }\n          }\n        }\n\n        options.windowHeight = options.windowHeight || 0;\n        options.windowHeight =\n          options.windowHeight == 0\n            ? Math.max(\n                this.prop.container.clientHeight,\n                this.prop.container.scrollHeight,\n                this.prop.container.offsetHeight\n              )\n            : options.windowHeight;\n\n        pdf.context2d.save(true);\n        return html2canvas(this.prop.container, options);\n      })\n      .then(function toContext2d_post(canvas) {\n        this.opt.jsPDF.context2d.restore(true);\n\n        // Handle old-fashioned 'onrendered' argument.\n        var onRendered = this.opt.html2canvas.onrendered || function() {};\n        onRendered(canvas);\n\n        this.prop.canvas = canvas;\n        document.body.removeChild(this.prop.overlay);\n      });\n  };\n\n  Worker.prototype.toImg = function toImg() {\n    // Set up function prerequisites.\n    var prereqs = [\n      function checkCanvas() {\n        return this.prop.canvas || this.toCanvas();\n      }\n    ];\n\n    // Fulfill prereqs then create the image.\n    return this.thenList(prereqs).then(function toImg_main() {\n      var imgData = this.prop.canvas.toDataURL(\n        \"image/\" + this.opt.image.type,\n        this.opt.image.quality\n      );\n      this.prop.img = document.createElement(\"img\");\n      this.prop.img.src = imgData;\n    });\n  };\n\n  Worker.prototype.toPdf = function toPdf() {\n    // Set up function prerequisites.\n    var prereqs = [\n      function checkContext2d() {\n        return this.toContext2d();\n      }\n      //function checkCanvas() { return this.prop.canvas || this.toCanvas(); }\n    ];\n\n    // Fulfill prereqs then create the image.\n    return this.thenList(prereqs).then(function toPdf_main() {\n      // Create local copies of frequently used properties.\n      this.prop.pdf = this.prop.pdf || this.opt.jsPDF;\n    });\n  };\n\n  /* ----- OUTPUT / SAVE ----- */\n\n  Worker.prototype.output = function output(type, options, src) {\n    // Redirect requests to the correct function (outputPdf / outputImg).\n    src = src || \"pdf\";\n    if (src.toLowerCase() === \"img\" || src.toLowerCase() === \"image\") {\n      return this.outputImg(type, options);\n    } else {\n      return this.outputPdf(type, options);\n    }\n  };\n\n  Worker.prototype.outputPdf = function outputPdf(type, options) {\n    // Set up function prerequisites.\n    var prereqs = [\n      function checkPdf() {\n        return this.prop.pdf || this.toPdf();\n      }\n    ];\n\n    // Fulfill prereqs then perform the appropriate output.\n    return this.thenList(prereqs).then(function outputPdf_main() {\n      /* Currently implemented output types:\n       *    https://rawgit.com/MrRio/jsPDF/master/docs/jspdf.js.html#line992\n       *  save(options), arraybuffer, blob, bloburi/bloburl,\n       *  datauristring/dataurlstring, dataurlnewwindow, datauri/dataurl\n       */\n      return this.prop.pdf.output(type, options);\n    });\n  };\n\n  Worker.prototype.outputImg = function outputImg(type) {\n    // Set up function prerequisites.\n    var prereqs = [\n      function checkImg() {\n        return this.prop.img || this.toImg();\n      }\n    ];\n\n    // Fulfill prereqs then perform the appropriate output.\n    return this.thenList(prereqs).then(function outputImg_main() {\n      switch (type) {\n        case undefined:\n        case \"img\":\n          return this.prop.img;\n        case \"datauristring\":\n        case \"dataurlstring\":\n          return this.prop.img.src;\n        case \"datauri\":\n        case \"dataurl\":\n          return (document.location.href = this.prop.img.src);\n        default:\n          throw 'Image output type \"' + type + '\" is not supported.';\n      }\n    });\n  };\n\n  Worker.prototype.save = function save(filename) {\n    // Set up function prerequisites.\n    var prereqs = [\n      function checkPdf() {\n        return this.prop.pdf || this.toPdf();\n      }\n    ];\n\n    // Fulfill prereqs, update the filename (if provided), and save the PDF.\n    return this.thenList(prereqs)\n      .set(filename ? { filename: filename } : null)\n      .then(function save_main() {\n        this.prop.pdf.save(this.opt.filename);\n      });\n  };\n\n  Worker.prototype.doCallback = function doCallback() {\n    // Set up function prerequisites.\n    var prereqs = [\n      function checkPdf() {\n        return this.prop.pdf || this.toPdf();\n      }\n    ];\n\n    // Fulfill prereqs, update the filename (if provided), and save the PDF.\n    return this.thenList(prereqs).then(function doCallback_main() {\n      this.prop.callback(this.prop.pdf);\n    });\n  };\n\n  /* ----- SET / GET ----- */\n\n  Worker.prototype.set = function set(opt) {\n    // TODO: Implement ordered pairs?\n\n    // Silently ignore invalid or empty input.\n    if (objType(opt) !== \"object\") {\n      return this;\n    }\n\n    // Build an array of setter functions to queue.\n    var fns = Object.keys(opt || {}).map(function(key) {\n      if (key in Worker.template.prop) {\n        // Set pre-defined properties.\n        return function set_prop() {\n          this.prop[key] = opt[key];\n        };\n      } else {\n        switch (key) {\n          case \"margin\":\n            return this.setMargin.bind(this, opt.margin);\n          case \"jsPDF\":\n            return function set_jsPDF() {\n              this.opt.jsPDF = opt.jsPDF;\n              return this.setPageSize();\n            };\n          case \"pageSize\":\n            return this.setPageSize.bind(this, opt.pageSize);\n          default:\n            // Set any other properties in opt.\n            return function set_opt() {\n              this.opt[key] = opt[key];\n            };\n        }\n      }\n    }, this);\n\n    // Set properties within the promise chain.\n    return this.then(function set_main() {\n      return this.thenList(fns);\n    });\n  };\n\n  Worker.prototype.get = function get(key, cbk) {\n    return this.then(function get_main() {\n      // Fetch the requested property, either as a predefined prop or in opt.\n      var val = key in Worker.template.prop ? this.prop[key] : this.opt[key];\n      return cbk ? cbk(val) : val;\n    });\n  };\n\n  Worker.prototype.setMargin = function setMargin(margin) {\n    return this.then(function setMargin_main() {\n      // Parse the margin property.\n      switch (objType(margin)) {\n        case \"number\":\n          margin = [margin, margin, margin, margin];\n        // eslint-disable-next-line no-fallthrough\n        case \"array\":\n          if (margin.length === 2) {\n            margin = [margin[0], margin[1], margin[0], margin[1]];\n          }\n          if (margin.length === 4) {\n            break;\n          }\n        // eslint-disable-next-line no-fallthrough\n        default:\n          return this.error(\"Invalid margin array.\");\n      }\n\n      // Set the margin property, then update pageSize.\n      this.opt.margin = margin;\n    }).then(this.setPageSize);\n  };\n\n  Worker.prototype.setPageSize = function setPageSize(pageSize) {\n    function toPx(val, k) {\n      return Math.floor(((val * k) / 72) * 96);\n    }\n\n    return this.then(function setPageSize_main() {\n      // Retrieve page-size based on jsPDF settings, if not explicitly provided.\n      pageSize = pageSize || jsPDF.getPageSize(this.opt.jsPDF);\n\n      // Add 'inner' field if not present.\n      if (!pageSize.hasOwnProperty(\"inner\")) {\n        pageSize.inner = {\n          width: pageSize.width - this.opt.margin[1] - this.opt.margin[3],\n          height: pageSize.height - this.opt.margin[0] - this.opt.margin[2]\n        };\n        pageSize.inner.px = {\n          width: toPx(pageSize.inner.width, pageSize.k),\n          height: toPx(pageSize.inner.height, pageSize.k)\n        };\n        pageSize.inner.ratio = pageSize.inner.height / pageSize.inner.width;\n      }\n\n      // Attach pageSize to this.\n      this.prop.pageSize = pageSize;\n    });\n  };\n\n  Worker.prototype.setProgress = function setProgress(val, state, n, stack) {\n    // Immediately update all progress values.\n    if (val != null) this.progress.val = val;\n    if (state != null) this.progress.state = state;\n    if (n != null) this.progress.n = n;\n    if (stack != null) this.progress.stack = stack;\n    this.progress.ratio = this.progress.val / this.progress.state;\n\n    // Return this for command chaining.\n    return this;\n  };\n\n  Worker.prototype.updateProgress = function updateProgress(\n    val,\n    state,\n    n,\n    stack\n  ) {\n    // Immediately update all progress values, using setProgress.\n    return this.setProgress(\n      val ? this.progress.val + val : null,\n      state ? state : null,\n      n ? this.progress.n + n : null,\n      stack ? this.progress.stack.concat(stack) : null\n    );\n  };\n\n  /* ----- PROMISE MAPPING ----- */\n\n  Worker.prototype.then = function then(onFulfilled, onRejected) {\n    // Wrap `this` for encapsulation.\n    var self = this;\n\n    return this.thenCore(onFulfilled, onRejected, function then_main(\n      onFulfilled,\n      onRejected\n    ) {\n      // Update progress while queuing, calling, and resolving `then`.\n      self.updateProgress(null, null, 1, [onFulfilled]);\n      return Promise.prototype.then\n        .call(this, function then_pre(val) {\n          self.updateProgress(null, onFulfilled);\n          return val;\n        })\n        .then(onFulfilled, onRejected)\n        .then(function then_post(val) {\n          self.updateProgress(1);\n          return val;\n        });\n    });\n  };\n\n  Worker.prototype.thenCore = function thenCore(\n    onFulfilled,\n    onRejected,\n    thenBase\n  ) {\n    // Handle optional thenBase parameter.\n    thenBase = thenBase || Promise.prototype.then;\n\n    // Wrap `this` for encapsulation and bind it to the promise handlers.\n    var self = this;\n    if (onFulfilled) {\n      onFulfilled = onFulfilled.bind(self);\n    }\n    if (onRejected) {\n      onRejected = onRejected.bind(self);\n    }\n\n    // Cast self into a Promise to avoid polyfills recursively defining `then`.\n    var isNative =\n      Promise.toString().indexOf(\"[native code]\") !== -1 &&\n      Promise.name === \"Promise\";\n    var selfPromise = isNative\n      ? self\n      : Worker.convert(Object.assign({}, self), Promise.prototype);\n\n    // Return the promise, after casting it into a Worker and preserving props.\n    var returnVal = thenBase.call(selfPromise, onFulfilled, onRejected);\n    return Worker.convert(returnVal, self.__proto__);\n  };\n\n  Worker.prototype.thenExternal = function thenExternal(\n    onFulfilled,\n    onRejected\n  ) {\n    // Call `then` and return a standard promise (exits the Worker chain).\n    return Promise.prototype.then.call(this, onFulfilled, onRejected);\n  };\n\n  Worker.prototype.thenList = function thenList(fns) {\n    // Queue a series of promise 'factories' into the promise chain.\n    var self = this;\n    fns.forEach(function thenList_forEach(fn) {\n      self = self.thenCore(fn);\n    });\n    return self;\n  };\n\n  Worker.prototype[\"catch\"] = function(onRejected) {\n    // Bind `this` to the promise handler, call `catch`, and return a Worker.\n    if (onRejected) {\n      onRejected = onRejected.bind(this);\n    }\n    var returnVal = Promise.prototype[\"catch\"].call(this, onRejected);\n    return Worker.convert(returnVal, this);\n  };\n\n  Worker.prototype.catchExternal = function catchExternal(onRejected) {\n    // Call `catch` and return a standard promise (exits the Worker chain).\n    return Promise.prototype[\"catch\"].call(this, onRejected);\n  };\n\n  Worker.prototype.error = function error(msg) {\n    // Throw the error in the Promise chain.\n    return this.then(function error_main() {\n      throw new Error(msg);\n    });\n  };\n\n  /* ----- ALIASES ----- */\n\n  Worker.prototype.using = Worker.prototype.set;\n  Worker.prototype.saveAs = Worker.prototype.save;\n  Worker.prototype.export = Worker.prototype.output;\n  Worker.prototype.run = Worker.prototype.then;\n\n  // Get dimensions of a PDF page, as determined by jsPDF.\n  jsPDF.getPageSize = function(orientation, unit, format) {\n    // Decode options object\n    if (typeof orientation === \"object\") {\n      var options = orientation;\n      orientation = options.orientation;\n      unit = options.unit || unit;\n      format = options.format || format;\n    }\n\n    // Default options\n    unit = unit || \"mm\";\n    format = format || \"a4\";\n    orientation = (\"\" + (orientation || \"P\")).toLowerCase();\n    var format_as_string = (\"\" + format).toLowerCase();\n\n    // Size in pt of various paper formats\n    var pageFormats = {\n      a0: [2383.94, 3370.39],\n      a1: [1683.78, 2383.94],\n      a2: [1190.55, 1683.78],\n      a3: [841.89, 1190.55],\n      a4: [595.28, 841.89],\n      a5: [419.53, 595.28],\n      a6: [297.64, 419.53],\n      a7: [209.76, 297.64],\n      a8: [147.4, 209.76],\n      a9: [104.88, 147.4],\n      a10: [73.7, 104.88],\n      b0: [2834.65, 4008.19],\n      b1: [2004.09, 2834.65],\n      b2: [1417.32, 2004.09],\n      b3: [1000.63, 1417.32],\n      b4: [708.66, 1000.63],\n      b5: [498.9, 708.66],\n      b6: [354.33, 498.9],\n      b7: [249.45, 354.33],\n      b8: [175.75, 249.45],\n      b9: [124.72, 175.75],\n      b10: [87.87, 124.72],\n      c0: [2599.37, 3676.54],\n      c1: [1836.85, 2599.37],\n      c2: [1298.27, 1836.85],\n      c3: [918.43, 1298.27],\n      c4: [649.13, 918.43],\n      c5: [459.21, 649.13],\n      c6: [323.15, 459.21],\n      c7: [229.61, 323.15],\n      c8: [161.57, 229.61],\n      c9: [113.39, 161.57],\n      c10: [79.37, 113.39],\n      dl: [311.81, 623.62],\n      letter: [612, 792],\n      \"government-letter\": [576, 756],\n      legal: [612, 1008],\n      \"junior-legal\": [576, 360],\n      ledger: [1224, 792],\n      tabloid: [792, 1224],\n      \"credit-card\": [153, 243]\n    };\n\n    var k;\n    // Unit conversion\n    switch (unit) {\n      case \"pt\":\n        k = 1;\n        break;\n      case \"mm\":\n        k = 72 / 25.4;\n        break;\n      case \"cm\":\n        k = 72 / 2.54;\n        break;\n      case \"in\":\n        k = 72;\n        break;\n      case \"px\":\n        k = 72 / 96;\n        break;\n      case \"pc\":\n        k = 12;\n        break;\n      case \"em\":\n        k = 12;\n        break;\n      case \"ex\":\n        k = 6;\n        break;\n      default:\n        throw \"Invalid unit: \" + unit;\n    }\n    var pageHeight = 0;\n    var pageWidth = 0;\n\n    // Dimensions are stored as user units and converted to points on output\n    if (pageFormats.hasOwnProperty(format_as_string)) {\n      pageHeight = pageFormats[format_as_string][1] / k;\n      pageWidth = pageFormats[format_as_string][0] / k;\n    } else {\n      try {\n        pageHeight = format[1];\n        pageWidth = format[0];\n      } catch (err) {\n        throw new Error(\"Invalid format: \" + format);\n      }\n    }\n\n    var tmp;\n    // Handle page orientation\n    if (orientation === \"p\" || orientation === \"portrait\") {\n      orientation = \"p\";\n      if (pageWidth > pageHeight) {\n        tmp = pageWidth;\n        pageWidth = pageHeight;\n        pageHeight = tmp;\n      }\n    } else if (orientation === \"l\" || orientation === \"landscape\") {\n      orientation = \"l\";\n      if (pageHeight > pageWidth) {\n        tmp = pageWidth;\n        pageWidth = pageHeight;\n        pageHeight = tmp;\n      }\n    } else {\n      throw \"Invalid orientation: \" + orientation;\n    }\n\n    // Return information (k is the unit conversion ratio from pts)\n    var info = {\n      width: pageWidth,\n      height: pageHeight,\n      unit: unit,\n      k: k,\n      orientation: orientation\n    };\n    return info;\n  };\n\n  /**\n   * @typedef FontFace\n   *\n   * The font-face type implements an interface similar to that of the font-face CSS rule,\n   * and is used by jsPDF to match fonts when the font property of CanvasRenderingContext2D\n   * is updated.\n   *\n   * All properties expect values similar to those in the font-face CSS rule. A difference\n   * is the font-family, which do not need to be enclosed in double-quotes when containing\n   * spaces like in CSS.\n   *\n   * @property {string} family The name of the font-family.\n   * @property {string|undefined} style The style that this font-face defines, e.g. 'italic'.\n   * @property {string|number|undefined} weight The weight of the font, either as a string or a number (400, 500, 600, e.g.)\n   * @property {string|undefined} stretch The stretch of the font, e.g. condensed, normal, expanded.\n   * @property {Object[]} src A list of URLs from where fonts of various formats can be fetched.\n   * @property {string} [src] url A URL to a font of a specific format.\n   * @property {string} [src] format Format of the font referenced by the URL.\n   */\n\n  /**\n   * Generate a PDF from an HTML element or string using.\n   *\n   * @name html\n   * @function\n   * @param {HTMLElement|string} source The source HTMLElement or a string containing HTML.\n   * @param {Object} [options] Collection of settings\n   * @param {function} [options.callback] The mandatory callback-function gets as first parameter the current jsPDF instance\n   * @param {(number|number[])=} [options.margin] Page margins [top, right, bottom, left]. Default is 0.\n   * @param {(boolean|'slice'|'text')=} [options.autoPaging] The auto paging mode.\n   * <ul>\n   * <li>\n   *   <code>false</code>: Auto paging is disabled.\n   * </li>\n   * <li>\n   *   <code>true</code> or <code>'slice'</code>: Will cut shapes or text chunks across page breaks. Will possibly\n   *   slice text in half, making it difficult to read.\n   * </li>\n   * <li>\n   *   <code>'text'</code>: Trys not to cut text in half across page breaks. Works best for documents consisting\n   *   mostly of a single column of text.\n   * </li>\n   * </ul>\n   * Default is <code>true</code>.\n   * @param {string} [options.filename] name of the file\n   * @param {HTMLOptionImage} [options.image] image settings when converting HTML to image\n   * @param {Html2CanvasOptions} [options.html2canvas] html2canvas options\n   * @param {FontFace[]} [options.fontFaces] A list of font-faces to match when resolving fonts. Fonts will be added to the PDF based on the specified URL. If omitted, the font match algorithm falls back to old algorithm.\n   * @param {jsPDF} [options.jsPDF] jsPDF instance\n   * @param {number=} [options.x] x position on the PDF document in jsPDF units.\n   * @param {number=} [options.y] y position on the PDF document in jsPDF units.\n   * @param {number=} [options.width] The target width in the PDF document in jsPDF units. The rendered element will be\n   * scaled such that it fits into the specified width. Has no effect if either the <code>html2canvas.scale<code> is\n   * specified or the <code>windowWidth</code> option is NOT specified.\n   * @param {number=} [options.windowWidth] The window width in CSS pixels. In contrast to the\n   * <code>html2canvas.windowWidth</code> option, this option affects the actual container size while rendering and\n   * does NOT affect CSS media queries. This option only has an effect, if the <code>width<code> option is also specified.\n   *\n   * @example\n   * var doc = new jsPDF();\n   *\n   * doc.html(document.body, {\n   *    callback: function (doc) {\n   *      doc.save();\n   *    },\n   *    x: 10,\n   *    y: 10\n   * });\n   */\n  jsPDFAPI.html = function(src, options) {\n    \"use strict\";\n\n    options = options || {};\n    options.callback = options.callback || function() {};\n    options.html2canvas = options.html2canvas || {};\n    options.html2canvas.canvas = options.html2canvas.canvas || this.canvas;\n    options.jsPDF = options.jsPDF || this;\n    options.fontFaces = options.fontFaces\n      ? options.fontFaces.map(normalizeFontFace)\n      : null;\n\n    // Create a new worker with the given options.\n    var worker = new Worker(options);\n\n    if (!options.worker) {\n      // If worker is not set to true, perform the traditional 'simple' operation.\n      return worker.from(src).doCallback();\n    } else {\n      // Otherwise, return the worker for new Promise-based operation.\n      return worker;\n    }\n  };\n})(jsPDF.API);\n","/**\n * @license\n * Copyright (c) 2014 Steven Spungin (TwelveTone LLC)  steven@twelvetone.tv\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * jsPDF Outline PlugIn\n *\n * Generates a PDF Outline\n * @name outline\n * @module\n */\n(function(jsPDFAPI) {\n  \"use strict\";\n\n  var namesOid;\n  //var destsGoto = [];\n\n  jsPDFAPI.events.push([\n    \"postPutResources\",\n    function() {\n      var pdf = this;\n      var rx = /^(\\d+) 0 obj$/;\n\n      // Write action goto objects for each page\n      // this.outline.destsGoto = [];\n      // for (var i = 0; i < totalPages; i++) {\n      // var id = pdf.internal.newObject();\n      // this.outline.destsGoto.push(id);\n      // pdf.internal.write(\"<</D[\" + (i * 2 + 3) + \" 0 R /XYZ null\n      // null null]/S/GoTo>> endobj\");\n      // }\n      //\n      // for (var i = 0; i < dests.length; i++) {\n      // pdf.internal.write(\"(page_\" + (i + 1) + \")\" + dests[i] + \" 0\n      // R\");\n      // }\n      //\n      if (this.outline.root.children.length > 0) {\n        var lines = pdf.outline.render().split(/\\r\\n/);\n        for (var i = 0; i < lines.length; i++) {\n          var line = lines[i];\n          var m = rx.exec(line);\n          if (m != null) {\n            var oid = m[1];\n            pdf.internal.newObjectDeferredBegin(oid, false);\n          }\n          pdf.internal.write(line);\n        }\n      }\n\n      // This code will write named destination for each page reference\n      // (page_1, etc)\n      if (this.outline.createNamedDestinations) {\n        var totalPages = this.internal.pages.length;\n        // WARNING: this assumes jsPDF starts on page 3 and pageIDs\n        // follow 5, 7, 9, etc\n        // Write destination objects for each page\n        var dests = [];\n        for (var i = 0; i < totalPages; i++) {\n          var id = pdf.internal.newObject();\n          dests.push(id);\n          var info = pdf.internal.getPageInfo(i + 1);\n          pdf.internal.write(\n            \"<< /D[\" + info.objId + \" 0 R /XYZ null null null]>> endobj\"\n          );\n        }\n\n        // assign a name for each destination\n        var names2Oid = pdf.internal.newObject();\n        pdf.internal.write(\"<< /Names [ \");\n        for (var i = 0; i < dests.length; i++) {\n          pdf.internal.write(\"(page_\" + (i + 1) + \")\" + dests[i] + \" 0 R\");\n        }\n        pdf.internal.write(\" ] >>\", \"endobj\");\n\n        // var kids = pdf.internal.newObject();\n        // pdf.internal.write('<< /Kids [ ' + names2Oid + ' 0 R');\n        // pdf.internal.write(' ] >>', 'endobj');\n\n        namesOid = pdf.internal.newObject();\n        pdf.internal.write(\"<< /Dests \" + names2Oid + \" 0 R\");\n        pdf.internal.write(\">>\", \"endobj\");\n      }\n    }\n  ]);\n\n  jsPDFAPI.events.push([\n    \"putCatalog\",\n    function() {\n      var pdf = this;\n      if (pdf.outline.root.children.length > 0) {\n        pdf.internal.write(\n          \"/Outlines\",\n          this.outline.makeRef(this.outline.root)\n        );\n        if (this.outline.createNamedDestinations) {\n          pdf.internal.write(\"/Names \" + namesOid + \" 0 R\");\n        }\n        // Open with Bookmarks showing\n        // pdf.internal.write(\"/PageMode /UseOutlines\");\n      }\n    }\n  ]);\n\n  jsPDFAPI.events.push([\n    \"initialized\",\n    function() {\n      var pdf = this;\n\n      pdf.outline = {\n        createNamedDestinations: false,\n        root: {\n          children: []\n        }\n      };\n\n      /**\n       * Options: pageNumber\n       */\n      pdf.outline.add = function(parent, title, options) {\n        var item = {\n          title: title,\n          options: options,\n          children: []\n        };\n        if (parent == null) {\n          parent = this.root;\n        }\n        parent.children.push(item);\n        return item;\n      };\n\n      pdf.outline.render = function() {\n        this.ctx = {};\n        this.ctx.val = \"\";\n        this.ctx.pdf = pdf;\n\n        this.genIds_r(this.root);\n        this.renderRoot(this.root);\n        this.renderItems(this.root);\n\n        return this.ctx.val;\n      };\n\n      pdf.outline.genIds_r = function(node) {\n        node.id = pdf.internal.newObjectDeferred();\n        for (var i = 0; i < node.children.length; i++) {\n          this.genIds_r(node.children[i]);\n        }\n      };\n\n      pdf.outline.renderRoot = function(node) {\n        this.objStart(node);\n        this.line(\"/Type /Outlines\");\n        if (node.children.length > 0) {\n          this.line(\"/First \" + this.makeRef(node.children[0]));\n          this.line(\n            \"/Last \" + this.makeRef(node.children[node.children.length - 1])\n          );\n        }\n        this.line(\n          \"/Count \" +\n            this.count_r(\n              {\n                count: 0\n              },\n              node\n            )\n        );\n        this.objEnd();\n      };\n\n      pdf.outline.renderItems = function(node) {\n        var getVerticalCoordinateString = this.ctx.pdf.internal\n          .getVerticalCoordinateString;\n        for (var i = 0; i < node.children.length; i++) {\n          var item = node.children[i];\n          this.objStart(item);\n\n          this.line(\"/Title \" + this.makeString(item.title));\n\n          this.line(\"/Parent \" + this.makeRef(node));\n          if (i > 0) {\n            this.line(\"/Prev \" + this.makeRef(node.children[i - 1]));\n          }\n          if (i < node.children.length - 1) {\n            this.line(\"/Next \" + this.makeRef(node.children[i + 1]));\n          }\n          if (item.children.length > 0) {\n            this.line(\"/First \" + this.makeRef(item.children[0]));\n            this.line(\n              \"/Last \" + this.makeRef(item.children[item.children.length - 1])\n            );\n          }\n\n          var count = (this.count = this.count_r(\n            {\n              count: 0\n            },\n            item\n          ));\n          if (count > 0) {\n            this.line(\"/Count \" + count);\n          }\n\n          if (item.options) {\n            if (item.options.pageNumber) {\n              // Explicit Destination\n              //WARNING this assumes page ids are 3,5,7, etc.\n              var info = pdf.internal.getPageInfo(item.options.pageNumber);\n              this.line(\n                \"/Dest \" +\n                  \"[\" +\n                  info.objId +\n                  \" 0 R /XYZ 0 \" +\n                  getVerticalCoordinateString(0) +\n                  \" 0]\"\n              );\n              // this line does not work on all clients (pageNumber instead of page ref)\n              //this.line('/Dest ' + '[' + (item.options.pageNumber - 1) + ' /XYZ 0 ' + this.ctx.pdf.internal.pageSize.getHeight() + ' 0]');\n\n              // Named Destination\n              // this.line('/Dest (page_' + (item.options.pageNumber) + ')');\n\n              // Action Destination\n              // var id = pdf.internal.newObject();\n              // pdf.internal.write('<</D[' + (item.options.pageNumber - 1) + ' /XYZ null null null]/S/GoTo>> endobj');\n              // this.line('/A ' + id + ' 0 R' );\n            }\n          }\n          this.objEnd();\n        }\n        for (var z = 0; z < node.children.length; z++) {\n          this.renderItems(node.children[z]);\n        }\n      };\n\n      pdf.outline.line = function(text) {\n        this.ctx.val += text + \"\\r\\n\";\n      };\n\n      pdf.outline.makeRef = function(node) {\n        return node.id + \" 0 R\";\n      };\n\n      pdf.outline.makeString = function(val) {\n        return \"(\" + pdf.internal.pdfEscape(val) + \")\";\n      };\n\n      pdf.outline.objStart = function(node) {\n        this.ctx.val += \"\\r\\n\" + node.id + \" 0 obj\" + \"\\r\\n<<\\r\\n\";\n      };\n\n      pdf.outline.objEnd = function() {\n        this.ctx.val += \">> \\r\\n\" + \"endobj\" + \"\\r\\n\";\n      };\n\n      pdf.outline.count_r = function(ctx, node) {\n        for (var i = 0; i < node.children.length; i++) {\n          ctx.count++;\n          this.count_r(ctx, node.children[i]);\n        }\n        return ctx.count;\n      };\n    }\n  ]);\n\n  return this;\n})(jsPDF.API);\n","/**\n * @license\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * jsPDF jpeg Support PlugIn\n *\n * @name jpeg_support\n * @module\n */\n(function(jsPDFAPI) {\n  \"use strict\";\n\n  /**\n   * 0xc0 (SOF) Huffman  - Baseline DCT\n   * 0xc1 (SOF) Huffman  - Extended sequential DCT\n   * 0xc2 Progressive DCT (SOF2)\n   * 0xc3 Spatial (sequential) lossless (SOF3)\n   * 0xc4 Differential sequential DCT (SOF5)\n   * 0xc5 Differential progressive DCT (SOF6)\n   * 0xc6 Differential spatial (SOF7)\n   * 0xc7\n   */\n  var markers = [0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7];\n\n  //takes a string imgData containing the raw bytes of\n  //a jpeg image and returns [width, height]\n  //Algorithm from: http://www.64lines.com/jpeg-width-height\n  var getJpegInfo = function(imgData) {\n    var width, height, numcomponents;\n    var blockLength = imgData.charCodeAt(4) * 256 + imgData.charCodeAt(5);\n    var len = imgData.length;\n    var result = { width: 0, height: 0, numcomponents: 1 };\n    for (var i = 4; i < len; i += 2) {\n      i += blockLength;\n      if (markers.indexOf(imgData.charCodeAt(i + 1)) !== -1) {\n        height = imgData.charCodeAt(i + 5) * 256 + imgData.charCodeAt(i + 6);\n        width = imgData.charCodeAt(i + 7) * 256 + imgData.charCodeAt(i + 8);\n        numcomponents = imgData.charCodeAt(i + 9);\n        result = { width: width, height: height, numcomponents: numcomponents };\n        break;\n      } else {\n        blockLength =\n          imgData.charCodeAt(i + 2) * 256 + imgData.charCodeAt(i + 3);\n      }\n    }\n    return result;\n  };\n\n  /**\n   * @ignore\n   */\n  jsPDFAPI.processJPEG = function(\n    data,\n    index,\n    alias,\n    compression,\n    dataAsBinaryString,\n    colorSpace\n  ) {\n    var filter = this.decode.DCT_DECODE,\n      bpc = 8,\n      dims,\n      result = null;\n\n    if (\n      typeof data === \"string\" ||\n      this.__addimage__.isArrayBuffer(data) ||\n      this.__addimage__.isArrayBufferView(data)\n    ) {\n      // if we already have a stored binary string rep use that\n      data = dataAsBinaryString || data;\n      data = this.__addimage__.isArrayBuffer(data)\n        ? new Uint8Array(data)\n        : data;\n      data = this.__addimage__.isArrayBufferView(data)\n        ? this.__addimage__.arrayBufferToBinaryString(data)\n        : data;\n\n      dims = getJpegInfo(data);\n      switch (dims.numcomponents) {\n        case 1:\n          colorSpace = this.color_spaces.DEVICE_GRAY;\n          break;\n        case 4:\n          colorSpace = this.color_spaces.DEVICE_CMYK;\n          break;\n        case 3:\n          colorSpace = this.color_spaces.DEVICE_RGB;\n          break;\n      }\n\n      result = {\n        data: data,\n        width: dims.width,\n        height: dims.height,\n        colorSpace: colorSpace,\n        bitsPerComponent: bpc,\n        filter: filter,\n        index: index,\n        alias: alias\n      };\n    }\n    return result;\n  };\n})(jsPDF.API);\n","// Generated by CoffeeScript 1.4.0\n\n/**\n * @license\n * PNG.js\n * Copyright (c) 2011 Devon Govett\n * MIT LICENSE\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\n * software and associated documentation files (the \"Software\"), to deal in the Software\n * without restriction, including without limitation the rights to use, copy, modify, merge,\n * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n * to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or\n * substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING\n * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\nimport { unzlibSync } from \"./fflate.js\";\nimport { globalObject } from \"./globalObject.js\";\n\nvar PNG = (function() {\n  var APNG_BLEND_OP_OVER,\n    APNG_BLEND_OP_SOURCE,\n    APNG_DISPOSE_OP_BACKGROUND,\n    APNG_DISPOSE_OP_NONE,\n    APNG_DISPOSE_OP_PREVIOUS,\n    makeImage,\n    scratchCanvas,\n    scratchCtx;\n\n  APNG_DISPOSE_OP_NONE = 0;\n\n  APNG_DISPOSE_OP_BACKGROUND = 1;\n\n  APNG_DISPOSE_OP_PREVIOUS = 2;\n\n  APNG_BLEND_OP_SOURCE = 0;\n\n  APNG_BLEND_OP_OVER = 1;\n\n  function PNG(data) {\n    var chunkSize,\n      colors,\n      palLen,\n      delayDen,\n      delayNum,\n      frame,\n      i,\n      index,\n      key,\n      section,\n      palShort,\n      text,\n      _i,\n      _j,\n      _ref;\n    this.data = data;\n    this.pos = 8;\n    this.palette = [];\n    this.imgData = [];\n    this.transparency = {};\n    this.animation = null;\n    this.text = {};\n    frame = null;\n    while (true) {\n      chunkSize = this.readUInt32();\n      section = function() {\n        var _i, _results;\n        _results = [];\n        for (i = _i = 0; _i < 4; i = ++_i) {\n          _results.push(String.fromCharCode(this.data[this.pos++]));\n        }\n        return _results;\n      }\n        .call(this)\n        .join(\"\");\n      switch (section) {\n        case \"IHDR\":\n          this.width = this.readUInt32();\n          this.height = this.readUInt32();\n          this.bits = this.data[this.pos++];\n          this.colorType = this.data[this.pos++];\n          this.compressionMethod = this.data[this.pos++];\n          this.filterMethod = this.data[this.pos++];\n          this.interlaceMethod = this.data[this.pos++];\n          break;\n        case \"acTL\":\n          this.animation = {\n            numFrames: this.readUInt32(),\n            numPlays: this.readUInt32() || Infinity,\n            frames: []\n          };\n          break;\n        case \"PLTE\":\n          this.palette = this.read(chunkSize);\n          break;\n        case \"fcTL\":\n          if (frame) {\n            this.animation.frames.push(frame);\n          }\n          this.pos += 4;\n          frame = {\n            width: this.readUInt32(),\n            height: this.readUInt32(),\n            xOffset: this.readUInt32(),\n            yOffset: this.readUInt32()\n          };\n          delayNum = this.readUInt16();\n          delayDen = this.readUInt16() || 100;\n          frame.delay = (1000 * delayNum) / delayDen;\n          frame.disposeOp = this.data[this.pos++];\n          frame.blendOp = this.data[this.pos++];\n          frame.data = [];\n          break;\n        case \"IDAT\":\n        case \"fdAT\":\n          if (section === \"fdAT\") {\n            this.pos += 4;\n            chunkSize -= 4;\n          }\n          data = (frame != null ? frame.data : void 0) || this.imgData;\n          for (\n            i = _i = 0;\n            0 <= chunkSize ? _i < chunkSize : _i > chunkSize;\n            i = 0 <= chunkSize ? ++_i : --_i\n          ) {\n            data.push(this.data[this.pos++]);\n          }\n          break;\n        case \"tRNS\":\n          this.transparency = {};\n          switch (this.colorType) {\n            case 3:\n              palLen = this.palette.length / 3;\n              this.transparency.indexed = this.read(chunkSize);\n              if (this.transparency.indexed.length > palLen)\n                throw new Error(\"More transparent colors than palette size\");\n              /*\n               * According to the PNG spec trns should be increased to the same size as palette if shorter\n               */\n              //palShort = 255 - this.transparency.indexed.length;\n              palShort = palLen - this.transparency.indexed.length;\n              if (palShort > 0) {\n                for (\n                  i = _j = 0;\n                  0 <= palShort ? _j < palShort : _j > palShort;\n                  i = 0 <= palShort ? ++_j : --_j\n                ) {\n                  this.transparency.indexed.push(255);\n                }\n              }\n              break;\n            case 0:\n              this.transparency.grayscale = this.read(chunkSize)[0];\n              break;\n            case 2:\n              this.transparency.rgb = this.read(chunkSize);\n          }\n          break;\n        case \"tEXt\":\n          text = this.read(chunkSize);\n          index = text.indexOf(0);\n          key = String.fromCharCode.apply(String, text.slice(0, index));\n          this.text[key] = String.fromCharCode.apply(\n            String,\n            text.slice(index + 1)\n          );\n          break;\n        case \"IEND\":\n          if (frame) {\n            this.animation.frames.push(frame);\n          }\n          this.colors = function() {\n            switch (this.colorType) {\n              case 0:\n              case 3:\n              case 4:\n                return 1;\n              case 2:\n              case 6:\n                return 3;\n            }\n          }.call(this);\n          this.hasAlphaChannel = (_ref = this.colorType) === 4 || _ref === 6;\n          colors = this.colors + (this.hasAlphaChannel ? 1 : 0);\n          this.pixelBitlength = this.bits * colors;\n          this.colorSpace = function() {\n            switch (this.colors) {\n              case 1:\n                return \"DeviceGray\";\n              case 3:\n                return \"DeviceRGB\";\n            }\n          }.call(this);\n          this.imgData = new Uint8Array(this.imgData);\n          return;\n        default:\n          this.pos += chunkSize;\n      }\n      this.pos += 4;\n      if (this.pos > this.data.length) {\n        throw new Error(\"Incomplete or corrupt PNG file\");\n      }\n    }\n  }\n\n  PNG.prototype.read = function(bytes) {\n    var i, _i, _results;\n    _results = [];\n    for (\n      i = _i = 0;\n      0 <= bytes ? _i < bytes : _i > bytes;\n      i = 0 <= bytes ? ++_i : --_i\n    ) {\n      _results.push(this.data[this.pos++]);\n    }\n    return _results;\n  };\n\n  PNG.prototype.readUInt32 = function() {\n    var b1, b2, b3, b4;\n    b1 = this.data[this.pos++] << 24;\n    b2 = this.data[this.pos++] << 16;\n    b3 = this.data[this.pos++] << 8;\n    b4 = this.data[this.pos++];\n    return b1 | b2 | b3 | b4;\n  };\n\n  PNG.prototype.readUInt16 = function() {\n    var b1, b2;\n    b1 = this.data[this.pos++] << 8;\n    b2 = this.data[this.pos++];\n    return b1 | b2;\n  };\n\n  PNG.prototype.decodePixels = function(data) {\n    var pixelBytes = this.pixelBitlength / 8;\n    var fullPixels = new Uint8Array(this.width * this.height * pixelBytes);\n    var pos = 0;\n    var _this = this;\n\n    if (data == null) {\n      data = this.imgData;\n    }\n    if (data.length === 0) {\n      return new Uint8Array(0);\n    }\n\n    data = unzlibSync(data);\n    function pass(x0, y0, dx, dy) {\n      var abyte,\n        c,\n        col,\n        i,\n        left,\n        length,\n        p,\n        pa,\n        paeth,\n        pb,\n        pc,\n        pixels,\n        row,\n        scanlineLength,\n        upper,\n        upperLeft,\n        _i,\n        _j,\n        _k,\n        _l,\n        _m;\n      var w = Math.ceil((_this.width - x0) / dx),\n        h = Math.ceil((_this.height - y0) / dy);\n      var isFull = _this.width == w && _this.height == h;\n      scanlineLength = pixelBytes * w;\n      pixels = isFull ? fullPixels : new Uint8Array(scanlineLength * h);\n      length = data.length;\n      row = 0;\n      c = 0;\n      while (row < h && pos < length) {\n        switch (data[pos++]) {\n          case 0:\n            for (i = _i = 0; _i < scanlineLength; i = _i += 1) {\n              pixels[c++] = data[pos++];\n            }\n            break;\n          case 1:\n            for (i = _j = 0; _j < scanlineLength; i = _j += 1) {\n              abyte = data[pos++];\n              left = i < pixelBytes ? 0 : pixels[c - pixelBytes];\n              pixels[c++] = (abyte + left) % 256;\n            }\n            break;\n          case 2:\n            for (i = _k = 0; _k < scanlineLength; i = _k += 1) {\n              abyte = data[pos++];\n              col = (i - (i % pixelBytes)) / pixelBytes;\n              upper =\n                row &&\n                pixels[\n                  (row - 1) * scanlineLength +\n                    col * pixelBytes +\n                    (i % pixelBytes)\n                ];\n              pixels[c++] = (upper + abyte) % 256;\n            }\n            break;\n          case 3:\n            for (i = _l = 0; _l < scanlineLength; i = _l += 1) {\n              abyte = data[pos++];\n              col = (i - (i % pixelBytes)) / pixelBytes;\n              left = i < pixelBytes ? 0 : pixels[c - pixelBytes];\n              upper =\n                row &&\n                pixels[\n                  (row - 1) * scanlineLength +\n                    col * pixelBytes +\n                    (i % pixelBytes)\n                ];\n              pixels[c++] = (abyte + Math.floor((left + upper) / 2)) % 256;\n            }\n            break;\n          case 4:\n            for (i = _m = 0; _m < scanlineLength; i = _m += 1) {\n              abyte = data[pos++];\n              col = (i - (i % pixelBytes)) / pixelBytes;\n              left = i < pixelBytes ? 0 : pixels[c - pixelBytes];\n              if (row === 0) {\n                upper = upperLeft = 0;\n              } else {\n                upper =\n                  pixels[\n                    (row - 1) * scanlineLength +\n                      col * pixelBytes +\n                      (i % pixelBytes)\n                  ];\n                upperLeft =\n                  col &&\n                  pixels[\n                    (row - 1) * scanlineLength +\n                      (col - 1) * pixelBytes +\n                      (i % pixelBytes)\n                  ];\n              }\n              p = left + upper - upperLeft;\n              pa = Math.abs(p - left);\n              pb = Math.abs(p - upper);\n              pc = Math.abs(p - upperLeft);\n              if (pa <= pb && pa <= pc) {\n                paeth = left;\n              } else if (pb <= pc) {\n                paeth = upper;\n              } else {\n                paeth = upperLeft;\n              }\n              pixels[c++] = (abyte + paeth) % 256;\n            }\n            break;\n          default:\n            throw new Error(\"Invalid filter algorithm: \" + data[pos - 1]);\n        }\n        if (!isFull) {\n          var fullPos = ((y0 + row * dy) * _this.width + x0) * pixelBytes;\n          var partPos = row * scanlineLength;\n          for (i = 0; i < w; i += 1) {\n            for (var j = 0; j < pixelBytes; j += 1)\n              fullPixels[fullPos++] = pixels[partPos++];\n            fullPos += (dx - 1) * pixelBytes;\n          }\n        }\n        row++;\n      }\n    }\n    if (_this.interlaceMethod == 1) {\n      /*\n          1 6 4 6 2 6 4 6\n          7 7 7 7 7 7 7 7\n          5 6 5 6 5 6 5 6\n          7 7 7 7 7 7 7 7\n          3 6 4 6 3 6 4 6\n          7 7 7 7 7 7 7 7\n          5 6 5 6 5 6 5 6\n          7 7 7 7 7 7 7 7\n        */\n      pass(0, 0, 8, 8); // 1\n      /* NOTE these seem to follow the pattern:\n       * pass(x, 0, 2*x, 2*x);\n       * pass(0, x,   x, 2*x);\n       * with x being 4, 2, 1.\n       */\n      pass(4, 0, 8, 8); // 2\n      pass(0, 4, 4, 8); // 3\n\n      pass(2, 0, 4, 4); // 4\n      pass(0, 2, 2, 4); // 5\n\n      pass(1, 0, 2, 2); // 6\n      pass(0, 1, 1, 2); // 7\n    } else {\n      pass(0, 0, 1, 1);\n    }\n    return fullPixels;\n  };\n\n  PNG.prototype.decodePalette = function() {\n    var c, i, length, palette, pos, ret, transparency, _i, _ref, _ref1;\n    palette = this.palette;\n    transparency = this.transparency.indexed || [];\n    ret = new Uint8Array((transparency.length || 0) + palette.length);\n    pos = 0;\n    length = palette.length;\n    c = 0;\n    for (i = _i = 0, _ref = length; _i < _ref; i = _i += 3) {\n      ret[pos++] = palette[i];\n      ret[pos++] = palette[i + 1];\n      ret[pos++] = palette[i + 2];\n      ret[pos++] = (_ref1 = transparency[c++]) != null ? _ref1 : 255;\n    }\n    return ret;\n  };\n\n  PNG.prototype.copyToImageData = function(imageData, pixels) {\n    var alpha, colors, data, i, input, j, k, length, palette, v, _ref;\n    colors = this.colors;\n    palette = null;\n    alpha = this.hasAlphaChannel;\n    if (this.palette.length) {\n      palette =\n        (_ref = this._decodedPalette) != null\n          ? _ref\n          : (this._decodedPalette = this.decodePalette());\n      colors = 4;\n      alpha = true;\n    }\n    data = imageData.data || imageData;\n    length = data.length;\n    input = palette || pixels;\n    i = j = 0;\n    if (colors === 1) {\n      while (i < length) {\n        k = palette ? pixels[i / 4] * 4 : j;\n        v = input[k++];\n        data[i++] = v;\n        data[i++] = v;\n        data[i++] = v;\n        data[i++] = alpha ? input[k++] : 255;\n        j = k;\n      }\n    } else {\n      while (i < length) {\n        k = palette ? pixels[i / 4] * 4 : j;\n        data[i++] = input[k++];\n        data[i++] = input[k++];\n        data[i++] = input[k++];\n        data[i++] = alpha ? input[k++] : 255;\n        j = k;\n      }\n    }\n  };\n\n  PNG.prototype.decode = function() {\n    var ret;\n    ret = new Uint8Array(this.width * this.height * 4);\n    this.copyToImageData(ret, this.decodePixels());\n    return ret;\n  };\n\n  var hasBrowserCanvas = function() {\n    if (Object.prototype.toString.call(globalObject) === \"[object Window]\") {\n      try {\n        scratchCanvas = globalObject.document.createElement(\"canvas\");\n        scratchCtx = scratchCanvas.getContext(\"2d\");\n      } catch (e) {\n        return false;\n      }\n      return true;\n    }\n    return false;\n  };\n\n  hasBrowserCanvas();\n\n  makeImage = function(imageData) {\n    if (hasBrowserCanvas() === true) {\n      var img;\n      scratchCtx.width = imageData.width;\n      scratchCtx.height = imageData.height;\n      scratchCtx.clearRect(0, 0, imageData.width, imageData.height);\n      scratchCtx.putImageData(imageData, 0, 0);\n      img = new Image();\n      img.src = scratchCanvas.toDataURL();\n      return img;\n    }\n    throw new Error(\"This method requires a Browser with Canvas-capability.\");\n  };\n\n  PNG.prototype.decodeFrames = function(ctx) {\n    var frame, i, imageData, pixels, _i, _len, _ref, _results;\n    if (!this.animation) {\n      return;\n    }\n    _ref = this.animation.frames;\n    _results = [];\n    for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {\n      frame = _ref[i];\n      imageData = ctx.createImageData(frame.width, frame.height);\n      pixels = this.decodePixels(new Uint8Array(frame.data));\n      this.copyToImageData(imageData, pixels);\n      frame.imageData = imageData;\n      _results.push((frame.image = makeImage(imageData)));\n    }\n    return _results;\n  };\n\n  PNG.prototype.renderFrame = function(ctx, number) {\n    var frame, frames, prev;\n    frames = this.animation.frames;\n    frame = frames[number];\n    prev = frames[number - 1];\n    if (number === 0) {\n      ctx.clearRect(0, 0, this.width, this.height);\n    }\n    if (\n      (prev != null ? prev.disposeOp : void 0) === APNG_DISPOSE_OP_BACKGROUND\n    ) {\n      ctx.clearRect(prev.xOffset, prev.yOffset, prev.width, prev.height);\n    } else if (\n      (prev != null ? prev.disposeOp : void 0) === APNG_DISPOSE_OP_PREVIOUS\n    ) {\n      ctx.putImageData(prev.imageData, prev.xOffset, prev.yOffset);\n    }\n    if (frame.blendOp === APNG_BLEND_OP_SOURCE) {\n      ctx.clearRect(frame.xOffset, frame.yOffset, frame.width, frame.height);\n    }\n    return ctx.drawImage(frame.image, frame.xOffset, frame.yOffset);\n  };\n\n  PNG.prototype.animate = function(ctx) {\n    var doFrame,\n      frameNumber,\n      frames,\n      numFrames,\n      numPlays,\n      _ref,\n      _this = this;\n    frameNumber = 0;\n    (_ref = this.animation),\n      (numFrames = _ref.numFrames),\n      (frames = _ref.frames),\n      (numPlays = _ref.numPlays);\n    return (doFrame = function() {\n      var f, frame;\n      f = frameNumber++ % numFrames;\n      frame = frames[f];\n      _this.renderFrame(ctx, f);\n      if (numFrames > 1 && frameNumber / numFrames < numPlays) {\n        return (_this.animation._timeout = setTimeout(doFrame, frame.delay));\n      }\n    })();\n  };\n\n  PNG.prototype.stopAnimation = function() {\n    var _ref;\n    return clearTimeout(\n      (_ref = this.animation) != null ? _ref._timeout : void 0\n    );\n  };\n\n  PNG.prototype.render = function(canvas) {\n    var ctx, data;\n    if (canvas._png) {\n      canvas._png.stopAnimation();\n    }\n    canvas._png = this;\n    canvas.width = this.width;\n    canvas.height = this.height;\n    ctx = canvas.getContext(\"2d\");\n    if (this.animation) {\n      this.decodeFrames(ctx);\n      return this.animate(ctx);\n    } else {\n      data = ctx.createImageData(this.width, this.height);\n      this.copyToImageData(data, this.decodePixels());\n      return ctx.putImageData(data, 0, 0);\n    }\n  };\n\n  return PNG;\n})();\n\nexport { PNG };\n","/** @license\n * MIT license.\n * Copyright (c) 2012 Willow Systems Corporation, https://github.com/willowsystems\n *               2014 Diego Casorran, https://github.com/diegocr\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * ====================================================================\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * jsPDF split_text_to_size plugin\n *\n * @name split_text_to_size\n * @module\n */\n(function(API) {\n  \"use strict\";\n  /**\n   * Returns an array of length matching length of the 'word' string, with each\n   * cell occupied by the width of the char in that position.\n   *\n   * @name getCharWidthsArray\n   * @function\n   * @param {string} text\n   * @param {Object} options\n   * @returns {Array}\n   */\n  var getCharWidthsArray = (API.getCharWidthsArray = function(text, options) {\n    options = options || {};\n\n    var activeFont = options.font || this.internal.getFont();\n    var fontSize = options.fontSize || this.internal.getFontSize();\n    var charSpace = options.charSpace || this.internal.getCharSpace();\n\n    var widths = options.widths\n      ? options.widths\n      : activeFont.metadata.Unicode.widths;\n    var widthsFractionOf = widths.fof ? widths.fof : 1;\n    var kerning = options.kerning\n      ? options.kerning\n      : activeFont.metadata.Unicode.kerning;\n    var kerningFractionOf = kerning.fof ? kerning.fof : 1;\n    var doKerning = options.doKerning === false ? false : true;\n    var kerningValue = 0;\n\n    var i;\n    var length = text.length;\n    var char_code;\n    var prior_char_code = 0; //for kerning\n    var default_char_width = widths[0] || widthsFractionOf;\n    var output = [];\n\n    for (i = 0; i < length; i++) {\n      char_code = text.charCodeAt(i);\n\n      if (typeof activeFont.metadata.widthOfString === \"function\") {\n        output.push(\n          (activeFont.metadata.widthOfGlyph(\n            activeFont.metadata.characterToGlyph(char_code)\n          ) +\n            charSpace * (1000 / fontSize) || 0) / 1000\n        );\n      } else {\n        if (\n          doKerning &&\n          typeof kerning[char_code] === \"object\" &&\n          !isNaN(parseInt(kerning[char_code][prior_char_code], 10))\n        ) {\n          kerningValue =\n            kerning[char_code][prior_char_code] / kerningFractionOf;\n        } else {\n          kerningValue = 0;\n        }\n        output.push(\n          (widths[char_code] || default_char_width) / widthsFractionOf +\n            kerningValue\n        );\n      }\n      prior_char_code = char_code;\n    }\n\n    return output;\n  });\n\n  /**\n   * Returns a widths of string in a given font, if the font size is set as 1 point.\n   *\n   * In other words, this is \"proportional\" value. For 1 unit of font size, the length\n   * of the string will be that much.\n   *\n   * Multiply by font size to get actual width in *points*\n   * Then divide by 72 to get inches or divide by (72/25.6) to get 'mm' etc.\n   *\n   * @name getStringUnitWidth\n   * @public\n   * @function\n   * @param {string} text\n   * @param {string} options\n   * @returns {number} result\n   */\n  var getStringUnitWidth = (API.getStringUnitWidth = function(text, options) {\n    options = options || {};\n\n    var fontSize = options.fontSize || this.internal.getFontSize();\n    var font = options.font || this.internal.getFont();\n    var charSpace = options.charSpace || this.internal.getCharSpace();\n    var result = 0;\n\n    if (API.processArabic) {\n      text = API.processArabic(text);\n    }\n\n    if (typeof font.metadata.widthOfString === \"function\") {\n      result =\n        font.metadata.widthOfString(text, fontSize, charSpace) / fontSize;\n    } else {\n      result = getCharWidthsArray\n        .apply(this, arguments)\n        .reduce(function(pv, cv) {\n          return pv + cv;\n        }, 0);\n    }\n    return result;\n  });\n\n  /**\n  returns array of lines\n  */\n  var splitLongWord = function(word, widths_array, firstLineMaxLen, maxLen) {\n    var answer = [];\n\n    // 1st, chop off the piece that can fit on the hanging line.\n    var i = 0,\n      l = word.length,\n      workingLen = 0;\n    while (i !== l && workingLen + widths_array[i] < firstLineMaxLen) {\n      workingLen += widths_array[i];\n      i++;\n    }\n    // this is first line.\n    answer.push(word.slice(0, i));\n\n    // 2nd. Split the rest into maxLen pieces.\n    var startOfLine = i;\n    workingLen = 0;\n    while (i !== l) {\n      if (workingLen + widths_array[i] > maxLen) {\n        answer.push(word.slice(startOfLine, i));\n        workingLen = 0;\n        startOfLine = i;\n      }\n      workingLen += widths_array[i];\n      i++;\n    }\n    if (startOfLine !== i) {\n      answer.push(word.slice(startOfLine, i));\n    }\n\n    return answer;\n  };\n\n  // Note, all sizing inputs for this function must be in \"font measurement units\"\n  // By default, for PDF, it's \"point\".\n  var splitParagraphIntoLines = function(text, maxlen, options) {\n    // at this time works only on Western scripts, ones with space char\n    // separating the words. Feel free to expand.\n\n    if (!options) {\n      options = {};\n    }\n\n    var line = [],\n      lines = [line],\n      line_length = options.textIndent || 0,\n      separator_length = 0,\n      current_word_length = 0,\n      word,\n      widths_array,\n      words = text.split(\" \"),\n      spaceCharWidth = getCharWidthsArray.apply(this, [\" \", options])[0],\n      i,\n      l,\n      tmp,\n      lineIndent;\n\n    if (options.lineIndent === -1) {\n      lineIndent = words[0].length + 2;\n    } else {\n      lineIndent = options.lineIndent || 0;\n    }\n    if (lineIndent) {\n      var pad = Array(lineIndent).join(\" \"),\n        wrds = [];\n      words.map(function(wrd) {\n        wrd = wrd.split(/\\s*\\n/);\n        if (wrd.length > 1) {\n          wrds = wrds.concat(\n            wrd.map(function(wrd, idx) {\n              return (idx && wrd.length ? \"\\n\" : \"\") + wrd;\n            })\n          );\n        } else {\n          wrds.push(wrd[0]);\n        }\n      });\n      words = wrds;\n      lineIndent = getStringUnitWidth.apply(this, [pad, options]);\n    }\n\n    for (i = 0, l = words.length; i < l; i++) {\n      var force = 0;\n\n      word = words[i];\n      if (lineIndent && word[0] == \"\\n\") {\n        word = word.substr(1);\n        force = 1;\n      }\n      widths_array = getCharWidthsArray.apply(this, [word, options]);\n      current_word_length = widths_array.reduce(function(pv, cv) {\n        return pv + cv;\n      }, 0);\n\n      if (\n        line_length + separator_length + current_word_length > maxlen ||\n        force\n      ) {\n        if (current_word_length > maxlen) {\n          // this happens when you have space-less long URLs for example.\n          // we just chop these to size. We do NOT insert hiphens\n          tmp = splitLongWord.apply(this, [\n            word,\n            widths_array,\n            maxlen - (line_length + separator_length),\n            maxlen\n          ]);\n          // first line we add to existing line object\n          line.push(tmp.shift()); // it's ok to have extra space indicator there\n          // last line we make into new line object\n          line = [tmp.pop()];\n          // lines in the middle we apped to lines object as whole lines\n          while (tmp.length) {\n            lines.push([tmp.shift()]); // single fragment occupies whole line\n          }\n          current_word_length = widths_array\n            .slice(word.length - (line[0] ? line[0].length : 0))\n            .reduce(function(pv, cv) {\n              return pv + cv;\n            }, 0);\n        } else {\n          // just put it on a new line\n          line = [word];\n        }\n\n        // now we attach new line to lines\n        lines.push(line);\n        line_length = current_word_length + lineIndent;\n        separator_length = spaceCharWidth;\n      } else {\n        line.push(word);\n\n        line_length += separator_length + current_word_length;\n        separator_length = spaceCharWidth;\n      }\n    }\n\n    var postProcess;\n    if (lineIndent) {\n      postProcess = function(ln, idx) {\n        return (idx ? pad : \"\") + ln.join(\" \");\n      };\n    } else {\n      postProcess = function(ln) {\n        return ln.join(\" \");\n      };\n    }\n\n    return lines.map(postProcess);\n  };\n\n  /**\n   * Splits a given string into an array of strings. Uses 'size' value\n   * (in measurement units declared as default for the jsPDF instance)\n   * and the font's \"widths\" and \"Kerning\" tables, where available, to\n   * determine display length of a given string for a given font.\n   *\n   * We use character's 100% of unit size (height) as width when Width\n   * table or other default width is not available.\n   *\n   * @name splitTextToSize\n   * @public\n   * @function\n   * @param {string} text Unencoded, regular JavaScript (Unicode, UTF-16 / UCS-2) string.\n   * @param {number} size Nominal number, measured in units default to this instance of jsPDF.\n   * @param {Object} options Optional flags needed for chopper to do the right thing.\n   * @returns {Array} array Array with strings chopped to size.\n   */\n  API.splitTextToSize = function(text, maxlen, options) {\n    \"use strict\";\n\n    options = options || {};\n\n    var fsize = options.fontSize || this.internal.getFontSize(),\n      newOptions = function(options) {\n        var widths = {\n            0: 1\n          },\n          kerning = {};\n\n        if (!options.widths || !options.kerning) {\n          var f = this.internal.getFont(options.fontName, options.fontStyle),\n            encoding = \"Unicode\";\n          // NOT UTF8, NOT UTF16BE/LE, NOT UCS2BE/LE\n          // Actual JavaScript-native String's 16bit char codes used.\n          // no multi-byte logic here\n\n          if (f.metadata[encoding]) {\n            return {\n              widths: f.metadata[encoding].widths || widths,\n              kerning: f.metadata[encoding].kerning || kerning\n            };\n          } else {\n            return {\n              font: f.metadata,\n              fontSize: this.internal.getFontSize(),\n              charSpace: this.internal.getCharSpace()\n            };\n          }\n        } else {\n          return {\n            widths: options.widths,\n            kerning: options.kerning\n          };\n        }\n      }.call(this, options);\n\n    // first we split on end-of-line chars\n    var paragraphs;\n    if (Array.isArray(text)) {\n      paragraphs = text;\n    } else {\n      paragraphs = String(text).split(/\\r?\\n/);\n    }\n\n    // now we convert size (max length of line) into \"font size units\"\n    // at present time, the \"font size unit\" is always 'point'\n    // 'proportional' means, \"in proportion to font size\"\n    var fontUnit_maxLen = (1.0 * this.internal.scaleFactor * maxlen) / fsize;\n    // at this time, fsize is always in \"points\" regardless of the default measurement unit of the doc.\n    // this may change in the future?\n    // until then, proportional_maxlen is likely to be in 'points'\n\n    // If first line is to be indented (shorter or longer) than maxLen\n    // we indicate that by using CSS-style \"text-indent\" option.\n    // here it's in font units too (which is likely 'points')\n    // it can be negative (which makes the first line longer than maxLen)\n    newOptions.textIndent = options.textIndent\n      ? (options.textIndent * 1.0 * this.internal.scaleFactor) / fsize\n      : 0;\n    newOptions.lineIndent = options.lineIndent;\n\n    var i,\n      l,\n      output = [];\n    for (i = 0, l = paragraphs.length; i < l; i++) {\n      output = output.concat(\n        splitParagraphIntoLines.apply(this, [\n          paragraphs[i],\n          fontUnit_maxLen,\n          newOptions\n        ])\n      );\n    }\n\n    return output;\n  };\n})(jsPDF.API);\n","/**\n * @license\n * (c) Dean McNamee <dean@gmail.com>, 2013.\n *\n * https://github.com/deanm/omggif\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n *\n * omggif is a JavaScript implementation of a GIF 89a encoder and decoder,\n * including animation and compression.  It does not rely on any specific\n * underlying system, so should run in the browser, Node, or Plask.\n */\n\n\"use strict\";\n\nimport { console } from \"./console.js\";\n\nfunction GifWriter(buf, width, height, gopts) {\n  var p = 0;\n\n  var gopts = gopts === undefined ? {} : gopts;\n  var loop_count = gopts.loop === undefined ? null : gopts.loop;\n  var global_palette = gopts.palette === undefined ? null : gopts.palette;\n\n  if (width <= 0 || height <= 0 || width > 65535 || height > 65535)\n    throw new Error(\"Width/Height invalid.\");\n\n  function check_palette_and_num_colors(palette) {\n    var num_colors = palette.length;\n    if (num_colors < 2 || num_colors > 256 || num_colors & (num_colors - 1)) {\n      throw new Error(\n        \"Invalid code/color length, must be power of 2 and 2 .. 256.\"\n      );\n    }\n    return num_colors;\n  }\n\n  // - Header.\n  buf[p++] = 0x47;\n  buf[p++] = 0x49;\n  buf[p++] = 0x46; // GIF\n  buf[p++] = 0x38;\n  buf[p++] = 0x39;\n  buf[p++] = 0x61; // 89a\n\n  // Handling of Global Color Table (palette) and background index.\n  var gp_num_colors_pow2 = 0;\n  var background = 0;\n  if (global_palette !== null) {\n    var gp_num_colors = check_palette_and_num_colors(global_palette);\n    while ((gp_num_colors >>= 1)) ++gp_num_colors_pow2;\n    gp_num_colors = 1 << gp_num_colors_pow2;\n    --gp_num_colors_pow2;\n    if (gopts.background !== undefined) {\n      background = gopts.background;\n      if (background >= gp_num_colors)\n        throw new Error(\"Background index out of range.\");\n      // The GIF spec states that a background index of 0 should be ignored, so\n      // this is probably a mistake and you really want to set it to another\n      // slot in the palette.  But actually in the end most browsers, etc end\n      // up ignoring this almost completely (including for dispose background).\n      if (background === 0)\n        throw new Error(\"Background index explicitly passed as 0.\");\n    }\n  }\n\n  // - Logical Screen Descriptor.\n  // NOTE(deanm): w/h apparently ignored by implementations, but set anyway.\n  buf[p++] = width & 0xff;\n  buf[p++] = (width >> 8) & 0xff;\n  buf[p++] = height & 0xff;\n  buf[p++] = (height >> 8) & 0xff;\n  // NOTE: Indicates 0-bpp original color resolution (unused?).\n  buf[p++] = (global_palette !== null ? 0x80 : 0) | gp_num_colors_pow2; // Global Color Table Flag. // NOTE: No sort flag (unused?).\n  buf[p++] = background; // Background Color Index.\n  buf[p++] = 0; // Pixel aspect ratio (unused?).\n\n  // - Global Color Table\n  if (global_palette !== null) {\n    for (var i = 0, il = global_palette.length; i < il; ++i) {\n      var rgb = global_palette[i];\n      buf[p++] = (rgb >> 16) & 0xff;\n      buf[p++] = (rgb >> 8) & 0xff;\n      buf[p++] = rgb & 0xff;\n    }\n  }\n\n  if (loop_count !== null) {\n    // Netscape block for looping.\n    if (loop_count < 0 || loop_count > 65535)\n      throw new Error(\"Loop count invalid.\");\n    // Extension code, label, and length.\n    buf[p++] = 0x21;\n    buf[p++] = 0xff;\n    buf[p++] = 0x0b;\n    // NETSCAPE2.0\n    buf[p++] = 0x4e;\n    buf[p++] = 0x45;\n    buf[p++] = 0x54;\n    buf[p++] = 0x53;\n    buf[p++] = 0x43;\n    buf[p++] = 0x41;\n    buf[p++] = 0x50;\n    buf[p++] = 0x45;\n    buf[p++] = 0x32;\n    buf[p++] = 0x2e;\n    buf[p++] = 0x30;\n    // Sub-block\n    buf[p++] = 0x03;\n    buf[p++] = 0x01;\n    buf[p++] = loop_count & 0xff;\n    buf[p++] = (loop_count >> 8) & 0xff;\n    buf[p++] = 0x00; // Terminator.\n  }\n\n  var ended = false;\n\n  this.addFrame = function(x, y, w, h, indexed_pixels, opts) {\n    if (ended === true) {\n      --p;\n      ended = false;\n    } // Un-end.\n\n    opts = opts === undefined ? {} : opts;\n\n    // TODO(deanm): Bounds check x, y.  Do they need to be within the virtual\n    // canvas width/height, I imagine?\n    if (x < 0 || y < 0 || x > 65535 || y > 65535)\n      throw new Error(\"x/y invalid.\");\n\n    if (w <= 0 || h <= 0 || w > 65535 || h > 65535)\n      throw new Error(\"Width/Height invalid.\");\n\n    if (indexed_pixels.length < w * h)\n      throw new Error(\"Not enough pixels for the frame size.\");\n\n    var using_local_palette = true;\n    var palette = opts.palette;\n    if (palette === undefined || palette === null) {\n      using_local_palette = false;\n      palette = global_palette;\n    }\n\n    if (palette === undefined || palette === null)\n      throw new Error(\"Must supply either a local or global palette.\");\n\n    var num_colors = check_palette_and_num_colors(palette);\n\n    // Compute the min_code_size (power of 2), destroying num_colors.\n    var min_code_size = 0;\n    while ((num_colors >>= 1)) ++min_code_size;\n    num_colors = 1 << min_code_size; // Now we can easily get it back.\n\n    var delay = opts.delay === undefined ? 0 : opts.delay;\n\n    // From the spec:\n    //     0 -   No disposal specified. The decoder is\n    //           not required to take any action.\n    //     1 -   Do not dispose. The graphic is to be left\n    //           in place.\n    //     2 -   Restore to background color. The area used by the\n    //           graphic must be restored to the background color.\n    //     3 -   Restore to previous. The decoder is required to\n    //           restore the area overwritten by the graphic with\n    //           what was there prior to rendering the graphic.\n    //  4-7 -    To be defined.\n    // NOTE(deanm): Dispose background doesn't really work, apparently most\n    // browsers ignore the background palette index and clear to transparency.\n    var disposal = opts.disposal === undefined ? 0 : opts.disposal;\n    if (disposal < 0 || disposal > 3)\n      // 4-7 is reserved.\n      throw new Error(\"Disposal out of range.\");\n\n    var use_transparency = false;\n    var transparent_index = 0;\n    if (opts.transparent !== undefined && opts.transparent !== null) {\n      use_transparency = true;\n      transparent_index = opts.transparent;\n      if (transparent_index < 0 || transparent_index >= num_colors)\n        throw new Error(\"Transparent color index.\");\n    }\n\n    if (disposal !== 0 || use_transparency || delay !== 0) {\n      // - Graphics Control Extension\n      buf[p++] = 0x21;\n      buf[p++] = 0xf9; // Extension / Label.\n      buf[p++] = 4; // Byte size.\n\n      buf[p++] = (disposal << 2) | (use_transparency === true ? 1 : 0);\n      buf[p++] = delay & 0xff;\n      buf[p++] = (delay >> 8) & 0xff;\n      buf[p++] = transparent_index; // Transparent color index.\n      buf[p++] = 0; // Block Terminator.\n    }\n\n    // - Image Descriptor\n    buf[p++] = 0x2c; // Image Seperator.\n    buf[p++] = x & 0xff;\n    buf[p++] = (x >> 8) & 0xff; // Left.\n    buf[p++] = y & 0xff;\n    buf[p++] = (y >> 8) & 0xff; // Top.\n    buf[p++] = w & 0xff;\n    buf[p++] = (w >> 8) & 0xff;\n    buf[p++] = h & 0xff;\n    buf[p++] = (h >> 8) & 0xff;\n    // NOTE: No sort flag (unused?).\n    // TODO(deanm): Support interlace.\n    buf[p++] = using_local_palette === true ? 0x80 | (min_code_size - 1) : 0;\n\n    // - Local Color Table\n    if (using_local_palette === true) {\n      for (var i = 0, il = palette.length; i < il; ++i) {\n        var rgb = palette[i];\n        buf[p++] = (rgb >> 16) & 0xff;\n        buf[p++] = (rgb >> 8) & 0xff;\n        buf[p++] = rgb & 0xff;\n      }\n    }\n\n    p = GifWriterOutputLZWCodeStream(\n      buf,\n      p,\n      min_code_size < 2 ? 2 : min_code_size,\n      indexed_pixels\n    );\n\n    return p;\n  };\n\n  this.end = function() {\n    if (ended === false) {\n      buf[p++] = 0x3b; // Trailer.\n      ended = true;\n    }\n    return p;\n  };\n\n  this.getOutputBuffer = function() {\n    return buf;\n  };\n  this.setOutputBuffer = function(v) {\n    buf = v;\n  };\n  this.getOutputBufferPosition = function() {\n    return p;\n  };\n  this.setOutputBufferPosition = function(v) {\n    p = v;\n  };\n}\n\n// Main compression routine, palette indexes -> LZW code stream.\n// |index_stream| must have at least one entry.\nfunction GifWriterOutputLZWCodeStream(buf, p, min_code_size, index_stream) {\n  buf[p++] = min_code_size;\n  var cur_subblock = p++; // Pointing at the length field.\n\n  var clear_code = 1 << min_code_size;\n  var code_mask = clear_code - 1;\n  var eoi_code = clear_code + 1;\n  var next_code = eoi_code + 1;\n\n  var cur_code_size = min_code_size + 1; // Number of bits per code.\n  var cur_shift = 0;\n  // We have at most 12-bit codes, so we should have to hold a max of 19\n  // bits here (and then we would write out).\n  var cur = 0;\n\n  function emit_bytes_to_buffer(bit_block_size) {\n    while (cur_shift >= bit_block_size) {\n      buf[p++] = cur & 0xff;\n      cur >>= 8;\n      cur_shift -= 8;\n      if (p === cur_subblock + 256) {\n        // Finished a subblock.\n        buf[cur_subblock] = 255;\n        cur_subblock = p++;\n      }\n    }\n  }\n\n  function emit_code(c) {\n    cur |= c << cur_shift;\n    cur_shift += cur_code_size;\n    emit_bytes_to_buffer(8);\n  }\n\n  // I am not an expert on the topic, and I don't want to write a thesis.\n  // However, it is good to outline here the basic algorithm and the few data\n  // structures and optimizations here that make this implementation fast.\n  // The basic idea behind LZW is to build a table of previously seen runs\n  // addressed by a short id (herein called output code).  All data is\n  // referenced by a code, which represents one or more values from the\n  // original input stream.  All input bytes can be referenced as the same\n  // value as an output code.  So if you didn't want any compression, you\n  // could more or less just output the original bytes as codes (there are\n  // some details to this, but it is the idea).  In order to achieve\n  // compression, values greater then the input range (codes can be up to\n  // 12-bit while input only 8-bit) represent a sequence of previously seen\n  // inputs.  The decompressor is able to build the same mapping while\n  // decoding, so there is always a shared common knowledge between the\n  // encoding and decoder, which is also important for \"timing\" aspects like\n  // how to handle variable bit width code encoding.\n  //\n  // One obvious but very important consequence of the table system is there\n  // is always a unique id (at most 12-bits) to map the runs.  'A' might be\n  // 4, then 'AA' might be 10, 'AAA' 11, 'AAAA' 12, etc.  This relationship\n  // can be used for an effecient lookup strategy for the code mapping.  We\n  // need to know if a run has been seen before, and be able to map that run\n  // to the output code.  Since we start with known unique ids (input bytes),\n  // and then from those build more unique ids (table entries), we can\n  // continue this chain (almost like a linked list) to always have small\n  // integer values that represent the current byte chains in the encoder.\n  // This means instead of tracking the input bytes (AAAABCD) to know our\n  // current state, we can track the table entry for AAAABC (it is guaranteed\n  // to exist by the nature of the algorithm) and the next character D.\n  // Therefor the tuple of (table_entry, byte) is guaranteed to also be\n  // unique.  This allows us to create a simple lookup key for mapping input\n  // sequences to codes (table indices) without having to store or search\n  // any of the code sequences.  So if 'AAAA' has a table entry of 12, the\n  // tuple of ('AAAA', K) for any input byte K will be unique, and can be our\n  // key.  This leads to a integer value at most 20-bits, which can always\n  // fit in an SMI value and be used as a fast sparse array / object key.\n\n  // Output code for the current contents of the index buffer.\n  var ib_code = index_stream[0] & code_mask; // Load first input index.\n  var code_table = {}; // Key'd on our 20-bit \"tuple\".\n\n  emit_code(clear_code); // Spec says first code should be a clear code.\n\n  // First index already loaded, process the rest of the stream.\n  for (var i = 1, il = index_stream.length; i < il; ++i) {\n    var k = index_stream[i] & code_mask;\n    var cur_key = (ib_code << 8) | k; // (prev, k) unique tuple.\n    var cur_code = code_table[cur_key]; // buffer + k.\n\n    // Check if we have to create a new code table entry.\n    if (cur_code === undefined) {\n      // We don't have buffer + k.\n      // Emit index buffer (without k).\n      // This is an inline version of emit_code, because this is the core\n      // writing routine of the compressor (and V8 cannot inline emit_code\n      // because it is a closure here in a different context).  Additionally\n      // we can call emit_byte_to_buffer less often, because we can have\n      // 30-bits (from our 31-bit signed SMI), and we know our codes will only\n      // be 12-bits, so can safely have 18-bits there without overflow.\n      // emit_code(ib_code);\n      cur |= ib_code << cur_shift;\n      cur_shift += cur_code_size;\n      while (cur_shift >= 8) {\n        buf[p++] = cur & 0xff;\n        cur >>= 8;\n        cur_shift -= 8;\n        if (p === cur_subblock + 256) {\n          // Finished a subblock.\n          buf[cur_subblock] = 255;\n          cur_subblock = p++;\n        }\n      }\n\n      if (next_code === 4096) {\n        // Table full, need a clear.\n        emit_code(clear_code);\n        next_code = eoi_code + 1;\n        cur_code_size = min_code_size + 1;\n        code_table = {};\n      } else {\n        // Table not full, insert a new entry.\n        // Increase our variable bit code sizes if necessary.  This is a bit\n        // tricky as it is based on \"timing\" between the encoding and\n        // decoder.  From the encoders perspective this should happen after\n        // we've already emitted the index buffer and are about to create the\n        // first table entry that would overflow our current code bit size.\n        if (next_code >= 1 << cur_code_size) ++cur_code_size;\n        code_table[cur_key] = next_code++; // Insert into code table.\n      }\n\n      ib_code = k; // Index buffer to single input k.\n    } else {\n      ib_code = cur_code; // Index buffer to sequence in code table.\n    }\n  }\n\n  emit_code(ib_code); // There will still be something in the index buffer.\n  emit_code(eoi_code); // End Of Information.\n\n  // Flush / finalize the sub-blocks stream to the buffer.\n  emit_bytes_to_buffer(1);\n\n  // Finish the sub-blocks, writing out any unfinished lengths and\n  // terminating with a sub-block of length 0.  If we have already started\n  // but not yet used a sub-block it can just become the terminator.\n  if (cur_subblock + 1 === p) {\n    // Started but unused.\n    buf[cur_subblock] = 0;\n  } else {\n    // Started and used, write length and additional terminator block.\n    buf[cur_subblock] = p - cur_subblock - 1;\n    buf[p++] = 0;\n  }\n  return p;\n}\n\nfunction GifReader(buf) {\n  var p = 0;\n\n  // - Header (GIF87a or GIF89a).\n  if (\n    buf[p++] !== 0x47 ||\n    buf[p++] !== 0x49 ||\n    buf[p++] !== 0x46 ||\n    buf[p++] !== 0x38 ||\n    ((buf[p++] + 1) & 0xfd) !== 0x38 ||\n    buf[p++] !== 0x61\n  ) {\n    throw new Error(\"Invalid GIF 87a/89a header.\");\n  }\n\n  // - Logical Screen Descriptor.\n  var width = buf[p++] | (buf[p++] << 8);\n  var height = buf[p++] | (buf[p++] << 8);\n  var pf0 = buf[p++]; // <Packed Fields>.\n  var global_palette_flag = pf0 >> 7;\n  var num_global_colors_pow2 = pf0 & 0x7;\n  var num_global_colors = 1 << (num_global_colors_pow2 + 1);\n  var background = buf[p++];\n  buf[p++]; // Pixel aspect ratio (unused?).\n\n  var global_palette_offset = null;\n  var global_palette_size = null;\n\n  if (global_palette_flag) {\n    global_palette_offset = p;\n    global_palette_size = num_global_colors;\n    p += num_global_colors * 3; // Seek past palette.\n  }\n\n  var no_eof = true;\n\n  var frames = [];\n\n  var delay = 0;\n  var transparent_index = null;\n  var disposal = 0; // 0 - No disposal specified.\n  var loop_count = null;\n\n  this.width = width;\n  this.height = height;\n\n  while (no_eof && p < buf.length) {\n    switch (buf[p++]) {\n      case 0x21: // Graphics Control Extension Block\n        switch (buf[p++]) {\n          case 0xff: // Application specific block\n            // Try if it's a Netscape block (with animation loop counter).\n            if (\n              buf[p] !== 0x0b || // 21 FF already read, check block size.\n              // NETSCAPE2.0\n              (buf[p + 1] == 0x4e &&\n                buf[p + 2] == 0x45 &&\n                buf[p + 3] == 0x54 &&\n                buf[p + 4] == 0x53 &&\n                buf[p + 5] == 0x43 &&\n                buf[p + 6] == 0x41 &&\n                buf[p + 7] == 0x50 &&\n                buf[p + 8] == 0x45 &&\n                buf[p + 9] == 0x32 &&\n                buf[p + 10] == 0x2e &&\n                buf[p + 11] == 0x30 &&\n                // Sub-block\n                buf[p + 12] == 0x03 &&\n                buf[p + 13] == 0x01 &&\n                buf[p + 16] == 0)\n            ) {\n              p += 14;\n              loop_count = buf[p++] | (buf[p++] << 8);\n              p++; // Skip terminator.\n            } else {\n              // We don't know what it is, just try to get past it.\n              p += 12;\n              while (true) {\n                // Seek through subblocks.\n                var block_size = buf[p++];\n                // Bad block size (ex: undefined from an out of bounds read).\n                if (!(block_size >= 0)) throw Error(\"Invalid block size\");\n                if (block_size === 0) break; // 0 size is terminator\n                p += block_size;\n              }\n            }\n            break;\n\n          case 0xf9: // Graphics Control Extension\n            if (buf[p++] !== 0x4 || buf[p + 4] !== 0)\n              throw new Error(\"Invalid graphics extension block.\");\n            var pf1 = buf[p++];\n            delay = buf[p++] | (buf[p++] << 8);\n            transparent_index = buf[p++];\n            if ((pf1 & 1) === 0) transparent_index = null;\n            disposal = (pf1 >> 2) & 0x7;\n            p++; // Skip terminator.\n            break;\n\n          case 0xfe: // Comment Extension.\n            while (true) {\n              // Seek through subblocks.\n              var block_size = buf[p++];\n              // Bad block size (ex: undefined from an out of bounds read).\n              if (!(block_size >= 0)) throw Error(\"Invalid block size\");\n              if (block_size === 0) break; // 0 size is terminator\n              // console.log(buf.slice(p, p+block_size).toString('ascii'));\n              p += block_size;\n            }\n            break;\n\n          default:\n            throw new Error(\n              \"Unknown graphic control label: 0x\" + buf[p - 1].toString(16)\n            );\n        }\n        break;\n\n      case 0x2c: // Image Descriptor.\n        var x = buf[p++] | (buf[p++] << 8);\n        var y = buf[p++] | (buf[p++] << 8);\n        var w = buf[p++] | (buf[p++] << 8);\n        var h = buf[p++] | (buf[p++] << 8);\n        var pf2 = buf[p++];\n        var local_palette_flag = pf2 >> 7;\n        var interlace_flag = (pf2 >> 6) & 1;\n        var num_local_colors_pow2 = pf2 & 0x7;\n        var num_local_colors = 1 << (num_local_colors_pow2 + 1);\n        var palette_offset = global_palette_offset;\n        var palette_size = global_palette_size;\n        var has_local_palette = false;\n        if (local_palette_flag) {\n          var has_local_palette = true;\n          palette_offset = p; // Override with local palette.\n          palette_size = num_local_colors;\n          p += num_local_colors * 3; // Seek past palette.\n        }\n\n        var data_offset = p;\n\n        p++; // codesize\n        while (true) {\n          var block_size = buf[p++];\n          // Bad block size (ex: undefined from an out of bounds read).\n          if (!(block_size >= 0)) throw Error(\"Invalid block size\");\n          if (block_size === 0) break; // 0 size is terminator\n          p += block_size;\n        }\n\n        frames.push({\n          x: x,\n          y: y,\n          width: w,\n          height: h,\n          has_local_palette: has_local_palette,\n          palette_offset: palette_offset,\n          palette_size: palette_size,\n          data_offset: data_offset,\n          data_length: p - data_offset,\n          transparent_index: transparent_index,\n          interlaced: !!interlace_flag,\n          delay: delay,\n          disposal: disposal\n        });\n        break;\n\n      case 0x3b: // Trailer Marker (end of file).\n        no_eof = false;\n        break;\n\n      default:\n        throw new Error(\"Unknown gif block: 0x\" + buf[p - 1].toString(16));\n        break;\n    }\n  }\n\n  this.numFrames = function() {\n    return frames.length;\n  };\n\n  this.loopCount = function() {\n    return loop_count;\n  };\n\n  this.frameInfo = function(frame_num) {\n    if (frame_num < 0 || frame_num >= frames.length)\n      throw new Error(\"Frame index out of range.\");\n    return frames[frame_num];\n  };\n\n  this.decodeAndBlitFrameBGRA = function(frame_num, pixels) {\n    var frame = this.frameInfo(frame_num);\n    var num_pixels = frame.width * frame.height;\n    var index_stream = new Uint8Array(num_pixels); // At most 8-bit indices.\n    GifReaderLZWOutputIndexStream(\n      buf,\n      frame.data_offset,\n      index_stream,\n      num_pixels\n    );\n    var palette_offset = frame.palette_offset;\n\n    // NOTE(deanm): It seems to be much faster to compare index to 256 than\n    // to === null.  Not sure why, but CompareStub_EQ_STRICT shows up high in\n    // the profile, not sure if it's related to using a Uint8Array.\n    var trans = frame.transparent_index;\n    if (trans === null) trans = 256;\n\n    // We are possibly just blitting to a portion of the entire frame.\n    // That is a subrect within the framerect, so the additional pixels\n    // must be skipped over after we finished a scanline.\n    var framewidth = frame.width;\n    var framestride = width - framewidth;\n    var xleft = framewidth; // Number of subrect pixels left in scanline.\n\n    // Output indices of the top left and bottom right corners of the subrect.\n    var opbeg = (frame.y * width + frame.x) * 4;\n    var opend = ((frame.y + frame.height) * width + frame.x) * 4;\n    var op = opbeg;\n\n    var scanstride = framestride * 4;\n\n    // Use scanstride to skip past the rows when interlacing.  This is skipping\n    // 7 rows for the first two passes, then 3 then 1.\n    if (frame.interlaced === true) {\n      scanstride += width * 4 * 7; // Pass 1.\n    }\n\n    var interlaceskip = 8; // Tracking the row interval in the current pass.\n\n    for (var i = 0, il = index_stream.length; i < il; ++i) {\n      var index = index_stream[i];\n\n      if (xleft === 0) {\n        // Beginning of new scan line\n        op += scanstride;\n        xleft = framewidth;\n        if (op >= opend) {\n          // Catch the wrap to switch passes when interlacing.\n          scanstride = framestride * 4 + width * 4 * (interlaceskip - 1);\n          // interlaceskip / 2 * 4 is interlaceskip << 1.\n          op = opbeg + (framewidth + framestride) * (interlaceskip << 1);\n          interlaceskip >>= 1;\n        }\n      }\n\n      if (index === trans) {\n        op += 4;\n      } else {\n        var r = buf[palette_offset + index * 3];\n        var g = buf[palette_offset + index * 3 + 1];\n        var b = buf[palette_offset + index * 3 + 2];\n        pixels[op++] = b;\n        pixels[op++] = g;\n        pixels[op++] = r;\n        pixels[op++] = 255;\n      }\n      --xleft;\n    }\n  };\n\n  // I will go to copy and paste hell one day...\n  this.decodeAndBlitFrameRGBA = function(frame_num, pixels) {\n    var frame = this.frameInfo(frame_num);\n    var num_pixels = frame.width * frame.height;\n    var index_stream = new Uint8Array(num_pixels); // At most 8-bit indices.\n    GifReaderLZWOutputIndexStream(\n      buf,\n      frame.data_offset,\n      index_stream,\n      num_pixels\n    );\n    var palette_offset = frame.palette_offset;\n\n    // NOTE(deanm): It seems to be much faster to compare index to 256 than\n    // to === null.  Not sure why, but CompareStub_EQ_STRICT shows up high in\n    // the profile, not sure if it's related to using a Uint8Array.\n    var trans = frame.transparent_index;\n    if (trans === null) trans = 256;\n\n    // We are possibly just blitting to a portion of the entire frame.\n    // That is a subrect within the framerect, so the additional pixels\n    // must be skipped over after we finished a scanline.\n    var framewidth = frame.width;\n    var framestride = width - framewidth;\n    var xleft = framewidth; // Number of subrect pixels left in scanline.\n\n    // Output indices of the top left and bottom right corners of the subrect.\n    var opbeg = (frame.y * width + frame.x) * 4;\n    var opend = ((frame.y + frame.height) * width + frame.x) * 4;\n    var op = opbeg;\n\n    var scanstride = framestride * 4;\n\n    // Use scanstride to skip past the rows when interlacing.  This is skipping\n    // 7 rows for the first two passes, then 3 then 1.\n    if (frame.interlaced === true) {\n      scanstride += width * 4 * 7; // Pass 1.\n    }\n\n    var interlaceskip = 8; // Tracking the row interval in the current pass.\n\n    for (var i = 0, il = index_stream.length; i < il; ++i) {\n      var index = index_stream[i];\n\n      if (xleft === 0) {\n        // Beginning of new scan line\n        op += scanstride;\n        xleft = framewidth;\n        if (op >= opend) {\n          // Catch the wrap to switch passes when interlacing.\n          scanstride = framestride * 4 + width * 4 * (interlaceskip - 1);\n          // interlaceskip / 2 * 4 is interlaceskip << 1.\n          op = opbeg + (framewidth + framestride) * (interlaceskip << 1);\n          interlaceskip >>= 1;\n        }\n      }\n\n      if (index === trans) {\n        op += 4;\n      } else {\n        var r = buf[palette_offset + index * 3];\n        var g = buf[palette_offset + index * 3 + 1];\n        var b = buf[palette_offset + index * 3 + 2];\n        pixels[op++] = r;\n        pixels[op++] = g;\n        pixels[op++] = b;\n        pixels[op++] = 255;\n      }\n      --xleft;\n    }\n  };\n}\n\nfunction GifReaderLZWOutputIndexStream(code_stream, p, output, output_length) {\n  var min_code_size = code_stream[p++];\n\n  var clear_code = 1 << min_code_size;\n  var eoi_code = clear_code + 1;\n  var next_code = eoi_code + 1;\n\n  var cur_code_size = min_code_size + 1; // Number of bits per code.\n  // NOTE: This shares the same name as the encoder, but has a different\n  // meaning here.  Here this masks each code coming from the code stream.\n  var code_mask = (1 << cur_code_size) - 1;\n  var cur_shift = 0;\n  var cur = 0;\n\n  var op = 0; // Output pointer.\n\n  var subblock_size = code_stream[p++];\n\n  // TODO(deanm): Would using a TypedArray be any faster?  At least it would\n  // solve the fast mode / backing store uncertainty.\n  // var code_table = Array(4096);\n  var code_table = new Int32Array(4096); // Can be signed, we only use 20 bits.\n\n  var prev_code = null; // Track code-1.\n\n  while (true) {\n    // Read up to two bytes, making sure we always 12-bits for max sized code.\n    while (cur_shift < 16) {\n      if (subblock_size === 0) break; // No more data to be read.\n\n      cur |= code_stream[p++] << cur_shift;\n      cur_shift += 8;\n\n      if (subblock_size === 1) {\n        // Never let it get to 0 to hold logic above.\n        subblock_size = code_stream[p++]; // Next subblock.\n      } else {\n        --subblock_size;\n      }\n    }\n\n    // TODO(deanm): We should never really get here, we should have received\n    // and EOI.\n    if (cur_shift < cur_code_size) break;\n\n    var code = cur & code_mask;\n    cur >>= cur_code_size;\n    cur_shift -= cur_code_size;\n\n    // TODO(deanm): Maybe should check that the first code was a clear code,\n    // at least this is what you're supposed to do.  But actually our encoder\n    // now doesn't emit a clear code first anyway.\n    if (code === clear_code) {\n      // We don't actually have to clear the table.  This could be a good idea\n      // for greater error checking, but we don't really do any anyway.  We\n      // will just track it with next_code and overwrite old entries.\n\n      next_code = eoi_code + 1;\n      cur_code_size = min_code_size + 1;\n      code_mask = (1 << cur_code_size) - 1;\n\n      // Don't update prev_code ?\n      prev_code = null;\n      continue;\n    } else if (code === eoi_code) {\n      break;\n    }\n\n    // We have a similar situation as the decoder, where we want to store\n    // variable length entries (code table entries), but we want to do in a\n    // faster manner than an array of arrays.  The code below stores sort of a\n    // linked list within the code table, and then \"chases\" through it to\n    // construct the dictionary entries.  When a new entry is created, just the\n    // last byte is stored, and the rest (prefix) of the entry is only\n    // referenced by its table entry.  Then the code chases through the\n    // prefixes until it reaches a single byte code.  We have to chase twice,\n    // first to compute the length, and then to actually copy the data to the\n    // output (backwards, since we know the length).  The alternative would be\n    // storing something in an intermediate stack, but that doesn't make any\n    // more sense.  I implemented an approach where it also stored the length\n    // in the code table, although it's a bit tricky because you run out of\n    // bits (12 + 12 + 8), but I didn't measure much improvements (the table\n    // entries are generally not the long).  Even when I created benchmarks for\n    // very long table entries the complexity did not seem worth it.\n    // The code table stores the prefix entry in 12 bits and then the suffix\n    // byte in 8 bits, so each entry is 20 bits.\n\n    var chase_code = code < next_code ? code : prev_code;\n\n    // Chase what we will output, either {CODE} or {CODE-1}.\n    var chase_length = 0;\n    var chase = chase_code;\n    while (chase > clear_code) {\n      chase = code_table[chase] >> 8;\n      ++chase_length;\n    }\n\n    var k = chase;\n\n    var op_end = op + chase_length + (chase_code !== code ? 1 : 0);\n    if (op_end > output_length) {\n      console.log(\"Warning, gif stream longer than expected.\");\n      return;\n    }\n\n    // Already have the first byte from the chase, might as well write it fast.\n    output[op++] = k;\n\n    op += chase_length;\n    var b = op; // Track pointer, writing backwards.\n\n    if (chase_code !== code)\n      // The case of emitting {CODE-1} + k.\n      output[op++] = k;\n\n    chase = chase_code;\n    while (chase_length--) {\n      chase = code_table[chase];\n      output[--b] = chase & 0xff; // Write backwards.\n      chase >>= 8; // Pull down to the prefix code.\n    }\n\n    if (prev_code !== null && next_code < 4096) {\n      code_table[next_code++] = (prev_code << 8) | k;\n      // TODO(deanm): Figure out this clearing vs code growth logic better.  I\n      // have an feeling that it should just happen somewhere else, for now it\n      // is awkward between when we grow past the max and then hit a clear code.\n      // For now just check if we hit the max 12-bits (then a clear code should\n      // follow, also of course encoded in 12-bits).\n      if (next_code >= code_mask + 1 && cur_code_size < 12) {\n        ++cur_code_size;\n        code_mask = (code_mask << 1) | 1;\n      }\n    }\n\n    prev_code = code;\n  }\n\n  if (op !== output_length) {\n    console.log(\"Warning, gif stream shorter than expected.\");\n  }\n\n  return output;\n}\n\nexport { GifReader, GifWriter };\n","/**\n * @license\n  Copyright (c) 2008, Adobe Systems Incorporated\n  All rights reserved.\n\n  Redistribution and use in source and binary forms, with or without \n  modification, are permitted provided that the following conditions are\n  met:\n\n  * Redistributions of source code must retain the above copyright notice, \n    this list of conditions and the following disclaimer.\n  \n  * Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in the \n    documentation and/or other materials provided with the distribution.\n  \n  * Neither the name of Adobe Systems Incorporated nor the names of its \n    contributors may be used to endorse or promote products derived from \n    this software without specific prior written permission.\n\n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\n  IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\n  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR \n  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n/*\nJPEG encoder ported to JavaScript and optimized by Andreas Ritter, www.bytestrom.eu, 11/2009\n\nBasic GUI blocking jpeg encoder\n*/\n\nfunction JPEGEncoder(quality) {\n  var ffloor = Math.floor;\n  var YTable = new Array(64);\n  var UVTable = new Array(64);\n  var fdtbl_Y = new Array(64);\n  var fdtbl_UV = new Array(64);\n  var YDC_HT;\n  var UVDC_HT;\n  var YAC_HT;\n  var UVAC_HT;\n\n  var bitcode = new Array(65535);\n  var category = new Array(65535);\n  var outputfDCTQuant = new Array(64);\n  var DU = new Array(64);\n  var byteout = [];\n  var bytenew = 0;\n  var bytepos = 7;\n\n  var YDU = new Array(64);\n  var UDU = new Array(64);\n  var VDU = new Array(64);\n  var clt = new Array(256);\n  var RGB_YUV_TABLE = new Array(2048);\n  var currentQuality;\n\n  var ZigZag = [\n    0,\n    1,\n    5,\n    6,\n    14,\n    15,\n    27,\n    28,\n    2,\n    4,\n    7,\n    13,\n    16,\n    26,\n    29,\n    42,\n    3,\n    8,\n    12,\n    17,\n    25,\n    30,\n    41,\n    43,\n    9,\n    11,\n    18,\n    24,\n    31,\n    40,\n    44,\n    53,\n    10,\n    19,\n    23,\n    32,\n    39,\n    45,\n    52,\n    54,\n    20,\n    22,\n    33,\n    38,\n    46,\n    51,\n    55,\n    60,\n    21,\n    34,\n    37,\n    47,\n    50,\n    56,\n    59,\n    61,\n    35,\n    36,\n    48,\n    49,\n    57,\n    58,\n    62,\n    63\n  ];\n\n  var std_dc_luminance_nrcodes = [\n    0,\n    0,\n    1,\n    5,\n    1,\n    1,\n    1,\n    1,\n    1,\n    1,\n    0,\n    0,\n    0,\n    0,\n    0,\n    0,\n    0\n  ];\n  var std_dc_luminance_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];\n  var std_ac_luminance_nrcodes = [\n    0,\n    0,\n    2,\n    1,\n    3,\n    3,\n    2,\n    4,\n    3,\n    5,\n    5,\n    4,\n    4,\n    0,\n    0,\n    1,\n    0x7d\n  ];\n  var std_ac_luminance_values = [\n    0x01,\n    0x02,\n    0x03,\n    0x00,\n    0x04,\n    0x11,\n    0x05,\n    0x12,\n    0x21,\n    0x31,\n    0x41,\n    0x06,\n    0x13,\n    0x51,\n    0x61,\n    0x07,\n    0x22,\n    0x71,\n    0x14,\n    0x32,\n    0x81,\n    0x91,\n    0xa1,\n    0x08,\n    0x23,\n    0x42,\n    0xb1,\n    0xc1,\n    0x15,\n    0x52,\n    0xd1,\n    0xf0,\n    0x24,\n    0x33,\n    0x62,\n    0x72,\n    0x82,\n    0x09,\n    0x0a,\n    0x16,\n    0x17,\n    0x18,\n    0x19,\n    0x1a,\n    0x25,\n    0x26,\n    0x27,\n    0x28,\n    0x29,\n    0x2a,\n    0x34,\n    0x35,\n    0x36,\n    0x37,\n    0x38,\n    0x39,\n    0x3a,\n    0x43,\n    0x44,\n    0x45,\n    0x46,\n    0x47,\n    0x48,\n    0x49,\n    0x4a,\n    0x53,\n    0x54,\n    0x55,\n    0x56,\n    0x57,\n    0x58,\n    0x59,\n    0x5a,\n    0x63,\n    0x64,\n    0x65,\n    0x66,\n    0x67,\n    0x68,\n    0x69,\n    0x6a,\n    0x73,\n    0x74,\n    0x75,\n    0x76,\n    0x77,\n    0x78,\n    0x79,\n    0x7a,\n    0x83,\n    0x84,\n    0x85,\n    0x86,\n    0x87,\n    0x88,\n    0x89,\n    0x8a,\n    0x92,\n    0x93,\n    0x94,\n    0x95,\n    0x96,\n    0x97,\n    0x98,\n    0x99,\n    0x9a,\n    0xa2,\n    0xa3,\n    0xa4,\n    0xa5,\n    0xa6,\n    0xa7,\n    0xa8,\n    0xa9,\n    0xaa,\n    0xb2,\n    0xb3,\n    0xb4,\n    0xb5,\n    0xb6,\n    0xb7,\n    0xb8,\n    0xb9,\n    0xba,\n    0xc2,\n    0xc3,\n    0xc4,\n    0xc5,\n    0xc6,\n    0xc7,\n    0xc8,\n    0xc9,\n    0xca,\n    0xd2,\n    0xd3,\n    0xd4,\n    0xd5,\n    0xd6,\n    0xd7,\n    0xd8,\n    0xd9,\n    0xda,\n    0xe1,\n    0xe2,\n    0xe3,\n    0xe4,\n    0xe5,\n    0xe6,\n    0xe7,\n    0xe8,\n    0xe9,\n    0xea,\n    0xf1,\n    0xf2,\n    0xf3,\n    0xf4,\n    0xf5,\n    0xf6,\n    0xf7,\n    0xf8,\n    0xf9,\n    0xfa\n  ];\n\n  var std_dc_chrominance_nrcodes = [\n    0,\n    0,\n    3,\n    1,\n    1,\n    1,\n    1,\n    1,\n    1,\n    1,\n    1,\n    1,\n    0,\n    0,\n    0,\n    0,\n    0\n  ];\n  var std_dc_chrominance_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];\n  var std_ac_chrominance_nrcodes = [\n    0,\n    0,\n    2,\n    1,\n    2,\n    4,\n    4,\n    3,\n    4,\n    7,\n    5,\n    4,\n    4,\n    0,\n    1,\n    2,\n    0x77\n  ];\n  var std_ac_chrominance_values = [\n    0x00,\n    0x01,\n    0x02,\n    0x03,\n    0x11,\n    0x04,\n    0x05,\n    0x21,\n    0x31,\n    0x06,\n    0x12,\n    0x41,\n    0x51,\n    0x07,\n    0x61,\n    0x71,\n    0x13,\n    0x22,\n    0x32,\n    0x81,\n    0x08,\n    0x14,\n    0x42,\n    0x91,\n    0xa1,\n    0xb1,\n    0xc1,\n    0x09,\n    0x23,\n    0x33,\n    0x52,\n    0xf0,\n    0x15,\n    0x62,\n    0x72,\n    0xd1,\n    0x0a,\n    0x16,\n    0x24,\n    0x34,\n    0xe1,\n    0x25,\n    0xf1,\n    0x17,\n    0x18,\n    0x19,\n    0x1a,\n    0x26,\n    0x27,\n    0x28,\n    0x29,\n    0x2a,\n    0x35,\n    0x36,\n    0x37,\n    0x38,\n    0x39,\n    0x3a,\n    0x43,\n    0x44,\n    0x45,\n    0x46,\n    0x47,\n    0x48,\n    0x49,\n    0x4a,\n    0x53,\n    0x54,\n    0x55,\n    0x56,\n    0x57,\n    0x58,\n    0x59,\n    0x5a,\n    0x63,\n    0x64,\n    0x65,\n    0x66,\n    0x67,\n    0x68,\n    0x69,\n    0x6a,\n    0x73,\n    0x74,\n    0x75,\n    0x76,\n    0x77,\n    0x78,\n    0x79,\n    0x7a,\n    0x82,\n    0x83,\n    0x84,\n    0x85,\n    0x86,\n    0x87,\n    0x88,\n    0x89,\n    0x8a,\n    0x92,\n    0x93,\n    0x94,\n    0x95,\n    0x96,\n    0x97,\n    0x98,\n    0x99,\n    0x9a,\n    0xa2,\n    0xa3,\n    0xa4,\n    0xa5,\n    0xa6,\n    0xa7,\n    0xa8,\n    0xa9,\n    0xaa,\n    0xb2,\n    0xb3,\n    0xb4,\n    0xb5,\n    0xb6,\n    0xb7,\n    0xb8,\n    0xb9,\n    0xba,\n    0xc2,\n    0xc3,\n    0xc4,\n    0xc5,\n    0xc6,\n    0xc7,\n    0xc8,\n    0xc9,\n    0xca,\n    0xd2,\n    0xd3,\n    0xd4,\n    0xd5,\n    0xd6,\n    0xd7,\n    0xd8,\n    0xd9,\n    0xda,\n    0xe2,\n    0xe3,\n    0xe4,\n    0xe5,\n    0xe6,\n    0xe7,\n    0xe8,\n    0xe9,\n    0xea,\n    0xf2,\n    0xf3,\n    0xf4,\n    0xf5,\n    0xf6,\n    0xf7,\n    0xf8,\n    0xf9,\n    0xfa\n  ];\n\n  function initQuantTables(sf) {\n    var YQT = [\n      16,\n      11,\n      10,\n      16,\n      24,\n      40,\n      51,\n      61,\n      12,\n      12,\n      14,\n      19,\n      26,\n      58,\n      60,\n      55,\n      14,\n      13,\n      16,\n      24,\n      40,\n      57,\n      69,\n      56,\n      14,\n      17,\n      22,\n      29,\n      51,\n      87,\n      80,\n      62,\n      18,\n      22,\n      37,\n      56,\n      68,\n      109,\n      103,\n      77,\n      24,\n      35,\n      55,\n      64,\n      81,\n      104,\n      113,\n      92,\n      49,\n      64,\n      78,\n      87,\n      103,\n      121,\n      120,\n      101,\n      72,\n      92,\n      95,\n      98,\n      112,\n      100,\n      103,\n      99\n    ];\n\n    for (var i = 0; i < 64; i++) {\n      var t = ffloor((YQT[i] * sf + 50) / 100);\n      t = Math.min(Math.max(t, 1), 255);\n      YTable[ZigZag[i]] = t;\n    }\n    var UVQT = [\n      17,\n      18,\n      24,\n      47,\n      99,\n      99,\n      99,\n      99,\n      18,\n      21,\n      26,\n      66,\n      99,\n      99,\n      99,\n      99,\n      24,\n      26,\n      56,\n      99,\n      99,\n      99,\n      99,\n      99,\n      47,\n      66,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99,\n      99\n    ];\n    for (var j = 0; j < 64; j++) {\n      var u = ffloor((UVQT[j] * sf + 50) / 100);\n      u = Math.min(Math.max(u, 1), 255);\n      UVTable[ZigZag[j]] = u;\n    }\n    var aasf = [\n      1.0,\n      1.387039845,\n      1.306562965,\n      1.175875602,\n      1.0,\n      0.785694958,\n      0.5411961,\n      0.275899379\n    ];\n    var k = 0;\n    for (var row = 0; row < 8; row++) {\n      for (var col = 0; col < 8; col++) {\n        fdtbl_Y[k] = 1.0 / (YTable[ZigZag[k]] * aasf[row] * aasf[col] * 8.0);\n        fdtbl_UV[k] = 1.0 / (UVTable[ZigZag[k]] * aasf[row] * aasf[col] * 8.0);\n        k++;\n      }\n    }\n  }\n\n  function computeHuffmanTbl(nrcodes, std_table) {\n    var codevalue = 0;\n    var pos_in_table = 0;\n    var HT = new Array();\n    for (var k = 1; k <= 16; k++) {\n      for (var j = 1; j <= nrcodes[k]; j++) {\n        HT[std_table[pos_in_table]] = [];\n        HT[std_table[pos_in_table]][0] = codevalue;\n        HT[std_table[pos_in_table]][1] = k;\n        pos_in_table++;\n        codevalue++;\n      }\n      codevalue *= 2;\n    }\n    return HT;\n  }\n\n  function initHuffmanTbl() {\n    YDC_HT = computeHuffmanTbl(\n      std_dc_luminance_nrcodes,\n      std_dc_luminance_values\n    );\n    UVDC_HT = computeHuffmanTbl(\n      std_dc_chrominance_nrcodes,\n      std_dc_chrominance_values\n    );\n    YAC_HT = computeHuffmanTbl(\n      std_ac_luminance_nrcodes,\n      std_ac_luminance_values\n    );\n    UVAC_HT = computeHuffmanTbl(\n      std_ac_chrominance_nrcodes,\n      std_ac_chrominance_values\n    );\n  }\n\n  function initCategoryNumber() {\n    var nrlower = 1;\n    var nrupper = 2;\n    for (var cat = 1; cat <= 15; cat++) {\n      //Positive numbers\n      for (var nr = nrlower; nr < nrupper; nr++) {\n        category[32767 + nr] = cat;\n        bitcode[32767 + nr] = [];\n        bitcode[32767 + nr][1] = cat;\n        bitcode[32767 + nr][0] = nr;\n      }\n      //Negative numbers\n      for (var nrneg = -(nrupper - 1); nrneg <= -nrlower; nrneg++) {\n        category[32767 + nrneg] = cat;\n        bitcode[32767 + nrneg] = [];\n        bitcode[32767 + nrneg][1] = cat;\n        bitcode[32767 + nrneg][0] = nrupper - 1 + nrneg;\n      }\n      nrlower <<= 1;\n      nrupper <<= 1;\n    }\n  }\n\n  function initRGBYUVTable() {\n    for (var i = 0; i < 256; i++) {\n      RGB_YUV_TABLE[i] = 19595 * i;\n      RGB_YUV_TABLE[(i + 256) >> 0] = 38470 * i;\n      RGB_YUV_TABLE[(i + 512) >> 0] = 7471 * i + 0x8000;\n      RGB_YUV_TABLE[(i + 768) >> 0] = -11059 * i;\n      RGB_YUV_TABLE[(i + 1024) >> 0] = -21709 * i;\n      RGB_YUV_TABLE[(i + 1280) >> 0] = 32768 * i + 0x807fff;\n      RGB_YUV_TABLE[(i + 1536) >> 0] = -27439 * i;\n      RGB_YUV_TABLE[(i + 1792) >> 0] = -5329 * i;\n    }\n  }\n\n  // IO functions\n  function writeBits(bs) {\n    var value = bs[0];\n    var posval = bs[1] - 1;\n    while (posval >= 0) {\n      if (value & (1 << posval)) {\n        bytenew |= 1 << bytepos;\n      }\n      posval--;\n      bytepos--;\n      if (bytepos < 0) {\n        if (bytenew == 0xff) {\n          writeByte(0xff);\n          writeByte(0);\n        } else {\n          writeByte(bytenew);\n        }\n        bytepos = 7;\n        bytenew = 0;\n      }\n    }\n  }\n\n  function writeByte(value) {\n    //byteout.push(clt[value]); // write char directly instead of converting later\n    byteout.push(value);\n  }\n\n  function writeWord(value) {\n    writeByte((value >> 8) & 0xff);\n    writeByte(value & 0xff);\n  }\n\n  // DCT & quantization core\n  function fDCTQuant(data, fdtbl) {\n    var d0, d1, d2, d3, d4, d5, d6, d7;\n    /* Pass 1: process rows. */\n    var dataOff = 0;\n    var i;\n    var I8 = 8;\n    var I64 = 64;\n    for (i = 0; i < I8; ++i) {\n      d0 = data[dataOff];\n      d1 = data[dataOff + 1];\n      d2 = data[dataOff + 2];\n      d3 = data[dataOff + 3];\n      d4 = data[dataOff + 4];\n      d5 = data[dataOff + 5];\n      d6 = data[dataOff + 6];\n      d7 = data[dataOff + 7];\n\n      var tmp0 = d0 + d7;\n      var tmp7 = d0 - d7;\n      var tmp1 = d1 + d6;\n      var tmp6 = d1 - d6;\n      var tmp2 = d2 + d5;\n      var tmp5 = d2 - d5;\n      var tmp3 = d3 + d4;\n      var tmp4 = d3 - d4;\n\n      /* Even part */\n      var tmp10 = tmp0 + tmp3; /* phase 2 */\n      var tmp13 = tmp0 - tmp3;\n      var tmp11 = tmp1 + tmp2;\n      var tmp12 = tmp1 - tmp2;\n\n      data[dataOff] = tmp10 + tmp11; /* phase 3 */\n      data[dataOff + 4] = tmp10 - tmp11;\n\n      var z1 = (tmp12 + tmp13) * 0.707106781; /* c4 */\n      data[dataOff + 2] = tmp13 + z1; /* phase 5 */\n      data[dataOff + 6] = tmp13 - z1;\n\n      /* Odd part */\n      tmp10 = tmp4 + tmp5; /* phase 2 */\n      tmp11 = tmp5 + tmp6;\n      tmp12 = tmp6 + tmp7;\n\n      /* The rotator is modified from fig 4-8 to avoid extra negations. */\n      var z5 = (tmp10 - tmp12) * 0.382683433; /* c6 */\n      var z2 = 0.5411961 * tmp10 + z5; /* c2-c6 */\n      var z4 = 1.306562965 * tmp12 + z5; /* c2+c6 */\n      var z3 = tmp11 * 0.707106781; /* c4 */\n\n      var z11 = tmp7 + z3; /* phase 5 */\n      var z13 = tmp7 - z3;\n\n      data[dataOff + 5] = z13 + z2; /* phase 6 */\n      data[dataOff + 3] = z13 - z2;\n      data[dataOff + 1] = z11 + z4;\n      data[dataOff + 7] = z11 - z4;\n\n      dataOff += 8; /* advance pointer to next row */\n    }\n\n    /* Pass 2: process columns. */\n    dataOff = 0;\n    for (i = 0; i < I8; ++i) {\n      d0 = data[dataOff];\n      d1 = data[dataOff + 8];\n      d2 = data[dataOff + 16];\n      d3 = data[dataOff + 24];\n      d4 = data[dataOff + 32];\n      d5 = data[dataOff + 40];\n      d6 = data[dataOff + 48];\n      d7 = data[dataOff + 56];\n\n      var tmp0p2 = d0 + d7;\n      var tmp7p2 = d0 - d7;\n      var tmp1p2 = d1 + d6;\n      var tmp6p2 = d1 - d6;\n      var tmp2p2 = d2 + d5;\n      var tmp5p2 = d2 - d5;\n      var tmp3p2 = d3 + d4;\n      var tmp4p2 = d3 - d4;\n\n      /* Even part */\n      var tmp10p2 = tmp0p2 + tmp3p2; /* phase 2 */\n      var tmp13p2 = tmp0p2 - tmp3p2;\n      var tmp11p2 = tmp1p2 + tmp2p2;\n      var tmp12p2 = tmp1p2 - tmp2p2;\n\n      data[dataOff] = tmp10p2 + tmp11p2; /* phase 3 */\n      data[dataOff + 32] = tmp10p2 - tmp11p2;\n\n      var z1p2 = (tmp12p2 + tmp13p2) * 0.707106781; /* c4 */\n      data[dataOff + 16] = tmp13p2 + z1p2; /* phase 5 */\n      data[dataOff + 48] = tmp13p2 - z1p2;\n\n      /* Odd part */\n      tmp10p2 = tmp4p2 + tmp5p2; /* phase 2 */\n      tmp11p2 = tmp5p2 + tmp6p2;\n      tmp12p2 = tmp6p2 + tmp7p2;\n\n      /* The rotator is modified from fig 4-8 to avoid extra negations. */\n      var z5p2 = (tmp10p2 - tmp12p2) * 0.382683433; /* c6 */\n      var z2p2 = 0.5411961 * tmp10p2 + z5p2; /* c2-c6 */\n      var z4p2 = 1.306562965 * tmp12p2 + z5p2; /* c2+c6 */\n      var z3p2 = tmp11p2 * 0.707106781; /* c4 */\n\n      var z11p2 = tmp7p2 + z3p2; /* phase 5 */\n      var z13p2 = tmp7p2 - z3p2;\n\n      data[dataOff + 40] = z13p2 + z2p2; /* phase 6 */\n      data[dataOff + 24] = z13p2 - z2p2;\n      data[dataOff + 8] = z11p2 + z4p2;\n      data[dataOff + 56] = z11p2 - z4p2;\n\n      dataOff++; /* advance pointer to next column */\n    }\n\n    // Quantize/descale the coefficients\n    var fDCTQuant;\n    for (i = 0; i < I64; ++i) {\n      // Apply the quantization and scaling factor & Round to nearest integer\n      fDCTQuant = data[i] * fdtbl[i];\n      outputfDCTQuant[i] =\n        fDCTQuant > 0.0 ? (fDCTQuant + 0.5) | 0 : (fDCTQuant - 0.5) | 0;\n      //outputfDCTQuant[i] = fround(fDCTQuant);\n    }\n    return outputfDCTQuant;\n  }\n\n  function writeAPP0() {\n    writeWord(0xffe0); // marker\n    writeWord(16); // length\n    writeByte(0x4a); // J\n    writeByte(0x46); // F\n    writeByte(0x49); // I\n    writeByte(0x46); // F\n    writeByte(0); // = \"JFIF\",'\\0'\n    writeByte(1); // versionhi\n    writeByte(1); // versionlo\n    writeByte(0); // xyunits\n    writeWord(1); // xdensity\n    writeWord(1); // ydensity\n    writeByte(0); // thumbnwidth\n    writeByte(0); // thumbnheight\n  }\n\n  function writeSOF0(width, height) {\n    writeWord(0xffc0); // marker\n    writeWord(17); // length, truecolor YUV JPG\n    writeByte(8); // precision\n    writeWord(height);\n    writeWord(width);\n    writeByte(3); // nrofcomponents\n    writeByte(1); // IdY\n    writeByte(0x11); // HVY\n    writeByte(0); // QTY\n    writeByte(2); // IdU\n    writeByte(0x11); // HVU\n    writeByte(1); // QTU\n    writeByte(3); // IdV\n    writeByte(0x11); // HVV\n    writeByte(1); // QTV\n  }\n\n  function writeDQT() {\n    writeWord(0xffdb); // marker\n    writeWord(132); // length\n    writeByte(0);\n    for (var i = 0; i < 64; i++) {\n      writeByte(YTable[i]);\n    }\n    writeByte(1);\n    for (var j = 0; j < 64; j++) {\n      writeByte(UVTable[j]);\n    }\n  }\n\n  function writeDHT() {\n    writeWord(0xffc4); // marker\n    writeWord(0x01a2); // length\n\n    writeByte(0); // HTYDCinfo\n    for (var i = 0; i < 16; i++) {\n      writeByte(std_dc_luminance_nrcodes[i + 1]);\n    }\n    for (var j = 0; j <= 11; j++) {\n      writeByte(std_dc_luminance_values[j]);\n    }\n\n    writeByte(0x10); // HTYACinfo\n    for (var k = 0; k < 16; k++) {\n      writeByte(std_ac_luminance_nrcodes[k + 1]);\n    }\n    for (var l = 0; l <= 161; l++) {\n      writeByte(std_ac_luminance_values[l]);\n    }\n\n    writeByte(1); // HTUDCinfo\n    for (var m = 0; m < 16; m++) {\n      writeByte(std_dc_chrominance_nrcodes[m + 1]);\n    }\n    for (var n = 0; n <= 11; n++) {\n      writeByte(std_dc_chrominance_values[n]);\n    }\n\n    writeByte(0x11); // HTUACinfo\n    for (var o = 0; o < 16; o++) {\n      writeByte(std_ac_chrominance_nrcodes[o + 1]);\n    }\n    for (var p = 0; p <= 161; p++) {\n      writeByte(std_ac_chrominance_values[p]);\n    }\n  }\n\n  function writeSOS() {\n    writeWord(0xffda); // marker\n    writeWord(12); // length\n    writeByte(3); // nrofcomponents\n    writeByte(1); // IdY\n    writeByte(0); // HTY\n    writeByte(2); // IdU\n    writeByte(0x11); // HTU\n    writeByte(3); // IdV\n    writeByte(0x11); // HTV\n    writeByte(0); // Ss\n    writeByte(0x3f); // Se\n    writeByte(0); // Bf\n  }\n\n  function processDU(CDU, fdtbl, DC, HTDC, HTAC) {\n    var EOB = HTAC[0x00];\n    var M16zeroes = HTAC[0xf0];\n    var pos;\n    var I16 = 16;\n    var I63 = 63;\n    var I64 = 64;\n    var DU_DCT = fDCTQuant(CDU, fdtbl);\n    //ZigZag reorder\n    for (var j = 0; j < I64; ++j) {\n      DU[ZigZag[j]] = DU_DCT[j];\n    }\n    var Diff = DU[0] - DC;\n    DC = DU[0];\n    //Encode DC\n    if (Diff == 0) {\n      writeBits(HTDC[0]); // Diff might be 0\n    } else {\n      pos = 32767 + Diff;\n      writeBits(HTDC[category[pos]]);\n      writeBits(bitcode[pos]);\n    }\n    //Encode ACs\n    var end0pos = 63; // was const... which is crazy\n    while (end0pos > 0 && DU[end0pos] == 0) {\n      end0pos--;\n    }\n    //end0pos = first element in reverse order !=0\n    if (end0pos == 0) {\n      writeBits(EOB);\n      return DC;\n    }\n    var i = 1;\n    var lng;\n    while (i <= end0pos) {\n      var startpos = i;\n      while (DU[i] == 0 && i <= end0pos) {\n        ++i;\n      }\n      var nrzeroes = i - startpos;\n      if (nrzeroes >= I16) {\n        lng = nrzeroes >> 4;\n        for (var nrmarker = 1; nrmarker <= lng; ++nrmarker)\n          writeBits(M16zeroes);\n        nrzeroes = nrzeroes & 0xf;\n      }\n      pos = 32767 + DU[i];\n      writeBits(HTAC[(nrzeroes << 4) + category[pos]]);\n      writeBits(bitcode[pos]);\n      i++;\n    }\n    if (end0pos != I63) {\n      writeBits(EOB);\n    }\n    return DC;\n  }\n\n  function initCharLookupTable() {\n    var sfcc = String.fromCharCode;\n    for (var i = 0; i < 256; i++) {\n      ///// ACHTUNG // 255\n      clt[i] = sfcc(i);\n    }\n  }\n\n  this.encode = function(\n    image,\n    quality // image data object\n  ) {\n    if (quality) setQuality(quality);\n\n    // Initialize bit writer\n    byteout = new Array();\n    bytenew = 0;\n    bytepos = 7;\n\n    // Add JPEG headers\n    writeWord(0xffd8); // SOI\n    writeAPP0();\n    writeDQT();\n    writeSOF0(image.width, image.height);\n    writeDHT();\n    writeSOS();\n\n    // Encode 8x8 macroblocks\n    var DCY = 0;\n    var DCU = 0;\n    var DCV = 0;\n\n    bytenew = 0;\n    bytepos = 7;\n\n    this.encode.displayName = \"_encode_\";\n\n    var imageData = image.data;\n    var width = image.width;\n    var height = image.height;\n\n    var quadWidth = width * 4;\n\n    var x,\n      y = 0;\n    var r, g, b;\n    var start, p, col, row, pos;\n    while (y < height) {\n      x = 0;\n      while (x < quadWidth) {\n        start = quadWidth * y + x;\n        col = -1;\n        row = 0;\n\n        for (pos = 0; pos < 64; pos++) {\n          row = pos >> 3; // /8\n          col = (pos & 7) * 4; // %8\n          p = start + row * quadWidth + col;\n\n          if (y + row >= height) {\n            // padding bottom\n            p -= quadWidth * (y + 1 + row - height);\n          }\n\n          if (x + col >= quadWidth) {\n            // padding right\n            p -= x + col - quadWidth + 4;\n          }\n\n          r = imageData[p++];\n          g = imageData[p++];\n          b = imageData[p++];\n\n          /* // calculate YUV values dynamically\n\t\t\t\t\tYDU[pos]=((( 0.29900)*r+( 0.58700)*g+( 0.11400)*b))-128; //-0x80\n\t\t\t\t\tUDU[pos]=(((-0.16874)*r+(-0.33126)*g+( 0.50000)*b));\n\t\t\t\t\tVDU[pos]=((( 0.50000)*r+(-0.41869)*g+(-0.08131)*b));\n\t\t\t\t\t*/\n\n          // use lookup table (slightly faster)\n          YDU[pos] =\n            ((RGB_YUV_TABLE[r] +\n              RGB_YUV_TABLE[(g + 256) >> 0] +\n              RGB_YUV_TABLE[(b + 512) >> 0]) >>\n              16) -\n            128;\n          UDU[pos] =\n            ((RGB_YUV_TABLE[(r + 768) >> 0] +\n              RGB_YUV_TABLE[(g + 1024) >> 0] +\n              RGB_YUV_TABLE[(b + 1280) >> 0]) >>\n              16) -\n            128;\n          VDU[pos] =\n            ((RGB_YUV_TABLE[(r + 1280) >> 0] +\n              RGB_YUV_TABLE[(g + 1536) >> 0] +\n              RGB_YUV_TABLE[(b + 1792) >> 0]) >>\n              16) -\n            128;\n        }\n\n        DCY = processDU(YDU, fdtbl_Y, DCY, YDC_HT, YAC_HT);\n        DCU = processDU(UDU, fdtbl_UV, DCU, UVDC_HT, UVAC_HT);\n        DCV = processDU(VDU, fdtbl_UV, DCV, UVDC_HT, UVAC_HT);\n        x += 32;\n      }\n      y += 8;\n    }\n\n    ////////////////////////////////////////////////////////////////\n\n    // Do the bit alignment of the EOI marker\n    if (bytepos >= 0) {\n      var fillbits = [];\n      fillbits[1] = bytepos + 1;\n      fillbits[0] = (1 << (bytepos + 1)) - 1;\n      writeBits(fillbits);\n    }\n\n    writeWord(0xffd9); //EOI\n\n    return new Uint8Array(byteout);\n  };\n\n  function setQuality(quality) {\n    quality = Math.min(Math.max(quality, 1), 100);\n\n    if (currentQuality == quality) return; // don't recalc if unchanged\n\n    var sf =\n      quality < 50 ? Math.floor(5000 / quality) : Math.floor(200 - quality * 2);\n\n    initQuantTables(sf);\n    currentQuality = quality;\n    //console.log('Quality set to: '+quality +'%');\n  }\n\n  function init() {\n    quality = quality || 50;\n    // Create tables\n    initCharLookupTable();\n    initHuffmanTbl();\n    initCategoryNumber();\n    initRGBYUVTable();\n\n    setQuality(quality);\n  }\n  init();\n}\n\nexport { JPEGEncoder };\n","/**\n * @author shaozilee\n *\n * Bmp format decoder,support 1bit 4bit 8bit 24bit bmp\n *\n */\n\nimport { console } from \"./console.js\";\n\nfunction BmpDecoder(buffer, is_with_alpha) {\n  this.pos = 0;\n  this.buffer = buffer;\n  this.datav = new DataView(buffer.buffer);\n  this.is_with_alpha = !!is_with_alpha;\n  this.bottom_up = true;\n  this.flag =\n    String.fromCharCode(this.buffer[0]) + String.fromCharCode(this.buffer[1]);\n  this.pos += 2;\n  if ([\"BM\", \"BA\", \"CI\", \"CP\", \"IC\", \"PT\"].indexOf(this.flag) === -1)\n    throw new Error(\"Invalid BMP File\");\n  this.parseHeader();\n  this.parseBGR();\n}\n\nBmpDecoder.prototype.parseHeader = function() {\n  this.fileSize = this.datav.getUint32(this.pos, true);\n  this.pos += 4;\n  this.reserved = this.datav.getUint32(this.pos, true);\n  this.pos += 4;\n  this.offset = this.datav.getUint32(this.pos, true);\n  this.pos += 4;\n  this.headerSize = this.datav.getUint32(this.pos, true);\n  this.pos += 4;\n  this.width = this.datav.getUint32(this.pos, true);\n  this.pos += 4;\n  this.height = this.datav.getInt32(this.pos, true);\n  this.pos += 4;\n  this.planes = this.datav.getUint16(this.pos, true);\n  this.pos += 2;\n  this.bitPP = this.datav.getUint16(this.pos, true);\n  this.pos += 2;\n  this.compress = this.datav.getUint32(this.pos, true);\n  this.pos += 4;\n  this.rawSize = this.datav.getUint32(this.pos, true);\n  this.pos += 4;\n  this.hr = this.datav.getUint32(this.pos, true);\n  this.pos += 4;\n  this.vr = this.datav.getUint32(this.pos, true);\n  this.pos += 4;\n  this.colors = this.datav.getUint32(this.pos, true);\n  this.pos += 4;\n  this.importantColors = this.datav.getUint32(this.pos, true);\n  this.pos += 4;\n\n  if (this.bitPP === 16 && this.is_with_alpha) {\n    this.bitPP = 15;\n  }\n  if (this.bitPP < 15) {\n    var len = this.colors === 0 ? 1 << this.bitPP : this.colors;\n    this.palette = new Array(len);\n    for (var i = 0; i < len; i++) {\n      var blue = this.datav.getUint8(this.pos++, true);\n      var green = this.datav.getUint8(this.pos++, true);\n      var red = this.datav.getUint8(this.pos++, true);\n      var quad = this.datav.getUint8(this.pos++, true);\n      this.palette[i] = {\n        red: red,\n        green: green,\n        blue: blue,\n        quad: quad\n      };\n    }\n  }\n  if (this.height < 0) {\n    this.height *= -1;\n    this.bottom_up = false;\n  }\n};\n\nBmpDecoder.prototype.parseBGR = function() {\n  this.pos = this.offset;\n  try {\n    var bitn = \"bit\" + this.bitPP;\n    var len = this.width * this.height * 4;\n    this.data = new Uint8Array(len);\n\n    this[bitn]();\n  } catch (e) {\n    console.log(\"bit decode error:\" + e);\n  }\n};\n\nBmpDecoder.prototype.bit1 = function() {\n  var xlen = Math.ceil(this.width / 8);\n  var mode = xlen % 4;\n  var y;\n  for (y = this.height - 1; y >= 0; y--) {\n    var line = this.bottom_up ? y : this.height - 1 - y;\n    for (var x = 0; x < xlen; x++) {\n      var b = this.datav.getUint8(this.pos++, true);\n      var location = line * this.width * 4 + x * 8 * 4;\n      for (var i = 0; i < 8; i++) {\n        if (x * 8 + i < this.width) {\n          var rgb = this.palette[(b >> (7 - i)) & 0x1];\n          this.data[location + i * 4] = rgb.blue;\n          this.data[location + i * 4 + 1] = rgb.green;\n          this.data[location + i * 4 + 2] = rgb.red;\n          this.data[location + i * 4 + 3] = 0xff;\n        } else {\n          break;\n        }\n      }\n    }\n\n    if (mode !== 0) {\n      this.pos += 4 - mode;\n    }\n  }\n};\n\nBmpDecoder.prototype.bit4 = function() {\n  var xlen = Math.ceil(this.width / 2);\n  var mode = xlen % 4;\n  for (var y = this.height - 1; y >= 0; y--) {\n    var line = this.bottom_up ? y : this.height - 1 - y;\n    for (var x = 0; x < xlen; x++) {\n      var b = this.datav.getUint8(this.pos++, true);\n      var location = line * this.width * 4 + x * 2 * 4;\n\n      var before = b >> 4;\n      var after = b & 0x0f;\n\n      var rgb = this.palette[before];\n      this.data[location] = rgb.blue;\n      this.data[location + 1] = rgb.green;\n      this.data[location + 2] = rgb.red;\n      this.data[location + 3] = 0xff;\n\n      if (x * 2 + 1 >= this.width) break;\n\n      rgb = this.palette[after];\n      this.data[location + 4] = rgb.blue;\n      this.data[location + 4 + 1] = rgb.green;\n      this.data[location + 4 + 2] = rgb.red;\n      this.data[location + 4 + 3] = 0xff;\n    }\n\n    if (mode !== 0) {\n      this.pos += 4 - mode;\n    }\n  }\n};\n\nBmpDecoder.prototype.bit8 = function() {\n  var mode = this.width % 4;\n  for (var y = this.height - 1; y >= 0; y--) {\n    var line = this.bottom_up ? y : this.height - 1 - y;\n    for (var x = 0; x < this.width; x++) {\n      var b = this.datav.getUint8(this.pos++, true);\n      var location = line * this.width * 4 + x * 4;\n      if (b < this.palette.length) {\n        var rgb = this.palette[b];\n        this.data[location] = rgb.red;\n        this.data[location + 1] = rgb.green;\n        this.data[location + 2] = rgb.blue;\n        this.data[location + 3] = 0xff;\n      } else {\n        this.data[location] = 0xff;\n        this.data[location + 1] = 0xff;\n        this.data[location + 2] = 0xff;\n        this.data[location + 3] = 0xff;\n      }\n    }\n    if (mode !== 0) {\n      this.pos += 4 - mode;\n    }\n  }\n};\n\nBmpDecoder.prototype.bit15 = function() {\n  var dif_w = this.width % 3;\n  var _11111 = parseInt(\"11111\", 2),\n    _1_5 = _11111;\n  for (var y = this.height - 1; y >= 0; y--) {\n    var line = this.bottom_up ? y : this.height - 1 - y;\n    for (var x = 0; x < this.width; x++) {\n      var B = this.datav.getUint16(this.pos, true);\n      this.pos += 2;\n      var blue = (((B & _1_5) / _1_5) * 255) | 0;\n      var green = ((((B >> 5) & _1_5) / _1_5) * 255) | 0;\n      var red = ((((B >> 10) & _1_5) / _1_5) * 255) | 0;\n      var alpha = B >> 15 ? 0xff : 0x00;\n\n      var location = line * this.width * 4 + x * 4;\n      this.data[location] = red;\n      this.data[location + 1] = green;\n      this.data[location + 2] = blue;\n      this.data[location + 3] = alpha;\n    }\n    //skip extra bytes\n    this.pos += dif_w;\n  }\n};\n\nBmpDecoder.prototype.bit16 = function() {\n  var dif_w = this.width % 3;\n  var _11111 = parseInt(\"11111\", 2),\n    _1_5 = _11111;\n  var _111111 = parseInt(\"111111\", 2),\n    _1_6 = _111111;\n  for (var y = this.height - 1; y >= 0; y--) {\n    var line = this.bottom_up ? y : this.height - 1 - y;\n    for (var x = 0; x < this.width; x++) {\n      var B = this.datav.getUint16(this.pos, true);\n      this.pos += 2;\n      var alpha = 0xff;\n      var blue = (((B & _1_5) / _1_5) * 255) | 0;\n      var green = ((((B >> 5) & _1_6) / _1_6) * 255) | 0;\n      var red = (((B >> 11) / _1_5) * 255) | 0;\n\n      var location = line * this.width * 4 + x * 4;\n      this.data[location] = red;\n      this.data[location + 1] = green;\n      this.data[location + 2] = blue;\n      this.data[location + 3] = alpha;\n    }\n    //skip extra bytes\n    this.pos += dif_w;\n  }\n};\n\nBmpDecoder.prototype.bit24 = function() {\n  //when height > 0\n  for (var y = this.height - 1; y >= 0; y--) {\n    var line = this.bottom_up ? y : this.height - 1 - y;\n    for (var x = 0; x < this.width; x++) {\n      var blue = this.datav.getUint8(this.pos++, true);\n      var green = this.datav.getUint8(this.pos++, true);\n      var red = this.datav.getUint8(this.pos++, true);\n      var location = line * this.width * 4 + x * 4;\n      this.data[location] = red;\n      this.data[location + 1] = green;\n      this.data[location + 2] = blue;\n      this.data[location + 3] = 0xff;\n    }\n    //skip extra bytes\n    this.pos += this.width % 4;\n  }\n};\n\n/**\n * add 32bit decode func\n * @author soubok\n */\nBmpDecoder.prototype.bit32 = function() {\n  //when height > 0\n  for (var y = this.height - 1; y >= 0; y--) {\n    var line = this.bottom_up ? y : this.height - 1 - y;\n    for (var x = 0; x < this.width; x++) {\n      var blue = this.datav.getUint8(this.pos++, true);\n      var green = this.datav.getUint8(this.pos++, true);\n      var red = this.datav.getUint8(this.pos++, true);\n      var alpha = this.datav.getUint8(this.pos++, true);\n      var location = line * this.width * 4 + x * 4;\n      this.data[location] = red;\n      this.data[location + 1] = green;\n      this.data[location + 2] = blue;\n      this.data[location + 3] = alpha;\n    }\n    //skip extra bytes\n    //this.pos += (this.width % 4);\n  }\n};\n\nBmpDecoder.prototype.getData = function() {\n  return this.data;\n};\n\nexport { BmpDecoder };\n","function WebPDecoder(imageData) {\n  /** @license\n   * Copyright 2011 Google Inc.\n   *\n   * This code is licensed under the same terms as WebM:\n   *  Software License Agreement:  http://www.webmproject.org/license/software/\n   *  Additional IP Rights Grant:  http://www.webmproject.org/license/additional/\n   * -----------------------------------------------------------------------------\n   *\n   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n   * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n   * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n   * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n   * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n   * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n   * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n   * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n   *\n   * -----------------------------------------------------------------------------\n   *\n   * Copyright 2011-2017 Dominik Homberger\n   * Libwebp Javascript / libwebpjs - the libwebp implementation in javascript (v0.6.0)\n   *\n   * Author: Dominik Homberger (dominik.homberger@gmail.com)\n   */\n\n  var self = this;\n  var UpsampleRgbLinePair,\n    UpsampleBgrLinePair,\n    UpsampleRgbaLinePair,\n    UpsampleBgraLinePair,\n    UpsampleArgbLinePair,\n    UpsampleArgbLinePair,\n    UpsampleRgba4444LinePair,\n    UpsampleRgb565LinePair;\n\n  function x(F) {\n    if (!F) throw Error(\"assert :P\");\n  }\n  function fa(F, L, J) {\n    for (var H = 0; 4 > H; H++) if (F[L + H] != J.charCodeAt(H)) return !0;\n    return !1;\n  }\n  function I(F, L, J, H, Z) {\n    for (var O = 0; O < Z; O++) F[L + O] = J[H + O];\n  }\n  function M(F, L, J, H) {\n    for (var Z = 0; Z < H; Z++) F[L + Z] = J;\n  }\n  function V(F) {\n    return new Int32Array(F);\n  }\n  function wa(F, L) {\n    for (var J = [], H = 0; H < F; H++) J.push(new L());\n    return J;\n  }\n  function wb() {\n    function F(J, H, Z) {\n      for (var O = Z[H], L = 0; L < O; L++) {\n        J.push(Z.length > H + 1 ? [] : 0);\n        if (Z.length < H + 1) break;\n        F(J[L], H + 1, Z);\n      }\n    }\n    var L = [];\n    F(L, 0, [3, 11]);\n    return L;\n  }\n  function Ed(F, L) {\n    function J(H, O, F) {\n      for (var Z = F[O], ma = 0; ma < Z; ma++) {\n        H.push(F.length > O + 1 ? [] : new L());\n        if (F.length < O + 1) break;\n        J(H[ma], O + 1, F);\n      }\n    }\n    var H = [];\n    J(H, 0, F);\n    return H;\n  }\n  var _WebPDecoder = function() {\n    var self = this;\n    function F() {\n      V(55);\n    }\n    function L(a, b) {\n      for (var c = (1 << (b - 1)) >>> 0; a & c; ) c >>>= 1;\n      return c ? (a & (c - 1)) + c : a;\n    }\n    function J(a, b, c, d, e) {\n      x(!(d % c));\n      do (d -= c), (a[b + d] = e);\n      while (0 < d);\n    }\n    function H(a, b, c, d, e, f) {\n      var g = b,\n        h = 1 << c,\n        k,\n        l,\n        m = V(16),\n        n = V(16);\n      x(0 != e);\n      x(null != d);\n      x(null != a);\n      x(0 < c);\n      for (l = 0; l < e; ++l) {\n        if (15 < d[l]) return 0;\n        ++m[d[l]];\n      }\n      if (m[0] == e) return 0;\n      n[1] = 0;\n      for (k = 1; 15 > k; ++k) {\n        if (m[k] > 1 << k) return 0;\n        n[k + 1] = n[k] + m[k];\n      }\n      for (l = 0; l < e; ++l) (k = d[l]), 0 < d[l] && (f[n[k]++] = l);\n      if (1 == n[15])\n        return (d = new O()), (d.g = 0), (d.value = f[0]), J(a, g, 1, h, d), h;\n      var r = -1,\n        q = h - 1,\n        t = 0,\n        v = 1,\n        p = 1,\n        u,\n        w = 1 << c;\n      l = 0;\n      k = 1;\n      for (e = 2; k <= c; ++k, e <<= 1) {\n        p <<= 1;\n        v += p;\n        p -= m[k];\n        if (0 > p) return 0;\n        for (; 0 < m[k]; --m[k])\n          (d = new O()),\n            (d.g = k),\n            (d.value = f[l++]),\n            J(a, g + t, e, w, d),\n            (t = L(t, k));\n      }\n      k = c + 1;\n      for (e = 2; 15 >= k; ++k, e <<= 1) {\n        p <<= 1;\n        v += p;\n        p -= m[k];\n        if (0 > p) return 0;\n        for (; 0 < m[k]; --m[k]) {\n          d = new O();\n          if ((t & q) != r) {\n            g += w;\n            r = k;\n            for (u = 1 << (r - c); 15 > r; ) {\n              u -= m[r];\n              if (0 >= u) break;\n              ++r;\n              u <<= 1;\n            }\n            u = r - c;\n            w = 1 << u;\n            h += w;\n            r = t & q;\n            a[b + r].g = u + c;\n            a[b + r].value = g - b - r;\n          }\n          d.g = k - c;\n          d.value = f[l++];\n          J(a, g + (t >> c), e, w, d);\n          t = L(t, k);\n        }\n      }\n      return v != 2 * n[15] - 1 ? 0 : h;\n    }\n    function Z(a, b, c, d, e) {\n      x(2328 >= e);\n      if (512 >= e) var f = V(512);\n      else if (((f = V(e)), null == f)) return 0;\n      return H(a, b, c, d, e, f);\n    }\n    function O() {\n      this.value = this.g = 0;\n    }\n    function Fd() {\n      this.value = this.g = 0;\n    }\n    function Ub() {\n      this.G = wa(5, O);\n      this.H = V(5);\n      this.jc = this.Qb = this.qb = this.nd = 0;\n      this.pd = wa(xb, Fd);\n    }\n    function ma(a, b, c, d) {\n      x(null != a);\n      x(null != b);\n      x(2147483648 > d);\n      a.Ca = 254;\n      a.I = 0;\n      a.b = -8;\n      a.Ka = 0;\n      a.oa = b;\n      a.pa = c;\n      a.Jd = b;\n      a.Yc = c + d;\n      a.Zc = 4 <= d ? c + d - 4 + 1 : c;\n      Qa(a);\n    }\n    function na(a, b) {\n      for (var c = 0; 0 < b--; ) c |= K(a, 128) << b;\n      return c;\n    }\n    function ca(a, b) {\n      var c = na(a, b);\n      return G(a) ? -c : c;\n    }\n    function cb(a, b, c, d) {\n      var e,\n        f = 0;\n      x(null != a);\n      x(null != b);\n      x(4294967288 > d);\n      a.Sb = d;\n      a.Ra = 0;\n      a.u = 0;\n      a.h = 0;\n      4 < d && (d = 4);\n      for (e = 0; e < d; ++e) f += b[c + e] << (8 * e);\n      a.Ra = f;\n      a.bb = d;\n      a.oa = b;\n      a.pa = c;\n    }\n    function Vb(a) {\n      for (; 8 <= a.u && a.bb < a.Sb; )\n        (a.Ra >>>= 8),\n          (a.Ra += (a.oa[a.pa + a.bb] << (ob - 8)) >>> 0),\n          ++a.bb,\n          (a.u -= 8);\n      db(a) && ((a.h = 1), (a.u = 0));\n    }\n    function D(a, b) {\n      x(0 <= b);\n      if (!a.h && b <= Gd) {\n        var c = pb(a) & Hd[b];\n        a.u += b;\n        Vb(a);\n        return c;\n      }\n      a.h = 1;\n      return (a.u = 0);\n    }\n    function Wb() {\n      this.b = this.Ca = this.I = 0;\n      this.oa = [];\n      this.pa = 0;\n      this.Jd = [];\n      this.Yc = 0;\n      this.Zc = [];\n      this.Ka = 0;\n    }\n    function Ra() {\n      this.Ra = 0;\n      this.oa = [];\n      this.h = this.u = this.bb = this.Sb = this.pa = 0;\n    }\n    function pb(a) {\n      return (a.Ra >>> (a.u & (ob - 1))) >>> 0;\n    }\n    function db(a) {\n      x(a.bb <= a.Sb);\n      return a.h || (a.bb == a.Sb && a.u > ob);\n    }\n    function qb(a, b) {\n      a.u = b;\n      a.h = db(a);\n    }\n    function Sa(a) {\n      a.u >= Xb && (x(a.u >= Xb), Vb(a));\n    }\n    function Qa(a) {\n      x(null != a && null != a.oa);\n      a.pa < a.Zc\n        ? ((a.I = (a.oa[a.pa++] | (a.I << 8)) >>> 0), (a.b += 8))\n        : (x(null != a && null != a.oa),\n          a.pa < a.Yc\n            ? ((a.b += 8), (a.I = a.oa[a.pa++] | (a.I << 8)))\n            : a.Ka\n            ? (a.b = 0)\n            : ((a.I <<= 8), (a.b += 8), (a.Ka = 1)));\n    }\n    function G(a) {\n      return na(a, 1);\n    }\n    function K(a, b) {\n      var c = a.Ca;\n      0 > a.b && Qa(a);\n      var d = a.b,\n        e = (c * b) >>> 8,\n        f = (a.I >>> d > e) + 0;\n      f ? ((c -= e), (a.I -= ((e + 1) << d) >>> 0)) : (c = e + 1);\n      d = c;\n      for (e = 0; 256 <= d; ) (e += 8), (d >>= 8);\n      d = 7 ^ (e + Id[d]);\n      a.b -= d;\n      a.Ca = (c << d) - 1;\n      return f;\n    }\n    function ra(a, b, c) {\n      a[b + 0] = (c >> 24) & 255;\n      a[b + 1] = (c >> 16) & 255;\n      a[b + 2] = (c >> 8) & 255;\n      a[b + 3] = (c >> 0) & 255;\n    }\n    function Ta(a, b) {\n      return (a[b + 0] << 0) | (a[b + 1] << 8);\n    }\n    function Yb(a, b) {\n      return Ta(a, b) | (a[b + 2] << 16);\n    }\n    function Ha(a, b) {\n      return Ta(a, b) | (Ta(a, b + 2) << 16);\n    }\n    function Zb(a, b) {\n      var c = 1 << b;\n      x(null != a);\n      x(0 < b);\n      a.X = V(c);\n      if (null == a.X) return 0;\n      a.Mb = 32 - b;\n      a.Xa = b;\n      return 1;\n    }\n    function $b(a, b) {\n      x(null != a);\n      x(null != b);\n      x(a.Xa == b.Xa);\n      I(b.X, 0, a.X, 0, 1 << b.Xa);\n    }\n    function ac() {\n      this.X = [];\n      this.Xa = this.Mb = 0;\n    }\n    function bc(a, b, c, d) {\n      x(null != c);\n      x(null != d);\n      var e = c[0],\n        f = d[0];\n      0 == e && (e = (a * f + b / 2) / b);\n      0 == f && (f = (b * e + a / 2) / a);\n      if (0 >= e || 0 >= f) return 0;\n      c[0] = e;\n      d[0] = f;\n      return 1;\n    }\n    function xa(a, b) {\n      return (a + (1 << b) - 1) >>> b;\n    }\n    function yb(a, b) {\n      return (\n        (((((a & 4278255360) + (b & 4278255360)) >>> 0) & 4278255360) +\n          ((((a & 16711935) + (b & 16711935)) >>> 0) & 16711935)) >>>\n        0\n      );\n    }\n    function X(a, b) {\n      self[b] = function(b, d, e, f, g, h, k) {\n        var c;\n        for (c = 0; c < g; ++c) {\n          var m = self[a](h[k + c - 1], e, f + c);\n          h[k + c] = yb(b[d + c], m);\n        }\n      };\n    }\n    function Jd() {\n      this.ud = this.hd = this.jd = 0;\n    }\n    function aa(a, b) {\n      return ((((a ^ b) & 4278124286) >>> 1) + (a & b)) >>> 0;\n    }\n    function sa(a) {\n      if (0 <= a && 256 > a) return a;\n      if (0 > a) return 0;\n      if (255 < a) return 255;\n    }\n    function eb(a, b) {\n      return sa(a + ((a - b + 0.5) >> 1));\n    }\n    function Ia(a, b, c) {\n      return Math.abs(b - c) - Math.abs(a - c);\n    }\n    function cc(a, b, c, d, e, f, g) {\n      d = f[g - 1];\n      for (c = 0; c < e; ++c) f[g + c] = d = yb(a[b + c], d);\n    }\n    function Kd(a, b, c, d, e) {\n      var f;\n      for (f = 0; f < c; ++f) {\n        var g = a[b + f],\n          h = (g >> 8) & 255,\n          k = g & 16711935,\n          k = k + ((h << 16) + h),\n          k = k & 16711935;\n        d[e + f] = ((g & 4278255360) + k) >>> 0;\n      }\n    }\n    function dc(a, b) {\n      b.jd = (a >> 0) & 255;\n      b.hd = (a >> 8) & 255;\n      b.ud = (a >> 16) & 255;\n    }\n    function Ld(a, b, c, d, e, f) {\n      var g;\n      for (g = 0; g < d; ++g) {\n        var h = b[c + g],\n          k = h >>> 8,\n          l = h >>> 16,\n          m = h,\n          l = l + ((((a.jd << 24) >> 24) * ((k << 24) >> 24)) >>> 5),\n          l = l & 255,\n          m = m + ((((a.hd << 24) >> 24) * ((k << 24) >> 24)) >>> 5),\n          m = m + ((((a.ud << 24) >> 24) * ((l << 24) >> 24)) >>> 5),\n          m = m & 255;\n        e[f + g] = (h & 4278255360) + (l << 16) + m;\n      }\n    }\n    function ec(a, b, c, d, e) {\n      self[b] = function(a, b, c, k, l, m, n, r, q) {\n        for (k = n; k < r; ++k)\n          for (n = 0; n < q; ++n) l[m++] = e(c[d(a[b++])]);\n      };\n      self[a] = function(a, b, h, k, l, m, n) {\n        var f = 8 >> a.b,\n          g = a.Ea,\n          t = a.K[0],\n          v = a.w;\n        if (8 > f)\n          for (a = (1 << a.b) - 1, v = (1 << f) - 1; b < h; ++b) {\n            var p = 0,\n              u;\n            for (u = 0; u < g; ++u)\n              u & a || (p = d(k[l++])), (m[n++] = e(t[p & v])), (p >>= f);\n          }\n        else self[\"VP8LMapColor\" + c](k, l, t, v, m, n, b, h, g);\n      };\n    }\n    function Md(a, b, c, d, e) {\n      for (c = b + c; b < c; ) {\n        var f = a[b++];\n        d[e++] = (f >> 16) & 255;\n        d[e++] = (f >> 8) & 255;\n        d[e++] = (f >> 0) & 255;\n      }\n    }\n    function Nd(a, b, c, d, e) {\n      for (c = b + c; b < c; ) {\n        var f = a[b++];\n        d[e++] = (f >> 16) & 255;\n        d[e++] = (f >> 8) & 255;\n        d[e++] = (f >> 0) & 255;\n        d[e++] = (f >> 24) & 255;\n      }\n    }\n    function Od(a, b, c, d, e) {\n      for (c = b + c; b < c; ) {\n        var f = a[b++],\n          g = ((f >> 16) & 240) | ((f >> 12) & 15),\n          f = ((f >> 0) & 240) | ((f >> 28) & 15);\n        d[e++] = g;\n        d[e++] = f;\n      }\n    }\n    function Pd(a, b, c, d, e) {\n      for (c = b + c; b < c; ) {\n        var f = a[b++],\n          g = ((f >> 16) & 248) | ((f >> 13) & 7),\n          f = ((f >> 5) & 224) | ((f >> 3) & 31);\n        d[e++] = g;\n        d[e++] = f;\n      }\n    }\n    function Qd(a, b, c, d, e) {\n      for (c = b + c; b < c; ) {\n        var f = a[b++];\n        d[e++] = (f >> 0) & 255;\n        d[e++] = (f >> 8) & 255;\n        d[e++] = (f >> 16) & 255;\n      }\n    }\n    function fb(a, b, c, d, e, f) {\n      if (0 == f)\n        for (c = b + c; b < c; )\n          (f = a[b++]),\n            ra(\n              d,\n              ((f[0] >> 24) |\n                ((f[1] >> 8) & 65280) |\n                ((f[2] << 8) & 16711680) |\n                (f[3] << 24)) >>>\n                0\n            ),\n            (e += 32);\n      else I(d, e, a, b, c);\n    }\n    function gb(a, b) {\n      self[b][0] = self[a + \"0\"];\n      self[b][1] = self[a + \"1\"];\n      self[b][2] = self[a + \"2\"];\n      self[b][3] = self[a + \"3\"];\n      self[b][4] = self[a + \"4\"];\n      self[b][5] = self[a + \"5\"];\n      self[b][6] = self[a + \"6\"];\n      self[b][7] = self[a + \"7\"];\n      self[b][8] = self[a + \"8\"];\n      self[b][9] = self[a + \"9\"];\n      self[b][10] = self[a + \"10\"];\n      self[b][11] = self[a + \"11\"];\n      self[b][12] = self[a + \"12\"];\n      self[b][13] = self[a + \"13\"];\n      self[b][14] = self[a + \"0\"];\n      self[b][15] = self[a + \"0\"];\n    }\n    function hb(a) {\n      return a == zb || a == Ab || a == Ja || a == Bb;\n    }\n    function Rd() {\n      this.eb = [];\n      this.size = this.A = this.fb = 0;\n    }\n    function Sd() {\n      this.y = [];\n      this.f = [];\n      this.ea = [];\n      this.F = [];\n      this.Tc = this.Ed = this.Cd = this.Fd = this.lb = this.Db = this.Ab = this.fa = this.J = this.W = this.N = this.O = 0;\n    }\n    function Cb() {\n      this.Rd = this.height = this.width = this.S = 0;\n      this.f = {};\n      this.f.RGBA = new Rd();\n      this.f.kb = new Sd();\n      this.sd = null;\n    }\n    function Td() {\n      this.width = [0];\n      this.height = [0];\n      this.Pd = [0];\n      this.Qd = [0];\n      this.format = [0];\n    }\n    function Ud() {\n      this.Id = this.fd = this.Md = this.hb = this.ib = this.da = this.bd = this.cd = this.j = this.v = this.Da = this.Sd = this.ob = 0;\n    }\n    function Vd(a) {\n      alert(\"todo:WebPSamplerProcessPlane\");\n      return a.T;\n    }\n    function Wd(a, b) {\n      var c = a.T,\n        d = b.ba.f.RGBA,\n        e = d.eb,\n        f = d.fb + a.ka * d.A,\n        g = P[b.ba.S],\n        h = a.y,\n        k = a.O,\n        l = a.f,\n        m = a.N,\n        n = a.ea,\n        r = a.W,\n        q = b.cc,\n        t = b.dc,\n        v = b.Mc,\n        p = b.Nc,\n        u = a.ka,\n        w = a.ka + a.T,\n        y = a.U,\n        A = (y + 1) >> 1;\n      0 == u\n        ? g(h, k, null, null, l, m, n, r, l, m, n, r, e, f, null, null, y)\n        : (g(b.ec, b.fc, h, k, q, t, v, p, l, m, n, r, e, f - d.A, e, f, y),\n          ++c);\n      for (; u + 2 < w; u += 2)\n        (q = l),\n          (t = m),\n          (v = n),\n          (p = r),\n          (m += a.Rc),\n          (r += a.Rc),\n          (f += 2 * d.A),\n          (k += 2 * a.fa),\n          g(h, k - a.fa, h, k, q, t, v, p, l, m, n, r, e, f - d.A, e, f, y);\n      k += a.fa;\n      a.j + w < a.o\n        ? (I(b.ec, b.fc, h, k, y),\n          I(b.cc, b.dc, l, m, A),\n          I(b.Mc, b.Nc, n, r, A),\n          c--)\n        : w & 1 ||\n          g(\n            h,\n            k,\n            null,\n            null,\n            l,\n            m,\n            n,\n            r,\n            l,\n            m,\n            n,\n            r,\n            e,\n            f + d.A,\n            null,\n            null,\n            y\n          );\n      return c;\n    }\n    function Xd(a, b, c) {\n      var d = a.F,\n        e = [a.J];\n      if (null != d) {\n        var f = a.U,\n          g = b.ba.S,\n          h = g == ya || g == Ja;\n        b = b.ba.f.RGBA;\n        var k = [0],\n          l = a.ka;\n        k[0] = a.T;\n        a.Kb &&\n          (0 == l ? --k[0] : (--l, (e[0] -= a.width)),\n          a.j + a.ka + a.T == a.o && (k[0] = a.o - a.j - l));\n        var m = b.eb,\n          l = b.fb + l * b.A;\n        a = fc(d, e[0], a.width, f, k, m, l + (h ? 0 : 3), b.A);\n        x(c == k);\n        a && hb(g) && za(m, l, h, f, k, b.A);\n      }\n      return 0;\n    }\n    function gc(a) {\n      var b = a.ma,\n        c = b.ba.S,\n        d = 11 > c,\n        e = c == Ua || c == Va || c == ya || c == Db || 12 == c || hb(c);\n      b.memory = null;\n      b.Ib = null;\n      b.Jb = null;\n      b.Nd = null;\n      if (!hc(b.Oa, a, e ? 11 : 12)) return 0;\n      e && hb(c) && ic();\n      if (a.da) alert(\"todo:use_scaling\");\n      else {\n        if (d) {\n          if (((b.Ib = Vd), a.Kb)) {\n            c = (a.U + 1) >> 1;\n            b.memory = V(a.U + 2 * c);\n            if (null == b.memory) return 0;\n            b.ec = b.memory;\n            b.fc = 0;\n            b.cc = b.ec;\n            b.dc = b.fc + a.U;\n            b.Mc = b.cc;\n            b.Nc = b.dc + c;\n            b.Ib = Wd;\n            ic();\n          }\n        } else alert(\"todo:EmitYUV\");\n        e && ((b.Jb = Xd), d && Aa());\n      }\n      if (d && !jc) {\n        for (a = 0; 256 > a; ++a)\n          (Yd[a] = (89858 * (a - 128) + Ba) >> Wa),\n            (Zd[a] = -22014 * (a - 128) + Ba),\n            ($d[a] = -45773 * (a - 128)),\n            (ae[a] = (113618 * (a - 128) + Ba) >> Wa);\n        for (a = ta; a < Eb; ++a)\n          (b = (76283 * (a - 16) + Ba) >> Wa),\n            (be[a - ta] = ga(b, 255)),\n            (ce[a - ta] = ga((b + 8) >> 4, 15));\n        jc = 1;\n      }\n      return 1;\n    }\n    function kc(a) {\n      var b = a.ma,\n        c = a.U,\n        d = a.T;\n      x(!(a.ka & 1));\n      if (0 >= c || 0 >= d) return 0;\n      c = b.Ib(a, b);\n      null != b.Jb && b.Jb(a, b, c);\n      b.Dc += c;\n      return 1;\n    }\n    function lc(a) {\n      a.ma.memory = null;\n    }\n    function mc(a, b, c, d) {\n      if (47 != D(a, 8)) return 0;\n      b[0] = D(a, 14) + 1;\n      c[0] = D(a, 14) + 1;\n      d[0] = D(a, 1);\n      return 0 != D(a, 3) ? 0 : !a.h;\n    }\n    function ib(a, b) {\n      if (4 > a) return a + 1;\n      var c = (a - 2) >> 1;\n      return ((2 + (a & 1)) << c) + D(b, c) + 1;\n    }\n    function nc(a, b) {\n      if (120 < b) return b - 120;\n      var c = de[b - 1],\n        c = (c >> 4) * a + (8 - (c & 15));\n      return 1 <= c ? c : 1;\n    }\n    function ua(a, b, c) {\n      var d = pb(c);\n      b += d & 255;\n      var e = a[b].g - 8;\n      0 < e &&\n        (qb(c, c.u + 8),\n        (d = pb(c)),\n        (b += a[b].value),\n        (b += d & ((1 << e) - 1)));\n      qb(c, c.u + a[b].g);\n      return a[b].value;\n    }\n    function ub(a, b, c) {\n      c.g += a.g;\n      c.value += (a.value << b) >>> 0;\n      x(8 >= c.g);\n      return a.g;\n    }\n    function ha(a, b, c) {\n      var d = a.xc;\n      b = 0 == d ? 0 : a.vc[a.md * (c >> d) + (b >> d)];\n      x(b < a.Wb);\n      return a.Ya[b];\n    }\n    function oc(a, b, c, d) {\n      var e = a.ab,\n        f = a.c * b,\n        g = a.C;\n      b = g + b;\n      var h = c,\n        k = d;\n      d = a.Ta;\n      for (c = a.Ua; 0 < e--; ) {\n        var l = a.gc[e],\n          m = g,\n          n = b,\n          r = h,\n          q = k,\n          k = d,\n          h = c,\n          t = l.Ea;\n        x(m < n);\n        x(n <= l.nc);\n        switch (l.hc) {\n          case 2:\n            pc(r, q, (n - m) * t, k, h);\n            break;\n          case 0:\n            var v = l,\n              p = m,\n              u = n,\n              w = k,\n              y = h,\n              A = v.Ea;\n            0 == p &&\n              (ee(r, q, null, null, 1, w, y),\n              cc(r, q + 1, 0, 0, A - 1, w, y + 1),\n              (q += A),\n              (y += A),\n              ++p);\n            for (\n              var E = 1 << v.b,\n                B = E - 1,\n                C = xa(A, v.b),\n                N = v.K,\n                v = v.w + (p >> v.b) * C;\n              p < u;\n\n            ) {\n              var z = N,\n                Q = v,\n                S = 1;\n              for (fe(r, q, w, y - A, 1, w, y); S < A; ) {\n                var K = qc[(z[Q++] >> 8) & 15],\n                  D = (S & ~B) + E;\n                D > A && (D = A);\n                K(r, q + +S, w, y + S - A, D - S, w, y + S);\n                S = D;\n              }\n              q += A;\n              y += A;\n              ++p;\n              p & B || (v += C);\n            }\n            n != l.nc && I(k, h - t, k, h + (n - m - 1) * t, t);\n            break;\n          case 1:\n            t = r;\n            u = q;\n            r = l.Ea;\n            q = 1 << l.b;\n            w = q - 1;\n            y = r & ~w;\n            A = r - y;\n            p = xa(r, l.b);\n            E = l.K;\n            for (l = l.w + (m >> l.b) * p; m < n; ) {\n              B = E;\n              C = l;\n              N = new Jd();\n              v = u + y;\n              for (z = u + r; u < v; )\n                dc(B[C++], N), Fb(N, t, u, q, k, h), (u += q), (h += q);\n              u < z &&\n                (dc(B[C++], N), Fb(N, t, u, A, k, h), (u += A), (h += A));\n              ++m;\n              m & w || (l += p);\n            }\n            break;\n          case 3:\n            if (r == k && q == h && 0 < l.b) {\n              y = (n - m) * xa(l.Ea, l.b);\n              t = h + (n - m) * t - y;\n              u = k;\n              r = t;\n              q = k;\n              w = h;\n              A = y;\n              p = [];\n              for (y = A - 1; 0 <= y; --y) p[y] = q[w + y];\n              for (y = A - 1; 0 <= y; --y) u[r + y] = p[y];\n              rc(l, m, n, k, t, k, h);\n            } else rc(l, m, n, r, q, k, h);\n        }\n        h = d;\n        k = c;\n      }\n      k != c && I(d, c, h, k, f);\n    }\n    function ge(a, b) {\n      var c = a.V,\n        d = a.Ba + a.c * a.C,\n        e = b - a.C;\n      x(b <= a.l.o);\n      x(16 >= e);\n      if (0 < e) {\n        var f = a.l,\n          g = a.Ta,\n          h = a.Ua,\n          k = f.width;\n        oc(a, e, c, d);\n        h = [h];\n        c = a.C;\n        d = b;\n        e = h;\n        x(c < d);\n        x(f.v < f.va);\n        d > f.o && (d = f.o);\n        if (c < f.j) {\n          var l = f.j - c,\n            c = f.j;\n          e[0] += l * k;\n        }\n        c >= d\n          ? (c = 0)\n          : ((e[0] += 4 * f.v),\n            (f.ka = c - f.j),\n            (f.U = f.va - f.v),\n            (f.T = d - c),\n            (c = 1));\n        if (c) {\n          h = h[0];\n          c = a.ca;\n          if (11 > c.S) {\n            for (\n              var m = c.f.RGBA,\n                d = c.S,\n                e = f.U,\n                f = f.T,\n                l = m.eb,\n                n = m.A,\n                r = f,\n                m = m.fb + a.Ma * m.A;\n              0 < r--;\n\n            ) {\n              var q = g,\n                t = h,\n                v = e,\n                p = l,\n                u = m;\n              switch (d) {\n                case Ca:\n                  sc(q, t, v, p, u);\n                  break;\n                case Ua:\n                  Gb(q, t, v, p, u);\n                  break;\n                case zb:\n                  Gb(q, t, v, p, u);\n                  za(p, u, 0, v, 1, 0);\n                  break;\n                case tc:\n                  uc(q, t, v, p, u);\n                  break;\n                case Va:\n                  fb(q, t, v, p, u, 1);\n                  break;\n                case Ab:\n                  fb(q, t, v, p, u, 1);\n                  za(p, u, 0, v, 1, 0);\n                  break;\n                case ya:\n                  fb(q, t, v, p, u, 0);\n                  break;\n                case Ja:\n                  fb(q, t, v, p, u, 0);\n                  za(p, u, 1, v, 1, 0);\n                  break;\n                case Db:\n                  Hb(q, t, v, p, u);\n                  break;\n                case Bb:\n                  Hb(q, t, v, p, u);\n                  vc(p, u, v, 1, 0);\n                  break;\n                case wc:\n                  xc(q, t, v, p, u);\n                  break;\n                default:\n                  x(0);\n              }\n              h += k;\n              m += n;\n            }\n            a.Ma += f;\n          } else alert(\"todo:EmitRescaledRowsYUVA\");\n          x(a.Ma <= c.height);\n        }\n      }\n      a.C = b;\n      x(a.C <= a.i);\n    }\n    function yc(a) {\n      var b;\n      if (0 < a.ua) return 0;\n      for (b = 0; b < a.Wb; ++b) {\n        var c = a.Ya[b].G,\n          d = a.Ya[b].H;\n        if (\n          0 < c[1][d[1] + 0].g ||\n          0 < c[2][d[2] + 0].g ||\n          0 < c[3][d[3] + 0].g\n        )\n          return 0;\n      }\n      return 1;\n    }\n    function zc(a, b, c, d, e, f) {\n      if (0 != a.Z) {\n        var g = a.qd,\n          h = a.rd;\n        for (x(null != ia[a.Z]); b < c; ++b)\n          ia[a.Z](g, h, d, e, d, e, f), (g = d), (h = e), (e += f);\n        a.qd = g;\n        a.rd = h;\n      }\n    }\n    function Ib(a, b) {\n      var c = a.l.ma,\n        d = 0 == c.Z || 1 == c.Z ? a.l.j : a.C,\n        d = a.C < d ? d : a.C;\n      x(b <= a.l.o);\n      if (b > d) {\n        var e = a.l.width,\n          f = c.ca,\n          g = c.tb + e * d,\n          h = a.V,\n          k = a.Ba + a.c * d,\n          l = a.gc;\n        x(1 == a.ab);\n        x(3 == l[0].hc);\n        he(l[0], d, b, h, k, f, g);\n        zc(c, d, b, f, g, e);\n      }\n      a.C = a.Ma = b;\n    }\n    function Jb(a, b, c, d, e, f, g) {\n      var h = a.$ / d,\n        k = a.$ % d,\n        l = a.m,\n        m = a.s,\n        n = c + a.$,\n        r = n;\n      e = c + d * e;\n      var q = c + d * f,\n        t = 280 + m.ua,\n        v = a.Pb ? h : 16777216,\n        p = 0 < m.ua ? m.Wa : null,\n        u = m.wc,\n        w = n < q ? ha(m, k, h) : null;\n      x(a.C < f);\n      x(q <= e);\n      var y = !1;\n      a: for (;;) {\n        for (; y || n < q; ) {\n          var A = 0;\n          if (h >= v) {\n            var v = a,\n              E = n - c;\n            x(v.Pb);\n            v.wd = v.m;\n            v.xd = E;\n            0 < v.s.ua && $b(v.s.Wa, v.s.vb);\n            v = h + ie;\n          }\n          k & u || (w = ha(m, k, h));\n          x(null != w);\n          w.Qb && ((b[n] = w.qb), (y = !0));\n          if (!y)\n            if ((Sa(l), w.jc)) {\n              var A = l,\n                E = b,\n                B = n,\n                C = w.pd[pb(A) & (xb - 1)];\n              x(w.jc);\n              256 > C.g\n                ? (qb(A, A.u + C.g), (E[B] = C.value), (A = 0))\n                : (qb(A, A.u + C.g - 256), x(256 <= C.value), (A = C.value));\n              0 == A && (y = !0);\n            } else A = ua(w.G[0], w.H[0], l);\n          if (l.h) break;\n          if (y || 256 > A) {\n            if (!y)\n              if (w.nd) b[n] = (w.qb | (A << 8)) >>> 0;\n              else {\n                Sa(l);\n                y = ua(w.G[1], w.H[1], l);\n                Sa(l);\n                E = ua(w.G[2], w.H[2], l);\n                B = ua(w.G[3], w.H[3], l);\n                if (l.h) break;\n                b[n] = ((B << 24) | (y << 16) | (A << 8) | E) >>> 0;\n              }\n            y = !1;\n            ++n;\n            ++k;\n            if (\n              k >= d &&\n              ((k = 0),\n              ++h,\n              null != g && h <= f && !(h % 16) && g(a, h),\n              null != p)\n            )\n              for (; r < n; )\n                (A = b[r++]),\n                  (p.X[((506832829 * A) & 4294967295) >>> p.Mb] = A);\n          } else if (280 > A) {\n            A = ib(A - 256, l);\n            E = ua(w.G[4], w.H[4], l);\n            Sa(l);\n            E = ib(E, l);\n            E = nc(d, E);\n            if (l.h) break;\n            if (n - c < E || e - n < A) break a;\n            else for (B = 0; B < A; ++B) b[n + B] = b[n + B - E];\n            n += A;\n            for (k += A; k >= d; )\n              (k -= d), ++h, null != g && h <= f && !(h % 16) && g(a, h);\n            x(n <= e);\n            k & u && (w = ha(m, k, h));\n            if (null != p)\n              for (; r < n; )\n                (A = b[r++]),\n                  (p.X[((506832829 * A) & 4294967295) >>> p.Mb] = A);\n          } else if (A < t) {\n            y = A - 280;\n            for (x(null != p); r < n; )\n              (A = b[r++]), (p.X[((506832829 * A) & 4294967295) >>> p.Mb] = A);\n            A = n;\n            E = p;\n            x(!(y >>> E.Xa));\n            b[A] = E.X[y];\n            y = !0;\n          } else break a;\n          y || x(l.h == db(l));\n        }\n        if (a.Pb && l.h && n < e)\n          x(a.m.h),\n            (a.a = 5),\n            (a.m = a.wd),\n            (a.$ = a.xd),\n            0 < a.s.ua && $b(a.s.vb, a.s.Wa);\n        else if (l.h) break a;\n        else null != g && g(a, h > f ? f : h), (a.a = 0), (a.$ = n - c);\n        return 1;\n      }\n      a.a = 3;\n      return 0;\n    }\n    function Ac(a) {\n      x(null != a);\n      a.vc = null;\n      a.yc = null;\n      a.Ya = null;\n      var b = a.Wa;\n      null != b && (b.X = null);\n      a.vb = null;\n      x(null != a);\n    }\n    function Bc() {\n      var a = new je();\n      if (null == a) return null;\n      a.a = 0;\n      a.xb = Cc;\n      gb(\"Predictor\", \"VP8LPredictors\");\n      gb(\"Predictor\", \"VP8LPredictors_C\");\n      gb(\"PredictorAdd\", \"VP8LPredictorsAdd\");\n      gb(\"PredictorAdd\", \"VP8LPredictorsAdd_C\");\n      pc = Kd;\n      Fb = Ld;\n      sc = Md;\n      Gb = Nd;\n      Hb = Od;\n      xc = Pd;\n      uc = Qd;\n      self.VP8LMapColor32b = ke;\n      self.VP8LMapColor8b = le;\n      return a;\n    }\n    function rb(a, b, c, d, e) {\n      var f = 1,\n        g = [a],\n        h = [b],\n        k = d.m,\n        l = d.s,\n        m = null,\n        n = 0;\n      a: for (;;) {\n        if (c)\n          for (; f && D(k, 1); ) {\n            var r = g,\n              q = h,\n              t = d,\n              v = 1,\n              p = t.m,\n              u = t.gc[t.ab],\n              w = D(p, 2);\n            if (t.Oc & (1 << w)) f = 0;\n            else {\n              t.Oc |= 1 << w;\n              u.hc = w;\n              u.Ea = r[0];\n              u.nc = q[0];\n              u.K = [null];\n              ++t.ab;\n              x(4 >= t.ab);\n              switch (w) {\n                case 0:\n                case 1:\n                  u.b = D(p, 3) + 2;\n                  v = rb(xa(u.Ea, u.b), xa(u.nc, u.b), 0, t, u.K);\n                  u.K = u.K[0];\n                  break;\n                case 3:\n                  var y = D(p, 8) + 1,\n                    A = 16 < y ? 0 : 4 < y ? 1 : 2 < y ? 2 : 3;\n                  r[0] = xa(u.Ea, A);\n                  u.b = A;\n                  var v = rb(y, 1, 0, t, u.K),\n                    E;\n                  if ((E = v)) {\n                    var B,\n                      C = y,\n                      N = u,\n                      z = 1 << (8 >> N.b),\n                      Q = V(z);\n                    if (null == Q) E = 0;\n                    else {\n                      var S = N.K[0],\n                        K = N.w;\n                      Q[0] = N.K[0][0];\n                      for (B = 1; B < 1 * C; ++B) Q[B] = yb(S[K + B], Q[B - 1]);\n                      for (; B < 4 * z; ++B) Q[B] = 0;\n                      N.K[0] = null;\n                      N.K[0] = Q;\n                      E = 1;\n                    }\n                  }\n                  v = E;\n                  break;\n                case 2:\n                  break;\n                default:\n                  x(0);\n              }\n              f = v;\n            }\n          }\n        g = g[0];\n        h = h[0];\n        if (f && D(k, 1) && ((n = D(k, 4)), (f = 1 <= n && 11 >= n), !f)) {\n          d.a = 3;\n          break a;\n        }\n        var H;\n        if ((H = f))\n          b: {\n            var F = d,\n              G = g,\n              L = h,\n              J = n,\n              T = c,\n              Da,\n              ba,\n              X = F.m,\n              R = F.s,\n              P = [null],\n              U,\n              W = 1,\n              aa = 0,\n              na = me[J];\n            c: for (;;) {\n              if (T && D(X, 1)) {\n                var ca = D(X, 3) + 2,\n                  ga = xa(G, ca),\n                  ka = xa(L, ca),\n                  qa = ga * ka;\n                if (!rb(ga, ka, 0, F, P)) break c;\n                P = P[0];\n                R.xc = ca;\n                for (Da = 0; Da < qa; ++Da) {\n                  var ia = (P[Da] >> 8) & 65535;\n                  P[Da] = ia;\n                  ia >= W && (W = ia + 1);\n                }\n              }\n              if (X.h) break c;\n              for (ba = 0; 5 > ba; ++ba) {\n                var Y = Dc[ba];\n                !ba && 0 < J && (Y += 1 << J);\n                aa < Y && (aa = Y);\n              }\n              var ma = wa(W * na, O);\n              var ua = W,\n                va = wa(ua, Ub);\n              if (null == va) var la = null;\n              else x(65536 >= ua), (la = va);\n              var ha = V(aa);\n              if (null == la || null == ha || null == ma) {\n                F.a = 1;\n                break c;\n              }\n              var pa = ma;\n              for (Da = U = 0; Da < W; ++Da) {\n                var ja = la[Da],\n                  da = ja.G,\n                  ea = ja.H,\n                  Fa = 0,\n                  ra = 1,\n                  Ha = 0;\n                for (ba = 0; 5 > ba; ++ba) {\n                  Y = Dc[ba];\n                  da[ba] = pa;\n                  ea[ba] = U;\n                  !ba && 0 < J && (Y += 1 << J);\n                  d: {\n                    var sa,\n                      za = Y,\n                      ta = F,\n                      oa = ha,\n                      db = pa,\n                      eb = U,\n                      Ia = 0,\n                      Ka = ta.m,\n                      fb = D(Ka, 1);\n                    M(oa, 0, 0, za);\n                    if (fb) {\n                      var gb = D(Ka, 1) + 1,\n                        hb = D(Ka, 1),\n                        Ja = D(Ka, 0 == hb ? 1 : 8);\n                      oa[Ja] = 1;\n                      2 == gb && ((Ja = D(Ka, 8)), (oa[Ja] = 1));\n                      var ya = 1;\n                    } else {\n                      var Ua = V(19),\n                        Va = D(Ka, 4) + 4;\n                      if (19 < Va) {\n                        ta.a = 3;\n                        var Aa = 0;\n                        break d;\n                      }\n                      for (sa = 0; sa < Va; ++sa) Ua[ne[sa]] = D(Ka, 3);\n                      var Ba = void 0,\n                        sb = void 0,\n                        Wa = ta,\n                        ib = Ua,\n                        Ca = za,\n                        Xa = oa,\n                        Oa = 0,\n                        La = Wa.m,\n                        Ya = 8,\n                        Za = wa(128, O);\n                      e: for (;;) {\n                        if (!Z(Za, 0, 7, ib, 19)) break e;\n                        if (D(La, 1)) {\n                          var kb = 2 + 2 * D(La, 3),\n                            Ba = 2 + D(La, kb);\n                          if (Ba > Ca) break e;\n                        } else Ba = Ca;\n                        for (sb = 0; sb < Ca && Ba--; ) {\n                          Sa(La);\n                          var $a = Za[0 + (pb(La) & 127)];\n                          qb(La, La.u + $a.g);\n                          var jb = $a.value;\n                          if (16 > jb) (Xa[sb++] = jb), 0 != jb && (Ya = jb);\n                          else {\n                            var lb = 16 == jb,\n                              ab = jb - 16,\n                              mb = oe[ab],\n                              bb = D(La, pe[ab]) + mb;\n                            if (sb + bb > Ca) break e;\n                            else\n                              for (var nb = lb ? Ya : 0; 0 < bb--; )\n                                Xa[sb++] = nb;\n                          }\n                        }\n                        Oa = 1;\n                        break e;\n                      }\n                      Oa || (Wa.a = 3);\n                      ya = Oa;\n                    }\n                    (ya = ya && !Ka.h) && (Ia = Z(db, eb, 8, oa, za));\n                    ya && 0 != Ia ? (Aa = Ia) : ((ta.a = 3), (Aa = 0));\n                  }\n                  if (0 == Aa) break c;\n                  ra && 1 == qe[ba] && (ra = 0 == pa[U].g);\n                  Fa += pa[U].g;\n                  U += Aa;\n                  if (3 >= ba) {\n                    var Pa = ha[0],\n                      tb;\n                    for (tb = 1; tb < Y; ++tb) ha[tb] > Pa && (Pa = ha[tb]);\n                    Ha += Pa;\n                  }\n                }\n                ja.nd = ra;\n                ja.Qb = 0;\n                ra &&\n                  ((ja.qb =\n                    ((da[3][ea[3] + 0].value << 24) |\n                      (da[1][ea[1] + 0].value << 16) |\n                      da[2][ea[2] + 0].value) >>>\n                    0),\n                  0 == Fa &&\n                    256 > da[0][ea[0] + 0].value &&\n                    ((ja.Qb = 1), (ja.qb += da[0][ea[0] + 0].value << 8)));\n                ja.jc = !ja.Qb && 6 > Ha;\n                if (ja.jc) {\n                  var Ga,\n                    Ea = ja;\n                  for (Ga = 0; Ga < xb; ++Ga) {\n                    var Ma = Ga,\n                      Na = Ea.pd[Ma],\n                      vb = Ea.G[0][Ea.H[0] + Ma];\n                    256 <= vb.value\n                      ? ((Na.g = vb.g + 256), (Na.value = vb.value))\n                      : ((Na.g = 0),\n                        (Na.value = 0),\n                        (Ma >>= ub(vb, 8, Na)),\n                        (Ma >>= ub(Ea.G[1][Ea.H[1] + Ma], 16, Na)),\n                        (Ma >>= ub(Ea.G[2][Ea.H[2] + Ma], 0, Na)),\n                        ub(Ea.G[3][Ea.H[3] + Ma], 24, Na));\n                  }\n                }\n              }\n              R.vc = P;\n              R.Wb = W;\n              R.Ya = la;\n              R.yc = ma;\n              H = 1;\n              break b;\n            }\n            H = 0;\n          }\n        f = H;\n        if (!f) {\n          d.a = 3;\n          break a;\n        }\n        if (0 < n) {\n          if (((l.ua = 1 << n), !Zb(l.Wa, n))) {\n            d.a = 1;\n            f = 0;\n            break a;\n          }\n        } else l.ua = 0;\n        var Qa = d,\n          cb = g,\n          ob = h,\n          Ra = Qa.s,\n          Ta = Ra.xc;\n        Qa.c = cb;\n        Qa.i = ob;\n        Ra.md = xa(cb, Ta);\n        Ra.wc = 0 == Ta ? -1 : (1 << Ta) - 1;\n        if (c) {\n          d.xb = re;\n          break a;\n        }\n        m = V(g * h);\n        if (null == m) {\n          d.a = 1;\n          f = 0;\n          break a;\n        }\n        f = (f = Jb(d, m, 0, g, h, h, null)) && !k.h;\n        break a;\n      }\n      f\n        ? (null != e ? (e[0] = m) : (x(null == m), x(c)), (d.$ = 0), c || Ac(l))\n        : Ac(l);\n      return f;\n    }\n    function Ec(a, b) {\n      var c = a.c * a.i,\n        d = c + b + 16 * b;\n      x(a.c <= b);\n      a.V = V(d);\n      if (null == a.V) return (a.Ta = null), (a.Ua = 0), (a.a = 1), 0;\n      a.Ta = a.V;\n      a.Ua = a.Ba + c + b;\n      return 1;\n    }\n    function se(a, b) {\n      var c = a.C,\n        d = b - c,\n        e = a.V,\n        f = a.Ba + a.c * c;\n      for (x(b <= a.l.o); 0 < d; ) {\n        var g = 16 < d ? 16 : d,\n          h = a.l.ma,\n          k = a.l.width,\n          l = k * g,\n          m = h.ca,\n          n = h.tb + k * c,\n          r = a.Ta,\n          q = a.Ua;\n        oc(a, g, e, f);\n        Fc(r, q, m, n, l);\n        zc(h, c, c + g, m, n, k);\n        d -= g;\n        e += g * a.c;\n        c += g;\n      }\n      x(c == b);\n      a.C = a.Ma = b;\n    }\n    function te(a, b) {\n      var c = [0],\n        d = [0],\n        e = [0];\n      a: for (;;) {\n        if (null == a) return 0;\n        if (null == b) return (a.a = 2), 0;\n        a.l = b;\n        a.a = 0;\n        cb(a.m, b.data, b.w, b.ha);\n        if (!mc(a.m, c, d, e)) {\n          a.a = 3;\n          break a;\n        }\n        a.xb = Cc;\n        b.width = c[0];\n        b.height = d[0];\n        if (!rb(c[0], d[0], 1, a, null)) break a;\n        return 1;\n      }\n      x(0 != a.a);\n      return 0;\n    }\n    function ue() {\n      this.ub = this.yd = this.td = this.Rb = 0;\n    }\n    function ve() {\n      this.Kd = this.Ld = this.Ud = this.Td = this.i = this.c = 0;\n    }\n    function we() {\n      this.Fb = this.Bb = this.Cb = 0;\n      this.Zb = V(4);\n      this.Lb = V(4);\n    }\n    function Gc() {\n      this.Yb = wb();\n    }\n    function xe() {\n      this.jb = V(3);\n      this.Wc = Ed([4, 8], Gc);\n      this.Xc = Ed([4, 17], Gc);\n    }\n    function ye() {\n      this.Pc = this.wb = this.Tb = this.zd = 0;\n      this.vd = new V(4);\n      this.od = new V(4);\n    }\n    function Xa() {\n      this.ld = this.La = this.dd = this.tc = 0;\n    }\n    function Hc() {\n      this.Na = this.la = 0;\n    }\n    function ze() {\n      this.Sc = [0, 0];\n      this.Eb = [0, 0];\n      this.Qc = [0, 0];\n      this.ia = this.lc = 0;\n    }\n    function Kb() {\n      this.ad = V(384);\n      this.Za = 0;\n      this.Ob = V(16);\n      this.$b = this.Ad = this.ia = this.Gc = this.Hc = this.Dd = 0;\n    }\n    function Ae() {\n      this.uc = this.M = this.Nb = 0;\n      this.wa = Array(new Xa());\n      this.Y = 0;\n      this.ya = Array(new Kb());\n      this.aa = 0;\n      this.l = new Oa();\n    }\n    function Ic() {\n      this.y = V(16);\n      this.f = V(8);\n      this.ea = V(8);\n    }\n    function Be() {\n      this.cb = this.a = 0;\n      this.sc = \"\";\n      this.m = new Wb();\n      this.Od = new ue();\n      this.Kc = new ve();\n      this.ed = new ye();\n      this.Qa = new we();\n      this.Ic = this.$c = this.Aa = 0;\n      this.D = new Ae();\n      this.Xb = this.Va = this.Hb = this.zb = this.yb = this.Ub = this.za = 0;\n      this.Jc = wa(8, Wb);\n      this.ia = 0;\n      new F();\n      this.pb = wa(4, ze);\n      this.Pa = new xe();\n      this.Bd = this.kc = 0;\n      this.Ac = [];\n      this.Bc = 0;\n      this.zc = [0, 0, 0, 0];\n      this.Gd = Array(new Ic());\n      this.Hd = 0;\n      this.rb = Array(new Hc());\n      this.sb = 0;\n      this.wa = Array(new Xa());\n      this.Y = 0;\n      this.oc = [];\n      this.pc = 0;\n      this.sa = [];\n      this.ta = 0;\n      this.qa = [];\n      this.ra = 0;\n      this.Ha = [];\n      this.B = this.R = this.Ia = 0;\n      this.Ec = [];\n      this.M = this.ja = this.Vb = this.Fc = 0;\n      this.ya = Array(new Kb());\n      this.L = this.aa = 0;\n      this.gd = Ed([4, 2], Xa);\n      this.ga = null;\n      this.Fa = [];\n      this.Cc = this.qc = this.P = 0;\n      this.Gb = [];\n      this.Uc = 0;\n      this.mb = [];\n      this.nb = 0;\n      this.rc = [];\n      this.Ga = this.Vc = 0;\n    }\n    function ga(a, b) {\n      return 0 > a ? 0 : a > b ? b : a;\n    }\n    function Oa() {\n      this.T = this.U = this.ka = this.height = this.width = 0;\n      this.y = [];\n      this.f = [];\n      this.ea = [];\n      this.Rc = this.fa = this.W = this.N = this.O = 0;\n      this.ma = \"void\";\n      this.put = \"VP8IoPutHook\";\n      this.ac = \"VP8IoSetupHook\";\n      this.bc = \"VP8IoTeardownHook\";\n      this.ha = this.Kb = 0;\n      this.data = [];\n      this.hb = this.ib = this.da = this.o = this.j = this.va = this.v = this.Da = this.ob = this.w = 0;\n      this.F = [];\n      this.J = 0;\n    }\n    function Ce() {\n      var a = new Be();\n      null != a &&\n        ((a.a = 0), (a.sc = \"OK\"), (a.cb = 0), (a.Xb = 0), oa || (oa = De));\n      return a;\n    }\n    function T(a, b, c) {\n      0 == a.a && ((a.a = b), (a.sc = c), (a.cb = 0));\n      return 0;\n    }\n    function Jc(a, b, c) {\n      return 3 <= c && 157 == a[b + 0] && 1 == a[b + 1] && 42 == a[b + 2];\n    }\n    function Kc(a, b) {\n      if (null == a) return 0;\n      a.a = 0;\n      a.sc = \"OK\";\n      if (null == b) return T(a, 2, \"null VP8Io passed to VP8GetHeaders()\");\n      var c = b.data;\n      var d = b.w;\n      var e = b.ha;\n      if (4 > e) return T(a, 7, \"Truncated header.\");\n      var f = c[d + 0] | (c[d + 1] << 8) | (c[d + 2] << 16);\n      var g = a.Od;\n      g.Rb = !(f & 1);\n      g.td = (f >> 1) & 7;\n      g.yd = (f >> 4) & 1;\n      g.ub = f >> 5;\n      if (3 < g.td) return T(a, 3, \"Incorrect keyframe parameters.\");\n      if (!g.yd) return T(a, 4, \"Frame not displayable.\");\n      d += 3;\n      e -= 3;\n      var h = a.Kc;\n      if (g.Rb) {\n        if (7 > e) return T(a, 7, \"cannot parse picture header\");\n        if (!Jc(c, d, e)) return T(a, 3, \"Bad code word\");\n        h.c = ((c[d + 4] << 8) | c[d + 3]) & 16383;\n        h.Td = c[d + 4] >> 6;\n        h.i = ((c[d + 6] << 8) | c[d + 5]) & 16383;\n        h.Ud = c[d + 6] >> 6;\n        d += 7;\n        e -= 7;\n        a.za = (h.c + 15) >> 4;\n        a.Ub = (h.i + 15) >> 4;\n        b.width = h.c;\n        b.height = h.i;\n        b.Da = 0;\n        b.j = 0;\n        b.v = 0;\n        b.va = b.width;\n        b.o = b.height;\n        b.da = 0;\n        b.ib = b.width;\n        b.hb = b.height;\n        b.U = b.width;\n        b.T = b.height;\n        f = a.Pa;\n        M(f.jb, 0, 255, f.jb.length);\n        f = a.Qa;\n        x(null != f);\n        f.Cb = 0;\n        f.Bb = 0;\n        f.Fb = 1;\n        M(f.Zb, 0, 0, f.Zb.length);\n        M(f.Lb, 0, 0, f.Lb);\n      }\n      if (g.ub > e) return T(a, 7, \"bad partition length\");\n      f = a.m;\n      ma(f, c, d, g.ub);\n      d += g.ub;\n      e -= g.ub;\n      g.Rb && ((h.Ld = G(f)), (h.Kd = G(f)));\n      h = a.Qa;\n      var k = a.Pa,\n        l;\n      x(null != f);\n      x(null != h);\n      h.Cb = G(f);\n      if (h.Cb) {\n        h.Bb = G(f);\n        if (G(f)) {\n          h.Fb = G(f);\n          for (l = 0; 4 > l; ++l) h.Zb[l] = G(f) ? ca(f, 7) : 0;\n          for (l = 0; 4 > l; ++l) h.Lb[l] = G(f) ? ca(f, 6) : 0;\n        }\n        if (h.Bb) for (l = 0; 3 > l; ++l) k.jb[l] = G(f) ? na(f, 8) : 255;\n      } else h.Bb = 0;\n      if (f.Ka) return T(a, 3, \"cannot parse segment header\");\n      h = a.ed;\n      h.zd = G(f);\n      h.Tb = na(f, 6);\n      h.wb = na(f, 3);\n      h.Pc = G(f);\n      if (h.Pc && G(f)) {\n        for (k = 0; 4 > k; ++k) G(f) && (h.vd[k] = ca(f, 6));\n        for (k = 0; 4 > k; ++k) G(f) && (h.od[k] = ca(f, 6));\n      }\n      a.L = 0 == h.Tb ? 0 : h.zd ? 1 : 2;\n      if (f.Ka) return T(a, 3, \"cannot parse filter header\");\n      l = d;\n      var m = e;\n      e = l;\n      d = l + m;\n      h = m;\n      a.Xb = (1 << na(a.m, 2)) - 1;\n      k = a.Xb;\n      if (m < 3 * k) c = 7;\n      else {\n        l += 3 * k;\n        h -= 3 * k;\n        for (m = 0; m < k; ++m) {\n          var n = c[e + 0] | (c[e + 1] << 8) | (c[e + 2] << 16);\n          n > h && (n = h);\n          ma(a.Jc[+m], c, l, n);\n          l += n;\n          h -= n;\n          e += 3;\n        }\n        ma(a.Jc[+k], c, l, h);\n        c = l < d ? 0 : 5;\n      }\n      if (0 != c) return T(a, c, \"cannot parse partitions\");\n      l = a.m;\n      c = na(l, 7);\n      e = G(l) ? ca(l, 4) : 0;\n      d = G(l) ? ca(l, 4) : 0;\n      h = G(l) ? ca(l, 4) : 0;\n      k = G(l) ? ca(l, 4) : 0;\n      l = G(l) ? ca(l, 4) : 0;\n      m = a.Qa;\n      for (n = 0; 4 > n; ++n) {\n        if (m.Cb) {\n          var r = m.Zb[n];\n          m.Fb || (r += c);\n        } else if (0 < n) {\n          a.pb[n] = a.pb[0];\n          continue;\n        } else r = c;\n        var q = a.pb[n];\n        q.Sc[0] = Lb[ga(r + e, 127)];\n        q.Sc[1] = Mb[ga(r + 0, 127)];\n        q.Eb[0] = 2 * Lb[ga(r + d, 127)];\n        q.Eb[1] = (101581 * Mb[ga(r + h, 127)]) >> 16;\n        8 > q.Eb[1] && (q.Eb[1] = 8);\n        q.Qc[0] = Lb[ga(r + k, 117)];\n        q.Qc[1] = Mb[ga(r + l, 127)];\n        q.lc = r + l;\n      }\n      if (!g.Rb) return T(a, 4, \"Not a key frame.\");\n      G(f);\n      g = a.Pa;\n      for (c = 0; 4 > c; ++c) {\n        for (e = 0; 8 > e; ++e)\n          for (d = 0; 3 > d; ++d)\n            for (h = 0; 11 > h; ++h)\n              (k = K(f, Ee[c][e][d][h]) ? na(f, 8) : Fe[c][e][d][h]),\n                (g.Wc[c][e].Yb[d][h] = k);\n        for (e = 0; 17 > e; ++e) g.Xc[c][e] = g.Wc[c][Ge[e]];\n      }\n      a.kc = G(f);\n      a.kc && (a.Bd = na(f, 8));\n      return (a.cb = 1);\n    }\n    function De(a, b, c, d, e, f, g) {\n      var h = b[e].Yb[c];\n      for (c = 0; 16 > e; ++e) {\n        if (!K(a, h[c + 0])) return e;\n        for (; !K(a, h[c + 1]); )\n          if (((h = b[++e].Yb[0]), (c = 0), 16 == e)) return 16;\n        var k = b[e + 1].Yb;\n        if (K(a, h[c + 2])) {\n          var l = a,\n            m = h,\n            n = c;\n          var r = 0;\n          if (K(l, m[n + 3]))\n            if (K(l, m[n + 6])) {\n              h = 0;\n              r = K(l, m[n + 8]);\n              m = K(l, m[n + 9 + r]);\n              n = 2 * r + m;\n              r = 0;\n              for (m = He[n]; m[h]; ++h) r += r + K(l, m[h]);\n              r += 3 + (8 << n);\n            } else\n              K(l, m[n + 7])\n                ? ((r = 7 + 2 * K(l, 165)), (r += K(l, 145)))\n                : (r = 5 + K(l, 159));\n          else K(l, m[n + 4]) ? (r = 3 + K(l, m[n + 5])) : (r = 2);\n          h = k[2];\n        } else (r = 1), (h = k[1]);\n        k = g + Ie[e];\n        l = a;\n        0 > l.b && Qa(l);\n        var m = l.b,\n          n = l.Ca >> 1,\n          q = (n - (l.I >> m)) >> 31;\n        --l.b;\n        l.Ca += q;\n        l.Ca |= 1;\n        l.I -= ((n + 1) & q) << m;\n        f[k] = ((r ^ q) - q) * d[(0 < e) + 0];\n      }\n      return 16;\n    }\n    function Lc(a) {\n      var b = a.rb[a.sb - 1];\n      b.la = 0;\n      b.Na = 0;\n      M(a.zc, 0, 0, a.zc.length);\n      a.ja = 0;\n    }\n    function Je(a, b) {\n      for (a.M = 0; a.M < a.Va; ++a.M) {\n        var c = a.Jc[a.M & a.Xb],\n          d = a.m,\n          e = a,\n          f;\n        for (f = 0; f < e.za; ++f) {\n          var g = d;\n          var h = e;\n          var k = h.Ac,\n            l = h.Bc + 4 * f,\n            m = h.zc,\n            n = h.ya[h.aa + f];\n          h.Qa.Bb\n            ? (n.$b = K(g, h.Pa.jb[0])\n                ? 2 + K(g, h.Pa.jb[2])\n                : K(g, h.Pa.jb[1]))\n            : (n.$b = 0);\n          h.kc && (n.Ad = K(g, h.Bd));\n          n.Za = !K(g, 145) + 0;\n          if (n.Za) {\n            var r = n.Ob,\n              q = 0;\n            for (h = 0; 4 > h; ++h) {\n              var t = m[0 + h];\n              var v;\n              for (v = 0; 4 > v; ++v) {\n                t = Ke[k[l + v]][t];\n                for (var p = Mc[K(g, t[0])]; 0 < p; )\n                  p = Mc[2 * p + K(g, t[p])];\n                t = -p;\n                k[l + v] = t;\n              }\n              I(r, q, k, l, 4);\n              q += 4;\n              m[0 + h] = t;\n            }\n          } else\n            (t = K(g, 156) ? (K(g, 128) ? 1 : 3) : K(g, 163) ? 2 : 0),\n              (n.Ob[0] = t),\n              M(k, l, t, 4),\n              M(m, 0, t, 4);\n          n.Dd = K(g, 142) ? (K(g, 114) ? (K(g, 183) ? 1 : 3) : 2) : 0;\n        }\n        if (e.m.Ka) return T(a, 7, \"Premature end-of-partition0 encountered.\");\n        for (; a.ja < a.za; ++a.ja) {\n          d = a;\n          e = c;\n          g = d.rb[d.sb - 1];\n          k = d.rb[d.sb + d.ja];\n          f = d.ya[d.aa + d.ja];\n          if ((l = d.kc ? f.Ad : 0))\n            (g.la = k.la = 0),\n              f.Za || (g.Na = k.Na = 0),\n              (f.Hc = 0),\n              (f.Gc = 0),\n              (f.ia = 0);\n          else {\n            var u,\n              w,\n              g = k,\n              k = e,\n              l = d.Pa.Xc,\n              m = d.ya[d.aa + d.ja],\n              n = d.pb[m.$b];\n            h = m.ad;\n            r = 0;\n            q = d.rb[d.sb - 1];\n            t = v = 0;\n            M(h, r, 0, 384);\n            if (m.Za) {\n              var y = 0;\n              var A = l[3];\n            } else {\n              p = V(16);\n              var E = g.Na + q.Na;\n              E = oa(k, l[1], E, n.Eb, 0, p, 0);\n              g.Na = q.Na = (0 < E) + 0;\n              if (1 < E) Nc(p, 0, h, r);\n              else {\n                var B = (p[0] + 3) >> 3;\n                for (p = 0; 256 > p; p += 16) h[r + p] = B;\n              }\n              y = 1;\n              A = l[0];\n            }\n            var C = g.la & 15;\n            var N = q.la & 15;\n            for (p = 0; 4 > p; ++p) {\n              var z = N & 1;\n              for (B = w = 0; 4 > B; ++B)\n                (E = z + (C & 1)),\n                  (E = oa(k, A, E, n.Sc, y, h, r)),\n                  (z = E > y),\n                  (C = (C >> 1) | (z << 7)),\n                  (w = (w << 2) | (3 < E ? 3 : 1 < E ? 2 : 0 != h[r + 0])),\n                  (r += 16);\n              C >>= 4;\n              N = (N >> 1) | (z << 7);\n              v = ((v << 8) | w) >>> 0;\n            }\n            A = C;\n            y = N >> 4;\n            for (u = 0; 4 > u; u += 2) {\n              w = 0;\n              C = g.la >> (4 + u);\n              N = q.la >> (4 + u);\n              for (p = 0; 2 > p; ++p) {\n                z = N & 1;\n                for (B = 0; 2 > B; ++B)\n                  (E = z + (C & 1)),\n                    (E = oa(k, l[2], E, n.Qc, 0, h, r)),\n                    (z = 0 < E),\n                    (C = (C >> 1) | (z << 3)),\n                    (w = (w << 2) | (3 < E ? 3 : 1 < E ? 2 : 0 != h[r + 0])),\n                    (r += 16);\n                C >>= 2;\n                N = (N >> 1) | (z << 5);\n              }\n              t |= w << (4 * u);\n              A |= (C << 4) << u;\n              y |= (N & 240) << u;\n            }\n            g.la = A;\n            q.la = y;\n            m.Hc = v;\n            m.Gc = t;\n            m.ia = t & 43690 ? 0 : n.ia;\n            l = !(v | t);\n          }\n          0 < d.L &&\n            ((d.wa[d.Y + d.ja] = d.gd[f.$b][f.Za]),\n            (d.wa[d.Y + d.ja].La |= !l));\n          if (e.Ka) return T(a, 7, \"Premature end-of-file encountered.\");\n        }\n        Lc(a);\n        c = a;\n        d = b;\n        e = 1;\n        f = c.D;\n        g = 0 < c.L && c.M >= c.zb && c.M <= c.Va;\n        if (0 == c.Aa)\n          a: {\n            (f.M = c.M), (f.uc = g), Oc(c, f), (e = 1);\n            w = c.D;\n            f = w.Nb;\n            t = Ya[c.L];\n            g = t * c.R;\n            k = (t / 2) * c.B;\n            p = 16 * f * c.R;\n            B = 8 * f * c.B;\n            l = c.sa;\n            m = c.ta - g + p;\n            n = c.qa;\n            h = c.ra - k + B;\n            r = c.Ha;\n            q = c.Ia - k + B;\n            C = w.M;\n            N = 0 == C;\n            v = C >= c.Va - 1;\n            2 == c.Aa && Oc(c, w);\n            if (w.uc)\n              for (E = c, z = E.D.M, x(E.D.uc), w = E.yb; w < E.Hb; ++w) {\n                var Q = E;\n                y = w;\n                A = z;\n                var S = Q.D,\n                  D = S.Nb;\n                u = Q.R;\n                var S = S.wa[S.Y + y],\n                  F = Q.sa,\n                  H = Q.ta + 16 * D * u + 16 * y,\n                  J = S.dd,\n                  G = S.tc;\n                if (0 != G)\n                  if ((x(3 <= G), 1 == Q.L))\n                    0 < y && Pc(F, H, u, G + 4),\n                      S.La && Qc(F, H, u, G),\n                      0 < A && Rc(F, H, u, G + 4),\n                      S.La && Sc(F, H, u, G);\n                  else {\n                    var L = Q.B,\n                      O = Q.qa,\n                      P = Q.ra + 8 * D * L + 8 * y,\n                      R = Q.Ha,\n                      Q = Q.Ia + 8 * D * L + 8 * y,\n                      D = S.ld;\n                    0 < y &&\n                      (Tc(F, H, u, G + 4, J, D),\n                      Uc(O, P, R, Q, L, G + 4, J, D));\n                    S.La && (Vc(F, H, u, G, J, D), Wc(O, P, R, Q, L, G, J, D));\n                    0 < A &&\n                      (Xc(F, H, u, G + 4, J, D),\n                      Yc(O, P, R, Q, L, G + 4, J, D));\n                    S.La && (Zc(F, H, u, G, J, D), $c(O, P, R, Q, L, G, J, D));\n                  }\n              }\n            c.ia && alert(\"todo:DitherRow\");\n            if (null != d.put) {\n              w = 16 * C;\n              C = 16 * (C + 1);\n              N\n                ? ((d.y = c.sa),\n                  (d.O = c.ta + p),\n                  (d.f = c.qa),\n                  (d.N = c.ra + B),\n                  (d.ea = c.Ha),\n                  (d.W = c.Ia + B))\n                : ((w -= t),\n                  (d.y = l),\n                  (d.O = m),\n                  (d.f = n),\n                  (d.N = h),\n                  (d.ea = r),\n                  (d.W = q));\n              v || (C -= t);\n              C > d.o && (C = d.o);\n              d.F = null;\n              d.J = null;\n              if (\n                null != c.Fa &&\n                0 < c.Fa.length &&\n                w < C &&\n                ((d.J = Le(c, d, w, C - w)),\n                (d.F = c.mb),\n                null == d.F && 0 == d.F.length)\n              ) {\n                e = T(c, 3, \"Could not decode alpha data.\");\n                break a;\n              }\n              w < d.j &&\n                ((t = d.j - w),\n                (w = d.j),\n                x(!(t & 1)),\n                (d.O += c.R * t),\n                (d.N += c.B * (t >> 1)),\n                (d.W += c.B * (t >> 1)),\n                null != d.F && (d.J += d.width * t));\n              w < C &&\n                ((d.O += d.v),\n                (d.N += d.v >> 1),\n                (d.W += d.v >> 1),\n                null != d.F && (d.J += d.v),\n                (d.ka = w - d.j),\n                (d.U = d.va - d.v),\n                (d.T = C - w),\n                (e = d.put(d)));\n            }\n            f + 1 != c.Ic ||\n              v ||\n              (I(c.sa, c.ta - g, l, m + 16 * c.R, g),\n              I(c.qa, c.ra - k, n, h + 8 * c.B, k),\n              I(c.Ha, c.Ia - k, r, q + 8 * c.B, k));\n          }\n        if (!e) return T(a, 6, \"Output aborted.\");\n      }\n      return 1;\n    }\n    function Me(a, b) {\n      if (null == a) return 0;\n      if (null == b) return T(a, 2, \"NULL VP8Io parameter in VP8Decode().\");\n      if (!a.cb && !Kc(a, b)) return 0;\n      x(a.cb);\n      if (null == b.ac || b.ac(b)) {\n        b.ob && (a.L = 0);\n        var c = Ya[a.L];\n        2 == a.L\n          ? ((a.yb = 0), (a.zb = 0))\n          : ((a.yb = (b.v - c) >> 4),\n            (a.zb = (b.j - c) >> 4),\n            0 > a.yb && (a.yb = 0),\n            0 > a.zb && (a.zb = 0));\n        a.Va = (b.o + 15 + c) >> 4;\n        a.Hb = (b.va + 15 + c) >> 4;\n        a.Hb > a.za && (a.Hb = a.za);\n        a.Va > a.Ub && (a.Va = a.Ub);\n        if (0 < a.L) {\n          var d = a.ed;\n          for (c = 0; 4 > c; ++c) {\n            var e;\n            if (a.Qa.Cb) {\n              var f = a.Qa.Lb[c];\n              a.Qa.Fb || (f += d.Tb);\n            } else f = d.Tb;\n            for (e = 0; 1 >= e; ++e) {\n              var g = a.gd[c][e],\n                h = f;\n              d.Pc && ((h += d.vd[0]), e && (h += d.od[0]));\n              h = 0 > h ? 0 : 63 < h ? 63 : h;\n              if (0 < h) {\n                var k = h;\n                0 < d.wb &&\n                  ((k = 4 < d.wb ? k >> 2 : k >> 1),\n                  k > 9 - d.wb && (k = 9 - d.wb));\n                1 > k && (k = 1);\n                g.dd = k;\n                g.tc = 2 * h + k;\n                g.ld = 40 <= h ? 2 : 15 <= h ? 1 : 0;\n              } else g.tc = 0;\n              g.La = e;\n            }\n          }\n        }\n        c = 0;\n      } else T(a, 6, \"Frame setup failed\"), (c = a.a);\n      if ((c = 0 == c)) {\n        if (c) {\n          a.$c = 0;\n          0 < a.Aa || (a.Ic = Ne);\n          b: {\n            c = a.Ic;\n            var k = a.za,\n              d = 4 * k,\n              l = 32 * k,\n              m = k + 1,\n              n = 0 < a.L ? k * (0 < a.Aa ? 2 : 1) : 0,\n              r = (2 == a.Aa ? 2 : 1) * k;\n            e = ((3 * (16 * c + Ya[a.L])) / 2) * l;\n            f = null != a.Fa && 0 < a.Fa.length ? a.Kc.c * a.Kc.i : 0;\n            g = d + 832 + e + f;\n            if (g != g) c = 0;\n            else {\n              if (g > a.Vb) {\n                a.Vb = 0;\n                a.Ec = V(g);\n                a.Fc = 0;\n                if (null == a.Ec) {\n                  c = T(a, 1, \"no memory during frame initialization.\");\n                  break b;\n                }\n                a.Vb = g;\n              }\n              g = a.Ec;\n              h = a.Fc;\n              a.Ac = g;\n              a.Bc = h;\n              h += d;\n              a.Gd = wa(l, Ic);\n              a.Hd = 0;\n              a.rb = wa(m + 1, Hc);\n              a.sb = 1;\n              a.wa = n ? wa(n, Xa) : null;\n              a.Y = 0;\n              a.D.Nb = 0;\n              a.D.wa = a.wa;\n              a.D.Y = a.Y;\n              0 < a.Aa && (a.D.Y += k);\n              x(!0);\n              a.oc = g;\n              a.pc = h;\n              h += 832;\n              a.ya = wa(r, Kb);\n              a.aa = 0;\n              a.D.ya = a.ya;\n              a.D.aa = a.aa;\n              2 == a.Aa && (a.D.aa += k);\n              a.R = 16 * k;\n              a.B = 8 * k;\n              l = Ya[a.L];\n              k = l * a.R;\n              l = (l / 2) * a.B;\n              a.sa = g;\n              a.ta = h + k;\n              a.qa = a.sa;\n              a.ra = a.ta + 16 * c * a.R + l;\n              a.Ha = a.qa;\n              a.Ia = a.ra + 8 * c * a.B + l;\n              a.$c = 0;\n              h += e;\n              a.mb = f ? g : null;\n              a.nb = f ? h : null;\n              x(h + f <= a.Fc + a.Vb);\n              Lc(a);\n              M(a.Ac, a.Bc, 0, d);\n              c = 1;\n            }\n          }\n          if (c) {\n            b.ka = 0;\n            b.y = a.sa;\n            b.O = a.ta;\n            b.f = a.qa;\n            b.N = a.ra;\n            b.ea = a.Ha;\n            b.Vd = a.Ia;\n            b.fa = a.R;\n            b.Rc = a.B;\n            b.F = null;\n            b.J = 0;\n            if (!ad) {\n              for (c = -255; 255 >= c; ++c) bd[255 + c] = 0 > c ? -c : c;\n              for (c = -1020; 1020 >= c; ++c)\n                cd[1020 + c] = -128 > c ? -128 : 127 < c ? 127 : c;\n              for (c = -112; 112 >= c; ++c)\n                dd[112 + c] = -16 > c ? -16 : 15 < c ? 15 : c;\n              for (c = -255; 510 >= c; ++c)\n                ed[255 + c] = 0 > c ? 0 : 255 < c ? 255 : c;\n              ad = 1;\n            }\n            Nc = Oe;\n            Za = Pe;\n            Nb = Qe;\n            pa = Re;\n            Ob = Se;\n            fd = Te;\n            Xc = Ue;\n            Tc = Ve;\n            Yc = We;\n            Uc = Xe;\n            Zc = Ye;\n            Vc = Ze;\n            $c = $e;\n            Wc = af;\n            Rc = gd;\n            Pc = hd;\n            Sc = bf;\n            Qc = cf;\n            W[0] = df;\n            W[1] = ef;\n            W[2] = ff;\n            W[3] = gf;\n            W[4] = hf;\n            W[5] = jf;\n            W[6] = kf;\n            W[7] = lf;\n            W[8] = mf;\n            W[9] = nf;\n            Y[0] = of;\n            Y[1] = pf;\n            Y[2] = qf;\n            Y[3] = rf;\n            Y[4] = sf;\n            Y[5] = tf;\n            Y[6] = uf;\n            ka[0] = vf;\n            ka[1] = wf;\n            ka[2] = xf;\n            ka[3] = yf;\n            ka[4] = zf;\n            ka[5] = Af;\n            ka[6] = Bf;\n            c = 1;\n          } else c = 0;\n        }\n        c && (c = Je(a, b));\n        null != b.bc && b.bc(b);\n        c &= 1;\n      }\n      if (!c) return 0;\n      a.cb = 0;\n      return c;\n    }\n    function qa(a, b, c, d, e) {\n      e = a[b + c + 32 * d] + (e >> 3);\n      a[b + c + 32 * d] = e & -256 ? (0 > e ? 0 : 255) : e;\n    }\n    function kb(a, b, c, d, e, f) {\n      qa(a, b, 0, c, d + e);\n      qa(a, b, 1, c, d + f);\n      qa(a, b, 2, c, d - f);\n      qa(a, b, 3, c, d - e);\n    }\n    function da(a) {\n      return ((20091 * a) >> 16) + a;\n    }\n    function id(a, b, c, d) {\n      var e = 0,\n        f;\n      var g = V(16);\n      for (f = 0; 4 > f; ++f) {\n        var h = a[b + 0] + a[b + 8];\n        var k = a[b + 0] - a[b + 8];\n        var l = ((35468 * a[b + 4]) >> 16) - da(a[b + 12]);\n        var m = da(a[b + 4]) + ((35468 * a[b + 12]) >> 16);\n        g[e + 0] = h + m;\n        g[e + 1] = k + l;\n        g[e + 2] = k - l;\n        g[e + 3] = h - m;\n        e += 4;\n        b++;\n      }\n      for (f = e = 0; 4 > f; ++f)\n        (a = g[e + 0] + 4),\n          (h = a + g[e + 8]),\n          (k = a - g[e + 8]),\n          (l = ((35468 * g[e + 4]) >> 16) - da(g[e + 12])),\n          (m = da(g[e + 4]) + ((35468 * g[e + 12]) >> 16)),\n          qa(c, d, 0, 0, h + m),\n          qa(c, d, 1, 0, k + l),\n          qa(c, d, 2, 0, k - l),\n          qa(c, d, 3, 0, h - m),\n          e++,\n          (d += 32);\n    }\n    function Te(a, b, c, d) {\n      var e = a[b + 0] + 4,\n        f = (35468 * a[b + 4]) >> 16,\n        g = da(a[b + 4]),\n        h = (35468 * a[b + 1]) >> 16;\n      a = da(a[b + 1]);\n      kb(c, d, 0, e + g, a, h);\n      kb(c, d, 1, e + f, a, h);\n      kb(c, d, 2, e - f, a, h);\n      kb(c, d, 3, e - g, a, h);\n    }\n    function Pe(a, b, c, d, e) {\n      id(a, b, c, d);\n      e && id(a, b + 16, c, d + 4);\n    }\n    function Qe(a, b, c, d) {\n      Za(a, b + 0, c, d, 1);\n      Za(a, b + 32, c, d + 128, 1);\n    }\n    function Re(a, b, c, d) {\n      a = a[b + 0] + 4;\n      var e;\n      for (e = 0; 4 > e; ++e) for (b = 0; 4 > b; ++b) qa(c, d, b, e, a);\n    }\n    function Se(a, b, c, d) {\n      a[b + 0] && pa(a, b + 0, c, d);\n      a[b + 16] && pa(a, b + 16, c, d + 4);\n      a[b + 32] && pa(a, b + 32, c, d + 128);\n      a[b + 48] && pa(a, b + 48, c, d + 128 + 4);\n    }\n    function Oe(a, b, c, d) {\n      var e = V(16),\n        f;\n      for (f = 0; 4 > f; ++f) {\n        var g = a[b + 0 + f] + a[b + 12 + f];\n        var h = a[b + 4 + f] + a[b + 8 + f];\n        var k = a[b + 4 + f] - a[b + 8 + f];\n        var l = a[b + 0 + f] - a[b + 12 + f];\n        e[0 + f] = g + h;\n        e[8 + f] = g - h;\n        e[4 + f] = l + k;\n        e[12 + f] = l - k;\n      }\n      for (f = 0; 4 > f; ++f)\n        (a = e[0 + 4 * f] + 3),\n          (g = a + e[3 + 4 * f]),\n          (h = e[1 + 4 * f] + e[2 + 4 * f]),\n          (k = e[1 + 4 * f] - e[2 + 4 * f]),\n          (l = a - e[3 + 4 * f]),\n          (c[d + 0] = (g + h) >> 3),\n          (c[d + 16] = (l + k) >> 3),\n          (c[d + 32] = (g - h) >> 3),\n          (c[d + 48] = (l - k) >> 3),\n          (d += 64);\n    }\n    function Pb(a, b, c) {\n      var d = b - 32,\n        e = R,\n        f = 255 - a[d - 1],\n        g;\n      for (g = 0; g < c; ++g) {\n        var h = e,\n          k = f + a[b - 1],\n          l;\n        for (l = 0; l < c; ++l) a[b + l] = h[k + a[d + l]];\n        b += 32;\n      }\n    }\n    function ef(a, b) {\n      Pb(a, b, 4);\n    }\n    function wf(a, b) {\n      Pb(a, b, 8);\n    }\n    function pf(a, b) {\n      Pb(a, b, 16);\n    }\n    function qf(a, b) {\n      var c;\n      for (c = 0; 16 > c; ++c) I(a, b + 32 * c, a, b - 32, 16);\n    }\n    function rf(a, b) {\n      var c;\n      for (c = 16; 0 < c; --c) M(a, b, a[b - 1], 16), (b += 32);\n    }\n    function $a(a, b, c) {\n      var d;\n      for (d = 0; 16 > d; ++d) M(b, c + 32 * d, a, 16);\n    }\n    function of(a, b) {\n      var c = 16,\n        d;\n      for (d = 0; 16 > d; ++d) c += a[b - 1 + 32 * d] + a[b + d - 32];\n      $a(c >> 5, a, b);\n    }\n    function sf(a, b) {\n      var c = 8,\n        d;\n      for (d = 0; 16 > d; ++d) c += a[b - 1 + 32 * d];\n      $a(c >> 4, a, b);\n    }\n    function tf(a, b) {\n      var c = 8,\n        d;\n      for (d = 0; 16 > d; ++d) c += a[b + d - 32];\n      $a(c >> 4, a, b);\n    }\n    function uf(a, b) {\n      $a(128, a, b);\n    }\n    function z(a, b, c) {\n      return (a + 2 * b + c + 2) >> 2;\n    }\n    function ff(a, b) {\n      var c = b - 32,\n        c = new Uint8Array([\n          z(a[c - 1], a[c + 0], a[c + 1]),\n          z(a[c + 0], a[c + 1], a[c + 2]),\n          z(a[c + 1], a[c + 2], a[c + 3]),\n          z(a[c + 2], a[c + 3], a[c + 4])\n        ]),\n        d;\n      for (d = 0; 4 > d; ++d) I(a, b + 32 * d, c, 0, c.length);\n    }\n    function gf(a, b) {\n      var c = a[b - 1],\n        d = a[b - 1 + 32],\n        e = a[b - 1 + 64],\n        f = a[b - 1 + 96];\n      ra(a, b + 0, 16843009 * z(a[b - 1 - 32], c, d));\n      ra(a, b + 32, 16843009 * z(c, d, e));\n      ra(a, b + 64, 16843009 * z(d, e, f));\n      ra(a, b + 96, 16843009 * z(e, f, f));\n    }\n    function df(a, b) {\n      var c = 4,\n        d;\n      for (d = 0; 4 > d; ++d) c += a[b + d - 32] + a[b - 1 + 32 * d];\n      c >>= 3;\n      for (d = 0; 4 > d; ++d) M(a, b + 32 * d, c, 4);\n    }\n    function hf(a, b) {\n      var c = a[b - 1 + 0],\n        d = a[b - 1 + 32],\n        e = a[b - 1 + 64],\n        f = a[b - 1 - 32],\n        g = a[b + 0 - 32],\n        h = a[b + 1 - 32],\n        k = a[b + 2 - 32],\n        l = a[b + 3 - 32];\n      a[b + 0 + 96] = z(d, e, a[b - 1 + 96]);\n      a[b + 1 + 96] = a[b + 0 + 64] = z(c, d, e);\n      a[b + 2 + 96] = a[b + 1 + 64] = a[b + 0 + 32] = z(f, c, d);\n      a[b + 3 + 96] = a[b + 2 + 64] = a[b + 1 + 32] = a[b + 0 + 0] = z(g, f, c);\n      a[b + 3 + 64] = a[b + 2 + 32] = a[b + 1 + 0] = z(h, g, f);\n      a[b + 3 + 32] = a[b + 2 + 0] = z(k, h, g);\n      a[b + 3 + 0] = z(l, k, h);\n    }\n    function kf(a, b) {\n      var c = a[b + 1 - 32],\n        d = a[b + 2 - 32],\n        e = a[b + 3 - 32],\n        f = a[b + 4 - 32],\n        g = a[b + 5 - 32],\n        h = a[b + 6 - 32],\n        k = a[b + 7 - 32];\n      a[b + 0 + 0] = z(a[b + 0 - 32], c, d);\n      a[b + 1 + 0] = a[b + 0 + 32] = z(c, d, e);\n      a[b + 2 + 0] = a[b + 1 + 32] = a[b + 0 + 64] = z(d, e, f);\n      a[b + 3 + 0] = a[b + 2 + 32] = a[b + 1 + 64] = a[b + 0 + 96] = z(e, f, g);\n      a[b + 3 + 32] = a[b + 2 + 64] = a[b + 1 + 96] = z(f, g, h);\n      a[b + 3 + 64] = a[b + 2 + 96] = z(g, h, k);\n      a[b + 3 + 96] = z(h, k, k);\n    }\n    function jf(a, b) {\n      var c = a[b - 1 + 0],\n        d = a[b - 1 + 32],\n        e = a[b - 1 + 64],\n        f = a[b - 1 - 32],\n        g = a[b + 0 - 32],\n        h = a[b + 1 - 32],\n        k = a[b + 2 - 32],\n        l = a[b + 3 - 32];\n      a[b + 0 + 0] = a[b + 1 + 64] = (f + g + 1) >> 1;\n      a[b + 1 + 0] = a[b + 2 + 64] = (g + h + 1) >> 1;\n      a[b + 2 + 0] = a[b + 3 + 64] = (h + k + 1) >> 1;\n      a[b + 3 + 0] = (k + l + 1) >> 1;\n      a[b + 0 + 96] = z(e, d, c);\n      a[b + 0 + 64] = z(d, c, f);\n      a[b + 0 + 32] = a[b + 1 + 96] = z(c, f, g);\n      a[b + 1 + 32] = a[b + 2 + 96] = z(f, g, h);\n      a[b + 2 + 32] = a[b + 3 + 96] = z(g, h, k);\n      a[b + 3 + 32] = z(h, k, l);\n    }\n    function lf(a, b) {\n      var c = a[b + 0 - 32],\n        d = a[b + 1 - 32],\n        e = a[b + 2 - 32],\n        f = a[b + 3 - 32],\n        g = a[b + 4 - 32],\n        h = a[b + 5 - 32],\n        k = a[b + 6 - 32],\n        l = a[b + 7 - 32];\n      a[b + 0 + 0] = (c + d + 1) >> 1;\n      a[b + 1 + 0] = a[b + 0 + 64] = (d + e + 1) >> 1;\n      a[b + 2 + 0] = a[b + 1 + 64] = (e + f + 1) >> 1;\n      a[b + 3 + 0] = a[b + 2 + 64] = (f + g + 1) >> 1;\n      a[b + 0 + 32] = z(c, d, e);\n      a[b + 1 + 32] = a[b + 0 + 96] = z(d, e, f);\n      a[b + 2 + 32] = a[b + 1 + 96] = z(e, f, g);\n      a[b + 3 + 32] = a[b + 2 + 96] = z(f, g, h);\n      a[b + 3 + 64] = z(g, h, k);\n      a[b + 3 + 96] = z(h, k, l);\n    }\n    function nf(a, b) {\n      var c = a[b - 1 + 0],\n        d = a[b - 1 + 32],\n        e = a[b - 1 + 64],\n        f = a[b - 1 + 96];\n      a[b + 0 + 0] = (c + d + 1) >> 1;\n      a[b + 2 + 0] = a[b + 0 + 32] = (d + e + 1) >> 1;\n      a[b + 2 + 32] = a[b + 0 + 64] = (e + f + 1) >> 1;\n      a[b + 1 + 0] = z(c, d, e);\n      a[b + 3 + 0] = a[b + 1 + 32] = z(d, e, f);\n      a[b + 3 + 32] = a[b + 1 + 64] = z(e, f, f);\n      a[b + 3 + 64] = a[b + 2 + 64] = a[b + 0 + 96] = a[b + 1 + 96] = a[\n        b + 2 + 96\n      ] = a[b + 3 + 96] = f;\n    }\n    function mf(a, b) {\n      var c = a[b - 1 + 0],\n        d = a[b - 1 + 32],\n        e = a[b - 1 + 64],\n        f = a[b - 1 + 96],\n        g = a[b - 1 - 32],\n        h = a[b + 0 - 32],\n        k = a[b + 1 - 32],\n        l = a[b + 2 - 32];\n      a[b + 0 + 0] = a[b + 2 + 32] = (c + g + 1) >> 1;\n      a[b + 0 + 32] = a[b + 2 + 64] = (d + c + 1) >> 1;\n      a[b + 0 + 64] = a[b + 2 + 96] = (e + d + 1) >> 1;\n      a[b + 0 + 96] = (f + e + 1) >> 1;\n      a[b + 3 + 0] = z(h, k, l);\n      a[b + 2 + 0] = z(g, h, k);\n      a[b + 1 + 0] = a[b + 3 + 32] = z(c, g, h);\n      a[b + 1 + 32] = a[b + 3 + 64] = z(d, c, g);\n      a[b + 1 + 64] = a[b + 3 + 96] = z(e, d, c);\n      a[b + 1 + 96] = z(f, e, d);\n    }\n    function xf(a, b) {\n      var c;\n      for (c = 0; 8 > c; ++c) I(a, b + 32 * c, a, b - 32, 8);\n    }\n    function yf(a, b) {\n      var c;\n      for (c = 0; 8 > c; ++c) M(a, b, a[b - 1], 8), (b += 32);\n    }\n    function lb(a, b, c) {\n      var d;\n      for (d = 0; 8 > d; ++d) M(b, c + 32 * d, a, 8);\n    }\n    function vf(a, b) {\n      var c = 8,\n        d;\n      for (d = 0; 8 > d; ++d) c += a[b + d - 32] + a[b - 1 + 32 * d];\n      lb(c >> 4, a, b);\n    }\n    function Af(a, b) {\n      var c = 4,\n        d;\n      for (d = 0; 8 > d; ++d) c += a[b + d - 32];\n      lb(c >> 3, a, b);\n    }\n    function zf(a, b) {\n      var c = 4,\n        d;\n      for (d = 0; 8 > d; ++d) c += a[b - 1 + 32 * d];\n      lb(c >> 3, a, b);\n    }\n    function Bf(a, b) {\n      lb(128, a, b);\n    }\n    function ab(a, b, c) {\n      var d = a[b - c],\n        e = a[b + 0],\n        f = 3 * (e - d) + Qb[1020 + a[b - 2 * c] - a[b + c]],\n        g = mb[112 + ((f + 4) >> 3)];\n      a[b - c] = R[255 + d + mb[112 + ((f + 3) >> 3)]];\n      a[b + 0] = R[255 + e - g];\n    }\n    function jd(a, b, c, d) {\n      var e = a[b + 0],\n        f = a[b + c];\n      return U[255 + a[b - 2 * c] - a[b - c]] > d || U[255 + f - e] > d;\n    }\n    function kd(a, b, c, d) {\n      return (\n        4 * U[255 + a[b - c] - a[b + 0]] + U[255 + a[b - 2 * c] - a[b + c]] <= d\n      );\n    }\n    function ld(a, b, c, d, e) {\n      var f = a[b - 3 * c],\n        g = a[b - 2 * c],\n        h = a[b - c],\n        k = a[b + 0],\n        l = a[b + c],\n        m = a[b + 2 * c],\n        n = a[b + 3 * c];\n      return 4 * U[255 + h - k] + U[255 + g - l] > d\n        ? 0\n        : U[255 + a[b - 4 * c] - f] <= e &&\n            U[255 + f - g] <= e &&\n            U[255 + g - h] <= e &&\n            U[255 + n - m] <= e &&\n            U[255 + m - l] <= e &&\n            U[255 + l - k] <= e;\n    }\n    function gd(a, b, c, d) {\n      var e = 2 * d + 1;\n      for (d = 0; 16 > d; ++d) kd(a, b + d, c, e) && ab(a, b + d, c);\n    }\n    function hd(a, b, c, d) {\n      var e = 2 * d + 1;\n      for (d = 0; 16 > d; ++d) kd(a, b + d * c, 1, e) && ab(a, b + d * c, 1);\n    }\n    function bf(a, b, c, d) {\n      var e;\n      for (e = 3; 0 < e; --e) (b += 4 * c), gd(a, b, c, d);\n    }\n    function cf(a, b, c, d) {\n      var e;\n      for (e = 3; 0 < e; --e) (b += 4), hd(a, b, c, d);\n    }\n    function ea(a, b, c, d, e, f, g, h) {\n      for (f = 2 * f + 1; 0 < e--; ) {\n        if (ld(a, b, c, f, g))\n          if (jd(a, b, c, h)) ab(a, b, c);\n          else {\n            var k = a,\n              l = b,\n              m = c,\n              n = k[l - 2 * m],\n              r = k[l - m],\n              q = k[l + 0],\n              t = k[l + m],\n              v = k[l + 2 * m],\n              p = Qb[1020 + 3 * (q - r) + Qb[1020 + n - t]],\n              u = (27 * p + 63) >> 7,\n              w = (18 * p + 63) >> 7,\n              p = (9 * p + 63) >> 7;\n            k[l - 3 * m] = R[255 + k[l - 3 * m] + p];\n            k[l - 2 * m] = R[255 + n + w];\n            k[l - m] = R[255 + r + u];\n            k[l + 0] = R[255 + q - u];\n            k[l + m] = R[255 + t - w];\n            k[l + 2 * m] = R[255 + v - p];\n          }\n        b += d;\n      }\n    }\n    function Fa(a, b, c, d, e, f, g, h) {\n      for (f = 2 * f + 1; 0 < e--; ) {\n        if (ld(a, b, c, f, g))\n          if (jd(a, b, c, h)) ab(a, b, c);\n          else {\n            var k = a,\n              l = b,\n              m = c,\n              n = k[l - m],\n              r = k[l + 0],\n              q = k[l + m],\n              t = 3 * (r - n),\n              v = mb[112 + ((t + 4) >> 3)],\n              t = mb[112 + ((t + 3) >> 3)],\n              p = (v + 1) >> 1;\n            k[l - 2 * m] = R[255 + k[l - 2 * m] + p];\n            k[l - m] = R[255 + n + t];\n            k[l + 0] = R[255 + r - v];\n            k[l + m] = R[255 + q - p];\n          }\n        b += d;\n      }\n    }\n    function Ue(a, b, c, d, e, f) {\n      ea(a, b, c, 1, 16, d, e, f);\n    }\n    function Ve(a, b, c, d, e, f) {\n      ea(a, b, 1, c, 16, d, e, f);\n    }\n    function Ye(a, b, c, d, e, f) {\n      var g;\n      for (g = 3; 0 < g; --g) (b += 4 * c), Fa(a, b, c, 1, 16, d, e, f);\n    }\n    function Ze(a, b, c, d, e, f) {\n      var g;\n      for (g = 3; 0 < g; --g) (b += 4), Fa(a, b, 1, c, 16, d, e, f);\n    }\n    function We(a, b, c, d, e, f, g, h) {\n      ea(a, b, e, 1, 8, f, g, h);\n      ea(c, d, e, 1, 8, f, g, h);\n    }\n    function Xe(a, b, c, d, e, f, g, h) {\n      ea(a, b, 1, e, 8, f, g, h);\n      ea(c, d, 1, e, 8, f, g, h);\n    }\n    function $e(a, b, c, d, e, f, g, h) {\n      Fa(a, b + 4 * e, e, 1, 8, f, g, h);\n      Fa(c, d + 4 * e, e, 1, 8, f, g, h);\n    }\n    function af(a, b, c, d, e, f, g, h) {\n      Fa(a, b + 4, 1, e, 8, f, g, h);\n      Fa(c, d + 4, 1, e, 8, f, g, h);\n    }\n    function Cf() {\n      this.ba = new Cb();\n      this.ec = [];\n      this.cc = [];\n      this.Mc = [];\n      this.Dc = this.Nc = this.dc = this.fc = 0;\n      this.Oa = new Ud();\n      this.memory = 0;\n      this.Ib = \"OutputFunc\";\n      this.Jb = \"OutputAlphaFunc\";\n      this.Nd = \"OutputRowFunc\";\n    }\n    function md() {\n      this.data = [];\n      this.offset = this.kd = this.ha = this.w = 0;\n      this.na = [];\n      this.xa = this.gb = this.Ja = this.Sa = this.P = 0;\n    }\n    function Df() {\n      this.nc = this.Ea = this.b = this.hc = 0;\n      this.K = [];\n      this.w = 0;\n    }\n    function Ef() {\n      this.ua = 0;\n      this.Wa = new ac();\n      this.vb = new ac();\n      this.md = this.xc = this.wc = 0;\n      this.vc = [];\n      this.Wb = 0;\n      this.Ya = new Ub();\n      this.yc = new O();\n    }\n    function je() {\n      this.xb = this.a = 0;\n      this.l = new Oa();\n      this.ca = new Cb();\n      this.V = [];\n      this.Ba = 0;\n      this.Ta = [];\n      this.Ua = 0;\n      this.m = new Ra();\n      this.Pb = 0;\n      this.wd = new Ra();\n      this.Ma = this.$ = this.C = this.i = this.c = this.xd = 0;\n      this.s = new Ef();\n      this.ab = 0;\n      this.gc = wa(4, Df);\n      this.Oc = 0;\n    }\n    function Ff() {\n      this.Lc = this.Z = this.$a = this.i = this.c = 0;\n      this.l = new Oa();\n      this.ic = 0;\n      this.ca = [];\n      this.tb = 0;\n      this.qd = null;\n      this.rd = 0;\n    }\n    function Rb(a, b, c, d, e, f, g) {\n      a = null == a ? 0 : a[b + 0];\n      for (b = 0; b < g; ++b) (e[f + b] = (a + c[d + b]) & 255), (a = e[f + b]);\n    }\n    function Gf(a, b, c, d, e, f, g) {\n      if (null == a) Rb(null, null, c, d, e, f, g);\n      else {\n        var h;\n        for (h = 0; h < g; ++h) e[f + h] = (a[b + h] + c[d + h]) & 255;\n      }\n    }\n    function Hf(a, b, c, d, e, f, g) {\n      if (null == a) Rb(null, null, c, d, e, f, g);\n      else {\n        var h = a[b + 0],\n          k = h,\n          l = h,\n          m;\n        for (m = 0; m < g; ++m)\n          (h = a[b + m]),\n            (k = l + h - k),\n            (l = (c[d + m] + (k & -256 ? (0 > k ? 0 : 255) : k)) & 255),\n            (k = h),\n            (e[f + m] = l);\n      }\n    }\n    function Le(a, b, c, d) {\n      var e = b.width,\n        f = b.o;\n      x(null != a && null != b);\n      if (0 > c || 0 >= d || c + d > f) return null;\n      if (!a.Cc) {\n        if (null == a.ga) {\n          a.ga = new Ff();\n          var g;\n          (g = null == a.ga) ||\n            ((g = b.width * b.o),\n            x(0 == a.Gb.length),\n            (a.Gb = V(g)),\n            (a.Uc = 0),\n            null == a.Gb\n              ? (g = 0)\n              : ((a.mb = a.Gb), (a.nb = a.Uc), (a.rc = null), (g = 1)),\n            (g = !g));\n          if (!g) {\n            g = a.ga;\n            var h = a.Fa,\n              k = a.P,\n              l = a.qc,\n              m = a.mb,\n              n = a.nb,\n              r = k + 1,\n              q = l - 1,\n              t = g.l;\n            x(null != h && null != m && null != b);\n            ia[0] = null;\n            ia[1] = Rb;\n            ia[2] = Gf;\n            ia[3] = Hf;\n            g.ca = m;\n            g.tb = n;\n            g.c = b.width;\n            g.i = b.height;\n            x(0 < g.c && 0 < g.i);\n            if (1 >= l) b = 0;\n            else if (\n              ((g.$a = (h[k + 0] >> 0) & 3),\n              (g.Z = (h[k + 0] >> 2) & 3),\n              (g.Lc = (h[k + 0] >> 4) & 3),\n              (k = (h[k + 0] >> 6) & 3),\n              0 > g.$a || 1 < g.$a || 4 <= g.Z || 1 < g.Lc || k)\n            )\n              b = 0;\n            else if (\n              ((t.put = kc),\n              (t.ac = gc),\n              (t.bc = lc),\n              (t.ma = g),\n              (t.width = b.width),\n              (t.height = b.height),\n              (t.Da = b.Da),\n              (t.v = b.v),\n              (t.va = b.va),\n              (t.j = b.j),\n              (t.o = b.o),\n              g.$a)\n            )\n              b: {\n                x(1 == g.$a), (b = Bc());\n                c: for (;;) {\n                  if (null == b) {\n                    b = 0;\n                    break b;\n                  }\n                  x(null != g);\n                  g.mc = b;\n                  b.c = g.c;\n                  b.i = g.i;\n                  b.l = g.l;\n                  b.l.ma = g;\n                  b.l.width = g.c;\n                  b.l.height = g.i;\n                  b.a = 0;\n                  cb(b.m, h, r, q);\n                  if (!rb(g.c, g.i, 1, b, null)) break c;\n                  1 == b.ab && 3 == b.gc[0].hc && yc(b.s)\n                    ? ((g.ic = 1),\n                      (h = b.c * b.i),\n                      (b.Ta = null),\n                      (b.Ua = 0),\n                      (b.V = V(h)),\n                      (b.Ba = 0),\n                      null == b.V ? ((b.a = 1), (b = 0)) : (b = 1))\n                    : ((g.ic = 0), (b = Ec(b, g.c)));\n                  if (!b) break c;\n                  b = 1;\n                  break b;\n                }\n                g.mc = null;\n                b = 0;\n              }\n            else b = q >= g.c * g.i;\n            g = !b;\n          }\n          if (g) return null;\n          1 != a.ga.Lc ? (a.Ga = 0) : (d = f - c);\n        }\n        x(null != a.ga);\n        x(c + d <= f);\n        a: {\n          h = a.ga;\n          b = h.c;\n          f = h.l.o;\n          if (0 == h.$a) {\n            r = a.rc;\n            q = a.Vc;\n            t = a.Fa;\n            k = a.P + 1 + c * b;\n            l = a.mb;\n            m = a.nb + c * b;\n            x(k <= a.P + a.qc);\n            if (0 != h.Z)\n              for (x(null != ia[h.Z]), g = 0; g < d; ++g)\n                ia[h.Z](r, q, t, k, l, m, b),\n                  (r = l),\n                  (q = m),\n                  (m += b),\n                  (k += b);\n            else\n              for (g = 0; g < d; ++g)\n                I(l, m, t, k, b), (r = l), (q = m), (m += b), (k += b);\n            a.rc = r;\n            a.Vc = q;\n          } else {\n            x(null != h.mc);\n            b = c + d;\n            g = h.mc;\n            x(null != g);\n            x(b <= g.i);\n            if (g.C >= b) b = 1;\n            else if ((h.ic || Aa(), h.ic)) {\n              var h = g.V,\n                r = g.Ba,\n                q = g.c,\n                v = g.i,\n                t = 1,\n                k = g.$ / q,\n                l = g.$ % q,\n                m = g.m,\n                n = g.s,\n                p = g.$,\n                u = q * v,\n                w = q * b,\n                y = n.wc,\n                A = p < w ? ha(n, l, k) : null;\n              x(p <= u);\n              x(b <= v);\n              x(yc(n));\n              c: for (;;) {\n                for (; !m.h && p < w; ) {\n                  l & y || (A = ha(n, l, k));\n                  x(null != A);\n                  Sa(m);\n                  v = ua(A.G[0], A.H[0], m);\n                  if (256 > v)\n                    (h[r + p] = v),\n                      ++p,\n                      ++l,\n                      l >= q && ((l = 0), ++k, k <= b && !(k % 16) && Ib(g, k));\n                  else if (280 > v) {\n                    var v = ib(v - 256, m);\n                    var E = ua(A.G[4], A.H[4], m);\n                    Sa(m);\n                    E = ib(E, m);\n                    E = nc(q, E);\n                    if (p >= E && u - p >= v) {\n                      var B;\n                      for (B = 0; B < v; ++B) h[r + p + B] = h[r + p + B - E];\n                    } else {\n                      t = 0;\n                      break c;\n                    }\n                    p += v;\n                    for (l += v; l >= q; )\n                      (l -= q), ++k, k <= b && !(k % 16) && Ib(g, k);\n                    p < w && l & y && (A = ha(n, l, k));\n                  } else {\n                    t = 0;\n                    break c;\n                  }\n                  x(m.h == db(m));\n                }\n                Ib(g, k > b ? b : k);\n                break c;\n              }\n              !t || (m.h && p < u) ? ((t = 0), (g.a = m.h ? 5 : 3)) : (g.$ = p);\n              b = t;\n            } else b = Jb(g, g.V, g.Ba, g.c, g.i, b, se);\n            if (!b) {\n              d = 0;\n              break a;\n            }\n          }\n          c + d >= f && (a.Cc = 1);\n          d = 1;\n        }\n        if (!d) return null;\n        if (\n          a.Cc &&\n          ((d = a.ga), null != d && (d.mc = null), (a.ga = null), 0 < a.Ga)\n        )\n          return alert(\"todo:WebPDequantizeLevels\"), null;\n      }\n      return a.nb + c * e;\n    }\n    function If(a, b, c, d, e, f) {\n      for (; 0 < e--; ) {\n        var g = a,\n          h = b + (c ? 1 : 0),\n          k = a,\n          l = b + (c ? 0 : 3),\n          m;\n        for (m = 0; m < d; ++m) {\n          var n = k[l + 4 * m];\n          255 != n &&\n            ((n *= 32897),\n            (g[h + 4 * m + 0] = (g[h + 4 * m + 0] * n) >> 23),\n            (g[h + 4 * m + 1] = (g[h + 4 * m + 1] * n) >> 23),\n            (g[h + 4 * m + 2] = (g[h + 4 * m + 2] * n) >> 23));\n        }\n        b += f;\n      }\n    }\n    function Jf(a, b, c, d, e) {\n      for (; 0 < d--; ) {\n        var f;\n        for (f = 0; f < c; ++f) {\n          var g = a[b + 2 * f + 0],\n            h = a[b + 2 * f + 1],\n            k = h & 15,\n            l = 4369 * k,\n            h = (((h & 240) | (h >> 4)) * l) >> 16;\n          a[b + 2 * f + 0] =\n            (((((g & 240) | (g >> 4)) * l) >> 16) & 240) |\n            ((((((g & 15) | (g << 4)) * l) >> 16) >> 4) & 15);\n          a[b + 2 * f + 1] = (h & 240) | k;\n        }\n        b += e;\n      }\n    }\n    function Kf(a, b, c, d, e, f, g, h) {\n      var k = 255,\n        l,\n        m;\n      for (m = 0; m < e; ++m) {\n        for (l = 0; l < d; ++l) {\n          var n = a[b + l];\n          f[g + 4 * l] = n;\n          k &= n;\n        }\n        b += c;\n        g += h;\n      }\n      return 255 != k;\n    }\n    function Lf(a, b, c, d, e) {\n      var f;\n      for (f = 0; f < e; ++f) c[d + f] = a[b + f] >> 8;\n    }\n    function Aa() {\n      za = If;\n      vc = Jf;\n      fc = Kf;\n      Fc = Lf;\n    }\n    function va(a, b, c) {\n      self[a] = function(a, e, f, g, h, k, l, m, n, r, q, t, v, p, u, w, y) {\n        var d,\n          E = (y - 1) >> 1;\n        var B = h[k + 0] | (l[m + 0] << 16);\n        var C = n[r + 0] | (q[t + 0] << 16);\n        x(null != a);\n        var z = (3 * B + C + 131074) >> 2;\n        b(a[e + 0], z & 255, z >> 16, v, p);\n        null != f &&\n          ((z = (3 * C + B + 131074) >> 2),\n          b(f[g + 0], z & 255, z >> 16, u, w));\n        for (d = 1; d <= E; ++d) {\n          var D = h[k + d] | (l[m + d] << 16);\n          var G = n[r + d] | (q[t + d] << 16);\n          var F = B + D + C + G + 524296;\n          var H = (F + 2 * (D + C)) >> 3;\n          F = (F + 2 * (B + G)) >> 3;\n          z = (H + B) >> 1;\n          B = (F + D) >> 1;\n          b(a[e + 2 * d - 1], z & 255, z >> 16, v, p + (2 * d - 1) * c);\n          b(a[e + 2 * d - 0], B & 255, B >> 16, v, p + (2 * d - 0) * c);\n          null != f &&\n            ((z = (F + C) >> 1),\n            (B = (H + G) >> 1),\n            b(f[g + 2 * d - 1], z & 255, z >> 16, u, w + (2 * d - 1) * c),\n            b(f[g + 2 * d + 0], B & 255, B >> 16, u, w + (2 * d + 0) * c));\n          B = D;\n          C = G;\n        }\n        y & 1 ||\n          ((z = (3 * B + C + 131074) >> 2),\n          b(a[e + y - 1], z & 255, z >> 16, v, p + (y - 1) * c),\n          null != f &&\n            ((z = (3 * C + B + 131074) >> 2),\n            b(f[g + y - 1], z & 255, z >> 16, u, w + (y - 1) * c)));\n      };\n    }\n    function ic() {\n      P[Ca] = Mf;\n      P[Ua] = nd;\n      P[tc] = Nf;\n      P[Va] = od;\n      P[ya] = pd;\n      P[Db] = qd;\n      P[wc] = Of;\n      P[zb] = nd;\n      P[Ab] = od;\n      P[Ja] = pd;\n      P[Bb] = qd;\n    }\n    function Sb(a) {\n      return a & ~Pf ? (0 > a ? 0 : 255) : a >> rd;\n    }\n    function bb(a, b) {\n      return Sb(((19077 * a) >> 8) + ((26149 * b) >> 8) - 14234);\n    }\n    function nb(a, b, c) {\n      return Sb(\n        ((19077 * a) >> 8) - ((6419 * b) >> 8) - ((13320 * c) >> 8) + 8708\n      );\n    }\n    function Pa(a, b) {\n      return Sb(((19077 * a) >> 8) + ((33050 * b) >> 8) - 17685);\n    }\n    function Ga(a, b, c, d, e) {\n      d[e + 0] = bb(a, c);\n      d[e + 1] = nb(a, b, c);\n      d[e + 2] = Pa(a, b);\n    }\n    function Tb(a, b, c, d, e) {\n      d[e + 0] = Pa(a, b);\n      d[e + 1] = nb(a, b, c);\n      d[e + 2] = bb(a, c);\n    }\n    function sd(a, b, c, d, e) {\n      var f = nb(a, b, c);\n      b = ((f << 3) & 224) | (Pa(a, b) >> 3);\n      d[e + 0] = (bb(a, c) & 248) | (f >> 5);\n      d[e + 1] = b;\n    }\n    function td(a, b, c, d, e) {\n      var f = (Pa(a, b) & 240) | 15;\n      d[e + 0] = (bb(a, c) & 240) | (nb(a, b, c) >> 4);\n      d[e + 1] = f;\n    }\n    function ud(a, b, c, d, e) {\n      d[e + 0] = 255;\n      Ga(a, b, c, d, e + 1);\n    }\n    function vd(a, b, c, d, e) {\n      Tb(a, b, c, d, e);\n      d[e + 3] = 255;\n    }\n    function wd(a, b, c, d, e) {\n      Ga(a, b, c, d, e);\n      d[e + 3] = 255;\n    }\n    function ga(a, b) {\n      return 0 > a ? 0 : a > b ? b : a;\n    }\n    function la(a, b, c) {\n      self[a] = function(a, e, f, g, h, k, l, m, n) {\n        for (var d = m + (n & -2) * c; m != d; )\n          b(a[e + 0], f[g + 0], h[k + 0], l, m),\n            b(a[e + 1], f[g + 0], h[k + 0], l, m + c),\n            (e += 2),\n            ++g,\n            ++k,\n            (m += 2 * c);\n        n & 1 && b(a[e + 0], f[g + 0], h[k + 0], l, m);\n      };\n    }\n    function xd(a, b, c) {\n      return 0 == c ? (0 == a ? (0 == b ? 6 : 5) : 0 == b ? 4 : 0) : c;\n    }\n    function yd(a, b, c, d, e) {\n      switch (a >>> 30) {\n        case 3:\n          Za(b, c, d, e, 0);\n          break;\n        case 2:\n          fd(b, c, d, e);\n          break;\n        case 1:\n          pa(b, c, d, e);\n      }\n    }\n    function Oc(a, b) {\n      var c,\n        d,\n        e = b.M,\n        f = b.Nb,\n        g = a.oc,\n        h = a.pc + 40,\n        k = a.oc,\n        l = a.pc + 584,\n        m = a.oc,\n        n = a.pc + 600;\n      for (c = 0; 16 > c; ++c) g[h + 32 * c - 1] = 129;\n      for (c = 0; 8 > c; ++c)\n        (k[l + 32 * c - 1] = 129), (m[n + 32 * c - 1] = 129);\n      0 < e\n        ? (g[h - 1 - 32] = k[l - 1 - 32] = m[n - 1 - 32] = 129)\n        : (M(g, h - 32 - 1, 127, 21),\n          M(k, l - 32 - 1, 127, 9),\n          M(m, n - 32 - 1, 127, 9));\n      for (d = 0; d < a.za; ++d) {\n        var r = b.ya[b.aa + d];\n        if (0 < d) {\n          for (c = -1; 16 > c; ++c) I(g, h + 32 * c - 4, g, h + 32 * c + 12, 4);\n          for (c = -1; 8 > c; ++c)\n            I(k, l + 32 * c - 4, k, l + 32 * c + 4, 4),\n              I(m, n + 32 * c - 4, m, n + 32 * c + 4, 4);\n        }\n        var q = a.Gd,\n          t = a.Hd + d,\n          v = r.ad,\n          p = r.Hc;\n        0 < e &&\n          (I(g, h - 32, q[t].y, 0, 16),\n          I(k, l - 32, q[t].f, 0, 8),\n          I(m, n - 32, q[t].ea, 0, 8));\n        if (r.Za) {\n          var u = g;\n          var w = h - 32 + 16;\n          0 < e &&\n            (d >= a.za - 1\n              ? M(u, w, q[t].y[15], 4)\n              : I(u, w, q[t + 1].y, 0, 4));\n          for (c = 0; 4 > c; c++)\n            u[w + 128 + c] = u[w + 256 + c] = u[w + 384 + c] = u[w + 0 + c];\n          for (c = 0; 16 > c; ++c, p <<= 2)\n            (u = g), (w = h + zd[c]), W[r.Ob[c]](u, w), yd(p, v, 16 * +c, u, w);\n        } else if (((u = xd(d, e, r.Ob[0])), Y[u](g, h), 0 != p))\n          for (c = 0; 16 > c; ++c, p <<= 2) yd(p, v, 16 * +c, g, h + zd[c]);\n        c = r.Gc;\n        u = xd(d, e, r.Dd);\n        ka[u](k, l);\n        ka[u](m, n);\n        r = c >> 0;\n        p = v;\n        u = k;\n        w = l;\n        r & 255 && (r & 170 ? Nb(p, 256, u, w) : Ob(p, 256, u, w));\n        c >>= 8;\n        r = m;\n        p = n;\n        c & 255 && (c & 170 ? Nb(v, 320, r, p) : Ob(v, 320, r, p));\n        e < a.Ub - 1 &&\n          (I(q[t].y, 0, g, h + 480, 16),\n          I(q[t].f, 0, k, l + 224, 8),\n          I(q[t].ea, 0, m, n + 224, 8));\n        c = 8 * f * a.B;\n        q = a.sa;\n        t = a.ta + 16 * d + 16 * f * a.R;\n        v = a.qa;\n        r = a.ra + 8 * d + c;\n        p = a.Ha;\n        u = a.Ia + 8 * d + c;\n        for (c = 0; 16 > c; ++c) I(q, t + c * a.R, g, h + 32 * c, 16);\n        for (c = 0; 8 > c; ++c)\n          I(v, r + c * a.B, k, l + 32 * c, 8),\n            I(p, u + c * a.B, m, n + 32 * c, 8);\n      }\n    }\n    function Ad(a, b, c, d, e, f, g, h, k) {\n      var l = [0],\n        m = [0],\n        n = 0,\n        r = null != k ? k.kd : 0,\n        q = null != k ? k : new md();\n      if (null == a || 12 > c) return 7;\n      q.data = a;\n      q.w = b;\n      q.ha = c;\n      b = [b];\n      c = [c];\n      q.gb = [q.gb];\n      a: {\n        var t = b;\n        var v = c;\n        var p = q.gb;\n        x(null != a);\n        x(null != v);\n        x(null != p);\n        p[0] = 0;\n        if (12 <= v[0] && !fa(a, t[0], \"RIFF\")) {\n          if (fa(a, t[0] + 8, \"WEBP\")) {\n            p = 3;\n            break a;\n          }\n          var u = Ha(a, t[0] + 4);\n          if (12 > u || 4294967286 < u) {\n            p = 3;\n            break a;\n          }\n          if (r && u > v[0] - 8) {\n            p = 7;\n            break a;\n          }\n          p[0] = u;\n          t[0] += 12;\n          v[0] -= 12;\n        }\n        p = 0;\n      }\n      if (0 != p) return p;\n      u = 0 < q.gb[0];\n      for (c = c[0]; ; ) {\n        t = [0];\n        n = [n];\n        a: {\n          var w = a;\n          v = b;\n          p = c;\n          var y = n,\n            A = l,\n            z = m,\n            B = t;\n          y[0] = 0;\n          if (8 > p[0]) p = 7;\n          else {\n            if (!fa(w, v[0], \"VP8X\")) {\n              if (10 != Ha(w, v[0] + 4)) {\n                p = 3;\n                break a;\n              }\n              if (18 > p[0]) {\n                p = 7;\n                break a;\n              }\n              var C = Ha(w, v[0] + 8);\n              var D = 1 + Yb(w, v[0] + 12);\n              w = 1 + Yb(w, v[0] + 15);\n              if (2147483648 <= D * w) {\n                p = 3;\n                break a;\n              }\n              null != B && (B[0] = C);\n              null != A && (A[0] = D);\n              null != z && (z[0] = w);\n              v[0] += 18;\n              p[0] -= 18;\n              y[0] = 1;\n            }\n            p = 0;\n          }\n        }\n        n = n[0];\n        t = t[0];\n        if (0 != p) return p;\n        v = !!(t & 2);\n        if (!u && n) return 3;\n        null != f && (f[0] = !!(t & 16));\n        null != g && (g[0] = v);\n        null != h && (h[0] = 0);\n        g = l[0];\n        t = m[0];\n        if (n && v && null == k) {\n          p = 0;\n          break;\n        }\n        if (4 > c) {\n          p = 7;\n          break;\n        }\n        if ((u && n) || (!u && !n && !fa(a, b[0], \"ALPH\"))) {\n          c = [c];\n          q.na = [q.na];\n          q.P = [q.P];\n          q.Sa = [q.Sa];\n          a: {\n            C = a;\n            p = b;\n            u = c;\n            var y = q.gb,\n              A = q.na,\n              z = q.P,\n              B = q.Sa;\n            D = 22;\n            x(null != C);\n            x(null != u);\n            w = p[0];\n            var F = u[0];\n            x(null != A);\n            x(null != B);\n            A[0] = null;\n            z[0] = null;\n            for (B[0] = 0; ; ) {\n              p[0] = w;\n              u[0] = F;\n              if (8 > F) {\n                p = 7;\n                break a;\n              }\n              var G = Ha(C, w + 4);\n              if (4294967286 < G) {\n                p = 3;\n                break a;\n              }\n              var H = (8 + G + 1) & -2;\n              D += H;\n              if (0 < y && D > y) {\n                p = 3;\n                break a;\n              }\n              if (!fa(C, w, \"VP8 \") || !fa(C, w, \"VP8L\")) {\n                p = 0;\n                break a;\n              }\n              if (F[0] < H) {\n                p = 7;\n                break a;\n              }\n              fa(C, w, \"ALPH\") || ((A[0] = C), (z[0] = w + 8), (B[0] = G));\n              w += H;\n              F -= H;\n            }\n          }\n          c = c[0];\n          q.na = q.na[0];\n          q.P = q.P[0];\n          q.Sa = q.Sa[0];\n          if (0 != p) break;\n        }\n        c = [c];\n        q.Ja = [q.Ja];\n        q.xa = [q.xa];\n        a: if (\n          ((y = a),\n          (p = b),\n          (u = c),\n          (A = q.gb[0]),\n          (z = q.Ja),\n          (B = q.xa),\n          (C = p[0]),\n          (w = !fa(y, C, \"VP8 \")),\n          (D = !fa(y, C, \"VP8L\")),\n          x(null != y),\n          x(null != u),\n          x(null != z),\n          x(null != B),\n          8 > u[0])\n        )\n          p = 7;\n        else {\n          if (w || D) {\n            y = Ha(y, C + 4);\n            if (12 <= A && y > A - 12) {\n              p = 3;\n              break a;\n            }\n            if (r && y > u[0] - 8) {\n              p = 7;\n              break a;\n            }\n            z[0] = y;\n            p[0] += 8;\n            u[0] -= 8;\n            B[0] = D;\n          } else\n            (B[0] = 5 <= u[0] && 47 == y[C + 0] && !(y[C + 4] >> 5)),\n              (z[0] = u[0]);\n          p = 0;\n        }\n        c = c[0];\n        q.Ja = q.Ja[0];\n        q.xa = q.xa[0];\n        b = b[0];\n        if (0 != p) break;\n        if (4294967286 < q.Ja) return 3;\n        null == h || v || (h[0] = q.xa ? 2 : 1);\n        g = [g];\n        t = [t];\n        if (q.xa) {\n          if (5 > c) {\n            p = 7;\n            break;\n          }\n          h = g;\n          r = t;\n          v = f;\n          null == a || 5 > c\n            ? (a = 0)\n            : 5 <= c && 47 == a[b + 0] && !(a[b + 4] >> 5)\n            ? ((u = [0]),\n              (y = [0]),\n              (A = [0]),\n              (z = new Ra()),\n              cb(z, a, b, c),\n              mc(z, u, y, A)\n                ? (null != h && (h[0] = u[0]),\n                  null != r && (r[0] = y[0]),\n                  null != v && (v[0] = A[0]),\n                  (a = 1))\n                : (a = 0))\n            : (a = 0);\n        } else {\n          if (10 > c) {\n            p = 7;\n            break;\n          }\n          h = t;\n          null == a || 10 > c || !Jc(a, b + 3, c - 3)\n            ? (a = 0)\n            : ((r = a[b + 0] | (a[b + 1] << 8) | (a[b + 2] << 16)),\n              (v = ((a[b + 7] << 8) | a[b + 6]) & 16383),\n              (a = ((a[b + 9] << 8) | a[b + 8]) & 16383),\n              r & 1 ||\n              3 < ((r >> 1) & 7) ||\n              !((r >> 4) & 1) ||\n              r >> 5 >= q.Ja ||\n              !v ||\n              !a\n                ? (a = 0)\n                : (g && (g[0] = v), h && (h[0] = a), (a = 1)));\n        }\n        if (!a) return 3;\n        g = g[0];\n        t = t[0];\n        if (n && (l[0] != g || m[0] != t)) return 3;\n        null != k &&\n          ((k[0] = q),\n          (k.offset = b - k.w),\n          x(4294967286 > b - k.w),\n          x(k.offset == k.ha - c));\n        break;\n      }\n      return 0 == p || (7 == p && n && null == k)\n        ? (null != f && (f[0] |= null != q.na && 0 < q.na.length),\n          null != d && (d[0] = g),\n          null != e && (e[0] = t),\n          0)\n        : p;\n    }\n    function hc(a, b, c) {\n      var d = b.width,\n        e = b.height,\n        f = 0,\n        g = 0,\n        h = d,\n        k = e;\n      b.Da = null != a && 0 < a.Da;\n      if (\n        b.Da &&\n        ((h = a.cd),\n        (k = a.bd),\n        (f = a.v),\n        (g = a.j),\n        11 > c || ((f &= -2), (g &= -2)),\n        0 > f || 0 > g || 0 >= h || 0 >= k || f + h > d || g + k > e)\n      )\n        return 0;\n      b.v = f;\n      b.j = g;\n      b.va = f + h;\n      b.o = g + k;\n      b.U = h;\n      b.T = k;\n      b.da = null != a && 0 < a.da;\n      if (b.da) {\n        c = [a.ib];\n        f = [a.hb];\n        if (!bc(h, k, c, f)) return 0;\n        b.ib = c[0];\n        b.hb = f[0];\n      }\n      b.ob = null != a && a.ob;\n      b.Kb = null == a || !a.Sd;\n      b.da && ((b.ob = b.ib < (3 * d) / 4 && b.hb < (3 * e) / 4), (b.Kb = 0));\n      return 1;\n    }\n    function Bd(a) {\n      if (null == a) return 2;\n      if (11 > a.S) {\n        var b = a.f.RGBA;\n        b.fb += (a.height - 1) * b.A;\n        b.A = -b.A;\n      } else\n        (b = a.f.kb),\n          (a = a.height),\n          (b.O += (a - 1) * b.fa),\n          (b.fa = -b.fa),\n          (b.N += ((a - 1) >> 1) * b.Ab),\n          (b.Ab = -b.Ab),\n          (b.W += ((a - 1) >> 1) * b.Db),\n          (b.Db = -b.Db),\n          null != b.F && ((b.J += (a - 1) * b.lb), (b.lb = -b.lb));\n      return 0;\n    }\n    function Cd(a, b, c, d) {\n      if (null == d || 0 >= a || 0 >= b) return 2;\n      if (null != c) {\n        if (c.Da) {\n          var e = c.cd,\n            f = c.bd,\n            g = c.v & -2,\n            h = c.j & -2;\n          if (0 > g || 0 > h || 0 >= e || 0 >= f || g + e > a || h + f > b)\n            return 2;\n          a = e;\n          b = f;\n        }\n        if (c.da) {\n          e = [c.ib];\n          f = [c.hb];\n          if (!bc(a, b, e, f)) return 2;\n          a = e[0];\n          b = f[0];\n        }\n      }\n      d.width = a;\n      d.height = b;\n      a: {\n        var k = d.width;\n        var l = d.height;\n        a = d.S;\n        if (0 >= k || 0 >= l || !(a >= Ca && 13 > a)) a = 2;\n        else {\n          if (0 >= d.Rd && null == d.sd) {\n            var g = (f = e = b = 0),\n              h = k * Dd[a],\n              m = h * l;\n            11 > a ||\n              ((b = (k + 1) / 2),\n              (f = ((l + 1) / 2) * b),\n              12 == a && ((e = k), (g = e * l)));\n            l = V(m + 2 * f + g);\n            if (null == l) {\n              a = 1;\n              break a;\n            }\n            d.sd = l;\n            11 > a\n              ? ((k = d.f.RGBA),\n                (k.eb = l),\n                (k.fb = 0),\n                (k.A = h),\n                (k.size = m))\n              : ((k = d.f.kb),\n                (k.y = l),\n                (k.O = 0),\n                (k.fa = h),\n                (k.Fd = m),\n                (k.f = l),\n                (k.N = 0 + m),\n                (k.Ab = b),\n                (k.Cd = f),\n                (k.ea = l),\n                (k.W = 0 + m + f),\n                (k.Db = b),\n                (k.Ed = f),\n                12 == a && ((k.F = l), (k.J = 0 + m + 2 * f)),\n                (k.Tc = g),\n                (k.lb = e));\n          }\n          b = 1;\n          e = d.S;\n          f = d.width;\n          g = d.height;\n          if (e >= Ca && 13 > e)\n            if (11 > e)\n              (a = d.f.RGBA),\n                (h = Math.abs(a.A)),\n                (b &= h * (g - 1) + f <= a.size),\n                (b &= h >= f * Dd[e]),\n                (b &= null != a.eb);\n            else {\n              a = d.f.kb;\n              h = (f + 1) / 2;\n              m = (g + 1) / 2;\n              k = Math.abs(a.fa);\n              var l = Math.abs(a.Ab),\n                n = Math.abs(a.Db),\n                r = Math.abs(a.lb),\n                q = r * (g - 1) + f;\n              b &= k * (g - 1) + f <= a.Fd;\n              b &= l * (m - 1) + h <= a.Cd;\n              b &= n * (m - 1) + h <= a.Ed;\n              b = b & (k >= f) & (l >= h) & (n >= h);\n              b &= null != a.y;\n              b &= null != a.f;\n              b &= null != a.ea;\n              12 == e && ((b &= r >= f), (b &= q <= a.Tc), (b &= null != a.F));\n            }\n          else b = 0;\n          a = b ? 0 : 2;\n        }\n      }\n      if (0 != a) return a;\n      null != c && c.fd && (a = Bd(d));\n      return a;\n    }\n    var xb = 64,\n      Hd = [\n        0,\n        1,\n        3,\n        7,\n        15,\n        31,\n        63,\n        127,\n        255,\n        511,\n        1023,\n        2047,\n        4095,\n        8191,\n        16383,\n        32767,\n        65535,\n        131071,\n        262143,\n        524287,\n        1048575,\n        2097151,\n        4194303,\n        8388607,\n        16777215\n      ],\n      Gd = 24,\n      ob = 32,\n      Xb = 8,\n      Id = [\n        0,\n        0,\n        1,\n        1,\n        2,\n        2,\n        2,\n        2,\n        3,\n        3,\n        3,\n        3,\n        3,\n        3,\n        3,\n        3,\n        4,\n        4,\n        4,\n        4,\n        4,\n        4,\n        4,\n        4,\n        4,\n        4,\n        4,\n        4,\n        4,\n        4,\n        4,\n        4,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        5,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        6,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7,\n        7\n      ];\n    X(\"Predictor0\", \"PredictorAdd0\");\n    self.Predictor0 = function() {\n      return 4278190080;\n    };\n    self.Predictor1 = function(a) {\n      return a;\n    };\n    self.Predictor2 = function(a, b, c) {\n      return b[c + 0];\n    };\n    self.Predictor3 = function(a, b, c) {\n      return b[c + 1];\n    };\n    self.Predictor4 = function(a, b, c) {\n      return b[c - 1];\n    };\n    self.Predictor5 = function(a, b, c) {\n      return aa(aa(a, b[c + 1]), b[c + 0]);\n    };\n    self.Predictor6 = function(a, b, c) {\n      return aa(a, b[c - 1]);\n    };\n    self.Predictor7 = function(a, b, c) {\n      return aa(a, b[c + 0]);\n    };\n    self.Predictor8 = function(a, b, c) {\n      return aa(b[c - 1], b[c + 0]);\n    };\n    self.Predictor9 = function(a, b, c) {\n      return aa(b[c + 0], b[c + 1]);\n    };\n    self.Predictor10 = function(a, b, c) {\n      return aa(aa(a, b[c - 1]), aa(b[c + 0], b[c + 1]));\n    };\n    self.Predictor11 = function(a, b, c) {\n      var d = b[c + 0];\n      b = b[c - 1];\n      return 0 >=\n        Ia((d >> 24) & 255, (a >> 24) & 255, (b >> 24) & 255) +\n          Ia((d >> 16) & 255, (a >> 16) & 255, (b >> 16) & 255) +\n          Ia((d >> 8) & 255, (a >> 8) & 255, (b >> 8) & 255) +\n          Ia(d & 255, a & 255, b & 255)\n        ? d\n        : a;\n    };\n    self.Predictor12 = function(a, b, c) {\n      var d = b[c + 0];\n      b = b[c - 1];\n      return (\n        ((sa(((a >> 24) & 255) + ((d >> 24) & 255) - ((b >> 24) & 255)) << 24) |\n          (sa(((a >> 16) & 255) + ((d >> 16) & 255) - ((b >> 16) & 255)) <<\n            16) |\n          (sa(((a >> 8) & 255) + ((d >> 8) & 255) - ((b >> 8) & 255)) << 8) |\n          sa((a & 255) + (d & 255) - (b & 255))) >>>\n        0\n      );\n    };\n    self.Predictor13 = function(a, b, c) {\n      var d = b[c - 1];\n      a = aa(a, b[c + 0]);\n      return (\n        ((eb((a >> 24) & 255, (d >> 24) & 255) << 24) |\n          (eb((a >> 16) & 255, (d >> 16) & 255) << 16) |\n          (eb((a >> 8) & 255, (d >> 8) & 255) << 8) |\n          eb((a >> 0) & 255, (d >> 0) & 255)) >>>\n        0\n      );\n    };\n    var ee = self.PredictorAdd0;\n    self.PredictorAdd1 = cc;\n    X(\"Predictor2\", \"PredictorAdd2\");\n    X(\"Predictor3\", \"PredictorAdd3\");\n    X(\"Predictor4\", \"PredictorAdd4\");\n    X(\"Predictor5\", \"PredictorAdd5\");\n    X(\"Predictor6\", \"PredictorAdd6\");\n    X(\"Predictor7\", \"PredictorAdd7\");\n    X(\"Predictor8\", \"PredictorAdd8\");\n    X(\"Predictor9\", \"PredictorAdd9\");\n    X(\"Predictor10\", \"PredictorAdd10\");\n    X(\"Predictor11\", \"PredictorAdd11\");\n    X(\"Predictor12\", \"PredictorAdd12\");\n    X(\"Predictor13\", \"PredictorAdd13\");\n    var fe = self.PredictorAdd2;\n    ec(\n      \"ColorIndexInverseTransform\",\n      \"MapARGB\",\n      \"32b\",\n      function(a) {\n        return (a >> 8) & 255;\n      },\n      function(a) {\n        return a;\n      }\n    );\n    ec(\n      \"VP8LColorIndexInverseTransformAlpha\",\n      \"MapAlpha\",\n      \"8b\",\n      function(a) {\n        return a;\n      },\n      function(a) {\n        return (a >> 8) & 255;\n      }\n    );\n    var rc = self.ColorIndexInverseTransform,\n      ke = self.MapARGB,\n      he = self.VP8LColorIndexInverseTransformAlpha,\n      le = self.MapAlpha,\n      pc,\n      qc = (self.VP8LPredictorsAdd = []);\n    qc.length = 16;\n    (self.VP8LPredictors = []).length = 16;\n    (self.VP8LPredictorsAdd_C = []).length = 16;\n    (self.VP8LPredictors_C = []).length = 16;\n    var Fb,\n      sc,\n      Gb,\n      Hb,\n      xc,\n      uc,\n      bd = V(511),\n      cd = V(2041),\n      dd = V(225),\n      ed = V(767),\n      ad = 0,\n      Qb = cd,\n      mb = dd,\n      R = ed,\n      U = bd,\n      Ca = 0,\n      Ua = 1,\n      tc = 2,\n      Va = 3,\n      ya = 4,\n      Db = 5,\n      wc = 6,\n      zb = 7,\n      Ab = 8,\n      Ja = 9,\n      Bb = 10,\n      pe = [2, 3, 7],\n      oe = [3, 3, 11],\n      Dc = [280, 256, 256, 256, 40],\n      qe = [0, 1, 1, 1, 0],\n      ne = [17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],\n      de = [\n        24,\n        7,\n        23,\n        25,\n        40,\n        6,\n        39,\n        41,\n        22,\n        26,\n        38,\n        42,\n        56,\n        5,\n        55,\n        57,\n        21,\n        27,\n        54,\n        58,\n        37,\n        43,\n        72,\n        4,\n        71,\n        73,\n        20,\n        28,\n        53,\n        59,\n        70,\n        74,\n        36,\n        44,\n        88,\n        69,\n        75,\n        52,\n        60,\n        3,\n        87,\n        89,\n        19,\n        29,\n        86,\n        90,\n        35,\n        45,\n        68,\n        76,\n        85,\n        91,\n        51,\n        61,\n        104,\n        2,\n        103,\n        105,\n        18,\n        30,\n        102,\n        106,\n        34,\n        46,\n        84,\n        92,\n        67,\n        77,\n        101,\n        107,\n        50,\n        62,\n        120,\n        1,\n        119,\n        121,\n        83,\n        93,\n        17,\n        31,\n        100,\n        108,\n        66,\n        78,\n        118,\n        122,\n        33,\n        47,\n        117,\n        123,\n        49,\n        63,\n        99,\n        109,\n        82,\n        94,\n        0,\n        116,\n        124,\n        65,\n        79,\n        16,\n        32,\n        98,\n        110,\n        48,\n        115,\n        125,\n        81,\n        95,\n        64,\n        114,\n        126,\n        97,\n        111,\n        80,\n        113,\n        127,\n        96,\n        112\n      ],\n      me = [\n        2954,\n        2956,\n        2958,\n        2962,\n        2970,\n        2986,\n        3018,\n        3082,\n        3212,\n        3468,\n        3980,\n        5004\n      ],\n      ie = 8,\n      Lb = [\n        4,\n        5,\n        6,\n        7,\n        8,\n        9,\n        10,\n        10,\n        11,\n        12,\n        13,\n        14,\n        15,\n        16,\n        17,\n        17,\n        18,\n        19,\n        20,\n        20,\n        21,\n        21,\n        22,\n        22,\n        23,\n        23,\n        24,\n        25,\n        25,\n        26,\n        27,\n        28,\n        29,\n        30,\n        31,\n        32,\n        33,\n        34,\n        35,\n        36,\n        37,\n        37,\n        38,\n        39,\n        40,\n        41,\n        42,\n        43,\n        44,\n        45,\n        46,\n        46,\n        47,\n        48,\n        49,\n        50,\n        51,\n        52,\n        53,\n        54,\n        55,\n        56,\n        57,\n        58,\n        59,\n        60,\n        61,\n        62,\n        63,\n        64,\n        65,\n        66,\n        67,\n        68,\n        69,\n        70,\n        71,\n        72,\n        73,\n        74,\n        75,\n        76,\n        76,\n        77,\n        78,\n        79,\n        80,\n        81,\n        82,\n        83,\n        84,\n        85,\n        86,\n        87,\n        88,\n        89,\n        91,\n        93,\n        95,\n        96,\n        98,\n        100,\n        101,\n        102,\n        104,\n        106,\n        108,\n        110,\n        112,\n        114,\n        116,\n        118,\n        122,\n        124,\n        126,\n        128,\n        130,\n        132,\n        134,\n        136,\n        138,\n        140,\n        143,\n        145,\n        148,\n        151,\n        154,\n        157\n      ],\n      Mb = [\n        4,\n        5,\n        6,\n        7,\n        8,\n        9,\n        10,\n        11,\n        12,\n        13,\n        14,\n        15,\n        16,\n        17,\n        18,\n        19,\n        20,\n        21,\n        22,\n        23,\n        24,\n        25,\n        26,\n        27,\n        28,\n        29,\n        30,\n        31,\n        32,\n        33,\n        34,\n        35,\n        36,\n        37,\n        38,\n        39,\n        40,\n        41,\n        42,\n        43,\n        44,\n        45,\n        46,\n        47,\n        48,\n        49,\n        50,\n        51,\n        52,\n        53,\n        54,\n        55,\n        56,\n        57,\n        58,\n        60,\n        62,\n        64,\n        66,\n        68,\n        70,\n        72,\n        74,\n        76,\n        78,\n        80,\n        82,\n        84,\n        86,\n        88,\n        90,\n        92,\n        94,\n        96,\n        98,\n        100,\n        102,\n        104,\n        106,\n        108,\n        110,\n        112,\n        114,\n        116,\n        119,\n        122,\n        125,\n        128,\n        131,\n        134,\n        137,\n        140,\n        143,\n        146,\n        149,\n        152,\n        155,\n        158,\n        161,\n        164,\n        167,\n        170,\n        173,\n        177,\n        181,\n        185,\n        189,\n        193,\n        197,\n        201,\n        205,\n        209,\n        213,\n        217,\n        221,\n        225,\n        229,\n        234,\n        239,\n        245,\n        249,\n        254,\n        259,\n        264,\n        269,\n        274,\n        279,\n        284\n      ],\n      oa = null,\n      He = [\n        [173, 148, 140, 0],\n        [176, 155, 140, 135, 0],\n        [180, 157, 141, 134, 130, 0],\n        [254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0]\n      ],\n      Ie = [0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15],\n      Mc = [-0, 1, -1, 2, -2, 3, 4, 6, -3, 5, -4, -5, -6, 7, -7, 8, -8, -9],\n      Fe = [\n        [\n          [\n            [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],\n            [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],\n            [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]\n          ],\n          [\n            [253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128],\n            [189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128],\n            [106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128]\n          ],\n          [\n            [1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128],\n            [181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128],\n            [78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128]\n          ],\n          [\n            [1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128],\n            [184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128],\n            [77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128]\n          ],\n          [\n            [1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128],\n            [170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128],\n            [37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128]\n          ],\n          [\n            [1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128],\n            [207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128],\n            [102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128]\n          ],\n          [\n            [1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128],\n            [177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128],\n            [80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128]\n          ],\n          [\n            [1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n            [246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n            [255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]\n          ]\n        ],\n        [\n          [\n            [198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62],\n            [131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1],\n            [68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128]\n          ],\n          [\n            [1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128],\n            [184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128],\n            [81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128]\n          ],\n          [\n            [1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128],\n            [99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128],\n            [23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128]\n          ],\n          [\n            [1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128],\n            [109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128],\n            [44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128]\n          ],\n          [\n            [1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128],\n            [94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128],\n            [22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128]\n          ],\n          [\n            [1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128],\n            [124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128],\n            [35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128]\n          ],\n          [\n            [1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128],\n            [121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128],\n            [45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128]\n          ],\n          [\n            [1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128],\n            [203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128],\n            [137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128]\n          ]\n        ],\n        [\n          [\n            [253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128],\n            [175, 13, 224, 243, 193, 185, 249, 198, 255, 255, 128],\n            [73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128]\n          ],\n          [\n            [1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128],\n            [239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128],\n            [155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128]\n          ],\n          [\n            [1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128],\n            [201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128],\n            [69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128]\n          ],\n          [\n            [1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128],\n            [223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128],\n            [141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128]\n          ],\n          [\n            [1, 16, 248, 255, 255, 128, 128, 128, 128, 128, 128],\n            [190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128],\n            [149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128]\n          ],\n          [\n            [1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n            [247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n            [240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128]\n          ],\n          [\n            [1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128],\n            [213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128],\n            [55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128]\n          ],\n          [\n            [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],\n            [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],\n            [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]\n          ]\n        ],\n        [\n          [\n            [202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255],\n            [126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128],\n            [61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128]\n          ],\n          [\n            [1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128],\n            [166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128],\n            [39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128]\n          ],\n          [\n            [1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128],\n            [124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128],\n            [24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128]\n          ],\n          [\n            [1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128],\n            [149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128],\n            [28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128]\n          ],\n          [\n            [1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128],\n            [123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128],\n            [20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128]\n          ],\n          [\n            [1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128],\n            [168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128],\n            [47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128]\n          ],\n          [\n            [1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128],\n            [141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128],\n            [42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128]\n          ],\n          [\n            [1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n            [244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n            [238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128]\n          ]\n        ]\n      ],\n      Ke = [\n        [\n          [231, 120, 48, 89, 115, 113, 120, 152, 112],\n          [152, 179, 64, 126, 170, 118, 46, 70, 95],\n          [175, 69, 143, 80, 85, 82, 72, 155, 103],\n          [56, 58, 10, 171, 218, 189, 17, 13, 152],\n          [114, 26, 17, 163, 44, 195, 21, 10, 173],\n          [121, 24, 80, 195, 26, 62, 44, 64, 85],\n          [144, 71, 10, 38, 171, 213, 144, 34, 26],\n          [170, 46, 55, 19, 136, 160, 33, 206, 71],\n          [63, 20, 8, 114, 114, 208, 12, 9, 226],\n          [81, 40, 11, 96, 182, 84, 29, 16, 36]\n        ],\n        [\n          [134, 183, 89, 137, 98, 101, 106, 165, 148],\n          [72, 187, 100, 130, 157, 111, 32, 75, 80],\n          [66, 102, 167, 99, 74, 62, 40, 234, 128],\n          [41, 53, 9, 178, 241, 141, 26, 8, 107],\n          [74, 43, 26, 146, 73, 166, 49, 23, 157],\n          [65, 38, 105, 160, 51, 52, 31, 115, 128],\n          [104, 79, 12, 27, 217, 255, 87, 17, 7],\n          [87, 68, 71, 44, 114, 51, 15, 186, 23],\n          [47, 41, 14, 110, 182, 183, 21, 17, 194],\n          [66, 45, 25, 102, 197, 189, 23, 18, 22]\n        ],\n        [\n          [88, 88, 147, 150, 42, 46, 45, 196, 205],\n          [43, 97, 183, 117, 85, 38, 35, 179, 61],\n          [39, 53, 200, 87, 26, 21, 43, 232, 171],\n          [56, 34, 51, 104, 114, 102, 29, 93, 77],\n          [39, 28, 85, 171, 58, 165, 90, 98, 64],\n          [34, 22, 116, 206, 23, 34, 43, 166, 73],\n          [107, 54, 32, 26, 51, 1, 81, 43, 31],\n          [68, 25, 106, 22, 64, 171, 36, 225, 114],\n          [34, 19, 21, 102, 132, 188, 16, 76, 124],\n          [62, 18, 78, 95, 85, 57, 50, 48, 51]\n        ],\n        [\n          [193, 101, 35, 159, 215, 111, 89, 46, 111],\n          [60, 148, 31, 172, 219, 228, 21, 18, 111],\n          [112, 113, 77, 85, 179, 255, 38, 120, 114],\n          [40, 42, 1, 196, 245, 209, 10, 25, 109],\n          [88, 43, 29, 140, 166, 213, 37, 43, 154],\n          [61, 63, 30, 155, 67, 45, 68, 1, 209],\n          [100, 80, 8, 43, 154, 1, 51, 26, 71],\n          [142, 78, 78, 16, 255, 128, 34, 197, 171],\n          [41, 40, 5, 102, 211, 183, 4, 1, 221],\n          [51, 50, 17, 168, 209, 192, 23, 25, 82]\n        ],\n        [\n          [138, 31, 36, 171, 27, 166, 38, 44, 229],\n          [67, 87, 58, 169, 82, 115, 26, 59, 179],\n          [63, 59, 90, 180, 59, 166, 93, 73, 154],\n          [40, 40, 21, 116, 143, 209, 34, 39, 175],\n          [47, 15, 16, 183, 34, 223, 49, 45, 183],\n          [46, 17, 33, 183, 6, 98, 15, 32, 183],\n          [57, 46, 22, 24, 128, 1, 54, 17, 37],\n          [65, 32, 73, 115, 28, 128, 23, 128, 205],\n          [40, 3, 9, 115, 51, 192, 18, 6, 223],\n          [87, 37, 9, 115, 59, 77, 64, 21, 47]\n        ],\n        [\n          [104, 55, 44, 218, 9, 54, 53, 130, 226],\n          [64, 90, 70, 205, 40, 41, 23, 26, 57],\n          [54, 57, 112, 184, 5, 41, 38, 166, 213],\n          [30, 34, 26, 133, 152, 116, 10, 32, 134],\n          [39, 19, 53, 221, 26, 114, 32, 73, 255],\n          [31, 9, 65, 234, 2, 15, 1, 118, 73],\n          [75, 32, 12, 51, 192, 255, 160, 43, 51],\n          [88, 31, 35, 67, 102, 85, 55, 186, 85],\n          [56, 21, 23, 111, 59, 205, 45, 37, 192],\n          [55, 38, 70, 124, 73, 102, 1, 34, 98]\n        ],\n        [\n          [125, 98, 42, 88, 104, 85, 117, 175, 82],\n          [95, 84, 53, 89, 128, 100, 113, 101, 45],\n          [75, 79, 123, 47, 51, 128, 81, 171, 1],\n          [57, 17, 5, 71, 102, 57, 53, 41, 49],\n          [38, 33, 13, 121, 57, 73, 26, 1, 85],\n          [41, 10, 67, 138, 77, 110, 90, 47, 114],\n          [115, 21, 2, 10, 102, 255, 166, 23, 6],\n          [101, 29, 16, 10, 85, 128, 101, 196, 26],\n          [57, 18, 10, 102, 102, 213, 34, 20, 43],\n          [117, 20, 15, 36, 163, 128, 68, 1, 26]\n        ],\n        [\n          [102, 61, 71, 37, 34, 53, 31, 243, 192],\n          [69, 60, 71, 38, 73, 119, 28, 222, 37],\n          [68, 45, 128, 34, 1, 47, 11, 245, 171],\n          [62, 17, 19, 70, 146, 85, 55, 62, 70],\n          [37, 43, 37, 154, 100, 163, 85, 160, 1],\n          [63, 9, 92, 136, 28, 64, 32, 201, 85],\n          [75, 15, 9, 9, 64, 255, 184, 119, 16],\n          [86, 6, 28, 5, 64, 255, 25, 248, 1],\n          [56, 8, 17, 132, 137, 255, 55, 116, 128],\n          [58, 15, 20, 82, 135, 57, 26, 121, 40]\n        ],\n        [\n          [164, 50, 31, 137, 154, 133, 25, 35, 218],\n          [51, 103, 44, 131, 131, 123, 31, 6, 158],\n          [86, 40, 64, 135, 148, 224, 45, 183, 128],\n          [22, 26, 17, 131, 240, 154, 14, 1, 209],\n          [45, 16, 21, 91, 64, 222, 7, 1, 197],\n          [56, 21, 39, 155, 60, 138, 23, 102, 213],\n          [83, 12, 13, 54, 192, 255, 68, 47, 28],\n          [85, 26, 85, 85, 128, 128, 32, 146, 171],\n          [18, 11, 7, 63, 144, 171, 4, 4, 246],\n          [35, 27, 10, 146, 174, 171, 12, 26, 128]\n        ],\n        [\n          [190, 80, 35, 99, 180, 80, 126, 54, 45],\n          [85, 126, 47, 87, 176, 51, 41, 20, 32],\n          [101, 75, 128, 139, 118, 146, 116, 128, 85],\n          [56, 41, 15, 176, 236, 85, 37, 9, 62],\n          [71, 30, 17, 119, 118, 255, 17, 18, 138],\n          [101, 38, 60, 138, 55, 70, 43, 26, 142],\n          [146, 36, 19, 30, 171, 255, 97, 27, 20],\n          [138, 45, 61, 62, 219, 1, 81, 188, 64],\n          [32, 41, 20, 117, 151, 142, 20, 21, 163],\n          [112, 19, 12, 61, 195, 128, 48, 4, 24]\n        ]\n      ],\n      Ee = [\n        [\n          [\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [223, 241, 252, 255, 255, 255, 255, 255, 255, 255, 255],\n            [249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255],\n            [234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n            [253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n            [239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n            [254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n            [251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n            [251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n            [254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255],\n            [250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255],\n            [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n          ]\n        ],\n        [\n          [\n            [217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [225, 252, 241, 253, 255, 255, 254, 255, 255, 255, 255],\n            [234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255]\n          ],\n          [\n            [255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n            [238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n            [249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n            [252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n            [253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n            [250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n          ]\n        ],\n        [\n          [\n            [186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255],\n            [234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255],\n            [251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255]\n          ],\n          [\n            [255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n            [236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n            [251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n            [254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n          ]\n        ],\n        [\n          [\n            [248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255],\n            [248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n            [246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n            [252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255],\n            [248, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n            [253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n            [245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n            [253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n            [252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 255, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n            [250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n          ],\n          [\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n            [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]\n          ]\n        ]\n      ],\n      Ge = [0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 0],\n      Nc,\n      Y = [],\n      W = [],\n      ka = [],\n      Za,\n      fd,\n      Nb,\n      pa,\n      Ob,\n      Xc,\n      Tc,\n      Yc,\n      Uc,\n      Zc,\n      Vc,\n      $c,\n      Wc,\n      Rc,\n      Pc,\n      Sc,\n      Qc,\n      re = 1,\n      Cc = 2,\n      ia = [],\n      za,\n      vc,\n      fc,\n      Fc,\n      P = [];\n    va(\"UpsampleRgbLinePair\", Ga, 3);\n    va(\"UpsampleBgrLinePair\", Tb, 3);\n    va(\"UpsampleRgbaLinePair\", wd, 4);\n    va(\"UpsampleBgraLinePair\", vd, 4);\n    va(\"UpsampleArgbLinePair\", ud, 4);\n    va(\"UpsampleRgba4444LinePair\", td, 2);\n    va(\"UpsampleRgb565LinePair\", sd, 2);\n    var Mf = self.UpsampleRgbLinePair,\n      Nf = self.UpsampleBgrLinePair,\n      nd = self.UpsampleRgbaLinePair,\n      od = self.UpsampleBgraLinePair,\n      pd = self.UpsampleArgbLinePair,\n      qd = self.UpsampleRgba4444LinePair,\n      Of = self.UpsampleRgb565LinePair,\n      Wa = 16,\n      Ba = 1 << (Wa - 1),\n      ta = -227,\n      Eb = 482,\n      rd = 6,\n      Pf = (256 << rd) - 1,\n      jc = 0,\n      Yd = V(256),\n      ae = V(256),\n      $d = V(256),\n      Zd = V(256),\n      be = V(Eb - ta),\n      ce = V(Eb - ta);\n    la(\"YuvToRgbRow\", Ga, 3);\n    la(\"YuvToBgrRow\", Tb, 3);\n    la(\"YuvToRgbaRow\", wd, 4);\n    la(\"YuvToBgraRow\", vd, 4);\n    la(\"YuvToArgbRow\", ud, 4);\n    la(\"YuvToRgba4444Row\", td, 2);\n    la(\"YuvToRgb565Row\", sd, 2);\n    var zd = [\n        0,\n        4,\n        8,\n        12,\n        128,\n        132,\n        136,\n        140,\n        256,\n        260,\n        264,\n        268,\n        384,\n        388,\n        392,\n        396\n      ],\n      Ya = [0, 2, 8],\n      Qf = [8, 7, 6, 4, 4, 2, 2, 2, 1, 1, 1, 1],\n      Ne = 1;\n    this.WebPDecodeRGBA = function(a, b, c, d, e) {\n      var f = Ua;\n      var g = new Cf(),\n        h = new Cb();\n      g.ba = h;\n      h.S = f;\n      h.width = [h.width];\n      h.height = [h.height];\n      var k = h.width;\n      var l = h.height,\n        m = new Td();\n      if (null == m || null == a) var n = 2;\n      else\n        x(null != m),\n          (n = Ad(a, b, c, m.width, m.height, m.Pd, m.Qd, m.format, null));\n      0 != n\n        ? (k = 0)\n        : (null != k && (k[0] = m.width[0]),\n          null != l && (l[0] = m.height[0]),\n          (k = 1));\n      if (k) {\n        h.width = h.width[0];\n        h.height = h.height[0];\n        null != d && (d[0] = h.width);\n        null != e && (e[0] = h.height);\n        b: {\n          d = new Oa();\n          e = new md();\n          e.data = a;\n          e.w = b;\n          e.ha = c;\n          e.kd = 1;\n          b = [0];\n          x(null != e);\n          a = Ad(e.data, e.w, e.ha, null, null, null, b, null, e);\n          (0 == a || 7 == a) && b[0] && (a = 4);\n          b = a;\n          if (0 == b) {\n            x(null != g);\n            d.data = e.data;\n            d.w = e.w + e.offset;\n            d.ha = e.ha - e.offset;\n            d.put = kc;\n            d.ac = gc;\n            d.bc = lc;\n            d.ma = g;\n            if (e.xa) {\n              a = Bc();\n              if (null == a) {\n                g = 1;\n                break b;\n              }\n              if (te(a, d)) {\n                b = Cd(d.width, d.height, g.Oa, g.ba);\n                if ((d = 0 == b)) {\n                  c: {\n                    d = a;\n                    d: for (;;) {\n                      if (null == d) {\n                        d = 0;\n                        break c;\n                      }\n                      x(null != d.s.yc);\n                      x(null != d.s.Ya);\n                      x(0 < d.s.Wb);\n                      c = d.l;\n                      x(null != c);\n                      e = c.ma;\n                      x(null != e);\n                      if (0 != d.xb) {\n                        d.ca = e.ba;\n                        d.tb = e.tb;\n                        x(null != d.ca);\n                        if (!hc(e.Oa, c, Va)) {\n                          d.a = 2;\n                          break d;\n                        }\n                        if (!Ec(d, c.width)) break d;\n                        if (c.da) break d;\n                        (c.da || hb(d.ca.S)) && Aa();\n                        11 > d.ca.S ||\n                          (alert(\"todo:WebPInitConvertARGBToYUV\"),\n                          null != d.ca.f.kb.F && Aa());\n                        if (\n                          d.Pb &&\n                          0 < d.s.ua &&\n                          null == d.s.vb.X &&\n                          !Zb(d.s.vb, d.s.Wa.Xa)\n                        ) {\n                          d.a = 1;\n                          break d;\n                        }\n                        d.xb = 0;\n                      }\n                      if (!Jb(d, d.V, d.Ba, d.c, d.i, c.o, ge)) break d;\n                      e.Dc = d.Ma;\n                      d = 1;\n                      break c;\n                    }\n                    x(0 != d.a);\n                    d = 0;\n                  }\n                  d = !d;\n                }\n                d && (b = a.a);\n              } else b = a.a;\n            } else {\n              a = new Ce();\n              if (null == a) {\n                g = 1;\n                break b;\n              }\n              a.Fa = e.na;\n              a.P = e.P;\n              a.qc = e.Sa;\n              if (Kc(a, d)) {\n                if (((b = Cd(d.width, d.height, g.Oa, g.ba)), 0 == b)) {\n                  a.Aa = 0;\n                  c = g.Oa;\n                  e = a;\n                  x(null != e);\n                  if (null != c) {\n                    k = c.Md;\n                    k = 0 > k ? 0 : 100 < k ? 255 : (255 * k) / 100;\n                    if (0 < k) {\n                      for (l = m = 0; 4 > l; ++l)\n                        (n = e.pb[l]),\n                          12 > n.lc &&\n                            (n.ia = (k * Qf[0 > n.lc ? 0 : n.lc]) >> 3),\n                          (m |= n.ia);\n                      m && (alert(\"todo:VP8InitRandom\"), (e.ia = 1));\n                    }\n                    e.Ga = c.Id;\n                    100 < e.Ga ? (e.Ga = 100) : 0 > e.Ga && (e.Ga = 0);\n                  }\n                  Me(a, d) || (b = a.a);\n                }\n              } else b = a.a;\n            }\n            0 == b && null != g.Oa && g.Oa.fd && (b = Bd(g.ba));\n          }\n          g = b;\n        }\n        f = 0 != g ? null : 11 > f ? h.f.RGBA.eb : h.f.kb.y;\n      } else f = null;\n      return f;\n    };\n    var Dd = [3, 4, 3, 4, 4, 2, 2, 4, 4, 4, 2, 1, 1];\n  };\n  new _WebPDecoder();\n\n  /** @license\n   * Copyright (c) 2017 Dominik Homberger\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nhttps://webpjs.appspot.com\nWebPRiffParser dominikhlbg@gmail.com\n*/\n\n  function memcmp(data, data_off, str, size) {\n    for (var i = 0; i < size; i++)\n      if (data[data_off + i] != str.charCodeAt(i)) return true;\n    return false;\n  }\n\n  function GetTag(data, data_off) {\n    var str = \"\";\n    for (var i = 0; i < 4; i++) str += String.fromCharCode(data[data_off++]);\n    return str;\n  }\n\n  function GetLE16(data, data_off) {\n    return (data[data_off + 0] << 0) | (data[data_off + 1] << 8);\n  }\n\n  function GetLE24(data, data_off) {\n    return (\n      ((data[data_off + 0] << 0) |\n        (data[data_off + 1] << 8) |\n        (data[data_off + 2] << 16)) >>>\n      0\n    );\n  }\n\n  function GetLE32(data, data_off) {\n    return (\n      ((data[data_off + 0] << 0) |\n        (data[data_off + 1] << 8) |\n        (data[data_off + 2] << 16) |\n        (data[data_off + 3] << 24)) >>>\n      0\n    );\n  }\n\n  function WebPRiffParser(src, src_off) {\n    var imagearray = {};\n    var i = 0;\n    var alpha_chunk = false;\n    var alpha_size = 0;\n    var alpha_offset = 0;\n    imagearray[\"frames\"] = [];\n    if (memcmp(src, src_off, \"RIFF\", 4)) return;\n    src_off += 4;\n    var riff_size = GetLE32(src, src_off) + 8;\n    src_off += 8;\n\n    while (src_off < src.length) {\n      var fourcc = GetTag(src, src_off);\n      src_off += 4;\n\n      var payload_size = GetLE32(src, src_off);\n      src_off += 4;\n      var payload_size_padded = payload_size + (payload_size & 1);\n\n      switch (fourcc) {\n        case \"VP8 \":\n        case \"VP8L\":\n          if (typeof imagearray[\"frames\"][i] === \"undefined\")\n            imagearray[\"frames\"][i] = {};\n          var obj = imagearray[\"frames\"][i];\n          var height = [0];\n          var width = [0];\n          obj[\"src_off\"] = alpha_chunk ? alpha_offset : src_off - 8;\n          obj[\"src_size\"] = alpha_size + payload_size + 8;\n          //var rgba = webpdecoder.WebPDecodeRGBA(src,(alpha_chunk?alpha_offset:src_off-8),alpha_size+payload_size+8,width,height);\n          //imagearray[i]={'rgba':rgba,'width':width[0],'height':height[0]};\n          i++;\n          if (alpha_chunk) {\n            alpha_chunk = false;\n            alpha_size = 0;\n            alpha_offset = 0;\n          }\n          break;\n        case \"VP8X\":\n          var obj = (imagearray[\"header\"] = {});\n          var feature_flags = (obj[\"feature_flags\"] = src[src_off]);\n          var src_off_ = src_off + 4;\n          var canvas_width = (obj[\"canvas_width\"] = 1 + GetLE24(src, src_off_));\n          src_off_ += 3;\n          var canvas_height = (obj[\"canvas_height\"] =\n            1 + GetLE24(src, src_off_));\n          src_off_ += 3;\n          break;\n        case \"ALPH\":\n          alpha_chunk = true;\n          alpha_size = payload_size_padded + 8;\n          alpha_offset = src_off - 8;\n          break;\n\n        case \"ANIM\":\n          var obj = imagearray[\"header\"];\n          var bgcolor = (obj[\"bgcolor\"] = GetLE32(src, src_off));\n          src_off_ = src_off + 4;\n\n          var loop_count = (obj[\"loop_count\"] = GetLE16(src, src_off_));\n          src_off_ += 2;\n          break;\n        case \"ANMF\":\n          var offset_x = 0,\n            offset_y = 0,\n            width = 0,\n            height = 0,\n            duration = 0,\n            blend = 0,\n            dispose = 0,\n            temp = 0;\n          var obj = (imagearray[\"frames\"][i] = {});\n          obj[\"offset_x\"] = offset_x = 2 * GetLE24(src, src_off);\n          src_off += 3;\n          obj[\"offset_y\"] = offset_y = 2 * GetLE24(src, src_off);\n          src_off += 3;\n          obj[\"width\"] = width = 1 + GetLE24(src, src_off);\n          src_off += 3;\n          obj[\"height\"] = height = 1 + GetLE24(src, src_off);\n          src_off += 3;\n          obj[\"duration\"] = duration = GetLE24(src, src_off);\n          src_off += 3;\n          temp = src[src_off++];\n          obj[\"dispose\"] = dispose = temp & 1;\n          obj[\"blend\"] = blend = (temp >> 1) & 1;\n          break;\n        default:\n      }\n      if (fourcc != \"ANMF\") src_off += payload_size_padded;\n    }\n    return imagearray;\n  }\n\n  var height = [0];\n  var width = [0];\n  var pixels = [];\n  var webpdecoder = new _WebPDecoder();\n\n  var response = imageData;\n  var imagearray = WebPRiffParser(response, 0);\n  imagearray[\"response\"] = response;\n  imagearray[\"rgbaoutput\"] = true;\n  imagearray[\"dataurl\"] = false;\n\n  var header = imagearray[\"header\"] ? imagearray[\"header\"] : null;\n  var frames = imagearray[\"frames\"] ? imagearray[\"frames\"] : null;\n\n  if (header) {\n    header[\"loop_counter\"] = header[\"loop_count\"];\n    height = [header[\"canvas_height\"]];\n    width = [header[\"canvas_width\"]];\n\n    var blend = false;\n    for (var f = 0; f < frames.length; f++)\n      if (frames[f][\"blend\"] == 0) {\n        blend = true;\n        break;\n      }\n  }\n\n  var frame = frames[0];\n  var rgba = webpdecoder.WebPDecodeRGBA(\n    response,\n    frame[\"src_off\"],\n    frame[\"src_size\"],\n    width,\n    height\n  );\n  frame[\"rgba\"] = rgba;\n  frame[\"imgwidth\"] = width[0];\n  frame[\"imgheight\"] = height[0];\n\n  for (var i = 0; i < width[0] * height[0] * 4; i++) {\n    pixels[i] = rgba[i];\n  }\n\n  this.width = width;\n  this.height = height;\n  this.data = pixels;\n  return this;\n}\n\nWebPDecoder.prototype.getData = function() {\n  return this.data;\n};\n\nexport { WebPDecoder };\n","/**\n * @license\n *\n * Copyright (c) 2014 James Robb, https://github.com/jamesbrobb\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * ====================================================================\n */\n\nimport { jsPDF } from \"../jspdf.js\";\nimport { zlibSync } from \"../libs/fflate.js\";\nimport { PNG } from \"../libs/png.js\";\n\n/**\n * jsPDF PNG PlugIn\n * @name png_support\n * @module\n */\n(function(jsPDFAPI) {\n  \"use strict\";\n\n  /*\n   * @see http://www.w3.org/TR/PNG-Chunks.html\n   *\n   Color    Allowed      Interpretation\n   Type     Bit Depths\n\n     0       1,2,4,8,16  Each pixel is a grayscale sample.\n\n     2       8,16        Each pixel is an R,G,B triple.\n\n     3       1,2,4,8     Each pixel is a palette index;\n                         a PLTE chunk must appear.\n\n     4       8,16        Each pixel is a grayscale sample,\n                         followed by an alpha sample.\n\n     6       8,16        Each pixel is an R,G,B triple,\n                         followed by an alpha sample.\n  */\n\n  /*\n   * PNG filter method types\n   *\n   * @see http://www.w3.org/TR/PNG-Filters.html\n   * @see http://www.libpng.org/pub/png/book/chapter09.html\n   *\n   * This is what the value 'Predictor' in decode params relates to\n   *\n   * 15 is \"optimal prediction\", which means the prediction algorithm can change from line to line.\n   * In that case, you actually have to read the first byte off each line for the prediction algorthim (which should be 0-4, corresponding to PDF 10-14) and select the appropriate unprediction algorithm based on that byte.\n   *\n     0       None\n     1       Sub\n     2       Up\n     3       Average\n     4       Paeth\n   */\n\n  var canCompress = function(value) {\n    return value !== jsPDFAPI.image_compression.NONE && hasCompressionJS();\n  };\n\n  var hasCompressionJS = function() {\n    return typeof zlibSync === \"function\";\n  };\n  var compressBytes = function(bytes, lineLength, colorsPerPixel, compression) {\n    var level = 4;\n    var filter_method = filterUp;\n\n    switch (compression) {\n      case jsPDFAPI.image_compression.FAST:\n        level = 1;\n        filter_method = filterSub;\n        break;\n\n      case jsPDFAPI.image_compression.MEDIUM:\n        level = 6;\n        filter_method = filterAverage;\n        break;\n\n      case jsPDFAPI.image_compression.SLOW:\n        level = 9;\n        filter_method = filterPaeth;\n        break;\n    }\n\n    bytes = applyPngFilterMethod(\n      bytes,\n      lineLength,\n      colorsPerPixel,\n      filter_method\n    );\n    var dat = zlibSync(bytes, { level: level });\n    return jsPDFAPI.__addimage__.arrayBufferToBinaryString(dat);\n  };\n\n  var applyPngFilterMethod = function(\n    bytes,\n    lineLength,\n    colorsPerPixel,\n    filter_method\n  ) {\n    var lines = bytes.length / lineLength,\n      result = new Uint8Array(bytes.length + lines),\n      filter_methods = getFilterMethods(),\n      line,\n      prevLine,\n      offset;\n\n    for (var i = 0; i < lines; i += 1) {\n      offset = i * lineLength;\n      line = bytes.subarray(offset, offset + lineLength);\n\n      if (filter_method) {\n        result.set(filter_method(line, colorsPerPixel, prevLine), offset + i);\n      } else {\n        var len = filter_methods.length,\n          results = [];\n\n        for (var j; j < len; j += 1) {\n          results[j] = filter_methods[j](line, colorsPerPixel, prevLine);\n        }\n\n        var ind = getIndexOfSmallestSum(results.concat());\n\n        result.set(results[ind], offset + i);\n      }\n\n      prevLine = line;\n    }\n\n    return result;\n  };\n\n  var filterNone = function(line) {\n    /*var result = new Uint8Array(line.length + 1);\n    result[0] = 0;\n    result.set(line, 1);*/\n\n    var result = Array.apply([], line);\n    result.unshift(0);\n\n    return result;\n  };\n\n  var filterSub = function(line, colorsPerPixel) {\n    var result = [],\n      len = line.length,\n      left;\n\n    result[0] = 1;\n\n    for (var i = 0; i < len; i += 1) {\n      left = line[i - colorsPerPixel] || 0;\n      result[i + 1] = (line[i] - left + 0x0100) & 0xff;\n    }\n\n    return result;\n  };\n\n  var filterUp = function(line, colorsPerPixel, prevLine) {\n    var result = [],\n      len = line.length,\n      up;\n\n    result[0] = 2;\n\n    for (var i = 0; i < len; i += 1) {\n      up = (prevLine && prevLine[i]) || 0;\n      result[i + 1] = (line[i] - up + 0x0100) & 0xff;\n    }\n\n    return result;\n  };\n\n  var filterAverage = function(line, colorsPerPixel, prevLine) {\n    var result = [],\n      len = line.length,\n      left,\n      up;\n\n    result[0] = 3;\n\n    for (var i = 0; i < len; i += 1) {\n      left = line[i - colorsPerPixel] || 0;\n      up = (prevLine && prevLine[i]) || 0;\n      result[i + 1] = (line[i] + 0x0100 - ((left + up) >>> 1)) & 0xff;\n    }\n\n    return result;\n  };\n\n  var filterPaeth = function(line, colorsPerPixel, prevLine) {\n    var result = [],\n      len = line.length,\n      left,\n      up,\n      upLeft,\n      paeth;\n\n    result[0] = 4;\n\n    for (var i = 0; i < len; i += 1) {\n      left = line[i - colorsPerPixel] || 0;\n      up = (prevLine && prevLine[i]) || 0;\n      upLeft = (prevLine && prevLine[i - colorsPerPixel]) || 0;\n      paeth = paethPredictor(left, up, upLeft);\n      result[i + 1] = (line[i] - paeth + 0x0100) & 0xff;\n    }\n\n    return result;\n  };\n\n  var paethPredictor = function(left, up, upLeft) {\n    if (left === up && up === upLeft) {\n      return left;\n    }\n    var pLeft = Math.abs(up - upLeft),\n      pUp = Math.abs(left - upLeft),\n      pUpLeft = Math.abs(left + up - upLeft - upLeft);\n    return pLeft <= pUp && pLeft <= pUpLeft\n      ? left\n      : pUp <= pUpLeft\n      ? up\n      : upLeft;\n  };\n\n  var getFilterMethods = function() {\n    return [filterNone, filterSub, filterUp, filterAverage, filterPaeth];\n  };\n\n  var getIndexOfSmallestSum = function(arrays) {\n    var sum = arrays.map(function(value) {\n      return value.reduce(function(pv, cv) {\n        return pv + Math.abs(cv);\n      }, 0);\n    });\n    return sum.indexOf(Math.min.apply(null, sum));\n  };\n\n  var getPredictorFromCompression = function(compression) {\n    var predictor;\n    switch (compression) {\n      case jsPDFAPI.image_compression.FAST:\n        predictor = 11;\n        break;\n\n      case jsPDFAPI.image_compression.MEDIUM:\n        predictor = 13;\n        break;\n\n      case jsPDFAPI.image_compression.SLOW:\n        predictor = 14;\n        break;\n\n      default:\n        predictor = 12;\n        break;\n    }\n    return predictor;\n  };\n\n  /**\n   * @name processPNG\n   * @function\n   * @ignore\n   */\n  jsPDFAPI.processPNG = function(imageData, index, alias, compression) {\n    \"use strict\";\n\n    var colorSpace,\n      filter = this.decode.FLATE_DECODE,\n      bitsPerComponent,\n      image,\n      decodeParameters = \"\",\n      trns,\n      colors,\n      pal,\n      smask,\n      pixels,\n      len,\n      alphaData,\n      imgData,\n      hasColors,\n      pixel,\n      i,\n      n;\n\n    if (this.__addimage__.isArrayBuffer(imageData))\n      imageData = new Uint8Array(imageData);\n\n    if (this.__addimage__.isArrayBufferView(imageData)) {\n      image = new PNG(imageData);\n      imageData = image.imgData;\n      bitsPerComponent = image.bits;\n      colorSpace = image.colorSpace;\n      colors = image.colors;\n\n      /*\n       * colorType 6 - Each pixel is an R,G,B triple, followed by an alpha sample.\n       *\n       * colorType 4 - Each pixel is a grayscale sample, followed by an alpha sample.\n       *\n       * Extract alpha to create two separate images, using the alpha as a sMask\n       */\n      if ([4, 6].indexOf(image.colorType) !== -1) {\n        /*\n         * processes 8 bit RGBA and grayscale + alpha images\n         */\n        if (image.bits === 8) {\n          pixels =\n            image.pixelBitlength == 32\n              ? new Uint32Array(image.decodePixels().buffer)\n              : image.pixelBitlength == 16\n              ? new Uint16Array(image.decodePixels().buffer)\n              : new Uint8Array(image.decodePixels().buffer);\n          len = pixels.length;\n          imgData = new Uint8Array(len * image.colors);\n          alphaData = new Uint8Array(len);\n          var pDiff = image.pixelBitlength - image.bits;\n          i = 0;\n          n = 0;\n          var pbl;\n\n          for (; i < len; i++) {\n            pixel = pixels[i];\n            pbl = 0;\n\n            while (pbl < pDiff) {\n              imgData[n++] = (pixel >>> pbl) & 0xff;\n              pbl = pbl + image.bits;\n            }\n\n            alphaData[i] = (pixel >>> pbl) & 0xff;\n          }\n        }\n\n        /*\n         * processes 16 bit RGBA and grayscale + alpha images\n         */\n        if (image.bits === 16) {\n          pixels = new Uint32Array(image.decodePixels().buffer);\n          len = pixels.length;\n          imgData = new Uint8Array(\n            len * (32 / image.pixelBitlength) * image.colors\n          );\n          alphaData = new Uint8Array(len * (32 / image.pixelBitlength));\n          hasColors = image.colors > 1;\n          i = 0;\n          n = 0;\n          var a = 0;\n\n          while (i < len) {\n            pixel = pixels[i++];\n\n            imgData[n++] = (pixel >>> 0) & 0xff;\n\n            if (hasColors) {\n              imgData[n++] = (pixel >>> 16) & 0xff;\n\n              pixel = pixels[i++];\n              imgData[n++] = (pixel >>> 0) & 0xff;\n            }\n\n            alphaData[a++] = (pixel >>> 16) & 0xff;\n          }\n          bitsPerComponent = 8;\n        }\n\n        if (canCompress(compression)) {\n          imageData = compressBytes(\n            imgData,\n            image.width * image.colors,\n            image.colors,\n            compression\n          );\n          smask = compressBytes(alphaData, image.width, 1, compression);\n        } else {\n          imageData = imgData;\n          smask = alphaData;\n          filter = undefined;\n        }\n      }\n\n      /*\n       * Indexed png. Each pixel is a palette index.\n       */\n      if (image.colorType === 3) {\n        colorSpace = this.color_spaces.INDEXED;\n        pal = image.palette;\n\n        if (image.transparency.indexed) {\n          var trans = image.transparency.indexed;\n          var total = 0;\n          i = 0;\n          len = trans.length;\n\n          for (; i < len; ++i) {\n            total += trans[i];\n          }\n\n          total = total / 255;\n\n          /*\n           * a single color is specified as 100% transparent (0),\n           * so we set trns to use a /Mask with that index\n           */\n          if (total === len - 1 && trans.indexOf(0) !== -1) {\n            trns = [trans.indexOf(0)];\n\n            /*\n             * there's more than one colour within the palette that specifies\n             * a transparency value less than 255, so we unroll the pixels to create an image sMask\n             */\n          } else if (total !== len) {\n            pixels = image.decodePixels();\n            alphaData = new Uint8Array(pixels.length);\n            i = 0;\n            len = pixels.length;\n\n            for (; i < len; i++) {\n              alphaData[i] = trans[pixels[i]];\n            }\n\n            smask = compressBytes(alphaData, image.width, 1);\n          }\n        }\n      }\n\n      var predictor = getPredictorFromCompression(compression);\n\n      if (filter === this.decode.FLATE_DECODE) {\n        decodeParameters = \"/Predictor \" + predictor + \" \";\n      }\n      decodeParameters +=\n        \"/Colors \" +\n        colors +\n        \" /BitsPerComponent \" +\n        bitsPerComponent +\n        \" /Columns \" +\n        image.width;\n\n      if (\n        this.__addimage__.isArrayBuffer(imageData) ||\n        this.__addimage__.isArrayBufferView(imageData)\n      ) {\n        imageData = this.__addimage__.arrayBufferToBinaryString(imageData);\n      }\n\n      if (\n        (smask && this.__addimage__.isArrayBuffer(smask)) ||\n        this.__addimage__.isArrayBufferView(smask)\n      ) {\n        smask = this.__addimage__.arrayBufferToBinaryString(smask);\n      }\n\n      return {\n        alias: alias,\n        data: imageData,\n        index: index,\n        filter: filter,\n        decodeParameters: decodeParameters,\n        transparency: trns,\n        palette: pal,\n        sMask: smask,\n        predictor: predictor,\n        width: image.width,\n        height: image.height,\n        bitsPerComponent: bitsPerComponent,\n        colorSpace: colorSpace\n      };\n    }\n  };\n})(jsPDF.API);\n","/**\n * @license\n * Copyright (c) 2017 Aras Abbasi\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\nimport { GifReader } from \"../libs/omggif.js\";\nimport { JPEGEncoder } from \"../libs/JPEGEncoder.js\";\n\n/**\n * jsPDF Gif Support PlugIn\n *\n * @name gif_support\n * @module\n */\n(function(jsPDFAPI) {\n  \"use strict\";\n\n  jsPDFAPI.processGIF89A = function(imageData, index, alias, compression) {\n    var reader = new GifReader(imageData);\n    var width = reader.width,\n      height = reader.height;\n    var qu = 100;\n    var pixels = [];\n\n    reader.decodeAndBlitFrameRGBA(0, pixels);\n    var rawImageData = {\n      data: pixels,\n      width: width,\n      height: height\n    };\n\n    var encoder = new JPEGEncoder(qu);\n    var data = encoder.encode(rawImageData, qu);\n    return jsPDFAPI.processJPEG.call(this, data, index, alias, compression);\n  };\n\n  jsPDFAPI.processGIF87A = jsPDFAPI.processGIF89A;\n})(jsPDF.API);\n","import { JPEGEncoder } from \"../libs/JPEGEncoder.js\";\nimport { BmpDecoder } from \"../libs/BMPDecoder.js\";\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * @license\n * Copyright (c) 2018 Aras Abbasi\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\n/**\n * jsPDF bmp Support PlugIn\n * @name bmp_support\n * @module\n */\n(function(jsPDFAPI) {\n  \"use strict\";\n\n  jsPDFAPI.processBMP = function(imageData, index, alias, compression) {\n    var reader = new BmpDecoder(imageData, false);\n    var width = reader.width,\n      height = reader.height;\n    var qu = 100;\n    var pixels = reader.getData();\n\n    var rawImageData = {\n      data: pixels,\n      width: width,\n      height: height\n    };\n\n    var encoder = new JPEGEncoder(qu);\n    var data = encoder.encode(rawImageData, qu);\n    return jsPDFAPI.processJPEG.call(this, data, index, alias, compression);\n  };\n})(jsPDF.API);\n","/**\n * @license\n * Copyright (c) 2019 Aras Abbasi\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\nimport { JPEGEncoder } from \"../libs/JPEGEncoder.js\";\nimport { WebPDecoder } from \"../libs/WebPDecoder.js\";\n\n/**\n * jsPDF webp Support PlugIn\n *\n * @name webp_support\n * @module\n */\n(function(jsPDFAPI) {\n  \"use strict\";\n\n  jsPDFAPI.processWEBP = function(imageData, index, alias, compression) {\n    var reader = new WebPDecoder(imageData, false);\n    var width = reader.width,\n      height = reader.height;\n    var qu = 100;\n    var pixels = reader.getData();\n\n    var rawImageData = {\n      data: pixels,\n      width: width,\n      height: height\n    };\n\n    var encoder = new JPEGEncoder(qu);\n    var data = encoder.encode(rawImageData, qu);\n    return jsPDFAPI.processJPEG.call(this, data, index, alias, compression);\n  };\n})(jsPDF.API);\n","/**\n * @license\n *\n * Copyright (c) 2021 Antti Palola, https://github.com/Pantura\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * ====================================================================\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * jsPDF RGBA array PlugIn\n * @name rgba_support\n * @module\n */\n(function(jsPDFAPI) {\n  \"use strict\";\n\n  /**\n   * @name processRGBA\n   * @function\n   *\n   * Process RGBA Array. This is a one-dimension array with pixel data [red, green, blue, alpha, red, green, ...].\n   * RGBA array data can be obtained from DOM canvas getImageData.\n   * @ignore\n   */\n  jsPDFAPI.processRGBA = function(imageData, index, alias) {\n    \"use strict\";\n\n    var imagePixels = imageData.data;\n    var length = imagePixels.length;\n    // jsPDF takes alpha data separately so extract that.\n    var rgbOut = new Uint8Array((length / 4) * 3);\n    var alphaOut = new Uint8Array(length / 4);\n    var outIndex = 0;\n    var alphaIndex = 0;\n\n    for (var i = 0; i < length; i += 4) {\n      var r = imagePixels[i];\n      var g = imagePixels[i + 1];\n      var b = imagePixels[i + 2];\n      var alpha = imagePixels[i + 3];\n      rgbOut[outIndex++] = r;\n      rgbOut[outIndex++] = g;\n      rgbOut[outIndex++] = b;\n      alphaOut[alphaIndex++] = alpha;\n    }\n\n    var rgbData = this.__addimage__.arrayBufferToBinaryString(rgbOut);\n    var alphaData = this.__addimage__.arrayBufferToBinaryString(alphaOut);\n\n    return {\n      alpha: alphaData,\n      data: rgbData,\n      index: index,\n      alias: alias,\n      colorSpace: \"DeviceRGB\",\n      bitsPerComponent: 8,\n      width: imageData.width,\n      height: imageData.height\n    };\n  };\n})(jsPDF.API);\n","/**\n * @license\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * jsPDF setLanguage Plugin\n *\n * @name setLanguage\n * @module\n */\n(function(jsPDFAPI) {\n  \"use strict\";\n\n  /**\n   * Add Language Tag to the generated PDF\n   *\n   * @name setLanguage\n   * @function\n   * @param {string} langCode The Language code as ISO-639-1 (e.g. 'en') or as country language code (e.g. 'en-GB').\n   * @returns {jsPDF}\n   * @example\n   * var doc = new jsPDF()\n   * doc.text(10, 10, 'This is a test')\n   * doc.setLanguage(\"en-US\")\n   * doc.save('english.pdf')\n   */\n  jsPDFAPI.setLanguage = function(langCode) {\n    \"use strict\";\n\n    var langCodes = {\n      af: \"Afrikaans\",\n      sq: \"Albanian\",\n      ar: \"Arabic (Standard)\",\n      \"ar-DZ\": \"Arabic (Algeria)\",\n      \"ar-BH\": \"Arabic (Bahrain)\",\n      \"ar-EG\": \"Arabic (Egypt)\",\n      \"ar-IQ\": \"Arabic (Iraq)\",\n      \"ar-JO\": \"Arabic (Jordan)\",\n      \"ar-KW\": \"Arabic (Kuwait)\",\n      \"ar-LB\": \"Arabic (Lebanon)\",\n      \"ar-LY\": \"Arabic (Libya)\",\n      \"ar-MA\": \"Arabic (Morocco)\",\n      \"ar-OM\": \"Arabic (Oman)\",\n      \"ar-QA\": \"Arabic (Qatar)\",\n      \"ar-SA\": \"Arabic (Saudi Arabia)\",\n      \"ar-SY\": \"Arabic (Syria)\",\n      \"ar-TN\": \"Arabic (Tunisia)\",\n      \"ar-AE\": \"Arabic (U.A.E.)\",\n      \"ar-YE\": \"Arabic (Yemen)\",\n      an: \"Aragonese\",\n      hy: \"Armenian\",\n      as: \"Assamese\",\n      ast: \"Asturian\",\n      az: \"Azerbaijani\",\n      eu: \"Basque\",\n      be: \"Belarusian\",\n      bn: \"Bengali\",\n      bs: \"Bosnian\",\n      br: \"Breton\",\n      bg: \"Bulgarian\",\n      my: \"Burmese\",\n      ca: \"Catalan\",\n      ch: \"Chamorro\",\n      ce: \"Chechen\",\n      zh: \"Chinese\",\n      \"zh-HK\": \"Chinese (Hong Kong)\",\n      \"zh-CN\": \"Chinese (PRC)\",\n      \"zh-SG\": \"Chinese (Singapore)\",\n      \"zh-TW\": \"Chinese (Taiwan)\",\n      cv: \"Chuvash\",\n      co: \"Corsican\",\n      cr: \"Cree\",\n      hr: \"Croatian\",\n      cs: \"Czech\",\n      da: \"Danish\",\n      nl: \"Dutch (Standard)\",\n      \"nl-BE\": \"Dutch (Belgian)\",\n      en: \"English\",\n      \"en-AU\": \"English (Australia)\",\n      \"en-BZ\": \"English (Belize)\",\n      \"en-CA\": \"English (Canada)\",\n      \"en-IE\": \"English (Ireland)\",\n      \"en-JM\": \"English (Jamaica)\",\n      \"en-NZ\": \"English (New Zealand)\",\n      \"en-PH\": \"English (Philippines)\",\n      \"en-ZA\": \"English (South Africa)\",\n      \"en-TT\": \"English (Trinidad & Tobago)\",\n      \"en-GB\": \"English (United Kingdom)\",\n      \"en-US\": \"English (United States)\",\n      \"en-ZW\": \"English (Zimbabwe)\",\n      eo: \"Esperanto\",\n      et: \"Estonian\",\n      fo: \"Faeroese\",\n      fj: \"Fijian\",\n      fi: \"Finnish\",\n      fr: \"French (Standard)\",\n      \"fr-BE\": \"French (Belgium)\",\n      \"fr-CA\": \"French (Canada)\",\n      \"fr-FR\": \"French (France)\",\n      \"fr-LU\": \"French (Luxembourg)\",\n      \"fr-MC\": \"French (Monaco)\",\n      \"fr-CH\": \"French (Switzerland)\",\n      fy: \"Frisian\",\n      fur: \"Friulian\",\n      gd: \"Gaelic (Scots)\",\n      \"gd-IE\": \"Gaelic (Irish)\",\n      gl: \"Galacian\",\n      ka: \"Georgian\",\n      de: \"German (Standard)\",\n      \"de-AT\": \"German (Austria)\",\n      \"de-DE\": \"German (Germany)\",\n      \"de-LI\": \"German (Liechtenstein)\",\n      \"de-LU\": \"German (Luxembourg)\",\n      \"de-CH\": \"German (Switzerland)\",\n      el: \"Greek\",\n      gu: \"Gujurati\",\n      ht: \"Haitian\",\n      he: \"Hebrew\",\n      hi: \"Hindi\",\n      hu: \"Hungarian\",\n      is: \"Icelandic\",\n      id: \"Indonesian\",\n      iu: \"Inuktitut\",\n      ga: \"Irish\",\n      it: \"Italian (Standard)\",\n      \"it-CH\": \"Italian (Switzerland)\",\n      ja: \"Japanese\",\n      kn: \"Kannada\",\n      ks: \"Kashmiri\",\n      kk: \"Kazakh\",\n      km: \"Khmer\",\n      ky: \"Kirghiz\",\n      tlh: \"Klingon\",\n      ko: \"Korean\",\n      \"ko-KP\": \"Korean (North Korea)\",\n      \"ko-KR\": \"Korean (South Korea)\",\n      la: \"Latin\",\n      lv: \"Latvian\",\n      lt: \"Lithuanian\",\n      lb: \"Luxembourgish\",\n      mk: \"North Macedonia\",\n      ms: \"Malay\",\n      ml: \"Malayalam\",\n      mt: \"Maltese\",\n      mi: \"Maori\",\n      mr: \"Marathi\",\n      mo: \"Moldavian\",\n      nv: \"Navajo\",\n      ng: \"Ndonga\",\n      ne: \"Nepali\",\n      no: \"Norwegian\",\n      nb: \"Norwegian (Bokmal)\",\n      nn: \"Norwegian (Nynorsk)\",\n      oc: \"Occitan\",\n      or: \"Oriya\",\n      om: \"Oromo\",\n      fa: \"Persian\",\n      \"fa-IR\": \"Persian/Iran\",\n      pl: \"Polish\",\n      pt: \"Portuguese\",\n      \"pt-BR\": \"Portuguese (Brazil)\",\n      pa: \"Punjabi\",\n      \"pa-IN\": \"Punjabi (India)\",\n      \"pa-PK\": \"Punjabi (Pakistan)\",\n      qu: \"Quechua\",\n      rm: \"Rhaeto-Romanic\",\n      ro: \"Romanian\",\n      \"ro-MO\": \"Romanian (Moldavia)\",\n      ru: \"Russian\",\n      \"ru-MO\": \"Russian (Moldavia)\",\n      sz: \"Sami (Lappish)\",\n      sg: \"Sango\",\n      sa: \"Sanskrit\",\n      sc: \"Sardinian\",\n      sd: \"Sindhi\",\n      si: \"Singhalese\",\n      sr: \"Serbian\",\n      sk: \"Slovak\",\n      sl: \"Slovenian\",\n      so: \"Somani\",\n      sb: \"Sorbian\",\n      es: \"Spanish\",\n      \"es-AR\": \"Spanish (Argentina)\",\n      \"es-BO\": \"Spanish (Bolivia)\",\n      \"es-CL\": \"Spanish (Chile)\",\n      \"es-CO\": \"Spanish (Colombia)\",\n      \"es-CR\": \"Spanish (Costa Rica)\",\n      \"es-DO\": \"Spanish (Dominican Republic)\",\n      \"es-EC\": \"Spanish (Ecuador)\",\n      \"es-SV\": \"Spanish (El Salvador)\",\n      \"es-GT\": \"Spanish (Guatemala)\",\n      \"es-HN\": \"Spanish (Honduras)\",\n      \"es-MX\": \"Spanish (Mexico)\",\n      \"es-NI\": \"Spanish (Nicaragua)\",\n      \"es-PA\": \"Spanish (Panama)\",\n      \"es-PY\": \"Spanish (Paraguay)\",\n      \"es-PE\": \"Spanish (Peru)\",\n      \"es-PR\": \"Spanish (Puerto Rico)\",\n      \"es-ES\": \"Spanish (Spain)\",\n      \"es-UY\": \"Spanish (Uruguay)\",\n      \"es-VE\": \"Spanish (Venezuela)\",\n      sx: \"Sutu\",\n      sw: \"Swahili\",\n      sv: \"Swedish\",\n      \"sv-FI\": \"Swedish (Finland)\",\n      \"sv-SV\": \"Swedish (Sweden)\",\n      ta: \"Tamil\",\n      tt: \"Tatar\",\n      te: \"Teluga\",\n      th: \"Thai\",\n      tig: \"Tigre\",\n      ts: \"Tsonga\",\n      tn: \"Tswana\",\n      tr: \"Turkish\",\n      tk: \"Turkmen\",\n      uk: \"Ukrainian\",\n      hsb: \"Upper Sorbian\",\n      ur: \"Urdu\",\n      ve: \"Venda\",\n      vi: \"Vietnamese\",\n      vo: \"Volapuk\",\n      wa: \"Walloon\",\n      cy: \"Welsh\",\n      xh: \"Xhosa\",\n      ji: \"Yiddish\",\n      zu: \"Zulu\"\n    };\n\n    if (this.internal.languageSettings === undefined) {\n      this.internal.languageSettings = {};\n      this.internal.languageSettings.isSubscribed = false;\n    }\n\n    if (langCodes[langCode] !== undefined) {\n      this.internal.languageSettings.languageCode = langCode;\n      if (this.internal.languageSettings.isSubscribed === false) {\n        this.internal.events.subscribe(\"putCatalog\", function() {\n          this.internal.write(\n            \"/Lang (\" + this.internal.languageSettings.languageCode + \")\"\n          );\n        });\n        this.internal.languageSettings.isSubscribed = true;\n      }\n    }\n    return this;\n  };\n})(jsPDF.API);\n","/** @license\n jsPDF standard_fonts_metrics plugin\n * Copyright (c) 2012 Willow Systems Corporation, https://github.com/willowsystems\n * MIT license.\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n * \n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * ====================================================================\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * This file adds the standard font metrics to jsPDF.\n *\n * Font metrics data is reprocessed derivative of contents of\n * \"Font Metrics for PDF Core 14 Fonts\" package, which exhibits the following copyright and license:\n *\n * Copyright (c) 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.\n *\n * This file and the 14 PostScript(R) AFM files it accompanies may be used,\n * copied, and distributed for any purpose and without charge, with or without\n * modification, provided that all copyright notices are retained; that the AFM\n * files are not distributed without this file; that all modifications to this\n * file or any of the AFM files are prominently noted in the modified file(s);\n * and that this paragraph is not modified. Adobe Systems has no responsibility\n * or obligation to support the use of the AFM files.\n *\n * @name standard_fonts_metrics\n * @module\n */\n\n(function(API) {\n  \"use strict\";\n  API.__fontmetrics__ = API.__fontmetrics__ || {};\n\n  var decoded = \"0123456789abcdef\",\n    encoded = \"klmnopqrstuvwxyz\",\n    mappingUncompress = {},\n    mappingCompress = {};\n\n  for (var i = 0; i < encoded.length; i++) {\n    mappingUncompress[encoded[i]] = decoded[i];\n    mappingCompress[decoded[i]] = encoded[i];\n  }\n\n  var hex = function(value) {\n    return \"0x\" + parseInt(value, 10).toString(16);\n  };\n\n  var compress = (API.__fontmetrics__.compress = function(data) {\n    var vals = [\"{\"];\n    var value, keystring, valuestring, numberprefix;\n\n    for (var key in data) {\n      value = data[key];\n\n      if (!isNaN(parseInt(key, 10))) {\n        key = parseInt(key, 10);\n        keystring = hex(key).slice(2);\n        keystring =\n          keystring.slice(0, -1) + mappingCompress[keystring.slice(-1)];\n      } else {\n        keystring = \"'\" + key + \"'\";\n      }\n\n      if (typeof value == \"number\") {\n        if (value < 0) {\n          valuestring = hex(value).slice(3);\n          numberprefix = \"-\";\n        } else {\n          valuestring = hex(value).slice(2);\n          numberprefix = \"\";\n        }\n        valuestring =\n          numberprefix +\n          valuestring.slice(0, -1) +\n          mappingCompress[valuestring.slice(-1)];\n      } else {\n        if (typeof value === \"object\") {\n          valuestring = compress(value);\n        } else {\n          throw new Error(\n            \"Don't know what to do with value type \" + typeof value + \".\"\n          );\n        }\n      }\n      vals.push(keystring + valuestring);\n    }\n    vals.push(\"}\");\n    return vals.join(\"\");\n  });\n\n  /**\n   * Uncompresses data compressed into custom, base16-like format.\n   *\n   * @public\n   * @function\n   * @param\n   * @returns {Type}\n   */\n  var uncompress = (API.__fontmetrics__.uncompress = function(data) {\n    if (typeof data !== \"string\") {\n      throw new Error(\"Invalid argument passed to uncompress.\");\n    }\n\n    var output = {},\n      sign = 1,\n      stringparts, // undef. will be [] in string mode\n      activeobject = output,\n      parentchain = [],\n      parent_key_pair,\n      keyparts = \"\",\n      valueparts = \"\",\n      key, // undef. will be Truthy when Key is resolved.\n      datalen = data.length - 1, // stripping ending }\n      ch;\n\n    for (var i = 1; i < datalen; i += 1) {\n      // - { } ' are special.\n\n      ch = data[i];\n\n      if (ch == \"'\") {\n        if (stringparts) {\n          // end of string mode\n          key = stringparts.join(\"\");\n          stringparts = undefined;\n        } else {\n          // start of string mode\n          stringparts = [];\n        }\n      } else if (stringparts) {\n        stringparts.push(ch);\n      } else if (ch == \"{\") {\n        // start of object\n        parentchain.push([activeobject, key]);\n        activeobject = {};\n        key = undefined;\n      } else if (ch == \"}\") {\n        // end of object\n        parent_key_pair = parentchain.pop();\n        parent_key_pair[0][parent_key_pair[1]] = activeobject;\n        key = undefined;\n        activeobject = parent_key_pair[0];\n      } else if (ch == \"-\") {\n        sign = -1;\n      } else {\n        // must be number\n        if (key === undefined) {\n          if (mappingUncompress.hasOwnProperty(ch)) {\n            keyparts += mappingUncompress[ch];\n            key = parseInt(keyparts, 16) * sign;\n            sign = +1;\n            keyparts = \"\";\n          } else {\n            keyparts += ch;\n          }\n        } else {\n          if (mappingUncompress.hasOwnProperty(ch)) {\n            valueparts += mappingUncompress[ch];\n            activeobject[key] = parseInt(valueparts, 16) * sign;\n            sign = +1;\n            key = undefined;\n            valueparts = \"\";\n          } else {\n            valueparts += ch;\n          }\n        }\n      }\n    }\n    return output;\n  });\n\n  // encoding = 'Unicode'\n  // NOT UTF8, NOT UTF16BE/LE, NOT UCS2BE/LE. NO clever BOM behavior\n  // Actual 16bit char codes used.\n  // no multi-byte logic here\n\n  // Unicode characters to WinAnsiEncoding:\n  // {402: 131, 8211: 150, 8212: 151, 8216: 145, 8217: 146, 8218: 130, 8220: 147, 8221: 148, 8222: 132, 8224: 134, 8225: 135, 8226: 149, 8230: 133, 8364: 128, 8240:137, 8249: 139, 8250: 155, 710: 136, 8482: 153, 338: 140, 339: 156, 732: 152, 352: 138, 353: 154, 376: 159, 381: 142, 382: 158}\n  // as you can see, all Unicode chars are outside of 0-255 range. No char code conflicts.\n  // this means that you can give Win cp1252 encoded strings to jsPDF for rendering directly\n  // as well as give strings with some (supported by these fonts) Unicode characters and\n  // these will be mapped to win cp1252\n  // for example, you can send char code (cp1252) 0x80 or (unicode) 0x20AC, getting \"Euro\" glyph displayed in both cases.\n\n  var encodingBlock = {\n    codePages: [\"WinAnsiEncoding\"],\n    WinAnsiEncoding: uncompress(\n      \"{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}\"\n    )\n  };\n  var encodings = {\n    Unicode: {\n      Courier: encodingBlock,\n      \"Courier-Bold\": encodingBlock,\n      \"Courier-BoldOblique\": encodingBlock,\n      \"Courier-Oblique\": encodingBlock,\n      Helvetica: encodingBlock,\n      \"Helvetica-Bold\": encodingBlock,\n      \"Helvetica-BoldOblique\": encodingBlock,\n      \"Helvetica-Oblique\": encodingBlock,\n      \"Times-Roman\": encodingBlock,\n      \"Times-Bold\": encodingBlock,\n      \"Times-BoldItalic\": encodingBlock,\n      \"Times-Italic\": encodingBlock\n      //\t, 'Symbol'\n      //\t, 'ZapfDingbats'\n    }\n  };\n\n  var fontMetrics = {\n    Unicode: {\n      // all sizing numbers are n/fontMetricsFractionOf = one font size unit\n      // this means that if fontMetricsFractionOf = 1000, and letter A's width is 476, it's\n      // width is 476/1000 or 47.6% of its height (regardless of font size)\n      // At this time this value applies to \"widths\" and \"kerning\" numbers.\n\n      // char code 0 represents \"default\" (average) width - use it for chars missing in this table.\n      // key 'fof' represents the \"fontMetricsFractionOf\" value\n\n      \"Courier-Oblique\": uncompress(\n        \"{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}\"\n      ),\n      \"Times-BoldItalic\": uncompress(\n        \"{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}\"\n      ),\n      \"Helvetica-Bold\": uncompress(\n        \"{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}\"\n      ),\n      Courier: uncompress(\"{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}\"),\n      \"Courier-BoldOblique\": uncompress(\n        \"{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}\"\n      ),\n      \"Times-Bold\": uncompress(\n        \"{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}\"\n      ),\n      Symbol: uncompress(\n        \"{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}\"\n      ),\n      Helvetica: uncompress(\n        \"{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}\"\n      ),\n      \"Helvetica-BoldOblique\": uncompress(\n        \"{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}\"\n      ),\n      ZapfDingbats: uncompress(\"{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}\"),\n      \"Courier-Bold\": uncompress(\"{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}\"),\n      \"Times-Italic\": uncompress(\n        \"{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}\"\n      ),\n      \"Times-Roman\": uncompress(\n        \"{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}\"\n      ),\n      \"Helvetica-Oblique\": uncompress(\n        \"{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}\"\n      )\n    }\n  };\n\n  /*\n\tThis event handler is fired when a new jsPDF object is initialized\n\tThis event handler appends metrics data to standard fonts within\n\tthat jsPDF instance. The metrics are mapped over Unicode character\n\tcodes, NOT CIDs or other codes matching the StandardEncoding table of the\n\tstandard PDF fonts.\n\tFuture:\n\tAlso included is the encoding maping table, converting Unicode (UCS-2, UTF-16)\n\tchar codes to StandardEncoding character codes. The encoding table is to be used\n\tsomewhere around \"pdfEscape\" call.\n\t*/\n  API.events.push([\n    \"addFont\",\n    function(data) {\n      var font = data.font;\n\n      var metrics = fontMetrics[\"Unicode\"][font.postScriptName];\n      if (metrics) {\n        font.metadata[\"Unicode\"] = {};\n        font.metadata[\"Unicode\"].widths = metrics.widths;\n        font.metadata[\"Unicode\"].kerning = metrics.kerning;\n      }\n\n      var encodingBlock = encodings[\"Unicode\"][font.postScriptName];\n      if (encodingBlock) {\n        font.metadata[\"Unicode\"].encoding = encodingBlock;\n        font.encoding = encodingBlock.codePages[0];\n      }\n    }\n  ]); // end of adding event handler\n})(jsPDF.API);\n","/**\n * @license\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\nimport { atob } from \"../libs/AtobBtoa.js\";\n\n/**\n * @name ttfsupport\n * @module\n */\n(function(jsPDF) {\n  \"use strict\";\n\n  var binaryStringToUint8Array = function(binary_string) {\n    var len = binary_string.length;\n    var bytes = new Uint8Array(len);\n    for (var i = 0; i < len; i++) {\n      bytes[i] = binary_string.charCodeAt(i);\n    }\n    return bytes;\n  };\n\n  var addFont = function(font, file) {\n    // eslint-disable-next-line no-control-regex\n    if (/^\\x00\\x01\\x00\\x00/.test(file)) {\n      file = binaryStringToUint8Array(file);\n    } else {\n      file = binaryStringToUint8Array(atob(file));\n    }\n    font.metadata = jsPDF.API.TTFFont.open(file);\n    font.metadata.Unicode = font.metadata.Unicode || {\n      encoding: {},\n      kerning: {},\n      widths: []\n    };\n    font.metadata.glyIdsUsed = [0];\n  };\n\n  jsPDF.API.events.push([\n    \"addFont\",\n    function(data) {\n      var file = undefined;\n      var font = data.font;\n      var instance = data.instance;\n      if (font.isStandardFont) {\n        return;\n      }\n      if (typeof instance !== \"undefined\") {\n        if (instance.existsFileInVFS(font.postScriptName) === false) {\n          file = instance.loadFile(font.postScriptName);\n        } else {\n          file = instance.getFileFromVFS(font.postScriptName);\n        }\n        if (typeof file !== \"string\") {\n          throw new Error(\n            \"Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('\" +\n              font.postScriptName +\n              \"').\"\n          );\n        }\n        addFont(font, file);\n      } else {\n        throw new Error(\n          \"Font does not exist in vFS, import fonts or remove declaration doc.addFont('\" +\n            font.postScriptName +\n            \"').\"\n        );\n      }\n    }\n  ]); // end of adding event handler\n})(jsPDF);\n","/** @license\n * Copyright (c) 2012 Willow Systems Corporation, https://github.com/willowsystems\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * ====================================================================\n */\n\nimport { jsPDF } from \"../jspdf.js\";\nimport { console } from \"../libs/console.js\";\nimport { globalObject } from \"../libs/globalObject.js\";\n\n/**\n * jsPDF SVG plugin\n *\n * @name svg\n * @module\n */\n(function(jsPDFAPI) {\n  \"use strict\";\n\n  function loadCanvg() {\n    return (function() {\n      if (globalObject[\"canvg\"]) {\n        return Promise.resolve(globalObject[\"canvg\"]);\n      }\n\n      return import(\"canvg\");\n\n    })()\n      .catch(function(e) {\n        return Promise.reject(new Error(\"Could not load canvg: \" + e));\n      })\n      .then(function(canvg) {\n        return canvg.default ? canvg.default : canvg;\n      });\n  }\n\n  /**\n   * Parses SVG XML and saves it as image into the PDF.\n   *\n   * Depends on canvas-element and canvg\n   *\n   * @name addSvgAsImage\n   * @public\n   * @function\n   * @param {string} SVG-Data as Text\n   * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page\n   * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page\n   * @param {number} width of SVG-Image (in units declared at inception of PDF document)\n   * @param {number} height of SVG-Image (in units declared at inception of PDF document)\n   * @param {string} alias of SVG-Image (if used multiple times)\n   * @param {string} compression of the generated JPEG, can have the values 'NONE', 'FAST', 'MEDIUM' and 'SLOW'\n   * @param {number} rotation of the image in degrees (0-359)\n   *\n   * @returns jsPDF jsPDF-instance\n   */\n  jsPDFAPI.addSvgAsImage = function(\n    svg,\n    x,\n    y,\n    w,\n    h,\n    alias,\n    compression,\n    rotation\n  ) {\n    if (isNaN(x) || isNaN(y)) {\n      console.error(\"jsPDF.addSvgAsImage: Invalid coordinates\", arguments);\n      throw new Error(\"Invalid coordinates passed to jsPDF.addSvgAsImage\");\n    }\n\n    if (isNaN(w) || isNaN(h)) {\n      console.error(\"jsPDF.addSvgAsImage: Invalid measurements\", arguments);\n      throw new Error(\n        \"Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage\"\n      );\n    }\n\n    var canvas = document.createElement(\"canvas\");\n    canvas.width = w;\n    canvas.height = h;\n    var ctx = canvas.getContext(\"2d\");\n    ctx.fillStyle = \"#fff\"; /// set white fill style\n    ctx.fillRect(0, 0, canvas.width, canvas.height);\n\n    var options = {\n      ignoreMouse: true,\n      ignoreAnimation: true,\n      ignoreDimensions: true\n    };\n    var doc = this;\n    return loadCanvg()\n      .then(\n        function(canvg) {\n          return canvg.fromString(ctx, svg, options);\n        },\n        function() {\n          return Promise.reject(new Error(\"Could not load canvg.\"));\n        }\n      )\n      .then(function(instance) {\n        return instance.render(options);\n      })\n      .then(function() {\n        doc.addImage(\n          canvas.toDataURL(\"image/jpeg\", 1.0),\n          x,\n          y,\n          w,\n          h,\n          compression,\n          rotation\n        );\n      });\n  };\n})(jsPDF.API);\n","/**\n * @license\n * ====================================================================\n * Copyright (c) 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * ====================================================================\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * jsPDF total_pages plugin\n * @name total_pages\n * @module\n */\n(function(jsPDFAPI) {\n  \"use strict\";\n  /**\n   * @name putTotalPages\n   * @function\n   * @param {string} pageExpression Regular Expression\n   * @returns {jsPDF} jsPDF-instance\n   */\n\n  jsPDFAPI.putTotalPages = function(pageExpression) {\n    \"use strict\";\n\n    var replaceExpression;\n    var totalNumberOfPages = 0;\n    if (parseInt(this.internal.getFont().id.substr(1), 10) < 15) {\n      replaceExpression = new RegExp(pageExpression, \"g\");\n      totalNumberOfPages = this.internal.getNumberOfPages();\n    } else {\n      replaceExpression = new RegExp(\n        this.pdfEscape16(pageExpression, this.internal.getFont()),\n        \"g\"\n      );\n      totalNumberOfPages = this.pdfEscape16(\n        this.internal.getNumberOfPages() + \"\",\n        this.internal.getFont()\n      );\n    }\n\n    for (var n = 1; n <= this.internal.getNumberOfPages(); n++) {\n      for (var i = 0; i < this.internal.pages[n].length; i++) {\n        this.internal.pages[n][i] = this.internal.pages[n][i].replace(\n          replaceExpression,\n          totalNumberOfPages\n        );\n      }\n    }\n\n    return this;\n  };\n})(jsPDF.API);\n","/**\n * @license\n * jsPDF viewerPreferences Plugin\n * @author Aras Abbasi (github.com/arasabbasi)\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * Adds the ability to set ViewerPreferences and by thus\n * controlling the way the document is to be presented on the\n * screen or in print.\n * @name viewerpreferences\n * @module\n */\n(function(jsPDFAPI) {\n  \"use strict\";\n  /**\n   * Set the ViewerPreferences of the generated PDF\n   *\n   * @name viewerPreferences\n   * @function\n   * @public\n   * @param {Object} options Array with the ViewerPreferences<br />\n   * Example: doc.viewerPreferences({\"FitWindow\":true});<br />\n   * <br />\n   * You can set following preferences:<br />\n   * <br/>\n   * <b>HideToolbar</b> <i>(boolean)</i><br />\n   * Default value: false<br />\n   * <br />\n   * <b>HideMenubar</b> <i>(boolean)</i><br />\n   * Default value: false.<br />\n   * <br />\n   * <b>HideWindowUI</b> <i>(boolean)</i><br />\n   * Default value: false.<br />\n   * <br />\n   * <b>FitWindow</b> <i>(boolean)</i><br />\n   * Default value: false.<br />\n   * <br />\n   * <b>CenterWindow</b> <i>(boolean)</i><br />\n   * Default value: false<br />\n   * <br />\n   * <b>DisplayDocTitle</b> <i>(boolean)</i><br />\n   * Default value: false.<br />\n   * <br />\n   * <b>NonFullScreenPageMode</b> <i>(string)</i><br />\n   * Possible values: UseNone, UseOutlines, UseThumbs, UseOC<br />\n   * Default value: UseNone<br/>\n   * <br />\n   * <b>Direction</b> <i>(string)</i><br />\n   * Possible values: L2R, R2L<br />\n   * Default value: L2R.<br />\n   * <br />\n   * <b>ViewArea</b> <i>(string)</i><br />\n   * Possible values: MediaBox, CropBox, TrimBox, BleedBox, ArtBox<br />\n   * Default value: CropBox.<br />\n   * <br />\n   * <b>ViewClip</b> <i>(string)</i><br />\n   * Possible values: MediaBox, CropBox, TrimBox, BleedBox, ArtBox<br />\n   * Default value: CropBox<br />\n   * <br />\n   * <b>PrintArea</b> <i>(string)</i><br />\n   * Possible values: MediaBox, CropBox, TrimBox, BleedBox, ArtBox<br />\n   * Default value: CropBox<br />\n   * <br />\n   * <b>PrintClip</b> <i>(string)</i><br />\n   * Possible values: MediaBox, CropBox, TrimBox, BleedBox, ArtBox<br />\n   * Default value: CropBox.<br />\n   * <br />\n   * <b>PrintScaling</b> <i>(string)</i><br />\n   * Possible values: AppDefault, None<br />\n   * Default value: AppDefault.<br />\n   * <br />\n   * <b>Duplex</b> <i>(string)</i><br />\n   * Possible values: Simplex, DuplexFlipLongEdge, DuplexFlipShortEdge\n   * Default value: none<br />\n   * <br />\n   * <b>PickTrayByPDFSize</b> <i>(boolean)</i><br />\n   * Default value: false<br />\n   * <br />\n   * <b>PrintPageRange</b> <i>(Array)</i><br />\n   * Example: [[1,5], [7,9]]<br />\n   * Default value: as defined by PDF viewer application<br />\n   * <br />\n   * <b>NumCopies</b> <i>(Number)</i><br />\n   * Possible values: 1, 2, 3, 4, 5<br />\n   * Default value: 1<br />\n   * <br />\n   * For more information see the PDF Reference, sixth edition on Page 577\n   * @param {boolean} doReset True to reset the settings\n   * @function\n   * @returns jsPDF jsPDF-instance\n   * @example\n   * var doc = new jsPDF()\n   * doc.text('This is a test', 10, 10)\n   * doc.viewerPreferences({'FitWindow': true}, true)\n   * doc.save(\"viewerPreferences.pdf\")\n   *\n   * // Example printing 10 copies, using cropbox, and hiding UI.\n   * doc.viewerPreferences({\n   *   'HideWindowUI': true,\n   *   'PrintArea': 'CropBox',\n   *   'NumCopies': 10\n   * })\n   */\n  jsPDFAPI.viewerPreferences = function(options, doReset) {\n    options = options || {};\n    doReset = doReset || false;\n\n    var configuration;\n    var configurationTemplate = {\n      HideToolbar: {\n        defaultValue: false,\n        value: false,\n        type: \"boolean\",\n        explicitSet: false,\n        valueSet: [true, false],\n        pdfVersion: 1.3\n      },\n      HideMenubar: {\n        defaultValue: false,\n        value: false,\n        type: \"boolean\",\n        explicitSet: false,\n        valueSet: [true, false],\n        pdfVersion: 1.3\n      },\n      HideWindowUI: {\n        defaultValue: false,\n        value: false,\n        type: \"boolean\",\n        explicitSet: false,\n        valueSet: [true, false],\n        pdfVersion: 1.3\n      },\n      FitWindow: {\n        defaultValue: false,\n        value: false,\n        type: \"boolean\",\n        explicitSet: false,\n        valueSet: [true, false],\n        pdfVersion: 1.3\n      },\n      CenterWindow: {\n        defaultValue: false,\n        value: false,\n        type: \"boolean\",\n        explicitSet: false,\n        valueSet: [true, false],\n        pdfVersion: 1.3\n      },\n      DisplayDocTitle: {\n        defaultValue: false,\n        value: false,\n        type: \"boolean\",\n        explicitSet: false,\n        valueSet: [true, false],\n        pdfVersion: 1.4\n      },\n      NonFullScreenPageMode: {\n        defaultValue: \"UseNone\",\n        value: \"UseNone\",\n        type: \"name\",\n        explicitSet: false,\n        valueSet: [\"UseNone\", \"UseOutlines\", \"UseThumbs\", \"UseOC\"],\n        pdfVersion: 1.3\n      },\n      Direction: {\n        defaultValue: \"L2R\",\n        value: \"L2R\",\n        type: \"name\",\n        explicitSet: false,\n        valueSet: [\"L2R\", \"R2L\"],\n        pdfVersion: 1.3\n      },\n      ViewArea: {\n        defaultValue: \"CropBox\",\n        value: \"CropBox\",\n        type: \"name\",\n        explicitSet: false,\n        valueSet: [\"MediaBox\", \"CropBox\", \"TrimBox\", \"BleedBox\", \"ArtBox\"],\n        pdfVersion: 1.4\n      },\n      ViewClip: {\n        defaultValue: \"CropBox\",\n        value: \"CropBox\",\n        type: \"name\",\n        explicitSet: false,\n        valueSet: [\"MediaBox\", \"CropBox\", \"TrimBox\", \"BleedBox\", \"ArtBox\"],\n        pdfVersion: 1.4\n      },\n      PrintArea: {\n        defaultValue: \"CropBox\",\n        value: \"CropBox\",\n        type: \"name\",\n        explicitSet: false,\n        valueSet: [\"MediaBox\", \"CropBox\", \"TrimBox\", \"BleedBox\", \"ArtBox\"],\n        pdfVersion: 1.4\n      },\n      PrintClip: {\n        defaultValue: \"CropBox\",\n        value: \"CropBox\",\n        type: \"name\",\n        explicitSet: false,\n        valueSet: [\"MediaBox\", \"CropBox\", \"TrimBox\", \"BleedBox\", \"ArtBox\"],\n        pdfVersion: 1.4\n      },\n      PrintScaling: {\n        defaultValue: \"AppDefault\",\n        value: \"AppDefault\",\n        type: \"name\",\n        explicitSet: false,\n        valueSet: [\"AppDefault\", \"None\"],\n        pdfVersion: 1.6\n      },\n      Duplex: {\n        defaultValue: \"\",\n        value: \"none\",\n        type: \"name\",\n        explicitSet: false,\n        valueSet: [\n          \"Simplex\",\n          \"DuplexFlipShortEdge\",\n          \"DuplexFlipLongEdge\",\n          \"none\"\n        ],\n        pdfVersion: 1.7\n      },\n      PickTrayByPDFSize: {\n        defaultValue: false,\n        value: false,\n        type: \"boolean\",\n        explicitSet: false,\n        valueSet: [true, false],\n        pdfVersion: 1.7\n      },\n      PrintPageRange: {\n        defaultValue: \"\",\n        value: \"\",\n        type: \"array\",\n        explicitSet: false,\n        valueSet: null,\n        pdfVersion: 1.7\n      },\n      NumCopies: {\n        defaultValue: 1,\n        value: 1,\n        type: \"integer\",\n        explicitSet: false,\n        valueSet: null,\n        pdfVersion: 1.7\n      }\n    };\n\n    var configurationKeys = Object.keys(configurationTemplate);\n\n    var rangeArray = [];\n    var i = 0;\n    var j = 0;\n    var k = 0;\n    var isValid;\n\n    var method;\n    var value;\n\n    function arrayContainsElement(array, element) {\n      var iterator;\n      var result = false;\n\n      for (iterator = 0; iterator < array.length; iterator += 1) {\n        if (array[iterator] === element) {\n          result = true;\n        }\n      }\n      return result;\n    }\n\n    if (this.internal.viewerpreferences === undefined) {\n      this.internal.viewerpreferences = {};\n      this.internal.viewerpreferences.configuration = JSON.parse(\n        JSON.stringify(configurationTemplate)\n      );\n      this.internal.viewerpreferences.isSubscribed = false;\n    }\n    configuration = this.internal.viewerpreferences.configuration;\n\n    if (options === \"reset\" || doReset === true) {\n      var len = configurationKeys.length;\n\n      for (k = 0; k < len; k += 1) {\n        configuration[configurationKeys[k]].value =\n          configuration[configurationKeys[k]].defaultValue;\n        configuration[configurationKeys[k]].explicitSet = false;\n      }\n    }\n\n    if (typeof options === \"object\") {\n      for (method in options) {\n        value = options[method];\n        if (\n          arrayContainsElement(configurationKeys, method) &&\n          value !== undefined\n        ) {\n          if (\n            configuration[method].type === \"boolean\" &&\n            typeof value === \"boolean\"\n          ) {\n            configuration[method].value = value;\n          } else if (\n            configuration[method].type === \"name\" &&\n            arrayContainsElement(configuration[method].valueSet, value)\n          ) {\n            configuration[method].value = value;\n          } else if (\n            configuration[method].type === \"integer\" &&\n            Number.isInteger(value)\n          ) {\n            configuration[method].value = value;\n          } else if (configuration[method].type === \"array\") {\n            for (i = 0; i < value.length; i += 1) {\n              isValid = true;\n              if (value[i].length === 1 && typeof value[i][0] === \"number\") {\n                rangeArray.push(String(value[i] - 1));\n              } else if (value[i].length > 1) {\n                for (j = 0; j < value[i].length; j += 1) {\n                  if (typeof value[i][j] !== \"number\") {\n                    isValid = false;\n                  }\n                }\n                if (isValid === true) {\n                  rangeArray.push([value[i][0] - 1, value[i][1] - 1].join(\" \"));\n                }\n              }\n            }\n            configuration[method].value = \"[\" + rangeArray.join(\" \") + \"]\";\n          } else {\n            configuration[method].value = configuration[method].defaultValue;\n          }\n\n          configuration[method].explicitSet = true;\n        }\n      }\n    }\n\n    if (this.internal.viewerpreferences.isSubscribed === false) {\n      this.internal.events.subscribe(\"putCatalog\", function() {\n        var pdfDict = [];\n        var vPref;\n        for (vPref in configuration) {\n          if (configuration[vPref].explicitSet === true) {\n            if (configuration[vPref].type === \"name\") {\n              pdfDict.push(\"/\" + vPref + \" /\" + configuration[vPref].value);\n            } else {\n              pdfDict.push(\"/\" + vPref + \" \" + configuration[vPref].value);\n            }\n          }\n        }\n        if (pdfDict.length !== 0) {\n          this.internal.write(\n            \"/ViewerPreferences\\n<<\\n\" + pdfDict.join(\"\\n\") + \"\\n>>\"\n          );\n        }\n      });\n      this.internal.viewerpreferences.isSubscribed = true;\n    }\n\n    this.internal.viewerpreferences.configuration = configuration;\n    return this;\n  };\n})(jsPDF.API);\n","/** ====================================================================\n * @license\n * jsPDF XMP metadata plugin\n * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * ====================================================================\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * @name xmp_metadata\n * @module\n */\n(function(jsPDFAPI) {\n  \"use strict\";\n\n  var postPutResources = function() {\n    var xmpmeta_beginning = '<x:xmpmeta xmlns:x=\"adobe:ns:meta/\">';\n    var rdf_beginning =\n      '<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"><rdf:Description rdf:about=\"\" xmlns:jspdf=\"' +\n      this.internal.__metadata__.namespaceuri +\n      '\"><jspdf:metadata>';\n    var rdf_ending = \"</jspdf:metadata></rdf:Description></rdf:RDF>\";\n    var xmpmeta_ending = \"</x:xmpmeta>\";\n    var utf8_xmpmeta_beginning = unescape(\n      encodeURIComponent(xmpmeta_beginning)\n    );\n    var utf8_rdf_beginning = unescape(encodeURIComponent(rdf_beginning));\n    var utf8_metadata = unescape(\n      encodeURIComponent(this.internal.__metadata__.metadata)\n    );\n    var utf8_rdf_ending = unescape(encodeURIComponent(rdf_ending));\n    var utf8_xmpmeta_ending = unescape(encodeURIComponent(xmpmeta_ending));\n\n    var total_len =\n      utf8_rdf_beginning.length +\n      utf8_metadata.length +\n      utf8_rdf_ending.length +\n      utf8_xmpmeta_beginning.length +\n      utf8_xmpmeta_ending.length;\n\n    this.internal.__metadata__.metadata_object_number = this.internal.newObject();\n    this.internal.write(\n      \"<< /Type /Metadata /Subtype /XML /Length \" + total_len + \" >>\"\n    );\n    this.internal.write(\"stream\");\n    this.internal.write(\n      utf8_xmpmeta_beginning +\n        utf8_rdf_beginning +\n        utf8_metadata +\n        utf8_rdf_ending +\n        utf8_xmpmeta_ending\n    );\n    this.internal.write(\"endstream\");\n    this.internal.write(\"endobj\");\n  };\n\n  var putCatalog = function() {\n    if (this.internal.__metadata__.metadata_object_number) {\n      this.internal.write(\n        \"/Metadata \" +\n          this.internal.__metadata__.metadata_object_number +\n          \" 0 R\"\n      );\n    }\n  };\n\n  /**\n   * Adds XMP formatted metadata to PDF\n   *\n   * @name addMetadata\n   * @function\n   * @param {String} metadata The actual metadata to be added. The metadata shall be stored as XMP simple value. Note that if the metadata string contains XML markup characters \"<\", \">\" or \"&\", those characters should be written using XML entities.\n   * @param {String} namespaceuri Sets the namespace URI for the metadata. Last character should be slash or hash.\n   * @returns {jsPDF} jsPDF-instance\n   */\n  jsPDFAPI.addMetadata = function(metadata, namespaceuri) {\n    if (typeof this.internal.__metadata__ === \"undefined\") {\n      this.internal.__metadata__ = {\n        metadata: metadata,\n        namespaceuri: namespaceuri || \"http://jspdf.default.namespaceuri/\"\n      };\n      this.internal.events.subscribe(\"putCatalog\", putCatalog);\n\n      this.internal.events.subscribe(\"postPutResources\", postPutResources);\n    }\n    return this;\n  };\n})(jsPDF.API);\n","import { jsPDF } from \"../jspdf.js\";\nimport { toPDFName } from \"../libs/pdfname.js\";\n\n/**\n * @name utf8\n * @module\n */\n(function(jsPDF) {\n  \"use strict\";\n  var jsPDFAPI = jsPDF.API;\n\n  /***************************************************************************************************/\n  /* function : pdfEscape16                                                                          */\n  /* comment : The character id of a 2-byte string is converted to a hexadecimal number by obtaining */\n  /*   the corresponding glyph id and width, and then adding padding to the string.                  */\n  /***************************************************************************************************/\n  var pdfEscape16 = (jsPDFAPI.pdfEscape16 = function(text, font) {\n    var widths = font.metadata.Unicode.widths;\n    var padz = [\"\", \"0\", \"00\", \"000\", \"0000\"];\n    var ar = [\"\"];\n    for (var i = 0, l = text.length, t; i < l; ++i) {\n      t = font.metadata.characterToGlyph(text.charCodeAt(i));\n      font.metadata.glyIdsUsed.push(t);\n      font.metadata.toUnicode[t] = text.charCodeAt(i);\n      if (widths.indexOf(t) == -1) {\n        widths.push(t);\n        widths.push([parseInt(font.metadata.widthOfGlyph(t), 10)]);\n      }\n      if (t == \"0\") {\n        //Spaces are not allowed in cmap.\n        return ar.join(\"\");\n      } else {\n        t = t.toString(16);\n        ar.push(padz[4 - t.length], t);\n      }\n    }\n    return ar.join(\"\");\n  });\n\n  var toUnicodeCmap = function(map) {\n    var code, codes, range, unicode, unicodeMap, _i, _len;\n    unicodeMap =\n      \"/CIDInit /ProcSet findresource begin\\n12 dict begin\\nbegincmap\\n/CIDSystemInfo <<\\n  /Registry (Adobe)\\n  /Ordering (UCS)\\n  /Supplement 0\\n>> def\\n/CMapName /Adobe-Identity-UCS def\\n/CMapType 2 def\\n1 begincodespacerange\\n<0000><ffff>\\nendcodespacerange\";\n    codes = Object.keys(map).sort(function(a, b) {\n      return a - b;\n    });\n\n    range = [];\n    for (_i = 0, _len = codes.length; _i < _len; _i++) {\n      code = codes[_i];\n      if (range.length >= 100) {\n        unicodeMap +=\n          \"\\n\" +\n          range.length +\n          \" beginbfchar\\n\" +\n          range.join(\"\\n\") +\n          \"\\nendbfchar\";\n        range = [];\n      }\n\n      if (\n        map[code] !== undefined &&\n        map[code] !== null &&\n        typeof map[code].toString === \"function\"\n      ) {\n        unicode = (\"0000\" + map[code].toString(16)).slice(-4);\n        code = (\"0000\" + (+code).toString(16)).slice(-4);\n        range.push(\"<\" + code + \"><\" + unicode + \">\");\n      }\n    }\n\n    if (range.length) {\n      unicodeMap +=\n        \"\\n\" +\n        range.length +\n        \" beginbfchar\\n\" +\n        range.join(\"\\n\") +\n        \"\\nendbfchar\\n\";\n    }\n    unicodeMap +=\n      \"endcmap\\nCMapName currentdict /CMap defineresource pop\\nend\\nend\";\n    return unicodeMap;\n  };\n\n  var identityHFunction = function(options) {\n    var font = options.font;\n    var out = options.out;\n    var newObject = options.newObject;\n    var putStream = options.putStream;\n\n    if (\n      font.metadata instanceof jsPDF.API.TTFFont &&\n      font.encoding === \"Identity-H\"\n    ) {\n      //Tag with Identity-H\n      var widths = font.metadata.Unicode.widths;\n      var data = font.metadata.subset.encode(font.metadata.glyIdsUsed, 1);\n      var pdfOutput = data;\n      var pdfOutput2 = \"\";\n      for (var i = 0; i < pdfOutput.length; i++) {\n        pdfOutput2 += String.fromCharCode(pdfOutput[i]);\n      }\n      var fontTable = newObject();\n      putStream({ data: pdfOutput2, addLength1: true, objectId: fontTable });\n      out(\"endobj\");\n\n      var cmap = newObject();\n      var cmapData = toUnicodeCmap(font.metadata.toUnicode);\n      putStream({ data: cmapData, addLength1: true, objectId: cmap });\n      out(\"endobj\");\n\n      var fontDescriptor = newObject();\n      out(\"<<\");\n      out(\"/Type /FontDescriptor\");\n      out(\"/FontName /\" + toPDFName(font.fontName));\n      out(\"/FontFile2 \" + fontTable + \" 0 R\");\n      out(\"/FontBBox \" + jsPDF.API.PDFObject.convert(font.metadata.bbox));\n      out(\"/Flags \" + font.metadata.flags);\n      out(\"/StemV \" + font.metadata.stemV);\n      out(\"/ItalicAngle \" + font.metadata.italicAngle);\n      out(\"/Ascent \" + font.metadata.ascender);\n      out(\"/Descent \" + font.metadata.decender);\n      out(\"/CapHeight \" + font.metadata.capHeight);\n      out(\">>\");\n      out(\"endobj\");\n\n      var DescendantFont = newObject();\n      out(\"<<\");\n      out(\"/Type /Font\");\n      out(\"/BaseFont /\" + toPDFName(font.fontName));\n      out(\"/FontDescriptor \" + fontDescriptor + \" 0 R\");\n      out(\"/W \" + jsPDF.API.PDFObject.convert(widths));\n      out(\"/CIDToGIDMap /Identity\");\n      out(\"/DW 1000\");\n      out(\"/Subtype /CIDFontType2\");\n      out(\"/CIDSystemInfo\");\n      out(\"<<\");\n      out(\"/Supplement 0\");\n      out(\"/Registry (Adobe)\");\n      out(\"/Ordering (\" + font.encoding + \")\");\n      out(\">>\");\n      out(\">>\");\n      out(\"endobj\");\n\n      font.objectNumber = newObject();\n      out(\"<<\");\n      out(\"/Type /Font\");\n      out(\"/Subtype /Type0\");\n      out(\"/ToUnicode \" + cmap + \" 0 R\");\n      out(\"/BaseFont /\" + toPDFName(font.fontName));\n      out(\"/Encoding /\" + font.encoding);\n      out(\"/DescendantFonts [\" + DescendantFont + \" 0 R]\");\n      out(\">>\");\n      out(\"endobj\");\n\n      font.isAlreadyPutted = true;\n    }\n  };\n\n  jsPDFAPI.events.push([\n    \"putFont\",\n    function(args) {\n      identityHFunction(args);\n    }\n  ]);\n\n  var winAnsiEncodingFunction = function(options) {\n    var font = options.font;\n    var out = options.out;\n    var newObject = options.newObject;\n    var putStream = options.putStream;\n\n    if (\n      font.metadata instanceof jsPDF.API.TTFFont &&\n      font.encoding === \"WinAnsiEncoding\"\n    ) {\n      //Tag with WinAnsi encoding\n      var data = font.metadata.rawData;\n      var pdfOutput = data;\n      var pdfOutput2 = \"\";\n      for (var i = 0; i < pdfOutput.length; i++) {\n        pdfOutput2 += String.fromCharCode(pdfOutput[i]);\n      }\n      var fontTable = newObject();\n      putStream({ data: pdfOutput2, addLength1: true, objectId: fontTable });\n      out(\"endobj\");\n\n      var cmap = newObject();\n      var cmapData = toUnicodeCmap(font.metadata.toUnicode);\n      putStream({ data: cmapData, addLength1: true, objectId: cmap });\n      out(\"endobj\");\n\n      var fontDescriptor = newObject();\n      out(\"<<\");\n      out(\"/Descent \" + font.metadata.decender);\n      out(\"/CapHeight \" + font.metadata.capHeight);\n      out(\"/StemV \" + font.metadata.stemV);\n      out(\"/Type /FontDescriptor\");\n      out(\"/FontFile2 \" + fontTable + \" 0 R\");\n      out(\"/Flags 96\");\n      out(\"/FontBBox \" + jsPDF.API.PDFObject.convert(font.metadata.bbox));\n      out(\"/FontName /\" + toPDFName(font.fontName));\n      out(\"/ItalicAngle \" + font.metadata.italicAngle);\n      out(\"/Ascent \" + font.metadata.ascender);\n      out(\">>\");\n      out(\"endobj\");\n      font.objectNumber = newObject();\n      for (var j = 0; j < font.metadata.hmtx.widths.length; j++) {\n        font.metadata.hmtx.widths[j] = parseInt(\n          font.metadata.hmtx.widths[j] * (1000 / font.metadata.head.unitsPerEm)\n        ); //Change the width of Em units to Point units.\n      }\n      out(\n        \"<</Subtype/TrueType/Type/Font/ToUnicode \" +\n          cmap +\n          \" 0 R/BaseFont/\" +\n          toPDFName(font.fontName) +\n          \"/FontDescriptor \" +\n          fontDescriptor +\n          \" 0 R\" +\n          \"/Encoding/\" +\n          font.encoding +\n          \" /FirstChar 29 /LastChar 255 /Widths \" +\n          jsPDF.API.PDFObject.convert(font.metadata.hmtx.widths) +\n          \">>\"\n      );\n      out(\"endobj\");\n      font.isAlreadyPutted = true;\n    }\n  };\n\n  jsPDFAPI.events.push([\n    \"putFont\",\n    function(args) {\n      winAnsiEncodingFunction(args);\n    }\n  ]);\n\n  var utf8TextFunction = function(args) {\n    var text = args.text || \"\";\n    var x = args.x;\n    var y = args.y;\n    var options = args.options || {};\n    var mutex = args.mutex || {};\n\n    var pdfEscape = mutex.pdfEscape;\n    var activeFontKey = mutex.activeFontKey;\n    var fonts = mutex.fonts;\n    var key = activeFontKey;\n\n    var str = \"\",\n      s = 0,\n      cmapConfirm;\n    var strText = \"\";\n    var encoding = fonts[key].encoding;\n\n    if (fonts[key].encoding !== \"Identity-H\") {\n      return {\n        text: text,\n        x: x,\n        y: y,\n        options: options,\n        mutex: mutex\n      };\n    }\n    strText = text;\n\n    key = activeFontKey;\n    if (Array.isArray(text)) {\n      strText = text[0];\n    }\n    for (s = 0; s < strText.length; s += 1) {\n      if (fonts[key].metadata.hasOwnProperty(\"cmap\")) {\n        cmapConfirm =\n          fonts[key].metadata.cmap.unicode.codeMap[strText[s].charCodeAt(0)];\n        /*\n             if (Object.prototype.toString.call(text) === '[object Array]') {\n                var i = 0;\n               // for (i = 0; i < text.length; i += 1) {\n                    if (Object.prototype.toString.call(text[s]) === '[object Array]') {\n                        cmapConfirm = fonts[key].metadata.cmap.unicode.codeMap[strText[s][0].charCodeAt(0)]; //Make sure the cmap has the corresponding glyph id\n                    } else {\n\n                    }\n                //}\n\n            } else {\n                cmapConfirm = fonts[key].metadata.cmap.unicode.codeMap[strText[s].charCodeAt(0)]; //Make sure the cmap has the corresponding glyph id\n            }*/\n      }\n      if (!cmapConfirm) {\n        if (\n          strText[s].charCodeAt(0) < 256 &&\n          fonts[key].metadata.hasOwnProperty(\"Unicode\")\n        ) {\n          str += strText[s];\n        } else {\n          str += \"\";\n        }\n      } else {\n        str += strText[s];\n      }\n    }\n    var result = \"\";\n    if (parseInt(key.slice(1)) < 14 || encoding === \"WinAnsiEncoding\") {\n      //For the default 13 font\n      result = pdfEscape(str, key)\n        .split(\"\")\n        .map(function(cv) {\n          return cv.charCodeAt(0).toString(16);\n        })\n        .join(\"\");\n    } else if (encoding === \"Identity-H\") {\n      result = pdfEscape16(str, fonts[key]);\n    }\n    mutex.isHex = true;\n\n    return {\n      text: result,\n      x: x,\n      y: y,\n      options: options,\n      mutex: mutex\n    };\n  };\n\n  var utf8EscapeFunction = function(parms) {\n    var text = parms.text || \"\",\n      x = parms.x,\n      y = parms.y,\n      options = parms.options,\n      mutex = parms.mutex;\n    var tmpText = [];\n    var args = {\n      text: text,\n      x: x,\n      y: y,\n      options: options,\n      mutex: mutex\n    };\n\n    if (Array.isArray(text)) {\n      var i = 0;\n      for (i = 0; i < text.length; i += 1) {\n        if (Array.isArray(text[i])) {\n          if (text[i].length === 3) {\n            tmpText.push([\n              utf8TextFunction(Object.assign({}, args, { text: text[i][0] }))\n                .text,\n              text[i][1],\n              text[i][2]\n            ]);\n          } else {\n            tmpText.push(\n              utf8TextFunction(Object.assign({}, args, { text: text[i] })).text\n            );\n          }\n        } else {\n          tmpText.push(\n            utf8TextFunction(Object.assign({}, args, { text: text[i] })).text\n          );\n        }\n      }\n      parms.text = tmpText;\n    } else {\n      parms.text = utf8TextFunction(\n        Object.assign({}, args, { text: text })\n      ).text;\n    }\n  };\n\n  jsPDFAPI.events.push([\"postProcessText\", utf8EscapeFunction]);\n})(jsPDF);\n","/**\n * @license\n * jsPDF virtual FileSystem functionality\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n/**\n * Use the vFS to handle files\n *\n * @name vFS\n * @module\n */\n(function(jsPDFAPI) {\n  \"use strict\";\n\n  var _initializeVFS = function() {\n    if (typeof this.internal.vFS === \"undefined\") {\n      this.internal.vFS = {};\n    }\n    return true;\n  };\n\n  /**\n   * Check if the file exists in the vFS\n   *\n   * @name existsFileInVFS\n   * @function\n   * @param {string} Possible filename in the vFS.\n   * @returns {boolean}\n   * @example\n   * doc.existsFileInVFS(\"someFile.txt\");\n   */\n  jsPDFAPI.existsFileInVFS = function(filename) {\n    _initializeVFS.call(this);\n    return typeof this.internal.vFS[filename] !== \"undefined\";\n  };\n\n  /**\n   * Add a file to the vFS\n   *\n   * @name addFileToVFS\n   * @function\n   * @param {string} filename The name of the file which should be added.\n   * @param {string} filecontent The content of the file.\n   * @returns {jsPDF}\n   * @example\n   * doc.addFileToVFS(\"someFile.txt\", \"BADFACE1\");\n   */\n  jsPDFAPI.addFileToVFS = function(filename, filecontent) {\n    _initializeVFS.call(this);\n    this.internal.vFS[filename] = filecontent;\n    return this;\n  };\n\n  /**\n   * Get the file from the vFS\n   *\n   * @name getFileFromVFS\n   * @function\n   * @param {string} The name of the file which gets requested.\n   * @returns {string}\n   * @example\n   * doc.getFileFromVFS(\"someFile.txt\");\n   */\n  jsPDFAPI.getFileFromVFS = function(filename) {\n    _initializeVFS.call(this);\n\n    if (typeof this.internal.vFS[filename] !== \"undefined\") {\n      return this.internal.vFS[filename];\n    }\n    return null;\n  };\n})(jsPDF.API);\n","/**\n * @license\n * Unicode Bidi Engine based on the work of Alex Shensis (@asthensis)\n * MIT License\n */\n\nimport { jsPDF } from \"../jspdf.js\";\n\n(function(jsPDF) {\n  \"use strict\";\n  /**\n   * Table of Unicode types.\n   *\n   * Generated by:\n   *\n   * var bidi = require(\"./bidi/index\");\n   * var bidi_accumulate = bidi.slice(0, 256).concat(bidi.slice(0x0500, 0x0500 + 256 * 3)).\n   * concat(bidi.slice(0x2000, 0x2000 + 256)).concat(bidi.slice(0xFB00, 0xFB00 + 256)).\n   * concat(bidi.slice(0xFE00, 0xFE00 + 2 * 256));\n   *\n   * for( var i = 0; i < bidi_accumulate.length; i++) {\n   * \tif(bidi_accumulate[i] === undefined || bidi_accumulate[i] === 'ON')\n   * \t\tbidi_accumulate[i] = 'N'; //mark as neutral to conserve space and substitute undefined\n   * }\n   * var bidiAccumulateStr = 'return [ \"' + bidi_accumulate.toString().replace(/,/g, '\", \"') + '\" ];';\n   * require(\"fs\").writeFile('unicode-types.js', bidiAccumulateStr);\n   *\n   * Based on:\n   * https://github.com/mathiasbynens/unicode-8.0.0\n   */\n  var bidiUnicodeTypes = [\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"S\",\n    \"B\",\n    \"S\",\n    \"WS\",\n    \"B\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"B\",\n    \"B\",\n    \"B\",\n    \"S\",\n    \"WS\",\n    \"N\",\n    \"N\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"ES\",\n    \"CS\",\n    \"ES\",\n    \"CS\",\n    \"CS\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"CS\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"B\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"CS\",\n    \"N\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"L\",\n    \"N\",\n    \"N\",\n    \"BN\",\n    \"N\",\n    \"N\",\n    \"ET\",\n    \"ET\",\n    \"EN\",\n    \"EN\",\n    \"N\",\n    \"L\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"EN\",\n    \"L\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"N\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"N\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"N\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"N\",\n    \"N\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"N\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"N\",\n    \"L\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"ET\",\n    \"N\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"R\",\n    \"NSM\",\n    \"R\",\n    \"NSM\",\n    \"NSM\",\n    \"R\",\n    \"NSM\",\n    \"NSM\",\n    \"R\",\n    \"NSM\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"AN\",\n    \"AN\",\n    \"AN\",\n    \"AN\",\n    \"AN\",\n    \"AN\",\n    \"N\",\n    \"N\",\n    \"AL\",\n    \"ET\",\n    \"ET\",\n    \"AL\",\n    \"CS\",\n    \"AL\",\n    \"N\",\n    \"N\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"AL\",\n    \"AL\",\n    \"N\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"AN\",\n    \"AN\",\n    \"AN\",\n    \"AN\",\n    \"AN\",\n    \"AN\",\n    \"AN\",\n    \"AN\",\n    \"AN\",\n    \"AN\",\n    \"ET\",\n    \"AN\",\n    \"AN\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"NSM\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"AN\",\n    \"N\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"AL\",\n    \"AL\",\n    \"NSM\",\n    \"NSM\",\n    \"N\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"AL\",\n    \"AL\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"N\",\n    \"AL\",\n    \"AL\",\n    \"NSM\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"N\",\n    \"N\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"AL\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"R\",\n    \"R\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"R\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"WS\",\n    \"WS\",\n    \"WS\",\n    \"WS\",\n    \"WS\",\n    \"WS\",\n    \"WS\",\n    \"WS\",\n    \"WS\",\n    \"WS\",\n    \"WS\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"L\",\n    \"R\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"WS\",\n    \"B\",\n    \"LRE\",\n    \"RLE\",\n    \"PDF\",\n    \"LRO\",\n    \"RLO\",\n    \"CS\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"CS\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"WS\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"N\",\n    \"LRI\",\n    \"RLI\",\n    \"FSI\",\n    \"PDI\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"BN\",\n    \"EN\",\n    \"L\",\n    \"N\",\n    \"N\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"ES\",\n    \"ES\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"L\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"ES\",\n    \"ES\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"R\",\n    \"NSM\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"ES\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"N\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"N\",\n    \"R\",\n    \"N\",\n    \"R\",\n    \"R\",\n    \"N\",\n    \"R\",\n    \"R\",\n    \"N\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"R\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"NSM\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"CS\",\n    \"N\",\n    \"CS\",\n    \"N\",\n    \"N\",\n    \"CS\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"ET\",\n    \"N\",\n    \"N\",\n    \"ES\",\n    \"ES\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"ET\",\n    \"ET\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"N\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"AL\",\n    \"N\",\n    \"N\",\n    \"BN\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"ET\",\n    \"ET\",\n    \"ET\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"ES\",\n    \"CS\",\n    \"ES\",\n    \"CS\",\n    \"CS\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"EN\",\n    \"CS\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"N\",\n    \"N\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"N\",\n    \"N\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"N\",\n    \"N\",\n    \"L\",\n    \"L\",\n    \"L\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"ET\",\n    \"ET\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"ET\",\n    \"ET\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\",\n    \"N\"\n  ];\n\n  /**\n   * Unicode Bidi algorithm compliant Bidi engine.\n   * For reference see http://unicode.org/reports/tr9/\n   */\n\n  /**\n   * constructor ( options )\n   *\n   * Initializes Bidi engine\n   *\n   * @param {Object} See 'setOptions' below for detailed description.\n   * options are cashed between invocation of 'doBidiReorder' method\n   *\n   * sample usage pattern of BidiEngine:\n   * var opt = {\n   * \tisInputVisual: true,\n   * \tisInputRtl: false,\n   * \tisOutputVisual: false,\n   * \tisOutputRtl: false,\n   * \tisSymmetricSwapping: true\n   * }\n   * var sourceToTarget = [], levels = [];\n   * var bidiEng = Globalize.bidiEngine(opt);\n   * var src = \"text string to be reordered\";\n   * var ret = bidiEng.doBidiReorder(src, sourceToTarget, levels);\n   */\n\n  jsPDF.__bidiEngine__ = jsPDF.prototype.__bidiEngine__ = function(options) {\n    var _UNICODE_TYPES = _bidiUnicodeTypes;\n\n    var _STATE_TABLE_LTR = [\n      [0, 3, 0, 1, 0, 0, 0],\n      [0, 3, 0, 1, 2, 2, 0],\n      [0, 3, 0, 0x11, 2, 0, 1],\n      [0, 3, 5, 5, 4, 1, 0],\n      [0, 3, 0x15, 0x15, 4, 0, 1],\n      [0, 3, 5, 5, 4, 2, 0]\n    ];\n\n    var _STATE_TABLE_RTL = [\n      [2, 0, 1, 1, 0, 1, 0],\n      [2, 0, 1, 1, 0, 2, 0],\n      [2, 0, 2, 1, 3, 2, 0],\n      [2, 0, 2, 0x21, 3, 1, 1]\n    ];\n\n    var _TYPE_NAMES_MAP = { L: 0, R: 1, EN: 2, AN: 3, N: 4, B: 5, S: 6 };\n\n    var _UNICODE_RANGES_MAP = {\n      0: 0,\n      5: 1,\n      6: 2,\n      7: 3,\n      0x20: 4,\n      0xfb: 5,\n      0xfe: 6,\n      0xff: 7\n    };\n\n    var _SWAP_TABLE = [\n      \"\\u0028\",\n      \"\\u0029\",\n      \"\\u0028\",\n      \"\\u003C\",\n      \"\\u003E\",\n      \"\\u003C\",\n      \"\\u005B\",\n      \"\\u005D\",\n      \"\\u005B\",\n      \"\\u007B\",\n      \"\\u007D\",\n      \"\\u007B\",\n      \"\\u00AB\",\n      \"\\u00BB\",\n      \"\\u00AB\",\n      \"\\u2039\",\n      \"\\u203A\",\n      \"\\u2039\",\n      \"\\u2045\",\n      \"\\u2046\",\n      \"\\u2045\",\n      \"\\u207D\",\n      \"\\u207E\",\n      \"\\u207D\",\n      \"\\u208D\",\n      \"\\u208E\",\n      \"\\u208D\",\n      \"\\u2264\",\n      \"\\u2265\",\n      \"\\u2264\",\n      \"\\u2329\",\n      \"\\u232A\",\n      \"\\u2329\",\n      \"\\uFE59\",\n      \"\\uFE5A\",\n      \"\\uFE59\",\n      \"\\uFE5B\",\n      \"\\uFE5C\",\n      \"\\uFE5B\",\n      \"\\uFE5D\",\n      \"\\uFE5E\",\n      \"\\uFE5D\",\n      \"\\uFE64\",\n      \"\\uFE65\",\n      \"\\uFE64\"\n    ];\n\n    var _LTR_RANGES_REG_EXPR = new RegExp(\n      /^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/\n    );\n\n    var _lastArabic = false,\n      _hasUbatAl,\n      _hasUbatB,\n      _hasUbatS,\n      DIR_LTR = 0,\n      DIR_RTL = 1,\n      _isInVisual,\n      _isInRtl,\n      _isOutVisual,\n      _isOutRtl,\n      _isSymmetricSwapping,\n      _dir = DIR_LTR;\n\n    this.__bidiEngine__ = {};\n\n    var _init = function(text, sourceToTargetMap) {\n      if (sourceToTargetMap) {\n        for (var i = 0; i < text.length; i++) {\n          sourceToTargetMap[i] = i;\n        }\n      }\n      if (_isInRtl === undefined) {\n        _isInRtl = _isContextualDirRtl(text);\n      }\n      if (_isOutRtl === undefined) {\n        _isOutRtl = _isContextualDirRtl(text);\n      }\n    };\n\n    // for reference see 3.2 in http://unicode.org/reports/tr9/\n    //\n    var _getCharType = function(ch) {\n      var charCode = ch.charCodeAt(),\n        range = charCode >> 8,\n        rangeIdx = _UNICODE_RANGES_MAP[range];\n\n      if (rangeIdx !== undefined) {\n        return _UNICODE_TYPES[rangeIdx * 256 + (charCode & 0xff)];\n      } else if (range === 0xfc || range === 0xfd) {\n        return \"AL\";\n      } else if (_LTR_RANGES_REG_EXPR.test(range)) {\n        //unlikely case\n        return \"L\";\n      } else if (range === 8) {\n        // even less likely\n        return \"R\";\n      }\n      return \"N\"; //undefined type, mark as neutral\n    };\n\n    var _isContextualDirRtl = function(text) {\n      for (var i = 0, charType; i < text.length; i++) {\n        charType = _getCharType(text.charAt(i));\n        if (charType === \"L\") {\n          return false;\n        } else if (charType === \"R\") {\n          return true;\n        }\n      }\n      return false;\n    };\n\n    // for reference see 3.3.4 & 3.3.5 in http://unicode.org/reports/tr9/\n    //\n    var _resolveCharType = function(chars, types, resolvedTypes, index) {\n      var cType = types[index],\n        wType,\n        nType,\n        i,\n        len;\n      switch (cType) {\n        case \"L\":\n        case \"R\":\n          _lastArabic = false;\n          break;\n        case \"N\":\n        case \"AN\":\n          break;\n\n        case \"EN\":\n          if (_lastArabic) {\n            cType = \"AN\";\n          }\n          break;\n\n        case \"AL\":\n          _lastArabic = true;\n          _hasUbatAl = true;\n          cType = \"R\";\n          break;\n\n        case \"WS\":\n          cType = \"N\";\n          break;\n\n        case \"CS\":\n          if (\n            index < 1 ||\n            index + 1 >= types.length ||\n            ((wType = resolvedTypes[index - 1]) !== \"EN\" && wType !== \"AN\") ||\n            ((nType = types[index + 1]) !== \"EN\" && nType !== \"AN\")\n          ) {\n            cType = \"N\";\n          } else if (_lastArabic) {\n            nType = \"AN\";\n          }\n          cType = nType === wType ? nType : \"N\";\n          break;\n\n        case \"ES\":\n          wType = index > 0 ? resolvedTypes[index - 1] : \"B\";\n          cType =\n            wType === \"EN\" &&\n            index + 1 < types.length &&\n            types[index + 1] === \"EN\"\n              ? \"EN\"\n              : \"N\";\n          break;\n\n        case \"ET\":\n          if (index > 0 && resolvedTypes[index - 1] === \"EN\") {\n            cType = \"EN\";\n            break;\n          } else if (_lastArabic) {\n            cType = \"N\";\n            break;\n          }\n          i = index + 1;\n          len = types.length;\n          while (i < len && types[i] === \"ET\") {\n            i++;\n          }\n          if (i < len && types[i] === \"EN\") {\n            cType = \"EN\";\n          } else {\n            cType = \"N\";\n          }\n          break;\n\n        case \"NSM\":\n          if (_isInVisual && !_isInRtl) {\n            //V->L\n            len = types.length;\n            i = index + 1;\n            while (i < len && types[i] === \"NSM\") {\n              i++;\n            }\n            if (i < len) {\n              var c = chars[index];\n              var rtlCandidate = (c >= 0x0591 && c <= 0x08ff) || c === 0xfb1e;\n              wType = types[i];\n              if (rtlCandidate && (wType === \"R\" || wType === \"AL\")) {\n                cType = \"R\";\n                break;\n              }\n            }\n          }\n          if (index < 1 || (wType = types[index - 1]) === \"B\") {\n            cType = \"N\";\n          } else {\n            cType = resolvedTypes[index - 1];\n          }\n          break;\n\n        case \"B\":\n          _lastArabic = false;\n          _hasUbatB = true;\n          cType = _dir;\n          break;\n\n        case \"S\":\n          _hasUbatS = true;\n          cType = \"N\";\n          break;\n\n        case \"LRE\":\n        case \"RLE\":\n        case \"LRO\":\n        case \"RLO\":\n        case \"PDF\":\n          _lastArabic = false;\n          break;\n        case \"BN\":\n          cType = \"N\";\n          break;\n      }\n      return cType;\n    };\n\n    var _handleUbatS = function(types, levels, length) {\n      for (var i = 0; i < length; i++) {\n        if (types[i] === \"S\") {\n          levels[i] = _dir;\n          for (var j = i - 1; j >= 0; j--) {\n            if (types[j] === \"WS\") {\n              levels[j] = _dir;\n            } else {\n              break;\n            }\n          }\n        }\n      }\n    };\n\n    var _invertString = function(text, sourceToTargetMap, levels) {\n      var charArray = text.split(\"\");\n      if (levels) {\n        _computeLevels(charArray, levels, { hiLevel: _dir });\n      }\n      charArray.reverse();\n      sourceToTargetMap && sourceToTargetMap.reverse();\n      return charArray.join(\"\");\n    };\n\n    // For reference see 3.3 in http://unicode.org/reports/tr9/\n    //\n    var _computeLevels = function(chars, levels, params) {\n      var action,\n        condition,\n        i,\n        index,\n        newLevel,\n        prevState,\n        condPos = -1,\n        len = chars.length,\n        newState = 0,\n        resolvedTypes = [],\n        stateTable = _dir ? _STATE_TABLE_RTL : _STATE_TABLE_LTR,\n        types = [];\n\n      _lastArabic = false;\n      _hasUbatAl = false;\n      _hasUbatB = false;\n      _hasUbatS = false;\n      for (i = 0; i < len; i++) {\n        types[i] = _getCharType(chars[i]);\n      }\n      for (index = 0; index < len; index++) {\n        prevState = newState;\n        resolvedTypes[index] = _resolveCharType(\n          chars,\n          types,\n          resolvedTypes,\n          index\n        );\n        newState = stateTable[prevState][_TYPE_NAMES_MAP[resolvedTypes[index]]];\n        action = newState & 0xf0;\n        newState &= 0x0f;\n        levels[index] = newLevel = stateTable[newState][5];\n        if (action > 0) {\n          if (action === 0x10) {\n            for (i = condPos; i < index; i++) {\n              levels[i] = 1;\n            }\n            condPos = -1;\n          } else {\n            condPos = -1;\n          }\n        }\n        condition = stateTable[newState][6];\n        if (condition) {\n          if (condPos === -1) {\n            condPos = index;\n          }\n        } else {\n          if (condPos > -1) {\n            for (i = condPos; i < index; i++) {\n              levels[i] = newLevel;\n            }\n            condPos = -1;\n          }\n        }\n        if (types[index] === \"B\") {\n          levels[index] = 0;\n        }\n        params.hiLevel |= newLevel;\n      }\n      if (_hasUbatS) {\n        _handleUbatS(types, levels, len);\n      }\n    };\n\n    // for reference see 3.4 in http://unicode.org/reports/tr9/\n    //\n    var _invertByLevel = function(\n      level,\n      charArray,\n      sourceToTargetMap,\n      levels,\n      params\n    ) {\n      if (params.hiLevel < level) {\n        return;\n      }\n      if (level === 1 && _dir === DIR_RTL && !_hasUbatB) {\n        charArray.reverse();\n        sourceToTargetMap && sourceToTargetMap.reverse();\n        return;\n      }\n      var ch,\n        high,\n        end,\n        low,\n        len = charArray.length,\n        start = 0;\n\n      while (start < len) {\n        if (levels[start] >= level) {\n          end = start + 1;\n          while (end < len && levels[end] >= level) {\n            end++;\n          }\n          for (low = start, high = end - 1; low < high; low++, high--) {\n            ch = charArray[low];\n            charArray[low] = charArray[high];\n            charArray[high] = ch;\n            if (sourceToTargetMap) {\n              ch = sourceToTargetMap[low];\n              sourceToTargetMap[low] = sourceToTargetMap[high];\n              sourceToTargetMap[high] = ch;\n            }\n          }\n          start = end;\n        }\n        start++;\n      }\n    };\n\n    // for reference see 7 & BD16 in http://unicode.org/reports/tr9/\n    //\n    var _symmetricSwap = function(charArray, levels, params) {\n      if (params.hiLevel !== 0 && _isSymmetricSwapping) {\n        for (var i = 0, index; i < charArray.length; i++) {\n          if (levels[i] === 1) {\n            index = _SWAP_TABLE.indexOf(charArray[i]);\n            if (index >= 0) {\n              charArray[i] = _SWAP_TABLE[index + 1];\n            }\n          }\n        }\n      }\n    };\n\n    var _reorder = function(text, sourceToTargetMap, levels) {\n      var charArray = text.split(\"\"),\n        params = { hiLevel: _dir };\n\n      if (!levels) {\n        levels = [];\n      }\n      _computeLevels(charArray, levels, params);\n      _symmetricSwap(charArray, levels, params);\n      _invertByLevel(DIR_RTL + 1, charArray, sourceToTargetMap, levels, params);\n      _invertByLevel(DIR_RTL, charArray, sourceToTargetMap, levels, params);\n      return charArray.join(\"\");\n    };\n\n    // doBidiReorder( text, sourceToTargetMap, levels )\n    // Performs Bidi reordering by implementing Unicode Bidi algorithm.\n    // Returns reordered string\n    // @text [String]:\n    // - input string to be reordered, this is input parameter\n    // $sourceToTargetMap [Array] (optional)\n    // - resultant mapping between input and output strings, this is output parameter\n    // $levels [Array] (optional)\n    // - array of calculated Bidi levels, , this is output parameter\n    this.__bidiEngine__.doBidiReorder = function(\n      text,\n      sourceToTargetMap,\n      levels\n    ) {\n      _init(text, sourceToTargetMap);\n      if (!_isInVisual && _isOutVisual && !_isOutRtl) {\n        // LLTR->VLTR, LRTL->VLTR\n        _dir = _isInRtl ? DIR_RTL : DIR_LTR;\n        text = _reorder(text, sourceToTargetMap, levels);\n      } else if (_isInVisual && _isOutVisual && _isInRtl ^ _isOutRtl) {\n        // VRTL->VLTR, VLTR->VRTL\n        _dir = _isInRtl ? DIR_RTL : DIR_LTR;\n        text = _invertString(text, sourceToTargetMap, levels);\n      } else if (!_isInVisual && _isOutVisual && _isOutRtl) {\n        // LLTR->VRTL, LRTL->VRTL\n        _dir = _isInRtl ? DIR_RTL : DIR_LTR;\n        text = _reorder(text, sourceToTargetMap, levels);\n        text = _invertString(text, sourceToTargetMap);\n      } else if (_isInVisual && !_isInRtl && !_isOutVisual && !_isOutRtl) {\n        // VLTR->LLTR\n        _dir = DIR_LTR;\n        text = _reorder(text, sourceToTargetMap, levels);\n      } else if (_isInVisual && !_isOutVisual && _isInRtl ^ _isOutRtl) {\n        // VLTR->LRTL, VRTL->LLTR\n        text = _invertString(text, sourceToTargetMap);\n        if (_isInRtl) {\n          //LLTR -> VLTR\n          _dir = DIR_LTR;\n          text = _reorder(text, sourceToTargetMap, levels);\n        } else {\n          //LRTL -> VRTL\n          _dir = DIR_RTL;\n          text = _reorder(text, sourceToTargetMap, levels);\n          text = _invertString(text, sourceToTargetMap);\n        }\n      } else if (_isInVisual && _isInRtl && !_isOutVisual && _isOutRtl) {\n        //  VRTL->LRTL\n        _dir = DIR_RTL;\n        text = _reorder(text, sourceToTargetMap, levels);\n        text = _invertString(text, sourceToTargetMap);\n      } else if (!_isInVisual && !_isOutVisual && _isInRtl ^ _isOutRtl) {\n        // LRTL->LLTR, LLTR->LRTL\n        var isSymmetricSwappingOrig = _isSymmetricSwapping;\n        if (_isInRtl) {\n          //LRTL->LLTR\n          _dir = DIR_RTL;\n          text = _reorder(text, sourceToTargetMap, levels);\n          _dir = DIR_LTR;\n          _isSymmetricSwapping = false;\n          text = _reorder(text, sourceToTargetMap, levels);\n          _isSymmetricSwapping = isSymmetricSwappingOrig;\n        } else {\n          //LLTR->LRTL\n          _dir = DIR_LTR;\n          text = _reorder(text, sourceToTargetMap, levels);\n          text = _invertString(text, sourceToTargetMap);\n          _dir = DIR_RTL;\n          _isSymmetricSwapping = false;\n          text = _reorder(text, sourceToTargetMap, levels);\n          _isSymmetricSwapping = isSymmetricSwappingOrig;\n          text = _invertString(text, sourceToTargetMap);\n        }\n      }\n      return text;\n    };\n\n    /**\n     * @name setOptions( options )\n     * @function\n     * Sets options for Bidi conversion\n     * @param {Object}:\n     * - isInputVisual {boolean} (defaults to false): allowed values: true(Visual mode), false(Logical mode)\n     * - isInputRtl {boolean}: allowed values true(Right-to-left direction), false (Left-to-right directiion), undefined(Contectual direction, i.e.direction defined by first strong character of input string)\n     * - isOutputVisual {boolean} (defaults to false): allowed values: true(Visual mode), false(Logical mode)\n     * - isOutputRtl {boolean}: allowed values true(Right-to-left direction), false (Left-to-right directiion), undefined(Contectual direction, i.e.direction defined by first strong characterof input string)\n     * - isSymmetricSwapping {boolean} (defaults to false): allowed values true(needs symmetric swapping), false (no need in symmetric swapping),\n     */\n    this.__bidiEngine__.setOptions = function(options) {\n      if (options) {\n        _isInVisual = options.isInputVisual;\n        _isOutVisual = options.isOutputVisual;\n        _isInRtl = options.isInputRtl;\n        _isOutRtl = options.isOutputRtl;\n        _isSymmetricSwapping = options.isSymmetricSwapping;\n      }\n    };\n\n    this.__bidiEngine__.setOptions(options);\n    return this.__bidiEngine__;\n  };\n\n  var _bidiUnicodeTypes = bidiUnicodeTypes;\n\n  var bidiEngine = new jsPDF.__bidiEngine__({ isInputVisual: true });\n\n  var bidiEngineFunction = function(args) {\n    var text = args.text;\n    var x = args.x;\n    var y = args.y;\n    var options = args.options || {};\n    var mutex = args.mutex || {};\n    var lang = options.lang;\n    var tmpText = [];\n\n    options.isInputVisual =\n      typeof options.isInputVisual === \"boolean\" ? options.isInputVisual : true;\n    bidiEngine.setOptions(options);\n\n    if (Object.prototype.toString.call(text) === \"[object Array]\") {\n      var i = 0;\n      tmpText = [];\n      for (i = 0; i < text.length; i += 1) {\n        if (Object.prototype.toString.call(text[i]) === \"[object Array]\") {\n          tmpText.push([\n            bidiEngine.doBidiReorder(text[i][0]),\n            text[i][1],\n            text[i][2]\n          ]);\n        } else {\n          tmpText.push([bidiEngine.doBidiReorder(text[i])]);\n        }\n      }\n      args.text = tmpText;\n    } else {\n      args.text = bidiEngine.doBidiReorder(text);\n    }\n    bidiEngine.setOptions({ isInputVisual: true });\n  };\n\n  jsPDF.API.events.push([\"postProcessText\", bidiEngineFunction]);\n})(jsPDF);\n","/* eslint-disable no-control-regex */\n/************************************************\n * Title : custom font                          *\n * Start Data : 2017. 01. 22.                   *\n * Comment : TEXT API                           *\n ************************************************/\n\n/******************************\n * jsPDF extension API Design *\n * ****************************/\n\nimport { jsPDF } from \"../jspdf.js\";\n\njsPDF.API.TTFFont = (function() {\n  /************************************************************************/\n  /* function : open                                                       */\n  /* comment : Decode the encoded ttf content and create a TTFFont object. */\n  /************************************************************************/\n  TTFFont.open = function(file) {\n    return new TTFFont(file);\n  };\n  /***************************************************************/\n  /* function : TTFFont gernerator                               */\n  /* comment : Decode TTF contents are parsed, Data,             */\n  /* Subset object is created, and registerTTF function is called.*/\n  /***************************************************************/\n  function TTFFont(rawData) {\n    var data;\n    this.rawData = rawData;\n    data = this.contents = new Data(rawData);\n    this.contents.pos = 4;\n    if (data.readString(4) === \"ttcf\") {\n      throw new Error(\"TTCF not supported.\");\n    } else {\n      data.pos = 0;\n      this.parse();\n      this.subset = new Subset(this);\n      this.registerTTF();\n    }\n  }\n  /********************************************************/\n  /* function : parse                                     */\n  /* comment : TTF Parses the file contents by each table.*/\n  /********************************************************/\n  TTFFont.prototype.parse = function() {\n    this.directory = new Directory(this.contents);\n    this.head = new HeadTable(this);\n    this.name = new NameTable(this);\n    this.cmap = new CmapTable(this);\n    this.toUnicode = {};\n    this.hhea = new HheaTable(this);\n    this.maxp = new MaxpTable(this);\n    this.hmtx = new HmtxTable(this);\n    this.post = new PostTable(this);\n    this.os2 = new OS2Table(this);\n    this.loca = new LocaTable(this);\n    this.glyf = new GlyfTable(this);\n    this.ascender =\n      (this.os2.exists && this.os2.ascender) || this.hhea.ascender;\n    this.decender =\n      (this.os2.exists && this.os2.decender) || this.hhea.decender;\n    this.lineGap = (this.os2.exists && this.os2.lineGap) || this.hhea.lineGap;\n    return (this.bbox = [\n      this.head.xMin,\n      this.head.yMin,\n      this.head.xMax,\n      this.head.yMax\n    ]);\n  };\n  /***************************************************************/\n  /* function : registerTTF                                      */\n  /* comment : Get the value to assign pdf font descriptors.     */\n  /***************************************************************/\n  TTFFont.prototype.registerTTF = function() {\n    var e, hi, low, raw, _ref;\n    this.scaleFactor = 1000.0 / this.head.unitsPerEm;\n    this.bbox = function() {\n      var _i, _len, _ref, _results;\n      _ref = this.bbox;\n      _results = [];\n      for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n        e = _ref[_i];\n        _results.push(Math.round(e * this.scaleFactor));\n      }\n      return _results;\n    }.call(this);\n    this.stemV = 0;\n    if (this.post.exists) {\n      raw = this.post.italic_angle;\n      hi = raw >> 16;\n      low = raw & 0xff;\n      if ((hi & 0x8000) !== 0) {\n        hi = -((hi ^ 0xffff) + 1);\n      }\n      this.italicAngle = +(\"\" + hi + \".\" + low);\n    } else {\n      this.italicAngle = 0;\n    }\n    this.ascender = Math.round(this.ascender * this.scaleFactor);\n    this.decender = Math.round(this.decender * this.scaleFactor);\n    this.lineGap = Math.round(this.lineGap * this.scaleFactor);\n    this.capHeight = (this.os2.exists && this.os2.capHeight) || this.ascender;\n    this.xHeight = (this.os2.exists && this.os2.xHeight) || 0;\n    this.familyClass = ((this.os2.exists && this.os2.familyClass) || 0) >> 8;\n    this.isSerif =\n      (_ref = this.familyClass) === 1 ||\n      _ref === 2 ||\n      _ref === 3 ||\n      _ref === 4 ||\n      _ref === 5 ||\n      _ref === 7;\n    this.isScript = this.familyClass === 10;\n    this.flags = 0;\n    if (this.post.isFixedPitch) {\n      this.flags |= 1 << 0;\n    }\n    if (this.isSerif) {\n      this.flags |= 1 << 1;\n    }\n    if (this.isScript) {\n      this.flags |= 1 << 3;\n    }\n    if (this.italicAngle !== 0) {\n      this.flags |= 1 << 6;\n    }\n    this.flags |= 1 << 5;\n    if (!this.cmap.unicode) {\n      throw new Error(\"No unicode cmap for font\");\n    }\n  };\n  TTFFont.prototype.characterToGlyph = function(character) {\n    var _ref;\n    return (\n      ((_ref = this.cmap.unicode) != null ? _ref.codeMap[character] : void 0) ||\n      0\n    );\n  };\n  TTFFont.prototype.widthOfGlyph = function(glyph) {\n    var scale;\n    scale = 1000.0 / this.head.unitsPerEm;\n    return this.hmtx.forGlyph(glyph).advance * scale;\n  };\n  TTFFont.prototype.widthOfString = function(string, size, charSpace) {\n    var charCode, i, scale, width, _ref;\n    string = \"\" + string;\n    width = 0;\n    for (\n      i = 0, _ref = string.length;\n      0 <= _ref ? i < _ref : i > _ref;\n      i = 0 <= _ref ? ++i : --i\n    ) {\n      charCode = string.charCodeAt(i);\n      width +=\n        this.widthOfGlyph(this.characterToGlyph(charCode)) +\n          charSpace * (1000 / size) || 0;\n    }\n    scale = size / 1000;\n    return width * scale;\n  };\n  TTFFont.prototype.lineHeight = function(size, includeGap) {\n    var gap;\n    if (includeGap == null) {\n      includeGap = false;\n    }\n    gap = includeGap ? this.lineGap : 0;\n    return ((this.ascender + gap - this.decender) / 1000) * size;\n  };\n  return TTFFont;\n})();\n\n/************************************************************************************************/\n/* function : Data                                                                              */\n/* comment : The ttf data decoded and stored in an array is read and written to the Data object.*/\n/************************************************************************************************/\nvar Data = (function() {\n  function Data(data) {\n    this.data = data != null ? data : [];\n    this.pos = 0;\n    this.length = this.data.length;\n  }\n  Data.prototype.readByte = function() {\n    return this.data[this.pos++];\n  };\n  Data.prototype.writeByte = function(byte) {\n    return (this.data[this.pos++] = byte);\n  };\n  Data.prototype.readUInt32 = function() {\n    var b1, b2, b3, b4;\n    b1 = this.readByte() * 0x1000000;\n    b2 = this.readByte() << 16;\n    b3 = this.readByte() << 8;\n    b4 = this.readByte();\n    return b1 + b2 + b3 + b4;\n  };\n  Data.prototype.writeUInt32 = function(val) {\n    this.writeByte((val >>> 24) & 0xff);\n    this.writeByte((val >> 16) & 0xff);\n    this.writeByte((val >> 8) & 0xff);\n    return this.writeByte(val & 0xff);\n  };\n  Data.prototype.readInt32 = function() {\n    var int;\n    int = this.readUInt32();\n    if (int >= 0x80000000) {\n      return int - 0x100000000;\n    } else {\n      return int;\n    }\n  };\n  Data.prototype.writeInt32 = function(val) {\n    if (val < 0) {\n      val += 0x100000000;\n    }\n    return this.writeUInt32(val);\n  };\n  Data.prototype.readUInt16 = function() {\n    var b1, b2;\n    b1 = this.readByte() << 8;\n    b2 = this.readByte();\n    return b1 | b2;\n  };\n  Data.prototype.writeUInt16 = function(val) {\n    this.writeByte((val >> 8) & 0xff);\n    return this.writeByte(val & 0xff);\n  };\n  Data.prototype.readInt16 = function() {\n    var int;\n    int = this.readUInt16();\n    if (int >= 0x8000) {\n      return int - 0x10000;\n    } else {\n      return int;\n    }\n  };\n  Data.prototype.writeInt16 = function(val) {\n    if (val < 0) {\n      val += 0x10000;\n    }\n    return this.writeUInt16(val);\n  };\n  Data.prototype.readString = function(length) {\n    var i, ret;\n    ret = [];\n    for (\n      i = 0;\n      0 <= length ? i < length : i > length;\n      i = 0 <= length ? ++i : --i\n    ) {\n      ret[i] = String.fromCharCode(this.readByte());\n    }\n    return ret.join(\"\");\n  };\n  Data.prototype.writeString = function(val) {\n    var i, _ref, _results;\n    _results = [];\n    for (\n      i = 0, _ref = val.length;\n      0 <= _ref ? i < _ref : i > _ref;\n      i = 0 <= _ref ? ++i : --i\n    ) {\n      _results.push(this.writeByte(val.charCodeAt(i)));\n    }\n    return _results;\n  };\n  /*Data.prototype.stringAt = function (pos, length) {\n            this.pos = pos;\n            return this.readString(length);\n        };*/\n  Data.prototype.readShort = function() {\n    return this.readInt16();\n  };\n  Data.prototype.writeShort = function(val) {\n    return this.writeInt16(val);\n  };\n  Data.prototype.readLongLong = function() {\n    var b1, b2, b3, b4, b5, b6, b7, b8;\n    b1 = this.readByte();\n    b2 = this.readByte();\n    b3 = this.readByte();\n    b4 = this.readByte();\n    b5 = this.readByte();\n    b6 = this.readByte();\n    b7 = this.readByte();\n    b8 = this.readByte();\n    if (b1 & 0x80) {\n      return (\n        ((b1 ^ 0xff) * 0x100000000000000 +\n          (b2 ^ 0xff) * 0x1000000000000 +\n          (b3 ^ 0xff) * 0x10000000000 +\n          (b4 ^ 0xff) * 0x100000000 +\n          (b5 ^ 0xff) * 0x1000000 +\n          (b6 ^ 0xff) * 0x10000 +\n          (b7 ^ 0xff) * 0x100 +\n          (b8 ^ 0xff) +\n          1) *\n        -1\n      );\n    }\n    return (\n      b1 * 0x100000000000000 +\n      b2 * 0x1000000000000 +\n      b3 * 0x10000000000 +\n      b4 * 0x100000000 +\n      b5 * 0x1000000 +\n      b6 * 0x10000 +\n      b7 * 0x100 +\n      b8\n    );\n  };\n  Data.prototype.writeLongLong = function(val) {\n    var high, low;\n    high = Math.floor(val / 0x100000000);\n    low = val & 0xffffffff;\n    this.writeByte((high >> 24) & 0xff);\n    this.writeByte((high >> 16) & 0xff);\n    this.writeByte((high >> 8) & 0xff);\n    this.writeByte(high & 0xff);\n    this.writeByte((low >> 24) & 0xff);\n    this.writeByte((low >> 16) & 0xff);\n    this.writeByte((low >> 8) & 0xff);\n    return this.writeByte(low & 0xff);\n  };\n  Data.prototype.readInt = function() {\n    return this.readInt32();\n  };\n  Data.prototype.writeInt = function(val) {\n    return this.writeInt32(val);\n  };\n  /*Data.prototype.slice = function (start, end) {\n            return this.data.slice(start, end);\n        };*/\n  Data.prototype.read = function(bytes) {\n    var buf, i;\n    buf = [];\n    for (\n      i = 0;\n      0 <= bytes ? i < bytes : i > bytes;\n      i = 0 <= bytes ? ++i : --i\n    ) {\n      buf.push(this.readByte());\n    }\n    return buf;\n  };\n  Data.prototype.write = function(bytes) {\n    var byte, i, _len, _results;\n    _results = [];\n    for (i = 0, _len = bytes.length; i < _len; i++) {\n      byte = bytes[i];\n      _results.push(this.writeByte(byte));\n    }\n    return _results;\n  };\n  return Data;\n})();\n\nvar Directory = (function() {\n  var checksum;\n\n  /*****************************************************************************************************/\n  /* function : Directory generator                                                                    */\n  /* comment : Initialize the offset, tag, length, and checksum for each table for the font to be used.*/\n  /*****************************************************************************************************/\n  function Directory(data) {\n    var entry, i, _ref;\n    this.scalarType = data.readInt();\n    this.tableCount = data.readShort();\n    this.searchRange = data.readShort();\n    this.entrySelector = data.readShort();\n    this.rangeShift = data.readShort();\n    this.tables = {};\n    for (\n      i = 0, _ref = this.tableCount;\n      0 <= _ref ? i < _ref : i > _ref;\n      i = 0 <= _ref ? ++i : --i\n    ) {\n      entry = {\n        tag: data.readString(4),\n        checksum: data.readInt(),\n        offset: data.readInt(),\n        length: data.readInt()\n      };\n      this.tables[entry.tag] = entry;\n    }\n  }\n  /********************************************************************************************************/\n  /* function : encode                                                                                    */\n  /* comment : It encodes and stores the font table object and information used for the directory object. */\n  /********************************************************************************************************/\n  Directory.prototype.encode = function(tables) {\n    var adjustment,\n      directory,\n      directoryLength,\n      entrySelector,\n      headOffset,\n      log2,\n      offset,\n      rangeShift,\n      searchRange,\n      sum,\n      table,\n      tableCount,\n      tableData,\n      tag;\n    tableCount = Object.keys(tables).length;\n    log2 = Math.log(2);\n    searchRange = Math.floor(Math.log(tableCount) / log2) * 16;\n    entrySelector = Math.floor(searchRange / log2);\n    rangeShift = tableCount * 16 - searchRange;\n    directory = new Data();\n    directory.writeInt(this.scalarType);\n    directory.writeShort(tableCount);\n    directory.writeShort(searchRange);\n    directory.writeShort(entrySelector);\n    directory.writeShort(rangeShift);\n    directoryLength = tableCount * 16;\n    offset = directory.pos + directoryLength;\n    headOffset = null;\n    tableData = [];\n    for (tag in tables) {\n      table = tables[tag];\n      directory.writeString(tag);\n      directory.writeInt(checksum(table));\n      directory.writeInt(offset);\n      directory.writeInt(table.length);\n      tableData = tableData.concat(table);\n      if (tag === \"head\") {\n        headOffset = offset;\n      }\n      offset += table.length;\n      while (offset % 4) {\n        tableData.push(0);\n        offset++;\n      }\n    }\n    directory.write(tableData);\n    sum = checksum(directory.data);\n    adjustment = 0xb1b0afba - sum;\n    directory.pos = headOffset + 8;\n    directory.writeUInt32(adjustment);\n    return directory.data;\n  };\n  /***************************************************************/\n  /* function : checksum                                         */\n  /* comment : Duplicate the table for the tag.                  */\n  /***************************************************************/\n  checksum = function(data) {\n    var i, sum, tmp, _ref;\n    data = __slice.call(data);\n    while (data.length % 4) {\n      data.push(0);\n    }\n    tmp = new Data(data);\n    sum = 0;\n    for (i = 0, _ref = data.length; i < _ref; i = i += 4) {\n      sum += tmp.readUInt32();\n    }\n    return sum & 0xffffffff;\n  };\n  return Directory;\n})();\n\nvar Table,\n  __hasProp = {}.hasOwnProperty,\n  __extends = function(child, parent) {\n    for (var key in parent) {\n      if (__hasProp.call(parent, key)) child[key] = parent[key];\n    }\n\n    function ctor() {\n      this.constructor = child;\n    }\n    ctor.prototype = parent.prototype;\n    child.prototype = new ctor();\n    child.__super__ = parent.prototype;\n    return child;\n  };\n\n/***************************************************************/\n/* function : Table                                            */\n/* comment : Save info for each table, and parse the table.    */\n/***************************************************************/\nTable = (function() {\n  function Table(file) {\n    var info;\n    this.file = file;\n    info = this.file.directory.tables[this.tag];\n    this.exists = !!info;\n    if (info) {\n      (this.offset = info.offset), (this.length = info.length);\n      this.parse(this.file.contents);\n    }\n  }\n  Table.prototype.parse = function() {};\n  Table.prototype.encode = function() {};\n  Table.prototype.raw = function() {\n    if (!this.exists) {\n      return null;\n    }\n    this.file.contents.pos = this.offset;\n    return this.file.contents.read(this.length);\n  };\n  return Table;\n})();\n\nvar HeadTable = (function(_super) {\n  __extends(HeadTable, _super);\n\n  function HeadTable() {\n    return HeadTable.__super__.constructor.apply(this, arguments);\n  }\n  HeadTable.prototype.tag = \"head\";\n  HeadTable.prototype.parse = function(data) {\n    data.pos = this.offset;\n    this.version = data.readInt();\n    this.revision = data.readInt();\n    this.checkSumAdjustment = data.readInt();\n    this.magicNumber = data.readInt();\n    this.flags = data.readShort();\n    this.unitsPerEm = data.readShort();\n    this.created = data.readLongLong();\n    this.modified = data.readLongLong();\n    this.xMin = data.readShort();\n    this.yMin = data.readShort();\n    this.xMax = data.readShort();\n    this.yMax = data.readShort();\n    this.macStyle = data.readShort();\n    this.lowestRecPPEM = data.readShort();\n    this.fontDirectionHint = data.readShort();\n    this.indexToLocFormat = data.readShort();\n    return (this.glyphDataFormat = data.readShort());\n  };\n  HeadTable.prototype.encode = function(indexToLocFormat) {\n    var table;\n    table = new Data();\n    table.writeInt(this.version);\n    table.writeInt(this.revision);\n    table.writeInt(this.checkSumAdjustment);\n    table.writeInt(this.magicNumber);\n    table.writeShort(this.flags);\n    table.writeShort(this.unitsPerEm);\n    table.writeLongLong(this.created);\n    table.writeLongLong(this.modified);\n    table.writeShort(this.xMin);\n    table.writeShort(this.yMin);\n    table.writeShort(this.xMax);\n    table.writeShort(this.yMax);\n    table.writeShort(this.macStyle);\n    table.writeShort(this.lowestRecPPEM);\n    table.writeShort(this.fontDirectionHint);\n    table.writeShort(indexToLocFormat);\n    table.writeShort(this.glyphDataFormat);\n    return table.data;\n  };\n  return HeadTable;\n})(Table);\n\n/************************************************************************************/\n/* function : CmapEntry                                                             */\n/* comment : Cmap Initializes and encodes object information (required by pdf spec).*/\n/************************************************************************************/\nvar CmapEntry = (function() {\n  function CmapEntry(data, offset) {\n    var code,\n      count,\n      endCode,\n      glyphId,\n      glyphIds,\n      i,\n      idDelta,\n      idRangeOffset,\n      index,\n      saveOffset,\n      segCount,\n      segCountX2,\n      start,\n      startCode,\n      tail,\n      _j,\n      _k,\n      _len;\n    this.platformID = data.readUInt16();\n    this.encodingID = data.readShort();\n    this.offset = offset + data.readInt();\n    saveOffset = data.pos;\n    data.pos = this.offset;\n    this.format = data.readUInt16();\n    this.length = data.readUInt16();\n    this.language = data.readUInt16();\n    this.isUnicode =\n      (this.platformID === 3 && this.encodingID === 1 && this.format === 4) ||\n      (this.platformID === 0 && this.format === 4);\n    this.codeMap = {};\n    switch (this.format) {\n      case 0:\n        for (i = 0; i < 256; ++i) {\n          this.codeMap[i] = data.readByte();\n        }\n        break;\n      case 4:\n        segCountX2 = data.readUInt16();\n        segCount = segCountX2 / 2;\n        data.pos += 6;\n        endCode = (function() {\n          var _j, _results;\n          _results = [];\n          for (\n            i = _j = 0;\n            0 <= segCount ? _j < segCount : _j > segCount;\n            i = 0 <= segCount ? ++_j : --_j\n          ) {\n            _results.push(data.readUInt16());\n          }\n          return _results;\n        })();\n        data.pos += 2;\n        startCode = (function() {\n          var _j, _results;\n          _results = [];\n          for (\n            i = _j = 0;\n            0 <= segCount ? _j < segCount : _j > segCount;\n            i = 0 <= segCount ? ++_j : --_j\n          ) {\n            _results.push(data.readUInt16());\n          }\n          return _results;\n        })();\n        idDelta = (function() {\n          var _j, _results;\n          _results = [];\n          for (\n            i = _j = 0;\n            0 <= segCount ? _j < segCount : _j > segCount;\n            i = 0 <= segCount ? ++_j : --_j\n          ) {\n            _results.push(data.readUInt16());\n          }\n          return _results;\n        })();\n        idRangeOffset = (function() {\n          var _j, _results;\n          _results = [];\n          for (\n            i = _j = 0;\n            0 <= segCount ? _j < segCount : _j > segCount;\n            i = 0 <= segCount ? ++_j : --_j\n          ) {\n            _results.push(data.readUInt16());\n          }\n          return _results;\n        })();\n        count = (this.length - data.pos + this.offset) / 2;\n        glyphIds = (function() {\n          var _j, _results;\n          _results = [];\n          for (\n            i = _j = 0;\n            0 <= count ? _j < count : _j > count;\n            i = 0 <= count ? ++_j : --_j\n          ) {\n            _results.push(data.readUInt16());\n          }\n          return _results;\n        })();\n        for (i = _j = 0, _len = endCode.length; _j < _len; i = ++_j) {\n          tail = endCode[i];\n          start = startCode[i];\n          for (\n            code = _k = start;\n            start <= tail ? _k <= tail : _k >= tail;\n            code = start <= tail ? ++_k : --_k\n          ) {\n            if (idRangeOffset[i] === 0) {\n              glyphId = code + idDelta[i];\n            } else {\n              index = idRangeOffset[i] / 2 + (code - start) - (segCount - i);\n              glyphId = glyphIds[index] || 0;\n              if (glyphId !== 0) {\n                glyphId += idDelta[i];\n              }\n            }\n            this.codeMap[code] = glyphId & 0xffff;\n          }\n        }\n    }\n    data.pos = saveOffset;\n  }\n  CmapEntry.encode = function(charmap, encoding) {\n    var charMap,\n      code,\n      codeMap,\n      codes,\n      delta,\n      deltas,\n      diff,\n      endCode,\n      endCodes,\n      entrySelector,\n      glyphIDs,\n      i,\n      id,\n      indexes,\n      last,\n      map,\n      nextID,\n      offset,\n      old,\n      rangeOffsets,\n      rangeShift,\n      searchRange,\n      segCount,\n      segCountX2,\n      startCode,\n      startCodes,\n      startGlyph,\n      subtable,\n      _i,\n      _j,\n      _k,\n      _l,\n      _len,\n      _len1,\n      _len2,\n      _len3,\n      _len4,\n      _len5,\n      _len6,\n      _len7,\n      _m,\n      _n,\n      _name,\n      _o,\n      _p,\n      _q;\n    subtable = new Data();\n    codes = Object.keys(charmap).sort(function(a, b) {\n      return a - b;\n    });\n    switch (encoding) {\n      case \"macroman\":\n        id = 0;\n        indexes = (function() {\n          var _results = [];\n          for (i = 0; i < 256; ++i) {\n            _results.push(0);\n          }\n          return _results;\n        })();\n        map = {\n          0: 0\n        };\n        codeMap = {};\n        for (_i = 0, _len = codes.length; _i < _len; _i++) {\n          code = codes[_i];\n          if (map[(_name = charmap[code])] == null) {\n            map[_name] = ++id;\n          }\n          codeMap[code] = {\n            old: charmap[code],\n            new: map[charmap[code]]\n          };\n          indexes[code] = map[charmap[code]];\n        }\n        subtable.writeUInt16(1);\n        subtable.writeUInt16(0);\n        subtable.writeUInt32(12);\n        subtable.writeUInt16(0);\n        subtable.writeUInt16(262);\n        subtable.writeUInt16(0);\n        subtable.write(indexes);\n        return {\n          charMap: codeMap,\n          subtable: subtable.data,\n          maxGlyphID: id + 1\n        };\n      case \"unicode\":\n        startCodes = [];\n        endCodes = [];\n        nextID = 0;\n        map = {};\n        charMap = {};\n        last = diff = null;\n        for (_j = 0, _len1 = codes.length; _j < _len1; _j++) {\n          code = codes[_j];\n          old = charmap[code];\n          if (map[old] == null) {\n            map[old] = ++nextID;\n          }\n          charMap[code] = {\n            old: old,\n            new: map[old]\n          };\n          delta = map[old] - code;\n          if (last == null || delta !== diff) {\n            if (last) {\n              endCodes.push(last);\n            }\n            startCodes.push(code);\n            diff = delta;\n          }\n          last = code;\n        }\n        if (last) {\n          endCodes.push(last);\n        }\n        endCodes.push(0xffff);\n        startCodes.push(0xffff);\n        segCount = startCodes.length;\n        segCountX2 = segCount * 2;\n        searchRange = 2 * Math.pow(Math.log(segCount) / Math.LN2, 2);\n        entrySelector = Math.log(searchRange / 2) / Math.LN2;\n        rangeShift = 2 * segCount - searchRange;\n        deltas = [];\n        rangeOffsets = [];\n        glyphIDs = [];\n        for (i = _k = 0, _len2 = startCodes.length; _k < _len2; i = ++_k) {\n          startCode = startCodes[i];\n          endCode = endCodes[i];\n          if (startCode === 0xffff) {\n            deltas.push(0);\n            rangeOffsets.push(0);\n            break;\n          }\n          startGlyph = charMap[startCode][\"new\"];\n          if (startCode - startGlyph >= 0x8000) {\n            deltas.push(0);\n            rangeOffsets.push(2 * (glyphIDs.length + segCount - i));\n            for (\n              code = _l = startCode;\n              startCode <= endCode ? _l <= endCode : _l >= endCode;\n              code = startCode <= endCode ? ++_l : --_l\n            ) {\n              glyphIDs.push(charMap[code][\"new\"]);\n            }\n          } else {\n            deltas.push(startGlyph - startCode);\n            rangeOffsets.push(0);\n          }\n        }\n        subtable.writeUInt16(3);\n        subtable.writeUInt16(1);\n        subtable.writeUInt32(12);\n        subtable.writeUInt16(4);\n        subtable.writeUInt16(16 + segCount * 8 + glyphIDs.length * 2);\n        subtable.writeUInt16(0);\n        subtable.writeUInt16(segCountX2);\n        subtable.writeUInt16(searchRange);\n        subtable.writeUInt16(entrySelector);\n        subtable.writeUInt16(rangeShift);\n        for (_m = 0, _len3 = endCodes.length; _m < _len3; _m++) {\n          code = endCodes[_m];\n          subtable.writeUInt16(code);\n        }\n        subtable.writeUInt16(0);\n        for (_n = 0, _len4 = startCodes.length; _n < _len4; _n++) {\n          code = startCodes[_n];\n          subtable.writeUInt16(code);\n        }\n        for (_o = 0, _len5 = deltas.length; _o < _len5; _o++) {\n          delta = deltas[_o];\n          subtable.writeUInt16(delta);\n        }\n        for (_p = 0, _len6 = rangeOffsets.length; _p < _len6; _p++) {\n          offset = rangeOffsets[_p];\n          subtable.writeUInt16(offset);\n        }\n        for (_q = 0, _len7 = glyphIDs.length; _q < _len7; _q++) {\n          id = glyphIDs[_q];\n          subtable.writeUInt16(id);\n        }\n        return {\n          charMap: charMap,\n          subtable: subtable.data,\n          maxGlyphID: nextID + 1\n        };\n    }\n  };\n  return CmapEntry;\n})();\n\nvar CmapTable = (function(_super) {\n  __extends(CmapTable, _super);\n\n  function CmapTable() {\n    return CmapTable.__super__.constructor.apply(this, arguments);\n  }\n  CmapTable.prototype.tag = \"cmap\";\n  CmapTable.prototype.parse = function(data) {\n    var entry, i, tableCount;\n    data.pos = this.offset;\n    this.version = data.readUInt16();\n    tableCount = data.readUInt16();\n    this.tables = [];\n    this.unicode = null;\n    for (\n      i = 0;\n      0 <= tableCount ? i < tableCount : i > tableCount;\n      i = 0 <= tableCount ? ++i : --i\n    ) {\n      entry = new CmapEntry(data, this.offset);\n      this.tables.push(entry);\n      if (entry.isUnicode) {\n        if (this.unicode == null) {\n          this.unicode = entry;\n        }\n      }\n    }\n    return true;\n  };\n  /*************************************************************************/\n  /* function : encode                                                     */\n  /* comment : Encode the cmap table corresponding to the input character. */\n  /*************************************************************************/\n  CmapTable.encode = function(charmap, encoding) {\n    var result, table;\n    if (encoding == null) {\n      encoding = \"macroman\";\n    }\n    result = CmapEntry.encode(charmap, encoding);\n    table = new Data();\n    table.writeUInt16(0);\n    table.writeUInt16(1);\n    result.table = table.data.concat(result.subtable);\n    return result;\n  };\n  return CmapTable;\n})(Table);\n\nvar HheaTable = (function(_super) {\n  __extends(HheaTable, _super);\n\n  function HheaTable() {\n    return HheaTable.__super__.constructor.apply(this, arguments);\n  }\n  HheaTable.prototype.tag = \"hhea\";\n  HheaTable.prototype.parse = function(data) {\n    data.pos = this.offset;\n    this.version = data.readInt();\n    this.ascender = data.readShort();\n    this.decender = data.readShort();\n    this.lineGap = data.readShort();\n    this.advanceWidthMax = data.readShort();\n    this.minLeftSideBearing = data.readShort();\n    this.minRightSideBearing = data.readShort();\n    this.xMaxExtent = data.readShort();\n    this.caretSlopeRise = data.readShort();\n    this.caretSlopeRun = data.readShort();\n    this.caretOffset = data.readShort();\n    data.pos += 4 * 2;\n    this.metricDataFormat = data.readShort();\n    return (this.numberOfMetrics = data.readUInt16());\n  };\n  /*HheaTable.prototype.encode = function (ids) {\n            var i, table, _i, _ref;\n            table = new Data;\n            table.writeInt(this.version);\n            table.writeShort(this.ascender);\n            table.writeShort(this.decender);\n            table.writeShort(this.lineGap);\n            table.writeShort(this.advanceWidthMax);\n            table.writeShort(this.minLeftSideBearing);\n            table.writeShort(this.minRightSideBearing);\n            table.writeShort(this.xMaxExtent);\n            table.writeShort(this.caretSlopeRise);\n            table.writeShort(this.caretSlopeRun);\n            table.writeShort(this.caretOffset);\n            for (i = _i = 0, _ref = 4 * 2; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {\n                table.writeByte(0);\n            }\n            table.writeShort(this.metricDataFormat);\n            table.writeUInt16(ids.length);\n            return table.data;\n        };*/\n  return HheaTable;\n})(Table);\n\nvar OS2Table = (function(_super) {\n  __extends(OS2Table, _super);\n\n  function OS2Table() {\n    return OS2Table.__super__.constructor.apply(this, arguments);\n  }\n  OS2Table.prototype.tag = \"OS/2\";\n  OS2Table.prototype.parse = function(data) {\n    data.pos = this.offset;\n    this.version = data.readUInt16();\n    this.averageCharWidth = data.readShort();\n    this.weightClass = data.readUInt16();\n    this.widthClass = data.readUInt16();\n    this.type = data.readShort();\n    this.ySubscriptXSize = data.readShort();\n    this.ySubscriptYSize = data.readShort();\n    this.ySubscriptXOffset = data.readShort();\n    this.ySubscriptYOffset = data.readShort();\n    this.ySuperscriptXSize = data.readShort();\n    this.ySuperscriptYSize = data.readShort();\n    this.ySuperscriptXOffset = data.readShort();\n    this.ySuperscriptYOffset = data.readShort();\n    this.yStrikeoutSize = data.readShort();\n    this.yStrikeoutPosition = data.readShort();\n    this.familyClass = data.readShort();\n    this.panose = (function() {\n      var i, _results;\n      _results = [];\n      for (i = 0; i < 10; ++i) {\n        _results.push(data.readByte());\n      }\n      return _results;\n    })();\n    this.charRange = (function() {\n      var i, _results;\n      _results = [];\n      for (i = 0; i < 4; ++i) {\n        _results.push(data.readInt());\n      }\n      return _results;\n    })();\n    this.vendorID = data.readString(4);\n    this.selection = data.readShort();\n    this.firstCharIndex = data.readShort();\n    this.lastCharIndex = data.readShort();\n    if (this.version > 0) {\n      this.ascent = data.readShort();\n      this.descent = data.readShort();\n      this.lineGap = data.readShort();\n      this.winAscent = data.readShort();\n      this.winDescent = data.readShort();\n      this.codePageRange = (function() {\n        var i, _results;\n        _results = [];\n        for (i = 0; i < 2; i = ++i) {\n          _results.push(data.readInt());\n        }\n        return _results;\n      })();\n      if (this.version > 1) {\n        this.xHeight = data.readShort();\n        this.capHeight = data.readShort();\n        this.defaultChar = data.readShort();\n        this.breakChar = data.readShort();\n        return (this.maxContext = data.readShort());\n      }\n    }\n  };\n  /*OS2Table.prototype.encode = function () {\n            return this.raw();\n        };*/\n  return OS2Table;\n})(Table);\n\nvar PostTable = (function(_super) {\n  var POSTSCRIPT_GLYPHS;\n  __extends(PostTable, _super);\n\n  function PostTable() {\n    return PostTable.__super__.constructor.apply(this, arguments);\n  }\n  PostTable.prototype.tag = \"post\";\n  PostTable.prototype.parse = function(data) {\n    var length, numberOfGlyphs, _results;\n    data.pos = this.offset;\n    this.format = data.readInt();\n    this.italicAngle = data.readInt();\n    this.underlinePosition = data.readShort();\n    this.underlineThickness = data.readShort();\n    this.isFixedPitch = data.readInt();\n    this.minMemType42 = data.readInt();\n    this.maxMemType42 = data.readInt();\n    this.minMemType1 = data.readInt();\n    this.maxMemType1 = data.readInt();\n    switch (this.format) {\n      case 0x00010000:\n        break;\n      case 0x00020000:\n        numberOfGlyphs = data.readUInt16();\n        this.glyphNameIndex = [];\n        var i;\n        for (\n          i = 0;\n          0 <= numberOfGlyphs ? i < numberOfGlyphs : i > numberOfGlyphs;\n          i = 0 <= numberOfGlyphs ? ++i : --i\n        ) {\n          this.glyphNameIndex.push(data.readUInt16());\n        }\n        this.names = [];\n        _results = [];\n        while (data.pos < this.offset + this.length) {\n          length = data.readByte();\n          _results.push(this.names.push(data.readString(length)));\n        }\n        return _results;\n      case 0x00025000:\n        numberOfGlyphs = data.readUInt16();\n        return (this.offsets = data.read(numberOfGlyphs));\n      case 0x00030000:\n        break;\n      case 0x00040000:\n        return (this.map = function() {\n          var _j, _ref, _results1;\n          _results1 = [];\n          for (\n            i = _j = 0, _ref = this.file.maxp.numGlyphs;\n            0 <= _ref ? _j < _ref : _j > _ref;\n            i = 0 <= _ref ? ++_j : --_j\n          ) {\n            _results1.push(data.readUInt32());\n          }\n          return _results1;\n        }.call(this));\n    }\n  };\n  /*PostTable.prototype.glyphFor = function (code) {\n            var index;\n            switch (this.format) {\n            case 0x00010000:\n                return POSTSCRIPT_GLYPHS[code] || '.notdef';\n            case 0x00020000:\n                index = this.glyphNameIndex[code];\n                if (index <= 257) {\n                    return POSTSCRIPT_GLYPHS[index];\n                }\n                else {\n                    return this.names[index - 258] || '.notdef';\n                }\n                break;\n            case 0x00025000:\n                return POSTSCRIPT_GLYPHS[code + this.offsets[code]] || '.notdef';\n            case 0x00030000:\n                return '.notdef';\n            case 0x00040000:\n                return this.map[code] || 0xFFFF;\n            }\n        };*/\n  /*PostTable.prototype.encode = function (mapping) {\n            var id, index, indexes, position, post, raw, string, strings, table, _i, _j, _k, _len, _len1, _len2;\n            if (!this.exists) {\n                return null;\n            }\n            raw = this.raw();\n            if (this.format === 0x00030000) {\n                return raw;\n            }\n            table = new Data(raw.slice(0, 32));\n            table.writeUInt32(0x00020000);\n            table.pos = 32;\n            indexes = [];\n            strings = [];\n            for (_i = 0, _len = mapping.length; _i < _len; _i++) {\n                id = mapping[_i];\n                post = this.glyphFor(id);\n                position = POSTSCRIPT_GLYPHS.indexOf(post);\n                if (position !== -1) {\n                    indexes.push(position);\n                }\n                else {\n                    indexes.push(257 + strings.length);\n                    strings.push(post);\n                }\n            }\n            table.writeUInt16(Object.keys(mapping).length);\n            for (_j = 0, _len1 = indexes.length; _j < _len1; _j++) {\n                index = indexes[_j];\n                table.writeUInt16(index);\n            }\n            for (_k = 0, _len2 = strings.length; _k < _len2; _k++) {\n                string = strings[_k];\n                table.writeByte(string.length);\n                table.writeString(string);\n            }\n            return table.data;\n        };*/\n  POSTSCRIPT_GLYPHS = \".notdef .null nonmarkingreturn space exclam quotedbl numbersign dollar percent\\nampersand quotesingle parenleft parenright asterisk plus comma hyphen period slash\\nzero one two three four five six seven eight nine colon semicolon less equal greater\\nquestion at A B C D E F G H I J K L M N O P Q R S T U V W X Y Z\\nbracketleft backslash bracketright asciicircum underscore grave\\na b c d e f g h i j k l m n o p q r s t u v w x y z\\nbraceleft bar braceright asciitilde Adieresis Aring Ccedilla Eacute Ntilde Odieresis\\nUdieresis aacute agrave acircumflex adieresis atilde aring ccedilla eacute egrave\\necircumflex edieresis iacute igrave icircumflex idieresis ntilde oacute ograve\\nocircumflex odieresis otilde uacute ugrave ucircumflex udieresis dagger degree cent\\nsterling section bullet paragraph germandbls registered copyright trademark acute\\ndieresis notequal AE Oslash infinity plusminus lessequal greaterequal yen mu\\npartialdiff summation product pi integral ordfeminine ordmasculine Omega ae oslash\\nquestiondown exclamdown logicalnot radical florin approxequal Delta guillemotleft\\nguillemotright ellipsis nonbreakingspace Agrave Atilde Otilde OE oe endash emdash\\nquotedblleft quotedblright quoteleft quoteright divide lozenge ydieresis Ydieresis\\nfraction currency guilsinglleft guilsinglright fi fl daggerdbl periodcentered\\nquotesinglbase quotedblbase perthousand Acircumflex Ecircumflex Aacute Edieresis\\nEgrave Iacute Icircumflex Idieresis Igrave Oacute Ocircumflex apple Ograve Uacute\\nUcircumflex Ugrave dotlessi circumflex tilde macron breve dotaccent ring cedilla\\nhungarumlaut ogonek caron Lslash lslash Scaron scaron Zcaron zcaron brokenbar Eth\\neth Yacute yacute Thorn thorn minus multiply onesuperior twosuperior threesuperior\\nonehalf onequarter threequarters franc Gbreve gbreve Idotaccent Scedilla scedilla\\nCacute cacute Ccaron ccaron dcroat\".split(\n    /\\s+/g\n  );\n  return PostTable;\n})(Table);\n\n/*********************************************************************************************************/\n/* function : NameEntry                                                                                  */\n/* comment : Store copyright information, platformID, encodingID, and languageID in the NameEntry object.*/\n/*********************************************************************************************************/\nvar NameEntry = (function() {\n  function NameEntry(raw, entry) {\n    this.raw = raw;\n    this.length = raw.length;\n    this.platformID = entry.platformID;\n    this.encodingID = entry.encodingID;\n    this.languageID = entry.languageID;\n  }\n  return NameEntry;\n})();\n\nvar NameTable = (function(_super) {\n  var subsetTag;\n  __extends(NameTable, _super);\n\n  function NameTable() {\n    return NameTable.__super__.constructor.apply(this, arguments);\n  }\n  NameTable.prototype.tag = \"name\";\n  NameTable.prototype.parse = function(data) {\n    var count,\n      entries,\n      entry,\n      i,\n      name,\n      stringOffset,\n      strings,\n      text,\n      _j,\n      _len,\n      _name;\n    data.pos = this.offset;\n    data.readShort(); //format\n    count = data.readShort();\n    stringOffset = data.readShort();\n    entries = [];\n    for (\n      i = 0;\n      0 <= count ? i < count : i > count;\n      i = 0 <= count ? ++i : --i\n    ) {\n      entries.push({\n        platformID: data.readShort(),\n        encodingID: data.readShort(),\n        languageID: data.readShort(),\n        nameID: data.readShort(),\n        length: data.readShort(),\n        offset: this.offset + stringOffset + data.readShort()\n      });\n    }\n    strings = {};\n    for (i = _j = 0, _len = entries.length; _j < _len; i = ++_j) {\n      entry = entries[i];\n      data.pos = entry.offset;\n      text = data.readString(entry.length);\n      name = new NameEntry(text, entry);\n      if (strings[(_name = entry.nameID)] == null) {\n        strings[_name] = [];\n      }\n      strings[entry.nameID].push(name);\n    }\n    this.strings = strings;\n    this.copyright = strings[0];\n    this.fontFamily = strings[1];\n    this.fontSubfamily = strings[2];\n    this.uniqueSubfamily = strings[3];\n    this.fontName = strings[4];\n    this.version = strings[5];\n    try {\n      this.postscriptName = strings[6][0].raw.replace(\n        /[\\x00-\\x19\\x80-\\xff]/g,\n        \"\"\n      );\n    } catch (e) {\n      this.postscriptName = strings[4][0].raw.replace(\n        /[\\x00-\\x19\\x80-\\xff]/g,\n        \"\"\n      );\n    }\n    this.trademark = strings[7];\n    this.manufacturer = strings[8];\n    this.designer = strings[9];\n    this.description = strings[10];\n    this.vendorUrl = strings[11];\n    this.designerUrl = strings[12];\n    this.license = strings[13];\n    this.licenseUrl = strings[14];\n    this.preferredFamily = strings[15];\n    this.preferredSubfamily = strings[17];\n    this.compatibleFull = strings[18];\n    return (this.sampleText = strings[19]);\n  };\n  subsetTag = \"AAAAAA\";\n  /*NameTable.prototype.encode = function () {\n            var id, list, nameID, nameTable, postscriptName, strCount, strTable, string, strings, table, val, _i, _len, _ref;\n            strings = {};\n            _ref = this.strings;\n            for (id in _ref) {\n                val = _ref[id];\n                strings[id] = val;\n            }\n            postscriptName = new NameEntry(\"\" + subsetTag + \"+\" + this.postscriptName, {\n                platformID: 1\n                , encodingID: 0\n                , languageID: 0\n            });\n            strings[6] = [postscriptName];\n            subsetTag = successorOf(subsetTag);\n            strCount = 0;\n            for (id in strings) {\n                list = strings[id];\n                if (list != null) {\n                    strCount += list.length;\n                }\n            }\n            table = new Data;\n            strTable = new Data;\n            table.writeShort(0);\n            table.writeShort(strCount);\n            table.writeShort(6 + 12 * strCount);\n            for (nameID in strings) {\n                list = strings[nameID];\n                if (list != null) {\n                    for (_i = 0, _len = list.length; _i < _len; _i++) {\n                        string = list[_i];\n                        table.writeShort(string.platformID);\n                        table.writeShort(string.encodingID);\n                        table.writeShort(string.languageID);\n                        table.writeShort(nameID);\n                        table.writeShort(string.length);\n                        table.writeShort(strTable.pos);\n                        strTable.writeString(string.raw);\n                    }\n                }\n            }\n            return nameTable = {\n                postscriptName: postscriptName.raw\n                , table: table.data.concat(strTable.data)\n            };\n        };*/\n  return NameTable;\n})(Table);\n\nvar MaxpTable = (function(_super) {\n  __extends(MaxpTable, _super);\n\n  function MaxpTable() {\n    return MaxpTable.__super__.constructor.apply(this, arguments);\n  }\n  MaxpTable.prototype.tag = \"maxp\";\n  MaxpTable.prototype.parse = function(data) {\n    data.pos = this.offset;\n    this.version = data.readInt();\n    this.numGlyphs = data.readUInt16();\n    this.maxPoints = data.readUInt16();\n    this.maxContours = data.readUInt16();\n    this.maxCompositePoints = data.readUInt16();\n    this.maxComponentContours = data.readUInt16();\n    this.maxZones = data.readUInt16();\n    this.maxTwilightPoints = data.readUInt16();\n    this.maxStorage = data.readUInt16();\n    this.maxFunctionDefs = data.readUInt16();\n    this.maxInstructionDefs = data.readUInt16();\n    this.maxStackElements = data.readUInt16();\n    this.maxSizeOfInstructions = data.readUInt16();\n    this.maxComponentElements = data.readUInt16();\n    return (this.maxComponentDepth = data.readUInt16());\n  };\n  /*MaxpTable.prototype.encode = function (ids) {\n            var table;\n            table = new Data;\n            table.writeInt(this.version);\n            table.writeUInt16(ids.length);\n            table.writeUInt16(this.maxPoints);\n            table.writeUInt16(this.maxContours);\n            table.writeUInt16(this.maxCompositePoints);\n            table.writeUInt16(this.maxComponentContours);\n            table.writeUInt16(this.maxZones);\n            table.writeUInt16(this.maxTwilightPoints);\n            table.writeUInt16(this.maxStorage);\n            table.writeUInt16(this.maxFunctionDefs);\n            table.writeUInt16(this.maxInstructionDefs);\n            table.writeUInt16(this.maxStackElements);\n            table.writeUInt16(this.maxSizeOfInstructions);\n            table.writeUInt16(this.maxComponentElements);\n            table.writeUInt16(this.maxComponentDepth);\n            return table.data;\n        };*/\n  return MaxpTable;\n})(Table);\n\nvar HmtxTable = (function(_super) {\n  __extends(HmtxTable, _super);\n\n  function HmtxTable() {\n    return HmtxTable.__super__.constructor.apply(this, arguments);\n  }\n  HmtxTable.prototype.tag = \"hmtx\";\n  HmtxTable.prototype.parse = function(data) {\n    var i, last, lsbCount, m, _j, _ref, _results;\n    data.pos = this.offset;\n    this.metrics = [];\n    for (\n      i = 0, _ref = this.file.hhea.numberOfMetrics;\n      0 <= _ref ? i < _ref : i > _ref;\n      i = 0 <= _ref ? ++i : --i\n    ) {\n      this.metrics.push({\n        advance: data.readUInt16(),\n        lsb: data.readInt16()\n      });\n    }\n    lsbCount = this.file.maxp.numGlyphs - this.file.hhea.numberOfMetrics;\n    this.leftSideBearings = (function() {\n      var _j, _results;\n      _results = [];\n      for (\n        i = _j = 0;\n        0 <= lsbCount ? _j < lsbCount : _j > lsbCount;\n        i = 0 <= lsbCount ? ++_j : --_j\n      ) {\n        _results.push(data.readInt16());\n      }\n      return _results;\n    })();\n    this.widths = function() {\n      var _j, _len, _ref1, _results;\n      _ref1 = this.metrics;\n      _results = [];\n      for (_j = 0, _len = _ref1.length; _j < _len; _j++) {\n        m = _ref1[_j];\n        _results.push(m.advance);\n      }\n      return _results;\n    }.call(this);\n    last = this.widths[this.widths.length - 1];\n    _results = [];\n    for (\n      i = _j = 0;\n      0 <= lsbCount ? _j < lsbCount : _j > lsbCount;\n      i = 0 <= lsbCount ? ++_j : --_j\n    ) {\n      _results.push(this.widths.push(last));\n    }\n    return _results;\n  };\n  /***************************************************************/\n  /* function : forGlyph                                         */\n  /* comment : Returns the advance width and lsb for this glyph. */\n  /***************************************************************/\n  HmtxTable.prototype.forGlyph = function(id) {\n    if (id in this.metrics) {\n      return this.metrics[id];\n    }\n    return {\n      advance: this.metrics[this.metrics.length - 1].advance,\n      lsb: this.leftSideBearings[id - this.metrics.length]\n    };\n  };\n  /*HmtxTable.prototype.encode = function (mapping) {\n            var id, metric, table, _i, _len;\n            table = new Data;\n            for (_i = 0, _len = mapping.length; _i < _len; _i++) {\n                id = mapping[_i];\n                metric = this.forGlyph(id);\n                table.writeUInt16(metric.advance);\n                table.writeUInt16(metric.lsb);\n            }\n            return table.data;\n        };*/\n  return HmtxTable;\n})(Table);\n\nvar __slice = [].slice;\n\nvar GlyfTable = (function(_super) {\n  __extends(GlyfTable, _super);\n\n  function GlyfTable() {\n    return GlyfTable.__super__.constructor.apply(this, arguments);\n  }\n  GlyfTable.prototype.tag = \"glyf\";\n  GlyfTable.prototype.parse = function() {\n    return (this.cache = {});\n  };\n  GlyfTable.prototype.glyphFor = function(id) {\n    var data,\n      index,\n      length,\n      loca,\n      numberOfContours,\n      raw,\n      xMax,\n      xMin,\n      yMax,\n      yMin;\n    if (id in this.cache) {\n      return this.cache[id];\n    }\n    loca = this.file.loca;\n    data = this.file.contents;\n    index = loca.indexOf(id);\n    length = loca.lengthOf(id);\n    if (length === 0) {\n      return (this.cache[id] = null);\n    }\n    data.pos = this.offset + index;\n    raw = new Data(data.read(length));\n    numberOfContours = raw.readShort();\n    xMin = raw.readShort();\n    yMin = raw.readShort();\n    xMax = raw.readShort();\n    yMax = raw.readShort();\n    if (numberOfContours === -1) {\n      this.cache[id] = new CompoundGlyph(raw, xMin, yMin, xMax, yMax);\n    } else {\n      this.cache[id] = new SimpleGlyph(\n        raw,\n        numberOfContours,\n        xMin,\n        yMin,\n        xMax,\n        yMax\n      );\n    }\n    return this.cache[id];\n  };\n  GlyfTable.prototype.encode = function(glyphs, mapping, old2new) {\n    var glyph, id, offsets, table, _i, _len;\n    table = [];\n    offsets = [];\n    for (_i = 0, _len = mapping.length; _i < _len; _i++) {\n      id = mapping[_i];\n      glyph = glyphs[id];\n      offsets.push(table.length);\n      if (glyph) {\n        table = table.concat(glyph.encode(old2new));\n      }\n    }\n    offsets.push(table.length);\n    return {\n      table: table,\n      offsets: offsets\n    };\n  };\n  return GlyfTable;\n})(Table);\n\nvar SimpleGlyph = (function() {\n  /**************************************************************************/\n  /* function : SimpleGlyph                                                 */\n  /* comment : Stores raw, xMin, yMin, xMax, and yMax values for this glyph.*/\n  /**************************************************************************/\n  function SimpleGlyph(raw, numberOfContours, xMin, yMin, xMax, yMax) {\n    this.raw = raw;\n    this.numberOfContours = numberOfContours;\n    this.xMin = xMin;\n    this.yMin = yMin;\n    this.xMax = xMax;\n    this.yMax = yMax;\n    this.compound = false;\n  }\n  SimpleGlyph.prototype.encode = function() {\n    return this.raw.data;\n  };\n  return SimpleGlyph;\n})();\n\nvar CompoundGlyph = (function() {\n  var ARG_1_AND_2_ARE_WORDS,\n    MORE_COMPONENTS,\n    WE_HAVE_AN_X_AND_Y_SCALE,\n    WE_HAVE_A_SCALE,\n    WE_HAVE_A_TWO_BY_TWO,\n    WE_HAVE_INSTRUCTIONS;\n  ARG_1_AND_2_ARE_WORDS = 0x0001;\n  WE_HAVE_A_SCALE = 0x0008;\n  MORE_COMPONENTS = 0x0020;\n  WE_HAVE_AN_X_AND_Y_SCALE = 0x0040;\n  WE_HAVE_A_TWO_BY_TWO = 0x0080;\n  WE_HAVE_INSTRUCTIONS = 0x0100;\n\n  /********************************************************************************************************************/\n  /* function : CompoundGlypg generator                                                                               */\n  /* comment : It stores raw, xMin, yMin, xMax, yMax, glyph id, and glyph offset for the corresponding compound glyph.*/\n  /********************************************************************************************************************/\n  function CompoundGlyph(raw, xMin, yMin, xMax, yMax) {\n    var data, flags;\n    this.raw = raw;\n    this.xMin = xMin;\n    this.yMin = yMin;\n    this.xMax = xMax;\n    this.yMax = yMax;\n    this.compound = true;\n    this.glyphIDs = [];\n    this.glyphOffsets = [];\n    data = this.raw;\n    while (true) {\n      flags = data.readShort();\n      this.glyphOffsets.push(data.pos);\n      this.glyphIDs.push(data.readUInt16());\n      if (!(flags & MORE_COMPONENTS)) {\n        break;\n      }\n      if (flags & ARG_1_AND_2_ARE_WORDS) {\n        data.pos += 4;\n      } else {\n        data.pos += 2;\n      }\n      if (flags & WE_HAVE_A_TWO_BY_TWO) {\n        data.pos += 8;\n      } else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) {\n        data.pos += 4;\n      } else if (flags & WE_HAVE_A_SCALE) {\n        data.pos += 2;\n      }\n    }\n  }\n  /****************************************************************************************************************/\n  /* function : CompoundGlypg encode                                                                              */\n  /* comment : After creating a table for the characters you typed, you call directory.encode to encode the table.*/\n  /****************************************************************************************************************/\n  CompoundGlyph.prototype.encode = function() {\n    var i, result, _len, _ref;\n    result = new Data(__slice.call(this.raw.data));\n    _ref = this.glyphIDs;\n    for (i = 0, _len = _ref.length; i < _len; ++i) {\n      result.pos = this.glyphOffsets[i];\n    }\n    return result.data;\n  };\n  return CompoundGlyph;\n})();\n\nvar LocaTable = (function(_super) {\n  __extends(LocaTable, _super);\n\n  function LocaTable() {\n    return LocaTable.__super__.constructor.apply(this, arguments);\n  }\n  LocaTable.prototype.tag = \"loca\";\n  LocaTable.prototype.parse = function(data) {\n    var format, i;\n    data.pos = this.offset;\n    format = this.file.head.indexToLocFormat;\n    if (format === 0) {\n      return (this.offsets = function() {\n        var _ref, _results;\n        _results = [];\n        for (i = 0, _ref = this.length; i < _ref; i += 2) {\n          _results.push(data.readUInt16() * 2);\n        }\n        return _results;\n      }.call(this));\n    } else {\n      return (this.offsets = function() {\n        var _ref, _results;\n        _results = [];\n        for (i = 0, _ref = this.length; i < _ref; i += 4) {\n          _results.push(data.readUInt32());\n        }\n        return _results;\n      }.call(this));\n    }\n  };\n  LocaTable.prototype.indexOf = function(id) {\n    return this.offsets[id];\n  };\n  LocaTable.prototype.lengthOf = function(id) {\n    return this.offsets[id + 1] - this.offsets[id];\n  };\n  LocaTable.prototype.encode = function(offsets, activeGlyphs) {\n    var LocaTable = new Uint32Array(this.offsets.length);\n    var glyfPtr = 0;\n    var listGlyf = 0;\n    for (var k = 0; k < LocaTable.length; ++k) {\n      LocaTable[k] = glyfPtr;\n      if (listGlyf < activeGlyphs.length && activeGlyphs[listGlyf] == k) {\n        ++listGlyf;\n        LocaTable[k] = glyfPtr;\n        var start = this.offsets[k];\n        var len = this.offsets[k + 1] - start;\n        if (len > 0) {\n          glyfPtr += len;\n        }\n      }\n    }\n    var newLocaTable = new Array(LocaTable.length * 4);\n    for (var j = 0; j < LocaTable.length; ++j) {\n      newLocaTable[4 * j + 3] = LocaTable[j] & 0x000000ff;\n      newLocaTable[4 * j + 2] = (LocaTable[j] & 0x0000ff00) >> 8;\n      newLocaTable[4 * j + 1] = (LocaTable[j] & 0x00ff0000) >> 16;\n      newLocaTable[4 * j] = (LocaTable[j] & 0xff000000) >> 24;\n    }\n    return newLocaTable;\n  };\n  return LocaTable;\n})(Table);\n\n/************************************************************************************/\n/* function : invert                                                                */\n/* comment : Change the object's (key: value) to create an object with (value: key).*/\n/************************************************************************************/\nvar invert = function(object) {\n  var key, ret, val;\n  ret = {};\n  for (key in object) {\n    val = object[key];\n    ret[val] = key;\n  }\n  return ret;\n};\n\n/*var successorOf = function (input) {\n        var added, alphabet, carry, i, index, isUpperCase, last, length, next, result;\n        alphabet = 'abcdefghijklmnopqrstuvwxyz';\n        length = alphabet.length;\n        result = input;\n        i = input.length;\n        while (i >= 0) {\n            last = input.charAt(--i);\n            if (isNaN(last)) {\n                index = alphabet.indexOf(last.toLowerCase());\n                if (index === -1) {\n                    next = last;\n                    carry = true;\n                }\n                else {\n                    next = alphabet.charAt((index + 1) % length);\n                    isUpperCase = last === last.toUpperCase();\n                    if (isUpperCase) {\n                        next = next.toUpperCase();\n                    }\n                    carry = index + 1 >= length;\n                    if (carry && i === 0) {\n                        added = isUpperCase ? 'A' : 'a';\n                        result = added + next + result.slice(1);\n                        break;\n                    }\n                }\n            }\n            else {\n                next = +last + 1;\n                carry = next > 9;\n                if (carry) {\n                    next = 0;\n                }\n                if (carry && i === 0) {\n                    result = '1' + next + result.slice(1);\n                    break;\n                }\n            }\n            result = result.slice(0, i) + next + result.slice(i + 1);\n            if (!carry) {\n                break;\n            }\n        }\n        return result;\n    };*/\n\nvar Subset = (function() {\n  function Subset(font) {\n    this.font = font;\n    this.subset = {};\n    this.unicodes = {};\n    this.next = 33;\n  }\n  /*Subset.prototype.use = function (character) {\n            var i, _i, _ref;\n            if (typeof character === 'string') {\n                for (i = _i = 0, _ref = character.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {\n                    this.use(character.charCodeAt(i));\n                }\n                return;\n            }\n            if (!this.unicodes[character]) {\n                this.subset[this.next] = character;\n                return this.unicodes[character] = this.next++;\n            }\n        };*/\n  /*Subset.prototype.encodeText = function (text) {\n            var char, i, string, _i, _ref;\n            string = '';\n            for (i = _i = 0, _ref = text.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {\n                char = this.unicodes[text.charCodeAt(i)];\n                string += String.fromCharCode(char);\n            }\n            return string;\n        };*/\n  /***************************************************************/\n  /* function : generateCmap                                     */\n  /* comment : Returns the unicode cmap for this font.         */\n  /***************************************************************/\n  Subset.prototype.generateCmap = function() {\n    var mapping, roman, unicode, unicodeCmap, _ref;\n    unicodeCmap = this.font.cmap.tables[0].codeMap;\n    mapping = {};\n    _ref = this.subset;\n    for (roman in _ref) {\n      unicode = _ref[roman];\n      mapping[roman] = unicodeCmap[unicode];\n    }\n    return mapping;\n  };\n  /*Subset.prototype.glyphIDs = function () {\n            var ret, roman, unicode, unicodeCmap, val, _ref;\n            unicodeCmap = this.font.cmap.tables[0].codeMap;\n            ret = [0];\n            _ref = this.subset;\n            for (roman in _ref) {\n                unicode = _ref[roman];\n                val = unicodeCmap[unicode];\n                if ((val != null) && __indexOf.call(ret, val) < 0) {\n                    ret.push(val);\n                }\n            }\n            return ret.sort();\n        };*/\n  /******************************************************************/\n  /* function : glyphsFor                                           */\n  /* comment : Returns simple glyph objects for the input character.*/\n  /******************************************************************/\n  Subset.prototype.glyphsFor = function(glyphIDs) {\n    var additionalIDs, glyph, glyphs, id, _i, _len, _ref;\n    glyphs = {};\n    for (_i = 0, _len = glyphIDs.length; _i < _len; _i++) {\n      id = glyphIDs[_i];\n      glyphs[id] = this.font.glyf.glyphFor(id);\n    }\n    additionalIDs = [];\n    for (id in glyphs) {\n      glyph = glyphs[id];\n      if (glyph != null ? glyph.compound : void 0) {\n        additionalIDs.push.apply(additionalIDs, glyph.glyphIDs);\n      }\n    }\n    if (additionalIDs.length > 0) {\n      _ref = this.glyphsFor(additionalIDs);\n      for (id in _ref) {\n        glyph = _ref[id];\n        glyphs[id] = glyph;\n      }\n    }\n    return glyphs;\n  };\n  /***************************************************************/\n  /* function : encode                                           */\n  /* comment : Encode various tables for the characters you use. */\n  /***************************************************************/\n  Subset.prototype.encode = function(glyID, indexToLocFormat) {\n    var cmap,\n      code,\n      glyf,\n      glyphs,\n      id,\n      ids,\n      loca,\n      new2old,\n      newIDs,\n      nextGlyphID,\n      old2new,\n      oldID,\n      oldIDs,\n      tables,\n      _ref;\n    cmap = CmapTable.encode(this.generateCmap(), \"unicode\");\n    glyphs = this.glyphsFor(glyID);\n    old2new = {\n      0: 0\n    };\n    _ref = cmap.charMap;\n    for (code in _ref) {\n      ids = _ref[code];\n      old2new[ids.old] = ids[\"new\"];\n    }\n    nextGlyphID = cmap.maxGlyphID;\n    for (oldID in glyphs) {\n      if (!(oldID in old2new)) {\n        old2new[oldID] = nextGlyphID++;\n      }\n    }\n    new2old = invert(old2new);\n    newIDs = Object.keys(new2old).sort(function(a, b) {\n      return a - b;\n    });\n    oldIDs = (function() {\n      var _i, _len, _results;\n      _results = [];\n      for (_i = 0, _len = newIDs.length; _i < _len; _i++) {\n        id = newIDs[_i];\n        _results.push(new2old[id]);\n      }\n      return _results;\n    })();\n    glyf = this.font.glyf.encode(glyphs, oldIDs, old2new);\n    loca = this.font.loca.encode(glyf.offsets, oldIDs);\n    tables = {\n      cmap: this.font.cmap.raw(),\n      glyf: glyf.table,\n      loca: loca,\n      hmtx: this.font.hmtx.raw(),\n      hhea: this.font.hhea.raw(),\n      maxp: this.font.maxp.raw(),\n      post: this.font.post.raw(),\n      name: this.font.name.raw(),\n      head: this.font.head.encode(indexToLocFormat)\n    };\n    if (this.font.os2.exists) {\n      tables[\"OS/2\"] = this.font.os2.raw();\n    }\n    return this.font.directory.encode(tables);\n  };\n  return Subset;\n})();\n\njsPDF.API.PDFObject = (function() {\n  var pad;\n\n  function PDFObject() {}\n  pad = function(str, length) {\n    return (Array(length + 1).join(\"0\") + str).slice(-length);\n  };\n  /*****************************************************************************/\n  /* function : convert                                                        */\n  /* comment :Converts pdf tag's / FontBBox and array values in / W to strings */\n  /*****************************************************************************/\n  PDFObject.convert = function(object) {\n    var e, items, key, out, val;\n    if (Array.isArray(object)) {\n      items = (function() {\n        var _i, _len, _results;\n        _results = [];\n        for (_i = 0, _len = object.length; _i < _len; _i++) {\n          e = object[_i];\n          _results.push(PDFObject.convert(e));\n        }\n        return _results;\n      })().join(\" \");\n      return \"[\" + items + \"]\";\n    } else if (typeof object === \"string\") {\n      return \"/\" + object;\n    } else if (object != null ? object.isString : void 0) {\n      return \"(\" + object + \")\";\n    } else if (object instanceof Date) {\n      return (\n        \"(D:\" +\n        pad(object.getUTCFullYear(), 4) +\n        pad(object.getUTCMonth(), 2) +\n        pad(object.getUTCDate(), 2) +\n        pad(object.getUTCHours(), 2) +\n        pad(object.getUTCMinutes(), 2) +\n        pad(object.getUTCSeconds(), 2) +\n        \"Z)\"\n      );\n    } else if ({}.toString.call(object) === \"[object Object]\") {\n      out = [\"<<\"];\n      for (key in object) {\n        val = object[key];\n        out.push(\"/\" + key + \" \" + PDFObject.convert(val));\n      }\n      out.push(\">>\");\n      return out.join(\"\\n\");\n    } else {\n      return \"\" + object;\n    }\n  };\n  return PDFObject;\n})();\n","/*!\n    localForage -- Offline Storage, Improved\n    Version 1.10.0\n    https://localforage.github.io/localForage\n    (c) 2013-2017 Mozilla, Apache License 2.0\n*/\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.localforage = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw (f.code=\"MODULE_NOT_FOUND\", f)}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){\n(function (global){\n'use strict';\nvar Mutation = global.MutationObserver || global.WebKitMutationObserver;\n\nvar scheduleDrain;\n\n{\n  if (Mutation) {\n    var called = 0;\n    var observer = new Mutation(nextTick);\n    var element = global.document.createTextNode('');\n    observer.observe(element, {\n      characterData: true\n    });\n    scheduleDrain = function () {\n      element.data = (called = ++called % 2);\n    };\n  } else if (!global.setImmediate && typeof global.MessageChannel !== 'undefined') {\n    var channel = new global.MessageChannel();\n    channel.port1.onmessage = nextTick;\n    scheduleDrain = function () {\n      channel.port2.postMessage(0);\n    };\n  } else if ('document' in global && 'onreadystatechange' in global.document.createElement('script')) {\n    scheduleDrain = function () {\n\n      // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n      // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n      var scriptEl = global.document.createElement('script');\n      scriptEl.onreadystatechange = function () {\n        nextTick();\n\n        scriptEl.onreadystatechange = null;\n        scriptEl.parentNode.removeChild(scriptEl);\n        scriptEl = null;\n      };\n      global.document.documentElement.appendChild(scriptEl);\n    };\n  } else {\n    scheduleDrain = function () {\n      setTimeout(nextTick, 0);\n    };\n  }\n}\n\nvar draining;\nvar queue = [];\n//named nextTick for less confusing stack traces\nfunction nextTick() {\n  draining = true;\n  var i, oldQueue;\n  var len = queue.length;\n  while (len) {\n    oldQueue = queue;\n    queue = [];\n    i = -1;\n    while (++i < len) {\n      oldQueue[i]();\n    }\n    len = queue.length;\n  }\n  draining = false;\n}\n\nmodule.exports = immediate;\nfunction immediate(task) {\n  if (queue.push(task) === 1 && !draining) {\n    scheduleDrain();\n  }\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],2:[function(_dereq_,module,exports){\n'use strict';\nvar immediate = _dereq_(1);\n\n/* istanbul ignore next */\nfunction INTERNAL() {}\n\nvar handlers = {};\n\nvar REJECTED = ['REJECTED'];\nvar FULFILLED = ['FULFILLED'];\nvar PENDING = ['PENDING'];\n\nmodule.exports = Promise;\n\nfunction Promise(resolver) {\n  if (typeof resolver !== 'function') {\n    throw new TypeError('resolver must be a function');\n  }\n  this.state = PENDING;\n  this.queue = [];\n  this.outcome = void 0;\n  if (resolver !== INTERNAL) {\n    safelyResolveThenable(this, resolver);\n  }\n}\n\nPromise.prototype[\"catch\"] = function (onRejected) {\n  return this.then(null, onRejected);\n};\nPromise.prototype.then = function (onFulfilled, onRejected) {\n  if (typeof onFulfilled !== 'function' && this.state === FULFILLED ||\n    typeof onRejected !== 'function' && this.state === REJECTED) {\n    return this;\n  }\n  var promise = new this.constructor(INTERNAL);\n  if (this.state !== PENDING) {\n    var resolver = this.state === FULFILLED ? onFulfilled : onRejected;\n    unwrap(promise, resolver, this.outcome);\n  } else {\n    this.queue.push(new QueueItem(promise, onFulfilled, onRejected));\n  }\n\n  return promise;\n};\nfunction QueueItem(promise, onFulfilled, onRejected) {\n  this.promise = promise;\n  if (typeof onFulfilled === 'function') {\n    this.onFulfilled = onFulfilled;\n    this.callFulfilled = this.otherCallFulfilled;\n  }\n  if (typeof onRejected === 'function') {\n    this.onRejected = onRejected;\n    this.callRejected = this.otherCallRejected;\n  }\n}\nQueueItem.prototype.callFulfilled = function (value) {\n  handlers.resolve(this.promise, value);\n};\nQueueItem.prototype.otherCallFulfilled = function (value) {\n  unwrap(this.promise, this.onFulfilled, value);\n};\nQueueItem.prototype.callRejected = function (value) {\n  handlers.reject(this.promise, value);\n};\nQueueItem.prototype.otherCallRejected = function (value) {\n  unwrap(this.promise, this.onRejected, value);\n};\n\nfunction unwrap(promise, func, value) {\n  immediate(function () {\n    var returnValue;\n    try {\n      returnValue = func(value);\n    } catch (e) {\n      return handlers.reject(promise, e);\n    }\n    if (returnValue === promise) {\n      handlers.reject(promise, new TypeError('Cannot resolve promise with itself'));\n    } else {\n      handlers.resolve(promise, returnValue);\n    }\n  });\n}\n\nhandlers.resolve = function (self, value) {\n  var result = tryCatch(getThen, value);\n  if (result.status === 'error') {\n    return handlers.reject(self, result.value);\n  }\n  var thenable = result.value;\n\n  if (thenable) {\n    safelyResolveThenable(self, thenable);\n  } else {\n    self.state = FULFILLED;\n    self.outcome = value;\n    var i = -1;\n    var len = self.queue.length;\n    while (++i < len) {\n      self.queue[i].callFulfilled(value);\n    }\n  }\n  return self;\n};\nhandlers.reject = function (self, error) {\n  self.state = REJECTED;\n  self.outcome = error;\n  var i = -1;\n  var len = self.queue.length;\n  while (++i < len) {\n    self.queue[i].callRejected(error);\n  }\n  return self;\n};\n\nfunction getThen(obj) {\n  // Make sure we only access the accessor once as required by the spec\n  var then = obj && obj.then;\n  if (obj && (typeof obj === 'object' || typeof obj === 'function') && typeof then === 'function') {\n    return function appyThen() {\n      then.apply(obj, arguments);\n    };\n  }\n}\n\nfunction safelyResolveThenable(self, thenable) {\n  // Either fulfill, reject or reject with error\n  var called = false;\n  function onError(value) {\n    if (called) {\n      return;\n    }\n    called = true;\n    handlers.reject(self, value);\n  }\n\n  function onSuccess(value) {\n    if (called) {\n      return;\n    }\n    called = true;\n    handlers.resolve(self, value);\n  }\n\n  function tryToUnwrap() {\n    thenable(onSuccess, onError);\n  }\n\n  var result = tryCatch(tryToUnwrap);\n  if (result.status === 'error') {\n    onError(result.value);\n  }\n}\n\nfunction tryCatch(func, value) {\n  var out = {};\n  try {\n    out.value = func(value);\n    out.status = 'success';\n  } catch (e) {\n    out.status = 'error';\n    out.value = e;\n  }\n  return out;\n}\n\nPromise.resolve = resolve;\nfunction resolve(value) {\n  if (value instanceof this) {\n    return value;\n  }\n  return handlers.resolve(new this(INTERNAL), value);\n}\n\nPromise.reject = reject;\nfunction reject(reason) {\n  var promise = new this(INTERNAL);\n  return handlers.reject(promise, reason);\n}\n\nPromise.all = all;\nfunction all(iterable) {\n  var self = this;\n  if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n    return this.reject(new TypeError('must be an array'));\n  }\n\n  var len = iterable.length;\n  var called = false;\n  if (!len) {\n    return this.resolve([]);\n  }\n\n  var values = new Array(len);\n  var resolved = 0;\n  var i = -1;\n  var promise = new this(INTERNAL);\n\n  while (++i < len) {\n    allResolver(iterable[i], i);\n  }\n  return promise;\n  function allResolver(value, i) {\n    self.resolve(value).then(resolveFromAll, function (error) {\n      if (!called) {\n        called = true;\n        handlers.reject(promise, error);\n      }\n    });\n    function resolveFromAll(outValue) {\n      values[i] = outValue;\n      if (++resolved === len && !called) {\n        called = true;\n        handlers.resolve(promise, values);\n      }\n    }\n  }\n}\n\nPromise.race = race;\nfunction race(iterable) {\n  var self = this;\n  if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n    return this.reject(new TypeError('must be an array'));\n  }\n\n  var len = iterable.length;\n  var called = false;\n  if (!len) {\n    return this.resolve([]);\n  }\n\n  var i = -1;\n  var promise = new this(INTERNAL);\n\n  while (++i < len) {\n    resolver(iterable[i]);\n  }\n  return promise;\n  function resolver(value) {\n    self.resolve(value).then(function (response) {\n      if (!called) {\n        called = true;\n        handlers.resolve(promise, response);\n      }\n    }, function (error) {\n      if (!called) {\n        called = true;\n        handlers.reject(promise, error);\n      }\n    });\n  }\n}\n\n},{\"1\":1}],3:[function(_dereq_,module,exports){\n(function (global){\n'use strict';\nif (typeof global.Promise !== 'function') {\n  global.Promise = _dereq_(2);\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"2\":2}],4:[function(_dereq_,module,exports){\n'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction getIDB() {\n    /* global indexedDB,webkitIndexedDB,mozIndexedDB,OIndexedDB,msIndexedDB */\n    try {\n        if (typeof indexedDB !== 'undefined') {\n            return indexedDB;\n        }\n        if (typeof webkitIndexedDB !== 'undefined') {\n            return webkitIndexedDB;\n        }\n        if (typeof mozIndexedDB !== 'undefined') {\n            return mozIndexedDB;\n        }\n        if (typeof OIndexedDB !== 'undefined') {\n            return OIndexedDB;\n        }\n        if (typeof msIndexedDB !== 'undefined') {\n            return msIndexedDB;\n        }\n    } catch (e) {\n        return;\n    }\n}\n\nvar idb = getIDB();\n\nfunction isIndexedDBValid() {\n    try {\n        // Initialize IndexedDB; fall back to vendor-prefixed versions\n        // if needed.\n        if (!idb || !idb.open) {\n            return false;\n        }\n        // We mimic PouchDB here;\n        //\n        // We test for openDatabase because IE Mobile identifies itself\n        // as Safari. Oh the lulz...\n        var isSafari = typeof openDatabase !== 'undefined' && /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) && !/BlackBerry/.test(navigator.platform);\n\n        var hasFetch = typeof fetch === 'function' && fetch.toString().indexOf('[native code') !== -1;\n\n        // Safari <10.1 does not meet our requirements for IDB support\n        // (see: https://github.com/pouchdb/pouchdb/issues/5572).\n        // Safari 10.1 shipped with fetch, we can use that to detect it.\n        // Note: this creates issues with `window.fetch` polyfills and\n        // overrides; see:\n        // https://github.com/localForage/localForage/issues/856\n        return (!isSafari || hasFetch) && typeof indexedDB !== 'undefined' &&\n        // some outdated implementations of IDB that appear on Samsung\n        // and HTC Android devices <4.4 are missing IDBKeyRange\n        // See: https://github.com/mozilla/localForage/issues/128\n        // See: https://github.com/mozilla/localForage/issues/272\n        typeof IDBKeyRange !== 'undefined';\n    } catch (e) {\n        return false;\n    }\n}\n\n// Abstracts constructing a Blob object, so it also works in older\n// browsers that don't support the native Blob constructor. (i.e.\n// old QtWebKit versions, at least).\n// Abstracts constructing a Blob object, so it also works in older\n// browsers that don't support the native Blob constructor. (i.e.\n// old QtWebKit versions, at least).\nfunction createBlob(parts, properties) {\n    /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */\n    parts = parts || [];\n    properties = properties || {};\n    try {\n        return new Blob(parts, properties);\n    } catch (e) {\n        if (e.name !== 'TypeError') {\n            throw e;\n        }\n        var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder : typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder : typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : WebKitBlobBuilder;\n        var builder = new Builder();\n        for (var i = 0; i < parts.length; i += 1) {\n            builder.append(parts[i]);\n        }\n        return builder.getBlob(properties.type);\n    }\n}\n\n// This is CommonJS because lie is an external dependency, so Rollup\n// can just ignore it.\nif (typeof Promise === 'undefined') {\n    // In the \"nopromises\" build this will just throw if you don't have\n    // a global promise object, but it would throw anyway later.\n    _dereq_(3);\n}\nvar Promise$1 = Promise;\n\nfunction executeCallback(promise, callback) {\n    if (callback) {\n        promise.then(function (result) {\n            callback(null, result);\n        }, function (error) {\n            callback(error);\n        });\n    }\n}\n\nfunction executeTwoCallbacks(promise, callback, errorCallback) {\n    if (typeof callback === 'function') {\n        promise.then(callback);\n    }\n\n    if (typeof errorCallback === 'function') {\n        promise[\"catch\"](errorCallback);\n    }\n}\n\nfunction normalizeKey(key) {\n    // Cast the key to a string, as that's all we can set as a key.\n    if (typeof key !== 'string') {\n        console.warn(key + ' used as a key, but it is not a string.');\n        key = String(key);\n    }\n\n    return key;\n}\n\nfunction getCallback() {\n    if (arguments.length && typeof arguments[arguments.length - 1] === 'function') {\n        return arguments[arguments.length - 1];\n    }\n}\n\n// Some code originally from async_storage.js in\n// [Gaia](https://github.com/mozilla-b2g/gaia).\n\nvar DETECT_BLOB_SUPPORT_STORE = 'local-forage-detect-blob-support';\nvar supportsBlobs = void 0;\nvar dbContexts = {};\nvar toString = Object.prototype.toString;\n\n// Transaction Modes\nvar READ_ONLY = 'readonly';\nvar READ_WRITE = 'readwrite';\n\n// Transform a binary string to an array buffer, because otherwise\n// weird stuff happens when you try to work with the binary string directly.\n// It is known.\n// From http://stackoverflow.com/questions/14967647/ (continues on next line)\n// encode-decode-image-with-base64-breaks-image (2013-04-21)\nfunction _binStringToArrayBuffer(bin) {\n    var length = bin.length;\n    var buf = new ArrayBuffer(length);\n    var arr = new Uint8Array(buf);\n    for (var i = 0; i < length; i++) {\n        arr[i] = bin.charCodeAt(i);\n    }\n    return buf;\n}\n\n//\n// Blobs are not supported in all versions of IndexedDB, notably\n// Chrome <37 and Android <5. In those versions, storing a blob will throw.\n//\n// Various other blob bugs exist in Chrome v37-42 (inclusive).\n// Detecting them is expensive and confusing to users, and Chrome 37-42\n// is at very low usage worldwide, so we do a hacky userAgent check instead.\n//\n// content-type bug: https://code.google.com/p/chromium/issues/detail?id=408120\n// 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916\n// FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836\n//\n// Code borrowed from PouchDB. See:\n// https://github.com/pouchdb/pouchdb/blob/master/packages/node_modules/pouchdb-adapter-idb/src/blobSupport.js\n//\nfunction _checkBlobSupportWithoutCaching(idb) {\n    return new Promise$1(function (resolve) {\n        var txn = idb.transaction(DETECT_BLOB_SUPPORT_STORE, READ_WRITE);\n        var blob = createBlob(['']);\n        txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob, 'key');\n\n        txn.onabort = function (e) {\n            // If the transaction aborts now its due to not being able to\n            // write to the database, likely due to the disk being full\n            e.preventDefault();\n            e.stopPropagation();\n            resolve(false);\n        };\n\n        txn.oncomplete = function () {\n            var matchedChrome = navigator.userAgent.match(/Chrome\\/(\\d+)/);\n            var matchedEdge = navigator.userAgent.match(/Edge\\//);\n            // MS Edge pretends to be Chrome 42:\n            // https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx\n            resolve(matchedEdge || !matchedChrome || parseInt(matchedChrome[1], 10) >= 43);\n        };\n    })[\"catch\"](function () {\n        return false; // error, so assume unsupported\n    });\n}\n\nfunction _checkBlobSupport(idb) {\n    if (typeof supportsBlobs === 'boolean') {\n        return Promise$1.resolve(supportsBlobs);\n    }\n    return _checkBlobSupportWithoutCaching(idb).then(function (value) {\n        supportsBlobs = value;\n        return supportsBlobs;\n    });\n}\n\nfunction _deferReadiness(dbInfo) {\n    var dbContext = dbContexts[dbInfo.name];\n\n    // Create a deferred object representing the current database operation.\n    var deferredOperation = {};\n\n    deferredOperation.promise = new Promise$1(function (resolve, reject) {\n        deferredOperation.resolve = resolve;\n        deferredOperation.reject = reject;\n    });\n\n    // Enqueue the deferred operation.\n    dbContext.deferredOperations.push(deferredOperation);\n\n    // Chain its promise to the database readiness.\n    if (!dbContext.dbReady) {\n        dbContext.dbReady = deferredOperation.promise;\n    } else {\n        dbContext.dbReady = dbContext.dbReady.then(function () {\n            return deferredOperation.promise;\n        });\n    }\n}\n\nfunction _advanceReadiness(dbInfo) {\n    var dbContext = dbContexts[dbInfo.name];\n\n    // Dequeue a deferred operation.\n    var deferredOperation = dbContext.deferredOperations.pop();\n\n    // Resolve its promise (which is part of the database readiness\n    // chain of promises).\n    if (deferredOperation) {\n        deferredOperation.resolve();\n        return deferredOperation.promise;\n    }\n}\n\nfunction _rejectReadiness(dbInfo, err) {\n    var dbContext = dbContexts[dbInfo.name];\n\n    // Dequeue a deferred operation.\n    var deferredOperation = dbContext.deferredOperations.pop();\n\n    // Reject its promise (which is part of the database readiness\n    // chain of promises).\n    if (deferredOperation) {\n        deferredOperation.reject(err);\n        return deferredOperation.promise;\n    }\n}\n\nfunction _getConnection(dbInfo, upgradeNeeded) {\n    return new Promise$1(function (resolve, reject) {\n        dbContexts[dbInfo.name] = dbContexts[dbInfo.name] || createDbContext();\n\n        if (dbInfo.db) {\n            if (upgradeNeeded) {\n                _deferReadiness(dbInfo);\n                dbInfo.db.close();\n            } else {\n                return resolve(dbInfo.db);\n            }\n        }\n\n        var dbArgs = [dbInfo.name];\n\n        if (upgradeNeeded) {\n            dbArgs.push(dbInfo.version);\n        }\n\n        var openreq = idb.open.apply(idb, dbArgs);\n\n        if (upgradeNeeded) {\n            openreq.onupgradeneeded = function (e) {\n                var db = openreq.result;\n                try {\n                    db.createObjectStore(dbInfo.storeName);\n                    if (e.oldVersion <= 1) {\n                        // Added when support for blob shims was added\n                        db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n                    }\n                } catch (ex) {\n                    if (ex.name === 'ConstraintError') {\n                        console.warn('The database \"' + dbInfo.name + '\"' + ' has been upgraded from version ' + e.oldVersion + ' to version ' + e.newVersion + ', but the storage \"' + dbInfo.storeName + '\" already exists.');\n                    } else {\n                        throw ex;\n                    }\n                }\n            };\n        }\n\n        openreq.onerror = function (e) {\n            e.preventDefault();\n            reject(openreq.error);\n        };\n\n        openreq.onsuccess = function () {\n            var db = openreq.result;\n            db.onversionchange = function (e) {\n                // Triggered when the database is modified (e.g. adding an objectStore) or\n                // deleted (even when initiated by other sessions in different tabs).\n                // Closing the connection here prevents those operations from being blocked.\n                // If the database is accessed again later by this instance, the connection\n                // will be reopened or the database recreated as needed.\n                e.target.close();\n            };\n            resolve(db);\n            _advanceReadiness(dbInfo);\n        };\n    });\n}\n\nfunction _getOriginalConnection(dbInfo) {\n    return _getConnection(dbInfo, false);\n}\n\nfunction _getUpgradedConnection(dbInfo) {\n    return _getConnection(dbInfo, true);\n}\n\nfunction _isUpgradeNeeded(dbInfo, defaultVersion) {\n    if (!dbInfo.db) {\n        return true;\n    }\n\n    var isNewStore = !dbInfo.db.objectStoreNames.contains(dbInfo.storeName);\n    var isDowngrade = dbInfo.version < dbInfo.db.version;\n    var isUpgrade = dbInfo.version > dbInfo.db.version;\n\n    if (isDowngrade) {\n        // If the version is not the default one\n        // then warn for impossible downgrade.\n        if (dbInfo.version !== defaultVersion) {\n            console.warn('The database \"' + dbInfo.name + '\"' + \" can't be downgraded from version \" + dbInfo.db.version + ' to version ' + dbInfo.version + '.');\n        }\n        // Align the versions to prevent errors.\n        dbInfo.version = dbInfo.db.version;\n    }\n\n    if (isUpgrade || isNewStore) {\n        // If the store is new then increment the version (if needed).\n        // This will trigger an \"upgradeneeded\" event which is required\n        // for creating a store.\n        if (isNewStore) {\n            var incVersion = dbInfo.db.version + 1;\n            if (incVersion > dbInfo.version) {\n                dbInfo.version = incVersion;\n            }\n        }\n\n        return true;\n    }\n\n    return false;\n}\n\n// encode a blob for indexeddb engines that don't support blobs\nfunction _encodeBlob(blob) {\n    return new Promise$1(function (resolve, reject) {\n        var reader = new FileReader();\n        reader.onerror = reject;\n        reader.onloadend = function (e) {\n            var base64 = btoa(e.target.result || '');\n            resolve({\n                __local_forage_encoded_blob: true,\n                data: base64,\n                type: blob.type\n            });\n        };\n        reader.readAsBinaryString(blob);\n    });\n}\n\n// decode an encoded blob\nfunction _decodeBlob(encodedBlob) {\n    var arrayBuff = _binStringToArrayBuffer(atob(encodedBlob.data));\n    return createBlob([arrayBuff], { type: encodedBlob.type });\n}\n\n// is this one of our fancy encoded blobs?\nfunction _isEncodedBlob(value) {\n    return value && value.__local_forage_encoded_blob;\n}\n\n// Specialize the default `ready()` function by making it dependent\n// on the current database operations. Thus, the driver will be actually\n// ready when it's been initialized (default) *and* there are no pending\n// operations on the database (initiated by some other instances).\nfunction _fullyReady(callback) {\n    var self = this;\n\n    var promise = self._initReady().then(function () {\n        var dbContext = dbContexts[self._dbInfo.name];\n\n        if (dbContext && dbContext.dbReady) {\n            return dbContext.dbReady;\n        }\n    });\n\n    executeTwoCallbacks(promise, callback, callback);\n    return promise;\n}\n\n// Try to establish a new db connection to replace the\n// current one which is broken (i.e. experiencing\n// InvalidStateError while creating a transaction).\nfunction _tryReconnect(dbInfo) {\n    _deferReadiness(dbInfo);\n\n    var dbContext = dbContexts[dbInfo.name];\n    var forages = dbContext.forages;\n\n    for (var i = 0; i < forages.length; i++) {\n        var forage = forages[i];\n        if (forage._dbInfo.db) {\n            forage._dbInfo.db.close();\n            forage._dbInfo.db = null;\n        }\n    }\n    dbInfo.db = null;\n\n    return _getOriginalConnection(dbInfo).then(function (db) {\n        dbInfo.db = db;\n        if (_isUpgradeNeeded(dbInfo)) {\n            // Reopen the database for upgrading.\n            return _getUpgradedConnection(dbInfo);\n        }\n        return db;\n    }).then(function (db) {\n        // store the latest db reference\n        // in case the db was upgraded\n        dbInfo.db = dbContext.db = db;\n        for (var i = 0; i < forages.length; i++) {\n            forages[i]._dbInfo.db = db;\n        }\n    })[\"catch\"](function (err) {\n        _rejectReadiness(dbInfo, err);\n        throw err;\n    });\n}\n\n// FF doesn't like Promises (micro-tasks) and IDDB store operations,\n// so we have to do it with callbacks\nfunction createTransaction(dbInfo, mode, callback, retries) {\n    if (retries === undefined) {\n        retries = 1;\n    }\n\n    try {\n        var tx = dbInfo.db.transaction(dbInfo.storeName, mode);\n        callback(null, tx);\n    } catch (err) {\n        if (retries > 0 && (!dbInfo.db || err.name === 'InvalidStateError' || err.name === 'NotFoundError')) {\n            return Promise$1.resolve().then(function () {\n                if (!dbInfo.db || err.name === 'NotFoundError' && !dbInfo.db.objectStoreNames.contains(dbInfo.storeName) && dbInfo.version <= dbInfo.db.version) {\n                    // increase the db version, to create the new ObjectStore\n                    if (dbInfo.db) {\n                        dbInfo.version = dbInfo.db.version + 1;\n                    }\n                    // Reopen the database for upgrading.\n                    return _getUpgradedConnection(dbInfo);\n                }\n            }).then(function () {\n                return _tryReconnect(dbInfo).then(function () {\n                    createTransaction(dbInfo, mode, callback, retries - 1);\n                });\n            })[\"catch\"](callback);\n        }\n\n        callback(err);\n    }\n}\n\nfunction createDbContext() {\n    return {\n        // Running localForages sharing a database.\n        forages: [],\n        // Shared database.\n        db: null,\n        // Database readiness (promise).\n        dbReady: null,\n        // Deferred operations on the database.\n        deferredOperations: []\n    };\n}\n\n// Open the IndexedDB database (automatically creates one if one didn't\n// previously exist), using any options set in the config.\nfunction _initStorage(options) {\n    var self = this;\n    var dbInfo = {\n        db: null\n    };\n\n    if (options) {\n        for (var i in options) {\n            dbInfo[i] = options[i];\n        }\n    }\n\n    // Get the current context of the database;\n    var dbContext = dbContexts[dbInfo.name];\n\n    // ...or create a new context.\n    if (!dbContext) {\n        dbContext = createDbContext();\n        // Register the new context in the global container.\n        dbContexts[dbInfo.name] = dbContext;\n    }\n\n    // Register itself as a running localForage in the current context.\n    dbContext.forages.push(self);\n\n    // Replace the default `ready()` function with the specialized one.\n    if (!self._initReady) {\n        self._initReady = self.ready;\n        self.ready = _fullyReady;\n    }\n\n    // Create an array of initialization states of the related localForages.\n    var initPromises = [];\n\n    function ignoreErrors() {\n        // Don't handle errors here,\n        // just makes sure related localForages aren't pending.\n        return Promise$1.resolve();\n    }\n\n    for (var j = 0; j < dbContext.forages.length; j++) {\n        var forage = dbContext.forages[j];\n        if (forage !== self) {\n            // Don't wait for itself...\n            initPromises.push(forage._initReady()[\"catch\"](ignoreErrors));\n        }\n    }\n\n    // Take a snapshot of the related localForages.\n    var forages = dbContext.forages.slice(0);\n\n    // Initialize the connection process only when\n    // all the related localForages aren't pending.\n    return Promise$1.all(initPromises).then(function () {\n        dbInfo.db = dbContext.db;\n        // Get the connection or open a new one without upgrade.\n        return _getOriginalConnection(dbInfo);\n    }).then(function (db) {\n        dbInfo.db = db;\n        if (_isUpgradeNeeded(dbInfo, self._defaultConfig.version)) {\n            // Reopen the database for upgrading.\n            return _getUpgradedConnection(dbInfo);\n        }\n        return db;\n    }).then(function (db) {\n        dbInfo.db = dbContext.db = db;\n        self._dbInfo = dbInfo;\n        // Share the final connection amongst related localForages.\n        for (var k = 0; k < forages.length; k++) {\n            var forage = forages[k];\n            if (forage !== self) {\n                // Self is already up-to-date.\n                forage._dbInfo.db = dbInfo.db;\n                forage._dbInfo.version = dbInfo.version;\n            }\n        }\n    });\n}\n\nfunction getItem(key, callback) {\n    var self = this;\n\n    key = normalizeKey(key);\n\n    var promise = new Promise$1(function (resolve, reject) {\n        self.ready().then(function () {\n            createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n                if (err) {\n                    return reject(err);\n                }\n\n                try {\n                    var store = transaction.objectStore(self._dbInfo.storeName);\n                    var req = store.get(key);\n\n                    req.onsuccess = function () {\n                        var value = req.result;\n                        if (value === undefined) {\n                            value = null;\n                        }\n                        if (_isEncodedBlob(value)) {\n                            value = _decodeBlob(value);\n                        }\n                        resolve(value);\n                    };\n\n                    req.onerror = function () {\n                        reject(req.error);\n                    };\n                } catch (e) {\n                    reject(e);\n                }\n            });\n        })[\"catch\"](reject);\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\n// Iterate over all items stored in database.\nfunction iterate(iterator, callback) {\n    var self = this;\n\n    var promise = new Promise$1(function (resolve, reject) {\n        self.ready().then(function () {\n            createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n                if (err) {\n                    return reject(err);\n                }\n\n                try {\n                    var store = transaction.objectStore(self._dbInfo.storeName);\n                    var req = store.openCursor();\n                    var iterationNumber = 1;\n\n                    req.onsuccess = function () {\n                        var cursor = req.result;\n\n                        if (cursor) {\n                            var value = cursor.value;\n                            if (_isEncodedBlob(value)) {\n                                value = _decodeBlob(value);\n                            }\n                            var result = iterator(value, cursor.key, iterationNumber++);\n\n                            // when the iterator callback returns any\n                            // (non-`undefined`) value, then we stop\n                            // the iteration immediately\n                            if (result !== void 0) {\n                                resolve(result);\n                            } else {\n                                cursor[\"continue\"]();\n                            }\n                        } else {\n                            resolve();\n                        }\n                    };\n\n                    req.onerror = function () {\n                        reject(req.error);\n                    };\n                } catch (e) {\n                    reject(e);\n                }\n            });\n        })[\"catch\"](reject);\n    });\n\n    executeCallback(promise, callback);\n\n    return promise;\n}\n\nfunction setItem(key, value, callback) {\n    var self = this;\n\n    key = normalizeKey(key);\n\n    var promise = new Promise$1(function (resolve, reject) {\n        var dbInfo;\n        self.ready().then(function () {\n            dbInfo = self._dbInfo;\n            if (toString.call(value) === '[object Blob]') {\n                return _checkBlobSupport(dbInfo.db).then(function (blobSupport) {\n                    if (blobSupport) {\n                        return value;\n                    }\n                    return _encodeBlob(value);\n                });\n            }\n            return value;\n        }).then(function (value) {\n            createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n                if (err) {\n                    return reject(err);\n                }\n\n                try {\n                    var store = transaction.objectStore(self._dbInfo.storeName);\n\n                    // The reason we don't _save_ null is because IE 10 does\n                    // not support saving the `null` type in IndexedDB. How\n                    // ironic, given the bug below!\n                    // See: https://github.com/mozilla/localForage/issues/161\n                    if (value === null) {\n                        value = undefined;\n                    }\n\n                    var req = store.put(value, key);\n\n                    transaction.oncomplete = function () {\n                        // Cast to undefined so the value passed to\n                        // callback/promise is the same as what one would get out\n                        // of `getItem()` later. This leads to some weirdness\n                        // (setItem('foo', undefined) will return `null`), but\n                        // it's not my fault localStorage is our baseline and that\n                        // it's weird.\n                        if (value === undefined) {\n                            value = null;\n                        }\n\n                        resolve(value);\n                    };\n                    transaction.onabort = transaction.onerror = function () {\n                        var err = req.error ? req.error : req.transaction.error;\n                        reject(err);\n                    };\n                } catch (e) {\n                    reject(e);\n                }\n            });\n        })[\"catch\"](reject);\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\nfunction removeItem(key, callback) {\n    var self = this;\n\n    key = normalizeKey(key);\n\n    var promise = new Promise$1(function (resolve, reject) {\n        self.ready().then(function () {\n            createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n                if (err) {\n                    return reject(err);\n                }\n\n                try {\n                    var store = transaction.objectStore(self._dbInfo.storeName);\n                    // We use a Grunt task to make this safe for IE and some\n                    // versions of Android (including those used by Cordova).\n                    // Normally IE won't like `.delete()` and will insist on\n                    // using `['delete']()`, but we have a build step that\n                    // fixes this for us now.\n                    var req = store[\"delete\"](key);\n                    transaction.oncomplete = function () {\n                        resolve();\n                    };\n\n                    transaction.onerror = function () {\n                        reject(req.error);\n                    };\n\n                    // The request will be also be aborted if we've exceeded our storage\n                    // space.\n                    transaction.onabort = function () {\n                        var err = req.error ? req.error : req.transaction.error;\n                        reject(err);\n                    };\n                } catch (e) {\n                    reject(e);\n                }\n            });\n        })[\"catch\"](reject);\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\nfunction clear(callback) {\n    var self = this;\n\n    var promise = new Promise$1(function (resolve, reject) {\n        self.ready().then(function () {\n            createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n                if (err) {\n                    return reject(err);\n                }\n\n                try {\n                    var store = transaction.objectStore(self._dbInfo.storeName);\n                    var req = store.clear();\n\n                    transaction.oncomplete = function () {\n                        resolve();\n                    };\n\n                    transaction.onabort = transaction.onerror = function () {\n                        var err = req.error ? req.error : req.transaction.error;\n                        reject(err);\n                    };\n                } catch (e) {\n                    reject(e);\n                }\n            });\n        })[\"catch\"](reject);\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\nfunction length(callback) {\n    var self = this;\n\n    var promise = new Promise$1(function (resolve, reject) {\n        self.ready().then(function () {\n            createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n                if (err) {\n                    return reject(err);\n                }\n\n                try {\n                    var store = transaction.objectStore(self._dbInfo.storeName);\n                    var req = store.count();\n\n                    req.onsuccess = function () {\n                        resolve(req.result);\n                    };\n\n                    req.onerror = function () {\n                        reject(req.error);\n                    };\n                } catch (e) {\n                    reject(e);\n                }\n            });\n        })[\"catch\"](reject);\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\nfunction key(n, callback) {\n    var self = this;\n\n    var promise = new Promise$1(function (resolve, reject) {\n        if (n < 0) {\n            resolve(null);\n\n            return;\n        }\n\n        self.ready().then(function () {\n            createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n                if (err) {\n                    return reject(err);\n                }\n\n                try {\n                    var store = transaction.objectStore(self._dbInfo.storeName);\n                    var advanced = false;\n                    var req = store.openKeyCursor();\n\n                    req.onsuccess = function () {\n                        var cursor = req.result;\n                        if (!cursor) {\n                            // this means there weren't enough keys\n                            resolve(null);\n\n                            return;\n                        }\n\n                        if (n === 0) {\n                            // We have the first key, return it if that's what they\n                            // wanted.\n                            resolve(cursor.key);\n                        } else {\n                            if (!advanced) {\n                                // Otherwise, ask the cursor to skip ahead n\n                                // records.\n                                advanced = true;\n                                cursor.advance(n);\n                            } else {\n                                // When we get here, we've got the nth key.\n                                resolve(cursor.key);\n                            }\n                        }\n                    };\n\n                    req.onerror = function () {\n                        reject(req.error);\n                    };\n                } catch (e) {\n                    reject(e);\n                }\n            });\n        })[\"catch\"](reject);\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\nfunction keys(callback) {\n    var self = this;\n\n    var promise = new Promise$1(function (resolve, reject) {\n        self.ready().then(function () {\n            createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n                if (err) {\n                    return reject(err);\n                }\n\n                try {\n                    var store = transaction.objectStore(self._dbInfo.storeName);\n                    var req = store.openKeyCursor();\n                    var keys = [];\n\n                    req.onsuccess = function () {\n                        var cursor = req.result;\n\n                        if (!cursor) {\n                            resolve(keys);\n                            return;\n                        }\n\n                        keys.push(cursor.key);\n                        cursor[\"continue\"]();\n                    };\n\n                    req.onerror = function () {\n                        reject(req.error);\n                    };\n                } catch (e) {\n                    reject(e);\n                }\n            });\n        })[\"catch\"](reject);\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\nfunction dropInstance(options, callback) {\n    callback = getCallback.apply(this, arguments);\n\n    var currentConfig = this.config();\n    options = typeof options !== 'function' && options || {};\n    if (!options.name) {\n        options.name = options.name || currentConfig.name;\n        options.storeName = options.storeName || currentConfig.storeName;\n    }\n\n    var self = this;\n    var promise;\n    if (!options.name) {\n        promise = Promise$1.reject('Invalid arguments');\n    } else {\n        var isCurrentDb = options.name === currentConfig.name && self._dbInfo.db;\n\n        var dbPromise = isCurrentDb ? Promise$1.resolve(self._dbInfo.db) : _getOriginalConnection(options).then(function (db) {\n            var dbContext = dbContexts[options.name];\n            var forages = dbContext.forages;\n            dbContext.db = db;\n            for (var i = 0; i < forages.length; i++) {\n                forages[i]._dbInfo.db = db;\n            }\n            return db;\n        });\n\n        if (!options.storeName) {\n            promise = dbPromise.then(function (db) {\n                _deferReadiness(options);\n\n                var dbContext = dbContexts[options.name];\n                var forages = dbContext.forages;\n\n                db.close();\n                for (var i = 0; i < forages.length; i++) {\n                    var forage = forages[i];\n                    forage._dbInfo.db = null;\n                }\n\n                var dropDBPromise = new Promise$1(function (resolve, reject) {\n                    var req = idb.deleteDatabase(options.name);\n\n                    req.onerror = function () {\n                        var db = req.result;\n                        if (db) {\n                            db.close();\n                        }\n                        reject(req.error);\n                    };\n\n                    req.onblocked = function () {\n                        // Closing all open connections in onversionchange handler should prevent this situation, but if\n                        // we do get here, it just means the request remains pending - eventually it will succeed or error\n                        console.warn('dropInstance blocked for database \"' + options.name + '\" until all open connections are closed');\n                    };\n\n                    req.onsuccess = function () {\n                        var db = req.result;\n                        if (db) {\n                            db.close();\n                        }\n                        resolve(db);\n                    };\n                });\n\n                return dropDBPromise.then(function (db) {\n                    dbContext.db = db;\n                    for (var i = 0; i < forages.length; i++) {\n                        var _forage = forages[i];\n                        _advanceReadiness(_forage._dbInfo);\n                    }\n                })[\"catch\"](function (err) {\n                    (_rejectReadiness(options, err) || Promise$1.resolve())[\"catch\"](function () {});\n                    throw err;\n                });\n            });\n        } else {\n            promise = dbPromise.then(function (db) {\n                if (!db.objectStoreNames.contains(options.storeName)) {\n                    return;\n                }\n\n                var newVersion = db.version + 1;\n\n                _deferReadiness(options);\n\n                var dbContext = dbContexts[options.name];\n                var forages = dbContext.forages;\n\n                db.close();\n                for (var i = 0; i < forages.length; i++) {\n                    var forage = forages[i];\n                    forage._dbInfo.db = null;\n                    forage._dbInfo.version = newVersion;\n                }\n\n                var dropObjectPromise = new Promise$1(function (resolve, reject) {\n                    var req = idb.open(options.name, newVersion);\n\n                    req.onerror = function (err) {\n                        var db = req.result;\n                        db.close();\n                        reject(err);\n                    };\n\n                    req.onupgradeneeded = function () {\n                        var db = req.result;\n                        db.deleteObjectStore(options.storeName);\n                    };\n\n                    req.onsuccess = function () {\n                        var db = req.result;\n                        db.close();\n                        resolve(db);\n                    };\n                });\n\n                return dropObjectPromise.then(function (db) {\n                    dbContext.db = db;\n                    for (var j = 0; j < forages.length; j++) {\n                        var _forage2 = forages[j];\n                        _forage2._dbInfo.db = db;\n                        _advanceReadiness(_forage2._dbInfo);\n                    }\n                })[\"catch\"](function (err) {\n                    (_rejectReadiness(options, err) || Promise$1.resolve())[\"catch\"](function () {});\n                    throw err;\n                });\n            });\n        }\n    }\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\nvar asyncStorage = {\n    _driver: 'asyncStorage',\n    _initStorage: _initStorage,\n    _support: isIndexedDBValid(),\n    iterate: iterate,\n    getItem: getItem,\n    setItem: setItem,\n    removeItem: removeItem,\n    clear: clear,\n    length: length,\n    key: key,\n    keys: keys,\n    dropInstance: dropInstance\n};\n\nfunction isWebSQLValid() {\n    return typeof openDatabase === 'function';\n}\n\n// Sadly, the best way to save binary data in WebSQL/localStorage is serializing\n// it to Base64, so this is how we store it to prevent very strange errors with less\n// verbose ways of binary <-> string data storage.\nvar BASE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\nvar BLOB_TYPE_PREFIX = '~~local_forage_type~';\nvar BLOB_TYPE_PREFIX_REGEX = /^~~local_forage_type~([^~]+)~/;\n\nvar SERIALIZED_MARKER = '__lfsc__:';\nvar SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER.length;\n\n// OMG the serializations!\nvar TYPE_ARRAYBUFFER = 'arbf';\nvar TYPE_BLOB = 'blob';\nvar TYPE_INT8ARRAY = 'si08';\nvar TYPE_UINT8ARRAY = 'ui08';\nvar TYPE_UINT8CLAMPEDARRAY = 'uic8';\nvar TYPE_INT16ARRAY = 'si16';\nvar TYPE_INT32ARRAY = 'si32';\nvar TYPE_UINT16ARRAY = 'ur16';\nvar TYPE_UINT32ARRAY = 'ui32';\nvar TYPE_FLOAT32ARRAY = 'fl32';\nvar TYPE_FLOAT64ARRAY = 'fl64';\nvar TYPE_SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER_LENGTH + TYPE_ARRAYBUFFER.length;\n\nvar toString$1 = Object.prototype.toString;\n\nfunction stringToBuffer(serializedString) {\n    // Fill the string into a ArrayBuffer.\n    var bufferLength = serializedString.length * 0.75;\n    var len = serializedString.length;\n    var i;\n    var p = 0;\n    var encoded1, encoded2, encoded3, encoded4;\n\n    if (serializedString[serializedString.length - 1] === '=') {\n        bufferLength--;\n        if (serializedString[serializedString.length - 2] === '=') {\n            bufferLength--;\n        }\n    }\n\n    var buffer = new ArrayBuffer(bufferLength);\n    var bytes = new Uint8Array(buffer);\n\n    for (i = 0; i < len; i += 4) {\n        encoded1 = BASE_CHARS.indexOf(serializedString[i]);\n        encoded2 = BASE_CHARS.indexOf(serializedString[i + 1]);\n        encoded3 = BASE_CHARS.indexOf(serializedString[i + 2]);\n        encoded4 = BASE_CHARS.indexOf(serializedString[i + 3]);\n\n        /*jslint bitwise: true */\n        bytes[p++] = encoded1 << 2 | encoded2 >> 4;\n        bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;\n        bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;\n    }\n    return buffer;\n}\n\n// Converts a buffer to a string to store, serialized, in the backend\n// storage library.\nfunction bufferToString(buffer) {\n    // base64-arraybuffer\n    var bytes = new Uint8Array(buffer);\n    var base64String = '';\n    var i;\n\n    for (i = 0; i < bytes.length; i += 3) {\n        /*jslint bitwise: true */\n        base64String += BASE_CHARS[bytes[i] >> 2];\n        base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n        base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n        base64String += BASE_CHARS[bytes[i + 2] & 63];\n    }\n\n    if (bytes.length % 3 === 2) {\n        base64String = base64String.substring(0, base64String.length - 1) + '=';\n    } else if (bytes.length % 3 === 1) {\n        base64String = base64String.substring(0, base64String.length - 2) + '==';\n    }\n\n    return base64String;\n}\n\n// Serialize a value, afterwards executing a callback (which usually\n// instructs the `setItem()` callback/promise to be executed). This is how\n// we store binary data with localStorage.\nfunction serialize(value, callback) {\n    var valueType = '';\n    if (value) {\n        valueType = toString$1.call(value);\n    }\n\n    // Cannot use `value instanceof ArrayBuffer` or such here, as these\n    // checks fail when running the tests using casper.js...\n    //\n    // TODO: See why those tests fail and use a better solution.\n    if (value && (valueType === '[object ArrayBuffer]' || value.buffer && toString$1.call(value.buffer) === '[object ArrayBuffer]')) {\n        // Convert binary arrays to a string and prefix the string with\n        // a special marker.\n        var buffer;\n        var marker = SERIALIZED_MARKER;\n\n        if (value instanceof ArrayBuffer) {\n            buffer = value;\n            marker += TYPE_ARRAYBUFFER;\n        } else {\n            buffer = value.buffer;\n\n            if (valueType === '[object Int8Array]') {\n                marker += TYPE_INT8ARRAY;\n            } else if (valueType === '[object Uint8Array]') {\n                marker += TYPE_UINT8ARRAY;\n            } else if (valueType === '[object Uint8ClampedArray]') {\n                marker += TYPE_UINT8CLAMPEDARRAY;\n            } else if (valueType === '[object Int16Array]') {\n                marker += TYPE_INT16ARRAY;\n            } else if (valueType === '[object Uint16Array]') {\n                marker += TYPE_UINT16ARRAY;\n            } else if (valueType === '[object Int32Array]') {\n                marker += TYPE_INT32ARRAY;\n            } else if (valueType === '[object Uint32Array]') {\n                marker += TYPE_UINT32ARRAY;\n            } else if (valueType === '[object Float32Array]') {\n                marker += TYPE_FLOAT32ARRAY;\n            } else if (valueType === '[object Float64Array]') {\n                marker += TYPE_FLOAT64ARRAY;\n            } else {\n                callback(new Error('Failed to get type for BinaryArray'));\n            }\n        }\n\n        callback(marker + bufferToString(buffer));\n    } else if (valueType === '[object Blob]') {\n        // Conver the blob to a binaryArray and then to a string.\n        var fileReader = new FileReader();\n\n        fileReader.onload = function () {\n            // Backwards-compatible prefix for the blob type.\n            var str = BLOB_TYPE_PREFIX + value.type + '~' + bufferToString(this.result);\n\n            callback(SERIALIZED_MARKER + TYPE_BLOB + str);\n        };\n\n        fileReader.readAsArrayBuffer(value);\n    } else {\n        try {\n            callback(JSON.stringify(value));\n        } catch (e) {\n            console.error(\"Couldn't convert value into a JSON string: \", value);\n\n            callback(null, e);\n        }\n    }\n}\n\n// Deserialize data we've inserted into a value column/field. We place\n// special markers into our strings to mark them as encoded; this isn't\n// as nice as a meta field, but it's the only sane thing we can do whilst\n// keeping localStorage support intact.\n//\n// Oftentimes this will just deserialize JSON content, but if we have a\n// special marker (SERIALIZED_MARKER, defined above), we will extract\n// some kind of arraybuffer/binary data/typed array out of the string.\nfunction deserialize(value) {\n    // If we haven't marked this string as being specially serialized (i.e.\n    // something other than serialized JSON), we can just return it and be\n    // done with it.\n    if (value.substring(0, SERIALIZED_MARKER_LENGTH) !== SERIALIZED_MARKER) {\n        return JSON.parse(value);\n    }\n\n    // The following code deals with deserializing some kind of Blob or\n    // TypedArray. First we separate out the type of data we're dealing\n    // with from the data itself.\n    var serializedString = value.substring(TYPE_SERIALIZED_MARKER_LENGTH);\n    var type = value.substring(SERIALIZED_MARKER_LENGTH, TYPE_SERIALIZED_MARKER_LENGTH);\n\n    var blobType;\n    // Backwards-compatible blob type serialization strategy.\n    // DBs created with older versions of localForage will simply not have the blob type.\n    if (type === TYPE_BLOB && BLOB_TYPE_PREFIX_REGEX.test(serializedString)) {\n        var matcher = serializedString.match(BLOB_TYPE_PREFIX_REGEX);\n        blobType = matcher[1];\n        serializedString = serializedString.substring(matcher[0].length);\n    }\n    var buffer = stringToBuffer(serializedString);\n\n    // Return the right type based on the code/type set during\n    // serialization.\n    switch (type) {\n        case TYPE_ARRAYBUFFER:\n            return buffer;\n        case TYPE_BLOB:\n            return createBlob([buffer], { type: blobType });\n        case TYPE_INT8ARRAY:\n            return new Int8Array(buffer);\n        case TYPE_UINT8ARRAY:\n            return new Uint8Array(buffer);\n        case TYPE_UINT8CLAMPEDARRAY:\n            return new Uint8ClampedArray(buffer);\n        case TYPE_INT16ARRAY:\n            return new Int16Array(buffer);\n        case TYPE_UINT16ARRAY:\n            return new Uint16Array(buffer);\n        case TYPE_INT32ARRAY:\n            return new Int32Array(buffer);\n        case TYPE_UINT32ARRAY:\n            return new Uint32Array(buffer);\n        case TYPE_FLOAT32ARRAY:\n            return new Float32Array(buffer);\n        case TYPE_FLOAT64ARRAY:\n            return new Float64Array(buffer);\n        default:\n            throw new Error('Unkown type: ' + type);\n    }\n}\n\nvar localforageSerializer = {\n    serialize: serialize,\n    deserialize: deserialize,\n    stringToBuffer: stringToBuffer,\n    bufferToString: bufferToString\n};\n\n/*\n * Includes code from:\n *\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n */\n\nfunction createDbTable(t, dbInfo, callback, errorCallback) {\n    t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n}\n\n// Open the WebSQL database (automatically creates one if one didn't\n// previously exist), using any options set in the config.\nfunction _initStorage$1(options) {\n    var self = this;\n    var dbInfo = {\n        db: null\n    };\n\n    if (options) {\n        for (var i in options) {\n            dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i];\n        }\n    }\n\n    var dbInfoPromise = new Promise$1(function (resolve, reject) {\n        // Open the database; the openDatabase API will automatically\n        // create it for us if it doesn't exist.\n        try {\n            dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);\n        } catch (e) {\n            return reject(e);\n        }\n\n        // Create our key/value table if it doesn't exist.\n        dbInfo.db.transaction(function (t) {\n            createDbTable(t, dbInfo, function () {\n                self._dbInfo = dbInfo;\n                resolve();\n            }, function (t, error) {\n                reject(error);\n            });\n        }, reject);\n    });\n\n    dbInfo.serializer = localforageSerializer;\n    return dbInfoPromise;\n}\n\nfunction tryExecuteSql(t, dbInfo, sqlStatement, args, callback, errorCallback) {\n    t.executeSql(sqlStatement, args, callback, function (t, error) {\n        if (error.code === error.SYNTAX_ERR) {\n            t.executeSql('SELECT name FROM sqlite_master ' + \"WHERE type='table' AND name = ?\", [dbInfo.storeName], function (t, results) {\n                if (!results.rows.length) {\n                    // if the table is missing (was deleted)\n                    // re-create it table and retry\n                    createDbTable(t, dbInfo, function () {\n                        t.executeSql(sqlStatement, args, callback, errorCallback);\n                    }, errorCallback);\n                } else {\n                    errorCallback(t, error);\n                }\n            }, errorCallback);\n        } else {\n            errorCallback(t, error);\n        }\n    }, errorCallback);\n}\n\nfunction getItem$1(key, callback) {\n    var self = this;\n\n    key = normalizeKey(key);\n\n    var promise = new Promise$1(function (resolve, reject) {\n        self.ready().then(function () {\n            var dbInfo = self._dbInfo;\n            dbInfo.db.transaction(function (t) {\n                tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName + ' WHERE key = ? LIMIT 1', [key], function (t, results) {\n                    var result = results.rows.length ? results.rows.item(0).value : null;\n\n                    // Check to see if this is serialized content we need to\n                    // unpack.\n                    if (result) {\n                        result = dbInfo.serializer.deserialize(result);\n                    }\n\n                    resolve(result);\n                }, function (t, error) {\n                    reject(error);\n                });\n            });\n        })[\"catch\"](reject);\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\nfunction iterate$1(iterator, callback) {\n    var self = this;\n\n    var promise = new Promise$1(function (resolve, reject) {\n        self.ready().then(function () {\n            var dbInfo = self._dbInfo;\n\n            dbInfo.db.transaction(function (t) {\n                tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName, [], function (t, results) {\n                    var rows = results.rows;\n                    var length = rows.length;\n\n                    for (var i = 0; i < length; i++) {\n                        var item = rows.item(i);\n                        var result = item.value;\n\n                        // Check to see if this is serialized content\n                        // we need to unpack.\n                        if (result) {\n                            result = dbInfo.serializer.deserialize(result);\n                        }\n\n                        result = iterator(result, item.key, i + 1);\n\n                        // void(0) prevents problems with redefinition\n                        // of `undefined`.\n                        if (result !== void 0) {\n                            resolve(result);\n                            return;\n                        }\n                    }\n\n                    resolve();\n                }, function (t, error) {\n                    reject(error);\n                });\n            });\n        })[\"catch\"](reject);\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\nfunction _setItem(key, value, callback, retriesLeft) {\n    var self = this;\n\n    key = normalizeKey(key);\n\n    var promise = new Promise$1(function (resolve, reject) {\n        self.ready().then(function () {\n            // The localStorage API doesn't return undefined values in an\n            // \"expected\" way, so undefined is always cast to null in all\n            // drivers. See: https://github.com/mozilla/localForage/pull/42\n            if (value === undefined) {\n                value = null;\n            }\n\n            // Save the original value to pass to the callback.\n            var originalValue = value;\n\n            var dbInfo = self._dbInfo;\n            dbInfo.serializer.serialize(value, function (value, error) {\n                if (error) {\n                    reject(error);\n                } else {\n                    dbInfo.db.transaction(function (t) {\n                        tryExecuteSql(t, dbInfo, 'INSERT OR REPLACE INTO ' + dbInfo.storeName + ' ' + '(key, value) VALUES (?, ?)', [key, value], function () {\n                            resolve(originalValue);\n                        }, function (t, error) {\n                            reject(error);\n                        });\n                    }, function (sqlError) {\n                        // The transaction failed; check\n                        // to see if it's a quota error.\n                        if (sqlError.code === sqlError.QUOTA_ERR) {\n                            // We reject the callback outright for now, but\n                            // it's worth trying to re-run the transaction.\n                            // Even if the user accepts the prompt to use\n                            // more storage on Safari, this error will\n                            // be called.\n                            //\n                            // Try to re-run the transaction.\n                            if (retriesLeft > 0) {\n                                resolve(_setItem.apply(self, [key, originalValue, callback, retriesLeft - 1]));\n                                return;\n                            }\n                            reject(sqlError);\n                        }\n                    });\n                }\n            });\n        })[\"catch\"](reject);\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\nfunction setItem$1(key, value, callback) {\n    return _setItem.apply(this, [key, value, callback, 1]);\n}\n\nfunction removeItem$1(key, callback) {\n    var self = this;\n\n    key = normalizeKey(key);\n\n    var promise = new Promise$1(function (resolve, reject) {\n        self.ready().then(function () {\n            var dbInfo = self._dbInfo;\n            dbInfo.db.transaction(function (t) {\n                tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName + ' WHERE key = ?', [key], function () {\n                    resolve();\n                }, function (t, error) {\n                    reject(error);\n                });\n            });\n        })[\"catch\"](reject);\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\n// Deletes every item in the table.\n// TODO: Find out if this resets the AUTO_INCREMENT number.\nfunction clear$1(callback) {\n    var self = this;\n\n    var promise = new Promise$1(function (resolve, reject) {\n        self.ready().then(function () {\n            var dbInfo = self._dbInfo;\n            dbInfo.db.transaction(function (t) {\n                tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName, [], function () {\n                    resolve();\n                }, function (t, error) {\n                    reject(error);\n                });\n            });\n        })[\"catch\"](reject);\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\n// Does a simple `COUNT(key)` to get the number of items stored in\n// localForage.\nfunction length$1(callback) {\n    var self = this;\n\n    var promise = new Promise$1(function (resolve, reject) {\n        self.ready().then(function () {\n            var dbInfo = self._dbInfo;\n            dbInfo.db.transaction(function (t) {\n                // Ahhh, SQL makes this one soooooo easy.\n                tryExecuteSql(t, dbInfo, 'SELECT COUNT(key) as c FROM ' + dbInfo.storeName, [], function (t, results) {\n                    var result = results.rows.item(0).c;\n                    resolve(result);\n                }, function (t, error) {\n                    reject(error);\n                });\n            });\n        })[\"catch\"](reject);\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\n// Return the key located at key index X; essentially gets the key from a\n// `WHERE id = ?`. This is the most efficient way I can think to implement\n// this rarely-used (in my experience) part of the API, but it can seem\n// inconsistent, because we do `INSERT OR REPLACE INTO` on `setItem()`, so\n// the ID of each key will change every time it's updated. Perhaps a stored\n// procedure for the `setItem()` SQL would solve this problem?\n// TODO: Don't change ID on `setItem()`.\nfunction key$1(n, callback) {\n    var self = this;\n\n    var promise = new Promise$1(function (resolve, reject) {\n        self.ready().then(function () {\n            var dbInfo = self._dbInfo;\n            dbInfo.db.transaction(function (t) {\n                tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName + ' WHERE id = ? LIMIT 1', [n + 1], function (t, results) {\n                    var result = results.rows.length ? results.rows.item(0).key : null;\n                    resolve(result);\n                }, function (t, error) {\n                    reject(error);\n                });\n            });\n        })[\"catch\"](reject);\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\nfunction keys$1(callback) {\n    var self = this;\n\n    var promise = new Promise$1(function (resolve, reject) {\n        self.ready().then(function () {\n            var dbInfo = self._dbInfo;\n            dbInfo.db.transaction(function (t) {\n                tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName, [], function (t, results) {\n                    var keys = [];\n\n                    for (var i = 0; i < results.rows.length; i++) {\n                        keys.push(results.rows.item(i).key);\n                    }\n\n                    resolve(keys);\n                }, function (t, error) {\n                    reject(error);\n                });\n            });\n        })[\"catch\"](reject);\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\n// https://www.w3.org/TR/webdatabase/#databases\n// > There is no way to enumerate or delete the databases available for an origin from this API.\nfunction getAllStoreNames(db) {\n    return new Promise$1(function (resolve, reject) {\n        db.transaction(function (t) {\n            t.executeSql('SELECT name FROM sqlite_master ' + \"WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'\", [], function (t, results) {\n                var storeNames = [];\n\n                for (var i = 0; i < results.rows.length; i++) {\n                    storeNames.push(results.rows.item(i).name);\n                }\n\n                resolve({\n                    db: db,\n                    storeNames: storeNames\n                });\n            }, function (t, error) {\n                reject(error);\n            });\n        }, function (sqlError) {\n            reject(sqlError);\n        });\n    });\n}\n\nfunction dropInstance$1(options, callback) {\n    callback = getCallback.apply(this, arguments);\n\n    var currentConfig = this.config();\n    options = typeof options !== 'function' && options || {};\n    if (!options.name) {\n        options.name = options.name || currentConfig.name;\n        options.storeName = options.storeName || currentConfig.storeName;\n    }\n\n    var self = this;\n    var promise;\n    if (!options.name) {\n        promise = Promise$1.reject('Invalid arguments');\n    } else {\n        promise = new Promise$1(function (resolve) {\n            var db;\n            if (options.name === currentConfig.name) {\n                // use the db reference of the current instance\n                db = self._dbInfo.db;\n            } else {\n                db = openDatabase(options.name, '', '', 0);\n            }\n\n            if (!options.storeName) {\n                // drop all database tables\n                resolve(getAllStoreNames(db));\n            } else {\n                resolve({\n                    db: db,\n                    storeNames: [options.storeName]\n                });\n            }\n        }).then(function (operationInfo) {\n            return new Promise$1(function (resolve, reject) {\n                operationInfo.db.transaction(function (t) {\n                    function dropTable(storeName) {\n                        return new Promise$1(function (resolve, reject) {\n                            t.executeSql('DROP TABLE IF EXISTS ' + storeName, [], function () {\n                                resolve();\n                            }, function (t, error) {\n                                reject(error);\n                            });\n                        });\n                    }\n\n                    var operations = [];\n                    for (var i = 0, len = operationInfo.storeNames.length; i < len; i++) {\n                        operations.push(dropTable(operationInfo.storeNames[i]));\n                    }\n\n                    Promise$1.all(operations).then(function () {\n                        resolve();\n                    })[\"catch\"](function (e) {\n                        reject(e);\n                    });\n                }, function (sqlError) {\n                    reject(sqlError);\n                });\n            });\n        });\n    }\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\nvar webSQLStorage = {\n    _driver: 'webSQLStorage',\n    _initStorage: _initStorage$1,\n    _support: isWebSQLValid(),\n    iterate: iterate$1,\n    getItem: getItem$1,\n    setItem: setItem$1,\n    removeItem: removeItem$1,\n    clear: clear$1,\n    length: length$1,\n    key: key$1,\n    keys: keys$1,\n    dropInstance: dropInstance$1\n};\n\nfunction isLocalStorageValid() {\n    try {\n        return typeof localStorage !== 'undefined' && 'setItem' in localStorage &&\n        // in IE8 typeof localStorage.setItem === 'object'\n        !!localStorage.setItem;\n    } catch (e) {\n        return false;\n    }\n}\n\nfunction _getKeyPrefix(options, defaultConfig) {\n    var keyPrefix = options.name + '/';\n\n    if (options.storeName !== defaultConfig.storeName) {\n        keyPrefix += options.storeName + '/';\n    }\n    return keyPrefix;\n}\n\n// Check if localStorage throws when saving an item\nfunction checkIfLocalStorageThrows() {\n    var localStorageTestKey = '_localforage_support_test';\n\n    try {\n        localStorage.setItem(localStorageTestKey, true);\n        localStorage.removeItem(localStorageTestKey);\n\n        return false;\n    } catch (e) {\n        return true;\n    }\n}\n\n// Check if localStorage is usable and allows to save an item\n// This method checks if localStorage is usable in Safari Private Browsing\n// mode, or in any other case where the available quota for localStorage\n// is 0 and there wasn't any saved items yet.\nfunction _isLocalStorageUsable() {\n    return !checkIfLocalStorageThrows() || localStorage.length > 0;\n}\n\n// Config the localStorage backend, using options set in the config.\nfunction _initStorage$2(options) {\n    var self = this;\n    var dbInfo = {};\n    if (options) {\n        for (var i in options) {\n            dbInfo[i] = options[i];\n        }\n    }\n\n    dbInfo.keyPrefix = _getKeyPrefix(options, self._defaultConfig);\n\n    if (!_isLocalStorageUsable()) {\n        return Promise$1.reject();\n    }\n\n    self._dbInfo = dbInfo;\n    dbInfo.serializer = localforageSerializer;\n\n    return Promise$1.resolve();\n}\n\n// Remove all keys from the datastore, effectively destroying all data in\n// the app's key/value store!\nfunction clear$2(callback) {\n    var self = this;\n    var promise = self.ready().then(function () {\n        var keyPrefix = self._dbInfo.keyPrefix;\n\n        for (var i = localStorage.length - 1; i >= 0; i--) {\n            var key = localStorage.key(i);\n\n            if (key.indexOf(keyPrefix) === 0) {\n                localStorage.removeItem(key);\n            }\n        }\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\n// Retrieve an item from the store. Unlike the original async_storage\n// library in Gaia, we don't modify return values at all. If a key's value\n// is `undefined`, we pass that value to the callback function.\nfunction getItem$2(key, callback) {\n    var self = this;\n\n    key = normalizeKey(key);\n\n    var promise = self.ready().then(function () {\n        var dbInfo = self._dbInfo;\n        var result = localStorage.getItem(dbInfo.keyPrefix + key);\n\n        // If a result was found, parse it from the serialized\n        // string into a JS object. If result isn't truthy, the key\n        // is likely undefined and we'll pass it straight to the\n        // callback.\n        if (result) {\n            result = dbInfo.serializer.deserialize(result);\n        }\n\n        return result;\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\n// Iterate over all items in the store.\nfunction iterate$2(iterator, callback) {\n    var self = this;\n\n    var promise = self.ready().then(function () {\n        var dbInfo = self._dbInfo;\n        var keyPrefix = dbInfo.keyPrefix;\n        var keyPrefixLength = keyPrefix.length;\n        var length = localStorage.length;\n\n        // We use a dedicated iterator instead of the `i` variable below\n        // so other keys we fetch in localStorage aren't counted in\n        // the `iterationNumber` argument passed to the `iterate()`\n        // callback.\n        //\n        // See: github.com/mozilla/localForage/pull/435#discussion_r38061530\n        var iterationNumber = 1;\n\n        for (var i = 0; i < length; i++) {\n            var key = localStorage.key(i);\n            if (key.indexOf(keyPrefix) !== 0) {\n                continue;\n            }\n            var value = localStorage.getItem(key);\n\n            // If a result was found, parse it from the serialized\n            // string into a JS object. If result isn't truthy, the\n            // key is likely undefined and we'll pass it straight\n            // to the iterator.\n            if (value) {\n                value = dbInfo.serializer.deserialize(value);\n            }\n\n            value = iterator(value, key.substring(keyPrefixLength), iterationNumber++);\n\n            if (value !== void 0) {\n                return value;\n            }\n        }\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\n// Same as localStorage's key() method, except takes a callback.\nfunction key$2(n, callback) {\n    var self = this;\n    var promise = self.ready().then(function () {\n        var dbInfo = self._dbInfo;\n        var result;\n        try {\n            result = localStorage.key(n);\n        } catch (error) {\n            result = null;\n        }\n\n        // Remove the prefix from the key, if a key is found.\n        if (result) {\n            result = result.substring(dbInfo.keyPrefix.length);\n        }\n\n        return result;\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\nfunction keys$2(callback) {\n    var self = this;\n    var promise = self.ready().then(function () {\n        var dbInfo = self._dbInfo;\n        var length = localStorage.length;\n        var keys = [];\n\n        for (var i = 0; i < length; i++) {\n            var itemKey = localStorage.key(i);\n            if (itemKey.indexOf(dbInfo.keyPrefix) === 0) {\n                keys.push(itemKey.substring(dbInfo.keyPrefix.length));\n            }\n        }\n\n        return keys;\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\n// Supply the number of keys in the datastore to the callback function.\nfunction length$2(callback) {\n    var self = this;\n    var promise = self.keys().then(function (keys) {\n        return keys.length;\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\n// Remove an item from the store, nice and simple.\nfunction removeItem$2(key, callback) {\n    var self = this;\n\n    key = normalizeKey(key);\n\n    var promise = self.ready().then(function () {\n        var dbInfo = self._dbInfo;\n        localStorage.removeItem(dbInfo.keyPrefix + key);\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\n// Set a key's value and run an optional callback once the value is set.\n// Unlike Gaia's implementation, the callback function is passed the value,\n// in case you want to operate on that value only after you're sure it\n// saved, or something like that.\nfunction setItem$2(key, value, callback) {\n    var self = this;\n\n    key = normalizeKey(key);\n\n    var promise = self.ready().then(function () {\n        // Convert undefined values to null.\n        // https://github.com/mozilla/localForage/pull/42\n        if (value === undefined) {\n            value = null;\n        }\n\n        // Save the original value to pass to the callback.\n        var originalValue = value;\n\n        return new Promise$1(function (resolve, reject) {\n            var dbInfo = self._dbInfo;\n            dbInfo.serializer.serialize(value, function (value, error) {\n                if (error) {\n                    reject(error);\n                } else {\n                    try {\n                        localStorage.setItem(dbInfo.keyPrefix + key, value);\n                        resolve(originalValue);\n                    } catch (e) {\n                        // localStorage capacity exceeded.\n                        // TODO: Make this a specific error/event.\n                        if (e.name === 'QuotaExceededError' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED') {\n                            reject(e);\n                        }\n                        reject(e);\n                    }\n                }\n            });\n        });\n    });\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\nfunction dropInstance$2(options, callback) {\n    callback = getCallback.apply(this, arguments);\n\n    options = typeof options !== 'function' && options || {};\n    if (!options.name) {\n        var currentConfig = this.config();\n        options.name = options.name || currentConfig.name;\n        options.storeName = options.storeName || currentConfig.storeName;\n    }\n\n    var self = this;\n    var promise;\n    if (!options.name) {\n        promise = Promise$1.reject('Invalid arguments');\n    } else {\n        promise = new Promise$1(function (resolve) {\n            if (!options.storeName) {\n                resolve(options.name + '/');\n            } else {\n                resolve(_getKeyPrefix(options, self._defaultConfig));\n            }\n        }).then(function (keyPrefix) {\n            for (var i = localStorage.length - 1; i >= 0; i--) {\n                var key = localStorage.key(i);\n\n                if (key.indexOf(keyPrefix) === 0) {\n                    localStorage.removeItem(key);\n                }\n            }\n        });\n    }\n\n    executeCallback(promise, callback);\n    return promise;\n}\n\nvar localStorageWrapper = {\n    _driver: 'localStorageWrapper',\n    _initStorage: _initStorage$2,\n    _support: isLocalStorageValid(),\n    iterate: iterate$2,\n    getItem: getItem$2,\n    setItem: setItem$2,\n    removeItem: removeItem$2,\n    clear: clear$2,\n    length: length$2,\n    key: key$2,\n    keys: keys$2,\n    dropInstance: dropInstance$2\n};\n\nvar sameValue = function sameValue(x, y) {\n    return x === y || typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y);\n};\n\nvar includes = function includes(array, searchElement) {\n    var len = array.length;\n    var i = 0;\n    while (i < len) {\n        if (sameValue(array[i], searchElement)) {\n            return true;\n        }\n        i++;\n    }\n\n    return false;\n};\n\nvar isArray = Array.isArray || function (arg) {\n    return Object.prototype.toString.call(arg) === '[object Array]';\n};\n\n// Drivers are stored here when `defineDriver()` is called.\n// They are shared across all instances of localForage.\nvar DefinedDrivers = {};\n\nvar DriverSupport = {};\n\nvar DefaultDrivers = {\n    INDEXEDDB: asyncStorage,\n    WEBSQL: webSQLStorage,\n    LOCALSTORAGE: localStorageWrapper\n};\n\nvar DefaultDriverOrder = [DefaultDrivers.INDEXEDDB._driver, DefaultDrivers.WEBSQL._driver, DefaultDrivers.LOCALSTORAGE._driver];\n\nvar OptionalDriverMethods = ['dropInstance'];\n\nvar LibraryMethods = ['clear', 'getItem', 'iterate', 'key', 'keys', 'length', 'removeItem', 'setItem'].concat(OptionalDriverMethods);\n\nvar DefaultConfig = {\n    description: '',\n    driver: DefaultDriverOrder.slice(),\n    name: 'localforage',\n    // Default DB size is _JUST UNDER_ 5MB, as it's the highest size\n    // we can use without a prompt.\n    size: 4980736,\n    storeName: 'keyvaluepairs',\n    version: 1.0\n};\n\nfunction callWhenReady(localForageInstance, libraryMethod) {\n    localForageInstance[libraryMethod] = function () {\n        var _args = arguments;\n        return localForageInstance.ready().then(function () {\n            return localForageInstance[libraryMethod].apply(localForageInstance, _args);\n        });\n    };\n}\n\nfunction extend() {\n    for (var i = 1; i < arguments.length; i++) {\n        var arg = arguments[i];\n\n        if (arg) {\n            for (var _key in arg) {\n                if (arg.hasOwnProperty(_key)) {\n                    if (isArray(arg[_key])) {\n                        arguments[0][_key] = arg[_key].slice();\n                    } else {\n                        arguments[0][_key] = arg[_key];\n                    }\n                }\n            }\n        }\n    }\n\n    return arguments[0];\n}\n\nvar LocalForage = function () {\n    function LocalForage(options) {\n        _classCallCheck(this, LocalForage);\n\n        for (var driverTypeKey in DefaultDrivers) {\n            if (DefaultDrivers.hasOwnProperty(driverTypeKey)) {\n                var driver = DefaultDrivers[driverTypeKey];\n                var driverName = driver._driver;\n                this[driverTypeKey] = driverName;\n\n                if (!DefinedDrivers[driverName]) {\n                    // we don't need to wait for the promise,\n                    // since the default drivers can be defined\n                    // in a blocking manner\n                    this.defineDriver(driver);\n                }\n            }\n        }\n\n        this._defaultConfig = extend({}, DefaultConfig);\n        this._config = extend({}, this._defaultConfig, options);\n        this._driverSet = null;\n        this._initDriver = null;\n        this._ready = false;\n        this._dbInfo = null;\n\n        this._wrapLibraryMethodsWithReady();\n        this.setDriver(this._config.driver)[\"catch\"](function () {});\n    }\n\n    // Set any config values for localForage; can be called anytime before\n    // the first API call (e.g. `getItem`, `setItem`).\n    // We loop through options so we don't overwrite existing config\n    // values.\n\n\n    LocalForage.prototype.config = function config(options) {\n        // If the options argument is an object, we use it to set values.\n        // Otherwise, we return either a specified config value or all\n        // config values.\n        if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object') {\n            // If localforage is ready and fully initialized, we can't set\n            // any new configuration values. Instead, we return an error.\n            if (this._ready) {\n                return new Error(\"Can't call config() after localforage \" + 'has been used.');\n            }\n\n            for (var i in options) {\n                if (i === 'storeName') {\n                    options[i] = options[i].replace(/\\W/g, '_');\n                }\n\n                if (i === 'version' && typeof options[i] !== 'number') {\n                    return new Error('Database version must be a number.');\n                }\n\n                this._config[i] = options[i];\n            }\n\n            // after all config options are set and\n            // the driver option is used, try setting it\n            if ('driver' in options && options.driver) {\n                return this.setDriver(this._config.driver);\n            }\n\n            return true;\n        } else if (typeof options === 'string') {\n            return this._config[options];\n        } else {\n            return this._config;\n        }\n    };\n\n    // Used to define a custom driver, shared across all instances of\n    // localForage.\n\n\n    LocalForage.prototype.defineDriver = function defineDriver(driverObject, callback, errorCallback) {\n        var promise = new Promise$1(function (resolve, reject) {\n            try {\n                var driverName = driverObject._driver;\n                var complianceError = new Error('Custom driver not compliant; see ' + 'https://mozilla.github.io/localForage/#definedriver');\n\n                // A driver name should be defined and not overlap with the\n                // library-defined, default drivers.\n                if (!driverObject._driver) {\n                    reject(complianceError);\n                    return;\n                }\n\n                var driverMethods = LibraryMethods.concat('_initStorage');\n                for (var i = 0, len = driverMethods.length; i < len; i++) {\n                    var driverMethodName = driverMethods[i];\n\n                    // when the property is there,\n                    // it should be a method even when optional\n                    var isRequired = !includes(OptionalDriverMethods, driverMethodName);\n                    if ((isRequired || driverObject[driverMethodName]) && typeof driverObject[driverMethodName] !== 'function') {\n                        reject(complianceError);\n                        return;\n                    }\n                }\n\n                var configureMissingMethods = function configureMissingMethods() {\n                    var methodNotImplementedFactory = function methodNotImplementedFactory(methodName) {\n                        return function () {\n                            var error = new Error('Method ' + methodName + ' is not implemented by the current driver');\n                            var promise = Promise$1.reject(error);\n                            executeCallback(promise, arguments[arguments.length - 1]);\n                            return promise;\n                        };\n                    };\n\n                    for (var _i = 0, _len = OptionalDriverMethods.length; _i < _len; _i++) {\n                        var optionalDriverMethod = OptionalDriverMethods[_i];\n                        if (!driverObject[optionalDriverMethod]) {\n                            driverObject[optionalDriverMethod] = methodNotImplementedFactory(optionalDriverMethod);\n                        }\n                    }\n                };\n\n                configureMissingMethods();\n\n                var setDriverSupport = function setDriverSupport(support) {\n                    if (DefinedDrivers[driverName]) {\n                        console.info('Redefining LocalForage driver: ' + driverName);\n                    }\n                    DefinedDrivers[driverName] = driverObject;\n                    DriverSupport[driverName] = support;\n                    // don't use a then, so that we can define\n                    // drivers that have simple _support methods\n                    // in a blocking manner\n                    resolve();\n                };\n\n                if ('_support' in driverObject) {\n                    if (driverObject._support && typeof driverObject._support === 'function') {\n                        driverObject._support().then(setDriverSupport, reject);\n                    } else {\n                        setDriverSupport(!!driverObject._support);\n                    }\n                } else {\n                    setDriverSupport(true);\n                }\n            } catch (e) {\n                reject(e);\n            }\n        });\n\n        executeTwoCallbacks(promise, callback, errorCallback);\n        return promise;\n    };\n\n    LocalForage.prototype.driver = function driver() {\n        return this._driver || null;\n    };\n\n    LocalForage.prototype.getDriver = function getDriver(driverName, callback, errorCallback) {\n        var getDriverPromise = DefinedDrivers[driverName] ? Promise$1.resolve(DefinedDrivers[driverName]) : Promise$1.reject(new Error('Driver not found.'));\n\n        executeTwoCallbacks(getDriverPromise, callback, errorCallback);\n        return getDriverPromise;\n    };\n\n    LocalForage.prototype.getSerializer = function getSerializer(callback) {\n        var serializerPromise = Promise$1.resolve(localforageSerializer);\n        executeTwoCallbacks(serializerPromise, callback);\n        return serializerPromise;\n    };\n\n    LocalForage.prototype.ready = function ready(callback) {\n        var self = this;\n\n        var promise = self._driverSet.then(function () {\n            if (self._ready === null) {\n                self._ready = self._initDriver();\n            }\n\n            return self._ready;\n        });\n\n        executeTwoCallbacks(promise, callback, callback);\n        return promise;\n    };\n\n    LocalForage.prototype.setDriver = function setDriver(drivers, callback, errorCallback) {\n        var self = this;\n\n        if (!isArray(drivers)) {\n            drivers = [drivers];\n        }\n\n        var supportedDrivers = this._getSupportedDrivers(drivers);\n\n        function setDriverToConfig() {\n            self._config.driver = self.driver();\n        }\n\n        function extendSelfWithDriver(driver) {\n            self._extend(driver);\n            setDriverToConfig();\n\n            self._ready = self._initStorage(self._config);\n            return self._ready;\n        }\n\n        function initDriver(supportedDrivers) {\n            return function () {\n                var currentDriverIndex = 0;\n\n                function driverPromiseLoop() {\n                    while (currentDriverIndex < supportedDrivers.length) {\n                        var driverName = supportedDrivers[currentDriverIndex];\n                        currentDriverIndex++;\n\n                        self._dbInfo = null;\n                        self._ready = null;\n\n                        return self.getDriver(driverName).then(extendSelfWithDriver)[\"catch\"](driverPromiseLoop);\n                    }\n\n                    setDriverToConfig();\n                    var error = new Error('No available storage method found.');\n                    self._driverSet = Promise$1.reject(error);\n                    return self._driverSet;\n                }\n\n                return driverPromiseLoop();\n            };\n        }\n\n        // There might be a driver initialization in progress\n        // so wait for it to finish in order to avoid a possible\n        // race condition to set _dbInfo\n        var oldDriverSetDone = this._driverSet !== null ? this._driverSet[\"catch\"](function () {\n            return Promise$1.resolve();\n        }) : Promise$1.resolve();\n\n        this._driverSet = oldDriverSetDone.then(function () {\n            var driverName = supportedDrivers[0];\n            self._dbInfo = null;\n            self._ready = null;\n\n            return self.getDriver(driverName).then(function (driver) {\n                self._driver = driver._driver;\n                setDriverToConfig();\n                self._wrapLibraryMethodsWithReady();\n                self._initDriver = initDriver(supportedDrivers);\n            });\n        })[\"catch\"](function () {\n            setDriverToConfig();\n            var error = new Error('No available storage method found.');\n            self._driverSet = Promise$1.reject(error);\n            return self._driverSet;\n        });\n\n        executeTwoCallbacks(this._driverSet, callback, errorCallback);\n        return this._driverSet;\n    };\n\n    LocalForage.prototype.supports = function supports(driverName) {\n        return !!DriverSupport[driverName];\n    };\n\n    LocalForage.prototype._extend = function _extend(libraryMethodsAndProperties) {\n        extend(this, libraryMethodsAndProperties);\n    };\n\n    LocalForage.prototype._getSupportedDrivers = function _getSupportedDrivers(drivers) {\n        var supportedDrivers = [];\n        for (var i = 0, len = drivers.length; i < len; i++) {\n            var driverName = drivers[i];\n            if (this.supports(driverName)) {\n                supportedDrivers.push(driverName);\n            }\n        }\n        return supportedDrivers;\n    };\n\n    LocalForage.prototype._wrapLibraryMethodsWithReady = function _wrapLibraryMethodsWithReady() {\n        // Add a stub for each driver API method that delays the call to the\n        // corresponding driver method until localForage is ready. These stubs\n        // will be replaced by the driver methods as soon as the driver is\n        // loaded, so there is no performance impact.\n        for (var i = 0, len = LibraryMethods.length; i < len; i++) {\n            callWhenReady(this, LibraryMethods[i]);\n        }\n    };\n\n    LocalForage.prototype.createInstance = function createInstance(options) {\n        return new LocalForage(options);\n    };\n\n    return LocalForage;\n}();\n\n// The actual localForage object that we expose as a module or via a\n// global. It's extended by pulling in one of our other libraries.\n\n\nvar localforage_js = new LocalForage();\n\nmodule.exports = localforage_js;\n\n},{\"3\":3}]},{},[4])(4)\n});\n","var getNative = require('./_getNative'),\n    root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n","var hashClear = require('./_hashClear'),\n    hashDelete = require('./_hashDelete'),\n    hashGet = require('./_hashGet'),\n    hashHas = require('./_hashHas'),\n    hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n  var index = -1,\n      length = entries == null ? 0 : entries.length;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","var listCacheClear = require('./_listCacheClear'),\n    listCacheDelete = require('./_listCacheDelete'),\n    listCacheGet = require('./_listCacheGet'),\n    listCacheHas = require('./_listCacheHas'),\n    listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n  var index = -1,\n      length = entries == null ? 0 : entries.length;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","var getNative = require('./_getNative'),\n    root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n","var mapCacheClear = require('./_mapCacheClear'),\n    mapCacheDelete = require('./_mapCacheDelete'),\n    mapCacheGet = require('./_mapCacheGet'),\n    mapCacheHas = require('./_mapCacheHas'),\n    mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n  var index = -1,\n      length = entries == null ? 0 : entries.length;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n","var getNative = require('./_getNative'),\n    root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","var getNative = require('./_getNative'),\n    root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n","var MapCache = require('./_MapCache'),\n    setCacheAdd = require('./_setCacheAdd'),\n    setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n  var index = -1,\n      length = values == null ? 0 : values.length;\n\n  this.__data__ = new MapCache;\n  while (++index < length) {\n    this.add(values[index]);\n  }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n","var ListCache = require('./_ListCache'),\n    stackClear = require('./_stackClear'),\n    stackDelete = require('./_stackDelete'),\n    stackGet = require('./_stackGet'),\n    stackHas = require('./_stackHas'),\n    stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n  var data = this.__data__ = new ListCache(entries);\n  this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n","var getNative = require('./_getNative'),\n    root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n  switch (args.length) {\n    case 0: return func.call(thisArg);\n    case 1: return func.call(thisArg, args[0]);\n    case 2: return func.call(thisArg, args[0], args[1]);\n    case 3: return func.call(thisArg, args[0], args[1], args[2]);\n  }\n  return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n","/**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction arrayAggregator(array, setter, iteratee, accumulator) {\n  var index = -1,\n      length = array == null ? 0 : array.length;\n\n  while (++index < length) {\n    var value = array[index];\n    setter(accumulator, value, iteratee(value), array);\n  }\n  return accumulator;\n}\n\nmodule.exports = arrayAggregator;\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n  var index = -1,\n      length = array == null ? 0 : array.length;\n\n  while (++index < length) {\n    if (iteratee(array[index], index, array) === false) {\n      break;\n    }\n  }\n  return array;\n}\n\nmodule.exports = arrayEach;\n","/**\n * A specialized version of `_.forEachRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEachRight(array, iteratee) {\n  var length = array == null ? 0 : array.length;\n\n  while (length--) {\n    if (iteratee(array[length], length, array) === false) {\n      break;\n    }\n  }\n  return array;\n}\n\nmodule.exports = arrayEachRight;\n","/**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n *  else `false`.\n */\nfunction arrayEvery(array, predicate) {\n  var index = -1,\n      length = array == null ? 0 : array.length;\n\n  while (++index < length) {\n    if (!predicate(array[index], index, array)) {\n      return false;\n    }\n  }\n  return true;\n}\n\nmodule.exports = arrayEvery;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n  var index = -1,\n      length = array == null ? 0 : array.length,\n      resIndex = 0,\n      result = [];\n\n  while (++index < length) {\n    var value = array[index];\n    if (predicate(value, index, array)) {\n      result[resIndex++] = value;\n    }\n  }\n  return result;\n}\n\nmodule.exports = arrayFilter;\n","var baseIndexOf = require('./_baseIndexOf');\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n  var length = array == null ? 0 : array.length;\n  return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nmodule.exports = arrayIncludes;\n","/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n  var index = -1,\n      length = array == null ? 0 : array.length;\n\n  while (++index < length) {\n    if (comparator(value, array[index])) {\n      return true;\n    }\n  }\n  return false;\n}\n\nmodule.exports = arrayIncludesWith;\n","var baseTimes = require('./_baseTimes'),\n    isArguments = require('./isArguments'),\n    isArray = require('./isArray'),\n    isBuffer = require('./isBuffer'),\n    isIndex = require('./_isIndex'),\n    isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n  var isArr = isArray(value),\n      isArg = !isArr && isArguments(value),\n      isBuff = !isArr && !isArg && isBuffer(value),\n      isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n      skipIndexes = isArr || isArg || isBuff || isType,\n      result = skipIndexes ? baseTimes(value.length, String) : [],\n      length = result.length;\n\n  for (var key in value) {\n    if ((inherited || hasOwnProperty.call(value, key)) &&\n        !(skipIndexes && (\n           // Safari 9 has enumerable `arguments.length` in strict mode.\n           key == 'length' ||\n           // Node.js 0.10 has enumerable non-index properties on buffers.\n           (isBuff && (key == 'offset' || key == 'parent')) ||\n           // PhantomJS 2 has enumerable non-index properties on typed arrays.\n           (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n           // Skip index properties.\n           isIndex(key, length)\n        ))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n  var index = -1,\n      length = array == null ? 0 : array.length,\n      result = Array(length);\n\n  while (++index < length) {\n    result[index] = iteratee(array[index], index, array);\n  }\n  return result;\n}\n\nmodule.exports = arrayMap;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n  var index = -1,\n      length = values.length,\n      offset = array.length;\n\n  while (++index < length) {\n    array[offset + index] = values[index];\n  }\n  return array;\n}\n\nmodule.exports = arrayPush;\n","/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n *  the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n  var index = -1,\n      length = array == null ? 0 : array.length;\n\n  if (initAccum && length) {\n    accumulator = array[++index];\n  }\n  while (++index < length) {\n    accumulator = iteratee(accumulator, array[index], index, array);\n  }\n  return accumulator;\n}\n\nmodule.exports = arrayReduce;\n","/**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n *  the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduceRight(array, iteratee, accumulator, initAccum) {\n  var length = array == null ? 0 : array.length;\n  if (initAccum && length) {\n    accumulator = array[--length];\n  }\n  while (length--) {\n    accumulator = iteratee(accumulator, array[length], length, array);\n  }\n  return accumulator;\n}\n\nmodule.exports = arrayReduceRight;\n","var baseRandom = require('./_baseRandom');\n\n/**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\nfunction arraySample(array) {\n  var length = array.length;\n  return length ? array[baseRandom(0, length - 1)] : undefined;\n}\n\nmodule.exports = arraySample;\n","var baseClamp = require('./_baseClamp'),\n    copyArray = require('./_copyArray'),\n    shuffleSelf = require('./_shuffleSelf');\n\n/**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\nfunction arraySampleSize(array, n) {\n  return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n}\n\nmodule.exports = arraySampleSize;\n","var copyArray = require('./_copyArray'),\n    shuffleSelf = require('./_shuffleSelf');\n\n/**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\nfunction arrayShuffle(array) {\n  return shuffleSelf(copyArray(array));\n}\n\nmodule.exports = arrayShuffle;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n *  else `false`.\n */\nfunction arraySome(array, predicate) {\n  var index = -1,\n      length = array == null ? 0 : array.length;\n\n  while (++index < length) {\n    if (predicate(array[index], index, array)) {\n      return true;\n    }\n  }\n  return false;\n}\n\nmodule.exports = arraySome;\n","var baseProperty = require('./_baseProperty');\n\n/**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\nvar asciiSize = baseProperty('length');\n\nmodule.exports = asciiSize;\n","var baseAssignValue = require('./_baseAssignValue'),\n    eq = require('./eq');\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n  if ((value !== undefined && !eq(object[key], value)) ||\n      (value === undefined && !(key in object))) {\n    baseAssignValue(object, key, value);\n  }\n}\n\nmodule.exports = assignMergeValue;\n","var baseAssignValue = require('./_baseAssignValue'),\n    eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n  var objValue = object[key];\n  if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n      (value === undefined && !(key in object))) {\n    baseAssignValue(object, key, value);\n  }\n}\n\nmodule.exports = assignValue;\n","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n  var length = array.length;\n  while (length--) {\n    if (eq(array[length][0], key)) {\n      return length;\n    }\n  }\n  return -1;\n}\n\nmodule.exports = assocIndexOf;\n","var baseEach = require('./_baseEach');\n\n/**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseAggregator(collection, setter, iteratee, accumulator) {\n  baseEach(collection, function(value, key, collection) {\n    setter(accumulator, value, iteratee(value), collection);\n  });\n  return accumulator;\n}\n\nmodule.exports = baseAggregator;\n","var copyObject = require('./_copyObject'),\n    keys = require('./keys');\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n  return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n","var copyObject = require('./_copyObject'),\n    keysIn = require('./keysIn');\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n  return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;\n","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n  if (key == '__proto__' && defineProperty) {\n    defineProperty(object, key, {\n      'configurable': true,\n      'enumerable': true,\n      'value': value,\n      'writable': true\n    });\n  } else {\n    object[key] = value;\n  }\n}\n\nmodule.exports = baseAssignValue;\n","var get = require('./get');\n\n/**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\nfunction baseAt(object, paths) {\n  var index = -1,\n      length = paths.length,\n      result = Array(length),\n      skip = object == null;\n\n  while (++index < length) {\n    result[index] = skip ? undefined : get(object, paths[index]);\n  }\n  return result;\n}\n\nmodule.exports = baseAt;\n","/**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\nfunction baseClamp(number, lower, upper) {\n  if (number === number) {\n    if (upper !== undefined) {\n      number = number <= upper ? number : upper;\n    }\n    if (lower !== undefined) {\n      number = number >= lower ? number : lower;\n    }\n  }\n  return number;\n}\n\nmodule.exports = baseClamp;\n","var Stack = require('./_Stack'),\n    arrayEach = require('./_arrayEach'),\n    assignValue = require('./_assignValue'),\n    baseAssign = require('./_baseAssign'),\n    baseAssignIn = require('./_baseAssignIn'),\n    cloneBuffer = require('./_cloneBuffer'),\n    copyArray = require('./_copyArray'),\n    copySymbols = require('./_copySymbols'),\n    copySymbolsIn = require('./_copySymbolsIn'),\n    getAllKeys = require('./_getAllKeys'),\n    getAllKeysIn = require('./_getAllKeysIn'),\n    getTag = require('./_getTag'),\n    initCloneArray = require('./_initCloneArray'),\n    initCloneByTag = require('./_initCloneByTag'),\n    initCloneObject = require('./_initCloneObject'),\n    isArray = require('./isArray'),\n    isBuffer = require('./isBuffer'),\n    isMap = require('./isMap'),\n    isObject = require('./isObject'),\n    isSet = require('./isSet'),\n    keys = require('./keys'),\n    keysIn = require('./keysIn');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n    CLONE_FLAT_FLAG = 2,\n    CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    objectTag = '[object Object]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]',\n    weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n *  1 - Deep clone\n *  2 - Flatten inherited properties\n *  4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n  var result,\n      isDeep = bitmask & CLONE_DEEP_FLAG,\n      isFlat = bitmask & CLONE_FLAT_FLAG,\n      isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n  if (customizer) {\n    result = object ? customizer(value, key, object, stack) : customizer(value);\n  }\n  if (result !== undefined) {\n    return result;\n  }\n  if (!isObject(value)) {\n    return value;\n  }\n  var isArr = isArray(value);\n  if (isArr) {\n    result = initCloneArray(value);\n    if (!isDeep) {\n      return copyArray(value, result);\n    }\n  } else {\n    var tag = getTag(value),\n        isFunc = tag == funcTag || tag == genTag;\n\n    if (isBuffer(value)) {\n      return cloneBuffer(value, isDeep);\n    }\n    if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n      result = (isFlat || isFunc) ? {} : initCloneObject(value);\n      if (!isDeep) {\n        return isFlat\n          ? copySymbolsIn(value, baseAssignIn(result, value))\n          : copySymbols(value, baseAssign(result, value));\n      }\n    } else {\n      if (!cloneableTags[tag]) {\n        return object ? value : {};\n      }\n      result = initCloneByTag(value, tag, isDeep);\n    }\n  }\n  // Check for circular references and return its corresponding clone.\n  stack || (stack = new Stack);\n  var stacked = stack.get(value);\n  if (stacked) {\n    return stacked;\n  }\n  stack.set(value, result);\n\n  if (isSet(value)) {\n    value.forEach(function(subValue) {\n      result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n    });\n  } else if (isMap(value)) {\n    value.forEach(function(subValue, key) {\n      result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n    });\n  }\n\n  var keysFunc = isFull\n    ? (isFlat ? getAllKeysIn : getAllKeys)\n    : (isFlat ? keysIn : keys);\n\n  var props = isArr ? undefined : keysFunc(value);\n  arrayEach(props || value, function(subValue, key) {\n    if (props) {\n      key = subValue;\n      subValue = value[key];\n    }\n    // Recursively populate clone (susceptible to call stack limits).\n    assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n  });\n  return result;\n}\n\nmodule.exports = baseClone;\n","var isObject = require('./isObject');\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n  function object() {}\n  return function(proto) {\n    if (!isObject(proto)) {\n      return {};\n    }\n    if (objectCreate) {\n      return objectCreate(proto);\n    }\n    object.prototype = proto;\n    var result = new object;\n    object.prototype = undefined;\n    return result;\n  };\n}());\n\nmodule.exports = baseCreate;\n","var SetCache = require('./_SetCache'),\n    arrayIncludes = require('./_arrayIncludes'),\n    arrayIncludesWith = require('./_arrayIncludesWith'),\n    arrayMap = require('./_arrayMap'),\n    baseUnary = require('./_baseUnary'),\n    cacheHas = require('./_cacheHas');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\nfunction baseDifference(array, values, iteratee, comparator) {\n  var index = -1,\n      includes = arrayIncludes,\n      isCommon = true,\n      length = array.length,\n      result = [],\n      valuesLength = values.length;\n\n  if (!length) {\n    return result;\n  }\n  if (iteratee) {\n    values = arrayMap(values, baseUnary(iteratee));\n  }\n  if (comparator) {\n    includes = arrayIncludesWith;\n    isCommon = false;\n  }\n  else if (values.length >= LARGE_ARRAY_SIZE) {\n    includes = cacheHas;\n    isCommon = false;\n    values = new SetCache(values);\n  }\n  outer:\n  while (++index < length) {\n    var value = array[index],\n        computed = iteratee == null ? value : iteratee(value);\n\n    value = (comparator || value !== 0) ? value : 0;\n    if (isCommon && computed === computed) {\n      var valuesIndex = valuesLength;\n      while (valuesIndex--) {\n        if (values[valuesIndex] === computed) {\n          continue outer;\n        }\n      }\n      result.push(value);\n    }\n    else if (!includes(values, computed, comparator)) {\n      result.push(value);\n    }\n  }\n  return result;\n}\n\nmodule.exports = baseDifference;\n","var baseForOwn = require('./_baseForOwn'),\n    createBaseEach = require('./_createBaseEach');\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nmodule.exports = baseEach;\n","var baseForOwnRight = require('./_baseForOwnRight'),\n    createBaseEach = require('./_createBaseEach');\n\n/**\n * The base implementation of `_.forEachRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEachRight = createBaseEach(baseForOwnRight, true);\n\nmodule.exports = baseEachRight;\n","var baseEach = require('./_baseEach');\n\n/**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n *  else `false`\n */\nfunction baseEvery(collection, predicate) {\n  var result = true;\n  baseEach(collection, function(value, index, collection) {\n    result = !!predicate(value, index, collection);\n    return result;\n  });\n  return result;\n}\n\nmodule.exports = baseEvery;\n","var toInteger = require('./toInteger'),\n    toLength = require('./toLength');\n\n/**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\nfunction baseFill(array, value, start, end) {\n  var length = array.length;\n\n  start = toInteger(start);\n  if (start < 0) {\n    start = -start > length ? 0 : (length + start);\n  }\n  end = (end === undefined || end > length) ? length : toInteger(end);\n  if (end < 0) {\n    end += length;\n  }\n  end = start > end ? 0 : toLength(end);\n  while (start < end) {\n    array[start++] = value;\n  }\n  return array;\n}\n\nmodule.exports = baseFill;\n","var baseEach = require('./_baseEach');\n\n/**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction baseFilter(collection, predicate) {\n  var result = [];\n  baseEach(collection, function(value, index, collection) {\n    if (predicate(value, index, collection)) {\n      result.push(value);\n    }\n  });\n  return result;\n}\n\nmodule.exports = baseFilter;\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n  var length = array.length,\n      index = fromIndex + (fromRight ? 1 : -1);\n\n  while ((fromRight ? index-- : ++index < length)) {\n    if (predicate(array[index], index, array)) {\n      return index;\n    }\n  }\n  return -1;\n}\n\nmodule.exports = baseFindIndex;\n","/**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\nfunction baseFindKey(collection, predicate, eachFunc) {\n  var result;\n  eachFunc(collection, function(value, key, collection) {\n    if (predicate(value, key, collection)) {\n      result = key;\n      return false;\n    }\n  });\n  return result;\n}\n\nmodule.exports = baseFindKey;\n","var arrayPush = require('./_arrayPush'),\n    isFlattenable = require('./_isFlattenable');\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n  var index = -1,\n      length = array.length;\n\n  predicate || (predicate = isFlattenable);\n  result || (result = []);\n\n  while (++index < length) {\n    var value = array[index];\n    if (depth > 0 && predicate(value)) {\n      if (depth > 1) {\n        // Recursively flatten arrays (susceptible to call stack limits).\n        baseFlatten(value, depth - 1, predicate, isStrict, result);\n      } else {\n        arrayPush(result, value);\n      }\n    } else if (!isStrict) {\n      result[result.length] = value;\n    }\n  }\n  return result;\n}\n\nmodule.exports = baseFlatten;\n","var createBaseFor = require('./_createBaseFor');\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n","var baseFor = require('./_baseFor'),\n    keys = require('./keys');\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n  return object && baseFor(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwn;\n","var baseForRight = require('./_baseForRight'),\n    keys = require('./keys');\n\n/**\n * The base implementation of `_.forOwnRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwnRight(object, iteratee) {\n  return object && baseForRight(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwnRight;\n","var createBaseFor = require('./_createBaseFor');\n\n/**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseForRight = createBaseFor(true);\n\nmodule.exports = baseForRight;\n","var arrayFilter = require('./_arrayFilter'),\n    isFunction = require('./isFunction');\n\n/**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\nfunction baseFunctions(object, props) {\n  return arrayFilter(props, function(key) {\n    return isFunction(object[key]);\n  });\n}\n\nmodule.exports = baseFunctions;\n","var castPath = require('./_castPath'),\n    toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n  path = castPath(path, object);\n\n  var index = 0,\n      length = path.length;\n\n  while (object != null && index < length) {\n    object = object[toKey(path[index++])];\n  }\n  return (index && index == length) ? object : undefined;\n}\n\nmodule.exports = baseGet;\n","var arrayPush = require('./_arrayPush'),\n    isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n  var result = keysFunc(object);\n  return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n","var Symbol = require('./_Symbol'),\n    getRawTag = require('./_getRawTag'),\n    objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n    undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n  if (value == null) {\n    return value === undefined ? undefinedTag : nullTag;\n  }\n  return (symToStringTag && symToStringTag in Object(value))\n    ? getRawTag(value)\n    : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHas(object, key) {\n  return object != null && hasOwnProperty.call(object, key);\n}\n\nmodule.exports = baseHas;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n  return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;\n","var baseFindIndex = require('./_baseFindIndex'),\n    baseIsNaN = require('./_baseIsNaN'),\n    strictIndexOf = require('./_strictIndexOf');\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n  return value === value\n    ? strictIndexOf(array, value, fromIndex)\n    : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nmodule.exports = baseIndexOf;\n","/**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOfWith(array, value, fromIndex, comparator) {\n  var index = fromIndex - 1,\n      length = array.length;\n\n  while (++index < length) {\n    if (comparator(array[index], value)) {\n      return index;\n    }\n  }\n  return -1;\n}\n\nmodule.exports = baseIndexOfWith;\n","var SetCache = require('./_SetCache'),\n    arrayIncludes = require('./_arrayIncludes'),\n    arrayIncludesWith = require('./_arrayIncludesWith'),\n    arrayMap = require('./_arrayMap'),\n    baseUnary = require('./_baseUnary'),\n    cacheHas = require('./_cacheHas');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\nfunction baseIntersection(arrays, iteratee, comparator) {\n  var includes = comparator ? arrayIncludesWith : arrayIncludes,\n      length = arrays[0].length,\n      othLength = arrays.length,\n      othIndex = othLength,\n      caches = Array(othLength),\n      maxLength = Infinity,\n      result = [];\n\n  while (othIndex--) {\n    var array = arrays[othIndex];\n    if (othIndex && iteratee) {\n      array = arrayMap(array, baseUnary(iteratee));\n    }\n    maxLength = nativeMin(array.length, maxLength);\n    caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n      ? new SetCache(othIndex && array)\n      : undefined;\n  }\n  array = arrays[0];\n\n  var index = -1,\n      seen = caches[0];\n\n  outer:\n  while (++index < length && result.length < maxLength) {\n    var value = array[index],\n        computed = iteratee ? iteratee(value) : value;\n\n    value = (comparator || value !== 0) ? value : 0;\n    if (!(seen\n          ? cacheHas(seen, computed)\n          : includes(result, computed, comparator)\n        )) {\n      othIndex = othLength;\n      while (--othIndex) {\n        var cache = caches[othIndex];\n        if (!(cache\n              ? cacheHas(cache, computed)\n              : includes(arrays[othIndex], computed, comparator))\n            ) {\n          continue outer;\n        }\n      }\n      if (seen) {\n        seen.push(computed);\n      }\n      result.push(value);\n    }\n  }\n  return result;\n}\n\nmodule.exports = baseIntersection;\n","var baseForOwn = require('./_baseForOwn');\n\n/**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseInverter(object, setter, iteratee, accumulator) {\n  baseForOwn(object, function(value, key, object) {\n    setter(accumulator, iteratee(value), key, object);\n  });\n  return accumulator;\n}\n\nmodule.exports = baseInverter;\n","var apply = require('./_apply'),\n    castPath = require('./_castPath'),\n    last = require('./last'),\n    parent = require('./_parent'),\n    toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\nfunction baseInvoke(object, path, args) {\n  path = castPath(path, object);\n  object = parent(object, path);\n  var func = object == null ? object : object[toKey(last(path))];\n  return func == null ? undefined : apply(func, object, args);\n}\n\nmodule.exports = baseInvoke;\n","var baseGetTag = require('./_baseGetTag'),\n    isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n  return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n    isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n *  1 - Unordered comparison\n *  2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n  if (value === other) {\n    return true;\n  }\n  if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n    return value !== value && other !== other;\n  }\n  return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n","var Stack = require('./_Stack'),\n    equalArrays = require('./_equalArrays'),\n    equalByTag = require('./_equalByTag'),\n    equalObjects = require('./_equalObjects'),\n    getTag = require('./_getTag'),\n    isArray = require('./isArray'),\n    isBuffer = require('./isBuffer'),\n    isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n  var objIsArr = isArray(object),\n      othIsArr = isArray(other),\n      objTag = objIsArr ? arrayTag : getTag(object),\n      othTag = othIsArr ? arrayTag : getTag(other);\n\n  objTag = objTag == argsTag ? objectTag : objTag;\n  othTag = othTag == argsTag ? objectTag : othTag;\n\n  var objIsObj = objTag == objectTag,\n      othIsObj = othTag == objectTag,\n      isSameTag = objTag == othTag;\n\n  if (isSameTag && isBuffer(object)) {\n    if (!isBuffer(other)) {\n      return false;\n    }\n    objIsArr = true;\n    objIsObj = false;\n  }\n  if (isSameTag && !objIsObj) {\n    stack || (stack = new Stack);\n    return (objIsArr || isTypedArray(object))\n      ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n      : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n  }\n  if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n    var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n        othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n    if (objIsWrapped || othIsWrapped) {\n      var objUnwrapped = objIsWrapped ? object.value() : object,\n          othUnwrapped = othIsWrapped ? other.value() : other;\n\n      stack || (stack = new Stack);\n      return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n    }\n  }\n  if (!isSameTag) {\n    return false;\n  }\n  stack || (stack = new Stack);\n  return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n","var getTag = require('./_getTag'),\n    isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n  return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nmodule.exports = baseIsMap;\n","var Stack = require('./_Stack'),\n    baseIsEqual = require('./_baseIsEqual');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n    COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n  var index = matchData.length,\n      length = index,\n      noCustomizer = !customizer;\n\n  if (object == null) {\n    return !length;\n  }\n  object = Object(object);\n  while (index--) {\n    var data = matchData[index];\n    if ((noCustomizer && data[2])\n          ? data[1] !== object[data[0]]\n          : !(data[0] in object)\n        ) {\n      return false;\n    }\n  }\n  while (++index < length) {\n    data = matchData[index];\n    var key = data[0],\n        objValue = object[key],\n        srcValue = data[1];\n\n    if (noCustomizer && data[2]) {\n      if (objValue === undefined && !(key in object)) {\n        return false;\n      }\n    } else {\n      var stack = new Stack;\n      if (customizer) {\n        var result = customizer(objValue, srcValue, key, object, source, stack);\n      }\n      if (!(result === undefined\n            ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n            : result\n          )) {\n        return false;\n      }\n    }\n  }\n  return true;\n}\n\nmodule.exports = baseIsMatch;\n","/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n  return value !== value;\n}\n\nmodule.exports = baseIsNaN;\n","var isFunction = require('./isFunction'),\n    isMasked = require('./_isMasked'),\n    isObject = require('./isObject'),\n    toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n  .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n *  else `false`.\n */\nfunction baseIsNative(value) {\n  if (!isObject(value) || isMasked(value)) {\n    return false;\n  }\n  var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n  return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","var getTag = require('./_getTag'),\n    isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n  return isObjectLike(value) && getTag(value) == setTag;\n}\n\nmodule.exports = baseIsSet;\n","var baseGetTag = require('./_baseGetTag'),\n    isLength = require('./isLength'),\n    isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    funcTag = '[object Function]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    objectTag = '[object Object]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n  return isObjectLike(value) &&\n    isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","var baseMatches = require('./_baseMatches'),\n    baseMatchesProperty = require('./_baseMatchesProperty'),\n    identity = require('./identity'),\n    isArray = require('./isArray'),\n    property = require('./property');\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n  // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n  // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n  if (typeof value == 'function') {\n    return value;\n  }\n  if (value == null) {\n    return identity;\n  }\n  if (typeof value == 'object') {\n    return isArray(value)\n      ? baseMatchesProperty(value[0], value[1])\n      : baseMatches(value);\n  }\n  return property(value);\n}\n\nmodule.exports = baseIteratee;\n","var isPrototype = require('./_isPrototype'),\n    nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n  if (!isPrototype(object)) {\n    return nativeKeys(object);\n  }\n  var result = [];\n  for (var key in Object(object)) {\n    if (hasOwnProperty.call(object, key) && key != 'constructor') {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nmodule.exports = baseKeys;\n","var isObject = require('./isObject'),\n    isPrototype = require('./_isPrototype'),\n    nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n  if (!isObject(object)) {\n    return nativeKeysIn(object);\n  }\n  var isProto = isPrototype(object),\n      result = [];\n\n  for (var key in object) {\n    if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nmodule.exports = baseKeysIn;\n","var baseEach = require('./_baseEach'),\n    isArrayLike = require('./isArrayLike');\n\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n  var index = -1,\n      result = isArrayLike(collection) ? Array(collection.length) : [];\n\n  baseEach(collection, function(value, key, collection) {\n    result[++index] = iteratee(value, key, collection);\n  });\n  return result;\n}\n\nmodule.exports = baseMap;\n","var baseIsMatch = require('./_baseIsMatch'),\n    getMatchData = require('./_getMatchData'),\n    matchesStrictComparable = require('./_matchesStrictComparable');\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n  var matchData = getMatchData(source);\n  if (matchData.length == 1 && matchData[0][2]) {\n    return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n  }\n  return function(object) {\n    return object === source || baseIsMatch(object, source, matchData);\n  };\n}\n\nmodule.exports = baseMatches;\n","var baseIsEqual = require('./_baseIsEqual'),\n    get = require('./get'),\n    hasIn = require('./hasIn'),\n    isKey = require('./_isKey'),\n    isStrictComparable = require('./_isStrictComparable'),\n    matchesStrictComparable = require('./_matchesStrictComparable'),\n    toKey = require('./_toKey');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n    COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n  if (isKey(path) && isStrictComparable(srcValue)) {\n    return matchesStrictComparable(toKey(path), srcValue);\n  }\n  return function(object) {\n    var objValue = get(object, path);\n    return (objValue === undefined && objValue === srcValue)\n      ? hasIn(object, path)\n      : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n  };\n}\n\nmodule.exports = baseMatchesProperty;\n","var Stack = require('./_Stack'),\n    assignMergeValue = require('./_assignMergeValue'),\n    baseFor = require('./_baseFor'),\n    baseMergeDeep = require('./_baseMergeDeep'),\n    isObject = require('./isObject'),\n    keysIn = require('./keysIn'),\n    safeGet = require('./_safeGet');\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n *  counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n  if (object === source) {\n    return;\n  }\n  baseFor(source, function(srcValue, key) {\n    stack || (stack = new Stack);\n    if (isObject(srcValue)) {\n      baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n    }\n    else {\n      var newValue = customizer\n        ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n        : undefined;\n\n      if (newValue === undefined) {\n        newValue = srcValue;\n      }\n      assignMergeValue(object, key, newValue);\n    }\n  }, keysIn);\n}\n\nmodule.exports = baseMerge;\n","var assignMergeValue = require('./_assignMergeValue'),\n    cloneBuffer = require('./_cloneBuffer'),\n    cloneTypedArray = require('./_cloneTypedArray'),\n    copyArray = require('./_copyArray'),\n    initCloneObject = require('./_initCloneObject'),\n    isArguments = require('./isArguments'),\n    isArray = require('./isArray'),\n    isArrayLikeObject = require('./isArrayLikeObject'),\n    isBuffer = require('./isBuffer'),\n    isFunction = require('./isFunction'),\n    isObject = require('./isObject'),\n    isPlainObject = require('./isPlainObject'),\n    isTypedArray = require('./isTypedArray'),\n    safeGet = require('./_safeGet'),\n    toPlainObject = require('./toPlainObject');\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n *  counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n  var objValue = safeGet(object, key),\n      srcValue = safeGet(source, key),\n      stacked = stack.get(srcValue);\n\n  if (stacked) {\n    assignMergeValue(object, key, stacked);\n    return;\n  }\n  var newValue = customizer\n    ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n    : undefined;\n\n  var isCommon = newValue === undefined;\n\n  if (isCommon) {\n    var isArr = isArray(srcValue),\n        isBuff = !isArr && isBuffer(srcValue),\n        isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n    newValue = srcValue;\n    if (isArr || isBuff || isTyped) {\n      if (isArray(objValue)) {\n        newValue = objValue;\n      }\n      else if (isArrayLikeObject(objValue)) {\n        newValue = copyArray(objValue);\n      }\n      else if (isBuff) {\n        isCommon = false;\n        newValue = cloneBuffer(srcValue, true);\n      }\n      else if (isTyped) {\n        isCommon = false;\n        newValue = cloneTypedArray(srcValue, true);\n      }\n      else {\n        newValue = [];\n      }\n    }\n    else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n      newValue = objValue;\n      if (isArguments(objValue)) {\n        newValue = toPlainObject(objValue);\n      }\n      else if (!isObject(objValue) || isFunction(objValue)) {\n        newValue = initCloneObject(srcValue);\n      }\n    }\n    else {\n      isCommon = false;\n    }\n  }\n  if (isCommon) {\n    // Recursively merge objects and arrays (susceptible to call stack limits).\n    stack.set(srcValue, newValue);\n    mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n    stack['delete'](srcValue);\n  }\n  assignMergeValue(object, key, newValue);\n}\n\nmodule.exports = baseMergeDeep;\n","var isIndex = require('./_isIndex');\n\n/**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\nfunction baseNth(array, n) {\n  var length = array.length;\n  if (!length) {\n    return;\n  }\n  n += n < 0 ? length : 0;\n  return isIndex(n, length) ? array[n] : undefined;\n}\n\nmodule.exports = baseNth;\n","var arrayMap = require('./_arrayMap'),\n    baseGet = require('./_baseGet'),\n    baseIteratee = require('./_baseIteratee'),\n    baseMap = require('./_baseMap'),\n    baseSortBy = require('./_baseSortBy'),\n    baseUnary = require('./_baseUnary'),\n    compareMultiple = require('./_compareMultiple'),\n    identity = require('./identity'),\n    isArray = require('./isArray');\n\n/**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\nfunction baseOrderBy(collection, iteratees, orders) {\n  if (iteratees.length) {\n    iteratees = arrayMap(iteratees, function(iteratee) {\n      if (isArray(iteratee)) {\n        return function(value) {\n          return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n        }\n      }\n      return iteratee;\n    });\n  } else {\n    iteratees = [identity];\n  }\n\n  var index = -1;\n  iteratees = arrayMap(iteratees, baseUnary(baseIteratee));\n\n  var result = baseMap(collection, function(value, key, collection) {\n    var criteria = arrayMap(iteratees, function(iteratee) {\n      return iteratee(value);\n    });\n    return { 'criteria': criteria, 'index': ++index, 'value': value };\n  });\n\n  return baseSortBy(result, function(object, other) {\n    return compareMultiple(object, other, orders);\n  });\n}\n\nmodule.exports = baseOrderBy;\n","var basePickBy = require('./_basePickBy'),\n    hasIn = require('./hasIn');\n\n/**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\nfunction basePick(object, paths) {\n  return basePickBy(object, paths, function(value, path) {\n    return hasIn(object, path);\n  });\n}\n\nmodule.exports = basePick;\n","var baseGet = require('./_baseGet'),\n    baseSet = require('./_baseSet'),\n    castPath = require('./_castPath');\n\n/**\n * The base implementation of  `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\nfunction basePickBy(object, paths, predicate) {\n  var index = -1,\n      length = paths.length,\n      result = {};\n\n  while (++index < length) {\n    var path = paths[index],\n        value = baseGet(object, path);\n\n    if (predicate(value, path)) {\n      baseSet(result, castPath(path, object), value);\n    }\n  }\n  return result;\n}\n\nmodule.exports = basePickBy;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n  return function(object) {\n    return object == null ? undefined : object[key];\n  };\n}\n\nmodule.exports = baseProperty;\n","var baseGet = require('./_baseGet');\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n  return function(object) {\n    return baseGet(object, path);\n  };\n}\n\nmodule.exports = basePropertyDeep;\n","var arrayMap = require('./_arrayMap'),\n    baseIndexOf = require('./_baseIndexOf'),\n    baseIndexOfWith = require('./_baseIndexOfWith'),\n    baseUnary = require('./_baseUnary'),\n    copyArray = require('./_copyArray');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\nfunction basePullAll(array, values, iteratee, comparator) {\n  var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n      index = -1,\n      length = values.length,\n      seen = array;\n\n  if (array === values) {\n    values = copyArray(values);\n  }\n  if (iteratee) {\n    seen = arrayMap(array, baseUnary(iteratee));\n  }\n  while (++index < length) {\n    var fromIndex = 0,\n        value = values[index],\n        computed = iteratee ? iteratee(value) : value;\n\n    while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n      if (seen !== array) {\n        splice.call(seen, fromIndex, 1);\n      }\n      splice.call(array, fromIndex, 1);\n    }\n  }\n  return array;\n}\n\nmodule.exports = basePullAll;\n","var baseUnset = require('./_baseUnset'),\n    isIndex = require('./_isIndex');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\nfunction basePullAt(array, indexes) {\n  var length = array ? indexes.length : 0,\n      lastIndex = length - 1;\n\n  while (length--) {\n    var index = indexes[length];\n    if (length == lastIndex || index !== previous) {\n      var previous = index;\n      if (isIndex(index)) {\n        splice.call(array, index, 1);\n      } else {\n        baseUnset(array, index);\n      }\n    }\n  }\n  return array;\n}\n\nmodule.exports = basePullAt;\n","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeFloor = Math.floor,\n    nativeRandom = Math.random;\n\n/**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\nfunction baseRandom(lower, upper) {\n  return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n}\n\nmodule.exports = baseRandom;\n","/**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n *  `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\nfunction baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n  eachFunc(collection, function(value, index, collection) {\n    accumulator = initAccum\n      ? (initAccum = false, value)\n      : iteratee(accumulator, value, index, collection);\n  });\n  return accumulator;\n}\n\nmodule.exports = baseReduce;\n","var identity = require('./identity'),\n    overRest = require('./_overRest'),\n    setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n  return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","var arraySample = require('./_arraySample'),\n    values = require('./values');\n\n/**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\nfunction baseSample(collection) {\n  return arraySample(values(collection));\n}\n\nmodule.exports = baseSample;\n","var baseClamp = require('./_baseClamp'),\n    shuffleSelf = require('./_shuffleSelf'),\n    values = require('./values');\n\n/**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\nfunction baseSampleSize(collection, n) {\n  var array = values(collection);\n  return shuffleSelf(array, baseClamp(n, 0, array.length));\n}\n\nmodule.exports = baseSampleSize;\n","var assignValue = require('./_assignValue'),\n    castPath = require('./_castPath'),\n    isIndex = require('./_isIndex'),\n    isObject = require('./isObject'),\n    toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseSet(object, path, value, customizer) {\n  if (!isObject(object)) {\n    return object;\n  }\n  path = castPath(path, object);\n\n  var index = -1,\n      length = path.length,\n      lastIndex = length - 1,\n      nested = object;\n\n  while (nested != null && ++index < length) {\n    var key = toKey(path[index]),\n        newValue = value;\n\n    if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n      return object;\n    }\n\n    if (index != lastIndex) {\n      var objValue = nested[key];\n      newValue = customizer ? customizer(objValue, key, nested) : undefined;\n      if (newValue === undefined) {\n        newValue = isObject(objValue)\n          ? objValue\n          : (isIndex(path[index + 1]) ? [] : {});\n      }\n    }\n    assignValue(nested, key, newValue);\n    nested = nested[key];\n  }\n  return object;\n}\n\nmodule.exports = baseSet;\n","var constant = require('./constant'),\n    defineProperty = require('./_defineProperty'),\n    identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n  return defineProperty(func, 'toString', {\n    'configurable': true,\n    'enumerable': false,\n    'value': constant(string),\n    'writable': true\n  });\n};\n\nmodule.exports = baseSetToString;\n","var shuffleSelf = require('./_shuffleSelf'),\n    values = require('./values');\n\n/**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\nfunction baseShuffle(collection) {\n  return shuffleSelf(values(collection));\n}\n\nmodule.exports = baseShuffle;\n","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n  var index = -1,\n      length = array.length;\n\n  if (start < 0) {\n    start = -start > length ? 0 : (length + start);\n  }\n  end = end > length ? length : end;\n  if (end < 0) {\n    end += length;\n  }\n  length = start > end ? 0 : ((end - start) >>> 0);\n  start >>>= 0;\n\n  var result = Array(length);\n  while (++index < length) {\n    result[index] = array[index + start];\n  }\n  return result;\n}\n\nmodule.exports = baseSlice;\n","var baseEach = require('./_baseEach');\n\n/**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n *  else `false`.\n */\nfunction baseSome(collection, predicate) {\n  var result;\n\n  baseEach(collection, function(value, index, collection) {\n    result = predicate(value, index, collection);\n    return !result;\n  });\n  return !!result;\n}\n\nmodule.exports = baseSome;\n","/**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\nfunction baseSortBy(array, comparer) {\n  var length = array.length;\n\n  array.sort(comparer);\n  while (length--) {\n    array[length] = array[length].value;\n  }\n  return array;\n}\n\nmodule.exports = baseSortBy;\n","var baseSortedIndexBy = require('./_baseSortedIndexBy'),\n    identity = require('./identity'),\n    isSymbol = require('./isSymbol');\n\n/** Used as references for the maximum length and index of an array. */\nvar MAX_ARRAY_LENGTH = 4294967295,\n    HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n/**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n *  into `array`.\n */\nfunction baseSortedIndex(array, value, retHighest) {\n  var low = 0,\n      high = array == null ? low : array.length;\n\n  if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n    while (low < high) {\n      var mid = (low + high) >>> 1,\n          computed = array[mid];\n\n      if (computed !== null && !isSymbol(computed) &&\n          (retHighest ? (computed <= value) : (computed < value))) {\n        low = mid + 1;\n      } else {\n        high = mid;\n      }\n    }\n    return high;\n  }\n  return baseSortedIndexBy(array, value, identity, retHighest);\n}\n\nmodule.exports = baseSortedIndex;\n","var isSymbol = require('./isSymbol');\n\n/** Used as references for the maximum length and index of an array. */\nvar MAX_ARRAY_LENGTH = 4294967295,\n    MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeFloor = Math.floor,\n    nativeMin = Math.min;\n\n/**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n *  into `array`.\n */\nfunction baseSortedIndexBy(array, value, iteratee, retHighest) {\n  var low = 0,\n      high = array == null ? 0 : array.length;\n  if (high === 0) {\n    return 0;\n  }\n\n  value = iteratee(value);\n  var valIsNaN = value !== value,\n      valIsNull = value === null,\n      valIsSymbol = isSymbol(value),\n      valIsUndefined = value === undefined;\n\n  while (low < high) {\n    var mid = nativeFloor((low + high) / 2),\n        computed = iteratee(array[mid]),\n        othIsDefined = computed !== undefined,\n        othIsNull = computed === null,\n        othIsReflexive = computed === computed,\n        othIsSymbol = isSymbol(computed);\n\n    if (valIsNaN) {\n      var setLow = retHighest || othIsReflexive;\n    } else if (valIsUndefined) {\n      setLow = othIsReflexive && (retHighest || othIsDefined);\n    } else if (valIsNull) {\n      setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n    } else if (valIsSymbol) {\n      setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n    } else if (othIsNull || othIsSymbol) {\n      setLow = false;\n    } else {\n      setLow = retHighest ? (computed <= value) : (computed < value);\n    }\n    if (setLow) {\n      low = mid + 1;\n    } else {\n      high = mid;\n    }\n  }\n  return nativeMin(high, MAX_ARRAY_INDEX);\n}\n\nmodule.exports = baseSortedIndexBy;\n","var eq = require('./eq');\n\n/**\n * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseSortedUniq(array, iteratee) {\n  var index = -1,\n      length = array.length,\n      resIndex = 0,\n      result = [];\n\n  while (++index < length) {\n    var value = array[index],\n        computed = iteratee ? iteratee(value) : value;\n\n    if (!index || !eq(computed, seen)) {\n      var seen = computed;\n      result[resIndex++] = value === 0 ? 0 : value;\n    }\n  }\n  return result;\n}\n\nmodule.exports = baseSortedUniq;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n  var index = -1,\n      result = Array(n);\n\n  while (++index < n) {\n    result[index] = iteratee(index);\n  }\n  return result;\n}\n\nmodule.exports = baseTimes;\n","var arrayMap = require('./_arrayMap');\n\n/**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\nfunction baseToPairs(object, props) {\n  return arrayMap(props, function(key) {\n    return [key, object[key]];\n  });\n}\n\nmodule.exports = baseToPairs;\n","var Symbol = require('./_Symbol'),\n    arrayMap = require('./_arrayMap'),\n    isArray = require('./isArray'),\n    isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n  // Exit early for strings to avoid a performance hit in some environments.\n  if (typeof value == 'string') {\n    return value;\n  }\n  if (isArray(value)) {\n    // Recursively convert values (susceptible to call stack limits).\n    return arrayMap(value, baseToString) + '';\n  }\n  if (isSymbol(value)) {\n    return symbolToString ? symbolToString.call(value) : '';\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n  return string\n    ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n    : string;\n}\n\nmodule.exports = baseTrim;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n  return function(value) {\n    return func(value);\n  };\n}\n\nmodule.exports = baseUnary;\n","var SetCache = require('./_SetCache'),\n    arrayIncludes = require('./_arrayIncludes'),\n    arrayIncludesWith = require('./_arrayIncludesWith'),\n    cacheHas = require('./_cacheHas'),\n    createSet = require('./_createSet'),\n    setToArray = require('./_setToArray');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n  var index = -1,\n      includes = arrayIncludes,\n      length = array.length,\n      isCommon = true,\n      result = [],\n      seen = result;\n\n  if (comparator) {\n    isCommon = false;\n    includes = arrayIncludesWith;\n  }\n  else if (length >= LARGE_ARRAY_SIZE) {\n    var set = iteratee ? null : createSet(array);\n    if (set) {\n      return setToArray(set);\n    }\n    isCommon = false;\n    includes = cacheHas;\n    seen = new SetCache;\n  }\n  else {\n    seen = iteratee ? [] : result;\n  }\n  outer:\n  while (++index < length) {\n    var value = array[index],\n        computed = iteratee ? iteratee(value) : value;\n\n    value = (comparator || value !== 0) ? value : 0;\n    if (isCommon && computed === computed) {\n      var seenIndex = seen.length;\n      while (seenIndex--) {\n        if (seen[seenIndex] === computed) {\n          continue outer;\n        }\n      }\n      if (iteratee) {\n        seen.push(computed);\n      }\n      result.push(value);\n    }\n    else if (!includes(seen, computed, comparator)) {\n      if (seen !== result) {\n        seen.push(computed);\n      }\n      result.push(value);\n    }\n  }\n  return result;\n}\n\nmodule.exports = baseUniq;\n","var castPath = require('./_castPath'),\n    last = require('./last'),\n    parent = require('./_parent'),\n    toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\nfunction baseUnset(object, path) {\n  path = castPath(path, object);\n  object = parent(object, path);\n  return object == null || delete object[toKey(last(path))];\n}\n\nmodule.exports = baseUnset;\n","var baseGet = require('./_baseGet'),\n    baseSet = require('./_baseSet');\n\n/**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseUpdate(object, path, updater, customizer) {\n  return baseSet(object, path, updater(baseGet(object, path)), customizer);\n}\n\nmodule.exports = baseUpdate;\n","var arrayMap = require('./_arrayMap');\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n  return arrayMap(props, function(key) {\n    return object[key];\n  });\n}\n\nmodule.exports = baseValues;\n","var baseSlice = require('./_baseSlice');\n\n/**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseWhile(array, predicate, isDrop, fromRight) {\n  var length = array.length,\n      index = fromRight ? length : -1;\n\n  while ((fromRight ? index-- : ++index < length) &&\n    predicate(array[index], index, array)) {}\n\n  return isDrop\n    ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n    : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n}\n\nmodule.exports = baseWhile;\n","var baseDifference = require('./_baseDifference'),\n    baseFlatten = require('./_baseFlatten'),\n    baseUniq = require('./_baseUniq');\n\n/**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of values.\n */\nfunction baseXor(arrays, iteratee, comparator) {\n  var length = arrays.length;\n  if (length < 2) {\n    return length ? baseUniq(arrays[0]) : [];\n  }\n  var index = -1,\n      result = Array(length);\n\n  while (++index < length) {\n    var array = arrays[index],\n        othIndex = -1;\n\n    while (++othIndex < length) {\n      if (othIndex != index) {\n        result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);\n      }\n    }\n  }\n  return baseUniq(baseFlatten(result, 1), iteratee, comparator);\n}\n\nmodule.exports = baseXor;\n","/**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\nfunction baseZipObject(props, values, assignFunc) {\n  var index = -1,\n      length = props.length,\n      valsLength = values.length,\n      result = {};\n\n  while (++index < length) {\n    var value = index < valsLength ? values[index] : undefined;\n    assignFunc(result, props[index], value);\n  }\n  return result;\n}\n\nmodule.exports = baseZipObject;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n  return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n","var isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\nfunction castArrayLikeObject(value) {\n  return isArrayLikeObject(value) ? value : [];\n}\n\nmodule.exports = castArrayLikeObject;\n","var identity = require('./identity');\n\n/**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\nfunction castFunction(value) {\n  return typeof value == 'function' ? value : identity;\n}\n\nmodule.exports = castFunction;\n","var isArray = require('./isArray'),\n    isKey = require('./_isKey'),\n    stringToPath = require('./_stringToPath'),\n    toString = require('./toString');\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n  if (isArray(value)) {\n    return value;\n  }\n  return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nmodule.exports = castPath;\n","var Uint8Array = require('./_Uint8Array');\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n  var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n  new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n  return result;\n}\n\nmodule.exports = cloneArrayBuffer;\n","var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n    allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of  `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n  if (isDeep) {\n    return buffer.slice();\n  }\n  var length = buffer.length,\n      result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n  buffer.copy(result);\n  return result;\n}\n\nmodule.exports = cloneBuffer;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n  var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n  return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n  var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n  result.lastIndex = regexp.lastIndex;\n  return result;\n}\n\nmodule.exports = cloneRegExp;\n","var Symbol = require('./_Symbol');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n  return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n  var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n  return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nmodule.exports = cloneTypedArray;\n","var isSymbol = require('./isSymbol');\n\n/**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\nfunction compareAscending(value, other) {\n  if (value !== other) {\n    var valIsDefined = value !== undefined,\n        valIsNull = value === null,\n        valIsReflexive = value === value,\n        valIsSymbol = isSymbol(value);\n\n    var othIsDefined = other !== undefined,\n        othIsNull = other === null,\n        othIsReflexive = other === other,\n        othIsSymbol = isSymbol(other);\n\n    if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n        (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n        (valIsNull && othIsDefined && othIsReflexive) ||\n        (!valIsDefined && othIsReflexive) ||\n        !valIsReflexive) {\n      return 1;\n    }\n    if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n        (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n        (othIsNull && valIsDefined && valIsReflexive) ||\n        (!othIsDefined && valIsReflexive) ||\n        !othIsReflexive) {\n      return -1;\n    }\n  }\n  return 0;\n}\n\nmodule.exports = compareAscending;\n","var compareAscending = require('./_compareAscending');\n\n/**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\nfunction compareMultiple(object, other, orders) {\n  var index = -1,\n      objCriteria = object.criteria,\n      othCriteria = other.criteria,\n      length = objCriteria.length,\n      ordersLength = orders.length;\n\n  while (++index < length) {\n    var result = compareAscending(objCriteria[index], othCriteria[index]);\n    if (result) {\n      if (index >= ordersLength) {\n        return result;\n      }\n      var order = orders[index];\n      return result * (order == 'desc' ? -1 : 1);\n    }\n  }\n  // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n  // that causes it, under certain circumstances, to provide the same value for\n  // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n  // for more details.\n  //\n  // This also ensures a stable sort in V8 and other engines.\n  // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n  return object.index - other.index;\n}\n\nmodule.exports = compareMultiple;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n  var index = -1,\n      length = source.length;\n\n  array || (array = Array(length));\n  while (++index < length) {\n    array[index] = source[index];\n  }\n  return array;\n}\n\nmodule.exports = copyArray;\n","var assignValue = require('./_assignValue'),\n    baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n  var isNew = !object;\n  object || (object = {});\n\n  var index = -1,\n      length = props.length;\n\n  while (++index < length) {\n    var key = props[index];\n\n    var newValue = customizer\n      ? customizer(object[key], source[key], key, object, source)\n      : undefined;\n\n    if (newValue === undefined) {\n      newValue = source[key];\n    }\n    if (isNew) {\n      baseAssignValue(object, key, newValue);\n    } else {\n      assignValue(object, key, newValue);\n    }\n  }\n  return object;\n}\n\nmodule.exports = copyObject;\n","var copyObject = require('./_copyObject'),\n    getSymbols = require('./_getSymbols');\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n  return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n","var copyObject = require('./_copyObject'),\n    getSymbolsIn = require('./_getSymbolsIn');\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n  return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var arrayAggregator = require('./_arrayAggregator'),\n    baseAggregator = require('./_baseAggregator'),\n    baseIteratee = require('./_baseIteratee'),\n    isArray = require('./isArray');\n\n/**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\nfunction createAggregator(setter, initializer) {\n  return function(collection, iteratee) {\n    var func = isArray(collection) ? arrayAggregator : baseAggregator,\n        accumulator = initializer ? initializer() : {};\n\n    return func(collection, setter, baseIteratee(iteratee, 2), accumulator);\n  };\n}\n\nmodule.exports = createAggregator;\n","var baseRest = require('./_baseRest'),\n    isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n  return baseRest(function(object, sources) {\n    var index = -1,\n        length = sources.length,\n        customizer = length > 1 ? sources[length - 1] : undefined,\n        guard = length > 2 ? sources[2] : undefined;\n\n    customizer = (assigner.length > 3 && typeof customizer == 'function')\n      ? (length--, customizer)\n      : undefined;\n\n    if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n      customizer = length < 3 ? undefined : customizer;\n      length = 1;\n    }\n    object = Object(object);\n    while (++index < length) {\n      var source = sources[index];\n      if (source) {\n        assigner(object, source, index, customizer);\n      }\n    }\n    return object;\n  });\n}\n\nmodule.exports = createAssigner;\n","var isArrayLike = require('./isArrayLike');\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n  return function(collection, iteratee) {\n    if (collection == null) {\n      return collection;\n    }\n    if (!isArrayLike(collection)) {\n      return eachFunc(collection, iteratee);\n    }\n    var length = collection.length,\n        index = fromRight ? length : -1,\n        iterable = Object(collection);\n\n    while ((fromRight ? index-- : ++index < length)) {\n      if (iteratee(iterable[index], index, iterable) === false) {\n        break;\n      }\n    }\n    return collection;\n  };\n}\n\nmodule.exports = createBaseEach;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n  return function(object, iteratee, keysFunc) {\n    var index = -1,\n        iterable = Object(object),\n        props = keysFunc(object),\n        length = props.length;\n\n    while (length--) {\n      var key = props[fromRight ? length : ++index];\n      if (iteratee(iterable[key], key, iterable) === false) {\n        break;\n      }\n    }\n    return object;\n  };\n}\n\nmodule.exports = createBaseFor;\n","var baseIteratee = require('./_baseIteratee'),\n    isArrayLike = require('./isArrayLike'),\n    keys = require('./keys');\n\n/**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\nfunction createFind(findIndexFunc) {\n  return function(collection, predicate, fromIndex) {\n    var iterable = Object(collection);\n    if (!isArrayLike(collection)) {\n      var iteratee = baseIteratee(predicate, 3);\n      collection = keys(collection);\n      predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n    }\n    var index = findIndexFunc(collection, predicate, fromIndex);\n    return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n  };\n}\n\nmodule.exports = createFind;\n","var baseInverter = require('./_baseInverter');\n\n/**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\nfunction createInverter(setter, toIteratee) {\n  return function(object, iteratee) {\n    return baseInverter(object, setter, toIteratee(iteratee), {});\n  };\n}\n\nmodule.exports = createInverter;\n","var Set = require('./_Set'),\n    noop = require('./noop'),\n    setToArray = require('./_setToArray');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n  return new Set(values);\n};\n\nmodule.exports = createSet;\n","var baseToPairs = require('./_baseToPairs'),\n    getTag = require('./_getTag'),\n    mapToArray = require('./_mapToArray'),\n    setToPairs = require('./_setToPairs');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n    setTag = '[object Set]';\n\n/**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\nfunction createToPairs(keysFunc) {\n  return function(object) {\n    var tag = getTag(object);\n    if (tag == mapTag) {\n      return mapToArray(object);\n    }\n    if (tag == setTag) {\n      return setToPairs(object);\n    }\n    return baseToPairs(object, keysFunc(object));\n  };\n}\n\nmodule.exports = createToPairs;\n","var baseMerge = require('./_baseMerge'),\n    isObject = require('./isObject');\n\n/**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n *  counterparts.\n * @returns {*} Returns the value to assign.\n */\nfunction customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n  if (isObject(objValue) && isObject(srcValue)) {\n    // Recursively merge objects and arrays (susceptible to call stack limits).\n    stack.set(srcValue, objValue);\n    baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n    stack['delete'](srcValue);\n  }\n  return objValue;\n}\n\nmodule.exports = customDefaultsMerge;\n","var isPlainObject = require('./isPlainObject');\n\n/**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\nfunction customOmitClone(value) {\n  return isPlainObject(value) ? undefined : value;\n}\n\nmodule.exports = customOmitClone;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n  try {\n    var func = getNative(Object, 'defineProperty');\n    func({}, '', {});\n    return func;\n  } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var SetCache = require('./_SetCache'),\n    arraySome = require('./_arraySome'),\n    cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n    COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n  var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n      arrLength = array.length,\n      othLength = other.length;\n\n  if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n    return false;\n  }\n  // Check that cyclic values are equal.\n  var arrStacked = stack.get(array);\n  var othStacked = stack.get(other);\n  if (arrStacked && othStacked) {\n    return arrStacked == other && othStacked == array;\n  }\n  var index = -1,\n      result = true,\n      seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n  stack.set(array, other);\n  stack.set(other, array);\n\n  // Ignore non-index properties.\n  while (++index < arrLength) {\n    var arrValue = array[index],\n        othValue = other[index];\n\n    if (customizer) {\n      var compared = isPartial\n        ? customizer(othValue, arrValue, index, other, array, stack)\n        : customizer(arrValue, othValue, index, array, other, stack);\n    }\n    if (compared !== undefined) {\n      if (compared) {\n        continue;\n      }\n      result = false;\n      break;\n    }\n    // Recursively compare arrays (susceptible to call stack limits).\n    if (seen) {\n      if (!arraySome(other, function(othValue, othIndex) {\n            if (!cacheHas(seen, othIndex) &&\n                (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n              return seen.push(othIndex);\n            }\n          })) {\n        result = false;\n        break;\n      }\n    } else if (!(\n          arrValue === othValue ||\n            equalFunc(arrValue, othValue, bitmask, customizer, stack)\n        )) {\n      result = false;\n      break;\n    }\n  }\n  stack['delete'](array);\n  stack['delete'](other);\n  return result;\n}\n\nmodule.exports = equalArrays;\n","var Symbol = require('./_Symbol'),\n    Uint8Array = require('./_Uint8Array'),\n    eq = require('./eq'),\n    equalArrays = require('./_equalArrays'),\n    mapToArray = require('./_mapToArray'),\n    setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n    COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n  switch (tag) {\n    case dataViewTag:\n      if ((object.byteLength != other.byteLength) ||\n          (object.byteOffset != other.byteOffset)) {\n        return false;\n      }\n      object = object.buffer;\n      other = other.buffer;\n\n    case arrayBufferTag:\n      if ((object.byteLength != other.byteLength) ||\n          !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n        return false;\n      }\n      return true;\n\n    case boolTag:\n    case dateTag:\n    case numberTag:\n      // Coerce booleans to `1` or `0` and dates to milliseconds.\n      // Invalid dates are coerced to `NaN`.\n      return eq(+object, +other);\n\n    case errorTag:\n      return object.name == other.name && object.message == other.message;\n\n    case regexpTag:\n    case stringTag:\n      // Coerce regexes to strings and treat strings, primitives and objects,\n      // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n      // for more details.\n      return object == (other + '');\n\n    case mapTag:\n      var convert = mapToArray;\n\n    case setTag:\n      var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n      convert || (convert = setToArray);\n\n      if (object.size != other.size && !isPartial) {\n        return false;\n      }\n      // Assume cyclic values are equal.\n      var stacked = stack.get(object);\n      if (stacked) {\n        return stacked == other;\n      }\n      bitmask |= COMPARE_UNORDERED_FLAG;\n\n      // Recursively compare objects (susceptible to call stack limits).\n      stack.set(object, other);\n      var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n      stack['delete'](object);\n      return result;\n\n    case symbolTag:\n      if (symbolValueOf) {\n        return symbolValueOf.call(object) == symbolValueOf.call(other);\n      }\n  }\n  return false;\n}\n\nmodule.exports = equalByTag;\n","var getAllKeys = require('./_getAllKeys');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n  var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n      objProps = getAllKeys(object),\n      objLength = objProps.length,\n      othProps = getAllKeys(other),\n      othLength = othProps.length;\n\n  if (objLength != othLength && !isPartial) {\n    return false;\n  }\n  var index = objLength;\n  while (index--) {\n    var key = objProps[index];\n    if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n      return false;\n    }\n  }\n  // Check that cyclic values are equal.\n  var objStacked = stack.get(object);\n  var othStacked = stack.get(other);\n  if (objStacked && othStacked) {\n    return objStacked == other && othStacked == object;\n  }\n  var result = true;\n  stack.set(object, other);\n  stack.set(other, object);\n\n  var skipCtor = isPartial;\n  while (++index < objLength) {\n    key = objProps[index];\n    var objValue = object[key],\n        othValue = other[key];\n\n    if (customizer) {\n      var compared = isPartial\n        ? customizer(othValue, objValue, key, other, object, stack)\n        : customizer(objValue, othValue, key, object, other, stack);\n    }\n    // Recursively compare objects (susceptible to call stack limits).\n    if (!(compared === undefined\n          ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n          : compared\n        )) {\n      result = false;\n      break;\n    }\n    skipCtor || (skipCtor = key == 'constructor');\n  }\n  if (result && !skipCtor) {\n    var objCtor = object.constructor,\n        othCtor = other.constructor;\n\n    // Non `Object` object instances with different constructors are not equal.\n    if (objCtor != othCtor &&\n        ('constructor' in object && 'constructor' in other) &&\n        !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n          typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n      result = false;\n    }\n  }\n  stack['delete'](object);\n  stack['delete'](other);\n  return result;\n}\n\nmodule.exports = equalObjects;\n","var flatten = require('./flatten'),\n    overRest = require('./_overRest'),\n    setToString = require('./_setToString');\n\n/**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\nfunction flatRest(func) {\n  return setToString(overRest(func, undefined, flatten), func + '');\n}\n\nmodule.exports = flatRest;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n    getSymbols = require('./_getSymbols'),\n    keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n  return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n    getSymbolsIn = require('./_getSymbolsIn'),\n    keysIn = require('./keysIn');\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n  return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nmodule.exports = getAllKeysIn;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n  var data = map.__data__;\n  return isKeyable(key)\n    ? data[typeof key == 'string' ? 'string' : 'hash']\n    : data.map;\n}\n\nmodule.exports = getMapData;\n","var isStrictComparable = require('./_isStrictComparable'),\n    keys = require('./keys');\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n  var result = keys(object),\n      length = result.length;\n\n  while (length--) {\n    var key = result[length],\n        value = object[key];\n\n    result[length] = [key, value, isStrictComparable(value)];\n  }\n  return result;\n}\n\nmodule.exports = getMatchData;\n","var baseIsNative = require('./_baseIsNative'),\n    getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n  var value = getValue(object, key);\n  return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n  var isOwn = hasOwnProperty.call(value, symToStringTag),\n      tag = value[symToStringTag];\n\n  try {\n    value[symToStringTag] = undefined;\n    var unmasked = true;\n  } catch (e) {}\n\n  var result = nativeObjectToString.call(value);\n  if (unmasked) {\n    if (isOwn) {\n      value[symToStringTag] = tag;\n    } else {\n      delete value[symToStringTag];\n    }\n  }\n  return result;\n}\n\nmodule.exports = getRawTag;\n","var arrayFilter = require('./_arrayFilter'),\n    stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n  if (object == null) {\n    return [];\n  }\n  object = Object(object);\n  return arrayFilter(nativeGetSymbols(object), function(symbol) {\n    return propertyIsEnumerable.call(object, symbol);\n  });\n};\n\nmodule.exports = getSymbols;\n","var arrayPush = require('./_arrayPush'),\n    getPrototype = require('./_getPrototype'),\n    getSymbols = require('./_getSymbols'),\n    stubArray = require('./stubArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n  var result = [];\n  while (object) {\n    arrayPush(result, getSymbols(object));\n    object = getPrototype(object);\n  }\n  return result;\n};\n\nmodule.exports = getSymbolsIn;\n","var DataView = require('./_DataView'),\n    Map = require('./_Map'),\n    Promise = require('./_Promise'),\n    Set = require('./_Set'),\n    WeakMap = require('./_WeakMap'),\n    baseGetTag = require('./_baseGetTag'),\n    toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n    objectTag = '[object Object]',\n    promiseTag = '[object Promise]',\n    setTag = '[object Set]',\n    weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n    mapCtorString = toSource(Map),\n    promiseCtorString = toSource(Promise),\n    setCtorString = toSource(Set),\n    weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n    (Map && getTag(new Map) != mapTag) ||\n    (Promise && getTag(Promise.resolve()) != promiseTag) ||\n    (Set && getTag(new Set) != setTag) ||\n    (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n  getTag = function(value) {\n    var result = baseGetTag(value),\n        Ctor = result == objectTag ? value.constructor : undefined,\n        ctorString = Ctor ? toSource(Ctor) : '';\n\n    if (ctorString) {\n      switch (ctorString) {\n        case dataViewCtorString: return dataViewTag;\n        case mapCtorString: return mapTag;\n        case promiseCtorString: return promiseTag;\n        case setCtorString: return setTag;\n        case weakMapCtorString: return weakMapTag;\n      }\n    }\n    return result;\n  };\n}\n\nmodule.exports = getTag;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n  return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var castPath = require('./_castPath'),\n    isArguments = require('./isArguments'),\n    isArray = require('./isArray'),\n    isIndex = require('./_isIndex'),\n    isLength = require('./isLength'),\n    toKey = require('./_toKey');\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n  path = castPath(path, object);\n\n  var index = -1,\n      length = path.length,\n      result = false;\n\n  while (++index < length) {\n    var key = toKey(path[index]);\n    if (!(result = object != null && hasFunc(object, key))) {\n      break;\n    }\n    object = object[key];\n  }\n  if (result || ++index != length) {\n    return result;\n  }\n  length = object == null ? 0 : object.length;\n  return !!length && isLength(length) && isIndex(key, length) &&\n    (isArray(object) || isArguments(object));\n}\n\nmodule.exports = hasPath;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n    rsComboMarksRange = '\\\\u0300-\\\\u036f',\n    reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n    rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n    rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n    rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsZWJ = '\\\\u200d';\n\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange  + rsComboRange + rsVarRange + ']');\n\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\nfunction hasUnicode(string) {\n  return reHasUnicode.test(string);\n}\n\nmodule.exports = hasUnicode;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n  this.__data__ = nativeCreate ? nativeCreate(null) : {};\n  this.size = 0;\n}\n\nmodule.exports = hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n  var result = this.has(key) && delete this.__data__[key];\n  this.size -= result ? 1 : 0;\n  return result;\n}\n\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n  var data = this.__data__;\n  if (nativeCreate) {\n    var result = data[key];\n    return result === HASH_UNDEFINED ? undefined : result;\n  }\n  return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n  var data = this.__data__;\n  return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n  var data = this.__data__;\n  this.size += this.has(key) ? 0 : 1;\n  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n  return this;\n}\n\nmodule.exports = hashSet;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n  var length = array.length,\n      result = new array.constructor(length);\n\n  // Add properties assigned by `RegExp#exec`.\n  if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n    result.index = array.index;\n    result.input = array.input;\n  }\n  return result;\n}\n\nmodule.exports = initCloneArray;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n    cloneDataView = require('./_cloneDataView'),\n    cloneRegExp = require('./_cloneRegExp'),\n    cloneSymbol = require('./_cloneSymbol'),\n    cloneTypedArray = require('./_cloneTypedArray');\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n  var Ctor = object.constructor;\n  switch (tag) {\n    case arrayBufferTag:\n      return cloneArrayBuffer(object);\n\n    case boolTag:\n    case dateTag:\n      return new Ctor(+object);\n\n    case dataViewTag:\n      return cloneDataView(object, isDeep);\n\n    case float32Tag: case float64Tag:\n    case int8Tag: case int16Tag: case int32Tag:\n    case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n      return cloneTypedArray(object, isDeep);\n\n    case mapTag:\n      return new Ctor;\n\n    case numberTag:\n    case stringTag:\n      return new Ctor(object);\n\n    case regexpTag:\n      return cloneRegExp(object);\n\n    case setTag:\n      return new Ctor;\n\n    case symbolTag:\n      return cloneSymbol(object);\n  }\n}\n\nmodule.exports = initCloneByTag;\n","var baseCreate = require('./_baseCreate'),\n    getPrototype = require('./_getPrototype'),\n    isPrototype = require('./_isPrototype');\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n  return (typeof object.constructor == 'function' && !isPrototype(object))\n    ? baseCreate(getPrototype(object))\n    : {};\n}\n\nmodule.exports = initCloneObject;\n","var Symbol = require('./_Symbol'),\n    isArguments = require('./isArguments'),\n    isArray = require('./isArray');\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n  return isArray(value) || isArguments(value) ||\n    !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n  var type = typeof value;\n  length = length == null ? MAX_SAFE_INTEGER : length;\n\n  return !!length &&\n    (type == 'number' ||\n      (type != 'symbol' && reIsUint.test(value))) &&\n        (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","var eq = require('./eq'),\n    isArrayLike = require('./isArrayLike'),\n    isIndex = require('./_isIndex'),\n    isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n *  else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n  if (!isObject(object)) {\n    return false;\n  }\n  var type = typeof index;\n  if (type == 'number'\n        ? (isArrayLike(object) && isIndex(index, object.length))\n        : (type == 'string' && index in object)\n      ) {\n    return eq(object[index], value);\n  }\n  return false;\n}\n\nmodule.exports = isIterateeCall;\n","var isArray = require('./isArray'),\n    isSymbol = require('./isSymbol');\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n    reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n  if (isArray(value)) {\n    return false;\n  }\n  var type = typeof value;\n  if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n      value == null || isSymbol(value)) {\n    return true;\n  }\n  return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n    (object != null && value in Object(object));\n}\n\nmodule.exports = isKey;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n  var type = typeof value;\n  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n    ? (value !== '__proto__')\n    : (value === null);\n}\n\nmodule.exports = isKeyable;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n  return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n  return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n  var Ctor = value && value.constructor,\n      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n  return value === proto;\n}\n\nmodule.exports = isPrototype;\n","var isObject = require('./isObject');\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n *  equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n  return value === value && !isObject(value);\n}\n\nmodule.exports = isStrictComparable;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n  this.__data__ = [];\n  this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    return false;\n  }\n  var lastIndex = data.length - 1;\n  if (index == lastIndex) {\n    data.pop();\n  } else {\n    splice.call(data, index, 1);\n  }\n  --this.size;\n  return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n  return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    ++this.size;\n    data.push([key, value]);\n  } else {\n    data[index][1] = value;\n  }\n  return this;\n}\n\nmodule.exports = listCacheSet;\n","var Hash = require('./_Hash'),\n    ListCache = require('./_ListCache'),\n    Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n  this.size = 0;\n  this.__data__ = {\n    'hash': new Hash,\n    'map': new (Map || ListCache),\n    'string': new Hash\n  };\n}\n\nmodule.exports = mapCacheClear;\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n  var result = getMapData(this, key)['delete'](key);\n  this.size -= result ? 1 : 0;\n  return result;\n}\n\nmodule.exports = mapCacheDelete;\n","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n  return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n  return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n  var data = getMapData(this, key),\n      size = data.size;\n\n  data.set(key, value);\n  this.size += data.size == size ? 0 : 1;\n  return this;\n}\n\nmodule.exports = mapCacheSet;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n  var index = -1,\n      result = Array(map.size);\n\n  map.forEach(function(value, key) {\n    result[++index] = [key, value];\n  });\n  return result;\n}\n\nmodule.exports = mapToArray;\n","/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n  return function(object) {\n    if (object == null) {\n      return false;\n    }\n    return object[key] === srcValue &&\n      (srcValue !== undefined || (key in Object(object)));\n  };\n}\n\nmodule.exports = matchesStrictComparable;\n","var memoize = require('./memoize');\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n  var result = memoize(func, function(key) {\n    if (cache.size === MAX_MEMOIZE_SIZE) {\n      cache.clear();\n    }\n    return key;\n  });\n\n  var cache = result.cache;\n  return result;\n}\n\nmodule.exports = memoizeCapped;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n  var result = [];\n  if (object != null) {\n    for (var key in Object(object)) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nmodule.exports = nativeKeysIn;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n  try {\n    // Use `util.types` for Node.js 10+.\n    var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n    if (types) {\n      return types;\n    }\n\n    // Legacy `process.binding('util')` for Node.js < 10.\n    return freeProcess && freeProcess.binding && freeProcess.binding('util');\n  } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n  return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n  return function(arg) {\n    return func(transform(arg));\n  };\n}\n\nmodule.exports = overArg;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n  start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n  return function() {\n    var args = arguments,\n        index = -1,\n        length = nativeMax(args.length - start, 0),\n        array = Array(length);\n\n    while (++index < length) {\n      array[index] = args[start + index];\n    }\n    index = -1;\n    var otherArgs = Array(start + 1);\n    while (++index < start) {\n      otherArgs[index] = args[index];\n    }\n    otherArgs[start] = transform(array);\n    return apply(func, this, otherArgs);\n  };\n}\n\nmodule.exports = overRest;\n","var baseGet = require('./_baseGet'),\n    baseSlice = require('./_baseSlice');\n\n/**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\nfunction parent(object, path) {\n  return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n}\n\nmodule.exports = parent;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n  if (key === 'constructor' && typeof object[key] === 'function') {\n    return;\n  }\n\n  if (key == '__proto__') {\n    return;\n  }\n\n  return object[key];\n}\n\nmodule.exports = safeGet;\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n  this.__data__.set(value, HASH_UNDEFINED);\n  return this;\n}\n\nmodule.exports = setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n  return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n  var index = -1,\n      result = Array(set.size);\n\n  set.forEach(function(value) {\n    result[++index] = value;\n  });\n  return result;\n}\n\nmodule.exports = setToArray;\n","/**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\nfunction setToPairs(set) {\n  var index = -1,\n      result = Array(set.size);\n\n  set.forEach(function(value) {\n    result[++index] = [value, value];\n  });\n  return result;\n}\n\nmodule.exports = setToPairs;\n","var baseSetToString = require('./_baseSetToString'),\n    shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n    HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n  var count = 0,\n      lastCalled = 0;\n\n  return function() {\n    var stamp = nativeNow(),\n        remaining = HOT_SPAN - (stamp - lastCalled);\n\n    lastCalled = stamp;\n    if (remaining > 0) {\n      if (++count >= HOT_COUNT) {\n        return arguments[0];\n      }\n    } else {\n      count = 0;\n    }\n    return func.apply(undefined, arguments);\n  };\n}\n\nmodule.exports = shortOut;\n","var baseRandom = require('./_baseRandom');\n\n/**\n * A specialized version of `_.shuffle` which mutates and sets the size of `array`.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @param {number} [size=array.length] The size of `array`.\n * @returns {Array} Returns `array`.\n */\nfunction shuffleSelf(array, size) {\n  var index = -1,\n      length = array.length,\n      lastIndex = length - 1;\n\n  size = size === undefined ? length : size;\n  while (++index < size) {\n    var rand = baseRandom(index, lastIndex),\n        value = array[rand];\n\n    array[rand] = array[index];\n    array[index] = value;\n  }\n  array.length = size;\n  return array;\n}\n\nmodule.exports = shuffleSelf;\n","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n  this.__data__ = new ListCache;\n  this.size = 0;\n}\n\nmodule.exports = stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n  var data = this.__data__,\n      result = data['delete'](key);\n\n  this.size = data.size;\n  return result;\n}\n\nmodule.exports = stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n  return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n  return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n","var ListCache = require('./_ListCache'),\n    Map = require('./_Map'),\n    MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n  var data = this.__data__;\n  if (data instanceof ListCache) {\n    var pairs = data.__data__;\n    if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n      pairs.push([key, value]);\n      this.size = ++data.size;\n      return this;\n    }\n    data = this.__data__ = new MapCache(pairs);\n  }\n  data.set(key, value);\n  this.size = data.size;\n  return this;\n}\n\nmodule.exports = stackSet;\n","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n  var index = fromIndex - 1,\n      length = array.length;\n\n  while (++index < length) {\n    if (array[index] === value) {\n      return index;\n    }\n  }\n  return -1;\n}\n\nmodule.exports = strictIndexOf;\n","/**\n * A specialized version of `_.lastIndexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictLastIndexOf(array, value, fromIndex) {\n  var index = fromIndex + 1;\n  while (index--) {\n    if (array[index] === value) {\n      return index;\n    }\n  }\n  return index;\n}\n\nmodule.exports = strictLastIndexOf;\n","var asciiSize = require('./_asciiSize'),\n    hasUnicode = require('./_hasUnicode'),\n    unicodeSize = require('./_unicodeSize');\n\n/**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\nfunction stringSize(string) {\n  return hasUnicode(string)\n    ? unicodeSize(string)\n    : asciiSize(string);\n}\n\nmodule.exports = stringSize;\n","var memoizeCapped = require('./_memoizeCapped');\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n  var result = [];\n  if (string.charCodeAt(0) === 46 /* . */) {\n    result.push('');\n  }\n  string.replace(rePropName, function(match, number, quote, subString) {\n    result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n  });\n  return result;\n});\n\nmodule.exports = stringToPath;\n","var isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n  if (typeof value == 'string' || isSymbol(value)) {\n    return value;\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = toKey;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n  if (func != null) {\n    try {\n      return funcToString.call(func);\n    } catch (e) {}\n    try {\n      return (func + '');\n    } catch (e) {}\n  }\n  return '';\n}\n\nmodule.exports = toSource;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n  var index = string.length;\n\n  while (index-- && reWhitespace.test(string.charAt(index))) {}\n  return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n    rsComboMarksRange = '\\\\u0300-\\\\u036f',\n    reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n    rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n    rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n    rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange + ']',\n    rsCombo = '[' + rsComboRange + ']',\n    rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n    rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n    rsNonAstral = '[^' + rsAstralRange + ']',\n    rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n    rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n    rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?',\n    rsOptVar = '[' + rsVarRange + ']?',\n    rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n    rsSeq = rsOptVar + reOptMod + rsOptJoin,\n    rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\nfunction unicodeSize(string) {\n  var result = reUnicode.lastIndex = 0;\n  while (reUnicode.test(string)) {\n    ++result;\n  }\n  return result;\n}\n\nmodule.exports = unicodeSize;\n","module.exports = {\n  'chunk': require('./chunk'),\n  'compact': require('./compact'),\n  'concat': require('./concat'),\n  'difference': require('./difference'),\n  'differenceBy': require('./differenceBy'),\n  'differenceWith': require('./differenceWith'),\n  'drop': require('./drop'),\n  'dropRight': require('./dropRight'),\n  'dropRightWhile': require('./dropRightWhile'),\n  'dropWhile': require('./dropWhile'),\n  'fill': require('./fill'),\n  'findIndex': require('./findIndex'),\n  'findLastIndex': require('./findLastIndex'),\n  'first': require('./first'),\n  'flatten': require('./flatten'),\n  'flattenDeep': require('./flattenDeep'),\n  'flattenDepth': require('./flattenDepth'),\n  'fromPairs': require('./fromPairs'),\n  'head': require('./head'),\n  'indexOf': require('./indexOf'),\n  'initial': require('./initial'),\n  'intersection': require('./intersection'),\n  'intersectionBy': require('./intersectionBy'),\n  'intersectionWith': require('./intersectionWith'),\n  'join': require('./join'),\n  'last': require('./last'),\n  'lastIndexOf': require('./lastIndexOf'),\n  'nth': require('./nth'),\n  'pull': require('./pull'),\n  'pullAll': require('./pullAll'),\n  'pullAllBy': require('./pullAllBy'),\n  'pullAllWith': require('./pullAllWith'),\n  'pullAt': require('./pullAt'),\n  'remove': require('./remove'),\n  'reverse': require('./reverse'),\n  'slice': require('./slice'),\n  'sortedIndex': require('./sortedIndex'),\n  'sortedIndexBy': require('./sortedIndexBy'),\n  'sortedIndexOf': require('./sortedIndexOf'),\n  'sortedLastIndex': require('./sortedLastIndex'),\n  'sortedLastIndexBy': require('./sortedLastIndexBy'),\n  'sortedLastIndexOf': require('./sortedLastIndexOf'),\n  'sortedUniq': require('./sortedUniq'),\n  'sortedUniqBy': require('./sortedUniqBy'),\n  'tail': require('./tail'),\n  'take': require('./take'),\n  'takeRight': require('./takeRight'),\n  'takeRightWhile': require('./takeRightWhile'),\n  'takeWhile': require('./takeWhile'),\n  'union': require('./union'),\n  'unionBy': require('./unionBy'),\n  'unionWith': require('./unionWith'),\n  'uniq': require('./uniq'),\n  'uniqBy': require('./uniqBy'),\n  'uniqWith': require('./uniqWith'),\n  'unzip': require('./unzip'),\n  'unzipWith': require('./unzipWith'),\n  'without': require('./without'),\n  'xor': require('./xor'),\n  'xorBy': require('./xorBy'),\n  'xorWith': require('./xorWith'),\n  'zip': require('./zip'),\n  'zipObject': require('./zipObject'),\n  'zipObjectDeep': require('./zipObjectDeep'),\n  'zipWith': require('./zipWith')\n};\n","var assignValue = require('./_assignValue'),\n    copyObject = require('./_copyObject'),\n    createAssigner = require('./_createAssigner'),\n    isArrayLike = require('./isArrayLike'),\n    isPrototype = require('./_isPrototype'),\n    keys = require('./keys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n * }\n *\n * function Bar() {\n *   this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\nvar assign = createAssigner(function(object, source) {\n  if (isPrototype(source) || isArrayLike(source)) {\n    copyObject(source, keys(source), object);\n    return;\n  }\n  for (var key in source) {\n    if (hasOwnProperty.call(source, key)) {\n      assignValue(object, key, source[key]);\n    }\n  }\n});\n\nmodule.exports = assign;\n","var copyObject = require('./_copyObject'),\n    createAssigner = require('./_createAssigner'),\n    keysIn = require('./keysIn');\n\n/**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n * }\n *\n * function Bar() {\n *   this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\nvar assignIn = createAssigner(function(object, source) {\n  copyObject(source, keysIn(source), object);\n});\n\nmodule.exports = assignIn;\n","var copyObject = require('./_copyObject'),\n    createAssigner = require('./_createAssigner'),\n    keysIn = require('./keysIn');\n\n/**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n *   return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\nvar assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n  copyObject(source, keysIn(source), object, customizer);\n});\n\nmodule.exports = assignInWith;\n","var copyObject = require('./_copyObject'),\n    createAssigner = require('./_createAssigner'),\n    keys = require('./keys');\n\n/**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n *   return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\nvar assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n  copyObject(source, keys(source), object, customizer);\n});\n\nmodule.exports = assignWith;\n","var baseAt = require('./_baseAt'),\n    flatRest = require('./_flatRest');\n\n/**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\nvar at = flatRest(baseAt);\n\nmodule.exports = at;\n","var baseSlice = require('./_baseSlice'),\n    isIterateeCall = require('./_isIterateeCall'),\n    toInteger = require('./toInteger');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil,\n    nativeMax = Math.max;\n\n/**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\nfunction chunk(array, size, guard) {\n  if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n    size = 1;\n  } else {\n    size = nativeMax(toInteger(size), 0);\n  }\n  var length = array == null ? 0 : array.length;\n  if (!length || size < 1) {\n    return [];\n  }\n  var index = 0,\n      resIndex = 0,\n      result = Array(nativeCeil(length / size));\n\n  while (index < length) {\n    result[resIndex++] = baseSlice(array, index, (index += size));\n  }\n  return result;\n}\n\nmodule.exports = chunk;\n","module.exports = {\n  'countBy': require('./countBy'),\n  'each': require('./each'),\n  'eachRight': require('./eachRight'),\n  'every': require('./every'),\n  'filter': require('./filter'),\n  'find': require('./find'),\n  'findLast': require('./findLast'),\n  'flatMap': require('./flatMap'),\n  'flatMapDeep': require('./flatMapDeep'),\n  'flatMapDepth': require('./flatMapDepth'),\n  'forEach': require('./forEach'),\n  'forEachRight': require('./forEachRight'),\n  'groupBy': require('./groupBy'),\n  'includes': require('./includes'),\n  'invokeMap': require('./invokeMap'),\n  'keyBy': require('./keyBy'),\n  'map': require('./map'),\n  'orderBy': require('./orderBy'),\n  'partition': require('./partition'),\n  'reduce': require('./reduce'),\n  'reduceRight': require('./reduceRight'),\n  'reject': require('./reject'),\n  'sample': require('./sample'),\n  'sampleSize': require('./sampleSize'),\n  'shuffle': require('./shuffle'),\n  'size': require('./size'),\n  'some': require('./some'),\n  'sortBy': require('./sortBy')\n};\n","/**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\nfunction compact(array) {\n  var index = -1,\n      length = array == null ? 0 : array.length,\n      resIndex = 0,\n      result = [];\n\n  while (++index < length) {\n    var value = array[index];\n    if (value) {\n      result[resIndex++] = value;\n    }\n  }\n  return result;\n}\n\nmodule.exports = compact;\n","var arrayPush = require('./_arrayPush'),\n    baseFlatten = require('./_baseFlatten'),\n    copyArray = require('./_copyArray'),\n    isArray = require('./isArray');\n\n/**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\nfunction concat() {\n  var length = arguments.length;\n  if (!length) {\n    return [];\n  }\n  var args = Array(length - 1),\n      array = arguments[0],\n      index = length;\n\n  while (index--) {\n    args[index - 1] = arguments[index];\n  }\n  return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n}\n\nmodule.exports = concat;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n  return function() {\n    return value;\n  };\n}\n\nmodule.exports = constant;\n","var baseAssignValue = require('./_baseAssignValue'),\n    createAggregator = require('./_createAggregator');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\nvar countBy = createAggregator(function(result, value, key) {\n  if (hasOwnProperty.call(result, key)) {\n    ++result[key];\n  } else {\n    baseAssignValue(result, key, 1);\n  }\n});\n\nmodule.exports = countBy;\n","var baseAssign = require('./_baseAssign'),\n    baseCreate = require('./_baseCreate');\n\n/**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n *   this.x = 0;\n *   this.y = 0;\n * }\n *\n * function Circle() {\n *   Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n *   'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\nfunction create(prototype, properties) {\n  var result = baseCreate(prototype);\n  return properties == null ? result : baseAssign(result, properties);\n}\n\nmodule.exports = create;\n","var baseRest = require('./_baseRest'),\n    eq = require('./eq'),\n    isIterateeCall = require('./_isIterateeCall'),\n    keysIn = require('./keysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\nvar defaults = baseRest(function(object, sources) {\n  object = Object(object);\n\n  var index = -1;\n  var length = sources.length;\n  var guard = length > 2 ? sources[2] : undefined;\n\n  if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n    length = 1;\n  }\n\n  while (++index < length) {\n    var source = sources[index];\n    var props = keysIn(source);\n    var propsIndex = -1;\n    var propsLength = props.length;\n\n    while (++propsIndex < propsLength) {\n      var key = props[propsIndex];\n      var value = object[key];\n\n      if (value === undefined ||\n          (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n        object[key] = source[key];\n      }\n    }\n  }\n\n  return object;\n});\n\nmodule.exports = defaults;\n","var apply = require('./_apply'),\n    baseRest = require('./_baseRest'),\n    customDefaultsMerge = require('./_customDefaultsMerge'),\n    mergeWith = require('./mergeWith');\n\n/**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\nvar defaultsDeep = baseRest(function(args) {\n  args.push(undefined, customDefaultsMerge);\n  return apply(mergeWith, undefined, args);\n});\n\nmodule.exports = defaultsDeep;\n","var baseDifference = require('./_baseDifference'),\n    baseFlatten = require('./_baseFlatten'),\n    baseRest = require('./_baseRest'),\n    isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\nvar difference = baseRest(function(array, values) {\n  return isArrayLikeObject(array)\n    ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n    : [];\n});\n\nmodule.exports = difference;\n","var baseDifference = require('./_baseDifference'),\n    baseFlatten = require('./_baseFlatten'),\n    baseIteratee = require('./_baseIteratee'),\n    baseRest = require('./_baseRest'),\n    isArrayLikeObject = require('./isArrayLikeObject'),\n    last = require('./last');\n\n/**\n * This method is like `_.difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * **Note:** Unlike `_.pullAllBy`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\nvar differenceBy = baseRest(function(array, values) {\n  var iteratee = last(values);\n  if (isArrayLikeObject(iteratee)) {\n    iteratee = undefined;\n  }\n  return isArrayLikeObject(array)\n    ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), baseIteratee(iteratee, 2))\n    : [];\n});\n\nmodule.exports = differenceBy;\n","var baseDifference = require('./_baseDifference'),\n    baseFlatten = require('./_baseFlatten'),\n    baseRest = require('./_baseRest'),\n    isArrayLikeObject = require('./isArrayLikeObject'),\n    last = require('./last');\n\n/**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\nvar differenceWith = baseRest(function(array, values) {\n  var comparator = last(values);\n  if (isArrayLikeObject(comparator)) {\n    comparator = undefined;\n  }\n  return isArrayLikeObject(array)\n    ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n    : [];\n});\n\nmodule.exports = differenceWith;\n","var baseSlice = require('./_baseSlice'),\n    toInteger = require('./toInteger');\n\n/**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\nfunction drop(array, n, guard) {\n  var length = array == null ? 0 : array.length;\n  if (!length) {\n    return [];\n  }\n  n = (guard || n === undefined) ? 1 : toInteger(n);\n  return baseSlice(array, n < 0 ? 0 : n, length);\n}\n\nmodule.exports = drop;\n","var baseSlice = require('./_baseSlice'),\n    toInteger = require('./toInteger');\n\n/**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\nfunction dropRight(array, n, guard) {\n  var length = array == null ? 0 : array.length;\n  if (!length) {\n    return [];\n  }\n  n = (guard || n === undefined) ? 1 : toInteger(n);\n  n = length - n;\n  return baseSlice(array, 0, n < 0 ? 0 : n);\n}\n\nmodule.exports = dropRight;\n","var baseIteratee = require('./_baseIteratee'),\n    baseWhile = require('./_baseWhile');\n\n/**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n *   { 'user': 'barney',  'active': true },\n *   { 'user': 'fred',    'active': false },\n *   { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.dropRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropRightWhile(users, ['active', false]);\n * // => objects for ['barney']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropRightWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\nfunction dropRightWhile(array, predicate) {\n  return (array && array.length)\n    ? baseWhile(array, baseIteratee(predicate, 3), true, true)\n    : [];\n}\n\nmodule.exports = dropRightWhile;\n","var baseIteratee = require('./_baseIteratee'),\n    baseWhile = require('./_baseWhile');\n\n/**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n *   { 'user': 'barney',  'active': false },\n *   { 'user': 'fred',    'active': false },\n *   { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.dropWhile(users, function(o) { return !o.active; });\n * // => objects for ['pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropWhile(users, ['active', false]);\n * // => objects for ['pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\nfunction dropWhile(array, predicate) {\n  return (array && array.length)\n    ? baseWhile(array, baseIteratee(predicate, 3), true)\n    : [];\n}\n\nmodule.exports = dropWhile;\n","module.exports = require('./forEach');\n","module.exports = require('./forEachRight');\n","module.exports = require('./toPairs');\n","module.exports = require('./toPairsIn');\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n  return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","var arrayEvery = require('./_arrayEvery'),\n    baseEvery = require('./_baseEvery'),\n    baseIteratee = require('./_baseIteratee'),\n    isArray = require('./isArray'),\n    isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n *  else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n *   { 'user': 'barney', 'age': 36, 'active': false },\n *   { 'user': 'fred',   'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\nfunction every(collection, predicate, guard) {\n  var func = isArray(collection) ? arrayEvery : baseEvery;\n  if (guard && isIterateeCall(collection, predicate, guard)) {\n    predicate = undefined;\n  }\n  return func(collection, baseIteratee(predicate, 3));\n}\n\nmodule.exports = every;\n","module.exports = require('./assignIn');\n","module.exports = require('./assignInWith');\n","var baseFill = require('./_baseFill'),\n    isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\nfunction fill(array, value, start, end) {\n  var length = array == null ? 0 : array.length;\n  if (!length) {\n    return [];\n  }\n  if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n    start = 0;\n    end = length;\n  }\n  return baseFill(array, value, start, end);\n}\n\nmodule.exports = fill;\n","var arrayFilter = require('./_arrayFilter'),\n    baseFilter = require('./_baseFilter'),\n    baseIteratee = require('./_baseIteratee'),\n    isArray = require('./isArray');\n\n/**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n *   { 'user': 'barney', 'age': 36, 'active': true },\n *   { 'user': 'fred',   'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\nfunction filter(collection, predicate) {\n  var func = isArray(collection) ? arrayFilter : baseFilter;\n  return func(collection, baseIteratee(predicate, 3));\n}\n\nmodule.exports = filter;\n","var createFind = require('./_createFind'),\n    findIndex = require('./findIndex');\n\n/**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n *   { 'user': 'barney',  'age': 36, 'active': true },\n *   { 'user': 'fred',    'age': 40, 'active': false },\n *   { 'user': 'pebbles', 'age': 1,  'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\nvar find = createFind(findIndex);\n\nmodule.exports = find;\n","var baseFindIndex = require('./_baseFindIndex'),\n    baseIteratee = require('./_baseIteratee'),\n    toInteger = require('./toInteger');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n *   { 'user': 'barney',  'active': false },\n *   { 'user': 'fred',    'active': false },\n *   { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\nfunction findIndex(array, predicate, fromIndex) {\n  var length = array == null ? 0 : array.length;\n  if (!length) {\n    return -1;\n  }\n  var index = fromIndex == null ? 0 : toInteger(fromIndex);\n  if (index < 0) {\n    index = nativeMax(length + index, 0);\n  }\n  return baseFindIndex(array, baseIteratee(predicate, 3), index);\n}\n\nmodule.exports = findIndex;\n","var baseFindKey = require('./_baseFindKey'),\n    baseForOwn = require('./_baseForOwn'),\n    baseIteratee = require('./_baseIteratee');\n\n/**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n *  else `undefined`.\n * @example\n *\n * var users = {\n *   'barney':  { 'age': 36, 'active': true },\n *   'fred':    { 'age': 40, 'active': false },\n *   'pebbles': { 'age': 1,  'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\nfunction findKey(object, predicate) {\n  return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn);\n}\n\nmodule.exports = findKey;\n","var createFind = require('./_createFind'),\n    findLastIndex = require('./findLastIndex');\n\n/**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n *   return n % 2 == 1;\n * });\n * // => 3\n */\nvar findLast = createFind(findLastIndex);\n\nmodule.exports = findLast;\n","var baseFindIndex = require('./_baseFindIndex'),\n    baseIteratee = require('./_baseIteratee'),\n    toInteger = require('./toInteger');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n    nativeMin = Math.min;\n\n/**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n *   { 'user': 'barney',  'active': true },\n *   { 'user': 'fred',    'active': false },\n *   { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\nfunction findLastIndex(array, predicate, fromIndex) {\n  var length = array == null ? 0 : array.length;\n  if (!length) {\n    return -1;\n  }\n  var index = length - 1;\n  if (fromIndex !== undefined) {\n    index = toInteger(fromIndex);\n    index = fromIndex < 0\n      ? nativeMax(length + index, 0)\n      : nativeMin(index, length - 1);\n  }\n  return baseFindIndex(array, baseIteratee(predicate, 3), index, true);\n}\n\nmodule.exports = findLastIndex;\n","var baseFindKey = require('./_baseFindKey'),\n    baseForOwnRight = require('./_baseForOwnRight'),\n    baseIteratee = require('./_baseIteratee');\n\n/**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n *  else `undefined`.\n * @example\n *\n * var users = {\n *   'barney':  { 'age': 36, 'active': true },\n *   'fred':    { 'age': 40, 'active': false },\n *   'pebbles': { 'age': 1,  'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\nfunction findLastKey(object, predicate) {\n  return baseFindKey(object, baseIteratee(predicate, 3), baseForOwnRight);\n}\n\nmodule.exports = findLastKey;\n","module.exports = require('./head');\n","var baseFlatten = require('./_baseFlatten'),\n    map = require('./map');\n\n/**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n *   return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\nfunction flatMap(collection, iteratee) {\n  return baseFlatten(map(collection, iteratee), 1);\n}\n\nmodule.exports = flatMap;\n","var baseFlatten = require('./_baseFlatten'),\n    map = require('./map');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n *   return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\nfunction flatMapDeep(collection, iteratee) {\n  return baseFlatten(map(collection, iteratee), INFINITY);\n}\n\nmodule.exports = flatMapDeep;\n","var baseFlatten = require('./_baseFlatten'),\n    map = require('./map'),\n    toInteger = require('./toInteger');\n\n/**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n *   return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\nfunction flatMapDepth(collection, iteratee, depth) {\n  depth = depth === undefined ? 1 : toInteger(depth);\n  return baseFlatten(map(collection, iteratee), depth);\n}\n\nmodule.exports = flatMapDepth;\n","var baseFlatten = require('./_baseFlatten');\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n  var length = array == null ? 0 : array.length;\n  return length ? baseFlatten(array, 1) : [];\n}\n\nmodule.exports = flatten;\n","var baseFlatten = require('./_baseFlatten');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\nfunction flattenDeep(array) {\n  var length = array == null ? 0 : array.length;\n  return length ? baseFlatten(array, INFINITY) : [];\n}\n\nmodule.exports = flattenDeep;\n","var baseFlatten = require('./_baseFlatten'),\n    toInteger = require('./toInteger');\n\n/**\n * Recursively flatten `array` up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * var array = [1, [2, [3, [4]], 5]];\n *\n * _.flattenDepth(array, 1);\n * // => [1, 2, [3, [4]], 5]\n *\n * _.flattenDepth(array, 2);\n * // => [1, 2, 3, [4], 5]\n */\nfunction flattenDepth(array, depth) {\n  var length = array == null ? 0 : array.length;\n  if (!length) {\n    return [];\n  }\n  depth = depth === undefined ? 1 : toInteger(depth);\n  return baseFlatten(array, depth);\n}\n\nmodule.exports = flattenDepth;\n","var arrayEach = require('./_arrayEach'),\n    baseEach = require('./_baseEach'),\n    castFunction = require('./_castFunction'),\n    isArray = require('./isArray');\n\n/**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n *   console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n *   console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forEach(collection, iteratee) {\n  var func = isArray(collection) ? arrayEach : baseEach;\n  return func(collection, castFunction(iteratee));\n}\n\nmodule.exports = forEach;\n","var arrayEachRight = require('./_arrayEachRight'),\n    baseEachRight = require('./_baseEachRight'),\n    castFunction = require('./_castFunction'),\n    isArray = require('./isArray');\n\n/**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n *   console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\nfunction forEachRight(collection, iteratee) {\n  var func = isArray(collection) ? arrayEachRight : baseEachRight;\n  return func(collection, castFunction(iteratee));\n}\n\nmodule.exports = forEachRight;\n","var baseFor = require('./_baseFor'),\n    castFunction = require('./_castFunction'),\n    keysIn = require('./keysIn');\n\n/**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n *   console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\nfunction forIn(object, iteratee) {\n  return object == null\n    ? object\n    : baseFor(object, castFunction(iteratee), keysIn);\n}\n\nmodule.exports = forIn;\n","var baseForRight = require('./_baseForRight'),\n    castFunction = require('./_castFunction'),\n    keysIn = require('./keysIn');\n\n/**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n *   console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\nfunction forInRight(object, iteratee) {\n  return object == null\n    ? object\n    : baseForRight(object, castFunction(iteratee), keysIn);\n}\n\nmodule.exports = forInRight;\n","var baseForOwn = require('./_baseForOwn'),\n    castFunction = require('./_castFunction');\n\n/**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n *   console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forOwn(object, iteratee) {\n  return object && baseForOwn(object, castFunction(iteratee));\n}\n\nmodule.exports = forOwn;\n","var baseForOwnRight = require('./_baseForOwnRight'),\n    castFunction = require('./_castFunction');\n\n/**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n *   console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\nfunction forOwnRight(object, iteratee) {\n  return object && baseForOwnRight(object, castFunction(iteratee));\n}\n\nmodule.exports = forOwnRight;\n","/**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\nfunction fromPairs(pairs) {\n  var index = -1,\n      length = pairs == null ? 0 : pairs.length,\n      result = {};\n\n  while (++index < length) {\n    var pair = pairs[index];\n    result[pair[0]] = pair[1];\n  }\n  return result;\n}\n\nmodule.exports = fromPairs;\n","var baseFunctions = require('./_baseFunctions'),\n    keys = require('./keys');\n\n/**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n *   this.a = _.constant('a');\n *   this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\nfunction functions(object) {\n  return object == null ? [] : baseFunctions(object, keys(object));\n}\n\nmodule.exports = functions;\n","var baseFunctions = require('./_baseFunctions'),\n    keysIn = require('./keysIn');\n\n/**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n *   this.a = _.constant('a');\n *   this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\nfunction functionsIn(object) {\n  return object == null ? [] : baseFunctions(object, keysIn(object));\n}\n\nmodule.exports = functionsIn;\n","var baseGet = require('./_baseGet');\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n  var result = object == null ? undefined : baseGet(object, path);\n  return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = get;\n","var baseAssignValue = require('./_baseAssignValue'),\n    createAggregator = require('./_createAggregator');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\nvar groupBy = createAggregator(function(result, value, key) {\n  if (hasOwnProperty.call(result, key)) {\n    result[key].push(value);\n  } else {\n    baseAssignValue(result, key, [value]);\n  }\n});\n\nmodule.exports = groupBy;\n","var baseHas = require('./_baseHas'),\n    hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\nfunction has(object, path) {\n  return object != null && hasPath(object, path, baseHas);\n}\n\nmodule.exports = has;\n","var baseHasIn = require('./_baseHasIn'),\n    hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n  return object != null && hasPath(object, path, baseHasIn);\n}\n\nmodule.exports = hasIn;\n","/**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\nfunction head(array) {\n  return (array && array.length) ? array[0] : undefined;\n}\n\nmodule.exports = head;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n  return value;\n}\n\nmodule.exports = identity;\n","var baseIndexOf = require('./_baseIndexOf'),\n    isArrayLike = require('./isArrayLike'),\n    isString = require('./isString'),\n    toInteger = require('./toInteger'),\n    values = require('./values');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\nfunction includes(collection, value, fromIndex, guard) {\n  collection = isArrayLike(collection) ? collection : values(collection);\n  fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n  var length = collection.length;\n  if (fromIndex < 0) {\n    fromIndex = nativeMax(length + fromIndex, 0);\n  }\n  return isString(collection)\n    ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n    : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n}\n\nmodule.exports = includes;\n","var baseIndexOf = require('./_baseIndexOf'),\n    toInteger = require('./toInteger');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\nfunction indexOf(array, value, fromIndex) {\n  var length = array == null ? 0 : array.length;\n  if (!length) {\n    return -1;\n  }\n  var index = fromIndex == null ? 0 : toInteger(fromIndex);\n  if (index < 0) {\n    index = nativeMax(length + index, 0);\n  }\n  return baseIndexOf(array, value, index);\n}\n\nmodule.exports = indexOf;\n","var baseSlice = require('./_baseSlice');\n\n/**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\nfunction initial(array) {\n  var length = array == null ? 0 : array.length;\n  return length ? baseSlice(array, 0, -1) : [];\n}\n\nmodule.exports = initial;\n","var arrayMap = require('./_arrayMap'),\n    baseIntersection = require('./_baseIntersection'),\n    baseRest = require('./_baseRest'),\n    castArrayLikeObject = require('./_castArrayLikeObject');\n\n/**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\nvar intersection = baseRest(function(arrays) {\n  var mapped = arrayMap(arrays, castArrayLikeObject);\n  return (mapped.length && mapped[0] === arrays[0])\n    ? baseIntersection(mapped)\n    : [];\n});\n\nmodule.exports = intersection;\n","var arrayMap = require('./_arrayMap'),\n    baseIntersection = require('./_baseIntersection'),\n    baseIteratee = require('./_baseIteratee'),\n    baseRest = require('./_baseRest'),\n    castArrayLikeObject = require('./_castArrayLikeObject'),\n    last = require('./last');\n\n/**\n * This method is like `_.intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [2.1]\n *\n * // The `_.property` iteratee shorthand.\n * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }]\n */\nvar intersectionBy = baseRest(function(arrays) {\n  var iteratee = last(arrays),\n      mapped = arrayMap(arrays, castArrayLikeObject);\n\n  if (iteratee === last(mapped)) {\n    iteratee = undefined;\n  } else {\n    mapped.pop();\n  }\n  return (mapped.length && mapped[0] === arrays[0])\n    ? baseIntersection(mapped, baseIteratee(iteratee, 2))\n    : [];\n});\n\nmodule.exports = intersectionBy;\n","var arrayMap = require('./_arrayMap'),\n    baseIntersection = require('./_baseIntersection'),\n    baseRest = require('./_baseRest'),\n    castArrayLikeObject = require('./_castArrayLikeObject'),\n    last = require('./last');\n\n/**\n * This method is like `_.intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.intersectionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }]\n */\nvar intersectionWith = baseRest(function(arrays) {\n  var comparator = last(arrays),\n      mapped = arrayMap(arrays, castArrayLikeObject);\n\n  comparator = typeof comparator == 'function' ? comparator : undefined;\n  if (comparator) {\n    mapped.pop();\n  }\n  return (mapped.length && mapped[0] === arrays[0])\n    ? baseIntersection(mapped, undefined, comparator)\n    : [];\n});\n\nmodule.exports = intersectionWith;\n","var constant = require('./constant'),\n    createInverter = require('./_createInverter'),\n    identity = require('./identity');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\nvar invert = createInverter(function(result, value, key) {\n  if (value != null &&\n      typeof value.toString != 'function') {\n    value = nativeObjectToString.call(value);\n  }\n\n  result[value] = key;\n}, constant(identity));\n\nmodule.exports = invert;\n","var baseIteratee = require('./_baseIteratee'),\n    createInverter = require('./_createInverter');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n *   return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\nvar invertBy = createInverter(function(result, value, key) {\n  if (value != null &&\n      typeof value.toString != 'function') {\n    value = nativeObjectToString.call(value);\n  }\n\n  if (hasOwnProperty.call(result, value)) {\n    result[value].push(key);\n  } else {\n    result[value] = [key];\n  }\n}, baseIteratee);\n\nmodule.exports = invertBy;\n","var baseInvoke = require('./_baseInvoke'),\n    baseRest = require('./_baseRest');\n\n/**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\nvar invoke = baseRest(baseInvoke);\n\nmodule.exports = invoke;\n","var apply = require('./_apply'),\n    baseEach = require('./_baseEach'),\n    baseInvoke = require('./_baseInvoke'),\n    baseRest = require('./_baseRest'),\n    isArrayLike = require('./isArrayLike');\n\n/**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n *  the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\nvar invokeMap = baseRest(function(collection, path, args) {\n  var index = -1,\n      isFunc = typeof path == 'function',\n      result = isArrayLike(collection) ? Array(collection.length) : [];\n\n  baseEach(collection, function(value) {\n    result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n  });\n  return result;\n});\n\nmodule.exports = invokeMap;\n","var baseIsArguments = require('./_baseIsArguments'),\n    isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n *  else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n  return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n    !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","var isFunction = require('./isFunction'),\n    isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n  return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","var isArrayLike = require('./isArrayLike'),\n    isObjectLike = require('./isObjectLike');\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n *  else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n  return isObjectLike(value) && isArrayLike(value);\n}\n\nmodule.exports = isArrayLikeObject;\n","var root = require('./_root'),\n    stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","var baseGetTag = require('./_baseGetTag'),\n    isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  if (!isObject(value)) {\n    return false;\n  }\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 9 which returns 'object' for typed arrays and other constructors.\n  var tag = baseGetTag(value);\n  return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n  return typeof value == 'number' &&\n    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var baseIsMap = require('./_baseIsMap'),\n    baseUnary = require('./_baseUnary'),\n    nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nmodule.exports = isMap;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n    getPrototype = require('./_getPrototype'),\n    isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n  if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n    return false;\n  }\n  var proto = getPrototype(value);\n  if (proto === null) {\n    return true;\n  }\n  var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n  return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n    funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\n","var baseIsSet = require('./_baseIsSet'),\n    baseUnary = require('./_baseUnary'),\n    nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nmodule.exports = isSet;\n","var baseGetTag = require('./_baseGetTag'),\n    isArray = require('./isArray'),\n    isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n  return typeof value == 'string' ||\n    (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n}\n\nmodule.exports = isString;\n","var baseGetTag = require('./_baseGetTag'),\n    isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n  return typeof value == 'symbol' ||\n    (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n    baseUnary = require('./_baseUnary'),\n    nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeJoin = arrayProto.join;\n\n/**\n * Converts all elements in `array` into a string separated by `separator`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to convert.\n * @param {string} [separator=','] The element separator.\n * @returns {string} Returns the joined string.\n * @example\n *\n * _.join(['a', 'b', 'c'], '~');\n * // => 'a~b~c'\n */\nfunction join(array, separator) {\n  return array == null ? '' : nativeJoin.call(array, separator);\n}\n\nmodule.exports = join;\n","var baseAssignValue = require('./_baseAssignValue'),\n    createAggregator = require('./_createAggregator');\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n *   { 'dir': 'left', 'code': 97 },\n *   { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n *   return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\nvar keyBy = createAggregator(function(result, value, key) {\n  baseAssignValue(result, key, value);\n});\n\nmodule.exports = keyBy;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n    baseKeys = require('./_baseKeys'),\n    isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n    baseKeysIn = require('./_baseKeysIn'),\n    isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n  return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;\n","/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n  var length = array == null ? 0 : array.length;\n  return length ? array[length - 1] : undefined;\n}\n\nmodule.exports = last;\n","var baseFindIndex = require('./_baseFindIndex'),\n    baseIsNaN = require('./_baseIsNaN'),\n    strictLastIndexOf = require('./_strictLastIndexOf'),\n    toInteger = require('./toInteger');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n    nativeMin = Math.min;\n\n/**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // Search from the `fromIndex`.\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n */\nfunction lastIndexOf(array, value, fromIndex) {\n  var length = array == null ? 0 : array.length;\n  if (!length) {\n    return -1;\n  }\n  var index = length;\n  if (fromIndex !== undefined) {\n    index = toInteger(fromIndex);\n    index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);\n  }\n  return value === value\n    ? strictLastIndexOf(array, value, index)\n    : baseFindIndex(array, baseIsNaN, index, true);\n}\n\nmodule.exports = lastIndexOf;\n","var arrayMap = require('./_arrayMap'),\n    baseIteratee = require('./_baseIteratee'),\n    baseMap = require('./_baseMap'),\n    isArray = require('./isArray');\n\n/**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n *   return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n *   { 'user': 'barney' },\n *   { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\nfunction map(collection, iteratee) {\n  var func = isArray(collection) ? arrayMap : baseMap;\n  return func(collection, baseIteratee(iteratee, 3));\n}\n\nmodule.exports = map;\n","var baseAssignValue = require('./_baseAssignValue'),\n    baseForOwn = require('./_baseForOwn'),\n    baseIteratee = require('./_baseIteratee');\n\n/**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n *   return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\nfunction mapKeys(object, iteratee) {\n  var result = {};\n  iteratee = baseIteratee(iteratee, 3);\n\n  baseForOwn(object, function(value, key, object) {\n    baseAssignValue(result, iteratee(value, key, object), value);\n  });\n  return result;\n}\n\nmodule.exports = mapKeys;\n","var baseAssignValue = require('./_baseAssignValue'),\n    baseForOwn = require('./_baseForOwn'),\n    baseIteratee = require('./_baseIteratee');\n\n/**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n *   'fred':    { 'user': 'fred',    'age': 40 },\n *   'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\nfunction mapValues(object, iteratee) {\n  var result = {};\n  iteratee = baseIteratee(iteratee, 3);\n\n  baseForOwn(object, function(value, key, object) {\n    baseAssignValue(result, key, iteratee(value, key, object));\n  });\n  return result;\n}\n\nmodule.exports = mapValues;\n","var MapCache = require('./_MapCache');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n  if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  var memoized = function() {\n    var args = arguments,\n        key = resolver ? resolver.apply(this, args) : args[0],\n        cache = memoized.cache;\n\n    if (cache.has(key)) {\n      return cache.get(key);\n    }\n    var result = func.apply(this, args);\n    memoized.cache = cache.set(key, result) || cache;\n    return result;\n  };\n  memoized.cache = new (memoize.Cache || MapCache);\n  return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nmodule.exports = memoize;\n","var baseMerge = require('./_baseMerge'),\n    createAssigner = require('./_createAssigner');\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n *   'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n *   'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n  baseMerge(object, source, srcIndex);\n});\n\nmodule.exports = merge;\n","var baseMerge = require('./_baseMerge'),\n    createAssigner = require('./_createAssigner');\n\n/**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n *   if (_.isArray(objValue)) {\n *     return objValue.concat(srcValue);\n *   }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\nvar mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n  baseMerge(object, source, srcIndex, customizer);\n});\n\nmodule.exports = mergeWith;\n","/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n *   return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\nfunction negate(predicate) {\n  if (typeof predicate != 'function') {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  return function() {\n    var args = arguments;\n    switch (args.length) {\n      case 0: return !predicate.call(this);\n      case 1: return !predicate.call(this, args[0]);\n      case 2: return !predicate.call(this, args[0], args[1]);\n      case 3: return !predicate.call(this, args[0], args[1], args[2]);\n    }\n    return !predicate.apply(this, args);\n  };\n}\n\nmodule.exports = negate;\n","/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n  // No operation performed.\n}\n\nmodule.exports = noop;\n","var baseNth = require('./_baseNth'),\n    toInteger = require('./toInteger');\n\n/**\n * Gets the element at index `n` of `array`. If `n` is negative, the nth\n * element from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.11.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=0] The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n *\n * _.nth(array, 1);\n * // => 'b'\n *\n * _.nth(array, -2);\n * // => 'c';\n */\nfunction nth(array, n) {\n  return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;\n}\n\nmodule.exports = nth;\n","module.exports = {\n  'assign': require('./assign'),\n  'assignIn': require('./assignIn'),\n  'assignInWith': require('./assignInWith'),\n  'assignWith': require('./assignWith'),\n  'at': require('./at'),\n  'create': require('./create'),\n  'defaults': require('./defaults'),\n  'defaultsDeep': require('./defaultsDeep'),\n  'entries': require('./entries'),\n  'entriesIn': require('./entriesIn'),\n  'extend': require('./extend'),\n  'extendWith': require('./extendWith'),\n  'findKey': require('./findKey'),\n  'findLastKey': require('./findLastKey'),\n  'forIn': require('./forIn'),\n  'forInRight': require('./forInRight'),\n  'forOwn': require('./forOwn'),\n  'forOwnRight': require('./forOwnRight'),\n  'functions': require('./functions'),\n  'functionsIn': require('./functionsIn'),\n  'get': require('./get'),\n  'has': require('./has'),\n  'hasIn': require('./hasIn'),\n  'invert': require('./invert'),\n  'invertBy': require('./invertBy'),\n  'invoke': require('./invoke'),\n  'keys': require('./keys'),\n  'keysIn': require('./keysIn'),\n  'mapKeys': require('./mapKeys'),\n  'mapValues': require('./mapValues'),\n  'merge': require('./merge'),\n  'mergeWith': require('./mergeWith'),\n  'omit': require('./omit'),\n  'omitBy': require('./omitBy'),\n  'pick': require('./pick'),\n  'pickBy': require('./pickBy'),\n  'result': require('./result'),\n  'set': require('./set'),\n  'setWith': require('./setWith'),\n  'toPairs': require('./toPairs'),\n  'toPairsIn': require('./toPairsIn'),\n  'transform': require('./transform'),\n  'unset': require('./unset'),\n  'update': require('./update'),\n  'updateWith': require('./updateWith'),\n  'values': require('./values'),\n  'valuesIn': require('./valuesIn')\n};\n","var arrayMap = require('./_arrayMap'),\n    baseClone = require('./_baseClone'),\n    baseUnset = require('./_baseUnset'),\n    castPath = require('./_castPath'),\n    copyObject = require('./_copyObject'),\n    customOmitClone = require('./_customOmitClone'),\n    flatRest = require('./_flatRest'),\n    getAllKeysIn = require('./_getAllKeysIn');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n    CLONE_FLAT_FLAG = 2,\n    CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\nvar omit = flatRest(function(object, paths) {\n  var result = {};\n  if (object == null) {\n    return result;\n  }\n  var isDeep = false;\n  paths = arrayMap(paths, function(path) {\n    path = castPath(path, object);\n    isDeep || (isDeep = path.length > 1);\n    return path;\n  });\n  copyObject(object, getAllKeysIn(object), result);\n  if (isDeep) {\n    result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n  }\n  var length = paths.length;\n  while (length--) {\n    baseUnset(result, paths[length]);\n  }\n  return result;\n});\n\nmodule.exports = omit;\n","var baseIteratee = require('./_baseIteratee'),\n    negate = require('./negate'),\n    pickBy = require('./pickBy');\n\n/**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\nfunction omitBy(object, predicate) {\n  return pickBy(object, negate(baseIteratee(predicate)));\n}\n\nmodule.exports = omitBy;\n","var baseOrderBy = require('./_baseOrderBy'),\n    isArray = require('./isArray');\n\n/**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n *  The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n *   { 'user': 'fred',   'age': 48 },\n *   { 'user': 'barney', 'age': 34 },\n *   { 'user': 'fred',   'age': 40 },\n *   { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\nfunction orderBy(collection, iteratees, orders, guard) {\n  if (collection == null) {\n    return [];\n  }\n  if (!isArray(iteratees)) {\n    iteratees = iteratees == null ? [] : [iteratees];\n  }\n  orders = guard ? undefined : orders;\n  if (!isArray(orders)) {\n    orders = orders == null ? [] : [orders];\n  }\n  return baseOrderBy(collection, iteratees, orders);\n}\n\nmodule.exports = orderBy;\n","var createAggregator = require('./_createAggregator');\n\n/**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n *   { 'user': 'barney',  'age': 36, 'active': false },\n *   { 'user': 'fred',    'age': 40, 'active': true },\n *   { 'user': 'pebbles', 'age': 1,  'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\nvar partition = createAggregator(function(result, value, key) {\n  result[key ? 0 : 1].push(value);\n}, function() { return [[], []]; });\n\nmodule.exports = partition;\n","var basePick = require('./_basePick'),\n    flatRest = require('./_flatRest');\n\n/**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\nvar pick = flatRest(function(object, paths) {\n  return object == null ? {} : basePick(object, paths);\n});\n\nmodule.exports = pick;\n","var arrayMap = require('./_arrayMap'),\n    baseIteratee = require('./_baseIteratee'),\n    basePickBy = require('./_basePickBy'),\n    getAllKeysIn = require('./_getAllKeysIn');\n\n/**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\nfunction pickBy(object, predicate) {\n  if (object == null) {\n    return {};\n  }\n  var props = arrayMap(getAllKeysIn(object), function(prop) {\n    return [prop];\n  });\n  predicate = baseIteratee(predicate);\n  return basePickBy(object, props, function(value, path) {\n    return predicate(value, path[0]);\n  });\n}\n\nmodule.exports = pickBy;\n","var baseProperty = require('./_baseProperty'),\n    basePropertyDeep = require('./_basePropertyDeep'),\n    isKey = require('./_isKey'),\n    toKey = require('./_toKey');\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n *   { 'a': { 'b': 2 } },\n *   { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n  return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = property;\n","var baseRest = require('./_baseRest'),\n    pullAll = require('./pullAll');\n\n/**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\nvar pull = baseRest(pullAll);\n\nmodule.exports = pull;\n","var basePullAll = require('./_basePullAll');\n\n/**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\nfunction pullAll(array, values) {\n  return (array && array.length && values && values.length)\n    ? basePullAll(array, values)\n    : array;\n}\n\nmodule.exports = pullAll;\n","var baseIteratee = require('./_baseIteratee'),\n    basePullAll = require('./_basePullAll');\n\n/**\n * This method is like `_.pullAll` except that it accepts `iteratee` which is\n * invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The iteratee is invoked with one argument: (value).\n *\n * **Note:** Unlike `_.differenceBy`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n *\n * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\n * console.log(array);\n * // => [{ 'x': 2 }]\n */\nfunction pullAllBy(array, values, iteratee) {\n  return (array && array.length && values && values.length)\n    ? basePullAll(array, values, baseIteratee(iteratee, 2))\n    : array;\n}\n\nmodule.exports = pullAllBy;\n","var basePullAll = require('./_basePullAll');\n\n/**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\nfunction pullAllWith(array, values, comparator) {\n  return (array && array.length && values && values.length)\n    ? basePullAll(array, values, undefined, comparator)\n    : array;\n}\n\nmodule.exports = pullAllWith;\n","var arrayMap = require('./_arrayMap'),\n    baseAt = require('./_baseAt'),\n    basePullAt = require('./_basePullAt'),\n    compareAscending = require('./_compareAscending'),\n    flatRest = require('./_flatRest'),\n    isIndex = require('./_isIndex');\n\n/**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\nvar pullAt = flatRest(function(array, indexes) {\n  var length = array == null ? 0 : array.length,\n      result = baseAt(array, indexes);\n\n  basePullAt(array, arrayMap(indexes, function(index) {\n    return isIndex(index, length) ? +index : index;\n  }).sort(compareAscending));\n\n  return result;\n});\n\nmodule.exports = pullAt;\n","var arrayReduce = require('./_arrayReduce'),\n    baseEach = require('./_baseEach'),\n    baseIteratee = require('./_baseIteratee'),\n    baseReduce = require('./_baseReduce'),\n    isArray = require('./isArray');\n\n/**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n *   return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n *   (result[value] || (result[value] = [])).push(key);\n *   return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\nfunction reduce(collection, iteratee, accumulator) {\n  var func = isArray(collection) ? arrayReduce : baseReduce,\n      initAccum = arguments.length < 3;\n\n  return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n}\n\nmodule.exports = reduce;\n","var arrayReduceRight = require('./_arrayReduceRight'),\n    baseEachRight = require('./_baseEachRight'),\n    baseIteratee = require('./_baseIteratee'),\n    baseReduce = require('./_baseReduce'),\n    isArray = require('./isArray');\n\n/**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n *   return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\nfunction reduceRight(collection, iteratee, accumulator) {\n  var func = isArray(collection) ? arrayReduceRight : baseReduce,\n      initAccum = arguments.length < 3;\n\n  return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n}\n\nmodule.exports = reduceRight;\n","var arrayFilter = require('./_arrayFilter'),\n    baseFilter = require('./_baseFilter'),\n    baseIteratee = require('./_baseIteratee'),\n    isArray = require('./isArray'),\n    negate = require('./negate');\n\n/**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n *   { 'user': 'barney', 'age': 36, 'active': false },\n *   { 'user': 'fred',   'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\nfunction reject(collection, predicate) {\n  var func = isArray(collection) ? arrayFilter : baseFilter;\n  return func(collection, negate(baseIteratee(predicate, 3)));\n}\n\nmodule.exports = reject;\n","var baseIteratee = require('./_baseIteratee'),\n    basePullAt = require('./_basePullAt');\n\n/**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is invoked\n * with three arguments: (value, index, array).\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`\n * to pull elements from an array by value.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n *   return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\nfunction remove(array, predicate) {\n  var result = [];\n  if (!(array && array.length)) {\n    return result;\n  }\n  var index = -1,\n      indexes = [],\n      length = array.length;\n\n  predicate = baseIteratee(predicate, 3);\n  while (++index < length) {\n    var value = array[index];\n    if (predicate(value, index, array)) {\n      result.push(value);\n      indexes.push(index);\n    }\n  }\n  basePullAt(array, indexes);\n  return result;\n}\n\nmodule.exports = remove;\n","var castPath = require('./_castPath'),\n    isFunction = require('./isFunction'),\n    toKey = require('./_toKey');\n\n/**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\nfunction result(object, path, defaultValue) {\n  path = castPath(path, object);\n\n  var index = -1,\n      length = path.length;\n\n  // Ensure the loop is entered when path is empty.\n  if (!length) {\n    length = 1;\n    object = undefined;\n  }\n  while (++index < length) {\n    var value = object == null ? undefined : object[toKey(path[index])];\n    if (value === undefined) {\n      index = length;\n      value = defaultValue;\n    }\n    object = isFunction(value) ? value.call(object) : value;\n  }\n  return object;\n}\n\nmodule.exports = result;\n","/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeReverse = arrayProto.reverse;\n\n/**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\nfunction reverse(array) {\n  return array == null ? array : nativeReverse.call(array);\n}\n\nmodule.exports = reverse;\n","var arraySample = require('./_arraySample'),\n    baseSample = require('./_baseSample'),\n    isArray = require('./isArray');\n\n/**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\nfunction sample(collection) {\n  var func = isArray(collection) ? arraySample : baseSample;\n  return func(collection);\n}\n\nmodule.exports = sample;\n","var arraySampleSize = require('./_arraySampleSize'),\n    baseSampleSize = require('./_baseSampleSize'),\n    isArray = require('./isArray'),\n    isIterateeCall = require('./_isIterateeCall'),\n    toInteger = require('./toInteger');\n\n/**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\nfunction sampleSize(collection, n, guard) {\n  if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n    n = 1;\n  } else {\n    n = toInteger(n);\n  }\n  var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n  return func(collection, n);\n}\n\nmodule.exports = sampleSize;\n","var baseSet = require('./_baseSet');\n\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\nfunction set(object, path, value) {\n  return object == null ? object : baseSet(object, path, value);\n}\n\nmodule.exports = set;\n","var baseSet = require('./_baseSet');\n\n/**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`.  If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\nfunction setWith(object, path, value, customizer) {\n  customizer = typeof customizer == 'function' ? customizer : undefined;\n  return object == null ? object : baseSet(object, path, value, customizer);\n}\n\nmodule.exports = setWith;\n","var arrayShuffle = require('./_arrayShuffle'),\n    baseShuffle = require('./_baseShuffle'),\n    isArray = require('./isArray');\n\n/**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\nfunction shuffle(collection) {\n  var func = isArray(collection) ? arrayShuffle : baseShuffle;\n  return func(collection);\n}\n\nmodule.exports = shuffle;\n","var baseKeys = require('./_baseKeys'),\n    getTag = require('./_getTag'),\n    isArrayLike = require('./isArrayLike'),\n    isString = require('./isString'),\n    stringSize = require('./_stringSize');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n    setTag = '[object Set]';\n\n/**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\nfunction size(collection) {\n  if (collection == null) {\n    return 0;\n  }\n  if (isArrayLike(collection)) {\n    return isString(collection) ? stringSize(collection) : collection.length;\n  }\n  var tag = getTag(collection);\n  if (tag == mapTag || tag == setTag) {\n    return collection.size;\n  }\n  return baseKeys(collection).length;\n}\n\nmodule.exports = size;\n","var baseSlice = require('./_baseSlice'),\n    isIterateeCall = require('./_isIterateeCall'),\n    toInteger = require('./toInteger');\n\n/**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction slice(array, start, end) {\n  var length = array == null ? 0 : array.length;\n  if (!length) {\n    return [];\n  }\n  if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n    start = 0;\n    end = length;\n  }\n  else {\n    start = start == null ? 0 : toInteger(start);\n    end = end === undefined ? length : toInteger(end);\n  }\n  return baseSlice(array, start, end);\n}\n\nmodule.exports = slice;\n","var arraySome = require('./_arraySome'),\n    baseIteratee = require('./_baseIteratee'),\n    baseSome = require('./_baseSome'),\n    isArray = require('./isArray'),\n    isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n *  else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n *   { 'user': 'barney', 'active': true },\n *   { 'user': 'fred',   'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\nfunction some(collection, predicate, guard) {\n  var func = isArray(collection) ? arraySome : baseSome;\n  if (guard && isIterateeCall(collection, predicate, guard)) {\n    predicate = undefined;\n  }\n  return func(collection, baseIteratee(predicate, 3));\n}\n\nmodule.exports = some;\n","var baseFlatten = require('./_baseFlatten'),\n    baseOrderBy = require('./_baseOrderBy'),\n    baseRest = require('./_baseRest'),\n    isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n *  The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n *   { 'user': 'fred',   'age': 48 },\n *   { 'user': 'barney', 'age': 36 },\n *   { 'user': 'fred',   'age': 30 },\n *   { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\nvar sortBy = baseRest(function(collection, iteratees) {\n  if (collection == null) {\n    return [];\n  }\n  var length = iteratees.length;\n  if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n    iteratees = [];\n  } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n    iteratees = [iteratees[0]];\n  }\n  return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n});\n\nmodule.exports = sortBy;\n","var baseSortedIndex = require('./_baseSortedIndex');\n\n/**\n * Uses a binary search to determine the lowest index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n *  into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n */\nfunction sortedIndex(array, value) {\n  return baseSortedIndex(array, value);\n}\n\nmodule.exports = sortedIndex;\n","var baseIteratee = require('./_baseIteratee'),\n    baseSortedIndexBy = require('./_baseSortedIndexBy');\n\n/**\n * This method is like `_.sortedIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n *  into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedIndexBy(objects, { 'x': 4 }, 'x');\n * // => 0\n */\nfunction sortedIndexBy(array, value, iteratee) {\n  return baseSortedIndexBy(array, value, baseIteratee(iteratee, 2));\n}\n\nmodule.exports = sortedIndexBy;\n","var baseSortedIndex = require('./_baseSortedIndex'),\n    eq = require('./eq');\n\n/**\n * This method is like `_.indexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedIndexOf([4, 5, 5, 5, 6], 5);\n * // => 1\n */\nfunction sortedIndexOf(array, value) {\n  var length = array == null ? 0 : array.length;\n  if (length) {\n    var index = baseSortedIndex(array, value);\n    if (index < length && eq(array[index], value)) {\n      return index;\n    }\n  }\n  return -1;\n}\n\nmodule.exports = sortedIndexOf;\n","var baseSortedIndex = require('./_baseSortedIndex');\n\n/**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n *  into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 5, 5, 5, 6], 5);\n * // => 4\n */\nfunction sortedLastIndex(array, value) {\n  return baseSortedIndex(array, value, true);\n}\n\nmodule.exports = sortedLastIndex;\n","var baseIteratee = require('./_baseIteratee'),\n    baseSortedIndexBy = require('./_baseSortedIndexBy');\n\n/**\n * This method is like `_.sortedLastIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n *  into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 1\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');\n * // => 1\n */\nfunction sortedLastIndexBy(array, value, iteratee) {\n  return baseSortedIndexBy(array, value, baseIteratee(iteratee, 2), true);\n}\n\nmodule.exports = sortedLastIndexBy;\n","var baseSortedIndex = require('./_baseSortedIndex'),\n    eq = require('./eq');\n\n/**\n * This method is like `_.lastIndexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);\n * // => 3\n */\nfunction sortedLastIndexOf(array, value) {\n  var length = array == null ? 0 : array.length;\n  if (length) {\n    var index = baseSortedIndex(array, value, true) - 1;\n    if (eq(array[index], value)) {\n      return index;\n    }\n  }\n  return -1;\n}\n\nmodule.exports = sortedLastIndexOf;\n","var baseSortedUniq = require('./_baseSortedUniq');\n\n/**\n * This method is like `_.uniq` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniq([1, 1, 2]);\n * // => [1, 2]\n */\nfunction sortedUniq(array) {\n  return (array && array.length)\n    ? baseSortedUniq(array)\n    : [];\n}\n\nmodule.exports = sortedUniq;\n","var baseIteratee = require('./_baseIteratee'),\n    baseSortedUniq = require('./_baseSortedUniq');\n\n/**\n * This method is like `_.uniqBy` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n * // => [1.1, 2.3]\n */\nfunction sortedUniqBy(array, iteratee) {\n  return (array && array.length)\n    ? baseSortedUniq(array, baseIteratee(iteratee, 2))\n    : [];\n}\n\nmodule.exports = sortedUniqBy;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n  return [];\n}\n\nmodule.exports = stubArray;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n  return false;\n}\n\nmodule.exports = stubFalse;\n","var baseSlice = require('./_baseSlice');\n\n/**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.tail([1, 2, 3]);\n * // => [2, 3]\n */\nfunction tail(array) {\n  var length = array == null ? 0 : array.length;\n  return length ? baseSlice(array, 1, length) : [];\n}\n\nmodule.exports = tail;\n","var baseSlice = require('./_baseSlice'),\n    toInteger = require('./toInteger');\n\n/**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\nfunction take(array, n, guard) {\n  if (!(array && array.length)) {\n    return [];\n  }\n  n = (guard || n === undefined) ? 1 : toInteger(n);\n  return baseSlice(array, 0, n < 0 ? 0 : n);\n}\n\nmodule.exports = take;\n","var baseSlice = require('./_baseSlice'),\n    toInteger = require('./toInteger');\n\n/**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\nfunction takeRight(array, n, guard) {\n  var length = array == null ? 0 : array.length;\n  if (!length) {\n    return [];\n  }\n  n = (guard || n === undefined) ? 1 : toInteger(n);\n  n = length - n;\n  return baseSlice(array, n < 0 ? 0 : n, length);\n}\n\nmodule.exports = takeRight;\n","var baseIteratee = require('./_baseIteratee'),\n    baseWhile = require('./_baseWhile');\n\n/**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n *   { 'user': 'barney',  'active': true },\n *   { 'user': 'fred',    'active': false },\n *   { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.takeRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeRightWhile(users, ['active', false]);\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeRightWhile(users, 'active');\n * // => []\n */\nfunction takeRightWhile(array, predicate) {\n  return (array && array.length)\n    ? baseWhile(array, baseIteratee(predicate, 3), false, true)\n    : [];\n}\n\nmodule.exports = takeRightWhile;\n","var baseIteratee = require('./_baseIteratee'),\n    baseWhile = require('./_baseWhile');\n\n/**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n *   { 'user': 'barney',  'active': false },\n *   { 'user': 'fred',    'active': false },\n *   { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.takeWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeWhile(users, ['active', false]);\n * // => objects for ['barney', 'fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeWhile(users, 'active');\n * // => []\n */\nfunction takeWhile(array, predicate) {\n  return (array && array.length)\n    ? baseWhile(array, baseIteratee(predicate, 3))\n    : [];\n}\n\nmodule.exports = takeWhile;\n","var toNumber = require('./toNumber');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n    MAX_INTEGER = 1.7976931348623157e+308;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n  if (!value) {\n    return value === 0 ? value : 0;\n  }\n  value = toNumber(value);\n  if (value === INFINITY || value === -INFINITY) {\n    var sign = (value < 0 ? -1 : 1);\n    return sign * MAX_INTEGER;\n  }\n  return value === value ? value : 0;\n}\n\nmodule.exports = toFinite;\n","var toFinite = require('./toFinite');\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n  var result = toFinite(value),\n      remainder = result % 1;\n\n  return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\nmodule.exports = toInteger;\n","var baseClamp = require('./_baseClamp'),\n    toInteger = require('./toInteger');\n\n/** Used as references for the maximum length and index of an array. */\nvar MAX_ARRAY_LENGTH = 4294967295;\n\n/**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\nfunction toLength(value) {\n  return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n}\n\nmodule.exports = toLength;\n","var baseTrim = require('./_baseTrim'),\n    isObject = require('./isObject'),\n    isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n  if (typeof value == 'number') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return NAN;\n  }\n  if (isObject(value)) {\n    var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n    value = isObject(other) ? (other + '') : other;\n  }\n  if (typeof value != 'string') {\n    return value === 0 ? value : +value;\n  }\n  value = baseTrim(value);\n  var isBinary = reIsBinary.test(value);\n  return (isBinary || reIsOctal.test(value))\n    ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n    : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var createToPairs = require('./_createToPairs'),\n    keys = require('./keys');\n\n/**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\nvar toPairs = createToPairs(keys);\n\nmodule.exports = toPairs;\n","var createToPairs = require('./_createToPairs'),\n    keysIn = require('./keysIn');\n\n/**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\nvar toPairsIn = createToPairs(keysIn);\n\nmodule.exports = toPairsIn;\n","var copyObject = require('./_copyObject'),\n    keysIn = require('./keysIn');\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n  return copyObject(value, keysIn(value));\n}\n\nmodule.exports = toPlainObject;\n","var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n  return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n","var arrayEach = require('./_arrayEach'),\n    baseCreate = require('./_baseCreate'),\n    baseForOwn = require('./_baseForOwn'),\n    baseIteratee = require('./_baseIteratee'),\n    getPrototype = require('./_getPrototype'),\n    isArray = require('./isArray'),\n    isBuffer = require('./isBuffer'),\n    isFunction = require('./isFunction'),\n    isObject = require('./isObject'),\n    isTypedArray = require('./isTypedArray');\n\n/**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n *   result.push(n *= n);\n *   return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n *   (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\nfunction transform(object, iteratee, accumulator) {\n  var isArr = isArray(object),\n      isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n  iteratee = baseIteratee(iteratee, 4);\n  if (accumulator == null) {\n    var Ctor = object && object.constructor;\n    if (isArrLike) {\n      accumulator = isArr ? new Ctor : [];\n    }\n    else if (isObject(object)) {\n      accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n    }\n    else {\n      accumulator = {};\n    }\n  }\n  (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n    return iteratee(accumulator, value, index, object);\n  });\n  return accumulator;\n}\n\nmodule.exports = transform;\n","var baseFlatten = require('./_baseFlatten'),\n    baseRest = require('./_baseRest'),\n    baseUniq = require('./_baseUniq'),\n    isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\nvar union = baseRest(function(arrays) {\n  return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n});\n\nmodule.exports = union;\n","var baseFlatten = require('./_baseFlatten'),\n    baseIteratee = require('./_baseIteratee'),\n    baseRest = require('./_baseRest'),\n    baseUniq = require('./_baseUniq'),\n    isArrayLikeObject = require('./isArrayLikeObject'),\n    last = require('./last');\n\n/**\n * This method is like `_.union` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which uniqueness is computed. Result values are chosen from the first\n * array in which the value occurs. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.unionBy([2.1], [1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\nvar unionBy = baseRest(function(arrays) {\n  var iteratee = last(arrays);\n  if (isArrayLikeObject(iteratee)) {\n    iteratee = undefined;\n  }\n  return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), baseIteratee(iteratee, 2));\n});\n\nmodule.exports = unionBy;\n","var baseFlatten = require('./_baseFlatten'),\n    baseRest = require('./_baseRest'),\n    baseUniq = require('./_baseUniq'),\n    isArrayLikeObject = require('./isArrayLikeObject'),\n    last = require('./last');\n\n/**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\nvar unionWith = baseRest(function(arrays) {\n  var comparator = last(arrays);\n  comparator = typeof comparator == 'function' ? comparator : undefined;\n  return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n});\n\nmodule.exports = unionWith;\n","var baseUniq = require('./_baseUniq');\n\n/**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\nfunction uniq(array) {\n  return (array && array.length) ? baseUniq(array) : [];\n}\n\nmodule.exports = uniq;\n","var baseIteratee = require('./_baseIteratee'),\n    baseUniq = require('./_baseUniq');\n\n/**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\nfunction uniqBy(array, iteratee) {\n  return (array && array.length) ? baseUniq(array, baseIteratee(iteratee, 2)) : [];\n}\n\nmodule.exports = uniqBy;\n","var baseUniq = require('./_baseUniq');\n\n/**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\nfunction uniqWith(array, comparator) {\n  comparator = typeof comparator == 'function' ? comparator : undefined;\n  return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n}\n\nmodule.exports = uniqWith;\n","var baseUnset = require('./_baseUnset');\n\n/**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\nfunction unset(object, path) {\n  return object == null ? true : baseUnset(object, path);\n}\n\nmodule.exports = unset;\n","var arrayFilter = require('./_arrayFilter'),\n    arrayMap = require('./_arrayMap'),\n    baseProperty = require('./_baseProperty'),\n    baseTimes = require('./_baseTimes'),\n    isArrayLikeObject = require('./isArrayLikeObject');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\nfunction unzip(array) {\n  if (!(array && array.length)) {\n    return [];\n  }\n  var length = 0;\n  array = arrayFilter(array, function(group) {\n    if (isArrayLikeObject(group)) {\n      length = nativeMax(group.length, length);\n      return true;\n    }\n  });\n  return baseTimes(length, function(index) {\n    return arrayMap(array, baseProperty(index));\n  });\n}\n\nmodule.exports = unzip;\n","var apply = require('./_apply'),\n    arrayMap = require('./_arrayMap'),\n    unzip = require('./unzip');\n\n/**\n * This method is like `_.unzip` except that it accepts `iteratee` to specify\n * how regrouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n *  regrouped values.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\nfunction unzipWith(array, iteratee) {\n  if (!(array && array.length)) {\n    return [];\n  }\n  var result = unzip(array);\n  if (iteratee == null) {\n    return result;\n  }\n  return arrayMap(result, function(group) {\n    return apply(iteratee, undefined, group);\n  });\n}\n\nmodule.exports = unzipWith;\n","var baseUpdate = require('./_baseUpdate'),\n    castFunction = require('./_castFunction');\n\n/**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\nfunction update(object, path, updater) {\n  return object == null ? object : baseUpdate(object, path, castFunction(updater));\n}\n\nmodule.exports = update;\n","var baseUpdate = require('./_baseUpdate'),\n    castFunction = require('./_castFunction');\n\n/**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`.  If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\nfunction updateWith(object, path, updater, customizer) {\n  customizer = typeof customizer == 'function' ? customizer : undefined;\n  return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n}\n\nmodule.exports = updateWith;\n","var baseValues = require('./_baseValues'),\n    keys = require('./keys');\n\n/**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\nfunction values(object) {\n  return object == null ? [] : baseValues(object, keys(object));\n}\n\nmodule.exports = values;\n","var baseValues = require('./_baseValues'),\n    keysIn = require('./keysIn');\n\n/**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\nfunction valuesIn(object) {\n  return object == null ? [] : baseValues(object, keysIn(object));\n}\n\nmodule.exports = valuesIn;\n","var baseDifference = require('./_baseDifference'),\n    baseRest = require('./_baseRest'),\n    isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\nvar without = baseRest(function(array, values) {\n  return isArrayLikeObject(array)\n    ? baseDifference(array, values)\n    : [];\n});\n\nmodule.exports = without;\n","var arrayFilter = require('./_arrayFilter'),\n    baseRest = require('./_baseRest'),\n    baseXor = require('./_baseXor'),\n    isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Creates an array of unique values that is the\n * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n * of the given arrays. The order of result values is determined by the order\n * they occur in the arrays.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.without\n * @example\n *\n * _.xor([2, 1], [2, 3]);\n * // => [1, 3]\n */\nvar xor = baseRest(function(arrays) {\n  return baseXor(arrayFilter(arrays, isArrayLikeObject));\n});\n\nmodule.exports = xor;\n","var arrayFilter = require('./_arrayFilter'),\n    baseIteratee = require('./_baseIteratee'),\n    baseRest = require('./_baseRest'),\n    baseXor = require('./_baseXor'),\n    isArrayLikeObject = require('./isArrayLikeObject'),\n    last = require('./last');\n\n/**\n * This method is like `_.xor` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which by which they're compared. The order of result values is determined\n * by the order they occur in the arrays. The iteratee is invoked with one\n * argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2, 3.4]\n *\n * // The `_.property` iteratee shorthand.\n * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\nvar xorBy = baseRest(function(arrays) {\n  var iteratee = last(arrays);\n  if (isArrayLikeObject(iteratee)) {\n    iteratee = undefined;\n  }\n  return baseXor(arrayFilter(arrays, isArrayLikeObject), baseIteratee(iteratee, 2));\n});\n\nmodule.exports = xorBy;\n","var arrayFilter = require('./_arrayFilter'),\n    baseRest = require('./_baseRest'),\n    baseXor = require('./_baseXor'),\n    isArrayLikeObject = require('./isArrayLikeObject'),\n    last = require('./last');\n\n/**\n * This method is like `_.xor` except that it accepts `comparator` which is\n * invoked to compare elements of `arrays`. The order of result values is\n * determined by the order they occur in the arrays. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.xorWith(objects, others, _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\nvar xorWith = baseRest(function(arrays) {\n  var comparator = last(arrays);\n  comparator = typeof comparator == 'function' ? comparator : undefined;\n  return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);\n});\n\nmodule.exports = xorWith;\n","var baseRest = require('./_baseRest'),\n    unzip = require('./unzip');\n\n/**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\nvar zip = baseRest(unzip);\n\nmodule.exports = zip;\n","var assignValue = require('./_assignValue'),\n    baseZipObject = require('./_baseZipObject');\n\n/**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\nfunction zipObject(props, values) {\n  return baseZipObject(props || [], values || [], assignValue);\n}\n\nmodule.exports = zipObject;\n","var baseSet = require('./_baseSet'),\n    baseZipObject = require('./_baseZipObject');\n\n/**\n * This method is like `_.zipObject` except that it supports property paths.\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);\n * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\nfunction zipObjectDeep(props, values) {\n  return baseZipObject(props || [], values || [], baseSet);\n}\n\nmodule.exports = zipObjectDeep;\n","var baseRest = require('./_baseRest'),\n    unzipWith = require('./unzipWith');\n\n/**\n * This method is like `_.zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n *  grouped values.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {\n *   return a + b + c;\n * });\n * // => [111, 222]\n */\nvar zipWith = baseRest(function(arrays) {\n  var length = arrays.length,\n      iteratee = length > 1 ? arrays[length - 1] : undefined;\n\n  iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;\n  return unzipWith(arrays, iteratee);\n});\n\nmodule.exports = zipWith;\n","var moment = module.exports = require(\"./moment-timezone\");\nmoment.tz.load(require('./data/packed/latest.json'));\n","//! moment-timezone.js\n//! version : 0.5.44\n//! Copyright (c) JS Foundation and other contributors\n//! license : MIT\n//! github.com/moment/moment-timezone\n\n(function (root, factory) {\n\t\"use strict\";\n\n\t/*global define*/\n\tif (typeof module === 'object' && module.exports) {\n\t\tmodule.exports = factory(require('moment')); // Node\n\t} else if (typeof define === 'function' && define.amd) {\n\t\tdefine(['moment'], factory);                 // AMD\n\t} else {\n\t\tfactory(root.moment);                        // Browser\n\t}\n}(this, function (moment) {\n\t\"use strict\";\n\n\t// Resolves es6 module loading issue\n\tif (moment.version === undefined && moment.default) {\n\t\tmoment = moment.default;\n\t}\n\n\t// Do not load moment-timezone a second time.\n\t// if (moment.tz !== undefined) {\n\t// \tlogError('Moment Timezone ' + moment.tz.version + ' was already loaded ' + (moment.tz.dataVersion ? 'with data from ' : 'without any data') + moment.tz.dataVersion);\n\t// \treturn moment;\n\t// }\n\n\tvar VERSION = \"0.5.44\",\n\t\tzones = {},\n\t\tlinks = {},\n\t\tcountries = {},\n\t\tnames = {},\n\t\tguesses = {},\n\t\tcachedGuess;\n\n\tif (!moment || typeof moment.version !== 'string') {\n\t\tlogError('Moment Timezone requires Moment.js. See https://momentjs.com/timezone/docs/#/use-it/browser/');\n\t}\n\n\tvar momentVersion = moment.version.split('.'),\n\t\tmajor = +momentVersion[0],\n\t\tminor = +momentVersion[1];\n\n\t// Moment.js version check\n\tif (major < 2 || (major === 2 && minor < 6)) {\n\t\tlogError('Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js ' + moment.version + '. See momentjs.com');\n\t}\n\n\t/************************************\n\t\tUnpacking\n\t************************************/\n\n\tfunction charCodeToInt(charCode) {\n\t\tif (charCode > 96) {\n\t\t\treturn charCode - 87;\n\t\t} else if (charCode > 64) {\n\t\t\treturn charCode - 29;\n\t\t}\n\t\treturn charCode - 48;\n\t}\n\n\tfunction unpackBase60(string) {\n\t\tvar i = 0,\n\t\t\tparts = string.split('.'),\n\t\t\twhole = parts[0],\n\t\t\tfractional = parts[1] || '',\n\t\t\tmultiplier = 1,\n\t\t\tnum,\n\t\t\tout = 0,\n\t\t\tsign = 1;\n\n\t\t// handle negative numbers\n\t\tif (string.charCodeAt(0) === 45) {\n\t\t\ti = 1;\n\t\t\tsign = -1;\n\t\t}\n\n\t\t// handle digits before the decimal\n\t\tfor (i; i < whole.length; i++) {\n\t\t\tnum = charCodeToInt(whole.charCodeAt(i));\n\t\t\tout = 60 * out + num;\n\t\t}\n\n\t\t// handle digits after the decimal\n\t\tfor (i = 0; i < fractional.length; i++) {\n\t\t\tmultiplier = multiplier / 60;\n\t\t\tnum = charCodeToInt(fractional.charCodeAt(i));\n\t\t\tout += num * multiplier;\n\t\t}\n\n\t\treturn out * sign;\n\t}\n\n\tfunction arrayToInt (array) {\n\t\tfor (var i = 0; i < array.length; i++) {\n\t\t\tarray[i] = unpackBase60(array[i]);\n\t\t}\n\t}\n\n\tfunction intToUntil (array, length) {\n\t\tfor (var i = 0; i < length; i++) {\n\t\t\tarray[i] = Math.round((array[i - 1] || 0) + (array[i] * 60000)); // minutes to milliseconds\n\t\t}\n\n\t\tarray[length - 1] = Infinity;\n\t}\n\n\tfunction mapIndices (source, indices) {\n\t\tvar out = [], i;\n\n\t\tfor (i = 0; i < indices.length; i++) {\n\t\t\tout[i] = source[indices[i]];\n\t\t}\n\n\t\treturn out;\n\t}\n\n\tfunction unpack (string) {\n\t\tvar data = string.split('|'),\n\t\t\toffsets = data[2].split(' '),\n\t\t\tindices = data[3].split(''),\n\t\t\tuntils  = data[4].split(' ');\n\n\t\tarrayToInt(offsets);\n\t\tarrayToInt(indices);\n\t\tarrayToInt(untils);\n\n\t\tintToUntil(untils, indices.length);\n\n\t\treturn {\n\t\t\tname       : data[0],\n\t\t\tabbrs      : mapIndices(data[1].split(' '), indices),\n\t\t\toffsets    : mapIndices(offsets, indices),\n\t\t\tuntils     : untils,\n\t\t\tpopulation : data[5] | 0\n\t\t};\n\t}\n\n\t/************************************\n\t\tZone object\n\t************************************/\n\n\tfunction Zone (packedString) {\n\t\tif (packedString) {\n\t\t\tthis._set(unpack(packedString));\n\t\t}\n\t}\n\n\tfunction closest (num, arr) {\n\t\tvar len = arr.length;\n\t\tif (num < arr[0]) {\n\t\t\treturn 0;\n\t\t} else if (len > 1 && arr[len - 1] === Infinity && num >= arr[len - 2]) {\n\t\t\treturn len - 1;\n\t\t} else if (num >= arr[len - 1]) {\n\t\t\treturn -1;\n\t\t}\n\t\n\t\tvar mid;\n\t\tvar lo = 0;\n\t\tvar hi = len - 1;  \n\t\twhile (hi - lo > 1) {\n\t\t\tmid = Math.floor((lo + hi) / 2);\n\t\t\tif (arr[mid] <= num) {\n\t\t\t\tlo = mid;\n\t\t\t} else {\n\t\t\t\thi = mid;\n\t\t\t}\n\t\t}\n\t\treturn hi;\n\t}\n\t\n\tZone.prototype = {\n\t\t_set : function (unpacked) {\n\t\t\tthis.name       = unpacked.name;\n\t\t\tthis.abbrs      = unpacked.abbrs;\n\t\t\tthis.untils     = unpacked.untils;\n\t\t\tthis.offsets    = unpacked.offsets;\n\t\t\tthis.population = unpacked.population;\n\t\t},\n\n\t\t_index : function (timestamp) {\n\t\t\tvar target = +timestamp,\n\t\t\t\tuntils = this.untils,\n\t\t\t\ti;\n\n\t\t\ti = closest(target, untils);\n\t\t\tif (i >= 0) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t},\n\n\t\tcountries : function () {\n\t\t\tvar zone_name = this.name;\n\t\t\treturn Object.keys(countries).filter(function (country_code) {\n\t\t\t\treturn countries[country_code].zones.indexOf(zone_name) !== -1;\n\t\t\t});\n\t\t},\n\n\t\tparse : function (timestamp) {\n\t\t\tvar target  = +timestamp,\n\t\t\t\toffsets = this.offsets,\n\t\t\t\tuntils  = this.untils,\n\t\t\t\tmax     = untils.length - 1,\n\t\t\t\toffset, offsetNext, offsetPrev, i;\n\n\t\t\tfor (i = 0; i < max; i++) {\n\t\t\t\toffset     = offsets[i];\n\t\t\t\toffsetNext = offsets[i + 1];\n\t\t\t\toffsetPrev = offsets[i ? i - 1 : i];\n\n\t\t\t\tif (offset < offsetNext && tz.moveAmbiguousForward) {\n\t\t\t\t\toffset = offsetNext;\n\t\t\t\t} else if (offset > offsetPrev && tz.moveInvalidForward) {\n\t\t\t\t\toffset = offsetPrev;\n\t\t\t\t}\n\n\t\t\t\tif (target < untils[i] - (offset * 60000)) {\n\t\t\t\t\treturn offsets[i];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn offsets[max];\n\t\t},\n\n\t\tabbr : function (mom) {\n\t\t\treturn this.abbrs[this._index(mom)];\n\t\t},\n\n\t\toffset : function (mom) {\n\t\t\tlogError(\"zone.offset has been deprecated in favor of zone.utcOffset\");\n\t\t\treturn this.offsets[this._index(mom)];\n\t\t},\n\n\t\tutcOffset : function (mom) {\n\t\t\treturn this.offsets[this._index(mom)];\n\t\t}\n\t};\n\n\t/************************************\n\t\tCountry object\n\t************************************/\n\n\tfunction Country (country_name, zone_names) {\n\t\tthis.name = country_name;\n\t\tthis.zones = zone_names;\n\t}\n\n\t/************************************\n\t\tCurrent Timezone\n\t************************************/\n\n\tfunction OffsetAt(at) {\n\t\tvar timeString = at.toTimeString();\n\t\tvar abbr = timeString.match(/\\([a-z ]+\\)/i);\n\t\tif (abbr && abbr[0]) {\n\t\t\t// 17:56:31 GMT-0600 (CST)\n\t\t\t// 17:56:31 GMT-0600 (Central Standard Time)\n\t\t\tabbr = abbr[0].match(/[A-Z]/g);\n\t\t\tabbr = abbr ? abbr.join('') : undefined;\n\t\t} else {\n\t\t\t// 17:56:31 CST\n\t\t\t// 17:56:31 GMT+0800 (台北標準時間)\n\t\t\tabbr = timeString.match(/[A-Z]{3,5}/g);\n\t\t\tabbr = abbr ? abbr[0] : undefined;\n\t\t}\n\n\t\tif (abbr === 'GMT') {\n\t\t\tabbr = undefined;\n\t\t}\n\n\t\tthis.at = +at;\n\t\tthis.abbr = abbr;\n\t\tthis.offset = at.getTimezoneOffset();\n\t}\n\n\tfunction ZoneScore(zone) {\n\t\tthis.zone = zone;\n\t\tthis.offsetScore = 0;\n\t\tthis.abbrScore = 0;\n\t}\n\n\tZoneScore.prototype.scoreOffsetAt = function (offsetAt) {\n\t\tthis.offsetScore += Math.abs(this.zone.utcOffset(offsetAt.at) - offsetAt.offset);\n\t\tif (this.zone.abbr(offsetAt.at).replace(/[^A-Z]/g, '') !== offsetAt.abbr) {\n\t\t\tthis.abbrScore++;\n\t\t}\n\t};\n\n\tfunction findChange(low, high) {\n\t\tvar mid, diff;\n\n\t\twhile ((diff = ((high.at - low.at) / 12e4 | 0) * 6e4)) {\n\t\t\tmid = new OffsetAt(new Date(low.at + diff));\n\t\t\tif (mid.offset === low.offset) {\n\t\t\t\tlow = mid;\n\t\t\t} else {\n\t\t\t\thigh = mid;\n\t\t\t}\n\t\t}\n\n\t\treturn low;\n\t}\n\n\tfunction userOffsets() {\n\t\tvar startYear = new Date().getFullYear() - 2,\n\t\t\tlast = new OffsetAt(new Date(startYear, 0, 1)),\n\t\t\tlastOffset = last.offset,\n\t\t\toffsets = [last],\n\t\t\tchange, next, nextOffset, i;\n\n\t\tfor (i = 1; i < 48; i++) {\n\t\t\tnextOffset = new Date(startYear, i, 1).getTimezoneOffset();\n\t\t\tif (nextOffset !== lastOffset) {\n\t\t\t\t// Create OffsetAt here to avoid unnecessary abbr parsing before checking offsets\n\t\t\t\tnext = new OffsetAt(new Date(startYear, i, 1));\n\t\t\t\tchange = findChange(last, next);\n\t\t\t\toffsets.push(change);\n\t\t\t\toffsets.push(new OffsetAt(new Date(change.at + 6e4)));\n\t\t\t\tlast = next;\n\t\t\t\tlastOffset = nextOffset;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0; i < 4; i++) {\n\t\t\toffsets.push(new OffsetAt(new Date(startYear + i, 0, 1)));\n\t\t\toffsets.push(new OffsetAt(new Date(startYear + i, 6, 1)));\n\t\t}\n\n\t\treturn offsets;\n\t}\n\n\tfunction sortZoneScores (a, b) {\n\t\tif (a.offsetScore !== b.offsetScore) {\n\t\t\treturn a.offsetScore - b.offsetScore;\n\t\t}\n\t\tif (a.abbrScore !== b.abbrScore) {\n\t\t\treturn a.abbrScore - b.abbrScore;\n\t\t}\n\t\tif (a.zone.population !== b.zone.population) {\n\t\t\treturn b.zone.population - a.zone.population;\n\t\t}\n\t\treturn b.zone.name.localeCompare(a.zone.name);\n\t}\n\n\tfunction addToGuesses (name, offsets) {\n\t\tvar i, offset;\n\t\tarrayToInt(offsets);\n\t\tfor (i = 0; i < offsets.length; i++) {\n\t\t\toffset = offsets[i];\n\t\t\tguesses[offset] = guesses[offset] || {};\n\t\t\tguesses[offset][name] = true;\n\t\t}\n\t}\n\n\tfunction guessesForUserOffsets (offsets) {\n\t\tvar offsetsLength = offsets.length,\n\t\t\tfilteredGuesses = {},\n\t\t\tout = [],\n\t\t\tcheckedOffsets = {},\n\t\t\ti, j, offset, guessesOffset;\n\n\t\tfor (i = 0; i < offsetsLength; i++) {\n\t\t\toffset = offsets[i].offset;\n\t\t\tif (checkedOffsets.hasOwnProperty(offset)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tguessesOffset = guesses[offset] || {};\n\t\t\tfor (j in guessesOffset) {\n\t\t\t\tif (guessesOffset.hasOwnProperty(j)) {\n\t\t\t\t\tfilteredGuesses[j] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcheckedOffsets[offset] = true;\n\t\t}\n\n\t\tfor (i in filteredGuesses) {\n\t\t\tif (filteredGuesses.hasOwnProperty(i)) {\n\t\t\t\tout.push(names[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn out;\n\t}\n\n\tfunction rebuildGuess () {\n\n\t\t// use Intl API when available and returning valid time zone\n\t\ttry {\n\t\t\tvar intlName = Intl.DateTimeFormat().resolvedOptions().timeZone;\n\t\t\tif (intlName && intlName.length > 3) {\n\t\t\t\tvar name = names[normalizeName(intlName)];\n\t\t\t\tif (name) {\n\t\t\t\t\treturn name;\n\t\t\t\t}\n\t\t\t\tlogError(\"Moment Timezone found \" + intlName + \" from the Intl api, but did not have that data loaded.\");\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t// Intl unavailable, fall back to manual guessing.\n\t\t}\n\n\t\tvar offsets = userOffsets(),\n\t\t\toffsetsLength = offsets.length,\n\t\t\tguesses = guessesForUserOffsets(offsets),\n\t\t\tzoneScores = [],\n\t\t\tzoneScore, i, j;\n\n\t\tfor (i = 0; i < guesses.length; i++) {\n\t\t\tzoneScore = new ZoneScore(getZone(guesses[i]), offsetsLength);\n\t\t\tfor (j = 0; j < offsetsLength; j++) {\n\t\t\t\tzoneScore.scoreOffsetAt(offsets[j]);\n\t\t\t}\n\t\t\tzoneScores.push(zoneScore);\n\t\t}\n\n\t\tzoneScores.sort(sortZoneScores);\n\n\t\treturn zoneScores.length > 0 ? zoneScores[0].zone.name : undefined;\n\t}\n\n\tfunction guess (ignoreCache) {\n\t\tif (!cachedGuess || ignoreCache) {\n\t\t\tcachedGuess = rebuildGuess();\n\t\t}\n\t\treturn cachedGuess;\n\t}\n\n\t/************************************\n\t\tGlobal Methods\n\t************************************/\n\n\tfunction normalizeName (name) {\n\t\treturn (name || '').toLowerCase().replace(/\\//g, '_');\n\t}\n\n\tfunction addZone (packed) {\n\t\tvar i, name, split, normalized;\n\n\t\tif (typeof packed === \"string\") {\n\t\t\tpacked = [packed];\n\t\t}\n\n\t\tfor (i = 0; i < packed.length; i++) {\n\t\t\tsplit = packed[i].split('|');\n\t\t\tname = split[0];\n\t\t\tnormalized = normalizeName(name);\n\t\t\tzones[normalized] = packed[i];\n\t\t\tnames[normalized] = name;\n\t\t\taddToGuesses(normalized, split[2].split(' '));\n\t\t}\n\t}\n\n\tfunction getZone (name, caller) {\n\n\t\tname = normalizeName(name);\n\n\t\tvar zone = zones[name];\n\t\tvar link;\n\n\t\tif (zone instanceof Zone) {\n\t\t\treturn zone;\n\t\t}\n\n\t\tif (typeof zone === 'string') {\n\t\t\tzone = new Zone(zone);\n\t\t\tzones[name] = zone;\n\t\t\treturn zone;\n\t\t}\n\n\t\t// Pass getZone to prevent recursion more than 1 level deep\n\t\tif (links[name] && caller !== getZone && (link = getZone(links[name], getZone))) {\n\t\t\tzone = zones[name] = new Zone();\n\t\t\tzone._set(link);\n\t\t\tzone.name = names[name];\n\t\t\treturn zone;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tfunction getNames () {\n\t\tvar i, out = [];\n\n\t\tfor (i in names) {\n\t\t\tif (names.hasOwnProperty(i) && (zones[i] || zones[links[i]]) && names[i]) {\n\t\t\t\tout.push(names[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn out.sort();\n\t}\n\n\tfunction getCountryNames () {\n\t\treturn Object.keys(countries);\n\t}\n\n\tfunction addLink (aliases) {\n\t\tvar i, alias, normal0, normal1;\n\n\t\tif (typeof aliases === \"string\") {\n\t\t\taliases = [aliases];\n\t\t}\n\n\t\tfor (i = 0; i < aliases.length; i++) {\n\t\t\talias = aliases[i].split('|');\n\n\t\t\tnormal0 = normalizeName(alias[0]);\n\t\t\tnormal1 = normalizeName(alias[1]);\n\n\t\t\tlinks[normal0] = normal1;\n\t\t\tnames[normal0] = alias[0];\n\n\t\t\tlinks[normal1] = normal0;\n\t\t\tnames[normal1] = alias[1];\n\t\t}\n\t}\n\n\tfunction addCountries (data) {\n\t\tvar i, country_code, country_zones, split;\n\t\tif (!data || !data.length) return;\n\t\tfor (i = 0; i < data.length; i++) {\n\t\t\tsplit = data[i].split('|');\n\t\t\tcountry_code = split[0].toUpperCase();\n\t\t\tcountry_zones = split[1].split(' ');\n\t\t\tcountries[country_code] = new Country(\n\t\t\t\tcountry_code,\n\t\t\t\tcountry_zones\n\t\t\t);\n\t\t}\n\t}\n\n\tfunction getCountry (name) {\n\t\tname = name.toUpperCase();\n\t\treturn countries[name] || null;\n\t}\n\n\tfunction zonesForCountry(country, with_offset) {\n\t\tcountry = getCountry(country);\n\n\t\tif (!country) return null;\n\n\t\tvar zones = country.zones.sort();\n\n\t\tif (with_offset) {\n\t\t\treturn zones.map(function (zone_name) {\n\t\t\t\tvar zone = getZone(zone_name);\n\t\t\t\treturn {\n\t\t\t\t\tname: zone_name,\n\t\t\t\t\toffset: zone.utcOffset(new Date())\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\n\t\treturn zones;\n\t}\n\n\tfunction loadData (data) {\n\t\taddZone(data.zones);\n\t\taddLink(data.links);\n\t\taddCountries(data.countries);\n\t\ttz.dataVersion = data.version;\n\t}\n\n\tfunction zoneExists (name) {\n\t\tif (!zoneExists.didShowError) {\n\t\t\tzoneExists.didShowError = true;\n\t\t\t\tlogError(\"moment.tz.zoneExists('\" + name + \"') has been deprecated in favor of !moment.tz.zone('\" + name + \"')\");\n\t\t}\n\t\treturn !!getZone(name);\n\t}\n\n\tfunction needsOffset (m) {\n\t\tvar isUnixTimestamp = (m._f === 'X' || m._f === 'x');\n\t\treturn !!(m._a && (m._tzm === undefined) && !isUnixTimestamp);\n\t}\n\n\tfunction logError (message) {\n\t\tif (typeof console !== 'undefined' && typeof console.error === 'function') {\n\t\t\tconsole.error(message);\n\t\t}\n\t}\n\n\t/************************************\n\t\tmoment.tz namespace\n\t************************************/\n\n\tfunction tz (input) {\n\t\tvar args = Array.prototype.slice.call(arguments, 0, -1),\n\t\t\tname = arguments[arguments.length - 1],\n\t\t\tout  = moment.utc.apply(null, args),\n\t\t\tzone;\n\n\t\tif (!moment.isMoment(input) && needsOffset(out) && (zone = getZone(name))) {\n\t\t\tout.add(zone.parse(out), 'minutes');\n\t\t}\n\n\t\tout.tz(name);\n\n\t\treturn out;\n\t}\n\n\ttz.version      = VERSION;\n\ttz.dataVersion  = '';\n\ttz._zones       = zones;\n\ttz._links       = links;\n\ttz._names       = names;\n\ttz._countries\t= countries;\n\ttz.add          = addZone;\n\ttz.link         = addLink;\n\ttz.load         = loadData;\n\ttz.zone         = getZone;\n\ttz.zoneExists   = zoneExists; // deprecated in 0.1.0\n\ttz.guess        = guess;\n\ttz.names        = getNames;\n\ttz.Zone         = Zone;\n\ttz.unpack       = unpack;\n\ttz.unpackBase60 = unpackBase60;\n\ttz.needsOffset  = needsOffset;\n\ttz.moveInvalidForward   = true;\n\ttz.moveAmbiguousForward = false;\n\ttz.countries    = getCountryNames;\n\ttz.zonesForCountry = zonesForCountry;\n\n\t/************************************\n\t\tInterface with Moment.js\n\t************************************/\n\n\tvar fn = moment.fn;\n\n\tmoment.tz = tz;\n\n\tmoment.defaultZone = null;\n\n\tmoment.updateOffset = function (mom, keepTime) {\n\t\tvar zone = moment.defaultZone,\n\t\t\toffset;\n\n\t\tif (mom._z === undefined) {\n\t\t\tif (zone && needsOffset(mom) && !mom._isUTC && mom.isValid()) {\n\t\t\t\tmom._d = moment.utc(mom._a)._d;\n\t\t\t\tmom.utc().add(zone.parse(mom), 'minutes');\n\t\t\t}\n\t\t\tmom._z = zone;\n\t\t}\n\t\tif (mom._z) {\n\t\t\toffset = mom._z.utcOffset(mom);\n\t\t\tif (Math.abs(offset) < 16) {\n\t\t\t\toffset = offset / 60;\n\t\t\t}\n\t\t\tif (mom.utcOffset !== undefined) {\n\t\t\t\tvar z = mom._z;\n\t\t\t\tmom.utcOffset(-offset, keepTime);\n\t\t\t\tmom._z = z;\n\t\t\t} else {\n\t\t\t\tmom.zone(offset, keepTime);\n\t\t\t}\n\t\t}\n\t};\n\n\tfn.tz = function (name, keepTime) {\n\t\tif (name) {\n\t\t\tif (typeof name !== 'string') {\n\t\t\t\tthrow new Error('Time zone name must be a string, got ' + name + ' [' + typeof name + ']');\n\t\t\t}\n\t\t\tthis._z = getZone(name);\n\t\t\tif (this._z) {\n\t\t\t\tmoment.updateOffset(this, keepTime);\n\t\t\t} else {\n\t\t\t\tlogError(\"Moment Timezone has no data for \" + name + \". See http://momentjs.com/timezone/docs/#/data-loading/.\");\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif (this._z) { return this._z.name; }\n\t};\n\n\tfunction abbrWrap (old) {\n\t\treturn function () {\n\t\t\tif (this._z) { return this._z.abbr(this); }\n\t\t\treturn old.call(this);\n\t\t};\n\t}\n\n\tfunction resetZoneWrap (old) {\n\t\treturn function () {\n\t\t\tthis._z = null;\n\t\t\treturn old.apply(this, arguments);\n\t\t};\n\t}\n\n\tfunction resetZoneWrap2 (old) {\n\t\treturn function () {\n\t\t\tif (arguments.length > 0) this._z = null;\n\t\t\treturn old.apply(this, arguments);\n\t\t};\n\t}\n\n\tfn.zoneName  = abbrWrap(fn.zoneName);\n\tfn.zoneAbbr  = abbrWrap(fn.zoneAbbr);\n\tfn.utc       = resetZoneWrap(fn.utc);\n\tfn.local     = resetZoneWrap(fn.local);\n\tfn.utcOffset = resetZoneWrap2(fn.utcOffset);\n\n\tmoment.tz.setDefault = function(name) {\n\t\tif (major < 2 || (major === 2 && minor < 9)) {\n\t\t\tlogError('Moment Timezone setDefault() requires Moment.js >= 2.9.0. You are using Moment.js ' + moment.version + '.');\n\t\t}\n\t\tmoment.defaultZone = name ? getZone(name) : null;\n\t\treturn moment;\n\t};\n\n\t// Cloning a moment should include the _z property.\n\tvar momentProperties = moment.momentProperties;\n\tif (Object.prototype.toString.call(momentProperties) === '[object Array]') {\n\t\t// moment 2.8.1+\n\t\tmomentProperties.push('_z');\n\t\tmomentProperties.push('_a');\n\t} else if (momentProperties) {\n\t\t// moment 2.7.0\n\t\tmomentProperties._z = null;\n\t}\n\n\t// INJECT DATA\n\n\treturn moment;\n}));\n","//! moment.js locale configuration\n//! locale : Afrikaans [af]\n//! author : Werner Mollentze : https://github.com/wernerm\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var af = moment.defineLocale('af', {\n        months: 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),\n        weekdays: 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split(\n            '_'\n        ),\n        weekdaysShort: 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),\n        weekdaysMin: 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),\n        meridiemParse: /vm|nm/i,\n        isPM: function (input) {\n            return /^nm$/i.test(input);\n        },\n        meridiem: function (hours, minutes, isLower) {\n            if (hours < 12) {\n                return isLower ? 'vm' : 'VM';\n            } else {\n                return isLower ? 'nm' : 'NM';\n            }\n        },\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Vandag om] LT',\n            nextDay: '[Môre om] LT',\n            nextWeek: 'dddd [om] LT',\n            lastDay: '[Gister om] LT',\n            lastWeek: '[Laas] dddd [om] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'oor %s',\n            past: '%s gelede',\n            s: \"'n paar sekondes\",\n            ss: '%d sekondes',\n            m: \"'n minuut\",\n            mm: '%d minute',\n            h: \"'n uur\",\n            hh: '%d ure',\n            d: \"'n dag\",\n            dd: '%d dae',\n            M: \"'n maand\",\n            MM: '%d maande',\n            y: \"'n jaar\",\n            yy: '%d jaar',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(ste|de)/,\n        ordinal: function (number) {\n            return (\n                number +\n                (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')\n            ); // Thanks to Joris Röling : https://github.com/jjupiter\n        },\n        week: {\n            dow: 1, // Maandag is die eerste dag van die week.\n            doy: 4, // Die week wat die 4de Januarie bevat is die eerste week van die jaar.\n        },\n    });\n\n    return af;\n\n})));\n","//! moment.js locale configuration\n//! locale : Arabic (Algeria) [ar-dz]\n//! author : Amine Roukh: https://github.com/Amine27\n//! author : Abdel Said: https://github.com/abdelsaid\n//! author : Ahmed Elkhatib\n//! author : forabi https://github.com/forabi\n//! author : Noureddine LOUAHEDJ : https://github.com/noureddinem\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var pluralForm = function (n) {\n            return n === 0\n                ? 0\n                : n === 1\n                ? 1\n                : n === 2\n                ? 2\n                : n % 100 >= 3 && n % 100 <= 10\n                ? 3\n                : n % 100 >= 11\n                ? 4\n                : 5;\n        },\n        plurals = {\n            s: [\n                'أقل من ثانية',\n                'ثانية واحدة',\n                ['ثانيتان', 'ثانيتين'],\n                '%d ثوان',\n                '%d ثانية',\n                '%d ثانية',\n            ],\n            m: [\n                'أقل من دقيقة',\n                'دقيقة واحدة',\n                ['دقيقتان', 'دقيقتين'],\n                '%d دقائق',\n                '%d دقيقة',\n                '%d دقيقة',\n            ],\n            h: [\n                'أقل من ساعة',\n                'ساعة واحدة',\n                ['ساعتان', 'ساعتين'],\n                '%d ساعات',\n                '%d ساعة',\n                '%d ساعة',\n            ],\n            d: [\n                'أقل من يوم',\n                'يوم واحد',\n                ['يومان', 'يومين'],\n                '%d أيام',\n                '%d يومًا',\n                '%d يوم',\n            ],\n            M: [\n                'أقل من شهر',\n                'شهر واحد',\n                ['شهران', 'شهرين'],\n                '%d أشهر',\n                '%d شهرا',\n                '%d شهر',\n            ],\n            y: [\n                'أقل من عام',\n                'عام واحد',\n                ['عامان', 'عامين'],\n                '%d أعوام',\n                '%d عامًا',\n                '%d عام',\n            ],\n        },\n        pluralize = function (u) {\n            return function (number, withoutSuffix, string, isFuture) {\n                var f = pluralForm(number),\n                    str = plurals[u][pluralForm(number)];\n                if (f === 2) {\n                    str = str[withoutSuffix ? 0 : 1];\n                }\n                return str.replace(/%d/i, number);\n            };\n        },\n        months = [\n            'جانفي',\n            'فيفري',\n            'مارس',\n            'أفريل',\n            'ماي',\n            'جوان',\n            'جويلية',\n            'أوت',\n            'سبتمبر',\n            'أكتوبر',\n            'نوفمبر',\n            'ديسمبر',\n        ];\n\n    var arDz = moment.defineLocale('ar-dz', {\n        months: months,\n        monthsShort: months,\n        weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'D/\\u200FM/\\u200FYYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /ص|م/,\n        isPM: function (input) {\n            return 'م' === input;\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ص';\n            } else {\n                return 'م';\n            }\n        },\n        calendar: {\n            sameDay: '[اليوم عند الساعة] LT',\n            nextDay: '[غدًا عند الساعة] LT',\n            nextWeek: 'dddd [عند الساعة] LT',\n            lastDay: '[أمس عند الساعة] LT',\n            lastWeek: 'dddd [عند الساعة] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'بعد %s',\n            past: 'منذ %s',\n            s: pluralize('s'),\n            ss: pluralize('s'),\n            m: pluralize('m'),\n            mm: pluralize('m'),\n            h: pluralize('h'),\n            hh: pluralize('h'),\n            d: pluralize('d'),\n            dd: pluralize('d'),\n            M: pluralize('M'),\n            MM: pluralize('M'),\n            y: pluralize('y'),\n            yy: pluralize('y'),\n        },\n        postformat: function (string) {\n            return string.replace(/,/g, '،');\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return arDz;\n\n})));\n","//! moment.js locale configuration\n//! locale : Arabic (Kuwait) [ar-kw]\n//! author : Nusret Parlak: https://github.com/nusretparlak\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var arKw = moment.defineLocale('ar-kw', {\n        months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(\n            '_'\n        ),\n        monthsShort:\n            'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(\n                '_'\n            ),\n        weekdays: 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort: 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[اليوم على الساعة] LT',\n            nextDay: '[غدا على الساعة] LT',\n            nextWeek: 'dddd [على الساعة] LT',\n            lastDay: '[أمس على الساعة] LT',\n            lastWeek: 'dddd [على الساعة] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'في %s',\n            past: 'منذ %s',\n            s: 'ثوان',\n            ss: '%d ثانية',\n            m: 'دقيقة',\n            mm: '%d دقائق',\n            h: 'ساعة',\n            hh: '%d ساعات',\n            d: 'يوم',\n            dd: '%d أيام',\n            M: 'شهر',\n            MM: '%d أشهر',\n            y: 'سنة',\n            yy: '%d سنوات',\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 12, // The week that contains Jan 12th is the first week of the year.\n        },\n    });\n\n    return arKw;\n\n})));\n","//! moment.js locale configuration\n//! locale : Arabic (Libya) [ar-ly]\n//! author : Ali Hmer: https://github.com/kikoanis\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '1',\n            2: '2',\n            3: '3',\n            4: '4',\n            5: '5',\n            6: '6',\n            7: '7',\n            8: '8',\n            9: '9',\n            0: '0',\n        },\n        pluralForm = function (n) {\n            return n === 0\n                ? 0\n                : n === 1\n                ? 1\n                : n === 2\n                ? 2\n                : n % 100 >= 3 && n % 100 <= 10\n                ? 3\n                : n % 100 >= 11\n                ? 4\n                : 5;\n        },\n        plurals = {\n            s: [\n                'أقل من ثانية',\n                'ثانية واحدة',\n                ['ثانيتان', 'ثانيتين'],\n                '%d ثوان',\n                '%d ثانية',\n                '%d ثانية',\n            ],\n            m: [\n                'أقل من دقيقة',\n                'دقيقة واحدة',\n                ['دقيقتان', 'دقيقتين'],\n                '%d دقائق',\n                '%d دقيقة',\n                '%d دقيقة',\n            ],\n            h: [\n                'أقل من ساعة',\n                'ساعة واحدة',\n                ['ساعتان', 'ساعتين'],\n                '%d ساعات',\n                '%d ساعة',\n                '%d ساعة',\n            ],\n            d: [\n                'أقل من يوم',\n                'يوم واحد',\n                ['يومان', 'يومين'],\n                '%d أيام',\n                '%d يومًا',\n                '%d يوم',\n            ],\n            M: [\n                'أقل من شهر',\n                'شهر واحد',\n                ['شهران', 'شهرين'],\n                '%d أشهر',\n                '%d شهرا',\n                '%d شهر',\n            ],\n            y: [\n                'أقل من عام',\n                'عام واحد',\n                ['عامان', 'عامين'],\n                '%d أعوام',\n                '%d عامًا',\n                '%d عام',\n            ],\n        },\n        pluralize = function (u) {\n            return function (number, withoutSuffix, string, isFuture) {\n                var f = pluralForm(number),\n                    str = plurals[u][pluralForm(number)];\n                if (f === 2) {\n                    str = str[withoutSuffix ? 0 : 1];\n                }\n                return str.replace(/%d/i, number);\n            };\n        },\n        months = [\n            'يناير',\n            'فبراير',\n            'مارس',\n            'أبريل',\n            'مايو',\n            'يونيو',\n            'يوليو',\n            'أغسطس',\n            'سبتمبر',\n            'أكتوبر',\n            'نوفمبر',\n            'ديسمبر',\n        ];\n\n    var arLy = moment.defineLocale('ar-ly', {\n        months: months,\n        monthsShort: months,\n        weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'D/\\u200FM/\\u200FYYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /ص|م/,\n        isPM: function (input) {\n            return 'م' === input;\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ص';\n            } else {\n                return 'م';\n            }\n        },\n        calendar: {\n            sameDay: '[اليوم عند الساعة] LT',\n            nextDay: '[غدًا عند الساعة] LT',\n            nextWeek: 'dddd [عند الساعة] LT',\n            lastDay: '[أمس عند الساعة] LT',\n            lastWeek: 'dddd [عند الساعة] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'بعد %s',\n            past: 'منذ %s',\n            s: pluralize('s'),\n            ss: pluralize('s'),\n            m: pluralize('m'),\n            mm: pluralize('m'),\n            h: pluralize('h'),\n            hh: pluralize('h'),\n            d: pluralize('d'),\n            dd: pluralize('d'),\n            M: pluralize('M'),\n            MM: pluralize('M'),\n            y: pluralize('y'),\n            yy: pluralize('y'),\n        },\n        preparse: function (string) {\n            return string.replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string\n                .replace(/\\d/g, function (match) {\n                    return symbolMap[match];\n                })\n                .replace(/,/g, '،');\n        },\n        week: {\n            dow: 6, // Saturday is the first day of the week.\n            doy: 12, // The week that contains Jan 12th is the first week of the year.\n        },\n    });\n\n    return arLy;\n\n})));\n","//! moment.js locale configuration\n//! locale : Arabic (Morocco) [ar-ma]\n//! author : ElFadili Yassine : https://github.com/ElFadiliY\n//! author : Abdel Said : https://github.com/abdelsaid\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var arMa = moment.defineLocale('ar-ma', {\n        months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(\n            '_'\n        ),\n        monthsShort:\n            'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(\n                '_'\n            ),\n        weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort: 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[اليوم على الساعة] LT',\n            nextDay: '[غدا على الساعة] LT',\n            nextWeek: 'dddd [على الساعة] LT',\n            lastDay: '[أمس على الساعة] LT',\n            lastWeek: 'dddd [على الساعة] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'في %s',\n            past: 'منذ %s',\n            s: 'ثوان',\n            ss: '%d ثانية',\n            m: 'دقيقة',\n            mm: '%d دقائق',\n            h: 'ساعة',\n            hh: '%d ساعات',\n            d: 'يوم',\n            dd: '%d أيام',\n            M: 'شهر',\n            MM: '%d أشهر',\n            y: 'سنة',\n            yy: '%d سنوات',\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return arMa;\n\n})));\n","//! moment.js locale configuration\n//! locale : Arabic (Saudi Arabia) [ar-sa]\n//! author : Suhail Alkowaileet : https://github.com/xsoh\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '١',\n            2: '٢',\n            3: '٣',\n            4: '٤',\n            5: '٥',\n            6: '٦',\n            7: '٧',\n            8: '٨',\n            9: '٩',\n            0: '٠',\n        },\n        numberMap = {\n            '١': '1',\n            '٢': '2',\n            '٣': '3',\n            '٤': '4',\n            '٥': '5',\n            '٦': '6',\n            '٧': '7',\n            '٨': '8',\n            '٩': '9',\n            '٠': '0',\n        };\n\n    var arSa = moment.defineLocale('ar-sa', {\n        months: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(\n            '_'\n        ),\n        monthsShort:\n            'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(\n                '_'\n            ),\n        weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /ص|م/,\n        isPM: function (input) {\n            return 'م' === input;\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ص';\n            } else {\n                return 'م';\n            }\n        },\n        calendar: {\n            sameDay: '[اليوم على الساعة] LT',\n            nextDay: '[غدا على الساعة] LT',\n            nextWeek: 'dddd [على الساعة] LT',\n            lastDay: '[أمس على الساعة] LT',\n            lastWeek: 'dddd [على الساعة] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'في %s',\n            past: 'منذ %s',\n            s: 'ثوان',\n            ss: '%d ثانية',\n            m: 'دقيقة',\n            mm: '%d دقائق',\n            h: 'ساعة',\n            hh: '%d ساعات',\n            d: 'يوم',\n            dd: '%d أيام',\n            M: 'شهر',\n            MM: '%d أشهر',\n            y: 'سنة',\n            yy: '%d سنوات',\n        },\n        preparse: function (string) {\n            return string\n                .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {\n                    return numberMap[match];\n                })\n                .replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string\n                .replace(/\\d/g, function (match) {\n                    return symbolMap[match];\n                })\n                .replace(/,/g, '،');\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return arSa;\n\n})));\n","//! moment.js locale configuration\n//! locale  :  Arabic (Tunisia) [ar-tn]\n//! author : Nader Toukabri : https://github.com/naderio\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var arTn = moment.defineLocale('ar-tn', {\n        months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(\n            '_'\n        ),\n        monthsShort:\n            'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(\n                '_'\n            ),\n        weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[اليوم على الساعة] LT',\n            nextDay: '[غدا على الساعة] LT',\n            nextWeek: 'dddd [على الساعة] LT',\n            lastDay: '[أمس على الساعة] LT',\n            lastWeek: 'dddd [على الساعة] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'في %s',\n            past: 'منذ %s',\n            s: 'ثوان',\n            ss: '%d ثانية',\n            m: 'دقيقة',\n            mm: '%d دقائق',\n            h: 'ساعة',\n            hh: '%d ساعات',\n            d: 'يوم',\n            dd: '%d أيام',\n            M: 'شهر',\n            MM: '%d أشهر',\n            y: 'سنة',\n            yy: '%d سنوات',\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return arTn;\n\n})));\n","//! moment.js locale configuration\n//! locale : Arabic [ar]\n//! author : Abdel Said: https://github.com/abdelsaid\n//! author : Ahmed Elkhatib\n//! author : forabi https://github.com/forabi\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '١',\n            2: '٢',\n            3: '٣',\n            4: '٤',\n            5: '٥',\n            6: '٦',\n            7: '٧',\n            8: '٨',\n            9: '٩',\n            0: '٠',\n        },\n        numberMap = {\n            '١': '1',\n            '٢': '2',\n            '٣': '3',\n            '٤': '4',\n            '٥': '5',\n            '٦': '6',\n            '٧': '7',\n            '٨': '8',\n            '٩': '9',\n            '٠': '0',\n        },\n        pluralForm = function (n) {\n            return n === 0\n                ? 0\n                : n === 1\n                ? 1\n                : n === 2\n                ? 2\n                : n % 100 >= 3 && n % 100 <= 10\n                ? 3\n                : n % 100 >= 11\n                ? 4\n                : 5;\n        },\n        plurals = {\n            s: [\n                'أقل من ثانية',\n                'ثانية واحدة',\n                ['ثانيتان', 'ثانيتين'],\n                '%d ثوان',\n                '%d ثانية',\n                '%d ثانية',\n            ],\n            m: [\n                'أقل من دقيقة',\n                'دقيقة واحدة',\n                ['دقيقتان', 'دقيقتين'],\n                '%d دقائق',\n                '%d دقيقة',\n                '%d دقيقة',\n            ],\n            h: [\n                'أقل من ساعة',\n                'ساعة واحدة',\n                ['ساعتان', 'ساعتين'],\n                '%d ساعات',\n                '%d ساعة',\n                '%d ساعة',\n            ],\n            d: [\n                'أقل من يوم',\n                'يوم واحد',\n                ['يومان', 'يومين'],\n                '%d أيام',\n                '%d يومًا',\n                '%d يوم',\n            ],\n            M: [\n                'أقل من شهر',\n                'شهر واحد',\n                ['شهران', 'شهرين'],\n                '%d أشهر',\n                '%d شهرا',\n                '%d شهر',\n            ],\n            y: [\n                'أقل من عام',\n                'عام واحد',\n                ['عامان', 'عامين'],\n                '%d أعوام',\n                '%d عامًا',\n                '%d عام',\n            ],\n        },\n        pluralize = function (u) {\n            return function (number, withoutSuffix, string, isFuture) {\n                var f = pluralForm(number),\n                    str = plurals[u][pluralForm(number)];\n                if (f === 2) {\n                    str = str[withoutSuffix ? 0 : 1];\n                }\n                return str.replace(/%d/i, number);\n            };\n        },\n        months = [\n            'يناير',\n            'فبراير',\n            'مارس',\n            'أبريل',\n            'مايو',\n            'يونيو',\n            'يوليو',\n            'أغسطس',\n            'سبتمبر',\n            'أكتوبر',\n            'نوفمبر',\n            'ديسمبر',\n        ];\n\n    var ar = moment.defineLocale('ar', {\n        months: months,\n        monthsShort: months,\n        weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n        weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n        weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'D/\\u200FM/\\u200FYYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /ص|م/,\n        isPM: function (input) {\n            return 'م' === input;\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ص';\n            } else {\n                return 'م';\n            }\n        },\n        calendar: {\n            sameDay: '[اليوم عند الساعة] LT',\n            nextDay: '[غدًا عند الساعة] LT',\n            nextWeek: 'dddd [عند الساعة] LT',\n            lastDay: '[أمس عند الساعة] LT',\n            lastWeek: 'dddd [عند الساعة] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'بعد %s',\n            past: 'منذ %s',\n            s: pluralize('s'),\n            ss: pluralize('s'),\n            m: pluralize('m'),\n            mm: pluralize('m'),\n            h: pluralize('h'),\n            hh: pluralize('h'),\n            d: pluralize('d'),\n            dd: pluralize('d'),\n            M: pluralize('M'),\n            MM: pluralize('M'),\n            y: pluralize('y'),\n            yy: pluralize('y'),\n        },\n        preparse: function (string) {\n            return string\n                .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {\n                    return numberMap[match];\n                })\n                .replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string\n                .replace(/\\d/g, function (match) {\n                    return symbolMap[match];\n                })\n                .replace(/,/g, '،');\n        },\n        week: {\n            dow: 6, // Saturday is the first day of the week.\n            doy: 12, // The week that contains Jan 12th is the first week of the year.\n        },\n    });\n\n    return ar;\n\n})));\n","//! moment.js locale configuration\n//! locale : Azerbaijani [az]\n//! author : topchiyev : https://github.com/topchiyev\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var suffixes = {\n        1: '-inci',\n        5: '-inci',\n        8: '-inci',\n        70: '-inci',\n        80: '-inci',\n        2: '-nci',\n        7: '-nci',\n        20: '-nci',\n        50: '-nci',\n        3: '-üncü',\n        4: '-üncü',\n        100: '-üncü',\n        6: '-ncı',\n        9: '-uncu',\n        10: '-uncu',\n        30: '-uncu',\n        60: '-ıncı',\n        90: '-ıncı',\n    };\n\n    var az = moment.defineLocale('az', {\n        months: 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split(\n            '_'\n        ),\n        monthsShort: 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),\n        weekdays:\n            'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split(\n                '_'\n            ),\n        weekdaysShort: 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),\n        weekdaysMin: 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[bugün saat] LT',\n            nextDay: '[sabah saat] LT',\n            nextWeek: '[gələn həftə] dddd [saat] LT',\n            lastDay: '[dünən] LT',\n            lastWeek: '[keçən həftə] dddd [saat] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s sonra',\n            past: '%s əvvəl',\n            s: 'bir neçə saniyə',\n            ss: '%d saniyə',\n            m: 'bir dəqiqə',\n            mm: '%d dəqiqə',\n            h: 'bir saat',\n            hh: '%d saat',\n            d: 'bir gün',\n            dd: '%d gün',\n            M: 'bir ay',\n            MM: '%d ay',\n            y: 'bir il',\n            yy: '%d il',\n        },\n        meridiemParse: /gecə|səhər|gündüz|axşam/,\n        isPM: function (input) {\n            return /^(gündüz|axşam)$/.test(input);\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'gecə';\n            } else if (hour < 12) {\n                return 'səhər';\n            } else if (hour < 17) {\n                return 'gündüz';\n            } else {\n                return 'axşam';\n            }\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,\n        ordinal: function (number) {\n            if (number === 0) {\n                // special case for zero\n                return number + '-ıncı';\n            }\n            var a = number % 10,\n                b = (number % 100) - a,\n                c = number >= 100 ? 100 : null;\n            return number + (suffixes[a] || suffixes[b] || suffixes[c]);\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return az;\n\n})));\n","//! moment.js locale configuration\n//! locale : Belarusian [be]\n//! author : Dmitry Demidov : https://github.com/demidov91\n//! author: Praleska: http://praleska.pro/\n//! Author : Menelion Elensúle : https://github.com/Oire\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function plural(word, num) {\n        var forms = word.split('_');\n        return num % 10 === 1 && num % 100 !== 11\n            ? forms[0]\n            : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)\n            ? forms[1]\n            : forms[2];\n    }\n    function relativeTimeWithPlural(number, withoutSuffix, key) {\n        var format = {\n            ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',\n            mm: withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',\n            hh: withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',\n            dd: 'дзень_дні_дзён',\n            MM: 'месяц_месяцы_месяцаў',\n            yy: 'год_гады_гадоў',\n        };\n        if (key === 'm') {\n            return withoutSuffix ? 'хвіліна' : 'хвіліну';\n        } else if (key === 'h') {\n            return withoutSuffix ? 'гадзіна' : 'гадзіну';\n        } else {\n            return number + ' ' + plural(format[key], +number);\n        }\n    }\n\n    var be = moment.defineLocale('be', {\n        months: {\n            format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split(\n                '_'\n            ),\n            standalone:\n                'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split(\n                    '_'\n                ),\n        },\n        monthsShort:\n            'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),\n        weekdays: {\n            format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split(\n                '_'\n            ),\n            standalone:\n                'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split(\n                    '_'\n                ),\n            isFormat: /\\[ ?[Ууў] ?(?:мінулую|наступную)? ?\\] ?dddd/,\n        },\n        weekdaysShort: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),\n        weekdaysMin: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY г.',\n            LLL: 'D MMMM YYYY г., HH:mm',\n            LLLL: 'dddd, D MMMM YYYY г., HH:mm',\n        },\n        calendar: {\n            sameDay: '[Сёння ў] LT',\n            nextDay: '[Заўтра ў] LT',\n            lastDay: '[Учора ў] LT',\n            nextWeek: function () {\n                return '[У] dddd [ў] LT';\n            },\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                    case 3:\n                    case 5:\n                    case 6:\n                        return '[У мінулую] dddd [ў] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                        return '[У мінулы] dddd [ў] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'праз %s',\n            past: '%s таму',\n            s: 'некалькі секунд',\n            m: relativeTimeWithPlural,\n            mm: relativeTimeWithPlural,\n            h: relativeTimeWithPlural,\n            hh: relativeTimeWithPlural,\n            d: 'дзень',\n            dd: relativeTimeWithPlural,\n            M: 'месяц',\n            MM: relativeTimeWithPlural,\n            y: 'год',\n            yy: relativeTimeWithPlural,\n        },\n        meridiemParse: /ночы|раніцы|дня|вечара/,\n        isPM: function (input) {\n            return /^(дня|вечара)$/.test(input);\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'ночы';\n            } else if (hour < 12) {\n                return 'раніцы';\n            } else if (hour < 17) {\n                return 'дня';\n            } else {\n                return 'вечара';\n            }\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-(і|ы|га)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'M':\n                case 'd':\n                case 'DDD':\n                case 'w':\n                case 'W':\n                    return (number % 10 === 2 || number % 10 === 3) &&\n                        number % 100 !== 12 &&\n                        number % 100 !== 13\n                        ? number + '-і'\n                        : number + '-ы';\n                case 'D':\n                    return number + '-га';\n                default:\n                    return number;\n            }\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return be;\n\n})));\n","//! moment.js locale configuration\n//! locale : Bulgarian [bg]\n//! author : Krasen Borisov : https://github.com/kraz\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var bg = moment.defineLocale('bg', {\n        months: 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split(\n            '_'\n        ),\n        monthsShort: 'яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),\n        weekdays: 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split(\n            '_'\n        ),\n        weekdaysShort: 'нед_пон_вто_сря_чет_пет_съб'.split('_'),\n        weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'D.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY H:mm',\n            LLLL: 'dddd, D MMMM YYYY H:mm',\n        },\n        calendar: {\n            sameDay: '[Днес в] LT',\n            nextDay: '[Утре в] LT',\n            nextWeek: 'dddd [в] LT',\n            lastDay: '[Вчера в] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                    case 3:\n                    case 6:\n                        return '[Миналата] dddd [в] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[Миналия] dddd [в] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'след %s',\n            past: 'преди %s',\n            s: 'няколко секунди',\n            ss: '%d секунди',\n            m: 'минута',\n            mm: '%d минути',\n            h: 'час',\n            hh: '%d часа',\n            d: 'ден',\n            dd: '%d дена',\n            w: 'седмица',\n            ww: '%d седмици',\n            M: 'месец',\n            MM: '%d месеца',\n            y: 'година',\n            yy: '%d години',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-(ев|ен|ти|ви|ри|ми)/,\n        ordinal: function (number) {\n            var lastDigit = number % 10,\n                last2Digits = number % 100;\n            if (number === 0) {\n                return number + '-ев';\n            } else if (last2Digits === 0) {\n                return number + '-ен';\n            } else if (last2Digits > 10 && last2Digits < 20) {\n                return number + '-ти';\n            } else if (lastDigit === 1) {\n                return number + '-ви';\n            } else if (lastDigit === 2) {\n                return number + '-ри';\n            } else if (lastDigit === 7 || lastDigit === 8) {\n                return number + '-ми';\n            } else {\n                return number + '-ти';\n            }\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return bg;\n\n})));\n","//! moment.js locale configuration\n//! locale : Bambara [bm]\n//! author : Estelle Comment : https://github.com/estellecomment\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var bm = moment.defineLocale('bm', {\n        months: 'Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo'.split(\n            '_'\n        ),\n        monthsShort: 'Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des'.split('_'),\n        weekdays: 'Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri'.split('_'),\n        weekdaysShort: 'Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib'.split('_'),\n        weekdaysMin: 'Ka_Nt_Ta_Ar_Al_Ju_Si'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'MMMM [tile] D [san] YYYY',\n            LLL: 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',\n            LLLL: 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',\n        },\n        calendar: {\n            sameDay: '[Bi lɛrɛ] LT',\n            nextDay: '[Sini lɛrɛ] LT',\n            nextWeek: 'dddd [don lɛrɛ] LT',\n            lastDay: '[Kunu lɛrɛ] LT',\n            lastWeek: 'dddd [tɛmɛnen lɛrɛ] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s kɔnɔ',\n            past: 'a bɛ %s bɔ',\n            s: 'sanga dama dama',\n            ss: 'sekondi %d',\n            m: 'miniti kelen',\n            mm: 'miniti %d',\n            h: 'lɛrɛ kelen',\n            hh: 'lɛrɛ %d',\n            d: 'tile kelen',\n            dd: 'tile %d',\n            M: 'kalo kelen',\n            MM: 'kalo %d',\n            y: 'san kelen',\n            yy: 'san %d',\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return bm;\n\n})));\n","//! moment.js locale configuration\n//! locale : Bengali (Bangladesh) [bn-bd]\n//! author : Asraf Hossain Patoary : https://github.com/ashwoolford\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '১',\n            2: '২',\n            3: '৩',\n            4: '৪',\n            5: '৫',\n            6: '৬',\n            7: '৭',\n            8: '৮',\n            9: '৯',\n            0: '০',\n        },\n        numberMap = {\n            '১': '1',\n            '২': '2',\n            '৩': '3',\n            '৪': '4',\n            '৫': '5',\n            '৬': '6',\n            '৭': '7',\n            '৮': '8',\n            '৯': '9',\n            '০': '0',\n        };\n\n    var bnBd = moment.defineLocale('bn-bd', {\n        months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split(\n            '_'\n        ),\n        monthsShort:\n            'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split(\n                '_'\n            ),\n        weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split(\n            '_'\n        ),\n        weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),\n        weekdaysMin: 'রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm সময়',\n            LTS: 'A h:mm:ss সময়',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, A h:mm সময়',\n            LLLL: 'dddd, D MMMM YYYY, A h:mm সময়',\n        },\n        calendar: {\n            sameDay: '[আজ] LT',\n            nextDay: '[আগামীকাল] LT',\n            nextWeek: 'dddd, LT',\n            lastDay: '[গতকাল] LT',\n            lastWeek: '[গত] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s পরে',\n            past: '%s আগে',\n            s: 'কয়েক সেকেন্ড',\n            ss: '%d সেকেন্ড',\n            m: 'এক মিনিট',\n            mm: '%d মিনিট',\n            h: 'এক ঘন্টা',\n            hh: '%d ঘন্টা',\n            d: 'এক দিন',\n            dd: '%d দিন',\n            M: 'এক মাস',\n            MM: '%d মাস',\n            y: 'এক বছর',\n            yy: '%d বছর',\n        },\n        preparse: function (string) {\n            return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n\n        meridiemParse: /রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'রাত') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'ভোর') {\n                return hour;\n            } else if (meridiem === 'সকাল') {\n                return hour;\n            } else if (meridiem === 'দুপুর') {\n                return hour >= 3 ? hour : hour + 12;\n            } else if (meridiem === 'বিকাল') {\n                return hour + 12;\n            } else if (meridiem === 'সন্ধ্যা') {\n                return hour + 12;\n            }\n        },\n\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'রাত';\n            } else if (hour < 6) {\n                return 'ভোর';\n            } else if (hour < 12) {\n                return 'সকাল';\n            } else if (hour < 15) {\n                return 'দুপুর';\n            } else if (hour < 18) {\n                return 'বিকাল';\n            } else if (hour < 20) {\n                return 'সন্ধ্যা';\n            } else {\n                return 'রাত';\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return bnBd;\n\n})));\n","//! moment.js locale configuration\n//! locale : Bengali [bn]\n//! author : Kaushik Gandhi : https://github.com/kaushikgandhi\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '১',\n            2: '২',\n            3: '৩',\n            4: '৪',\n            5: '৫',\n            6: '৬',\n            7: '৭',\n            8: '৮',\n            9: '৯',\n            0: '০',\n        },\n        numberMap = {\n            '১': '1',\n            '২': '2',\n            '৩': '3',\n            '৪': '4',\n            '৫': '5',\n            '৬': '6',\n            '৭': '7',\n            '৮': '8',\n            '৯': '9',\n            '০': '0',\n        };\n\n    var bn = moment.defineLocale('bn', {\n        months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split(\n            '_'\n        ),\n        monthsShort:\n            'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split(\n                '_'\n            ),\n        weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split(\n            '_'\n        ),\n        weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),\n        weekdaysMin: 'রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm সময়',\n            LTS: 'A h:mm:ss সময়',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, A h:mm সময়',\n            LLLL: 'dddd, D MMMM YYYY, A h:mm সময়',\n        },\n        calendar: {\n            sameDay: '[আজ] LT',\n            nextDay: '[আগামীকাল] LT',\n            nextWeek: 'dddd, LT',\n            lastDay: '[গতকাল] LT',\n            lastWeek: '[গত] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s পরে',\n            past: '%s আগে',\n            s: 'কয়েক সেকেন্ড',\n            ss: '%d সেকেন্ড',\n            m: 'এক মিনিট',\n            mm: '%d মিনিট',\n            h: 'এক ঘন্টা',\n            hh: '%d ঘন্টা',\n            d: 'এক দিন',\n            dd: '%d দিন',\n            M: 'এক মাস',\n            MM: '%d মাস',\n            y: 'এক বছর',\n            yy: '%d বছর',\n        },\n        preparse: function (string) {\n            return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (\n                (meridiem === 'রাত' && hour >= 4) ||\n                (meridiem === 'দুপুর' && hour < 5) ||\n                meridiem === 'বিকাল'\n            ) {\n                return hour + 12;\n            } else {\n                return hour;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'রাত';\n            } else if (hour < 10) {\n                return 'সকাল';\n            } else if (hour < 17) {\n                return 'দুপুর';\n            } else if (hour < 20) {\n                return 'বিকাল';\n            } else {\n                return 'রাত';\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return bn;\n\n})));\n","//! moment.js locale configuration\n//! locale : Tibetan [bo]\n//! author : Thupten N. Chakrishar : https://github.com/vajradog\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '༡',\n            2: '༢',\n            3: '༣',\n            4: '༤',\n            5: '༥',\n            6: '༦',\n            7: '༧',\n            8: '༨',\n            9: '༩',\n            0: '༠',\n        },\n        numberMap = {\n            '༡': '1',\n            '༢': '2',\n            '༣': '3',\n            '༤': '4',\n            '༥': '5',\n            '༦': '6',\n            '༧': '7',\n            '༨': '8',\n            '༩': '9',\n            '༠': '0',\n        };\n\n    var bo = moment.defineLocale('bo', {\n        months: 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split(\n            '_'\n        ),\n        monthsShort:\n            'ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12'.split(\n                '_'\n            ),\n        monthsShortRegex: /^(ཟླ་\\d{1,2})/,\n        monthsParseExact: true,\n        weekdays:\n            'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split(\n                '_'\n            ),\n        weekdaysShort: 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split(\n            '_'\n        ),\n        weekdaysMin: 'ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm',\n            LTS: 'A h:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, A h:mm',\n            LLLL: 'dddd, D MMMM YYYY, A h:mm',\n        },\n        calendar: {\n            sameDay: '[དི་རིང] LT',\n            nextDay: '[སང་ཉིན] LT',\n            nextWeek: '[བདུན་ཕྲག་རྗེས་མ], LT',\n            lastDay: '[ཁ་སང] LT',\n            lastWeek: '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s ལ་',\n            past: '%s སྔན་ལ',\n            s: 'ལམ་སང',\n            ss: '%d སྐར་ཆ།',\n            m: 'སྐར་མ་གཅིག',\n            mm: '%d སྐར་མ',\n            h: 'ཆུ་ཚོད་གཅིག',\n            hh: '%d ཆུ་ཚོད',\n            d: 'ཉིན་གཅིག',\n            dd: '%d ཉིན་',\n            M: 'ཟླ་བ་གཅིག',\n            MM: '%d ཟླ་བ',\n            y: 'ལོ་གཅིག',\n            yy: '%d ལོ',\n        },\n        preparse: function (string) {\n            return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (\n                (meridiem === 'མཚན་མོ' && hour >= 4) ||\n                (meridiem === 'ཉིན་གུང' && hour < 5) ||\n                meridiem === 'དགོང་དག'\n            ) {\n                return hour + 12;\n            } else {\n                return hour;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'མཚན་མོ';\n            } else if (hour < 10) {\n                return 'ཞོགས་ཀས';\n            } else if (hour < 17) {\n                return 'ཉིན་གུང';\n            } else if (hour < 20) {\n                return 'དགོང་དག';\n            } else {\n                return 'མཚན་མོ';\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return bo;\n\n})));\n","//! moment.js locale configuration\n//! locale : Breton [br]\n//! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function relativeTimeWithMutation(number, withoutSuffix, key) {\n        var format = {\n            mm: 'munutenn',\n            MM: 'miz',\n            dd: 'devezh',\n        };\n        return number + ' ' + mutation(format[key], number);\n    }\n    function specialMutationForYears(number) {\n        switch (lastNumber(number)) {\n            case 1:\n            case 3:\n            case 4:\n            case 5:\n            case 9:\n                return number + ' bloaz';\n            default:\n                return number + ' vloaz';\n        }\n    }\n    function lastNumber(number) {\n        if (number > 9) {\n            return lastNumber(number % 10);\n        }\n        return number;\n    }\n    function mutation(text, number) {\n        if (number === 2) {\n            return softMutation(text);\n        }\n        return text;\n    }\n    function softMutation(text) {\n        var mutationTable = {\n            m: 'v',\n            b: 'v',\n            d: 'z',\n        };\n        if (mutationTable[text.charAt(0)] === undefined) {\n            return text;\n        }\n        return mutationTable[text.charAt(0)] + text.substring(1);\n    }\n\n    var monthsParse = [\n            /^gen/i,\n            /^c[ʼ\\']hwe/i,\n            /^meu/i,\n            /^ebr/i,\n            /^mae/i,\n            /^(mez|eve)/i,\n            /^gou/i,\n            /^eos/i,\n            /^gwe/i,\n            /^her/i,\n            /^du/i,\n            /^ker/i,\n        ],\n        monthsRegex =\n            /^(genver|c[ʼ\\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,\n        monthsStrictRegex =\n            /^(genver|c[ʼ\\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,\n        monthsShortStrictRegex =\n            /^(gen|c[ʼ\\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,\n        fullWeekdaysParse = [\n            /^sul/i,\n            /^lun/i,\n            /^meurzh/i,\n            /^merc[ʼ\\']her/i,\n            /^yaou/i,\n            /^gwener/i,\n            /^sadorn/i,\n        ],\n        shortWeekdaysParse = [\n            /^Sul/i,\n            /^Lun/i,\n            /^Meu/i,\n            /^Mer/i,\n            /^Yao/i,\n            /^Gwe/i,\n            /^Sad/i,\n        ],\n        minWeekdaysParse = [\n            /^Su/i,\n            /^Lu/i,\n            /^Me([^r]|$)/i,\n            /^Mer/i,\n            /^Ya/i,\n            /^Gw/i,\n            /^Sa/i,\n        ];\n\n    var br = moment.defineLocale('br', {\n        months: 'Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split(\n            '_'\n        ),\n        monthsShort: 'Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),\n        weekdays: 'Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn'.split('_'),\n        weekdaysShort: 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),\n        weekdaysMin: 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),\n        weekdaysParse: minWeekdaysParse,\n        fullWeekdaysParse: fullWeekdaysParse,\n        shortWeekdaysParse: shortWeekdaysParse,\n        minWeekdaysParse: minWeekdaysParse,\n\n        monthsRegex: monthsRegex,\n        monthsShortRegex: monthsRegex,\n        monthsStrictRegex: monthsStrictRegex,\n        monthsShortStrictRegex: monthsShortStrictRegex,\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D [a viz] MMMM YYYY',\n            LLL: 'D [a viz] MMMM YYYY HH:mm',\n            LLLL: 'dddd, D [a viz] MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Hiziv da] LT',\n            nextDay: '[Warcʼhoazh da] LT',\n            nextWeek: 'dddd [da] LT',\n            lastDay: '[Decʼh da] LT',\n            lastWeek: 'dddd [paset da] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'a-benn %s',\n            past: '%s ʼzo',\n            s: 'un nebeud segondennoù',\n            ss: '%d eilenn',\n            m: 'ur vunutenn',\n            mm: relativeTimeWithMutation,\n            h: 'un eur',\n            hh: '%d eur',\n            d: 'un devezh',\n            dd: relativeTimeWithMutation,\n            M: 'ur miz',\n            MM: relativeTimeWithMutation,\n            y: 'ur bloaz',\n            yy: specialMutationForYears,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(añ|vet)/,\n        ordinal: function (number) {\n            var output = number === 1 ? 'añ' : 'vet';\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n        meridiemParse: /a.m.|g.m./, // goude merenn | a-raok merenn\n        isPM: function (token) {\n            return token === 'g.m.';\n        },\n        meridiem: function (hour, minute, isLower) {\n            return hour < 12 ? 'a.m.' : 'g.m.';\n        },\n    });\n\n    return br;\n\n})));\n","//! moment.js locale configuration\n//! locale : Bosnian [bs]\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function translate(number, withoutSuffix, key) {\n        var result = number + ' ';\n        switch (key) {\n            case 'ss':\n                if (number === 1) {\n                    result += 'sekunda';\n                } else if (number === 2 || number === 3 || number === 4) {\n                    result += 'sekunde';\n                } else {\n                    result += 'sekundi';\n                }\n                return result;\n            case 'm':\n                return withoutSuffix ? 'jedna minuta' : 'jedne minute';\n            case 'mm':\n                if (number === 1) {\n                    result += 'minuta';\n                } else if (number === 2 || number === 3 || number === 4) {\n                    result += 'minute';\n                } else {\n                    result += 'minuta';\n                }\n                return result;\n            case 'h':\n                return withoutSuffix ? 'jedan sat' : 'jednog sata';\n            case 'hh':\n                if (number === 1) {\n                    result += 'sat';\n                } else if (number === 2 || number === 3 || number === 4) {\n                    result += 'sata';\n                } else {\n                    result += 'sati';\n                }\n                return result;\n            case 'dd':\n                if (number === 1) {\n                    result += 'dan';\n                } else {\n                    result += 'dana';\n                }\n                return result;\n            case 'MM':\n                if (number === 1) {\n                    result += 'mjesec';\n                } else if (number === 2 || number === 3 || number === 4) {\n                    result += 'mjeseca';\n                } else {\n                    result += 'mjeseci';\n                }\n                return result;\n            case 'yy':\n                if (number === 1) {\n                    result += 'godina';\n                } else if (number === 2 || number === 3 || number === 4) {\n                    result += 'godine';\n                } else {\n                    result += 'godina';\n                }\n                return result;\n        }\n    }\n\n    var bs = moment.defineLocale('bs', {\n        months: 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split(\n            '_'\n        ),\n        monthsShort:\n            'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(\n            '_'\n        ),\n        weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),\n        weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY H:mm',\n            LLLL: 'dddd, D. MMMM YYYY H:mm',\n        },\n        calendar: {\n            sameDay: '[danas u] LT',\n            nextDay: '[sutra u] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[u] [nedjelju] [u] LT';\n                    case 3:\n                        return '[u] [srijedu] [u] LT';\n                    case 6:\n                        return '[u] [subotu] [u] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[u] dddd [u] LT';\n                }\n            },\n            lastDay: '[jučer u] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                    case 3:\n                        return '[prošlu] dddd [u] LT';\n                    case 6:\n                        return '[prošle] [subote] [u] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[prošli] dddd [u] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'za %s',\n            past: 'prije %s',\n            s: 'par sekundi',\n            ss: translate,\n            m: translate,\n            mm: translate,\n            h: translate,\n            hh: translate,\n            d: 'dan',\n            dd: translate,\n            M: 'mjesec',\n            MM: translate,\n            y: 'godinu',\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return bs;\n\n})));\n","//! moment.js locale configuration\n//! locale : Catalan [ca]\n//! author : Juan G. Hurtado : https://github.com/juanghurtado\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var ca = moment.defineLocale('ca', {\n        months: {\n            standalone:\n                'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split(\n                    '_'\n                ),\n            format: \"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre\".split(\n                '_'\n            ),\n            isFormat: /D[oD]?(\\s)+MMMM/,\n        },\n        monthsShort:\n            'gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays:\n            'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split(\n                '_'\n            ),\n        weekdaysShort: 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),\n        weekdaysMin: 'dg_dl_dt_dc_dj_dv_ds'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM [de] YYYY',\n            ll: 'D MMM YYYY',\n            LLL: 'D MMMM [de] YYYY [a les] H:mm',\n            lll: 'D MMM YYYY, H:mm',\n            LLLL: 'dddd D MMMM [de] YYYY [a les] H:mm',\n            llll: 'ddd D MMM YYYY, H:mm',\n        },\n        calendar: {\n            sameDay: function () {\n                return '[avui a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';\n            },\n            nextDay: function () {\n                return '[demà a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';\n            },\n            nextWeek: function () {\n                return 'dddd [a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';\n            },\n            lastDay: function () {\n                return '[ahir a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';\n            },\n            lastWeek: function () {\n                return (\n                    '[el] dddd [passat a ' +\n                    (this.hours() !== 1 ? 'les' : 'la') +\n                    '] LT'\n                );\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: \"d'aquí %s\",\n            past: 'fa %s',\n            s: 'uns segons',\n            ss: '%d segons',\n            m: 'un minut',\n            mm: '%d minuts',\n            h: 'una hora',\n            hh: '%d hores',\n            d: 'un dia',\n            dd: '%d dies',\n            M: 'un mes',\n            MM: '%d mesos',\n            y: 'un any',\n            yy: '%d anys',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(r|n|t|è|a)/,\n        ordinal: function (number, period) {\n            var output =\n                number === 1\n                    ? 'r'\n                    : number === 2\n                    ? 'n'\n                    : number === 3\n                    ? 'r'\n                    : number === 4\n                    ? 't'\n                    : 'è';\n            if (period === 'w' || period === 'W') {\n                output = 'a';\n            }\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return ca;\n\n})));\n","//! moment.js locale configuration\n//! locale : Czech [cs]\n//! author : petrbela : https://github.com/petrbela\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var months = {\n            format: 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split(\n                '_'\n            ),\n            standalone:\n                'ledna_února_března_dubna_května_června_července_srpna_září_října_listopadu_prosince'.split(\n                    '_'\n                ),\n        },\n        monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_'),\n        monthsParse = [\n            /^led/i,\n            /^úno/i,\n            /^bře/i,\n            /^dub/i,\n            /^kvě/i,\n            /^(čvn|červen$|června)/i,\n            /^(čvc|červenec|července)/i,\n            /^srp/i,\n            /^zář/i,\n            /^říj/i,\n            /^lis/i,\n            /^pro/i,\n        ],\n        // NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched.\n        // Otherwise parser matches '1. červenec' as '1. červen' + 'ec'.\n        monthsRegex =\n            /^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;\n\n    function plural(n) {\n        return n > 1 && n < 5 && ~~(n / 10) !== 1;\n    }\n    function translate(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        switch (key) {\n            case 's': // a few seconds / in a few seconds / a few seconds ago\n                return withoutSuffix || isFuture ? 'pár sekund' : 'pár sekundami';\n            case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'sekundy' : 'sekund');\n                } else {\n                    return result + 'sekundami';\n                }\n            case 'm': // a minute / in a minute / a minute ago\n                return withoutSuffix ? 'minuta' : isFuture ? 'minutu' : 'minutou';\n            case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'minuty' : 'minut');\n                } else {\n                    return result + 'minutami';\n                }\n            case 'h': // an hour / in an hour / an hour ago\n                return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';\n            case 'hh': // 9 hours / in 9 hours / 9 hours ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'hodiny' : 'hodin');\n                } else {\n                    return result + 'hodinami';\n                }\n            case 'd': // a day / in a day / a day ago\n                return withoutSuffix || isFuture ? 'den' : 'dnem';\n            case 'dd': // 9 days / in 9 days / 9 days ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'dny' : 'dní');\n                } else {\n                    return result + 'dny';\n                }\n            case 'M': // a month / in a month / a month ago\n                return withoutSuffix || isFuture ? 'měsíc' : 'měsícem';\n            case 'MM': // 9 months / in 9 months / 9 months ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'měsíce' : 'měsíců');\n                } else {\n                    return result + 'měsíci';\n                }\n            case 'y': // a year / in a year / a year ago\n                return withoutSuffix || isFuture ? 'rok' : 'rokem';\n            case 'yy': // 9 years / in 9 years / 9 years ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'roky' : 'let');\n                } else {\n                    return result + 'lety';\n                }\n        }\n    }\n\n    var cs = moment.defineLocale('cs', {\n        months: months,\n        monthsShort: monthsShort,\n        monthsRegex: monthsRegex,\n        monthsShortRegex: monthsRegex,\n        // NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched.\n        // Otherwise parser matches '1. červenec' as '1. červen' + 'ec'.\n        monthsStrictRegex:\n            /^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,\n        monthsShortStrictRegex:\n            /^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n        weekdays: 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),\n        weekdaysShort: 'ne_po_út_st_čt_pá_so'.split('_'),\n        weekdaysMin: 'ne_po_út_st_čt_pá_so'.split('_'),\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY H:mm',\n            LLLL: 'dddd D. MMMM YYYY H:mm',\n            l: 'D. M. YYYY',\n        },\n        calendar: {\n            sameDay: '[dnes v] LT',\n            nextDay: '[zítra v] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[v neděli v] LT';\n                    case 1:\n                    case 2:\n                        return '[v] dddd [v] LT';\n                    case 3:\n                        return '[ve středu v] LT';\n                    case 4:\n                        return '[ve čtvrtek v] LT';\n                    case 5:\n                        return '[v pátek v] LT';\n                    case 6:\n                        return '[v sobotu v] LT';\n                }\n            },\n            lastDay: '[včera v] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[minulou neděli v] LT';\n                    case 1:\n                    case 2:\n                        return '[minulé] dddd [v] LT';\n                    case 3:\n                        return '[minulou středu v] LT';\n                    case 4:\n                    case 5:\n                        return '[minulý] dddd [v] LT';\n                    case 6:\n                        return '[minulou sobotu v] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'za %s',\n            past: 'před %s',\n            s: translate,\n            ss: translate,\n            m: translate,\n            mm: translate,\n            h: translate,\n            hh: translate,\n            d: translate,\n            dd: translate,\n            M: translate,\n            MM: translate,\n            y: translate,\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return cs;\n\n})));\n","//! moment.js locale configuration\n//! locale : Chuvash [cv]\n//! author : Anatoly Mironov : https://github.com/mirontoli\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var cv = moment.defineLocale('cv', {\n        months: 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split(\n            '_'\n        ),\n        monthsShort: 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'),\n        weekdays:\n            'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split(\n                '_'\n            ),\n        weekdaysShort: 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'),\n        weekdaysMin: 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD-MM-YYYY',\n            LL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]',\n            LLL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',\n            LLLL: 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',\n        },\n        calendar: {\n            sameDay: '[Паян] LT [сехетре]',\n            nextDay: '[Ыран] LT [сехетре]',\n            lastDay: '[Ӗнер] LT [сехетре]',\n            nextWeek: '[Ҫитес] dddd LT [сехетре]',\n            lastWeek: '[Иртнӗ] dddd LT [сехетре]',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: function (output) {\n                var affix = /сехет$/i.exec(output)\n                    ? 'рен'\n                    : /ҫул$/i.exec(output)\n                    ? 'тан'\n                    : 'ран';\n                return output + affix;\n            },\n            past: '%s каялла',\n            s: 'пӗр-ик ҫеккунт',\n            ss: '%d ҫеккунт',\n            m: 'пӗр минут',\n            mm: '%d минут',\n            h: 'пӗр сехет',\n            hh: '%d сехет',\n            d: 'пӗр кун',\n            dd: '%d кун',\n            M: 'пӗр уйӑх',\n            MM: '%d уйӑх',\n            y: 'пӗр ҫул',\n            yy: '%d ҫул',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-мӗш/,\n        ordinal: '%d-мӗш',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return cv;\n\n})));\n","//! moment.js locale configuration\n//! locale : Welsh [cy]\n//! author : Robert Allen : https://github.com/robgallen\n//! author : https://github.com/ryangreaves\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var cy = moment.defineLocale('cy', {\n        months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split(\n            '_'\n        ),\n        monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split(\n            '_'\n        ),\n        weekdays:\n            'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split(\n                '_'\n            ),\n        weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),\n        weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),\n        weekdaysParseExact: true,\n        // time formats are the same as en-gb\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Heddiw am] LT',\n            nextDay: '[Yfory am] LT',\n            nextWeek: 'dddd [am] LT',\n            lastDay: '[Ddoe am] LT',\n            lastWeek: 'dddd [diwethaf am] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'mewn %s',\n            past: '%s yn ôl',\n            s: 'ychydig eiliadau',\n            ss: '%d eiliad',\n            m: 'munud',\n            mm: '%d munud',\n            h: 'awr',\n            hh: '%d awr',\n            d: 'diwrnod',\n            dd: '%d diwrnod',\n            M: 'mis',\n            MM: '%d mis',\n            y: 'blwyddyn',\n            yy: '%d flynedd',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,\n        // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh\n        ordinal: function (number) {\n            var b = number,\n                output = '',\n                lookup = [\n                    '',\n                    'af',\n                    'il',\n                    'ydd',\n                    'ydd',\n                    'ed',\n                    'ed',\n                    'ed',\n                    'fed',\n                    'fed',\n                    'fed', // 1af to 10fed\n                    'eg',\n                    'fed',\n                    'eg',\n                    'eg',\n                    'fed',\n                    'eg',\n                    'eg',\n                    'fed',\n                    'eg',\n                    'fed', // 11eg to 20fed\n                ];\n            if (b > 20) {\n                if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {\n                    output = 'fed'; // not 30ain, 70ain or 90ain\n                } else {\n                    output = 'ain';\n                }\n            } else if (b > 0) {\n                output = lookup[b];\n            }\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return cy;\n\n})));\n","//! moment.js locale configuration\n//! locale : Danish [da]\n//! author : Ulrik Nielsen : https://github.com/mrbase\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var da = moment.defineLocale('da', {\n        months: 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split(\n            '_'\n        ),\n        monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),\n        weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),\n        weekdaysShort: 'søn_man_tir_ons_tor_fre_lør'.split('_'),\n        weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY HH:mm',\n            LLLL: 'dddd [d.] D. MMMM YYYY [kl.] HH:mm',\n        },\n        calendar: {\n            sameDay: '[i dag kl.] LT',\n            nextDay: '[i morgen kl.] LT',\n            nextWeek: 'på dddd [kl.] LT',\n            lastDay: '[i går kl.] LT',\n            lastWeek: '[i] dddd[s kl.] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'om %s',\n            past: '%s siden',\n            s: 'få sekunder',\n            ss: '%d sekunder',\n            m: 'et minut',\n            mm: '%d minutter',\n            h: 'en time',\n            hh: '%d timer',\n            d: 'en dag',\n            dd: '%d dage',\n            M: 'en måned',\n            MM: '%d måneder',\n            y: 'et år',\n            yy: '%d år',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return da;\n\n})));\n","//! moment.js locale configuration\n//! locale : German (Austria) [de-at]\n//! author : lluchs : https://github.com/lluchs\n//! author: Menelion Elensúle: https://github.com/Oire\n//! author : Martin Groller : https://github.com/MadMG\n//! author : Mikolaj Dadela : https://github.com/mik01aj\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            m: ['eine Minute', 'einer Minute'],\n            h: ['eine Stunde', 'einer Stunde'],\n            d: ['ein Tag', 'einem Tag'],\n            dd: [number + ' Tage', number + ' Tagen'],\n            w: ['eine Woche', 'einer Woche'],\n            M: ['ein Monat', 'einem Monat'],\n            MM: [number + ' Monate', number + ' Monaten'],\n            y: ['ein Jahr', 'einem Jahr'],\n            yy: [number + ' Jahre', number + ' Jahren'],\n        };\n        return withoutSuffix ? format[key][0] : format[key][1];\n    }\n\n    var deAt = moment.defineLocale('de-at', {\n        months: 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(\n            '_'\n        ),\n        monthsShort:\n            'Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),\n        monthsParseExact: true,\n        weekdays:\n            'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(\n                '_'\n            ),\n        weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),\n        weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY HH:mm',\n            LLLL: 'dddd, D. MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[heute um] LT [Uhr]',\n            sameElse: 'L',\n            nextDay: '[morgen um] LT [Uhr]',\n            nextWeek: 'dddd [um] LT [Uhr]',\n            lastDay: '[gestern um] LT [Uhr]',\n            lastWeek: '[letzten] dddd [um] LT [Uhr]',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: 'vor %s',\n            s: 'ein paar Sekunden',\n            ss: '%d Sekunden',\n            m: processRelativeTime,\n            mm: '%d Minuten',\n            h: processRelativeTime,\n            hh: '%d Stunden',\n            d: processRelativeTime,\n            dd: processRelativeTime,\n            w: processRelativeTime,\n            ww: '%d Wochen',\n            M: processRelativeTime,\n            MM: processRelativeTime,\n            y: processRelativeTime,\n            yy: processRelativeTime,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return deAt;\n\n})));\n","//! moment.js locale configuration\n//! locale : German (Switzerland) [de-ch]\n//! author : sschueller : https://github.com/sschueller\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            m: ['eine Minute', 'einer Minute'],\n            h: ['eine Stunde', 'einer Stunde'],\n            d: ['ein Tag', 'einem Tag'],\n            dd: [number + ' Tage', number + ' Tagen'],\n            w: ['eine Woche', 'einer Woche'],\n            M: ['ein Monat', 'einem Monat'],\n            MM: [number + ' Monate', number + ' Monaten'],\n            y: ['ein Jahr', 'einem Jahr'],\n            yy: [number + ' Jahre', number + ' Jahren'],\n        };\n        return withoutSuffix ? format[key][0] : format[key][1];\n    }\n\n    var deCh = moment.defineLocale('de-ch', {\n        months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(\n            '_'\n        ),\n        monthsShort:\n            'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),\n        monthsParseExact: true,\n        weekdays:\n            'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(\n                '_'\n            ),\n        weekdaysShort: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n        weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY HH:mm',\n            LLLL: 'dddd, D. MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[heute um] LT [Uhr]',\n            sameElse: 'L',\n            nextDay: '[morgen um] LT [Uhr]',\n            nextWeek: 'dddd [um] LT [Uhr]',\n            lastDay: '[gestern um] LT [Uhr]',\n            lastWeek: '[letzten] dddd [um] LT [Uhr]',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: 'vor %s',\n            s: 'ein paar Sekunden',\n            ss: '%d Sekunden',\n            m: processRelativeTime,\n            mm: '%d Minuten',\n            h: processRelativeTime,\n            hh: '%d Stunden',\n            d: processRelativeTime,\n            dd: processRelativeTime,\n            w: processRelativeTime,\n            ww: '%d Wochen',\n            M: processRelativeTime,\n            MM: processRelativeTime,\n            y: processRelativeTime,\n            yy: processRelativeTime,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return deCh;\n\n})));\n","//! moment.js locale configuration\n//! locale : German [de]\n//! author : lluchs : https://github.com/lluchs\n//! author: Menelion Elensúle: https://github.com/Oire\n//! author : Mikolaj Dadela : https://github.com/mik01aj\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            m: ['eine Minute', 'einer Minute'],\n            h: ['eine Stunde', 'einer Stunde'],\n            d: ['ein Tag', 'einem Tag'],\n            dd: [number + ' Tage', number + ' Tagen'],\n            w: ['eine Woche', 'einer Woche'],\n            M: ['ein Monat', 'einem Monat'],\n            MM: [number + ' Monate', number + ' Monaten'],\n            y: ['ein Jahr', 'einem Jahr'],\n            yy: [number + ' Jahre', number + ' Jahren'],\n        };\n        return withoutSuffix ? format[key][0] : format[key][1];\n    }\n\n    var de = moment.defineLocale('de', {\n        months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(\n            '_'\n        ),\n        monthsShort:\n            'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),\n        monthsParseExact: true,\n        weekdays:\n            'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(\n                '_'\n            ),\n        weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),\n        weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY HH:mm',\n            LLLL: 'dddd, D. MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[heute um] LT [Uhr]',\n            sameElse: 'L',\n            nextDay: '[morgen um] LT [Uhr]',\n            nextWeek: 'dddd [um] LT [Uhr]',\n            lastDay: '[gestern um] LT [Uhr]',\n            lastWeek: '[letzten] dddd [um] LT [Uhr]',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: 'vor %s',\n            s: 'ein paar Sekunden',\n            ss: '%d Sekunden',\n            m: processRelativeTime,\n            mm: '%d Minuten',\n            h: processRelativeTime,\n            hh: '%d Stunden',\n            d: processRelativeTime,\n            dd: processRelativeTime,\n            w: processRelativeTime,\n            ww: '%d Wochen',\n            M: processRelativeTime,\n            MM: processRelativeTime,\n            y: processRelativeTime,\n            yy: processRelativeTime,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return de;\n\n})));\n","//! moment.js locale configuration\n//! locale : Maldivian [dv]\n//! author : Jawish Hameed : https://github.com/jawish\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var months = [\n            'ޖެނުއަރީ',\n            'ފެބްރުއަރީ',\n            'މާރިޗު',\n            'އޭޕްރީލު',\n            'މޭ',\n            'ޖޫން',\n            'ޖުލައި',\n            'އޯގަސްޓު',\n            'ސެޕްޓެމްބަރު',\n            'އޮކްޓޯބަރު',\n            'ނޮވެމްބަރު',\n            'ޑިސެމްބަރު',\n        ],\n        weekdays = [\n            'އާދިއްތަ',\n            'ހޯމަ',\n            'އަންގާރަ',\n            'ބުދަ',\n            'ބުރާސްފަތި',\n            'ހުކުރު',\n            'ހޮނިހިރު',\n        ];\n\n    var dv = moment.defineLocale('dv', {\n        months: months,\n        monthsShort: months,\n        weekdays: weekdays,\n        weekdaysShort: weekdays,\n        weekdaysMin: 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'D/M/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /މކ|މފ/,\n        isPM: function (input) {\n            return 'މފ' === input;\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'މކ';\n            } else {\n                return 'މފ';\n            }\n        },\n        calendar: {\n            sameDay: '[މިއަދު] LT',\n            nextDay: '[މާދަމާ] LT',\n            nextWeek: 'dddd LT',\n            lastDay: '[އިއްޔެ] LT',\n            lastWeek: '[ފާއިތުވި] dddd LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'ތެރޭގައި %s',\n            past: 'ކުރިން %s',\n            s: 'ސިކުންތުކޮޅެއް',\n            ss: 'd% ސިކުންތު',\n            m: 'މިނިޓެއް',\n            mm: 'މިނިޓު %d',\n            h: 'ގަޑިއިރެއް',\n            hh: 'ގަޑިއިރު %d',\n            d: 'ދުވަހެއް',\n            dd: 'ދުވަސް %d',\n            M: 'މަހެއް',\n            MM: 'މަސް %d',\n            y: 'އަހަރެއް',\n            yy: 'އަހަރު %d',\n        },\n        preparse: function (string) {\n            return string.replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string.replace(/,/g, '،');\n        },\n        week: {\n            dow: 7, // Sunday is the first day of the week.\n            doy: 12, // The week that contains Jan 12th is the first week of the year.\n        },\n    });\n\n    return dv;\n\n})));\n","//! moment.js locale configuration\n//! locale : Greek [el]\n//! author : Aggelos Karalias : https://github.com/mehiel\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function isFunction(input) {\n        return (\n            (typeof Function !== 'undefined' && input instanceof Function) ||\n            Object.prototype.toString.call(input) === '[object Function]'\n        );\n    }\n\n    var el = moment.defineLocale('el', {\n        monthsNominativeEl:\n            'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split(\n                '_'\n            ),\n        monthsGenitiveEl:\n            'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split(\n                '_'\n            ),\n        months: function (momentToFormat, format) {\n            if (!momentToFormat) {\n                return this._monthsNominativeEl;\n            } else if (\n                typeof format === 'string' &&\n                /D/.test(format.substring(0, format.indexOf('MMMM')))\n            ) {\n                // if there is a day number before 'MMMM'\n                return this._monthsGenitiveEl[momentToFormat.month()];\n            } else {\n                return this._monthsNominativeEl[momentToFormat.month()];\n            }\n        },\n        monthsShort: 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),\n        weekdays: 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split(\n            '_'\n        ),\n        weekdaysShort: 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),\n        weekdaysMin: 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),\n        meridiem: function (hours, minutes, isLower) {\n            if (hours > 11) {\n                return isLower ? 'μμ' : 'ΜΜ';\n            } else {\n                return isLower ? 'πμ' : 'ΠΜ';\n            }\n        },\n        isPM: function (input) {\n            return (input + '').toLowerCase()[0] === 'μ';\n        },\n        meridiemParse: /[ΠΜ]\\.?Μ?\\.?/i,\n        longDateFormat: {\n            LT: 'h:mm A',\n            LTS: 'h:mm:ss A',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY h:mm A',\n            LLLL: 'dddd, D MMMM YYYY h:mm A',\n        },\n        calendarEl: {\n            sameDay: '[Σήμερα {}] LT',\n            nextDay: '[Αύριο {}] LT',\n            nextWeek: 'dddd [{}] LT',\n            lastDay: '[Χθες {}] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 6:\n                        return '[το προηγούμενο] dddd [{}] LT';\n                    default:\n                        return '[την προηγούμενη] dddd [{}] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        calendar: function (key, mom) {\n            var output = this._calendarEl[key],\n                hours = mom && mom.hours();\n            if (isFunction(output)) {\n                output = output.apply(mom);\n            }\n            return output.replace('{}', hours % 12 === 1 ? 'στη' : 'στις');\n        },\n        relativeTime: {\n            future: 'σε %s',\n            past: '%s πριν',\n            s: 'λίγα δευτερόλεπτα',\n            ss: '%d δευτερόλεπτα',\n            m: 'ένα λεπτό',\n            mm: '%d λεπτά',\n            h: 'μία ώρα',\n            hh: '%d ώρες',\n            d: 'μία μέρα',\n            dd: '%d μέρες',\n            M: 'ένας μήνας',\n            MM: '%d μήνες',\n            y: 'ένας χρόνος',\n            yy: '%d χρόνια',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}η/,\n        ordinal: '%dη',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4st is the first week of the year.\n        },\n    });\n\n    return el;\n\n})));\n","//! moment.js locale configuration\n//! locale : English (Australia) [en-au]\n//! author : Jared Morse : https://github.com/jarcoal\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var enAu = moment.defineLocale('en-au', {\n        months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n            '_'\n        ),\n        weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'h:mm A',\n            LTS: 'h:mm:ss A',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY h:mm A',\n            LLLL: 'dddd, D MMMM YYYY h:mm A',\n        },\n        calendar: {\n            sameDay: '[Today at] LT',\n            nextDay: '[Tomorrow at] LT',\n            nextWeek: 'dddd [at] LT',\n            lastDay: '[Yesterday at] LT',\n            lastWeek: '[Last] dddd [at] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: '%s ago',\n            s: 'a few seconds',\n            ss: '%d seconds',\n            m: 'a minute',\n            mm: '%d minutes',\n            h: 'an hour',\n            hh: '%d hours',\n            d: 'a day',\n            dd: '%d days',\n            M: 'a month',\n            MM: '%d months',\n            y: 'a year',\n            yy: '%d years',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return enAu;\n\n})));\n","//! moment.js locale configuration\n//! locale : English (Canada) [en-ca]\n//! author : Jonathan Abourbih : https://github.com/jonbca\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var enCa = moment.defineLocale('en-ca', {\n        months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n            '_'\n        ),\n        weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'h:mm A',\n            LTS: 'h:mm:ss A',\n            L: 'YYYY-MM-DD',\n            LL: 'MMMM D, YYYY',\n            LLL: 'MMMM D, YYYY h:mm A',\n            LLLL: 'dddd, MMMM D, YYYY h:mm A',\n        },\n        calendar: {\n            sameDay: '[Today at] LT',\n            nextDay: '[Tomorrow at] LT',\n            nextWeek: 'dddd [at] LT',\n            lastDay: '[Yesterday at] LT',\n            lastWeek: '[Last] dddd [at] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: '%s ago',\n            s: 'a few seconds',\n            ss: '%d seconds',\n            m: 'a minute',\n            mm: '%d minutes',\n            h: 'an hour',\n            hh: '%d hours',\n            d: 'a day',\n            dd: '%d days',\n            M: 'a month',\n            MM: '%d months',\n            y: 'a year',\n            yy: '%d years',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n    });\n\n    return enCa;\n\n})));\n","//! moment.js locale configuration\n//! locale : English (United Kingdom) [en-gb]\n//! author : Chris Gedrim : https://github.com/chrisgedrim\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var enGb = moment.defineLocale('en-gb', {\n        months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n            '_'\n        ),\n        weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Today at] LT',\n            nextDay: '[Tomorrow at] LT',\n            nextWeek: 'dddd [at] LT',\n            lastDay: '[Yesterday at] LT',\n            lastWeek: '[Last] dddd [at] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: '%s ago',\n            s: 'a few seconds',\n            ss: '%d seconds',\n            m: 'a minute',\n            mm: '%d minutes',\n            h: 'an hour',\n            hh: '%d hours',\n            d: 'a day',\n            dd: '%d days',\n            M: 'a month',\n            MM: '%d months',\n            y: 'a year',\n            yy: '%d years',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return enGb;\n\n})));\n","//! moment.js locale configuration\n//! locale : English (Ireland) [en-ie]\n//! author : Chris Cartlidge : https://github.com/chriscartlidge\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var enIe = moment.defineLocale('en-ie', {\n        months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n            '_'\n        ),\n        weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Today at] LT',\n            nextDay: '[Tomorrow at] LT',\n            nextWeek: 'dddd [at] LT',\n            lastDay: '[Yesterday at] LT',\n            lastWeek: '[Last] dddd [at] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: '%s ago',\n            s: 'a few seconds',\n            ss: '%d seconds',\n            m: 'a minute',\n            mm: '%d minutes',\n            h: 'an hour',\n            hh: '%d hours',\n            d: 'a day',\n            dd: '%d days',\n            M: 'a month',\n            MM: '%d months',\n            y: 'a year',\n            yy: '%d years',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return enIe;\n\n})));\n","//! moment.js locale configuration\n//! locale : English (Israel) [en-il]\n//! author : Chris Gedrim : https://github.com/chrisgedrim\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var enIl = moment.defineLocale('en-il', {\n        months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n            '_'\n        ),\n        weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Today at] LT',\n            nextDay: '[Tomorrow at] LT',\n            nextWeek: 'dddd [at] LT',\n            lastDay: '[Yesterday at] LT',\n            lastWeek: '[Last] dddd [at] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: '%s ago',\n            s: 'a few seconds',\n            ss: '%d seconds',\n            m: 'a minute',\n            mm: '%d minutes',\n            h: 'an hour',\n            hh: '%d hours',\n            d: 'a day',\n            dd: '%d days',\n            M: 'a month',\n            MM: '%d months',\n            y: 'a year',\n            yy: '%d years',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n    });\n\n    return enIl;\n\n})));\n","//! moment.js locale configuration\n//! locale : English (India) [en-in]\n//! author : Jatin Agrawal : https://github.com/jatinag22\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var enIn = moment.defineLocale('en-in', {\n        months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n            '_'\n        ),\n        weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'h:mm A',\n            LTS: 'h:mm:ss A',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY h:mm A',\n            LLLL: 'dddd, D MMMM YYYY h:mm A',\n        },\n        calendar: {\n            sameDay: '[Today at] LT',\n            nextDay: '[Tomorrow at] LT',\n            nextWeek: 'dddd [at] LT',\n            lastDay: '[Yesterday at] LT',\n            lastWeek: '[Last] dddd [at] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: '%s ago',\n            s: 'a few seconds',\n            ss: '%d seconds',\n            m: 'a minute',\n            mm: '%d minutes',\n            h: 'an hour',\n            hh: '%d hours',\n            d: 'a day',\n            dd: '%d days',\n            M: 'a month',\n            MM: '%d months',\n            y: 'a year',\n            yy: '%d years',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 1st is the first week of the year.\n        },\n    });\n\n    return enIn;\n\n})));\n","//! moment.js locale configuration\n//! locale : English (New Zealand) [en-nz]\n//! author : Luke McGregor : https://github.com/lukemcgregor\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var enNz = moment.defineLocale('en-nz', {\n        months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n            '_'\n        ),\n        weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'h:mm A',\n            LTS: 'h:mm:ss A',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY h:mm A',\n            LLLL: 'dddd, D MMMM YYYY h:mm A',\n        },\n        calendar: {\n            sameDay: '[Today at] LT',\n            nextDay: '[Tomorrow at] LT',\n            nextWeek: 'dddd [at] LT',\n            lastDay: '[Yesterday at] LT',\n            lastWeek: '[Last] dddd [at] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: '%s ago',\n            s: 'a few seconds',\n            ss: '%d seconds',\n            m: 'a minute',\n            mm: '%d minutes',\n            h: 'an hour',\n            hh: '%d hours',\n            d: 'a day',\n            dd: '%d days',\n            M: 'a month',\n            MM: '%d months',\n            y: 'a year',\n            yy: '%d years',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return enNz;\n\n})));\n","//! moment.js locale configuration\n//! locale : English (Singapore) [en-sg]\n//! author : Matthew Castrillon-Madrigal : https://github.com/techdimension\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var enSg = moment.defineLocale('en-sg', {\n        months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n            '_'\n        ),\n        weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Today at] LT',\n            nextDay: '[Tomorrow at] LT',\n            nextWeek: 'dddd [at] LT',\n            lastDay: '[Yesterday at] LT',\n            lastWeek: '[Last] dddd [at] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'in %s',\n            past: '%s ago',\n            s: 'a few seconds',\n            ss: '%d seconds',\n            m: 'a minute',\n            mm: '%d minutes',\n            h: 'an hour',\n            hh: '%d hours',\n            d: 'a day',\n            dd: '%d days',\n            M: 'a month',\n            MM: '%d months',\n            y: 'a year',\n            yy: '%d years',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return enSg;\n\n})));\n","//! moment.js locale configuration\n//! locale : Esperanto [eo]\n//! author : Colin Dean : https://github.com/colindean\n//! author : Mia Nordentoft Imperatori : https://github.com/miestasmia\n//! comment : miestasmia corrected the translation by colindean\n//! comment : Vivakvo corrected the translation by colindean and miestasmia\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var eo = moment.defineLocale('eo', {\n        months: 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split(\n            '_'\n        ),\n        monthsShort: 'jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec'.split('_'),\n        weekdays: 'dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato'.split('_'),\n        weekdaysShort: 'dim_lun_mard_merk_ĵaŭ_ven_sab'.split('_'),\n        weekdaysMin: 'di_lu_ma_me_ĵa_ve_sa'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY-MM-DD',\n            LL: '[la] D[-an de] MMMM, YYYY',\n            LLL: '[la] D[-an de] MMMM, YYYY HH:mm',\n            LLLL: 'dddd[n], [la] D[-an de] MMMM, YYYY HH:mm',\n            llll: 'ddd, [la] D[-an de] MMM, YYYY HH:mm',\n        },\n        meridiemParse: /[ap]\\.t\\.m/i,\n        isPM: function (input) {\n            return input.charAt(0).toLowerCase() === 'p';\n        },\n        meridiem: function (hours, minutes, isLower) {\n            if (hours > 11) {\n                return isLower ? 'p.t.m.' : 'P.T.M.';\n            } else {\n                return isLower ? 'a.t.m.' : 'A.T.M.';\n            }\n        },\n        calendar: {\n            sameDay: '[Hodiaŭ je] LT',\n            nextDay: '[Morgaŭ je] LT',\n            nextWeek: 'dddd[n je] LT',\n            lastDay: '[Hieraŭ je] LT',\n            lastWeek: '[pasintan] dddd[n je] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'post %s',\n            past: 'antaŭ %s',\n            s: 'kelkaj sekundoj',\n            ss: '%d sekundoj',\n            m: 'unu minuto',\n            mm: '%d minutoj',\n            h: 'unu horo',\n            hh: '%d horoj',\n            d: 'unu tago', //ne 'diurno', ĉar estas uzita por proksimumo\n            dd: '%d tagoj',\n            M: 'unu monato',\n            MM: '%d monatoj',\n            y: 'unu jaro',\n            yy: '%d jaroj',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}a/,\n        ordinal: '%da',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return eo;\n\n})));\n","//! moment.js locale configuration\n//! locale : Spanish (Dominican Republic) [es-do]\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var monthsShortDot =\n            'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(\n                '_'\n            ),\n        monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),\n        monthsParse = [\n            /^ene/i,\n            /^feb/i,\n            /^mar/i,\n            /^abr/i,\n            /^may/i,\n            /^jun/i,\n            /^jul/i,\n            /^ago/i,\n            /^sep/i,\n            /^oct/i,\n            /^nov/i,\n            /^dic/i,\n        ],\n        monthsRegex =\n            /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i;\n\n    var esDo = moment.defineLocale('es-do', {\n        months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(\n            '_'\n        ),\n        monthsShort: function (m, format) {\n            if (!m) {\n                return monthsShortDot;\n            } else if (/-MMM-/.test(format)) {\n                return monthsShort[m.month()];\n            } else {\n                return monthsShortDot[m.month()];\n            }\n        },\n        monthsRegex: monthsRegex,\n        monthsShortRegex: monthsRegex,\n        monthsStrictRegex:\n            /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,\n        monthsShortStrictRegex:\n            /^(ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i,\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n        weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n        weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n        weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'h:mm A',\n            LTS: 'h:mm:ss A',\n            L: 'DD/MM/YYYY',\n            LL: 'D [de] MMMM [de] YYYY',\n            LLL: 'D [de] MMMM [de] YYYY h:mm A',\n            LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A',\n        },\n        calendar: {\n            sameDay: function () {\n                return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            nextDay: function () {\n                return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            nextWeek: function () {\n                return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            lastDay: function () {\n                return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            lastWeek: function () {\n                return (\n                    '[el] dddd [pasado a la' +\n                    (this.hours() !== 1 ? 's' : '') +\n                    '] LT'\n                );\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'en %s',\n            past: 'hace %s',\n            s: 'unos segundos',\n            ss: '%d segundos',\n            m: 'un minuto',\n            mm: '%d minutos',\n            h: 'una hora',\n            hh: '%d horas',\n            d: 'un día',\n            dd: '%d días',\n            w: 'una semana',\n            ww: '%d semanas',\n            M: 'un mes',\n            MM: '%d meses',\n            y: 'un año',\n            yy: '%d años',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return esDo;\n\n})));\n","//! moment.js locale configuration\n//! locale : Spanish (Mexico) [es-mx]\n//! author : JC Franco : https://github.com/jcfranco\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var monthsShortDot =\n            'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(\n                '_'\n            ),\n        monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),\n        monthsParse = [\n            /^ene/i,\n            /^feb/i,\n            /^mar/i,\n            /^abr/i,\n            /^may/i,\n            /^jun/i,\n            /^jul/i,\n            /^ago/i,\n            /^sep/i,\n            /^oct/i,\n            /^nov/i,\n            /^dic/i,\n        ],\n        monthsRegex =\n            /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i;\n\n    var esMx = moment.defineLocale('es-mx', {\n        months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(\n            '_'\n        ),\n        monthsShort: function (m, format) {\n            if (!m) {\n                return monthsShortDot;\n            } else if (/-MMM-/.test(format)) {\n                return monthsShort[m.month()];\n            } else {\n                return monthsShortDot[m.month()];\n            }\n        },\n        monthsRegex: monthsRegex,\n        monthsShortRegex: monthsRegex,\n        monthsStrictRegex:\n            /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,\n        monthsShortStrictRegex:\n            /^(ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i,\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n        weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n        weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n        weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D [de] MMMM [de] YYYY',\n            LLL: 'D [de] MMMM [de] YYYY H:mm',\n            LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',\n        },\n        calendar: {\n            sameDay: function () {\n                return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            nextDay: function () {\n                return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            nextWeek: function () {\n                return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            lastDay: function () {\n                return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            lastWeek: function () {\n                return (\n                    '[el] dddd [pasado a la' +\n                    (this.hours() !== 1 ? 's' : '') +\n                    '] LT'\n                );\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'en %s',\n            past: 'hace %s',\n            s: 'unos segundos',\n            ss: '%d segundos',\n            m: 'un minuto',\n            mm: '%d minutos',\n            h: 'una hora',\n            hh: '%d horas',\n            d: 'un día',\n            dd: '%d días',\n            w: 'una semana',\n            ww: '%d semanas',\n            M: 'un mes',\n            MM: '%d meses',\n            y: 'un año',\n            yy: '%d años',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n        invalidDate: 'Fecha inválida',\n    });\n\n    return esMx;\n\n})));\n","//! moment.js locale configuration\n//! locale : Spanish (United States) [es-us]\n//! author : bustta : https://github.com/bustta\n//! author : chrisrodz : https://github.com/chrisrodz\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var monthsShortDot =\n            'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(\n                '_'\n            ),\n        monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),\n        monthsParse = [\n            /^ene/i,\n            /^feb/i,\n            /^mar/i,\n            /^abr/i,\n            /^may/i,\n            /^jun/i,\n            /^jul/i,\n            /^ago/i,\n            /^sep/i,\n            /^oct/i,\n            /^nov/i,\n            /^dic/i,\n        ],\n        monthsRegex =\n            /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i;\n\n    var esUs = moment.defineLocale('es-us', {\n        months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(\n            '_'\n        ),\n        monthsShort: function (m, format) {\n            if (!m) {\n                return monthsShortDot;\n            } else if (/-MMM-/.test(format)) {\n                return monthsShort[m.month()];\n            } else {\n                return monthsShortDot[m.month()];\n            }\n        },\n        monthsRegex: monthsRegex,\n        monthsShortRegex: monthsRegex,\n        monthsStrictRegex:\n            /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,\n        monthsShortStrictRegex:\n            /^(ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i,\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n        weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n        weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n        weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'h:mm A',\n            LTS: 'h:mm:ss A',\n            L: 'MM/DD/YYYY',\n            LL: 'D [de] MMMM [de] YYYY',\n            LLL: 'D [de] MMMM [de] YYYY h:mm A',\n            LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A',\n        },\n        calendar: {\n            sameDay: function () {\n                return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            nextDay: function () {\n                return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            nextWeek: function () {\n                return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            lastDay: function () {\n                return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            lastWeek: function () {\n                return (\n                    '[el] dddd [pasado a la' +\n                    (this.hours() !== 1 ? 's' : '') +\n                    '] LT'\n                );\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'en %s',\n            past: 'hace %s',\n            s: 'unos segundos',\n            ss: '%d segundos',\n            m: 'un minuto',\n            mm: '%d minutos',\n            h: 'una hora',\n            hh: '%d horas',\n            d: 'un día',\n            dd: '%d días',\n            w: 'una semana',\n            ww: '%d semanas',\n            M: 'un mes',\n            MM: '%d meses',\n            y: 'un año',\n            yy: '%d años',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return esUs;\n\n})));\n","//! moment.js locale configuration\n//! locale : Spanish [es]\n//! author : Julio Napurí : https://github.com/julionc\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var monthsShortDot =\n            'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(\n                '_'\n            ),\n        monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),\n        monthsParse = [\n            /^ene/i,\n            /^feb/i,\n            /^mar/i,\n            /^abr/i,\n            /^may/i,\n            /^jun/i,\n            /^jul/i,\n            /^ago/i,\n            /^sep/i,\n            /^oct/i,\n            /^nov/i,\n            /^dic/i,\n        ],\n        monthsRegex =\n            /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i;\n\n    var es = moment.defineLocale('es', {\n        months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(\n            '_'\n        ),\n        monthsShort: function (m, format) {\n            if (!m) {\n                return monthsShortDot;\n            } else if (/-MMM-/.test(format)) {\n                return monthsShort[m.month()];\n            } else {\n                return monthsShortDot[m.month()];\n            }\n        },\n        monthsRegex: monthsRegex,\n        monthsShortRegex: monthsRegex,\n        monthsStrictRegex:\n            /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,\n        monthsShortStrictRegex:\n            /^(ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i,\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n        weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n        weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n        weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D [de] MMMM [de] YYYY',\n            LLL: 'D [de] MMMM [de] YYYY H:mm',\n            LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',\n        },\n        calendar: {\n            sameDay: function () {\n                return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            nextDay: function () {\n                return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            nextWeek: function () {\n                return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            lastDay: function () {\n                return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n            },\n            lastWeek: function () {\n                return (\n                    '[el] dddd [pasado a la' +\n                    (this.hours() !== 1 ? 's' : '') +\n                    '] LT'\n                );\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'en %s',\n            past: 'hace %s',\n            s: 'unos segundos',\n            ss: '%d segundos',\n            m: 'un minuto',\n            mm: '%d minutos',\n            h: 'una hora',\n            hh: '%d horas',\n            d: 'un día',\n            dd: '%d días',\n            w: 'una semana',\n            ww: '%d semanas',\n            M: 'un mes',\n            MM: '%d meses',\n            y: 'un año',\n            yy: '%d años',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n        invalidDate: 'Fecha inválida',\n    });\n\n    return es;\n\n})));\n","//! moment.js locale configuration\n//! locale : Estonian [et]\n//! author : Henry Kehlmann : https://github.com/madhenry\n//! improvements : Illimar Tambek : https://github.com/ragulka\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            s: ['mõne sekundi', 'mõni sekund', 'paar sekundit'],\n            ss: [number + 'sekundi', number + 'sekundit'],\n            m: ['ühe minuti', 'üks minut'],\n            mm: [number + ' minuti', number + ' minutit'],\n            h: ['ühe tunni', 'tund aega', 'üks tund'],\n            hh: [number + ' tunni', number + ' tundi'],\n            d: ['ühe päeva', 'üks päev'],\n            M: ['kuu aja', 'kuu aega', 'üks kuu'],\n            MM: [number + ' kuu', number + ' kuud'],\n            y: ['ühe aasta', 'aasta', 'üks aasta'],\n            yy: [number + ' aasta', number + ' aastat'],\n        };\n        if (withoutSuffix) {\n            return format[key][2] ? format[key][2] : format[key][1];\n        }\n        return isFuture ? format[key][0] : format[key][1];\n    }\n\n    var et = moment.defineLocale('et', {\n        months: 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split(\n            '_'\n        ),\n        monthsShort:\n            'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'),\n        weekdays:\n            'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split(\n                '_'\n            ),\n        weekdaysShort: 'P_E_T_K_N_R_L'.split('_'),\n        weekdaysMin: 'P_E_T_K_N_R_L'.split('_'),\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY H:mm',\n            LLLL: 'dddd, D. MMMM YYYY H:mm',\n        },\n        calendar: {\n            sameDay: '[Täna,] LT',\n            nextDay: '[Homme,] LT',\n            nextWeek: '[Järgmine] dddd LT',\n            lastDay: '[Eile,] LT',\n            lastWeek: '[Eelmine] dddd LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s pärast',\n            past: '%s tagasi',\n            s: processRelativeTime,\n            ss: processRelativeTime,\n            m: processRelativeTime,\n            mm: processRelativeTime,\n            h: processRelativeTime,\n            hh: processRelativeTime,\n            d: processRelativeTime,\n            dd: '%d päeva',\n            M: processRelativeTime,\n            MM: processRelativeTime,\n            y: processRelativeTime,\n            yy: processRelativeTime,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return et;\n\n})));\n","//! moment.js locale configuration\n//! locale : Basque [eu]\n//! author : Eneko Illarramendi : https://github.com/eillarra\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var eu = moment.defineLocale('eu', {\n        months: 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split(\n            '_'\n        ),\n        monthsShort:\n            'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays:\n            'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split(\n                '_'\n            ),\n        weekdaysShort: 'ig._al._ar._az._og._ol._lr.'.split('_'),\n        weekdaysMin: 'ig_al_ar_az_og_ol_lr'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY-MM-DD',\n            LL: 'YYYY[ko] MMMM[ren] D[a]',\n            LLL: 'YYYY[ko] MMMM[ren] D[a] HH:mm',\n            LLLL: 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm',\n            l: 'YYYY-M-D',\n            ll: 'YYYY[ko] MMM D[a]',\n            lll: 'YYYY[ko] MMM D[a] HH:mm',\n            llll: 'ddd, YYYY[ko] MMM D[a] HH:mm',\n        },\n        calendar: {\n            sameDay: '[gaur] LT[etan]',\n            nextDay: '[bihar] LT[etan]',\n            nextWeek: 'dddd LT[etan]',\n            lastDay: '[atzo] LT[etan]',\n            lastWeek: '[aurreko] dddd LT[etan]',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s barru',\n            past: 'duela %s',\n            s: 'segundo batzuk',\n            ss: '%d segundo',\n            m: 'minutu bat',\n            mm: '%d minutu',\n            h: 'ordu bat',\n            hh: '%d ordu',\n            d: 'egun bat',\n            dd: '%d egun',\n            M: 'hilabete bat',\n            MM: '%d hilabete',\n            y: 'urte bat',\n            yy: '%d urte',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return eu;\n\n})));\n","//! moment.js locale configuration\n//! locale : Persian [fa]\n//! author : Ebrahim Byagowi : https://github.com/ebraminio\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '۱',\n            2: '۲',\n            3: '۳',\n            4: '۴',\n            5: '۵',\n            6: '۶',\n            7: '۷',\n            8: '۸',\n            9: '۹',\n            0: '۰',\n        },\n        numberMap = {\n            '۱': '1',\n            '۲': '2',\n            '۳': '3',\n            '۴': '4',\n            '۵': '5',\n            '۶': '6',\n            '۷': '7',\n            '۸': '8',\n            '۹': '9',\n            '۰': '0',\n        };\n\n    var fa = moment.defineLocale('fa', {\n        months: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split(\n            '_'\n        ),\n        monthsShort:\n            'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split(\n                '_'\n            ),\n        weekdays:\n            'یک\\u200cشنبه_دوشنبه_سه\\u200cشنبه_چهارشنبه_پنج\\u200cشنبه_جمعه_شنبه'.split(\n                '_'\n            ),\n        weekdaysShort:\n            'یک\\u200cشنبه_دوشنبه_سه\\u200cشنبه_چهارشنبه_پنج\\u200cشنبه_جمعه_شنبه'.split(\n                '_'\n            ),\n        weekdaysMin: 'ی_د_س_چ_پ_ج_ش'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /قبل از ظهر|بعد از ظهر/,\n        isPM: function (input) {\n            return /بعد از ظهر/.test(input);\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'قبل از ظهر';\n            } else {\n                return 'بعد از ظهر';\n            }\n        },\n        calendar: {\n            sameDay: '[امروز ساعت] LT',\n            nextDay: '[فردا ساعت] LT',\n            nextWeek: 'dddd [ساعت] LT',\n            lastDay: '[دیروز ساعت] LT',\n            lastWeek: 'dddd [پیش] [ساعت] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'در %s',\n            past: '%s پیش',\n            s: 'چند ثانیه',\n            ss: '%d ثانیه',\n            m: 'یک دقیقه',\n            mm: '%d دقیقه',\n            h: 'یک ساعت',\n            hh: '%d ساعت',\n            d: 'یک روز',\n            dd: '%d روز',\n            M: 'یک ماه',\n            MM: '%d ماه',\n            y: 'یک سال',\n            yy: '%d سال',\n        },\n        preparse: function (string) {\n            return string\n                .replace(/[۰-۹]/g, function (match) {\n                    return numberMap[match];\n                })\n                .replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string\n                .replace(/\\d/g, function (match) {\n                    return symbolMap[match];\n                })\n                .replace(/,/g, '،');\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}م/,\n        ordinal: '%dم',\n        week: {\n            dow: 6, // Saturday is the first day of the week.\n            doy: 12, // The week that contains Jan 12th is the first week of the year.\n        },\n    });\n\n    return fa;\n\n})));\n","//! moment.js locale configuration\n//! locale : Finnish [fi]\n//! author : Tarmo Aidantausta : https://github.com/bleadof\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var numbersPast =\n            'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(\n                ' '\n            ),\n        numbersFuture = [\n            'nolla',\n            'yhden',\n            'kahden',\n            'kolmen',\n            'neljän',\n            'viiden',\n            'kuuden',\n            numbersPast[7],\n            numbersPast[8],\n            numbersPast[9],\n        ];\n    function translate(number, withoutSuffix, key, isFuture) {\n        var result = '';\n        switch (key) {\n            case 's':\n                return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';\n            case 'ss':\n                result = isFuture ? 'sekunnin' : 'sekuntia';\n                break;\n            case 'm':\n                return isFuture ? 'minuutin' : 'minuutti';\n            case 'mm':\n                result = isFuture ? 'minuutin' : 'minuuttia';\n                break;\n            case 'h':\n                return isFuture ? 'tunnin' : 'tunti';\n            case 'hh':\n                result = isFuture ? 'tunnin' : 'tuntia';\n                break;\n            case 'd':\n                return isFuture ? 'päivän' : 'päivä';\n            case 'dd':\n                result = isFuture ? 'päivän' : 'päivää';\n                break;\n            case 'M':\n                return isFuture ? 'kuukauden' : 'kuukausi';\n            case 'MM':\n                result = isFuture ? 'kuukauden' : 'kuukautta';\n                break;\n            case 'y':\n                return isFuture ? 'vuoden' : 'vuosi';\n            case 'yy':\n                result = isFuture ? 'vuoden' : 'vuotta';\n                break;\n        }\n        result = verbalNumber(number, isFuture) + ' ' + result;\n        return result;\n    }\n    function verbalNumber(number, isFuture) {\n        return number < 10\n            ? isFuture\n                ? numbersFuture[number]\n                : numbersPast[number]\n            : number;\n    }\n\n    var fi = moment.defineLocale('fi', {\n        months: 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split(\n            '_'\n        ),\n        monthsShort:\n            'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split(\n                '_'\n            ),\n        weekdays:\n            'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split(\n                '_'\n            ),\n        weekdaysShort: 'su_ma_ti_ke_to_pe_la'.split('_'),\n        weekdaysMin: 'su_ma_ti_ke_to_pe_la'.split('_'),\n        longDateFormat: {\n            LT: 'HH.mm',\n            LTS: 'HH.mm.ss',\n            L: 'DD.MM.YYYY',\n            LL: 'Do MMMM[ta] YYYY',\n            LLL: 'Do MMMM[ta] YYYY, [klo] HH.mm',\n            LLLL: 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm',\n            l: 'D.M.YYYY',\n            ll: 'Do MMM YYYY',\n            lll: 'Do MMM YYYY, [klo] HH.mm',\n            llll: 'ddd, Do MMM YYYY, [klo] HH.mm',\n        },\n        calendar: {\n            sameDay: '[tänään] [klo] LT',\n            nextDay: '[huomenna] [klo] LT',\n            nextWeek: 'dddd [klo] LT',\n            lastDay: '[eilen] [klo] LT',\n            lastWeek: '[viime] dddd[na] [klo] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s päästä',\n            past: '%s sitten',\n            s: translate,\n            ss: translate,\n            m: translate,\n            mm: translate,\n            h: translate,\n            hh: translate,\n            d: translate,\n            dd: translate,\n            M: translate,\n            MM: translate,\n            y: translate,\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return fi;\n\n})));\n","//! moment.js locale configuration\n//! locale : Filipino [fil]\n//! author : Dan Hagman : https://github.com/hagmandan\n//! author : Matthew Co : https://github.com/matthewdeeco\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var fil = moment.defineLocale('fil', {\n        months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split(\n            '_'\n        ),\n        monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),\n        weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split(\n            '_'\n        ),\n        weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),\n        weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'MM/D/YYYY',\n            LL: 'MMMM D, YYYY',\n            LLL: 'MMMM D, YYYY HH:mm',\n            LLLL: 'dddd, MMMM DD, YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: 'LT [ngayong araw]',\n            nextDay: '[Bukas ng] LT',\n            nextWeek: 'LT [sa susunod na] dddd',\n            lastDay: 'LT [kahapon]',\n            lastWeek: 'LT [noong nakaraang] dddd',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'sa loob ng %s',\n            past: '%s ang nakalipas',\n            s: 'ilang segundo',\n            ss: '%d segundo',\n            m: 'isang minuto',\n            mm: '%d minuto',\n            h: 'isang oras',\n            hh: '%d oras',\n            d: 'isang araw',\n            dd: '%d araw',\n            M: 'isang buwan',\n            MM: '%d buwan',\n            y: 'isang taon',\n            yy: '%d taon',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}/,\n        ordinal: function (number) {\n            return number;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return fil;\n\n})));\n","//! moment.js locale configuration\n//! locale : Faroese [fo]\n//! author : Ragnar Johannesen : https://github.com/ragnar123\n//! author : Kristian Sakarisson : https://github.com/sakarisson\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var fo = moment.defineLocale('fo', {\n        months: 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split(\n            '_'\n        ),\n        monthsShort: 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),\n        weekdays:\n            'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split(\n                '_'\n            ),\n        weekdaysShort: 'sun_mán_týs_mik_hós_frí_ley'.split('_'),\n        weekdaysMin: 'su_má_tý_mi_hó_fr_le'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D. MMMM, YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Í dag kl.] LT',\n            nextDay: '[Í morgin kl.] LT',\n            nextWeek: 'dddd [kl.] LT',\n            lastDay: '[Í gjár kl.] LT',\n            lastWeek: '[síðstu] dddd [kl] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'um %s',\n            past: '%s síðani',\n            s: 'fá sekund',\n            ss: '%d sekundir',\n            m: 'ein minuttur',\n            mm: '%d minuttir',\n            h: 'ein tími',\n            hh: '%d tímar',\n            d: 'ein dagur',\n            dd: '%d dagar',\n            M: 'ein mánaður',\n            MM: '%d mánaðir',\n            y: 'eitt ár',\n            yy: '%d ár',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return fo;\n\n})));\n","//! moment.js locale configuration\n//! locale : French (Canada) [fr-ca]\n//! author : Jonathan Abourbih : https://github.com/jonbca\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var frCa = moment.defineLocale('fr-ca', {\n        months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(\n            '_'\n        ),\n        monthsShort:\n            'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n        weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n        weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY-MM-DD',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Aujourd’hui à] LT',\n            nextDay: '[Demain à] LT',\n            nextWeek: 'dddd [à] LT',\n            lastDay: '[Hier à] LT',\n            lastWeek: 'dddd [dernier à] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'dans %s',\n            past: 'il y a %s',\n            s: 'quelques secondes',\n            ss: '%d secondes',\n            m: 'une minute',\n            mm: '%d minutes',\n            h: 'une heure',\n            hh: '%d heures',\n            d: 'un jour',\n            dd: '%d jours',\n            M: 'un mois',\n            MM: '%d mois',\n            y: 'un an',\n            yy: '%d ans',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(er|e)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                // Words with masculine grammatical gender: mois, trimestre, jour\n                default:\n                case 'M':\n                case 'Q':\n                case 'D':\n                case 'DDD':\n                case 'd':\n                    return number + (number === 1 ? 'er' : 'e');\n\n                // Words with feminine grammatical gender: semaine\n                case 'w':\n                case 'W':\n                    return number + (number === 1 ? 're' : 'e');\n            }\n        },\n    });\n\n    return frCa;\n\n})));\n","//! moment.js locale configuration\n//! locale : French (Switzerland) [fr-ch]\n//! author : Gaspard Bucher : https://github.com/gaspard\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var frCh = moment.defineLocale('fr-ch', {\n        months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(\n            '_'\n        ),\n        monthsShort:\n            'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n        weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n        weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Aujourd’hui à] LT',\n            nextDay: '[Demain à] LT',\n            nextWeek: 'dddd [à] LT',\n            lastDay: '[Hier à] LT',\n            lastWeek: 'dddd [dernier à] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'dans %s',\n            past: 'il y a %s',\n            s: 'quelques secondes',\n            ss: '%d secondes',\n            m: 'une minute',\n            mm: '%d minutes',\n            h: 'une heure',\n            hh: '%d heures',\n            d: 'un jour',\n            dd: '%d jours',\n            M: 'un mois',\n            MM: '%d mois',\n            y: 'un an',\n            yy: '%d ans',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(er|e)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                // Words with masculine grammatical gender: mois, trimestre, jour\n                default:\n                case 'M':\n                case 'Q':\n                case 'D':\n                case 'DDD':\n                case 'd':\n                    return number + (number === 1 ? 'er' : 'e');\n\n                // Words with feminine grammatical gender: semaine\n                case 'w':\n                case 'W':\n                    return number + (number === 1 ? 're' : 'e');\n            }\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return frCh;\n\n})));\n","//! moment.js locale configuration\n//! locale : French [fr]\n//! author : John Fischer : https://github.com/jfroffice\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var monthsStrictRegex =\n            /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,\n        monthsShortStrictRegex =\n            /(janv\\.?|févr\\.?|mars|avr\\.?|mai|juin|juil\\.?|août|sept\\.?|oct\\.?|nov\\.?|déc\\.?)/i,\n        monthsRegex =\n            /(janv\\.?|févr\\.?|mars|avr\\.?|mai|juin|juil\\.?|août|sept\\.?|oct\\.?|nov\\.?|déc\\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,\n        monthsParse = [\n            /^janv/i,\n            /^févr/i,\n            /^mars/i,\n            /^avr/i,\n            /^mai/i,\n            /^juin/i,\n            /^juil/i,\n            /^août/i,\n            /^sept/i,\n            /^oct/i,\n            /^nov/i,\n            /^déc/i,\n        ];\n\n    var fr = moment.defineLocale('fr', {\n        months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(\n            '_'\n        ),\n        monthsShort:\n            'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(\n                '_'\n            ),\n        monthsRegex: monthsRegex,\n        monthsShortRegex: monthsRegex,\n        monthsStrictRegex: monthsStrictRegex,\n        monthsShortStrictRegex: monthsShortStrictRegex,\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n        weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n        weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n        weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Aujourd’hui à] LT',\n            nextDay: '[Demain à] LT',\n            nextWeek: 'dddd [à] LT',\n            lastDay: '[Hier à] LT',\n            lastWeek: 'dddd [dernier à] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'dans %s',\n            past: 'il y a %s',\n            s: 'quelques secondes',\n            ss: '%d secondes',\n            m: 'une minute',\n            mm: '%d minutes',\n            h: 'une heure',\n            hh: '%d heures',\n            d: 'un jour',\n            dd: '%d jours',\n            w: 'une semaine',\n            ww: '%d semaines',\n            M: 'un mois',\n            MM: '%d mois',\n            y: 'un an',\n            yy: '%d ans',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(er|)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                // TODO: Return 'e' when day of month > 1. Move this case inside\n                // block for masculine words below.\n                // See https://github.com/moment/moment/issues/3375\n                case 'D':\n                    return number + (number === 1 ? 'er' : '');\n\n                // Words with masculine grammatical gender: mois, trimestre, jour\n                default:\n                case 'M':\n                case 'Q':\n                case 'DDD':\n                case 'd':\n                    return number + (number === 1 ? 'er' : 'e');\n\n                // Words with feminine grammatical gender: semaine\n                case 'w':\n                case 'W':\n                    return number + (number === 1 ? 're' : 'e');\n            }\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return fr;\n\n})));\n","//! moment.js locale configuration\n//! locale : Frisian [fy]\n//! author : Robin van der Vliet : https://github.com/robin0van0der0v\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var monthsShortWithDots =\n            'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_'),\n        monthsShortWithoutDots =\n            'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_');\n\n    var fy = moment.defineLocale('fy', {\n        months: 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split(\n            '_'\n        ),\n        monthsShort: function (m, format) {\n            if (!m) {\n                return monthsShortWithDots;\n            } else if (/-MMM-/.test(format)) {\n                return monthsShortWithoutDots[m.month()];\n            } else {\n                return monthsShortWithDots[m.month()];\n            }\n        },\n        monthsParseExact: true,\n        weekdays: 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split(\n            '_'\n        ),\n        weekdaysShort: 'si._mo._ti._wo._to._fr._so.'.split('_'),\n        weekdaysMin: 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD-MM-YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[hjoed om] LT',\n            nextDay: '[moarn om] LT',\n            nextWeek: 'dddd [om] LT',\n            lastDay: '[juster om] LT',\n            lastWeek: '[ôfrûne] dddd [om] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'oer %s',\n            past: '%s lyn',\n            s: 'in pear sekonden',\n            ss: '%d sekonden',\n            m: 'ien minút',\n            mm: '%d minuten',\n            h: 'ien oere',\n            hh: '%d oeren',\n            d: 'ien dei',\n            dd: '%d dagen',\n            M: 'ien moanne',\n            MM: '%d moannen',\n            y: 'ien jier',\n            yy: '%d jierren',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(ste|de)/,\n        ordinal: function (number) {\n            return (\n                number +\n                (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')\n            );\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return fy;\n\n})));\n","//! moment.js locale configuration\n//! locale : Irish or Irish Gaelic [ga]\n//! author : André Silva : https://github.com/askpt\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var months = [\n            'Eanáir',\n            'Feabhra',\n            'Márta',\n            'Aibreán',\n            'Bealtaine',\n            'Meitheamh',\n            'Iúil',\n            'Lúnasa',\n            'Meán Fómhair',\n            'Deireadh Fómhair',\n            'Samhain',\n            'Nollaig',\n        ],\n        monthsShort = [\n            'Ean',\n            'Feabh',\n            'Márt',\n            'Aib',\n            'Beal',\n            'Meith',\n            'Iúil',\n            'Lún',\n            'M.F.',\n            'D.F.',\n            'Samh',\n            'Noll',\n        ],\n        weekdays = [\n            'Dé Domhnaigh',\n            'Dé Luain',\n            'Dé Máirt',\n            'Dé Céadaoin',\n            'Déardaoin',\n            'Dé hAoine',\n            'Dé Sathairn',\n        ],\n        weekdaysShort = ['Domh', 'Luan', 'Máirt', 'Céad', 'Déar', 'Aoine', 'Sath'],\n        weekdaysMin = ['Do', 'Lu', 'Má', 'Cé', 'Dé', 'A', 'Sa'];\n\n    var ga = moment.defineLocale('ga', {\n        months: months,\n        monthsShort: monthsShort,\n        monthsParseExact: true,\n        weekdays: weekdays,\n        weekdaysShort: weekdaysShort,\n        weekdaysMin: weekdaysMin,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Inniu ag] LT',\n            nextDay: '[Amárach ag] LT',\n            nextWeek: 'dddd [ag] LT',\n            lastDay: '[Inné ag] LT',\n            lastWeek: 'dddd [seo caite] [ag] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'i %s',\n            past: '%s ó shin',\n            s: 'cúpla soicind',\n            ss: '%d soicind',\n            m: 'nóiméad',\n            mm: '%d nóiméad',\n            h: 'uair an chloig',\n            hh: '%d uair an chloig',\n            d: 'lá',\n            dd: '%d lá',\n            M: 'mí',\n            MM: '%d míonna',\n            y: 'bliain',\n            yy: '%d bliain',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(d|na|mh)/,\n        ordinal: function (number) {\n            var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return ga;\n\n})));\n","//! moment.js locale configuration\n//! locale : Scottish Gaelic [gd]\n//! author : Jon Ashdown : https://github.com/jonashdown\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var months = [\n            'Am Faoilleach',\n            'An Gearran',\n            'Am Màrt',\n            'An Giblean',\n            'An Cèitean',\n            'An t-Ògmhios',\n            'An t-Iuchar',\n            'An Lùnastal',\n            'An t-Sultain',\n            'An Dàmhair',\n            'An t-Samhain',\n            'An Dùbhlachd',\n        ],\n        monthsShort = [\n            'Faoi',\n            'Gear',\n            'Màrt',\n            'Gibl',\n            'Cèit',\n            'Ògmh',\n            'Iuch',\n            'Lùn',\n            'Sult',\n            'Dàmh',\n            'Samh',\n            'Dùbh',\n        ],\n        weekdays = [\n            'Didòmhnaich',\n            'Diluain',\n            'Dimàirt',\n            'Diciadain',\n            'Diardaoin',\n            'Dihaoine',\n            'Disathairne',\n        ],\n        weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis'],\n        weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa'];\n\n    var gd = moment.defineLocale('gd', {\n        months: months,\n        monthsShort: monthsShort,\n        monthsParseExact: true,\n        weekdays: weekdays,\n        weekdaysShort: weekdaysShort,\n        weekdaysMin: weekdaysMin,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[An-diugh aig] LT',\n            nextDay: '[A-màireach aig] LT',\n            nextWeek: 'dddd [aig] LT',\n            lastDay: '[An-dè aig] LT',\n            lastWeek: 'dddd [seo chaidh] [aig] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'ann an %s',\n            past: 'bho chionn %s',\n            s: 'beagan diogan',\n            ss: '%d diogan',\n            m: 'mionaid',\n            mm: '%d mionaidean',\n            h: 'uair',\n            hh: '%d uairean',\n            d: 'latha',\n            dd: '%d latha',\n            M: 'mìos',\n            MM: '%d mìosan',\n            y: 'bliadhna',\n            yy: '%d bliadhna',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(d|na|mh)/,\n        ordinal: function (number) {\n            var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return gd;\n\n})));\n","//! moment.js locale configuration\n//! locale : Galician [gl]\n//! author : Juan G. Hurtado : https://github.com/juanghurtado\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var gl = moment.defineLocale('gl', {\n        months: 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split(\n            '_'\n        ),\n        monthsShort:\n            'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'),\n        weekdaysShort: 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'),\n        weekdaysMin: 'do_lu_ma_mé_xo_ve_sá'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D [de] MMMM [de] YYYY',\n            LLL: 'D [de] MMMM [de] YYYY H:mm',\n            LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',\n        },\n        calendar: {\n            sameDay: function () {\n                return '[hoxe ' + (this.hours() !== 1 ? 'ás' : 'á') + '] LT';\n            },\n            nextDay: function () {\n                return '[mañá ' + (this.hours() !== 1 ? 'ás' : 'á') + '] LT';\n            },\n            nextWeek: function () {\n                return 'dddd [' + (this.hours() !== 1 ? 'ás' : 'a') + '] LT';\n            },\n            lastDay: function () {\n                return '[onte ' + (this.hours() !== 1 ? 'á' : 'a') + '] LT';\n            },\n            lastWeek: function () {\n                return (\n                    '[o] dddd [pasado ' + (this.hours() !== 1 ? 'ás' : 'a') + '] LT'\n                );\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: function (str) {\n                if (str.indexOf('un') === 0) {\n                    return 'n' + str;\n                }\n                return 'en ' + str;\n            },\n            past: 'hai %s',\n            s: 'uns segundos',\n            ss: '%d segundos',\n            m: 'un minuto',\n            mm: '%d minutos',\n            h: 'unha hora',\n            hh: '%d horas',\n            d: 'un día',\n            dd: '%d días',\n            M: 'un mes',\n            MM: '%d meses',\n            y: 'un ano',\n            yy: '%d anos',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return gl;\n\n})));\n","//! moment.js locale configuration\n//! locale : Konkani Devanagari script [gom-deva]\n//! author : The Discoverer : https://github.com/WikiDiscoverer\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            s: ['थोडया सॅकंडांनी', 'थोडे सॅकंड'],\n            ss: [number + ' सॅकंडांनी', number + ' सॅकंड'],\n            m: ['एका मिणटान', 'एक मिनूट'],\n            mm: [number + ' मिणटांनी', number + ' मिणटां'],\n            h: ['एका वरान', 'एक वर'],\n            hh: [number + ' वरांनी', number + ' वरां'],\n            d: ['एका दिसान', 'एक दीस'],\n            dd: [number + ' दिसांनी', number + ' दीस'],\n            M: ['एका म्हयन्यान', 'एक म्हयनो'],\n            MM: [number + ' म्हयन्यानी', number + ' म्हयने'],\n            y: ['एका वर्सान', 'एक वर्स'],\n            yy: [number + ' वर्सांनी', number + ' वर्सां'],\n        };\n        return isFuture ? format[key][0] : format[key][1];\n    }\n\n    var gomDeva = moment.defineLocale('gom-deva', {\n        months: {\n            standalone:\n                'जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split(\n                    '_'\n                ),\n            format: 'जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या'.split(\n                '_'\n            ),\n            isFormat: /MMMM(\\s)+D[oD]?/,\n        },\n        monthsShort:\n            'जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार'.split('_'),\n        weekdaysShort: 'आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.'.split('_'),\n        weekdaysMin: 'आ_सो_मं_बु_ब्रे_सु_शे'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'A h:mm [वाजतां]',\n            LTS: 'A h:mm:ss [वाजतां]',\n            L: 'DD-MM-YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY A h:mm [वाजतां]',\n            LLLL: 'dddd, MMMM Do, YYYY, A h:mm [वाजतां]',\n            llll: 'ddd, D MMM YYYY, A h:mm [वाजतां]',\n        },\n        calendar: {\n            sameDay: '[आयज] LT',\n            nextDay: '[फाल्यां] LT',\n            nextWeek: '[फुडलो] dddd[,] LT',\n            lastDay: '[काल] LT',\n            lastWeek: '[फाटलो] dddd[,] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s',\n            past: '%s आदीं',\n            s: processRelativeTime,\n            ss: processRelativeTime,\n            m: processRelativeTime,\n            mm: processRelativeTime,\n            h: processRelativeTime,\n            hh: processRelativeTime,\n            d: processRelativeTime,\n            dd: processRelativeTime,\n            M: processRelativeTime,\n            MM: processRelativeTime,\n            y: processRelativeTime,\n            yy: processRelativeTime,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(वेर)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                // the ordinal 'वेर' only applies to day of the month\n                case 'D':\n                    return number + 'वेर';\n                default:\n                case 'M':\n                case 'Q':\n                case 'DDD':\n                case 'd':\n                case 'w':\n                case 'W':\n                    return number;\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week\n            doy: 3, // The week that contains Jan 4th is the first week of the year (7 + 0 - 4)\n        },\n        meridiemParse: /राती|सकाळीं|दनपारां|सांजे/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'राती') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'सकाळीं') {\n                return hour;\n            } else if (meridiem === 'दनपारां') {\n                return hour > 12 ? hour : hour + 12;\n            } else if (meridiem === 'सांजे') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'राती';\n            } else if (hour < 12) {\n                return 'सकाळीं';\n            } else if (hour < 16) {\n                return 'दनपारां';\n            } else if (hour < 20) {\n                return 'सांजे';\n            } else {\n                return 'राती';\n            }\n        },\n    });\n\n    return gomDeva;\n\n})));\n","//! moment.js locale configuration\n//! locale : Konkani Latin script [gom-latn]\n//! author : The Discoverer : https://github.com/WikiDiscoverer\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            s: ['thoddea sekondamni', 'thodde sekond'],\n            ss: [number + ' sekondamni', number + ' sekond'],\n            m: ['eka mintan', 'ek minut'],\n            mm: [number + ' mintamni', number + ' mintam'],\n            h: ['eka voran', 'ek vor'],\n            hh: [number + ' voramni', number + ' voram'],\n            d: ['eka disan', 'ek dis'],\n            dd: [number + ' disamni', number + ' dis'],\n            M: ['eka mhoinean', 'ek mhoino'],\n            MM: [number + ' mhoineamni', number + ' mhoine'],\n            y: ['eka vorsan', 'ek voros'],\n            yy: [number + ' vorsamni', number + ' vorsam'],\n        };\n        return isFuture ? format[key][0] : format[key][1];\n    }\n\n    var gomLatn = moment.defineLocale('gom-latn', {\n        months: {\n            standalone:\n                'Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr'.split(\n                    '_'\n                ),\n            format: 'Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea'.split(\n                '_'\n            ),\n            isFormat: /MMMM(\\s)+D[oD]?/,\n        },\n        monthsShort:\n            'Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.'.split('_'),\n        monthsParseExact: true,\n        weekdays: \"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var\".split('_'),\n        weekdaysShort: 'Ait._Som._Mon._Bud._Bre._Suk._Son.'.split('_'),\n        weekdaysMin: 'Ai_Sm_Mo_Bu_Br_Su_Sn'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'A h:mm [vazta]',\n            LTS: 'A h:mm:ss [vazta]',\n            L: 'DD-MM-YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY A h:mm [vazta]',\n            LLLL: 'dddd, MMMM Do, YYYY, A h:mm [vazta]',\n            llll: 'ddd, D MMM YYYY, A h:mm [vazta]',\n        },\n        calendar: {\n            sameDay: '[Aiz] LT',\n            nextDay: '[Faleam] LT',\n            nextWeek: '[Fuddlo] dddd[,] LT',\n            lastDay: '[Kal] LT',\n            lastWeek: '[Fattlo] dddd[,] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s',\n            past: '%s adim',\n            s: processRelativeTime,\n            ss: processRelativeTime,\n            m: processRelativeTime,\n            mm: processRelativeTime,\n            h: processRelativeTime,\n            hh: processRelativeTime,\n            d: processRelativeTime,\n            dd: processRelativeTime,\n            M: processRelativeTime,\n            MM: processRelativeTime,\n            y: processRelativeTime,\n            yy: processRelativeTime,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(er)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                // the ordinal 'er' only applies to day of the month\n                case 'D':\n                    return number + 'er';\n                default:\n                case 'M':\n                case 'Q':\n                case 'DDD':\n                case 'd':\n                case 'w':\n                case 'W':\n                    return number;\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week\n            doy: 3, // The week that contains Jan 4th is the first week of the year (7 + 0 - 4)\n        },\n        meridiemParse: /rati|sokallim|donparam|sanje/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'rati') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'sokallim') {\n                return hour;\n            } else if (meridiem === 'donparam') {\n                return hour > 12 ? hour : hour + 12;\n            } else if (meridiem === 'sanje') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'rati';\n            } else if (hour < 12) {\n                return 'sokallim';\n            } else if (hour < 16) {\n                return 'donparam';\n            } else if (hour < 20) {\n                return 'sanje';\n            } else {\n                return 'rati';\n            }\n        },\n    });\n\n    return gomLatn;\n\n})));\n","//! moment.js locale configuration\n//! locale : Gujarati [gu]\n//! author : Kaushik Thanki : https://github.com/Kaushik1987\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '૧',\n            2: '૨',\n            3: '૩',\n            4: '૪',\n            5: '૫',\n            6: '૬',\n            7: '૭',\n            8: '૮',\n            9: '૯',\n            0: '૦',\n        },\n        numberMap = {\n            '૧': '1',\n            '૨': '2',\n            '૩': '3',\n            '૪': '4',\n            '૫': '5',\n            '૬': '6',\n            '૭': '7',\n            '૮': '8',\n            '૯': '9',\n            '૦': '0',\n        };\n\n    var gu = moment.defineLocale('gu', {\n        months: 'જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર'.split(\n            '_'\n        ),\n        monthsShort:\n            'જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર'.split(\n            '_'\n        ),\n        weekdaysShort: 'રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ'.split('_'),\n        weekdaysMin: 'ર_સો_મં_બુ_ગુ_શુ_શ'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm વાગ્યે',\n            LTS: 'A h:mm:ss વાગ્યે',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, A h:mm વાગ્યે',\n            LLLL: 'dddd, D MMMM YYYY, A h:mm વાગ્યે',\n        },\n        calendar: {\n            sameDay: '[આજ] LT',\n            nextDay: '[કાલે] LT',\n            nextWeek: 'dddd, LT',\n            lastDay: '[ગઇકાલે] LT',\n            lastWeek: '[પાછલા] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s મા',\n            past: '%s પહેલા',\n            s: 'અમુક પળો',\n            ss: '%d સેકંડ',\n            m: 'એક મિનિટ',\n            mm: '%d મિનિટ',\n            h: 'એક કલાક',\n            hh: '%d કલાક',\n            d: 'એક દિવસ',\n            dd: '%d દિવસ',\n            M: 'એક મહિનો',\n            MM: '%d મહિનો',\n            y: 'એક વર્ષ',\n            yy: '%d વર્ષ',\n        },\n        preparse: function (string) {\n            return string.replace(/[૧૨૩૪૫૬૭૮૯૦]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        // Gujarati notation for meridiems are quite fuzzy in practice. While there exists\n        // a rigid notion of a 'Pahar' it is not used as rigidly in modern Gujarati.\n        meridiemParse: /રાત|બપોર|સવાર|સાંજ/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'રાત') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'સવાર') {\n                return hour;\n            } else if (meridiem === 'બપોર') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'સાંજ') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'રાત';\n            } else if (hour < 10) {\n                return 'સવાર';\n            } else if (hour < 17) {\n                return 'બપોર';\n            } else if (hour < 20) {\n                return 'સાંજ';\n            } else {\n                return 'રાત';\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return gu;\n\n})));\n","//! moment.js locale configuration\n//! locale : Hebrew [he]\n//! author : Tomer Cohen : https://github.com/tomer\n//! author : Moshe Simantov : https://github.com/DevelopmentIL\n//! author : Tal Ater : https://github.com/TalAter\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var he = moment.defineLocale('he', {\n        months: 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split(\n            '_'\n        ),\n        monthsShort:\n            'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'),\n        weekdays: 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),\n        weekdaysShort: 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),\n        weekdaysMin: 'א_ב_ג_ד_ה_ו_ש'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D [ב]MMMM YYYY',\n            LLL: 'D [ב]MMMM YYYY HH:mm',\n            LLLL: 'dddd, D [ב]MMMM YYYY HH:mm',\n            l: 'D/M/YYYY',\n            ll: 'D MMM YYYY',\n            lll: 'D MMM YYYY HH:mm',\n            llll: 'ddd, D MMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[היום ב־]LT',\n            nextDay: '[מחר ב־]LT',\n            nextWeek: 'dddd [בשעה] LT',\n            lastDay: '[אתמול ב־]LT',\n            lastWeek: '[ביום] dddd [האחרון בשעה] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'בעוד %s',\n            past: 'לפני %s',\n            s: 'מספר שניות',\n            ss: '%d שניות',\n            m: 'דקה',\n            mm: '%d דקות',\n            h: 'שעה',\n            hh: function (number) {\n                if (number === 2) {\n                    return 'שעתיים';\n                }\n                return number + ' שעות';\n            },\n            d: 'יום',\n            dd: function (number) {\n                if (number === 2) {\n                    return 'יומיים';\n                }\n                return number + ' ימים';\n            },\n            M: 'חודש',\n            MM: function (number) {\n                if (number === 2) {\n                    return 'חודשיים';\n                }\n                return number + ' חודשים';\n            },\n            y: 'שנה',\n            yy: function (number) {\n                if (number === 2) {\n                    return 'שנתיים';\n                } else if (number % 10 === 0 && number !== 10) {\n                    return number + ' שנה';\n                }\n                return number + ' שנים';\n            },\n        },\n        meridiemParse:\n            /אחה\"צ|לפנה\"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,\n        isPM: function (input) {\n            return /^(אחה\"צ|אחרי הצהריים|בערב)$/.test(input);\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 5) {\n                return 'לפנות בוקר';\n            } else if (hour < 10) {\n                return 'בבוקר';\n            } else if (hour < 12) {\n                return isLower ? 'לפנה\"צ' : 'לפני הצהריים';\n            } else if (hour < 18) {\n                return isLower ? 'אחה\"צ' : 'אחרי הצהריים';\n            } else {\n                return 'בערב';\n            }\n        },\n    });\n\n    return he;\n\n})));\n","//! moment.js locale configuration\n//! locale : Hindi [hi]\n//! author : Mayank Singhal : https://github.com/mayanksinghal\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '१',\n            2: '२',\n            3: '३',\n            4: '४',\n            5: '५',\n            6: '६',\n            7: '७',\n            8: '८',\n            9: '९',\n            0: '०',\n        },\n        numberMap = {\n            '१': '1',\n            '२': '2',\n            '३': '3',\n            '४': '4',\n            '५': '5',\n            '६': '6',\n            '७': '7',\n            '८': '8',\n            '९': '9',\n            '०': '0',\n        },\n        monthsParse = [\n            /^जन/i,\n            /^फ़र|फर/i,\n            /^मार्च/i,\n            /^अप्रै/i,\n            /^मई/i,\n            /^जून/i,\n            /^जुल/i,\n            /^अग/i,\n            /^सितं|सित/i,\n            /^अक्टू/i,\n            /^नव|नवं/i,\n            /^दिसं|दिस/i,\n        ],\n        shortMonthsParse = [\n            /^जन/i,\n            /^फ़र/i,\n            /^मार्च/i,\n            /^अप्रै/i,\n            /^मई/i,\n            /^जून/i,\n            /^जुल/i,\n            /^अग/i,\n            /^सित/i,\n            /^अक्टू/i,\n            /^नव/i,\n            /^दिस/i,\n        ];\n\n    var hi = moment.defineLocale('hi', {\n        months: {\n            format: 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split(\n                '_'\n            ),\n            standalone:\n                'जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर'.split(\n                    '_'\n                ),\n        },\n        monthsShort:\n            'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),\n        weekdays: 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),\n        weekdaysShort: 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),\n        weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm बजे',\n            LTS: 'A h:mm:ss बजे',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, A h:mm बजे',\n            LLLL: 'dddd, D MMMM YYYY, A h:mm बजे',\n        },\n\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: shortMonthsParse,\n\n        monthsRegex:\n            /^(जनवरी|जन\\.?|फ़रवरी|फरवरी|फ़र\\.?|मार्च?|अप्रैल|अप्रै\\.?|मई?|जून?|जुलाई|जुल\\.?|अगस्त|अग\\.?|सितम्बर|सितंबर|सित\\.?|अक्टूबर|अक्टू\\.?|नवम्बर|नवंबर|नव\\.?|दिसम्बर|दिसंबर|दिस\\.?)/i,\n\n        monthsShortRegex:\n            /^(जनवरी|जन\\.?|फ़रवरी|फरवरी|फ़र\\.?|मार्च?|अप्रैल|अप्रै\\.?|मई?|जून?|जुलाई|जुल\\.?|अगस्त|अग\\.?|सितम्बर|सितंबर|सित\\.?|अक्टूबर|अक्टू\\.?|नवम्बर|नवंबर|नव\\.?|दिसम्बर|दिसंबर|दिस\\.?)/i,\n\n        monthsStrictRegex:\n            /^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\\.?|अक्टूबर|अक्टू\\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,\n\n        monthsShortStrictRegex:\n            /^(जन\\.?|फ़र\\.?|मार्च?|अप्रै\\.?|मई?|जून?|जुल\\.?|अग\\.?|सित\\.?|अक्टू\\.?|नव\\.?|दिस\\.?)/i,\n\n        calendar: {\n            sameDay: '[आज] LT',\n            nextDay: '[कल] LT',\n            nextWeek: 'dddd, LT',\n            lastDay: '[कल] LT',\n            lastWeek: '[पिछले] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s में',\n            past: '%s पहले',\n            s: 'कुछ ही क्षण',\n            ss: '%d सेकंड',\n            m: 'एक मिनट',\n            mm: '%d मिनट',\n            h: 'एक घंटा',\n            hh: '%d घंटे',\n            d: 'एक दिन',\n            dd: '%d दिन',\n            M: 'एक महीने',\n            MM: '%d महीने',\n            y: 'एक वर्ष',\n            yy: '%d वर्ष',\n        },\n        preparse: function (string) {\n            return string.replace(/[१२३४५६७८९०]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        // Hindi notation for meridiems are quite fuzzy in practice. While there exists\n        // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.\n        meridiemParse: /रात|सुबह|दोपहर|शाम/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'रात') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'सुबह') {\n                return hour;\n            } else if (meridiem === 'दोपहर') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'शाम') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'रात';\n            } else if (hour < 10) {\n                return 'सुबह';\n            } else if (hour < 17) {\n                return 'दोपहर';\n            } else if (hour < 20) {\n                return 'शाम';\n            } else {\n                return 'रात';\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return hi;\n\n})));\n","//! moment.js locale configuration\n//! locale : Croatian [hr]\n//! author : Bojan Marković : https://github.com/bmarkovic\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function translate(number, withoutSuffix, key) {\n        var result = number + ' ';\n        switch (key) {\n            case 'ss':\n                if (number === 1) {\n                    result += 'sekunda';\n                } else if (number === 2 || number === 3 || number === 4) {\n                    result += 'sekunde';\n                } else {\n                    result += 'sekundi';\n                }\n                return result;\n            case 'm':\n                return withoutSuffix ? 'jedna minuta' : 'jedne minute';\n            case 'mm':\n                if (number === 1) {\n                    result += 'minuta';\n                } else if (number === 2 || number === 3 || number === 4) {\n                    result += 'minute';\n                } else {\n                    result += 'minuta';\n                }\n                return result;\n            case 'h':\n                return withoutSuffix ? 'jedan sat' : 'jednog sata';\n            case 'hh':\n                if (number === 1) {\n                    result += 'sat';\n                } else if (number === 2 || number === 3 || number === 4) {\n                    result += 'sata';\n                } else {\n                    result += 'sati';\n                }\n                return result;\n            case 'dd':\n                if (number === 1) {\n                    result += 'dan';\n                } else {\n                    result += 'dana';\n                }\n                return result;\n            case 'MM':\n                if (number === 1) {\n                    result += 'mjesec';\n                } else if (number === 2 || number === 3 || number === 4) {\n                    result += 'mjeseca';\n                } else {\n                    result += 'mjeseci';\n                }\n                return result;\n            case 'yy':\n                if (number === 1) {\n                    result += 'godina';\n                } else if (number === 2 || number === 3 || number === 4) {\n                    result += 'godine';\n                } else {\n                    result += 'godina';\n                }\n                return result;\n        }\n    }\n\n    var hr = moment.defineLocale('hr', {\n        months: {\n            format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split(\n                '_'\n            ),\n            standalone:\n                'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split(\n                    '_'\n                ),\n        },\n        monthsShort:\n            'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(\n            '_'\n        ),\n        weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),\n        weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'Do MMMM YYYY',\n            LLL: 'Do MMMM YYYY H:mm',\n            LLLL: 'dddd, Do MMMM YYYY H:mm',\n        },\n        calendar: {\n            sameDay: '[danas u] LT',\n            nextDay: '[sutra u] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[u] [nedjelju] [u] LT';\n                    case 3:\n                        return '[u] [srijedu] [u] LT';\n                    case 6:\n                        return '[u] [subotu] [u] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[u] dddd [u] LT';\n                }\n            },\n            lastDay: '[jučer u] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[prošlu] [nedjelju] [u] LT';\n                    case 3:\n                        return '[prošlu] [srijedu] [u] LT';\n                    case 6:\n                        return '[prošle] [subote] [u] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[prošli] dddd [u] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'za %s',\n            past: 'prije %s',\n            s: 'par sekundi',\n            ss: translate,\n            m: translate,\n            mm: translate,\n            h: translate,\n            hh: translate,\n            d: 'dan',\n            dd: translate,\n            M: 'mjesec',\n            MM: translate,\n            y: 'godinu',\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return hr;\n\n})));\n","//! moment.js locale configuration\n//! locale : Hungarian [hu]\n//! author : Adam Brunner : https://github.com/adambrunner\n//! author : Peter Viszt  : https://github.com/passatgt\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var weekEndings =\n        'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' ');\n    function translate(number, withoutSuffix, key, isFuture) {\n        var num = number;\n        switch (key) {\n            case 's':\n                return isFuture || withoutSuffix\n                    ? 'néhány másodperc'\n                    : 'néhány másodperce';\n            case 'ss':\n                return num + (isFuture || withoutSuffix)\n                    ? ' másodperc'\n                    : ' másodperce';\n            case 'm':\n                return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');\n            case 'mm':\n                return num + (isFuture || withoutSuffix ? ' perc' : ' perce');\n            case 'h':\n                return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');\n            case 'hh':\n                return num + (isFuture || withoutSuffix ? ' óra' : ' órája');\n            case 'd':\n                return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');\n            case 'dd':\n                return num + (isFuture || withoutSuffix ? ' nap' : ' napja');\n            case 'M':\n                return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');\n            case 'MM':\n                return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');\n            case 'y':\n                return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');\n            case 'yy':\n                return num + (isFuture || withoutSuffix ? ' év' : ' éve');\n        }\n        return '';\n    }\n    function week(isFuture) {\n        return (\n            (isFuture ? '' : '[múlt] ') +\n            '[' +\n            weekEndings[this.day()] +\n            '] LT[-kor]'\n        );\n    }\n\n    var hu = moment.defineLocale('hu', {\n        months: 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split(\n            '_'\n        ),\n        monthsShort:\n            'jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),\n        weekdaysShort: 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),\n        weekdaysMin: 'v_h_k_sze_cs_p_szo'.split('_'),\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'YYYY.MM.DD.',\n            LL: 'YYYY. MMMM D.',\n            LLL: 'YYYY. MMMM D. H:mm',\n            LLLL: 'YYYY. MMMM D., dddd H:mm',\n        },\n        meridiemParse: /de|du/i,\n        isPM: function (input) {\n            return input.charAt(1).toLowerCase() === 'u';\n        },\n        meridiem: function (hours, minutes, isLower) {\n            if (hours < 12) {\n                return isLower === true ? 'de' : 'DE';\n            } else {\n                return isLower === true ? 'du' : 'DU';\n            }\n        },\n        calendar: {\n            sameDay: '[ma] LT[-kor]',\n            nextDay: '[holnap] LT[-kor]',\n            nextWeek: function () {\n                return week.call(this, true);\n            },\n            lastDay: '[tegnap] LT[-kor]',\n            lastWeek: function () {\n                return week.call(this, false);\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s múlva',\n            past: '%s',\n            s: translate,\n            ss: translate,\n            m: translate,\n            mm: translate,\n            h: translate,\n            hh: translate,\n            d: translate,\n            dd: translate,\n            M: translate,\n            MM: translate,\n            y: translate,\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return hu;\n\n})));\n","//! moment.js locale configuration\n//! locale : Armenian [hy-am]\n//! author : Armendarabyan : https://github.com/armendarabyan\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var hyAm = moment.defineLocale('hy-am', {\n        months: {\n            format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split(\n                '_'\n            ),\n            standalone:\n                'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split(\n                    '_'\n                ),\n        },\n        monthsShort: 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'),\n        weekdays:\n            'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split(\n                '_'\n            ),\n        weekdaysShort: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),\n        weekdaysMin: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY թ.',\n            LLL: 'D MMMM YYYY թ., HH:mm',\n            LLLL: 'dddd, D MMMM YYYY թ., HH:mm',\n        },\n        calendar: {\n            sameDay: '[այսօր] LT',\n            nextDay: '[վաղը] LT',\n            lastDay: '[երեկ] LT',\n            nextWeek: function () {\n                return 'dddd [օրը ժամը] LT';\n            },\n            lastWeek: function () {\n                return '[անցած] dddd [օրը ժամը] LT';\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s հետո',\n            past: '%s առաջ',\n            s: 'մի քանի վայրկյան',\n            ss: '%d վայրկյան',\n            m: 'րոպե',\n            mm: '%d րոպե',\n            h: 'ժամ',\n            hh: '%d ժամ',\n            d: 'օր',\n            dd: '%d օր',\n            M: 'ամիս',\n            MM: '%d ամիս',\n            y: 'տարի',\n            yy: '%d տարի',\n        },\n        meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,\n        isPM: function (input) {\n            return /^(ցերեկվա|երեկոյան)$/.test(input);\n        },\n        meridiem: function (hour) {\n            if (hour < 4) {\n                return 'գիշերվա';\n            } else if (hour < 12) {\n                return 'առավոտվա';\n            } else if (hour < 17) {\n                return 'ցերեկվա';\n            } else {\n                return 'երեկոյան';\n            }\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}|\\d{1,2}-(ին|րդ)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'DDD':\n                case 'w':\n                case 'W':\n                case 'DDDo':\n                    if (number === 1) {\n                        return number + '-ին';\n                    }\n                    return number + '-րդ';\n                default:\n                    return number;\n            }\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return hyAm;\n\n})));\n","//! moment.js locale configuration\n//! locale : Indonesian [id]\n//! author : Mohammad Satrio Utomo : https://github.com/tyok\n//! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var id = moment.defineLocale('id', {\n        months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des'.split('_'),\n        weekdays: 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),\n        weekdaysShort: 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),\n        weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),\n        longDateFormat: {\n            LT: 'HH.mm',\n            LTS: 'HH.mm.ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY [pukul] HH.mm',\n            LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',\n        },\n        meridiemParse: /pagi|siang|sore|malam/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'pagi') {\n                return hour;\n            } else if (meridiem === 'siang') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === 'sore' || meridiem === 'malam') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hours, minutes, isLower) {\n            if (hours < 11) {\n                return 'pagi';\n            } else if (hours < 15) {\n                return 'siang';\n            } else if (hours < 19) {\n                return 'sore';\n            } else {\n                return 'malam';\n            }\n        },\n        calendar: {\n            sameDay: '[Hari ini pukul] LT',\n            nextDay: '[Besok pukul] LT',\n            nextWeek: 'dddd [pukul] LT',\n            lastDay: '[Kemarin pukul] LT',\n            lastWeek: 'dddd [lalu pukul] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'dalam %s',\n            past: '%s yang lalu',\n            s: 'beberapa detik',\n            ss: '%d detik',\n            m: 'semenit',\n            mm: '%d menit',\n            h: 'sejam',\n            hh: '%d jam',\n            d: 'sehari',\n            dd: '%d hari',\n            M: 'sebulan',\n            MM: '%d bulan',\n            y: 'setahun',\n            yy: '%d tahun',\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return id;\n\n})));\n","//! moment.js locale configuration\n//! locale : Icelandic [is]\n//! author : Hinrik Örn Sigurðsson : https://github.com/hinrik\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function plural(n) {\n        if (n % 100 === 11) {\n            return true;\n        } else if (n % 10 === 1) {\n            return false;\n        }\n        return true;\n    }\n    function translate(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        switch (key) {\n            case 's':\n                return withoutSuffix || isFuture\n                    ? 'nokkrar sekúndur'\n                    : 'nokkrum sekúndum';\n            case 'ss':\n                if (plural(number)) {\n                    return (\n                        result +\n                        (withoutSuffix || isFuture ? 'sekúndur' : 'sekúndum')\n                    );\n                }\n                return result + 'sekúnda';\n            case 'm':\n                return withoutSuffix ? 'mínúta' : 'mínútu';\n            case 'mm':\n                if (plural(number)) {\n                    return (\n                        result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum')\n                    );\n                } else if (withoutSuffix) {\n                    return result + 'mínúta';\n                }\n                return result + 'mínútu';\n            case 'hh':\n                if (plural(number)) {\n                    return (\n                        result +\n                        (withoutSuffix || isFuture\n                            ? 'klukkustundir'\n                            : 'klukkustundum')\n                    );\n                }\n                return result + 'klukkustund';\n            case 'd':\n                if (withoutSuffix) {\n                    return 'dagur';\n                }\n                return isFuture ? 'dag' : 'degi';\n            case 'dd':\n                if (plural(number)) {\n                    if (withoutSuffix) {\n                        return result + 'dagar';\n                    }\n                    return result + (isFuture ? 'daga' : 'dögum');\n                } else if (withoutSuffix) {\n                    return result + 'dagur';\n                }\n                return result + (isFuture ? 'dag' : 'degi');\n            case 'M':\n                if (withoutSuffix) {\n                    return 'mánuður';\n                }\n                return isFuture ? 'mánuð' : 'mánuði';\n            case 'MM':\n                if (plural(number)) {\n                    if (withoutSuffix) {\n                        return result + 'mánuðir';\n                    }\n                    return result + (isFuture ? 'mánuði' : 'mánuðum');\n                } else if (withoutSuffix) {\n                    return result + 'mánuður';\n                }\n                return result + (isFuture ? 'mánuð' : 'mánuði');\n            case 'y':\n                return withoutSuffix || isFuture ? 'ár' : 'ári';\n            case 'yy':\n                if (plural(number)) {\n                    return result + (withoutSuffix || isFuture ? 'ár' : 'árum');\n                }\n                return result + (withoutSuffix || isFuture ? 'ár' : 'ári');\n        }\n    }\n\n    var is = moment.defineLocale('is', {\n        months: 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split(\n            '_'\n        ),\n        monthsShort: 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),\n        weekdays:\n            'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split(\n                '_'\n            ),\n        weekdaysShort: 'sun_mán_þri_mið_fim_fös_lau'.split('_'),\n        weekdaysMin: 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY [kl.] H:mm',\n            LLLL: 'dddd, D. MMMM YYYY [kl.] H:mm',\n        },\n        calendar: {\n            sameDay: '[í dag kl.] LT',\n            nextDay: '[á morgun kl.] LT',\n            nextWeek: 'dddd [kl.] LT',\n            lastDay: '[í gær kl.] LT',\n            lastWeek: '[síðasta] dddd [kl.] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'eftir %s',\n            past: 'fyrir %s síðan',\n            s: translate,\n            ss: translate,\n            m: translate,\n            mm: translate,\n            h: 'klukkustund',\n            hh: translate,\n            d: translate,\n            dd: translate,\n            M: translate,\n            MM: translate,\n            y: translate,\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return is;\n\n})));\n","//! moment.js locale configuration\n//! locale : Italian (Switzerland) [it-ch]\n//! author : xfh : https://github.com/xfh\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var itCh = moment.defineLocale('it-ch', {\n        months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split(\n            '_'\n        ),\n        monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),\n        weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split(\n            '_'\n        ),\n        weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),\n        weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Oggi alle] LT',\n            nextDay: '[Domani alle] LT',\n            nextWeek: 'dddd [alle] LT',\n            lastDay: '[Ieri alle] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[la scorsa] dddd [alle] LT';\n                    default:\n                        return '[lo scorso] dddd [alle] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: function (s) {\n                return (/^[0-9].+$/.test(s) ? 'tra' : 'in') + ' ' + s;\n            },\n            past: '%s fa',\n            s: 'alcuni secondi',\n            ss: '%d secondi',\n            m: 'un minuto',\n            mm: '%d minuti',\n            h: \"un'ora\",\n            hh: '%d ore',\n            d: 'un giorno',\n            dd: '%d giorni',\n            M: 'un mese',\n            MM: '%d mesi',\n            y: 'un anno',\n            yy: '%d anni',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return itCh;\n\n})));\n","//! moment.js locale configuration\n//! locale : Italian [it]\n//! author : Lorenzo : https://github.com/aliem\n//! author: Mattia Larentis: https://github.com/nostalgiaz\n//! author: Marco : https://github.com/Manfre98\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var it = moment.defineLocale('it', {\n        months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split(\n            '_'\n        ),\n        monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),\n        weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split(\n            '_'\n        ),\n        weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),\n        weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: function () {\n                return (\n                    '[Oggi a' +\n                    (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : \"ll'\") +\n                    ']LT'\n                );\n            },\n            nextDay: function () {\n                return (\n                    '[Domani a' +\n                    (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : \"ll'\") +\n                    ']LT'\n                );\n            },\n            nextWeek: function () {\n                return (\n                    'dddd [a' +\n                    (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : \"ll'\") +\n                    ']LT'\n                );\n            },\n            lastDay: function () {\n                return (\n                    '[Ieri a' +\n                    (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : \"ll'\") +\n                    ']LT'\n                );\n            },\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return (\n                            '[La scorsa] dddd [a' +\n                            (this.hours() > 1\n                                ? 'lle '\n                                : this.hours() === 0\n                                ? ' '\n                                : \"ll'\") +\n                            ']LT'\n                        );\n                    default:\n                        return (\n                            '[Lo scorso] dddd [a' +\n                            (this.hours() > 1\n                                ? 'lle '\n                                : this.hours() === 0\n                                ? ' '\n                                : \"ll'\") +\n                            ']LT'\n                        );\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'tra %s',\n            past: '%s fa',\n            s: 'alcuni secondi',\n            ss: '%d secondi',\n            m: 'un minuto',\n            mm: '%d minuti',\n            h: \"un'ora\",\n            hh: '%d ore',\n            d: 'un giorno',\n            dd: '%d giorni',\n            w: 'una settimana',\n            ww: '%d settimane',\n            M: 'un mese',\n            MM: '%d mesi',\n            y: 'un anno',\n            yy: '%d anni',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return it;\n\n})));\n","//! moment.js locale configuration\n//! locale : Japanese [ja]\n//! author : LI Long : https://github.com/baryon\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var ja = moment.defineLocale('ja', {\n        eras: [\n            {\n                since: '2019-05-01',\n                offset: 1,\n                name: '令和',\n                narrow: '㋿',\n                abbr: 'R',\n            },\n            {\n                since: '1989-01-08',\n                until: '2019-04-30',\n                offset: 1,\n                name: '平成',\n                narrow: '㍻',\n                abbr: 'H',\n            },\n            {\n                since: '1926-12-25',\n                until: '1989-01-07',\n                offset: 1,\n                name: '昭和',\n                narrow: '㍼',\n                abbr: 'S',\n            },\n            {\n                since: '1912-07-30',\n                until: '1926-12-24',\n                offset: 1,\n                name: '大正',\n                narrow: '㍽',\n                abbr: 'T',\n            },\n            {\n                since: '1873-01-01',\n                until: '1912-07-29',\n                offset: 6,\n                name: '明治',\n                narrow: '㍾',\n                abbr: 'M',\n            },\n            {\n                since: '0001-01-01',\n                until: '1873-12-31',\n                offset: 1,\n                name: '西暦',\n                narrow: 'AD',\n                abbr: 'AD',\n            },\n            {\n                since: '0000-12-31',\n                until: -Infinity,\n                offset: 1,\n                name: '紀元前',\n                narrow: 'BC',\n                abbr: 'BC',\n            },\n        ],\n        eraYearOrdinalRegex: /(元|\\d+)年/,\n        eraYearOrdinalParse: function (input, match) {\n            return match[1] === '元' ? 1 : parseInt(match[1] || input, 10);\n        },\n        months: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n        monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(\n            '_'\n        ),\n        weekdays: '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),\n        weekdaysShort: '日_月_火_水_木_金_土'.split('_'),\n        weekdaysMin: '日_月_火_水_木_金_土'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY/MM/DD',\n            LL: 'YYYY年M月D日',\n            LLL: 'YYYY年M月D日 HH:mm',\n            LLLL: 'YYYY年M月D日 dddd HH:mm',\n            l: 'YYYY/MM/DD',\n            ll: 'YYYY年M月D日',\n            lll: 'YYYY年M月D日 HH:mm',\n            llll: 'YYYY年M月D日(ddd) HH:mm',\n        },\n        meridiemParse: /午前|午後/i,\n        isPM: function (input) {\n            return input === '午後';\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return '午前';\n            } else {\n                return '午後';\n            }\n        },\n        calendar: {\n            sameDay: '[今日] LT',\n            nextDay: '[明日] LT',\n            nextWeek: function (now) {\n                if (now.week() !== this.week()) {\n                    return '[来週]dddd LT';\n                } else {\n                    return 'dddd LT';\n                }\n            },\n            lastDay: '[昨日] LT',\n            lastWeek: function (now) {\n                if (this.week() !== now.week()) {\n                    return '[先週]dddd LT';\n                } else {\n                    return 'dddd LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}日/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'y':\n                    return number === 1 ? '元年' : number + '年';\n                case 'd':\n                case 'D':\n                case 'DDD':\n                    return number + '日';\n                default:\n                    return number;\n            }\n        },\n        relativeTime: {\n            future: '%s後',\n            past: '%s前',\n            s: '数秒',\n            ss: '%d秒',\n            m: '1分',\n            mm: '%d分',\n            h: '1時間',\n            hh: '%d時間',\n            d: '1日',\n            dd: '%d日',\n            M: '1ヶ月',\n            MM: '%dヶ月',\n            y: '1年',\n            yy: '%d年',\n        },\n    });\n\n    return ja;\n\n})));\n","//! moment.js locale configuration\n//! locale : Javanese [jv]\n//! author : Rony Lantip : https://github.com/lantip\n//! reference: http://jv.wikipedia.org/wiki/Basa_Jawa\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var jv = moment.defineLocale('jv', {\n        months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'),\n        weekdays: 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'),\n        weekdaysShort: 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'),\n        weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'),\n        longDateFormat: {\n            LT: 'HH.mm',\n            LTS: 'HH.mm.ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY [pukul] HH.mm',\n            LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',\n        },\n        meridiemParse: /enjing|siyang|sonten|ndalu/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'enjing') {\n                return hour;\n            } else if (meridiem === 'siyang') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === 'sonten' || meridiem === 'ndalu') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hours, minutes, isLower) {\n            if (hours < 11) {\n                return 'enjing';\n            } else if (hours < 15) {\n                return 'siyang';\n            } else if (hours < 19) {\n                return 'sonten';\n            } else {\n                return 'ndalu';\n            }\n        },\n        calendar: {\n            sameDay: '[Dinten puniko pukul] LT',\n            nextDay: '[Mbenjang pukul] LT',\n            nextWeek: 'dddd [pukul] LT',\n            lastDay: '[Kala wingi pukul] LT',\n            lastWeek: 'dddd [kepengker pukul] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'wonten ing %s',\n            past: '%s ingkang kepengker',\n            s: 'sawetawis detik',\n            ss: '%d detik',\n            m: 'setunggal menit',\n            mm: '%d menit',\n            h: 'setunggal jam',\n            hh: '%d jam',\n            d: 'sedinten',\n            dd: '%d dinten',\n            M: 'sewulan',\n            MM: '%d wulan',\n            y: 'setaun',\n            yy: '%d taun',\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return jv;\n\n})));\n","//! moment.js locale configuration\n//! locale : Georgian [ka]\n//! author : Irakli Janiashvili : https://github.com/IrakliJani\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var ka = moment.defineLocale('ka', {\n        months: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split(\n            '_'\n        ),\n        monthsShort: 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),\n        weekdays: {\n            standalone:\n                'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split(\n                    '_'\n                ),\n            format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split(\n                '_'\n            ),\n            isFormat: /(წინა|შემდეგ)/,\n        },\n        weekdaysShort: 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),\n        weekdaysMin: 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[დღეს] LT[-ზე]',\n            nextDay: '[ხვალ] LT[-ზე]',\n            lastDay: '[გუშინ] LT[-ზე]',\n            nextWeek: '[შემდეგ] dddd LT[-ზე]',\n            lastWeek: '[წინა] dddd LT-ზე',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: function (s) {\n                return s.replace(\n                    /(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,\n                    function ($0, $1, $2) {\n                        return $2 === 'ი' ? $1 + 'ში' : $1 + $2 + 'ში';\n                    }\n                );\n            },\n            past: function (s) {\n                if (/(წამი|წუთი|საათი|დღე|თვე)/.test(s)) {\n                    return s.replace(/(ი|ე)$/, 'ის წინ');\n                }\n                if (/წელი/.test(s)) {\n                    return s.replace(/წელი$/, 'წლის წინ');\n                }\n                return s;\n            },\n            s: 'რამდენიმე წამი',\n            ss: '%d წამი',\n            m: 'წუთი',\n            mm: '%d წუთი',\n            h: 'საათი',\n            hh: '%d საათი',\n            d: 'დღე',\n            dd: '%d დღე',\n            M: 'თვე',\n            MM: '%d თვე',\n            y: 'წელი',\n            yy: '%d წელი',\n        },\n        dayOfMonthOrdinalParse: /0|1-ლი|მე-\\d{1,2}|\\d{1,2}-ე/,\n        ordinal: function (number) {\n            if (number === 0) {\n                return number;\n            }\n            if (number === 1) {\n                return number + '-ლი';\n            }\n            if (\n                number < 20 ||\n                (number <= 100 && number % 20 === 0) ||\n                number % 100 === 0\n            ) {\n                return 'მე-' + number;\n            }\n            return number + '-ე';\n        },\n        week: {\n            dow: 1,\n            doy: 7,\n        },\n    });\n\n    return ka;\n\n})));\n","//! moment.js locale configuration\n//! locale : Kazakh [kk]\n//! authors : Nurlan Rakhimzhanov : https://github.com/nurlan\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var suffixes = {\n        0: '-ші',\n        1: '-ші',\n        2: '-ші',\n        3: '-ші',\n        4: '-ші',\n        5: '-ші',\n        6: '-шы',\n        7: '-ші',\n        8: '-ші',\n        9: '-шы',\n        10: '-шы',\n        20: '-шы',\n        30: '-шы',\n        40: '-шы',\n        50: '-ші',\n        60: '-шы',\n        70: '-ші',\n        80: '-ші',\n        90: '-шы',\n        100: '-ші',\n    };\n\n    var kk = moment.defineLocale('kk', {\n        months: 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split(\n            '_'\n        ),\n        monthsShort: 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'),\n        weekdays: 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split(\n            '_'\n        ),\n        weekdaysShort: 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'),\n        weekdaysMin: 'жк_дй_сй_ср_бй_жм_сн'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Бүгін сағат] LT',\n            nextDay: '[Ертең сағат] LT',\n            nextWeek: 'dddd [сағат] LT',\n            lastDay: '[Кеше сағат] LT',\n            lastWeek: '[Өткен аптаның] dddd [сағат] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s ішінде',\n            past: '%s бұрын',\n            s: 'бірнеше секунд',\n            ss: '%d секунд',\n            m: 'бір минут',\n            mm: '%d минут',\n            h: 'бір сағат',\n            hh: '%d сағат',\n            d: 'бір күн',\n            dd: '%d күн',\n            M: 'бір ай',\n            MM: '%d ай',\n            y: 'бір жыл',\n            yy: '%d жыл',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-(ші|шы)/,\n        ordinal: function (number) {\n            var a = number % 10,\n                b = number >= 100 ? 100 : null;\n            return number + (suffixes[number] || suffixes[a] || suffixes[b]);\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return kk;\n\n})));\n","//! moment.js locale configuration\n//! locale : Cambodian [km]\n//! author : Kruy Vanna : https://github.com/kruyvanna\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '១',\n            2: '២',\n            3: '៣',\n            4: '៤',\n            5: '៥',\n            6: '៦',\n            7: '៧',\n            8: '៨',\n            9: '៩',\n            0: '០',\n        },\n        numberMap = {\n            '១': '1',\n            '២': '2',\n            '៣': '3',\n            '៤': '4',\n            '៥': '5',\n            '៦': '6',\n            '៧': '7',\n            '៨': '8',\n            '៩': '9',\n            '០': '0',\n        };\n\n    var km = moment.defineLocale('km', {\n        months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split(\n            '_'\n        ),\n        monthsShort:\n            'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split(\n                '_'\n            ),\n        weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),\n        weekdaysShort: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),\n        weekdaysMin: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /ព្រឹក|ល្ងាច/,\n        isPM: function (input) {\n            return input === 'ល្ងាច';\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ព្រឹក';\n            } else {\n                return 'ល្ងាច';\n            }\n        },\n        calendar: {\n            sameDay: '[ថ្ងៃនេះ ម៉ោង] LT',\n            nextDay: '[ស្អែក ម៉ោង] LT',\n            nextWeek: 'dddd [ម៉ោង] LT',\n            lastDay: '[ម្សិលមិញ ម៉ោង] LT',\n            lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%sទៀត',\n            past: '%sមុន',\n            s: 'ប៉ុន្មានវិនាទី',\n            ss: '%d វិនាទី',\n            m: 'មួយនាទី',\n            mm: '%d នាទី',\n            h: 'មួយម៉ោង',\n            hh: '%d ម៉ោង',\n            d: 'មួយថ្ងៃ',\n            dd: '%d ថ្ងៃ',\n            M: 'មួយខែ',\n            MM: '%d ខែ',\n            y: 'មួយឆ្នាំ',\n            yy: '%d ឆ្នាំ',\n        },\n        dayOfMonthOrdinalParse: /ទី\\d{1,2}/,\n        ordinal: 'ទី%d',\n        preparse: function (string) {\n            return string.replace(/[១២៣៤៥៦៧៨៩០]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return km;\n\n})));\n","//! moment.js locale configuration\n//! locale : Kannada [kn]\n//! author : Rajeev Naik : https://github.com/rajeevnaikte\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '೧',\n            2: '೨',\n            3: '೩',\n            4: '೪',\n            5: '೫',\n            6: '೬',\n            7: '೭',\n            8: '೮',\n            9: '೯',\n            0: '೦',\n        },\n        numberMap = {\n            '೧': '1',\n            '೨': '2',\n            '೩': '3',\n            '೪': '4',\n            '೫': '5',\n            '೬': '6',\n            '೭': '7',\n            '೮': '8',\n            '೯': '9',\n            '೦': '0',\n        };\n\n    var kn = moment.defineLocale('kn', {\n        months: 'ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್'.split(\n            '_'\n        ),\n        monthsShort:\n            'ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ'.split(\n            '_'\n        ),\n        weekdaysShort: 'ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ'.split('_'),\n        weekdaysMin: 'ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm',\n            LTS: 'A h:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, A h:mm',\n            LLLL: 'dddd, D MMMM YYYY, A h:mm',\n        },\n        calendar: {\n            sameDay: '[ಇಂದು] LT',\n            nextDay: '[ನಾಳೆ] LT',\n            nextWeek: 'dddd, LT',\n            lastDay: '[ನಿನ್ನೆ] LT',\n            lastWeek: '[ಕೊನೆಯ] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s ನಂತರ',\n            past: '%s ಹಿಂದೆ',\n            s: 'ಕೆಲವು ಕ್ಷಣಗಳು',\n            ss: '%d ಸೆಕೆಂಡುಗಳು',\n            m: 'ಒಂದು ನಿಮಿಷ',\n            mm: '%d ನಿಮಿಷ',\n            h: 'ಒಂದು ಗಂಟೆ',\n            hh: '%d ಗಂಟೆ',\n            d: 'ಒಂದು ದಿನ',\n            dd: '%d ದಿನ',\n            M: 'ಒಂದು ತಿಂಗಳು',\n            MM: '%d ತಿಂಗಳು',\n            y: 'ಒಂದು ವರ್ಷ',\n            yy: '%d ವರ್ಷ',\n        },\n        preparse: function (string) {\n            return string.replace(/[೧೨೩೪೫೬೭೮೯೦]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        meridiemParse: /ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'ರಾತ್ರಿ') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'ಬೆಳಿಗ್ಗೆ') {\n                return hour;\n            } else if (meridiem === 'ಮಧ್ಯಾಹ್ನ') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'ಸಂಜೆ') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'ರಾತ್ರಿ';\n            } else if (hour < 10) {\n                return 'ಬೆಳಿಗ್ಗೆ';\n            } else if (hour < 17) {\n                return 'ಮಧ್ಯಾಹ್ನ';\n            } else if (hour < 20) {\n                return 'ಸಂಜೆ';\n            } else {\n                return 'ರಾತ್ರಿ';\n            }\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(ನೇ)/,\n        ordinal: function (number) {\n            return number + 'ನೇ';\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return kn;\n\n})));\n","//! moment.js locale configuration\n//! locale : Korean [ko]\n//! author : Kyungwook, Park : https://github.com/kyungw00k\n//! author : Jeeeyul Lee <jeeeyul@gmail.com>\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var ko = moment.defineLocale('ko', {\n        months: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),\n        monthsShort: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split(\n            '_'\n        ),\n        weekdays: '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),\n        weekdaysShort: '일_월_화_수_목_금_토'.split('_'),\n        weekdaysMin: '일_월_화_수_목_금_토'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm',\n            LTS: 'A h:mm:ss',\n            L: 'YYYY.MM.DD.',\n            LL: 'YYYY년 MMMM D일',\n            LLL: 'YYYY년 MMMM D일 A h:mm',\n            LLLL: 'YYYY년 MMMM D일 dddd A h:mm',\n            l: 'YYYY.MM.DD.',\n            ll: 'YYYY년 MMMM D일',\n            lll: 'YYYY년 MMMM D일 A h:mm',\n            llll: 'YYYY년 MMMM D일 dddd A h:mm',\n        },\n        calendar: {\n            sameDay: '오늘 LT',\n            nextDay: '내일 LT',\n            nextWeek: 'dddd LT',\n            lastDay: '어제 LT',\n            lastWeek: '지난주 dddd LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s 후',\n            past: '%s 전',\n            s: '몇 초',\n            ss: '%d초',\n            m: '1분',\n            mm: '%d분',\n            h: '한 시간',\n            hh: '%d시간',\n            d: '하루',\n            dd: '%d일',\n            M: '한 달',\n            MM: '%d달',\n            y: '일 년',\n            yy: '%d년',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(일|월|주)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'd':\n                case 'D':\n                case 'DDD':\n                    return number + '일';\n                case 'M':\n                    return number + '월';\n                case 'w':\n                case 'W':\n                    return number + '주';\n                default:\n                    return number;\n            }\n        },\n        meridiemParse: /오전|오후/,\n        isPM: function (token) {\n            return token === '오후';\n        },\n        meridiem: function (hour, minute, isUpper) {\n            return hour < 12 ? '오전' : '오후';\n        },\n    });\n\n    return ko;\n\n})));\n","//! moment.js locale configuration\n//! locale : Kurdish [ku]\n//! author : Shahram Mebashar : https://github.com/ShahramMebashar\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '١',\n            2: '٢',\n            3: '٣',\n            4: '٤',\n            5: '٥',\n            6: '٦',\n            7: '٧',\n            8: '٨',\n            9: '٩',\n            0: '٠',\n        },\n        numberMap = {\n            '١': '1',\n            '٢': '2',\n            '٣': '3',\n            '٤': '4',\n            '٥': '5',\n            '٦': '6',\n            '٧': '7',\n            '٨': '8',\n            '٩': '9',\n            '٠': '0',\n        },\n        months = [\n            'کانونی دووەم',\n            'شوبات',\n            'ئازار',\n            'نیسان',\n            'ئایار',\n            'حوزەیران',\n            'تەمموز',\n            'ئاب',\n            'ئەیلوول',\n            'تشرینی یەكەم',\n            'تشرینی دووەم',\n            'كانونی یەکەم',\n        ];\n\n    var ku = moment.defineLocale('ku', {\n        months: months,\n        monthsShort: months,\n        weekdays:\n            'یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌'.split(\n                '_'\n            ),\n        weekdaysShort:\n            'یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌'.split('_'),\n        weekdaysMin: 'ی_د_س_چ_پ_ه_ش'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /ئێواره‌|به‌یانی/,\n        isPM: function (input) {\n            return /ئێواره‌/.test(input);\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'به‌یانی';\n            } else {\n                return 'ئێواره‌';\n            }\n        },\n        calendar: {\n            sameDay: '[ئه‌مرۆ كاتژمێر] LT',\n            nextDay: '[به‌یانی كاتژمێر] LT',\n            nextWeek: 'dddd [كاتژمێر] LT',\n            lastDay: '[دوێنێ كاتژمێر] LT',\n            lastWeek: 'dddd [كاتژمێر] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'له‌ %s',\n            past: '%s',\n            s: 'چه‌ند چركه‌یه‌ك',\n            ss: 'چركه‌ %d',\n            m: 'یه‌ك خوله‌ك',\n            mm: '%d خوله‌ك',\n            h: 'یه‌ك كاتژمێر',\n            hh: '%d كاتژمێر',\n            d: 'یه‌ك ڕۆژ',\n            dd: '%d ڕۆژ',\n            M: 'یه‌ك مانگ',\n            MM: '%d مانگ',\n            y: 'یه‌ك ساڵ',\n            yy: '%d ساڵ',\n        },\n        preparse: function (string) {\n            return string\n                .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {\n                    return numberMap[match];\n                })\n                .replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string\n                .replace(/\\d/g, function (match) {\n                    return symbolMap[match];\n                })\n                .replace(/,/g, '،');\n        },\n        week: {\n            dow: 6, // Saturday is the first day of the week.\n            doy: 12, // The week that contains Jan 12th is the first week of the year.\n        },\n    });\n\n    return ku;\n\n})));\n","//! moment.js locale configuration\n//! locale : Kyrgyz [ky]\n//! author : Chyngyz Arystan uulu : https://github.com/chyngyz\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var suffixes = {\n        0: '-чү',\n        1: '-чи',\n        2: '-чи',\n        3: '-чү',\n        4: '-чү',\n        5: '-чи',\n        6: '-чы',\n        7: '-чи',\n        8: '-чи',\n        9: '-чу',\n        10: '-чу',\n        20: '-чы',\n        30: '-чу',\n        40: '-чы',\n        50: '-чү',\n        60: '-чы',\n        70: '-чи',\n        80: '-чи',\n        90: '-чу',\n        100: '-чү',\n    };\n\n    var ky = moment.defineLocale('ky', {\n        months: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split(\n            '_'\n        ),\n        monthsShort: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split(\n            '_'\n        ),\n        weekdays: 'Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби'.split(\n            '_'\n        ),\n        weekdaysShort: 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'),\n        weekdaysMin: 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Бүгүн саат] LT',\n            nextDay: '[Эртең саат] LT',\n            nextWeek: 'dddd [саат] LT',\n            lastDay: '[Кечээ саат] LT',\n            lastWeek: '[Өткөн аптанын] dddd [күнү] [саат] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s ичинде',\n            past: '%s мурун',\n            s: 'бирнече секунд',\n            ss: '%d секунд',\n            m: 'бир мүнөт',\n            mm: '%d мүнөт',\n            h: 'бир саат',\n            hh: '%d саат',\n            d: 'бир күн',\n            dd: '%d күн',\n            M: 'бир ай',\n            MM: '%d ай',\n            y: 'бир жыл',\n            yy: '%d жыл',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-(чи|чы|чү|чу)/,\n        ordinal: function (number) {\n            var a = number % 10,\n                b = number >= 100 ? 100 : null;\n            return number + (suffixes[number] || suffixes[a] || suffixes[b]);\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return ky;\n\n})));\n","//! moment.js locale configuration\n//! locale : Luxembourgish [lb]\n//! author : mweimerskirch : https://github.com/mweimerskirch\n//! author : David Raison : https://github.com/kwisatz\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            m: ['eng Minutt', 'enger Minutt'],\n            h: ['eng Stonn', 'enger Stonn'],\n            d: ['een Dag', 'engem Dag'],\n            M: ['ee Mount', 'engem Mount'],\n            y: ['ee Joer', 'engem Joer'],\n        };\n        return withoutSuffix ? format[key][0] : format[key][1];\n    }\n    function processFutureTime(string) {\n        var number = string.substr(0, string.indexOf(' '));\n        if (eifelerRegelAppliesToNumber(number)) {\n            return 'a ' + string;\n        }\n        return 'an ' + string;\n    }\n    function processPastTime(string) {\n        var number = string.substr(0, string.indexOf(' '));\n        if (eifelerRegelAppliesToNumber(number)) {\n            return 'viru ' + string;\n        }\n        return 'virun ' + string;\n    }\n    /**\n     * Returns true if the word before the given number loses the '-n' ending.\n     * e.g. 'an 10 Deeg' but 'a 5 Deeg'\n     *\n     * @param number {integer}\n     * @returns {boolean}\n     */\n    function eifelerRegelAppliesToNumber(number) {\n        number = parseInt(number, 10);\n        if (isNaN(number)) {\n            return false;\n        }\n        if (number < 0) {\n            // Negative Number --> always true\n            return true;\n        } else if (number < 10) {\n            // Only 1 digit\n            if (4 <= number && number <= 7) {\n                return true;\n            }\n            return false;\n        } else if (number < 100) {\n            // 2 digits\n            var lastDigit = number % 10,\n                firstDigit = number / 10;\n            if (lastDigit === 0) {\n                return eifelerRegelAppliesToNumber(firstDigit);\n            }\n            return eifelerRegelAppliesToNumber(lastDigit);\n        } else if (number < 10000) {\n            // 3 or 4 digits --> recursively check first digit\n            while (number >= 10) {\n                number = number / 10;\n            }\n            return eifelerRegelAppliesToNumber(number);\n        } else {\n            // Anything larger than 4 digits: recursively check first n-3 digits\n            number = number / 1000;\n            return eifelerRegelAppliesToNumber(number);\n        }\n    }\n\n    var lb = moment.defineLocale('lb', {\n        months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split(\n            '_'\n        ),\n        monthsShort:\n            'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays:\n            'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split(\n                '_'\n            ),\n        weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),\n        weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm [Auer]',\n            LTS: 'H:mm:ss [Auer]',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY H:mm [Auer]',\n            LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]',\n        },\n        calendar: {\n            sameDay: '[Haut um] LT',\n            sameElse: 'L',\n            nextDay: '[Muer um] LT',\n            nextWeek: 'dddd [um] LT',\n            lastDay: '[Gëschter um] LT',\n            lastWeek: function () {\n                // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule\n                switch (this.day()) {\n                    case 2:\n                    case 4:\n                        return '[Leschten] dddd [um] LT';\n                    default:\n                        return '[Leschte] dddd [um] LT';\n                }\n            },\n        },\n        relativeTime: {\n            future: processFutureTime,\n            past: processPastTime,\n            s: 'e puer Sekonnen',\n            ss: '%d Sekonnen',\n            m: processRelativeTime,\n            mm: '%d Minutten',\n            h: processRelativeTime,\n            hh: '%d Stonnen',\n            d: processRelativeTime,\n            dd: '%d Deeg',\n            M: processRelativeTime,\n            MM: '%d Méint',\n            y: processRelativeTime,\n            yy: '%d Joer',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return lb;\n\n})));\n","//! moment.js locale configuration\n//! locale : Lao [lo]\n//! author : Ryan Hart : https://github.com/ryanhart2\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var lo = moment.defineLocale('lo', {\n        months: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split(\n            '_'\n        ),\n        monthsShort:\n            'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split(\n                '_'\n            ),\n        weekdays: 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),\n        weekdaysShort: 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),\n        weekdaysMin: 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'ວັນdddd D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/,\n        isPM: function (input) {\n            return input === 'ຕອນແລງ';\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ຕອນເຊົ້າ';\n            } else {\n                return 'ຕອນແລງ';\n            }\n        },\n        calendar: {\n            sameDay: '[ມື້ນີ້ເວລາ] LT',\n            nextDay: '[ມື້ອື່ນເວລາ] LT',\n            nextWeek: '[ວັນ]dddd[ໜ້າເວລາ] LT',\n            lastDay: '[ມື້ວານນີ້ເວລາ] LT',\n            lastWeek: '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'ອີກ %s',\n            past: '%sຜ່ານມາ',\n            s: 'ບໍ່ເທົ່າໃດວິນາທີ',\n            ss: '%d ວິນາທີ',\n            m: '1 ນາທີ',\n            mm: '%d ນາທີ',\n            h: '1 ຊົ່ວໂມງ',\n            hh: '%d ຊົ່ວໂມງ',\n            d: '1 ມື້',\n            dd: '%d ມື້',\n            M: '1 ເດືອນ',\n            MM: '%d ເດືອນ',\n            y: '1 ປີ',\n            yy: '%d ປີ',\n        },\n        dayOfMonthOrdinalParse: /(ທີ່)\\d{1,2}/,\n        ordinal: function (number) {\n            return 'ທີ່' + number;\n        },\n    });\n\n    return lo;\n\n})));\n","//! moment.js locale configuration\n//! locale : Lithuanian [lt]\n//! author : Mindaugas Mozūras : https://github.com/mmozuras\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var units = {\n        ss: 'sekundė_sekundžių_sekundes',\n        m: 'minutė_minutės_minutę',\n        mm: 'minutės_minučių_minutes',\n        h: 'valanda_valandos_valandą',\n        hh: 'valandos_valandų_valandas',\n        d: 'diena_dienos_dieną',\n        dd: 'dienos_dienų_dienas',\n        M: 'mėnuo_mėnesio_mėnesį',\n        MM: 'mėnesiai_mėnesių_mėnesius',\n        y: 'metai_metų_metus',\n        yy: 'metai_metų_metus',\n    };\n    function translateSeconds(number, withoutSuffix, key, isFuture) {\n        if (withoutSuffix) {\n            return 'kelios sekundės';\n        } else {\n            return isFuture ? 'kelių sekundžių' : 'kelias sekundes';\n        }\n    }\n    function translateSingular(number, withoutSuffix, key, isFuture) {\n        return withoutSuffix\n            ? forms(key)[0]\n            : isFuture\n            ? forms(key)[1]\n            : forms(key)[2];\n    }\n    function special(number) {\n        return number % 10 === 0 || (number > 10 && number < 20);\n    }\n    function forms(key) {\n        return units[key].split('_');\n    }\n    function translate(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        if (number === 1) {\n            return (\n                result + translateSingular(number, withoutSuffix, key[0], isFuture)\n            );\n        } else if (withoutSuffix) {\n            return result + (special(number) ? forms(key)[1] : forms(key)[0]);\n        } else {\n            if (isFuture) {\n                return result + forms(key)[1];\n            } else {\n                return result + (special(number) ? forms(key)[1] : forms(key)[2]);\n            }\n        }\n    }\n    var lt = moment.defineLocale('lt', {\n        months: {\n            format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split(\n                '_'\n            ),\n            standalone:\n                'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split(\n                    '_'\n                ),\n            isFormat: /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?|MMMM?(\\[[^\\[\\]]*\\]|\\s)+D[oD]?/,\n        },\n        monthsShort: 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),\n        weekdays: {\n            format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split(\n                '_'\n            ),\n            standalone:\n                'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split(\n                    '_'\n                ),\n            isFormat: /dddd HH:mm/,\n        },\n        weekdaysShort: 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),\n        weekdaysMin: 'S_P_A_T_K_Pn_Š'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY-MM-DD',\n            LL: 'YYYY [m.] MMMM D [d.]',\n            LLL: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',\n            LLLL: 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',\n            l: 'YYYY-MM-DD',\n            ll: 'YYYY [m.] MMMM D [d.]',\n            lll: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',\n            llll: 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]',\n        },\n        calendar: {\n            sameDay: '[Šiandien] LT',\n            nextDay: '[Rytoj] LT',\n            nextWeek: 'dddd LT',\n            lastDay: '[Vakar] LT',\n            lastWeek: '[Praėjusį] dddd LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'po %s',\n            past: 'prieš %s',\n            s: translateSeconds,\n            ss: translate,\n            m: translateSingular,\n            mm: translate,\n            h: translateSingular,\n            hh: translate,\n            d: translateSingular,\n            dd: translate,\n            M: translateSingular,\n            MM: translate,\n            y: translateSingular,\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-oji/,\n        ordinal: function (number) {\n            return number + '-oji';\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return lt;\n\n})));\n","//! moment.js locale configuration\n//! locale : Latvian [lv]\n//! author : Kristaps Karlsons : https://github.com/skakri\n//! author : Jānis Elmeris : https://github.com/JanisE\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var units = {\n        ss: 'sekundes_sekundēm_sekunde_sekundes'.split('_'),\n        m: 'minūtes_minūtēm_minūte_minūtes'.split('_'),\n        mm: 'minūtes_minūtēm_minūte_minūtes'.split('_'),\n        h: 'stundas_stundām_stunda_stundas'.split('_'),\n        hh: 'stundas_stundām_stunda_stundas'.split('_'),\n        d: 'dienas_dienām_diena_dienas'.split('_'),\n        dd: 'dienas_dienām_diena_dienas'.split('_'),\n        M: 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),\n        MM: 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),\n        y: 'gada_gadiem_gads_gadi'.split('_'),\n        yy: 'gada_gadiem_gads_gadi'.split('_'),\n    };\n    /**\n     * @param withoutSuffix boolean true = a length of time; false = before/after a period of time.\n     */\n    function format(forms, number, withoutSuffix) {\n        if (withoutSuffix) {\n            // E.g. \"21 minūte\", \"3 minūtes\".\n            return number % 10 === 1 && number % 100 !== 11 ? forms[2] : forms[3];\n        } else {\n            // E.g. \"21 minūtes\" as in \"pēc 21 minūtes\".\n            // E.g. \"3 minūtēm\" as in \"pēc 3 minūtēm\".\n            return number % 10 === 1 && number % 100 !== 11 ? forms[0] : forms[1];\n        }\n    }\n    function relativeTimeWithPlural(number, withoutSuffix, key) {\n        return number + ' ' + format(units[key], number, withoutSuffix);\n    }\n    function relativeTimeWithSingular(number, withoutSuffix, key) {\n        return format(units[key], number, withoutSuffix);\n    }\n    function relativeSeconds(number, withoutSuffix) {\n        return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm';\n    }\n\n    var lv = moment.defineLocale('lv', {\n        months: 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split(\n            '_'\n        ),\n        monthsShort: 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),\n        weekdays:\n            'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split(\n                '_'\n            ),\n        weekdaysShort: 'Sv_P_O_T_C_Pk_S'.split('_'),\n        weekdaysMin: 'Sv_P_O_T_C_Pk_S'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY.',\n            LL: 'YYYY. [gada] D. MMMM',\n            LLL: 'YYYY. [gada] D. MMMM, HH:mm',\n            LLLL: 'YYYY. [gada] D. MMMM, dddd, HH:mm',\n        },\n        calendar: {\n            sameDay: '[Šodien pulksten] LT',\n            nextDay: '[Rīt pulksten] LT',\n            nextWeek: 'dddd [pulksten] LT',\n            lastDay: '[Vakar pulksten] LT',\n            lastWeek: '[Pagājušā] dddd [pulksten] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'pēc %s',\n            past: 'pirms %s',\n            s: relativeSeconds,\n            ss: relativeTimeWithPlural,\n            m: relativeTimeWithSingular,\n            mm: relativeTimeWithPlural,\n            h: relativeTimeWithSingular,\n            hh: relativeTimeWithPlural,\n            d: relativeTimeWithSingular,\n            dd: relativeTimeWithPlural,\n            M: relativeTimeWithSingular,\n            MM: relativeTimeWithPlural,\n            y: relativeTimeWithSingular,\n            yy: relativeTimeWithPlural,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return lv;\n\n})));\n","//! moment.js locale configuration\n//! locale : Montenegrin [me]\n//! author : Miodrag Nikač <miodrag@restartit.me> : https://github.com/miodragnikac\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var translator = {\n        words: {\n            //Different grammatical cases\n            ss: ['sekund', 'sekunda', 'sekundi'],\n            m: ['jedan minut', 'jednog minuta'],\n            mm: ['minut', 'minuta', 'minuta'],\n            h: ['jedan sat', 'jednog sata'],\n            hh: ['sat', 'sata', 'sati'],\n            dd: ['dan', 'dana', 'dana'],\n            MM: ['mjesec', 'mjeseca', 'mjeseci'],\n            yy: ['godina', 'godine', 'godina'],\n        },\n        correctGrammaticalCase: function (number, wordKey) {\n            return number === 1\n                ? wordKey[0]\n                : number >= 2 && number <= 4\n                ? wordKey[1]\n                : wordKey[2];\n        },\n        translate: function (number, withoutSuffix, key) {\n            var wordKey = translator.words[key];\n            if (key.length === 1) {\n                return withoutSuffix ? wordKey[0] : wordKey[1];\n            } else {\n                return (\n                    number +\n                    ' ' +\n                    translator.correctGrammaticalCase(number, wordKey)\n                );\n            }\n        },\n    };\n\n    var me = moment.defineLocale('me', {\n        months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(\n            '_'\n        ),\n        monthsShort:\n            'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),\n        monthsParseExact: true,\n        weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(\n            '_'\n        ),\n        weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),\n        weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY H:mm',\n            LLLL: 'dddd, D. MMMM YYYY H:mm',\n        },\n        calendar: {\n            sameDay: '[danas u] LT',\n            nextDay: '[sjutra u] LT',\n\n            nextWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[u] [nedjelju] [u] LT';\n                    case 3:\n                        return '[u] [srijedu] [u] LT';\n                    case 6:\n                        return '[u] [subotu] [u] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[u] dddd [u] LT';\n                }\n            },\n            lastDay: '[juče u] LT',\n            lastWeek: function () {\n                var lastWeekDays = [\n                    '[prošle] [nedjelje] [u] LT',\n                    '[prošlog] [ponedjeljka] [u] LT',\n                    '[prošlog] [utorka] [u] LT',\n                    '[prošle] [srijede] [u] LT',\n                    '[prošlog] [četvrtka] [u] LT',\n                    '[prošlog] [petka] [u] LT',\n                    '[prošle] [subote] [u] LT',\n                ];\n                return lastWeekDays[this.day()];\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'za %s',\n            past: 'prije %s',\n            s: 'nekoliko sekundi',\n            ss: translator.translate,\n            m: translator.translate,\n            mm: translator.translate,\n            h: translator.translate,\n            hh: translator.translate,\n            d: 'dan',\n            dd: translator.translate,\n            M: 'mjesec',\n            MM: translator.translate,\n            y: 'godinu',\n            yy: translator.translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return me;\n\n})));\n","//! moment.js locale configuration\n//! locale : Maori [mi]\n//! author : John Corrigan <robbiecloset@gmail.com> : https://github.com/johnideal\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var mi = moment.defineLocale('mi', {\n        months: 'Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea'.split(\n            '_'\n        ),\n        monthsShort:\n            'Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki'.split(\n                '_'\n            ),\n        monthsRegex: /(?:['a-z\\u0101\\u014D\\u016B]+\\-?){1,3}/i,\n        monthsStrictRegex: /(?:['a-z\\u0101\\u014D\\u016B]+\\-?){1,3}/i,\n        monthsShortRegex: /(?:['a-z\\u0101\\u014D\\u016B]+\\-?){1,3}/i,\n        monthsShortStrictRegex: /(?:['a-z\\u0101\\u014D\\u016B]+\\-?){1,2}/i,\n        weekdays: 'Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei'.split('_'),\n        weekdaysShort: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),\n        weekdaysMin: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY [i] HH:mm',\n            LLLL: 'dddd, D MMMM YYYY [i] HH:mm',\n        },\n        calendar: {\n            sameDay: '[i teie mahana, i] LT',\n            nextDay: '[apopo i] LT',\n            nextWeek: 'dddd [i] LT',\n            lastDay: '[inanahi i] LT',\n            lastWeek: 'dddd [whakamutunga i] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'i roto i %s',\n            past: '%s i mua',\n            s: 'te hēkona ruarua',\n            ss: '%d hēkona',\n            m: 'he meneti',\n            mm: '%d meneti',\n            h: 'te haora',\n            hh: '%d haora',\n            d: 'he ra',\n            dd: '%d ra',\n            M: 'he marama',\n            MM: '%d marama',\n            y: 'he tau',\n            yy: '%d tau',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return mi;\n\n})));\n","//! moment.js locale configuration\n//! locale : Macedonian [mk]\n//! author : Borislav Mickov : https://github.com/B0k0\n//! author : Sashko Todorov : https://github.com/bkyceh\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var mk = moment.defineLocale('mk', {\n        months: 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split(\n            '_'\n        ),\n        monthsShort: 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),\n        weekdays: 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split(\n            '_'\n        ),\n        weekdaysShort: 'нед_пон_вто_сре_чет_пет_саб'.split('_'),\n        weekdaysMin: 'нe_пo_вт_ср_че_пе_сa'.split('_'),\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'D.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY H:mm',\n            LLLL: 'dddd, D MMMM YYYY H:mm',\n        },\n        calendar: {\n            sameDay: '[Денес во] LT',\n            nextDay: '[Утре во] LT',\n            nextWeek: '[Во] dddd [во] LT',\n            lastDay: '[Вчера во] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                    case 3:\n                    case 6:\n                        return '[Изминатата] dddd [во] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[Изминатиот] dddd [во] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'за %s',\n            past: 'пред %s',\n            s: 'неколку секунди',\n            ss: '%d секунди',\n            m: 'една минута',\n            mm: '%d минути',\n            h: 'еден час',\n            hh: '%d часа',\n            d: 'еден ден',\n            dd: '%d дена',\n            M: 'еден месец',\n            MM: '%d месеци',\n            y: 'една година',\n            yy: '%d години',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-(ев|ен|ти|ви|ри|ми)/,\n        ordinal: function (number) {\n            var lastDigit = number % 10,\n                last2Digits = number % 100;\n            if (number === 0) {\n                return number + '-ев';\n            } else if (last2Digits === 0) {\n                return number + '-ен';\n            } else if (last2Digits > 10 && last2Digits < 20) {\n                return number + '-ти';\n            } else if (lastDigit === 1) {\n                return number + '-ви';\n            } else if (lastDigit === 2) {\n                return number + '-ри';\n            } else if (lastDigit === 7 || lastDigit === 8) {\n                return number + '-ми';\n            } else {\n                return number + '-ти';\n            }\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return mk;\n\n})));\n","//! moment.js locale configuration\n//! locale : Malayalam [ml]\n//! author : Floyd Pink : https://github.com/floydpink\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var ml = moment.defineLocale('ml', {\n        months: 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split(\n            '_'\n        ),\n        monthsShort:\n            'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays:\n            'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split(\n                '_'\n            ),\n        weekdaysShort: 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),\n        weekdaysMin: 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm -നു',\n            LTS: 'A h:mm:ss -നു',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, A h:mm -നു',\n            LLLL: 'dddd, D MMMM YYYY, A h:mm -നു',\n        },\n        calendar: {\n            sameDay: '[ഇന്ന്] LT',\n            nextDay: '[നാളെ] LT',\n            nextWeek: 'dddd, LT',\n            lastDay: '[ഇന്നലെ] LT',\n            lastWeek: '[കഴിഞ്ഞ] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s കഴിഞ്ഞ്',\n            past: '%s മുൻപ്',\n            s: 'അൽപ നിമിഷങ്ങൾ',\n            ss: '%d സെക്കൻഡ്',\n            m: 'ഒരു മിനിറ്റ്',\n            mm: '%d മിനിറ്റ്',\n            h: 'ഒരു മണിക്കൂർ',\n            hh: '%d മണിക്കൂർ',\n            d: 'ഒരു ദിവസം',\n            dd: '%d ദിവസം',\n            M: 'ഒരു മാസം',\n            MM: '%d മാസം',\n            y: 'ഒരു വർഷം',\n            yy: '%d വർഷം',\n        },\n        meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (\n                (meridiem === 'രാത്രി' && hour >= 4) ||\n                meridiem === 'ഉച്ച കഴിഞ്ഞ്' ||\n                meridiem === 'വൈകുന്നേരം'\n            ) {\n                return hour + 12;\n            } else {\n                return hour;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'രാത്രി';\n            } else if (hour < 12) {\n                return 'രാവിലെ';\n            } else if (hour < 17) {\n                return 'ഉച്ച കഴിഞ്ഞ്';\n            } else if (hour < 20) {\n                return 'വൈകുന്നേരം';\n            } else {\n                return 'രാത്രി';\n            }\n        },\n    });\n\n    return ml;\n\n})));\n","//! moment.js locale configuration\n//! locale : Mongolian [mn]\n//! author : Javkhlantugs Nyamdorj : https://github.com/javkhaanj7\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function translate(number, withoutSuffix, key, isFuture) {\n        switch (key) {\n            case 's':\n                return withoutSuffix ? 'хэдхэн секунд' : 'хэдхэн секундын';\n            case 'ss':\n                return number + (withoutSuffix ? ' секунд' : ' секундын');\n            case 'm':\n            case 'mm':\n                return number + (withoutSuffix ? ' минут' : ' минутын');\n            case 'h':\n            case 'hh':\n                return number + (withoutSuffix ? ' цаг' : ' цагийн');\n            case 'd':\n            case 'dd':\n                return number + (withoutSuffix ? ' өдөр' : ' өдрийн');\n            case 'M':\n            case 'MM':\n                return number + (withoutSuffix ? ' сар' : ' сарын');\n            case 'y':\n            case 'yy':\n                return number + (withoutSuffix ? ' жил' : ' жилийн');\n            default:\n                return number;\n        }\n    }\n\n    var mn = moment.defineLocale('mn', {\n        months: 'Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар'.split(\n            '_'\n        ),\n        monthsShort:\n            '1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба'.split('_'),\n        weekdaysShort: 'Ням_Дав_Мяг_Лха_Пүр_Баа_Бям'.split('_'),\n        weekdaysMin: 'Ня_Да_Мя_Лх_Пү_Ба_Бя'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY-MM-DD',\n            LL: 'YYYY оны MMMMын D',\n            LLL: 'YYYY оны MMMMын D HH:mm',\n            LLLL: 'dddd, YYYY оны MMMMын D HH:mm',\n        },\n        meridiemParse: /ҮӨ|ҮХ/i,\n        isPM: function (input) {\n            return input === 'ҮХ';\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ҮӨ';\n            } else {\n                return 'ҮХ';\n            }\n        },\n        calendar: {\n            sameDay: '[Өнөөдөр] LT',\n            nextDay: '[Маргааш] LT',\n            nextWeek: '[Ирэх] dddd LT',\n            lastDay: '[Өчигдөр] LT',\n            lastWeek: '[Өнгөрсөн] dddd LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s дараа',\n            past: '%s өмнө',\n            s: translate,\n            ss: translate,\n            m: translate,\n            mm: translate,\n            h: translate,\n            hh: translate,\n            d: translate,\n            dd: translate,\n            M: translate,\n            MM: translate,\n            y: translate,\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2} өдөр/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'd':\n                case 'D':\n                case 'DDD':\n                    return number + ' өдөр';\n                default:\n                    return number;\n            }\n        },\n    });\n\n    return mn;\n\n})));\n","//! moment.js locale configuration\n//! locale : Marathi [mr]\n//! author : Harshad Kale : https://github.com/kalehv\n//! author : Vivek Athalye : https://github.com/vnathalye\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '१',\n            2: '२',\n            3: '३',\n            4: '४',\n            5: '५',\n            6: '६',\n            7: '७',\n            8: '८',\n            9: '९',\n            0: '०',\n        },\n        numberMap = {\n            '१': '1',\n            '२': '2',\n            '३': '3',\n            '४': '4',\n            '५': '5',\n            '६': '6',\n            '७': '7',\n            '८': '8',\n            '९': '9',\n            '०': '0',\n        };\n\n    function relativeTimeMr(number, withoutSuffix, string, isFuture) {\n        var output = '';\n        if (withoutSuffix) {\n            switch (string) {\n                case 's':\n                    output = 'काही सेकंद';\n                    break;\n                case 'ss':\n                    output = '%d सेकंद';\n                    break;\n                case 'm':\n                    output = 'एक मिनिट';\n                    break;\n                case 'mm':\n                    output = '%d मिनिटे';\n                    break;\n                case 'h':\n                    output = 'एक तास';\n                    break;\n                case 'hh':\n                    output = '%d तास';\n                    break;\n                case 'd':\n                    output = 'एक दिवस';\n                    break;\n                case 'dd':\n                    output = '%d दिवस';\n                    break;\n                case 'M':\n                    output = 'एक महिना';\n                    break;\n                case 'MM':\n                    output = '%d महिने';\n                    break;\n                case 'y':\n                    output = 'एक वर्ष';\n                    break;\n                case 'yy':\n                    output = '%d वर्षे';\n                    break;\n            }\n        } else {\n            switch (string) {\n                case 's':\n                    output = 'काही सेकंदां';\n                    break;\n                case 'ss':\n                    output = '%d सेकंदां';\n                    break;\n                case 'm':\n                    output = 'एका मिनिटा';\n                    break;\n                case 'mm':\n                    output = '%d मिनिटां';\n                    break;\n                case 'h':\n                    output = 'एका तासा';\n                    break;\n                case 'hh':\n                    output = '%d तासां';\n                    break;\n                case 'd':\n                    output = 'एका दिवसा';\n                    break;\n                case 'dd':\n                    output = '%d दिवसां';\n                    break;\n                case 'M':\n                    output = 'एका महिन्या';\n                    break;\n                case 'MM':\n                    output = '%d महिन्यां';\n                    break;\n                case 'y':\n                    output = 'एका वर्षा';\n                    break;\n                case 'yy':\n                    output = '%d वर्षां';\n                    break;\n            }\n        }\n        return output.replace(/%d/i, number);\n    }\n\n    var mr = moment.defineLocale('mr', {\n        months: 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split(\n            '_'\n        ),\n        monthsShort:\n            'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),\n        weekdaysShort: 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),\n        weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm वाजता',\n            LTS: 'A h:mm:ss वाजता',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, A h:mm वाजता',\n            LLLL: 'dddd, D MMMM YYYY, A h:mm वाजता',\n        },\n        calendar: {\n            sameDay: '[आज] LT',\n            nextDay: '[उद्या] LT',\n            nextWeek: 'dddd, LT',\n            lastDay: '[काल] LT',\n            lastWeek: '[मागील] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%sमध्ये',\n            past: '%sपूर्वी',\n            s: relativeTimeMr,\n            ss: relativeTimeMr,\n            m: relativeTimeMr,\n            mm: relativeTimeMr,\n            h: relativeTimeMr,\n            hh: relativeTimeMr,\n            d: relativeTimeMr,\n            dd: relativeTimeMr,\n            M: relativeTimeMr,\n            MM: relativeTimeMr,\n            y: relativeTimeMr,\n            yy: relativeTimeMr,\n        },\n        preparse: function (string) {\n            return string.replace(/[१२३४५६७८९०]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        meridiemParse: /पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'पहाटे' || meridiem === 'सकाळी') {\n                return hour;\n            } else if (\n                meridiem === 'दुपारी' ||\n                meridiem === 'सायंकाळी' ||\n                meridiem === 'रात्री'\n            ) {\n                return hour >= 12 ? hour : hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour >= 0 && hour < 6) {\n                return 'पहाटे';\n            } else if (hour < 12) {\n                return 'सकाळी';\n            } else if (hour < 17) {\n                return 'दुपारी';\n            } else if (hour < 20) {\n                return 'सायंकाळी';\n            } else {\n                return 'रात्री';\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return mr;\n\n})));\n","//! moment.js locale configuration\n//! locale : Malay [ms-my]\n//! note : DEPRECATED, the correct one is [ms]\n//! author : Weldan Jamili : https://github.com/weldan\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var msMy = moment.defineLocale('ms-my', {\n        months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),\n        weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),\n        weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),\n        weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),\n        longDateFormat: {\n            LT: 'HH.mm',\n            LTS: 'HH.mm.ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY [pukul] HH.mm',\n            LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',\n        },\n        meridiemParse: /pagi|tengahari|petang|malam/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'pagi') {\n                return hour;\n            } else if (meridiem === 'tengahari') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === 'petang' || meridiem === 'malam') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hours, minutes, isLower) {\n            if (hours < 11) {\n                return 'pagi';\n            } else if (hours < 15) {\n                return 'tengahari';\n            } else if (hours < 19) {\n                return 'petang';\n            } else {\n                return 'malam';\n            }\n        },\n        calendar: {\n            sameDay: '[Hari ini pukul] LT',\n            nextDay: '[Esok pukul] LT',\n            nextWeek: 'dddd [pukul] LT',\n            lastDay: '[Kelmarin pukul] LT',\n            lastWeek: 'dddd [lepas pukul] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'dalam %s',\n            past: '%s yang lepas',\n            s: 'beberapa saat',\n            ss: '%d saat',\n            m: 'seminit',\n            mm: '%d minit',\n            h: 'sejam',\n            hh: '%d jam',\n            d: 'sehari',\n            dd: '%d hari',\n            M: 'sebulan',\n            MM: '%d bulan',\n            y: 'setahun',\n            yy: '%d tahun',\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return msMy;\n\n})));\n","//! moment.js locale configuration\n//! locale : Malay [ms]\n//! author : Weldan Jamili : https://github.com/weldan\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var ms = moment.defineLocale('ms', {\n        months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),\n        weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),\n        weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),\n        weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),\n        longDateFormat: {\n            LT: 'HH.mm',\n            LTS: 'HH.mm.ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY [pukul] HH.mm',\n            LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',\n        },\n        meridiemParse: /pagi|tengahari|petang|malam/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'pagi') {\n                return hour;\n            } else if (meridiem === 'tengahari') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === 'petang' || meridiem === 'malam') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hours, minutes, isLower) {\n            if (hours < 11) {\n                return 'pagi';\n            } else if (hours < 15) {\n                return 'tengahari';\n            } else if (hours < 19) {\n                return 'petang';\n            } else {\n                return 'malam';\n            }\n        },\n        calendar: {\n            sameDay: '[Hari ini pukul] LT',\n            nextDay: '[Esok pukul] LT',\n            nextWeek: 'dddd [pukul] LT',\n            lastDay: '[Kelmarin pukul] LT',\n            lastWeek: 'dddd [lepas pukul] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'dalam %s',\n            past: '%s yang lepas',\n            s: 'beberapa saat',\n            ss: '%d saat',\n            m: 'seminit',\n            mm: '%d minit',\n            h: 'sejam',\n            hh: '%d jam',\n            d: 'sehari',\n            dd: '%d hari',\n            M: 'sebulan',\n            MM: '%d bulan',\n            y: 'setahun',\n            yy: '%d tahun',\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return ms;\n\n})));\n","//! moment.js locale configuration\n//! locale : Maltese (Malta) [mt]\n//! author : Alessandro Maruccia : https://github.com/alesma\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var mt = moment.defineLocale('mt', {\n        months: 'Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ'.split('_'),\n        weekdays:\n            'Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt'.split(\n                '_'\n            ),\n        weekdaysShort: 'Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib'.split('_'),\n        weekdaysMin: 'Ħa_Tn_Tl_Er_Ħa_Ġi_Si'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Illum fil-]LT',\n            nextDay: '[Għada fil-]LT',\n            nextWeek: 'dddd [fil-]LT',\n            lastDay: '[Il-bieraħ fil-]LT',\n            lastWeek: 'dddd [li għadda] [fil-]LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'f’ %s',\n            past: '%s ilu',\n            s: 'ftit sekondi',\n            ss: '%d sekondi',\n            m: 'minuta',\n            mm: '%d minuti',\n            h: 'siegħa',\n            hh: '%d siegħat',\n            d: 'ġurnata',\n            dd: '%d ġranet',\n            M: 'xahar',\n            MM: '%d xhur',\n            y: 'sena',\n            yy: '%d sni',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return mt;\n\n})));\n","//! moment.js locale configuration\n//! locale : Burmese [my]\n//! author : Squar team, mysquar.com\n//! author : David Rossellat : https://github.com/gholadr\n//! author : Tin Aung Lin : https://github.com/thanyawzinmin\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '၁',\n            2: '၂',\n            3: '၃',\n            4: '၄',\n            5: '၅',\n            6: '၆',\n            7: '၇',\n            8: '၈',\n            9: '၉',\n            0: '၀',\n        },\n        numberMap = {\n            '၁': '1',\n            '၂': '2',\n            '၃': '3',\n            '၄': '4',\n            '၅': '5',\n            '၆': '6',\n            '၇': '7',\n            '၈': '8',\n            '၉': '9',\n            '၀': '0',\n        };\n\n    var my = moment.defineLocale('my', {\n        months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split(\n            '_'\n        ),\n        monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),\n        weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split(\n            '_'\n        ),\n        weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),\n        weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),\n\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[ယနေ.] LT [မှာ]',\n            nextDay: '[မနက်ဖြန်] LT [မှာ]',\n            nextWeek: 'dddd LT [မှာ]',\n            lastDay: '[မနေ.က] LT [မှာ]',\n            lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'လာမည့် %s မှာ',\n            past: 'လွန်ခဲ့သော %s က',\n            s: 'စက္ကန်.အနည်းငယ်',\n            ss: '%d စက္ကန့်',\n            m: 'တစ်မိနစ်',\n            mm: '%d မိနစ်',\n            h: 'တစ်နာရီ',\n            hh: '%d နာရီ',\n            d: 'တစ်ရက်',\n            dd: '%d ရက်',\n            M: 'တစ်လ',\n            MM: '%d လ',\n            y: 'တစ်နှစ်',\n            yy: '%d နှစ်',\n        },\n        preparse: function (string) {\n            return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return my;\n\n})));\n","//! moment.js locale configuration\n//! locale : Norwegian Bokmål [nb]\n//! authors : Espen Hovlandsdal : https://github.com/rexxars\n//!           Sigurd Gartmann : https://github.com/sigurdga\n//!           Stephen Ramthun : https://github.com/stephenramthun\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var nb = moment.defineLocale('nb', {\n        months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split(\n            '_'\n        ),\n        monthsShort:\n            'jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.'.split('_'),\n        monthsParseExact: true,\n        weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),\n        weekdaysShort: 'sø._ma._ti._on._to._fr._lø.'.split('_'),\n        weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY [kl.] HH:mm',\n            LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm',\n        },\n        calendar: {\n            sameDay: '[i dag kl.] LT',\n            nextDay: '[i morgen kl.] LT',\n            nextWeek: 'dddd [kl.] LT',\n            lastDay: '[i går kl.] LT',\n            lastWeek: '[forrige] dddd [kl.] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'om %s',\n            past: '%s siden',\n            s: 'noen sekunder',\n            ss: '%d sekunder',\n            m: 'ett minutt',\n            mm: '%d minutter',\n            h: 'en time',\n            hh: '%d timer',\n            d: 'en dag',\n            dd: '%d dager',\n            w: 'en uke',\n            ww: '%d uker',\n            M: 'en måned',\n            MM: '%d måneder',\n            y: 'ett år',\n            yy: '%d år',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return nb;\n\n})));\n","//! moment.js locale configuration\n//! locale : Nepalese [ne]\n//! author : suvash : https://github.com/suvash\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '१',\n            2: '२',\n            3: '३',\n            4: '४',\n            5: '५',\n            6: '६',\n            7: '७',\n            8: '८',\n            9: '९',\n            0: '०',\n        },\n        numberMap = {\n            '१': '1',\n            '२': '2',\n            '३': '3',\n            '४': '4',\n            '५': '5',\n            '६': '6',\n            '७': '7',\n            '८': '8',\n            '९': '9',\n            '०': '0',\n        };\n\n    var ne = moment.defineLocale('ne', {\n        months: 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split(\n            '_'\n        ),\n        monthsShort:\n            'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split(\n            '_'\n        ),\n        weekdaysShort: 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'),\n        weekdaysMin: 'आ._सो._मं._बु._बि._शु._श.'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'Aको h:mm बजे',\n            LTS: 'Aको h:mm:ss बजे',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, Aको h:mm बजे',\n            LLLL: 'dddd, D MMMM YYYY, Aको h:mm बजे',\n        },\n        preparse: function (string) {\n            return string.replace(/[१२३४५६७८९०]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        meridiemParse: /राति|बिहान|दिउँसो|साँझ/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'राति') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'बिहान') {\n                return hour;\n            } else if (meridiem === 'दिउँसो') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'साँझ') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 3) {\n                return 'राति';\n            } else if (hour < 12) {\n                return 'बिहान';\n            } else if (hour < 16) {\n                return 'दिउँसो';\n            } else if (hour < 20) {\n                return 'साँझ';\n            } else {\n                return 'राति';\n            }\n        },\n        calendar: {\n            sameDay: '[आज] LT',\n            nextDay: '[भोलि] LT',\n            nextWeek: '[आउँदो] dddd[,] LT',\n            lastDay: '[हिजो] LT',\n            lastWeek: '[गएको] dddd[,] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%sमा',\n            past: '%s अगाडि',\n            s: 'केही क्षण',\n            ss: '%d सेकेण्ड',\n            m: 'एक मिनेट',\n            mm: '%d मिनेट',\n            h: 'एक घण्टा',\n            hh: '%d घण्टा',\n            d: 'एक दिन',\n            dd: '%d दिन',\n            M: 'एक महिना',\n            MM: '%d महिना',\n            y: 'एक बर्ष',\n            yy: '%d बर्ष',\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return ne;\n\n})));\n","//! moment.js locale configuration\n//! locale : Dutch (Belgium) [nl-be]\n//! author : Joris Röling : https://github.com/jorisroling\n//! author : Jacob Middag : https://github.com/middagj\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var monthsShortWithDots =\n            'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),\n        monthsShortWithoutDots =\n            'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_'),\n        monthsParse = [\n            /^jan/i,\n            /^feb/i,\n            /^maart|mrt.?$/i,\n            /^apr/i,\n            /^mei$/i,\n            /^jun[i.]?$/i,\n            /^jul[i.]?$/i,\n            /^aug/i,\n            /^sep/i,\n            /^okt/i,\n            /^nov/i,\n            /^dec/i,\n        ],\n        monthsRegex =\n            /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\\.?|feb\\.?|mrt\\.?|apr\\.?|ju[nl]\\.?|aug\\.?|sep\\.?|okt\\.?|nov\\.?|dec\\.?)/i;\n\n    var nlBe = moment.defineLocale('nl-be', {\n        months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split(\n            '_'\n        ),\n        monthsShort: function (m, format) {\n            if (!m) {\n                return monthsShortWithDots;\n            } else if (/-MMM-/.test(format)) {\n                return monthsShortWithoutDots[m.month()];\n            } else {\n                return monthsShortWithDots[m.month()];\n            }\n        },\n\n        monthsRegex: monthsRegex,\n        monthsShortRegex: monthsRegex,\n        monthsStrictRegex:\n            /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,\n        monthsShortStrictRegex:\n            /^(jan\\.?|feb\\.?|mrt\\.?|apr\\.?|mei|ju[nl]\\.?|aug\\.?|sep\\.?|okt\\.?|nov\\.?|dec\\.?)/i,\n\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n\n        weekdays:\n            'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),\n        weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),\n        weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[vandaag om] LT',\n            nextDay: '[morgen om] LT',\n            nextWeek: 'dddd [om] LT',\n            lastDay: '[gisteren om] LT',\n            lastWeek: '[afgelopen] dddd [om] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'over %s',\n            past: '%s geleden',\n            s: 'een paar seconden',\n            ss: '%d seconden',\n            m: 'één minuut',\n            mm: '%d minuten',\n            h: 'één uur',\n            hh: '%d uur',\n            d: 'één dag',\n            dd: '%d dagen',\n            M: 'één maand',\n            MM: '%d maanden',\n            y: 'één jaar',\n            yy: '%d jaar',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(ste|de)/,\n        ordinal: function (number) {\n            return (\n                number +\n                (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')\n            );\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return nlBe;\n\n})));\n","//! moment.js locale configuration\n//! locale : Dutch [nl]\n//! author : Joris Röling : https://github.com/jorisroling\n//! author : Jacob Middag : https://github.com/middagj\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var monthsShortWithDots =\n            'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),\n        monthsShortWithoutDots =\n            'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_'),\n        monthsParse = [\n            /^jan/i,\n            /^feb/i,\n            /^maart|mrt.?$/i,\n            /^apr/i,\n            /^mei$/i,\n            /^jun[i.]?$/i,\n            /^jul[i.]?$/i,\n            /^aug/i,\n            /^sep/i,\n            /^okt/i,\n            /^nov/i,\n            /^dec/i,\n        ],\n        monthsRegex =\n            /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\\.?|feb\\.?|mrt\\.?|apr\\.?|ju[nl]\\.?|aug\\.?|sep\\.?|okt\\.?|nov\\.?|dec\\.?)/i;\n\n    var nl = moment.defineLocale('nl', {\n        months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split(\n            '_'\n        ),\n        monthsShort: function (m, format) {\n            if (!m) {\n                return monthsShortWithDots;\n            } else if (/-MMM-/.test(format)) {\n                return monthsShortWithoutDots[m.month()];\n            } else {\n                return monthsShortWithDots[m.month()];\n            }\n        },\n\n        monthsRegex: monthsRegex,\n        monthsShortRegex: monthsRegex,\n        monthsStrictRegex:\n            /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,\n        monthsShortStrictRegex:\n            /^(jan\\.?|feb\\.?|mrt\\.?|apr\\.?|mei|ju[nl]\\.?|aug\\.?|sep\\.?|okt\\.?|nov\\.?|dec\\.?)/i,\n\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n\n        weekdays:\n            'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),\n        weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),\n        weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD-MM-YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[vandaag om] LT',\n            nextDay: '[morgen om] LT',\n            nextWeek: 'dddd [om] LT',\n            lastDay: '[gisteren om] LT',\n            lastWeek: '[afgelopen] dddd [om] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'over %s',\n            past: '%s geleden',\n            s: 'een paar seconden',\n            ss: '%d seconden',\n            m: 'één minuut',\n            mm: '%d minuten',\n            h: 'één uur',\n            hh: '%d uur',\n            d: 'één dag',\n            dd: '%d dagen',\n            w: 'één week',\n            ww: '%d weken',\n            M: 'één maand',\n            MM: '%d maanden',\n            y: 'één jaar',\n            yy: '%d jaar',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(ste|de)/,\n        ordinal: function (number) {\n            return (\n                number +\n                (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')\n            );\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return nl;\n\n})));\n","//! moment.js locale configuration\n//! locale : Nynorsk [nn]\n//! authors : https://github.com/mechuwind\n//!           Stephen Ramthun : https://github.com/stephenramthun\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var nn = moment.defineLocale('nn', {\n        months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split(\n            '_'\n        ),\n        monthsShort:\n            'jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.'.split('_'),\n        monthsParseExact: true,\n        weekdays: 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),\n        weekdaysShort: 'su._må._ty._on._to._fr._lau.'.split('_'),\n        weekdaysMin: 'su_må_ty_on_to_fr_la'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY [kl.] H:mm',\n            LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm',\n        },\n        calendar: {\n            sameDay: '[I dag klokka] LT',\n            nextDay: '[I morgon klokka] LT',\n            nextWeek: 'dddd [klokka] LT',\n            lastDay: '[I går klokka] LT',\n            lastWeek: '[Føregåande] dddd [klokka] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'om %s',\n            past: '%s sidan',\n            s: 'nokre sekund',\n            ss: '%d sekund',\n            m: 'eit minutt',\n            mm: '%d minutt',\n            h: 'ein time',\n            hh: '%d timar',\n            d: 'ein dag',\n            dd: '%d dagar',\n            w: 'ei veke',\n            ww: '%d veker',\n            M: 'ein månad',\n            MM: '%d månader',\n            y: 'eit år',\n            yy: '%d år',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return nn;\n\n})));\n","//! moment.js locale configuration\n//! locale : Occitan, lengadocian dialecte [oc-lnc]\n//! author : Quentin PAGÈS : https://github.com/Quenty31\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var ocLnc = moment.defineLocale('oc-lnc', {\n        months: {\n            standalone:\n                'genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre'.split(\n                    '_'\n                ),\n            format: \"de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre\".split(\n                '_'\n            ),\n            isFormat: /D[oD]?(\\s)+MMMM/,\n        },\n        monthsShort:\n            'gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte'.split(\n            '_'\n        ),\n        weekdaysShort: 'dg._dl._dm._dc._dj._dv._ds.'.split('_'),\n        weekdaysMin: 'dg_dl_dm_dc_dj_dv_ds'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM [de] YYYY',\n            ll: 'D MMM YYYY',\n            LLL: 'D MMMM [de] YYYY [a] H:mm',\n            lll: 'D MMM YYYY, H:mm',\n            LLLL: 'dddd D MMMM [de] YYYY [a] H:mm',\n            llll: 'ddd D MMM YYYY, H:mm',\n        },\n        calendar: {\n            sameDay: '[uèi a] LT',\n            nextDay: '[deman a] LT',\n            nextWeek: 'dddd [a] LT',\n            lastDay: '[ièr a] LT',\n            lastWeek: 'dddd [passat a] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: \"d'aquí %s\",\n            past: 'fa %s',\n            s: 'unas segondas',\n            ss: '%d segondas',\n            m: 'una minuta',\n            mm: '%d minutas',\n            h: 'una ora',\n            hh: '%d oras',\n            d: 'un jorn',\n            dd: '%d jorns',\n            M: 'un mes',\n            MM: '%d meses',\n            y: 'un an',\n            yy: '%d ans',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(r|n|t|è|a)/,\n        ordinal: function (number, period) {\n            var output =\n                number === 1\n                    ? 'r'\n                    : number === 2\n                    ? 'n'\n                    : number === 3\n                    ? 'r'\n                    : number === 4\n                    ? 't'\n                    : 'è';\n            if (period === 'w' || period === 'W') {\n                output = 'a';\n            }\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4,\n        },\n    });\n\n    return ocLnc;\n\n})));\n","//! moment.js locale configuration\n//! locale : Punjabi (India) [pa-in]\n//! author : Harpreet Singh : https://github.com/harpreetkhalsagtbit\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '੧',\n            2: '੨',\n            3: '੩',\n            4: '੪',\n            5: '੫',\n            6: '੬',\n            7: '੭',\n            8: '੮',\n            9: '੯',\n            0: '੦',\n        },\n        numberMap = {\n            '੧': '1',\n            '੨': '2',\n            '੩': '3',\n            '੪': '4',\n            '੫': '5',\n            '੬': '6',\n            '੭': '7',\n            '੮': '8',\n            '੯': '9',\n            '੦': '0',\n        };\n\n    var paIn = moment.defineLocale('pa-in', {\n        // There are months name as per Nanakshahi Calendar but they are not used as rigidly in modern Punjabi.\n        months: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split(\n            '_'\n        ),\n        monthsShort:\n            'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split(\n                '_'\n            ),\n        weekdays: 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split(\n            '_'\n        ),\n        weekdaysShort: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),\n        weekdaysMin: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm ਵਜੇ',\n            LTS: 'A h:mm:ss ਵਜੇ',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, A h:mm ਵਜੇ',\n            LLLL: 'dddd, D MMMM YYYY, A h:mm ਵਜੇ',\n        },\n        calendar: {\n            sameDay: '[ਅਜ] LT',\n            nextDay: '[ਕਲ] LT',\n            nextWeek: '[ਅਗਲਾ] dddd, LT',\n            lastDay: '[ਕਲ] LT',\n            lastWeek: '[ਪਿਛਲੇ] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s ਵਿੱਚ',\n            past: '%s ਪਿਛਲੇ',\n            s: 'ਕੁਝ ਸਕਿੰਟ',\n            ss: '%d ਸਕਿੰਟ',\n            m: 'ਇਕ ਮਿੰਟ',\n            mm: '%d ਮਿੰਟ',\n            h: 'ਇੱਕ ਘੰਟਾ',\n            hh: '%d ਘੰਟੇ',\n            d: 'ਇੱਕ ਦਿਨ',\n            dd: '%d ਦਿਨ',\n            M: 'ਇੱਕ ਮਹੀਨਾ',\n            MM: '%d ਮਹੀਨੇ',\n            y: 'ਇੱਕ ਸਾਲ',\n            yy: '%d ਸਾਲ',\n        },\n        preparse: function (string) {\n            return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        // Punjabi notation for meridiems are quite fuzzy in practice. While there exists\n        // a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi.\n        meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'ਰਾਤ') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'ਸਵੇਰ') {\n                return hour;\n            } else if (meridiem === 'ਦੁਪਹਿਰ') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'ਸ਼ਾਮ') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'ਰਾਤ';\n            } else if (hour < 10) {\n                return 'ਸਵੇਰ';\n            } else if (hour < 17) {\n                return 'ਦੁਪਹਿਰ';\n            } else if (hour < 20) {\n                return 'ਸ਼ਾਮ';\n            } else {\n                return 'ਰਾਤ';\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return paIn;\n\n})));\n","//! moment.js locale configuration\n//! locale : Polish [pl]\n//! author : Rafal Hirsz : https://github.com/evoL\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var monthsNominative =\n            'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split(\n                '_'\n            ),\n        monthsSubjective =\n            'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split(\n                '_'\n            ),\n        monthsParse = [\n            /^sty/i,\n            /^lut/i,\n            /^mar/i,\n            /^kwi/i,\n            /^maj/i,\n            /^cze/i,\n            /^lip/i,\n            /^sie/i,\n            /^wrz/i,\n            /^paź/i,\n            /^lis/i,\n            /^gru/i,\n        ];\n    function plural(n) {\n        return n % 10 < 5 && n % 10 > 1 && ~~(n / 10) % 10 !== 1;\n    }\n    function translate(number, withoutSuffix, key) {\n        var result = number + ' ';\n        switch (key) {\n            case 'ss':\n                return result + (plural(number) ? 'sekundy' : 'sekund');\n            case 'm':\n                return withoutSuffix ? 'minuta' : 'minutę';\n            case 'mm':\n                return result + (plural(number) ? 'minuty' : 'minut');\n            case 'h':\n                return withoutSuffix ? 'godzina' : 'godzinę';\n            case 'hh':\n                return result + (plural(number) ? 'godziny' : 'godzin');\n            case 'ww':\n                return result + (plural(number) ? 'tygodnie' : 'tygodni');\n            case 'MM':\n                return result + (plural(number) ? 'miesiące' : 'miesięcy');\n            case 'yy':\n                return result + (plural(number) ? 'lata' : 'lat');\n        }\n    }\n\n    var pl = moment.defineLocale('pl', {\n        months: function (momentToFormat, format) {\n            if (!momentToFormat) {\n                return monthsNominative;\n            } else if (/D MMMM/.test(format)) {\n                return monthsSubjective[momentToFormat.month()];\n            } else {\n                return monthsNominative[momentToFormat.month()];\n            }\n        },\n        monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n        weekdays:\n            'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),\n        weekdaysShort: 'ndz_pon_wt_śr_czw_pt_sob'.split('_'),\n        weekdaysMin: 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Dziś o] LT',\n            nextDay: '[Jutro o] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[W niedzielę o] LT';\n\n                    case 2:\n                        return '[We wtorek o] LT';\n\n                    case 3:\n                        return '[W środę o] LT';\n\n                    case 6:\n                        return '[W sobotę o] LT';\n\n                    default:\n                        return '[W] dddd [o] LT';\n                }\n            },\n            lastDay: '[Wczoraj o] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[W zeszłą niedzielę o] LT';\n                    case 3:\n                        return '[W zeszłą środę o] LT';\n                    case 6:\n                        return '[W zeszłą sobotę o] LT';\n                    default:\n                        return '[W zeszły] dddd [o] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'za %s',\n            past: '%s temu',\n            s: 'kilka sekund',\n            ss: translate,\n            m: translate,\n            mm: translate,\n            h: translate,\n            hh: translate,\n            d: '1 dzień',\n            dd: '%d dni',\n            w: 'tydzień',\n            ww: translate,\n            M: 'miesiąc',\n            MM: translate,\n            y: 'rok',\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return pl;\n\n})));\n","//! moment.js locale configuration\n//! locale : Portuguese (Brazil) [pt-br]\n//! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var ptBr = moment.defineLocale('pt-br', {\n        months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split(\n            '_'\n        ),\n        monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),\n        weekdays:\n            'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split(\n                '_'\n            ),\n        weekdaysShort: 'dom_seg_ter_qua_qui_sex_sáb'.split('_'),\n        weekdaysMin: 'do_2ª_3ª_4ª_5ª_6ª_sá'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D [de] MMMM [de] YYYY',\n            LLL: 'D [de] MMMM [de] YYYY [às] HH:mm',\n            LLLL: 'dddd, D [de] MMMM [de] YYYY [às] HH:mm',\n        },\n        calendar: {\n            sameDay: '[Hoje às] LT',\n            nextDay: '[Amanhã às] LT',\n            nextWeek: 'dddd [às] LT',\n            lastDay: '[Ontem às] LT',\n            lastWeek: function () {\n                return this.day() === 0 || this.day() === 6\n                    ? '[Último] dddd [às] LT' // Saturday + Sunday\n                    : '[Última] dddd [às] LT'; // Monday - Friday\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'em %s',\n            past: 'há %s',\n            s: 'poucos segundos',\n            ss: '%d segundos',\n            m: 'um minuto',\n            mm: '%d minutos',\n            h: 'uma hora',\n            hh: '%d horas',\n            d: 'um dia',\n            dd: '%d dias',\n            M: 'um mês',\n            MM: '%d meses',\n            y: 'um ano',\n            yy: '%d anos',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        invalidDate: 'Data inválida',\n    });\n\n    return ptBr;\n\n})));\n","//! moment.js locale configuration\n//! locale : Portuguese [pt]\n//! author : Jefferson : https://github.com/jalex79\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var pt = moment.defineLocale('pt', {\n        months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split(\n            '_'\n        ),\n        monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),\n        weekdays:\n            'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split(\n                '_'\n            ),\n        weekdaysShort: 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),\n        weekdaysMin: 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D [de] MMMM [de] YYYY',\n            LLL: 'D [de] MMMM [de] YYYY HH:mm',\n            LLLL: 'dddd, D [de] MMMM [de] YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Hoje às] LT',\n            nextDay: '[Amanhã às] LT',\n            nextWeek: 'dddd [às] LT',\n            lastDay: '[Ontem às] LT',\n            lastWeek: function () {\n                return this.day() === 0 || this.day() === 6\n                    ? '[Último] dddd [às] LT' // Saturday + Sunday\n                    : '[Última] dddd [às] LT'; // Monday - Friday\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'em %s',\n            past: 'há %s',\n            s: 'segundos',\n            ss: '%d segundos',\n            m: 'um minuto',\n            mm: '%d minutos',\n            h: 'uma hora',\n            hh: '%d horas',\n            d: 'um dia',\n            dd: '%d dias',\n            w: 'uma semana',\n            ww: '%d semanas',\n            M: 'um mês',\n            MM: '%d meses',\n            y: 'um ano',\n            yy: '%d anos',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}º/,\n        ordinal: '%dº',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return pt;\n\n})));\n","//! moment.js locale configuration\n//! locale : Romanian [ro]\n//! author : Vlad Gurdiga : https://github.com/gurdiga\n//! author : Valentin Agachi : https://github.com/avaly\n//! author : Emanuel Cepoi : https://github.com/cepem\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function relativeTimeWithPlural(number, withoutSuffix, key) {\n        var format = {\n                ss: 'secunde',\n                mm: 'minute',\n                hh: 'ore',\n                dd: 'zile',\n                ww: 'săptămâni',\n                MM: 'luni',\n                yy: 'ani',\n            },\n            separator = ' ';\n        if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {\n            separator = ' de ';\n        }\n        return number + separator + format[key];\n    }\n\n    var ro = moment.defineLocale('ro', {\n        months: 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split(\n            '_'\n        ),\n        monthsShort:\n            'ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),\n        weekdaysShort: 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),\n        weekdaysMin: 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY H:mm',\n            LLLL: 'dddd, D MMMM YYYY H:mm',\n        },\n        calendar: {\n            sameDay: '[azi la] LT',\n            nextDay: '[mâine la] LT',\n            nextWeek: 'dddd [la] LT',\n            lastDay: '[ieri la] LT',\n            lastWeek: '[fosta] dddd [la] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'peste %s',\n            past: '%s în urmă',\n            s: 'câteva secunde',\n            ss: relativeTimeWithPlural,\n            m: 'un minut',\n            mm: relativeTimeWithPlural,\n            h: 'o oră',\n            hh: relativeTimeWithPlural,\n            d: 'o zi',\n            dd: relativeTimeWithPlural,\n            w: 'o săptămână',\n            ww: relativeTimeWithPlural,\n            M: 'o lună',\n            MM: relativeTimeWithPlural,\n            y: 'un an',\n            yy: relativeTimeWithPlural,\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return ro;\n\n})));\n","//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function plural(word, num) {\n        var forms = word.split('_');\n        return num % 10 === 1 && num % 100 !== 11\n            ? forms[0]\n            : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)\n            ? forms[1]\n            : forms[2];\n    }\n    function relativeTimeWithPlural(number, withoutSuffix, key) {\n        var format = {\n            ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',\n            mm: withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',\n            hh: 'час_часа_часов',\n            dd: 'день_дня_дней',\n            ww: 'неделя_недели_недель',\n            MM: 'месяц_месяца_месяцев',\n            yy: 'год_года_лет',\n        };\n        if (key === 'm') {\n            return withoutSuffix ? 'минута' : 'минуту';\n        } else {\n            return number + ' ' + plural(format[key], +number);\n        }\n    }\n    var monthsParse = [\n        /^янв/i,\n        /^фев/i,\n        /^мар/i,\n        /^апр/i,\n        /^ма[йя]/i,\n        /^июн/i,\n        /^июл/i,\n        /^авг/i,\n        /^сен/i,\n        /^окт/i,\n        /^ноя/i,\n        /^дек/i,\n    ];\n\n    // http://new.gramota.ru/spravka/rules/139-prop : § 103\n    // Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637\n    // CLDR data:          http://www.unicode.org/cldr/charts/28/summary/ru.html#1753\n    var ru = moment.defineLocale('ru', {\n        months: {\n            format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split(\n                '_'\n            ),\n            standalone:\n                'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split(\n                    '_'\n                ),\n        },\n        monthsShort: {\n            // по CLDR именно \"июл.\" и \"июн.\", но какой смысл менять букву на точку?\n            format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split(\n                '_'\n            ),\n            standalone:\n                'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split(\n                    '_'\n                ),\n        },\n        weekdays: {\n            standalone:\n                'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split(\n                    '_'\n                ),\n            format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split(\n                '_'\n            ),\n            isFormat: /\\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/,\n        },\n        weekdaysShort: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),\n        weekdaysMin: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),\n        monthsParse: monthsParse,\n        longMonthsParse: monthsParse,\n        shortMonthsParse: monthsParse,\n\n        // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки\n        monthsRegex:\n            /^(январ[ья]|янв\\.?|феврал[ья]|февр?\\.?|марта?|мар\\.?|апрел[ья]|апр\\.?|ма[йя]|июн[ья]|июн\\.?|июл[ья]|июл\\.?|августа?|авг\\.?|сентябр[ья]|сент?\\.?|октябр[ья]|окт\\.?|ноябр[ья]|нояб?\\.?|декабр[ья]|дек\\.?)/i,\n\n        // копия предыдущего\n        monthsShortRegex:\n            /^(январ[ья]|янв\\.?|феврал[ья]|февр?\\.?|марта?|мар\\.?|апрел[ья]|апр\\.?|ма[йя]|июн[ья]|июн\\.?|июл[ья]|июл\\.?|августа?|авг\\.?|сентябр[ья]|сент?\\.?|октябр[ья]|окт\\.?|ноябр[ья]|нояб?\\.?|декабр[ья]|дек\\.?)/i,\n\n        // полные названия с падежами\n        monthsStrictRegex:\n            /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,\n\n        // Выражение, которое соответствует только сокращённым формам\n        monthsShortStrictRegex:\n            /^(янв\\.|февр?\\.|мар[т.]|апр\\.|ма[яй]|июн[ья.]|июл[ья.]|авг\\.|сент?\\.|окт\\.|нояб?\\.|дек\\.)/i,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY г.',\n            LLL: 'D MMMM YYYY г., H:mm',\n            LLLL: 'dddd, D MMMM YYYY г., H:mm',\n        },\n        calendar: {\n            sameDay: '[Сегодня, в] LT',\n            nextDay: '[Завтра, в] LT',\n            lastDay: '[Вчера, в] LT',\n            nextWeek: function (now) {\n                if (now.week() !== this.week()) {\n                    switch (this.day()) {\n                        case 0:\n                            return '[В следующее] dddd, [в] LT';\n                        case 1:\n                        case 2:\n                        case 4:\n                            return '[В следующий] dddd, [в] LT';\n                        case 3:\n                        case 5:\n                        case 6:\n                            return '[В следующую] dddd, [в] LT';\n                    }\n                } else {\n                    if (this.day() === 2) {\n                        return '[Во] dddd, [в] LT';\n                    } else {\n                        return '[В] dddd, [в] LT';\n                    }\n                }\n            },\n            lastWeek: function (now) {\n                if (now.week() !== this.week()) {\n                    switch (this.day()) {\n                        case 0:\n                            return '[В прошлое] dddd, [в] LT';\n                        case 1:\n                        case 2:\n                        case 4:\n                            return '[В прошлый] dddd, [в] LT';\n                        case 3:\n                        case 5:\n                        case 6:\n                            return '[В прошлую] dddd, [в] LT';\n                    }\n                } else {\n                    if (this.day() === 2) {\n                        return '[Во] dddd, [в] LT';\n                    } else {\n                        return '[В] dddd, [в] LT';\n                    }\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'через %s',\n            past: '%s назад',\n            s: 'несколько секунд',\n            ss: relativeTimeWithPlural,\n            m: relativeTimeWithPlural,\n            mm: relativeTimeWithPlural,\n            h: 'час',\n            hh: relativeTimeWithPlural,\n            d: 'день',\n            dd: relativeTimeWithPlural,\n            w: 'неделя',\n            ww: relativeTimeWithPlural,\n            M: 'месяц',\n            MM: relativeTimeWithPlural,\n            y: 'год',\n            yy: relativeTimeWithPlural,\n        },\n        meridiemParse: /ночи|утра|дня|вечера/i,\n        isPM: function (input) {\n            return /^(дня|вечера)$/.test(input);\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'ночи';\n            } else if (hour < 12) {\n                return 'утра';\n            } else if (hour < 17) {\n                return 'дня';\n            } else {\n                return 'вечера';\n            }\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-(й|го|я)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'M':\n                case 'd':\n                case 'DDD':\n                    return number + '-й';\n                case 'D':\n                    return number + '-го';\n                case 'w':\n                case 'W':\n                    return number + '-я';\n                default:\n                    return number;\n            }\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return ru;\n\n})));\n","//! moment.js locale configuration\n//! locale : Sindhi [sd]\n//! author : Narain Sagar : https://github.com/narainsagar\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var months = [\n            'جنوري',\n            'فيبروري',\n            'مارچ',\n            'اپريل',\n            'مئي',\n            'جون',\n            'جولاءِ',\n            'آگسٽ',\n            'سيپٽمبر',\n            'آڪٽوبر',\n            'نومبر',\n            'ڊسمبر',\n        ],\n        days = ['آچر', 'سومر', 'اڱارو', 'اربع', 'خميس', 'جمع', 'ڇنڇر'];\n\n    var sd = moment.defineLocale('sd', {\n        months: months,\n        monthsShort: months,\n        weekdays: days,\n        weekdaysShort: days,\n        weekdaysMin: days,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd، D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /صبح|شام/,\n        isPM: function (input) {\n            return 'شام' === input;\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'صبح';\n            }\n            return 'شام';\n        },\n        calendar: {\n            sameDay: '[اڄ] LT',\n            nextDay: '[سڀاڻي] LT',\n            nextWeek: 'dddd [اڳين هفتي تي] LT',\n            lastDay: '[ڪالهه] LT',\n            lastWeek: '[گزريل هفتي] dddd [تي] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s پوء',\n            past: '%s اڳ',\n            s: 'چند سيڪنڊ',\n            ss: '%d سيڪنڊ',\n            m: 'هڪ منٽ',\n            mm: '%d منٽ',\n            h: 'هڪ ڪلاڪ',\n            hh: '%d ڪلاڪ',\n            d: 'هڪ ڏينهن',\n            dd: '%d ڏينهن',\n            M: 'هڪ مهينو',\n            MM: '%d مهينا',\n            y: 'هڪ سال',\n            yy: '%d سال',\n        },\n        preparse: function (string) {\n            return string.replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string.replace(/,/g, '،');\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return sd;\n\n})));\n","//! moment.js locale configuration\n//! locale : Northern Sami [se]\n//! authors : Bård Rolstad Henriksen : https://github.com/karamell\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var se = moment.defineLocale('se', {\n        months: 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split(\n            '_'\n        ),\n        monthsShort:\n            'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split('_'),\n        weekdays:\n            'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split(\n                '_'\n            ),\n        weekdaysShort: 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'),\n        weekdaysMin: 's_v_m_g_d_b_L'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'MMMM D. [b.] YYYY',\n            LLL: 'MMMM D. [b.] YYYY [ti.] HH:mm',\n            LLLL: 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm',\n        },\n        calendar: {\n            sameDay: '[otne ti] LT',\n            nextDay: '[ihttin ti] LT',\n            nextWeek: 'dddd [ti] LT',\n            lastDay: '[ikte ti] LT',\n            lastWeek: '[ovddit] dddd [ti] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s geažes',\n            past: 'maŋit %s',\n            s: 'moadde sekunddat',\n            ss: '%d sekunddat',\n            m: 'okta minuhta',\n            mm: '%d minuhtat',\n            h: 'okta diimmu',\n            hh: '%d diimmut',\n            d: 'okta beaivi',\n            dd: '%d beaivvit',\n            M: 'okta mánnu',\n            MM: '%d mánut',\n            y: 'okta jahki',\n            yy: '%d jagit',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return se;\n\n})));\n","//! moment.js locale configuration\n//! locale : Sinhalese [si]\n//! author : Sampath Sitinamaluwa : https://github.com/sampathsris\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    /*jshint -W100*/\n    var si = moment.defineLocale('si', {\n        months: 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split(\n            '_'\n        ),\n        monthsShort: 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split(\n            '_'\n        ),\n        weekdays:\n            'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split(\n                '_'\n            ),\n        weekdaysShort: 'ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන'.split('_'),\n        weekdaysMin: 'ඉ_ස_අ_බ_බ්‍ර_සි_සෙ'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'a h:mm',\n            LTS: 'a h:mm:ss',\n            L: 'YYYY/MM/DD',\n            LL: 'YYYY MMMM D',\n            LLL: 'YYYY MMMM D, a h:mm',\n            LLLL: 'YYYY MMMM D [වැනි] dddd, a h:mm:ss',\n        },\n        calendar: {\n            sameDay: '[අද] LT[ට]',\n            nextDay: '[හෙට] LT[ට]',\n            nextWeek: 'dddd LT[ට]',\n            lastDay: '[ඊයේ] LT[ට]',\n            lastWeek: '[පසුගිය] dddd LT[ට]',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%sකින්',\n            past: '%sකට පෙර',\n            s: 'තත්පර කිහිපය',\n            ss: 'තත්පර %d',\n            m: 'මිනිත්තුව',\n            mm: 'මිනිත්තු %d',\n            h: 'පැය',\n            hh: 'පැය %d',\n            d: 'දිනය',\n            dd: 'දින %d',\n            M: 'මාසය',\n            MM: 'මාස %d',\n            y: 'වසර',\n            yy: 'වසර %d',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2} වැනි/,\n        ordinal: function (number) {\n            return number + ' වැනි';\n        },\n        meridiemParse: /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,\n        isPM: function (input) {\n            return input === 'ප.ව.' || input === 'පස් වරු';\n        },\n        meridiem: function (hours, minutes, isLower) {\n            if (hours > 11) {\n                return isLower ? 'ප.ව.' : 'පස් වරු';\n            } else {\n                return isLower ? 'පෙ.ව.' : 'පෙර වරු';\n            }\n        },\n    });\n\n    return si;\n\n})));\n","//! moment.js locale configuration\n//! locale : Slovak [sk]\n//! author : Martin Minka : https://github.com/k2s\n//! based on work of petrbela : https://github.com/petrbela\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var months =\n            'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split(\n                '_'\n            ),\n        monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');\n    function plural(n) {\n        return n > 1 && n < 5;\n    }\n    function translate(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        switch (key) {\n            case 's': // a few seconds / in a few seconds / a few seconds ago\n                return withoutSuffix || isFuture ? 'pár sekúnd' : 'pár sekundami';\n            case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'sekundy' : 'sekúnd');\n                } else {\n                    return result + 'sekundami';\n                }\n            case 'm': // a minute / in a minute / a minute ago\n                return withoutSuffix ? 'minúta' : isFuture ? 'minútu' : 'minútou';\n            case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'minúty' : 'minút');\n                } else {\n                    return result + 'minútami';\n                }\n            case 'h': // an hour / in an hour / an hour ago\n                return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';\n            case 'hh': // 9 hours / in 9 hours / 9 hours ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'hodiny' : 'hodín');\n                } else {\n                    return result + 'hodinami';\n                }\n            case 'd': // a day / in a day / a day ago\n                return withoutSuffix || isFuture ? 'deň' : 'dňom';\n            case 'dd': // 9 days / in 9 days / 9 days ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'dni' : 'dní');\n                } else {\n                    return result + 'dňami';\n                }\n            case 'M': // a month / in a month / a month ago\n                return withoutSuffix || isFuture ? 'mesiac' : 'mesiacom';\n            case 'MM': // 9 months / in 9 months / 9 months ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'mesiace' : 'mesiacov');\n                } else {\n                    return result + 'mesiacmi';\n                }\n            case 'y': // a year / in a year / a year ago\n                return withoutSuffix || isFuture ? 'rok' : 'rokom';\n            case 'yy': // 9 years / in 9 years / 9 years ago\n                if (withoutSuffix || isFuture) {\n                    return result + (plural(number) ? 'roky' : 'rokov');\n                } else {\n                    return result + 'rokmi';\n                }\n        }\n    }\n\n    var sk = moment.defineLocale('sk', {\n        months: months,\n        monthsShort: monthsShort,\n        weekdays: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),\n        weekdaysShort: 'ne_po_ut_st_št_pi_so'.split('_'),\n        weekdaysMin: 'ne_po_ut_st_št_pi_so'.split('_'),\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY H:mm',\n            LLLL: 'dddd D. MMMM YYYY H:mm',\n        },\n        calendar: {\n            sameDay: '[dnes o] LT',\n            nextDay: '[zajtra o] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[v nedeľu o] LT';\n                    case 1:\n                    case 2:\n                        return '[v] dddd [o] LT';\n                    case 3:\n                        return '[v stredu o] LT';\n                    case 4:\n                        return '[vo štvrtok o] LT';\n                    case 5:\n                        return '[v piatok o] LT';\n                    case 6:\n                        return '[v sobotu o] LT';\n                }\n            },\n            lastDay: '[včera o] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[minulú nedeľu o] LT';\n                    case 1:\n                    case 2:\n                        return '[minulý] dddd [o] LT';\n                    case 3:\n                        return '[minulú stredu o] LT';\n                    case 4:\n                    case 5:\n                        return '[minulý] dddd [o] LT';\n                    case 6:\n                        return '[minulú sobotu o] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'za %s',\n            past: 'pred %s',\n            s: translate,\n            ss: translate,\n            m: translate,\n            mm: translate,\n            h: translate,\n            hh: translate,\n            d: translate,\n            dd: translate,\n            M: translate,\n            MM: translate,\n            y: translate,\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return sk;\n\n})));\n","//! moment.js locale configuration\n//! locale : Slovenian [sl]\n//! author : Robert Sedovšek : https://github.com/sedovsek\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var result = number + ' ';\n        switch (key) {\n            case 's':\n                return withoutSuffix || isFuture\n                    ? 'nekaj sekund'\n                    : 'nekaj sekundami';\n            case 'ss':\n                if (number === 1) {\n                    result += withoutSuffix ? 'sekundo' : 'sekundi';\n                } else if (number === 2) {\n                    result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n                } else if (number < 5) {\n                    result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n                } else {\n                    result += 'sekund';\n                }\n                return result;\n            case 'm':\n                return withoutSuffix ? 'ena minuta' : 'eno minuto';\n            case 'mm':\n                if (number === 1) {\n                    result += withoutSuffix ? 'minuta' : 'minuto';\n                } else if (number === 2) {\n                    result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n                } else if (number < 5) {\n                    result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n                } else {\n                    result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n                }\n                return result;\n            case 'h':\n                return withoutSuffix ? 'ena ura' : 'eno uro';\n            case 'hh':\n                if (number === 1) {\n                    result += withoutSuffix ? 'ura' : 'uro';\n                } else if (number === 2) {\n                    result += withoutSuffix || isFuture ? 'uri' : 'urama';\n                } else if (number < 5) {\n                    result += withoutSuffix || isFuture ? 'ure' : 'urami';\n                } else {\n                    result += withoutSuffix || isFuture ? 'ur' : 'urami';\n                }\n                return result;\n            case 'd':\n                return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n            case 'dd':\n                if (number === 1) {\n                    result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n                } else if (number === 2) {\n                    result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n                } else {\n                    result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n                }\n                return result;\n            case 'M':\n                return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n            case 'MM':\n                if (number === 1) {\n                    result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n                } else if (number === 2) {\n                    result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n                } else if (number < 5) {\n                    result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n                } else {\n                    result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n                }\n                return result;\n            case 'y':\n                return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n            case 'yy':\n                if (number === 1) {\n                    result += withoutSuffix || isFuture ? 'leto' : 'letom';\n                } else if (number === 2) {\n                    result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n                } else if (number < 5) {\n                    result += withoutSuffix || isFuture ? 'leta' : 'leti';\n                } else {\n                    result += withoutSuffix || isFuture ? 'let' : 'leti';\n                }\n                return result;\n        }\n    }\n\n    var sl = moment.defineLocale('sl', {\n        months: 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split(\n            '_'\n        ),\n        monthsShort:\n            'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),\n        weekdaysShort: 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),\n        weekdaysMin: 'ne_po_to_sr_če_pe_so'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD. MM. YYYY',\n            LL: 'D. MMMM YYYY',\n            LLL: 'D. MMMM YYYY H:mm',\n            LLLL: 'dddd, D. MMMM YYYY H:mm',\n        },\n        calendar: {\n            sameDay: '[danes ob] LT',\n            nextDay: '[jutri ob] LT',\n\n            nextWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[v] [nedeljo] [ob] LT';\n                    case 3:\n                        return '[v] [sredo] [ob] LT';\n                    case 6:\n                        return '[v] [soboto] [ob] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[v] dddd [ob] LT';\n                }\n            },\n            lastDay: '[včeraj ob] LT',\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[prejšnjo] [nedeljo] [ob] LT';\n                    case 3:\n                        return '[prejšnjo] [sredo] [ob] LT';\n                    case 6:\n                        return '[prejšnjo] [soboto] [ob] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[prejšnji] dddd [ob] LT';\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'čez %s',\n            past: 'pred %s',\n            s: processRelativeTime,\n            ss: processRelativeTime,\n            m: processRelativeTime,\n            mm: processRelativeTime,\n            h: processRelativeTime,\n            hh: processRelativeTime,\n            d: processRelativeTime,\n            dd: processRelativeTime,\n            M: processRelativeTime,\n            MM: processRelativeTime,\n            y: processRelativeTime,\n            yy: processRelativeTime,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return sl;\n\n})));\n","//! moment.js locale configuration\n//! locale : Albanian [sq]\n//! author : Flakërim Ismani : https://github.com/flakerimi\n//! author : Menelion Elensúle : https://github.com/Oire\n//! author : Oerd Cukalla : https://github.com/oerd\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var sq = moment.defineLocale('sq', {\n        months: 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),\n        weekdays: 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split(\n            '_'\n        ),\n        weekdaysShort: 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),\n        weekdaysMin: 'D_H_Ma_Më_E_P_Sh'.split('_'),\n        weekdaysParseExact: true,\n        meridiemParse: /PD|MD/,\n        isPM: function (input) {\n            return input.charAt(0) === 'M';\n        },\n        meridiem: function (hours, minutes, isLower) {\n            return hours < 12 ? 'PD' : 'MD';\n        },\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Sot në] LT',\n            nextDay: '[Nesër në] LT',\n            nextWeek: 'dddd [në] LT',\n            lastDay: '[Dje në] LT',\n            lastWeek: 'dddd [e kaluar në] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'në %s',\n            past: '%s më parë',\n            s: 'disa sekonda',\n            ss: '%d sekonda',\n            m: 'një minutë',\n            mm: '%d minuta',\n            h: 'një orë',\n            hh: '%d orë',\n            d: 'një ditë',\n            dd: '%d ditë',\n            M: 'një muaj',\n            MM: '%d muaj',\n            y: 'një vit',\n            yy: '%d vite',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return sq;\n\n})));\n","//! moment.js locale configuration\n//! locale : Serbian Cyrillic [sr-cyrl]\n//! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j\n//! author : Stefan Crnjaković <stefan@hotmail.rs> : https://github.com/crnjakovic\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var translator = {\n        words: {\n            //Different grammatical cases\n            ss: ['секунда', 'секунде', 'секунди'],\n            m: ['један минут', 'једног минута'],\n            mm: ['минут', 'минута', 'минута'],\n            h: ['један сат', 'једног сата'],\n            hh: ['сат', 'сата', 'сати'],\n            d: ['један дан', 'једног дана'],\n            dd: ['дан', 'дана', 'дана'],\n            M: ['један месец', 'једног месеца'],\n            MM: ['месец', 'месеца', 'месеци'],\n            y: ['једну годину', 'једне године'],\n            yy: ['годину', 'године', 'година'],\n        },\n        correctGrammaticalCase: function (number, wordKey) {\n            if (\n                number % 10 >= 1 &&\n                number % 10 <= 4 &&\n                (number % 100 < 10 || number % 100 >= 20)\n            ) {\n                return number % 10 === 1 ? wordKey[0] : wordKey[1];\n            }\n            return wordKey[2];\n        },\n        translate: function (number, withoutSuffix, key, isFuture) {\n            var wordKey = translator.words[key],\n                word;\n\n            if (key.length === 1) {\n                // Nominativ\n                if (key === 'y' && withoutSuffix) return 'једна година';\n                return isFuture || withoutSuffix ? wordKey[0] : wordKey[1];\n            }\n\n            word = translator.correctGrammaticalCase(number, wordKey);\n            // Nominativ\n            if (key === 'yy' && withoutSuffix && word === 'годину') {\n                return number + ' година';\n            }\n\n            return number + ' ' + word;\n        },\n    };\n\n    var srCyrl = moment.defineLocale('sr-cyrl', {\n        months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split(\n            '_'\n        ),\n        monthsShort:\n            'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split('_'),\n        monthsParseExact: true,\n        weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'),\n        weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'),\n        weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'D. M. YYYY.',\n            LL: 'D. MMMM YYYY.',\n            LLL: 'D. MMMM YYYY. H:mm',\n            LLLL: 'dddd, D. MMMM YYYY. H:mm',\n        },\n        calendar: {\n            sameDay: '[данас у] LT',\n            nextDay: '[сутра у] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[у] [недељу] [у] LT';\n                    case 3:\n                        return '[у] [среду] [у] LT';\n                    case 6:\n                        return '[у] [суботу] [у] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[у] dddd [у] LT';\n                }\n            },\n            lastDay: '[јуче у] LT',\n            lastWeek: function () {\n                var lastWeekDays = [\n                    '[прошле] [недеље] [у] LT',\n                    '[прошлог] [понедељка] [у] LT',\n                    '[прошлог] [уторка] [у] LT',\n                    '[прошле] [среде] [у] LT',\n                    '[прошлог] [четвртка] [у] LT',\n                    '[прошлог] [петка] [у] LT',\n                    '[прошле] [суботе] [у] LT',\n                ];\n                return lastWeekDays[this.day()];\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'за %s',\n            past: 'пре %s',\n            s: 'неколико секунди',\n            ss: translator.translate,\n            m: translator.translate,\n            mm: translator.translate,\n            h: translator.translate,\n            hh: translator.translate,\n            d: translator.translate,\n            dd: translator.translate,\n            M: translator.translate,\n            MM: translator.translate,\n            y: translator.translate,\n            yy: translator.translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 1st is the first week of the year.\n        },\n    });\n\n    return srCyrl;\n\n})));\n","//! moment.js locale configuration\n//! locale : Serbian [sr]\n//! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j\n//! author : Stefan Crnjaković <stefan@hotmail.rs> : https://github.com/crnjakovic\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var translator = {\n        words: {\n            //Different grammatical cases\n            ss: ['sekunda', 'sekunde', 'sekundi'],\n            m: ['jedan minut', 'jednog minuta'],\n            mm: ['minut', 'minuta', 'minuta'],\n            h: ['jedan sat', 'jednog sata'],\n            hh: ['sat', 'sata', 'sati'],\n            d: ['jedan dan', 'jednog dana'],\n            dd: ['dan', 'dana', 'dana'],\n            M: ['jedan mesec', 'jednog meseca'],\n            MM: ['mesec', 'meseca', 'meseci'],\n            y: ['jednu godinu', 'jedne godine'],\n            yy: ['godinu', 'godine', 'godina'],\n        },\n        correctGrammaticalCase: function (number, wordKey) {\n            if (\n                number % 10 >= 1 &&\n                number % 10 <= 4 &&\n                (number % 100 < 10 || number % 100 >= 20)\n            ) {\n                return number % 10 === 1 ? wordKey[0] : wordKey[1];\n            }\n            return wordKey[2];\n        },\n        translate: function (number, withoutSuffix, key, isFuture) {\n            var wordKey = translator.words[key],\n                word;\n\n            if (key.length === 1) {\n                // Nominativ\n                if (key === 'y' && withoutSuffix) return 'jedna godina';\n                return isFuture || withoutSuffix ? wordKey[0] : wordKey[1];\n            }\n\n            word = translator.correctGrammaticalCase(number, wordKey);\n            // Nominativ\n            if (key === 'yy' && withoutSuffix && word === 'godinu') {\n                return number + ' godina';\n            }\n\n            return number + ' ' + word;\n        },\n    };\n\n    var sr = moment.defineLocale('sr', {\n        months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(\n            '_'\n        ),\n        monthsShort:\n            'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),\n        monthsParseExact: true,\n        weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split(\n            '_'\n        ),\n        weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),\n        weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'D. M. YYYY.',\n            LL: 'D. MMMM YYYY.',\n            LLL: 'D. MMMM YYYY. H:mm',\n            LLLL: 'dddd, D. MMMM YYYY. H:mm',\n        },\n        calendar: {\n            sameDay: '[danas u] LT',\n            nextDay: '[sutra u] LT',\n            nextWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                        return '[u] [nedelju] [u] LT';\n                    case 3:\n                        return '[u] [sredu] [u] LT';\n                    case 6:\n                        return '[u] [subotu] [u] LT';\n                    case 1:\n                    case 2:\n                    case 4:\n                    case 5:\n                        return '[u] dddd [u] LT';\n                }\n            },\n            lastDay: '[juče u] LT',\n            lastWeek: function () {\n                var lastWeekDays = [\n                    '[prošle] [nedelje] [u] LT',\n                    '[prošlog] [ponedeljka] [u] LT',\n                    '[prošlog] [utorka] [u] LT',\n                    '[prošle] [srede] [u] LT',\n                    '[prošlog] [četvrtka] [u] LT',\n                    '[prošlog] [petka] [u] LT',\n                    '[prošle] [subote] [u] LT',\n                ];\n                return lastWeekDays[this.day()];\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'za %s',\n            past: 'pre %s',\n            s: 'nekoliko sekundi',\n            ss: translator.translate,\n            m: translator.translate,\n            mm: translator.translate,\n            h: translator.translate,\n            hh: translator.translate,\n            d: translator.translate,\n            dd: translator.translate,\n            M: translator.translate,\n            MM: translator.translate,\n            y: translator.translate,\n            yy: translator.translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return sr;\n\n})));\n","//! moment.js locale configuration\n//! locale : siSwati [ss]\n//! author : Nicolai Davies<mail@nicolai.io> : https://github.com/nicolaidavies\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var ss = moment.defineLocale('ss', {\n        months: \"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni\".split(\n            '_'\n        ),\n        monthsShort: 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'),\n        weekdays:\n            'Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo'.split(\n                '_'\n            ),\n        weekdaysShort: 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'),\n        weekdaysMin: 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'h:mm A',\n            LTS: 'h:mm:ss A',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY h:mm A',\n            LLLL: 'dddd, D MMMM YYYY h:mm A',\n        },\n        calendar: {\n            sameDay: '[Namuhla nga] LT',\n            nextDay: '[Kusasa nga] LT',\n            nextWeek: 'dddd [nga] LT',\n            lastDay: '[Itolo nga] LT',\n            lastWeek: 'dddd [leliphelile] [nga] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'nga %s',\n            past: 'wenteka nga %s',\n            s: 'emizuzwana lomcane',\n            ss: '%d mzuzwana',\n            m: 'umzuzu',\n            mm: '%d emizuzu',\n            h: 'lihora',\n            hh: '%d emahora',\n            d: 'lilanga',\n            dd: '%d emalanga',\n            M: 'inyanga',\n            MM: '%d tinyanga',\n            y: 'umnyaka',\n            yy: '%d iminyaka',\n        },\n        meridiemParse: /ekuseni|emini|entsambama|ebusuku/,\n        meridiem: function (hours, minutes, isLower) {\n            if (hours < 11) {\n                return 'ekuseni';\n            } else if (hours < 15) {\n                return 'emini';\n            } else if (hours < 19) {\n                return 'entsambama';\n            } else {\n                return 'ebusuku';\n            }\n        },\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'ekuseni') {\n                return hour;\n            } else if (meridiem === 'emini') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === 'entsambama' || meridiem === 'ebusuku') {\n                if (hour === 0) {\n                    return 0;\n                }\n                return hour + 12;\n            }\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}/,\n        ordinal: '%d',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return ss;\n\n})));\n","//! moment.js locale configuration\n//! locale : Swedish [sv]\n//! author : Jens Alm : https://github.com/ulmus\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var sv = moment.defineLocale('sv', {\n        months: 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split(\n            '_'\n        ),\n        monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),\n        weekdays: 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),\n        weekdaysShort: 'sön_mån_tis_ons_tor_fre_lör'.split('_'),\n        weekdaysMin: 'sö_må_ti_on_to_fr_lö'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY-MM-DD',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY [kl.] HH:mm',\n            LLLL: 'dddd D MMMM YYYY [kl.] HH:mm',\n            lll: 'D MMM YYYY HH:mm',\n            llll: 'ddd D MMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Idag] LT',\n            nextDay: '[Imorgon] LT',\n            lastDay: '[Igår] LT',\n            nextWeek: '[På] dddd LT',\n            lastWeek: '[I] dddd[s] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'om %s',\n            past: 'för %s sedan',\n            s: 'några sekunder',\n            ss: '%d sekunder',\n            m: 'en minut',\n            mm: '%d minuter',\n            h: 'en timme',\n            hh: '%d timmar',\n            d: 'en dag',\n            dd: '%d dagar',\n            M: 'en månad',\n            MM: '%d månader',\n            y: 'ett år',\n            yy: '%d år',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(\\:e|\\:a)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? ':e'\n                        : b === 1\n                        ? ':a'\n                        : b === 2\n                        ? ':a'\n                        : b === 3\n                        ? ':e'\n                        : ':e';\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return sv;\n\n})));\n","//! moment.js locale configuration\n//! locale : Swahili [sw]\n//! author : Fahad Kassim : https://github.com/fadsel\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var sw = moment.defineLocale('sw', {\n        months: 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'),\n        weekdays:\n            'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split(\n                '_'\n            ),\n        weekdaysShort: 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'),\n        weekdaysMin: 'J2_J3_J4_J5_Al_Ij_J1'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'hh:mm A',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[leo saa] LT',\n            nextDay: '[kesho saa] LT',\n            nextWeek: '[wiki ijayo] dddd [saat] LT',\n            lastDay: '[jana] LT',\n            lastWeek: '[wiki iliyopita] dddd [saat] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s baadaye',\n            past: 'tokea %s',\n            s: 'hivi punde',\n            ss: 'sekunde %d',\n            m: 'dakika moja',\n            mm: 'dakika %d',\n            h: 'saa limoja',\n            hh: 'masaa %d',\n            d: 'siku moja',\n            dd: 'siku %d',\n            M: 'mwezi mmoja',\n            MM: 'miezi %d',\n            y: 'mwaka mmoja',\n            yy: 'miaka %d',\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return sw;\n\n})));\n","//! moment.js locale configuration\n//! locale : Tamil [ta]\n//! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var symbolMap = {\n            1: '௧',\n            2: '௨',\n            3: '௩',\n            4: '௪',\n            5: '௫',\n            6: '௬',\n            7: '௭',\n            8: '௮',\n            9: '௯',\n            0: '௦',\n        },\n        numberMap = {\n            '௧': '1',\n            '௨': '2',\n            '௩': '3',\n            '௪': '4',\n            '௫': '5',\n            '௬': '6',\n            '௭': '7',\n            '௮': '8',\n            '௯': '9',\n            '௦': '0',\n        };\n\n    var ta = moment.defineLocale('ta', {\n        months: 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split(\n            '_'\n        ),\n        monthsShort:\n            'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split(\n                '_'\n            ),\n        weekdays:\n            'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split(\n                '_'\n            ),\n        weekdaysShort: 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split(\n            '_'\n        ),\n        weekdaysMin: 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, HH:mm',\n            LLLL: 'dddd, D MMMM YYYY, HH:mm',\n        },\n        calendar: {\n            sameDay: '[இன்று] LT',\n            nextDay: '[நாளை] LT',\n            nextWeek: 'dddd, LT',\n            lastDay: '[நேற்று] LT',\n            lastWeek: '[கடந்த வாரம்] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s இல்',\n            past: '%s முன்',\n            s: 'ஒரு சில விநாடிகள்',\n            ss: '%d விநாடிகள்',\n            m: 'ஒரு நிமிடம்',\n            mm: '%d நிமிடங்கள்',\n            h: 'ஒரு மணி நேரம்',\n            hh: '%d மணி நேரம்',\n            d: 'ஒரு நாள்',\n            dd: '%d நாட்கள்',\n            M: 'ஒரு மாதம்',\n            MM: '%d மாதங்கள்',\n            y: 'ஒரு வருடம்',\n            yy: '%d ஆண்டுகள்',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}வது/,\n        ordinal: function (number) {\n            return number + 'வது';\n        },\n        preparse: function (string) {\n            return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) {\n                return numberMap[match];\n            });\n        },\n        postformat: function (string) {\n            return string.replace(/\\d/g, function (match) {\n                return symbolMap[match];\n            });\n        },\n        // refer http://ta.wikipedia.org/s/1er1\n        meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 2) {\n                return ' யாமம்';\n            } else if (hour < 6) {\n                return ' வைகறை'; // வைகறை\n            } else if (hour < 10) {\n                return ' காலை'; // காலை\n            } else if (hour < 14) {\n                return ' நண்பகல்'; // நண்பகல்\n            } else if (hour < 18) {\n                return ' எற்பாடு'; // எற்பாடு\n            } else if (hour < 22) {\n                return ' மாலை'; // மாலை\n            } else {\n                return ' யாமம்';\n            }\n        },\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'யாமம்') {\n                return hour < 2 ? hour : hour + 12;\n            } else if (meridiem === 'வைகறை' || meridiem === 'காலை') {\n                return hour;\n            } else if (meridiem === 'நண்பகல்') {\n                return hour >= 10 ? hour : hour + 12;\n            } else {\n                return hour + 12;\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return ta;\n\n})));\n","//! moment.js locale configuration\n//! locale : Telugu [te]\n//! author : Krishna Chaitanya Thota : https://github.com/kcthota\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var te = moment.defineLocale('te', {\n        months: 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split(\n            '_'\n        ),\n        monthsShort:\n            'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays:\n            'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split(\n                '_'\n            ),\n        weekdaysShort: 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'),\n        weekdaysMin: 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'),\n        longDateFormat: {\n            LT: 'A h:mm',\n            LTS: 'A h:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY, A h:mm',\n            LLLL: 'dddd, D MMMM YYYY, A h:mm',\n        },\n        calendar: {\n            sameDay: '[నేడు] LT',\n            nextDay: '[రేపు] LT',\n            nextWeek: 'dddd, LT',\n            lastDay: '[నిన్న] LT',\n            lastWeek: '[గత] dddd, LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s లో',\n            past: '%s క్రితం',\n            s: 'కొన్ని క్షణాలు',\n            ss: '%d సెకన్లు',\n            m: 'ఒక నిమిషం',\n            mm: '%d నిమిషాలు',\n            h: 'ఒక గంట',\n            hh: '%d గంటలు',\n            d: 'ఒక రోజు',\n            dd: '%d రోజులు',\n            M: 'ఒక నెల',\n            MM: '%d నెలలు',\n            y: 'ఒక సంవత్సరం',\n            yy: '%d సంవత్సరాలు',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}వ/,\n        ordinal: '%dవ',\n        meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'రాత్రి') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'ఉదయం') {\n                return hour;\n            } else if (meridiem === 'మధ్యాహ్నం') {\n                return hour >= 10 ? hour : hour + 12;\n            } else if (meridiem === 'సాయంత్రం') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'రాత్రి';\n            } else if (hour < 10) {\n                return 'ఉదయం';\n            } else if (hour < 17) {\n                return 'మధ్యాహ్నం';\n            } else if (hour < 20) {\n                return 'సాయంత్రం';\n            } else {\n                return 'రాత్రి';\n            }\n        },\n        week: {\n            dow: 0, // Sunday is the first day of the week.\n            doy: 6, // The week that contains Jan 6th is the first week of the year.\n        },\n    });\n\n    return te;\n\n})));\n","//! moment.js locale configuration\n//! locale : Tetun Dili (East Timor) [tet]\n//! author : Joshua Brooks : https://github.com/joshbrooks\n//! author : Onorio De J. Afonso : https://github.com/marobo\n//! author : Sonia Simoes : https://github.com/soniasimoes\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var tet = moment.defineLocale('tet', {\n        months: 'Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),\n        weekdays: 'Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu'.split('_'),\n        weekdaysShort: 'Dom_Seg_Ters_Kua_Kint_Sest_Sab'.split('_'),\n        weekdaysMin: 'Do_Seg_Te_Ku_Ki_Ses_Sa'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Ohin iha] LT',\n            nextDay: '[Aban iha] LT',\n            nextWeek: 'dddd [iha] LT',\n            lastDay: '[Horiseik iha] LT',\n            lastWeek: 'dddd [semana kotuk] [iha] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'iha %s',\n            past: '%s liuba',\n            s: 'segundu balun',\n            ss: 'segundu %d',\n            m: 'minutu ida',\n            mm: 'minutu %d',\n            h: 'oras ida',\n            hh: 'oras %d',\n            d: 'loron ida',\n            dd: 'loron %d',\n            M: 'fulan ida',\n            MM: 'fulan %d',\n            y: 'tinan ida',\n            yy: 'tinan %d',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return tet;\n\n})));\n","//! moment.js locale configuration\n//! locale : Tajik [tg]\n//! author : Orif N. Jr. : https://github.com/orif-jr\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var suffixes = {\n        0: '-ум',\n        1: '-ум',\n        2: '-юм',\n        3: '-юм',\n        4: '-ум',\n        5: '-ум',\n        6: '-ум',\n        7: '-ум',\n        8: '-ум',\n        9: '-ум',\n        10: '-ум',\n        12: '-ум',\n        13: '-ум',\n        20: '-ум',\n        30: '-юм',\n        40: '-ум',\n        50: '-ум',\n        60: '-ум',\n        70: '-ум',\n        80: '-ум',\n        90: '-ум',\n        100: '-ум',\n    };\n\n    var tg = moment.defineLocale('tg', {\n        months: {\n            format: 'январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри'.split(\n                '_'\n            ),\n            standalone:\n                'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split(\n                    '_'\n                ),\n        },\n        monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),\n        weekdays: 'якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе'.split(\n            '_'\n        ),\n        weekdaysShort: 'яшб_дшб_сшб_чшб_пшб_ҷум_шнб'.split('_'),\n        weekdaysMin: 'яш_дш_сш_чш_пш_ҷм_шб'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Имрӯз соати] LT',\n            nextDay: '[Фардо соати] LT',\n            lastDay: '[Дирӯз соати] LT',\n            nextWeek: 'dddd[и] [ҳафтаи оянда соати] LT',\n            lastWeek: 'dddd[и] [ҳафтаи гузашта соати] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'баъди %s',\n            past: '%s пеш',\n            s: 'якчанд сония',\n            m: 'як дақиқа',\n            mm: '%d дақиқа',\n            h: 'як соат',\n            hh: '%d соат',\n            d: 'як рӯз',\n            dd: '%d рӯз',\n            M: 'як моҳ',\n            MM: '%d моҳ',\n            y: 'як сол',\n            yy: '%d сол',\n        },\n        meridiemParse: /шаб|субҳ|рӯз|бегоҳ/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === 'шаб') {\n                return hour < 4 ? hour : hour + 12;\n            } else if (meridiem === 'субҳ') {\n                return hour;\n            } else if (meridiem === 'рӯз') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === 'бегоҳ') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'шаб';\n            } else if (hour < 11) {\n                return 'субҳ';\n            } else if (hour < 16) {\n                return 'рӯз';\n            } else if (hour < 19) {\n                return 'бегоҳ';\n            } else {\n                return 'шаб';\n            }\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-(ум|юм)/,\n        ordinal: function (number) {\n            var a = number % 10,\n                b = number >= 100 ? 100 : null;\n            return number + (suffixes[number] || suffixes[a] || suffixes[b]);\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 1th is the first week of the year.\n        },\n    });\n\n    return tg;\n\n})));\n","//! moment.js locale configuration\n//! locale : Thai [th]\n//! author : Kridsada Thanabulpong : https://github.com/sirn\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var th = moment.defineLocale('th', {\n        months: 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split(\n            '_'\n        ),\n        monthsShort:\n            'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),\n        weekdaysShort: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference\n        weekdaysMin: 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'H:mm',\n            LTS: 'H:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY เวลา H:mm',\n            LLLL: 'วันddddที่ D MMMM YYYY เวลา H:mm',\n        },\n        meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,\n        isPM: function (input) {\n            return input === 'หลังเที่ยง';\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'ก่อนเที่ยง';\n            } else {\n                return 'หลังเที่ยง';\n            }\n        },\n        calendar: {\n            sameDay: '[วันนี้ เวลา] LT',\n            nextDay: '[พรุ่งนี้ เวลา] LT',\n            nextWeek: 'dddd[หน้า เวลา] LT',\n            lastDay: '[เมื่อวานนี้ เวลา] LT',\n            lastWeek: '[วัน]dddd[ที่แล้ว เวลา] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'อีก %s',\n            past: '%sที่แล้ว',\n            s: 'ไม่กี่วินาที',\n            ss: '%d วินาที',\n            m: '1 นาที',\n            mm: '%d นาที',\n            h: '1 ชั่วโมง',\n            hh: '%d ชั่วโมง',\n            d: '1 วัน',\n            dd: '%d วัน',\n            w: '1 สัปดาห์',\n            ww: '%d สัปดาห์',\n            M: '1 เดือน',\n            MM: '%d เดือน',\n            y: '1 ปี',\n            yy: '%d ปี',\n        },\n    });\n\n    return th;\n\n})));\n","//! moment.js locale configuration\n//! locale : Turkmen [tk]\n//! author : Atamyrat Abdyrahmanov : https://github.com/atamyratabdy\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var suffixes = {\n        1: \"'inji\",\n        5: \"'inji\",\n        8: \"'inji\",\n        70: \"'inji\",\n        80: \"'inji\",\n        2: \"'nji\",\n        7: \"'nji\",\n        20: \"'nji\",\n        50: \"'nji\",\n        3: \"'ünji\",\n        4: \"'ünji\",\n        100: \"'ünji\",\n        6: \"'njy\",\n        9: \"'unjy\",\n        10: \"'unjy\",\n        30: \"'unjy\",\n        60: \"'ynjy\",\n        90: \"'ynjy\",\n    };\n\n    var tk = moment.defineLocale('tk', {\n        months: 'Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr'.split(\n            '_'\n        ),\n        monthsShort: 'Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek'.split('_'),\n        weekdays: 'Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe'.split(\n            '_'\n        ),\n        weekdaysShort: 'Ýek_Duş_Siş_Çar_Pen_Ann_Şen'.split('_'),\n        weekdaysMin: 'Ýk_Dş_Sş_Çr_Pn_An_Şn'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[bugün sagat] LT',\n            nextDay: '[ertir sagat] LT',\n            nextWeek: '[indiki] dddd [sagat] LT',\n            lastDay: '[düýn] LT',\n            lastWeek: '[geçen] dddd [sagat] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s soň',\n            past: '%s öň',\n            s: 'birnäçe sekunt',\n            m: 'bir minut',\n            mm: '%d minut',\n            h: 'bir sagat',\n            hh: '%d sagat',\n            d: 'bir gün',\n            dd: '%d gün',\n            M: 'bir aý',\n            MM: '%d aý',\n            y: 'bir ýyl',\n            yy: '%d ýyl',\n        },\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'd':\n                case 'D':\n                case 'Do':\n                case 'DD':\n                    return number;\n                default:\n                    if (number === 0) {\n                        // special case for zero\n                        return number + \"'unjy\";\n                    }\n                    var a = number % 10,\n                        b = (number % 100) - a,\n                        c = number >= 100 ? 100 : null;\n                    return number + (suffixes[a] || suffixes[b] || suffixes[c]);\n            }\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return tk;\n\n})));\n","//! moment.js locale configuration\n//! locale : Tagalog (Philippines) [tl-ph]\n//! author : Dan Hagman : https://github.com/hagmandan\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var tlPh = moment.defineLocale('tl-ph', {\n        months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split(\n            '_'\n        ),\n        monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),\n        weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split(\n            '_'\n        ),\n        weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),\n        weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'MM/D/YYYY',\n            LL: 'MMMM D, YYYY',\n            LLL: 'MMMM D, YYYY HH:mm',\n            LLLL: 'dddd, MMMM DD, YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: 'LT [ngayong araw]',\n            nextDay: '[Bukas ng] LT',\n            nextWeek: 'LT [sa susunod na] dddd',\n            lastDay: 'LT [kahapon]',\n            lastWeek: 'LT [noong nakaraang] dddd',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'sa loob ng %s',\n            past: '%s ang nakalipas',\n            s: 'ilang segundo',\n            ss: '%d segundo',\n            m: 'isang minuto',\n            mm: '%d minuto',\n            h: 'isang oras',\n            hh: '%d oras',\n            d: 'isang araw',\n            dd: '%d araw',\n            M: 'isang buwan',\n            MM: '%d buwan',\n            y: 'isang taon',\n            yy: '%d taon',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}/,\n        ordinal: function (number) {\n            return number;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return tlPh;\n\n})));\n","//! moment.js locale configuration\n//! locale : Klingon [tlh]\n//! author : Dominika Kruk : https://github.com/amaranthrose\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_');\n\n    function translateFuture(output) {\n        var time = output;\n        time =\n            output.indexOf('jaj') !== -1\n                ? time.slice(0, -3) + 'leS'\n                : output.indexOf('jar') !== -1\n                ? time.slice(0, -3) + 'waQ'\n                : output.indexOf('DIS') !== -1\n                ? time.slice(0, -3) + 'nem'\n                : time + ' pIq';\n        return time;\n    }\n\n    function translatePast(output) {\n        var time = output;\n        time =\n            output.indexOf('jaj') !== -1\n                ? time.slice(0, -3) + 'Hu’'\n                : output.indexOf('jar') !== -1\n                ? time.slice(0, -3) + 'wen'\n                : output.indexOf('DIS') !== -1\n                ? time.slice(0, -3) + 'ben'\n                : time + ' ret';\n        return time;\n    }\n\n    function translate(number, withoutSuffix, string, isFuture) {\n        var numberNoun = numberAsNoun(number);\n        switch (string) {\n            case 'ss':\n                return numberNoun + ' lup';\n            case 'mm':\n                return numberNoun + ' tup';\n            case 'hh':\n                return numberNoun + ' rep';\n            case 'dd':\n                return numberNoun + ' jaj';\n            case 'MM':\n                return numberNoun + ' jar';\n            case 'yy':\n                return numberNoun + ' DIS';\n        }\n    }\n\n    function numberAsNoun(number) {\n        var hundred = Math.floor((number % 1000) / 100),\n            ten = Math.floor((number % 100) / 10),\n            one = number % 10,\n            word = '';\n        if (hundred > 0) {\n            word += numbersNouns[hundred] + 'vatlh';\n        }\n        if (ten > 0) {\n            word += (word !== '' ? ' ' : '') + numbersNouns[ten] + 'maH';\n        }\n        if (one > 0) {\n            word += (word !== '' ? ' ' : '') + numbersNouns[one];\n        }\n        return word === '' ? 'pagh' : word;\n    }\n\n    var tlh = moment.defineLocale('tlh', {\n        months: 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split(\n            '_'\n        ),\n        monthsShort:\n            'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split(\n            '_'\n        ),\n        weekdaysShort:\n            'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),\n        weekdaysMin:\n            'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[DaHjaj] LT',\n            nextDay: '[wa’leS] LT',\n            nextWeek: 'LLL',\n            lastDay: '[wa’Hu’] LT',\n            lastWeek: 'LLL',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: translateFuture,\n            past: translatePast,\n            s: 'puS lup',\n            ss: translate,\n            m: 'wa’ tup',\n            mm: translate,\n            h: 'wa’ rep',\n            hh: translate,\n            d: 'wa’ jaj',\n            dd: translate,\n            M: 'wa’ jar',\n            MM: translate,\n            y: 'wa’ DIS',\n            yy: translate,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return tlh;\n\n})));\n","//! moment.js locale configuration\n//! locale : Turkish [tr]\n//! authors : Erhan Gundogan : https://github.com/erhangundogan,\n//!           Burak Yiğit Kaya: https://github.com/BYK\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var suffixes = {\n        1: \"'inci\",\n        5: \"'inci\",\n        8: \"'inci\",\n        70: \"'inci\",\n        80: \"'inci\",\n        2: \"'nci\",\n        7: \"'nci\",\n        20: \"'nci\",\n        50: \"'nci\",\n        3: \"'üncü\",\n        4: \"'üncü\",\n        100: \"'üncü\",\n        6: \"'ncı\",\n        9: \"'uncu\",\n        10: \"'uncu\",\n        30: \"'uncu\",\n        60: \"'ıncı\",\n        90: \"'ıncı\",\n    };\n\n    var tr = moment.defineLocale('tr', {\n        months: 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split(\n            '_'\n        ),\n        monthsShort: 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),\n        weekdays: 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split(\n            '_'\n        ),\n        weekdaysShort: 'Paz_Pzt_Sal_Çar_Per_Cum_Cmt'.split('_'),\n        weekdaysMin: 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),\n        meridiem: function (hours, minutes, isLower) {\n            if (hours < 12) {\n                return isLower ? 'öö' : 'ÖÖ';\n            } else {\n                return isLower ? 'ös' : 'ÖS';\n            }\n        },\n        meridiemParse: /öö|ÖÖ|ös|ÖS/,\n        isPM: function (input) {\n            return input === 'ös' || input === 'ÖS';\n        },\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[bugün saat] LT',\n            nextDay: '[yarın saat] LT',\n            nextWeek: '[gelecek] dddd [saat] LT',\n            lastDay: '[dün] LT',\n            lastWeek: '[geçen] dddd [saat] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s sonra',\n            past: '%s önce',\n            s: 'birkaç saniye',\n            ss: '%d saniye',\n            m: 'bir dakika',\n            mm: '%d dakika',\n            h: 'bir saat',\n            hh: '%d saat',\n            d: 'bir gün',\n            dd: '%d gün',\n            w: 'bir hafta',\n            ww: '%d hafta',\n            M: 'bir ay',\n            MM: '%d ay',\n            y: 'bir yıl',\n            yy: '%d yıl',\n        },\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'd':\n                case 'D':\n                case 'Do':\n                case 'DD':\n                    return number;\n                default:\n                    if (number === 0) {\n                        // special case for zero\n                        return number + \"'ıncı\";\n                    }\n                    var a = number % 10,\n                        b = (number % 100) - a,\n                        c = number >= 100 ? 100 : null;\n                    return number + (suffixes[a] || suffixes[b] || suffixes[c]);\n            }\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return tr;\n\n})));\n","//! moment.js locale configuration\n//! locale : Talossan [tzl]\n//! author : Robin van der Vliet : https://github.com/robin0van0der0v\n//! author : Iustì Canun\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    // After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals.\n    // This is currently too difficult (maybe even impossible) to add.\n    var tzl = moment.defineLocale('tzl', {\n        months: 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split(\n            '_'\n        ),\n        monthsShort: 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'),\n        weekdays: 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'),\n        weekdaysShort: 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'),\n        weekdaysMin: 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'),\n        longDateFormat: {\n            LT: 'HH.mm',\n            LTS: 'HH.mm.ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D. MMMM [dallas] YYYY',\n            LLL: 'D. MMMM [dallas] YYYY HH.mm',\n            LLLL: 'dddd, [li] D. MMMM [dallas] YYYY HH.mm',\n        },\n        meridiemParse: /d\\'o|d\\'a/i,\n        isPM: function (input) {\n            return \"d'o\" === input.toLowerCase();\n        },\n        meridiem: function (hours, minutes, isLower) {\n            if (hours > 11) {\n                return isLower ? \"d'o\" : \"D'O\";\n            } else {\n                return isLower ? \"d'a\" : \"D'A\";\n            }\n        },\n        calendar: {\n            sameDay: '[oxhi à] LT',\n            nextDay: '[demà à] LT',\n            nextWeek: 'dddd [à] LT',\n            lastDay: '[ieiri à] LT',\n            lastWeek: '[sür el] dddd [lasteu à] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'osprei %s',\n            past: 'ja%s',\n            s: processRelativeTime,\n            ss: processRelativeTime,\n            m: processRelativeTime,\n            mm: processRelativeTime,\n            h: processRelativeTime,\n            hh: processRelativeTime,\n            d: processRelativeTime,\n            dd: processRelativeTime,\n            M: processRelativeTime,\n            MM: processRelativeTime,\n            y: processRelativeTime,\n            yy: processRelativeTime,\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n        ordinal: '%d.',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    function processRelativeTime(number, withoutSuffix, key, isFuture) {\n        var format = {\n            s: ['viensas secunds', \"'iensas secunds\"],\n            ss: [number + ' secunds', '' + number + ' secunds'],\n            m: [\"'n míut\", \"'iens míut\"],\n            mm: [number + ' míuts', '' + number + ' míuts'],\n            h: [\"'n þora\", \"'iensa þora\"],\n            hh: [number + ' þoras', '' + number + ' þoras'],\n            d: [\"'n ziua\", \"'iensa ziua\"],\n            dd: [number + ' ziuas', '' + number + ' ziuas'],\n            M: [\"'n mes\", \"'iens mes\"],\n            MM: [number + ' mesen', '' + number + ' mesen'],\n            y: [\"'n ar\", \"'iens ar\"],\n            yy: [number + ' ars', '' + number + ' ars'],\n        };\n        return isFuture\n            ? format[key][0]\n            : withoutSuffix\n            ? format[key][0]\n            : format[key][1];\n    }\n\n    return tzl;\n\n})));\n","//! moment.js locale configuration\n//! locale : Central Atlas Tamazight Latin [tzm-latn]\n//! author : Abdel Said : https://github.com/abdelsaid\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var tzmLatn = moment.defineLocale('tzm-latn', {\n        months: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split(\n            '_'\n        ),\n        monthsShort:\n            'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split(\n                '_'\n            ),\n        weekdays: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n        weekdaysShort: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n        weekdaysMin: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[asdkh g] LT',\n            nextDay: '[aska g] LT',\n            nextWeek: 'dddd [g] LT',\n            lastDay: '[assant g] LT',\n            lastWeek: 'dddd [g] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'dadkh s yan %s',\n            past: 'yan %s',\n            s: 'imik',\n            ss: '%d imik',\n            m: 'minuḍ',\n            mm: '%d minuḍ',\n            h: 'saɛa',\n            hh: '%d tassaɛin',\n            d: 'ass',\n            dd: '%d ossan',\n            M: 'ayowr',\n            MM: '%d iyyirn',\n            y: 'asgas',\n            yy: '%d isgasn',\n        },\n        week: {\n            dow: 6, // Saturday is the first day of the week.\n            doy: 12, // The week that contains Jan 12th is the first week of the year.\n        },\n    });\n\n    return tzmLatn;\n\n})));\n","//! moment.js locale configuration\n//! locale : Central Atlas Tamazight [tzm]\n//! author : Abdel Said : https://github.com/abdelsaid\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var tzm = moment.defineLocale('tzm', {\n        months: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split(\n            '_'\n        ),\n        monthsShort:\n            'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split(\n                '_'\n            ),\n        weekdays: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n        weekdaysShort: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n        weekdaysMin: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[ⴰⵙⴷⵅ ⴴ] LT',\n            nextDay: '[ⴰⵙⴽⴰ ⴴ] LT',\n            nextWeek: 'dddd [ⴴ] LT',\n            lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT',\n            lastWeek: 'dddd [ⴴ] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',\n            past: 'ⵢⴰⵏ %s',\n            s: 'ⵉⵎⵉⴽ',\n            ss: '%d ⵉⵎⵉⴽ',\n            m: 'ⵎⵉⵏⵓⴺ',\n            mm: '%d ⵎⵉⵏⵓⴺ',\n            h: 'ⵙⴰⵄⴰ',\n            hh: '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',\n            d: 'ⴰⵙⵙ',\n            dd: '%d oⵙⵙⴰⵏ',\n            M: 'ⴰⵢoⵓⵔ',\n            MM: '%d ⵉⵢⵢⵉⵔⵏ',\n            y: 'ⴰⵙⴳⴰⵙ',\n            yy: '%d ⵉⵙⴳⴰⵙⵏ',\n        },\n        week: {\n            dow: 6, // Saturday is the first day of the week.\n            doy: 12, // The week that contains Jan 12th is the first week of the year.\n        },\n    });\n\n    return tzm;\n\n})));\n","//! moment.js locale configuration\n//! locale : Uyghur (China) [ug-cn]\n//! author: boyaq : https://github.com/boyaq\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var ugCn = moment.defineLocale('ug-cn', {\n        months: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split(\n            '_'\n        ),\n        monthsShort:\n            'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split(\n                '_'\n            ),\n        weekdays: 'يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە'.split(\n            '_'\n        ),\n        weekdaysShort: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),\n        weekdaysMin: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY-MM-DD',\n            LL: 'YYYY-يىلىM-ئاينىڭD-كۈنى',\n            LLL: 'YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm',\n            LLLL: 'dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm',\n        },\n        meridiemParse: /يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (\n                meridiem === 'يېرىم كېچە' ||\n                meridiem === 'سەھەر' ||\n                meridiem === 'چۈشتىن بۇرۇن'\n            ) {\n                return hour;\n            } else if (meridiem === 'چۈشتىن كېيىن' || meridiem === 'كەچ') {\n                return hour + 12;\n            } else {\n                return hour >= 11 ? hour : hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            var hm = hour * 100 + minute;\n            if (hm < 600) {\n                return 'يېرىم كېچە';\n            } else if (hm < 900) {\n                return 'سەھەر';\n            } else if (hm < 1130) {\n                return 'چۈشتىن بۇرۇن';\n            } else if (hm < 1230) {\n                return 'چۈش';\n            } else if (hm < 1800) {\n                return 'چۈشتىن كېيىن';\n            } else {\n                return 'كەچ';\n            }\n        },\n        calendar: {\n            sameDay: '[بۈگۈن سائەت] LT',\n            nextDay: '[ئەتە سائەت] LT',\n            nextWeek: '[كېلەركى] dddd [سائەت] LT',\n            lastDay: '[تۆنۈگۈن] LT',\n            lastWeek: '[ئالدىنقى] dddd [سائەت] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s كېيىن',\n            past: '%s بۇرۇن',\n            s: 'نەچچە سېكونت',\n            ss: '%d سېكونت',\n            m: 'بىر مىنۇت',\n            mm: '%d مىنۇت',\n            h: 'بىر سائەت',\n            hh: '%d سائەت',\n            d: 'بىر كۈن',\n            dd: '%d كۈن',\n            M: 'بىر ئاي',\n            MM: '%d ئاي',\n            y: 'بىر يىل',\n            yy: '%d يىل',\n        },\n\n        dayOfMonthOrdinalParse: /\\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'd':\n                case 'D':\n                case 'DDD':\n                    return number + '-كۈنى';\n                case 'w':\n                case 'W':\n                    return number + '-ھەپتە';\n                default:\n                    return number;\n            }\n        },\n        preparse: function (string) {\n            return string.replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string.replace(/,/g, '،');\n        },\n        week: {\n            // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 1st is the first week of the year.\n        },\n    });\n\n    return ugCn;\n\n})));\n","//! moment.js locale configuration\n//! locale : Ukrainian [uk]\n//! author : zemlanin : https://github.com/zemlanin\n//! Author : Menelion Elensúle : https://github.com/Oire\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    function plural(word, num) {\n        var forms = word.split('_');\n        return num % 10 === 1 && num % 100 !== 11\n            ? forms[0]\n            : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)\n            ? forms[1]\n            : forms[2];\n    }\n    function relativeTimeWithPlural(number, withoutSuffix, key) {\n        var format = {\n            ss: withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд',\n            mm: withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',\n            hh: withoutSuffix ? 'година_години_годин' : 'годину_години_годин',\n            dd: 'день_дні_днів',\n            MM: 'місяць_місяці_місяців',\n            yy: 'рік_роки_років',\n        };\n        if (key === 'm') {\n            return withoutSuffix ? 'хвилина' : 'хвилину';\n        } else if (key === 'h') {\n            return withoutSuffix ? 'година' : 'годину';\n        } else {\n            return number + ' ' + plural(format[key], +number);\n        }\n    }\n    function weekdaysCaseReplace(m, format) {\n        var weekdays = {\n                nominative:\n                    'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split(\n                        '_'\n                    ),\n                accusative:\n                    'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split(\n                        '_'\n                    ),\n                genitive:\n                    'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split(\n                        '_'\n                    ),\n            },\n            nounCase;\n\n        if (m === true) {\n            return weekdays['nominative']\n                .slice(1, 7)\n                .concat(weekdays['nominative'].slice(0, 1));\n        }\n        if (!m) {\n            return weekdays['nominative'];\n        }\n\n        nounCase = /(\\[[ВвУу]\\]) ?dddd/.test(format)\n            ? 'accusative'\n            : /\\[?(?:минулої|наступної)? ?\\] ?dddd/.test(format)\n            ? 'genitive'\n            : 'nominative';\n        return weekdays[nounCase][m.day()];\n    }\n    function processHoursFunction(str) {\n        return function () {\n            return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';\n        };\n    }\n\n    var uk = moment.defineLocale('uk', {\n        months: {\n            format: 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split(\n                '_'\n            ),\n            standalone:\n                'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split(\n                    '_'\n                ),\n        },\n        monthsShort: 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split(\n            '_'\n        ),\n        weekdays: weekdaysCaseReplace,\n        weekdaysShort: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n        weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD.MM.YYYY',\n            LL: 'D MMMM YYYY р.',\n            LLL: 'D MMMM YYYY р., HH:mm',\n            LLLL: 'dddd, D MMMM YYYY р., HH:mm',\n        },\n        calendar: {\n            sameDay: processHoursFunction('[Сьогодні '),\n            nextDay: processHoursFunction('[Завтра '),\n            lastDay: processHoursFunction('[Вчора '),\n            nextWeek: processHoursFunction('[У] dddd ['),\n            lastWeek: function () {\n                switch (this.day()) {\n                    case 0:\n                    case 3:\n                    case 5:\n                    case 6:\n                        return processHoursFunction('[Минулої] dddd [').call(this);\n                    case 1:\n                    case 2:\n                    case 4:\n                        return processHoursFunction('[Минулого] dddd [').call(this);\n                }\n            },\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'за %s',\n            past: '%s тому',\n            s: 'декілька секунд',\n            ss: relativeTimeWithPlural,\n            m: relativeTimeWithPlural,\n            mm: relativeTimeWithPlural,\n            h: 'годину',\n            hh: relativeTimeWithPlural,\n            d: 'день',\n            dd: relativeTimeWithPlural,\n            M: 'місяць',\n            MM: relativeTimeWithPlural,\n            y: 'рік',\n            yy: relativeTimeWithPlural,\n        },\n        // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason\n        meridiemParse: /ночі|ранку|дня|вечора/,\n        isPM: function (input) {\n            return /^(дня|вечора)$/.test(input);\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 4) {\n                return 'ночі';\n            } else if (hour < 12) {\n                return 'ранку';\n            } else if (hour < 17) {\n                return 'дня';\n            } else {\n                return 'вечора';\n            }\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}-(й|го)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'M':\n                case 'd':\n                case 'DDD':\n                case 'w':\n                case 'W':\n                    return number + '-й';\n                case 'D':\n                    return number + '-го';\n                default:\n                    return number;\n            }\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return uk;\n\n})));\n","//! moment.js locale configuration\n//! locale : Urdu [ur]\n//! author : Sawood Alam : https://github.com/ibnesayeed\n//! author : Zack : https://github.com/ZackVision\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var months = [\n            'جنوری',\n            'فروری',\n            'مارچ',\n            'اپریل',\n            'مئی',\n            'جون',\n            'جولائی',\n            'اگست',\n            'ستمبر',\n            'اکتوبر',\n            'نومبر',\n            'دسمبر',\n        ],\n        days = ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'ہفتہ'];\n\n    var ur = moment.defineLocale('ur', {\n        months: months,\n        monthsShort: months,\n        weekdays: days,\n        weekdaysShort: days,\n        weekdaysMin: days,\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd، D MMMM YYYY HH:mm',\n        },\n        meridiemParse: /صبح|شام/,\n        isPM: function (input) {\n            return 'شام' === input;\n        },\n        meridiem: function (hour, minute, isLower) {\n            if (hour < 12) {\n                return 'صبح';\n            }\n            return 'شام';\n        },\n        calendar: {\n            sameDay: '[آج بوقت] LT',\n            nextDay: '[کل بوقت] LT',\n            nextWeek: 'dddd [بوقت] LT',\n            lastDay: '[گذشتہ روز بوقت] LT',\n            lastWeek: '[گذشتہ] dddd [بوقت] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s بعد',\n            past: '%s قبل',\n            s: 'چند سیکنڈ',\n            ss: '%d سیکنڈ',\n            m: 'ایک منٹ',\n            mm: '%d منٹ',\n            h: 'ایک گھنٹہ',\n            hh: '%d گھنٹے',\n            d: 'ایک دن',\n            dd: '%d دن',\n            M: 'ایک ماہ',\n            MM: '%d ماہ',\n            y: 'ایک سال',\n            yy: '%d سال',\n        },\n        preparse: function (string) {\n            return string.replace(/،/g, ',');\n        },\n        postformat: function (string) {\n            return string.replace(/,/g, '،');\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return ur;\n\n})));\n","//! moment.js locale configuration\n//! locale : Uzbek Latin [uz-latn]\n//! author : Rasulbek Mirzayev : github.com/Rasulbeeek\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var uzLatn = moment.defineLocale('uz-latn', {\n        months: 'Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr'.split(\n            '_'\n        ),\n        monthsShort: 'Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek'.split('_'),\n        weekdays:\n            'Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba'.split(\n                '_'\n            ),\n        weekdaysShort: 'Yak_Dush_Sesh_Chor_Pay_Jum_Shan'.split('_'),\n        weekdaysMin: 'Ya_Du_Se_Cho_Pa_Ju_Sha'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'D MMMM YYYY, dddd HH:mm',\n        },\n        calendar: {\n            sameDay: '[Bugun soat] LT [da]',\n            nextDay: '[Ertaga] LT [da]',\n            nextWeek: 'dddd [kuni soat] LT [da]',\n            lastDay: '[Kecha soat] LT [da]',\n            lastWeek: \"[O'tgan] dddd [kuni soat] LT [da]\",\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'Yaqin %s ichida',\n            past: 'Bir necha %s oldin',\n            s: 'soniya',\n            ss: '%d soniya',\n            m: 'bir daqiqa',\n            mm: '%d daqiqa',\n            h: 'bir soat',\n            hh: '%d soat',\n            d: 'bir kun',\n            dd: '%d kun',\n            M: 'bir oy',\n            MM: '%d oy',\n            y: 'bir yil',\n            yy: '%d yil',\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 7th is the first week of the year.\n        },\n    });\n\n    return uzLatn;\n\n})));\n","//! moment.js locale configuration\n//! locale : Uzbek [uz]\n//! author : Sardor Muminov : https://github.com/muminoff\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var uz = moment.defineLocale('uz', {\n        months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split(\n            '_'\n        ),\n        monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),\n        weekdays: 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),\n        weekdaysShort: 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),\n        weekdaysMin: 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'D MMMM YYYY, dddd HH:mm',\n        },\n        calendar: {\n            sameDay: '[Бугун соат] LT [да]',\n            nextDay: '[Эртага] LT [да]',\n            nextWeek: 'dddd [куни соат] LT [да]',\n            lastDay: '[Кеча соат] LT [да]',\n            lastWeek: '[Утган] dddd [куни соат] LT [да]',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'Якин %s ичида',\n            past: 'Бир неча %s олдин',\n            s: 'фурсат',\n            ss: '%d фурсат',\n            m: 'бир дакика',\n            mm: '%d дакика',\n            h: 'бир соат',\n            hh: '%d соат',\n            d: 'бир кун',\n            dd: '%d кун',\n            M: 'бир ой',\n            MM: '%d ой',\n            y: 'бир йил',\n            yy: '%d йил',\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 7, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return uz;\n\n})));\n","//! moment.js locale configuration\n//! locale : Vietnamese [vi]\n//! author : Bang Nguyen : https://github.com/bangnk\n//! author : Chien Kira : https://github.com/chienkira\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var vi = moment.defineLocale('vi', {\n        months: 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split(\n            '_'\n        ),\n        monthsShort:\n            'Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays: 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split(\n            '_'\n        ),\n        weekdaysShort: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),\n        weekdaysMin: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),\n        weekdaysParseExact: true,\n        meridiemParse: /sa|ch/i,\n        isPM: function (input) {\n            return /^ch$/i.test(input);\n        },\n        meridiem: function (hours, minutes, isLower) {\n            if (hours < 12) {\n                return isLower ? 'sa' : 'SA';\n            } else {\n                return isLower ? 'ch' : 'CH';\n            }\n        },\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM [năm] YYYY',\n            LLL: 'D MMMM [năm] YYYY HH:mm',\n            LLLL: 'dddd, D MMMM [năm] YYYY HH:mm',\n            l: 'DD/M/YYYY',\n            ll: 'D MMM YYYY',\n            lll: 'D MMM YYYY HH:mm',\n            llll: 'ddd, D MMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[Hôm nay lúc] LT',\n            nextDay: '[Ngày mai lúc] LT',\n            nextWeek: 'dddd [tuần tới lúc] LT',\n            lastDay: '[Hôm qua lúc] LT',\n            lastWeek: 'dddd [tuần trước lúc] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: '%s tới',\n            past: '%s trước',\n            s: 'vài giây',\n            ss: '%d giây',\n            m: 'một phút',\n            mm: '%d phút',\n            h: 'một giờ',\n            hh: '%d giờ',\n            d: 'một ngày',\n            dd: '%d ngày',\n            w: 'một tuần',\n            ww: '%d tuần',\n            M: 'một tháng',\n            MM: '%d tháng',\n            y: 'một năm',\n            yy: '%d năm',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}/,\n        ordinal: function (number) {\n            return number;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return vi;\n\n})));\n","//! moment.js locale configuration\n//! locale : Pseudo [x-pseudo]\n//! author : Andrew Hood : https://github.com/andrewhood125\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var xPseudo = moment.defineLocale('x-pseudo', {\n        months: 'J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér'.split(\n            '_'\n        ),\n        monthsShort:\n            'J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc'.split(\n                '_'\n            ),\n        monthsParseExact: true,\n        weekdays:\n            'S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý'.split(\n                '_'\n            ),\n        weekdaysShort: 'S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát'.split('_'),\n        weekdaysMin: 'S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá'.split('_'),\n        weekdaysParseExact: true,\n        longDateFormat: {\n            LT: 'HH:mm',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY HH:mm',\n            LLLL: 'dddd, D MMMM YYYY HH:mm',\n        },\n        calendar: {\n            sameDay: '[T~ódá~ý át] LT',\n            nextDay: '[T~ómó~rró~w át] LT',\n            nextWeek: 'dddd [át] LT',\n            lastDay: '[Ý~ést~érdá~ý át] LT',\n            lastWeek: '[L~ást] dddd [át] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'í~ñ %s',\n            past: '%s á~gó',\n            s: 'á ~féw ~sécó~ñds',\n            ss: '%d s~écóñ~ds',\n            m: 'á ~míñ~úté',\n            mm: '%d m~íñú~tés',\n            h: 'á~ñ hó~úr',\n            hh: '%d h~óúrs',\n            d: 'á ~dáý',\n            dd: '%d d~áýs',\n            M: 'á ~móñ~th',\n            MM: '%d m~óñt~hs',\n            y: 'á ~ýéár',\n            yy: '%d ý~éárs',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(th|st|nd|rd)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    ~~((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return xPseudo;\n\n})));\n","//! moment.js locale configuration\n//! locale : Yoruba Nigeria [yo]\n//! author : Atolagbe Abisoye : https://github.com/andela-batolagbe\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var yo = moment.defineLocale('yo', {\n        months: 'Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀'.split(\n            '_'\n        ),\n        monthsShort: 'Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀'.split('_'),\n        weekdays: 'Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta'.split('_'),\n        weekdaysShort: 'Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá'.split('_'),\n        weekdaysMin: 'Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb'.split('_'),\n        longDateFormat: {\n            LT: 'h:mm A',\n            LTS: 'h:mm:ss A',\n            L: 'DD/MM/YYYY',\n            LL: 'D MMMM YYYY',\n            LLL: 'D MMMM YYYY h:mm A',\n            LLLL: 'dddd, D MMMM YYYY h:mm A',\n        },\n        calendar: {\n            sameDay: '[Ònì ni] LT',\n            nextDay: '[Ọ̀la ni] LT',\n            nextWeek: \"dddd [Ọsẹ̀ tón'bọ] [ni] LT\",\n            lastDay: '[Àna ni] LT',\n            lastWeek: 'dddd [Ọsẹ̀ tólọ́] [ni] LT',\n            sameElse: 'L',\n        },\n        relativeTime: {\n            future: 'ní %s',\n            past: '%s kọjá',\n            s: 'ìsẹjú aayá die',\n            ss: 'aayá %d',\n            m: 'ìsẹjú kan',\n            mm: 'ìsẹjú %d',\n            h: 'wákati kan',\n            hh: 'wákati %d',\n            d: 'ọjọ́ kan',\n            dd: 'ọjọ́ %d',\n            M: 'osù kan',\n            MM: 'osù %d',\n            y: 'ọdún kan',\n            yy: 'ọdún %d',\n        },\n        dayOfMonthOrdinalParse: /ọjọ́\\s\\d{1,2}/,\n        ordinal: 'ọjọ́ %d',\n        week: {\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return yo;\n\n})));\n","//! moment.js locale configuration\n//! locale : Chinese (China) [zh-cn]\n//! author : suupic : https://github.com/suupic\n//! author : Zeno Zeng : https://github.com/zenozeng\n//! author : uu109 : https://github.com/uu109\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var zhCn = moment.defineLocale('zh-cn', {\n        months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(\n            '_'\n        ),\n        monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(\n            '_'\n        ),\n        weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),\n        weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'),\n        weekdaysMin: '日_一_二_三_四_五_六'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY/MM/DD',\n            LL: 'YYYY年M月D日',\n            LLL: 'YYYY年M月D日Ah点mm分',\n            LLLL: 'YYYY年M月D日ddddAh点mm分',\n            l: 'YYYY/M/D',\n            ll: 'YYYY年M月D日',\n            lll: 'YYYY年M月D日 HH:mm',\n            llll: 'YYYY年M月D日dddd HH:mm',\n        },\n        meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {\n                return hour;\n            } else if (meridiem === '下午' || meridiem === '晚上') {\n                return hour + 12;\n            } else {\n                // '中午'\n                return hour >= 11 ? hour : hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            var hm = hour * 100 + minute;\n            if (hm < 600) {\n                return '凌晨';\n            } else if (hm < 900) {\n                return '早上';\n            } else if (hm < 1130) {\n                return '上午';\n            } else if (hm < 1230) {\n                return '中午';\n            } else if (hm < 1800) {\n                return '下午';\n            } else {\n                return '晚上';\n            }\n        },\n        calendar: {\n            sameDay: '[今天]LT',\n            nextDay: '[明天]LT',\n            nextWeek: function (now) {\n                if (now.week() !== this.week()) {\n                    return '[下]dddLT';\n                } else {\n                    return '[本]dddLT';\n                }\n            },\n            lastDay: '[昨天]LT',\n            lastWeek: function (now) {\n                if (this.week() !== now.week()) {\n                    return '[上]dddLT';\n                } else {\n                    return '[本]dddLT';\n                }\n            },\n            sameElse: 'L',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(日|月|周)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'd':\n                case 'D':\n                case 'DDD':\n                    return number + '日';\n                case 'M':\n                    return number + '月';\n                case 'w':\n                case 'W':\n                    return number + '周';\n                default:\n                    return number;\n            }\n        },\n        relativeTime: {\n            future: '%s后',\n            past: '%s前',\n            s: '几秒',\n            ss: '%d 秒',\n            m: '1 分钟',\n            mm: '%d 分钟',\n            h: '1 小时',\n            hh: '%d 小时',\n            d: '1 天',\n            dd: '%d 天',\n            w: '1 周',\n            ww: '%d 周',\n            M: '1 个月',\n            MM: '%d 个月',\n            y: '1 年',\n            yy: '%d 年',\n        },\n        week: {\n            // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效\n            dow: 1, // Monday is the first day of the week.\n            doy: 4, // The week that contains Jan 4th is the first week of the year.\n        },\n    });\n\n    return zhCn;\n\n})));\n","//! moment.js locale configuration\n//! locale : Chinese (Hong Kong) [zh-hk]\n//! author : Ben : https://github.com/ben-lin\n//! author : Chris Lam : https://github.com/hehachris\n//! author : Konstantin : https://github.com/skfd\n//! author : Anthony : https://github.com/anthonylau\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var zhHk = moment.defineLocale('zh-hk', {\n        months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(\n            '_'\n        ),\n        monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(\n            '_'\n        ),\n        weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),\n        weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),\n        weekdaysMin: '日_一_二_三_四_五_六'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY/MM/DD',\n            LL: 'YYYY年M月D日',\n            LLL: 'YYYY年M月D日 HH:mm',\n            LLLL: 'YYYY年M月D日dddd HH:mm',\n            l: 'YYYY/M/D',\n            ll: 'YYYY年M月D日',\n            lll: 'YYYY年M月D日 HH:mm',\n            llll: 'YYYY年M月D日dddd HH:mm',\n        },\n        meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {\n                return hour;\n            } else if (meridiem === '中午') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === '下午' || meridiem === '晚上') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            var hm = hour * 100 + minute;\n            if (hm < 600) {\n                return '凌晨';\n            } else if (hm < 900) {\n                return '早上';\n            } else if (hm < 1200) {\n                return '上午';\n            } else if (hm === 1200) {\n                return '中午';\n            } else if (hm < 1800) {\n                return '下午';\n            } else {\n                return '晚上';\n            }\n        },\n        calendar: {\n            sameDay: '[今天]LT',\n            nextDay: '[明天]LT',\n            nextWeek: '[下]ddddLT',\n            lastDay: '[昨天]LT',\n            lastWeek: '[上]ddddLT',\n            sameElse: 'L',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(日|月|週)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'd':\n                case 'D':\n                case 'DDD':\n                    return number + '日';\n                case 'M':\n                    return number + '月';\n                case 'w':\n                case 'W':\n                    return number + '週';\n                default:\n                    return number;\n            }\n        },\n        relativeTime: {\n            future: '%s後',\n            past: '%s前',\n            s: '幾秒',\n            ss: '%d 秒',\n            m: '1 分鐘',\n            mm: '%d 分鐘',\n            h: '1 小時',\n            hh: '%d 小時',\n            d: '1 天',\n            dd: '%d 天',\n            M: '1 個月',\n            MM: '%d 個月',\n            y: '1 年',\n            yy: '%d 年',\n        },\n    });\n\n    return zhHk;\n\n})));\n","//! moment.js locale configuration\n//! locale : Chinese (Macau) [zh-mo]\n//! author : Ben : https://github.com/ben-lin\n//! author : Chris Lam : https://github.com/hehachris\n//! author : Tan Yuanhong : https://github.com/le0tan\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var zhMo = moment.defineLocale('zh-mo', {\n        months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(\n            '_'\n        ),\n        monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(\n            '_'\n        ),\n        weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),\n        weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),\n        weekdaysMin: '日_一_二_三_四_五_六'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'DD/MM/YYYY',\n            LL: 'YYYY年M月D日',\n            LLL: 'YYYY年M月D日 HH:mm',\n            LLLL: 'YYYY年M月D日dddd HH:mm',\n            l: 'D/M/YYYY',\n            ll: 'YYYY年M月D日',\n            lll: 'YYYY年M月D日 HH:mm',\n            llll: 'YYYY年M月D日dddd HH:mm',\n        },\n        meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {\n                return hour;\n            } else if (meridiem === '中午') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === '下午' || meridiem === '晚上') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            var hm = hour * 100 + minute;\n            if (hm < 600) {\n                return '凌晨';\n            } else if (hm < 900) {\n                return '早上';\n            } else if (hm < 1130) {\n                return '上午';\n            } else if (hm < 1230) {\n                return '中午';\n            } else if (hm < 1800) {\n                return '下午';\n            } else {\n                return '晚上';\n            }\n        },\n        calendar: {\n            sameDay: '[今天] LT',\n            nextDay: '[明天] LT',\n            nextWeek: '[下]dddd LT',\n            lastDay: '[昨天] LT',\n            lastWeek: '[上]dddd LT',\n            sameElse: 'L',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(日|月|週)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'd':\n                case 'D':\n                case 'DDD':\n                    return number + '日';\n                case 'M':\n                    return number + '月';\n                case 'w':\n                case 'W':\n                    return number + '週';\n                default:\n                    return number;\n            }\n        },\n        relativeTime: {\n            future: '%s內',\n            past: '%s前',\n            s: '幾秒',\n            ss: '%d 秒',\n            m: '1 分鐘',\n            mm: '%d 分鐘',\n            h: '1 小時',\n            hh: '%d 小時',\n            d: '1 天',\n            dd: '%d 天',\n            M: '1 個月',\n            MM: '%d 個月',\n            y: '1 年',\n            yy: '%d 年',\n        },\n    });\n\n    return zhMo;\n\n})));\n","//! moment.js locale configuration\n//! locale : Chinese (Taiwan) [zh-tw]\n//! author : Ben : https://github.com/ben-lin\n//! author : Chris Lam : https://github.com/hehachris\n\n;(function (global, factory) {\n   typeof exports === 'object' && typeof module !== 'undefined'\n       && typeof require === 'function' ? factory(require('../moment')) :\n   typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n   factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n    //! moment.js locale configuration\n\n    var zhTw = moment.defineLocale('zh-tw', {\n        months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(\n            '_'\n        ),\n        monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(\n            '_'\n        ),\n        weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),\n        weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),\n        weekdaysMin: '日_一_二_三_四_五_六'.split('_'),\n        longDateFormat: {\n            LT: 'HH:mm',\n            LTS: 'HH:mm:ss',\n            L: 'YYYY/MM/DD',\n            LL: 'YYYY年M月D日',\n            LLL: 'YYYY年M月D日 HH:mm',\n            LLLL: 'YYYY年M月D日dddd HH:mm',\n            l: 'YYYY/M/D',\n            ll: 'YYYY年M月D日',\n            lll: 'YYYY年M月D日 HH:mm',\n            llll: 'YYYY年M月D日dddd HH:mm',\n        },\n        meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,\n        meridiemHour: function (hour, meridiem) {\n            if (hour === 12) {\n                hour = 0;\n            }\n            if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {\n                return hour;\n            } else if (meridiem === '中午') {\n                return hour >= 11 ? hour : hour + 12;\n            } else if (meridiem === '下午' || meridiem === '晚上') {\n                return hour + 12;\n            }\n        },\n        meridiem: function (hour, minute, isLower) {\n            var hm = hour * 100 + minute;\n            if (hm < 600) {\n                return '凌晨';\n            } else if (hm < 900) {\n                return '早上';\n            } else if (hm < 1130) {\n                return '上午';\n            } else if (hm < 1230) {\n                return '中午';\n            } else if (hm < 1800) {\n                return '下午';\n            } else {\n                return '晚上';\n            }\n        },\n        calendar: {\n            sameDay: '[今天] LT',\n            nextDay: '[明天] LT',\n            nextWeek: '[下]dddd LT',\n            lastDay: '[昨天] LT',\n            lastWeek: '[上]dddd LT',\n            sameElse: 'L',\n        },\n        dayOfMonthOrdinalParse: /\\d{1,2}(日|月|週)/,\n        ordinal: function (number, period) {\n            switch (period) {\n                case 'd':\n                case 'D':\n                case 'DDD':\n                    return number + '日';\n                case 'M':\n                    return number + '月';\n                case 'w':\n                case 'W':\n                    return number + '週';\n                default:\n                    return number;\n            }\n        },\n        relativeTime: {\n            future: '%s後',\n            past: '%s前',\n            s: '幾秒',\n            ss: '%d 秒',\n            m: '1 分鐘',\n            mm: '%d 分鐘',\n            h: '1 小時',\n            hh: '%d 小時',\n            d: '1 天',\n            dd: '%d 天',\n            M: '1 個月',\n            MM: '%d 個月',\n            y: '1 年',\n            yy: '%d 年',\n        },\n    });\n\n    return zhTw;\n\n})));\n","//! moment.js\n//! version : 2.29.4\n//! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n//! license : MIT\n//! momentjs.com\n\n;(function (global, factory) {\n    typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n    typeof define === 'function' && define.amd ? define(factory) :\n    global.moment = factory()\n}(this, (function () { 'use strict';\n\n    var hookCallback;\n\n    function hooks() {\n        return hookCallback.apply(null, arguments);\n    }\n\n    // This is done to register the method called with moment()\n    // without creating circular dependencies.\n    function setHookCallback(callback) {\n        hookCallback = callback;\n    }\n\n    function isArray(input) {\n        return (\n            input instanceof Array ||\n            Object.prototype.toString.call(input) === '[object Array]'\n        );\n    }\n\n    function isObject(input) {\n        // IE8 will treat undefined and null as object if it wasn't for\n        // input != null\n        return (\n            input != null &&\n            Object.prototype.toString.call(input) === '[object Object]'\n        );\n    }\n\n    function hasOwnProp(a, b) {\n        return Object.prototype.hasOwnProperty.call(a, b);\n    }\n\n    function isObjectEmpty(obj) {\n        if (Object.getOwnPropertyNames) {\n            return Object.getOwnPropertyNames(obj).length === 0;\n        } else {\n            var k;\n            for (k in obj) {\n                if (hasOwnProp(obj, k)) {\n                    return false;\n                }\n            }\n            return true;\n        }\n    }\n\n    function isUndefined(input) {\n        return input === void 0;\n    }\n\n    function isNumber(input) {\n        return (\n            typeof input === 'number' ||\n            Object.prototype.toString.call(input) === '[object Number]'\n        );\n    }\n\n    function isDate(input) {\n        return (\n            input instanceof Date ||\n            Object.prototype.toString.call(input) === '[object Date]'\n        );\n    }\n\n    function map(arr, fn) {\n        var res = [],\n            i,\n            arrLen = arr.length;\n        for (i = 0; i < arrLen; ++i) {\n            res.push(fn(arr[i], i));\n        }\n        return res;\n    }\n\n    function extend(a, b) {\n        for (var i in b) {\n            if (hasOwnProp(b, i)) {\n                a[i] = b[i];\n            }\n        }\n\n        if (hasOwnProp(b, 'toString')) {\n            a.toString = b.toString;\n        }\n\n        if (hasOwnProp(b, 'valueOf')) {\n            a.valueOf = b.valueOf;\n        }\n\n        return a;\n    }\n\n    function createUTC(input, format, locale, strict) {\n        return createLocalOrUTC(input, format, locale, strict, true).utc();\n    }\n\n    function defaultParsingFlags() {\n        // We need to deep clone this object.\n        return {\n            empty: false,\n            unusedTokens: [],\n            unusedInput: [],\n            overflow: -2,\n            charsLeftOver: 0,\n            nullInput: false,\n            invalidEra: null,\n            invalidMonth: null,\n            invalidFormat: false,\n            userInvalidated: false,\n            iso: false,\n            parsedDateParts: [],\n            era: null,\n            meridiem: null,\n            rfc2822: false,\n            weekdayMismatch: false,\n        };\n    }\n\n    function getParsingFlags(m) {\n        if (m._pf == null) {\n            m._pf = defaultParsingFlags();\n        }\n        return m._pf;\n    }\n\n    var some;\n    if (Array.prototype.some) {\n        some = Array.prototype.some;\n    } else {\n        some = function (fun) {\n            var t = Object(this),\n                len = t.length >>> 0,\n                i;\n\n            for (i = 0; i < len; i++) {\n                if (i in t && fun.call(this, t[i], i, t)) {\n                    return true;\n                }\n            }\n\n            return false;\n        };\n    }\n\n    function isValid(m) {\n        if (m._isValid == null) {\n            var flags = getParsingFlags(m),\n                parsedParts = some.call(flags.parsedDateParts, function (i) {\n                    return i != null;\n                }),\n                isNowValid =\n                    !isNaN(m._d.getTime()) &&\n                    flags.overflow < 0 &&\n                    !flags.empty &&\n                    !flags.invalidEra &&\n                    !flags.invalidMonth &&\n                    !flags.invalidWeekday &&\n                    !flags.weekdayMismatch &&\n                    !flags.nullInput &&\n                    !flags.invalidFormat &&\n                    !flags.userInvalidated &&\n                    (!flags.meridiem || (flags.meridiem && parsedParts));\n\n            if (m._strict) {\n                isNowValid =\n                    isNowValid &&\n                    flags.charsLeftOver === 0 &&\n                    flags.unusedTokens.length === 0 &&\n                    flags.bigHour === undefined;\n            }\n\n            if (Object.isFrozen == null || !Object.isFrozen(m)) {\n                m._isValid = isNowValid;\n            } else {\n                return isNowValid;\n            }\n        }\n        return m._isValid;\n    }\n\n    function createInvalid(flags) {\n        var m = createUTC(NaN);\n        if (flags != null) {\n            extend(getParsingFlags(m), flags);\n        } else {\n            getParsingFlags(m).userInvalidated = true;\n        }\n\n        return m;\n    }\n\n    // Plugins that add properties should also add the key here (null value),\n    // so we can properly clone ourselves.\n    var momentProperties = (hooks.momentProperties = []),\n        updateInProgress = false;\n\n    function copyConfig(to, from) {\n        var i,\n            prop,\n            val,\n            momentPropertiesLen = momentProperties.length;\n\n        if (!isUndefined(from._isAMomentObject)) {\n            to._isAMomentObject = from._isAMomentObject;\n        }\n        if (!isUndefined(from._i)) {\n            to._i = from._i;\n        }\n        if (!isUndefined(from._f)) {\n            to._f = from._f;\n        }\n        if (!isUndefined(from._l)) {\n            to._l = from._l;\n        }\n        if (!isUndefined(from._strict)) {\n            to._strict = from._strict;\n        }\n        if (!isUndefined(from._tzm)) {\n            to._tzm = from._tzm;\n        }\n        if (!isUndefined(from._isUTC)) {\n            to._isUTC = from._isUTC;\n        }\n        if (!isUndefined(from._offset)) {\n            to._offset = from._offset;\n        }\n        if (!isUndefined(from._pf)) {\n            to._pf = getParsingFlags(from);\n        }\n        if (!isUndefined(from._locale)) {\n            to._locale = from._locale;\n        }\n\n        if (momentPropertiesLen > 0) {\n            for (i = 0; i < momentPropertiesLen; i++) {\n                prop = momentProperties[i];\n                val = from[prop];\n                if (!isUndefined(val)) {\n                    to[prop] = val;\n                }\n            }\n        }\n\n        return to;\n    }\n\n    // Moment prototype object\n    function Moment(config) {\n        copyConfig(this, config);\n        this._d = new Date(config._d != null ? config._d.getTime() : NaN);\n        if (!this.isValid()) {\n            this._d = new Date(NaN);\n        }\n        // Prevent infinite loop in case updateOffset creates new moment\n        // objects.\n        if (updateInProgress === false) {\n            updateInProgress = true;\n            hooks.updateOffset(this);\n            updateInProgress = false;\n        }\n    }\n\n    function isMoment(obj) {\n        return (\n            obj instanceof Moment || (obj != null && obj._isAMomentObject != null)\n        );\n    }\n\n    function warn(msg) {\n        if (\n            hooks.suppressDeprecationWarnings === false &&\n            typeof console !== 'undefined' &&\n            console.warn\n        ) {\n            console.warn('Deprecation warning: ' + msg);\n        }\n    }\n\n    function deprecate(msg, fn) {\n        var firstTime = true;\n\n        return extend(function () {\n            if (hooks.deprecationHandler != null) {\n                hooks.deprecationHandler(null, msg);\n            }\n            if (firstTime) {\n                var args = [],\n                    arg,\n                    i,\n                    key,\n                    argLen = arguments.length;\n                for (i = 0; i < argLen; i++) {\n                    arg = '';\n                    if (typeof arguments[i] === 'object') {\n                        arg += '\\n[' + i + '] ';\n                        for (key in arguments[0]) {\n                            if (hasOwnProp(arguments[0], key)) {\n                                arg += key + ': ' + arguments[0][key] + ', ';\n                            }\n                        }\n                        arg = arg.slice(0, -2); // Remove trailing comma and space\n                    } else {\n                        arg = arguments[i];\n                    }\n                    args.push(arg);\n                }\n                warn(\n                    msg +\n                        '\\nArguments: ' +\n                        Array.prototype.slice.call(args).join('') +\n                        '\\n' +\n                        new Error().stack\n                );\n                firstTime = false;\n            }\n            return fn.apply(this, arguments);\n        }, fn);\n    }\n\n    var deprecations = {};\n\n    function deprecateSimple(name, msg) {\n        if (hooks.deprecationHandler != null) {\n            hooks.deprecationHandler(name, msg);\n        }\n        if (!deprecations[name]) {\n            warn(msg);\n            deprecations[name] = true;\n        }\n    }\n\n    hooks.suppressDeprecationWarnings = false;\n    hooks.deprecationHandler = null;\n\n    function isFunction(input) {\n        return (\n            (typeof Function !== 'undefined' && input instanceof Function) ||\n            Object.prototype.toString.call(input) === '[object Function]'\n        );\n    }\n\n    function set(config) {\n        var prop, i;\n        for (i in config) {\n            if (hasOwnProp(config, i)) {\n                prop = config[i];\n                if (isFunction(prop)) {\n                    this[i] = prop;\n                } else {\n                    this['_' + i] = prop;\n                }\n            }\n        }\n        this._config = config;\n        // Lenient ordinal parsing accepts just a number in addition to\n        // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.\n        // TODO: Remove \"ordinalParse\" fallback in next major release.\n        this._dayOfMonthOrdinalParseLenient = new RegExp(\n            (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +\n                '|' +\n                /\\d{1,2}/.source\n        );\n    }\n\n    function mergeConfigs(parentConfig, childConfig) {\n        var res = extend({}, parentConfig),\n            prop;\n        for (prop in childConfig) {\n            if (hasOwnProp(childConfig, prop)) {\n                if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {\n                    res[prop] = {};\n                    extend(res[prop], parentConfig[prop]);\n                    extend(res[prop], childConfig[prop]);\n                } else if (childConfig[prop] != null) {\n                    res[prop] = childConfig[prop];\n                } else {\n                    delete res[prop];\n                }\n            }\n        }\n        for (prop in parentConfig) {\n            if (\n                hasOwnProp(parentConfig, prop) &&\n                !hasOwnProp(childConfig, prop) &&\n                isObject(parentConfig[prop])\n            ) {\n                // make sure changes to properties don't modify parent config\n                res[prop] = extend({}, res[prop]);\n            }\n        }\n        return res;\n    }\n\n    function Locale(config) {\n        if (config != null) {\n            this.set(config);\n        }\n    }\n\n    var keys;\n\n    if (Object.keys) {\n        keys = Object.keys;\n    } else {\n        keys = function (obj) {\n            var i,\n                res = [];\n            for (i in obj) {\n                if (hasOwnProp(obj, i)) {\n                    res.push(i);\n                }\n            }\n            return res;\n        };\n    }\n\n    var defaultCalendar = {\n        sameDay: '[Today at] LT',\n        nextDay: '[Tomorrow at] LT',\n        nextWeek: 'dddd [at] LT',\n        lastDay: '[Yesterday at] LT',\n        lastWeek: '[Last] dddd [at] LT',\n        sameElse: 'L',\n    };\n\n    function calendar(key, mom, now) {\n        var output = this._calendar[key] || this._calendar['sameElse'];\n        return isFunction(output) ? output.call(mom, now) : output;\n    }\n\n    function zeroFill(number, targetLength, forceSign) {\n        var absNumber = '' + Math.abs(number),\n            zerosToFill = targetLength - absNumber.length,\n            sign = number >= 0;\n        return (\n            (sign ? (forceSign ? '+' : '') : '-') +\n            Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +\n            absNumber\n        );\n    }\n\n    var formattingTokens =\n            /(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,\n        localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,\n        formatFunctions = {},\n        formatTokenFunctions = {};\n\n    // token:    'M'\n    // padded:   ['MM', 2]\n    // ordinal:  'Mo'\n    // callback: function () { this.month() + 1 }\n    function addFormatToken(token, padded, ordinal, callback) {\n        var func = callback;\n        if (typeof callback === 'string') {\n            func = function () {\n                return this[callback]();\n            };\n        }\n        if (token) {\n            formatTokenFunctions[token] = func;\n        }\n        if (padded) {\n            formatTokenFunctions[padded[0]] = function () {\n                return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n            };\n        }\n        if (ordinal) {\n            formatTokenFunctions[ordinal] = function () {\n                return this.localeData().ordinal(\n                    func.apply(this, arguments),\n                    token\n                );\n            };\n        }\n    }\n\n    function removeFormattingTokens(input) {\n        if (input.match(/\\[[\\s\\S]/)) {\n            return input.replace(/^\\[|\\]$/g, '');\n        }\n        return input.replace(/\\\\/g, '');\n    }\n\n    function makeFormatFunction(format) {\n        var array = format.match(formattingTokens),\n            i,\n            length;\n\n        for (i = 0, length = array.length; i < length; i++) {\n            if (formatTokenFunctions[array[i]]) {\n                array[i] = formatTokenFunctions[array[i]];\n            } else {\n                array[i] = removeFormattingTokens(array[i]);\n            }\n        }\n\n        return function (mom) {\n            var output = '',\n                i;\n            for (i = 0; i < length; i++) {\n                output += isFunction(array[i])\n                    ? array[i].call(mom, format)\n                    : array[i];\n            }\n            return output;\n        };\n    }\n\n    // format date using native date object\n    function formatMoment(m, format) {\n        if (!m.isValid()) {\n            return m.localeData().invalidDate();\n        }\n\n        format = expandFormat(format, m.localeData());\n        formatFunctions[format] =\n            formatFunctions[format] || makeFormatFunction(format);\n\n        return formatFunctions[format](m);\n    }\n\n    function expandFormat(format, locale) {\n        var i = 5;\n\n        function replaceLongDateFormatTokens(input) {\n            return locale.longDateFormat(input) || input;\n        }\n\n        localFormattingTokens.lastIndex = 0;\n        while (i >= 0 && localFormattingTokens.test(format)) {\n            format = format.replace(\n                localFormattingTokens,\n                replaceLongDateFormatTokens\n            );\n            localFormattingTokens.lastIndex = 0;\n            i -= 1;\n        }\n\n        return format;\n    }\n\n    var defaultLongDateFormat = {\n        LTS: 'h:mm:ss A',\n        LT: 'h:mm A',\n        L: 'MM/DD/YYYY',\n        LL: 'MMMM D, YYYY',\n        LLL: 'MMMM D, YYYY h:mm A',\n        LLLL: 'dddd, MMMM D, YYYY h:mm A',\n    };\n\n    function longDateFormat(key) {\n        var format = this._longDateFormat[key],\n            formatUpper = this._longDateFormat[key.toUpperCase()];\n\n        if (format || !formatUpper) {\n            return format;\n        }\n\n        this._longDateFormat[key] = formatUpper\n            .match(formattingTokens)\n            .map(function (tok) {\n                if (\n                    tok === 'MMMM' ||\n                    tok === 'MM' ||\n                    tok === 'DD' ||\n                    tok === 'dddd'\n                ) {\n                    return tok.slice(1);\n                }\n                return tok;\n            })\n            .join('');\n\n        return this._longDateFormat[key];\n    }\n\n    var defaultInvalidDate = 'Invalid date';\n\n    function invalidDate() {\n        return this._invalidDate;\n    }\n\n    var defaultOrdinal = '%d',\n        defaultDayOfMonthOrdinalParse = /\\d{1,2}/;\n\n    function ordinal(number) {\n        return this._ordinal.replace('%d', number);\n    }\n\n    var defaultRelativeTime = {\n        future: 'in %s',\n        past: '%s ago',\n        s: 'a few seconds',\n        ss: '%d seconds',\n        m: 'a minute',\n        mm: '%d minutes',\n        h: 'an hour',\n        hh: '%d hours',\n        d: 'a day',\n        dd: '%d days',\n        w: 'a week',\n        ww: '%d weeks',\n        M: 'a month',\n        MM: '%d months',\n        y: 'a year',\n        yy: '%d years',\n    };\n\n    function relativeTime(number, withoutSuffix, string, isFuture) {\n        var output = this._relativeTime[string];\n        return isFunction(output)\n            ? output(number, withoutSuffix, string, isFuture)\n            : output.replace(/%d/i, number);\n    }\n\n    function pastFuture(diff, output) {\n        var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n        return isFunction(format) ? format(output) : format.replace(/%s/i, output);\n    }\n\n    var aliases = {};\n\n    function addUnitAlias(unit, shorthand) {\n        var lowerCase = unit.toLowerCase();\n        aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;\n    }\n\n    function normalizeUnits(units) {\n        return typeof units === 'string'\n            ? aliases[units] || aliases[units.toLowerCase()]\n            : undefined;\n    }\n\n    function normalizeObjectUnits(inputObject) {\n        var normalizedInput = {},\n            normalizedProp,\n            prop;\n\n        for (prop in inputObject) {\n            if (hasOwnProp(inputObject, prop)) {\n                normalizedProp = normalizeUnits(prop);\n                if (normalizedProp) {\n                    normalizedInput[normalizedProp] = inputObject[prop];\n                }\n            }\n        }\n\n        return normalizedInput;\n    }\n\n    var priorities = {};\n\n    function addUnitPriority(unit, priority) {\n        priorities[unit] = priority;\n    }\n\n    function getPrioritizedUnits(unitsObj) {\n        var units = [],\n            u;\n        for (u in unitsObj) {\n            if (hasOwnProp(unitsObj, u)) {\n                units.push({ unit: u, priority: priorities[u] });\n            }\n        }\n        units.sort(function (a, b) {\n            return a.priority - b.priority;\n        });\n        return units;\n    }\n\n    function isLeapYear(year) {\n        return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n    }\n\n    function absFloor(number) {\n        if (number < 0) {\n            // -0 -> 0\n            return Math.ceil(number) || 0;\n        } else {\n            return Math.floor(number);\n        }\n    }\n\n    function toInt(argumentForCoercion) {\n        var coercedNumber = +argumentForCoercion,\n            value = 0;\n\n        if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n            value = absFloor(coercedNumber);\n        }\n\n        return value;\n    }\n\n    function makeGetSet(unit, keepTime) {\n        return function (value) {\n            if (value != null) {\n                set$1(this, unit, value);\n                hooks.updateOffset(this, keepTime);\n                return this;\n            } else {\n                return get(this, unit);\n            }\n        };\n    }\n\n    function get(mom, unit) {\n        return mom.isValid()\n            ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()\n            : NaN;\n    }\n\n    function set$1(mom, unit, value) {\n        if (mom.isValid() && !isNaN(value)) {\n            if (\n                unit === 'FullYear' &&\n                isLeapYear(mom.year()) &&\n                mom.month() === 1 &&\n                mom.date() === 29\n            ) {\n                value = toInt(value);\n                mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](\n                    value,\n                    mom.month(),\n                    daysInMonth(value, mom.month())\n                );\n            } else {\n                mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);\n            }\n        }\n    }\n\n    // MOMENTS\n\n    function stringGet(units) {\n        units = normalizeUnits(units);\n        if (isFunction(this[units])) {\n            return this[units]();\n        }\n        return this;\n    }\n\n    function stringSet(units, value) {\n        if (typeof units === 'object') {\n            units = normalizeObjectUnits(units);\n            var prioritized = getPrioritizedUnits(units),\n                i,\n                prioritizedLen = prioritized.length;\n            for (i = 0; i < prioritizedLen; i++) {\n                this[prioritized[i].unit](units[prioritized[i].unit]);\n            }\n        } else {\n            units = normalizeUnits(units);\n            if (isFunction(this[units])) {\n                return this[units](value);\n            }\n        }\n        return this;\n    }\n\n    var match1 = /\\d/, //       0 - 9\n        match2 = /\\d\\d/, //      00 - 99\n        match3 = /\\d{3}/, //     000 - 999\n        match4 = /\\d{4}/, //    0000 - 9999\n        match6 = /[+-]?\\d{6}/, // -999999 - 999999\n        match1to2 = /\\d\\d?/, //       0 - 99\n        match3to4 = /\\d\\d\\d\\d?/, //     999 - 9999\n        match5to6 = /\\d\\d\\d\\d\\d\\d?/, //   99999 - 999999\n        match1to3 = /\\d{1,3}/, //       0 - 999\n        match1to4 = /\\d{1,4}/, //       0 - 9999\n        match1to6 = /[+-]?\\d{1,6}/, // -999999 - 999999\n        matchUnsigned = /\\d+/, //       0 - inf\n        matchSigned = /[+-]?\\d+/, //    -inf - inf\n        matchOffset = /Z|[+-]\\d\\d:?\\d\\d/gi, // +00:00 -00:00 +0000 -0000 or Z\n        matchShortOffset = /Z|[+-]\\d\\d(?::?\\d\\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z\n        matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/, // 123456789 123456789.123\n        // any word (or two) characters or numbers including two/three word month in arabic.\n        // includes scottish gaelic two word and hyphenated months\n        matchWord =\n            /[0-9]{0,256}['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFF07\\uFF10-\\uFFEF]{1,256}|[\\u0600-\\u06FF\\/]{1,256}(\\s*?[\\u0600-\\u06FF]{1,256}){1,2}/i,\n        regexes;\n\n    regexes = {};\n\n    function addRegexToken(token, regex, strictRegex) {\n        regexes[token] = isFunction(regex)\n            ? regex\n            : function (isStrict, localeData) {\n                  return isStrict && strictRegex ? strictRegex : regex;\n              };\n    }\n\n    function getParseRegexForToken(token, config) {\n        if (!hasOwnProp(regexes, token)) {\n            return new RegExp(unescapeFormat(token));\n        }\n\n        return regexes[token](config._strict, config._locale);\n    }\n\n    // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\n    function unescapeFormat(s) {\n        return regexEscape(\n            s\n                .replace('\\\\', '')\n                .replace(\n                    /\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g,\n                    function (matched, p1, p2, p3, p4) {\n                        return p1 || p2 || p3 || p4;\n                    }\n                )\n        );\n    }\n\n    function regexEscape(s) {\n        return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n    }\n\n    var tokens = {};\n\n    function addParseToken(token, callback) {\n        var i,\n            func = callback,\n            tokenLen;\n        if (typeof token === 'string') {\n            token = [token];\n        }\n        if (isNumber(callback)) {\n            func = function (input, array) {\n                array[callback] = toInt(input);\n            };\n        }\n        tokenLen = token.length;\n        for (i = 0; i < tokenLen; i++) {\n            tokens[token[i]] = func;\n        }\n    }\n\n    function addWeekParseToken(token, callback) {\n        addParseToken(token, function (input, array, config, token) {\n            config._w = config._w || {};\n            callback(input, config._w, config, token);\n        });\n    }\n\n    function addTimeToArrayFromToken(token, input, config) {\n        if (input != null && hasOwnProp(tokens, token)) {\n            tokens[token](input, config._a, config, token);\n        }\n    }\n\n    var YEAR = 0,\n        MONTH = 1,\n        DATE = 2,\n        HOUR = 3,\n        MINUTE = 4,\n        SECOND = 5,\n        MILLISECOND = 6,\n        WEEK = 7,\n        WEEKDAY = 8;\n\n    function mod(n, x) {\n        return ((n % x) + x) % x;\n    }\n\n    var indexOf;\n\n    if (Array.prototype.indexOf) {\n        indexOf = Array.prototype.indexOf;\n    } else {\n        indexOf = function (o) {\n            // I know\n            var i;\n            for (i = 0; i < this.length; ++i) {\n                if (this[i] === o) {\n                    return i;\n                }\n            }\n            return -1;\n        };\n    }\n\n    function daysInMonth(year, month) {\n        if (isNaN(year) || isNaN(month)) {\n            return NaN;\n        }\n        var modMonth = mod(month, 12);\n        year += (month - modMonth) / 12;\n        return modMonth === 1\n            ? isLeapYear(year)\n                ? 29\n                : 28\n            : 31 - ((modMonth % 7) % 2);\n    }\n\n    // FORMATTING\n\n    addFormatToken('M', ['MM', 2], 'Mo', function () {\n        return this.month() + 1;\n    });\n\n    addFormatToken('MMM', 0, 0, function (format) {\n        return this.localeData().monthsShort(this, format);\n    });\n\n    addFormatToken('MMMM', 0, 0, function (format) {\n        return this.localeData().months(this, format);\n    });\n\n    // ALIASES\n\n    addUnitAlias('month', 'M');\n\n    // PRIORITY\n\n    addUnitPriority('month', 8);\n\n    // PARSING\n\n    addRegexToken('M', match1to2);\n    addRegexToken('MM', match1to2, match2);\n    addRegexToken('MMM', function (isStrict, locale) {\n        return locale.monthsShortRegex(isStrict);\n    });\n    addRegexToken('MMMM', function (isStrict, locale) {\n        return locale.monthsRegex(isStrict);\n    });\n\n    addParseToken(['M', 'MM'], function (input, array) {\n        array[MONTH] = toInt(input) - 1;\n    });\n\n    addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n        var month = config._locale.monthsParse(input, token, config._strict);\n        // if we didn't find a month name, mark the date as invalid.\n        if (month != null) {\n            array[MONTH] = month;\n        } else {\n            getParsingFlags(config).invalidMonth = input;\n        }\n    });\n\n    // LOCALES\n\n    var defaultLocaleMonths =\n            'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n                '_'\n            ),\n        defaultLocaleMonthsShort =\n            'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n        MONTHS_IN_FORMAT = /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/,\n        defaultMonthsShortRegex = matchWord,\n        defaultMonthsRegex = matchWord;\n\n    function localeMonths(m, format) {\n        if (!m) {\n            return isArray(this._months)\n                ? this._months\n                : this._months['standalone'];\n        }\n        return isArray(this._months)\n            ? this._months[m.month()]\n            : this._months[\n                  (this._months.isFormat || MONTHS_IN_FORMAT).test(format)\n                      ? 'format'\n                      : 'standalone'\n              ][m.month()];\n    }\n\n    function localeMonthsShort(m, format) {\n        if (!m) {\n            return isArray(this._monthsShort)\n                ? this._monthsShort\n                : this._monthsShort['standalone'];\n        }\n        return isArray(this._monthsShort)\n            ? this._monthsShort[m.month()]\n            : this._monthsShort[\n                  MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'\n              ][m.month()];\n    }\n\n    function handleStrictParse(monthName, format, strict) {\n        var i,\n            ii,\n            mom,\n            llc = monthName.toLocaleLowerCase();\n        if (!this._monthsParse) {\n            // this is not used\n            this._monthsParse = [];\n            this._longMonthsParse = [];\n            this._shortMonthsParse = [];\n            for (i = 0; i < 12; ++i) {\n                mom = createUTC([2000, i]);\n                this._shortMonthsParse[i] = this.monthsShort(\n                    mom,\n                    ''\n                ).toLocaleLowerCase();\n                this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();\n            }\n        }\n\n        if (strict) {\n            if (format === 'MMM') {\n                ii = indexOf.call(this._shortMonthsParse, llc);\n                return ii !== -1 ? ii : null;\n            } else {\n                ii = indexOf.call(this._longMonthsParse, llc);\n                return ii !== -1 ? ii : null;\n            }\n        } else {\n            if (format === 'MMM') {\n                ii = indexOf.call(this._shortMonthsParse, llc);\n                if (ii !== -1) {\n                    return ii;\n                }\n                ii = indexOf.call(this._longMonthsParse, llc);\n                return ii !== -1 ? ii : null;\n            } else {\n                ii = indexOf.call(this._longMonthsParse, llc);\n                if (ii !== -1) {\n                    return ii;\n                }\n                ii = indexOf.call(this._shortMonthsParse, llc);\n                return ii !== -1 ? ii : null;\n            }\n        }\n    }\n\n    function localeMonthsParse(monthName, format, strict) {\n        var i, mom, regex;\n\n        if (this._monthsParseExact) {\n            return handleStrictParse.call(this, monthName, format, strict);\n        }\n\n        if (!this._monthsParse) {\n            this._monthsParse = [];\n            this._longMonthsParse = [];\n            this._shortMonthsParse = [];\n        }\n\n        // TODO: add sorting\n        // Sorting makes sure if one month (or abbr) is a prefix of another\n        // see sorting in computeMonthsParse\n        for (i = 0; i < 12; i++) {\n            // make the regex if we don't have it already\n            mom = createUTC([2000, i]);\n            if (strict && !this._longMonthsParse[i]) {\n                this._longMonthsParse[i] = new RegExp(\n                    '^' + this.months(mom, '').replace('.', '') + '$',\n                    'i'\n                );\n                this._shortMonthsParse[i] = new RegExp(\n                    '^' + this.monthsShort(mom, '').replace('.', '') + '$',\n                    'i'\n                );\n            }\n            if (!strict && !this._monthsParse[i]) {\n                regex =\n                    '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n                this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n            }\n            // test the regex\n            if (\n                strict &&\n                format === 'MMMM' &&\n                this._longMonthsParse[i].test(monthName)\n            ) {\n                return i;\n            } else if (\n                strict &&\n                format === 'MMM' &&\n                this._shortMonthsParse[i].test(monthName)\n            ) {\n                return i;\n            } else if (!strict && this._monthsParse[i].test(monthName)) {\n                return i;\n            }\n        }\n    }\n\n    // MOMENTS\n\n    function setMonth(mom, value) {\n        var dayOfMonth;\n\n        if (!mom.isValid()) {\n            // No op\n            return mom;\n        }\n\n        if (typeof value === 'string') {\n            if (/^\\d+$/.test(value)) {\n                value = toInt(value);\n            } else {\n                value = mom.localeData().monthsParse(value);\n                // TODO: Another silent failure?\n                if (!isNumber(value)) {\n                    return mom;\n                }\n            }\n        }\n\n        dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));\n        mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);\n        return mom;\n    }\n\n    function getSetMonth(value) {\n        if (value != null) {\n            setMonth(this, value);\n            hooks.updateOffset(this, true);\n            return this;\n        } else {\n            return get(this, 'Month');\n        }\n    }\n\n    function getDaysInMonth() {\n        return daysInMonth(this.year(), this.month());\n    }\n\n    function monthsShortRegex(isStrict) {\n        if (this._monthsParseExact) {\n            if (!hasOwnProp(this, '_monthsRegex')) {\n                computeMonthsParse.call(this);\n            }\n            if (isStrict) {\n                return this._monthsShortStrictRegex;\n            } else {\n                return this._monthsShortRegex;\n            }\n        } else {\n            if (!hasOwnProp(this, '_monthsShortRegex')) {\n                this._monthsShortRegex = defaultMonthsShortRegex;\n            }\n            return this._monthsShortStrictRegex && isStrict\n                ? this._monthsShortStrictRegex\n                : this._monthsShortRegex;\n        }\n    }\n\n    function monthsRegex(isStrict) {\n        if (this._monthsParseExact) {\n            if (!hasOwnProp(this, '_monthsRegex')) {\n                computeMonthsParse.call(this);\n            }\n            if (isStrict) {\n                return this._monthsStrictRegex;\n            } else {\n                return this._monthsRegex;\n            }\n        } else {\n            if (!hasOwnProp(this, '_monthsRegex')) {\n                this._monthsRegex = defaultMonthsRegex;\n            }\n            return this._monthsStrictRegex && isStrict\n                ? this._monthsStrictRegex\n                : this._monthsRegex;\n        }\n    }\n\n    function computeMonthsParse() {\n        function cmpLenRev(a, b) {\n            return b.length - a.length;\n        }\n\n        var shortPieces = [],\n            longPieces = [],\n            mixedPieces = [],\n            i,\n            mom;\n        for (i = 0; i < 12; i++) {\n            // make the regex if we don't have it already\n            mom = createUTC([2000, i]);\n            shortPieces.push(this.monthsShort(mom, ''));\n            longPieces.push(this.months(mom, ''));\n            mixedPieces.push(this.months(mom, ''));\n            mixedPieces.push(this.monthsShort(mom, ''));\n        }\n        // Sorting makes sure if one month (or abbr) is a prefix of another it\n        // will match the longer piece.\n        shortPieces.sort(cmpLenRev);\n        longPieces.sort(cmpLenRev);\n        mixedPieces.sort(cmpLenRev);\n        for (i = 0; i < 12; i++) {\n            shortPieces[i] = regexEscape(shortPieces[i]);\n            longPieces[i] = regexEscape(longPieces[i]);\n        }\n        for (i = 0; i < 24; i++) {\n            mixedPieces[i] = regexEscape(mixedPieces[i]);\n        }\n\n        this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n        this._monthsShortRegex = this._monthsRegex;\n        this._monthsStrictRegex = new RegExp(\n            '^(' + longPieces.join('|') + ')',\n            'i'\n        );\n        this._monthsShortStrictRegex = new RegExp(\n            '^(' + shortPieces.join('|') + ')',\n            'i'\n        );\n    }\n\n    // FORMATTING\n\n    addFormatToken('Y', 0, 0, function () {\n        var y = this.year();\n        return y <= 9999 ? zeroFill(y, 4) : '+' + y;\n    });\n\n    addFormatToken(0, ['YY', 2], 0, function () {\n        return this.year() % 100;\n    });\n\n    addFormatToken(0, ['YYYY', 4], 0, 'year');\n    addFormatToken(0, ['YYYYY', 5], 0, 'year');\n    addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');\n\n    // ALIASES\n\n    addUnitAlias('year', 'y');\n\n    // PRIORITIES\n\n    addUnitPriority('year', 1);\n\n    // PARSING\n\n    addRegexToken('Y', matchSigned);\n    addRegexToken('YY', match1to2, match2);\n    addRegexToken('YYYY', match1to4, match4);\n    addRegexToken('YYYYY', match1to6, match6);\n    addRegexToken('YYYYYY', match1to6, match6);\n\n    addParseToken(['YYYYY', 'YYYYYY'], YEAR);\n    addParseToken('YYYY', function (input, array) {\n        array[YEAR] =\n            input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);\n    });\n    addParseToken('YY', function (input, array) {\n        array[YEAR] = hooks.parseTwoDigitYear(input);\n    });\n    addParseToken('Y', function (input, array) {\n        array[YEAR] = parseInt(input, 10);\n    });\n\n    // HELPERS\n\n    function daysInYear(year) {\n        return isLeapYear(year) ? 366 : 365;\n    }\n\n    // HOOKS\n\n    hooks.parseTwoDigitYear = function (input) {\n        return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n    };\n\n    // MOMENTS\n\n    var getSetYear = makeGetSet('FullYear', true);\n\n    function getIsLeapYear() {\n        return isLeapYear(this.year());\n    }\n\n    function createDate(y, m, d, h, M, s, ms) {\n        // can't just apply() to create a date:\n        // https://stackoverflow.com/q/181348\n        var date;\n        // the date constructor remaps years 0-99 to 1900-1999\n        if (y < 100 && y >= 0) {\n            // preserve leap years using a full 400 year cycle, then reset\n            date = new Date(y + 400, m, d, h, M, s, ms);\n            if (isFinite(date.getFullYear())) {\n                date.setFullYear(y);\n            }\n        } else {\n            date = new Date(y, m, d, h, M, s, ms);\n        }\n\n        return date;\n    }\n\n    function createUTCDate(y) {\n        var date, args;\n        // the Date.UTC function remaps years 0-99 to 1900-1999\n        if (y < 100 && y >= 0) {\n            args = Array.prototype.slice.call(arguments);\n            // preserve leap years using a full 400 year cycle, then reset\n            args[0] = y + 400;\n            date = new Date(Date.UTC.apply(null, args));\n            if (isFinite(date.getUTCFullYear())) {\n                date.setUTCFullYear(y);\n            }\n        } else {\n            date = new Date(Date.UTC.apply(null, arguments));\n        }\n\n        return date;\n    }\n\n    // start-of-first-week - start-of-year\n    function firstWeekOffset(year, dow, doy) {\n        var // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n            fwd = 7 + dow - doy,\n            // first-week day local weekday -- which local weekday is fwd\n            fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;\n\n        return -fwdlw + fwd - 1;\n    }\n\n    // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\n    function dayOfYearFromWeeks(year, week, weekday, dow, doy) {\n        var localWeekday = (7 + weekday - dow) % 7,\n            weekOffset = firstWeekOffset(year, dow, doy),\n            dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,\n            resYear,\n            resDayOfYear;\n\n        if (dayOfYear <= 0) {\n            resYear = year - 1;\n            resDayOfYear = daysInYear(resYear) + dayOfYear;\n        } else if (dayOfYear > daysInYear(year)) {\n            resYear = year + 1;\n            resDayOfYear = dayOfYear - daysInYear(year);\n        } else {\n            resYear = year;\n            resDayOfYear = dayOfYear;\n        }\n\n        return {\n            year: resYear,\n            dayOfYear: resDayOfYear,\n        };\n    }\n\n    function weekOfYear(mom, dow, doy) {\n        var weekOffset = firstWeekOffset(mom.year(), dow, doy),\n            week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,\n            resWeek,\n            resYear;\n\n        if (week < 1) {\n            resYear = mom.year() - 1;\n            resWeek = week + weeksInYear(resYear, dow, doy);\n        } else if (week > weeksInYear(mom.year(), dow, doy)) {\n            resWeek = week - weeksInYear(mom.year(), dow, doy);\n            resYear = mom.year() + 1;\n        } else {\n            resYear = mom.year();\n            resWeek = week;\n        }\n\n        return {\n            week: resWeek,\n            year: resYear,\n        };\n    }\n\n    function weeksInYear(year, dow, doy) {\n        var weekOffset = firstWeekOffset(year, dow, doy),\n            weekOffsetNext = firstWeekOffset(year + 1, dow, doy);\n        return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;\n    }\n\n    // FORMATTING\n\n    addFormatToken('w', ['ww', 2], 'wo', 'week');\n    addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');\n\n    // ALIASES\n\n    addUnitAlias('week', 'w');\n    addUnitAlias('isoWeek', 'W');\n\n    // PRIORITIES\n\n    addUnitPriority('week', 5);\n    addUnitPriority('isoWeek', 5);\n\n    // PARSING\n\n    addRegexToken('w', match1to2);\n    addRegexToken('ww', match1to2, match2);\n    addRegexToken('W', match1to2);\n    addRegexToken('WW', match1to2, match2);\n\n    addWeekParseToken(\n        ['w', 'ww', 'W', 'WW'],\n        function (input, week, config, token) {\n            week[token.substr(0, 1)] = toInt(input);\n        }\n    );\n\n    // HELPERS\n\n    // LOCALES\n\n    function localeWeek(mom) {\n        return weekOfYear(mom, this._week.dow, this._week.doy).week;\n    }\n\n    var defaultLocaleWeek = {\n        dow: 0, // Sunday is the first day of the week.\n        doy: 6, // The week that contains Jan 6th is the first week of the year.\n    };\n\n    function localeFirstDayOfWeek() {\n        return this._week.dow;\n    }\n\n    function localeFirstDayOfYear() {\n        return this._week.doy;\n    }\n\n    // MOMENTS\n\n    function getSetWeek(input) {\n        var week = this.localeData().week(this);\n        return input == null ? week : this.add((input - week) * 7, 'd');\n    }\n\n    function getSetISOWeek(input) {\n        var week = weekOfYear(this, 1, 4).week;\n        return input == null ? week : this.add((input - week) * 7, 'd');\n    }\n\n    // FORMATTING\n\n    addFormatToken('d', 0, 'do', 'day');\n\n    addFormatToken('dd', 0, 0, function (format) {\n        return this.localeData().weekdaysMin(this, format);\n    });\n\n    addFormatToken('ddd', 0, 0, function (format) {\n        return this.localeData().weekdaysShort(this, format);\n    });\n\n    addFormatToken('dddd', 0, 0, function (format) {\n        return this.localeData().weekdays(this, format);\n    });\n\n    addFormatToken('e', 0, 0, 'weekday');\n    addFormatToken('E', 0, 0, 'isoWeekday');\n\n    // ALIASES\n\n    addUnitAlias('day', 'd');\n    addUnitAlias('weekday', 'e');\n    addUnitAlias('isoWeekday', 'E');\n\n    // PRIORITY\n    addUnitPriority('day', 11);\n    addUnitPriority('weekday', 11);\n    addUnitPriority('isoWeekday', 11);\n\n    // PARSING\n\n    addRegexToken('d', match1to2);\n    addRegexToken('e', match1to2);\n    addRegexToken('E', match1to2);\n    addRegexToken('dd', function (isStrict, locale) {\n        return locale.weekdaysMinRegex(isStrict);\n    });\n    addRegexToken('ddd', function (isStrict, locale) {\n        return locale.weekdaysShortRegex(isStrict);\n    });\n    addRegexToken('dddd', function (isStrict, locale) {\n        return locale.weekdaysRegex(isStrict);\n    });\n\n    addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {\n        var weekday = config._locale.weekdaysParse(input, token, config._strict);\n        // if we didn't get a weekday name, mark the date as invalid\n        if (weekday != null) {\n            week.d = weekday;\n        } else {\n            getParsingFlags(config).invalidWeekday = input;\n        }\n    });\n\n    addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n        week[token] = toInt(input);\n    });\n\n    // HELPERS\n\n    function parseWeekday(input, locale) {\n        if (typeof input !== 'string') {\n            return input;\n        }\n\n        if (!isNaN(input)) {\n            return parseInt(input, 10);\n        }\n\n        input = locale.weekdaysParse(input);\n        if (typeof input === 'number') {\n            return input;\n        }\n\n        return null;\n    }\n\n    function parseIsoWeekday(input, locale) {\n        if (typeof input === 'string') {\n            return locale.weekdaysParse(input) % 7 || 7;\n        }\n        return isNaN(input) ? null : input;\n    }\n\n    // LOCALES\n    function shiftWeekdays(ws, n) {\n        return ws.slice(n, 7).concat(ws.slice(0, n));\n    }\n\n    var defaultLocaleWeekdays =\n            'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n        defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n        defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n        defaultWeekdaysRegex = matchWord,\n        defaultWeekdaysShortRegex = matchWord,\n        defaultWeekdaysMinRegex = matchWord;\n\n    function localeWeekdays(m, format) {\n        var weekdays = isArray(this._weekdays)\n            ? this._weekdays\n            : this._weekdays[\n                  m && m !== true && this._weekdays.isFormat.test(format)\n                      ? 'format'\n                      : 'standalone'\n              ];\n        return m === true\n            ? shiftWeekdays(weekdays, this._week.dow)\n            : m\n            ? weekdays[m.day()]\n            : weekdays;\n    }\n\n    function localeWeekdaysShort(m) {\n        return m === true\n            ? shiftWeekdays(this._weekdaysShort, this._week.dow)\n            : m\n            ? this._weekdaysShort[m.day()]\n            : this._weekdaysShort;\n    }\n\n    function localeWeekdaysMin(m) {\n        return m === true\n            ? shiftWeekdays(this._weekdaysMin, this._week.dow)\n            : m\n            ? this._weekdaysMin[m.day()]\n            : this._weekdaysMin;\n    }\n\n    function handleStrictParse$1(weekdayName, format, strict) {\n        var i,\n            ii,\n            mom,\n            llc = weekdayName.toLocaleLowerCase();\n        if (!this._weekdaysParse) {\n            this._weekdaysParse = [];\n            this._shortWeekdaysParse = [];\n            this._minWeekdaysParse = [];\n\n            for (i = 0; i < 7; ++i) {\n                mom = createUTC([2000, 1]).day(i);\n                this._minWeekdaysParse[i] = this.weekdaysMin(\n                    mom,\n                    ''\n                ).toLocaleLowerCase();\n                this._shortWeekdaysParse[i] = this.weekdaysShort(\n                    mom,\n                    ''\n                ).toLocaleLowerCase();\n                this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();\n            }\n        }\n\n        if (strict) {\n            if (format === 'dddd') {\n                ii = indexOf.call(this._weekdaysParse, llc);\n                return ii !== -1 ? ii : null;\n            } else if (format === 'ddd') {\n                ii = indexOf.call(this._shortWeekdaysParse, llc);\n                return ii !== -1 ? ii : null;\n            } else {\n                ii = indexOf.call(this._minWeekdaysParse, llc);\n                return ii !== -1 ? ii : null;\n            }\n        } else {\n            if (format === 'dddd') {\n                ii = indexOf.call(this._weekdaysParse, llc);\n                if (ii !== -1) {\n                    return ii;\n                }\n                ii = indexOf.call(this._shortWeekdaysParse, llc);\n                if (ii !== -1) {\n                    return ii;\n                }\n                ii = indexOf.call(this._minWeekdaysParse, llc);\n                return ii !== -1 ? ii : null;\n            } else if (format === 'ddd') {\n                ii = indexOf.call(this._shortWeekdaysParse, llc);\n                if (ii !== -1) {\n                    return ii;\n                }\n                ii = indexOf.call(this._weekdaysParse, llc);\n                if (ii !== -1) {\n                    return ii;\n                }\n                ii = indexOf.call(this._minWeekdaysParse, llc);\n                return ii !== -1 ? ii : null;\n            } else {\n                ii = indexOf.call(this._minWeekdaysParse, llc);\n                if (ii !== -1) {\n                    return ii;\n                }\n                ii = indexOf.call(this._weekdaysParse, llc);\n                if (ii !== -1) {\n                    return ii;\n                }\n                ii = indexOf.call(this._shortWeekdaysParse, llc);\n                return ii !== -1 ? ii : null;\n            }\n        }\n    }\n\n    function localeWeekdaysParse(weekdayName, format, strict) {\n        var i, mom, regex;\n\n        if (this._weekdaysParseExact) {\n            return handleStrictParse$1.call(this, weekdayName, format, strict);\n        }\n\n        if (!this._weekdaysParse) {\n            this._weekdaysParse = [];\n            this._minWeekdaysParse = [];\n            this._shortWeekdaysParse = [];\n            this._fullWeekdaysParse = [];\n        }\n\n        for (i = 0; i < 7; i++) {\n            // make the regex if we don't have it already\n\n            mom = createUTC([2000, 1]).day(i);\n            if (strict && !this._fullWeekdaysParse[i]) {\n                this._fullWeekdaysParse[i] = new RegExp(\n                    '^' + this.weekdays(mom, '').replace('.', '\\\\.?') + '$',\n                    'i'\n                );\n                this._shortWeekdaysParse[i] = new RegExp(\n                    '^' + this.weekdaysShort(mom, '').replace('.', '\\\\.?') + '$',\n                    'i'\n                );\n                this._minWeekdaysParse[i] = new RegExp(\n                    '^' + this.weekdaysMin(mom, '').replace('.', '\\\\.?') + '$',\n                    'i'\n                );\n            }\n            if (!this._weekdaysParse[i]) {\n                regex =\n                    '^' +\n                    this.weekdays(mom, '') +\n                    '|^' +\n                    this.weekdaysShort(mom, '') +\n                    '|^' +\n                    this.weekdaysMin(mom, '');\n                this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n            }\n            // test the regex\n            if (\n                strict &&\n                format === 'dddd' &&\n                this._fullWeekdaysParse[i].test(weekdayName)\n            ) {\n                return i;\n            } else if (\n                strict &&\n                format === 'ddd' &&\n                this._shortWeekdaysParse[i].test(weekdayName)\n            ) {\n                return i;\n            } else if (\n                strict &&\n                format === 'dd' &&\n                this._minWeekdaysParse[i].test(weekdayName)\n            ) {\n                return i;\n            } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {\n                return i;\n            }\n        }\n    }\n\n    // MOMENTS\n\n    function getSetDayOfWeek(input) {\n        if (!this.isValid()) {\n            return input != null ? this : NaN;\n        }\n        var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();\n        if (input != null) {\n            input = parseWeekday(input, this.localeData());\n            return this.add(input - day, 'd');\n        } else {\n            return day;\n        }\n    }\n\n    function getSetLocaleDayOfWeek(input) {\n        if (!this.isValid()) {\n            return input != null ? this : NaN;\n        }\n        var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n        return input == null ? weekday : this.add(input - weekday, 'd');\n    }\n\n    function getSetISODayOfWeek(input) {\n        if (!this.isValid()) {\n            return input != null ? this : NaN;\n        }\n\n        // behaves the same as moment#day except\n        // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n        // as a setter, sunday should belong to the previous week.\n\n        if (input != null) {\n            var weekday = parseIsoWeekday(input, this.localeData());\n            return this.day(this.day() % 7 ? weekday : weekday - 7);\n        } else {\n            return this.day() || 7;\n        }\n    }\n\n    function weekdaysRegex(isStrict) {\n        if (this._weekdaysParseExact) {\n            if (!hasOwnProp(this, '_weekdaysRegex')) {\n                computeWeekdaysParse.call(this);\n            }\n            if (isStrict) {\n                return this._weekdaysStrictRegex;\n            } else {\n                return this._weekdaysRegex;\n            }\n        } else {\n            if (!hasOwnProp(this, '_weekdaysRegex')) {\n                this._weekdaysRegex = defaultWeekdaysRegex;\n            }\n            return this._weekdaysStrictRegex && isStrict\n                ? this._weekdaysStrictRegex\n                : this._weekdaysRegex;\n        }\n    }\n\n    function weekdaysShortRegex(isStrict) {\n        if (this._weekdaysParseExact) {\n            if (!hasOwnProp(this, '_weekdaysRegex')) {\n                computeWeekdaysParse.call(this);\n            }\n            if (isStrict) {\n                return this._weekdaysShortStrictRegex;\n            } else {\n                return this._weekdaysShortRegex;\n            }\n        } else {\n            if (!hasOwnProp(this, '_weekdaysShortRegex')) {\n                this._weekdaysShortRegex = defaultWeekdaysShortRegex;\n            }\n            return this._weekdaysShortStrictRegex && isStrict\n                ? this._weekdaysShortStrictRegex\n                : this._weekdaysShortRegex;\n        }\n    }\n\n    function weekdaysMinRegex(isStrict) {\n        if (this._weekdaysParseExact) {\n            if (!hasOwnProp(this, '_weekdaysRegex')) {\n                computeWeekdaysParse.call(this);\n            }\n            if (isStrict) {\n                return this._weekdaysMinStrictRegex;\n            } else {\n                return this._weekdaysMinRegex;\n            }\n        } else {\n            if (!hasOwnProp(this, '_weekdaysMinRegex')) {\n                this._weekdaysMinRegex = defaultWeekdaysMinRegex;\n            }\n            return this._weekdaysMinStrictRegex && isStrict\n                ? this._weekdaysMinStrictRegex\n                : this._weekdaysMinRegex;\n        }\n    }\n\n    function computeWeekdaysParse() {\n        function cmpLenRev(a, b) {\n            return b.length - a.length;\n        }\n\n        var minPieces = [],\n            shortPieces = [],\n            longPieces = [],\n            mixedPieces = [],\n            i,\n            mom,\n            minp,\n            shortp,\n            longp;\n        for (i = 0; i < 7; i++) {\n            // make the regex if we don't have it already\n            mom = createUTC([2000, 1]).day(i);\n            minp = regexEscape(this.weekdaysMin(mom, ''));\n            shortp = regexEscape(this.weekdaysShort(mom, ''));\n            longp = regexEscape(this.weekdays(mom, ''));\n            minPieces.push(minp);\n            shortPieces.push(shortp);\n            longPieces.push(longp);\n            mixedPieces.push(minp);\n            mixedPieces.push(shortp);\n            mixedPieces.push(longp);\n        }\n        // Sorting makes sure if one weekday (or abbr) is a prefix of another it\n        // will match the longer piece.\n        minPieces.sort(cmpLenRev);\n        shortPieces.sort(cmpLenRev);\n        longPieces.sort(cmpLenRev);\n        mixedPieces.sort(cmpLenRev);\n\n        this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n        this._weekdaysShortRegex = this._weekdaysRegex;\n        this._weekdaysMinRegex = this._weekdaysRegex;\n\n        this._weekdaysStrictRegex = new RegExp(\n            '^(' + longPieces.join('|') + ')',\n            'i'\n        );\n        this._weekdaysShortStrictRegex = new RegExp(\n            '^(' + shortPieces.join('|') + ')',\n            'i'\n        );\n        this._weekdaysMinStrictRegex = new RegExp(\n            '^(' + minPieces.join('|') + ')',\n            'i'\n        );\n    }\n\n    // FORMATTING\n\n    function hFormat() {\n        return this.hours() % 12 || 12;\n    }\n\n    function kFormat() {\n        return this.hours() || 24;\n    }\n\n    addFormatToken('H', ['HH', 2], 0, 'hour');\n    addFormatToken('h', ['hh', 2], 0, hFormat);\n    addFormatToken('k', ['kk', 2], 0, kFormat);\n\n    addFormatToken('hmm', 0, 0, function () {\n        return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);\n    });\n\n    addFormatToken('hmmss', 0, 0, function () {\n        return (\n            '' +\n            hFormat.apply(this) +\n            zeroFill(this.minutes(), 2) +\n            zeroFill(this.seconds(), 2)\n        );\n    });\n\n    addFormatToken('Hmm', 0, 0, function () {\n        return '' + this.hours() + zeroFill(this.minutes(), 2);\n    });\n\n    addFormatToken('Hmmss', 0, 0, function () {\n        return (\n            '' +\n            this.hours() +\n            zeroFill(this.minutes(), 2) +\n            zeroFill(this.seconds(), 2)\n        );\n    });\n\n    function meridiem(token, lowercase) {\n        addFormatToken(token, 0, 0, function () {\n            return this.localeData().meridiem(\n                this.hours(),\n                this.minutes(),\n                lowercase\n            );\n        });\n    }\n\n    meridiem('a', true);\n    meridiem('A', false);\n\n    // ALIASES\n\n    addUnitAlias('hour', 'h');\n\n    // PRIORITY\n    addUnitPriority('hour', 13);\n\n    // PARSING\n\n    function matchMeridiem(isStrict, locale) {\n        return locale._meridiemParse;\n    }\n\n    addRegexToken('a', matchMeridiem);\n    addRegexToken('A', matchMeridiem);\n    addRegexToken('H', match1to2);\n    addRegexToken('h', match1to2);\n    addRegexToken('k', match1to2);\n    addRegexToken('HH', match1to2, match2);\n    addRegexToken('hh', match1to2, match2);\n    addRegexToken('kk', match1to2, match2);\n\n    addRegexToken('hmm', match3to4);\n    addRegexToken('hmmss', match5to6);\n    addRegexToken('Hmm', match3to4);\n    addRegexToken('Hmmss', match5to6);\n\n    addParseToken(['H', 'HH'], HOUR);\n    addParseToken(['k', 'kk'], function (input, array, config) {\n        var kInput = toInt(input);\n        array[HOUR] = kInput === 24 ? 0 : kInput;\n    });\n    addParseToken(['a', 'A'], function (input, array, config) {\n        config._isPm = config._locale.isPM(input);\n        config._meridiem = input;\n    });\n    addParseToken(['h', 'hh'], function (input, array, config) {\n        array[HOUR] = toInt(input);\n        getParsingFlags(config).bigHour = true;\n    });\n    addParseToken('hmm', function (input, array, config) {\n        var pos = input.length - 2;\n        array[HOUR] = toInt(input.substr(0, pos));\n        array[MINUTE] = toInt(input.substr(pos));\n        getParsingFlags(config).bigHour = true;\n    });\n    addParseToken('hmmss', function (input, array, config) {\n        var pos1 = input.length - 4,\n            pos2 = input.length - 2;\n        array[HOUR] = toInt(input.substr(0, pos1));\n        array[MINUTE] = toInt(input.substr(pos1, 2));\n        array[SECOND] = toInt(input.substr(pos2));\n        getParsingFlags(config).bigHour = true;\n    });\n    addParseToken('Hmm', function (input, array, config) {\n        var pos = input.length - 2;\n        array[HOUR] = toInt(input.substr(0, pos));\n        array[MINUTE] = toInt(input.substr(pos));\n    });\n    addParseToken('Hmmss', function (input, array, config) {\n        var pos1 = input.length - 4,\n            pos2 = input.length - 2;\n        array[HOUR] = toInt(input.substr(0, pos1));\n        array[MINUTE] = toInt(input.substr(pos1, 2));\n        array[SECOND] = toInt(input.substr(pos2));\n    });\n\n    // LOCALES\n\n    function localeIsPM(input) {\n        // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n        // Using charAt should be more compatible.\n        return (input + '').toLowerCase().charAt(0) === 'p';\n    }\n\n    var defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i,\n        // Setting the hour should keep the time, because the user explicitly\n        // specified which hour they want. So trying to maintain the same hour (in\n        // a new timezone) makes sense. Adding/subtracting hours does not follow\n        // this rule.\n        getSetHour = makeGetSet('Hours', true);\n\n    function localeMeridiem(hours, minutes, isLower) {\n        if (hours > 11) {\n            return isLower ? 'pm' : 'PM';\n        } else {\n            return isLower ? 'am' : 'AM';\n        }\n    }\n\n    var baseConfig = {\n        calendar: defaultCalendar,\n        longDateFormat: defaultLongDateFormat,\n        invalidDate: defaultInvalidDate,\n        ordinal: defaultOrdinal,\n        dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,\n        relativeTime: defaultRelativeTime,\n\n        months: defaultLocaleMonths,\n        monthsShort: defaultLocaleMonthsShort,\n\n        week: defaultLocaleWeek,\n\n        weekdays: defaultLocaleWeekdays,\n        weekdaysMin: defaultLocaleWeekdaysMin,\n        weekdaysShort: defaultLocaleWeekdaysShort,\n\n        meridiemParse: defaultLocaleMeridiemParse,\n    };\n\n    // internal storage for locale config files\n    var locales = {},\n        localeFamilies = {},\n        globalLocale;\n\n    function commonPrefix(arr1, arr2) {\n        var i,\n            minl = Math.min(arr1.length, arr2.length);\n        for (i = 0; i < minl; i += 1) {\n            if (arr1[i] !== arr2[i]) {\n                return i;\n            }\n        }\n        return minl;\n    }\n\n    function normalizeLocale(key) {\n        return key ? key.toLowerCase().replace('_', '-') : key;\n    }\n\n    // pick the locale from the array\n    // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n    // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n    function chooseLocale(names) {\n        var i = 0,\n            j,\n            next,\n            locale,\n            split;\n\n        while (i < names.length) {\n            split = normalizeLocale(names[i]).split('-');\n            j = split.length;\n            next = normalizeLocale(names[i + 1]);\n            next = next ? next.split('-') : null;\n            while (j > 0) {\n                locale = loadLocale(split.slice(0, j).join('-'));\n                if (locale) {\n                    return locale;\n                }\n                if (\n                    next &&\n                    next.length >= j &&\n                    commonPrefix(split, next) >= j - 1\n                ) {\n                    //the next array item is better than a shallower substring of this one\n                    break;\n                }\n                j--;\n            }\n            i++;\n        }\n        return globalLocale;\n    }\n\n    function isLocaleNameSane(name) {\n        // Prevent names that look like filesystem paths, i.e contain '/' or '\\'\n        return name.match('^[^/\\\\\\\\]*$') != null;\n    }\n\n    function loadLocale(name) {\n        var oldLocale = null,\n            aliasedRequire;\n        // TODO: Find a better way to register and load all the locales in Node\n        if (\n            locales[name] === undefined &&\n            typeof module !== 'undefined' &&\n            module &&\n            module.exports &&\n            isLocaleNameSane(name)\n        ) {\n            try {\n                oldLocale = globalLocale._abbr;\n                aliasedRequire = require;\n                aliasedRequire('./locale/' + name);\n                getSetGlobalLocale(oldLocale);\n            } catch (e) {\n                // mark as not found to avoid repeating expensive file require call causing high CPU\n                // when trying to find en-US, en_US, en-us for every format call\n                locales[name] = null; // null means not found\n            }\n        }\n        return locales[name];\n    }\n\n    // This function will load locale and then set the global locale.  If\n    // no arguments are passed in, it will simply return the current global\n    // locale key.\n    function getSetGlobalLocale(key, values) {\n        var data;\n        if (key) {\n            if (isUndefined(values)) {\n                data = getLocale(key);\n            } else {\n                data = defineLocale(key, values);\n            }\n\n            if (data) {\n                // moment.duration._locale = moment._locale = data;\n                globalLocale = data;\n            } else {\n                if (typeof console !== 'undefined' && console.warn) {\n                    //warn user if arguments are passed but the locale could not be set\n                    console.warn(\n                        'Locale ' + key + ' not found. Did you forget to load it?'\n                    );\n                }\n            }\n        }\n\n        return globalLocale._abbr;\n    }\n\n    function defineLocale(name, config) {\n        if (config !== null) {\n            var locale,\n                parentConfig = baseConfig;\n            config.abbr = name;\n            if (locales[name] != null) {\n                deprecateSimple(\n                    'defineLocaleOverride',\n                    'use moment.updateLocale(localeName, config) to change ' +\n                        'an existing locale. moment.defineLocale(localeName, ' +\n                        'config) should only be used for creating a new locale ' +\n                        'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'\n                );\n                parentConfig = locales[name]._config;\n            } else if (config.parentLocale != null) {\n                if (locales[config.parentLocale] != null) {\n                    parentConfig = locales[config.parentLocale]._config;\n                } else {\n                    locale = loadLocale(config.parentLocale);\n                    if (locale != null) {\n                        parentConfig = locale._config;\n                    } else {\n                        if (!localeFamilies[config.parentLocale]) {\n                            localeFamilies[config.parentLocale] = [];\n                        }\n                        localeFamilies[config.parentLocale].push({\n                            name: name,\n                            config: config,\n                        });\n                        return null;\n                    }\n                }\n            }\n            locales[name] = new Locale(mergeConfigs(parentConfig, config));\n\n            if (localeFamilies[name]) {\n                localeFamilies[name].forEach(function (x) {\n                    defineLocale(x.name, x.config);\n                });\n            }\n\n            // backwards compat for now: also set the locale\n            // make sure we set the locale AFTER all child locales have been\n            // created, so we won't end up with the child locale set.\n            getSetGlobalLocale(name);\n\n            return locales[name];\n        } else {\n            // useful for testing\n            delete locales[name];\n            return null;\n        }\n    }\n\n    function updateLocale(name, config) {\n        if (config != null) {\n            var locale,\n                tmpLocale,\n                parentConfig = baseConfig;\n\n            if (locales[name] != null && locales[name].parentLocale != null) {\n                // Update existing child locale in-place to avoid memory-leaks\n                locales[name].set(mergeConfigs(locales[name]._config, config));\n            } else {\n                // MERGE\n                tmpLocale = loadLocale(name);\n                if (tmpLocale != null) {\n                    parentConfig = tmpLocale._config;\n                }\n                config = mergeConfigs(parentConfig, config);\n                if (tmpLocale == null) {\n                    // updateLocale is called for creating a new locale\n                    // Set abbr so it will have a name (getters return\n                    // undefined otherwise).\n                    config.abbr = name;\n                }\n                locale = new Locale(config);\n                locale.parentLocale = locales[name];\n                locales[name] = locale;\n            }\n\n            // backwards compat for now: also set the locale\n            getSetGlobalLocale(name);\n        } else {\n            // pass null for config to unupdate, useful for tests\n            if (locales[name] != null) {\n                if (locales[name].parentLocale != null) {\n                    locales[name] = locales[name].parentLocale;\n                    if (name === getSetGlobalLocale()) {\n                        getSetGlobalLocale(name);\n                    }\n                } else if (locales[name] != null) {\n                    delete locales[name];\n                }\n            }\n        }\n        return locales[name];\n    }\n\n    // returns locale data\n    function getLocale(key) {\n        var locale;\n\n        if (key && key._locale && key._locale._abbr) {\n            key = key._locale._abbr;\n        }\n\n        if (!key) {\n            return globalLocale;\n        }\n\n        if (!isArray(key)) {\n            //short-circuit everything else\n            locale = loadLocale(key);\n            if (locale) {\n                return locale;\n            }\n            key = [key];\n        }\n\n        return chooseLocale(key);\n    }\n\n    function listLocales() {\n        return keys(locales);\n    }\n\n    function checkOverflow(m) {\n        var overflow,\n            a = m._a;\n\n        if (a && getParsingFlags(m).overflow === -2) {\n            overflow =\n                a[MONTH] < 0 || a[MONTH] > 11\n                    ? MONTH\n                    : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])\n                    ? DATE\n                    : a[HOUR] < 0 ||\n                      a[HOUR] > 24 ||\n                      (a[HOUR] === 24 &&\n                          (a[MINUTE] !== 0 ||\n                              a[SECOND] !== 0 ||\n                              a[MILLISECOND] !== 0))\n                    ? HOUR\n                    : a[MINUTE] < 0 || a[MINUTE] > 59\n                    ? MINUTE\n                    : a[SECOND] < 0 || a[SECOND] > 59\n                    ? SECOND\n                    : a[MILLISECOND] < 0 || a[MILLISECOND] > 999\n                    ? MILLISECOND\n                    : -1;\n\n            if (\n                getParsingFlags(m)._overflowDayOfYear &&\n                (overflow < YEAR || overflow > DATE)\n            ) {\n                overflow = DATE;\n            }\n            if (getParsingFlags(m)._overflowWeeks && overflow === -1) {\n                overflow = WEEK;\n            }\n            if (getParsingFlags(m)._overflowWeekday && overflow === -1) {\n                overflow = WEEKDAY;\n            }\n\n            getParsingFlags(m).overflow = overflow;\n        }\n\n        return m;\n    }\n\n    // iso 8601 regex\n    // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)\n    var extendedIsoRegex =\n            /^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,\n        basicIsoRegex =\n            /^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d|))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,\n        tzRegex = /Z|[+-]\\d\\d(?::?\\d\\d)?/,\n        isoDates = [\n            ['YYYYYY-MM-DD', /[+-]\\d{6}-\\d\\d-\\d\\d/],\n            ['YYYY-MM-DD', /\\d{4}-\\d\\d-\\d\\d/],\n            ['GGGG-[W]WW-E', /\\d{4}-W\\d\\d-\\d/],\n            ['GGGG-[W]WW', /\\d{4}-W\\d\\d/, false],\n            ['YYYY-DDD', /\\d{4}-\\d{3}/],\n            ['YYYY-MM', /\\d{4}-\\d\\d/, false],\n            ['YYYYYYMMDD', /[+-]\\d{10}/],\n            ['YYYYMMDD', /\\d{8}/],\n            ['GGGG[W]WWE', /\\d{4}W\\d{3}/],\n            ['GGGG[W]WW', /\\d{4}W\\d{2}/, false],\n            ['YYYYDDD', /\\d{7}/],\n            ['YYYYMM', /\\d{6}/, false],\n            ['YYYY', /\\d{4}/, false],\n        ],\n        // iso time formats and regexes\n        isoTimes = [\n            ['HH:mm:ss.SSSS', /\\d\\d:\\d\\d:\\d\\d\\.\\d+/],\n            ['HH:mm:ss,SSSS', /\\d\\d:\\d\\d:\\d\\d,\\d+/],\n            ['HH:mm:ss', /\\d\\d:\\d\\d:\\d\\d/],\n            ['HH:mm', /\\d\\d:\\d\\d/],\n            ['HHmmss.SSSS', /\\d\\d\\d\\d\\d\\d\\.\\d+/],\n            ['HHmmss,SSSS', /\\d\\d\\d\\d\\d\\d,\\d+/],\n            ['HHmmss', /\\d\\d\\d\\d\\d\\d/],\n            ['HHmm', /\\d\\d\\d\\d/],\n            ['HH', /\\d\\d/],\n        ],\n        aspNetJsonRegex = /^\\/?Date\\((-?\\d+)/i,\n        // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3\n        rfc2822 =\n            /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/,\n        obsOffsets = {\n            UT: 0,\n            GMT: 0,\n            EDT: -4 * 60,\n            EST: -5 * 60,\n            CDT: -5 * 60,\n            CST: -6 * 60,\n            MDT: -6 * 60,\n            MST: -7 * 60,\n            PDT: -7 * 60,\n            PST: -8 * 60,\n        };\n\n    // date from iso format\n    function configFromISO(config) {\n        var i,\n            l,\n            string = config._i,\n            match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),\n            allowTime,\n            dateFormat,\n            timeFormat,\n            tzFormat,\n            isoDatesLen = isoDates.length,\n            isoTimesLen = isoTimes.length;\n\n        if (match) {\n            getParsingFlags(config).iso = true;\n            for (i = 0, l = isoDatesLen; i < l; i++) {\n                if (isoDates[i][1].exec(match[1])) {\n                    dateFormat = isoDates[i][0];\n                    allowTime = isoDates[i][2] !== false;\n                    break;\n                }\n            }\n            if (dateFormat == null) {\n                config._isValid = false;\n                return;\n            }\n            if (match[3]) {\n                for (i = 0, l = isoTimesLen; i < l; i++) {\n                    if (isoTimes[i][1].exec(match[3])) {\n                        // match[2] should be 'T' or space\n                        timeFormat = (match[2] || ' ') + isoTimes[i][0];\n                        break;\n                    }\n                }\n                if (timeFormat == null) {\n                    config._isValid = false;\n                    return;\n                }\n            }\n            if (!allowTime && timeFormat != null) {\n                config._isValid = false;\n                return;\n            }\n            if (match[4]) {\n                if (tzRegex.exec(match[4])) {\n                    tzFormat = 'Z';\n                } else {\n                    config._isValid = false;\n                    return;\n                }\n            }\n            config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n            configFromStringAndFormat(config);\n        } else {\n            config._isValid = false;\n        }\n    }\n\n    function extractFromRFC2822Strings(\n        yearStr,\n        monthStr,\n        dayStr,\n        hourStr,\n        minuteStr,\n        secondStr\n    ) {\n        var result = [\n            untruncateYear(yearStr),\n            defaultLocaleMonthsShort.indexOf(monthStr),\n            parseInt(dayStr, 10),\n            parseInt(hourStr, 10),\n            parseInt(minuteStr, 10),\n        ];\n\n        if (secondStr) {\n            result.push(parseInt(secondStr, 10));\n        }\n\n        return result;\n    }\n\n    function untruncateYear(yearStr) {\n        var year = parseInt(yearStr, 10);\n        if (year <= 49) {\n            return 2000 + year;\n        } else if (year <= 999) {\n            return 1900 + year;\n        }\n        return year;\n    }\n\n    function preprocessRFC2822(s) {\n        // Remove comments and folding whitespace and replace multiple-spaces with a single space\n        return s\n            .replace(/\\([^()]*\\)|[\\n\\t]/g, ' ')\n            .replace(/(\\s\\s+)/g, ' ')\n            .replace(/^\\s\\s*/, '')\n            .replace(/\\s\\s*$/, '');\n    }\n\n    function checkWeekday(weekdayStr, parsedInput, config) {\n        if (weekdayStr) {\n            // TODO: Replace the vanilla JS Date object with an independent day-of-week check.\n            var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),\n                weekdayActual = new Date(\n                    parsedInput[0],\n                    parsedInput[1],\n                    parsedInput[2]\n                ).getDay();\n            if (weekdayProvided !== weekdayActual) {\n                getParsingFlags(config).weekdayMismatch = true;\n                config._isValid = false;\n                return false;\n            }\n        }\n        return true;\n    }\n\n    function calculateOffset(obsOffset, militaryOffset, numOffset) {\n        if (obsOffset) {\n            return obsOffsets[obsOffset];\n        } else if (militaryOffset) {\n            // the only allowed military tz is Z\n            return 0;\n        } else {\n            var hm = parseInt(numOffset, 10),\n                m = hm % 100,\n                h = (hm - m) / 100;\n            return h * 60 + m;\n        }\n    }\n\n    // date and time from ref 2822 format\n    function configFromRFC2822(config) {\n        var match = rfc2822.exec(preprocessRFC2822(config._i)),\n            parsedArray;\n        if (match) {\n            parsedArray = extractFromRFC2822Strings(\n                match[4],\n                match[3],\n                match[2],\n                match[5],\n                match[6],\n                match[7]\n            );\n            if (!checkWeekday(match[1], parsedArray, config)) {\n                return;\n            }\n\n            config._a = parsedArray;\n            config._tzm = calculateOffset(match[8], match[9], match[10]);\n\n            config._d = createUTCDate.apply(null, config._a);\n            config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\n            getParsingFlags(config).rfc2822 = true;\n        } else {\n            config._isValid = false;\n        }\n    }\n\n    // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict\n    function configFromString(config) {\n        var matched = aspNetJsonRegex.exec(config._i);\n        if (matched !== null) {\n            config._d = new Date(+matched[1]);\n            return;\n        }\n\n        configFromISO(config);\n        if (config._isValid === false) {\n            delete config._isValid;\n        } else {\n            return;\n        }\n\n        configFromRFC2822(config);\n        if (config._isValid === false) {\n            delete config._isValid;\n        } else {\n            return;\n        }\n\n        if (config._strict) {\n            config._isValid = false;\n        } else {\n            // Final attempt, use Input Fallback\n            hooks.createFromInputFallback(config);\n        }\n    }\n\n    hooks.createFromInputFallback = deprecate(\n        'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +\n            'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +\n            'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.',\n        function (config) {\n            config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n        }\n    );\n\n    // Pick the first defined of two or three arguments.\n    function defaults(a, b, c) {\n        if (a != null) {\n            return a;\n        }\n        if (b != null) {\n            return b;\n        }\n        return c;\n    }\n\n    function currentDateArray(config) {\n        // hooks is actually the exported moment object\n        var nowValue = new Date(hooks.now());\n        if (config._useUTC) {\n            return [\n                nowValue.getUTCFullYear(),\n                nowValue.getUTCMonth(),\n                nowValue.getUTCDate(),\n            ];\n        }\n        return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];\n    }\n\n    // convert an array to a date.\n    // the array should mirror the parameters below\n    // note: all values past the year are optional and will default to the lowest possible value.\n    // [year, month, day , hour, minute, second, millisecond]\n    function configFromArray(config) {\n        var i,\n            date,\n            input = [],\n            currentDate,\n            expectedWeekday,\n            yearToUse;\n\n        if (config._d) {\n            return;\n        }\n\n        currentDate = currentDateArray(config);\n\n        //compute day of the year from weeks and weekdays\n        if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n            dayOfYearFromWeekInfo(config);\n        }\n\n        //if the day of the year is set, figure out what it is\n        if (config._dayOfYear != null) {\n            yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n            if (\n                config._dayOfYear > daysInYear(yearToUse) ||\n                config._dayOfYear === 0\n            ) {\n                getParsingFlags(config)._overflowDayOfYear = true;\n            }\n\n            date = createUTCDate(yearToUse, 0, config._dayOfYear);\n            config._a[MONTH] = date.getUTCMonth();\n            config._a[DATE] = date.getUTCDate();\n        }\n\n        // Default to current date.\n        // * if no year, month, day of month are given, default to today\n        // * if day of month is given, default month and year\n        // * if month is given, default only year\n        // * if year is given, don't default anything\n        for (i = 0; i < 3 && config._a[i] == null; ++i) {\n            config._a[i] = input[i] = currentDate[i];\n        }\n\n        // Zero out whatever was not defaulted, including time\n        for (; i < 7; i++) {\n            config._a[i] = input[i] =\n                config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i];\n        }\n\n        // Check for 24:00:00.000\n        if (\n            config._a[HOUR] === 24 &&\n            config._a[MINUTE] === 0 &&\n            config._a[SECOND] === 0 &&\n            config._a[MILLISECOND] === 0\n        ) {\n            config._nextDay = true;\n            config._a[HOUR] = 0;\n        }\n\n        config._d = (config._useUTC ? createUTCDate : createDate).apply(\n            null,\n            input\n        );\n        expectedWeekday = config._useUTC\n            ? config._d.getUTCDay()\n            : config._d.getDay();\n\n        // Apply timezone offset from input. The actual utcOffset can be changed\n        // with parseZone.\n        if (config._tzm != null) {\n            config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n        }\n\n        if (config._nextDay) {\n            config._a[HOUR] = 24;\n        }\n\n        // check for mismatching day of week\n        if (\n            config._w &&\n            typeof config._w.d !== 'undefined' &&\n            config._w.d !== expectedWeekday\n        ) {\n            getParsingFlags(config).weekdayMismatch = true;\n        }\n    }\n\n    function dayOfYearFromWeekInfo(config) {\n        var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;\n\n        w = config._w;\n        if (w.GG != null || w.W != null || w.E != null) {\n            dow = 1;\n            doy = 4;\n\n            // TODO: We need to take the current isoWeekYear, but that depends on\n            // how we interpret now (local, utc, fixed offset). So create\n            // a now version of current config (take local/utc/offset flags, and\n            // create now).\n            weekYear = defaults(\n                w.GG,\n                config._a[YEAR],\n                weekOfYear(createLocal(), 1, 4).year\n            );\n            week = defaults(w.W, 1);\n            weekday = defaults(w.E, 1);\n            if (weekday < 1 || weekday > 7) {\n                weekdayOverflow = true;\n            }\n        } else {\n            dow = config._locale._week.dow;\n            doy = config._locale._week.doy;\n\n            curWeek = weekOfYear(createLocal(), dow, doy);\n\n            weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);\n\n            // Default to current week.\n            week = defaults(w.w, curWeek.week);\n\n            if (w.d != null) {\n                // weekday -- low day numbers are considered next week\n                weekday = w.d;\n                if (weekday < 0 || weekday > 6) {\n                    weekdayOverflow = true;\n                }\n            } else if (w.e != null) {\n                // local weekday -- counting starts from beginning of week\n                weekday = w.e + dow;\n                if (w.e < 0 || w.e > 6) {\n                    weekdayOverflow = true;\n                }\n            } else {\n                // default to beginning of week\n                weekday = dow;\n            }\n        }\n        if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {\n            getParsingFlags(config)._overflowWeeks = true;\n        } else if (weekdayOverflow != null) {\n            getParsingFlags(config)._overflowWeekday = true;\n        } else {\n            temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);\n            config._a[YEAR] = temp.year;\n            config._dayOfYear = temp.dayOfYear;\n        }\n    }\n\n    // constant that refers to the ISO standard\n    hooks.ISO_8601 = function () {};\n\n    // constant that refers to the RFC 2822 form\n    hooks.RFC_2822 = function () {};\n\n    // date from string and format string\n    function configFromStringAndFormat(config) {\n        // TODO: Move this to another part of the creation flow to prevent circular deps\n        if (config._f === hooks.ISO_8601) {\n            configFromISO(config);\n            return;\n        }\n        if (config._f === hooks.RFC_2822) {\n            configFromRFC2822(config);\n            return;\n        }\n        config._a = [];\n        getParsingFlags(config).empty = true;\n\n        // This array is used to make a Date, either with `new Date` or `Date.UTC`\n        var string = '' + config._i,\n            i,\n            parsedInput,\n            tokens,\n            token,\n            skipped,\n            stringLength = string.length,\n            totalParsedInputLength = 0,\n            era,\n            tokenLen;\n\n        tokens =\n            expandFormat(config._f, config._locale).match(formattingTokens) || [];\n        tokenLen = tokens.length;\n        for (i = 0; i < tokenLen; i++) {\n            token = tokens[i];\n            parsedInput = (string.match(getParseRegexForToken(token, config)) ||\n                [])[0];\n            if (parsedInput) {\n                skipped = string.substr(0, string.indexOf(parsedInput));\n                if (skipped.length > 0) {\n                    getParsingFlags(config).unusedInput.push(skipped);\n                }\n                string = string.slice(\n                    string.indexOf(parsedInput) + parsedInput.length\n                );\n                totalParsedInputLength += parsedInput.length;\n            }\n            // don't parse if it's not a known token\n            if (formatTokenFunctions[token]) {\n                if (parsedInput) {\n                    getParsingFlags(config).empty = false;\n                } else {\n                    getParsingFlags(config).unusedTokens.push(token);\n                }\n                addTimeToArrayFromToken(token, parsedInput, config);\n            } else if (config._strict && !parsedInput) {\n                getParsingFlags(config).unusedTokens.push(token);\n            }\n        }\n\n        // add remaining unparsed input length to the string\n        getParsingFlags(config).charsLeftOver =\n            stringLength - totalParsedInputLength;\n        if (string.length > 0) {\n            getParsingFlags(config).unusedInput.push(string);\n        }\n\n        // clear _12h flag if hour is <= 12\n        if (\n            config._a[HOUR] <= 12 &&\n            getParsingFlags(config).bigHour === true &&\n            config._a[HOUR] > 0\n        ) {\n            getParsingFlags(config).bigHour = undefined;\n        }\n\n        getParsingFlags(config).parsedDateParts = config._a.slice(0);\n        getParsingFlags(config).meridiem = config._meridiem;\n        // handle meridiem\n        config._a[HOUR] = meridiemFixWrap(\n            config._locale,\n            config._a[HOUR],\n            config._meridiem\n        );\n\n        // handle era\n        era = getParsingFlags(config).era;\n        if (era !== null) {\n            config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);\n        }\n\n        configFromArray(config);\n        checkOverflow(config);\n    }\n\n    function meridiemFixWrap(locale, hour, meridiem) {\n        var isPm;\n\n        if (meridiem == null) {\n            // nothing to do\n            return hour;\n        }\n        if (locale.meridiemHour != null) {\n            return locale.meridiemHour(hour, meridiem);\n        } else if (locale.isPM != null) {\n            // Fallback\n            isPm = locale.isPM(meridiem);\n            if (isPm && hour < 12) {\n                hour += 12;\n            }\n            if (!isPm && hour === 12) {\n                hour = 0;\n            }\n            return hour;\n        } else {\n            // this is not supposed to happen\n            return hour;\n        }\n    }\n\n    // date from string and array of format strings\n    function configFromStringAndArray(config) {\n        var tempConfig,\n            bestMoment,\n            scoreToBeat,\n            i,\n            currentScore,\n            validFormatFound,\n            bestFormatIsValid = false,\n            configfLen = config._f.length;\n\n        if (configfLen === 0) {\n            getParsingFlags(config).invalidFormat = true;\n            config._d = new Date(NaN);\n            return;\n        }\n\n        for (i = 0; i < configfLen; i++) {\n            currentScore = 0;\n            validFormatFound = false;\n            tempConfig = copyConfig({}, config);\n            if (config._useUTC != null) {\n                tempConfig._useUTC = config._useUTC;\n            }\n            tempConfig._f = config._f[i];\n            configFromStringAndFormat(tempConfig);\n\n            if (isValid(tempConfig)) {\n                validFormatFound = true;\n            }\n\n            // if there is any input that was not parsed add a penalty for that format\n            currentScore += getParsingFlags(tempConfig).charsLeftOver;\n\n            //or tokens\n            currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;\n\n            getParsingFlags(tempConfig).score = currentScore;\n\n            if (!bestFormatIsValid) {\n                if (\n                    scoreToBeat == null ||\n                    currentScore < scoreToBeat ||\n                    validFormatFound\n                ) {\n                    scoreToBeat = currentScore;\n                    bestMoment = tempConfig;\n                    if (validFormatFound) {\n                        bestFormatIsValid = true;\n                    }\n                }\n            } else {\n                if (currentScore < scoreToBeat) {\n                    scoreToBeat = currentScore;\n                    bestMoment = tempConfig;\n                }\n            }\n        }\n\n        extend(config, bestMoment || tempConfig);\n    }\n\n    function configFromObject(config) {\n        if (config._d) {\n            return;\n        }\n\n        var i = normalizeObjectUnits(config._i),\n            dayOrDate = i.day === undefined ? i.date : i.day;\n        config._a = map(\n            [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],\n            function (obj) {\n                return obj && parseInt(obj, 10);\n            }\n        );\n\n        configFromArray(config);\n    }\n\n    function createFromConfig(config) {\n        var res = new Moment(checkOverflow(prepareConfig(config)));\n        if (res._nextDay) {\n            // Adding is smart enough around DST\n            res.add(1, 'd');\n            res._nextDay = undefined;\n        }\n\n        return res;\n    }\n\n    function prepareConfig(config) {\n        var input = config._i,\n            format = config._f;\n\n        config._locale = config._locale || getLocale(config._l);\n\n        if (input === null || (format === undefined && input === '')) {\n            return createInvalid({ nullInput: true });\n        }\n\n        if (typeof input === 'string') {\n            config._i = input = config._locale.preparse(input);\n        }\n\n        if (isMoment(input)) {\n            return new Moment(checkOverflow(input));\n        } else if (isDate(input)) {\n            config._d = input;\n        } else if (isArray(format)) {\n            configFromStringAndArray(config);\n        } else if (format) {\n            configFromStringAndFormat(config);\n        } else {\n            configFromInput(config);\n        }\n\n        if (!isValid(config)) {\n            config._d = null;\n        }\n\n        return config;\n    }\n\n    function configFromInput(config) {\n        var input = config._i;\n        if (isUndefined(input)) {\n            config._d = new Date(hooks.now());\n        } else if (isDate(input)) {\n            config._d = new Date(input.valueOf());\n        } else if (typeof input === 'string') {\n            configFromString(config);\n        } else if (isArray(input)) {\n            config._a = map(input.slice(0), function (obj) {\n                return parseInt(obj, 10);\n            });\n            configFromArray(config);\n        } else if (isObject(input)) {\n            configFromObject(config);\n        } else if (isNumber(input)) {\n            // from milliseconds\n            config._d = new Date(input);\n        } else {\n            hooks.createFromInputFallback(config);\n        }\n    }\n\n    function createLocalOrUTC(input, format, locale, strict, isUTC) {\n        var c = {};\n\n        if (format === true || format === false) {\n            strict = format;\n            format = undefined;\n        }\n\n        if (locale === true || locale === false) {\n            strict = locale;\n            locale = undefined;\n        }\n\n        if (\n            (isObject(input) && isObjectEmpty(input)) ||\n            (isArray(input) && input.length === 0)\n        ) {\n            input = undefined;\n        }\n        // object construction must be done this way.\n        // https://github.com/moment/moment/issues/1423\n        c._isAMomentObject = true;\n        c._useUTC = c._isUTC = isUTC;\n        c._l = locale;\n        c._i = input;\n        c._f = format;\n        c._strict = strict;\n\n        return createFromConfig(c);\n    }\n\n    function createLocal(input, format, locale, strict) {\n        return createLocalOrUTC(input, format, locale, strict, false);\n    }\n\n    var prototypeMin = deprecate(\n            'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',\n            function () {\n                var other = createLocal.apply(null, arguments);\n                if (this.isValid() && other.isValid()) {\n                    return other < this ? this : other;\n                } else {\n                    return createInvalid();\n                }\n            }\n        ),\n        prototypeMax = deprecate(\n            'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',\n            function () {\n                var other = createLocal.apply(null, arguments);\n                if (this.isValid() && other.isValid()) {\n                    return other > this ? this : other;\n                } else {\n                    return createInvalid();\n                }\n            }\n        );\n\n    // Pick a moment m from moments so that m[fn](other) is true for all\n    // other. This relies on the function fn to be transitive.\n    //\n    // moments should either be an array of moment objects or an array, whose\n    // first element is an array of moment objects.\n    function pickBy(fn, moments) {\n        var res, i;\n        if (moments.length === 1 && isArray(moments[0])) {\n            moments = moments[0];\n        }\n        if (!moments.length) {\n            return createLocal();\n        }\n        res = moments[0];\n        for (i = 1; i < moments.length; ++i) {\n            if (!moments[i].isValid() || moments[i][fn](res)) {\n                res = moments[i];\n            }\n        }\n        return res;\n    }\n\n    // TODO: Use [].sort instead?\n    function min() {\n        var args = [].slice.call(arguments, 0);\n\n        return pickBy('isBefore', args);\n    }\n\n    function max() {\n        var args = [].slice.call(arguments, 0);\n\n        return pickBy('isAfter', args);\n    }\n\n    var now = function () {\n        return Date.now ? Date.now() : +new Date();\n    };\n\n    var ordering = [\n        'year',\n        'quarter',\n        'month',\n        'week',\n        'day',\n        'hour',\n        'minute',\n        'second',\n        'millisecond',\n    ];\n\n    function isDurationValid(m) {\n        var key,\n            unitHasDecimal = false,\n            i,\n            orderLen = ordering.length;\n        for (key in m) {\n            if (\n                hasOwnProp(m, key) &&\n                !(\n                    indexOf.call(ordering, key) !== -1 &&\n                    (m[key] == null || !isNaN(m[key]))\n                )\n            ) {\n                return false;\n            }\n        }\n\n        for (i = 0; i < orderLen; ++i) {\n            if (m[ordering[i]]) {\n                if (unitHasDecimal) {\n                    return false; // only allow non-integers for smallest unit\n                }\n                if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {\n                    unitHasDecimal = true;\n                }\n            }\n        }\n\n        return true;\n    }\n\n    function isValid$1() {\n        return this._isValid;\n    }\n\n    function createInvalid$1() {\n        return createDuration(NaN);\n    }\n\n    function Duration(duration) {\n        var normalizedInput = normalizeObjectUnits(duration),\n            years = normalizedInput.year || 0,\n            quarters = normalizedInput.quarter || 0,\n            months = normalizedInput.month || 0,\n            weeks = normalizedInput.week || normalizedInput.isoWeek || 0,\n            days = normalizedInput.day || 0,\n            hours = normalizedInput.hour || 0,\n            minutes = normalizedInput.minute || 0,\n            seconds = normalizedInput.second || 0,\n            milliseconds = normalizedInput.millisecond || 0;\n\n        this._isValid = isDurationValid(normalizedInput);\n\n        // representation for dateAddRemove\n        this._milliseconds =\n            +milliseconds +\n            seconds * 1e3 + // 1000\n            minutes * 6e4 + // 1000 * 60\n            hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978\n        // Because of dateAddRemove treats 24 hours as different from a\n        // day when working around DST, we need to store them separately\n        this._days = +days + weeks * 7;\n        // It is impossible to translate months into days without knowing\n        // which months you are are talking about, so we have to store\n        // it separately.\n        this._months = +months + quarters * 3 + years * 12;\n\n        this._data = {};\n\n        this._locale = getLocale();\n\n        this._bubble();\n    }\n\n    function isDuration(obj) {\n        return obj instanceof Duration;\n    }\n\n    function absRound(number) {\n        if (number < 0) {\n            return Math.round(-1 * number) * -1;\n        } else {\n            return Math.round(number);\n        }\n    }\n\n    // compare two arrays, return the number of differences\n    function compareArrays(array1, array2, dontConvert) {\n        var len = Math.min(array1.length, array2.length),\n            lengthDiff = Math.abs(array1.length - array2.length),\n            diffs = 0,\n            i;\n        for (i = 0; i < len; i++) {\n            if (\n                (dontConvert && array1[i] !== array2[i]) ||\n                (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))\n            ) {\n                diffs++;\n            }\n        }\n        return diffs + lengthDiff;\n    }\n\n    // FORMATTING\n\n    function offset(token, separator) {\n        addFormatToken(token, 0, 0, function () {\n            var offset = this.utcOffset(),\n                sign = '+';\n            if (offset < 0) {\n                offset = -offset;\n                sign = '-';\n            }\n            return (\n                sign +\n                zeroFill(~~(offset / 60), 2) +\n                separator +\n                zeroFill(~~offset % 60, 2)\n            );\n        });\n    }\n\n    offset('Z', ':');\n    offset('ZZ', '');\n\n    // PARSING\n\n    addRegexToken('Z', matchShortOffset);\n    addRegexToken('ZZ', matchShortOffset);\n    addParseToken(['Z', 'ZZ'], function (input, array, config) {\n        config._useUTC = true;\n        config._tzm = offsetFromString(matchShortOffset, input);\n    });\n\n    // HELPERS\n\n    // timezone chunker\n    // '+10:00' > ['10',  '00']\n    // '-1530'  > ['-15', '30']\n    var chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n\n    function offsetFromString(matcher, string) {\n        var matches = (string || '').match(matcher),\n            chunk,\n            parts,\n            minutes;\n\n        if (matches === null) {\n            return null;\n        }\n\n        chunk = matches[matches.length - 1] || [];\n        parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n        minutes = +(parts[1] * 60) + toInt(parts[2]);\n\n        return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;\n    }\n\n    // Return a moment from input, that is local/utc/zone equivalent to model.\n    function cloneWithOffset(input, model) {\n        var res, diff;\n        if (model._isUTC) {\n            res = model.clone();\n            diff =\n                (isMoment(input) || isDate(input)\n                    ? input.valueOf()\n                    : createLocal(input).valueOf()) - res.valueOf();\n            // Use low-level api, because this fn is low-level api.\n            res._d.setTime(res._d.valueOf() + diff);\n            hooks.updateOffset(res, false);\n            return res;\n        } else {\n            return createLocal(input).local();\n        }\n    }\n\n    function getDateOffset(m) {\n        // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n        // https://github.com/moment/moment/pull/1871\n        return -Math.round(m._d.getTimezoneOffset());\n    }\n\n    // HOOKS\n\n    // This function will be called whenever a moment is mutated.\n    // It is intended to keep the offset in sync with the timezone.\n    hooks.updateOffset = function () {};\n\n    // MOMENTS\n\n    // keepLocalTime = true means only change the timezone, without\n    // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n    // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n    // +0200, so we adjust the time as needed, to be valid.\n    //\n    // Keeping the time actually adds/subtracts (one hour)\n    // from the actual represented time. That is why we call updateOffset\n    // a second time. In case it wants us to change the offset again\n    // _changeInProgress == true case, then we have to adjust, because\n    // there is no such time in the given timezone.\n    function getSetOffset(input, keepLocalTime, keepMinutes) {\n        var offset = this._offset || 0,\n            localAdjust;\n        if (!this.isValid()) {\n            return input != null ? this : NaN;\n        }\n        if (input != null) {\n            if (typeof input === 'string') {\n                input = offsetFromString(matchShortOffset, input);\n                if (input === null) {\n                    return this;\n                }\n            } else if (Math.abs(input) < 16 && !keepMinutes) {\n                input = input * 60;\n            }\n            if (!this._isUTC && keepLocalTime) {\n                localAdjust = getDateOffset(this);\n            }\n            this._offset = input;\n            this._isUTC = true;\n            if (localAdjust != null) {\n                this.add(localAdjust, 'm');\n            }\n            if (offset !== input) {\n                if (!keepLocalTime || this._changeInProgress) {\n                    addSubtract(\n                        this,\n                        createDuration(input - offset, 'm'),\n                        1,\n                        false\n                    );\n                } else if (!this._changeInProgress) {\n                    this._changeInProgress = true;\n                    hooks.updateOffset(this, true);\n                    this._changeInProgress = null;\n                }\n            }\n            return this;\n        } else {\n            return this._isUTC ? offset : getDateOffset(this);\n        }\n    }\n\n    function getSetZone(input, keepLocalTime) {\n        if (input != null) {\n            if (typeof input !== 'string') {\n                input = -input;\n            }\n\n            this.utcOffset(input, keepLocalTime);\n\n            return this;\n        } else {\n            return -this.utcOffset();\n        }\n    }\n\n    function setOffsetToUTC(keepLocalTime) {\n        return this.utcOffset(0, keepLocalTime);\n    }\n\n    function setOffsetToLocal(keepLocalTime) {\n        if (this._isUTC) {\n            this.utcOffset(0, keepLocalTime);\n            this._isUTC = false;\n\n            if (keepLocalTime) {\n                this.subtract(getDateOffset(this), 'm');\n            }\n        }\n        return this;\n    }\n\n    function setOffsetToParsedOffset() {\n        if (this._tzm != null) {\n            this.utcOffset(this._tzm, false, true);\n        } else if (typeof this._i === 'string') {\n            var tZone = offsetFromString(matchOffset, this._i);\n            if (tZone != null) {\n                this.utcOffset(tZone);\n            } else {\n                this.utcOffset(0, true);\n            }\n        }\n        return this;\n    }\n\n    function hasAlignedHourOffset(input) {\n        if (!this.isValid()) {\n            return false;\n        }\n        input = input ? createLocal(input).utcOffset() : 0;\n\n        return (this.utcOffset() - input) % 60 === 0;\n    }\n\n    function isDaylightSavingTime() {\n        return (\n            this.utcOffset() > this.clone().month(0).utcOffset() ||\n            this.utcOffset() > this.clone().month(5).utcOffset()\n        );\n    }\n\n    function isDaylightSavingTimeShifted() {\n        if (!isUndefined(this._isDSTShifted)) {\n            return this._isDSTShifted;\n        }\n\n        var c = {},\n            other;\n\n        copyConfig(c, this);\n        c = prepareConfig(c);\n\n        if (c._a) {\n            other = c._isUTC ? createUTC(c._a) : createLocal(c._a);\n            this._isDSTShifted =\n                this.isValid() && compareArrays(c._a, other.toArray()) > 0;\n        } else {\n            this._isDSTShifted = false;\n        }\n\n        return this._isDSTShifted;\n    }\n\n    function isLocal() {\n        return this.isValid() ? !this._isUTC : false;\n    }\n\n    function isUtcOffset() {\n        return this.isValid() ? this._isUTC : false;\n    }\n\n    function isUtc() {\n        return this.isValid() ? this._isUTC && this._offset === 0 : false;\n    }\n\n    // ASP.NET json date format regex\n    var aspNetRegex = /^(-|\\+)?(?:(\\d*)[. ])?(\\d+):(\\d+)(?::(\\d+)(\\.\\d*)?)?$/,\n        // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n        // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n        // and further modified to allow for strings containing both week and day\n        isoRegex =\n            /^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;\n\n    function createDuration(input, key) {\n        var duration = input,\n            // matching against regexp is expensive, do it on demand\n            match = null,\n            sign,\n            ret,\n            diffRes;\n\n        if (isDuration(input)) {\n            duration = {\n                ms: input._milliseconds,\n                d: input._days,\n                M: input._months,\n            };\n        } else if (isNumber(input) || !isNaN(+input)) {\n            duration = {};\n            if (key) {\n                duration[key] = +input;\n            } else {\n                duration.milliseconds = +input;\n            }\n        } else if ((match = aspNetRegex.exec(input))) {\n            sign = match[1] === '-' ? -1 : 1;\n            duration = {\n                y: 0,\n                d: toInt(match[DATE]) * sign,\n                h: toInt(match[HOUR]) * sign,\n                m: toInt(match[MINUTE]) * sign,\n                s: toInt(match[SECOND]) * sign,\n                ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match\n            };\n        } else if ((match = isoRegex.exec(input))) {\n            sign = match[1] === '-' ? -1 : 1;\n            duration = {\n                y: parseIso(match[2], sign),\n                M: parseIso(match[3], sign),\n                w: parseIso(match[4], sign),\n                d: parseIso(match[5], sign),\n                h: parseIso(match[6], sign),\n                m: parseIso(match[7], sign),\n                s: parseIso(match[8], sign),\n            };\n        } else if (duration == null) {\n            // checks for null or undefined\n            duration = {};\n        } else if (\n            typeof duration === 'object' &&\n            ('from' in duration || 'to' in duration)\n        ) {\n            diffRes = momentsDifference(\n                createLocal(duration.from),\n                createLocal(duration.to)\n            );\n\n            duration = {};\n            duration.ms = diffRes.milliseconds;\n            duration.M = diffRes.months;\n        }\n\n        ret = new Duration(duration);\n\n        if (isDuration(input) && hasOwnProp(input, '_locale')) {\n            ret._locale = input._locale;\n        }\n\n        if (isDuration(input) && hasOwnProp(input, '_isValid')) {\n            ret._isValid = input._isValid;\n        }\n\n        return ret;\n    }\n\n    createDuration.fn = Duration.prototype;\n    createDuration.invalid = createInvalid$1;\n\n    function parseIso(inp, sign) {\n        // We'd normally use ~~inp for this, but unfortunately it also\n        // converts floats to ints.\n        // inp may be undefined, so careful calling replace on it.\n        var res = inp && parseFloat(inp.replace(',', '.'));\n        // apply sign while we're at it\n        return (isNaN(res) ? 0 : res) * sign;\n    }\n\n    function positiveMomentsDifference(base, other) {\n        var res = {};\n\n        res.months =\n            other.month() - base.month() + (other.year() - base.year()) * 12;\n        if (base.clone().add(res.months, 'M').isAfter(other)) {\n            --res.months;\n        }\n\n        res.milliseconds = +other - +base.clone().add(res.months, 'M');\n\n        return res;\n    }\n\n    function momentsDifference(base, other) {\n        var res;\n        if (!(base.isValid() && other.isValid())) {\n            return { milliseconds: 0, months: 0 };\n        }\n\n        other = cloneWithOffset(other, base);\n        if (base.isBefore(other)) {\n            res = positiveMomentsDifference(base, other);\n        } else {\n            res = positiveMomentsDifference(other, base);\n            res.milliseconds = -res.milliseconds;\n            res.months = -res.months;\n        }\n\n        return res;\n    }\n\n    // TODO: remove 'name' arg after deprecation is removed\n    function createAdder(direction, name) {\n        return function (val, period) {\n            var dur, tmp;\n            //invert the arguments, but complain about it\n            if (period !== null && !isNaN(+period)) {\n                deprecateSimple(\n                    name,\n                    'moment().' +\n                        name +\n                        '(period, number) is deprecated. Please use moment().' +\n                        name +\n                        '(number, period). ' +\n                        'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n                );\n                tmp = val;\n                val = period;\n                period = tmp;\n            }\n\n            dur = createDuration(val, period);\n            addSubtract(this, dur, direction);\n            return this;\n        };\n    }\n\n    function addSubtract(mom, duration, isAdding, updateOffset) {\n        var milliseconds = duration._milliseconds,\n            days = absRound(duration._days),\n            months = absRound(duration._months);\n\n        if (!mom.isValid()) {\n            // No op\n            return;\n        }\n\n        updateOffset = updateOffset == null ? true : updateOffset;\n\n        if (months) {\n            setMonth(mom, get(mom, 'Month') + months * isAdding);\n        }\n        if (days) {\n            set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);\n        }\n        if (milliseconds) {\n            mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);\n        }\n        if (updateOffset) {\n            hooks.updateOffset(mom, days || months);\n        }\n    }\n\n    var add = createAdder(1, 'add'),\n        subtract = createAdder(-1, 'subtract');\n\n    function isString(input) {\n        return typeof input === 'string' || input instanceof String;\n    }\n\n    // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined\n    function isMomentInput(input) {\n        return (\n            isMoment(input) ||\n            isDate(input) ||\n            isString(input) ||\n            isNumber(input) ||\n            isNumberOrStringArray(input) ||\n            isMomentInputObject(input) ||\n            input === null ||\n            input === undefined\n        );\n    }\n\n    function isMomentInputObject(input) {\n        var objectTest = isObject(input) && !isObjectEmpty(input),\n            propertyTest = false,\n            properties = [\n                'years',\n                'year',\n                'y',\n                'months',\n                'month',\n                'M',\n                'days',\n                'day',\n                'd',\n                'dates',\n                'date',\n                'D',\n                'hours',\n                'hour',\n                'h',\n                'minutes',\n                'minute',\n                'm',\n                'seconds',\n                'second',\n                's',\n                'milliseconds',\n                'millisecond',\n                'ms',\n            ],\n            i,\n            property,\n            propertyLen = properties.length;\n\n        for (i = 0; i < propertyLen; i += 1) {\n            property = properties[i];\n            propertyTest = propertyTest || hasOwnProp(input, property);\n        }\n\n        return objectTest && propertyTest;\n    }\n\n    function isNumberOrStringArray(input) {\n        var arrayTest = isArray(input),\n            dataTypeTest = false;\n        if (arrayTest) {\n            dataTypeTest =\n                input.filter(function (item) {\n                    return !isNumber(item) && isString(input);\n                }).length === 0;\n        }\n        return arrayTest && dataTypeTest;\n    }\n\n    function isCalendarSpec(input) {\n        var objectTest = isObject(input) && !isObjectEmpty(input),\n            propertyTest = false,\n            properties = [\n                'sameDay',\n                'nextDay',\n                'lastDay',\n                'nextWeek',\n                'lastWeek',\n                'sameElse',\n            ],\n            i,\n            property;\n\n        for (i = 0; i < properties.length; i += 1) {\n            property = properties[i];\n            propertyTest = propertyTest || hasOwnProp(input, property);\n        }\n\n        return objectTest && propertyTest;\n    }\n\n    function getCalendarFormat(myMoment, now) {\n        var diff = myMoment.diff(now, 'days', true);\n        return diff < -6\n            ? 'sameElse'\n            : diff < -1\n            ? 'lastWeek'\n            : diff < 0\n            ? 'lastDay'\n            : diff < 1\n            ? 'sameDay'\n            : diff < 2\n            ? 'nextDay'\n            : diff < 7\n            ? 'nextWeek'\n            : 'sameElse';\n    }\n\n    function calendar$1(time, formats) {\n        // Support for single parameter, formats only overload to the calendar function\n        if (arguments.length === 1) {\n            if (!arguments[0]) {\n                time = undefined;\n                formats = undefined;\n            } else if (isMomentInput(arguments[0])) {\n                time = arguments[0];\n                formats = undefined;\n            } else if (isCalendarSpec(arguments[0])) {\n                formats = arguments[0];\n                time = undefined;\n            }\n        }\n        // We want to compare the start of today, vs this.\n        // Getting start-of-today depends on whether we're local/utc/offset or not.\n        var now = time || createLocal(),\n            sod = cloneWithOffset(now, this).startOf('day'),\n            format = hooks.calendarFormat(this, sod) || 'sameElse',\n            output =\n                formats &&\n                (isFunction(formats[format])\n                    ? formats[format].call(this, now)\n                    : formats[format]);\n\n        return this.format(\n            output || this.localeData().calendar(format, this, createLocal(now))\n        );\n    }\n\n    function clone() {\n        return new Moment(this);\n    }\n\n    function isAfter(input, units) {\n        var localInput = isMoment(input) ? input : createLocal(input);\n        if (!(this.isValid() && localInput.isValid())) {\n            return false;\n        }\n        units = normalizeUnits(units) || 'millisecond';\n        if (units === 'millisecond') {\n            return this.valueOf() > localInput.valueOf();\n        } else {\n            return localInput.valueOf() < this.clone().startOf(units).valueOf();\n        }\n    }\n\n    function isBefore(input, units) {\n        var localInput = isMoment(input) ? input : createLocal(input);\n        if (!(this.isValid() && localInput.isValid())) {\n            return false;\n        }\n        units = normalizeUnits(units) || 'millisecond';\n        if (units === 'millisecond') {\n            return this.valueOf() < localInput.valueOf();\n        } else {\n            return this.clone().endOf(units).valueOf() < localInput.valueOf();\n        }\n    }\n\n    function isBetween(from, to, units, inclusivity) {\n        var localFrom = isMoment(from) ? from : createLocal(from),\n            localTo = isMoment(to) ? to : createLocal(to);\n        if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {\n            return false;\n        }\n        inclusivity = inclusivity || '()';\n        return (\n            (inclusivity[0] === '('\n                ? this.isAfter(localFrom, units)\n                : !this.isBefore(localFrom, units)) &&\n            (inclusivity[1] === ')'\n                ? this.isBefore(localTo, units)\n                : !this.isAfter(localTo, units))\n        );\n    }\n\n    function isSame(input, units) {\n        var localInput = isMoment(input) ? input : createLocal(input),\n            inputMs;\n        if (!(this.isValid() && localInput.isValid())) {\n            return false;\n        }\n        units = normalizeUnits(units) || 'millisecond';\n        if (units === 'millisecond') {\n            return this.valueOf() === localInput.valueOf();\n        } else {\n            inputMs = localInput.valueOf();\n            return (\n                this.clone().startOf(units).valueOf() <= inputMs &&\n                inputMs <= this.clone().endOf(units).valueOf()\n            );\n        }\n    }\n\n    function isSameOrAfter(input, units) {\n        return this.isSame(input, units) || this.isAfter(input, units);\n    }\n\n    function isSameOrBefore(input, units) {\n        return this.isSame(input, units) || this.isBefore(input, units);\n    }\n\n    function diff(input, units, asFloat) {\n        var that, zoneDelta, output;\n\n        if (!this.isValid()) {\n            return NaN;\n        }\n\n        that = cloneWithOffset(input, this);\n\n        if (!that.isValid()) {\n            return NaN;\n        }\n\n        zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;\n\n        units = normalizeUnits(units);\n\n        switch (units) {\n            case 'year':\n                output = monthDiff(this, that) / 12;\n                break;\n            case 'month':\n                output = monthDiff(this, that);\n                break;\n            case 'quarter':\n                output = monthDiff(this, that) / 3;\n                break;\n            case 'second':\n                output = (this - that) / 1e3;\n                break; // 1000\n            case 'minute':\n                output = (this - that) / 6e4;\n                break; // 1000 * 60\n            case 'hour':\n                output = (this - that) / 36e5;\n                break; // 1000 * 60 * 60\n            case 'day':\n                output = (this - that - zoneDelta) / 864e5;\n                break; // 1000 * 60 * 60 * 24, negate dst\n            case 'week':\n                output = (this - that - zoneDelta) / 6048e5;\n                break; // 1000 * 60 * 60 * 24 * 7, negate dst\n            default:\n                output = this - that;\n        }\n\n        return asFloat ? output : absFloor(output);\n    }\n\n    function monthDiff(a, b) {\n        if (a.date() < b.date()) {\n            // end-of-month calculations work correct when the start month has more\n            // days than the end month.\n            return -monthDiff(b, a);\n        }\n        // difference in months\n        var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),\n            // b is in (anchor - 1 month, anchor + 1 month)\n            anchor = a.clone().add(wholeMonthDiff, 'months'),\n            anchor2,\n            adjust;\n\n        if (b - anchor < 0) {\n            anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');\n            // linear across the month\n            adjust = (b - anchor) / (anchor - anchor2);\n        } else {\n            anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');\n            // linear across the month\n            adjust = (b - anchor) / (anchor2 - anchor);\n        }\n\n        //check for negative zero, return zero if negative zero\n        return -(wholeMonthDiff + adjust) || 0;\n    }\n\n    hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\n    hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';\n\n    function toString() {\n        return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n    }\n\n    function toISOString(keepOffset) {\n        if (!this.isValid()) {\n            return null;\n        }\n        var utc = keepOffset !== true,\n            m = utc ? this.clone().utc() : this;\n        if (m.year() < 0 || m.year() > 9999) {\n            return formatMoment(\n                m,\n                utc\n                    ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'\n                    : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'\n            );\n        }\n        if (isFunction(Date.prototype.toISOString)) {\n            // native implementation is ~50x faster, use it when we can\n            if (utc) {\n                return this.toDate().toISOString();\n            } else {\n                return new Date(this.valueOf() + this.utcOffset() * 60 * 1000)\n                    .toISOString()\n                    .replace('Z', formatMoment(m, 'Z'));\n            }\n        }\n        return formatMoment(\n            m,\n            utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'\n        );\n    }\n\n    /**\n     * Return a human readable representation of a moment that can\n     * also be evaluated to get a new moment which is the same\n     *\n     * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects\n     */\n    function inspect() {\n        if (!this.isValid()) {\n            return 'moment.invalid(/* ' + this._i + ' */)';\n        }\n        var func = 'moment',\n            zone = '',\n            prefix,\n            year,\n            datetime,\n            suffix;\n        if (!this.isLocal()) {\n            func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n            zone = 'Z';\n        }\n        prefix = '[' + func + '(\"]';\n        year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';\n        datetime = '-MM-DD[T]HH:mm:ss.SSS';\n        suffix = zone + '[\")]';\n\n        return this.format(prefix + year + datetime + suffix);\n    }\n\n    function format(inputString) {\n        if (!inputString) {\n            inputString = this.isUtc()\n                ? hooks.defaultFormatUtc\n                : hooks.defaultFormat;\n        }\n        var output = formatMoment(this, inputString);\n        return this.localeData().postformat(output);\n    }\n\n    function from(time, withoutSuffix) {\n        if (\n            this.isValid() &&\n            ((isMoment(time) && time.isValid()) || createLocal(time).isValid())\n        ) {\n            return createDuration({ to: this, from: time })\n                .locale(this.locale())\n                .humanize(!withoutSuffix);\n        } else {\n            return this.localeData().invalidDate();\n        }\n    }\n\n    function fromNow(withoutSuffix) {\n        return this.from(createLocal(), withoutSuffix);\n    }\n\n    function to(time, withoutSuffix) {\n        if (\n            this.isValid() &&\n            ((isMoment(time) && time.isValid()) || createLocal(time).isValid())\n        ) {\n            return createDuration({ from: this, to: time })\n                .locale(this.locale())\n                .humanize(!withoutSuffix);\n        } else {\n            return this.localeData().invalidDate();\n        }\n    }\n\n    function toNow(withoutSuffix) {\n        return this.to(createLocal(), withoutSuffix);\n    }\n\n    // If passed a locale key, it will set the locale for this\n    // instance.  Otherwise, it will return the locale configuration\n    // variables for this instance.\n    function locale(key) {\n        var newLocaleData;\n\n        if (key === undefined) {\n            return this._locale._abbr;\n        } else {\n            newLocaleData = getLocale(key);\n            if (newLocaleData != null) {\n                this._locale = newLocaleData;\n            }\n            return this;\n        }\n    }\n\n    var lang = deprecate(\n        'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',\n        function (key) {\n            if (key === undefined) {\n                return this.localeData();\n            } else {\n                return this.locale(key);\n            }\n        }\n    );\n\n    function localeData() {\n        return this._locale;\n    }\n\n    var MS_PER_SECOND = 1000,\n        MS_PER_MINUTE = 60 * MS_PER_SECOND,\n        MS_PER_HOUR = 60 * MS_PER_MINUTE,\n        MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;\n\n    // actual modulo - handles negative numbers (for dates before 1970):\n    function mod$1(dividend, divisor) {\n        return ((dividend % divisor) + divisor) % divisor;\n    }\n\n    function localStartOfDate(y, m, d) {\n        // the date constructor remaps years 0-99 to 1900-1999\n        if (y < 100 && y >= 0) {\n            // preserve leap years using a full 400 year cycle, then reset\n            return new Date(y + 400, m, d) - MS_PER_400_YEARS;\n        } else {\n            return new Date(y, m, d).valueOf();\n        }\n    }\n\n    function utcStartOfDate(y, m, d) {\n        // Date.UTC remaps years 0-99 to 1900-1999\n        if (y < 100 && y >= 0) {\n            // preserve leap years using a full 400 year cycle, then reset\n            return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;\n        } else {\n            return Date.UTC(y, m, d);\n        }\n    }\n\n    function startOf(units) {\n        var time, startOfDate;\n        units = normalizeUnits(units);\n        if (units === undefined || units === 'millisecond' || !this.isValid()) {\n            return this;\n        }\n\n        startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n\n        switch (units) {\n            case 'year':\n                time = startOfDate(this.year(), 0, 1);\n                break;\n            case 'quarter':\n                time = startOfDate(\n                    this.year(),\n                    this.month() - (this.month() % 3),\n                    1\n                );\n                break;\n            case 'month':\n                time = startOfDate(this.year(), this.month(), 1);\n                break;\n            case 'week':\n                time = startOfDate(\n                    this.year(),\n                    this.month(),\n                    this.date() - this.weekday()\n                );\n                break;\n            case 'isoWeek':\n                time = startOfDate(\n                    this.year(),\n                    this.month(),\n                    this.date() - (this.isoWeekday() - 1)\n                );\n                break;\n            case 'day':\n            case 'date':\n                time = startOfDate(this.year(), this.month(), this.date());\n                break;\n            case 'hour':\n                time = this._d.valueOf();\n                time -= mod$1(\n                    time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),\n                    MS_PER_HOUR\n                );\n                break;\n            case 'minute':\n                time = this._d.valueOf();\n                time -= mod$1(time, MS_PER_MINUTE);\n                break;\n            case 'second':\n                time = this._d.valueOf();\n                time -= mod$1(time, MS_PER_SECOND);\n                break;\n        }\n\n        this._d.setTime(time);\n        hooks.updateOffset(this, true);\n        return this;\n    }\n\n    function endOf(units) {\n        var time, startOfDate;\n        units = normalizeUnits(units);\n        if (units === undefined || units === 'millisecond' || !this.isValid()) {\n            return this;\n        }\n\n        startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n\n        switch (units) {\n            case 'year':\n                time = startOfDate(this.year() + 1, 0, 1) - 1;\n                break;\n            case 'quarter':\n                time =\n                    startOfDate(\n                        this.year(),\n                        this.month() - (this.month() % 3) + 3,\n                        1\n                    ) - 1;\n                break;\n            case 'month':\n                time = startOfDate(this.year(), this.month() + 1, 1) - 1;\n                break;\n            case 'week':\n                time =\n                    startOfDate(\n                        this.year(),\n                        this.month(),\n                        this.date() - this.weekday() + 7\n                    ) - 1;\n                break;\n            case 'isoWeek':\n                time =\n                    startOfDate(\n                        this.year(),\n                        this.month(),\n                        this.date() - (this.isoWeekday() - 1) + 7\n                    ) - 1;\n                break;\n            case 'day':\n            case 'date':\n                time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;\n                break;\n            case 'hour':\n                time = this._d.valueOf();\n                time +=\n                    MS_PER_HOUR -\n                    mod$1(\n                        time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),\n                        MS_PER_HOUR\n                    ) -\n                    1;\n                break;\n            case 'minute':\n                time = this._d.valueOf();\n                time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;\n                break;\n            case 'second':\n                time = this._d.valueOf();\n                time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;\n                break;\n        }\n\n        this._d.setTime(time);\n        hooks.updateOffset(this, true);\n        return this;\n    }\n\n    function valueOf() {\n        return this._d.valueOf() - (this._offset || 0) * 60000;\n    }\n\n    function unix() {\n        return Math.floor(this.valueOf() / 1000);\n    }\n\n    function toDate() {\n        return new Date(this.valueOf());\n    }\n\n    function toArray() {\n        var m = this;\n        return [\n            m.year(),\n            m.month(),\n            m.date(),\n            m.hour(),\n            m.minute(),\n            m.second(),\n            m.millisecond(),\n        ];\n    }\n\n    function toObject() {\n        var m = this;\n        return {\n            years: m.year(),\n            months: m.month(),\n            date: m.date(),\n            hours: m.hours(),\n            minutes: m.minutes(),\n            seconds: m.seconds(),\n            milliseconds: m.milliseconds(),\n        };\n    }\n\n    function toJSON() {\n        // new Date(NaN).toJSON() === null\n        return this.isValid() ? this.toISOString() : null;\n    }\n\n    function isValid$2() {\n        return isValid(this);\n    }\n\n    function parsingFlags() {\n        return extend({}, getParsingFlags(this));\n    }\n\n    function invalidAt() {\n        return getParsingFlags(this).overflow;\n    }\n\n    function creationData() {\n        return {\n            input: this._i,\n            format: this._f,\n            locale: this._locale,\n            isUTC: this._isUTC,\n            strict: this._strict,\n        };\n    }\n\n    addFormatToken('N', 0, 0, 'eraAbbr');\n    addFormatToken('NN', 0, 0, 'eraAbbr');\n    addFormatToken('NNN', 0, 0, 'eraAbbr');\n    addFormatToken('NNNN', 0, 0, 'eraName');\n    addFormatToken('NNNNN', 0, 0, 'eraNarrow');\n\n    addFormatToken('y', ['y', 1], 'yo', 'eraYear');\n    addFormatToken('y', ['yy', 2], 0, 'eraYear');\n    addFormatToken('y', ['yyy', 3], 0, 'eraYear');\n    addFormatToken('y', ['yyyy', 4], 0, 'eraYear');\n\n    addRegexToken('N', matchEraAbbr);\n    addRegexToken('NN', matchEraAbbr);\n    addRegexToken('NNN', matchEraAbbr);\n    addRegexToken('NNNN', matchEraName);\n    addRegexToken('NNNNN', matchEraNarrow);\n\n    addParseToken(\n        ['N', 'NN', 'NNN', 'NNNN', 'NNNNN'],\n        function (input, array, config, token) {\n            var era = config._locale.erasParse(input, token, config._strict);\n            if (era) {\n                getParsingFlags(config).era = era;\n            } else {\n                getParsingFlags(config).invalidEra = input;\n            }\n        }\n    );\n\n    addRegexToken('y', matchUnsigned);\n    addRegexToken('yy', matchUnsigned);\n    addRegexToken('yyy', matchUnsigned);\n    addRegexToken('yyyy', matchUnsigned);\n    addRegexToken('yo', matchEraYearOrdinal);\n\n    addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);\n    addParseToken(['yo'], function (input, array, config, token) {\n        var match;\n        if (config._locale._eraYearOrdinalRegex) {\n            match = input.match(config._locale._eraYearOrdinalRegex);\n        }\n\n        if (config._locale.eraYearOrdinalParse) {\n            array[YEAR] = config._locale.eraYearOrdinalParse(input, match);\n        } else {\n            array[YEAR] = parseInt(input, 10);\n        }\n    });\n\n    function localeEras(m, format) {\n        var i,\n            l,\n            date,\n            eras = this._eras || getLocale('en')._eras;\n        for (i = 0, l = eras.length; i < l; ++i) {\n            switch (typeof eras[i].since) {\n                case 'string':\n                    // truncate time\n                    date = hooks(eras[i].since).startOf('day');\n                    eras[i].since = date.valueOf();\n                    break;\n            }\n\n            switch (typeof eras[i].until) {\n                case 'undefined':\n                    eras[i].until = +Infinity;\n                    break;\n                case 'string':\n                    // truncate time\n                    date = hooks(eras[i].until).startOf('day').valueOf();\n                    eras[i].until = date.valueOf();\n                    break;\n            }\n        }\n        return eras;\n    }\n\n    function localeErasParse(eraName, format, strict) {\n        var i,\n            l,\n            eras = this.eras(),\n            name,\n            abbr,\n            narrow;\n        eraName = eraName.toUpperCase();\n\n        for (i = 0, l = eras.length; i < l; ++i) {\n            name = eras[i].name.toUpperCase();\n            abbr = eras[i].abbr.toUpperCase();\n            narrow = eras[i].narrow.toUpperCase();\n\n            if (strict) {\n                switch (format) {\n                    case 'N':\n                    case 'NN':\n                    case 'NNN':\n                        if (abbr === eraName) {\n                            return eras[i];\n                        }\n                        break;\n\n                    case 'NNNN':\n                        if (name === eraName) {\n                            return eras[i];\n                        }\n                        break;\n\n                    case 'NNNNN':\n                        if (narrow === eraName) {\n                            return eras[i];\n                        }\n                        break;\n                }\n            } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {\n                return eras[i];\n            }\n        }\n    }\n\n    function localeErasConvertYear(era, year) {\n        var dir = era.since <= era.until ? +1 : -1;\n        if (year === undefined) {\n            return hooks(era.since).year();\n        } else {\n            return hooks(era.since).year() + (year - era.offset) * dir;\n        }\n    }\n\n    function getEraName() {\n        var i,\n            l,\n            val,\n            eras = this.localeData().eras();\n        for (i = 0, l = eras.length; i < l; ++i) {\n            // truncate time\n            val = this.clone().startOf('day').valueOf();\n\n            if (eras[i].since <= val && val <= eras[i].until) {\n                return eras[i].name;\n            }\n            if (eras[i].until <= val && val <= eras[i].since) {\n                return eras[i].name;\n            }\n        }\n\n        return '';\n    }\n\n    function getEraNarrow() {\n        var i,\n            l,\n            val,\n            eras = this.localeData().eras();\n        for (i = 0, l = eras.length; i < l; ++i) {\n            // truncate time\n            val = this.clone().startOf('day').valueOf();\n\n            if (eras[i].since <= val && val <= eras[i].until) {\n                return eras[i].narrow;\n            }\n            if (eras[i].until <= val && val <= eras[i].since) {\n                return eras[i].narrow;\n            }\n        }\n\n        return '';\n    }\n\n    function getEraAbbr() {\n        var i,\n            l,\n            val,\n            eras = this.localeData().eras();\n        for (i = 0, l = eras.length; i < l; ++i) {\n            // truncate time\n            val = this.clone().startOf('day').valueOf();\n\n            if (eras[i].since <= val && val <= eras[i].until) {\n                return eras[i].abbr;\n            }\n            if (eras[i].until <= val && val <= eras[i].since) {\n                return eras[i].abbr;\n            }\n        }\n\n        return '';\n    }\n\n    function getEraYear() {\n        var i,\n            l,\n            dir,\n            val,\n            eras = this.localeData().eras();\n        for (i = 0, l = eras.length; i < l; ++i) {\n            dir = eras[i].since <= eras[i].until ? +1 : -1;\n\n            // truncate time\n            val = this.clone().startOf('day').valueOf();\n\n            if (\n                (eras[i].since <= val && val <= eras[i].until) ||\n                (eras[i].until <= val && val <= eras[i].since)\n            ) {\n                return (\n                    (this.year() - hooks(eras[i].since).year()) * dir +\n                    eras[i].offset\n                );\n            }\n        }\n\n        return this.year();\n    }\n\n    function erasNameRegex(isStrict) {\n        if (!hasOwnProp(this, '_erasNameRegex')) {\n            computeErasParse.call(this);\n        }\n        return isStrict ? this._erasNameRegex : this._erasRegex;\n    }\n\n    function erasAbbrRegex(isStrict) {\n        if (!hasOwnProp(this, '_erasAbbrRegex')) {\n            computeErasParse.call(this);\n        }\n        return isStrict ? this._erasAbbrRegex : this._erasRegex;\n    }\n\n    function erasNarrowRegex(isStrict) {\n        if (!hasOwnProp(this, '_erasNarrowRegex')) {\n            computeErasParse.call(this);\n        }\n        return isStrict ? this._erasNarrowRegex : this._erasRegex;\n    }\n\n    function matchEraAbbr(isStrict, locale) {\n        return locale.erasAbbrRegex(isStrict);\n    }\n\n    function matchEraName(isStrict, locale) {\n        return locale.erasNameRegex(isStrict);\n    }\n\n    function matchEraNarrow(isStrict, locale) {\n        return locale.erasNarrowRegex(isStrict);\n    }\n\n    function matchEraYearOrdinal(isStrict, locale) {\n        return locale._eraYearOrdinalRegex || matchUnsigned;\n    }\n\n    function computeErasParse() {\n        var abbrPieces = [],\n            namePieces = [],\n            narrowPieces = [],\n            mixedPieces = [],\n            i,\n            l,\n            eras = this.eras();\n\n        for (i = 0, l = eras.length; i < l; ++i) {\n            namePieces.push(regexEscape(eras[i].name));\n            abbrPieces.push(regexEscape(eras[i].abbr));\n            narrowPieces.push(regexEscape(eras[i].narrow));\n\n            mixedPieces.push(regexEscape(eras[i].name));\n            mixedPieces.push(regexEscape(eras[i].abbr));\n            mixedPieces.push(regexEscape(eras[i].narrow));\n        }\n\n        this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n        this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');\n        this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');\n        this._erasNarrowRegex = new RegExp(\n            '^(' + narrowPieces.join('|') + ')',\n            'i'\n        );\n    }\n\n    // FORMATTING\n\n    addFormatToken(0, ['gg', 2], 0, function () {\n        return this.weekYear() % 100;\n    });\n\n    addFormatToken(0, ['GG', 2], 0, function () {\n        return this.isoWeekYear() % 100;\n    });\n\n    function addWeekYearFormatToken(token, getter) {\n        addFormatToken(0, [token, token.length], 0, getter);\n    }\n\n    addWeekYearFormatToken('gggg', 'weekYear');\n    addWeekYearFormatToken('ggggg', 'weekYear');\n    addWeekYearFormatToken('GGGG', 'isoWeekYear');\n    addWeekYearFormatToken('GGGGG', 'isoWeekYear');\n\n    // ALIASES\n\n    addUnitAlias('weekYear', 'gg');\n    addUnitAlias('isoWeekYear', 'GG');\n\n    // PRIORITY\n\n    addUnitPriority('weekYear', 1);\n    addUnitPriority('isoWeekYear', 1);\n\n    // PARSING\n\n    addRegexToken('G', matchSigned);\n    addRegexToken('g', matchSigned);\n    addRegexToken('GG', match1to2, match2);\n    addRegexToken('gg', match1to2, match2);\n    addRegexToken('GGGG', match1to4, match4);\n    addRegexToken('gggg', match1to4, match4);\n    addRegexToken('GGGGG', match1to6, match6);\n    addRegexToken('ggggg', match1to6, match6);\n\n    addWeekParseToken(\n        ['gggg', 'ggggg', 'GGGG', 'GGGGG'],\n        function (input, week, config, token) {\n            week[token.substr(0, 2)] = toInt(input);\n        }\n    );\n\n    addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n        week[token] = hooks.parseTwoDigitYear(input);\n    });\n\n    // MOMENTS\n\n    function getSetWeekYear(input) {\n        return getSetWeekYearHelper.call(\n            this,\n            input,\n            this.week(),\n            this.weekday(),\n            this.localeData()._week.dow,\n            this.localeData()._week.doy\n        );\n    }\n\n    function getSetISOWeekYear(input) {\n        return getSetWeekYearHelper.call(\n            this,\n            input,\n            this.isoWeek(),\n            this.isoWeekday(),\n            1,\n            4\n        );\n    }\n\n    function getISOWeeksInYear() {\n        return weeksInYear(this.year(), 1, 4);\n    }\n\n    function getISOWeeksInISOWeekYear() {\n        return weeksInYear(this.isoWeekYear(), 1, 4);\n    }\n\n    function getWeeksInYear() {\n        var weekInfo = this.localeData()._week;\n        return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n    }\n\n    function getWeeksInWeekYear() {\n        var weekInfo = this.localeData()._week;\n        return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);\n    }\n\n    function getSetWeekYearHelper(input, week, weekday, dow, doy) {\n        var weeksTarget;\n        if (input == null) {\n            return weekOfYear(this, dow, doy).year;\n        } else {\n            weeksTarget = weeksInYear(input, dow, doy);\n            if (week > weeksTarget) {\n                week = weeksTarget;\n            }\n            return setWeekAll.call(this, input, week, weekday, dow, doy);\n        }\n    }\n\n    function setWeekAll(weekYear, week, weekday, dow, doy) {\n        var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),\n            date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);\n\n        this.year(date.getUTCFullYear());\n        this.month(date.getUTCMonth());\n        this.date(date.getUTCDate());\n        return this;\n    }\n\n    // FORMATTING\n\n    addFormatToken('Q', 0, 'Qo', 'quarter');\n\n    // ALIASES\n\n    addUnitAlias('quarter', 'Q');\n\n    // PRIORITY\n\n    addUnitPriority('quarter', 7);\n\n    // PARSING\n\n    addRegexToken('Q', match1);\n    addParseToken('Q', function (input, array) {\n        array[MONTH] = (toInt(input) - 1) * 3;\n    });\n\n    // MOMENTS\n\n    function getSetQuarter(input) {\n        return input == null\n            ? Math.ceil((this.month() + 1) / 3)\n            : this.month((input - 1) * 3 + (this.month() % 3));\n    }\n\n    // FORMATTING\n\n    addFormatToken('D', ['DD', 2], 'Do', 'date');\n\n    // ALIASES\n\n    addUnitAlias('date', 'D');\n\n    // PRIORITY\n    addUnitPriority('date', 9);\n\n    // PARSING\n\n    addRegexToken('D', match1to2);\n    addRegexToken('DD', match1to2, match2);\n    addRegexToken('Do', function (isStrict, locale) {\n        // TODO: Remove \"ordinalParse\" fallback in next major release.\n        return isStrict\n            ? locale._dayOfMonthOrdinalParse || locale._ordinalParse\n            : locale._dayOfMonthOrdinalParseLenient;\n    });\n\n    addParseToken(['D', 'DD'], DATE);\n    addParseToken('Do', function (input, array) {\n        array[DATE] = toInt(input.match(match1to2)[0]);\n    });\n\n    // MOMENTS\n\n    var getSetDayOfMonth = makeGetSet('Date', true);\n\n    // FORMATTING\n\n    addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');\n\n    // ALIASES\n\n    addUnitAlias('dayOfYear', 'DDD');\n\n    // PRIORITY\n    addUnitPriority('dayOfYear', 4);\n\n    // PARSING\n\n    addRegexToken('DDD', match1to3);\n    addRegexToken('DDDD', match3);\n    addParseToken(['DDD', 'DDDD'], function (input, array, config) {\n        config._dayOfYear = toInt(input);\n    });\n\n    // HELPERS\n\n    // MOMENTS\n\n    function getSetDayOfYear(input) {\n        var dayOfYear =\n            Math.round(\n                (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5\n            ) + 1;\n        return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');\n    }\n\n    // FORMATTING\n\n    addFormatToken('m', ['mm', 2], 0, 'minute');\n\n    // ALIASES\n\n    addUnitAlias('minute', 'm');\n\n    // PRIORITY\n\n    addUnitPriority('minute', 14);\n\n    // PARSING\n\n    addRegexToken('m', match1to2);\n    addRegexToken('mm', match1to2, match2);\n    addParseToken(['m', 'mm'], MINUTE);\n\n    // MOMENTS\n\n    var getSetMinute = makeGetSet('Minutes', false);\n\n    // FORMATTING\n\n    addFormatToken('s', ['ss', 2], 0, 'second');\n\n    // ALIASES\n\n    addUnitAlias('second', 's');\n\n    // PRIORITY\n\n    addUnitPriority('second', 15);\n\n    // PARSING\n\n    addRegexToken('s', match1to2);\n    addRegexToken('ss', match1to2, match2);\n    addParseToken(['s', 'ss'], SECOND);\n\n    // MOMENTS\n\n    var getSetSecond = makeGetSet('Seconds', false);\n\n    // FORMATTING\n\n    addFormatToken('S', 0, 0, function () {\n        return ~~(this.millisecond() / 100);\n    });\n\n    addFormatToken(0, ['SS', 2], 0, function () {\n        return ~~(this.millisecond() / 10);\n    });\n\n    addFormatToken(0, ['SSS', 3], 0, 'millisecond');\n    addFormatToken(0, ['SSSS', 4], 0, function () {\n        return this.millisecond() * 10;\n    });\n    addFormatToken(0, ['SSSSS', 5], 0, function () {\n        return this.millisecond() * 100;\n    });\n    addFormatToken(0, ['SSSSSS', 6], 0, function () {\n        return this.millisecond() * 1000;\n    });\n    addFormatToken(0, ['SSSSSSS', 7], 0, function () {\n        return this.millisecond() * 10000;\n    });\n    addFormatToken(0, ['SSSSSSSS', 8], 0, function () {\n        return this.millisecond() * 100000;\n    });\n    addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {\n        return this.millisecond() * 1000000;\n    });\n\n    // ALIASES\n\n    addUnitAlias('millisecond', 'ms');\n\n    // PRIORITY\n\n    addUnitPriority('millisecond', 16);\n\n    // PARSING\n\n    addRegexToken('S', match1to3, match1);\n    addRegexToken('SS', match1to3, match2);\n    addRegexToken('SSS', match1to3, match3);\n\n    var token, getSetMillisecond;\n    for (token = 'SSSS'; token.length <= 9; token += 'S') {\n        addRegexToken(token, matchUnsigned);\n    }\n\n    function parseMs(input, array) {\n        array[MILLISECOND] = toInt(('0.' + input) * 1000);\n    }\n\n    for (token = 'S'; token.length <= 9; token += 'S') {\n        addParseToken(token, parseMs);\n    }\n\n    getSetMillisecond = makeGetSet('Milliseconds', false);\n\n    // FORMATTING\n\n    addFormatToken('z', 0, 0, 'zoneAbbr');\n    addFormatToken('zz', 0, 0, 'zoneName');\n\n    // MOMENTS\n\n    function getZoneAbbr() {\n        return this._isUTC ? 'UTC' : '';\n    }\n\n    function getZoneName() {\n        return this._isUTC ? 'Coordinated Universal Time' : '';\n    }\n\n    var proto = Moment.prototype;\n\n    proto.add = add;\n    proto.calendar = calendar$1;\n    proto.clone = clone;\n    proto.diff = diff;\n    proto.endOf = endOf;\n    proto.format = format;\n    proto.from = from;\n    proto.fromNow = fromNow;\n    proto.to = to;\n    proto.toNow = toNow;\n    proto.get = stringGet;\n    proto.invalidAt = invalidAt;\n    proto.isAfter = isAfter;\n    proto.isBefore = isBefore;\n    proto.isBetween = isBetween;\n    proto.isSame = isSame;\n    proto.isSameOrAfter = isSameOrAfter;\n    proto.isSameOrBefore = isSameOrBefore;\n    proto.isValid = isValid$2;\n    proto.lang = lang;\n    proto.locale = locale;\n    proto.localeData = localeData;\n    proto.max = prototypeMax;\n    proto.min = prototypeMin;\n    proto.parsingFlags = parsingFlags;\n    proto.set = stringSet;\n    proto.startOf = startOf;\n    proto.subtract = subtract;\n    proto.toArray = toArray;\n    proto.toObject = toObject;\n    proto.toDate = toDate;\n    proto.toISOString = toISOString;\n    proto.inspect = inspect;\n    if (typeof Symbol !== 'undefined' && Symbol.for != null) {\n        proto[Symbol.for('nodejs.util.inspect.custom')] = function () {\n            return 'Moment<' + this.format() + '>';\n        };\n    }\n    proto.toJSON = toJSON;\n    proto.toString = toString;\n    proto.unix = unix;\n    proto.valueOf = valueOf;\n    proto.creationData = creationData;\n    proto.eraName = getEraName;\n    proto.eraNarrow = getEraNarrow;\n    proto.eraAbbr = getEraAbbr;\n    proto.eraYear = getEraYear;\n    proto.year = getSetYear;\n    proto.isLeapYear = getIsLeapYear;\n    proto.weekYear = getSetWeekYear;\n    proto.isoWeekYear = getSetISOWeekYear;\n    proto.quarter = proto.quarters = getSetQuarter;\n    proto.month = getSetMonth;\n    proto.daysInMonth = getDaysInMonth;\n    proto.week = proto.weeks = getSetWeek;\n    proto.isoWeek = proto.isoWeeks = getSetISOWeek;\n    proto.weeksInYear = getWeeksInYear;\n    proto.weeksInWeekYear = getWeeksInWeekYear;\n    proto.isoWeeksInYear = getISOWeeksInYear;\n    proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;\n    proto.date = getSetDayOfMonth;\n    proto.day = proto.days = getSetDayOfWeek;\n    proto.weekday = getSetLocaleDayOfWeek;\n    proto.isoWeekday = getSetISODayOfWeek;\n    proto.dayOfYear = getSetDayOfYear;\n    proto.hour = proto.hours = getSetHour;\n    proto.minute = proto.minutes = getSetMinute;\n    proto.second = proto.seconds = getSetSecond;\n    proto.millisecond = proto.milliseconds = getSetMillisecond;\n    proto.utcOffset = getSetOffset;\n    proto.utc = setOffsetToUTC;\n    proto.local = setOffsetToLocal;\n    proto.parseZone = setOffsetToParsedOffset;\n    proto.hasAlignedHourOffset = hasAlignedHourOffset;\n    proto.isDST = isDaylightSavingTime;\n    proto.isLocal = isLocal;\n    proto.isUtcOffset = isUtcOffset;\n    proto.isUtc = isUtc;\n    proto.isUTC = isUtc;\n    proto.zoneAbbr = getZoneAbbr;\n    proto.zoneName = getZoneName;\n    proto.dates = deprecate(\n        'dates accessor is deprecated. Use date instead.',\n        getSetDayOfMonth\n    );\n    proto.months = deprecate(\n        'months accessor is deprecated. Use month instead',\n        getSetMonth\n    );\n    proto.years = deprecate(\n        'years accessor is deprecated. Use year instead',\n        getSetYear\n    );\n    proto.zone = deprecate(\n        'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/',\n        getSetZone\n    );\n    proto.isDSTShifted = deprecate(\n        'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information',\n        isDaylightSavingTimeShifted\n    );\n\n    function createUnix(input) {\n        return createLocal(input * 1000);\n    }\n\n    function createInZone() {\n        return createLocal.apply(null, arguments).parseZone();\n    }\n\n    function preParsePostFormat(string) {\n        return string;\n    }\n\n    var proto$1 = Locale.prototype;\n\n    proto$1.calendar = calendar;\n    proto$1.longDateFormat = longDateFormat;\n    proto$1.invalidDate = invalidDate;\n    proto$1.ordinal = ordinal;\n    proto$1.preparse = preParsePostFormat;\n    proto$1.postformat = preParsePostFormat;\n    proto$1.relativeTime = relativeTime;\n    proto$1.pastFuture = pastFuture;\n    proto$1.set = set;\n    proto$1.eras = localeEras;\n    proto$1.erasParse = localeErasParse;\n    proto$1.erasConvertYear = localeErasConvertYear;\n    proto$1.erasAbbrRegex = erasAbbrRegex;\n    proto$1.erasNameRegex = erasNameRegex;\n    proto$1.erasNarrowRegex = erasNarrowRegex;\n\n    proto$1.months = localeMonths;\n    proto$1.monthsShort = localeMonthsShort;\n    proto$1.monthsParse = localeMonthsParse;\n    proto$1.monthsRegex = monthsRegex;\n    proto$1.monthsShortRegex = monthsShortRegex;\n    proto$1.week = localeWeek;\n    proto$1.firstDayOfYear = localeFirstDayOfYear;\n    proto$1.firstDayOfWeek = localeFirstDayOfWeek;\n\n    proto$1.weekdays = localeWeekdays;\n    proto$1.weekdaysMin = localeWeekdaysMin;\n    proto$1.weekdaysShort = localeWeekdaysShort;\n    proto$1.weekdaysParse = localeWeekdaysParse;\n\n    proto$1.weekdaysRegex = weekdaysRegex;\n    proto$1.weekdaysShortRegex = weekdaysShortRegex;\n    proto$1.weekdaysMinRegex = weekdaysMinRegex;\n\n    proto$1.isPM = localeIsPM;\n    proto$1.meridiem = localeMeridiem;\n\n    function get$1(format, index, field, setter) {\n        var locale = getLocale(),\n            utc = createUTC().set(setter, index);\n        return locale[field](utc, format);\n    }\n\n    function listMonthsImpl(format, index, field) {\n        if (isNumber(format)) {\n            index = format;\n            format = undefined;\n        }\n\n        format = format || '';\n\n        if (index != null) {\n            return get$1(format, index, field, 'month');\n        }\n\n        var i,\n            out = [];\n        for (i = 0; i < 12; i++) {\n            out[i] = get$1(format, i, field, 'month');\n        }\n        return out;\n    }\n\n    // ()\n    // (5)\n    // (fmt, 5)\n    // (fmt)\n    // (true)\n    // (true, 5)\n    // (true, fmt, 5)\n    // (true, fmt)\n    function listWeekdaysImpl(localeSorted, format, index, field) {\n        if (typeof localeSorted === 'boolean') {\n            if (isNumber(format)) {\n                index = format;\n                format = undefined;\n            }\n\n            format = format || '';\n        } else {\n            format = localeSorted;\n            index = format;\n            localeSorted = false;\n\n            if (isNumber(format)) {\n                index = format;\n                format = undefined;\n            }\n\n            format = format || '';\n        }\n\n        var locale = getLocale(),\n            shift = localeSorted ? locale._week.dow : 0,\n            i,\n            out = [];\n\n        if (index != null) {\n            return get$1(format, (index + shift) % 7, field, 'day');\n        }\n\n        for (i = 0; i < 7; i++) {\n            out[i] = get$1(format, (i + shift) % 7, field, 'day');\n        }\n        return out;\n    }\n\n    function listMonths(format, index) {\n        return listMonthsImpl(format, index, 'months');\n    }\n\n    function listMonthsShort(format, index) {\n        return listMonthsImpl(format, index, 'monthsShort');\n    }\n\n    function listWeekdays(localeSorted, format, index) {\n        return listWeekdaysImpl(localeSorted, format, index, 'weekdays');\n    }\n\n    function listWeekdaysShort(localeSorted, format, index) {\n        return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');\n    }\n\n    function listWeekdaysMin(localeSorted, format, index) {\n        return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');\n    }\n\n    getSetGlobalLocale('en', {\n        eras: [\n            {\n                since: '0001-01-01',\n                until: +Infinity,\n                offset: 1,\n                name: 'Anno Domini',\n                narrow: 'AD',\n                abbr: 'AD',\n            },\n            {\n                since: '0000-12-31',\n                until: -Infinity,\n                offset: 1,\n                name: 'Before Christ',\n                narrow: 'BC',\n                abbr: 'BC',\n            },\n        ],\n        dayOfMonthOrdinalParse: /\\d{1,2}(th|st|nd|rd)/,\n        ordinal: function (number) {\n            var b = number % 10,\n                output =\n                    toInt((number % 100) / 10) === 1\n                        ? 'th'\n                        : b === 1\n                        ? 'st'\n                        : b === 2\n                        ? 'nd'\n                        : b === 3\n                        ? 'rd'\n                        : 'th';\n            return number + output;\n        },\n    });\n\n    // Side effect imports\n\n    hooks.lang = deprecate(\n        'moment.lang is deprecated. Use moment.locale instead.',\n        getSetGlobalLocale\n    );\n    hooks.langData = deprecate(\n        'moment.langData is deprecated. Use moment.localeData instead.',\n        getLocale\n    );\n\n    var mathAbs = Math.abs;\n\n    function abs() {\n        var data = this._data;\n\n        this._milliseconds = mathAbs(this._milliseconds);\n        this._days = mathAbs(this._days);\n        this._months = mathAbs(this._months);\n\n        data.milliseconds = mathAbs(data.milliseconds);\n        data.seconds = mathAbs(data.seconds);\n        data.minutes = mathAbs(data.minutes);\n        data.hours = mathAbs(data.hours);\n        data.months = mathAbs(data.months);\n        data.years = mathAbs(data.years);\n\n        return this;\n    }\n\n    function addSubtract$1(duration, input, value, direction) {\n        var other = createDuration(input, value);\n\n        duration._milliseconds += direction * other._milliseconds;\n        duration._days += direction * other._days;\n        duration._months += direction * other._months;\n\n        return duration._bubble();\n    }\n\n    // supports only 2.0-style add(1, 's') or add(duration)\n    function add$1(input, value) {\n        return addSubtract$1(this, input, value, 1);\n    }\n\n    // supports only 2.0-style subtract(1, 's') or subtract(duration)\n    function subtract$1(input, value) {\n        return addSubtract$1(this, input, value, -1);\n    }\n\n    function absCeil(number) {\n        if (number < 0) {\n            return Math.floor(number);\n        } else {\n            return Math.ceil(number);\n        }\n    }\n\n    function bubble() {\n        var milliseconds = this._milliseconds,\n            days = this._days,\n            months = this._months,\n            data = this._data,\n            seconds,\n            minutes,\n            hours,\n            years,\n            monthsFromDays;\n\n        // if we have a mix of positive and negative values, bubble down first\n        // check: https://github.com/moment/moment/issues/2166\n        if (\n            !(\n                (milliseconds >= 0 && days >= 0 && months >= 0) ||\n                (milliseconds <= 0 && days <= 0 && months <= 0)\n            )\n        ) {\n            milliseconds += absCeil(monthsToDays(months) + days) * 864e5;\n            days = 0;\n            months = 0;\n        }\n\n        // The following code bubbles up values, see the tests for\n        // examples of what that means.\n        data.milliseconds = milliseconds % 1000;\n\n        seconds = absFloor(milliseconds / 1000);\n        data.seconds = seconds % 60;\n\n        minutes = absFloor(seconds / 60);\n        data.minutes = minutes % 60;\n\n        hours = absFloor(minutes / 60);\n        data.hours = hours % 24;\n\n        days += absFloor(hours / 24);\n\n        // convert days to months\n        monthsFromDays = absFloor(daysToMonths(days));\n        months += monthsFromDays;\n        days -= absCeil(monthsToDays(monthsFromDays));\n\n        // 12 months -> 1 year\n        years = absFloor(months / 12);\n        months %= 12;\n\n        data.days = days;\n        data.months = months;\n        data.years = years;\n\n        return this;\n    }\n\n    function daysToMonths(days) {\n        // 400 years have 146097 days (taking into account leap year rules)\n        // 400 years have 12 months === 4800\n        return (days * 4800) / 146097;\n    }\n\n    function monthsToDays(months) {\n        // the reverse of daysToMonths\n        return (months * 146097) / 4800;\n    }\n\n    function as(units) {\n        if (!this.isValid()) {\n            return NaN;\n        }\n        var days,\n            months,\n            milliseconds = this._milliseconds;\n\n        units = normalizeUnits(units);\n\n        if (units === 'month' || units === 'quarter' || units === 'year') {\n            days = this._days + milliseconds / 864e5;\n            months = this._months + daysToMonths(days);\n            switch (units) {\n                case 'month':\n                    return months;\n                case 'quarter':\n                    return months / 3;\n                case 'year':\n                    return months / 12;\n            }\n        } else {\n            // handle milliseconds separately because of floating point math errors (issue #1867)\n            days = this._days + Math.round(monthsToDays(this._months));\n            switch (units) {\n                case 'week':\n                    return days / 7 + milliseconds / 6048e5;\n                case 'day':\n                    return days + milliseconds / 864e5;\n                case 'hour':\n                    return days * 24 + milliseconds / 36e5;\n                case 'minute':\n                    return days * 1440 + milliseconds / 6e4;\n                case 'second':\n                    return days * 86400 + milliseconds / 1000;\n                // Math.floor prevents floating point math errors here\n                case 'millisecond':\n                    return Math.floor(days * 864e5) + milliseconds;\n                default:\n                    throw new Error('Unknown unit ' + units);\n            }\n        }\n    }\n\n    // TODO: Use this.as('ms')?\n    function valueOf$1() {\n        if (!this.isValid()) {\n            return NaN;\n        }\n        return (\n            this._milliseconds +\n            this._days * 864e5 +\n            (this._months % 12) * 2592e6 +\n            toInt(this._months / 12) * 31536e6\n        );\n    }\n\n    function makeAs(alias) {\n        return function () {\n            return this.as(alias);\n        };\n    }\n\n    var asMilliseconds = makeAs('ms'),\n        asSeconds = makeAs('s'),\n        asMinutes = makeAs('m'),\n        asHours = makeAs('h'),\n        asDays = makeAs('d'),\n        asWeeks = makeAs('w'),\n        asMonths = makeAs('M'),\n        asQuarters = makeAs('Q'),\n        asYears = makeAs('y');\n\n    function clone$1() {\n        return createDuration(this);\n    }\n\n    function get$2(units) {\n        units = normalizeUnits(units);\n        return this.isValid() ? this[units + 's']() : NaN;\n    }\n\n    function makeGetter(name) {\n        return function () {\n            return this.isValid() ? this._data[name] : NaN;\n        };\n    }\n\n    var milliseconds = makeGetter('milliseconds'),\n        seconds = makeGetter('seconds'),\n        minutes = makeGetter('minutes'),\n        hours = makeGetter('hours'),\n        days = makeGetter('days'),\n        months = makeGetter('months'),\n        years = makeGetter('years');\n\n    function weeks() {\n        return absFloor(this.days() / 7);\n    }\n\n    var round = Math.round,\n        thresholds = {\n            ss: 44, // a few seconds to seconds\n            s: 45, // seconds to minute\n            m: 45, // minutes to hour\n            h: 22, // hours to day\n            d: 26, // days to month/week\n            w: null, // weeks to month\n            M: 11, // months to year\n        };\n\n    // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\n    function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n        return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n    }\n\n    function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {\n        var duration = createDuration(posNegDuration).abs(),\n            seconds = round(duration.as('s')),\n            minutes = round(duration.as('m')),\n            hours = round(duration.as('h')),\n            days = round(duration.as('d')),\n            months = round(duration.as('M')),\n            weeks = round(duration.as('w')),\n            years = round(duration.as('y')),\n            a =\n                (seconds <= thresholds.ss && ['s', seconds]) ||\n                (seconds < thresholds.s && ['ss', seconds]) ||\n                (minutes <= 1 && ['m']) ||\n                (minutes < thresholds.m && ['mm', minutes]) ||\n                (hours <= 1 && ['h']) ||\n                (hours < thresholds.h && ['hh', hours]) ||\n                (days <= 1 && ['d']) ||\n                (days < thresholds.d && ['dd', days]);\n\n        if (thresholds.w != null) {\n            a =\n                a ||\n                (weeks <= 1 && ['w']) ||\n                (weeks < thresholds.w && ['ww', weeks]);\n        }\n        a = a ||\n            (months <= 1 && ['M']) ||\n            (months < thresholds.M && ['MM', months]) ||\n            (years <= 1 && ['y']) || ['yy', years];\n\n        a[2] = withoutSuffix;\n        a[3] = +posNegDuration > 0;\n        a[4] = locale;\n        return substituteTimeAgo.apply(null, a);\n    }\n\n    // This function allows you to set the rounding function for relative time strings\n    function getSetRelativeTimeRounding(roundingFunction) {\n        if (roundingFunction === undefined) {\n            return round;\n        }\n        if (typeof roundingFunction === 'function') {\n            round = roundingFunction;\n            return true;\n        }\n        return false;\n    }\n\n    // This function allows you to set a threshold for relative time strings\n    function getSetRelativeTimeThreshold(threshold, limit) {\n        if (thresholds[threshold] === undefined) {\n            return false;\n        }\n        if (limit === undefined) {\n            return thresholds[threshold];\n        }\n        thresholds[threshold] = limit;\n        if (threshold === 's') {\n            thresholds.ss = limit - 1;\n        }\n        return true;\n    }\n\n    function humanize(argWithSuffix, argThresholds) {\n        if (!this.isValid()) {\n            return this.localeData().invalidDate();\n        }\n\n        var withSuffix = false,\n            th = thresholds,\n            locale,\n            output;\n\n        if (typeof argWithSuffix === 'object') {\n            argThresholds = argWithSuffix;\n            argWithSuffix = false;\n        }\n        if (typeof argWithSuffix === 'boolean') {\n            withSuffix = argWithSuffix;\n        }\n        if (typeof argThresholds === 'object') {\n            th = Object.assign({}, thresholds, argThresholds);\n            if (argThresholds.s != null && argThresholds.ss == null) {\n                th.ss = argThresholds.s - 1;\n            }\n        }\n\n        locale = this.localeData();\n        output = relativeTime$1(this, !withSuffix, th, locale);\n\n        if (withSuffix) {\n            output = locale.pastFuture(+this, output);\n        }\n\n        return locale.postformat(output);\n    }\n\n    var abs$1 = Math.abs;\n\n    function sign(x) {\n        return (x > 0) - (x < 0) || +x;\n    }\n\n    function toISOString$1() {\n        // for ISO strings we do not use the normal bubbling rules:\n        //  * milliseconds bubble up until they become hours\n        //  * days do not bubble at all\n        //  * months bubble up until they become years\n        // This is because there is no context-free conversion between hours and days\n        // (think of clock changes)\n        // and also not between days and months (28-31 days per month)\n        if (!this.isValid()) {\n            return this.localeData().invalidDate();\n        }\n\n        var seconds = abs$1(this._milliseconds) / 1000,\n            days = abs$1(this._days),\n            months = abs$1(this._months),\n            minutes,\n            hours,\n            years,\n            s,\n            total = this.asSeconds(),\n            totalSign,\n            ymSign,\n            daysSign,\n            hmsSign;\n\n        if (!total) {\n            // this is the same as C#'s (Noda) and python (isodate)...\n            // but not other JS (goog.date)\n            return 'P0D';\n        }\n\n        // 3600 seconds -> 60 minutes -> 1 hour\n        minutes = absFloor(seconds / 60);\n        hours = absFloor(minutes / 60);\n        seconds %= 60;\n        minutes %= 60;\n\n        // 12 months -> 1 year\n        years = absFloor(months / 12);\n        months %= 12;\n\n        // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n        s = seconds ? seconds.toFixed(3).replace(/\\.?0+$/, '') : '';\n\n        totalSign = total < 0 ? '-' : '';\n        ymSign = sign(this._months) !== sign(total) ? '-' : '';\n        daysSign = sign(this._days) !== sign(total) ? '-' : '';\n        hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';\n\n        return (\n            totalSign +\n            'P' +\n            (years ? ymSign + years + 'Y' : '') +\n            (months ? ymSign + months + 'M' : '') +\n            (days ? daysSign + days + 'D' : '') +\n            (hours || minutes || seconds ? 'T' : '') +\n            (hours ? hmsSign + hours + 'H' : '') +\n            (minutes ? hmsSign + minutes + 'M' : '') +\n            (seconds ? hmsSign + s + 'S' : '')\n        );\n    }\n\n    var proto$2 = Duration.prototype;\n\n    proto$2.isValid = isValid$1;\n    proto$2.abs = abs;\n    proto$2.add = add$1;\n    proto$2.subtract = subtract$1;\n    proto$2.as = as;\n    proto$2.asMilliseconds = asMilliseconds;\n    proto$2.asSeconds = asSeconds;\n    proto$2.asMinutes = asMinutes;\n    proto$2.asHours = asHours;\n    proto$2.asDays = asDays;\n    proto$2.asWeeks = asWeeks;\n    proto$2.asMonths = asMonths;\n    proto$2.asQuarters = asQuarters;\n    proto$2.asYears = asYears;\n    proto$2.valueOf = valueOf$1;\n    proto$2._bubble = bubble;\n    proto$2.clone = clone$1;\n    proto$2.get = get$2;\n    proto$2.milliseconds = milliseconds;\n    proto$2.seconds = seconds;\n    proto$2.minutes = minutes;\n    proto$2.hours = hours;\n    proto$2.days = days;\n    proto$2.weeks = weeks;\n    proto$2.months = months;\n    proto$2.years = years;\n    proto$2.humanize = humanize;\n    proto$2.toISOString = toISOString$1;\n    proto$2.toString = toISOString$1;\n    proto$2.toJSON = toISOString$1;\n    proto$2.locale = locale;\n    proto$2.localeData = localeData;\n\n    proto$2.toIsoString = deprecate(\n        'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)',\n        toISOString$1\n    );\n    proto$2.lang = lang;\n\n    // FORMATTING\n\n    addFormatToken('X', 0, 0, 'unix');\n    addFormatToken('x', 0, 0, 'valueOf');\n\n    // PARSING\n\n    addRegexToken('x', matchSigned);\n    addRegexToken('X', matchTimestamp);\n    addParseToken('X', function (input, array, config) {\n        config._d = new Date(parseFloat(input) * 1000);\n    });\n    addParseToken('x', function (input, array, config) {\n        config._d = new Date(toInt(input));\n    });\n\n    //! moment.js\n\n    hooks.version = '2.29.4';\n\n    setHookCallback(createLocal);\n\n    hooks.fn = proto;\n    hooks.min = min;\n    hooks.max = max;\n    hooks.now = now;\n    hooks.utc = createUTC;\n    hooks.unix = createUnix;\n    hooks.months = listMonths;\n    hooks.isDate = isDate;\n    hooks.locale = getSetGlobalLocale;\n    hooks.invalid = createInvalid;\n    hooks.duration = createDuration;\n    hooks.isMoment = isMoment;\n    hooks.weekdays = listWeekdays;\n    hooks.parseZone = createInZone;\n    hooks.localeData = getLocale;\n    hooks.isDuration = isDuration;\n    hooks.monthsShort = listMonthsShort;\n    hooks.weekdaysMin = listWeekdaysMin;\n    hooks.defineLocale = defineLocale;\n    hooks.updateLocale = updateLocale;\n    hooks.locales = listLocales;\n    hooks.weekdaysShort = listWeekdaysShort;\n    hooks.normalizeUnits = normalizeUnits;\n    hooks.relativeTimeRounding = getSetRelativeTimeRounding;\n    hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;\n    hooks.calendarFormat = getCalendarFormat;\n    hooks.prototype = proto;\n\n    // currently HTML5 input type only supports 24-hour formats\n    hooks.HTML5_FMT = {\n        DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type=\"datetime-local\" />\n        DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type=\"datetime-local\" step=\"1\" />\n        DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type=\"datetime-local\" step=\"0.001\" />\n        DATE: 'YYYY-MM-DD', // <input type=\"date\" />\n        TIME: 'HH:mm', // <input type=\"time\" />\n        TIME_SECONDS: 'HH:mm:ss', // <input type=\"time\" step=\"1\" />\n        TIME_MS: 'HH:mm:ss.SSS', // <input type=\"time\" step=\"0.001\" />\n        WEEK: 'GGGG-[W]WW', // <input type=\"week\" />\n        MONTH: 'YYYY-MM', // <input type=\"month\" />\n    };\n\n    return hooks;\n\n})));\n","/* @license\nPapa Parse\nv5.3.2\nhttps://github.com/mholt/PapaParse\nLicense: MIT\n*/\n!function(e,t){\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof module&&\"undefined\"!=typeof exports?module.exports=t():e.Papa=t()}(this,function s(){\"use strict\";var f=\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:void 0!==f?f:{};var n=!f.document&&!!f.postMessage,o=n&&/blob:/i.test((f.location||{}).protocol),a={},h=0,b={parse:function(e,t){var i=(t=t||{}).dynamicTyping||!1;M(i)&&(t.dynamicTypingFunction=i,i={});if(t.dynamicTyping=i,t.transform=!!M(t.transform)&&t.transform,t.worker&&b.WORKERS_SUPPORTED){var r=function(){if(!b.WORKERS_SUPPORTED)return!1;var e=(i=f.URL||f.webkitURL||null,r=s.toString(),b.BLOB_URL||(b.BLOB_URL=i.createObjectURL(new Blob([\"(\",r,\")();\"],{type:\"text/javascript\"})))),t=new f.Worker(e);var i,r;return t.onmessage=_,t.id=h++,a[t.id]=t}();return r.userStep=t.step,r.userChunk=t.chunk,r.userComplete=t.complete,r.userError=t.error,t.step=M(t.step),t.chunk=M(t.chunk),t.complete=M(t.complete),t.error=M(t.error),delete t.worker,void r.postMessage({input:e,config:t,workerId:r.id})}var n=null;b.NODE_STREAM_INPUT,\"string\"==typeof e?n=t.download?new l(t):new p(t):!0===e.readable&&M(e.read)&&M(e.on)?n=new g(t):(f.File&&e instanceof File||e instanceof Object)&&(n=new c(t));return n.stream(e)},unparse:function(e,t){var n=!1,_=!0,m=\",\",y=\"\\r\\n\",s='\"',a=s+s,i=!1,r=null,o=!1;!function(){if(\"object\"!=typeof t)return;\"string\"!=typeof t.delimiter||b.BAD_DELIMITERS.filter(function(e){return-1!==t.delimiter.indexOf(e)}).length||(m=t.delimiter);(\"boolean\"==typeof t.quotes||\"function\"==typeof t.quotes||Array.isArray(t.quotes))&&(n=t.quotes);\"boolean\"!=typeof t.skipEmptyLines&&\"string\"!=typeof t.skipEmptyLines||(i=t.skipEmptyLines);\"string\"==typeof t.newline&&(y=t.newline);\"string\"==typeof t.quoteChar&&(s=t.quoteChar);\"boolean\"==typeof t.header&&(_=t.header);if(Array.isArray(t.columns)){if(0===t.columns.length)throw new Error(\"Option columns is empty\");r=t.columns}void 0!==t.escapeChar&&(a=t.escapeChar+s);(\"boolean\"==typeof t.escapeFormulae||t.escapeFormulae instanceof RegExp)&&(o=t.escapeFormulae instanceof RegExp?t.escapeFormulae:/^[=+\\-@\\t\\r].*$/)}();var h=new RegExp(j(s),\"g\");\"string\"==typeof e&&(e=JSON.parse(e));if(Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return u(null,e,i);if(\"object\"==typeof e[0])return u(r||Object.keys(e[0]),e,i)}else if(\"object\"==typeof e)return\"string\"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||r),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:\"object\"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||\"object\"==typeof e.data[0]||(e.data=[e.data])),u(e.fields||[],e.data||[],i);throw new Error(\"Unable to serialize unrecognized input\");function u(e,t,i){var r=\"\";\"string\"==typeof e&&(e=JSON.parse(e)),\"string\"==typeof t&&(t=JSON.parse(t));var n=Array.isArray(e)&&0<e.length,s=!Array.isArray(t[0]);if(n&&_){for(var a=0;a<e.length;a++)0<a&&(r+=m),r+=v(e[a],a);0<t.length&&(r+=y)}for(var o=0;o<t.length;o++){var h=n?e.length:t[o].length,u=!1,f=n?0===Object.keys(t[o]).length:0===t[o].length;if(i&&!n&&(u=\"greedy\"===i?\"\"===t[o].join(\"\").trim():1===t[o].length&&0===t[o][0].length),\"greedy\"===i&&n){for(var d=[],l=0;l<h;l++){var c=s?e[l]:l;d.push(t[o][c])}u=\"\"===d.join(\"\").trim()}if(!u){for(var p=0;p<h;p++){0<p&&!f&&(r+=m);var g=n&&s?e[p]:p;r+=v(t[o][g],p)}o<t.length-1&&(!i||0<h&&!f)&&(r+=y)}}return r}function v(e,t){if(null==e)return\"\";if(e.constructor===Date)return JSON.stringify(e).slice(1,25);var i=!1;o&&\"string\"==typeof e&&o.test(e)&&(e=\"'\"+e,i=!0);var r=e.toString().replace(h,a);return(i=i||!0===n||\"function\"==typeof n&&n(e,t)||Array.isArray(n)&&n[t]||function(e,t){for(var i=0;i<t.length;i++)if(-1<e.indexOf(t[i]))return!0;return!1}(r,b.BAD_DELIMITERS)||-1<r.indexOf(m)||\" \"===r.charAt(0)||\" \"===r.charAt(r.length-1))?s+r+s:r}}};if(b.RECORD_SEP=String.fromCharCode(30),b.UNIT_SEP=String.fromCharCode(31),b.BYTE_ORDER_MARK=\"\\ufeff\",b.BAD_DELIMITERS=[\"\\r\",\"\\n\",'\"',b.BYTE_ORDER_MARK],b.WORKERS_SUPPORTED=!n&&!!f.Worker,b.NODE_STREAM_INPUT=1,b.LocalChunkSize=10485760,b.RemoteChunkSize=5242880,b.DefaultDelimiter=\",\",b.Parser=E,b.ParserHandle=i,b.NetworkStreamer=l,b.FileStreamer=c,b.StringStreamer=p,b.ReadableStreamStreamer=g,f.jQuery){var d=f.jQuery;d.fn.parse=function(o){var i=o.config||{},h=[];return this.each(function(e){if(!(\"INPUT\"===d(this).prop(\"tagName\").toUpperCase()&&\"file\"===d(this).attr(\"type\").toLowerCase()&&f.FileReader)||!this.files||0===this.files.length)return!0;for(var t=0;t<this.files.length;t++)h.push({file:this.files[t],inputElem:this,instanceConfig:d.extend({},i)})}),e(),this;function e(){if(0!==h.length){var e,t,i,r,n=h[0];if(M(o.before)){var s=o.before(n.file,n.inputElem);if(\"object\"==typeof s){if(\"abort\"===s.action)return e=\"AbortError\",t=n.file,i=n.inputElem,r=s.reason,void(M(o.error)&&o.error({name:e},t,i,r));if(\"skip\"===s.action)return void u();\"object\"==typeof s.config&&(n.instanceConfig=d.extend(n.instanceConfig,s.config))}else if(\"skip\"===s)return void u()}var a=n.instanceConfig.complete;n.instanceConfig.complete=function(e){M(a)&&a(e,n.file,n.inputElem),u()},b.parse(n.file,n.instanceConfig)}else M(o.complete)&&o.complete()}function u(){h.splice(0,1),e()}}}function u(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine=\"\",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(e){var t=w(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null);this._handle=new i(t),(this._handle.streamer=this)._config=t}.call(this,e),this.parseChunk=function(e,t){if(this.isFirstChunk&&M(this._config.beforeFirstChunk)){var i=this._config.beforeFirstChunk(e);void 0!==i&&(e=i)}this.isFirstChunk=!1,this._halted=!1;var r=this._partialLine+e;this._partialLine=\"\";var n=this._handle.parse(r,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var s=n.meta.cursor;this._finished||(this._partialLine=r.substring(s-this._baseIndex),this._baseIndex=s),n&&n.data&&(this._rowCount+=n.data.length);var a=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(o)f.postMessage({results:n,workerId:b.WORKER_ID,finished:a});else if(M(this._config.chunk)&&!t){if(this._config.chunk(n,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);n=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(n.data),this._completeResults.errors=this._completeResults.errors.concat(n.errors),this._completeResults.meta=n.meta),this._completed||!a||!M(this._config.complete)||n&&n.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),a||n&&n.meta.paused||this._nextChunk(),n}this._halted=!0},this._sendError=function(e){M(this._config.error)?this._config.error(e):o&&this._config.error&&f.postMessage({workerId:b.WORKER_ID,error:e,finished:!1})}}function l(e){var r;(e=e||{}).chunkSize||(e.chunkSize=b.RemoteChunkSize),u.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(r=new XMLHttpRequest,this._config.withCredentials&&(r.withCredentials=this._config.withCredentials),n||(r.onload=v(this._chunkLoaded,this),r.onerror=v(this._chunkError,this)),r.open(this._config.downloadRequestBody?\"POST\":\"GET\",this._input,!n),this._config.downloadRequestHeaders){var e=this._config.downloadRequestHeaders;for(var t in e)r.setRequestHeader(t,e[t])}if(this._config.chunkSize){var i=this._start+this._config.chunkSize-1;r.setRequestHeader(\"Range\",\"bytes=\"+this._start+\"-\"+i)}try{r.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}n&&0===r.status&&this._chunkError()}},this._chunkLoaded=function(){4===r.readyState&&(r.status<200||400<=r.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:r.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(e){var t=e.getResponseHeader(\"Content-Range\");if(null===t)return-1;return parseInt(t.substring(t.lastIndexOf(\"/\")+1))}(r),this.parseChunk(r.responseText)))},this._chunkError=function(e){var t=r.statusText||e;this._sendError(new Error(t))}}function c(e){var r,n;(e=e||{}).chunkSize||(e.chunkSize=b.LocalChunkSize),u.call(this,e);var s=\"undefined\"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,s?((r=new FileReader).onload=v(this._chunkLoaded,this),r.onerror=v(this._chunkError,this)):r=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var e=this._input;if(this._config.chunkSize){var t=Math.min(this._start+this._config.chunkSize,this._input.size);e=n.call(e,this._start,t)}var i=r.readAsText(e,this._config.encoding);s||this._chunkLoaded({target:{result:i}})},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(r.error)}}function p(e){var i;u.call(this,e=e||{}),this.stream=function(e){return i=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e,t=this._config.chunkSize;return t?(e=i.substring(0,t),i=i.substring(t)):(e=i,i=\"\"),this._finished=!i,this.parseChunk(e)}}}function g(e){u.call(this,e=e||{});var t=[],i=!0,r=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on(\"data\",this._streamData),this._input.on(\"end\",this._streamEnd),this._input.on(\"error\",this._streamError)},this._checkIsFinished=function(){r&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):i=!0},this._streamData=v(function(e){try{t.push(\"string\"==typeof e?e:e.toString(this._config.encoding)),i&&(i=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=v(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=v(function(){this._streamCleanUp(),r=!0,this._streamData(\"\")},this),this._streamCleanUp=v(function(){this._input.removeListener(\"data\",this._streamData),this._input.removeListener(\"end\",this._streamEnd),this._input.removeListener(\"error\",this._streamError)},this)}function i(m){var a,o,h,r=Math.pow(2,53),n=-r,s=/^\\s*-?(\\d+\\.?|\\.\\d+|\\d+\\.\\d+)([eE][-+]?\\d+)?\\s*$/,u=/^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z))|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))$/,t=this,i=0,f=0,d=!1,e=!1,l=[],c={data:[],errors:[],meta:{}};if(M(m.step)){var p=m.step;m.step=function(e){if(c=e,_())g();else{if(g(),0===c.data.length)return;i+=e.data.length,m.preview&&i>m.preview?o.abort():(c.data=c.data[0],p(c,t))}}}function y(e){return\"greedy\"===m.skipEmptyLines?\"\"===e.join(\"\").trim():1===e.length&&0===e[0].length}function g(){return c&&h&&(k(\"Delimiter\",\"UndetectableDelimiter\",\"Unable to auto-detect delimiting character; defaulted to '\"+b.DefaultDelimiter+\"'\"),h=!1),m.skipEmptyLines&&(c.data=c.data.filter(function(e){return!y(e)})),_()&&function(){if(!c)return;function e(e,t){M(m.transformHeader)&&(e=m.transformHeader(e,t)),l.push(e)}if(Array.isArray(c.data[0])){for(var t=0;_()&&t<c.data.length;t++)c.data[t].forEach(e);c.data.splice(0,1)}else c.data.forEach(e)}(),function(){if(!c||!m.header&&!m.dynamicTyping&&!m.transform)return c;function e(e,t){var i,r=m.header?{}:[];for(i=0;i<e.length;i++){var n=i,s=e[i];m.header&&(n=i>=l.length?\"__parsed_extra\":l[i]),m.transform&&(s=m.transform(s,n)),s=v(n,s),\"__parsed_extra\"===n?(r[n]=r[n]||[],r[n].push(s)):r[n]=s}return m.header&&(i>l.length?k(\"FieldMismatch\",\"TooManyFields\",\"Too many fields: expected \"+l.length+\" fields but parsed \"+i,f+t):i<l.length&&k(\"FieldMismatch\",\"TooFewFields\",\"Too few fields: expected \"+l.length+\" fields but parsed \"+i,f+t)),r}var t=1;!c.data.length||Array.isArray(c.data[0])?(c.data=c.data.map(e),t=c.data.length):c.data=e(c.data,0);m.header&&c.meta&&(c.meta.fields=l);return f+=t,c}()}function _(){return m.header&&0===l.length}function v(e,t){return i=e,m.dynamicTypingFunction&&void 0===m.dynamicTyping[i]&&(m.dynamicTyping[i]=m.dynamicTypingFunction(i)),!0===(m.dynamicTyping[i]||m.dynamicTyping)?\"true\"===t||\"TRUE\"===t||\"false\"!==t&&\"FALSE\"!==t&&(function(e){if(s.test(e)){var t=parseFloat(e);if(n<t&&t<r)return!0}return!1}(t)?parseFloat(t):u.test(t)?new Date(t):\"\"===t?null:t):t;var i}function k(e,t,i,r){var n={type:e,code:t,message:i};void 0!==r&&(n.row=r),c.errors.push(n)}this.parse=function(e,t,i){var r=m.quoteChar||'\"';if(m.newline||(m.newline=function(e,t){e=e.substring(0,1048576);var i=new RegExp(j(t)+\"([^]*?)\"+j(t),\"gm\"),r=(e=e.replace(i,\"\")).split(\"\\r\"),n=e.split(\"\\n\"),s=1<n.length&&n[0].length<r[0].length;if(1===r.length||s)return\"\\n\";for(var a=0,o=0;o<r.length;o++)\"\\n\"===r[o][0]&&a++;return a>=r.length/2?\"\\r\\n\":\"\\r\"}(e,r)),h=!1,m.delimiter)M(m.delimiter)&&(m.delimiter=m.delimiter(e),c.meta.delimiter=m.delimiter);else{var n=function(e,t,i,r,n){var s,a,o,h;n=n||[\",\",\"\\t\",\"|\",\";\",b.RECORD_SEP,b.UNIT_SEP];for(var u=0;u<n.length;u++){var f=n[u],d=0,l=0,c=0;o=void 0;for(var p=new E({comments:r,delimiter:f,newline:t,preview:10}).parse(e),g=0;g<p.data.length;g++)if(i&&y(p.data[g]))c++;else{var _=p.data[g].length;l+=_,void 0!==o?0<_&&(d+=Math.abs(_-o),o=_):o=_}0<p.data.length&&(l/=p.data.length-c),(void 0===a||d<=a)&&(void 0===h||h<l)&&1.99<l&&(a=d,s=f,h=l)}return{successful:!!(m.delimiter=s),bestDelimiter:s}}(e,m.newline,m.skipEmptyLines,m.comments,m.delimitersToGuess);n.successful?m.delimiter=n.bestDelimiter:(h=!0,m.delimiter=b.DefaultDelimiter),c.meta.delimiter=m.delimiter}var s=w(m);return m.preview&&m.header&&s.preview++,a=e,o=new E(s),c=o.parse(a,t,i),g(),d?{meta:{paused:!0}}:c||{meta:{paused:!1}}},this.paused=function(){return d},this.pause=function(){d=!0,o.abort(),a=M(m.chunk)?\"\":a.substring(o.getCharIndex())},this.resume=function(){t.streamer._halted?(d=!1,t.streamer.parseChunk(a,!0)):setTimeout(t.resume,3)},this.aborted=function(){return e},this.abort=function(){e=!0,o.abort(),c.meta.aborted=!0,M(m.complete)&&m.complete(c),a=\"\"}}function j(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\")}function E(e){var S,O=(e=e||{}).delimiter,x=e.newline,I=e.comments,T=e.step,D=e.preview,A=e.fastMode,L=S=void 0===e.quoteChar||null===e.quoteChar?'\"':e.quoteChar;if(void 0!==e.escapeChar&&(L=e.escapeChar),(\"string\"!=typeof O||-1<b.BAD_DELIMITERS.indexOf(O))&&(O=\",\"),I===O)throw new Error(\"Comment character same as delimiter\");!0===I?I=\"#\":(\"string\"!=typeof I||-1<b.BAD_DELIMITERS.indexOf(I))&&(I=!1),\"\\n\"!==x&&\"\\r\"!==x&&\"\\r\\n\"!==x&&(x=\"\\n\");var F=0,z=!1;this.parse=function(r,t,i){if(\"string\"!=typeof r)throw new Error(\"Input must be a string\");var n=r.length,e=O.length,s=x.length,a=I.length,o=M(T),h=[],u=[],f=[],d=F=0;if(!r)return C();if(A||!1!==A&&-1===r.indexOf(S)){for(var l=r.split(x),c=0;c<l.length;c++){if(f=l[c],F+=f.length,c!==l.length-1)F+=x.length;else if(i)return C();if(!I||f.substring(0,a)!==I){if(o){if(h=[],k(f.split(O)),R(),z)return C()}else k(f.split(O));if(D&&D<=c)return h=h.slice(0,D),C(!0)}}return C()}for(var p=r.indexOf(O,F),g=r.indexOf(x,F),_=new RegExp(j(L)+j(S),\"g\"),m=r.indexOf(S,F);;)if(r[F]!==S)if(I&&0===f.length&&r.substring(F,F+a)===I){if(-1===g)return C();F=g+s,g=r.indexOf(x,F),p=r.indexOf(O,F)}else if(-1!==p&&(p<g||-1===g))f.push(r.substring(F,p)),F=p+e,p=r.indexOf(O,F);else{if(-1===g)break;if(f.push(r.substring(F,g)),w(g+s),o&&(R(),z))return C();if(D&&h.length>=D)return C(!0)}else for(m=F,F++;;){if(-1===(m=r.indexOf(S,m+1)))return i||u.push({type:\"Quotes\",code:\"MissingQuotes\",message:\"Quoted field unterminated\",row:h.length,index:F}),E();if(m===n-1)return E(r.substring(F,m).replace(_,S));if(S!==L||r[m+1]!==L){if(S===L||0===m||r[m-1]!==L){-1!==p&&p<m+1&&(p=r.indexOf(O,m+1)),-1!==g&&g<m+1&&(g=r.indexOf(x,m+1));var y=b(-1===g?p:Math.min(p,g));if(r.substr(m+1+y,e)===O){f.push(r.substring(F,m).replace(_,S)),r[F=m+1+y+e]!==S&&(m=r.indexOf(S,F)),p=r.indexOf(O,F),g=r.indexOf(x,F);break}var v=b(g);if(r.substring(m+1+v,m+1+v+s)===x){if(f.push(r.substring(F,m).replace(_,S)),w(m+1+v+s),p=r.indexOf(O,F),m=r.indexOf(S,F),o&&(R(),z))return C();if(D&&h.length>=D)return C(!0);break}u.push({type:\"Quotes\",code:\"InvalidQuotes\",message:\"Trailing quote on quoted field is malformed\",row:h.length,index:F}),m++}}else m++}return E();function k(e){h.push(e),d=F}function b(e){var t=0;if(-1!==e){var i=r.substring(m+1,e);i&&\"\"===i.trim()&&(t=i.length)}return t}function E(e){return i||(void 0===e&&(e=r.substring(F)),f.push(e),F=n,k(f),o&&R()),C()}function w(e){F=e,k(f),f=[],g=r.indexOf(x,F)}function C(e){return{data:h,errors:u,meta:{delimiter:O,linebreak:x,aborted:z,truncated:!!e,cursor:d+(t||0)}}}function R(){T(C()),h=[],u=[]}},this.abort=function(){z=!0},this.getCharIndex=function(){return F}}function _(e){var t=e.data,i=a[t.workerId],r=!1;if(t.error)i.userError(t.error,t.file);else if(t.results&&t.results.data){var n={abort:function(){r=!0,m(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:y,resume:y};if(M(i.userStep)){for(var s=0;s<t.results.data.length&&(i.userStep({data:t.results.data[s],errors:t.results.errors,meta:t.results.meta},n),!r);s++);delete t.results}else M(i.userChunk)&&(i.userChunk(t.results,n,t.file),delete t.results)}t.finished&&!r&&m(t.workerId,t.results)}function m(e,t){var i=a[e];M(i.userComplete)&&i.userComplete(t),i.terminate(),delete a[e]}function y(){throw new Error(\"Not implemented.\")}function w(e){if(\"object\"!=typeof e||null===e)return e;var t=Array.isArray(e)?[]:{};for(var i in e)t[i]=w(e[i]);return t}function v(e,t){return function(){e.apply(t,arguments)}}function M(e){return\"function\"==typeof e}return o&&(f.onmessage=function(e){var t=e.data;void 0===b.WORKER_ID&&t&&(b.WORKER_ID=t.workerId);if(\"string\"==typeof t.input)f.postMessage({workerId:b.WORKER_ID,results:b.parse(t.input,t.config),finished:!0});else if(f.File&&t.input instanceof File||t.input instanceof Object){var i=b.parse(t.input,t.config);i&&f.postMessage({workerId:b.WORKER_ID,results:i,finished:!0})}}),(l.prototype=Object.create(u.prototype)).constructor=l,(c.prototype=Object.create(u.prototype)).constructor=c,(p.prototype=Object.create(p.prototype)).constructor=p,(g.prototype=Object.create(u.prototype)).constructor=g,b});","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PusherPresenceChannelMock = exports.PusherChannelMock = exports.PusherFactoryMock = exports.PusherMock = void 0;\nvar pusher_channel_mock_1 = require(\"./pusher-channel-mock\");\nexports.PusherChannelMock = pusher_channel_mock_1.default;\nvar pusher_factory_mock_1 = require(\"./pusher-factory-mock\");\nexports.PusherFactoryMock = pusher_factory_mock_1.default;\nvar pusher_js_mock_1 = require(\"./pusher-js-mock\");\nexports.PusherMock = pusher_js_mock_1.default;\nvar pusher_presence_channel_mock_1 = require(\"./pusher-presence-channel-mock\");\nexports.PusherPresenceChannelMock = pusher_presence_channel_mock_1.default;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.objectApply = void 0;\n/* tslint:disable */\n/* istanbul ignore file */\n/** COPIED DIRECTLY FROM pusher-js PACKAGE */\nfunction objectApply(object, f) {\n    for (var key in object) {\n        if (Object.prototype.hasOwnProperty.call(object, key)) {\n            f(object[key], key, object);\n        }\n    }\n}\nexports.objectApply = objectApply;\n/** COPIED DIRECTLY FROM pusher-js PACKAGE */\n/** Represents a collection of members of a presence channel. */\nvar Members = /** @class */ (function () {\n    function Members(members) {\n        this.reset(members);\n    }\n    /** Returns member's info for given id.\n     *\n     * Resulting object containts two fields - id and info.\n     *\n     * @param {Number} id\n     * @return {Object} member's info or null\n     */\n    Members.prototype.get = function (id) {\n        if (Object.prototype.hasOwnProperty.call(this.members, id)) {\n            return {\n                id: id,\n                info: this.members[id]\n            };\n        }\n        else {\n            return null;\n        }\n    };\n    /** Calls back for each member in unspecified order.\n     *\n     * @param  {Function} callback\n     */\n    Members.prototype.each = function (callback) {\n        var _this = this;\n        objectApply(this.members, function (member, id) {\n            callback(_this.get(id));\n        });\n    };\n    /** Adds a new member to the collection. For internal use only. */\n    Members.prototype.addMember = function (memberData) {\n        if (this.get(memberData.user_id) === null) {\n            this.count++;\n        }\n        this.members[memberData.user_id] = memberData.user_info;\n        return this.get(memberData.user_id);\n    };\n    /** Adds a member from the collection. For internal use only. */\n    Members.prototype.removeMember = function (memberData) {\n        var member = this.get(memberData.user_id);\n        if (member) {\n            delete this.members[memberData.user_id];\n            this.count--;\n        }\n        return member;\n    };\n    /** Resets the collection to the initial state. For internal use only. */\n    Members.prototype.reset = function (members) {\n        this.members = members || {};\n        this.count = 0;\n        this.myID = null;\n        this.me = null;\n    };\n    return Members;\n}());\nexports.default = Members;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.proxyPresenceChannel = void 0;\n/**\n * Proxy custom members info to\n *\n * @param {Members} original The original members property on the channel\n * @param {PusherMock} client The client we're using to proxy the channel\n * @returns {Members} The proxied members property on the channel\n */\nvar proxyMembers = function (original, client) {\n    original.myID = client.id;\n    original.me = {\n        id: client.id,\n        info: client.info\n    };\n    return original;\n};\n/**\n * Proxy the channel bind function and attach owner id for conditions in channel.emit\n *\n * @param original The channel being proxied\n * @param client The client we're using to proxy the channel\n * @returns void\n */\nvar proxyBind = function (original, client) { return function (eventName, callback) {\n    if (client.id) {\n        callback.owner = client.id;\n        original.bind(eventName, callback);\n    }\n}; };\n/**\n * Proxy emit function and only trigger callbacks if conditions are correct, i.e.\n * - if the eventName is internal, only trigger the callback if the owner is me\n * - or if the eventName isn't internal, only call this callback if the owner is not me\n *\n * @param original The channel being proxied\n * @param client The client we're using to proxy the channel\n * @returns void\n */\nvar proxyEmit = function (original, client) { return function (eventName, data) {\n    var callbacks = original.callbacks[eventName];\n    var internals = [\"pusher:subscription_succeeded\"];\n    if (callbacks) {\n        callbacks.forEach(function (cb) {\n            if ((internals.includes(eventName) &&\n                cb.owner === client.id) ||\n                (!internals.includes(eventName) &&\n                    cb.owner !== client.id)) {\n                cb(data);\n            }\n        });\n    }\n}; };\n/**\n * Create the proxied channel\n * @param {PusherPresenceChannelMock} channel the channel to be proxied\n * @param {PusherMock} client the client we'll use to proxy the channel\n * @returns {Proxy<PusherPresenceChannelMock>} the proxied channel\n */\nexports.proxyPresenceChannel = function (channel, client) {\n    var handler = {\n        /**\n         * Proxies a channel and augments it with client specific information\n         * @param target The channel we're proxying\n         * @param key The attribute, property or method we're trapping\n         * @returns {mixed} the result of the trapped function\n         */\n        get: function (target, key) {\n            switch (key) {\n                /** Attach this client's info the member specific calls */\n                case \"members\":\n                    return proxyMembers(target.members, client);\n                /** Attach the owner of the callback so we can ignore it in future */\n                case \"bind\":\n                    return proxyBind(target, client);\n                /** Emit callbacks on this channel, with conditions to check whether the callback should be called or not */\n                case \"emit\":\n                case \"trigger\":\n                    return proxyEmit(target, client);\n                /** For developer experience, attach IS_PROXY flag to check whether the channel has been proxied or not */\n                case \"IS_PROXY\":\n                    return true;\n                default:\n                    return target[key];\n            }\n        }\n    };\n    return new Proxy(channel, handler);\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/** Class representing a fake Pusher channel. */\nvar PusherChannelMock = /** @class */ (function () {\n    /** Initialize PusherChannelMock with callbacks object. */\n    function PusherChannelMock(name) {\n        if (name === void 0) { name = \"public-channel\"; }\n        this.subscribed = true;\n        this.name = name;\n        this.callbacks = {};\n    }\n    /**\n     * Bind callback to an event name.\n     * @param {String} name - name of the event.\n     * @param {Function} callback - callback to be called on event.\n     */\n    PusherChannelMock.prototype.bind = function (name, callback) {\n        this.callbacks[name] = this.callbacks[name] || [];\n        this.callbacks[name].push(callback);\n        return this;\n    };\n    /**\n     * Unbind callback from an event name.\n     * @param {String} name - name of the event.\n     * @param {Function} callback - callback to be called on event.\n     */\n    PusherChannelMock.prototype.unbind = function (name, callback) {\n        this.callbacks[name] = (this.callbacks[name] || []).filter(function (cb) { return cb !== callback; });\n        return this;\n    };\n    /**\n     * Unbind callbacks from all the events.\n     */\n    PusherChannelMock.prototype.unbind_all = function () {\n        this.callbacks = {};\n        return this;\n    };\n    /**\n     * Emit event with data.\n     * @param {String} name - name of the event.\n     * @param {*} data - data you want to pass in to callback function that gets called.\n     */\n    PusherChannelMock.prototype.emit = function (name, data) {\n        var callbacks = this.callbacks[name];\n        if (callbacks) {\n            callbacks.forEach(function (cb) { return cb(data); });\n        }\n        return this;\n    };\n    /**\n     * Trigger event with data.\n     * @param {String} name - name of the event.\n     * @param {*} data - data you want to pass in to callback function that gets called.\n     */\n    PusherChannelMock.prototype.trigger = function (name, data) {\n        this.emit(name, data);\n    };\n    return PusherChannelMock;\n}());\nexports.default = PusherChannelMock;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n    return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n    function verb(n) { return function (v) { return step([n, v]); }; }\n    function step(op) {\n        if (f) throw new TypeError(\"Generator is already executing.\");\n        while (_) try {\n            if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n            if (y = 0, t) op = [op[0] & 2, t.value];\n            switch (op[0]) {\n                case 0: case 1: t = op; break;\n                case 4: _.label++; return { value: op[1], done: false };\n                case 5: _.label++; y = op[1]; op = [0]; continue;\n                case 7: op = _.ops.pop(); _.trys.pop(); continue;\n                default:\n                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n                    if (t[2]) _.ops.pop();\n                    _.trys.pop(); continue;\n            }\n            op = body.call(thisArg, _);\n        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n    }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.emitDisconnectionEvents = exports.emitConnectionEvents = void 0;\n/**\n * Emit connection events triggered by pusher\n * @param {PusherPresenceChannelMock} channel the channel we want to trigger this on\n * @param client the client we're using to emit the connection events\n * @returns void\n */\nexports.emitConnectionEvents = function (channel, client) { return __awaiter(void 0, void 0, void 0, function () {\n    return __generator(this, function (_a) {\n        switch (_a.label) {\n            case 0: \n            /** setTimeout simulates the async nature of adding members */\n            return [4 /*yield*/, Promise.resolve()];\n            case 1:\n                /** setTimeout simulates the async nature of adding members */\n                _a.sent();\n                /** Add member to the members object */\n                channel.members.addMember({\n                    user_id: client.id,\n                    user_info: client.info\n                });\n                /** emit external event to other connected clients */\n                channel.emit(\"pusher:member_added\", {\n                    id: client.id,\n                    info: client.info\n                });\n                /** Emit internal event */\n                channel.emit(\"pusher:subscription_succeeded\", channel.members);\n                return [2 /*return*/];\n        }\n    });\n}); };\n/**\n * Emit disconnection events triggered by pusher\n * @param {PusherPresenceChannelMock} channel the channel we want to trigger this on\n * @param client the client we're using to emit the connection events\n * @returns void\n */\nexports.emitDisconnectionEvents = function (channel, client) {\n    /** Remove member from the members object */\n    channel.members.removeMember({\n        user_id: client.id,\n        user_info: client.info\n    });\n    /** emit external event to other connected clients */\n    channel.emit(\"pusher:member_removed\", {\n        id: client.id,\n        info: client.info\n    });\n};\n","\"use strict\";\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n    for (var r = Array(s), k = 0, i = 0; i < il; i++)\n        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n            r[k] = a[j];\n    return r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar pusher_js_mock_1 = require(\"./pusher-js-mock\");\n/**\n * Class represents fake PusherFactory.\n *\n * @example <caption>Example of mocking global Pusher instance</caption>\n *\n * import { PusherFactoryMock } from \"pusher-js-mock\";\n *\n * ...\n *\n * beforeEach(() => {\n *   const pusherFactoryMock = new PusherFactoryMock()\n *\n *   window.PusherFactory = pusherFactoryMock\n *\n *   pusher = pusherFactoryMock.pusherClient()\n * })\n */\nvar PusherFactoryMock = /** @class */ (function () {\n    /**\n     * Initialize PusherFactoryMock with pusherKey and sets a\n     * pusherClientInstance\n     * @param {String} pusherKey - Pusher app key\n     */\n    function PusherFactoryMock(pusherKey) {\n        var args = [];\n        for (var _i = 1; _i < arguments.length; _i++) {\n            args[_i - 1] = arguments[_i];\n        }\n        this.pusherKey = pusherKey;\n        this.pusherClientInstance = new (pusher_js_mock_1.default.bind.apply(pusher_js_mock_1.default, __spreadArrays([void 0], args)))();\n    }\n    /**\n     * Getter for pusherClientInstance\n     * @returns {PusherMock} PusherMock object that reprents pusherClient\n     */\n    PusherFactoryMock.prototype.pusherClient = function () {\n        return this.pusherClientInstance;\n    };\n    return PusherFactoryMock;\n}());\nexports.default = PusherFactoryMock;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar proxy_presence_channel_1 = require(\"./proxy-presence-channel\");\nvar pusher_channel_mock_1 = require(\"./pusher-channel-mock\");\nvar pusher_js_mock_1 = require(\"./pusher-js-mock\");\nvar pusher_presence_channel_mock_1 = require(\"./pusher-presence-channel-mock\");\nvar PusherMockInstance = /** @class */ (function () {\n    function PusherMockInstance() {\n        this.channels = {};\n        this.connection = new pusher_channel_mock_1.default(\"connection\");\n        this.channel = this.channel.bind(this);\n    }\n    /**\n     * Get channel by its name.\n     * @param {String} name - name of the channel.\n     * @returns {PusherChannelMock} PusherChannelMock object that represents channel\n     */\n    PusherMockInstance.prototype.channel = function (name, client) {\n        if (client === void 0) { client = new pusher_js_mock_1.default(); }\n        var presenceChannel = name.includes(\"presence-\");\n        if (!this.channels[name]) {\n            this.channels[name] = presenceChannel\n                ? new pusher_presence_channel_mock_1.default(name)\n                : new pusher_channel_mock_1.default(name);\n        }\n        return presenceChannel\n            ? proxy_presence_channel_1.proxyPresenceChannel(this.channels[name], client)\n            : this.channels[name];\n    };\n    /**\n     * Resets the instance to a fresh state, i.e. no channels.\n     */\n    PusherMockInstance.prototype.reset = function () {\n        this.channels = {};\n    };\n    return PusherMockInstance;\n}());\nexports.default = new PusherMockInstance();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar pusher_events_1 = require(\"./pusher-events\");\nvar pusher_js_mock_instance_1 = require(\"./pusher-js-mock-instance\");\n/** Class representing fake Pusher Client. */\nvar PusherMock = /** @class */ (function () {\n    /** Initialize PusherMock */\n    function PusherMock(clientKey, config) {\n        this.id = undefined;\n        this.info = undefined;\n        this.connection = pusher_js_mock_instance_1.default.connection;\n        this.channels = pusher_js_mock_instance_1.default.channels;\n        this.channel = pusher_js_mock_instance_1.default.channel;\n        this.clientKey = clientKey;\n        this.config = config;\n        this.setAuthInfo = this.setAuthInfo.bind(this);\n        this.subscribe = this.subscribe.bind(this);\n        this.unsubscribe = this.unsubscribe.bind(this);\n    }\n    PusherMock.prototype.setAuthInfo = function (errored, auth) {\n        if (!errored) {\n            this.id = auth.id;\n            this.info = auth.info;\n        }\n    };\n    /**\n     * Mock subscribing to a channel.\n     * @param {String} name - name of the channel.\n     * @returns {PusherChannelMock} PusherChannelMock object that represents channel\n     */\n    PusherMock.prototype.subscribe = function (name) {\n        var _a;\n        var channel = pusher_js_mock_instance_1.default.channel(name, this);\n        if (name.includes(\"presence-\")) {\n            ((_a = this.config) === null || _a === void 0 ? void 0 : _a.authorizer) ? this.config.authorizer({}).authorize(channel, this.setAuthInfo)\n                : this.setAuthInfo(false, {\n                    id: Math.random()\n                        .toString(36)\n                        .substr(2, 9),\n                    info: {}\n                });\n            pusher_events_1.emitConnectionEvents(channel, this);\n        }\n        return channel;\n    };\n    /**\n     * Unsubscribe from a mocked channel.\n     * @param {String} name - name of the channel.\n     */\n    PusherMock.prototype.unsubscribe = function (name) {\n        var _this = this;\n        if (name in pusher_js_mock_instance_1.default.channels) {\n            if (name.includes(\"presence-\")) {\n                var channel = pusher_js_mock_instance_1.default.channels[name];\n                pusher_events_1.emitDisconnectionEvents(channel, this);\n                for (var _i = 0, _a = Object.keys(channel.callbacks); _i < _a.length; _i++) {\n                    var key = _a[_i];\n                    // filter out any callbacks that are our own\n                    channel.callbacks[key] = channel.callbacks[key].filter(function (cb) { return cb.owner !== _this.id; });\n                    // delete the callback list if there are no callbacks left\n                    if (channel.callbacks[key].length === 0) {\n                        delete channel.callbacks[key];\n                    }\n                }\n                // if there are no callback events left, delete the channel\n                if (Object.keys(Object.assign({}, channel.callbacks)).length === 0) {\n                    delete pusher_js_mock_instance_1.default.channels[name];\n                }\n            }\n            else {\n                // public channel\n                pusher_js_mock_instance_1.default.channels[name].callbacks = {};\n                delete pusher_js_mock_instance_1.default.channels[name];\n            }\n        }\n    };\n    /**\n     * Bind a callback to an event on all channels\n     * @param {String} name - name of the event to bind to.\n     * @param {Function} callback - callback to be called on event.\n     */\n    PusherMock.prototype.bind = function (name, callback) {\n        var _this = this;\n        Object.keys(this.channels).forEach(function (channelName) {\n            _this.channel(channelName).bind(name, callback);\n        });\n    };\n    /**\n     * Unbind a callback from an event on all channels\n     * @param {String} name - name of the event to unbind from.\n     * @param {Function} callback - callback to be called on event.\n     */\n    PusherMock.prototype.unbind = function (name, callback) {\n        var _this = this;\n        Object.keys(this.channels).forEach(function (channelName) {\n            _this.channel(channelName).unbind(name, callback);\n        });\n    };\n    /**\n     * Returns a list of all channels\n     */\n    PusherMock.prototype.allChannels = function () {\n        return Object.values(this.channels);\n    };\n    return PusherMock;\n}());\nexports.default = PusherMock;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n    var extendStatics = function (d, b) {\n        extendStatics = Object.setPrototypeOf ||\n            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n        return extendStatics(d, b);\n    };\n    return function (d, b) {\n        extendStatics(d, b);\n        function __() { this.constructor = d; }\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar members_1 = require(\"./members\");\nvar pusher_channel_mock_1 = require(\"./pusher-channel-mock\");\n/** Basic augmentation of the PusherChannel class. */\nvar PusherPresenceChannelMock = /** @class */ (function (_super) {\n    __extends(PusherPresenceChannelMock, _super);\n    /**\n     * Initialise members object when created.\n     * `pusher-js` provides all the functionality we need.\n     * @param name The name of the channel to initialise\n     * @returns PusherPresenceChannelMock the mocked presence channel\n     */\n    function PusherPresenceChannelMock(name) {\n        if (name === void 0) { name = \"presence-channel\"; }\n        var _this = _super.call(this, name) || this;\n        /** Alias to match actual API for client events */\n        _this.trigger = _this.emit;\n        _this.members = new members_1.default();\n        return _this;\n    }\n    return PusherPresenceChannelMock;\n}(pusher_channel_mock_1.default));\nexports.default = PusherPresenceChannelMock;\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Pusher\"] = factory();\n\telse\n\t\troot[\"Pusher\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n","// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\n\n/**\n * Package base64 implements Base64 encoding and decoding.\n */\n\n// Invalid character used in decoding to indicate\n// that the character to decode is out of range of\n// alphabet and cannot be decoded.\nconst INVALID_BYTE = 256;\n\n/**\n * Implements standard Base64 encoding.\n *\n * Operates in constant time.\n */\nexport class Coder {\n    // TODO(dchest): methods to encode chunk-by-chunk.\n\n    constructor(private _paddingCharacter = \"=\") { }\n\n    encodedLength(length: number): number {\n        if (!this._paddingCharacter) {\n            return (length * 8 + 5) / 6 | 0;\n        }\n        return (length + 2) / 3 * 4 | 0;\n    }\n\n    encode(data: Uint8Array): string {\n        let out = \"\";\n\n        let i = 0;\n        for (; i < data.length - 2; i += 3) {\n            let c = (data[i] << 16) | (data[i + 1] << 8) | (data[i + 2]);\n            out += this._encodeByte((c >>> 3 * 6) & 63);\n            out += this._encodeByte((c >>> 2 * 6) & 63);\n            out += this._encodeByte((c >>> 1 * 6) & 63);\n            out += this._encodeByte((c >>> 0 * 6) & 63);\n        }\n\n        const left = data.length - i;\n        if (left > 0) {\n            let c = (data[i] << 16) | (left === 2 ? data[i + 1] << 8 : 0);\n            out += this._encodeByte((c >>> 3 * 6) & 63);\n            out += this._encodeByte((c >>> 2 * 6) & 63);\n            if (left === 2) {\n                out += this._encodeByte((c >>> 1 * 6) & 63);\n            } else {\n                out += this._paddingCharacter || \"\";\n            }\n            out += this._paddingCharacter || \"\";\n        }\n\n        return out;\n    }\n\n    maxDecodedLength(length: number): number {\n        if (!this._paddingCharacter) {\n            return (length * 6 + 7) / 8 | 0;\n        }\n        return length / 4 * 3 | 0;\n    }\n\n    decodedLength(s: string): number {\n        return this.maxDecodedLength(s.length - this._getPaddingLength(s));\n    }\n\n    decode(s: string): Uint8Array {\n        if (s.length === 0) {\n            return new Uint8Array(0);\n        }\n        const paddingLength = this._getPaddingLength(s);\n        const length = s.length - paddingLength;\n        const out = new Uint8Array(this.maxDecodedLength(length));\n        let op = 0;\n        let i = 0;\n        let haveBad = 0;\n        let v0 = 0, v1 = 0, v2 = 0, v3 = 0;\n        for (; i < length - 4; i += 4) {\n            v0 = this._decodeChar(s.charCodeAt(i + 0));\n            v1 = this._decodeChar(s.charCodeAt(i + 1));\n            v2 = this._decodeChar(s.charCodeAt(i + 2));\n            v3 = this._decodeChar(s.charCodeAt(i + 3));\n            out[op++] = (v0 << 2) | (v1 >>> 4);\n            out[op++] = (v1 << 4) | (v2 >>> 2);\n            out[op++] = (v2 << 6) | v3;\n            haveBad |= v0 & INVALID_BYTE;\n            haveBad |= v1 & INVALID_BYTE;\n            haveBad |= v2 & INVALID_BYTE;\n            haveBad |= v3 & INVALID_BYTE;\n        }\n        if (i < length - 1) {\n            v0 = this._decodeChar(s.charCodeAt(i));\n            v1 = this._decodeChar(s.charCodeAt(i + 1));\n            out[op++] = (v0 << 2) | (v1 >>> 4);\n            haveBad |= v0 & INVALID_BYTE;\n            haveBad |= v1 & INVALID_BYTE;\n        }\n        if (i < length - 2) {\n            v2 = this._decodeChar(s.charCodeAt(i + 2));\n            out[op++] = (v1 << 4) | (v2 >>> 2);\n            haveBad |= v2 & INVALID_BYTE;\n        }\n        if (i < length - 3) {\n            v3 = this._decodeChar(s.charCodeAt(i + 3));\n            out[op++] = (v2 << 6) | v3;\n            haveBad |= v3 & INVALID_BYTE;\n        }\n        if (haveBad !== 0) {\n            throw new Error(\"Base64Coder: incorrect characters for decoding\");\n        }\n        return out;\n    }\n\n    // Standard encoding have the following encoded/decoded ranges,\n    // which we need to convert between.\n    //\n    // ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789  +   /\n    // Index:   0 - 25                    26 - 51              52 - 61   62  63\n    // ASCII:  65 - 90                    97 - 122             48 - 57   43  47\n    //\n\n    // Encode 6 bits in b into a new character.\n    protected _encodeByte(b: number): string {\n        // Encoding uses constant time operations as follows:\n        //\n        // 1. Define comparison of A with B using (A - B) >>> 8:\n        //          if A > B, then result is positive integer\n        //          if A <= B, then result is 0\n        //\n        // 2. Define selection of C or 0 using bitwise AND: X & C:\n        //          if X == 0, then result is 0\n        //          if X != 0, then result is C\n        //\n        // 3. Start with the smallest comparison (b >= 0), which is always\n        //    true, so set the result to the starting ASCII value (65).\n        //\n        // 4. Continue comparing b to higher ASCII values, and selecting\n        //    zero if comparison isn't true, otherwise selecting a value\n        //    to add to result, which:\n        //\n        //          a) undoes the previous addition\n        //          b) provides new value to add\n        //\n        let result = b;\n        // b >= 0\n        result += 65;\n        // b > 25\n        result += ((25 - b) >>> 8) & ((0 - 65) - 26 + 97);\n        // b > 51\n        result += ((51 - b) >>> 8) & ((26 - 97) - 52 + 48);\n        // b > 61\n        result += ((61 - b) >>> 8) & ((52 - 48) - 62 + 43);\n        // b > 62\n        result += ((62 - b) >>> 8) & ((62 - 43) - 63 + 47);\n\n        return String.fromCharCode(result);\n    }\n\n    // Decode a character code into a byte.\n    // Must return 256 if character is out of alphabet range.\n    protected _decodeChar(c: number): number {\n        // Decoding works similar to encoding: using the same comparison\n        // function, but now it works on ranges: result is always incremented\n        // by value, but this value becomes zero if the range is not\n        // satisfied.\n        //\n        // Decoding starts with invalid value, 256, which is then\n        // subtracted when the range is satisfied. If none of the ranges\n        // apply, the function returns 256, which is then checked by\n        // the caller to throw error.\n        let result = INVALID_BYTE; // start with invalid character\n\n        // c == 43 (c > 42 and c < 44)\n        result += (((42 - c) & (c - 44)) >>> 8) & (-INVALID_BYTE + c - 43 + 62);\n        // c == 47 (c > 46 and c < 48)\n        result += (((46 - c) & (c - 48)) >>> 8) & (-INVALID_BYTE + c - 47 + 63);\n        // c > 47 and c < 58\n        result += (((47 - c) & (c - 58)) >>> 8) & (-INVALID_BYTE + c - 48 + 52);\n        // c > 64 and c < 91\n        result += (((64 - c) & (c - 91)) >>> 8) & (-INVALID_BYTE + c - 65 + 0);\n        // c > 96 and c < 123\n        result += (((96 - c) & (c - 123)) >>> 8) & (-INVALID_BYTE + c - 97 + 26);\n\n        return result;\n    }\n\n    private _getPaddingLength(s: string): number {\n        let paddingLength = 0;\n        if (this._paddingCharacter) {\n            for (let i = s.length - 1; i >= 0; i--) {\n                if (s[i] !== this._paddingCharacter) {\n                    break;\n                }\n                paddingLength++;\n            }\n            if (s.length < 4 || paddingLength > 2) {\n                throw new Error(\"Base64Coder: incorrect padding\");\n            }\n        }\n        return paddingLength;\n    }\n\n}\n\nconst stdCoder = new Coder();\n\nexport function encode(data: Uint8Array): string {\n    return stdCoder.encode(data);\n}\n\nexport function decode(s: string): Uint8Array {\n    return stdCoder.decode(s);\n}\n\n/**\n * Implements URL-safe Base64 encoding.\n * (Same as Base64, but '+' is replaced with '-', and '/' with '_').\n *\n * Operates in constant time.\n */\nexport class URLSafeCoder extends Coder {\n    // URL-safe encoding have the following encoded/decoded ranges:\n    //\n    // ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789  -   _\n    // Index:   0 - 25                    26 - 51              52 - 61   62  63\n    // ASCII:  65 - 90                    97 - 122             48 - 57   45  95\n    //\n\n    protected _encodeByte(b: number): string {\n        let result = b;\n        // b >= 0\n        result += 65;\n        // b > 25\n        result += ((25 - b) >>> 8) & ((0 - 65) - 26 + 97);\n        // b > 51\n        result += ((51 - b) >>> 8) & ((26 - 97) - 52 + 48);\n        // b > 61\n        result += ((61 - b) >>> 8) & ((52 - 48) - 62 + 45);\n        // b > 62\n        result += ((62 - b) >>> 8) & ((62 - 45) - 63 + 95);\n\n        return String.fromCharCode(result);\n    }\n\n    protected _decodeChar(c: number): number {\n        let result = INVALID_BYTE;\n\n        // c == 45 (c > 44 and c < 46)\n        result += (((44 - c) & (c - 46)) >>> 8) & (-INVALID_BYTE + c - 45 + 62);\n        // c == 95 (c > 94 and c < 96)\n        result += (((94 - c) & (c - 96)) >>> 8) & (-INVALID_BYTE + c - 95 + 63);\n        // c > 47 and c < 58\n        result += (((47 - c) & (c - 58)) >>> 8) & (-INVALID_BYTE + c - 48 + 52);\n        // c > 64 and c < 91\n        result += (((64 - c) & (c - 91)) >>> 8) & (-INVALID_BYTE + c - 65 + 0);\n        // c > 96 and c < 123\n        result += (((96 - c) & (c - 123)) >>> 8) & (-INVALID_BYTE + c - 97 + 26);\n\n        return result;\n    }\n}\n\nconst urlSafeCoder = new URLSafeCoder();\n\nexport function encodeURLSafe(data: Uint8Array): string {\n    return urlSafeCoder.encode(data);\n}\n\nexport function decodeURLSafe(s: string): Uint8Array {\n    return urlSafeCoder.decode(s);\n}\n\n\nexport const encodedLength = (length: number) =>\n    stdCoder.encodedLength(length);\n\nexport const maxDecodedLength = (length: number) =>\n    stdCoder.maxDecodedLength(length);\n\nexport const decodedLength = (s: string) =>\n    stdCoder.decodedLength(s);\n","// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\n\n/**\n * Package utf8 implements UTF-8 encoding and decoding.\n */\n\nconst INVALID_UTF16 = \"utf8: invalid string\";\nconst INVALID_UTF8 = \"utf8: invalid source encoding\";\n\n/**\n * Encodes the given string into UTF-8 byte array.\n * Throws if the source string has invalid UTF-16 encoding.\n */\nexport function encode(s: string): Uint8Array {\n    // Calculate result length and allocate output array.\n    // encodedLength() also validates string and throws errors,\n    // so we don't need repeat validation here.\n    const arr = new Uint8Array(encodedLength(s));\n\n    let pos = 0;\n    for (let i = 0; i < s.length; i++) {\n        let c = s.charCodeAt(i);\n        if (c < 0x80) {\n            arr[pos++] = c;\n        } else if (c < 0x800) {\n            arr[pos++] = 0xc0 | c >> 6;\n            arr[pos++] = 0x80 | c & 0x3f;\n        } else if (c < 0xd800) {\n            arr[pos++] = 0xe0 | c >> 12;\n            arr[pos++] = 0x80 | (c >> 6) & 0x3f;\n            arr[pos++] = 0x80 | c & 0x3f;\n        } else {\n            i++; // get one more character\n            c = (c & 0x3ff) << 10;\n            c |= s.charCodeAt(i) & 0x3ff;\n            c += 0x10000;\n\n            arr[pos++] = 0xf0 | c >> 18;\n            arr[pos++] = 0x80 | (c >> 12) & 0x3f;\n            arr[pos++] = 0x80 | (c >> 6) & 0x3f;\n            arr[pos++] = 0x80 | c & 0x3f;\n        }\n    }\n    return arr;\n}\n\n/**\n * Returns the number of bytes required to encode the given string into UTF-8.\n * Throws if the source string has invalid UTF-16 encoding.\n */\nexport function encodedLength(s: string): number {\n    let result = 0;\n    for (let i = 0; i < s.length; i++) {\n        const c = s.charCodeAt(i);\n        if (c < 0x80) {\n            result += 1;\n        } else if (c < 0x800) {\n            result += 2;\n        } else if (c < 0xd800) {\n            result += 3;\n        } else if (c <= 0xdfff) {\n            if (i >= s.length - 1) {\n                throw new Error(INVALID_UTF16);\n            }\n            i++; // \"eat\" next character\n            result += 4;\n        } else {\n            throw new Error(INVALID_UTF16);\n        }\n    }\n    return result;\n}\n\n/**\n * Decodes the given byte array from UTF-8 into a string.\n * Throws if encoding is invalid.\n */\nexport function decode(arr: Uint8Array): string {\n    const chars: string[] = [];\n    for (let i = 0; i < arr.length; i++) {\n        let b = arr[i];\n\n        if (b & 0x80) {\n            let min;\n            if (b < 0xe0) {\n                // Need 1 more byte.\n                if (i >= arr.length) {\n                    throw new Error(INVALID_UTF8);\n                }\n                const n1 = arr[++i];\n                if ((n1 & 0xc0) !== 0x80) {\n                    throw new Error(INVALID_UTF8);\n                }\n                b = (b & 0x1f) << 6 | (n1 & 0x3f);\n                min = 0x80;\n            } else if (b < 0xf0) {\n                // Need 2 more bytes.\n                if (i >= arr.length - 1) {\n                    throw new Error(INVALID_UTF8);\n                }\n                const n1 = arr[++i];\n                const n2 = arr[++i];\n                if ((n1 & 0xc0) !== 0x80 || (n2 & 0xc0) !== 0x80) {\n                    throw new Error(INVALID_UTF8);\n                }\n                b = (b & 0x0f) << 12 | (n1 & 0x3f) << 6 | (n2 & 0x3f);\n                min = 0x800;\n            } else if (b < 0xf8) {\n                // Need 3 more bytes.\n                if (i >= arr.length - 2) {\n                    throw new Error(INVALID_UTF8);\n                }\n                const n1 = arr[++i];\n                const n2 = arr[++i];\n                const n3 = arr[++i];\n                if ((n1 & 0xc0) !== 0x80 || (n2 & 0xc0) !== 0x80 || (n3 & 0xc0) !== 0x80) {\n                    throw new Error(INVALID_UTF8);\n                }\n                b = (b & 0x0f) << 18 | (n1 & 0x3f) << 12 | (n2 & 0x3f) << 6 | (n3 & 0x3f);\n                min = 0x10000;\n            } else {\n                throw new Error(INVALID_UTF8);\n            }\n\n            if (b < min || (b >= 0xd800 && b <= 0xdfff)) {\n                throw new Error(INVALID_UTF8);\n            }\n\n            if (b >= 0x10000) {\n                // Surrogate pair.\n                if (b > 0x10ffff) {\n                    throw new Error(INVALID_UTF8);\n                }\n                b -= 0x10000;\n                chars.push(String.fromCharCode(0xd800 | (b >> 10)));\n                b = 0xdc00 | (b & 0x3ff);\n            }\n        }\n\n        chars.push(String.fromCharCode(b));\n    }\n    return chars.join(\"\");\n}\n","(function(nacl) {\n'use strict';\n\n// Ported in 2014 by Dmitry Chestnykh and Devi Mandiri.\n// Public domain.\n//\n// Implementation derived from TweetNaCl version 20140427.\n// See for details: http://tweetnacl.cr.yp.to/\n\nvar gf = function(init) {\n  var i, r = new Float64Array(16);\n  if (init) for (i = 0; i < init.length; i++) r[i] = init[i];\n  return r;\n};\n\n//  Pluggable, initialized in high-level API below.\nvar randombytes = function(/* x, n */) { throw new Error('no PRNG'); };\n\nvar _0 = new Uint8Array(16);\nvar _9 = new Uint8Array(32); _9[0] = 9;\n\nvar gf0 = gf(),\n    gf1 = gf([1]),\n    _121665 = gf([0xdb41, 1]),\n    D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]),\n    D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]),\n    X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]),\n    Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]),\n    I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]);\n\nfunction ts64(x, i, h, l) {\n  x[i]   = (h >> 24) & 0xff;\n  x[i+1] = (h >> 16) & 0xff;\n  x[i+2] = (h >>  8) & 0xff;\n  x[i+3] = h & 0xff;\n  x[i+4] = (l >> 24)  & 0xff;\n  x[i+5] = (l >> 16)  & 0xff;\n  x[i+6] = (l >>  8)  & 0xff;\n  x[i+7] = l & 0xff;\n}\n\nfunction vn(x, xi, y, yi, n) {\n  var i,d = 0;\n  for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i];\n  return (1 & ((d - 1) >>> 8)) - 1;\n}\n\nfunction crypto_verify_16(x, xi, y, yi) {\n  return vn(x,xi,y,yi,16);\n}\n\nfunction crypto_verify_32(x, xi, y, yi) {\n  return vn(x,xi,y,yi,32);\n}\n\nfunction core_salsa20(o, p, k, c) {\n  var j0  = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,\n      j1  = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,\n      j2  = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,\n      j3  = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,\n      j4  = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,\n      j5  = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,\n      j6  = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,\n      j7  = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,\n      j8  = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,\n      j9  = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,\n      j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,\n      j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,\n      j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,\n      j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,\n      j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,\n      j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;\n\n  var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,\n      x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,\n      x15 = j15, u;\n\n  for (var i = 0; i < 20; i += 2) {\n    u = x0 + x12 | 0;\n    x4 ^= u<<7 | u>>>(32-7);\n    u = x4 + x0 | 0;\n    x8 ^= u<<9 | u>>>(32-9);\n    u = x8 + x4 | 0;\n    x12 ^= u<<13 | u>>>(32-13);\n    u = x12 + x8 | 0;\n    x0 ^= u<<18 | u>>>(32-18);\n\n    u = x5 + x1 | 0;\n    x9 ^= u<<7 | u>>>(32-7);\n    u = x9 + x5 | 0;\n    x13 ^= u<<9 | u>>>(32-9);\n    u = x13 + x9 | 0;\n    x1 ^= u<<13 | u>>>(32-13);\n    u = x1 + x13 | 0;\n    x5 ^= u<<18 | u>>>(32-18);\n\n    u = x10 + x6 | 0;\n    x14 ^= u<<7 | u>>>(32-7);\n    u = x14 + x10 | 0;\n    x2 ^= u<<9 | u>>>(32-9);\n    u = x2 + x14 | 0;\n    x6 ^= u<<13 | u>>>(32-13);\n    u = x6 + x2 | 0;\n    x10 ^= u<<18 | u>>>(32-18);\n\n    u = x15 + x11 | 0;\n    x3 ^= u<<7 | u>>>(32-7);\n    u = x3 + x15 | 0;\n    x7 ^= u<<9 | u>>>(32-9);\n    u = x7 + x3 | 0;\n    x11 ^= u<<13 | u>>>(32-13);\n    u = x11 + x7 | 0;\n    x15 ^= u<<18 | u>>>(32-18);\n\n    u = x0 + x3 | 0;\n    x1 ^= u<<7 | u>>>(32-7);\n    u = x1 + x0 | 0;\n    x2 ^= u<<9 | u>>>(32-9);\n    u = x2 + x1 | 0;\n    x3 ^= u<<13 | u>>>(32-13);\n    u = x3 + x2 | 0;\n    x0 ^= u<<18 | u>>>(32-18);\n\n    u = x5 + x4 | 0;\n    x6 ^= u<<7 | u>>>(32-7);\n    u = x6 + x5 | 0;\n    x7 ^= u<<9 | u>>>(32-9);\n    u = x7 + x6 | 0;\n    x4 ^= u<<13 | u>>>(32-13);\n    u = x4 + x7 | 0;\n    x5 ^= u<<18 | u>>>(32-18);\n\n    u = x10 + x9 | 0;\n    x11 ^= u<<7 | u>>>(32-7);\n    u = x11 + x10 | 0;\n    x8 ^= u<<9 | u>>>(32-9);\n    u = x8 + x11 | 0;\n    x9 ^= u<<13 | u>>>(32-13);\n    u = x9 + x8 | 0;\n    x10 ^= u<<18 | u>>>(32-18);\n\n    u = x15 + x14 | 0;\n    x12 ^= u<<7 | u>>>(32-7);\n    u = x12 + x15 | 0;\n    x13 ^= u<<9 | u>>>(32-9);\n    u = x13 + x12 | 0;\n    x14 ^= u<<13 | u>>>(32-13);\n    u = x14 + x13 | 0;\n    x15 ^= u<<18 | u>>>(32-18);\n  }\n   x0 =  x0 +  j0 | 0;\n   x1 =  x1 +  j1 | 0;\n   x2 =  x2 +  j2 | 0;\n   x3 =  x3 +  j3 | 0;\n   x4 =  x4 +  j4 | 0;\n   x5 =  x5 +  j5 | 0;\n   x6 =  x6 +  j6 | 0;\n   x7 =  x7 +  j7 | 0;\n   x8 =  x8 +  j8 | 0;\n   x9 =  x9 +  j9 | 0;\n  x10 = x10 + j10 | 0;\n  x11 = x11 + j11 | 0;\n  x12 = x12 + j12 | 0;\n  x13 = x13 + j13 | 0;\n  x14 = x14 + j14 | 0;\n  x15 = x15 + j15 | 0;\n\n  o[ 0] = x0 >>>  0 & 0xff;\n  o[ 1] = x0 >>>  8 & 0xff;\n  o[ 2] = x0 >>> 16 & 0xff;\n  o[ 3] = x0 >>> 24 & 0xff;\n\n  o[ 4] = x1 >>>  0 & 0xff;\n  o[ 5] = x1 >>>  8 & 0xff;\n  o[ 6] = x1 >>> 16 & 0xff;\n  o[ 7] = x1 >>> 24 & 0xff;\n\n  o[ 8] = x2 >>>  0 & 0xff;\n  o[ 9] = x2 >>>  8 & 0xff;\n  o[10] = x2 >>> 16 & 0xff;\n  o[11] = x2 >>> 24 & 0xff;\n\n  o[12] = x3 >>>  0 & 0xff;\n  o[13] = x3 >>>  8 & 0xff;\n  o[14] = x3 >>> 16 & 0xff;\n  o[15] = x3 >>> 24 & 0xff;\n\n  o[16] = x4 >>>  0 & 0xff;\n  o[17] = x4 >>>  8 & 0xff;\n  o[18] = x4 >>> 16 & 0xff;\n  o[19] = x4 >>> 24 & 0xff;\n\n  o[20] = x5 >>>  0 & 0xff;\n  o[21] = x5 >>>  8 & 0xff;\n  o[22] = x5 >>> 16 & 0xff;\n  o[23] = x5 >>> 24 & 0xff;\n\n  o[24] = x6 >>>  0 & 0xff;\n  o[25] = x6 >>>  8 & 0xff;\n  o[26] = x6 >>> 16 & 0xff;\n  o[27] = x6 >>> 24 & 0xff;\n\n  o[28] = x7 >>>  0 & 0xff;\n  o[29] = x7 >>>  8 & 0xff;\n  o[30] = x7 >>> 16 & 0xff;\n  o[31] = x7 >>> 24 & 0xff;\n\n  o[32] = x8 >>>  0 & 0xff;\n  o[33] = x8 >>>  8 & 0xff;\n  o[34] = x8 >>> 16 & 0xff;\n  o[35] = x8 >>> 24 & 0xff;\n\n  o[36] = x9 >>>  0 & 0xff;\n  o[37] = x9 >>>  8 & 0xff;\n  o[38] = x9 >>> 16 & 0xff;\n  o[39] = x9 >>> 24 & 0xff;\n\n  o[40] = x10 >>>  0 & 0xff;\n  o[41] = x10 >>>  8 & 0xff;\n  o[42] = x10 >>> 16 & 0xff;\n  o[43] = x10 >>> 24 & 0xff;\n\n  o[44] = x11 >>>  0 & 0xff;\n  o[45] = x11 >>>  8 & 0xff;\n  o[46] = x11 >>> 16 & 0xff;\n  o[47] = x11 >>> 24 & 0xff;\n\n  o[48] = x12 >>>  0 & 0xff;\n  o[49] = x12 >>>  8 & 0xff;\n  o[50] = x12 >>> 16 & 0xff;\n  o[51] = x12 >>> 24 & 0xff;\n\n  o[52] = x13 >>>  0 & 0xff;\n  o[53] = x13 >>>  8 & 0xff;\n  o[54] = x13 >>> 16 & 0xff;\n  o[55] = x13 >>> 24 & 0xff;\n\n  o[56] = x14 >>>  0 & 0xff;\n  o[57] = x14 >>>  8 & 0xff;\n  o[58] = x14 >>> 16 & 0xff;\n  o[59] = x14 >>> 24 & 0xff;\n\n  o[60] = x15 >>>  0 & 0xff;\n  o[61] = x15 >>>  8 & 0xff;\n  o[62] = x15 >>> 16 & 0xff;\n  o[63] = x15 >>> 24 & 0xff;\n}\n\nfunction core_hsalsa20(o,p,k,c) {\n  var j0  = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,\n      j1  = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,\n      j2  = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,\n      j3  = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,\n      j4  = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,\n      j5  = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,\n      j6  = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,\n      j7  = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,\n      j8  = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,\n      j9  = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,\n      j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,\n      j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,\n      j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,\n      j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,\n      j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,\n      j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;\n\n  var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,\n      x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,\n      x15 = j15, u;\n\n  for (var i = 0; i < 20; i += 2) {\n    u = x0 + x12 | 0;\n    x4 ^= u<<7 | u>>>(32-7);\n    u = x4 + x0 | 0;\n    x8 ^= u<<9 | u>>>(32-9);\n    u = x8 + x4 | 0;\n    x12 ^= u<<13 | u>>>(32-13);\n    u = x12 + x8 | 0;\n    x0 ^= u<<18 | u>>>(32-18);\n\n    u = x5 + x1 | 0;\n    x9 ^= u<<7 | u>>>(32-7);\n    u = x9 + x5 | 0;\n    x13 ^= u<<9 | u>>>(32-9);\n    u = x13 + x9 | 0;\n    x1 ^= u<<13 | u>>>(32-13);\n    u = x1 + x13 | 0;\n    x5 ^= u<<18 | u>>>(32-18);\n\n    u = x10 + x6 | 0;\n    x14 ^= u<<7 | u>>>(32-7);\n    u = x14 + x10 | 0;\n    x2 ^= u<<9 | u>>>(32-9);\n    u = x2 + x14 | 0;\n    x6 ^= u<<13 | u>>>(32-13);\n    u = x6 + x2 | 0;\n    x10 ^= u<<18 | u>>>(32-18);\n\n    u = x15 + x11 | 0;\n    x3 ^= u<<7 | u>>>(32-7);\n    u = x3 + x15 | 0;\n    x7 ^= u<<9 | u>>>(32-9);\n    u = x7 + x3 | 0;\n    x11 ^= u<<13 | u>>>(32-13);\n    u = x11 + x7 | 0;\n    x15 ^= u<<18 | u>>>(32-18);\n\n    u = x0 + x3 | 0;\n    x1 ^= u<<7 | u>>>(32-7);\n    u = x1 + x0 | 0;\n    x2 ^= u<<9 | u>>>(32-9);\n    u = x2 + x1 | 0;\n    x3 ^= u<<13 | u>>>(32-13);\n    u = x3 + x2 | 0;\n    x0 ^= u<<18 | u>>>(32-18);\n\n    u = x5 + x4 | 0;\n    x6 ^= u<<7 | u>>>(32-7);\n    u = x6 + x5 | 0;\n    x7 ^= u<<9 | u>>>(32-9);\n    u = x7 + x6 | 0;\n    x4 ^= u<<13 | u>>>(32-13);\n    u = x4 + x7 | 0;\n    x5 ^= u<<18 | u>>>(32-18);\n\n    u = x10 + x9 | 0;\n    x11 ^= u<<7 | u>>>(32-7);\n    u = x11 + x10 | 0;\n    x8 ^= u<<9 | u>>>(32-9);\n    u = x8 + x11 | 0;\n    x9 ^= u<<13 | u>>>(32-13);\n    u = x9 + x8 | 0;\n    x10 ^= u<<18 | u>>>(32-18);\n\n    u = x15 + x14 | 0;\n    x12 ^= u<<7 | u>>>(32-7);\n    u = x12 + x15 | 0;\n    x13 ^= u<<9 | u>>>(32-9);\n    u = x13 + x12 | 0;\n    x14 ^= u<<13 | u>>>(32-13);\n    u = x14 + x13 | 0;\n    x15 ^= u<<18 | u>>>(32-18);\n  }\n\n  o[ 0] = x0 >>>  0 & 0xff;\n  o[ 1] = x0 >>>  8 & 0xff;\n  o[ 2] = x0 >>> 16 & 0xff;\n  o[ 3] = x0 >>> 24 & 0xff;\n\n  o[ 4] = x5 >>>  0 & 0xff;\n  o[ 5] = x5 >>>  8 & 0xff;\n  o[ 6] = x5 >>> 16 & 0xff;\n  o[ 7] = x5 >>> 24 & 0xff;\n\n  o[ 8] = x10 >>>  0 & 0xff;\n  o[ 9] = x10 >>>  8 & 0xff;\n  o[10] = x10 >>> 16 & 0xff;\n  o[11] = x10 >>> 24 & 0xff;\n\n  o[12] = x15 >>>  0 & 0xff;\n  o[13] = x15 >>>  8 & 0xff;\n  o[14] = x15 >>> 16 & 0xff;\n  o[15] = x15 >>> 24 & 0xff;\n\n  o[16] = x6 >>>  0 & 0xff;\n  o[17] = x6 >>>  8 & 0xff;\n  o[18] = x6 >>> 16 & 0xff;\n  o[19] = x6 >>> 24 & 0xff;\n\n  o[20] = x7 >>>  0 & 0xff;\n  o[21] = x7 >>>  8 & 0xff;\n  o[22] = x7 >>> 16 & 0xff;\n  o[23] = x7 >>> 24 & 0xff;\n\n  o[24] = x8 >>>  0 & 0xff;\n  o[25] = x8 >>>  8 & 0xff;\n  o[26] = x8 >>> 16 & 0xff;\n  o[27] = x8 >>> 24 & 0xff;\n\n  o[28] = x9 >>>  0 & 0xff;\n  o[29] = x9 >>>  8 & 0xff;\n  o[30] = x9 >>> 16 & 0xff;\n  o[31] = x9 >>> 24 & 0xff;\n}\n\nfunction crypto_core_salsa20(out,inp,k,c) {\n  core_salsa20(out,inp,k,c);\n}\n\nfunction crypto_core_hsalsa20(out,inp,k,c) {\n  core_hsalsa20(out,inp,k,c);\n}\n\nvar sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);\n            // \"expand 32-byte k\"\n\nfunction crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) {\n  var z = new Uint8Array(16), x = new Uint8Array(64);\n  var u, i;\n  for (i = 0; i < 16; i++) z[i] = 0;\n  for (i = 0; i < 8; i++) z[i] = n[i];\n  while (b >= 64) {\n    crypto_core_salsa20(x,z,k,sigma);\n    for (i = 0; i < 64; i++) c[cpos+i] = m[mpos+i] ^ x[i];\n    u = 1;\n    for (i = 8; i < 16; i++) {\n      u = u + (z[i] & 0xff) | 0;\n      z[i] = u & 0xff;\n      u >>>= 8;\n    }\n    b -= 64;\n    cpos += 64;\n    mpos += 64;\n  }\n  if (b > 0) {\n    crypto_core_salsa20(x,z,k,sigma);\n    for (i = 0; i < b; i++) c[cpos+i] = m[mpos+i] ^ x[i];\n  }\n  return 0;\n}\n\nfunction crypto_stream_salsa20(c,cpos,b,n,k) {\n  var z = new Uint8Array(16), x = new Uint8Array(64);\n  var u, i;\n  for (i = 0; i < 16; i++) z[i] = 0;\n  for (i = 0; i < 8; i++) z[i] = n[i];\n  while (b >= 64) {\n    crypto_core_salsa20(x,z,k,sigma);\n    for (i = 0; i < 64; i++) c[cpos+i] = x[i];\n    u = 1;\n    for (i = 8; i < 16; i++) {\n      u = u + (z[i] & 0xff) | 0;\n      z[i] = u & 0xff;\n      u >>>= 8;\n    }\n    b -= 64;\n    cpos += 64;\n  }\n  if (b > 0) {\n    crypto_core_salsa20(x,z,k,sigma);\n    for (i = 0; i < b; i++) c[cpos+i] = x[i];\n  }\n  return 0;\n}\n\nfunction crypto_stream(c,cpos,d,n,k) {\n  var s = new Uint8Array(32);\n  crypto_core_hsalsa20(s,n,k,sigma);\n  var sn = new Uint8Array(8);\n  for (var i = 0; i < 8; i++) sn[i] = n[i+16];\n  return crypto_stream_salsa20(c,cpos,d,sn,s);\n}\n\nfunction crypto_stream_xor(c,cpos,m,mpos,d,n,k) {\n  var s = new Uint8Array(32);\n  crypto_core_hsalsa20(s,n,k,sigma);\n  var sn = new Uint8Array(8);\n  for (var i = 0; i < 8; i++) sn[i] = n[i+16];\n  return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,sn,s);\n}\n\n/*\n* Port of Andrew Moon's Poly1305-donna-16. Public domain.\n* https://github.com/floodyberry/poly1305-donna\n*/\n\nvar poly1305 = function(key) {\n  this.buffer = new Uint8Array(16);\n  this.r = new Uint16Array(10);\n  this.h = new Uint16Array(10);\n  this.pad = new Uint16Array(8);\n  this.leftover = 0;\n  this.fin = 0;\n\n  var t0, t1, t2, t3, t4, t5, t6, t7;\n\n  t0 = key[ 0] & 0xff | (key[ 1] & 0xff) << 8; this.r[0] = ( t0                     ) & 0x1fff;\n  t1 = key[ 2] & 0xff | (key[ 3] & 0xff) << 8; this.r[1] = ((t0 >>> 13) | (t1 <<  3)) & 0x1fff;\n  t2 = key[ 4] & 0xff | (key[ 5] & 0xff) << 8; this.r[2] = ((t1 >>> 10) | (t2 <<  6)) & 0x1f03;\n  t3 = key[ 6] & 0xff | (key[ 7] & 0xff) << 8; this.r[3] = ((t2 >>>  7) | (t3 <<  9)) & 0x1fff;\n  t4 = key[ 8] & 0xff | (key[ 9] & 0xff) << 8; this.r[4] = ((t3 >>>  4) | (t4 << 12)) & 0x00ff;\n  this.r[5] = ((t4 >>>  1)) & 0x1ffe;\n  t5 = key[10] & 0xff | (key[11] & 0xff) << 8; this.r[6] = ((t4 >>> 14) | (t5 <<  2)) & 0x1fff;\n  t6 = key[12] & 0xff | (key[13] & 0xff) << 8; this.r[7] = ((t5 >>> 11) | (t6 <<  5)) & 0x1f81;\n  t7 = key[14] & 0xff | (key[15] & 0xff) << 8; this.r[8] = ((t6 >>>  8) | (t7 <<  8)) & 0x1fff;\n  this.r[9] = ((t7 >>>  5)) & 0x007f;\n\n  this.pad[0] = key[16] & 0xff | (key[17] & 0xff) << 8;\n  this.pad[1] = key[18] & 0xff | (key[19] & 0xff) << 8;\n  this.pad[2] = key[20] & 0xff | (key[21] & 0xff) << 8;\n  this.pad[3] = key[22] & 0xff | (key[23] & 0xff) << 8;\n  this.pad[4] = key[24] & 0xff | (key[25] & 0xff) << 8;\n  this.pad[5] = key[26] & 0xff | (key[27] & 0xff) << 8;\n  this.pad[6] = key[28] & 0xff | (key[29] & 0xff) << 8;\n  this.pad[7] = key[30] & 0xff | (key[31] & 0xff) << 8;\n};\n\npoly1305.prototype.blocks = function(m, mpos, bytes) {\n  var hibit = this.fin ? 0 : (1 << 11);\n  var t0, t1, t2, t3, t4, t5, t6, t7, c;\n  var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9;\n\n  var h0 = this.h[0],\n      h1 = this.h[1],\n      h2 = this.h[2],\n      h3 = this.h[3],\n      h4 = this.h[4],\n      h5 = this.h[5],\n      h6 = this.h[6],\n      h7 = this.h[7],\n      h8 = this.h[8],\n      h9 = this.h[9];\n\n  var r0 = this.r[0],\n      r1 = this.r[1],\n      r2 = this.r[2],\n      r3 = this.r[3],\n      r4 = this.r[4],\n      r5 = this.r[5],\n      r6 = this.r[6],\n      r7 = this.r[7],\n      r8 = this.r[8],\n      r9 = this.r[9];\n\n  while (bytes >= 16) {\n    t0 = m[mpos+ 0] & 0xff | (m[mpos+ 1] & 0xff) << 8; h0 += ( t0                     ) & 0x1fff;\n    t1 = m[mpos+ 2] & 0xff | (m[mpos+ 3] & 0xff) << 8; h1 += ((t0 >>> 13) | (t1 <<  3)) & 0x1fff;\n    t2 = m[mpos+ 4] & 0xff | (m[mpos+ 5] & 0xff) << 8; h2 += ((t1 >>> 10) | (t2 <<  6)) & 0x1fff;\n    t3 = m[mpos+ 6] & 0xff | (m[mpos+ 7] & 0xff) << 8; h3 += ((t2 >>>  7) | (t3 <<  9)) & 0x1fff;\n    t4 = m[mpos+ 8] & 0xff | (m[mpos+ 9] & 0xff) << 8; h4 += ((t3 >>>  4) | (t4 << 12)) & 0x1fff;\n    h5 += ((t4 >>>  1)) & 0x1fff;\n    t5 = m[mpos+10] & 0xff | (m[mpos+11] & 0xff) << 8; h6 += ((t4 >>> 14) | (t5 <<  2)) & 0x1fff;\n    t6 = m[mpos+12] & 0xff | (m[mpos+13] & 0xff) << 8; h7 += ((t5 >>> 11) | (t6 <<  5)) & 0x1fff;\n    t7 = m[mpos+14] & 0xff | (m[mpos+15] & 0xff) << 8; h8 += ((t6 >>>  8) | (t7 <<  8)) & 0x1fff;\n    h9 += ((t7 >>> 5)) | hibit;\n\n    c = 0;\n\n    d0 = c;\n    d0 += h0 * r0;\n    d0 += h1 * (5 * r9);\n    d0 += h2 * (5 * r8);\n    d0 += h3 * (5 * r7);\n    d0 += h4 * (5 * r6);\n    c = (d0 >>> 13); d0 &= 0x1fff;\n    d0 += h5 * (5 * r5);\n    d0 += h6 * (5 * r4);\n    d0 += h7 * (5 * r3);\n    d0 += h8 * (5 * r2);\n    d0 += h9 * (5 * r1);\n    c += (d0 >>> 13); d0 &= 0x1fff;\n\n    d1 = c;\n    d1 += h0 * r1;\n    d1 += h1 * r0;\n    d1 += h2 * (5 * r9);\n    d1 += h3 * (5 * r8);\n    d1 += h4 * (5 * r7);\n    c = (d1 >>> 13); d1 &= 0x1fff;\n    d1 += h5 * (5 * r6);\n    d1 += h6 * (5 * r5);\n    d1 += h7 * (5 * r4);\n    d1 += h8 * (5 * r3);\n    d1 += h9 * (5 * r2);\n    c += (d1 >>> 13); d1 &= 0x1fff;\n\n    d2 = c;\n    d2 += h0 * r2;\n    d2 += h1 * r1;\n    d2 += h2 * r0;\n    d2 += h3 * (5 * r9);\n    d2 += h4 * (5 * r8);\n    c = (d2 >>> 13); d2 &= 0x1fff;\n    d2 += h5 * (5 * r7);\n    d2 += h6 * (5 * r6);\n    d2 += h7 * (5 * r5);\n    d2 += h8 * (5 * r4);\n    d2 += h9 * (5 * r3);\n    c += (d2 >>> 13); d2 &= 0x1fff;\n\n    d3 = c;\n    d3 += h0 * r3;\n    d3 += h1 * r2;\n    d3 += h2 * r1;\n    d3 += h3 * r0;\n    d3 += h4 * (5 * r9);\n    c = (d3 >>> 13); d3 &= 0x1fff;\n    d3 += h5 * (5 * r8);\n    d3 += h6 * (5 * r7);\n    d3 += h7 * (5 * r6);\n    d3 += h8 * (5 * r5);\n    d3 += h9 * (5 * r4);\n    c += (d3 >>> 13); d3 &= 0x1fff;\n\n    d4 = c;\n    d4 += h0 * r4;\n    d4 += h1 * r3;\n    d4 += h2 * r2;\n    d4 += h3 * r1;\n    d4 += h4 * r0;\n    c = (d4 >>> 13); d4 &= 0x1fff;\n    d4 += h5 * (5 * r9);\n    d4 += h6 * (5 * r8);\n    d4 += h7 * (5 * r7);\n    d4 += h8 * (5 * r6);\n    d4 += h9 * (5 * r5);\n    c += (d4 >>> 13); d4 &= 0x1fff;\n\n    d5 = c;\n    d5 += h0 * r5;\n    d5 += h1 * r4;\n    d5 += h2 * r3;\n    d5 += h3 * r2;\n    d5 += h4 * r1;\n    c = (d5 >>> 13); d5 &= 0x1fff;\n    d5 += h5 * r0;\n    d5 += h6 * (5 * r9);\n    d5 += h7 * (5 * r8);\n    d5 += h8 * (5 * r7);\n    d5 += h9 * (5 * r6);\n    c += (d5 >>> 13); d5 &= 0x1fff;\n\n    d6 = c;\n    d6 += h0 * r6;\n    d6 += h1 * r5;\n    d6 += h2 * r4;\n    d6 += h3 * r3;\n    d6 += h4 * r2;\n    c = (d6 >>> 13); d6 &= 0x1fff;\n    d6 += h5 * r1;\n    d6 += h6 * r0;\n    d6 += h7 * (5 * r9);\n    d6 += h8 * (5 * r8);\n    d6 += h9 * (5 * r7);\n    c += (d6 >>> 13); d6 &= 0x1fff;\n\n    d7 = c;\n    d7 += h0 * r7;\n    d7 += h1 * r6;\n    d7 += h2 * r5;\n    d7 += h3 * r4;\n    d7 += h4 * r3;\n    c = (d7 >>> 13); d7 &= 0x1fff;\n    d7 += h5 * r2;\n    d7 += h6 * r1;\n    d7 += h7 * r0;\n    d7 += h8 * (5 * r9);\n    d7 += h9 * (5 * r8);\n    c += (d7 >>> 13); d7 &= 0x1fff;\n\n    d8 = c;\n    d8 += h0 * r8;\n    d8 += h1 * r7;\n    d8 += h2 * r6;\n    d8 += h3 * r5;\n    d8 += h4 * r4;\n    c = (d8 >>> 13); d8 &= 0x1fff;\n    d8 += h5 * r3;\n    d8 += h6 * r2;\n    d8 += h7 * r1;\n    d8 += h8 * r0;\n    d8 += h9 * (5 * r9);\n    c += (d8 >>> 13); d8 &= 0x1fff;\n\n    d9 = c;\n    d9 += h0 * r9;\n    d9 += h1 * r8;\n    d9 += h2 * r7;\n    d9 += h3 * r6;\n    d9 += h4 * r5;\n    c = (d9 >>> 13); d9 &= 0x1fff;\n    d9 += h5 * r4;\n    d9 += h6 * r3;\n    d9 += h7 * r2;\n    d9 += h8 * r1;\n    d9 += h9 * r0;\n    c += (d9 >>> 13); d9 &= 0x1fff;\n\n    c = (((c << 2) + c)) | 0;\n    c = (c + d0) | 0;\n    d0 = c & 0x1fff;\n    c = (c >>> 13);\n    d1 += c;\n\n    h0 = d0;\n    h1 = d1;\n    h2 = d2;\n    h3 = d3;\n    h4 = d4;\n    h5 = d5;\n    h6 = d6;\n    h7 = d7;\n    h8 = d8;\n    h9 = d9;\n\n    mpos += 16;\n    bytes -= 16;\n  }\n  this.h[0] = h0;\n  this.h[1] = h1;\n  this.h[2] = h2;\n  this.h[3] = h3;\n  this.h[4] = h4;\n  this.h[5] = h5;\n  this.h[6] = h6;\n  this.h[7] = h7;\n  this.h[8] = h8;\n  this.h[9] = h9;\n};\n\npoly1305.prototype.finish = function(mac, macpos) {\n  var g = new Uint16Array(10);\n  var c, mask, f, i;\n\n  if (this.leftover) {\n    i = this.leftover;\n    this.buffer[i++] = 1;\n    for (; i < 16; i++) this.buffer[i] = 0;\n    this.fin = 1;\n    this.blocks(this.buffer, 0, 16);\n  }\n\n  c = this.h[1] >>> 13;\n  this.h[1] &= 0x1fff;\n  for (i = 2; i < 10; i++) {\n    this.h[i] += c;\n    c = this.h[i] >>> 13;\n    this.h[i] &= 0x1fff;\n  }\n  this.h[0] += (c * 5);\n  c = this.h[0] >>> 13;\n  this.h[0] &= 0x1fff;\n  this.h[1] += c;\n  c = this.h[1] >>> 13;\n  this.h[1] &= 0x1fff;\n  this.h[2] += c;\n\n  g[0] = this.h[0] + 5;\n  c = g[0] >>> 13;\n  g[0] &= 0x1fff;\n  for (i = 1; i < 10; i++) {\n    g[i] = this.h[i] + c;\n    c = g[i] >>> 13;\n    g[i] &= 0x1fff;\n  }\n  g[9] -= (1 << 13);\n\n  mask = (c ^ 1) - 1;\n  for (i = 0; i < 10; i++) g[i] &= mask;\n  mask = ~mask;\n  for (i = 0; i < 10; i++) this.h[i] = (this.h[i] & mask) | g[i];\n\n  this.h[0] = ((this.h[0]       ) | (this.h[1] << 13)                    ) & 0xffff;\n  this.h[1] = ((this.h[1] >>>  3) | (this.h[2] << 10)                    ) & 0xffff;\n  this.h[2] = ((this.h[2] >>>  6) | (this.h[3] <<  7)                    ) & 0xffff;\n  this.h[3] = ((this.h[3] >>>  9) | (this.h[4] <<  4)                    ) & 0xffff;\n  this.h[4] = ((this.h[4] >>> 12) | (this.h[5] <<  1) | (this.h[6] << 14)) & 0xffff;\n  this.h[5] = ((this.h[6] >>>  2) | (this.h[7] << 11)                    ) & 0xffff;\n  this.h[6] = ((this.h[7] >>>  5) | (this.h[8] <<  8)                    ) & 0xffff;\n  this.h[7] = ((this.h[8] >>>  8) | (this.h[9] <<  5)                    ) & 0xffff;\n\n  f = this.h[0] + this.pad[0];\n  this.h[0] = f & 0xffff;\n  for (i = 1; i < 8; i++) {\n    f = (((this.h[i] + this.pad[i]) | 0) + (f >>> 16)) | 0;\n    this.h[i] = f & 0xffff;\n  }\n\n  mac[macpos+ 0] = (this.h[0] >>> 0) & 0xff;\n  mac[macpos+ 1] = (this.h[0] >>> 8) & 0xff;\n  mac[macpos+ 2] = (this.h[1] >>> 0) & 0xff;\n  mac[macpos+ 3] = (this.h[1] >>> 8) & 0xff;\n  mac[macpos+ 4] = (this.h[2] >>> 0) & 0xff;\n  mac[macpos+ 5] = (this.h[2] >>> 8) & 0xff;\n  mac[macpos+ 6] = (this.h[3] >>> 0) & 0xff;\n  mac[macpos+ 7] = (this.h[3] >>> 8) & 0xff;\n  mac[macpos+ 8] = (this.h[4] >>> 0) & 0xff;\n  mac[macpos+ 9] = (this.h[4] >>> 8) & 0xff;\n  mac[macpos+10] = (this.h[5] >>> 0) & 0xff;\n  mac[macpos+11] = (this.h[5] >>> 8) & 0xff;\n  mac[macpos+12] = (this.h[6] >>> 0) & 0xff;\n  mac[macpos+13] = (this.h[6] >>> 8) & 0xff;\n  mac[macpos+14] = (this.h[7] >>> 0) & 0xff;\n  mac[macpos+15] = (this.h[7] >>> 8) & 0xff;\n};\n\npoly1305.prototype.update = function(m, mpos, bytes) {\n  var i, want;\n\n  if (this.leftover) {\n    want = (16 - this.leftover);\n    if (want > bytes)\n      want = bytes;\n    for (i = 0; i < want; i++)\n      this.buffer[this.leftover + i] = m[mpos+i];\n    bytes -= want;\n    mpos += want;\n    this.leftover += want;\n    if (this.leftover < 16)\n      return;\n    this.blocks(this.buffer, 0, 16);\n    this.leftover = 0;\n  }\n\n  if (bytes >= 16) {\n    want = bytes - (bytes % 16);\n    this.blocks(m, mpos, want);\n    mpos += want;\n    bytes -= want;\n  }\n\n  if (bytes) {\n    for (i = 0; i < bytes; i++)\n      this.buffer[this.leftover + i] = m[mpos+i];\n    this.leftover += bytes;\n  }\n};\n\nfunction crypto_onetimeauth(out, outpos, m, mpos, n, k) {\n  var s = new poly1305(k);\n  s.update(m, mpos, n);\n  s.finish(out, outpos);\n  return 0;\n}\n\nfunction crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) {\n  var x = new Uint8Array(16);\n  crypto_onetimeauth(x,0,m,mpos,n,k);\n  return crypto_verify_16(h,hpos,x,0);\n}\n\nfunction crypto_secretbox(c,m,d,n,k) {\n  var i;\n  if (d < 32) return -1;\n  crypto_stream_xor(c,0,m,0,d,n,k);\n  crypto_onetimeauth(c, 16, c, 32, d - 32, c);\n  for (i = 0; i < 16; i++) c[i] = 0;\n  return 0;\n}\n\nfunction crypto_secretbox_open(m,c,d,n,k) {\n  var i;\n  var x = new Uint8Array(32);\n  if (d < 32) return -1;\n  crypto_stream(x,0,32,n,k);\n  if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1;\n  crypto_stream_xor(m,0,c,0,d,n,k);\n  for (i = 0; i < 32; i++) m[i] = 0;\n  return 0;\n}\n\nfunction set25519(r, a) {\n  var i;\n  for (i = 0; i < 16; i++) r[i] = a[i]|0;\n}\n\nfunction car25519(o) {\n  var i, v, c = 1;\n  for (i = 0; i < 16; i++) {\n    v = o[i] + c + 65535;\n    c = Math.floor(v / 65536);\n    o[i] = v - c * 65536;\n  }\n  o[0] += c-1 + 37 * (c-1);\n}\n\nfunction sel25519(p, q, b) {\n  var t, c = ~(b-1);\n  for (var i = 0; i < 16; i++) {\n    t = c & (p[i] ^ q[i]);\n    p[i] ^= t;\n    q[i] ^= t;\n  }\n}\n\nfunction pack25519(o, n) {\n  var i, j, b;\n  var m = gf(), t = gf();\n  for (i = 0; i < 16; i++) t[i] = n[i];\n  car25519(t);\n  car25519(t);\n  car25519(t);\n  for (j = 0; j < 2; j++) {\n    m[0] = t[0] - 0xffed;\n    for (i = 1; i < 15; i++) {\n      m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1);\n      m[i-1] &= 0xffff;\n    }\n    m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1);\n    b = (m[15]>>16) & 1;\n    m[14] &= 0xffff;\n    sel25519(t, m, 1-b);\n  }\n  for (i = 0; i < 16; i++) {\n    o[2*i] = t[i] & 0xff;\n    o[2*i+1] = t[i]>>8;\n  }\n}\n\nfunction neq25519(a, b) {\n  var c = new Uint8Array(32), d = new Uint8Array(32);\n  pack25519(c, a);\n  pack25519(d, b);\n  return crypto_verify_32(c, 0, d, 0);\n}\n\nfunction par25519(a) {\n  var d = new Uint8Array(32);\n  pack25519(d, a);\n  return d[0] & 1;\n}\n\nfunction unpack25519(o, n) {\n  var i;\n  for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8);\n  o[15] &= 0x7fff;\n}\n\nfunction A(o, a, b) {\n  for (var i = 0; i < 16; i++) o[i] = a[i] + b[i];\n}\n\nfunction Z(o, a, b) {\n  for (var i = 0; i < 16; i++) o[i] = a[i] - b[i];\n}\n\nfunction M(o, a, b) {\n  var v, c,\n     t0 = 0,  t1 = 0,  t2 = 0,  t3 = 0,  t4 = 0,  t5 = 0,  t6 = 0,  t7 = 0,\n     t8 = 0,  t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0,\n    t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0,\n    t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0,\n    b0 = b[0],\n    b1 = b[1],\n    b2 = b[2],\n    b3 = b[3],\n    b4 = b[4],\n    b5 = b[5],\n    b6 = b[6],\n    b7 = b[7],\n    b8 = b[8],\n    b9 = b[9],\n    b10 = b[10],\n    b11 = b[11],\n    b12 = b[12],\n    b13 = b[13],\n    b14 = b[14],\n    b15 = b[15];\n\n  v = a[0];\n  t0 += v * b0;\n  t1 += v * b1;\n  t2 += v * b2;\n  t3 += v * b3;\n  t4 += v * b4;\n  t5 += v * b5;\n  t6 += v * b6;\n  t7 += v * b7;\n  t8 += v * b8;\n  t9 += v * b9;\n  t10 += v * b10;\n  t11 += v * b11;\n  t12 += v * b12;\n  t13 += v * b13;\n  t14 += v * b14;\n  t15 += v * b15;\n  v = a[1];\n  t1 += v * b0;\n  t2 += v * b1;\n  t3 += v * b2;\n  t4 += v * b3;\n  t5 += v * b4;\n  t6 += v * b5;\n  t7 += v * b6;\n  t8 += v * b7;\n  t9 += v * b8;\n  t10 += v * b9;\n  t11 += v * b10;\n  t12 += v * b11;\n  t13 += v * b12;\n  t14 += v * b13;\n  t15 += v * b14;\n  t16 += v * b15;\n  v = a[2];\n  t2 += v * b0;\n  t3 += v * b1;\n  t4 += v * b2;\n  t5 += v * b3;\n  t6 += v * b4;\n  t7 += v * b5;\n  t8 += v * b6;\n  t9 += v * b7;\n  t10 += v * b8;\n  t11 += v * b9;\n  t12 += v * b10;\n  t13 += v * b11;\n  t14 += v * b12;\n  t15 += v * b13;\n  t16 += v * b14;\n  t17 += v * b15;\n  v = a[3];\n  t3 += v * b0;\n  t4 += v * b1;\n  t5 += v * b2;\n  t6 += v * b3;\n  t7 += v * b4;\n  t8 += v * b5;\n  t9 += v * b6;\n  t10 += v * b7;\n  t11 += v * b8;\n  t12 += v * b9;\n  t13 += v * b10;\n  t14 += v * b11;\n  t15 += v * b12;\n  t16 += v * b13;\n  t17 += v * b14;\n  t18 += v * b15;\n  v = a[4];\n  t4 += v * b0;\n  t5 += v * b1;\n  t6 += v * b2;\n  t7 += v * b3;\n  t8 += v * b4;\n  t9 += v * b5;\n  t10 += v * b6;\n  t11 += v * b7;\n  t12 += v * b8;\n  t13 += v * b9;\n  t14 += v * b10;\n  t15 += v * b11;\n  t16 += v * b12;\n  t17 += v * b13;\n  t18 += v * b14;\n  t19 += v * b15;\n  v = a[5];\n  t5 += v * b0;\n  t6 += v * b1;\n  t7 += v * b2;\n  t8 += v * b3;\n  t9 += v * b4;\n  t10 += v * b5;\n  t11 += v * b6;\n  t12 += v * b7;\n  t13 += v * b8;\n  t14 += v * b9;\n  t15 += v * b10;\n  t16 += v * b11;\n  t17 += v * b12;\n  t18 += v * b13;\n  t19 += v * b14;\n  t20 += v * b15;\n  v = a[6];\n  t6 += v * b0;\n  t7 += v * b1;\n  t8 += v * b2;\n  t9 += v * b3;\n  t10 += v * b4;\n  t11 += v * b5;\n  t12 += v * b6;\n  t13 += v * b7;\n  t14 += v * b8;\n  t15 += v * b9;\n  t16 += v * b10;\n  t17 += v * b11;\n  t18 += v * b12;\n  t19 += v * b13;\n  t20 += v * b14;\n  t21 += v * b15;\n  v = a[7];\n  t7 += v * b0;\n  t8 += v * b1;\n  t9 += v * b2;\n  t10 += v * b3;\n  t11 += v * b4;\n  t12 += v * b5;\n  t13 += v * b6;\n  t14 += v * b7;\n  t15 += v * b8;\n  t16 += v * b9;\n  t17 += v * b10;\n  t18 += v * b11;\n  t19 += v * b12;\n  t20 += v * b13;\n  t21 += v * b14;\n  t22 += v * b15;\n  v = a[8];\n  t8 += v * b0;\n  t9 += v * b1;\n  t10 += v * b2;\n  t11 += v * b3;\n  t12 += v * b4;\n  t13 += v * b5;\n  t14 += v * b6;\n  t15 += v * b7;\n  t16 += v * b8;\n  t17 += v * b9;\n  t18 += v * b10;\n  t19 += v * b11;\n  t20 += v * b12;\n  t21 += v * b13;\n  t22 += v * b14;\n  t23 += v * b15;\n  v = a[9];\n  t9 += v * b0;\n  t10 += v * b1;\n  t11 += v * b2;\n  t12 += v * b3;\n  t13 += v * b4;\n  t14 += v * b5;\n  t15 += v * b6;\n  t16 += v * b7;\n  t17 += v * b8;\n  t18 += v * b9;\n  t19 += v * b10;\n  t20 += v * b11;\n  t21 += v * b12;\n  t22 += v * b13;\n  t23 += v * b14;\n  t24 += v * b15;\n  v = a[10];\n  t10 += v * b0;\n  t11 += v * b1;\n  t12 += v * b2;\n  t13 += v * b3;\n  t14 += v * b4;\n  t15 += v * b5;\n  t16 += v * b6;\n  t17 += v * b7;\n  t18 += v * b8;\n  t19 += v * b9;\n  t20 += v * b10;\n  t21 += v * b11;\n  t22 += v * b12;\n  t23 += v * b13;\n  t24 += v * b14;\n  t25 += v * b15;\n  v = a[11];\n  t11 += v * b0;\n  t12 += v * b1;\n  t13 += v * b2;\n  t14 += v * b3;\n  t15 += v * b4;\n  t16 += v * b5;\n  t17 += v * b6;\n  t18 += v * b7;\n  t19 += v * b8;\n  t20 += v * b9;\n  t21 += v * b10;\n  t22 += v * b11;\n  t23 += v * b12;\n  t24 += v * b13;\n  t25 += v * b14;\n  t26 += v * b15;\n  v = a[12];\n  t12 += v * b0;\n  t13 += v * b1;\n  t14 += v * b2;\n  t15 += v * b3;\n  t16 += v * b4;\n  t17 += v * b5;\n  t18 += v * b6;\n  t19 += v * b7;\n  t20 += v * b8;\n  t21 += v * b9;\n  t22 += v * b10;\n  t23 += v * b11;\n  t24 += v * b12;\n  t25 += v * b13;\n  t26 += v * b14;\n  t27 += v * b15;\n  v = a[13];\n  t13 += v * b0;\n  t14 += v * b1;\n  t15 += v * b2;\n  t16 += v * b3;\n  t17 += v * b4;\n  t18 += v * b5;\n  t19 += v * b6;\n  t20 += v * b7;\n  t21 += v * b8;\n  t22 += v * b9;\n  t23 += v * b10;\n  t24 += v * b11;\n  t25 += v * b12;\n  t26 += v * b13;\n  t27 += v * b14;\n  t28 += v * b15;\n  v = a[14];\n  t14 += v * b0;\n  t15 += v * b1;\n  t16 += v * b2;\n  t17 += v * b3;\n  t18 += v * b4;\n  t19 += v * b5;\n  t20 += v * b6;\n  t21 += v * b7;\n  t22 += v * b8;\n  t23 += v * b9;\n  t24 += v * b10;\n  t25 += v * b11;\n  t26 += v * b12;\n  t27 += v * b13;\n  t28 += v * b14;\n  t29 += v * b15;\n  v = a[15];\n  t15 += v * b0;\n  t16 += v * b1;\n  t17 += v * b2;\n  t18 += v * b3;\n  t19 += v * b4;\n  t20 += v * b5;\n  t21 += v * b6;\n  t22 += v * b7;\n  t23 += v * b8;\n  t24 += v * b9;\n  t25 += v * b10;\n  t26 += v * b11;\n  t27 += v * b12;\n  t28 += v * b13;\n  t29 += v * b14;\n  t30 += v * b15;\n\n  t0  += 38 * t16;\n  t1  += 38 * t17;\n  t2  += 38 * t18;\n  t3  += 38 * t19;\n  t4  += 38 * t20;\n  t5  += 38 * t21;\n  t6  += 38 * t22;\n  t7  += 38 * t23;\n  t8  += 38 * t24;\n  t9  += 38 * t25;\n  t10 += 38 * t26;\n  t11 += 38 * t27;\n  t12 += 38 * t28;\n  t13 += 38 * t29;\n  t14 += 38 * t30;\n  // t15 left as is\n\n  // first car\n  c = 1;\n  v =  t0 + c + 65535; c = Math.floor(v / 65536);  t0 = v - c * 65536;\n  v =  t1 + c + 65535; c = Math.floor(v / 65536);  t1 = v - c * 65536;\n  v =  t2 + c + 65535; c = Math.floor(v / 65536);  t2 = v - c * 65536;\n  v =  t3 + c + 65535; c = Math.floor(v / 65536);  t3 = v - c * 65536;\n  v =  t4 + c + 65535; c = Math.floor(v / 65536);  t4 = v - c * 65536;\n  v =  t5 + c + 65535; c = Math.floor(v / 65536);  t5 = v - c * 65536;\n  v =  t6 + c + 65535; c = Math.floor(v / 65536);  t6 = v - c * 65536;\n  v =  t7 + c + 65535; c = Math.floor(v / 65536);  t7 = v - c * 65536;\n  v =  t8 + c + 65535; c = Math.floor(v / 65536);  t8 = v - c * 65536;\n  v =  t9 + c + 65535; c = Math.floor(v / 65536);  t9 = v - c * 65536;\n  v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;\n  v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;\n  v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;\n  v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;\n  v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;\n  v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;\n  t0 += c-1 + 37 * (c-1);\n\n  // second car\n  c = 1;\n  v =  t0 + c + 65535; c = Math.floor(v / 65536);  t0 = v - c * 65536;\n  v =  t1 + c + 65535; c = Math.floor(v / 65536);  t1 = v - c * 65536;\n  v =  t2 + c + 65535; c = Math.floor(v / 65536);  t2 = v - c * 65536;\n  v =  t3 + c + 65535; c = Math.floor(v / 65536);  t3 = v - c * 65536;\n  v =  t4 + c + 65535; c = Math.floor(v / 65536);  t4 = v - c * 65536;\n  v =  t5 + c + 65535; c = Math.floor(v / 65536);  t5 = v - c * 65536;\n  v =  t6 + c + 65535; c = Math.floor(v / 65536);  t6 = v - c * 65536;\n  v =  t7 + c + 65535; c = Math.floor(v / 65536);  t7 = v - c * 65536;\n  v =  t8 + c + 65535; c = Math.floor(v / 65536);  t8 = v - c * 65536;\n  v =  t9 + c + 65535; c = Math.floor(v / 65536);  t9 = v - c * 65536;\n  v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;\n  v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;\n  v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;\n  v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;\n  v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;\n  v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;\n  t0 += c-1 + 37 * (c-1);\n\n  o[ 0] = t0;\n  o[ 1] = t1;\n  o[ 2] = t2;\n  o[ 3] = t3;\n  o[ 4] = t4;\n  o[ 5] = t5;\n  o[ 6] = t6;\n  o[ 7] = t7;\n  o[ 8] = t8;\n  o[ 9] = t9;\n  o[10] = t10;\n  o[11] = t11;\n  o[12] = t12;\n  o[13] = t13;\n  o[14] = t14;\n  o[15] = t15;\n}\n\nfunction S(o, a) {\n  M(o, a, a);\n}\n\nfunction inv25519(o, i) {\n  var c = gf();\n  var a;\n  for (a = 0; a < 16; a++) c[a] = i[a];\n  for (a = 253; a >= 0; a--) {\n    S(c, c);\n    if(a !== 2 && a !== 4) M(c, c, i);\n  }\n  for (a = 0; a < 16; a++) o[a] = c[a];\n}\n\nfunction pow2523(o, i) {\n  var c = gf();\n  var a;\n  for (a = 0; a < 16; a++) c[a] = i[a];\n  for (a = 250; a >= 0; a--) {\n      S(c, c);\n      if(a !== 1) M(c, c, i);\n  }\n  for (a = 0; a < 16; a++) o[a] = c[a];\n}\n\nfunction crypto_scalarmult(q, n, p) {\n  var z = new Uint8Array(32);\n  var x = new Float64Array(80), r, i;\n  var a = gf(), b = gf(), c = gf(),\n      d = gf(), e = gf(), f = gf();\n  for (i = 0; i < 31; i++) z[i] = n[i];\n  z[31]=(n[31]&127)|64;\n  z[0]&=248;\n  unpack25519(x,p);\n  for (i = 0; i < 16; i++) {\n    b[i]=x[i];\n    d[i]=a[i]=c[i]=0;\n  }\n  a[0]=d[0]=1;\n  for (i=254; i>=0; --i) {\n    r=(z[i>>>3]>>>(i&7))&1;\n    sel25519(a,b,r);\n    sel25519(c,d,r);\n    A(e,a,c);\n    Z(a,a,c);\n    A(c,b,d);\n    Z(b,b,d);\n    S(d,e);\n    S(f,a);\n    M(a,c,a);\n    M(c,b,e);\n    A(e,a,c);\n    Z(a,a,c);\n    S(b,a);\n    Z(c,d,f);\n    M(a,c,_121665);\n    A(a,a,d);\n    M(c,c,a);\n    M(a,d,f);\n    M(d,b,x);\n    S(b,e);\n    sel25519(a,b,r);\n    sel25519(c,d,r);\n  }\n  for (i = 0; i < 16; i++) {\n    x[i+16]=a[i];\n    x[i+32]=c[i];\n    x[i+48]=b[i];\n    x[i+64]=d[i];\n  }\n  var x32 = x.subarray(32);\n  var x16 = x.subarray(16);\n  inv25519(x32,x32);\n  M(x16,x16,x32);\n  pack25519(q,x16);\n  return 0;\n}\n\nfunction crypto_scalarmult_base(q, n) {\n  return crypto_scalarmult(q, n, _9);\n}\n\nfunction crypto_box_keypair(y, x) {\n  randombytes(x, 32);\n  return crypto_scalarmult_base(y, x);\n}\n\nfunction crypto_box_beforenm(k, y, x) {\n  var s = new Uint8Array(32);\n  crypto_scalarmult(s, x, y);\n  return crypto_core_hsalsa20(k, _0, s, sigma);\n}\n\nvar crypto_box_afternm = crypto_secretbox;\nvar crypto_box_open_afternm = crypto_secretbox_open;\n\nfunction crypto_box(c, m, d, n, y, x) {\n  var k = new Uint8Array(32);\n  crypto_box_beforenm(k, y, x);\n  return crypto_box_afternm(c, m, d, n, k);\n}\n\nfunction crypto_box_open(m, c, d, n, y, x) {\n  var k = new Uint8Array(32);\n  crypto_box_beforenm(k, y, x);\n  return crypto_box_open_afternm(m, c, d, n, k);\n}\n\nvar K = [\n  0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n  0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n  0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n  0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n  0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n  0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n  0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n  0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n  0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n  0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n  0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n  0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n  0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n  0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n  0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n  0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n  0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n  0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n  0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n  0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n  0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n  0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n  0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n  0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n  0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n  0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n  0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n  0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n  0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n  0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n  0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n  0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n  0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n  0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n  0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n  0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n  0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n  0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n  0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n  0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n];\n\nfunction crypto_hashblocks_hl(hh, hl, m, n) {\n  var wh = new Int32Array(16), wl = new Int32Array(16),\n      bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7,\n      bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7,\n      th, tl, i, j, h, l, a, b, c, d;\n\n  var ah0 = hh[0],\n      ah1 = hh[1],\n      ah2 = hh[2],\n      ah3 = hh[3],\n      ah4 = hh[4],\n      ah5 = hh[5],\n      ah6 = hh[6],\n      ah7 = hh[7],\n\n      al0 = hl[0],\n      al1 = hl[1],\n      al2 = hl[2],\n      al3 = hl[3],\n      al4 = hl[4],\n      al5 = hl[5],\n      al6 = hl[6],\n      al7 = hl[7];\n\n  var pos = 0;\n  while (n >= 128) {\n    for (i = 0; i < 16; i++) {\n      j = 8 * i + pos;\n      wh[i] = (m[j+0] << 24) | (m[j+1] << 16) | (m[j+2] << 8) | m[j+3];\n      wl[i] = (m[j+4] << 24) | (m[j+5] << 16) | (m[j+6] << 8) | m[j+7];\n    }\n    for (i = 0; i < 80; i++) {\n      bh0 = ah0;\n      bh1 = ah1;\n      bh2 = ah2;\n      bh3 = ah3;\n      bh4 = ah4;\n      bh5 = ah5;\n      bh6 = ah6;\n      bh7 = ah7;\n\n      bl0 = al0;\n      bl1 = al1;\n      bl2 = al2;\n      bl3 = al3;\n      bl4 = al4;\n      bl5 = al5;\n      bl6 = al6;\n      bl7 = al7;\n\n      // add\n      h = ah7;\n      l = al7;\n\n      a = l & 0xffff; b = l >>> 16;\n      c = h & 0xffff; d = h >>> 16;\n\n      // Sigma1\n      h = ((ah4 >>> 14) | (al4 << (32-14))) ^ ((ah4 >>> 18) | (al4 << (32-18))) ^ ((al4 >>> (41-32)) | (ah4 << (32-(41-32))));\n      l = ((al4 >>> 14) | (ah4 << (32-14))) ^ ((al4 >>> 18) | (ah4 << (32-18))) ^ ((ah4 >>> (41-32)) | (al4 << (32-(41-32))));\n\n      a += l & 0xffff; b += l >>> 16;\n      c += h & 0xffff; d += h >>> 16;\n\n      // Ch\n      h = (ah4 & ah5) ^ (~ah4 & ah6);\n      l = (al4 & al5) ^ (~al4 & al6);\n\n      a += l & 0xffff; b += l >>> 16;\n      c += h & 0xffff; d += h >>> 16;\n\n      // K\n      h = K[i*2];\n      l = K[i*2+1];\n\n      a += l & 0xffff; b += l >>> 16;\n      c += h & 0xffff; d += h >>> 16;\n\n      // w\n      h = wh[i%16];\n      l = wl[i%16];\n\n      a += l & 0xffff; b += l >>> 16;\n      c += h & 0xffff; d += h >>> 16;\n\n      b += a >>> 16;\n      c += b >>> 16;\n      d += c >>> 16;\n\n      th = c & 0xffff | d << 16;\n      tl = a & 0xffff | b << 16;\n\n      // add\n      h = th;\n      l = tl;\n\n      a = l & 0xffff; b = l >>> 16;\n      c = h & 0xffff; d = h >>> 16;\n\n      // Sigma0\n      h = ((ah0 >>> 28) | (al0 << (32-28))) ^ ((al0 >>> (34-32)) | (ah0 << (32-(34-32)))) ^ ((al0 >>> (39-32)) | (ah0 << (32-(39-32))));\n      l = ((al0 >>> 28) | (ah0 << (32-28))) ^ ((ah0 >>> (34-32)) | (al0 << (32-(34-32)))) ^ ((ah0 >>> (39-32)) | (al0 << (32-(39-32))));\n\n      a += l & 0xffff; b += l >>> 16;\n      c += h & 0xffff; d += h >>> 16;\n\n      // Maj\n      h = (ah0 & ah1) ^ (ah0 & ah2) ^ (ah1 & ah2);\n      l = (al0 & al1) ^ (al0 & al2) ^ (al1 & al2);\n\n      a += l & 0xffff; b += l >>> 16;\n      c += h & 0xffff; d += h >>> 16;\n\n      b += a >>> 16;\n      c += b >>> 16;\n      d += c >>> 16;\n\n      bh7 = (c & 0xffff) | (d << 16);\n      bl7 = (a & 0xffff) | (b << 16);\n\n      // add\n      h = bh3;\n      l = bl3;\n\n      a = l & 0xffff; b = l >>> 16;\n      c = h & 0xffff; d = h >>> 16;\n\n      h = th;\n      l = tl;\n\n      a += l & 0xffff; b += l >>> 16;\n      c += h & 0xffff; d += h >>> 16;\n\n      b += a >>> 16;\n      c += b >>> 16;\n      d += c >>> 16;\n\n      bh3 = (c & 0xffff) | (d << 16);\n      bl3 = (a & 0xffff) | (b << 16);\n\n      ah1 = bh0;\n      ah2 = bh1;\n      ah3 = bh2;\n      ah4 = bh3;\n      ah5 = bh4;\n      ah6 = bh5;\n      ah7 = bh6;\n      ah0 = bh7;\n\n      al1 = bl0;\n      al2 = bl1;\n      al3 = bl2;\n      al4 = bl3;\n      al5 = bl4;\n      al6 = bl5;\n      al7 = bl6;\n      al0 = bl7;\n\n      if (i%16 === 15) {\n        for (j = 0; j < 16; j++) {\n          // add\n          h = wh[j];\n          l = wl[j];\n\n          a = l & 0xffff; b = l >>> 16;\n          c = h & 0xffff; d = h >>> 16;\n\n          h = wh[(j+9)%16];\n          l = wl[(j+9)%16];\n\n          a += l & 0xffff; b += l >>> 16;\n          c += h & 0xffff; d += h >>> 16;\n\n          // sigma0\n          th = wh[(j+1)%16];\n          tl = wl[(j+1)%16];\n          h = ((th >>> 1) | (tl << (32-1))) ^ ((th >>> 8) | (tl << (32-8))) ^ (th >>> 7);\n          l = ((tl >>> 1) | (th << (32-1))) ^ ((tl >>> 8) | (th << (32-8))) ^ ((tl >>> 7) | (th << (32-7)));\n\n          a += l & 0xffff; b += l >>> 16;\n          c += h & 0xffff; d += h >>> 16;\n\n          // sigma1\n          th = wh[(j+14)%16];\n          tl = wl[(j+14)%16];\n          h = ((th >>> 19) | (tl << (32-19))) ^ ((tl >>> (61-32)) | (th << (32-(61-32)))) ^ (th >>> 6);\n          l = ((tl >>> 19) | (th << (32-19))) ^ ((th >>> (61-32)) | (tl << (32-(61-32)))) ^ ((tl >>> 6) | (th << (32-6)));\n\n          a += l & 0xffff; b += l >>> 16;\n          c += h & 0xffff; d += h >>> 16;\n\n          b += a >>> 16;\n          c += b >>> 16;\n          d += c >>> 16;\n\n          wh[j] = (c & 0xffff) | (d << 16);\n          wl[j] = (a & 0xffff) | (b << 16);\n        }\n      }\n    }\n\n    // add\n    h = ah0;\n    l = al0;\n\n    a = l & 0xffff; b = l >>> 16;\n    c = h & 0xffff; d = h >>> 16;\n\n    h = hh[0];\n    l = hl[0];\n\n    a += l & 0xffff; b += l >>> 16;\n    c += h & 0xffff; d += h >>> 16;\n\n    b += a >>> 16;\n    c += b >>> 16;\n    d += c >>> 16;\n\n    hh[0] = ah0 = (c & 0xffff) | (d << 16);\n    hl[0] = al0 = (a & 0xffff) | (b << 16);\n\n    h = ah1;\n    l = al1;\n\n    a = l & 0xffff; b = l >>> 16;\n    c = h & 0xffff; d = h >>> 16;\n\n    h = hh[1];\n    l = hl[1];\n\n    a += l & 0xffff; b += l >>> 16;\n    c += h & 0xffff; d += h >>> 16;\n\n    b += a >>> 16;\n    c += b >>> 16;\n    d += c >>> 16;\n\n    hh[1] = ah1 = (c & 0xffff) | (d << 16);\n    hl[1] = al1 = (a & 0xffff) | (b << 16);\n\n    h = ah2;\n    l = al2;\n\n    a = l & 0xffff; b = l >>> 16;\n    c = h & 0xffff; d = h >>> 16;\n\n    h = hh[2];\n    l = hl[2];\n\n    a += l & 0xffff; b += l >>> 16;\n    c += h & 0xffff; d += h >>> 16;\n\n    b += a >>> 16;\n    c += b >>> 16;\n    d += c >>> 16;\n\n    hh[2] = ah2 = (c & 0xffff) | (d << 16);\n    hl[2] = al2 = (a & 0xffff) | (b << 16);\n\n    h = ah3;\n    l = al3;\n\n    a = l & 0xffff; b = l >>> 16;\n    c = h & 0xffff; d = h >>> 16;\n\n    h = hh[3];\n    l = hl[3];\n\n    a += l & 0xffff; b += l >>> 16;\n    c += h & 0xffff; d += h >>> 16;\n\n    b += a >>> 16;\n    c += b >>> 16;\n    d += c >>> 16;\n\n    hh[3] = ah3 = (c & 0xffff) | (d << 16);\n    hl[3] = al3 = (a & 0xffff) | (b << 16);\n\n    h = ah4;\n    l = al4;\n\n    a = l & 0xffff; b = l >>> 16;\n    c = h & 0xffff; d = h >>> 16;\n\n    h = hh[4];\n    l = hl[4];\n\n    a += l & 0xffff; b += l >>> 16;\n    c += h & 0xffff; d += h >>> 16;\n\n    b += a >>> 16;\n    c += b >>> 16;\n    d += c >>> 16;\n\n    hh[4] = ah4 = (c & 0xffff) | (d << 16);\n    hl[4] = al4 = (a & 0xffff) | (b << 16);\n\n    h = ah5;\n    l = al5;\n\n    a = l & 0xffff; b = l >>> 16;\n    c = h & 0xffff; d = h >>> 16;\n\n    h = hh[5];\n    l = hl[5];\n\n    a += l & 0xffff; b += l >>> 16;\n    c += h & 0xffff; d += h >>> 16;\n\n    b += a >>> 16;\n    c += b >>> 16;\n    d += c >>> 16;\n\n    hh[5] = ah5 = (c & 0xffff) | (d << 16);\n    hl[5] = al5 = (a & 0xffff) | (b << 16);\n\n    h = ah6;\n    l = al6;\n\n    a = l & 0xffff; b = l >>> 16;\n    c = h & 0xffff; d = h >>> 16;\n\n    h = hh[6];\n    l = hl[6];\n\n    a += l & 0xffff; b += l >>> 16;\n    c += h & 0xffff; d += h >>> 16;\n\n    b += a >>> 16;\n    c += b >>> 16;\n    d += c >>> 16;\n\n    hh[6] = ah6 = (c & 0xffff) | (d << 16);\n    hl[6] = al6 = (a & 0xffff) | (b << 16);\n\n    h = ah7;\n    l = al7;\n\n    a = l & 0xffff; b = l >>> 16;\n    c = h & 0xffff; d = h >>> 16;\n\n    h = hh[7];\n    l = hl[7];\n\n    a += l & 0xffff; b += l >>> 16;\n    c += h & 0xffff; d += h >>> 16;\n\n    b += a >>> 16;\n    c += b >>> 16;\n    d += c >>> 16;\n\n    hh[7] = ah7 = (c & 0xffff) | (d << 16);\n    hl[7] = al7 = (a & 0xffff) | (b << 16);\n\n    pos += 128;\n    n -= 128;\n  }\n\n  return n;\n}\n\nfunction crypto_hash(out, m, n) {\n  var hh = new Int32Array(8),\n      hl = new Int32Array(8),\n      x = new Uint8Array(256),\n      i, b = n;\n\n  hh[0] = 0x6a09e667;\n  hh[1] = 0xbb67ae85;\n  hh[2] = 0x3c6ef372;\n  hh[3] = 0xa54ff53a;\n  hh[4] = 0x510e527f;\n  hh[5] = 0x9b05688c;\n  hh[6] = 0x1f83d9ab;\n  hh[7] = 0x5be0cd19;\n\n  hl[0] = 0xf3bcc908;\n  hl[1] = 0x84caa73b;\n  hl[2] = 0xfe94f82b;\n  hl[3] = 0x5f1d36f1;\n  hl[4] = 0xade682d1;\n  hl[5] = 0x2b3e6c1f;\n  hl[6] = 0xfb41bd6b;\n  hl[7] = 0x137e2179;\n\n  crypto_hashblocks_hl(hh, hl, m, n);\n  n %= 128;\n\n  for (i = 0; i < n; i++) x[i] = m[b-n+i];\n  x[n] = 128;\n\n  n = 256-128*(n<112?1:0);\n  x[n-9] = 0;\n  ts64(x, n-8,  (b / 0x20000000) | 0, b << 3);\n  crypto_hashblocks_hl(hh, hl, x, n);\n\n  for (i = 0; i < 8; i++) ts64(out, 8*i, hh[i], hl[i]);\n\n  return 0;\n}\n\nfunction add(p, q) {\n  var a = gf(), b = gf(), c = gf(),\n      d = gf(), e = gf(), f = gf(),\n      g = gf(), h = gf(), t = gf();\n\n  Z(a, p[1], p[0]);\n  Z(t, q[1], q[0]);\n  M(a, a, t);\n  A(b, p[0], p[1]);\n  A(t, q[0], q[1]);\n  M(b, b, t);\n  M(c, p[3], q[3]);\n  M(c, c, D2);\n  M(d, p[2], q[2]);\n  A(d, d, d);\n  Z(e, b, a);\n  Z(f, d, c);\n  A(g, d, c);\n  A(h, b, a);\n\n  M(p[0], e, f);\n  M(p[1], h, g);\n  M(p[2], g, f);\n  M(p[3], e, h);\n}\n\nfunction cswap(p, q, b) {\n  var i;\n  for (i = 0; i < 4; i++) {\n    sel25519(p[i], q[i], b);\n  }\n}\n\nfunction pack(r, p) {\n  var tx = gf(), ty = gf(), zi = gf();\n  inv25519(zi, p[2]);\n  M(tx, p[0], zi);\n  M(ty, p[1], zi);\n  pack25519(r, ty);\n  r[31] ^= par25519(tx) << 7;\n}\n\nfunction scalarmult(p, q, s) {\n  var b, i;\n  set25519(p[0], gf0);\n  set25519(p[1], gf1);\n  set25519(p[2], gf1);\n  set25519(p[3], gf0);\n  for (i = 255; i >= 0; --i) {\n    b = (s[(i/8)|0] >> (i&7)) & 1;\n    cswap(p, q, b);\n    add(q, p);\n    add(p, p);\n    cswap(p, q, b);\n  }\n}\n\nfunction scalarbase(p, s) {\n  var q = [gf(), gf(), gf(), gf()];\n  set25519(q[0], X);\n  set25519(q[1], Y);\n  set25519(q[2], gf1);\n  M(q[3], X, Y);\n  scalarmult(p, q, s);\n}\n\nfunction crypto_sign_keypair(pk, sk, seeded) {\n  var d = new Uint8Array(64);\n  var p = [gf(), gf(), gf(), gf()];\n  var i;\n\n  if (!seeded) randombytes(sk, 32);\n  crypto_hash(d, sk, 32);\n  d[0] &= 248;\n  d[31] &= 127;\n  d[31] |= 64;\n\n  scalarbase(p, d);\n  pack(pk, p);\n\n  for (i = 0; i < 32; i++) sk[i+32] = pk[i];\n  return 0;\n}\n\nvar L = new Float64Array([0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]);\n\nfunction modL(r, x) {\n  var carry, i, j, k;\n  for (i = 63; i >= 32; --i) {\n    carry = 0;\n    for (j = i - 32, k = i - 12; j < k; ++j) {\n      x[j] += carry - 16 * x[i] * L[j - (i - 32)];\n      carry = Math.floor((x[j] + 128) / 256);\n      x[j] -= carry * 256;\n    }\n    x[j] += carry;\n    x[i] = 0;\n  }\n  carry = 0;\n  for (j = 0; j < 32; j++) {\n    x[j] += carry - (x[31] >> 4) * L[j];\n    carry = x[j] >> 8;\n    x[j] &= 255;\n  }\n  for (j = 0; j < 32; j++) x[j] -= carry * L[j];\n  for (i = 0; i < 32; i++) {\n    x[i+1] += x[i] >> 8;\n    r[i] = x[i] & 255;\n  }\n}\n\nfunction reduce(r) {\n  var x = new Float64Array(64), i;\n  for (i = 0; i < 64; i++) x[i] = r[i];\n  for (i = 0; i < 64; i++) r[i] = 0;\n  modL(r, x);\n}\n\n// Note: difference from C - smlen returned, not passed as argument.\nfunction crypto_sign(sm, m, n, sk) {\n  var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64);\n  var i, j, x = new Float64Array(64);\n  var p = [gf(), gf(), gf(), gf()];\n\n  crypto_hash(d, sk, 32);\n  d[0] &= 248;\n  d[31] &= 127;\n  d[31] |= 64;\n\n  var smlen = n + 64;\n  for (i = 0; i < n; i++) sm[64 + i] = m[i];\n  for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i];\n\n  crypto_hash(r, sm.subarray(32), n+32);\n  reduce(r);\n  scalarbase(p, r);\n  pack(sm, p);\n\n  for (i = 32; i < 64; i++) sm[i] = sk[i];\n  crypto_hash(h, sm, n + 64);\n  reduce(h);\n\n  for (i = 0; i < 64; i++) x[i] = 0;\n  for (i = 0; i < 32; i++) x[i] = r[i];\n  for (i = 0; i < 32; i++) {\n    for (j = 0; j < 32; j++) {\n      x[i+j] += h[i] * d[j];\n    }\n  }\n\n  modL(sm.subarray(32), x);\n  return smlen;\n}\n\nfunction unpackneg(r, p) {\n  var t = gf(), chk = gf(), num = gf(),\n      den = gf(), den2 = gf(), den4 = gf(),\n      den6 = gf();\n\n  set25519(r[2], gf1);\n  unpack25519(r[1], p);\n  S(num, r[1]);\n  M(den, num, D);\n  Z(num, num, r[2]);\n  A(den, r[2], den);\n\n  S(den2, den);\n  S(den4, den2);\n  M(den6, den4, den2);\n  M(t, den6, num);\n  M(t, t, den);\n\n  pow2523(t, t);\n  M(t, t, num);\n  M(t, t, den);\n  M(t, t, den);\n  M(r[0], t, den);\n\n  S(chk, r[0]);\n  M(chk, chk, den);\n  if (neq25519(chk, num)) M(r[0], r[0], I);\n\n  S(chk, r[0]);\n  M(chk, chk, den);\n  if (neq25519(chk, num)) return -1;\n\n  if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]);\n\n  M(r[3], r[0], r[1]);\n  return 0;\n}\n\nfunction crypto_sign_open(m, sm, n, pk) {\n  var i;\n  var t = new Uint8Array(32), h = new Uint8Array(64);\n  var p = [gf(), gf(), gf(), gf()],\n      q = [gf(), gf(), gf(), gf()];\n\n  if (n < 64) return -1;\n\n  if (unpackneg(q, pk)) return -1;\n\n  for (i = 0; i < n; i++) m[i] = sm[i];\n  for (i = 0; i < 32; i++) m[i+32] = pk[i];\n  crypto_hash(h, m, n);\n  reduce(h);\n  scalarmult(p, q, h);\n\n  scalarbase(q, sm.subarray(32));\n  add(p, q);\n  pack(t, p);\n\n  n -= 64;\n  if (crypto_verify_32(sm, 0, t, 0)) {\n    for (i = 0; i < n; i++) m[i] = 0;\n    return -1;\n  }\n\n  for (i = 0; i < n; i++) m[i] = sm[i + 64];\n  return n;\n}\n\nvar crypto_secretbox_KEYBYTES = 32,\n    crypto_secretbox_NONCEBYTES = 24,\n    crypto_secretbox_ZEROBYTES = 32,\n    crypto_secretbox_BOXZEROBYTES = 16,\n    crypto_scalarmult_BYTES = 32,\n    crypto_scalarmult_SCALARBYTES = 32,\n    crypto_box_PUBLICKEYBYTES = 32,\n    crypto_box_SECRETKEYBYTES = 32,\n    crypto_box_BEFORENMBYTES = 32,\n    crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES,\n    crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES,\n    crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES,\n    crypto_sign_BYTES = 64,\n    crypto_sign_PUBLICKEYBYTES = 32,\n    crypto_sign_SECRETKEYBYTES = 64,\n    crypto_sign_SEEDBYTES = 32,\n    crypto_hash_BYTES = 64;\n\nnacl.lowlevel = {\n  crypto_core_hsalsa20: crypto_core_hsalsa20,\n  crypto_stream_xor: crypto_stream_xor,\n  crypto_stream: crypto_stream,\n  crypto_stream_salsa20_xor: crypto_stream_salsa20_xor,\n  crypto_stream_salsa20: crypto_stream_salsa20,\n  crypto_onetimeauth: crypto_onetimeauth,\n  crypto_onetimeauth_verify: crypto_onetimeauth_verify,\n  crypto_verify_16: crypto_verify_16,\n  crypto_verify_32: crypto_verify_32,\n  crypto_secretbox: crypto_secretbox,\n  crypto_secretbox_open: crypto_secretbox_open,\n  crypto_scalarmult: crypto_scalarmult,\n  crypto_scalarmult_base: crypto_scalarmult_base,\n  crypto_box_beforenm: crypto_box_beforenm,\n  crypto_box_afternm: crypto_box_afternm,\n  crypto_box: crypto_box,\n  crypto_box_open: crypto_box_open,\n  crypto_box_keypair: crypto_box_keypair,\n  crypto_hash: crypto_hash,\n  crypto_sign: crypto_sign,\n  crypto_sign_keypair: crypto_sign_keypair,\n  crypto_sign_open: crypto_sign_open,\n\n  crypto_secretbox_KEYBYTES: crypto_secretbox_KEYBYTES,\n  crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES,\n  crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES,\n  crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES,\n  crypto_scalarmult_BYTES: crypto_scalarmult_BYTES,\n  crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES,\n  crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES,\n  crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES,\n  crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES,\n  crypto_box_NONCEBYTES: crypto_box_NONCEBYTES,\n  crypto_box_ZEROBYTES: crypto_box_ZEROBYTES,\n  crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES,\n  crypto_sign_BYTES: crypto_sign_BYTES,\n  crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES,\n  crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES,\n  crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES,\n  crypto_hash_BYTES: crypto_hash_BYTES,\n\n  gf: gf,\n  D: D,\n  L: L,\n  pack25519: pack25519,\n  unpack25519: unpack25519,\n  M: M,\n  A: A,\n  S: S,\n  Z: Z,\n  pow2523: pow2523,\n  add: add,\n  set25519: set25519,\n  modL: modL,\n  scalarmult: scalarmult,\n  scalarbase: scalarbase,\n};\n\n/* High-level API */\n\nfunction checkLengths(k, n) {\n  if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size');\n  if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size');\n}\n\nfunction checkBoxLengths(pk, sk) {\n  if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size');\n  if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size');\n}\n\nfunction checkArrayTypes() {\n  for (var i = 0; i < arguments.length; i++) {\n    if (!(arguments[i] instanceof Uint8Array))\n      throw new TypeError('unexpected type, use Uint8Array');\n  }\n}\n\nfunction cleanup(arr) {\n  for (var i = 0; i < arr.length; i++) arr[i] = 0;\n}\n\nnacl.randomBytes = function(n) {\n  var b = new Uint8Array(n);\n  randombytes(b, n);\n  return b;\n};\n\nnacl.secretbox = function(msg, nonce, key) {\n  checkArrayTypes(msg, nonce, key);\n  checkLengths(key, nonce);\n  var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length);\n  var c = new Uint8Array(m.length);\n  for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i];\n  crypto_secretbox(c, m, m.length, nonce, key);\n  return c.subarray(crypto_secretbox_BOXZEROBYTES);\n};\n\nnacl.secretbox.open = function(box, nonce, key) {\n  checkArrayTypes(box, nonce, key);\n  checkLengths(key, nonce);\n  var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length);\n  var m = new Uint8Array(c.length);\n  for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i];\n  if (c.length < 32) return null;\n  if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return null;\n  return m.subarray(crypto_secretbox_ZEROBYTES);\n};\n\nnacl.secretbox.keyLength = crypto_secretbox_KEYBYTES;\nnacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES;\nnacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES;\n\nnacl.scalarMult = function(n, p) {\n  checkArrayTypes(n, p);\n  if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');\n  if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size');\n  var q = new Uint8Array(crypto_scalarmult_BYTES);\n  crypto_scalarmult(q, n, p);\n  return q;\n};\n\nnacl.scalarMult.base = function(n) {\n  checkArrayTypes(n);\n  if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');\n  var q = new Uint8Array(crypto_scalarmult_BYTES);\n  crypto_scalarmult_base(q, n);\n  return q;\n};\n\nnacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES;\nnacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES;\n\nnacl.box = function(msg, nonce, publicKey, secretKey) {\n  var k = nacl.box.before(publicKey, secretKey);\n  return nacl.secretbox(msg, nonce, k);\n};\n\nnacl.box.before = function(publicKey, secretKey) {\n  checkArrayTypes(publicKey, secretKey);\n  checkBoxLengths(publicKey, secretKey);\n  var k = new Uint8Array(crypto_box_BEFORENMBYTES);\n  crypto_box_beforenm(k, publicKey, secretKey);\n  return k;\n};\n\nnacl.box.after = nacl.secretbox;\n\nnacl.box.open = function(msg, nonce, publicKey, secretKey) {\n  var k = nacl.box.before(publicKey, secretKey);\n  return nacl.secretbox.open(msg, nonce, k);\n};\n\nnacl.box.open.after = nacl.secretbox.open;\n\nnacl.box.keyPair = function() {\n  var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);\n  var sk = new Uint8Array(crypto_box_SECRETKEYBYTES);\n  crypto_box_keypair(pk, sk);\n  return {publicKey: pk, secretKey: sk};\n};\n\nnacl.box.keyPair.fromSecretKey = function(secretKey) {\n  checkArrayTypes(secretKey);\n  if (secretKey.length !== crypto_box_SECRETKEYBYTES)\n    throw new Error('bad secret key size');\n  var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);\n  crypto_scalarmult_base(pk, secretKey);\n  return {publicKey: pk, secretKey: new Uint8Array(secretKey)};\n};\n\nnacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES;\nnacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES;\nnacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES;\nnacl.box.nonceLength = crypto_box_NONCEBYTES;\nnacl.box.overheadLength = nacl.secretbox.overheadLength;\n\nnacl.sign = function(msg, secretKey) {\n  checkArrayTypes(msg, secretKey);\n  if (secretKey.length !== crypto_sign_SECRETKEYBYTES)\n    throw new Error('bad secret key size');\n  var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length);\n  crypto_sign(signedMsg, msg, msg.length, secretKey);\n  return signedMsg;\n};\n\nnacl.sign.open = function(signedMsg, publicKey) {\n  checkArrayTypes(signedMsg, publicKey);\n  if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)\n    throw new Error('bad public key size');\n  var tmp = new Uint8Array(signedMsg.length);\n  var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey);\n  if (mlen < 0) return null;\n  var m = new Uint8Array(mlen);\n  for (var i = 0; i < m.length; i++) m[i] = tmp[i];\n  return m;\n};\n\nnacl.sign.detached = function(msg, secretKey) {\n  var signedMsg = nacl.sign(msg, secretKey);\n  var sig = new Uint8Array(crypto_sign_BYTES);\n  for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i];\n  return sig;\n};\n\nnacl.sign.detached.verify = function(msg, sig, publicKey) {\n  checkArrayTypes(msg, sig, publicKey);\n  if (sig.length !== crypto_sign_BYTES)\n    throw new Error('bad signature size');\n  if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)\n    throw new Error('bad public key size');\n  var sm = new Uint8Array(crypto_sign_BYTES + msg.length);\n  var m = new Uint8Array(crypto_sign_BYTES + msg.length);\n  var i;\n  for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i];\n  for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i];\n  return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0);\n};\n\nnacl.sign.keyPair = function() {\n  var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n  var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);\n  crypto_sign_keypair(pk, sk);\n  return {publicKey: pk, secretKey: sk};\n};\n\nnacl.sign.keyPair.fromSecretKey = function(secretKey) {\n  checkArrayTypes(secretKey);\n  if (secretKey.length !== crypto_sign_SECRETKEYBYTES)\n    throw new Error('bad secret key size');\n  var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n  for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i];\n  return {publicKey: pk, secretKey: new Uint8Array(secretKey)};\n};\n\nnacl.sign.keyPair.fromSeed = function(seed) {\n  checkArrayTypes(seed);\n  if (seed.length !== crypto_sign_SEEDBYTES)\n    throw new Error('bad seed size');\n  var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n  var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);\n  for (var i = 0; i < 32; i++) sk[i] = seed[i];\n  crypto_sign_keypair(pk, sk, true);\n  return {publicKey: pk, secretKey: sk};\n};\n\nnacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES;\nnacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES;\nnacl.sign.seedLength = crypto_sign_SEEDBYTES;\nnacl.sign.signatureLength = crypto_sign_BYTES;\n\nnacl.hash = function(msg) {\n  checkArrayTypes(msg);\n  var h = new Uint8Array(crypto_hash_BYTES);\n  crypto_hash(h, msg, msg.length);\n  return h;\n};\n\nnacl.hash.hashLength = crypto_hash_BYTES;\n\nnacl.verify = function(x, y) {\n  checkArrayTypes(x, y);\n  // Zero length arguments are considered not equal.\n  if (x.length === 0 || y.length === 0) return false;\n  if (x.length !== y.length) return false;\n  return (vn(x, 0, y, 0, x.length) === 0) ? true : false;\n};\n\nnacl.setPRNG = function(fn) {\n  randombytes = fn;\n};\n\n(function() {\n  // Initialize PRNG if environment provides CSPRNG.\n  // If not, methods calling randombytes will throw.\n  var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null;\n  if (crypto && crypto.getRandomValues) {\n    // Browsers.\n    var QUOTA = 65536;\n    nacl.setPRNG(function(x, n) {\n      var i, v = new Uint8Array(n);\n      for (i = 0; i < n; i += QUOTA) {\n        crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA)));\n      }\n      for (i = 0; i < n; i++) x[i] = v[i];\n      cleanup(v);\n    });\n  } else if (typeof require !== 'undefined') {\n    // Node.js.\n    crypto = require('crypto');\n    if (crypto && crypto.randomBytes) {\n      nacl.setPRNG(function(x, n) {\n        var i, v = crypto.randomBytes(n);\n        for (i = 0; i < n; i++) x[i] = v[i];\n        cleanup(v);\n      });\n    }\n  }\n})();\n\n})(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.nacl || {}));\n","module.exports = require('./pusher-with-encryption').default;\n","/* (ignored) */","import ScriptReceiver from './script_receiver';\n\n/** Builds receivers for JSONP and Script requests.\n *\n * Each receiver is an object with following fields:\n * - number - unique (for the factory instance), numerical id of the receiver\n * - id - a string ID that can be used in DOM attributes\n * - name - name of the function triggering the receiver\n * - callback - callback function\n *\n * Receivers are triggered only once, on the first callback call.\n *\n * Receivers can be called by their name or by accessing factory object\n * by the number key.\n *\n * @param {String} prefix the prefix used in ids\n * @param {String} name the name of the object\n */\nexport class ScriptReceiverFactory {\n  lastId: number;\n  prefix: string;\n  name: string;\n\n  constructor(prefix: string, name: string) {\n    this.lastId = 0;\n    this.prefix = prefix;\n    this.name = name;\n  }\n\n  create(callback: Function): ScriptReceiver {\n    this.lastId++;\n\n    var number = this.lastId;\n    var id = this.prefix + number;\n    var name = this.name + '[' + number + ']';\n\n    var called = false;\n    var callbackWrapper = function() {\n      if (!called) {\n        callback.apply(null, arguments);\n        called = true;\n      }\n    };\n\n    this[number] = callbackWrapper;\n    return { number: number, id: id, name: name, callback: callbackWrapper };\n  }\n\n  remove(receiver: ScriptReceiver) {\n    delete this[receiver.number];\n  }\n}\n\nexport var ScriptReceivers = new ScriptReceiverFactory(\n  '_pusher_script_',\n  'Pusher.ScriptReceivers'\n);\n","export enum AuthRequestType {\n  UserAuthentication = 'user-authentication',\n  ChannelAuthorization = 'channel-authorization'\n}\n\nexport interface ChannelAuthorizationData {\n  auth: string;\n  channel_data?: string;\n  shared_secret?: string;\n}\n\nexport type ChannelAuthorizationCallback = (\n  error: Error | null,\n  authData: ChannelAuthorizationData | null\n) => void;\n\nexport interface ChannelAuthorizationRequestParams {\n  socketId: string;\n  channelName: string;\n}\n\nexport interface ChannelAuthorizationHandler {\n  (\n    params: ChannelAuthorizationRequestParams,\n    callback: ChannelAuthorizationCallback\n  ): void;\n}\n\nexport interface UserAuthenticationData {\n  auth: string;\n  user_data: string;\n}\n\nexport type UserAuthenticationCallback = (\n  error: Error | null,\n  authData: UserAuthenticationData | null\n) => void;\n\nexport interface UserAuthenticationRequestParams {\n  socketId: string;\n}\n\nexport interface UserAuthenticationHandler {\n  (\n    params: UserAuthenticationRequestParams,\n    callback: UserAuthenticationCallback\n  ): void;\n}\n\nexport type AuthTransportCallback =\n  | ChannelAuthorizationCallback\n  | UserAuthenticationCallback;\n\nexport interface AuthOptionsT<AuthHandler> {\n  transport: 'ajax' | 'jsonp';\n  endpoint: string;\n  params?: any;\n  headers?: any;\n  paramsProvider?: () => any;\n  headersProvider?: () => any;\n  customHandler?: AuthHandler;\n}\n\nexport declare type UserAuthenticationOptions = AuthOptionsT<\n  UserAuthenticationHandler\n>;\nexport declare type ChannelAuthorizationOptions = AuthOptionsT<\n  ChannelAuthorizationHandler\n>;\n\nexport interface InternalAuthOptions {\n  transport: 'ajax' | 'jsonp';\n  endpoint: string;\n  params?: any;\n  headers?: any;\n  paramsProvider?: () => any;\n  headersProvider?: () => any;\n}\n","import {\n  ChannelAuthorizationOptions,\n  UserAuthenticationOptions\n} from './auth/options';\nimport { AuthTransport } from './config';\n\nexport interface DefaultConfig {\n  VERSION: string;\n  PROTOCOL: number;\n  wsPort: number;\n  wssPort: number;\n  wsPath: string;\n  httpHost: string;\n  httpPort: number;\n  httpsPort: number;\n  httpPath: string;\n  stats_host: string;\n  authEndpoint: string;\n  authTransport: AuthTransport;\n  activityTimeout: number;\n  pongTimeout: number;\n  unavailableTimeout: number;\n  cluster: string;\n  userAuthentication: UserAuthenticationOptions;\n  channelAuthorization: ChannelAuthorizationOptions;\n\n  cdn_http?: string;\n  cdn_https?: string;\n  dependency_suffix?: string;\n}\n\nvar Defaults: DefaultConfig = {\n  VERSION: VERSION,\n  PROTOCOL: 7,\n\n  wsPort: 80,\n  wssPort: 443,\n  wsPath: '',\n  // DEPRECATED: SockJS fallback parameters\n  httpHost: 'sockjs.pusher.com',\n  httpPort: 80,\n  httpsPort: 443,\n  httpPath: '/pusher',\n  // DEPRECATED: Stats\n  stats_host: 'stats.pusher.com',\n  // DEPRECATED: Other settings\n  authEndpoint: '/pusher/auth',\n  authTransport: 'ajax',\n  activityTimeout: 120000,\n  pongTimeout: 30000,\n  unavailableTimeout: 10000,\n  cluster: 'mt1',\n  userAuthentication: {\n    endpoint: '/pusher/user-auth',\n    transport: 'ajax'\n  },\n  channelAuthorization: {\n    endpoint: '/pusher/auth',\n    transport: 'ajax'\n  },\n\n  // CDN configuration\n  cdn_http: CDN_HTTP,\n  cdn_https: CDN_HTTPS,\n  dependency_suffix: DEPENDENCY_SUFFIX\n};\n\nexport default Defaults;\n","import {\n  ScriptReceivers,\n  ScriptReceiverFactory\n} from './script_receiver_factory';\nimport Runtime from 'runtime';\nimport ScriptRequest from './script_request';\n\n/** Handles loading dependency files.\n *\n * Dependency loaders don't remember whether a resource has been loaded or\n * not. It is caller's responsibility to make sure the resource is not loaded\n * twice. This is because it's impossible to detect resource loading status\n * without knowing its content.\n *\n * Options:\n * - cdn_http - url to HTTP CND\n * - cdn_https - url to HTTPS CDN\n * - version - version of pusher-js\n * - suffix - suffix appended to all names of dependency files\n *\n * @param {Object} options\n */\nexport default class DependencyLoader {\n  options: any;\n  receivers: ScriptReceiverFactory;\n  loading: any;\n\n  constructor(options: any) {\n    this.options = options;\n    this.receivers = options.receivers || ScriptReceivers;\n    this.loading = {};\n  }\n\n  /** Loads the dependency from CDN.\n   *\n   * @param  {String} name\n   * @param  {Function} callback\n   */\n  load(name: string, options: any, callback: Function) {\n    var self = this;\n\n    if (self.loading[name] && self.loading[name].length > 0) {\n      self.loading[name].push(callback);\n    } else {\n      self.loading[name] = [callback];\n\n      var request = Runtime.createScriptRequest(self.getPath(name, options));\n      var receiver = self.receivers.create(function(error) {\n        self.receivers.remove(receiver);\n\n        if (self.loading[name]) {\n          var callbacks = self.loading[name];\n          delete self.loading[name];\n\n          var successCallback = function(wasSuccessful) {\n            if (!wasSuccessful) {\n              request.cleanup();\n            }\n          };\n          for (var i = 0; i < callbacks.length; i++) {\n            callbacks[i](error, successCallback);\n          }\n        }\n      });\n      request.send(receiver);\n    }\n  }\n\n  /** Returns a root URL for pusher-js CDN.\n   *\n   * @returns {String}\n   */\n  getRoot(options: any): string {\n    var cdn;\n    var protocol = Runtime.getDocument().location.protocol;\n    if ((options && options.useTLS) || protocol === 'https:') {\n      cdn = this.options.cdn_https;\n    } else {\n      cdn = this.options.cdn_http;\n    }\n    // make sure there are no double slashes\n    return cdn.replace(/\\/*$/, '') + '/' + this.options.version;\n  }\n\n  /** Returns a full path to a dependency file.\n   *\n   * @param {String} name\n   * @returns {String}\n   */\n  getPath(name: string, options: any): string {\n    return this.getRoot(options) + '/' + name + this.options.suffix + '.js';\n  }\n}\n","import { ScriptReceiverFactory } from './script_receiver_factory';\nimport Defaults from 'core/defaults';\nimport DependencyLoader from './dependency_loader';\n\nexport var DependenciesReceivers = new ScriptReceiverFactory(\n  '_pusher_dependencies',\n  'Pusher.DependenciesReceivers'\n);\n\nexport var Dependencies = new DependencyLoader({\n  cdn_http: Defaults.cdn_http,\n  cdn_https: Defaults.cdn_https,\n  version: Defaults.VERSION,\n  suffix: Defaults.dependency_suffix,\n  receivers: DependenciesReceivers\n});\n","/**\n * A place to store help URLs for error messages etc\n */\n\nconst urlStore = {\n  baseUrl: 'https://pusher.com',\n  urls: {\n    authenticationEndpoint: {\n      path: '/docs/channels/server_api/authenticating_users'\n    },\n    authorizationEndpoint: {\n      path: '/docs/channels/server_api/authorizing-users/'\n    },\n    javascriptQuickStart: {\n      path: '/docs/javascript_quick_start'\n    },\n    triggeringClientEvents: {\n      path: '/docs/client_api_guide/client_events#trigger-events'\n    },\n    encryptedChannelSupport: {\n      fullUrl:\n        'https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support'\n    }\n  }\n};\n\n/** Builds a consistent string with links to pusher documentation\n *\n * @param {string} key - relevant key in the url_store.urls object\n * @return {string} suffix string to append to log message\n */\nconst buildLogSuffix = function(key: string): string {\n  const urlPrefix = 'See:';\n  const urlObj = urlStore.urls[key];\n  if (!urlObj) return '';\n\n  let url;\n  if (urlObj.fullUrl) {\n    url = urlObj.fullUrl;\n  } else if (urlObj.path) {\n    url = urlStore.baseUrl + urlObj.path;\n  }\n\n  if (!url) return '';\n  return `${urlPrefix} ${url}`;\n};\n\nexport default { buildLogSuffix };\n","export default function encode(s: any): string {\n  return btoa(utob(s));\n}\n\nvar fromCharCode = String.fromCharCode;\n\nvar b64chars =\n  'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nvar b64tab = {};\n\nfor (var i = 0, l = b64chars.length; i < l; i++) {\n  b64tab[b64chars.charAt(i)] = i;\n}\n\nvar cb_utob = function(c) {\n  var cc = c.charCodeAt(0);\n  return cc < 0x80\n    ? c\n    : cc < 0x800\n    ? fromCharCode(0xc0 | (cc >>> 6)) + fromCharCode(0x80 | (cc & 0x3f))\n    : fromCharCode(0xe0 | ((cc >>> 12) & 0x0f)) +\n      fromCharCode(0x80 | ((cc >>> 6) & 0x3f)) +\n      fromCharCode(0x80 | (cc & 0x3f));\n};\n\nvar utob = function(u) {\n  return u.replace(/[^\\x00-\\x7F]/g, cb_utob);\n};\n\nvar cb_encode = function(ccc) {\n  var padlen = [0, 2, 1][ccc.length % 3];\n  var ord =\n    (ccc.charCodeAt(0) << 16) |\n    ((ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8) |\n    (ccc.length > 2 ? ccc.charCodeAt(2) : 0);\n  var chars = [\n    b64chars.charAt(ord >>> 18),\n    b64chars.charAt((ord >>> 12) & 63),\n    padlen >= 2 ? '=' : b64chars.charAt((ord >>> 6) & 63),\n    padlen >= 1 ? '=' : b64chars.charAt(ord & 63)\n  ];\n  return chars.join('');\n};\n\nvar btoa =\n  global.btoa ||\n  function(b) {\n    return b.replace(/[\\s\\S]{1,3}/g, cb_encode);\n  };\n","/** Error classes used throughout the library. */\n// https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\nexport class BadEventName extends Error {\n  constructor(msg?: string) {\n    super(msg);\n\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\nexport class BadChannelName extends Error {\n  constructor(msg?: string) {\n    super(msg);\n\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\nexport class RequestTimedOut extends Error {\n  constructor(msg?: string) {\n    super(msg);\n\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\nexport class TransportPriorityTooLow extends Error {\n  constructor(msg?: string) {\n    super(msg);\n\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\nexport class TransportClosed extends Error {\n  constructor(msg?: string) {\n    super(msg);\n\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\nexport class UnsupportedFeature extends Error {\n  constructor(msg?: string) {\n    super(msg);\n\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\nexport class UnsupportedTransport extends Error {\n  constructor(msg?: string) {\n    super(msg);\n\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\nexport class UnsupportedStrategy extends Error {\n  constructor(msg?: string) {\n    super(msg);\n\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\nexport class HTTPAuthError extends Error {\n  status: number;\n  constructor(status: number, msg?: string) {\n    super(msg);\n    this.status = status;\n\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n","import TimelineSender from 'core/timeline/timeline_sender';\nimport * as Collections from 'core/utils/collections';\nimport Util from 'core/util';\nimport Runtime from 'runtime';\nimport { AuthTransport } from 'core/auth/auth_transports';\nimport AbstractRuntime from 'runtimes/interface';\nimport UrlStore from 'core/utils/url_store';\nimport {\n  AuthRequestType,\n  AuthTransportCallback,\n  InternalAuthOptions\n} from 'core/auth/options';\nimport { HTTPAuthError } from 'core/errors';\n\nconst ajax: AuthTransport = function(\n  context: AbstractRuntime,\n  query: string,\n  authOptions: InternalAuthOptions,\n  authRequestType: AuthRequestType,\n  callback: AuthTransportCallback\n) {\n  const xhr = Runtime.createXHR();\n  xhr.open('POST', authOptions.endpoint, true);\n\n  // add request headers\n  xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n  for (var headerName in authOptions.headers) {\n    xhr.setRequestHeader(headerName, authOptions.headers[headerName]);\n  }\n  if (authOptions.headersProvider != null) {\n    let dynamicHeaders = authOptions.headersProvider();\n    for (var headerName in dynamicHeaders) {\n      xhr.setRequestHeader(headerName, dynamicHeaders[headerName]);\n    }\n  }\n\n  xhr.onreadystatechange = function() {\n    if (xhr.readyState === 4) {\n      if (xhr.status === 200) {\n        let data;\n        let parsed = false;\n\n        try {\n          data = JSON.parse(xhr.responseText);\n          parsed = true;\n        } catch (e) {\n          callback(\n            new HTTPAuthError(\n              200,\n              `JSON returned from ${authRequestType.toString()} endpoint was invalid, yet status code was 200. Data was: ${\n                xhr.responseText\n              }`\n            ),\n            null\n          );\n        }\n\n        if (parsed) {\n          // prevents double execution.\n          callback(null, data);\n        }\n      } else {\n        let suffix = '';\n        switch (authRequestType) {\n          case AuthRequestType.UserAuthentication:\n            suffix = UrlStore.buildLogSuffix('authenticationEndpoint');\n            break;\n          case AuthRequestType.ChannelAuthorization:\n            suffix = `Clients must be authorized to join private or presence channels. ${UrlStore.buildLogSuffix(\n              'authorizationEndpoint'\n            )}`;\n            break;\n        }\n        callback(\n          new HTTPAuthError(\n            xhr.status,\n            `Unable to retrieve auth string from ${authRequestType.toString()} endpoint - ` +\n              `received status: ${xhr.status} from ${authOptions.endpoint}. ${suffix}`\n          ),\n          null\n        );\n      }\n    }\n  };\n\n  xhr.send(query);\n  return xhr;\n};\n\nexport default ajax;\n","import TimedCallback from './timed_callback';\nimport { Delay, Scheduler, Canceller } from './scheduling';\n\nabstract class Timer {\n  protected clear: Canceller;\n  protected timer: number | void;\n\n  constructor(\n    set: Scheduler,\n    clear: Canceller,\n    delay: Delay,\n    callback: TimedCallback\n  ) {\n    this.clear = clear;\n    this.timer = set(() => {\n      if (this.timer) {\n        this.timer = callback(this.timer);\n      }\n    }, delay);\n  }\n\n  /** Returns whether the timer is still running.\n   *\n   * @return {Boolean}\n   */\n  isRunning(): boolean {\n    return this.timer !== null;\n  }\n\n  /** Aborts a timer when it's running. */\n  ensureAborted() {\n    if (this.timer) {\n      this.clear(this.timer);\n      this.timer = null;\n    }\n  }\n}\n\nexport default Timer;\n","import Timer from './abstract_timer';\nimport TimedCallback from './timed_callback';\nimport { Delay } from './scheduling';\n\n// We need to bind clear functions this way to avoid exceptions on IE8\nfunction clearTimeout(timer) {\n  global.clearTimeout(timer);\n}\nfunction clearInterval(timer) {\n  global.clearInterval(timer);\n}\n\n/** Cross-browser compatible one-off timer abstraction.\n *\n * @param {Number} delay\n * @param {Function} callback\n */\nexport class OneOffTimer extends Timer {\n  constructor(delay: Delay, callback: TimedCallback) {\n    super(setTimeout, clearTimeout, delay, function(timer) {\n      callback();\n      return null;\n    });\n  }\n}\n\n/** Cross-browser compatible periodic timer abstraction.\n *\n * @param {Number} delay\n * @param {Function} callback\n */\nexport class PeriodicTimer extends Timer {\n  constructor(delay: Delay, callback: TimedCallback) {\n    super(setInterval, clearInterval, delay, function(timer) {\n      callback();\n      return timer;\n    });\n  }\n}\n","import * as Collections from './utils/collections';\nimport TimedCallback from './utils/timers/timed_callback';\nimport { OneOffTimer, PeriodicTimer } from './utils/timers';\n\nvar Util = {\n  now(): number {\n    if (Date.now) {\n      return Date.now();\n    } else {\n      return new Date().valueOf();\n    }\n  },\n\n  defer(callback: TimedCallback): OneOffTimer {\n    return new OneOffTimer(0, callback);\n  },\n\n  /** Builds a function that will proxy a method call to its first argument.\n   *\n   * Allows partial application of arguments, so additional arguments are\n   * prepended to the argument list.\n   *\n   * @param  {String} name method name\n   * @return {Function} proxy function\n   */\n  method(name: string, ...args: any[]): Function {\n    var boundArguments = Array.prototype.slice.call(arguments, 1);\n    return function(object) {\n      return object[name].apply(object, boundArguments.concat(arguments));\n    };\n  }\n};\n\nexport default Util;\n","import base64encode from '../base64';\nimport Util from '../util';\n\n/** Merges multiple objects into the target argument.\n *\n * For properties that are plain Objects, performs a deep-merge. For the\n * rest it just copies the value of the property.\n *\n * To extend prototypes use it as following:\n *   Pusher.Util.extend(Target.prototype, Base.prototype)\n *\n * You can also use it to merge objects without altering them:\n *   Pusher.Util.extend({}, object1, object2)\n *\n * @param  {Object} target\n * @return {Object} the target argument\n */\nexport function extend<T>(target: any, ...sources: any[]): T {\n  for (var i = 0; i < sources.length; i++) {\n    var extensions = sources[i];\n    for (var property in extensions) {\n      if (\n        extensions[property] &&\n        extensions[property].constructor &&\n        extensions[property].constructor === Object\n      ) {\n        target[property] = extend(target[property] || {}, extensions[property]);\n      } else {\n        target[property] = extensions[property];\n      }\n    }\n  }\n  return target;\n}\n\nexport function stringify(): string {\n  var m = ['Pusher'];\n  for (var i = 0; i < arguments.length; i++) {\n    if (typeof arguments[i] === 'string') {\n      m.push(arguments[i]);\n    } else {\n      m.push(safeJSONStringify(arguments[i]));\n    }\n  }\n  return m.join(' : ');\n}\n\nexport function arrayIndexOf(array: any[], item: any): number {\n  // MSIE doesn't have array.indexOf\n  var nativeIndexOf = Array.prototype.indexOf;\n  if (array === null) {\n    return -1;\n  }\n  if (nativeIndexOf && array.indexOf === nativeIndexOf) {\n    return array.indexOf(item);\n  }\n  for (var i = 0, l = array.length; i < l; i++) {\n    if (array[i] === item) {\n      return i;\n    }\n  }\n  return -1;\n}\n\n/** Applies a function f to all properties of an object.\n *\n * Function f gets 3 arguments passed:\n * - element from the object\n * - key of the element\n * - reference to the object\n *\n * @param {Object} object\n * @param {Function} f\n */\nexport function objectApply(object: any, f: Function) {\n  for (var key in object) {\n    if (Object.prototype.hasOwnProperty.call(object, key)) {\n      f(object[key], key, object);\n    }\n  }\n}\n\n/** Return a list of objects own proerty keys\n *\n * @param {Object} object\n * @returns {Array}\n */\nexport function keys(object: any): string[] {\n  var keys = [];\n  objectApply(object, function(_, key) {\n    keys.push(key);\n  });\n  return keys;\n}\n\n/** Return a list of object's own property values\n *\n * @param {Object} object\n * @returns {Array}\n */\nexport function values(object: any): any[] {\n  var values = [];\n  objectApply(object, function(value) {\n    values.push(value);\n  });\n  return values;\n}\n\n/** Applies a function f to all elements of an array.\n *\n * Function f gets 3 arguments passed:\n * - element from the array\n * - index of the element\n * - reference to the array\n *\n * @param {Array} array\n * @param {Function} f\n */\nexport function apply(array: any[], f: Function, context?: any) {\n  for (var i = 0; i < array.length; i++) {\n    f.call(context || global, array[i], i, array);\n  }\n}\n\n/** Maps all elements of the array and returns the result.\n *\n * Function f gets 4 arguments passed:\n * - element from the array\n * - index of the element\n * - reference to the source array\n * - reference to the destination array\n *\n * @param {Array} array\n * @param {Function} f\n */\nexport function map(array: any[], f: Function): any[] {\n  var result = [];\n  for (var i = 0; i < array.length; i++) {\n    result.push(f(array[i], i, array, result));\n  }\n  return result;\n}\n\n/** Maps all elements of the object and returns the result.\n *\n * Function f gets 4 arguments passed:\n * - element from the object\n * - key of the element\n * - reference to the source object\n * - reference to the destination object\n *\n * @param {Object} object\n * @param {Function} f\n */\nexport function mapObject(object: any, f: Function): any {\n  var result = {};\n  objectApply(object, function(value, key) {\n    result[key] = f(value);\n  });\n  return result;\n}\n\n/** Filters elements of the array using a test function.\n *\n * Function test gets 4 arguments passed:\n * - element from the array\n * - index of the element\n * - reference to the source array\n * - reference to the destination array\n *\n * @param {Array} array\n * @param {Function} f\n */\nexport function filter(array: any[], test: Function): any[] {\n  test =\n    test ||\n    function(value) {\n      return !!value;\n    };\n\n  var result = [];\n  for (var i = 0; i < array.length; i++) {\n    if (test(array[i], i, array, result)) {\n      result.push(array[i]);\n    }\n  }\n  return result;\n}\n\n/** Filters properties of the object using a test function.\n *\n * Function test gets 4 arguments passed:\n * - element from the object\n * - key of the element\n * - reference to the source object\n * - reference to the destination object\n *\n * @param {Object} object\n * @param {Function} f\n */\nexport function filterObject(object: Object, test: Function) {\n  var result = {};\n  objectApply(object, function(value, key) {\n    if ((test && test(value, key, object, result)) || Boolean(value)) {\n      result[key] = value;\n    }\n  });\n  return result;\n}\n\n/** Flattens an object into a two-dimensional array.\n *\n * @param  {Object} object\n * @return {Array} resulting array of [key, value] pairs\n */\nexport function flatten(object: Object): any[] {\n  var result = [];\n  objectApply(object, function(value, key) {\n    result.push([key, value]);\n  });\n  return result;\n}\n\n/** Checks whether any element of the array passes the test.\n *\n * Function test gets 3 arguments passed:\n * - element from the array\n * - index of the element\n * - reference to the source array\n *\n * @param {Array} array\n * @param {Function} f\n */\nexport function any(array: any[], test: Function): boolean {\n  for (var i = 0; i < array.length; i++) {\n    if (test(array[i], i, array)) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/** Checks whether all elements of the array pass the test.\n *\n * Function test gets 3 arguments passed:\n * - element from the array\n * - index of the element\n * - reference to the source array\n *\n * @param {Array} array\n * @param {Function} f\n */\nexport function all(array: any[], test: Function): boolean {\n  for (var i = 0; i < array.length; i++) {\n    if (!test(array[i], i, array)) {\n      return false;\n    }\n  }\n  return true;\n}\n\nexport function encodeParamsObject(data): string {\n  return mapObject(data, function(value) {\n    if (typeof value === 'object') {\n      value = safeJSONStringify(value);\n    }\n    return encodeURIComponent(base64encode(value.toString()));\n  });\n}\n\nexport function buildQueryString(data: any): string {\n  var params = filterObject(data, function(value) {\n    return value !== undefined;\n  });\n\n  var query = map(\n    flatten(encodeParamsObject(params)),\n    Util.method('join', '=')\n  ).join('&');\n\n  return query;\n}\n\n/**\n * See https://github.com/douglascrockford/JSON-js/blob/master/cycle.js\n *\n * Remove circular references from an object. Required for JSON.stringify in\n * React Native, which tends to blow up a lot.\n *\n * @param  {any} object\n * @return {any}        Decycled object\n */\nexport function decycleObject(object: any): any {\n  var objects = [],\n    paths = [];\n\n  return (function derez(value, path) {\n    var i, name, nu;\n\n    switch (typeof value) {\n      case 'object':\n        if (!value) {\n          return null;\n        }\n        for (i = 0; i < objects.length; i += 1) {\n          if (objects[i] === value) {\n            return { $ref: paths[i] };\n          }\n        }\n\n        objects.push(value);\n        paths.push(path);\n\n        if (Object.prototype.toString.apply(value) === '[object Array]') {\n          nu = [];\n          for (i = 0; i < value.length; i += 1) {\n            nu[i] = derez(value[i], path + '[' + i + ']');\n          }\n        } else {\n          nu = {};\n          for (name in value) {\n            if (Object.prototype.hasOwnProperty.call(value, name)) {\n              nu[name] = derez(\n                value[name],\n                path + '[' + JSON.stringify(name) + ']'\n              );\n            }\n          }\n        }\n        return nu;\n      case 'number':\n      case 'string':\n      case 'boolean':\n        return value;\n    }\n  })(object, '$');\n}\n\n/**\n * Provides a cross-browser and cross-platform way to safely stringify objects\n * into JSON. This is particularly necessary for ReactNative, where circular JSON\n * structures throw an exception.\n *\n * @param  {any}    source The object to stringify\n * @return {string}        The serialized output.\n */\nexport function safeJSONStringify(source: any): string {\n  try {\n    return JSON.stringify(source);\n  } catch (e) {\n    return JSON.stringify(decycleObject(source));\n  }\n}\n","import { stringify } from './utils/collections';\nimport Pusher from './pusher';\n\nclass Logger {\n  debug(...args: any[]) {\n    this.log(this.globalLog, args);\n  }\n\n  warn(...args: any[]) {\n    this.log(this.globalLogWarn, args);\n  }\n\n  error(...args: any[]) {\n    this.log(this.globalLogError, args);\n  }\n\n  private globalLog = (message: string) => {\n    if (global.console && global.console.log) {\n      global.console.log(message);\n    }\n  };\n\n  private globalLogWarn(message: string) {\n    if (global.console && global.console.warn) {\n      global.console.warn(message);\n    } else {\n      this.globalLog(message);\n    }\n  }\n\n  private globalLogError(message: string) {\n    if (global.console && global.console.error) {\n      global.console.error(message);\n    } else {\n      this.globalLogWarn(message);\n    }\n  }\n\n  private log(\n    defaultLoggingFunction: (message: string) => void,\n    ...args: any[]\n  ) {\n    var message = stringify.apply(this, arguments);\n    if (Pusher.log) {\n      Pusher.log(message);\n    } else if (Pusher.logToConsole) {\n      const log = defaultLoggingFunction.bind(this);\n      log(message);\n    }\n  }\n}\n\nexport default new Logger();\n","import Browser from '../browser';\nimport Logger from 'core/logger';\nimport JSONPRequest from '../dom/jsonp_request';\nimport { ScriptReceivers } from '../dom/script_receiver_factory';\nimport { AuthTransport } from 'core/auth/auth_transports';\nimport {\n  AuthRequestType,\n  AuthTransportCallback,\n  InternalAuthOptions\n} from 'core/auth/options';\n\nvar jsonp: AuthTransport = function(\n  context: Browser,\n  query: string,\n  authOptions: InternalAuthOptions,\n  authRequestType: AuthRequestType,\n  callback: AuthTransportCallback\n) {\n  if (\n    authOptions.headers !== undefined ||\n    authOptions.headersProvider != null\n  ) {\n    Logger.warn(\n      `To send headers with the ${authRequestType.toString()} request, you must use AJAX, rather than JSONP.`\n    );\n  }\n\n  var callbackName = context.nextAuthCallbackID.toString();\n  context.nextAuthCallbackID++;\n\n  var document = context.getDocument();\n  var script = document.createElement('script');\n  // Hacked wrapper.\n  context.auth_callbacks[callbackName] = function(data) {\n    callback(null, data);\n  };\n\n  var callback_name = \"Pusher.auth_callbacks['\" + callbackName + \"']\";\n  script.src =\n    authOptions.endpoint +\n    '?callback=' +\n    encodeURIComponent(callback_name) +\n    '&' +\n    query;\n\n  var head =\n    document.getElementsByTagName('head')[0] || document.documentElement;\n  head.insertBefore(script, head.firstChild);\n};\n\nexport default jsonp;\n","import ScriptReceiver from './script_receiver';\n\n/** Sends a generic HTTP GET request using a script tag.\n *\n * By constructing URL in a specific way, it can be used for loading\n * JavaScript resources or JSONP requests. It can notify about errors, but\n * only in certain environments. Please take care of monitoring the state of\n * the request yourself.\n *\n * @param {String} src\n */\nexport default class ScriptRequest {\n  src: string;\n  script: any;\n  errorScript: any;\n\n  constructor(src: string) {\n    this.src = src;\n  }\n\n  send(receiver: ScriptReceiver) {\n    var self = this;\n    var errorString = 'Error loading ' + self.src;\n\n    self.script = document.createElement('script');\n    self.script.id = receiver.id;\n    self.script.src = self.src;\n    self.script.type = 'text/javascript';\n    self.script.charset = 'UTF-8';\n\n    if (self.script.addEventListener) {\n      self.script.onerror = function() {\n        receiver.callback(errorString);\n      };\n      self.script.onload = function() {\n        receiver.callback(null);\n      };\n    } else {\n      self.script.onreadystatechange = function() {\n        if (\n          self.script.readyState === 'loaded' ||\n          self.script.readyState === 'complete'\n        ) {\n          receiver.callback(null);\n        }\n      };\n    }\n\n    // Opera<11.6 hack for missing onerror callback\n    if (\n      self.script.async === undefined &&\n      (<any>document).attachEvent &&\n      /opera/i.test(navigator.userAgent)\n    ) {\n      self.errorScript = document.createElement('script');\n      self.errorScript.id = receiver.id + '_error';\n      self.errorScript.text = receiver.name + \"('\" + errorString + \"');\";\n      self.script.async = self.errorScript.async = false;\n    } else {\n      self.script.async = true;\n    }\n\n    var head = document.getElementsByTagName('head')[0];\n    head.insertBefore(self.script, head.firstChild);\n    if (self.errorScript) {\n      head.insertBefore(self.errorScript, self.script.nextSibling);\n    }\n  }\n\n  /** Cleans up the DOM remains of the script request. */\n  cleanup() {\n    if (this.script) {\n      this.script.onload = this.script.onerror = null;\n      this.script.onreadystatechange = null;\n    }\n    if (this.script && this.script.parentNode) {\n      this.script.parentNode.removeChild(this.script);\n    }\n    if (this.errorScript && this.errorScript.parentNode) {\n      this.errorScript.parentNode.removeChild(this.errorScript);\n    }\n    this.script = null;\n    this.errorScript = null;\n  }\n}\n","import ScriptReceiver from './script_receiver';\nimport ScriptRequest from './script_request';\nimport * as Collections from 'core/utils/collections';\nimport Util from 'core/util';\nimport Runtime from '../runtime';\n\n/** Sends data via JSONP.\n *\n * Data is a key-value map. Its values are JSON-encoded and then passed\n * through base64. Finally, keys and encoded values are appended to the query\n * string.\n *\n * The class itself does not guarantee raising errors on failures, as it's not\n * possible to support such feature on all browsers. Instead, JSONP endpoint\n * should call back in a way that's easy to distinguish from browser calls,\n * for example by passing a second argument to the receiver.\n *\n * @param {String} url\n * @param {Object} data key-value map of data to be submitted\n */\nexport default class JSONPRequest {\n  url: string;\n  data: any;\n  request: ScriptRequest;\n\n  constructor(url: string, data: any) {\n    this.url = url;\n    this.data = data;\n  }\n\n  /** Sends the actual JSONP request.\n   *\n   * @param {ScriptReceiver} receiver\n   */\n  send(receiver: ScriptReceiver) {\n    if (this.request) {\n      return;\n    }\n\n    var query = Collections.buildQueryString(this.data);\n    var url = this.url + '/' + receiver.number + '?' + query;\n    this.request = Runtime.createScriptRequest(url);\n    this.request.send(receiver);\n  }\n\n  /** Cleans up the DOM remains of the JSONP request. */\n  cleanup() {\n    if (this.request) {\n      this.request.cleanup();\n    }\n  }\n}\n","import TimelineSender from 'core/timeline/timeline_sender';\nimport TimelineTransport from 'core/timeline/timeline_transport';\nimport Browser from 'runtime';\nimport { AuthTransport } from 'core/auth/auth_transports';\nimport { ScriptReceivers } from '../dom/script_receiver_factory';\n\nvar getAgent = function(sender: TimelineSender, useTLS: boolean) {\n  return function(data: any, callback: Function) {\n    var scheme = 'http' + (useTLS ? 's' : '') + '://';\n    var url =\n      scheme + (sender.host || sender.options.host) + sender.options.path;\n    var request = Browser.createJSONPRequest(url, data);\n\n    var receiver = Browser.ScriptReceivers.create(function(error, result) {\n      ScriptReceivers.remove(receiver);\n      request.cleanup();\n\n      if (result && result.host) {\n        sender.host = result.host;\n      }\n      if (callback) {\n        callback(error, result);\n      }\n    });\n    request.send(receiver);\n  };\n};\n\nvar jsonp = {\n  name: 'jsonp',\n  getAgent\n};\n\nexport default jsonp;\n","import Defaults from '../defaults';\nimport { default as URLScheme, URLSchemeParams } from './url_scheme';\n\nfunction getGenericURL(\n  baseScheme: string,\n  params: URLSchemeParams,\n  path: string\n): string {\n  var scheme = baseScheme + (params.useTLS ? 's' : '');\n  var host = params.useTLS ? params.hostTLS : params.hostNonTLS;\n  return scheme + '://' + host + path;\n}\n\nfunction getGenericPath(key: string, queryString?: string): string {\n  var path = '/app/' + key;\n  var query =\n    '?protocol=' +\n    Defaults.PROTOCOL +\n    '&client=js' +\n    '&version=' +\n    Defaults.VERSION +\n    (queryString ? '&' + queryString : '');\n  return path + query;\n}\n\nexport var ws: URLScheme = {\n  getInitial: function(key: string, params: URLSchemeParams): string {\n    var path = (params.httpPath || '') + getGenericPath(key, 'flash=false');\n    return getGenericURL('ws', params, path);\n  }\n};\n\nexport var http: URLScheme = {\n  getInitial: function(key: string, params: URLSchemeParams): string {\n    var path = (params.httpPath || '/pusher') + getGenericPath(key);\n    return getGenericURL('http', params, path);\n  }\n};\n\nexport var sockjs: URLScheme = {\n  getInitial: function(key: string, params: URLSchemeParams): string {\n    return getGenericURL('http', params, params.httpPath || '/pusher');\n  },\n  getPath: function(key: string, params: URLSchemeParams): string {\n    return getGenericPath(key);\n  }\n};\n","import Callback from './callback';\nimport * as Collections from '../utils/collections';\nimport CallbackTable from './callback_table';\n\nexport default class CallbackRegistry {\n  _callbacks: CallbackTable;\n\n  constructor() {\n    this._callbacks = {};\n  }\n\n  get(name: string): Callback[] {\n    return this._callbacks[prefix(name)];\n  }\n\n  add(name: string, callback: Function, context: any) {\n    var prefixedEventName = prefix(name);\n    this._callbacks[prefixedEventName] =\n      this._callbacks[prefixedEventName] || [];\n    this._callbacks[prefixedEventName].push({\n      fn: callback,\n      context: context\n    });\n  }\n\n  remove(name?: string, callback?: Function, context?: any) {\n    if (!name && !callback && !context) {\n      this._callbacks = {};\n      return;\n    }\n\n    var names = name ? [prefix(name)] : Collections.keys(this._callbacks);\n\n    if (callback || context) {\n      this.removeCallback(names, callback, context);\n    } else {\n      this.removeAllCallbacks(names);\n    }\n  }\n\n  private removeCallback(names: string[], callback: Function, context: any) {\n    Collections.apply(\n      names,\n      function(name) {\n        this._callbacks[name] = Collections.filter(\n          this._callbacks[name] || [],\n          function(binding) {\n            return (\n              (callback && callback !== binding.fn) ||\n              (context && context !== binding.context)\n            );\n          }\n        );\n        if (this._callbacks[name].length === 0) {\n          delete this._callbacks[name];\n        }\n      },\n      this\n    );\n  }\n\n  private removeAllCallbacks(names: string[]) {\n    Collections.apply(\n      names,\n      function(name) {\n        delete this._callbacks[name];\n      },\n      this\n    );\n  }\n}\n\nfunction prefix(name: string): string {\n  return '_' + name;\n}\n","import * as Collections from '../utils/collections';\nimport Callback from './callback';\nimport Metadata from '../channels/metadata';\nimport CallbackRegistry from './callback_registry';\n\n/** Manages callback bindings and event emitting.\n *\n * @param Function failThrough called when no listeners are bound to an event\n */\nexport default class Dispatcher {\n  callbacks: CallbackRegistry;\n  global_callbacks: Function[];\n  failThrough: Function;\n\n  constructor(failThrough?: Function) {\n    this.callbacks = new CallbackRegistry();\n    this.global_callbacks = [];\n    this.failThrough = failThrough;\n  }\n\n  bind(eventName: string, callback: Function, context?: any) {\n    this.callbacks.add(eventName, callback, context);\n    return this;\n  }\n\n  bind_global(callback: Function) {\n    this.global_callbacks.push(callback);\n    return this;\n  }\n\n  unbind(eventName?: string, callback?: Function, context?: any) {\n    this.callbacks.remove(eventName, callback, context);\n    return this;\n  }\n\n  unbind_global(callback?: Function) {\n    if (!callback) {\n      this.global_callbacks = [];\n      return this;\n    }\n\n    this.global_callbacks = Collections.filter(\n      this.global_callbacks || [],\n      c => c !== callback\n    );\n\n    return this;\n  }\n\n  unbind_all() {\n    this.unbind();\n    this.unbind_global();\n    return this;\n  }\n\n  emit(eventName: string, data?: any, metadata?: Metadata): Dispatcher {\n    for (var i = 0; i < this.global_callbacks.length; i++) {\n      this.global_callbacks[i](eventName, data);\n    }\n\n    var callbacks = this.callbacks.get(eventName);\n    var args = [];\n\n    if (metadata) {\n      // if there's a metadata argument, we need to call the callback with both\n      // data and metadata regardless of whether data is undefined\n      args.push(data, metadata);\n    } else if (data) {\n      // metadata is undefined, so we only need to call the callback with data\n      // if data exists\n      args.push(data);\n    }\n\n    if (callbacks && callbacks.length > 0) {\n      for (var i = 0; i < callbacks.length; i++) {\n        callbacks[i].fn.apply(callbacks[i].context || global, args);\n      }\n    } else if (this.failThrough) {\n      this.failThrough(eventName, data);\n    }\n\n    return this;\n  }\n}\n","import Util from '../util';\nimport * as Collections from '../utils/collections';\nimport { default as EventsDispatcher } from '../events/dispatcher';\nimport Logger from '../logger';\nimport TransportHooks from './transport_hooks';\nimport Socket from '../socket';\nimport Runtime from 'runtime';\nimport Timeline from '../timeline/timeline';\nimport TransportConnectionOptions from './transport_connection_options';\n\n/** Provides universal API for transport connections.\n *\n * Transport connection is a low-level object that wraps a connection method\n * and exposes a simple evented interface for the connection state and\n * messaging. It does not implement Pusher-specific WebSocket protocol.\n *\n * Additionally, it fetches resources needed for transport to work and exposes\n * an interface for querying transport features.\n *\n * States:\n * - new - initial state after constructing the object\n * - initializing - during initialization phase, usually fetching resources\n * - intialized - ready to establish a connection\n * - connection - when connection is being established\n * - open - when connection ready to be used\n * - closed - after connection was closed be either side\n *\n * Emits:\n * - error - after the connection raised an error\n *\n * Options:\n * - useTLS - whether connection should be over TLS\n * - hostTLS - host to connect to when connection is over TLS\n * - hostNonTLS - host to connect to when connection is over TLS\n *\n * @param {String} key application key\n * @param {Object} options\n */\nexport default class TransportConnection extends EventsDispatcher {\n  hooks: TransportHooks;\n  name: string;\n  priority: number;\n  key: string;\n  options: TransportConnectionOptions;\n  state: string;\n  timeline: Timeline;\n  activityTimeout: number;\n  id: number;\n  socket: Socket;\n  beforeOpen: Function;\n  initialize: Function;\n\n  constructor(\n    hooks: TransportHooks,\n    name: string,\n    priority: number,\n    key: string,\n    options: TransportConnectionOptions\n  ) {\n    super();\n    this.initialize = Runtime.transportConnectionInitializer;\n    this.hooks = hooks;\n    this.name = name;\n    this.priority = priority;\n    this.key = key;\n    this.options = options;\n\n    this.state = 'new';\n    this.timeline = options.timeline;\n    this.activityTimeout = options.activityTimeout;\n    this.id = this.timeline.generateUniqueID();\n  }\n\n  /** Checks whether the transport handles activity checks by itself.\n   *\n   * @return {Boolean}\n   */\n  handlesActivityChecks(): boolean {\n    return Boolean(this.hooks.handlesActivityChecks);\n  }\n\n  /** Checks whether the transport supports the ping/pong API.\n   *\n   * @return {Boolean}\n   */\n  supportsPing(): boolean {\n    return Boolean(this.hooks.supportsPing);\n  }\n\n  /** Tries to establish a connection.\n   *\n   * @returns {Boolean} false if transport is in invalid state\n   */\n  connect(): boolean {\n    if (this.socket || this.state !== 'initialized') {\n      return false;\n    }\n\n    var url = this.hooks.urls.getInitial(this.key, this.options);\n    try {\n      this.socket = this.hooks.getSocket(url, this.options);\n    } catch (e) {\n      Util.defer(() => {\n        this.onError(e);\n        this.changeState('closed');\n      });\n      return false;\n    }\n\n    this.bindListeners();\n\n    Logger.debug('Connecting', { transport: this.name, url });\n    this.changeState('connecting');\n    return true;\n  }\n\n  /** Closes the connection.\n   *\n   * @return {Boolean} true if there was a connection to close\n   */\n  close(): boolean {\n    if (this.socket) {\n      this.socket.close();\n      return true;\n    } else {\n      return false;\n    }\n  }\n\n  /** Sends data over the open connection.\n   *\n   * @param {String} data\n   * @return {Boolean} true only when in the \"open\" state\n   */\n  send(data: any): boolean {\n    if (this.state === 'open') {\n      // Workaround for MobileSafari bug (see https://gist.github.com/2052006)\n      Util.defer(() => {\n        if (this.socket) {\n          this.socket.send(data);\n        }\n      });\n      return true;\n    } else {\n      return false;\n    }\n  }\n\n  /** Sends a ping if the connection is open and transport supports it. */\n  ping() {\n    if (this.state === 'open' && this.supportsPing()) {\n      this.socket.ping();\n    }\n  }\n\n  private onOpen() {\n    if (this.hooks.beforeOpen) {\n      this.hooks.beforeOpen(\n        this.socket,\n        this.hooks.urls.getPath(this.key, this.options)\n      );\n    }\n    this.changeState('open');\n    this.socket.onopen = undefined;\n  }\n\n  private onError(error) {\n    this.emit('error', { type: 'WebSocketError', error: error });\n    this.timeline.error(this.buildTimelineMessage({ error: error.toString() }));\n  }\n\n  private onClose(closeEvent?: any) {\n    if (closeEvent) {\n      this.changeState('closed', {\n        code: closeEvent.code,\n        reason: closeEvent.reason,\n        wasClean: closeEvent.wasClean\n      });\n    } else {\n      this.changeState('closed');\n    }\n    this.unbindListeners();\n    this.socket = undefined;\n  }\n\n  private onMessage(message) {\n    this.emit('message', message);\n  }\n\n  private onActivity() {\n    this.emit('activity');\n  }\n\n  private bindListeners() {\n    this.socket.onopen = () => {\n      this.onOpen();\n    };\n    this.socket.onerror = error => {\n      this.onError(error);\n    };\n    this.socket.onclose = closeEvent => {\n      this.onClose(closeEvent);\n    };\n    this.socket.onmessage = message => {\n      this.onMessage(message);\n    };\n\n    if (this.supportsPing()) {\n      this.socket.onactivity = () => {\n        this.onActivity();\n      };\n    }\n  }\n\n  private unbindListeners() {\n    if (this.socket) {\n      this.socket.onopen = undefined;\n      this.socket.onerror = undefined;\n      this.socket.onclose = undefined;\n      this.socket.onmessage = undefined;\n      if (this.supportsPing()) {\n        this.socket.onactivity = undefined;\n      }\n    }\n  }\n\n  private changeState(state: string, params?: any) {\n    this.state = state;\n    this.timeline.info(\n      this.buildTimelineMessage({\n        state: state,\n        params: params\n      })\n    );\n    this.emit(state, params);\n  }\n\n  buildTimelineMessage(message): any {\n    return Collections.extend({ cid: this.id }, message);\n  }\n}\n","import Factory from '../utils/factory';\nimport TransportHooks from './transport_hooks';\nimport TransportConnection from './transport_connection';\nimport TransportConnectionOptions from './transport_connection_options';\n\n/** Provides interface for transport connection instantiation.\n *\n * Takes transport-specific hooks as the only argument, which allow checking\n * for transport support and creating its connections.\n *\n * Supported hooks: * - file - the name of the file to be fetched during initialization\n * - urls - URL scheme to be used by transport\n * - handlesActivityCheck - true when the transport handles activity checks\n * - supportsPing - true when the transport has a ping/activity API\n * - isSupported - tells whether the transport is supported in the environment\n * - getSocket - creates a WebSocket-compatible transport socket\n *\n * See transports.js for specific implementations.\n *\n * @param {Object} hooks object containing all needed transport hooks\n */\nexport default class Transport {\n  hooks: TransportHooks;\n\n  constructor(hooks: TransportHooks) {\n    this.hooks = hooks;\n  }\n\n  /** Returns whether the transport is supported in the environment.\n   *\n   * @param {Object} envronment te environment details (encryption, settings)\n   * @returns {Boolean} true when the transport is supported\n   */\n  isSupported(environment: any): boolean {\n    return this.hooks.isSupported(environment);\n  }\n\n  /** Creates a transport connection.\n   *\n   * @param {String} name\n   * @param {Number} priority\n   * @param {String} key the application key\n   * @param {Object} options\n   * @returns {TransportConnection}\n   */\n  createConnection(\n    name: string,\n    priority: number,\n    key: string,\n    options: any\n  ): TransportConnection {\n    return new TransportConnection(this.hooks, name, priority, key, options);\n  }\n}\n","import * as URLSchemes from 'core/transports/url_schemes';\nimport URLScheme from 'core/transports/url_scheme';\nimport Transport from 'core/transports/transport';\nimport Util from 'core/util';\nimport * as Collections from 'core/utils/collections';\nimport TransportHooks from 'core/transports/transport_hooks';\nimport TransportsTable from 'core/transports/transports_table';\nimport Runtime from 'runtime';\n\n/** WebSocket transport.\n *\n * Uses native WebSocket implementation, including MozWebSocket supported by\n * earlier Firefox versions.\n */\nvar WSTransport = new Transport(<TransportHooks>{\n  urls: URLSchemes.ws,\n  handlesActivityChecks: false,\n  supportsPing: false,\n\n  isInitialized: function() {\n    return Boolean(Runtime.getWebSocketAPI());\n  },\n  isSupported: function(): boolean {\n    return Boolean(Runtime.getWebSocketAPI());\n  },\n  getSocket: function(url) {\n    return Runtime.createWebSocket(url);\n  }\n});\n\nvar httpConfiguration = {\n  urls: URLSchemes.http,\n  handlesActivityChecks: false,\n  supportsPing: true,\n  isInitialized: function() {\n    return true;\n  }\n};\n\nexport var streamingConfiguration = Collections.extend(\n  {\n    getSocket: function(url) {\n      return Runtime.HTTPFactory.createStreamingSocket(url);\n    }\n  },\n  httpConfiguration\n);\nexport var pollingConfiguration = Collections.extend(\n  {\n    getSocket: function(url) {\n      return Runtime.HTTPFactory.createPollingSocket(url);\n    }\n  },\n  httpConfiguration\n);\n\nvar xhrConfiguration = {\n  isSupported: function(): boolean {\n    return Runtime.isXHRSupported();\n  }\n};\n\n/** HTTP streaming transport using CORS-enabled XMLHttpRequest. */\nvar XHRStreamingTransport = new Transport(\n  <TransportHooks>(\n    Collections.extend({}, streamingConfiguration, xhrConfiguration)\n  )\n);\n\n/** HTTP long-polling transport using CORS-enabled XMLHttpRequest. */\nvar XHRPollingTransport = new Transport(\n  <TransportHooks>Collections.extend({}, pollingConfiguration, xhrConfiguration)\n);\n\nvar Transports: TransportsTable = {\n  ws: WSTransport,\n  xhr_streaming: XHRStreamingTransport,\n  xhr_polling: XHRPollingTransport\n};\n\nexport default Transports;\n","import {\n  default as Transports,\n  streamingConfiguration,\n  pollingConfiguration\n} from 'isomorphic/transports/transports';\nimport Transport from 'core/transports/transport';\nimport TransportHooks from 'core/transports/transport_hooks';\nimport * as URLSchemes from 'core/transports/url_schemes';\nimport Runtime from 'runtime';\nimport { Dependencies } from '../dom/dependencies';\nimport * as Collections from 'core/utils/collections';\n\nvar SockJSTransport = new Transport(<TransportHooks>{\n  file: 'sockjs',\n  urls: URLSchemes.sockjs,\n  handlesActivityChecks: true,\n  supportsPing: false,\n\n  isSupported: function() {\n    return true;\n  },\n  isInitialized: function() {\n    return window.SockJS !== undefined;\n  },\n  getSocket: function(url, options) {\n    return new window.SockJS(url, null, {\n      js_path: Dependencies.getPath('sockjs', {\n        useTLS: options.useTLS\n      }),\n      ignore_null_origin: options.ignoreNullOrigin\n    });\n  },\n  beforeOpen: function(socket, path) {\n    socket.send(\n      JSON.stringify({\n        path: path\n      })\n    );\n  }\n});\n\nvar xdrConfiguration = {\n  isSupported: function(environment): boolean {\n    var yes = Runtime.isXDRSupported(environment.useTLS);\n    return yes;\n  }\n};\n\n/** HTTP streaming transport using XDomainRequest (IE 8,9). */\nvar XDRStreamingTransport = new Transport(\n  <TransportHooks>(\n    Collections.extend({}, streamingConfiguration, xdrConfiguration)\n  )\n);\n\n/** HTTP long-polling transport using XDomainRequest (IE 8,9). */\nvar XDRPollingTransport = new Transport(\n  <TransportHooks>Collections.extend({}, pollingConfiguration, xdrConfiguration)\n);\n\nTransports.xdr_streaming = XDRStreamingTransport;\nTransports.xdr_polling = XDRPollingTransport;\nTransports.sockjs = SockJSTransport;\n\nexport default Transports;\n","import Reachability from 'core/reachability';\nimport { default as EventsDispatcher } from 'core/events/dispatcher';\n\n/** Really basic interface providing network availability info.\n *\n * Emits:\n * - online - when browser goes online\n * - offline - when browser goes offline\n */\nexport class NetInfo extends EventsDispatcher implements Reachability {\n  constructor() {\n    super();\n    var self = this;\n    // This is okay, as IE doesn't support this stuff anyway.\n    if (window.addEventListener !== undefined) {\n      window.addEventListener(\n        'online',\n        function() {\n          self.emit('online');\n        },\n        false\n      );\n      window.addEventListener(\n        'offline',\n        function() {\n          self.emit('offline');\n        },\n        false\n      );\n    }\n  }\n\n  /** Returns whether browser is online or not\n   *\n   * Offline means definitely offline (no connection to router).\n   * Inverse does NOT mean definitely online (only currently supported in Safari\n   * and even there only means the device has a connection to the router).\n   *\n   * @return {Boolean}\n   */\n  isOnline(): boolean {\n    if (window.navigator.onLine === undefined) {\n      return true;\n    } else {\n      return window.navigator.onLine;\n    }\n  }\n}\n\nexport var Network = new NetInfo();\n","import Util from '../util';\nimport * as Collections from '../utils/collections';\nimport TransportManager from './transport_manager';\nimport TransportConnection from './transport_connection';\nimport Transport from './transport';\nimport PingDelayOptions from './ping_delay_options';\n\n/** Creates transport connections monitored by a transport manager.\n *\n * When a transport is closed, it might mean the environment does not support\n * it. It's possible that messages get stuck in an intermediate buffer or\n * proxies terminate inactive connections. To combat these problems,\n * assistants monitor the connection lifetime, report unclean exits and\n * adjust ping timeouts to keep the connection active. The decision to disable\n * a transport is the manager's responsibility.\n *\n * @param {TransportManager} manager\n * @param {TransportConnection} transport\n * @param {Object} options\n */\nexport default class AssistantToTheTransportManager {\n  manager: TransportManager;\n  transport: Transport;\n  minPingDelay: number;\n  maxPingDelay: number;\n  pingDelay: number;\n\n  constructor(\n    manager: TransportManager,\n    transport: Transport,\n    options: PingDelayOptions\n  ) {\n    this.manager = manager;\n    this.transport = transport;\n    this.minPingDelay = options.minPingDelay;\n    this.maxPingDelay = options.maxPingDelay;\n    this.pingDelay = undefined;\n  }\n\n  /** Creates a transport connection.\n   *\n   * This function has the same API as Transport#createConnection.\n   *\n   * @param {String} name\n   * @param {Number} priority\n   * @param {String} key the application key\n   * @param {Object} options\n   * @returns {TransportConnection}\n   */\n  createConnection(\n    name: string,\n    priority: number,\n    key: string,\n    options: Object\n  ): TransportConnection {\n    options = Collections.extend({}, options, {\n      activityTimeout: this.pingDelay\n    });\n    var connection = this.transport.createConnection(\n      name,\n      priority,\n      key,\n      options\n    );\n\n    var openTimestamp = null;\n\n    var onOpen = function() {\n      connection.unbind('open', onOpen);\n      connection.bind('closed', onClosed);\n      openTimestamp = Util.now();\n    };\n    var onClosed = closeEvent => {\n      connection.unbind('closed', onClosed);\n\n      if (closeEvent.code === 1002 || closeEvent.code === 1003) {\n        // we don't want to use transports not obeying the protocol\n        this.manager.reportDeath();\n      } else if (!closeEvent.wasClean && openTimestamp) {\n        // report deaths only for short-living transport\n        var lifespan = Util.now() - openTimestamp;\n        if (lifespan < 2 * this.maxPingDelay) {\n          this.manager.reportDeath();\n          this.pingDelay = Math.max(lifespan / 2, this.minPingDelay);\n        }\n      }\n    };\n\n    connection.bind('open', onOpen);\n    return connection;\n  }\n\n  /** Returns whether the transport is supported in the environment.\n   *\n   * This function has the same API as Transport#isSupported. Might return false\n   * when the manager decides to kill the transport.\n   *\n   * @param {Object} environment the environment details (encryption, settings)\n   * @returns {Boolean} true when the transport is supported\n   */\n  isSupported(environment: string): boolean {\n    return this.manager.isAlive() && this.transport.isSupported(environment);\n  }\n}\n","import Action from './action';\nimport { PusherEvent } from './message-types';\n/**\n * Provides functions for handling Pusher protocol-specific messages.\n */\n\nconst Protocol = {\n  /**\n   * Decodes a message in a Pusher format.\n   *\n   * The MessageEvent we receive from the transport should contain a pusher event\n   * (https://pusher.com/docs/pusher_protocol#events) serialized as JSON in the\n   * data field\n   *\n   * The pusher event may contain a data field too, and it may also be\n   * serialised as JSON\n   *\n   * Throws errors when messages are not parse'able.\n   *\n   * @param  {MessageEvent} messageEvent\n   * @return {PusherEvent}\n   */\n  decodeMessage: function(messageEvent: MessageEvent): PusherEvent {\n    try {\n      var messageData = JSON.parse(messageEvent.data);\n      var pusherEventData = messageData.data;\n      if (typeof pusherEventData === 'string') {\n        try {\n          pusherEventData = JSON.parse(messageData.data);\n        } catch (e) {}\n      }\n      var pusherEvent: PusherEvent = {\n        event: messageData.event,\n        channel: messageData.channel,\n        data: pusherEventData\n      };\n      if (messageData.user_id) {\n        pusherEvent.user_id = messageData.user_id;\n      }\n      return pusherEvent;\n    } catch (e) {\n      throw { type: 'MessageParseError', error: e, data: messageEvent.data };\n    }\n  },\n\n  /**\n   * Encodes a message to be sent.\n   *\n   * @param  {PusherEvent} event\n   * @return {String}\n   */\n  encodeMessage: function(event: PusherEvent): string {\n    return JSON.stringify(event);\n  },\n\n  /**\n   * Processes a handshake message and returns appropriate actions.\n   *\n   * Returns an object with an 'action' and other action-specific properties.\n   *\n   * There are three outcomes when calling this function. First is a successful\n   * connection attempt, when pusher:connection_established is received, which\n   * results in a 'connected' action with an 'id' property. When passed a\n   * pusher:error event, it returns a result with action appropriate to the\n   * close code and an error. Otherwise, it raises an exception.\n   *\n   * @param {String} message\n   * @result Object\n   */\n  processHandshake: function(messageEvent: MessageEvent): Action {\n    var message = Protocol.decodeMessage(messageEvent);\n\n    if (message.event === 'pusher:connection_established') {\n      if (!message.data.activity_timeout) {\n        throw 'No activity timeout specified in handshake';\n      }\n      return {\n        action: 'connected',\n        id: message.data.socket_id,\n        activityTimeout: message.data.activity_timeout * 1000\n      };\n    } else if (message.event === 'pusher:error') {\n      // From protocol 6 close codes are sent only once, so this only\n      // happens when connection does not support close codes\n      return {\n        action: this.getCloseAction(message.data),\n        error: this.getCloseError(message.data)\n      };\n    } else {\n      throw 'Invalid handshake';\n    }\n  },\n\n  /**\n   * Dispatches the close event and returns an appropriate action name.\n   *\n   * See:\n   * 1. https://developer.mozilla.org/en-US/docs/WebSockets/WebSockets_reference/CloseEvent\n   * 2. http://pusher.com/docs/pusher_protocol\n   *\n   * @param  {CloseEvent} closeEvent\n   * @return {String} close action name\n   */\n  getCloseAction: function(closeEvent): string {\n    if (closeEvent.code < 4000) {\n      // ignore 1000 CLOSE_NORMAL, 1001 CLOSE_GOING_AWAY,\n      //        1005 CLOSE_NO_STATUS, 1006 CLOSE_ABNORMAL\n      // ignore 1007...3999\n      // handle 1002 CLOSE_PROTOCOL_ERROR, 1003 CLOSE_UNSUPPORTED,\n      //        1004 CLOSE_TOO_LARGE\n      if (closeEvent.code >= 1002 && closeEvent.code <= 1004) {\n        return 'backoff';\n      } else {\n        return null;\n      }\n    } else if (closeEvent.code === 4000) {\n      return 'tls_only';\n    } else if (closeEvent.code < 4100) {\n      return 'refused';\n    } else if (closeEvent.code < 4200) {\n      return 'backoff';\n    } else if (closeEvent.code < 4300) {\n      return 'retry';\n    } else {\n      // unknown error\n      return 'refused';\n    }\n  },\n\n  /**\n   * Returns an error or null basing on the close event.\n   *\n   * Null is returned when connection was closed cleanly. Otherwise, an object\n   * with error details is returned.\n   *\n   * @param  {CloseEvent} closeEvent\n   * @return {Object} error object\n   */\n  getCloseError: function(closeEvent): any {\n    if (closeEvent.code !== 1000 && closeEvent.code !== 1001) {\n      return {\n        type: 'PusherError',\n        data: {\n          code: closeEvent.code,\n          message: closeEvent.reason || closeEvent.message\n        }\n      };\n    } else {\n      return null;\n    }\n  }\n};\n\nexport default Protocol;\n","import * as Collections from '../utils/collections';\nimport { default as EventsDispatcher } from '../events/dispatcher';\nimport Protocol from './protocol/protocol';\nimport { PusherEvent } from './protocol/message-types';\nimport Logger from '../logger';\nimport TransportConnection from '../transports/transport_connection';\nimport Socket from '../socket';\n/**\n * Provides Pusher protocol interface for transports.\n *\n * Emits following events:\n * - message - on received messages\n * - ping - on ping requests\n * - pong - on pong responses\n * - error - when the transport emits an error\n * - closed - after closing the transport\n *\n * It also emits more events when connection closes with a code.\n * See Protocol.getCloseAction to get more details.\n *\n * @param {Number} id\n * @param {AbstractTransport} transport\n */\nexport default class Connection extends EventsDispatcher implements Socket {\n  id: string;\n  transport: TransportConnection;\n  activityTimeout: number;\n\n  constructor(id: string, transport: TransportConnection) {\n    super();\n    this.id = id;\n    this.transport = transport;\n    this.activityTimeout = transport.activityTimeout;\n    this.bindListeners();\n  }\n\n  /** Returns whether used transport handles activity checks by itself\n   *\n   * @returns {Boolean} true if activity checks are handled by the transport\n   */\n  handlesActivityChecks() {\n    return this.transport.handlesActivityChecks();\n  }\n\n  /** Sends raw data.\n   *\n   * @param {String} data\n   */\n  send(data: any): boolean {\n    return this.transport.send(data);\n  }\n\n  /** Sends an event.\n   *\n   * @param {String} name\n   * @param {String} data\n   * @param {String} [channel]\n   * @returns {Boolean} whether message was sent or not\n   */\n  send_event(name: string, data: any, channel?: string): boolean {\n    var event: PusherEvent = { event: name, data: data };\n    if (channel) {\n      event.channel = channel;\n    }\n    Logger.debug('Event sent', event);\n    return this.send(Protocol.encodeMessage(event));\n  }\n\n  /** Sends a ping message to the server.\n   *\n   * Basing on the underlying transport, it might send either transport's\n   * protocol-specific ping or pusher:ping event.\n   */\n  ping() {\n    if (this.transport.supportsPing()) {\n      this.transport.ping();\n    } else {\n      this.send_event('pusher:ping', {});\n    }\n  }\n\n  /** Closes the connection. */\n  close() {\n    this.transport.close();\n  }\n\n  private bindListeners() {\n    var listeners = {\n      message: (messageEvent: MessageEvent) => {\n        var pusherEvent;\n        try {\n          pusherEvent = Protocol.decodeMessage(messageEvent);\n        } catch (e) {\n          this.emit('error', {\n            type: 'MessageParseError',\n            error: e,\n            data: messageEvent.data\n          });\n        }\n\n        if (pusherEvent !== undefined) {\n          Logger.debug('Event recd', pusherEvent);\n\n          switch (pusherEvent.event) {\n            case 'pusher:error':\n              this.emit('error', {\n                type: 'PusherError',\n                data: pusherEvent.data\n              });\n              break;\n            case 'pusher:ping':\n              this.emit('ping');\n              break;\n            case 'pusher:pong':\n              this.emit('pong');\n              break;\n          }\n          this.emit('message', pusherEvent);\n        }\n      },\n      activity: () => {\n        this.emit('activity');\n      },\n      error: error => {\n        this.emit('error', error);\n      },\n      closed: closeEvent => {\n        unbindListeners();\n\n        if (closeEvent && closeEvent.code) {\n          this.handleCloseEvent(closeEvent);\n        }\n\n        this.transport = null;\n        this.emit('closed');\n      }\n    };\n\n    var unbindListeners = () => {\n      Collections.objectApply(listeners, (listener, event) => {\n        this.transport.unbind(event, listener);\n      });\n    };\n\n    Collections.objectApply(listeners, (listener, event) => {\n      this.transport.bind(event, listener);\n    });\n  }\n\n  private handleCloseEvent(closeEvent: any) {\n    var action = Protocol.getCloseAction(closeEvent);\n    var error = Protocol.getCloseError(closeEvent);\n    if (error) {\n      this.emit('error', error);\n    }\n    if (action) {\n      this.emit(action, { action: action, error: error });\n    }\n  }\n}\n","import Util from '../../util';\nimport * as Collections from '../../utils/collections';\nimport Protocol from '../protocol/protocol';\nimport Connection from '../connection';\nimport TransportConnection from '../../transports/transport_connection';\nimport HandshakePayload from './handshake_payload';\n\n/**\n * Handles Pusher protocol handshakes for transports.\n *\n * Calls back with a result object after handshake is completed. Results\n * always have two fields:\n * - action - string describing action to be taken after the handshake\n * - transport - the transport object passed to the constructor\n *\n * Different actions can set different additional properties on the result.\n * In the case of 'connected' action, there will be a 'connection' property\n * containing a Connection object for the transport. Other actions should\n * carry an 'error' property.\n *\n * @param {AbstractTransport} transport\n * @param {Function} callback\n */\nexport default class Handshake {\n  transport: TransportConnection;\n  callback: (HandshakePayload) => void;\n  onMessage: Function;\n  onClosed: Function;\n\n  constructor(\n    transport: TransportConnection,\n    callback: (HandshakePayload) => void\n  ) {\n    this.transport = transport;\n    this.callback = callback;\n    this.bindListeners();\n  }\n\n  close() {\n    this.unbindListeners();\n    this.transport.close();\n  }\n\n  private bindListeners() {\n    this.onMessage = m => {\n      this.unbindListeners();\n\n      var result;\n      try {\n        result = Protocol.processHandshake(m);\n      } catch (e) {\n        this.finish('error', { error: e });\n        this.transport.close();\n        return;\n      }\n\n      if (result.action === 'connected') {\n        this.finish('connected', {\n          connection: new Connection(result.id, this.transport),\n          activityTimeout: result.activityTimeout\n        });\n      } else {\n        this.finish(result.action, { error: result.error });\n        this.transport.close();\n      }\n    };\n\n    this.onClosed = closeEvent => {\n      this.unbindListeners();\n\n      var action = Protocol.getCloseAction(closeEvent) || 'backoff';\n      var error = Protocol.getCloseError(closeEvent);\n      this.finish(action, { error: error });\n    };\n\n    this.transport.bind('message', this.onMessage);\n    this.transport.bind('closed', this.onClosed);\n  }\n\n  private unbindListeners() {\n    this.transport.unbind('message', this.onMessage);\n    this.transport.unbind('closed', this.onClosed);\n  }\n\n  private finish(action: string, params: any) {\n    this.callback(\n      Collections.extend({ transport: this.transport, action: action }, params)\n    );\n  }\n}\n","import * as Collections from '../utils/collections';\nimport Util from '../util';\nimport base64encode from '../base64';\nimport Timeline from './timeline';\nimport Runtime from 'runtime';\n\nexport interface TimelineSenderOptions {\n  host?: string;\n  port?: number;\n  path?: string;\n}\n\nexport default class TimelineSender {\n  timeline: Timeline;\n  options: TimelineSenderOptions;\n  host: string;\n\n  constructor(timeline: Timeline, options: TimelineSenderOptions) {\n    this.timeline = timeline;\n    this.options = options || {};\n  }\n\n  send(useTLS: boolean, callback?: Function) {\n    if (this.timeline.isEmpty()) {\n      return;\n    }\n\n    this.timeline.send(\n      Runtime.TimelineTransport.getAgent(this, useTLS),\n      callback\n    );\n  }\n}\n","import { default as EventsDispatcher } from '../events/dispatcher';\nimport * as Errors from '../errors';\nimport Logger from '../logger';\nimport Pusher from '../pusher';\nimport { PusherEvent } from '../connection/protocol/message-types';\nimport Metadata from './metadata';\nimport UrlStore from '../utils/url_store';\nimport {\n  ChannelAuthorizationData,\n  ChannelAuthorizationCallback\n} from '../auth/options';\nimport { HTTPAuthError } from '../errors';\n\n/** Provides base public channel interface with an event emitter.\n *\n * Emits:\n * - pusher:subscription_succeeded - after subscribing successfully\n * - other non-internal events\n *\n * @param {String} name\n * @param {Pusher} pusher\n */\nexport default class Channel extends EventsDispatcher {\n  name: string;\n  pusher: Pusher;\n  subscribed: boolean;\n  subscriptionPending: boolean;\n  subscriptionCancelled: boolean;\n  subscriptionCount: null;\n\n  constructor(name: string, pusher: Pusher) {\n    super(function(event, data) {\n      Logger.debug('No callbacks on ' + name + ' for ' + event);\n    });\n\n    this.name = name;\n    this.pusher = pusher;\n    this.subscribed = false;\n    this.subscriptionPending = false;\n    this.subscriptionCancelled = false;\n  }\n\n  /** Skips authorization, since public channels don't require it.\n   *\n   * @param {Function} callback\n   */\n  authorize(socketId: string, callback: ChannelAuthorizationCallback) {\n    return callback(null, { auth: '' });\n  }\n\n  /** Triggers an event */\n  trigger(event: string, data: any) {\n    if (event.indexOf('client-') !== 0) {\n      throw new Errors.BadEventName(\n        \"Event '\" + event + \"' does not start with 'client-'\"\n      );\n    }\n    if (!this.subscribed) {\n      var suffix = UrlStore.buildLogSuffix('triggeringClientEvents');\n      Logger.warn(\n        `Client event triggered before channel 'subscription_succeeded' event . ${suffix}`\n      );\n    }\n    return this.pusher.send_event(event, data, this.name);\n  }\n\n  /** Signals disconnection to the channel. For internal use only. */\n  disconnect() {\n    this.subscribed = false;\n    this.subscriptionPending = false;\n  }\n\n  /** Handles a PusherEvent. For internal use only.\n   *\n   * @param {PusherEvent} event\n   */\n  handleEvent(event: PusherEvent) {\n    var eventName = event.event;\n    var data = event.data;\n    if (eventName === 'pusher_internal:subscription_succeeded') {\n      this.handleSubscriptionSucceededEvent(event);\n    } else if (eventName === 'pusher_internal:subscription_count') {\n      this.handleSubscriptionCountEvent(event);\n    } else if (eventName.indexOf('pusher_internal:') !== 0) {\n      var metadata: Metadata = {};\n      this.emit(eventName, data, metadata);\n    }\n  }\n\n  handleSubscriptionSucceededEvent(event: PusherEvent) {\n    this.subscriptionPending = false;\n    this.subscribed = true;\n    if (this.subscriptionCancelled) {\n      this.pusher.unsubscribe(this.name);\n    } else {\n      this.emit('pusher:subscription_succeeded', event.data);\n    }\n  }\n\n  handleSubscriptionCountEvent(event: PusherEvent) {\n    if (event.data.subscription_count) {\n      this.subscriptionCount = event.data.subscription_count;\n    }\n\n    this.emit('pusher:subscription_count', event.data);\n  }\n\n  /** Sends a subscription request. For internal use only. */\n  subscribe() {\n    if (this.subscribed) {\n      return;\n    }\n    this.subscriptionPending = true;\n    this.subscriptionCancelled = false;\n    this.authorize(\n      this.pusher.connection.socket_id,\n      (error: Error | null, data: ChannelAuthorizationData) => {\n        if (error) {\n          this.subscriptionPending = false;\n          // Why not bind to 'pusher:subscription_error' a level up, and log there?\n          // Binding to this event would cause the warning about no callbacks being\n          // bound (see constructor) to be suppressed, that's not what we want.\n          Logger.error(error.toString());\n          this.emit(\n            'pusher:subscription_error',\n            Object.assign(\n              {},\n              {\n                type: 'AuthError',\n                error: error.message\n              },\n              error instanceof HTTPAuthError ? { status: error.status } : {}\n            )\n          );\n        } else {\n          this.pusher.send_event('pusher:subscribe', {\n            auth: data.auth,\n            channel_data: data.channel_data,\n            channel: this.name\n          });\n        }\n      }\n    );\n  }\n\n  /** Sends an unsubscription request. For internal use only. */\n  unsubscribe() {\n    this.subscribed = false;\n    this.pusher.send_event('pusher:unsubscribe', {\n      channel: this.name\n    });\n  }\n\n  /** Cancels an in progress subscription. For internal use only. */\n  cancelSubscription() {\n    this.subscriptionCancelled = true;\n  }\n\n  /** Reinstates an in progress subscripiton. For internal use only. */\n  reinstateSubscription() {\n    this.subscriptionCancelled = false;\n  }\n}\n","import Factory from '../utils/factory';\nimport Channel from './channel';\nimport { ChannelAuthorizationCallback } from '../auth/options';\n\n/** Extends public channels to provide private channel interface.\n *\n * @param {String} name\n * @param {Pusher} pusher\n */\nexport default class PrivateChannel extends Channel {\n  /** Authorizes the connection to use the channel.\n   *\n   * @param  {String} socketId\n   * @param  {Function} callback\n   */\n  authorize(socketId: string, callback: ChannelAuthorizationCallback) {\n    return this.pusher.config.channelAuthorizer(\n      {\n        channelName: this.name,\n        socketId: socketId\n      },\n      callback\n    );\n  }\n}\n","import * as Collections from '../utils/collections';\n\n/** Represents a collection of members of a presence channel. */\nexport default class Members {\n  members: any;\n  count: number;\n  myID: any;\n  me: any;\n\n  constructor() {\n    this.reset();\n  }\n\n  /** Returns member's info for given id.\n   *\n   * Resulting object containts two fields - id and info.\n   *\n   * @param {Number} id\n   * @return {Object} member's info or null\n   */\n  get(id: string): any {\n    if (Object.prototype.hasOwnProperty.call(this.members, id)) {\n      return {\n        id: id,\n        info: this.members[id]\n      };\n    } else {\n      return null;\n    }\n  }\n\n  /** Calls back for each member in unspecified order.\n   *\n   * @param  {Function} callback\n   */\n  each(callback: Function) {\n    Collections.objectApply(this.members, (member, id) => {\n      callback(this.get(id));\n    });\n  }\n\n  /** Updates the id for connected member. For internal use only. */\n  setMyID(id: string) {\n    this.myID = id;\n  }\n\n  /** Handles subscription data. For internal use only. */\n  onSubscription(subscriptionData: any) {\n    this.members = subscriptionData.presence.hash;\n    this.count = subscriptionData.presence.count;\n    this.me = this.get(this.myID);\n  }\n\n  /** Adds a new member to the collection. For internal use only. */\n  addMember(memberData: any) {\n    if (this.get(memberData.user_id) === null) {\n      this.count++;\n    }\n    this.members[memberData.user_id] = memberData.user_info;\n    return this.get(memberData.user_id);\n  }\n\n  /** Adds a member from the collection. For internal use only. */\n  removeMember(memberData: any) {\n    var member = this.get(memberData.user_id);\n    if (member) {\n      delete this.members[memberData.user_id];\n      this.count--;\n    }\n    return member;\n  }\n\n  /** Resets the collection to the initial state. For internal use only. */\n  reset() {\n    this.members = {};\n    this.count = 0;\n    this.myID = null;\n    this.me = null;\n  }\n}\n","import PrivateChannel from './private_channel';\nimport Logger from '../logger';\nimport Members from './members';\nimport Pusher from '../pusher';\nimport UrlStore from 'core/utils/url_store';\nimport { PusherEvent } from '../connection/protocol/message-types';\nimport Metadata from './metadata';\nimport { ChannelAuthorizationData } from '../auth/options';\n\nexport default class PresenceChannel extends PrivateChannel {\n  members: Members;\n\n  /** Adds presence channel functionality to private channels.\n   *\n   * @param {String} name\n   * @param {Pusher} pusher\n   */\n  constructor(name: string, pusher: Pusher) {\n    super(name, pusher);\n    this.members = new Members();\n  }\n\n  /** Authorizes the connection as a member of the channel.\n   *\n   * @param  {String} socketId\n   * @param  {Function} callback\n   */\n  authorize(socketId: string, callback: Function) {\n    super.authorize(socketId, async (error, authData) => {\n      if (!error) {\n        authData = authData as ChannelAuthorizationData;\n        if (authData.channel_data != null) {\n          var channelData = JSON.parse(authData.channel_data);\n          this.members.setMyID(channelData.user_id);\n        } else {\n          await this.pusher.user.signinDonePromise;\n          if (this.pusher.user.user_data != null) {\n            // If the user is signed in, get the id of the authenticated user\n            // and allow the presence authorization to continue.\n            this.members.setMyID(this.pusher.user.user_data.id);\n          } else {\n            let suffix = UrlStore.buildLogSuffix('authorizationEndpoint');\n            Logger.error(\n              `Invalid auth response for channel '${this.name}', ` +\n                `expected 'channel_data' field. ${suffix}, ` +\n                `or the user should be signed in.`\n            );\n            callback('Invalid auth response');\n            return;\n          }\n        }\n      }\n      callback(error, authData);\n    });\n  }\n\n  /** Handles presence and subscription events. For internal use only.\n   *\n   * @param {PusherEvent} event\n   */\n  handleEvent(event: PusherEvent) {\n    var eventName = event.event;\n    if (eventName.indexOf('pusher_internal:') === 0) {\n      this.handleInternalEvent(event);\n    } else {\n      var data = event.data;\n      var metadata: Metadata = {};\n      if (event.user_id) {\n        metadata.user_id = event.user_id;\n      }\n      this.emit(eventName, data, metadata);\n    }\n  }\n  handleInternalEvent(event: PusherEvent) {\n    var eventName = event.event;\n    var data = event.data;\n    switch (eventName) {\n      case 'pusher_internal:subscription_succeeded':\n        this.handleSubscriptionSucceededEvent(event);\n        break;\n      case 'pusher_internal:subscription_count':\n        this.handleSubscriptionCountEvent(event);\n        break;\n      case 'pusher_internal:member_added':\n        var addedMember = this.members.addMember(data);\n        this.emit('pusher:member_added', addedMember);\n        break;\n      case 'pusher_internal:member_removed':\n        var removedMember = this.members.removeMember(data);\n        if (removedMember) {\n          this.emit('pusher:member_removed', removedMember);\n        }\n        break;\n    }\n  }\n\n  handleSubscriptionSucceededEvent(event: PusherEvent) {\n    this.subscriptionPending = false;\n    this.subscribed = true;\n    if (this.subscriptionCancelled) {\n      this.pusher.unsubscribe(this.name);\n    } else {\n      this.members.onSubscription(event.data);\n      this.emit('pusher:subscription_succeeded', this.members);\n    }\n  }\n\n  /** Resets the channel state, including members map. For internal use only. */\n  disconnect() {\n    this.members.reset();\n    super.disconnect();\n  }\n}\n","import PrivateChannel from './private_channel';\nimport * as Errors from '../errors';\nimport Logger from '../logger';\nimport Pusher from '../pusher';\nimport { decode as encodeUTF8 } from '@stablelib/utf8';\nimport { decode as decodeBase64 } from '@stablelib/base64';\nimport Dispatcher from '../events/dispatcher';\nimport { PusherEvent } from '../connection/protocol/message-types';\nimport {\n  ChannelAuthorizationData,\n  ChannelAuthorizationCallback\n} from '../auth/options';\nimport * as nacl from 'tweetnacl';\n\n/** Extends private channels to provide encrypted channel interface.\n *\n * @param {String} name\n * @param {Pusher} pusher\n */\nexport default class EncryptedChannel extends PrivateChannel {\n  key: Uint8Array = null;\n  nacl: nacl;\n\n  constructor(name: string, pusher: Pusher, nacl: nacl) {\n    super(name, pusher);\n    this.nacl = nacl;\n  }\n\n  /** Authorizes the connection to use the channel.\n   *\n   * @param  {String} socketId\n   * @param  {Function} callback\n   */\n  authorize(socketId: string, callback: ChannelAuthorizationCallback) {\n    super.authorize(\n      socketId,\n      (error: Error | null, authData: ChannelAuthorizationData) => {\n        if (error) {\n          callback(error, authData);\n          return;\n        }\n        let sharedSecret = authData['shared_secret'];\n        if (!sharedSecret) {\n          callback(\n            new Error(\n              `No shared_secret key in auth payload for encrypted channel: ${this.name}`\n            ),\n            null\n          );\n          return;\n        }\n        this.key = decodeBase64(sharedSecret);\n        delete authData['shared_secret'];\n        callback(null, authData);\n      }\n    );\n  }\n\n  trigger(event: string, data: any): boolean {\n    throw new Errors.UnsupportedFeature(\n      'Client events are not currently supported for encrypted channels'\n    );\n  }\n\n  /** Handles an event. For internal use only.\n   *\n   * @param {PusherEvent} event\n   */\n  handleEvent(event: PusherEvent) {\n    var eventName = event.event;\n    var data = event.data;\n    if (\n      eventName.indexOf('pusher_internal:') === 0 ||\n      eventName.indexOf('pusher:') === 0\n    ) {\n      super.handleEvent(event);\n      return;\n    }\n    this.handleEncryptedEvent(eventName, data);\n  }\n\n  private handleEncryptedEvent(event: string, data: any): void {\n    if (!this.key) {\n      Logger.debug(\n        'Received encrypted event before key has been retrieved from the authEndpoint'\n      );\n      return;\n    }\n    if (!data.ciphertext || !data.nonce) {\n      Logger.error(\n        'Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: ' +\n          data\n      );\n      return;\n    }\n    let cipherText = decodeBase64(data.ciphertext);\n    if (cipherText.length < this.nacl.secretbox.overheadLength) {\n      Logger.error(\n        `Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${cipherText.length}`\n      );\n      return;\n    }\n    let nonce = decodeBase64(data.nonce);\n    if (nonce.length < this.nacl.secretbox.nonceLength) {\n      Logger.error(\n        `Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${nonce.length}`\n      );\n      return;\n    }\n\n    let bytes = this.nacl.secretbox.open(cipherText, nonce, this.key);\n    if (bytes === null) {\n      Logger.debug(\n        'Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint...'\n      );\n      // Try a single time to retrieve a new auth key and decrypt the event with it\n      // If this fails, a new key will be requested when a new message is received\n      this.authorize(this.pusher.connection.socket_id, (error, authData) => {\n        if (error) {\n          Logger.error(\n            `Failed to make a request to the authEndpoint: ${authData}. Unable to fetch new key, so dropping encrypted event`\n          );\n          return;\n        }\n        bytes = this.nacl.secretbox.open(cipherText, nonce, this.key);\n        if (bytes === null) {\n          Logger.error(\n            `Failed to decrypt event with new key. Dropping encrypted event`\n          );\n          return;\n        }\n        this.emit(event, this.getDataToEmit(bytes));\n        return;\n      });\n      return;\n    }\n    this.emit(event, this.getDataToEmit(bytes));\n  }\n\n  // Try and parse the decrypted bytes as JSON. If we can't parse it, just\n  // return the utf-8 string\n  getDataToEmit(bytes: Uint8Array): string {\n    let raw = encodeUTF8(bytes);\n    try {\n      return JSON.parse(raw);\n    } catch {\n      return raw;\n    }\n  }\n}\n","import { default as EventsDispatcher } from '../events/dispatcher';\nimport { OneOffTimer as Timer } from '../utils/timers';\nimport { Config } from '../config';\nimport Logger from '../logger';\nimport HandshakePayload from './handshake/handshake_payload';\nimport Connection from './connection';\nimport Strategy from '../strategies/strategy';\nimport StrategyRunner from '../strategies/strategy_runner';\nimport * as Collections from '../utils/collections';\nimport Timeline from '../timeline/timeline';\nimport ConnectionManagerOptions from './connection_manager_options';\nimport Runtime from 'runtime';\n\nimport {\n  ErrorCallbacks,\n  HandshakeCallbacks,\n  ConnectionCallbacks\n} from './callbacks';\nimport Action from './protocol/action';\n\n/** Manages connection to Pusher.\n *\n * Uses a strategy (currently only default), timers and network availability\n * info to establish a connection and export its state. In case of failures,\n * manages reconnection attempts.\n *\n * Exports state changes as following events:\n * - \"state_change\", { previous: p, current: state }\n * - state\n *\n * States:\n * - initialized - initial state, never transitioned to\n * - connecting - connection is being established\n * - connected - connection has been fully established\n * - disconnected - on requested disconnection\n * - unavailable - after connection timeout or when there's no network\n * - failed - when the connection strategy is not supported\n *\n * Options:\n * - unavailableTimeout - time to transition to unavailable state\n * - activityTimeout - time after which ping message should be sent\n * - pongTimeout - time for Pusher to respond with pong before reconnecting\n *\n * @param {String} key application key\n * @param {Object} options\n */\nexport default class ConnectionManager extends EventsDispatcher {\n  key: string;\n  options: ConnectionManagerOptions;\n  state: string;\n  connection: Connection;\n  usingTLS: boolean;\n  timeline: Timeline;\n  socket_id: string;\n  unavailableTimer: Timer;\n  activityTimer: Timer;\n  retryTimer: Timer;\n  activityTimeout: number;\n  strategy: Strategy;\n  runner: StrategyRunner;\n  errorCallbacks: ErrorCallbacks;\n  handshakeCallbacks: HandshakeCallbacks;\n  connectionCallbacks: ConnectionCallbacks;\n\n  constructor(key: string, options: ConnectionManagerOptions) {\n    super();\n    this.state = 'initialized';\n    this.connection = null;\n\n    this.key = key;\n    this.options = options;\n    this.timeline = this.options.timeline;\n    this.usingTLS = this.options.useTLS;\n\n    this.errorCallbacks = this.buildErrorCallbacks();\n    this.connectionCallbacks = this.buildConnectionCallbacks(\n      this.errorCallbacks\n    );\n    this.handshakeCallbacks = this.buildHandshakeCallbacks(this.errorCallbacks);\n\n    var Network = Runtime.getNetwork();\n\n    Network.bind('online', () => {\n      this.timeline.info({ netinfo: 'online' });\n      if (this.state === 'connecting' || this.state === 'unavailable') {\n        this.retryIn(0);\n      }\n    });\n    Network.bind('offline', () => {\n      this.timeline.info({ netinfo: 'offline' });\n      if (this.connection) {\n        this.sendActivityCheck();\n      }\n    });\n\n    this.updateStrategy();\n  }\n\n  /** Establishes a connection to Pusher.\n   *\n   * Does nothing when connection is already established. See top-level doc\n   * to find events emitted on connection attempts.\n   */\n  connect() {\n    if (this.connection || this.runner) {\n      return;\n    }\n    if (!this.strategy.isSupported()) {\n      this.updateState('failed');\n      return;\n    }\n    this.updateState('connecting');\n    this.startConnecting();\n    this.setUnavailableTimer();\n  }\n\n  /** Sends raw data.\n   *\n   * @param {String} data\n   */\n  send(data) {\n    if (this.connection) {\n      return this.connection.send(data);\n    } else {\n      return false;\n    }\n  }\n\n  /** Sends an event.\n   *\n   * @param {String} name\n   * @param {String} data\n   * @param {String} [channel]\n   * @returns {Boolean} whether message was sent or not\n   */\n  send_event(name: string, data: any, channel?: string) {\n    if (this.connection) {\n      return this.connection.send_event(name, data, channel);\n    } else {\n      return false;\n    }\n  }\n\n  /** Closes the connection. */\n  disconnect() {\n    this.disconnectInternally();\n    this.updateState('disconnected');\n  }\n\n  isUsingTLS() {\n    return this.usingTLS;\n  }\n\n  private startConnecting() {\n    var callback = (error, handshake) => {\n      if (error) {\n        this.runner = this.strategy.connect(0, callback);\n      } else {\n        if (handshake.action === 'error') {\n          this.emit('error', {\n            type: 'HandshakeError',\n            error: handshake.error\n          });\n          this.timeline.error({ handshakeError: handshake.error });\n        } else {\n          this.abortConnecting(); // we don't support switching connections yet\n          this.handshakeCallbacks[handshake.action](handshake);\n        }\n      }\n    };\n    this.runner = this.strategy.connect(0, callback);\n  }\n\n  private abortConnecting() {\n    if (this.runner) {\n      this.runner.abort();\n      this.runner = null;\n    }\n  }\n\n  private disconnectInternally() {\n    this.abortConnecting();\n    this.clearRetryTimer();\n    this.clearUnavailableTimer();\n    if (this.connection) {\n      var connection = this.abandonConnection();\n      connection.close();\n    }\n  }\n\n  private updateStrategy() {\n    this.strategy = this.options.getStrategy({\n      key: this.key,\n      timeline: this.timeline,\n      useTLS: this.usingTLS\n    });\n  }\n\n  private retryIn(delay) {\n    this.timeline.info({ action: 'retry', delay: delay });\n    if (delay > 0) {\n      this.emit('connecting_in', Math.round(delay / 1000));\n    }\n    this.retryTimer = new Timer(delay || 0, () => {\n      this.disconnectInternally();\n      this.connect();\n    });\n  }\n\n  private clearRetryTimer() {\n    if (this.retryTimer) {\n      this.retryTimer.ensureAborted();\n      this.retryTimer = null;\n    }\n  }\n\n  private setUnavailableTimer() {\n    this.unavailableTimer = new Timer(this.options.unavailableTimeout, () => {\n      this.updateState('unavailable');\n    });\n  }\n\n  private clearUnavailableTimer() {\n    if (this.unavailableTimer) {\n      this.unavailableTimer.ensureAborted();\n    }\n  }\n\n  private sendActivityCheck() {\n    this.stopActivityCheck();\n    this.connection.ping();\n    // wait for pong response\n    this.activityTimer = new Timer(this.options.pongTimeout, () => {\n      this.timeline.error({ pong_timed_out: this.options.pongTimeout });\n      this.retryIn(0);\n    });\n  }\n\n  private resetActivityCheck() {\n    this.stopActivityCheck();\n    // send ping after inactivity\n    if (this.connection && !this.connection.handlesActivityChecks()) {\n      this.activityTimer = new Timer(this.activityTimeout, () => {\n        this.sendActivityCheck();\n      });\n    }\n  }\n\n  private stopActivityCheck() {\n    if (this.activityTimer) {\n      this.activityTimer.ensureAborted();\n    }\n  }\n\n  private buildConnectionCallbacks(\n    errorCallbacks: ErrorCallbacks\n  ): ConnectionCallbacks {\n    return Collections.extend<ConnectionCallbacks>({}, errorCallbacks, {\n      message: message => {\n        // includes pong messages from server\n        this.resetActivityCheck();\n        this.emit('message', message);\n      },\n      ping: () => {\n        this.send_event('pusher:pong', {});\n      },\n      activity: () => {\n        this.resetActivityCheck();\n      },\n      error: error => {\n        // just emit error to user - socket will already be closed by browser\n        this.emit('error', error);\n      },\n      closed: () => {\n        this.abandonConnection();\n        if (this.shouldRetry()) {\n          this.retryIn(1000);\n        }\n      }\n    });\n  }\n\n  private buildHandshakeCallbacks(\n    errorCallbacks: ErrorCallbacks\n  ): HandshakeCallbacks {\n    return Collections.extend<HandshakeCallbacks>({}, errorCallbacks, {\n      connected: (handshake: HandshakePayload) => {\n        this.activityTimeout = Math.min(\n          this.options.activityTimeout,\n          handshake.activityTimeout,\n          handshake.connection.activityTimeout || Infinity\n        );\n        this.clearUnavailableTimer();\n        this.setConnection(handshake.connection);\n        this.socket_id = this.connection.id;\n        this.updateState('connected', { socket_id: this.socket_id });\n      }\n    });\n  }\n\n  private buildErrorCallbacks(): ErrorCallbacks {\n    let withErrorEmitted = callback => {\n      return (result: Action | HandshakePayload) => {\n        if (result.error) {\n          this.emit('error', { type: 'WebSocketError', error: result.error });\n        }\n        callback(result);\n      };\n    };\n\n    return {\n      tls_only: withErrorEmitted(() => {\n        this.usingTLS = true;\n        this.updateStrategy();\n        this.retryIn(0);\n      }),\n      refused: withErrorEmitted(() => {\n        this.disconnect();\n      }),\n      backoff: withErrorEmitted(() => {\n        this.retryIn(1000);\n      }),\n      retry: withErrorEmitted(() => {\n        this.retryIn(0);\n      })\n    };\n  }\n\n  private setConnection(connection) {\n    this.connection = connection;\n    for (var event in this.connectionCallbacks) {\n      this.connection.bind(event, this.connectionCallbacks[event]);\n    }\n    this.resetActivityCheck();\n  }\n\n  private abandonConnection() {\n    if (!this.connection) {\n      return;\n    }\n    this.stopActivityCheck();\n    for (var event in this.connectionCallbacks) {\n      this.connection.unbind(event, this.connectionCallbacks[event]);\n    }\n    var connection = this.connection;\n    this.connection = null;\n    return connection;\n  }\n\n  private updateState(newState: string, data?: any) {\n    var previousState = this.state;\n    this.state = newState;\n    if (previousState !== newState) {\n      var newStateDescription = newState;\n      if (newStateDescription === 'connected') {\n        newStateDescription += ' with new socket ID ' + data.socket_id;\n      }\n      Logger.debug(\n        'State changed',\n        previousState + ' -> ' + newStateDescription\n      );\n      this.timeline.info({ state: newState, params: data });\n      this.emit('state_change', { previous: previousState, current: newState });\n      this.emit(newState, data);\n    }\n  }\n\n  private shouldRetry(): boolean {\n    return this.state === 'connecting' || this.state === 'connected';\n  }\n}\n","import Channel from './channel';\nimport * as Collections from '../utils/collections';\nimport ChannelTable from './channel_table';\nimport Factory from '../utils/factory';\nimport Pusher from '../pusher';\nimport Logger from '../logger';\nimport * as Errors from '../errors';\nimport urlStore from '../utils/url_store';\n\n/** Handles a channel map. */\nexport default class Channels {\n  channels: ChannelTable;\n\n  constructor() {\n    this.channels = {};\n  }\n\n  /** Creates or retrieves an existing channel by its name.\n   *\n   * @param {String} name\n   * @param {Pusher} pusher\n   * @return {Channel}\n   */\n  add(name: string, pusher: Pusher) {\n    if (!this.channels[name]) {\n      this.channels[name] = createChannel(name, pusher);\n    }\n    return this.channels[name];\n  }\n\n  /** Returns a list of all channels\n   *\n   * @return {Array}\n   */\n  all(): Channel[] {\n    return Collections.values(this.channels);\n  }\n\n  /** Finds a channel by its name.\n   *\n   * @param {String} name\n   * @return {Channel} channel or null if it doesn't exist\n   */\n  find(name: string) {\n    return this.channels[name];\n  }\n\n  /** Removes a channel from the map.\n   *\n   * @param {String} name\n   */\n  remove(name: string) {\n    var channel = this.channels[name];\n    delete this.channels[name];\n    return channel;\n  }\n\n  /** Proxies disconnection signal to all channels. */\n  disconnect() {\n    Collections.objectApply(this.channels, function(channel) {\n      channel.disconnect();\n    });\n  }\n}\n\nfunction createChannel(name: string, pusher: Pusher): Channel {\n  if (name.indexOf('private-encrypted-') === 0) {\n    if (pusher.config.nacl) {\n      return Factory.createEncryptedChannel(name, pusher, pusher.config.nacl);\n    }\n    let errMsg =\n      'Tried to subscribe to a private-encrypted- channel but no nacl implementation available';\n    let suffix = urlStore.buildLogSuffix('encryptedChannelSupport');\n    throw new Errors.UnsupportedFeature(`${errMsg}. ${suffix}`);\n  } else if (name.indexOf('private-') === 0) {\n    return Factory.createPrivateChannel(name, pusher);\n  } else if (name.indexOf('presence-') === 0) {\n    return Factory.createPresenceChannel(name, pusher);\n  } else if (name.indexOf('#') === 0) {\n    throw new Errors.BadChannelName(\n      'Cannot create a channel with name \"' + name + '\".'\n    );\n  } else {\n    return Factory.createChannel(name, pusher);\n  }\n}\n","import AssistantToTheTransportManager from '../transports/assistant_to_the_transport_manager';\nimport PingDelayOptions from '../transports/ping_delay_options';\nimport Transport from '../transports/transport';\nimport TransportManager from '../transports/transport_manager';\nimport Handshake from '../connection/handshake';\nimport TransportConnection from '../transports/transport_connection';\nimport SocketHooks from '../http/socket_hooks';\nimport HTTPSocket from '../http/http_socket';\n\nimport Timeline from '../timeline/timeline';\nimport {\n  default as TimelineSender,\n  TimelineSenderOptions\n} from '../timeline/timeline_sender';\nimport PresenceChannel from '../channels/presence_channel';\nimport PrivateChannel from '../channels/private_channel';\nimport EncryptedChannel from '../channels/encrypted_channel';\nimport Channel from '../channels/channel';\nimport ConnectionManager from '../connection/connection_manager';\nimport ConnectionManagerOptions from '../connection/connection_manager_options';\nimport Ajax from '../http/ajax';\nimport Channels from '../channels/channels';\nimport Pusher from '../pusher';\nimport { Config } from '../config';\nimport * as nacl from 'tweetnacl';\n\nvar Factory = {\n  createChannels(): Channels {\n    return new Channels();\n  },\n\n  createConnectionManager(\n    key: string,\n    options: ConnectionManagerOptions\n  ): ConnectionManager {\n    return new ConnectionManager(key, options);\n  },\n\n  createChannel(name: string, pusher: Pusher): Channel {\n    return new Channel(name, pusher);\n  },\n\n  createPrivateChannel(name: string, pusher: Pusher): PrivateChannel {\n    return new PrivateChannel(name, pusher);\n  },\n\n  createPresenceChannel(name: string, pusher: Pusher): PresenceChannel {\n    return new PresenceChannel(name, pusher);\n  },\n\n  createEncryptedChannel(\n    name: string,\n    pusher: Pusher,\n    nacl: nacl\n  ): EncryptedChannel {\n    return new EncryptedChannel(name, pusher, nacl);\n  },\n\n  createTimelineSender(timeline: Timeline, options: TimelineSenderOptions) {\n    return new TimelineSender(timeline, options);\n  },\n\n  createHandshake(\n    transport: TransportConnection,\n    callback: (HandshakePayload) => void\n  ): Handshake {\n    return new Handshake(transport, callback);\n  },\n\n  createAssistantToTheTransportManager(\n    manager: TransportManager,\n    transport: Transport,\n    options: PingDelayOptions\n  ): AssistantToTheTransportManager {\n    return new AssistantToTheTransportManager(manager, transport, options);\n  }\n};\n\nexport default Factory;\n","import AssistantToTheTransportManager from './assistant_to_the_transport_manager';\nimport Transport from './transport';\nimport PingDelayOptions from './ping_delay_options';\nimport Factory from '../utils/factory';\n\nexport interface TransportManagerOptions extends PingDelayOptions {\n  lives?: number;\n}\n\n/** Keeps track of the number of lives left for a transport.\n *\n * In the beginning of a session, transports may be assigned a number of\n * lives. When an AssistantToTheTransportManager instance reports a transport\n * connection closed uncleanly, the transport loses a life. When the number\n * of lives drops to zero, the transport gets disabled by its manager.\n *\n * @param {Object} options\n */\nexport default class TransportManager {\n  options: TransportManagerOptions;\n  livesLeft: number;\n\n  constructor(options: TransportManagerOptions) {\n    this.options = options || {};\n    this.livesLeft = this.options.lives || Infinity;\n  }\n\n  /** Creates a assistant for the transport.\n   *\n   * @param {Transport} transport\n   * @returns {AssistantToTheTransportManager}\n   */\n  getAssistant(transport: Transport): AssistantToTheTransportManager {\n    return Factory.createAssistantToTheTransportManager(this, transport, {\n      minPingDelay: this.options.minPingDelay,\n      maxPingDelay: this.options.maxPingDelay\n    });\n  }\n\n  /** Returns whether the transport has any lives left.\n   *\n   * @returns {Boolean}\n   */\n  isAlive(): boolean {\n    return this.livesLeft > 0;\n  }\n\n  /** Takes one life from the transport. */\n  reportDeath() {\n    this.livesLeft -= 1;\n  }\n}\n","import * as Collections from '../utils/collections';\nimport Util from '../util';\nimport { OneOffTimer as Timer } from '../utils/timers';\nimport Strategy from './strategy';\nimport StrategyOptions from './strategy_options';\n\n/** Loops through strategies with optional timeouts.\n *\n * Options:\n * - loop - whether it should loop through the substrategy list\n * - timeout - initial timeout for a single substrategy\n * - timeoutLimit - maximum timeout\n *\n * @param {Strategy[]} strategies\n * @param {Object} options\n */\nexport default class SequentialStrategy implements Strategy {\n  strategies: Strategy[];\n  loop: boolean;\n  failFast: boolean;\n  timeout: number;\n  timeoutLimit: number;\n\n  constructor(strategies: Strategy[], options: StrategyOptions) {\n    this.strategies = strategies;\n    this.loop = Boolean(options.loop);\n    this.failFast = Boolean(options.failFast);\n    this.timeout = options.timeout;\n    this.timeoutLimit = options.timeoutLimit;\n  }\n\n  isSupported(): boolean {\n    return Collections.any(this.strategies, Util.method('isSupported'));\n  }\n\n  connect(minPriority: number, callback: Function) {\n    var strategies = this.strategies;\n    var current = 0;\n    var timeout = this.timeout;\n    var runner = null;\n\n    var tryNextStrategy = (error, handshake) => {\n      if (handshake) {\n        callback(null, handshake);\n      } else {\n        current = current + 1;\n        if (this.loop) {\n          current = current % strategies.length;\n        }\n\n        if (current < strategies.length) {\n          if (timeout) {\n            timeout = timeout * 2;\n            if (this.timeoutLimit) {\n              timeout = Math.min(timeout, this.timeoutLimit);\n            }\n          }\n          runner = this.tryStrategy(\n            strategies[current],\n            minPriority,\n            { timeout, failFast: this.failFast },\n            tryNextStrategy\n          );\n        } else {\n          callback(true);\n        }\n      }\n    };\n\n    runner = this.tryStrategy(\n      strategies[current],\n      minPriority,\n      { timeout: timeout, failFast: this.failFast },\n      tryNextStrategy\n    );\n\n    return {\n      abort: function() {\n        runner.abort();\n      },\n      forceMinPriority: function(p) {\n        minPriority = p;\n        if (runner) {\n          runner.forceMinPriority(p);\n        }\n      }\n    };\n  }\n\n  private tryStrategy(\n    strategy: Strategy,\n    minPriority: number,\n    options: StrategyOptions,\n    callback: Function\n  ) {\n    var timer = null;\n    var runner = null;\n\n    if (options.timeout > 0) {\n      timer = new Timer(options.timeout, function() {\n        runner.abort();\n        callback(true);\n      });\n    }\n\n    runner = strategy.connect(minPriority, function(error, handshake) {\n      if (error && timer && timer.isRunning() && !options.failFast) {\n        // advance to the next strategy after the timeout\n        return;\n      }\n      if (timer) {\n        timer.ensureAborted();\n      }\n      callback(error, handshake);\n    });\n\n    return {\n      abort: function() {\n        if (timer) {\n          timer.ensureAborted();\n        }\n        runner.abort();\n      },\n      forceMinPriority: function(p) {\n        runner.forceMinPriority(p);\n      }\n    };\n  }\n}\n","import * as Collections from '../utils/collections';\nimport Util from '../util';\nimport Strategy from './strategy';\n\n/** Launches all substrategies and emits prioritized connected transports.\n *\n * @param {Array} strategies\n */\nexport default class BestConnectedEverStrategy implements Strategy {\n  strategies: Strategy[];\n\n  constructor(strategies: Strategy[]) {\n    this.strategies = strategies;\n  }\n\n  isSupported(): boolean {\n    return Collections.any(this.strategies, Util.method('isSupported'));\n  }\n\n  connect(minPriority: number, callback: Function) {\n    return connect(this.strategies, minPriority, function(i, runners) {\n      return function(error, handshake) {\n        runners[i].error = error;\n        if (error) {\n          if (allRunnersFailed(runners)) {\n            callback(true);\n          }\n          return;\n        }\n        Collections.apply(runners, function(runner) {\n          runner.forceMinPriority(handshake.transport.priority);\n        });\n        callback(null, handshake);\n      };\n    });\n  }\n}\n\n/** Connects to all strategies in parallel.\n *\n * Callback builder should be a function that takes two arguments: index\n * and a list of runners. It should return another function that will be\n * passed to the substrategy with given index. Runners can be aborted using\n * abortRunner(s) functions from this class.\n *\n * @param  {Array} strategies\n * @param  {Function} callbackBuilder\n * @return {Object} strategy runner\n */\nfunction connect(\n  strategies: Strategy[],\n  minPriority: number,\n  callbackBuilder: Function\n) {\n  var runners = Collections.map(strategies, function(strategy, i, _, rs) {\n    return strategy.connect(minPriority, callbackBuilder(i, rs));\n  });\n  return {\n    abort: function() {\n      Collections.apply(runners, abortRunner);\n    },\n    forceMinPriority: function(p) {\n      Collections.apply(runners, function(runner) {\n        runner.forceMinPriority(p);\n      });\n    }\n  };\n}\n\nfunction allRunnersFailed(runners): boolean {\n  return Collections.all(runners, function(runner) {\n    return Boolean(runner.error);\n  });\n}\n\nfunction abortRunner(runner) {\n  if (!runner.error && !runner.aborted) {\n    runner.abort();\n    runner.aborted = true;\n  }\n}\n","import Util from '../util';\nimport Runtime from 'runtime';\nimport Strategy from './strategy';\nimport SequentialStrategy from './sequential_strategy';\nimport StrategyOptions from './strategy_options';\nimport TransportStrategy from './transport_strategy';\nimport Timeline from '../timeline/timeline';\nimport * as Collections from '../utils/collections';\n\nexport interface TransportStrategyDictionary {\n  [key: string]: TransportStrategy;\n}\n\n/** Caches last successful transport and uses it for following attempts.\n *\n * @param {Strategy} strategy\n * @param {Object} transports\n * @param {Object} options\n */\nexport default class CachedStrategy implements Strategy {\n  strategy: Strategy;\n  transports: TransportStrategyDictionary;\n  ttl: number;\n  usingTLS: boolean;\n  timeline: Timeline;\n\n  constructor(\n    strategy: Strategy,\n    transports: TransportStrategyDictionary,\n    options: StrategyOptions\n  ) {\n    this.strategy = strategy;\n    this.transports = transports;\n    this.ttl = options.ttl || 1800 * 1000;\n    this.usingTLS = options.useTLS;\n    this.timeline = options.timeline;\n  }\n\n  isSupported(): boolean {\n    return this.strategy.isSupported();\n  }\n\n  connect(minPriority: number, callback: Function) {\n    var usingTLS = this.usingTLS;\n    var info = fetchTransportCache(usingTLS);\n\n    var strategies = [this.strategy];\n    if (info && info.timestamp + this.ttl >= Util.now()) {\n      var transport = this.transports[info.transport];\n      if (transport) {\n        this.timeline.info({\n          cached: true,\n          transport: info.transport,\n          latency: info.latency\n        });\n        strategies.push(\n          new SequentialStrategy([transport], {\n            timeout: info.latency * 2 + 1000,\n            failFast: true\n          })\n        );\n      }\n    }\n\n    var startTimestamp = Util.now();\n    var runner = strategies\n      .pop()\n      .connect(minPriority, function cb(error, handshake) {\n        if (error) {\n          flushTransportCache(usingTLS);\n          if (strategies.length > 0) {\n            startTimestamp = Util.now();\n            runner = strategies.pop().connect(minPriority, cb);\n          } else {\n            callback(error);\n          }\n        } else {\n          storeTransportCache(\n            usingTLS,\n            handshake.transport.name,\n            Util.now() - startTimestamp\n          );\n          callback(null, handshake);\n        }\n      });\n\n    return {\n      abort: function() {\n        runner.abort();\n      },\n      forceMinPriority: function(p) {\n        minPriority = p;\n        if (runner) {\n          runner.forceMinPriority(p);\n        }\n      }\n    };\n  }\n}\n\nfunction getTransportCacheKey(usingTLS: boolean): string {\n  return 'pusherTransport' + (usingTLS ? 'TLS' : 'NonTLS');\n}\n\nfunction fetchTransportCache(usingTLS: boolean): any {\n  var storage = Runtime.getLocalStorage();\n  if (storage) {\n    try {\n      var serializedCache = storage[getTransportCacheKey(usingTLS)];\n      if (serializedCache) {\n        return JSON.parse(serializedCache);\n      }\n    } catch (e) {\n      flushTransportCache(usingTLS);\n    }\n  }\n  return null;\n}\n\nfunction storeTransportCache(\n  usingTLS: boolean,\n  transport: TransportStrategy,\n  latency: number\n) {\n  var storage = Runtime.getLocalStorage();\n  if (storage) {\n    try {\n      storage[getTransportCacheKey(usingTLS)] = Collections.safeJSONStringify({\n        timestamp: Util.now(),\n        transport: transport,\n        latency: latency\n      });\n    } catch (e) {\n      // catch over quota exceptions raised by localStorage\n    }\n  }\n}\n\nfunction flushTransportCache(usingTLS: boolean) {\n  var storage = Runtime.getLocalStorage();\n  if (storage) {\n    try {\n      delete storage[getTransportCacheKey(usingTLS)];\n    } catch (e) {\n      // catch exceptions raised by localStorage\n    }\n  }\n}\n","import { OneOffTimer as Timer } from '../utils/timers';\nimport Strategy from './strategy';\nimport StrategyOptions from './strategy_options';\n\n/** Runs substrategy after specified delay.\n *\n * Options:\n * - delay - time in miliseconds to delay the substrategy attempt\n *\n * @param {Strategy} strategy\n * @param {Object} options\n */\nexport default class DelayedStrategy implements Strategy {\n  strategy: Strategy;\n  options: { delay: number };\n\n  constructor(strategy: Strategy, { delay: number }) {\n    this.strategy = strategy;\n    this.options = { delay: number };\n  }\n\n  isSupported(): boolean {\n    return this.strategy.isSupported();\n  }\n\n  connect(minPriority: number, callback: Function) {\n    var strategy = this.strategy;\n    var runner;\n    var timer = new Timer(this.options.delay, function() {\n      runner = strategy.connect(minPriority, callback);\n    });\n\n    return {\n      abort: function() {\n        timer.ensureAborted();\n        if (runner) {\n          runner.abort();\n        }\n      },\n      forceMinPriority: function(p) {\n        minPriority = p;\n        if (runner) {\n          runner.forceMinPriority(p);\n        }\n      }\n    };\n  }\n}\n","import Strategy from './strategy';\nimport StrategyRunner from './strategy_runner';\n\n/** Proxies method calls to one of substrategies basing on the test function.\n *\n * @param {Function} test\n * @param {Strategy} trueBranch strategy used when test returns true\n * @param {Strategy} falseBranch strategy used when test returns false\n */\nexport default class IfStrategy implements Strategy {\n  test: () => boolean;\n  trueBranch: Strategy;\n  falseBranch: Strategy;\n\n  constructor(\n    test: () => boolean,\n    trueBranch: Strategy,\n    falseBranch: Strategy\n  ) {\n    this.test = test;\n    this.trueBranch = trueBranch;\n    this.falseBranch = falseBranch;\n  }\n\n  isSupported(): boolean {\n    var branch = this.test() ? this.trueBranch : this.falseBranch;\n    return branch.isSupported();\n  }\n\n  connect(minPriority: number, callback: Function): StrategyRunner {\n    var branch = this.test() ? this.trueBranch : this.falseBranch;\n    return branch.connect(minPriority, callback);\n  }\n}\n","import Strategy from './strategy';\nimport StrategyRunner from './strategy_runner';\n\n/** Launches the substrategy and terminates on the first open connection.\n *\n * @param {Strategy} strategy\n */\nexport default class FirstConnectedStrategy implements Strategy {\n  strategy: Strategy;\n\n  constructor(strategy: Strategy) {\n    this.strategy = strategy;\n  }\n\n  isSupported(): boolean {\n    return this.strategy.isSupported();\n  }\n\n  connect(minPriority: number, callback: Function): StrategyRunner {\n    var runner = this.strategy.connect(minPriority, function(error, handshake) {\n      if (handshake) {\n        runner.abort();\n      }\n      callback(error, handshake);\n    });\n    return runner;\n  }\n}\n","import * as Collections from 'core/utils/collections';\nimport TransportManager from 'core/transports/transport_manager';\nimport Strategy from 'core/strategies/strategy';\nimport StrategyOptions from 'core/strategies/strategy_options';\nimport SequentialStrategy from 'core/strategies/sequential_strategy';\nimport BestConnectedEverStrategy from 'core/strategies/best_connected_ever_strategy';\nimport CachedStrategy, {\n  TransportStrategyDictionary\n} from 'core/strategies/cached_strategy';\nimport DelayedStrategy from 'core/strategies/delayed_strategy';\nimport IfStrategy from 'core/strategies/if_strategy';\nimport FirstConnectedStrategy from 'core/strategies/first_connected_strategy';\nimport { Config } from 'core/config';\n\nfunction testSupportsStrategy(strategy: Strategy) {\n  return function() {\n    return strategy.isSupported();\n  };\n}\n\nvar getDefaultStrategy = function(\n  config: Config,\n  baseOptions: StrategyOptions,\n  defineTransport: Function\n): Strategy {\n  var definedTransports = <TransportStrategyDictionary>{};\n\n  function defineTransportStrategy(\n    name: string,\n    type: string,\n    priority: number,\n    options: StrategyOptions,\n    manager?: TransportManager\n  ) {\n    var transport = defineTransport(\n      config,\n      name,\n      type,\n      priority,\n      options,\n      manager\n    );\n\n    definedTransports[name] = transport;\n\n    return transport;\n  }\n\n  var ws_options: StrategyOptions = Object.assign({}, baseOptions, {\n    hostNonTLS: config.wsHost + ':' + config.wsPort,\n    hostTLS: config.wsHost + ':' + config.wssPort,\n    httpPath: config.wsPath\n  });\n  var wss_options: StrategyOptions = Object.assign({}, ws_options, {\n    useTLS: true\n  });\n  var sockjs_options: StrategyOptions = Object.assign({}, baseOptions, {\n    hostNonTLS: config.httpHost + ':' + config.httpPort,\n    hostTLS: config.httpHost + ':' + config.httpsPort,\n    httpPath: config.httpPath\n  });\n\n  var timeouts = {\n    loop: true,\n    timeout: 15000,\n    timeoutLimit: 60000\n  };\n\n  var ws_manager = new TransportManager({\n    lives: 2,\n    minPingDelay: 10000,\n    maxPingDelay: config.activityTimeout\n  });\n  var streaming_manager = new TransportManager({\n    lives: 2,\n    minPingDelay: 10000,\n    maxPingDelay: config.activityTimeout\n  });\n\n  var ws_transport = defineTransportStrategy(\n    'ws',\n    'ws',\n    3,\n    ws_options,\n    ws_manager\n  );\n  var wss_transport = defineTransportStrategy(\n    'wss',\n    'ws',\n    3,\n    wss_options,\n    ws_manager\n  );\n  var sockjs_transport = defineTransportStrategy(\n    'sockjs',\n    'sockjs',\n    1,\n    sockjs_options\n  );\n  var xhr_streaming_transport = defineTransportStrategy(\n    'xhr_streaming',\n    'xhr_streaming',\n    1,\n    sockjs_options,\n    streaming_manager\n  );\n  var xdr_streaming_transport = defineTransportStrategy(\n    'xdr_streaming',\n    'xdr_streaming',\n    1,\n    sockjs_options,\n    streaming_manager\n  );\n  var xhr_polling_transport = defineTransportStrategy(\n    'xhr_polling',\n    'xhr_polling',\n    1,\n    sockjs_options\n  );\n  var xdr_polling_transport = defineTransportStrategy(\n    'xdr_polling',\n    'xdr_polling',\n    1,\n    sockjs_options\n  );\n\n  var ws_loop = new SequentialStrategy([ws_transport], timeouts);\n  var wss_loop = new SequentialStrategy([wss_transport], timeouts);\n  var sockjs_loop = new SequentialStrategy([sockjs_transport], timeouts);\n  var streaming_loop = new SequentialStrategy(\n    [\n      new IfStrategy(\n        testSupportsStrategy(xhr_streaming_transport),\n        xhr_streaming_transport,\n        xdr_streaming_transport\n      )\n    ],\n    timeouts\n  );\n  var polling_loop = new SequentialStrategy(\n    [\n      new IfStrategy(\n        testSupportsStrategy(xhr_polling_transport),\n        xhr_polling_transport,\n        xdr_polling_transport\n      )\n    ],\n    timeouts\n  );\n\n  var http_loop = new SequentialStrategy(\n    [\n      new IfStrategy(\n        testSupportsStrategy(streaming_loop),\n        new BestConnectedEverStrategy([\n          streaming_loop,\n          new DelayedStrategy(polling_loop, { delay: 4000 })\n        ]),\n        polling_loop\n      )\n    ],\n    timeouts\n  );\n\n  var http_fallback_loop = new IfStrategy(\n    testSupportsStrategy(http_loop),\n    http_loop,\n    sockjs_loop\n  );\n\n  var wsStrategy;\n  if (baseOptions.useTLS) {\n    wsStrategy = new BestConnectedEverStrategy([\n      ws_loop,\n      new DelayedStrategy(http_fallback_loop, { delay: 2000 })\n    ]);\n  } else {\n    wsStrategy = new BestConnectedEverStrategy([\n      ws_loop,\n      new DelayedStrategy(wss_loop, { delay: 2000 }),\n      new DelayedStrategy(http_fallback_loop, { delay: 5000 })\n    ]);\n  }\n\n  return new CachedStrategy(\n    new FirstConnectedStrategy(\n      new IfStrategy(\n        testSupportsStrategy(ws_transport),\n        wsStrategy,\n        http_fallback_loop\n      )\n    ),\n    definedTransports,\n    {\n      ttl: 1800000,\n      timeline: baseOptions.timeline,\n      useTLS: baseOptions.useTLS\n    }\n  );\n};\n\nexport default getDefaultStrategy;\n","enum State {\n  CONNECTING = 0,\n  OPEN = 1,\n  CLOSED = 3\n}\n\nexport default State;\n","import HTTPRequest from 'core/http/http_request';\nimport RequestHooks from 'core/http/request_hooks';\nimport Ajax from 'core/http/ajax';\nimport * as Errors from 'core/errors';\n\nvar hooks: RequestHooks = {\n  getRequest: function(socket: HTTPRequest): Ajax {\n    var xdr = new (<any>window).XDomainRequest();\n    xdr.ontimeout = function() {\n      socket.emit('error', new Errors.RequestTimedOut());\n      socket.close();\n    };\n    xdr.onerror = function(e) {\n      socket.emit('error', e);\n      socket.close();\n    };\n    xdr.onprogress = function() {\n      if (xdr.responseText && xdr.responseText.length > 0) {\n        socket.onChunk(200, xdr.responseText);\n      }\n    };\n    xdr.onload = function() {\n      if (xdr.responseText && xdr.responseText.length > 0) {\n        socket.onChunk(200, xdr.responseText);\n      }\n      socket.emit('finished', 200);\n      socket.close();\n    };\n    return xdr;\n  },\n  abortRequest: function(xdr: Ajax) {\n    xdr.ontimeout = xdr.onerror = xdr.onprogress = xdr.onload = null;\n    xdr.abort();\n  }\n};\n\nexport default hooks;\n","import Runtime from 'runtime';\nimport RequestHooks from './request_hooks';\nimport Ajax from './ajax';\nimport { default as EventsDispatcher } from '../events/dispatcher';\n\nconst MAX_BUFFER_LENGTH = 256 * 1024;\n\nexport default class HTTPRequest extends EventsDispatcher {\n  hooks: RequestHooks;\n  method: string;\n  url: string;\n  position: number;\n  xhr: Ajax;\n  unloader: Function;\n\n  constructor(hooks: RequestHooks, method: string, url: string) {\n    super();\n    this.hooks = hooks;\n    this.method = method;\n    this.url = url;\n  }\n\n  start(payload?: any) {\n    this.position = 0;\n    this.xhr = this.hooks.getRequest(this);\n\n    this.unloader = () => {\n      this.close();\n    };\n    Runtime.addUnloadListener(this.unloader);\n\n    this.xhr.open(this.method, this.url, true);\n\n    if (this.xhr.setRequestHeader) {\n      this.xhr.setRequestHeader('Content-Type', 'application/json'); // ReactNative doesn't set this header by default.\n    }\n    this.xhr.send(payload);\n  }\n\n  close() {\n    if (this.unloader) {\n      Runtime.removeUnloadListener(this.unloader);\n      this.unloader = null;\n    }\n    if (this.xhr) {\n      this.hooks.abortRequest(this.xhr);\n      this.xhr = null;\n    }\n  }\n\n  onChunk(status: number, data: any) {\n    while (true) {\n      var chunk = this.advanceBuffer(data);\n      if (chunk) {\n        this.emit('chunk', { status: status, data: chunk });\n      } else {\n        break;\n      }\n    }\n    if (this.isBufferTooLong(data)) {\n      this.emit('buffer_too_long');\n    }\n  }\n\n  private advanceBuffer(buffer: any[]): any {\n    var unreadData = buffer.slice(this.position);\n    var endOfLinePosition = unreadData.indexOf('\\n');\n\n    if (endOfLinePosition !== -1) {\n      this.position += endOfLinePosition + 1;\n      return unreadData.slice(0, endOfLinePosition);\n    } else {\n      // chunk is not finished yet, don't move the buffer pointer\n      return null;\n    }\n  }\n\n  private isBufferTooLong(buffer: any): boolean {\n    return this.position === buffer.length && buffer.length > MAX_BUFFER_LENGTH;\n  }\n}\n","import URLLocation from './url_location';\nimport State from './state';\nimport Socket from '../socket';\nimport SocketHooks from './socket_hooks';\nimport Util from '../util';\nimport Ajax from './ajax';\nimport HTTPRequest from './http_request';\nimport Runtime from 'runtime';\n\nvar autoIncrement = 1;\n\nclass HTTPSocket implements Socket {\n  hooks: SocketHooks;\n  session: string;\n  location: URLLocation;\n  readyState: State;\n  stream: HTTPRequest;\n\n  onopen: () => void;\n  onerror: (error: any) => void;\n  onclose: (closeEvent: any) => void;\n  onmessage: (message: any) => void;\n  onactivity: () => void;\n\n  constructor(hooks: SocketHooks, url: string) {\n    this.hooks = hooks;\n    this.session = randomNumber(1000) + '/' + randomString(8);\n    this.location = getLocation(url);\n    this.readyState = State.CONNECTING;\n    this.openStream();\n  }\n\n  send(payload: any) {\n    return this.sendRaw(JSON.stringify([payload]));\n  }\n\n  ping() {\n    this.hooks.sendHeartbeat(this);\n  }\n\n  close(code: any, reason: any) {\n    this.onClose(code, reason, true);\n  }\n\n  /** For internal use only */\n  sendRaw(payload: any): boolean {\n    if (this.readyState === State.OPEN) {\n      try {\n        Runtime.createSocketRequest(\n          'POST',\n          getUniqueURL(getSendURL(this.location, this.session))\n        ).start(payload);\n        return true;\n      } catch (e) {\n        return false;\n      }\n    } else {\n      return false;\n    }\n  }\n\n  /** For internal use only */\n  reconnect() {\n    this.closeStream();\n    this.openStream();\n  }\n\n  /** For internal use only */\n  onClose(code, reason, wasClean) {\n    this.closeStream();\n    this.readyState = State.CLOSED;\n    if (this.onclose) {\n      this.onclose({\n        code: code,\n        reason: reason,\n        wasClean: wasClean\n      });\n    }\n  }\n\n  private onChunk(chunk) {\n    if (chunk.status !== 200) {\n      return;\n    }\n    if (this.readyState === State.OPEN) {\n      this.onActivity();\n    }\n\n    var payload;\n    var type = chunk.data.slice(0, 1);\n    switch (type) {\n      case 'o':\n        payload = JSON.parse(chunk.data.slice(1) || '{}');\n        this.onOpen(payload);\n        break;\n      case 'a':\n        payload = JSON.parse(chunk.data.slice(1) || '[]');\n        for (var i = 0; i < payload.length; i++) {\n          this.onEvent(payload[i]);\n        }\n        break;\n      case 'm':\n        payload = JSON.parse(chunk.data.slice(1) || 'null');\n        this.onEvent(payload);\n        break;\n      case 'h':\n        this.hooks.onHeartbeat(this);\n        break;\n      case 'c':\n        payload = JSON.parse(chunk.data.slice(1) || '[]');\n        this.onClose(payload[0], payload[1], true);\n        break;\n    }\n  }\n\n  private onOpen(options) {\n    if (this.readyState === State.CONNECTING) {\n      if (options && options.hostname) {\n        this.location.base = replaceHost(this.location.base, options.hostname);\n      }\n      this.readyState = State.OPEN;\n\n      if (this.onopen) {\n        this.onopen();\n      }\n    } else {\n      this.onClose(1006, 'Server lost session', true);\n    }\n  }\n\n  private onEvent(event) {\n    if (this.readyState === State.OPEN && this.onmessage) {\n      this.onmessage({ data: event });\n    }\n  }\n\n  private onActivity() {\n    if (this.onactivity) {\n      this.onactivity();\n    }\n  }\n\n  private onError(error) {\n    if (this.onerror) {\n      this.onerror(error);\n    }\n  }\n\n  private openStream() {\n    this.stream = Runtime.createSocketRequest(\n      'POST',\n      getUniqueURL(this.hooks.getReceiveURL(this.location, this.session))\n    );\n\n    this.stream.bind('chunk', chunk => {\n      this.onChunk(chunk);\n    });\n    this.stream.bind('finished', status => {\n      this.hooks.onFinished(this, status);\n    });\n    this.stream.bind('buffer_too_long', () => {\n      this.reconnect();\n    });\n\n    try {\n      this.stream.start();\n    } catch (error) {\n      Util.defer(() => {\n        this.onError(error);\n        this.onClose(1006, 'Could not start streaming', false);\n      });\n    }\n  }\n\n  private closeStream() {\n    if (this.stream) {\n      this.stream.unbind_all();\n      this.stream.close();\n      this.stream = null;\n    }\n  }\n}\n\nfunction getLocation(url): URLLocation {\n  var parts = /([^\\?]*)\\/*(\\??.*)/.exec(url);\n  return {\n    base: parts[1],\n    queryString: parts[2]\n  };\n}\n\nfunction getSendURL(url: URLLocation, session: string): string {\n  return url.base + '/' + session + '/xhr_send';\n}\n\nfunction getUniqueURL(url: string): string {\n  var separator = url.indexOf('?') === -1 ? '?' : '&';\n  return url + separator + 't=' + +new Date() + '&n=' + autoIncrement++;\n}\n\nfunction replaceHost(url: string, hostname: string): string {\n  var urlParts = /(https?:\\/\\/)([^\\/:]+)((\\/|:)?.*)/.exec(url);\n  return urlParts[1] + hostname + urlParts[3];\n}\n\nfunction randomNumber(max: number): number {\n  return Runtime.randomInt(max);\n}\n\nfunction randomString(length: number): string {\n  var result = [];\n\n  for (var i = 0; i < length; i++) {\n    result.push(randomNumber(32).toString(32));\n  }\n\n  return result.join('');\n}\n\nexport default HTTPSocket;\n","enum TimelineLevel {\n  ERROR = 3,\n  INFO = 6,\n  DEBUG = 7\n}\n\nexport default TimelineLevel;\n","import SocketHooks from './socket_hooks';\nimport HTTPSocket from './http_socket';\n\nvar hooks: SocketHooks = {\n  getReceiveURL: function(url, session) {\n    return url.base + '/' + session + '/xhr_streaming' + url.queryString;\n  },\n  onHeartbeat: function(socket) {\n    socket.sendRaw('[]');\n  },\n  sendHeartbeat: function(socket) {\n    socket.sendRaw('[]');\n  },\n  onFinished: function(socket, status) {\n    socket.onClose(1006, 'Connection interrupted (' + status + ')', false);\n  }\n};\n\nexport default hooks;\n","import SocketHooks from './socket_hooks';\nimport URLLocation from './url_location';\nimport HTTPSocket from './http_socket';\n\nvar hooks: SocketHooks = {\n  getReceiveURL: function(url: URLLocation, session: string): string {\n    return url.base + '/' + session + '/xhr' + url.queryString;\n  },\n  onHeartbeat: function() {\n    // next HTTP request will reset server's activity timer\n  },\n  sendHeartbeat: function(socket) {\n    socket.sendRaw('[]');\n  },\n  onFinished: function(socket, status) {\n    if (status === 200) {\n      socket.reconnect();\n    } else {\n      socket.onClose(1006, 'Connection interrupted (' + status + ')', false);\n    }\n  }\n};\n\nexport default hooks;\n","import HTTPRequest from 'core/http/http_request';\nimport RequestHooks from 'core/http/request_hooks';\nimport Ajax from 'core/http/ajax';\nimport Runtime from 'runtime';\n\nvar hooks: RequestHooks = {\n  getRequest: function(socket: HTTPRequest): Ajax {\n    var Constructor = Runtime.getXHRAPI();\n    var xhr = new Constructor();\n    xhr.onreadystatechange = xhr.onprogress = function() {\n      switch (xhr.readyState) {\n        case 3:\n          if (xhr.responseText && xhr.responseText.length > 0) {\n            socket.onChunk(xhr.status, xhr.responseText);\n          }\n          break;\n        case 4:\n          // this happens only on errors, never after calling close\n          if (xhr.responseText && xhr.responseText.length > 0) {\n            socket.onChunk(xhr.status, xhr.responseText);\n          }\n          socket.emit('finished', xhr.status);\n          socket.close();\n          break;\n      }\n    };\n    return xhr;\n  },\n  abortRequest: function(xhr: Ajax) {\n    xhr.onreadystatechange = null;\n    xhr.abort();\n  }\n};\n\nexport default hooks;\n","import Browser from './browser';\nimport { Dependencies, DependenciesReceivers } from './dom/dependencies';\nimport { AuthTransport, AuthTransports } from 'core/auth/auth_transports';\nimport xhrAuth from 'isomorphic/auth/xhr_auth';\nimport jsonpAuth from './auth/jsonp_auth';\nimport TimelineTransport from 'core/timeline/timeline_transport';\nimport TimelineSender from 'core/timeline/timeline_sender';\nimport ScriptRequest from './dom/script_request';\nimport JSONPRequest from './dom/jsonp_request';\nimport * as Collections from 'core/utils/collections';\nimport { ScriptReceivers } from './dom/script_receiver_factory';\nimport jsonpTimeline from './timeline/jsonp_timeline';\nimport Transports from './transports/transports';\nimport Ajax from 'core/http/ajax';\nimport { Network } from './net_info';\nimport getDefaultStrategy from './default_strategy';\nimport transportConnectionInitializer from './transports/transport_connection_initializer';\nimport HTTPFactory from './http/http';\nimport HTTPRequest from 'core/http/http_request';\n\nvar Runtime: Browser = {\n  // for jsonp auth\n  nextAuthCallbackID: 1,\n  auth_callbacks: {},\n  ScriptReceivers,\n  DependenciesReceivers,\n  getDefaultStrategy,\n  Transports,\n  transportConnectionInitializer,\n  HTTPFactory,\n\n  TimelineTransport: jsonpTimeline,\n\n  getXHRAPI() {\n    return window.XMLHttpRequest;\n  },\n\n  getWebSocketAPI() {\n    return window.WebSocket || window.MozWebSocket;\n  },\n\n  setup(PusherClass): void {\n    (<any>window).Pusher = PusherClass; // JSONp requires Pusher to be in the global scope.\n    var initializeOnDocumentBody = () => {\n      this.onDocumentBody(PusherClass.ready);\n    };\n    if (!(<any>window).JSON) {\n      Dependencies.load('json2', {}, initializeOnDocumentBody);\n    } else {\n      initializeOnDocumentBody();\n    }\n  },\n\n  getDocument(): Document {\n    return document;\n  },\n\n  getProtocol(): string {\n    return this.getDocument().location.protocol;\n  },\n\n  getAuthorizers(): AuthTransports {\n    return { ajax: xhrAuth, jsonp: jsonpAuth };\n  },\n\n  onDocumentBody(callback: Function) {\n    if (document.body) {\n      callback();\n    } else {\n      setTimeout(() => {\n        this.onDocumentBody(callback);\n      }, 0);\n    }\n  },\n\n  createJSONPRequest(url: string, data: any): JSONPRequest {\n    return new JSONPRequest(url, data);\n  },\n\n  createScriptRequest(src: string): ScriptRequest {\n    return new ScriptRequest(src);\n  },\n\n  getLocalStorage() {\n    try {\n      return window.localStorage;\n    } catch (e) {\n      return undefined;\n    }\n  },\n\n  createXHR(): Ajax {\n    if (this.getXHRAPI()) {\n      return this.createXMLHttpRequest();\n    } else {\n      return this.createMicrosoftXHR();\n    }\n  },\n\n  createXMLHttpRequest(): Ajax {\n    var Constructor = this.getXHRAPI();\n    return new Constructor();\n  },\n\n  createMicrosoftXHR(): Ajax {\n    return new ActiveXObject('Microsoft.XMLHTTP');\n  },\n\n  getNetwork() {\n    return Network;\n  },\n\n  createWebSocket(url: string): any {\n    var Constructor = this.getWebSocketAPI();\n    return new Constructor(url);\n  },\n\n  createSocketRequest(method: string, url: string): HTTPRequest {\n    if (this.isXHRSupported()) {\n      return this.HTTPFactory.createXHR(method, url);\n    } else if (this.isXDRSupported(url.indexOf('https:') === 0)) {\n      return this.HTTPFactory.createXDR(method, url);\n    } else {\n      throw 'Cross-origin HTTP requests are not supported';\n    }\n  },\n\n  isXHRSupported(): boolean {\n    var Constructor = this.getXHRAPI();\n    return (\n      Boolean(Constructor) && new Constructor().withCredentials !== undefined\n    );\n  },\n\n  isXDRSupported(useTLS?: boolean): boolean {\n    var protocol = useTLS ? 'https:' : 'http:';\n    var documentProtocol = this.getProtocol();\n    return (\n      Boolean(<any>window['XDomainRequest']) && documentProtocol === protocol\n    );\n  },\n\n  addUnloadListener(listener: any) {\n    if (window.addEventListener !== undefined) {\n      window.addEventListener('unload', listener, false);\n    } else if (window.attachEvent !== undefined) {\n      window.attachEvent('onunload', listener);\n    }\n  },\n\n  removeUnloadListener(listener: any) {\n    if (window.addEventListener !== undefined) {\n      window.removeEventListener('unload', listener, false);\n    } else if (window.detachEvent !== undefined) {\n      window.detachEvent('onunload', listener);\n    }\n  },\n\n  randomInt(max: number): number {\n    /**\n     * Return values in the range of [0, 1[\n     */\n    const random = function() {\n      const crypto = window.crypto || window['msCrypto'];\n      const random = crypto.getRandomValues(new Uint32Array(1))[0];\n\n      return random / 2 ** 32;\n    };\n\n    return Math.floor(random() * max);\n  }\n};\n\nexport default Runtime;\n","import { Dependencies } from '../dom/dependencies';\n\n/** Initializes the transport.\n *\n * Fetches resources if needed and then transitions to initialized.\n */\nexport default function() {\n  var self = this;\n\n  self.timeline.info(\n    self.buildTimelineMessage({\n      transport: self.name + (self.options.useTLS ? 's' : '')\n    })\n  );\n\n  if (self.hooks.isInitialized()) {\n    self.changeState('initialized');\n  } else if (self.hooks.file) {\n    self.changeState('initializing');\n    Dependencies.load(\n      self.hooks.file,\n      { useTLS: self.options.useTLS },\n      function(error, callback) {\n        if (self.hooks.isInitialized()) {\n          self.changeState('initialized');\n          callback(true);\n        } else {\n          if (error) {\n            self.onError(error);\n          }\n          self.onClose();\n          callback(false);\n        }\n      }\n    );\n  } else {\n    self.onClose();\n  }\n}\n","import HTTPRequest from 'core/http/http_request';\nimport HTTPSocket from 'core/http/http_socket';\nimport SocketHooks from 'core/http/socket_hooks';\nimport RequestHooks from 'core/http/request_hooks';\nimport streamingHooks from 'core/http/http_streaming_socket';\nimport pollingHooks from 'core/http/http_polling_socket';\nimport xhrHooks from './http_xhr_request';\nimport HTTPFactory from 'core/http/http_factory';\n\nvar HTTP: HTTPFactory = {\n  createStreamingSocket(url: string): HTTPSocket {\n    return this.createSocket(streamingHooks, url);\n  },\n\n  createPollingSocket(url: string): HTTPSocket {\n    return this.createSocket(pollingHooks, url);\n  },\n\n  createSocket(hooks: SocketHooks, url: string): HTTPSocket {\n    return new HTTPSocket(hooks, url);\n  },\n\n  createXHR(method: string, url: string): HTTPRequest {\n    return this.createRequest(xhrHooks, method, url);\n  },\n\n  createRequest(hooks: RequestHooks, method: string, url: string): HTTPRequest {\n    return new HTTPRequest(hooks, method, url);\n  }\n};\n\nexport default HTTP;\n","import xdrHooks from './http_xdomain_request';\nimport HTTP from 'isomorphic/http/http';\n\nHTTP.createXDR = function(method, url) {\n  return this.createRequest(xdrHooks, method, url);\n};\n\nexport default HTTP;\n","import * as Collections from '../utils/collections';\nimport Util from '../util';\nimport { default as Level } from './level';\n\nexport interface TimelineOptions {\n  level?: Level;\n  limit?: number;\n  version?: string;\n  cluster?: string;\n  features?: string[];\n  params?: any;\n}\n\nexport default class Timeline {\n  key: string;\n  session: number;\n  events: any[];\n  options: TimelineOptions;\n  sent: number;\n  uniqueID: number;\n\n  constructor(key: string, session: number, options: TimelineOptions) {\n    this.key = key;\n    this.session = session;\n    this.events = [];\n    this.options = options || {};\n    this.sent = 0;\n    this.uniqueID = 0;\n  }\n\n  log(level, event) {\n    if (level <= this.options.level) {\n      this.events.push(\n        Collections.extend({}, event, { timestamp: Util.now() })\n      );\n      if (this.options.limit && this.events.length > this.options.limit) {\n        this.events.shift();\n      }\n    }\n  }\n\n  error(event) {\n    this.log(Level.ERROR, event);\n  }\n\n  info(event) {\n    this.log(Level.INFO, event);\n  }\n\n  debug(event) {\n    this.log(Level.DEBUG, event);\n  }\n\n  isEmpty() {\n    return this.events.length === 0;\n  }\n\n  send(sendfn, callback) {\n    var data = Collections.extend(\n      {\n        session: this.session,\n        bundle: this.sent + 1,\n        key: this.key,\n        lib: 'js',\n        version: this.options.version,\n        cluster: this.options.cluster,\n        features: this.options.features,\n        timeline: this.events\n      },\n      this.options.params\n    );\n\n    this.events = [];\n    sendfn(data, (error, result) => {\n      if (!error) {\n        this.sent++;\n      }\n      if (callback) {\n        callback(error, result);\n      }\n    });\n\n    return true;\n  }\n\n  generateUniqueID(): number {\n    this.uniqueID++;\n    return this.uniqueID;\n  }\n}\n","import Factory from '../utils/factory';\nimport Util from '../util';\nimport * as Errors from '../errors';\nimport * as Collections from '../utils/collections';\nimport Strategy from './strategy';\nimport Transport from '../transports/transport';\nimport StrategyOptions from './strategy_options';\nimport Handshake from '../connection/handshake';\n\n/** Provides a strategy interface for transports.\n *\n * @param {String} name\n * @param {Number} priority\n * @param {Class} transport\n * @param {Object} options\n */\nexport default class TransportStrategy implements Strategy {\n  name: string;\n  priority: number;\n  transport: Transport;\n  options: StrategyOptions;\n\n  constructor(\n    name: string,\n    priority: number,\n    transport: Transport,\n    options: StrategyOptions\n  ) {\n    this.name = name;\n    this.priority = priority;\n    this.transport = transport;\n    this.options = options || {};\n  }\n\n  /** Returns whether the transport is supported in the browser.\n   *\n   * @returns {Boolean}\n   */\n  isSupported(): boolean {\n    return this.transport.isSupported({\n      useTLS: this.options.useTLS\n    });\n  }\n\n  /** Launches a connection attempt and returns a strategy runner.\n   *\n   * @param  {Function} callback\n   * @return {Object} strategy runner\n   */\n  connect(minPriority: number, callback: Function) {\n    if (!this.isSupported()) {\n      return failAttempt(new Errors.UnsupportedStrategy(), callback);\n    } else if (this.priority < minPriority) {\n      return failAttempt(new Errors.TransportPriorityTooLow(), callback);\n    }\n\n    var connected = false;\n    var transport = this.transport.createConnection(\n      this.name,\n      this.priority,\n      this.options.key,\n      this.options\n    );\n    var handshake = null;\n\n    var onInitialized = function() {\n      transport.unbind('initialized', onInitialized);\n      transport.connect();\n    };\n    var onOpen = function() {\n      handshake = Factory.createHandshake(transport, function(result) {\n        connected = true;\n        unbindListeners();\n        callback(null, result);\n      });\n    };\n    var onError = function(error) {\n      unbindListeners();\n      callback(error);\n    };\n    var onClosed = function() {\n      unbindListeners();\n      var serializedTransport;\n\n      // The reason for this try/catch block is that on React Native\n      // the WebSocket object is circular. Therefore transport.socket will\n      // throw errors upon stringification. Collections.safeJSONStringify\n      // discards circular references when serializing.\n      serializedTransport = Collections.safeJSONStringify(transport);\n      callback(new Errors.TransportClosed(serializedTransport));\n    };\n\n    var unbindListeners = function() {\n      transport.unbind('initialized', onInitialized);\n      transport.unbind('open', onOpen);\n      transport.unbind('error', onError);\n      transport.unbind('closed', onClosed);\n    };\n\n    transport.bind('initialized', onInitialized);\n    transport.bind('open', onOpen);\n    transport.bind('error', onError);\n    transport.bind('closed', onClosed);\n\n    // connect will be called automatically after initialization\n    transport.initialize();\n\n    return {\n      abort: () => {\n        if (connected) {\n          return;\n        }\n        unbindListeners();\n        if (handshake) {\n          handshake.close();\n        } else {\n          transport.close();\n        }\n      },\n      forceMinPriority: p => {\n        if (connected) {\n          return;\n        }\n        if (this.priority < p) {\n          if (handshake) {\n            handshake.close();\n          } else {\n            transport.close();\n          }\n        }\n      }\n    };\n  }\n}\n\nfunction failAttempt(error: Error, callback: Function) {\n  Util.defer(function() {\n    callback(error);\n  });\n  return {\n    abort: function() {},\n    forceMinPriority: function() {}\n  };\n}\n","import * as Collections from '../utils/collections';\nimport Util from '../util';\nimport TransportManager from '../transports/transport_manager';\nimport * as Errors from '../errors';\nimport Strategy from './strategy';\nimport TransportStrategy from './transport_strategy';\nimport StrategyOptions from '../strategies/strategy_options';\nimport { Config } from '../config';\nimport Runtime from 'runtime';\n\nconst { Transports } = Runtime;\n\nexport var defineTransport = function(\n  config: Config,\n  name: string,\n  type: string,\n  priority: number,\n  options: StrategyOptions,\n  manager?: TransportManager\n): Strategy {\n  var transportClass = Transports[type];\n  if (!transportClass) {\n    throw new Errors.UnsupportedTransport(type);\n  }\n\n  var enabled =\n    (!config.enabledTransports ||\n      Collections.arrayIndexOf(config.enabledTransports, name) !== -1) &&\n    (!config.disabledTransports ||\n      Collections.arrayIndexOf(config.disabledTransports, name) === -1);\n\n  var transport;\n  if (enabled) {\n    options = Object.assign(\n      { ignoreNullOrigin: config.ignoreNullOrigin },\n      options\n    );\n\n    transport = new TransportStrategy(\n      name,\n      priority,\n      manager ? manager.getAssistant(transportClass) : transportClass,\n      options\n    );\n  } else {\n    transport = UnsupportedStrategy;\n  }\n\n  return transport;\n};\n\nvar UnsupportedStrategy: Strategy = {\n  isSupported: function() {\n    return false;\n  },\n  connect: function(_, callback) {\n    var deferred = Util.defer(function() {\n      callback(new Errors.UnsupportedStrategy());\n    });\n    return {\n      abort: function() {\n        deferred.ensureAborted();\n      },\n      forceMinPriority: function() {}\n    };\n  }\n};\n","import { Options } from './options';\nimport Defaults from './defaults';\nimport {\n  ChannelAuthorizationHandler,\n  UserAuthenticationHandler,\n  ChannelAuthorizationOptions\n} from './auth/options';\nimport UserAuthenticator from './auth/user_authenticator';\nimport ChannelAuthorizer from './auth/channel_authorizer';\nimport { ChannelAuthorizerProxy } from './auth/deprecated_channel_authorizer';\nimport Runtime from 'runtime';\nimport * as nacl from 'tweetnacl';\nimport Logger from './logger';\n\nexport type AuthTransport = 'ajax' | 'jsonp';\nexport type Transport =\n  | 'ws'\n  | 'wss'\n  | 'xhr_streaming'\n  | 'xhr_polling'\n  | 'sockjs';\n\nexport interface Config {\n  // these are all 'required' config parameters, it's not necessary for the user\n  // to set them, but they have configured defaults.\n  activityTimeout: number;\n  enableStats: boolean;\n  httpHost: string;\n  httpPath: string;\n  httpPort: number;\n  httpsPort: number;\n  pongTimeout: number;\n  statsHost: string;\n  unavailableTimeout: number;\n  useTLS: boolean;\n  wsHost: string;\n  wsPath: string;\n  wsPort: number;\n  wssPort: number;\n  userAuthenticator: UserAuthenticationHandler;\n  channelAuthorizer: ChannelAuthorizationHandler;\n\n  // these are all optional parameters or overrrides. The customer can set these\n  // but it's not strictly necessary\n  forceTLS?: boolean;\n  cluster?: string;\n  disabledTransports?: Transport[];\n  enabledTransports?: Transport[];\n  ignoreNullOrigin?: boolean;\n  nacl?: nacl;\n  timelineParams?: any;\n}\n\n// getConfig mainly sets the defaults for the options that are not provided\nexport function getConfig(opts: Options, pusher): Config {\n  let config: Config = {\n    activityTimeout: opts.activityTimeout || Defaults.activityTimeout,\n    cluster: opts.cluster || Defaults.cluster,\n    httpPath: opts.httpPath || Defaults.httpPath,\n    httpPort: opts.httpPort || Defaults.httpPort,\n    httpsPort: opts.httpsPort || Defaults.httpsPort,\n    pongTimeout: opts.pongTimeout || Defaults.pongTimeout,\n    statsHost: opts.statsHost || Defaults.stats_host,\n    unavailableTimeout: opts.unavailableTimeout || Defaults.unavailableTimeout,\n    wsPath: opts.wsPath || Defaults.wsPath,\n    wsPort: opts.wsPort || Defaults.wsPort,\n    wssPort: opts.wssPort || Defaults.wssPort,\n\n    enableStats: getEnableStatsConfig(opts),\n    httpHost: getHttpHost(opts),\n    useTLS: shouldUseTLS(opts),\n    wsHost: getWebsocketHost(opts),\n\n    userAuthenticator: buildUserAuthenticator(opts),\n    channelAuthorizer: buildChannelAuthorizer(opts, pusher)\n  };\n\n  if ('disabledTransports' in opts)\n    config.disabledTransports = opts.disabledTransports;\n  if ('enabledTransports' in opts)\n    config.enabledTransports = opts.enabledTransports;\n  if ('ignoreNullOrigin' in opts)\n    config.ignoreNullOrigin = opts.ignoreNullOrigin;\n  if ('timelineParams' in opts) config.timelineParams = opts.timelineParams;\n  if ('nacl' in opts) {\n    config.nacl = opts.nacl;\n  }\n\n  return config;\n}\n\nfunction getHttpHost(opts: Options): string {\n  if (opts.httpHost) {\n    return opts.httpHost;\n  }\n  if (opts.cluster) {\n    return `sockjs-${opts.cluster}.pusher.com`;\n  }\n  return Defaults.httpHost;\n}\n\nfunction getWebsocketHost(opts: Options): string {\n  if (opts.wsHost) {\n    return opts.wsHost;\n  }\n  if (opts.cluster) {\n    return getWebsocketHostFromCluster(opts.cluster);\n  }\n  return getWebsocketHostFromCluster(Defaults.cluster);\n}\n\nfunction getWebsocketHostFromCluster(cluster: string): string {\n  return `ws-${cluster}.pusher.com`;\n}\n\nfunction shouldUseTLS(opts: Options): boolean {\n  if (Runtime.getProtocol() === 'https:') {\n    return true;\n  } else if (opts.forceTLS === false) {\n    return false;\n  }\n  return true;\n}\n\n// if enableStats is set take the value\n// if disableStats is set take the inverse\n// otherwise default to false\nfunction getEnableStatsConfig(opts: Options): boolean {\n  if ('enableStats' in opts) {\n    return opts.enableStats;\n  }\n  if ('disableStats' in opts) {\n    return !opts.disableStats;\n  }\n  return false;\n}\n\nfunction buildUserAuthenticator(opts: Options): UserAuthenticationHandler {\n  const userAuthentication = {\n    ...Defaults.userAuthentication,\n    ...opts.userAuthentication\n  };\n  if (\n    'customHandler' in userAuthentication &&\n    userAuthentication['customHandler'] != null\n  ) {\n    return userAuthentication['customHandler'];\n  }\n\n  return UserAuthenticator(userAuthentication);\n}\n\nfunction buildChannelAuth(opts: Options, pusher): ChannelAuthorizationOptions {\n  let channelAuthorization: ChannelAuthorizationOptions;\n  if ('channelAuthorization' in opts) {\n    channelAuthorization = {\n      ...Defaults.channelAuthorization,\n      ...opts.channelAuthorization\n    };\n  } else {\n    channelAuthorization = {\n      transport: opts.authTransport || Defaults.authTransport,\n      endpoint: opts.authEndpoint || Defaults.authEndpoint\n    };\n    if ('auth' in opts) {\n      if ('params' in opts.auth) channelAuthorization.params = opts.auth.params;\n      if ('headers' in opts.auth)\n        channelAuthorization.headers = opts.auth.headers;\n    }\n    if ('authorizer' in opts)\n      channelAuthorization.customHandler = ChannelAuthorizerProxy(\n        pusher,\n        channelAuthorization,\n        opts.authorizer\n      );\n  }\n  return channelAuthorization;\n}\n\nfunction buildChannelAuthorizer(\n  opts: Options,\n  pusher\n): ChannelAuthorizationHandler {\n  const channelAuthorization = buildChannelAuth(opts, pusher);\n  if (\n    'customHandler' in channelAuthorization &&\n    channelAuthorization['customHandler'] != null\n  ) {\n    return channelAuthorization['customHandler'];\n  }\n\n  return ChannelAuthorizer(channelAuthorization);\n}\n","import {\n  UserAuthenticationCallback,\n  InternalAuthOptions,\n  UserAuthenticationHandler,\n  UserAuthenticationRequestParams,\n  AuthRequestType\n} from './options';\n\nimport Runtime from 'runtime';\n\nconst composeChannelQuery = (\n  params: UserAuthenticationRequestParams,\n  authOptions: InternalAuthOptions\n) => {\n  var query = 'socket_id=' + encodeURIComponent(params.socketId);\n\n  for (var key in authOptions.params) {\n    query +=\n      '&' +\n      encodeURIComponent(key) +\n      '=' +\n      encodeURIComponent(authOptions.params[key]);\n  }\n\n  if (authOptions.paramsProvider != null) {\n    let dynamicParams = authOptions.paramsProvider();\n    for (var key in dynamicParams) {\n      query +=\n        '&' +\n        encodeURIComponent(key) +\n        '=' +\n        encodeURIComponent(dynamicParams[key]);\n    }\n  }\n\n  return query;\n};\n\nconst UserAuthenticator = (\n  authOptions: InternalAuthOptions\n): UserAuthenticationHandler => {\n  if (typeof Runtime.getAuthorizers()[authOptions.transport] === 'undefined') {\n    throw `'${authOptions.transport}' is not a recognized auth transport`;\n  }\n\n  return (\n    params: UserAuthenticationRequestParams,\n    callback: UserAuthenticationCallback\n  ) => {\n    const query = composeChannelQuery(params, authOptions);\n\n    Runtime.getAuthorizers()[authOptions.transport](\n      Runtime,\n      query,\n      authOptions,\n      AuthRequestType.UserAuthentication,\n      callback\n    );\n  };\n};\n\nexport default UserAuthenticator;\n","import Channel from '../channels/channel';\nimport {\n  ChannelAuthorizationCallback,\n  ChannelAuthorizationHandler,\n  ChannelAuthorizationRequestParams,\n  InternalAuthOptions\n} from './options';\n\nexport interface DeprecatedChannelAuthorizer {\n  authorize(socketId: string, callback: ChannelAuthorizationCallback): void;\n}\n\nexport interface ChannelAuthorizerGenerator {\n  (\n    channel: Channel,\n    options: DeprecatedAuthorizerOptions\n  ): DeprecatedChannelAuthorizer;\n}\n\nexport interface DeprecatedAuthOptions {\n  params?: any;\n  headers?: any;\n}\n\nexport interface DeprecatedAuthorizerOptions {\n  authTransport: 'ajax' | 'jsonp';\n  authEndpoint: string;\n  auth?: DeprecatedAuthOptions;\n}\n\nexport const ChannelAuthorizerProxy = (\n  pusher,\n  authOptions: InternalAuthOptions,\n  channelAuthorizerGenerator: ChannelAuthorizerGenerator\n): ChannelAuthorizationHandler => {\n  const deprecatedAuthorizerOptions: DeprecatedAuthorizerOptions = {\n    authTransport: authOptions.transport,\n    authEndpoint: authOptions.endpoint,\n    auth: {\n      params: authOptions.params,\n      headers: authOptions.headers\n    }\n  };\n  return (\n    params: ChannelAuthorizationRequestParams,\n    callback: ChannelAuthorizationCallback\n  ) => {\n    const channel = pusher.channel(params.channelName);\n    // This line creates a new channel authorizer every time.\n    // In the past, this was only done once per channel and reused.\n    // We can do that again if we want to keep this behavior intact.\n    const channelAuthorizer: DeprecatedChannelAuthorizer = channelAuthorizerGenerator(\n      channel,\n      deprecatedAuthorizerOptions\n    );\n    channelAuthorizer.authorize(params.socketId, callback);\n  };\n};\n","import {\n  AuthRequestType,\n  InternalAuthOptions,\n  ChannelAuthorizationHandler,\n  ChannelAuthorizationRequestParams,\n  ChannelAuthorizationCallback\n} from './options';\n\nimport Runtime from 'runtime';\n\nconst composeChannelQuery = (\n  params: ChannelAuthorizationRequestParams,\n  authOptions: InternalAuthOptions\n) => {\n  var query = 'socket_id=' + encodeURIComponent(params.socketId);\n\n  query += '&channel_name=' + encodeURIComponent(params.channelName);\n\n  for (var key in authOptions.params) {\n    query +=\n      '&' +\n      encodeURIComponent(key) +\n      '=' +\n      encodeURIComponent(authOptions.params[key]);\n  }\n\n  if (authOptions.paramsProvider != null) {\n    let dynamicParams = authOptions.paramsProvider();\n    for (var key in dynamicParams) {\n      query +=\n        '&' +\n        encodeURIComponent(key) +\n        '=' +\n        encodeURIComponent(dynamicParams[key]);\n    }\n  }\n\n  return query;\n};\n\nconst ChannelAuthorizer = (\n  authOptions: InternalAuthOptions\n): ChannelAuthorizationHandler => {\n  if (typeof Runtime.getAuthorizers()[authOptions.transport] === 'undefined') {\n    throw `'${authOptions.transport}' is not a recognized auth transport`;\n  }\n\n  return (\n    params: ChannelAuthorizationRequestParams,\n    callback: ChannelAuthorizationCallback\n  ) => {\n    const query = composeChannelQuery(params, authOptions);\n\n    Runtime.getAuthorizers()[authOptions.transport](\n      Runtime,\n      query,\n      authOptions,\n      AuthRequestType.ChannelAuthorization,\n      callback\n    );\n  };\n};\n\nexport default ChannelAuthorizer;\n","import Logger from './logger';\nimport Pusher from './pusher';\nimport EventsDispatcher from './events/dispatcher';\n\nexport default class WatchlistFacade extends EventsDispatcher {\n  private pusher: Pusher;\n\n  public constructor(pusher: Pusher) {\n    super(function(eventName, data) {\n      Logger.debug(`No callbacks on watchlist events for ${eventName}`);\n    });\n\n    this.pusher = pusher;\n    this.bindWatchlistInternalEvent();\n  }\n\n  handleEvent(pusherEvent) {\n    pusherEvent.data.events.forEach(watchlistEvent => {\n      this.emit(watchlistEvent.name, watchlistEvent);\n    });\n  }\n\n  private bindWatchlistInternalEvent() {\n    this.pusher.connection.bind('message', pusherEvent => {\n      var eventName = pusherEvent.event;\n      if (eventName === 'pusher_internal:watchlist_events') {\n        this.handleEvent(pusherEvent);\n      }\n    });\n  }\n}\n","import Pusher from './pusher';\nimport Logger from './logger';\nimport {\n  UserAuthenticationData,\n  UserAuthenticationCallback\n} from './auth/options';\nimport Channel from './channels/channel';\nimport WatchlistFacade from './watchlist';\nimport EventsDispatcher from './events/dispatcher';\nimport flatPromise from './utils/flat_promise';\n\nexport default class UserFacade extends EventsDispatcher {\n  pusher: Pusher;\n  signin_requested: boolean = false;\n  user_data: any = null;\n  serverToUserChannel: Channel = null;\n  signinDonePromise: Promise<any> = null;\n  watchlist: WatchlistFacade;\n  private _signinDoneResolve: Function = null;\n\n  public constructor(pusher: Pusher) {\n    super(function(eventName, data) {\n      Logger.debug('No callbacks on user for ' + eventName);\n    });\n    this.pusher = pusher;\n    this.pusher.connection.bind('state_change', ({ previous, current }) => {\n      if (previous !== 'connected' && current === 'connected') {\n        this._signin();\n      }\n      if (previous === 'connected' && current !== 'connected') {\n        this._cleanup();\n        this._newSigninPromiseIfNeeded();\n      }\n    });\n\n    this.watchlist = new WatchlistFacade(pusher);\n\n    this.pusher.connection.bind('message', event => {\n      var eventName = event.event;\n      if (eventName === 'pusher:signin_success') {\n        this._onSigninSuccess(event.data);\n      }\n      if (\n        this.serverToUserChannel &&\n        this.serverToUserChannel.name === event.channel\n      ) {\n        this.serverToUserChannel.handleEvent(event);\n      }\n    });\n  }\n\n  public signin() {\n    if (this.signin_requested) {\n      return;\n    }\n\n    this.signin_requested = true;\n    this._signin();\n  }\n\n  private _signin() {\n    if (!this.signin_requested) {\n      return;\n    }\n\n    this._newSigninPromiseIfNeeded();\n\n    if (this.pusher.connection.state !== 'connected') {\n      // Signin will be attempted when the connection is connected\n      return;\n    }\n\n    this.pusher.config.userAuthenticator(\n      {\n        socketId: this.pusher.connection.socket_id\n      },\n      this._onAuthorize\n    );\n  }\n\n  private _onAuthorize: UserAuthenticationCallback = (\n    err,\n    authData: UserAuthenticationData\n  ) => {\n    if (err) {\n      Logger.warn(`Error during signin: ${err}`);\n      this._cleanup();\n      return;\n    }\n\n    this.pusher.send_event('pusher:signin', {\n      auth: authData.auth,\n      user_data: authData.user_data\n    });\n\n    // Later when we get pusher:singin_success event, the user will be marked as signed in\n  };\n\n  private _onSigninSuccess(data: any) {\n    try {\n      this.user_data = JSON.parse(data.user_data);\n    } catch (e) {\n      Logger.error(`Failed parsing user data after signin: ${data.user_data}`);\n      this._cleanup();\n      return;\n    }\n\n    if (typeof this.user_data.id !== 'string' || this.user_data.id === '') {\n      Logger.error(\n        `user_data doesn't contain an id. user_data: ${this.user_data}`\n      );\n      this._cleanup();\n      return;\n    }\n\n    // Signin succeeded\n    this._signinDoneResolve();\n    this._subscribeChannels();\n  }\n\n  private _subscribeChannels() {\n    const ensure_subscribed = channel => {\n      if (channel.subscriptionPending && channel.subscriptionCancelled) {\n        channel.reinstateSubscription();\n      } else if (\n        !channel.subscriptionPending &&\n        this.pusher.connection.state === 'connected'\n      ) {\n        channel.subscribe();\n      }\n    };\n\n    this.serverToUserChannel = new Channel(\n      `#server-to-user-${this.user_data.id}`,\n      this.pusher\n    );\n    this.serverToUserChannel.bind_global((eventName, data) => {\n      if (\n        eventName.indexOf('pusher_internal:') === 0 ||\n        eventName.indexOf('pusher:') === 0\n      ) {\n        // ignore internal events\n        return;\n      }\n      this.emit(eventName, data);\n    });\n    ensure_subscribed(this.serverToUserChannel);\n  }\n\n  private _cleanup() {\n    this.user_data = null;\n    if (this.serverToUserChannel) {\n      this.serverToUserChannel.unbind_all();\n      this.serverToUserChannel.disconnect();\n      this.serverToUserChannel = null;\n    }\n\n    if (this.signin_requested) {\n      // If signin is in progress and cleanup is called,\n      // Mark the current signin process as done.\n      this._signinDoneResolve();\n    }\n  }\n\n  private _newSigninPromiseIfNeeded() {\n    if (!this.signin_requested) {\n      return;\n    }\n\n    // If there is a promise and it is not resolved, return without creating a new one.\n    if (this.signinDonePromise && !(this.signinDonePromise as any).done) {\n      return;\n    }\n\n    // This promise is never rejected.\n    // It gets resolved when the signin process is done whether it failed or succeeded\n    const { promise, resolve, reject: _ } = flatPromise();\n    (promise as any).done = false;\n    const setDone = () => {\n      (promise as any).done = true;\n    };\n    promise.then(setDone).catch(setDone);\n    this.signinDonePromise = promise;\n    this._signinDoneResolve = resolve;\n  }\n}\n","function flatPromise() {\n  let resolve, reject;\n  const promise = new Promise((res, rej) => {\n    resolve = res;\n    reject = rej;\n  });\n  return { promise, resolve, reject };\n}\n\nexport default flatPromise;\n","import AbstractRuntime from '../runtimes/interface';\nimport Runtime from 'runtime';\nimport Util from './util';\nimport * as Collections from './utils/collections';\nimport Channels from './channels/channels';\nimport Channel from './channels/channel';\nimport { default as EventsDispatcher } from './events/dispatcher';\nimport Timeline from './timeline/timeline';\nimport TimelineSender from './timeline/timeline_sender';\nimport TimelineLevel from './timeline/level';\nimport { defineTransport } from './strategies/strategy_builder';\nimport ConnectionManager from './connection/connection_manager';\nimport ConnectionManagerOptions from './connection/connection_manager_options';\nimport { PeriodicTimer } from './utils/timers';\nimport Defaults from './defaults';\nimport * as DefaultConfig from './config';\nimport Logger from './logger';\nimport Factory from './utils/factory';\nimport UrlStore from 'core/utils/url_store';\nimport { Options } from './options';\nimport { Config, getConfig } from './config';\nimport StrategyOptions from './strategies/strategy_options';\nimport UserFacade from './user';\n\nexport default class Pusher {\n  /*  STATIC PROPERTIES */\n  static instances: Pusher[] = [];\n  static isReady: boolean = false;\n  static logToConsole: boolean = false;\n\n  // for jsonp\n  static Runtime: AbstractRuntime = Runtime;\n  static ScriptReceivers: any = (<any>Runtime).ScriptReceivers;\n  static DependenciesReceivers: any = (<any>Runtime).DependenciesReceivers;\n  static auth_callbacks: any = (<any>Runtime).auth_callbacks;\n\n  static ready() {\n    Pusher.isReady = true;\n    for (var i = 0, l = Pusher.instances.length; i < l; i++) {\n      Pusher.instances[i].connect();\n    }\n  }\n\n  static log: (message: any) => void;\n\n  private static getClientFeatures(): string[] {\n    return Collections.keys(\n      Collections.filterObject({ ws: Runtime.Transports.ws }, function(t) {\n        return t.isSupported({});\n      })\n    );\n  }\n\n  /* INSTANCE PROPERTIES */\n  key: string;\n  config: Config;\n  channels: Channels;\n  global_emitter: EventsDispatcher;\n  sessionID: number;\n  timeline: Timeline;\n  timelineSender: TimelineSender;\n  connection: ConnectionManager;\n  timelineSenderTimer: PeriodicTimer;\n  user: UserFacade;\n  constructor(app_key: string, options?: Options) {\n    checkAppKey(app_key);\n    options = options || {};\n    if (!options.cluster && !(options.wsHost || options.httpHost)) {\n      let suffix = UrlStore.buildLogSuffix('javascriptQuickStart');\n      Logger.warn(\n        `You should always specify a cluster when connecting. ${suffix}`\n      );\n    }\n    if ('disableStats' in options) {\n      Logger.warn(\n        'The disableStats option is deprecated in favor of enableStats'\n      );\n    }\n\n    this.key = app_key;\n    this.config = getConfig(options, this);\n\n    this.channels = Factory.createChannels();\n    this.global_emitter = new EventsDispatcher();\n    this.sessionID = Runtime.randomInt(1000000000);\n\n    this.timeline = new Timeline(this.key, this.sessionID, {\n      cluster: this.config.cluster,\n      features: Pusher.getClientFeatures(),\n      params: this.config.timelineParams || {},\n      limit: 50,\n      level: TimelineLevel.INFO,\n      version: Defaults.VERSION\n    });\n    if (this.config.enableStats) {\n      this.timelineSender = Factory.createTimelineSender(this.timeline, {\n        host: this.config.statsHost,\n        path: '/timeline/v2/' + Runtime.TimelineTransport.name\n      });\n    }\n\n    var getStrategy = (options: StrategyOptions) => {\n      return Runtime.getDefaultStrategy(this.config, options, defineTransport);\n    };\n\n    this.connection = Factory.createConnectionManager(this.key, {\n      getStrategy: getStrategy,\n      timeline: this.timeline,\n      activityTimeout: this.config.activityTimeout,\n      pongTimeout: this.config.pongTimeout,\n      unavailableTimeout: this.config.unavailableTimeout,\n      useTLS: Boolean(this.config.useTLS)\n    });\n\n    this.connection.bind('connected', () => {\n      this.subscribeAll();\n      if (this.timelineSender) {\n        this.timelineSender.send(this.connection.isUsingTLS());\n      }\n    });\n\n    this.connection.bind('message', event => {\n      var eventName = event.event;\n      var internal = eventName.indexOf('pusher_internal:') === 0;\n      if (event.channel) {\n        var channel = this.channel(event.channel);\n        if (channel) {\n          channel.handleEvent(event);\n        }\n      }\n      // Emit globally [deprecated]\n      if (!internal) {\n        this.global_emitter.emit(event.event, event.data);\n      }\n    });\n    this.connection.bind('connecting', () => {\n      this.channels.disconnect();\n    });\n    this.connection.bind('disconnected', () => {\n      this.channels.disconnect();\n    });\n    this.connection.bind('error', err => {\n      Logger.warn(err);\n    });\n\n    Pusher.instances.push(this);\n    this.timeline.info({ instances: Pusher.instances.length });\n\n    this.user = new UserFacade(this);\n\n    if (Pusher.isReady) {\n      this.connect();\n    }\n  }\n\n  channel(name: string): Channel {\n    return this.channels.find(name);\n  }\n\n  allChannels(): Channel[] {\n    return this.channels.all();\n  }\n\n  connect() {\n    this.connection.connect();\n\n    if (this.timelineSender) {\n      if (!this.timelineSenderTimer) {\n        var usingTLS = this.connection.isUsingTLS();\n        var timelineSender = this.timelineSender;\n        this.timelineSenderTimer = new PeriodicTimer(60000, function() {\n          timelineSender.send(usingTLS);\n        });\n      }\n    }\n  }\n\n  disconnect() {\n    this.connection.disconnect();\n\n    if (this.timelineSenderTimer) {\n      this.timelineSenderTimer.ensureAborted();\n      this.timelineSenderTimer = null;\n    }\n  }\n\n  bind(event_name: string, callback: Function, context?: any): Pusher {\n    this.global_emitter.bind(event_name, callback, context);\n    return this;\n  }\n\n  unbind(event_name?: string, callback?: Function, context?: any): Pusher {\n    this.global_emitter.unbind(event_name, callback, context);\n    return this;\n  }\n\n  bind_global(callback: Function): Pusher {\n    this.global_emitter.bind_global(callback);\n    return this;\n  }\n\n  unbind_global(callback?: Function): Pusher {\n    this.global_emitter.unbind_global(callback);\n    return this;\n  }\n\n  unbind_all(callback?: Function): Pusher {\n    this.global_emitter.unbind_all();\n    return this;\n  }\n\n  subscribeAll() {\n    var channelName;\n    for (channelName in this.channels.channels) {\n      if (this.channels.channels.hasOwnProperty(channelName)) {\n        this.subscribe(channelName);\n      }\n    }\n  }\n\n  subscribe(channel_name: string) {\n    var channel = this.channels.add(channel_name, this);\n    if (channel.subscriptionPending && channel.subscriptionCancelled) {\n      channel.reinstateSubscription();\n    } else if (\n      !channel.subscriptionPending &&\n      this.connection.state === 'connected'\n    ) {\n      channel.subscribe();\n    }\n    return channel;\n  }\n\n  unsubscribe(channel_name: string) {\n    var channel = this.channels.find(channel_name);\n    if (channel && channel.subscriptionPending) {\n      channel.cancelSubscription();\n    } else {\n      channel = this.channels.remove(channel_name);\n      if (channel && channel.subscribed) {\n        channel.unsubscribe();\n      }\n    }\n  }\n\n  send_event(event_name: string, data: any, channel?: string) {\n    return this.connection.send_event(event_name, data, channel);\n  }\n\n  shouldUseTLS(): boolean {\n    return this.config.useTLS;\n  }\n\n  signin() {\n    this.user.signin();\n  }\n}\n\nfunction checkAppKey(key) {\n  if (key === null || key === undefined) {\n    throw 'You must pass your app key when you instantiate Pusher.';\n  }\n}\n\nRuntime.setup(Pusher);\n","import Pusher from './pusher';\nimport { Options } from './options';\nimport * as nacl from 'tweetnacl';\n\nexport default class PusherWithEncryption extends Pusher {\n  constructor(app_key: string, options?: Options) {\n    Pusher.logToConsole = PusherWithEncryption.logToConsole;\n    Pusher.log = PusherWithEncryption.log;\n\n    options = options || {};\n    options.nacl = nacl;\n    super(app_key, options);\n  }\n}\n","// This is a wrapper to make importing the encrypted channel capable web build\n// nicer\n// import Pusher from 'pusher-js/with-encryption'\nmodule.exports = require('../dist/web/pusher-with-encryption');\n","\n;(function (name, root, factory) {\n  if (typeof exports === 'object') {\n    module.exports = factory()\n    module.exports['default'] = factory()\n  }\n  /* istanbul ignore next */\n  else if (typeof define === 'function' && define.amd) {\n    define(factory)\n  }\n  else {\n    root[name] = factory()\n  }\n}('slugify', this, function () {\n  var charMap = JSON.parse('{\"$\":\"dollar\",\"%\":\"percent\",\"&\":\"and\",\"<\":\"less\",\">\":\"greater\",\"|\":\"or\",\"¢\":\"cent\",\"£\":\"pound\",\"¤\":\"currency\",\"¥\":\"yen\",\"©\":\"(c)\",\"ª\":\"a\",\"®\":\"(r)\",\"º\":\"o\",\"À\":\"A\",\"Á\":\"A\",\"Â\":\"A\",\"Ã\":\"A\",\"Ä\":\"A\",\"Å\":\"A\",\"Æ\":\"AE\",\"Ç\":\"C\",\"È\":\"E\",\"É\":\"E\",\"Ê\":\"E\",\"Ë\":\"E\",\"Ì\":\"I\",\"Í\":\"I\",\"Î\":\"I\",\"Ï\":\"I\",\"Ð\":\"D\",\"Ñ\":\"N\",\"Ò\":\"O\",\"Ó\":\"O\",\"Ô\":\"O\",\"Õ\":\"O\",\"Ö\":\"O\",\"Ø\":\"O\",\"Ù\":\"U\",\"Ú\":\"U\",\"Û\":\"U\",\"Ü\":\"U\",\"Ý\":\"Y\",\"Þ\":\"TH\",\"ß\":\"ss\",\"à\":\"a\",\"á\":\"a\",\"â\":\"a\",\"ã\":\"a\",\"ä\":\"a\",\"å\":\"a\",\"æ\":\"ae\",\"ç\":\"c\",\"è\":\"e\",\"é\":\"e\",\"ê\":\"e\",\"ë\":\"e\",\"ì\":\"i\",\"í\":\"i\",\"î\":\"i\",\"ï\":\"i\",\"ð\":\"d\",\"ñ\":\"n\",\"ò\":\"o\",\"ó\":\"o\",\"ô\":\"o\",\"õ\":\"o\",\"ö\":\"o\",\"ø\":\"o\",\"ù\":\"u\",\"ú\":\"u\",\"û\":\"u\",\"ü\":\"u\",\"ý\":\"y\",\"þ\":\"th\",\"ÿ\":\"y\",\"Ā\":\"A\",\"ā\":\"a\",\"Ă\":\"A\",\"ă\":\"a\",\"Ą\":\"A\",\"ą\":\"a\",\"Ć\":\"C\",\"ć\":\"c\",\"Č\":\"C\",\"č\":\"c\",\"Ď\":\"D\",\"ď\":\"d\",\"Đ\":\"DJ\",\"đ\":\"dj\",\"Ē\":\"E\",\"ē\":\"e\",\"Ė\":\"E\",\"ė\":\"e\",\"Ę\":\"e\",\"ę\":\"e\",\"Ě\":\"E\",\"ě\":\"e\",\"Ğ\":\"G\",\"ğ\":\"g\",\"Ģ\":\"G\",\"ģ\":\"g\",\"Ĩ\":\"I\",\"ĩ\":\"i\",\"Ī\":\"i\",\"ī\":\"i\",\"Į\":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Γ\":\"G\",\"Δ\":\"D\",\"Ε\":\"E\",\"Ζ\":\"Z\",\"Η\":\"H\",\"Θ\":\"8\",\"Ι\":\"I\",\"Κ\":\"K\",\"Λ\":\"L\",\"Μ\":\"M\",\"Ν\":\"N\",\"Ξ\":\"3\",\"Ο\":\"O\",\"Π\":\"P\",\"Ρ\":\"R\",\"Σ\":\"S\",\"Τ\":\"T\",\"Υ\":\"Y\",\"Φ\":\"F\",\"Χ\":\"X\",\"Ψ\":\"PS\",\"Ω\":\"W\",\"Ϊ\":\"I\",\"Ϋ\":\"Y\",\"ά\":\"a\",\"έ\":\"e\",\"ή\":\"h\",\"ί\":\"i\",\"ΰ\":\"y\",\"α\":\"a\",\"β\":\"b\",\"γ\":\"g\",\"δ\":\"d\",\"ε\":\"e\",\"ζ\":\"z\",\"η\":\"h\",\"θ\":\"8\",\"ι\":\"i\",\"κ\":\"k\",\"λ\":\"l\",\"μ\":\"m\",\"ν\":\"n\",\"ξ\":\"3\",\"ο\":\"o\",\"π\":\"p\",\"ρ\":\"r\",\"ς\":\"s\",\"σ\":\"s\",\"τ\":\"t\",\"υ\":\"y\",\"φ\":\"f\",\"χ\":\"x\",\"ψ\":\"ps\",\"ω\":\"w\",\"ϊ\":\"i\",\"ϋ\":\"y\",\"ό\":\"o\",\"ύ\":\"y\",\"ώ\":\"w\",\"Ё\":\"Yo\",\"Ђ\":\"DJ\",\"Є\":\"Ye\",\"І\":\"I\",\"Ї\":\"Yi\",\"Ј\":\"J\",\"Љ\":\"LJ\",\"Њ\":\"NJ\",\"Ћ\":\"C\",\"Џ\":\"DZ\",\"А\":\"A\",\"Б\":\"B\",\"В\":\"V\",\"Г\":\"G\",\"Д\":\"D\",\"Е\":\"E\",\"Ж\":\"Zh\",\"З\":\"Z\",\"И\":\"I\",\"Й\":\"J\",\"К\":\"K\",\"Л\":\"L\",\"М\":\"M\",\"Н\":\"N\",\"О\":\"O\",\"П\":\"P\",\"Р\":\"R\",\"С\":\"S\",\"Т\":\"T\",\"У\":\"U\",\"Ф\":\"F\",\"Х\":\"H\",\"Ц\":\"C\",\"Ч\":\"Ch\",\"Ш\":\"Sh\",\"Щ\":\"Sh\",\"Ъ\":\"U\",\"Ы\":\"Y\",\"Ь\":\"\",\"Э\":\"E\",\"Ю\":\"Yu\",\"Я\":\"Ya\",\"а\":\"a\",\"б\":\"b\",\"в\":\"v\",\"г\":\"g\",\"д\":\"d\",\"е\":\"e\",\"ж\":\"zh\",\"з\":\"z\",\"и\":\"i\",\"й\":\"j\",\"к\":\"k\",\"л\":\"l\",\"м\":\"m\",\"н\":\"n\",\"о\":\"o\",\"п\":\"p\",\"р\":\"r\",\"с\":\"s\",\"т\":\"t\",\"у\":\"u\",\"ф\":\"f\",\"х\":\"h\",\"ц\":\"c\",\"ч\":\"ch\",\"ш\":\"sh\",\"щ\":\"sh\",\"ъ\":\"u\",\"ы\":\"y\",\"ь\":\"\",\"э\":\"e\",\"ю\":\"yu\",\"я\":\"ya\",\"ё\":\"yo\",\"ђ\":\"dj\",\"є\":\"ye\",\"і\":\"i\",\"ї\":\"yi\",\"ј\":\"j\",\"љ\":\"lj\",\"њ\":\"nj\",\"ћ\":\"c\",\"ѝ\":\"u\",\"џ\":\"dz\",\"Ґ\":\"G\",\"ґ\":\"g\",\"Ғ\":\"GH\",\"ғ\":\"gh\",\"Қ\":\"KH\",\"қ\":\"kh\",\"Ң\":\"NG\",\"ң\":\"ng\",\"Ү\":\"UE\",\"ү\":\"ue\",\"Ұ\":\"U\",\"ұ\":\"u\",\"Һ\":\"H\",\"һ\":\"h\",\"Ә\":\"AE\",\"ә\":\"ae\",\"Ө\":\"OE\",\"ө\":\"oe\",\"Ա\":\"A\",\"Բ\":\"B\",\"Գ\":\"G\",\"Դ\":\"D\",\"Ե\":\"E\",\"Զ\":\"Z\",\"Է\":\"E\\'\",\"Ը\":\"Y\\'\",\"Թ\":\"T\\'\",\"Ժ\":\"JH\",\"Ի\":\"I\",\"Լ\":\"L\",\"Խ\":\"X\",\"Ծ\":\"C\\'\",\"Կ\":\"K\",\"Հ\":\"H\",\"Ձ\":\"D\\'\",\"Ղ\":\"GH\",\"Ճ\":\"TW\",\"Մ\":\"M\",\"Յ\":\"Y\",\"Ն\":\"N\",\"Շ\":\"SH\",\"Չ\":\"CH\",\"Պ\":\"P\",\"Ջ\":\"J\",\"Ռ\":\"R\\'\",\"Ս\":\"S\",\"Վ\":\"V\",\"Տ\":\"T\",\"Ր\":\"R\",\"Ց\":\"C\",\"Փ\":\"P\\'\",\"Ք\":\"Q\\'\",\"Օ\":\"O\\'\\'\",\"Ֆ\":\"F\",\"և\":\"EV\",\"ء\":\"a\",\"آ\":\"aa\",\"أ\":\"a\",\"ؤ\":\"u\",\"إ\":\"i\",\"ئ\":\"e\",\"ا\":\"a\",\"ب\":\"b\",\"ة\":\"h\",\"ت\":\"t\",\"ث\":\"th\",\"ج\":\"j\",\"ح\":\"h\",\"خ\":\"kh\",\"د\":\"d\",\"ذ\":\"th\",\"ر\":\"r\",\"ز\":\"z\",\"س\":\"s\",\"ش\":\"sh\",\"ص\":\"s\",\"ض\":\"dh\",\"ط\":\"t\",\"ظ\":\"z\",\"ع\":\"a\",\"غ\":\"gh\",\"ف\":\"f\",\"ق\":\"q\",\"ك\":\"k\",\"ل\":\"l\",\"م\":\"m\",\"ن\":\"n\",\"ه\":\"h\",\"و\":\"w\",\"ى\":\"a\",\"ي\":\"y\",\"ً\":\"an\",\"ٌ\":\"on\",\"ٍ\":\"en\",\"َ\":\"a\",\"ُ\":\"u\",\"ِ\":\"e\",\"ْ\":\"\",\"٠\":\"0\",\"١\":\"1\",\"٢\":\"2\",\"٣\":\"3\",\"٤\":\"4\",\"٥\":\"5\",\"٦\":\"6\",\"٧\":\"7\",\"٨\":\"8\",\"٩\":\"9\",\"پ\":\"p\",\"چ\":\"ch\",\"ژ\":\"zh\",\"ک\":\"k\",\"گ\":\"g\",\"ی\":\"y\",\"۰\":\"0\",\"۱\":\"1\",\"۲\":\"2\",\"۳\":\"3\",\"۴\":\"4\",\"۵\":\"5\",\"۶\":\"6\",\"۷\":\"7\",\"۸\":\"8\",\"۹\":\"9\",\"฿\":\"baht\",\"ა\":\"a\",\"ბ\":\"b\",\"გ\":\"g\",\"დ\":\"d\",\"ე\":\"e\",\"ვ\":\"v\",\"ზ\":\"z\",\"თ\":\"t\",\"ი\":\"i\",\"კ\":\"k\",\"ლ\":\"l\",\"მ\":\"m\",\"ნ\":\"n\",\"ო\":\"o\",\"პ\":\"p\",\"ჟ\":\"zh\",\"რ\":\"r\",\"ს\":\"s\",\"ტ\":\"t\",\"უ\":\"u\",\"ფ\":\"f\",\"ქ\":\"k\",\"ღ\":\"gh\",\"ყ\":\"q\",\"შ\":\"sh\",\"ჩ\":\"ch\",\"ც\":\"ts\",\"ძ\":\"dz\",\"წ\":\"ts\",\"ჭ\":\"ch\",\"ხ\":\"kh\",\"ჯ\":\"j\",\"ჰ\":\"h\",\"Ṣ\":\"S\",\"ṣ\":\"s\",\"Ẁ\":\"W\",\"ẁ\":\"w\",\"Ẃ\":\"W\",\"ẃ\":\"w\",\"Ẅ\":\"W\",\"ẅ\":\"w\",\"ẞ\":\"SS\",\"Ạ\":\"A\",\"ạ\":\"a\",\"Ả\":\"A\",\"ả\":\"a\",\"Ấ\":\"A\",\"ấ\":\"a\",\"Ầ\":\"A\",\"ầ\":\"a\",\"Ẩ\":\"A\",\"ẩ\":\"a\",\"Ẫ\":\"A\",\"ẫ\":\"a\",\"Ậ\":\"A\",\"ậ\":\"a\",\"Ắ\":\"A\",\"ắ\":\"a\",\"Ằ\":\"A\",\"ằ\":\"a\",\"Ẳ\":\"A\",\"ẳ\":\"a\",\"Ẵ\":\"A\",\"ẵ\":\"a\",\"Ặ\":\"A\",\"ặ\":\"a\",\"Ẹ\":\"E\",\"ẹ\":\"e\",\"Ẻ\":\"E\",\"ẻ\":\"e\",\"Ẽ\":\"E\",\"ẽ\":\"e\",\"Ế\":\"E\",\"ế\":\"e\",\"Ề\":\"E\",\"ề\":\"e\",\"Ể\":\"E\",\"ể\":\"e\",\"Ễ\":\"E\",\"ễ\":\"e\",\"Ệ\":\"E\",\"ệ\":\"e\",\"Ỉ\":\"I\",\"ỉ\":\"i\",\"Ị\":\"I\",\"ị\":\"i\",\"Ọ\":\"O\",\"ọ\":\"o\",\"Ỏ\":\"O\",\"ỏ\":\"o\",\"Ố\":\"O\",\"ố\":\"o\",\"Ồ\":\"O\",\"ồ\":\"o\",\"Ổ\":\"O\",\"ổ\":\"o\",\"Ỗ\":\"O\",\"ỗ\":\"o\",\"Ộ\":\"O\",\"ộ\":\"o\",\"Ớ\":\"O\",\"ớ\":\"o\",\"Ờ\":\"O\",\"ờ\":\"o\",\"Ở\":\"O\",\"ở\":\"o\",\"Ỡ\":\"O\",\"ỡ\":\"o\",\"Ợ\":\"O\",\"ợ\":\"o\",\"Ụ\":\"U\",\"ụ\":\"u\",\"Ủ\":\"U\",\"ủ\":\"u\",\"Ứ\":\"U\",\"ứ\":\"u\",\"Ừ\":\"U\",\"ừ\":\"u\",\"Ử\":\"U\",\"ử\":\"u\",\"Ữ\":\"U\",\"ữ\":\"u\",\"Ự\":\"U\",\"ự\":\"u\",\"Ỳ\":\"Y\",\"ỳ\":\"y\",\"Ỵ\":\"Y\",\"ỵ\":\"y\",\"Ỷ\":\"Y\",\"ỷ\":\"y\",\"Ỹ\":\"Y\",\"ỹ\":\"y\",\"–\":\"-\",\"‘\":\"\\'\",\"’\":\"\\'\",\"“\":\"\\\\\\\"\",\"”\":\"\\\\\\\"\",\"„\":\"\\\\\\\"\",\"†\":\"+\",\"•\":\"*\",\"…\":\"...\",\"₠\":\"ecu\",\"₢\":\"cruzeiro\",\"₣\":\"french franc\",\"₤\":\"lira\",\"₥\":\"mill\",\"₦\":\"naira\",\"₧\":\"peseta\",\"₨\":\"rupee\",\"₩\":\"won\",\"₪\":\"new shequel\",\"₫\":\"dong\",\"€\":\"euro\",\"₭\":\"kip\",\"₮\":\"tugrik\",\"₯\":\"drachma\",\"₰\":\"penny\",\"₱\":\"peso\",\"₲\":\"guarani\",\"₳\":\"austral\",\"₴\":\"hryvnia\",\"₵\":\"cedi\",\"₸\":\"kazakhstani tenge\",\"₹\":\"indian rupee\",\"₺\":\"turkish lira\",\"₽\":\"russian ruble\",\"₿\":\"bitcoin\",\"℠\":\"sm\",\"™\":\"tm\",\"∂\":\"d\",\"∆\":\"delta\",\"∑\":\"sum\",\"∞\":\"infinity\",\"♥\":\"love\",\"元\":\"yuan\",\"円\":\"yen\",\"﷼\":\"rial\",\"ﻵ\":\"laa\",\"ﻷ\":\"laa\",\"ﻹ\":\"lai\",\"ﻻ\":\"la\"}')\n  var locales = JSON.parse('{\"bg\":{\"Й\":\"Y\",\"Ц\":\"Ts\",\"Щ\":\"Sht\",\"Ъ\":\"A\",\"Ь\":\"Y\",\"й\":\"y\",\"ц\":\"ts\",\"щ\":\"sht\",\"ъ\":\"a\",\"ь\":\"y\"},\"de\":{\"Ä\":\"AE\",\"ä\":\"ae\",\"Ö\":\"OE\",\"ö\":\"oe\",\"Ü\":\"UE\",\"ü\":\"ue\",\"ß\":\"ss\",\"%\":\"prozent\",\"&\":\"und\",\"|\":\"oder\",\"∑\":\"summe\",\"∞\":\"unendlich\",\"♥\":\"liebe\"},\"es\":{\"%\":\"por ciento\",\"&\":\"y\",\"<\":\"menor que\",\">\":\"mayor que\",\"|\":\"o\",\"¢\":\"centavos\",\"£\":\"libras\",\"¤\":\"moneda\",\"₣\":\"francos\",\"∑\":\"suma\",\"∞\":\"infinito\",\"♥\":\"amor\"},\"fr\":{\"%\":\"pourcent\",\"&\":\"et\",\"<\":\"plus petit\",\">\":\"plus grand\",\"|\":\"ou\",\"¢\":\"centime\",\"£\":\"livre\",\"¤\":\"devise\",\"₣\":\"franc\",\"∑\":\"somme\",\"∞\":\"infini\",\"♥\":\"amour\"},\"pt\":{\"%\":\"porcento\",\"&\":\"e\",\"<\":\"menor\",\">\":\"maior\",\"|\":\"ou\",\"¢\":\"centavo\",\"∑\":\"soma\",\"£\":\"libra\",\"∞\":\"infinito\",\"♥\":\"amor\"},\"uk\":{\"И\":\"Y\",\"и\":\"y\",\"Й\":\"Y\",\"й\":\"y\",\"Ц\":\"Ts\",\"ц\":\"ts\",\"Х\":\"Kh\",\"х\":\"kh\",\"Щ\":\"Shch\",\"щ\":\"shch\",\"Г\":\"H\",\"г\":\"h\"},\"vi\":{\"Đ\":\"D\",\"đ\":\"d\"},\"da\":{\"Ø\":\"OE\",\"ø\":\"oe\",\"Å\":\"AA\",\"å\":\"aa\",\"%\":\"procent\",\"&\":\"og\",\"|\":\"eller\",\"$\":\"dollar\",\"<\":\"mindre end\",\">\":\"større end\"},\"nb\":{\"&\":\"og\",\"Å\":\"AA\",\"Æ\":\"AE\",\"Ø\":\"OE\",\"å\":\"aa\",\"æ\":\"ae\",\"ø\":\"oe\"},\"it\":{\"&\":\"e\"},\"nl\":{\"&\":\"en\"},\"sv\":{\"&\":\"och\",\"Å\":\"AA\",\"Ä\":\"AE\",\"Ö\":\"OE\",\"å\":\"aa\",\"ä\":\"ae\",\"ö\":\"oe\"}}')\n\n  function replace (string, options) {\n    if (typeof string !== 'string') {\n      throw new Error('slugify: string argument expected')\n    }\n\n    options = (typeof options === 'string')\n      ? {replacement: options}\n      : options || {}\n\n    var locale = locales[options.locale] || {}\n\n    var replacement = options.replacement === undefined ? '-' : options.replacement\n\n    var trim = options.trim === undefined ? true : options.trim\n\n    var slug = string.normalize().split('')\n      // replace characters based on charMap\n      .reduce(function (result, ch) {\n        var appendChar = locale[ch];\n        if (appendChar === undefined) appendChar = charMap[ch];\n        if (appendChar === undefined) appendChar = ch;\n        if (appendChar === replacement) appendChar = ' ';\n        return result + appendChar\n          // remove not allowed characters\n          .replace(options.remove || /[^\\w\\s$*_+~.()'\"!\\-:@]+/g, '')\n      }, '');\n\n    if (options.strict) {\n      slug = slug.replace(/[^A-Za-z0-9\\s]/g, '');\n    }\n\n    if (trim) {\n      slug = slug.trim()\n    }\n\n    // Replace spaces with replacement character, treating multiple consecutive\n    // spaces as a single space.\n    slug = slug.replace(/\\s+/g, replacement);\n\n    if (options.lower) {\n      slug = slug.toLowerCase()\n    }\n\n    return slug\n  }\n\n  replace.extend = function (customMap) {\n    Object.assign(charMap, customMap)\n  }\n\n  return replace\n}))\n","const hexRegex = /^[-+]?0x[a-fA-F0-9]+$/;\nconst numRegex = /^([\\-\\+])?(0*)(\\.[0-9]+([eE]\\-?[0-9]+)?|[0-9]+(\\.[0-9]+([eE]\\-?[0-9]+)?)?)$/;\n// const octRegex = /0x[a-z0-9]+/;\n// const binRegex = /0x[a-z0-9]+/;\n\n\n//polyfill\nif (!Number.parseInt && window.parseInt) {\n    Number.parseInt = window.parseInt;\n}\nif (!Number.parseFloat && window.parseFloat) {\n    Number.parseFloat = window.parseFloat;\n}\n\n  \nconst consider = {\n    hex :  true,\n    leadingZeros: true,\n    decimalPoint: \"\\.\",\n    eNotation: true\n    //skipLike: /regex/\n};\n\nfunction toNumber(str, options = {}){\n    // const options = Object.assign({}, consider);\n    // if(opt.leadingZeros === false){\n    //     options.leadingZeros = false;\n    // }else if(opt.hex === false){\n    //     options.hex = false;\n    // }\n\n    options = Object.assign({}, consider, options );\n    if(!str || typeof str !== \"string\" ) return str;\n    \n    let trimmedStr  = str.trim();\n    // if(trimmedStr === \"0.0\") return 0;\n    // else if(trimmedStr === \"+0.0\") return 0;\n    // else if(trimmedStr === \"-0.0\") return -0;\n\n    if(options.skipLike !== undefined && options.skipLike.test(trimmedStr)) return str;\n    else if (options.hex && hexRegex.test(trimmedStr)) {\n        return Number.parseInt(trimmedStr, 16);\n    // } else if (options.parseOct && octRegex.test(str)) {\n    //     return Number.parseInt(val, 8);\n    // }else if (options.parseBin && binRegex.test(str)) {\n    //     return Number.parseInt(val, 2);\n    }else{\n        //separate negative sign, leading zeros, and rest number\n        const match = numRegex.exec(trimmedStr);\n        if(match){\n            const sign = match[1];\n            const leadingZeros = match[2];\n            let numTrimmedByZeros = trimZeros(match[3]); //complete num without leading zeros\n            //trim ending zeros for floating number\n            \n            const eNotation = match[4] || match[6];\n            if(!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== \".\") return str; //-0123\n            else if(!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== \".\") return str; //0123\n            else{//no leading zeros or leading zeros are allowed\n                const num = Number(trimmedStr);\n                const numStr = \"\" + num;\n                if(numStr.search(/[eE]/) !== -1){ //given number is long and parsed to eNotation\n                    if(options.eNotation) return num;\n                    else return str;\n                }else if(eNotation){ //given number has enotation\n                    if(options.eNotation) return num;\n                    else return str;\n                }else if(trimmedStr.indexOf(\".\") !== -1){ //floating number\n                    // const decimalPart = match[5].substr(1);\n                    // const intPart = trimmedStr.substr(0,trimmedStr.indexOf(\".\"));\n\n                    \n                    // const p = numStr.indexOf(\".\");\n                    // const givenIntPart = numStr.substr(0,p);\n                    // const givenDecPart = numStr.substr(p+1);\n                    if(numStr === \"0\" && (numTrimmedByZeros === \"\") ) return num; //0.0\n                    else if(numStr === numTrimmedByZeros) return num; //0.456. 0.79000\n                    else if( sign && numStr === \"-\"+numTrimmedByZeros) return num;\n                    else return str;\n                }\n                \n                if(leadingZeros){\n                    // if(numTrimmedByZeros === numStr){\n                    //     if(options.leadingZeros) return num;\n                    //     else return str;\n                    // }else return str;\n                    if(numTrimmedByZeros === numStr) return num;\n                    else if(sign+numTrimmedByZeros === numStr) return num;\n                    else return str;\n                }\n\n                if(trimmedStr === numStr) return num;\n                else if(trimmedStr === sign+numStr) return num;\n                // else{\n                //     //number with +/- sign\n                //     trimmedStr.test(/[-+][0-9]);\n\n                // }\n                return str;\n            }\n            // else if(!eNotation && trimmedStr && trimmedStr !== Number(trimmedStr) ) return str;\n            \n        }else{ //non-numeric string\n            return str;\n        }\n    }\n}\n\n/**\n * \n * @param {string} numStr without leading zeros\n * @returns \n */\nfunction trimZeros(numStr){\n    if(numStr && numStr.indexOf(\".\") !== -1){//float\n        numStr = numStr.replace(/0+$/, \"\"); //remove ending zeros\n        if(numStr === \".\")  numStr = \"0\";\n        else if(numStr[0] === \".\")  numStr = \"0\"+numStr;\n        else if(numStr[numStr.length-1] === \".\")  numStr = numStr.substr(0,numStr.length-1);\n        return numStr;\n    }\n    return numStr;\n}\nmodule.exports = toNumber\n","const candidateSelectors = [\n  'input',\n  'select',\n  'textarea',\n  'a[href]',\n  'button',\n  '[tabindex]:not(slot)',\n  'audio[controls]',\n  'video[controls]',\n  '[contenteditable]:not([contenteditable=\"false\"])',\n  'details>summary:first-of-type',\n  'details',\n];\nconst candidateSelector = /* #__PURE__ */ candidateSelectors.join(',');\n\nconst NoElement = typeof Element === 'undefined';\n\nconst matches = NoElement\n  ? function () {}\n  : Element.prototype.matches ||\n    Element.prototype.msMatchesSelector ||\n    Element.prototype.webkitMatchesSelector;\n\nconst getRootNode =\n  !NoElement && Element.prototype.getRootNode\n    ? (element) => element.getRootNode()\n    : (element) => element.ownerDocument;\n\n/**\n * @param {Element} el container to check in\n * @param {boolean} includeContainer add container to check\n * @param {(node: Element) => boolean} filter filter candidates\n * @returns {Element[]}\n */\nconst getCandidates = function (el, includeContainer, filter) {\n  let candidates = Array.prototype.slice.apply(\n    el.querySelectorAll(candidateSelector)\n  );\n  if (includeContainer && matches.call(el, candidateSelector)) {\n    candidates.unshift(el);\n  }\n  candidates = candidates.filter(filter);\n  return candidates;\n};\n\n/**\n * @callback GetShadowRoot\n * @param {Element} element to check for shadow root\n * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.\n */\n\n/**\n * @callback ShadowRootFilter\n * @param {Element} shadowHostNode the element which contains shadow content\n * @returns {boolean} true if a shadow root could potentially contain valid candidates.\n */\n\n/**\n * @typedef {Object} CandidateScope\n * @property {Element} scopeParent contains inner candidates\n * @property {Element[]} candidates list of candidates found in the scope parent\n */\n\n/**\n * @typedef {Object} IterativeOptions\n * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;\n *  if a function, implies shadow support is enabled and either returns the shadow root of an element\n *  or a boolean stating if it has an undisclosed shadow root\n * @property {(node: Element) => boolean} filter filter candidates\n * @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list\n * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;\n */\n\n/**\n * @param {Element[]} elements list of element containers to match candidates from\n * @param {boolean} includeContainer add container list to check\n * @param {IterativeOptions} options\n * @returns {Array.<Element|CandidateScope>}\n */\nconst getCandidatesIteratively = function (\n  elements,\n  includeContainer,\n  options\n) {\n  const candidates = [];\n  const elementsToCheck = Array.from(elements);\n  while (elementsToCheck.length) {\n    const element = elementsToCheck.shift();\n    if (element.tagName === 'SLOT') {\n      // add shadow dom slot scope (slot itself cannot be focusable)\n      const assigned = element.assignedElements();\n      const content = assigned.length ? assigned : element.children;\n      const nestedCandidates = getCandidatesIteratively(content, true, options);\n      if (options.flatten) {\n        candidates.push(...nestedCandidates);\n      } else {\n        candidates.push({\n          scopeParent: element,\n          candidates: nestedCandidates,\n        });\n      }\n    } else {\n      // check candidate element\n      const validCandidate = matches.call(element, candidateSelector);\n      if (\n        validCandidate &&\n        options.filter(element) &&\n        (includeContainer || !elements.includes(element))\n      ) {\n        candidates.push(element);\n      }\n\n      // iterate over shadow content if possible\n      const shadowRoot =\n        element.shadowRoot ||\n        // check for an undisclosed shadow\n        (typeof options.getShadowRoot === 'function' &&\n          options.getShadowRoot(element));\n\n      const validShadowRoot =\n        !options.shadowRootFilter || options.shadowRootFilter(element);\n\n      if (shadowRoot && validShadowRoot) {\n        // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed\n        //  shadow exists, so look at light dom children as fallback BUT create a scope for any\n        //  child candidates found because they're likely slotted elements (elements that are\n        //  children of the web component element (which has the shadow), in the light dom, but\n        //  slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,\n        //  _after_ we return from this recursive call\n        const nestedCandidates = getCandidatesIteratively(\n          shadowRoot === true ? element.children : shadowRoot.children,\n          true,\n          options\n        );\n\n        if (options.flatten) {\n          candidates.push(...nestedCandidates);\n        } else {\n          candidates.push({\n            scopeParent: element,\n            candidates: nestedCandidates,\n          });\n        }\n      } else {\n        // there's not shadow so just dig into the element's (light dom) children\n        //  __without__ giving the element special scope treatment\n        elementsToCheck.unshift(...element.children);\n      }\n    }\n  }\n  return candidates;\n};\n\nconst getTabindex = function (node, isScope) {\n  if (node.tabIndex < 0) {\n    // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default\n    // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,\n    // yet they are still part of the regular tab order; in FF, they get a default\n    // `tabIndex` of 0; since Chrome still puts those elements in the regular tab\n    // order, consider their tab index to be 0.\n    // Also browsers do not return `tabIndex` correctly for contentEditable nodes;\n    // so if they don't have a tabindex attribute specifically set, assume it's 0.\n    //\n    // isScope is positive for custom element with shadow root or slot that by default\n    // have tabIndex -1, but need to be sorted by document order in order for their\n    // content to be inserted in the correct position\n    if (\n      (isScope ||\n        /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) ||\n        node.isContentEditable) &&\n      isNaN(parseInt(node.getAttribute('tabindex'), 10))\n    ) {\n      return 0;\n    }\n  }\n\n  return node.tabIndex;\n};\n\nconst sortOrderedTabbables = function (a, b) {\n  return a.tabIndex === b.tabIndex\n    ? a.documentOrder - b.documentOrder\n    : a.tabIndex - b.tabIndex;\n};\n\nconst isInput = function (node) {\n  return node.tagName === 'INPUT';\n};\n\nconst isHiddenInput = function (node) {\n  return isInput(node) && node.type === 'hidden';\n};\n\nconst isDetailsWithSummary = function (node) {\n  const r =\n    node.tagName === 'DETAILS' &&\n    Array.prototype.slice\n      .apply(node.children)\n      .some((child) => child.tagName === 'SUMMARY');\n  return r;\n};\n\nconst getCheckedRadio = function (nodes, form) {\n  for (let i = 0; i < nodes.length; i++) {\n    if (nodes[i].checked && nodes[i].form === form) {\n      return nodes[i];\n    }\n  }\n};\n\nconst isTabbableRadio = function (node) {\n  if (!node.name) {\n    return true;\n  }\n  const radioScope = node.form || getRootNode(node);\n  const queryRadios = function (name) {\n    return radioScope.querySelectorAll(\n      'input[type=\"radio\"][name=\"' + name + '\"]'\n    );\n  };\n\n  let radioSet;\n  if (\n    typeof window !== 'undefined' &&\n    typeof window.CSS !== 'undefined' &&\n    typeof window.CSS.escape === 'function'\n  ) {\n    radioSet = queryRadios(window.CSS.escape(node.name));\n  } else {\n    try {\n      radioSet = queryRadios(node.name);\n    } catch (err) {\n      // eslint-disable-next-line no-console\n      console.error(\n        'Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s',\n        err.message\n      );\n      return false;\n    }\n  }\n\n  const checked = getCheckedRadio(radioSet, node.form);\n  return !checked || checked === node;\n};\n\nconst isRadio = function (node) {\n  return isInput(node) && node.type === 'radio';\n};\n\nconst isNonTabbableRadio = function (node) {\n  return isRadio(node) && !isTabbableRadio(node);\n};\n\n// determines if a node is ultimately attached to the window's document\nconst isNodeAttached = function (node) {\n  // The root node is the shadow root if the node is in a shadow DOM; some document otherwise\n  //  (but NOT _the_ document; see second 'If' comment below for more).\n  // If rootNode is shadow root, it'll have a host, which is the element to which the shadow\n  //  is attached, and the one we need to check if it's in the document or not (because the\n  //  shadow, and all nodes it contains, is never considered in the document since shadows\n  //  behave like self-contained DOMs; but if the shadow's HOST, which is part of the document,\n  //  is hidden, or is not in the document itself but is detached, it will affect the shadow's\n  //  visibility, including all the nodes it contains). The host could be any normal node,\n  //  or a custom element (i.e. web component). Either way, that's the one that is considered\n  //  part of the document, not the shadow root, nor any of its children (i.e. the node being\n  //  tested).\n  // To further complicate things, we have to look all the way up until we find a shadow HOST\n  //  that is attached (or find none) because the node might be in nested shadows...\n  // If rootNode is not a shadow root, it won't have a host, and so rootNode should be the\n  //  document (per the docs) and while it's a Document-type object, that document does not\n  //  appear to be the same as the node's `ownerDocument` for some reason, so it's safer\n  //  to ignore the rootNode at this point, and use `node.ownerDocument`. Otherwise,\n  //  using `rootNode.contains(node)` will _always_ be true we'll get false-positives when\n  //  node is actually detached.\n  let nodeRootHost = getRootNode(node).host;\n  let attached = !!(\n    nodeRootHost?.ownerDocument.contains(nodeRootHost) ||\n    node.ownerDocument.contains(node)\n  );\n\n  while (!attached && nodeRootHost) {\n    // since it's not attached and we have a root host, the node MUST be in a nested shadow DOM,\n    //  which means we need to get the host's host and check if that parent host is contained\n    //  in (i.e. attached to) the document\n    nodeRootHost = getRootNode(nodeRootHost).host;\n    attached = !!nodeRootHost?.ownerDocument.contains(nodeRootHost);\n  }\n\n  return attached;\n};\n\nconst isZeroArea = function (node) {\n  const { width, height } = node.getBoundingClientRect();\n  return width === 0 && height === 0;\n};\nconst isHidden = function (node, { displayCheck, getShadowRoot }) {\n  // NOTE: visibility will be `undefined` if node is detached from the document\n  //  (see notes about this further down), which means we will consider it visible\n  //  (this is legacy behavior from a very long way back)\n  // NOTE: we check this regardless of `displayCheck=\"none\"` because this is a\n  //  _visibility_ check, not a _display_ check\n  if (getComputedStyle(node).visibility === 'hidden') {\n    return true;\n  }\n\n  const isDirectSummary = matches.call(node, 'details>summary:first-of-type');\n  const nodeUnderDetails = isDirectSummary ? node.parentElement : node;\n  if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {\n    return true;\n  }\n\n  if (\n    !displayCheck ||\n    displayCheck === 'full' ||\n    displayCheck === 'legacy-full'\n  ) {\n    if (typeof getShadowRoot === 'function') {\n      // figure out if we should consider the node to be in an undisclosed shadow and use the\n      //  'non-zero-area' fallback\n      const originalNode = node;\n      while (node) {\n        const parentElement = node.parentElement;\n        const rootNode = getRootNode(node);\n        if (\n          parentElement &&\n          !parentElement.shadowRoot &&\n          getShadowRoot(parentElement) === true // check if there's an undisclosed shadow\n        ) {\n          // node has an undisclosed shadow which means we can only treat it as a black box, so we\n          //  fall back to a non-zero-area test\n          return isZeroArea(node);\n        } else if (node.assignedSlot) {\n          // iterate up slot\n          node = node.assignedSlot;\n        } else if (!parentElement && rootNode !== node.ownerDocument) {\n          // cross shadow boundary\n          node = rootNode.host;\n        } else {\n          // iterate up normal dom\n          node = parentElement;\n        }\n      }\n\n      node = originalNode;\n    }\n    // else, `getShadowRoot` might be true, but all that does is enable shadow DOM support\n    //  (i.e. it does not also presume that all nodes might have undisclosed shadows); or\n    //  it might be a falsy value, which means shadow DOM support is disabled\n\n    // Since we didn't find it sitting in an undisclosed shadow (or shadows are disabled)\n    //  now we can just test to see if it would normally be visible or not, provided it's\n    //  attached to the main document.\n    // NOTE: We must consider case where node is inside a shadow DOM and given directly to\n    //  `isTabbable()` or `isFocusable()` -- regardless of `getShadowRoot` option setting.\n\n    if (isNodeAttached(node)) {\n      // this works wherever the node is: if there's at least one client rect, it's\n      //  somehow displayed; it also covers the CSS 'display: contents' case where the\n      //  node itself is hidden in place of its contents; and there's no need to search\n      //  up the hierarchy either\n      return !node.getClientRects().length;\n    }\n\n    // Else, the node isn't attached to the document, which means the `getClientRects()`\n    //  API will __always__ return zero rects (this can happen, for example, if React\n    //  is used to render nodes onto a detached tree, as confirmed in this thread:\n    //  https://github.com/facebook/react/issues/9117#issuecomment-284228870)\n    //\n    // It also means that even window.getComputedStyle(node).display will return `undefined`\n    //  because styles are only computed for nodes that are in the document.\n    //\n    // NOTE: THIS HAS BEEN THE CASE FOR YEARS. It is not new, nor is it caused by tabbable\n    //  somehow. Though it was never stated officially, anyone who has ever used tabbable\n    //  APIs on nodes in detached containers has actually implicitly used tabbable in what\n    //  was later (as of v5.2.0 on Apr 9, 2021) called `displayCheck=\"none\"` mode -- essentially\n    //  considering __everything__ to be visible because of the innability to determine styles.\n    //\n    // v6.0.0: As of this major release, the default 'full' option __no longer treats detached\n    //  nodes as visible with the 'none' fallback.__\n    if (displayCheck !== 'legacy-full') {\n      return true; // hidden\n    }\n    // else, fallback to 'none' mode and consider the node visible\n  } else if (displayCheck === 'non-zero-area') {\n    // NOTE: Even though this tests that the node's client rect is non-zero to determine\n    //  whether it's displayed, and that a detached node will __always__ have a zero-area\n    //  client rect, we don't special-case for whether the node is attached or not. In\n    //  this mode, we do want to consider nodes that have a zero area to be hidden at all\n    //  times, and that includes attached or not.\n    return isZeroArea(node);\n  }\n\n  // visible, as far as we can tell, or per current `displayCheck=none` mode, we assume\n  //  it's visible\n  return false;\n};\n\n// form fields (nested) inside a disabled fieldset are not focusable/tabbable\n//  unless they are in the _first_ <legend> element of the top-most disabled\n//  fieldset\nconst isDisabledFromFieldset = function (node) {\n  if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {\n    let parentNode = node.parentElement;\n    // check if `node` is contained in a disabled <fieldset>\n    while (parentNode) {\n      if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {\n        // look for the first <legend> among the children of the disabled <fieldset>\n        for (let i = 0; i < parentNode.children.length; i++) {\n          const child = parentNode.children.item(i);\n          // when the first <legend> (in document order) is found\n          if (child.tagName === 'LEGEND') {\n            // if its parent <fieldset> is not nested in another disabled <fieldset>,\n            // return whether `node` is a descendant of its first <legend>\n            return matches.call(parentNode, 'fieldset[disabled] *')\n              ? true\n              : !child.contains(node);\n          }\n        }\n        // the disabled <fieldset> containing `node` has no <legend>\n        return true;\n      }\n      parentNode = parentNode.parentElement;\n    }\n  }\n\n  // else, node's tabbable/focusable state should not be affected by a fieldset's\n  //  enabled/disabled state\n  return false;\n};\n\nconst isNodeMatchingSelectorFocusable = function (options, node) {\n  if (\n    node.disabled ||\n    isHiddenInput(node) ||\n    isHidden(node, options) ||\n    // For a details element with a summary, the summary element gets the focus\n    isDetailsWithSummary(node) ||\n    isDisabledFromFieldset(node)\n  ) {\n    return false;\n  }\n  return true;\n};\n\nconst isNodeMatchingSelectorTabbable = function (options, node) {\n  if (\n    isNonTabbableRadio(node) ||\n    getTabindex(node) < 0 ||\n    !isNodeMatchingSelectorFocusable(options, node)\n  ) {\n    return false;\n  }\n  return true;\n};\n\nconst isValidShadowRootTabbable = function (shadowHostNode) {\n  const tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);\n  if (isNaN(tabIndex) || tabIndex >= 0) {\n    return true;\n  }\n  // If a custom element has an explicit negative tabindex,\n  // browsers will not allow tab targeting said element's children.\n  return false;\n};\n\n/**\n * @param {Array.<Element|CandidateScope>} candidates\n * @returns Element[]\n */\nconst sortByOrder = function (candidates) {\n  const regularTabbables = [];\n  const orderedTabbables = [];\n  candidates.forEach(function (item, i) {\n    const isScope = !!item.scopeParent;\n    const element = isScope ? item.scopeParent : item;\n    const candidateTabindex = getTabindex(element, isScope);\n    const elements = isScope ? sortByOrder(item.candidates) : element;\n    if (candidateTabindex === 0) {\n      isScope\n        ? regularTabbables.push(...elements)\n        : regularTabbables.push(element);\n    } else {\n      orderedTabbables.push({\n        documentOrder: i,\n        tabIndex: candidateTabindex,\n        item: item,\n        isScope: isScope,\n        content: elements,\n      });\n    }\n  });\n\n  return orderedTabbables\n    .sort(sortOrderedTabbables)\n    .reduce((acc, sortable) => {\n      sortable.isScope\n        ? acc.push(...sortable.content)\n        : acc.push(sortable.content);\n      return acc;\n    }, [])\n    .concat(regularTabbables);\n};\n\nconst tabbable = function (el, options) {\n  options = options || {};\n\n  let candidates;\n  if (options.getShadowRoot) {\n    candidates = getCandidatesIteratively([el], options.includeContainer, {\n      filter: isNodeMatchingSelectorTabbable.bind(null, options),\n      flatten: false,\n      getShadowRoot: options.getShadowRoot,\n      shadowRootFilter: isValidShadowRootTabbable,\n    });\n  } else {\n    candidates = getCandidates(\n      el,\n      options.includeContainer,\n      isNodeMatchingSelectorTabbable.bind(null, options)\n    );\n  }\n  return sortByOrder(candidates);\n};\n\nconst focusable = function (el, options) {\n  options = options || {};\n\n  let candidates;\n  if (options.getShadowRoot) {\n    candidates = getCandidatesIteratively([el], options.includeContainer, {\n      filter: isNodeMatchingSelectorFocusable.bind(null, options),\n      flatten: true,\n      getShadowRoot: options.getShadowRoot,\n    });\n  } else {\n    candidates = getCandidates(\n      el,\n      options.includeContainer,\n      isNodeMatchingSelectorFocusable.bind(null, options)\n    );\n  }\n\n  return candidates;\n};\n\nconst isTabbable = function (node, options) {\n  options = options || {};\n  if (!node) {\n    throw new Error('No node provided');\n  }\n  if (matches.call(node, candidateSelector) === false) {\n    return false;\n  }\n  return isNodeMatchingSelectorTabbable(options, node);\n};\n\nconst focusableCandidateSelector = /* #__PURE__ */ candidateSelectors\n  .concat('iframe')\n  .join(',');\n\nconst isFocusable = function (node, options) {\n  options = options || {};\n  if (!node) {\n    throw new Error('No node provided');\n  }\n  if (matches.call(node, focusableCandidateSelector) === false) {\n    return false;\n  }\n  return isNodeMatchingSelectorFocusable(options, node);\n};\n\nexport { tabbable, focusable, isTabbable, isFocusable };\n","/*! tether 1.4.7 */\n\n(function(root, factory) {\n  if (typeof define === 'function' && define.amd) {\n    define([], factory);\n  } else if (typeof exports === 'object') {\n    module.exports = factory();\n  } else {\n    root.Tether = factory();\n  }\n}(this, function() {\n\n'use strict';\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nvar TetherBase = undefined;\nif (typeof TetherBase === 'undefined') {\n  TetherBase = { modules: [] };\n}\n\nvar zeroElement = null;\n\n// Same as native getBoundingClientRect, except it takes into account parent <frame> offsets\n// if the element lies within a nested document (<frame> or <iframe>-like).\nfunction getActualBoundingClientRect(node) {\n  var boundingRect = node.getBoundingClientRect();\n\n  // The original object returned by getBoundingClientRect is immutable, so we clone it\n  // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9\n  var rect = {};\n  for (var k in boundingRect) {\n    rect[k] = boundingRect[k];\n  }\n\n  try {\n    if (node.ownerDocument !== document) {\n      var _frameElement = node.ownerDocument.defaultView.frameElement;\n      if (_frameElement) {\n        var frameRect = getActualBoundingClientRect(_frameElement);\n        rect.top += frameRect.top;\n        rect.bottom += frameRect.top;\n        rect.left += frameRect.left;\n        rect.right += frameRect.left;\n      }\n    }\n  } catch (err) {\n    // Ignore \"Access is denied\" in IE11/Edge\n  }\n\n  return rect;\n}\n\nfunction getScrollParents(el) {\n  // In firefox if the el is inside an iframe with display: none; window.getComputedStyle() will return null;\n  // https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n  var computedStyle = getComputedStyle(el) || {};\n  var position = computedStyle.position;\n  var parents = [];\n\n  if (position === 'fixed') {\n    return [el];\n  }\n\n  var parent = el;\n  while ((parent = parent.parentNode) && parent && parent.nodeType === 1) {\n    var style = undefined;\n    try {\n      style = getComputedStyle(parent);\n    } catch (err) {}\n\n    if (typeof style === 'undefined' || style === null) {\n      parents.push(parent);\n      return parents;\n    }\n\n    var _style = style;\n    var overflow = _style.overflow;\n    var overflowX = _style.overflowX;\n    var overflowY = _style.overflowY;\n\n    if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {\n      if (position !== 'absolute' || ['relative', 'absolute', 'fixed'].indexOf(style.position) >= 0) {\n        parents.push(parent);\n      }\n    }\n  }\n\n  parents.push(el.ownerDocument.body);\n\n  // If the node is within a frame, account for the parent window scroll\n  if (el.ownerDocument !== document) {\n    parents.push(el.ownerDocument.defaultView);\n  }\n\n  return parents;\n}\n\nvar uniqueId = (function () {\n  var id = 0;\n  return function () {\n    return ++id;\n  };\n})();\n\nvar zeroPosCache = {};\nvar getOrigin = function getOrigin() {\n  // getBoundingClientRect is unfortunately too accurate.  It introduces a pixel or two of\n  // jitter as the user scrolls that messes with our ability to detect if two positions\n  // are equivilant or not.  We place an element at the top left of the page that will\n  // get the same jitter, so we can cancel the two out.\n  var node = zeroElement;\n  if (!node || !document.body.contains(node)) {\n    node = document.createElement('div');\n    node.setAttribute('data-tether-id', uniqueId());\n    extend(node.style, {\n      top: 0,\n      left: 0,\n      position: 'absolute'\n    });\n\n    document.body.appendChild(node);\n\n    zeroElement = node;\n  }\n\n  var id = node.getAttribute('data-tether-id');\n  if (typeof zeroPosCache[id] === 'undefined') {\n    zeroPosCache[id] = getActualBoundingClientRect(node);\n\n    // Clear the cache when this position call is done\n    defer(function () {\n      delete zeroPosCache[id];\n    });\n  }\n\n  return zeroPosCache[id];\n};\n\nfunction removeUtilElements() {\n  if (zeroElement) {\n    document.body.removeChild(zeroElement);\n  }\n  zeroElement = null;\n};\n\nfunction getBounds(el) {\n  var doc = undefined;\n  if (el === document) {\n    doc = document;\n    el = document.documentElement;\n  } else {\n    doc = el.ownerDocument;\n  }\n\n  var docEl = doc.documentElement;\n\n  var box = getActualBoundingClientRect(el);\n\n  var origin = getOrigin();\n\n  box.top -= origin.top;\n  box.left -= origin.left;\n\n  if (typeof box.width === 'undefined') {\n    box.width = document.body.scrollWidth - box.left - box.right;\n  }\n  if (typeof box.height === 'undefined') {\n    box.height = document.body.scrollHeight - box.top - box.bottom;\n  }\n\n  box.top = box.top - docEl.clientTop;\n  box.left = box.left - docEl.clientLeft;\n  box.right = doc.body.clientWidth - box.width - box.left;\n  box.bottom = doc.body.clientHeight - box.height - box.top;\n\n  return box;\n}\n\nfunction getOffsetParent(el) {\n  return el.offsetParent || document.documentElement;\n}\n\nvar _scrollBarSize = null;\nfunction getScrollBarSize() {\n  if (_scrollBarSize) {\n    return _scrollBarSize;\n  }\n  var inner = document.createElement('div');\n  inner.style.width = '100%';\n  inner.style.height = '200px';\n\n  var outer = document.createElement('div');\n  extend(outer.style, {\n    position: 'absolute',\n    top: 0,\n    left: 0,\n    pointerEvents: 'none',\n    visibility: 'hidden',\n    width: '200px',\n    height: '150px',\n    overflow: 'hidden'\n  });\n\n  outer.appendChild(inner);\n\n  document.body.appendChild(outer);\n\n  var widthContained = inner.offsetWidth;\n  outer.style.overflow = 'scroll';\n  var widthScroll = inner.offsetWidth;\n\n  if (widthContained === widthScroll) {\n    widthScroll = outer.clientWidth;\n  }\n\n  document.body.removeChild(outer);\n\n  var width = widthContained - widthScroll;\n\n  _scrollBarSize = { width: width, height: width };\n  return _scrollBarSize;\n}\n\nfunction extend() {\n  var out = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n  var args = [];\n\n  Array.prototype.push.apply(args, arguments);\n\n  args.slice(1).forEach(function (obj) {\n    if (obj) {\n      for (var key in obj) {\n        if (({}).hasOwnProperty.call(obj, key)) {\n          out[key] = obj[key];\n        }\n      }\n    }\n  });\n\n  return out;\n}\n\nfunction removeClass(el, name) {\n  if (typeof el.classList !== 'undefined') {\n    name.split(' ').forEach(function (cls) {\n      if (cls.trim()) {\n        el.classList.remove(cls);\n      }\n    });\n  } else {\n    var regex = new RegExp('(^| )' + name.split(' ').join('|') + '( |$)', 'gi');\n    var className = getClassName(el).replace(regex, ' ');\n    setClassName(el, className);\n  }\n}\n\nfunction addClass(el, name) {\n  if (typeof el.classList !== 'undefined') {\n    name.split(' ').forEach(function (cls) {\n      if (cls.trim()) {\n        el.classList.add(cls);\n      }\n    });\n  } else {\n    removeClass(el, name);\n    var cls = getClassName(el) + (' ' + name);\n    setClassName(el, cls);\n  }\n}\n\nfunction hasClass(el, name) {\n  if (typeof el.classList !== 'undefined') {\n    return el.classList.contains(name);\n  }\n  var className = getClassName(el);\n  return new RegExp('(^| )' + name + '( |$)', 'gi').test(className);\n}\n\nfunction getClassName(el) {\n  // Can't use just SVGAnimatedString here since nodes within a Frame in IE have\n  // completely separately SVGAnimatedString base classes\n  if (el.className instanceof el.ownerDocument.defaultView.SVGAnimatedString) {\n    return el.className.baseVal;\n  }\n  return el.className;\n}\n\nfunction setClassName(el, className) {\n  el.setAttribute('class', className);\n}\n\nfunction updateClasses(el, add, all) {\n  // Of the set of 'all' classes, we need the 'add' classes, and only the\n  // 'add' classes to be set.\n  all.forEach(function (cls) {\n    if (add.indexOf(cls) === -1 && hasClass(el, cls)) {\n      removeClass(el, cls);\n    }\n  });\n\n  add.forEach(function (cls) {\n    if (!hasClass(el, cls)) {\n      addClass(el, cls);\n    }\n  });\n}\n\nvar deferred = [];\n\nvar defer = function defer(fn) {\n  deferred.push(fn);\n};\n\nvar flush = function flush() {\n  var fn = undefined;\n  while (fn = deferred.pop()) {\n    fn();\n  }\n};\n\nvar Evented = (function () {\n  function Evented() {\n    _classCallCheck(this, Evented);\n  }\n\n  _createClass(Evented, [{\n    key: 'on',\n    value: function on(event, handler, ctx) {\n      var once = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];\n\n      if (typeof this.bindings === 'undefined') {\n        this.bindings = {};\n      }\n      if (typeof this.bindings[event] === 'undefined') {\n        this.bindings[event] = [];\n      }\n      this.bindings[event].push({ handler: handler, ctx: ctx, once: once });\n    }\n  }, {\n    key: 'once',\n    value: function once(event, handler, ctx) {\n      this.on(event, handler, ctx, true);\n    }\n  }, {\n    key: 'off',\n    value: function off(event, handler) {\n      if (typeof this.bindings === 'undefined' || typeof this.bindings[event] === 'undefined') {\n        return;\n      }\n\n      if (typeof handler === 'undefined') {\n        delete this.bindings[event];\n      } else {\n        var i = 0;\n        while (i < this.bindings[event].length) {\n          if (this.bindings[event][i].handler === handler) {\n            this.bindings[event].splice(i, 1);\n          } else {\n            ++i;\n          }\n        }\n      }\n    }\n  }, {\n    key: 'trigger',\n    value: function trigger(event) {\n      if (typeof this.bindings !== 'undefined' && this.bindings[event]) {\n        var i = 0;\n\n        for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n          args[_key - 1] = arguments[_key];\n        }\n\n        while (i < this.bindings[event].length) {\n          var _bindings$event$i = this.bindings[event][i];\n          var handler = _bindings$event$i.handler;\n          var ctx = _bindings$event$i.ctx;\n          var once = _bindings$event$i.once;\n\n          var context = ctx;\n          if (typeof context === 'undefined') {\n            context = this;\n          }\n\n          handler.apply(context, args);\n\n          if (once) {\n            this.bindings[event].splice(i, 1);\n          } else {\n            ++i;\n          }\n        }\n      }\n    }\n  }]);\n\n  return Evented;\n})();\n\nTetherBase.Utils = {\n  getActualBoundingClientRect: getActualBoundingClientRect,\n  getScrollParents: getScrollParents,\n  getBounds: getBounds,\n  getOffsetParent: getOffsetParent,\n  extend: extend,\n  addClass: addClass,\n  removeClass: removeClass,\n  hasClass: hasClass,\n  updateClasses: updateClasses,\n  defer: defer,\n  flush: flush,\n  uniqueId: uniqueId,\n  Evented: Evented,\n  getScrollBarSize: getScrollBarSize,\n  removeUtilElements: removeUtilElements\n};\n/* globals TetherBase, performance */\n\n'use strict';\n\nvar _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nvar _get = function get(_x6, _x7, _x8) { var _again = true; _function: while (_again) { var object = _x6, property = _x7, receiver = _x8; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x6 = parent; _x7 = property; _x8 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nif (typeof TetherBase === 'undefined') {\n  throw new Error('You must include the utils.js file before tether.js');\n}\n\nvar _TetherBase$Utils = TetherBase.Utils;\nvar getScrollParents = _TetherBase$Utils.getScrollParents;\nvar getBounds = _TetherBase$Utils.getBounds;\nvar getOffsetParent = _TetherBase$Utils.getOffsetParent;\nvar extend = _TetherBase$Utils.extend;\nvar addClass = _TetherBase$Utils.addClass;\nvar removeClass = _TetherBase$Utils.removeClass;\nvar updateClasses = _TetherBase$Utils.updateClasses;\nvar defer = _TetherBase$Utils.defer;\nvar flush = _TetherBase$Utils.flush;\nvar getScrollBarSize = _TetherBase$Utils.getScrollBarSize;\nvar removeUtilElements = _TetherBase$Utils.removeUtilElements;\n\nfunction within(a, b) {\n  var diff = arguments.length <= 2 || arguments[2] === undefined ? 1 : arguments[2];\n\n  return a + diff >= b && b >= a - diff;\n}\n\nvar transformKey = (function () {\n  if (typeof document === 'undefined') {\n    return '';\n  }\n  var el = document.createElement('div');\n\n  var transforms = ['transform', 'WebkitTransform', 'OTransform', 'MozTransform', 'msTransform'];\n  for (var i = 0; i < transforms.length; ++i) {\n    var key = transforms[i];\n    if (el.style[key] !== undefined) {\n      return key;\n    }\n  }\n})();\n\nvar tethers = [];\n\nvar position = function position() {\n  tethers.forEach(function (tether) {\n    tether.position(false);\n  });\n  flush();\n};\n\nfunction now() {\n  if (typeof performance === 'object' && typeof performance.now === 'function') {\n    return performance.now();\n  }\n  return +new Date();\n}\n\n(function () {\n  var lastCall = null;\n  var lastDuration = null;\n  var pendingTimeout = null;\n\n  var tick = function tick() {\n    if (typeof lastDuration !== 'undefined' && lastDuration > 16) {\n      // We voluntarily throttle ourselves if we can't manage 60fps\n      lastDuration = Math.min(lastDuration - 16, 250);\n\n      // Just in case this is the last event, remember to position just once more\n      pendingTimeout = setTimeout(tick, 250);\n      return;\n    }\n\n    if (typeof lastCall !== 'undefined' && now() - lastCall < 10) {\n      // Some browsers call events a little too frequently, refuse to run more than is reasonable\n      return;\n    }\n\n    if (pendingTimeout != null) {\n      clearTimeout(pendingTimeout);\n      pendingTimeout = null;\n    }\n\n    lastCall = now();\n    position();\n    lastDuration = now() - lastCall;\n  };\n\n  if (typeof window !== 'undefined' && typeof window.addEventListener !== 'undefined') {\n    ['resize', 'scroll', 'touchmove'].forEach(function (event) {\n      window.addEventListener(event, tick);\n    });\n  }\n})();\n\nvar MIRROR_LR = {\n  center: 'center',\n  left: 'right',\n  right: 'left'\n};\n\nvar MIRROR_TB = {\n  middle: 'middle',\n  top: 'bottom',\n  bottom: 'top'\n};\n\nvar OFFSET_MAP = {\n  top: 0,\n  left: 0,\n  middle: '50%',\n  center: '50%',\n  bottom: '100%',\n  right: '100%'\n};\n\nvar autoToFixedAttachment = function autoToFixedAttachment(attachment, relativeToAttachment) {\n  var left = attachment.left;\n  var top = attachment.top;\n\n  if (left === 'auto') {\n    left = MIRROR_LR[relativeToAttachment.left];\n  }\n\n  if (top === 'auto') {\n    top = MIRROR_TB[relativeToAttachment.top];\n  }\n\n  return { left: left, top: top };\n};\n\nvar attachmentToOffset = function attachmentToOffset(attachment) {\n  var left = attachment.left;\n  var top = attachment.top;\n\n  if (typeof OFFSET_MAP[attachment.left] !== 'undefined') {\n    left = OFFSET_MAP[attachment.left];\n  }\n\n  if (typeof OFFSET_MAP[attachment.top] !== 'undefined') {\n    top = OFFSET_MAP[attachment.top];\n  }\n\n  return { left: left, top: top };\n};\n\nfunction addOffset() {\n  var out = { top: 0, left: 0 };\n\n  for (var _len = arguments.length, offsets = Array(_len), _key = 0; _key < _len; _key++) {\n    offsets[_key] = arguments[_key];\n  }\n\n  offsets.forEach(function (_ref) {\n    var top = _ref.top;\n    var left = _ref.left;\n\n    if (typeof top === 'string') {\n      top = parseFloat(top, 10);\n    }\n    if (typeof left === 'string') {\n      left = parseFloat(left, 10);\n    }\n\n    out.top += top;\n    out.left += left;\n  });\n\n  return out;\n}\n\nfunction offsetToPx(offset, size) {\n  if (typeof offset.left === 'string' && offset.left.indexOf('%') !== -1) {\n    offset.left = parseFloat(offset.left, 10) / 100 * size.width;\n  }\n  if (typeof offset.top === 'string' && offset.top.indexOf('%') !== -1) {\n    offset.top = parseFloat(offset.top, 10) / 100 * size.height;\n  }\n\n  return offset;\n}\n\nvar parseOffset = function parseOffset(value) {\n  var _value$split = value.split(' ');\n\n  var _value$split2 = _slicedToArray(_value$split, 2);\n\n  var top = _value$split2[0];\n  var left = _value$split2[1];\n\n  return { top: top, left: left };\n};\nvar parseAttachment = parseOffset;\n\nvar TetherClass = (function (_Evented) {\n  _inherits(TetherClass, _Evented);\n\n  function TetherClass(options) {\n    var _this = this;\n\n    _classCallCheck(this, TetherClass);\n\n    _get(Object.getPrototypeOf(TetherClass.prototype), 'constructor', this).call(this);\n    this.position = this.position.bind(this);\n\n    tethers.push(this);\n\n    this.history = [];\n\n    this.setOptions(options, false);\n\n    TetherBase.modules.forEach(function (module) {\n      if (typeof module.initialize !== 'undefined') {\n        module.initialize.call(_this);\n      }\n    });\n\n    this.position();\n  }\n\n  _createClass(TetherClass, [{\n    key: 'getClass',\n    value: function getClass() {\n      var key = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];\n      var classes = this.options.classes;\n\n      if (typeof classes !== 'undefined' && classes[key]) {\n        return this.options.classes[key];\n      } else if (this.options.classPrefix) {\n        return this.options.classPrefix + '-' + key;\n      } else {\n        return key;\n      }\n    }\n  }, {\n    key: 'setOptions',\n    value: function setOptions(options) {\n      var _this2 = this;\n\n      var pos = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];\n\n      var defaults = {\n        offset: '0 0',\n        targetOffset: '0 0',\n        targetAttachment: 'auto auto',\n        classPrefix: 'tether'\n      };\n\n      this.options = extend(defaults, options);\n\n      var _options = this.options;\n      var element = _options.element;\n      var target = _options.target;\n      var targetModifier = _options.targetModifier;\n\n      this.element = element;\n      this.target = target;\n      this.targetModifier = targetModifier;\n\n      if (this.target === 'viewport') {\n        this.target = document.body;\n        this.targetModifier = 'visible';\n      } else if (this.target === 'scroll-handle') {\n        this.target = document.body;\n        this.targetModifier = 'scroll-handle';\n      }\n\n      ['element', 'target'].forEach(function (key) {\n        if (typeof _this2[key] === 'undefined') {\n          throw new Error('Tether Error: Both element and target must be defined');\n        }\n\n        if (typeof _this2[key].jquery !== 'undefined') {\n          _this2[key] = _this2[key][0];\n        } else if (typeof _this2[key] === 'string') {\n          _this2[key] = document.querySelector(_this2[key]);\n        }\n      });\n\n      addClass(this.element, this.getClass('element'));\n      if (!(this.options.addTargetClasses === false)) {\n        addClass(this.target, this.getClass('target'));\n      }\n\n      if (!this.options.attachment) {\n        throw new Error('Tether Error: You must provide an attachment');\n      }\n\n      this.targetAttachment = parseAttachment(this.options.targetAttachment);\n      this.attachment = parseAttachment(this.options.attachment);\n      this.offset = parseOffset(this.options.offset);\n      this.targetOffset = parseOffset(this.options.targetOffset);\n\n      if (typeof this.scrollParents !== 'undefined') {\n        this.disable();\n      }\n\n      if (this.targetModifier === 'scroll-handle') {\n        this.scrollParents = [this.target];\n      } else {\n        this.scrollParents = getScrollParents(this.target);\n      }\n\n      if (!(this.options.enabled === false)) {\n        this.enable(pos);\n      }\n    }\n  }, {\n    key: 'getTargetBounds',\n    value: function getTargetBounds() {\n      if (typeof this.targetModifier !== 'undefined') {\n        if (this.targetModifier === 'visible') {\n          if (this.target === document.body) {\n            return { top: pageYOffset, left: pageXOffset, height: innerHeight, width: innerWidth };\n          } else {\n            var bounds = getBounds(this.target);\n\n            var out = {\n              height: bounds.height,\n              width: bounds.width,\n              top: bounds.top,\n              left: bounds.left\n            };\n\n            out.height = Math.min(out.height, bounds.height - (pageYOffset - bounds.top));\n            out.height = Math.min(out.height, bounds.height - (bounds.top + bounds.height - (pageYOffset + innerHeight)));\n            out.height = Math.min(innerHeight, out.height);\n            out.height -= 2;\n\n            out.width = Math.min(out.width, bounds.width - (pageXOffset - bounds.left));\n            out.width = Math.min(out.width, bounds.width - (bounds.left + bounds.width - (pageXOffset + innerWidth)));\n            out.width = Math.min(innerWidth, out.width);\n            out.width -= 2;\n\n            if (out.top < pageYOffset) {\n              out.top = pageYOffset;\n            }\n            if (out.left < pageXOffset) {\n              out.left = pageXOffset;\n            }\n\n            return out;\n          }\n        } else if (this.targetModifier === 'scroll-handle') {\n          var bounds = undefined;\n          var target = this.target;\n          if (target === document.body) {\n            target = document.documentElement;\n\n            bounds = {\n              left: pageXOffset,\n              top: pageYOffset,\n              height: innerHeight,\n              width: innerWidth\n            };\n          } else {\n            bounds = getBounds(target);\n          }\n\n          var style = getComputedStyle(target);\n\n          var hasBottomScroll = target.scrollWidth > target.clientWidth || [style.overflow, style.overflowX].indexOf('scroll') >= 0 || this.target !== document.body;\n\n          var scrollBottom = 0;\n          if (hasBottomScroll) {\n            scrollBottom = 15;\n          }\n\n          var height = bounds.height - parseFloat(style.borderTopWidth) - parseFloat(style.borderBottomWidth) - scrollBottom;\n\n          var out = {\n            width: 15,\n            height: height * 0.975 * (height / target.scrollHeight),\n            left: bounds.left + bounds.width - parseFloat(style.borderLeftWidth) - 15\n          };\n\n          var fitAdj = 0;\n          if (height < 408 && this.target === document.body) {\n            fitAdj = -0.00011 * Math.pow(height, 2) - 0.00727 * height + 22.58;\n          }\n\n          if (this.target !== document.body) {\n            out.height = Math.max(out.height, 24);\n          }\n\n          var scrollPercentage = this.target.scrollTop / (target.scrollHeight - height);\n          out.top = scrollPercentage * (height - out.height - fitAdj) + bounds.top + parseFloat(style.borderTopWidth);\n\n          if (this.target === document.body) {\n            out.height = Math.max(out.height, 24);\n          }\n\n          return out;\n        }\n      } else {\n        return getBounds(this.target);\n      }\n    }\n  }, {\n    key: 'clearCache',\n    value: function clearCache() {\n      this._cache = {};\n    }\n  }, {\n    key: 'cache',\n    value: function cache(k, getter) {\n      // More than one module will often need the same DOM info, so\n      // we keep a cache which is cleared on each position call\n      if (typeof this._cache === 'undefined') {\n        this._cache = {};\n      }\n\n      if (typeof this._cache[k] === 'undefined') {\n        this._cache[k] = getter.call(this);\n      }\n\n      return this._cache[k];\n    }\n  }, {\n    key: 'enable',\n    value: function enable() {\n      var _this3 = this;\n\n      var pos = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0];\n\n      if (!(this.options.addTargetClasses === false)) {\n        addClass(this.target, this.getClass('enabled'));\n      }\n      addClass(this.element, this.getClass('enabled'));\n      this.enabled = true;\n\n      this.scrollParents.forEach(function (parent) {\n        if (parent !== _this3.target.ownerDocument) {\n          parent.addEventListener('scroll', _this3.position);\n        }\n      });\n\n      if (pos) {\n        this.position();\n      }\n    }\n  }, {\n    key: 'disable',\n    value: function disable() {\n      var _this4 = this;\n\n      removeClass(this.target, this.getClass('enabled'));\n      removeClass(this.element, this.getClass('enabled'));\n      this.enabled = false;\n\n      if (typeof this.scrollParents !== 'undefined') {\n        this.scrollParents.forEach(function (parent) {\n          parent.removeEventListener('scroll', _this4.position);\n        });\n      }\n    }\n  }, {\n    key: 'destroy',\n    value: function destroy() {\n      var _this5 = this;\n\n      this.disable();\n\n      tethers.forEach(function (tether, i) {\n        if (tether === _this5) {\n          tethers.splice(i, 1);\n        }\n      });\n\n      // Remove any elements we were using for convenience from the DOM\n      if (tethers.length === 0) {\n        removeUtilElements();\n      }\n    }\n  }, {\n    key: 'updateAttachClasses',\n    value: function updateAttachClasses(elementAttach, targetAttach) {\n      var _this6 = this;\n\n      elementAttach = elementAttach || this.attachment;\n      targetAttach = targetAttach || this.targetAttachment;\n      var sides = ['left', 'top', 'bottom', 'right', 'middle', 'center'];\n\n      if (typeof this._addAttachClasses !== 'undefined' && this._addAttachClasses.length) {\n        // updateAttachClasses can be called more than once in a position call, so\n        // we need to clean up after ourselves such that when the last defer gets\n        // ran it doesn't add any extra classes from previous calls.\n        this._addAttachClasses.splice(0, this._addAttachClasses.length);\n      }\n\n      if (typeof this._addAttachClasses === 'undefined') {\n        this._addAttachClasses = [];\n      }\n      var add = this._addAttachClasses;\n\n      if (elementAttach.top) {\n        add.push(this.getClass('element-attached') + '-' + elementAttach.top);\n      }\n      if (elementAttach.left) {\n        add.push(this.getClass('element-attached') + '-' + elementAttach.left);\n      }\n      if (targetAttach.top) {\n        add.push(this.getClass('target-attached') + '-' + targetAttach.top);\n      }\n      if (targetAttach.left) {\n        add.push(this.getClass('target-attached') + '-' + targetAttach.left);\n      }\n\n      var all = [];\n      sides.forEach(function (side) {\n        all.push(_this6.getClass('element-attached') + '-' + side);\n        all.push(_this6.getClass('target-attached') + '-' + side);\n      });\n\n      defer(function () {\n        if (!(typeof _this6._addAttachClasses !== 'undefined')) {\n          return;\n        }\n\n        updateClasses(_this6.element, _this6._addAttachClasses, all);\n        if (!(_this6.options.addTargetClasses === false)) {\n          updateClasses(_this6.target, _this6._addAttachClasses, all);\n        }\n\n        delete _this6._addAttachClasses;\n      });\n    }\n  }, {\n    key: 'position',\n    value: function position() {\n      var _this7 = this;\n\n      var flushChanges = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0];\n\n      // flushChanges commits the changes immediately, leave true unless you are positioning multiple\n      // tethers (in which case call Tether.Utils.flush yourself when you're done)\n\n      if (!this.enabled) {\n        return;\n      }\n\n      this.clearCache();\n\n      // Turn 'auto' attachments into the appropriate corner or edge\n      var targetAttachment = autoToFixedAttachment(this.targetAttachment, this.attachment);\n\n      this.updateAttachClasses(this.attachment, targetAttachment);\n\n      var elementPos = this.cache('element-bounds', function () {\n        return getBounds(_this7.element);\n      });\n\n      var width = elementPos.width;\n      var height = elementPos.height;\n\n      if (width === 0 && height === 0 && typeof this.lastSize !== 'undefined') {\n        var _lastSize = this.lastSize;\n\n        // We cache the height and width to make it possible to position elements that are\n        // getting hidden.\n        width = _lastSize.width;\n        height = _lastSize.height;\n      } else {\n        this.lastSize = { width: width, height: height };\n      }\n\n      var targetPos = this.cache('target-bounds', function () {\n        return _this7.getTargetBounds();\n      });\n      var targetSize = targetPos;\n\n      // Get an actual px offset from the attachment\n      var offset = offsetToPx(attachmentToOffset(this.attachment), { width: width, height: height });\n      var targetOffset = offsetToPx(attachmentToOffset(targetAttachment), targetSize);\n\n      var manualOffset = offsetToPx(this.offset, { width: width, height: height });\n      var manualTargetOffset = offsetToPx(this.targetOffset, targetSize);\n\n      // Add the manually provided offset\n      offset = addOffset(offset, manualOffset);\n      targetOffset = addOffset(targetOffset, manualTargetOffset);\n\n      // It's now our goal to make (element position + offset) == (target position + target offset)\n      var left = targetPos.left + targetOffset.left - offset.left;\n      var top = targetPos.top + targetOffset.top - offset.top;\n\n      for (var i = 0; i < TetherBase.modules.length; ++i) {\n        var _module2 = TetherBase.modules[i];\n        var ret = _module2.position.call(this, {\n          left: left,\n          top: top,\n          targetAttachment: targetAttachment,\n          targetPos: targetPos,\n          elementPos: elementPos,\n          offset: offset,\n          targetOffset: targetOffset,\n          manualOffset: manualOffset,\n          manualTargetOffset: manualTargetOffset,\n          scrollbarSize: scrollbarSize,\n          attachment: this.attachment\n        });\n\n        if (ret === false) {\n          return false;\n        } else if (typeof ret === 'undefined' || typeof ret !== 'object') {\n          continue;\n        } else {\n          top = ret.top;\n          left = ret.left;\n        }\n      }\n\n      // We describe the position three different ways to give the optimizer\n      // a chance to decide the best possible way to position the element\n      // with the fewest repaints.\n      var next = {\n        // It's position relative to the page (absolute positioning when\n        // the element is a child of the body)\n        page: {\n          top: top,\n          left: left\n        },\n\n        // It's position relative to the viewport (fixed positioning)\n        viewport: {\n          top: top - pageYOffset,\n          bottom: pageYOffset - top - height + innerHeight,\n          left: left - pageXOffset,\n          right: pageXOffset - left - width + innerWidth\n        }\n      };\n\n      var doc = this.target.ownerDocument;\n      var win = doc.defaultView;\n\n      var scrollbarSize = undefined;\n      if (win.innerHeight > doc.documentElement.clientHeight) {\n        scrollbarSize = this.cache('scrollbar-size', getScrollBarSize);\n        next.viewport.bottom -= scrollbarSize.height;\n      }\n\n      if (win.innerWidth > doc.documentElement.clientWidth) {\n        scrollbarSize = this.cache('scrollbar-size', getScrollBarSize);\n        next.viewport.right -= scrollbarSize.width;\n      }\n\n      if (['', 'static'].indexOf(doc.body.style.position) === -1 || ['', 'static'].indexOf(doc.body.parentElement.style.position) === -1) {\n        // Absolute positioning in the body will be relative to the page, not the 'initial containing block'\n        next.page.bottom = doc.body.scrollHeight - top - height;\n        next.page.right = doc.body.scrollWidth - left - width;\n      }\n\n      if (typeof this.options.optimizations !== 'undefined' && this.options.optimizations.moveElement !== false && !(typeof this.targetModifier !== 'undefined')) {\n        (function () {\n          var offsetParent = _this7.cache('target-offsetparent', function () {\n            return getOffsetParent(_this7.target);\n          });\n          var offsetPosition = _this7.cache('target-offsetparent-bounds', function () {\n            return getBounds(offsetParent);\n          });\n          var offsetParentStyle = getComputedStyle(offsetParent);\n          var offsetParentSize = offsetPosition;\n\n          var offsetBorder = {};\n          ['Top', 'Left', 'Bottom', 'Right'].forEach(function (side) {\n            offsetBorder[side.toLowerCase()] = parseFloat(offsetParentStyle['border' + side + 'Width']);\n          });\n\n          offsetPosition.right = doc.body.scrollWidth - offsetPosition.left - offsetParentSize.width + offsetBorder.right;\n          offsetPosition.bottom = doc.body.scrollHeight - offsetPosition.top - offsetParentSize.height + offsetBorder.bottom;\n\n          if (next.page.top >= offsetPosition.top + offsetBorder.top && next.page.bottom >= offsetPosition.bottom) {\n            if (next.page.left >= offsetPosition.left + offsetBorder.left && next.page.right >= offsetPosition.right) {\n              // We're within the visible part of the target's scroll parent\n              var scrollTop = offsetParent.scrollTop;\n              var scrollLeft = offsetParent.scrollLeft;\n\n              // It's position relative to the target's offset parent (absolute positioning when\n              // the element is moved to be a child of the target's offset parent).\n              next.offset = {\n                top: next.page.top - offsetPosition.top + scrollTop - offsetBorder.top,\n                left: next.page.left - offsetPosition.left + scrollLeft - offsetBorder.left\n              };\n            }\n          }\n        })();\n      }\n\n      // We could also travel up the DOM and try each containing context, rather than only\n      // looking at the body, but we're gonna get diminishing returns.\n\n      this.move(next);\n\n      this.history.unshift(next);\n\n      if (this.history.length > 3) {\n        this.history.pop();\n      }\n\n      if (flushChanges) {\n        flush();\n      }\n\n      return true;\n    }\n\n    // THE ISSUE\n  }, {\n    key: 'move',\n    value: function move(pos) {\n      var _this8 = this;\n\n      if (!(typeof this.element.parentNode !== 'undefined')) {\n        return;\n      }\n\n      var same = {};\n\n      for (var type in pos) {\n        same[type] = {};\n\n        for (var key in pos[type]) {\n          var found = false;\n\n          for (var i = 0; i < this.history.length; ++i) {\n            var point = this.history[i];\n            if (typeof point[type] !== 'undefined' && !within(point[type][key], pos[type][key])) {\n              found = true;\n              break;\n            }\n          }\n\n          if (!found) {\n            same[type][key] = true;\n          }\n        }\n      }\n\n      var css = { top: '', left: '', right: '', bottom: '' };\n\n      var transcribe = function transcribe(_same, _pos) {\n        var hasOptimizations = typeof _this8.options.optimizations !== 'undefined';\n        var gpu = hasOptimizations ? _this8.options.optimizations.gpu : null;\n        if (gpu !== false) {\n          var yPos = undefined,\n              xPos = undefined;\n          if (_same.top) {\n            css.top = 0;\n            yPos = _pos.top;\n          } else {\n            css.bottom = 0;\n            yPos = -_pos.bottom;\n          }\n\n          if (_same.left) {\n            css.left = 0;\n            xPos = _pos.left;\n          } else {\n            css.right = 0;\n            xPos = -_pos.right;\n          }\n\n          if (typeof window.devicePixelRatio === 'number' && devicePixelRatio % 1 === 0) {\n            xPos = Math.round(xPos * devicePixelRatio) / devicePixelRatio;\n            yPos = Math.round(yPos * devicePixelRatio) / devicePixelRatio;\n          }\n\n          css[transformKey] = 'translateX(' + xPos + 'px) translateY(' + yPos + 'px)';\n\n          if (transformKey !== 'msTransform') {\n            // The Z transform will keep this in the GPU (faster, and prevents artifacts),\n            // but IE9 doesn't support 3d transforms and will choke.\n            css[transformKey] += \" translateZ(0)\";\n          }\n        } else {\n          if (_same.top) {\n            css.top = _pos.top + 'px';\n          } else {\n            css.bottom = _pos.bottom + 'px';\n          }\n\n          if (_same.left) {\n            css.left = _pos.left + 'px';\n          } else {\n            css.right = _pos.right + 'px';\n          }\n        }\n      };\n\n      var moved = false;\n      if ((same.page.top || same.page.bottom) && (same.page.left || same.page.right)) {\n        css.position = 'absolute';\n        transcribe(same.page, pos.page);\n      } else if ((same.viewport.top || same.viewport.bottom) && (same.viewport.left || same.viewport.right)) {\n        css.position = 'fixed';\n        transcribe(same.viewport, pos.viewport);\n      } else if (typeof same.offset !== 'undefined' && same.offset.top && same.offset.left) {\n        (function () {\n          css.position = 'absolute';\n          var offsetParent = _this8.cache('target-offsetparent', function () {\n            return getOffsetParent(_this8.target);\n          });\n\n          if (getOffsetParent(_this8.element) !== offsetParent) {\n            defer(function () {\n              _this8.element.parentNode.removeChild(_this8.element);\n              offsetParent.appendChild(_this8.element);\n            });\n          }\n\n          transcribe(same.offset, pos.offset);\n          moved = true;\n        })();\n      } else {\n        css.position = 'absolute';\n        transcribe({ top: true, left: true }, pos.page);\n      }\n\n      if (!moved) {\n        if (this.options.bodyElement) {\n          if (this.element.parentNode !== this.options.bodyElement) {\n            this.options.bodyElement.appendChild(this.element);\n          }\n        } else {\n          var isFullscreenElement = function isFullscreenElement(e) {\n            var d = e.ownerDocument;\n            var fe = d.fullscreenElement || d.webkitFullscreenElement || d.mozFullScreenElement || d.msFullscreenElement;\n            return fe === e;\n          };\n\n          var offsetParentIsBody = true;\n\n          var currentNode = this.element.parentNode;\n          while (currentNode && currentNode.nodeType === 1 && currentNode.tagName !== 'BODY' && !isFullscreenElement(currentNode)) {\n            if (getComputedStyle(currentNode).position !== 'static') {\n              offsetParentIsBody = false;\n              break;\n            }\n\n            currentNode = currentNode.parentNode;\n          }\n\n          if (!offsetParentIsBody) {\n            this.element.parentNode.removeChild(this.element);\n            this.element.ownerDocument.body.appendChild(this.element);\n          }\n        }\n      }\n\n      // Any css change will trigger a repaint, so let's avoid one if nothing changed\n      var writeCSS = {};\n      var write = false;\n      for (var key in css) {\n        var val = css[key];\n        var elVal = this.element.style[key];\n\n        if (elVal !== val) {\n          write = true;\n          writeCSS[key] = val;\n        }\n      }\n\n      if (write) {\n        defer(function () {\n          extend(_this8.element.style, writeCSS);\n          _this8.trigger('repositioned');\n        });\n      }\n    }\n  }]);\n\n  return TetherClass;\n})(Evented);\n\nTetherClass.modules = [];\n\nTetherBase.position = position;\n\nvar Tether = extend(TetherClass, TetherBase);\n/* globals TetherBase */\n\n'use strict';\n\nvar _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();\n\nvar _TetherBase$Utils = TetherBase.Utils;\nvar getBounds = _TetherBase$Utils.getBounds;\nvar extend = _TetherBase$Utils.extend;\nvar updateClasses = _TetherBase$Utils.updateClasses;\nvar defer = _TetherBase$Utils.defer;\n\nvar BOUNDS_FORMAT = ['left', 'top', 'right', 'bottom'];\n\nfunction getBoundingRect(tether, to) {\n  if (to === 'scrollParent') {\n    to = tether.scrollParents[0];\n  } else if (to === 'window') {\n    to = [pageXOffset, pageYOffset, innerWidth + pageXOffset, innerHeight + pageYOffset];\n  }\n\n  if (to === document) {\n    to = to.documentElement;\n  }\n\n  if (typeof to.nodeType !== 'undefined') {\n    (function () {\n      var node = to;\n      var size = getBounds(to);\n      var pos = size;\n      var style = getComputedStyle(to);\n\n      to = [pos.left, pos.top, size.width + pos.left, size.height + pos.top];\n\n      // Account any parent Frames scroll offset\n      if (node.ownerDocument !== document) {\n        var win = node.ownerDocument.defaultView;\n        to[0] += win.pageXOffset;\n        to[1] += win.pageYOffset;\n        to[2] += win.pageXOffset;\n        to[3] += win.pageYOffset;\n      }\n\n      BOUNDS_FORMAT.forEach(function (side, i) {\n        side = side[0].toUpperCase() + side.substr(1);\n        if (side === 'Top' || side === 'Left') {\n          to[i] += parseFloat(style['border' + side + 'Width']);\n        } else {\n          to[i] -= parseFloat(style['border' + side + 'Width']);\n        }\n      });\n    })();\n  }\n\n  return to;\n}\n\nTetherBase.modules.push({\n  position: function position(_ref) {\n    var _this = this;\n\n    var top = _ref.top;\n    var left = _ref.left;\n    var targetAttachment = _ref.targetAttachment;\n\n    if (!this.options.constraints) {\n      return true;\n    }\n\n    var _cache = this.cache('element-bounds', function () {\n      return getBounds(_this.element);\n    });\n\n    var height = _cache.height;\n    var width = _cache.width;\n\n    if (width === 0 && height === 0 && typeof this.lastSize !== 'undefined') {\n      var _lastSize = this.lastSize;\n\n      // Handle the item getting hidden as a result of our positioning without glitching\n      // the classes in and out\n      width = _lastSize.width;\n      height = _lastSize.height;\n    }\n\n    var targetSize = this.cache('target-bounds', function () {\n      return _this.getTargetBounds();\n    });\n\n    var targetHeight = targetSize.height;\n    var targetWidth = targetSize.width;\n\n    var allClasses = [this.getClass('pinned'), this.getClass('out-of-bounds')];\n\n    this.options.constraints.forEach(function (constraint) {\n      var outOfBoundsClass = constraint.outOfBoundsClass;\n      var pinnedClass = constraint.pinnedClass;\n\n      if (outOfBoundsClass) {\n        allClasses.push(outOfBoundsClass);\n      }\n      if (pinnedClass) {\n        allClasses.push(pinnedClass);\n      }\n    });\n\n    allClasses.forEach(function (cls) {\n      ['left', 'top', 'right', 'bottom'].forEach(function (side) {\n        allClasses.push(cls + '-' + side);\n      });\n    });\n\n    var addClasses = [];\n\n    var tAttachment = extend({}, targetAttachment);\n    var eAttachment = extend({}, this.attachment);\n\n    this.options.constraints.forEach(function (constraint) {\n      var to = constraint.to;\n      var attachment = constraint.attachment;\n      var pin = constraint.pin;\n\n      if (typeof attachment === 'undefined') {\n        attachment = '';\n      }\n\n      var changeAttachX = undefined,\n          changeAttachY = undefined;\n      if (attachment.indexOf(' ') >= 0) {\n        var _attachment$split = attachment.split(' ');\n\n        var _attachment$split2 = _slicedToArray(_attachment$split, 2);\n\n        changeAttachY = _attachment$split2[0];\n        changeAttachX = _attachment$split2[1];\n      } else {\n        changeAttachX = changeAttachY = attachment;\n      }\n\n      var bounds = getBoundingRect(_this, to);\n\n      if (changeAttachY === 'target' || changeAttachY === 'both') {\n        if (top < bounds[1] && tAttachment.top === 'top') {\n          top += targetHeight;\n          tAttachment.top = 'bottom';\n        }\n\n        if (top + height > bounds[3] && tAttachment.top === 'bottom') {\n          top -= targetHeight;\n          tAttachment.top = 'top';\n        }\n      }\n\n      if (changeAttachY === 'together') {\n        if (tAttachment.top === 'top') {\n          if (eAttachment.top === 'bottom' && top < bounds[1]) {\n            top += targetHeight;\n            tAttachment.top = 'bottom';\n\n            top += height;\n            eAttachment.top = 'top';\n          } else if (eAttachment.top === 'top' && top + height > bounds[3] && top - (height - targetHeight) >= bounds[1]) {\n            top -= height - targetHeight;\n            tAttachment.top = 'bottom';\n\n            eAttachment.top = 'bottom';\n          }\n        }\n\n        if (tAttachment.top === 'bottom') {\n          if (eAttachment.top === 'top' && top + height > bounds[3]) {\n            top -= targetHeight;\n            tAttachment.top = 'top';\n\n            top -= height;\n            eAttachment.top = 'bottom';\n          } else if (eAttachment.top === 'bottom' && top < bounds[1] && top + (height * 2 - targetHeight) <= bounds[3]) {\n            top += height - targetHeight;\n            tAttachment.top = 'top';\n\n            eAttachment.top = 'top';\n          }\n        }\n\n        if (tAttachment.top === 'middle') {\n          if (top + height > bounds[3] && eAttachment.top === 'top') {\n            top -= height;\n            eAttachment.top = 'bottom';\n          } else if (top < bounds[1] && eAttachment.top === 'bottom') {\n            top += height;\n            eAttachment.top = 'top';\n          }\n        }\n      }\n\n      if (changeAttachX === 'target' || changeAttachX === 'both') {\n        if (left < bounds[0] && tAttachment.left === 'left') {\n          left += targetWidth;\n          tAttachment.left = 'right';\n        }\n\n        if (left + width > bounds[2] && tAttachment.left === 'right') {\n          left -= targetWidth;\n          tAttachment.left = 'left';\n        }\n      }\n\n      if (changeAttachX === 'together') {\n        if (left < bounds[0] && tAttachment.left === 'left') {\n          if (eAttachment.left === 'right') {\n            left += targetWidth;\n            tAttachment.left = 'right';\n\n            left += width;\n            eAttachment.left = 'left';\n          } else if (eAttachment.left === 'left') {\n            left += targetWidth;\n            tAttachment.left = 'right';\n\n            left -= width;\n            eAttachment.left = 'right';\n          }\n        } else if (left + width > bounds[2] && tAttachment.left === 'right') {\n          if (eAttachment.left === 'left') {\n            left -= targetWidth;\n            tAttachment.left = 'left';\n\n            left -= width;\n            eAttachment.left = 'right';\n          } else if (eAttachment.left === 'right') {\n            left -= targetWidth;\n            tAttachment.left = 'left';\n\n            left += width;\n            eAttachment.left = 'left';\n          }\n        } else if (tAttachment.left === 'center') {\n          if (left + width > bounds[2] && eAttachment.left === 'left') {\n            left -= width;\n            eAttachment.left = 'right';\n          } else if (left < bounds[0] && eAttachment.left === 'right') {\n            left += width;\n            eAttachment.left = 'left';\n          }\n        }\n      }\n\n      if (changeAttachY === 'element' || changeAttachY === 'both') {\n        if (top < bounds[1] && eAttachment.top === 'bottom') {\n          top += height;\n          eAttachment.top = 'top';\n        }\n\n        if (top + height > bounds[3] && eAttachment.top === 'top') {\n          top -= height;\n          eAttachment.top = 'bottom';\n        }\n      }\n\n      if (changeAttachX === 'element' || changeAttachX === 'both') {\n        if (left < bounds[0]) {\n          if (eAttachment.left === 'right') {\n            left += width;\n            eAttachment.left = 'left';\n          } else if (eAttachment.left === 'center') {\n            left += width / 2;\n            eAttachment.left = 'left';\n          }\n        }\n\n        if (left + width > bounds[2]) {\n          if (eAttachment.left === 'left') {\n            left -= width;\n            eAttachment.left = 'right';\n          } else if (eAttachment.left === 'center') {\n            left -= width / 2;\n            eAttachment.left = 'right';\n          }\n        }\n      }\n\n      if (typeof pin === 'string') {\n        pin = pin.split(',').map(function (p) {\n          return p.trim();\n        });\n      } else if (pin === true) {\n        pin = ['top', 'left', 'right', 'bottom'];\n      }\n\n      pin = pin || [];\n\n      var pinned = [];\n      var oob = [];\n\n      if (top < bounds[1]) {\n        if (pin.indexOf('top') >= 0) {\n          top = bounds[1];\n          pinned.push('top');\n        } else {\n          oob.push('top');\n        }\n      }\n\n      if (top + height > bounds[3]) {\n        if (pin.indexOf('bottom') >= 0) {\n          top = bounds[3] - height;\n          pinned.push('bottom');\n        } else {\n          oob.push('bottom');\n        }\n      }\n\n      if (left < bounds[0]) {\n        if (pin.indexOf('left') >= 0) {\n          left = bounds[0];\n          pinned.push('left');\n        } else {\n          oob.push('left');\n        }\n      }\n\n      if (left + width > bounds[2]) {\n        if (pin.indexOf('right') >= 0) {\n          left = bounds[2] - width;\n          pinned.push('right');\n        } else {\n          oob.push('right');\n        }\n      }\n\n      if (pinned.length) {\n        (function () {\n          var pinnedClass = undefined;\n          if (typeof _this.options.pinnedClass !== 'undefined') {\n            pinnedClass = _this.options.pinnedClass;\n          } else {\n            pinnedClass = _this.getClass('pinned');\n          }\n\n          addClasses.push(pinnedClass);\n          pinned.forEach(function (side) {\n            addClasses.push(pinnedClass + '-' + side);\n          });\n        })();\n      }\n\n      if (oob.length) {\n        (function () {\n          var oobClass = undefined;\n          if (typeof _this.options.outOfBoundsClass !== 'undefined') {\n            oobClass = _this.options.outOfBoundsClass;\n          } else {\n            oobClass = _this.getClass('out-of-bounds');\n          }\n\n          addClasses.push(oobClass);\n          oob.forEach(function (side) {\n            addClasses.push(oobClass + '-' + side);\n          });\n        })();\n      }\n\n      if (pinned.indexOf('left') >= 0 || pinned.indexOf('right') >= 0) {\n        eAttachment.left = tAttachment.left = false;\n      }\n      if (pinned.indexOf('top') >= 0 || pinned.indexOf('bottom') >= 0) {\n        eAttachment.top = tAttachment.top = false;\n      }\n\n      if (tAttachment.top !== targetAttachment.top || tAttachment.left !== targetAttachment.left || eAttachment.top !== _this.attachment.top || eAttachment.left !== _this.attachment.left) {\n        _this.updateAttachClasses(eAttachment, tAttachment);\n        _this.trigger('update', {\n          attachment: eAttachment,\n          targetAttachment: tAttachment\n        });\n      }\n    });\n\n    defer(function () {\n      if (!(_this.options.addTargetClasses === false)) {\n        updateClasses(_this.target, addClasses, allClasses);\n      }\n      updateClasses(_this.element, addClasses, allClasses);\n    });\n\n    return { top: top, left: left };\n  }\n});\n/* globals TetherBase */\n\n'use strict';\n\nvar _TetherBase$Utils = TetherBase.Utils;\nvar getBounds = _TetherBase$Utils.getBounds;\nvar updateClasses = _TetherBase$Utils.updateClasses;\nvar defer = _TetherBase$Utils.defer;\n\nTetherBase.modules.push({\n  position: function position(_ref) {\n    var _this = this;\n\n    var top = _ref.top;\n    var left = _ref.left;\n\n    var _cache = this.cache('element-bounds', function () {\n      return getBounds(_this.element);\n    });\n\n    var height = _cache.height;\n    var width = _cache.width;\n\n    var targetPos = this.getTargetBounds();\n\n    var bottom = top + height;\n    var right = left + width;\n\n    var abutted = [];\n    if (top <= targetPos.bottom && bottom >= targetPos.top) {\n      ['left', 'right'].forEach(function (side) {\n        var targetPosSide = targetPos[side];\n        if (targetPosSide === left || targetPosSide === right) {\n          abutted.push(side);\n        }\n      });\n    }\n\n    if (left <= targetPos.right && right >= targetPos.left) {\n      ['top', 'bottom'].forEach(function (side) {\n        var targetPosSide = targetPos[side];\n        if (targetPosSide === top || targetPosSide === bottom) {\n          abutted.push(side);\n        }\n      });\n    }\n\n    var allClasses = [];\n    var addClasses = [];\n\n    var sides = ['left', 'top', 'right', 'bottom'];\n    allClasses.push(this.getClass('abutted'));\n    sides.forEach(function (side) {\n      allClasses.push(_this.getClass('abutted') + '-' + side);\n    });\n\n    if (abutted.length) {\n      addClasses.push(this.getClass('abutted'));\n    }\n\n    abutted.forEach(function (side) {\n      addClasses.push(_this.getClass('abutted') + '-' + side);\n    });\n\n    defer(function () {\n      if (!(_this.options.addTargetClasses === false)) {\n        updateClasses(_this.target, addClasses, allClasses);\n      }\n      updateClasses(_this.element, addClasses, allClasses);\n    });\n\n    return true;\n  }\n});\n/* globals TetherBase */\n\n'use strict';\n\nvar _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();\n\nTetherBase.modules.push({\n  position: function position(_ref) {\n    var top = _ref.top;\n    var left = _ref.left;\n\n    if (!this.options.shift) {\n      return;\n    }\n\n    var shift = this.options.shift;\n    if (typeof this.options.shift === 'function') {\n      shift = this.options.shift.call(this, { top: top, left: left });\n    }\n\n    var shiftTop = undefined,\n        shiftLeft = undefined;\n    if (typeof shift === 'string') {\n      shift = shift.split(' ');\n      shift[1] = shift[1] || shift[0];\n\n      var _shift = shift;\n\n      var _shift2 = _slicedToArray(_shift, 2);\n\n      shiftTop = _shift2[0];\n      shiftLeft = _shift2[1];\n\n      shiftTop = parseFloat(shiftTop, 10);\n      shiftLeft = parseFloat(shiftLeft, 10);\n    } else {\n      shiftTop = shift.top;\n      shiftLeft = shift.left;\n    }\n\n    top += shiftTop;\n    left += shiftLeft;\n\n    return { top: top, left: left };\n  }\n});\nreturn Tether;\n\n}));\n","export default typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';\n","import isBrowser from './isBrowser';\n\nconst timeoutDuration = (function(){\n  const longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];\n  for (let i = 0; i < longerTimeoutBrowsers.length; i += 1) {\n    if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {\n      return 1;\n    }\n  }\n  return 0;\n}());\n\nexport function microtaskDebounce(fn) {\n  let called = false\n  return () => {\n    if (called) {\n      return\n    }\n    called = true\n    window.Promise.resolve().then(() => {\n      called = false\n      fn()\n    })\n  }\n}\n\nexport function taskDebounce(fn) {\n  let scheduled = false;\n  return () => {\n    if (!scheduled) {\n      scheduled = true;\n      setTimeout(() => {\n        scheduled = false;\n        fn();\n      }, timeoutDuration);\n    }\n  };\n}\n\nconst supportsMicroTasks = isBrowser && window.Promise\n\n\n/**\n* Create a debounced version of a method, that's asynchronously deferred\n* but called in the minimum time possible.\n*\n* @method\n* @memberof Popper.Utils\n* @argument {Function} fn\n* @returns {Function}\n*/\nexport default (supportsMicroTasks\n  ? microtaskDebounce\n  : taskDebounce);\n","/**\n * Check if the given variable is a function\n * @method\n * @memberof Popper.Utils\n * @argument {Any} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\nexport default function isFunction(functionToCheck) {\n  const getType = {};\n  return (\n    functionToCheck &&\n    getType.toString.call(functionToCheck) === '[object Function]'\n  );\n}\n","/**\n * Get CSS computed property of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Eement} element\n * @argument {String} property\n */\nexport default function getStyleComputedProperty(element, property) {\n  if (element.nodeType !== 1) {\n    return [];\n  }\n  // NOTE: 1 DOM access here\n  const window = element.ownerDocument.defaultView;\n  const css = window.getComputedStyle(element, null);\n  return property ? css[property] : css;\n}\n","/**\n * Returns the parentNode or the host of the element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} parent\n */\nexport default function getParentNode(element) {\n  if (element.nodeName === 'HTML') {\n    return element;\n  }\n  return element.parentNode || element.host;\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport getParentNode from './getParentNode';\n\n/**\n * Returns the scrolling parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} scroll parent\n */\nexport default function getScrollParent(element) {\n  // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n  if (!element) {\n    return document.body\n  }\n\n  switch (element.nodeName) {\n    case 'HTML':\n    case 'BODY':\n      return element.ownerDocument.body\n    case '#document':\n      return element.body\n  }\n\n  // Firefox want us to check `-x` and `-y` variations as well\n  const { overflow, overflowX, overflowY } = getStyleComputedProperty(element);\n  if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {\n    return element;\n  }\n\n  return getScrollParent(getParentNode(element));\n}\n","/**\n * Returns the reference node of the reference object, or the reference object itself.\n * @method\n * @memberof Popper.Utils\n * @param {Element|Object} reference - the reference element (the popper will be relative to this)\n * @returns {Element} parent\n */\nexport default function getReferenceNode(reference) {\n  return reference && reference.referenceNode ? reference.referenceNode : reference;\n}\n","import isBrowser from './isBrowser';\n\nconst isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);\nconst isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);\n\n/**\n * Determines if the browser is Internet Explorer\n * @method\n * @memberof Popper.Utils\n * @param {Number} version to check\n * @returns {Boolean} isIE\n */\nexport default function isIE(version) {\n  if (version === 11) {\n    return isIE11;\n  }\n  if (version === 10) {\n    return isIE10;\n  }\n  return isIE11 || isIE10;\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport isIE from './isIE';\n/**\n * Returns the offset parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} offset parent\n */\nexport default function getOffsetParent(element) {\n  if (!element) {\n    return document.documentElement;\n  }\n\n  const noOffsetParent = isIE(10) ? document.body : null;\n\n  // NOTE: 1 DOM access here\n  let offsetParent = element.offsetParent || null;\n  // Skip hidden elements which don't have an offsetParent\n  while (offsetParent === noOffsetParent && element.nextElementSibling) {\n    offsetParent = (element = element.nextElementSibling).offsetParent;\n  }\n\n  const nodeName = offsetParent && offsetParent.nodeName;\n\n  if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {\n    return element ? element.ownerDocument.documentElement : document.documentElement;\n  }\n\n  // .offsetParent will return the closest TH, TD or TABLE in case\n  // no offsetParent is present, I hate this job...\n  if (\n    ['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 &&\n    getStyleComputedProperty(offsetParent, 'position') === 'static'\n  ) {\n    return getOffsetParent(offsetParent);\n  }\n\n  return offsetParent;\n}\n","/**\n * Finds the root node (document, shadowDOM root) of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} node\n * @returns {Element} root node\n */\nexport default function getRoot(node) {\n  if (node.parentNode !== null) {\n    return getRoot(node.parentNode);\n  }\n\n  return node;\n}\n","import isOffsetContainer from './isOffsetContainer';\nimport getRoot from './getRoot';\nimport getOffsetParent from './getOffsetParent';\n\n/**\n * Finds the offset parent common to the two provided nodes\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element1\n * @argument {Element} element2\n * @returns {Element} common offset parent\n */\nexport default function findCommonOffsetParent(element1, element2) {\n  // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n  if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {\n    return document.documentElement;\n  }\n\n  // Here we make sure to give as \"start\" the element that comes first in the DOM\n  const order =\n    element1.compareDocumentPosition(element2) &\n    Node.DOCUMENT_POSITION_FOLLOWING;\n  const start = order ? element1 : element2;\n  const end = order ? element2 : element1;\n\n  // Get common ancestor container\n  const range = document.createRange();\n  range.setStart(start, 0);\n  range.setEnd(end, 0);\n  const { commonAncestorContainer } = range;\n\n  // Both nodes are inside #document\n  if (\n    (element1 !== commonAncestorContainer &&\n      element2 !== commonAncestorContainer) ||\n    start.contains(end)\n  ) {\n    if (isOffsetContainer(commonAncestorContainer)) {\n      return commonAncestorContainer;\n    }\n\n    return getOffsetParent(commonAncestorContainer);\n  }\n\n  // one of the nodes is inside shadowDOM, find which one\n  const element1root = getRoot(element1);\n  if (element1root.host) {\n    return findCommonOffsetParent(element1root.host, element2);\n  } else {\n    return findCommonOffsetParent(element1, getRoot(element2).host);\n  }\n}\n","import getOffsetParent from './getOffsetParent';\n\nexport default function isOffsetContainer(element) {\n  const { nodeName } = element;\n  if (nodeName === 'BODY') {\n    return false;\n  }\n  return (\n    nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element\n  );\n}\n","/**\n * Gets the scroll value of the given element in the given side (top and left)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {String} side `top` or `left`\n * @returns {number} amount of scrolled pixels\n */\nexport default function getScroll(element, side = 'top') {\n  const upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';\n  const nodeName = element.nodeName;\n\n  if (nodeName === 'BODY' || nodeName === 'HTML') {\n    const html = element.ownerDocument.documentElement;\n    const scrollingElement = element.ownerDocument.scrollingElement || html;\n    return scrollingElement[upperSide];\n  }\n\n  return element[upperSide];\n}\n","/*\n * Helper to detect borders of a given element\n * @method\n * @memberof Popper.Utils\n * @param {CSSStyleDeclaration} styles\n * Result of `getStyleComputedProperty` on the given element\n * @param {String} axis - `x` or `y`\n * @return {number} borders - The borders size of the given axis\n */\n\nexport default function getBordersSize(styles, axis) {\n  const sideA = axis === 'x' ? 'Left' : 'Top';\n  const sideB = sideA === 'Left' ? 'Right' : 'Bottom';\n\n  return (\n    parseFloat(styles[`border${sideA}Width`]) +\n    parseFloat(styles[`border${sideB}Width`])\n  );\n}\n","import isIE from './isIE';\n\nfunction getSize(axis, body, html, computedStyle) {\n  return Math.max(\n    body[`offset${axis}`],\n    body[`scroll${axis}`],\n    html[`client${axis}`],\n    html[`offset${axis}`],\n    html[`scroll${axis}`],\n    isIE(10)\n      ? (parseInt(html[`offset${axis}`]) + \n      parseInt(computedStyle[`margin${axis === 'Height' ? 'Top' : 'Left'}`]) + \n      parseInt(computedStyle[`margin${axis === 'Height' ? 'Bottom' : 'Right'}`]))\n    : 0 \n  );\n}\n\nexport default function getWindowSizes(document) {\n  const body = document.body;\n  const html = document.documentElement;\n  const computedStyle = isIE(10) && getComputedStyle(html);\n\n  return {\n    height: getSize('Height', body, html, computedStyle),\n    width: getSize('Width', body, html, computedStyle),\n  };\n}\n","/**\n * Given element offsets, generate an output similar to getBoundingClientRect\n * @method\n * @memberof Popper.Utils\n * @argument {Object} offsets\n * @returns {Object} ClientRect like output\n */\nexport default function getClientRect(offsets) {\n  return {\n    ...offsets,\n    right: offsets.left + offsets.width,\n    bottom: offsets.top + offsets.height,\n  };\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport getBordersSize from './getBordersSize';\nimport getWindowSizes from './getWindowSizes';\nimport getScroll from './getScroll';\nimport getClientRect from './getClientRect';\nimport isIE from './isIE';\n\n/**\n * Get bounding client rect of given element\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} element\n * @return {Object} client rect\n */\nexport default function getBoundingClientRect(element) {\n  let rect = {};\n\n  // IE10 10 FIX: Please, don't ask, the element isn't\n  // considered in DOM in some circumstances...\n  // This isn't reproducible in IE10 compatibility mode of IE11\n  try {\n    if (isIE(10)) {\n      rect = element.getBoundingClientRect();\n      const scrollTop = getScroll(element, 'top');\n      const scrollLeft = getScroll(element, 'left');\n      rect.top += scrollTop;\n      rect.left += scrollLeft;\n      rect.bottom += scrollTop;\n      rect.right += scrollLeft;\n    }\n    else {\n      rect = element.getBoundingClientRect();\n    }\n  }\n  catch(e){}\n\n  const result = {\n    left: rect.left,\n    top: rect.top,\n    width: rect.right - rect.left,\n    height: rect.bottom - rect.top,\n  };\n\n  // subtract scrollbar size from sizes\n  const sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};\n  const width =\n    sizes.width || element.clientWidth || result.width;\n  const height =\n    sizes.height || element.clientHeight || result.height;\n\n  let horizScrollbar = element.offsetWidth - width;\n  let vertScrollbar = element.offsetHeight - height;\n\n  // if an hypothetical scrollbar is detected, we must be sure it's not a `border`\n  // we make this check conditional for performance reasons\n  if (horizScrollbar || vertScrollbar) {\n    const styles = getStyleComputedProperty(element);\n    horizScrollbar -= getBordersSize(styles, 'x');\n    vertScrollbar -= getBordersSize(styles, 'y');\n\n    result.width -= horizScrollbar;\n    result.height -= vertScrollbar;\n  }\n\n  return getClientRect(result);\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport includeScroll from './includeScroll';\nimport getScrollParent from './getScrollParent';\nimport getBoundingClientRect from './getBoundingClientRect';\nimport runIsIE from './isIE';\nimport getClientRect from './getClientRect';\n\nexport default function getOffsetRectRelativeToArbitraryNode(children, parent, fixedPosition = false) {\n  const isIE10 = runIsIE(10);\n  const isHTML = parent.nodeName === 'HTML';\n  const childrenRect = getBoundingClientRect(children);\n  const parentRect = getBoundingClientRect(parent);\n  const scrollParent = getScrollParent(children);\n\n  const styles = getStyleComputedProperty(parent);\n  const borderTopWidth = parseFloat(styles.borderTopWidth);\n  const borderLeftWidth = parseFloat(styles.borderLeftWidth);\n\n  // In cases where the parent is fixed, we must ignore negative scroll in offset calc\n  if(fixedPosition && isHTML) {\n    parentRect.top = Math.max(parentRect.top, 0);\n    parentRect.left = Math.max(parentRect.left, 0);\n  }\n  let offsets = getClientRect({\n    top: childrenRect.top - parentRect.top - borderTopWidth,\n    left: childrenRect.left - parentRect.left - borderLeftWidth,\n    width: childrenRect.width,\n    height: childrenRect.height,\n  });\n  offsets.marginTop = 0;\n  offsets.marginLeft = 0;\n\n  // Subtract margins of documentElement in case it's being used as parent\n  // we do this only on HTML because it's the only element that behaves\n  // differently when margins are applied to it. The margins are included in\n  // the box of the documentElement, in the other cases not.\n  if (!isIE10 && isHTML) {\n    const marginTop = parseFloat(styles.marginTop);\n    const marginLeft = parseFloat(styles.marginLeft);\n\n    offsets.top -= borderTopWidth - marginTop;\n    offsets.bottom -= borderTopWidth - marginTop;\n    offsets.left -= borderLeftWidth - marginLeft;\n    offsets.right -= borderLeftWidth - marginLeft;\n\n    // Attach marginTop and marginLeft because in some circumstances we may need them\n    offsets.marginTop = marginTop;\n    offsets.marginLeft = marginLeft;\n  }\n\n  if (\n    isIE10 && !fixedPosition\n      ? parent.contains(scrollParent)\n      : parent === scrollParent && scrollParent.nodeName !== 'BODY'\n  ) {\n    offsets = includeScroll(offsets, parent);\n  }\n\n  return offsets;\n}\n","import getScroll from './getScroll';\n\n/*\n * Sum or subtract the element scroll values (left and top) from a given rect object\n * @method\n * @memberof Popper.Utils\n * @param {Object} rect - Rect object you want to change\n * @param {HTMLElement} element - The element from the function reads the scroll values\n * @param {Boolean} subtract - set to true if you want to subtract the scroll values\n * @return {Object} rect - The modifier rect object\n */\nexport default function includeScroll(rect, element, subtract = false) {\n  const scrollTop = getScroll(element, 'top');\n  const scrollLeft = getScroll(element, 'left');\n  const modifier = subtract ? -1 : 1;\n  rect.top += scrollTop * modifier;\n  rect.bottom += scrollTop * modifier;\n  rect.left += scrollLeft * modifier;\n  rect.right += scrollLeft * modifier;\n  return rect;\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport getParentNode from './getParentNode';\n\n/**\n * Check if the given element is fixed or is inside a fixed parent\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {Element} customContainer\n * @returns {Boolean} answer to \"isFixed?\"\n */\nexport default function isFixed(element) {\n  const nodeName = element.nodeName;\n  if (nodeName === 'BODY' || nodeName === 'HTML') {\n    return false;\n  }\n  if (getStyleComputedProperty(element, 'position') === 'fixed') {\n    return true;\n  }\n  const parentNode = getParentNode(element);\n  if (!parentNode) {\n    return false;\n  }\n  return isFixed(parentNode);\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport isIE from './isIE';\n/**\n * Finds the first parent of an element that has a transformed property defined\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} first transformed parent or documentElement\n */\n\nexport default function getFixedPositionOffsetParent(element) {\n  // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n   if (!element || !element.parentElement || isIE()) {\n    return document.documentElement;\n  }\n  let el = element.parentElement;\n  while (el && getStyleComputedProperty(el, 'transform') === 'none') {\n    el = el.parentElement;\n  }\n  return el || document.documentElement;\n\n}\n","import getScrollParent from './getScrollParent';\nimport getParentNode from './getParentNode';\nimport getReferenceNode from './getReferenceNode';\nimport findCommonOffsetParent from './findCommonOffsetParent';\nimport getOffsetRectRelativeToArbitraryNode from './getOffsetRectRelativeToArbitraryNode';\nimport getViewportOffsetRectRelativeToArtbitraryNode from './getViewportOffsetRectRelativeToArtbitraryNode';\nimport getWindowSizes from './getWindowSizes';\nimport isFixed from './isFixed';\nimport getFixedPositionOffsetParent from './getFixedPositionOffsetParent';\n\n/**\n * Computed the boundaries limits and return them\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} popper\n * @param {HTMLElement} reference\n * @param {number} padding\n * @param {HTMLElement} boundariesElement - Element used to define the boundaries\n * @param {Boolean} fixedPosition - Is in fixed position mode\n * @returns {Object} Coordinates of the boundaries\n */\nexport default function getBoundaries(\n  popper,\n  reference,\n  padding,\n  boundariesElement,\n  fixedPosition = false\n) {\n  // NOTE: 1 DOM access here\n\n  let boundaries = { top: 0, left: 0 };\n  const offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));\n\n  // Handle viewport case\n  if (boundariesElement === 'viewport' ) {\n    boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);\n  }\n\n  else {\n    // Handle other cases based on DOM element used as boundaries\n    let boundariesNode;\n    if (boundariesElement === 'scrollParent') {\n      boundariesNode = getScrollParent(getParentNode(reference));\n      if (boundariesNode.nodeName === 'BODY') {\n        boundariesNode = popper.ownerDocument.documentElement;\n      }\n    } else if (boundariesElement === 'window') {\n      boundariesNode = popper.ownerDocument.documentElement;\n    } else {\n      boundariesNode = boundariesElement;\n    }\n\n    const offsets = getOffsetRectRelativeToArbitraryNode(\n      boundariesNode,\n      offsetParent,\n      fixedPosition\n    );\n\n    // In case of HTML, we need a different computation\n    if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {\n      const { height, width } = getWindowSizes(popper.ownerDocument);\n      boundaries.top += offsets.top - offsets.marginTop;\n      boundaries.bottom = height + offsets.top;\n      boundaries.left += offsets.left - offsets.marginLeft;\n      boundaries.right = width + offsets.left;\n    } else {\n      // for all the other DOM elements, this one is good\n      boundaries = offsets;\n    }\n  }\n\n  // Add paddings\n  padding = padding || 0;\n  const isPaddingNumber = typeof padding === 'number';\n  boundaries.left += isPaddingNumber ? padding : padding.left || 0; \n  boundaries.top += isPaddingNumber ? padding : padding.top || 0; \n  boundaries.right -= isPaddingNumber ? padding : padding.right || 0; \n  boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; \n\n  return boundaries;\n}\n","import getOffsetRectRelativeToArbitraryNode from './getOffsetRectRelativeToArbitraryNode';\nimport getScroll from './getScroll';\nimport getClientRect from './getClientRect';\n\nexport default function getViewportOffsetRectRelativeToArtbitraryNode(element, excludeScroll = false) {\n  const html = element.ownerDocument.documentElement;\n  const relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);\n  const width = Math.max(html.clientWidth, window.innerWidth || 0);\n  const height = Math.max(html.clientHeight, window.innerHeight || 0);\n\n  const scrollTop = !excludeScroll ? getScroll(html) : 0;\n  const scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;\n\n  const offset = {\n    top: scrollTop - relativeOffset.top + relativeOffset.marginTop,\n    left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,\n    width,\n    height,\n  };\n\n  return getClientRect(offset);\n}\n","import getBoundaries from '../utils/getBoundaries';\n\nfunction getArea({ width, height }) {\n  return width * height;\n}\n\n/**\n * Utility used to transform the `auto` placement to the placement with more\n * available space.\n * @method\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function computeAutoPlacement(\n  placement,\n  refRect,\n  popper,\n  reference,\n  boundariesElement,\n  padding = 0\n) {\n  if (placement.indexOf('auto') === -1) {\n    return placement;\n  }\n\n  const boundaries = getBoundaries(\n    popper,\n    reference,\n    padding,\n    boundariesElement\n  );\n\n  const rects = {\n    top: {\n      width: boundaries.width,\n      height: refRect.top - boundaries.top,\n    },\n    right: {\n      width: boundaries.right - refRect.right,\n      height: boundaries.height,\n    },\n    bottom: {\n      width: boundaries.width,\n      height: boundaries.bottom - refRect.bottom,\n    },\n    left: {\n      width: refRect.left - boundaries.left,\n      height: boundaries.height,\n    },\n  };\n\n  const sortedAreas = Object.keys(rects)\n    .map(key => ({\n      key,\n      ...rects[key],\n      area: getArea(rects[key]),\n    }))\n    .sort((a, b) => b.area - a.area);\n\n  const filteredAreas = sortedAreas.filter(\n    ({ width, height }) =>\n      width >= popper.clientWidth && height >= popper.clientHeight\n  );\n\n  const computedPlacement = filteredAreas.length > 0\n    ? filteredAreas[0].key\n    : sortedAreas[0].key;\n\n  const variation = placement.split('-')[1];\n\n  return computedPlacement + (variation ? `-${variation}` : '');\n}\n","import findCommonOffsetParent from './findCommonOffsetParent';\nimport getOffsetRectRelativeToArbitraryNode from './getOffsetRectRelativeToArbitraryNode';\nimport getFixedPositionOffsetParent from './getFixedPositionOffsetParent';\nimport getReferenceNode from './getReferenceNode';\n\n/**\n * Get offsets to the reference element\n * @method\n * @memberof Popper.Utils\n * @param {Object} state\n * @param {Element} popper - the popper element\n * @param {Element} reference - the reference element (the popper will be relative to this)\n * @param {Element} fixedPosition - is in fixed position mode\n * @returns {Object} An object containing the offsets which will be applied to the popper\n */\nexport default function getReferenceOffsets(state, popper, reference, fixedPosition = null) {\n  const commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));\n  return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);\n}\n","/**\n * Get the outer sizes of the given element (offset size + margins)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Object} object containing width and height properties\n */\nexport default function getOuterSizes(element) {\n  const window = element.ownerDocument.defaultView;\n  const styles = window.getComputedStyle(element);\n  const x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);\n  const y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);\n  const result = {\n    width: element.offsetWidth + y,\n    height: element.offsetHeight + x,\n  };\n  return result;\n}\n","/**\n * Get the opposite placement of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement\n * @returns {String} flipped placement\n */\nexport default function getOppositePlacement(placement) {\n  const hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n  return placement.replace(/left|right|bottom|top/g, matched => hash[matched]);\n}\n","import getOuterSizes from './getOuterSizes';\nimport getOppositePlacement from './getOppositePlacement';\n\n/**\n * Get offsets to the popper\n * @method\n * @memberof Popper.Utils\n * @param {Object} position - CSS position the Popper will get applied\n * @param {HTMLElement} popper - the popper element\n * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)\n * @param {String} placement - one of the valid placement options\n * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper\n */\nexport default function getPopperOffsets(popper, referenceOffsets, placement) {\n  placement = placement.split('-')[0];\n\n  // Get popper node sizes\n  const popperRect = getOuterSizes(popper);\n\n  // Add position, width and height to our offsets object\n  const popperOffsets = {\n    width: popperRect.width,\n    height: popperRect.height,\n  };\n\n  // depending by the popper placement we have to compute its offsets slightly differently\n  const isHoriz = ['right', 'left'].indexOf(placement) !== -1;\n  const mainSide = isHoriz ? 'top' : 'left';\n  const secondarySide = isHoriz ? 'left' : 'top';\n  const measurement = isHoriz ? 'height' : 'width';\n  const secondaryMeasurement = !isHoriz ? 'height' : 'width';\n\n  popperOffsets[mainSide] =\n    referenceOffsets[mainSide] +\n    referenceOffsets[measurement] / 2 -\n    popperRect[measurement] / 2;\n  if (placement === secondarySide) {\n    popperOffsets[secondarySide] =\n      referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];\n  } else {\n    popperOffsets[secondarySide] =\n      referenceOffsets[getOppositePlacement(secondarySide)];\n  }\n\n  return popperOffsets;\n}\n","/**\n * Mimics the `find` method of Array\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nexport default function find(arr, check) {\n  // use native find if supported\n  if (Array.prototype.find) {\n    return arr.find(check);\n  }\n\n  // use `filter` to obtain the same behavior of `find`\n  return arr.filter(check)[0];\n}\n","import isFunction from './isFunction';\nimport findIndex from './findIndex';\nimport getClientRect from '../utils/getClientRect';\n\n/**\n * Loop trough the list of modifiers and run them in order,\n * each of them will then edit the data object.\n * @method\n * @memberof Popper.Utils\n * @param {dataObject} data\n * @param {Array} modifiers\n * @param {String} ends - Optional modifier name used as stopper\n * @returns {dataObject}\n */\nexport default function runModifiers(modifiers, data, ends) {\n  const modifiersToRun = ends === undefined\n    ? modifiers\n    : modifiers.slice(0, findIndex(modifiers, 'name', ends));\n\n  modifiersToRun.forEach(modifier => {\n    if (modifier['function']) { // eslint-disable-line dot-notation\n      console.warn('`modifier.function` is deprecated, use `modifier.fn`!');\n    }\n    const fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation\n    if (modifier.enabled && isFunction(fn)) {\n      // Add properties to offsets to make them a complete clientRect object\n      // we do this before each modifier to make sure the previous one doesn't\n      // mess with these values\n      data.offsets.popper = getClientRect(data.offsets.popper);\n      data.offsets.reference = getClientRect(data.offsets.reference);\n\n      data = fn(data, modifier);\n    }\n  });\n\n  return data;\n}\n","import find from './find';\n\n/**\n * Return the index of the matching object\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nexport default function findIndex(arr, prop, value) {\n  // use native findIndex if supported\n  if (Array.prototype.findIndex) {\n    return arr.findIndex(cur => cur[prop] === value);\n  }\n\n  // use `find` + `indexOf` if `findIndex` isn't supported\n  const match = find(arr, obj => obj[prop] === value);\n  return arr.indexOf(match);\n}\n","import computeAutoPlacement from '../utils/computeAutoPlacement';\nimport getReferenceOffsets from '../utils/getReferenceOffsets';\nimport getPopperOffsets from '../utils/getPopperOffsets';\nimport runModifiers from '../utils/runModifiers';\n\n/**\n * Updates the position of the popper, computing the new offsets and applying\n * the new style.<br />\n * Prefer `scheduleUpdate` over `update` because of performance reasons.\n * @method\n * @memberof Popper\n */\nexport default function update() {\n  // if popper is destroyed, don't perform any further update\n  if (this.state.isDestroyed) {\n    return;\n  }\n\n  let data = {\n    instance: this,\n    styles: {},\n    arrowStyles: {},\n    attributes: {},\n    flipped: false,\n    offsets: {},\n  };\n\n  // compute reference element offsets\n  data.offsets.reference = getReferenceOffsets(\n    this.state,\n    this.popper,\n    this.reference,\n    this.options.positionFixed\n  );\n\n  // compute auto placement, store placement inside the data object,\n  // modifiers will be able to edit `placement` if needed\n  // and refer to originalPlacement to know the original value\n  data.placement = computeAutoPlacement(\n    this.options.placement,\n    data.offsets.reference,\n    this.popper,\n    this.reference,\n    this.options.modifiers.flip.boundariesElement,\n    this.options.modifiers.flip.padding\n  );\n\n  // store the computed placement inside `originalPlacement`\n  data.originalPlacement = data.placement;\n\n  data.positionFixed = this.options.positionFixed;\n\n  // compute the popper offsets\n  data.offsets.popper = getPopperOffsets(\n    this.popper,\n    data.offsets.reference,\n    data.placement\n  );\n\n  data.offsets.popper.position = this.options.positionFixed\n    ? 'fixed'\n    : 'absolute';\n\n  // run the modifiers\n  data = runModifiers(this.modifiers, data);\n\n  // the first `update` will call `onCreate` callback\n  // the other ones will call `onUpdate` callback\n  if (!this.state.isCreated) {\n    this.state.isCreated = true;\n    this.options.onCreate(data);\n  } else {\n    this.options.onUpdate(data);\n  }\n}\n","/**\n * Helper used to know if the given modifier is enabled.\n * @method\n * @memberof Popper.Utils\n * @returns {Boolean}\n */\nexport default function isModifierEnabled(modifiers, modifierName) {\n  return modifiers.some(\n    ({ name, enabled }) => enabled && name === modifierName\n  );\n}\n","/**\n * Get the prefixed supported property name\n * @method\n * @memberof Popper.Utils\n * @argument {String} property (camelCase)\n * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)\n */\nexport default function getSupportedPropertyName(property) {\n  const prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];\n  const upperProp = property.charAt(0).toUpperCase() + property.slice(1);\n\n  for (let i = 0; i < prefixes.length; i++) {\n    const prefix = prefixes[i];\n    const toCheck = prefix ? `${prefix}${upperProp}` : property;\n    if (typeof document.body.style[toCheck] !== 'undefined') {\n      return toCheck;\n    }\n  }\n  return null;\n}\n","import isModifierEnabled from '../utils/isModifierEnabled';\nimport getSupportedPropertyName from '../utils/getSupportedPropertyName';\n\n/**\n * Destroys the popper.\n * @method\n * @memberof Popper\n */\nexport default function destroy() {\n  this.state.isDestroyed = true;\n\n  // touch DOM only if `applyStyle` modifier is enabled\n  if (isModifierEnabled(this.modifiers, 'applyStyle')) {\n    this.popper.removeAttribute('x-placement');\n    this.popper.style.position = '';\n    this.popper.style.top = '';\n    this.popper.style.left = '';\n    this.popper.style.right = '';\n    this.popper.style.bottom = '';\n    this.popper.style.willChange = '';\n    this.popper.style[getSupportedPropertyName('transform')] = '';\n  }\n\n  this.disableEventListeners();\n\n  // remove the popper if user explicitly asked for the deletion on destroy\n  // do not use `remove` because IE11 doesn't support it\n  if (this.options.removeOnDestroy) {\n    this.popper.parentNode.removeChild(this.popper);\n  }\n  return this;\n}\n","/**\n * Get the window associated with the element\n * @argument {Element} element\n * @returns {Window}\n */\nexport default function getWindow(element) {\n  const ownerDocument = element.ownerDocument;\n  return ownerDocument ? ownerDocument.defaultView : window;\n}\n","import getScrollParent from './getScrollParent';\nimport getWindow from './getWindow';\n\nfunction attachToScrollParents(scrollParent, event, callback, scrollParents) {\n  const isBody = scrollParent.nodeName === 'BODY';\n  const target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;\n  target.addEventListener(event, callback, { passive: true });\n\n  if (!isBody) {\n    attachToScrollParents(\n      getScrollParent(target.parentNode),\n      event,\n      callback,\n      scrollParents\n    );\n  }\n  scrollParents.push(target);\n}\n\n/**\n * Setup needed event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nexport default function setupEventListeners(\n  reference,\n  options,\n  state,\n  updateBound\n) {\n  // Resize event listener on window\n  state.updateBound = updateBound;\n  getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });\n\n  // Scroll event listener on scroll parents\n  const scrollElement = getScrollParent(reference);\n  attachToScrollParents(\n    scrollElement,\n    'scroll',\n    state.updateBound,\n    state.scrollParents\n  );\n  state.scrollElement = scrollElement;\n  state.eventsEnabled = true;\n\n  return state;\n}\n","import setupEventListeners from '../utils/setupEventListeners';\n\n/**\n * It will add resize/scroll events and start recalculating\n * position of the popper element when they are triggered.\n * @method\n * @memberof Popper\n */\nexport default function enableEventListeners() {\n  if (!this.state.eventsEnabled) {\n    this.state = setupEventListeners(\n      this.reference,\n      this.options,\n      this.state,\n      this.scheduleUpdate\n    );\n  }\n}\n","import removeEventListeners from '../utils/removeEventListeners';\n\n/**\n * It will remove resize/scroll events and won't recalculate popper position\n * when they are triggered. It also won't trigger `onUpdate` callback anymore,\n * unless you call `update` method manually.\n * @method\n * @memberof Popper\n */\nexport default function disableEventListeners() {\n  if (this.state.eventsEnabled) {\n    cancelAnimationFrame(this.scheduleUpdate);\n    this.state = removeEventListeners(this.reference, this.state);\n  }\n}\n","import getWindow from './getWindow';\n\n/**\n * Remove event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nexport default function removeEventListeners(reference, state) {\n  // Remove resize event listener on window\n  getWindow(reference).removeEventListener('resize', state.updateBound);\n\n  // Remove scroll event listener on scroll parents\n  state.scrollParents.forEach(target => {\n    target.removeEventListener('scroll', state.updateBound);\n  });\n\n  // Reset state\n  state.updateBound = null;\n  state.scrollParents = [];\n  state.scrollElement = null;\n  state.eventsEnabled = false;\n  return state;\n}\n","/**\n * Tells if a given input is a number\n * @method\n * @memberof Popper.Utils\n * @param {*} input to check\n * @return {Boolean}\n */\nexport default function isNumeric(n) {\n  return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);\n}\n","import isNumeric from './isNumeric';\n\n/**\n * Set the style to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the style to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nexport default function setStyles(element, styles) {\n  Object.keys(styles).forEach(prop => {\n    let unit = '';\n    // add unit if the value is numeric and is one of the following\n    if (\n      ['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !==\n        -1 &&\n      isNumeric(styles[prop])\n    ) {\n      unit = 'px';\n    }\n    element.style[prop] = styles[prop] + unit;\n  });\n}\n","import getSupportedPropertyName from '../utils/getSupportedPropertyName';\nimport find from '../utils/find';\nimport getOffsetParent from '../utils/getOffsetParent';\nimport getBoundingClientRect from '../utils/getBoundingClientRect';\nimport getRoundedOffsets from '../utils/getRoundedOffsets';\nimport isBrowser from '../utils/isBrowser';\n\nconst isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function computeStyle(data, options) {\n  const { x, y } = options;\n  const { popper } = data.offsets;\n\n  // Remove this legacy support in Popper.js v2\n  const legacyGpuAccelerationOption = find(\n    data.instance.modifiers,\n    modifier => modifier.name === 'applyStyle'\n  ).gpuAcceleration;\n  if (legacyGpuAccelerationOption !== undefined) {\n    console.warn(\n      'WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'\n    );\n  }\n  const gpuAcceleration =\n    legacyGpuAccelerationOption !== undefined\n      ? legacyGpuAccelerationOption\n      : options.gpuAcceleration;\n\n  const offsetParent = getOffsetParent(data.instance.popper);\n  const offsetParentRect = getBoundingClientRect(offsetParent);\n\n  // Styles\n  const styles = {\n    position: popper.position,\n  };\n\n  const offsets = getRoundedOffsets(\n    data,\n    window.devicePixelRatio < 2 || !isFirefox\n  );\n\n  const sideA = x === 'bottom' ? 'top' : 'bottom';\n  const sideB = y === 'right' ? 'left' : 'right';\n\n  // if gpuAcceleration is set to `true` and transform is supported,\n  //  we use `translate3d` to apply the position to the popper we\n  // automatically use the supported prefixed version if needed\n  const prefixedProperty = getSupportedPropertyName('transform');\n\n  // now, let's make a step back and look at this code closely (wtf?)\n  // If the content of the popper grows once it's been positioned, it\n  // may happen that the popper gets misplaced because of the new content\n  // overflowing its reference element\n  // To avoid this problem, we provide two options (x and y), which allow\n  // the consumer to define the offset origin.\n  // If we position a popper on top of a reference element, we can set\n  // `x` to `top` to make the popper grow towards its top instead of\n  // its bottom.\n  let left, top;\n  if (sideA === 'bottom') {\n    // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)\n    // and not the bottom of the html element\n    if (offsetParent.nodeName === 'HTML') {\n      top = -offsetParent.clientHeight + offsets.bottom;\n    } else {\n      top = -offsetParentRect.height + offsets.bottom;\n    }\n  } else {\n    top = offsets.top;\n  }\n  if (sideB === 'right') {\n    if (offsetParent.nodeName === 'HTML') {\n      left = -offsetParent.clientWidth + offsets.right;\n    } else {\n      left = -offsetParentRect.width + offsets.right;\n    }\n  } else {\n    left = offsets.left;\n  }\n  if (gpuAcceleration && prefixedProperty) {\n    styles[prefixedProperty] = `translate3d(${left}px, ${top}px, 0)`;\n    styles[sideA] = 0;\n    styles[sideB] = 0;\n    styles.willChange = 'transform';\n  } else {\n    // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties\n    const invertTop = sideA === 'bottom' ? -1 : 1;\n    const invertLeft = sideB === 'right' ? -1 : 1;\n    styles[sideA] = top * invertTop;\n    styles[sideB] = left * invertLeft;\n    styles.willChange = `${sideA}, ${sideB}`;\n  }\n\n  // Attributes\n  const attributes = {\n    'x-placement': data.placement,\n  };\n\n  // Update `data` attributes, styles and arrowStyles\n  data.attributes = { ...attributes, ...data.attributes };\n  data.styles = { ...styles, ...data.styles };\n  data.arrowStyles = { ...data.offsets.arrow, ...data.arrowStyles };\n\n  return data;\n}\n","import find from './find';\n\n/**\n * Helper used to know if the given modifier depends from another one.<br />\n * It checks if the needed modifier is listed and enabled.\n * @method\n * @memberof Popper.Utils\n * @param {Array} modifiers - list of modifiers\n * @param {String} requestingName - name of requesting modifier\n * @param {String} requestedName - name of requested modifier\n * @returns {Boolean}\n */\nexport default function isModifierRequired(\n  modifiers,\n  requestingName,\n  requestedName\n) {\n  const requesting = find(modifiers, ({ name }) => name === requestingName);\n\n  const isRequired =\n    !!requesting &&\n    modifiers.some(modifier => {\n      return (\n        modifier.name === requestedName &&\n        modifier.enabled &&\n        modifier.order < requesting.order\n      );\n    });\n\n  if (!isRequired) {\n    const requesting = `\\`${requestingName}\\``;\n    const requested = `\\`${requestedName}\\``;\n    console.warn(\n      `${requested} modifier is required by ${requesting} modifier in order to work, be sure to include it before ${requesting}!`\n    );\n  }\n  return isRequired;\n}\n","/**\n * List of accepted placements to use as values of the `placement` option.<br />\n * Valid placements are:\n * - `auto`\n * - `top`\n * - `right`\n * - `bottom`\n * - `left`\n *\n * Each placement can have a variation from this list:\n * - `-start`\n * - `-end`\n *\n * Variations are interpreted easily if you think of them as the left to right\n * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`\n * is right.<br />\n * Vertically (`left` and `right`), `start` is top and `end` is bottom.\n *\n * Some valid examples are:\n * - `top-end` (on top of reference, right aligned)\n * - `right-start` (on right of reference, top aligned)\n * - `bottom` (on bottom, centered)\n * - `auto-end` (on the side with more space available, alignment depends by placement)\n *\n * @static\n * @type {Array}\n * @enum {String}\n * @readonly\n * @method placements\n * @memberof Popper\n */\nexport default [\n  'auto-start',\n  'auto',\n  'auto-end',\n  'top-start',\n  'top',\n  'top-end',\n  'right-start',\n  'right',\n  'right-end',\n  'bottom-end',\n  'bottom',\n  'bottom-start',\n  'left-end',\n  'left',\n  'left-start',\n];\n","import placements from '../methods/placements';\n\n// Get rid of `auto` `auto-start` and `auto-end`\nconst validPlacements = placements.slice(3);\n\n/**\n * Given an initial placement, returns all the subsequent placements\n * clockwise (or counter-clockwise).\n *\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement - A valid placement (it accepts variations)\n * @argument {Boolean} counter - Set to true to walk the placements counterclockwise\n * @returns {Array} placements including their variations\n */\nexport default function clockwise(placement, counter = false) {\n  const index = validPlacements.indexOf(placement);\n  const arr = validPlacements\n    .slice(index + 1)\n    .concat(validPlacements.slice(0, index));\n  return counter ? arr.reverse() : arr;\n}\n","import applyStyle, { applyStyleOnLoad } from './applyStyle';\nimport computeStyle from './computeStyle';\nimport arrow from './arrow';\nimport flip from './flip';\nimport keepTogether from './keepTogether';\nimport offset from './offset';\nimport preventOverflow from './preventOverflow';\nimport shift from './shift';\nimport hide from './hide';\nimport inner from './inner';\n\n/**\n * Modifier function, each modifier can have a function of this type assigned\n * to its `fn` property.<br />\n * These functions will be called on each update, this means that you must\n * make sure they are performant enough to avoid performance bottlenecks.\n *\n * @function ModifierFn\n * @argument {dataObject} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {dataObject} The data object, properly modified\n */\n\n/**\n * Modifiers are plugins used to alter the behavior of your poppers.<br />\n * Popper.js uses a set of 9 modifiers to provide all the basic functionalities\n * needed by the library.\n *\n * Usually you don't want to override the `order`, `fn` and `onLoad` props.\n * All the other properties are configurations that could be tweaked.\n * @namespace modifiers\n */\nexport default {\n  /**\n   * Modifier used to shift the popper on the start or end of its reference\n   * element.<br />\n   * It will read the variation of the `placement` property.<br />\n   * It can be one either `-end` or `-start`.\n   * @memberof modifiers\n   * @inner\n   */\n  shift: {\n    /** @prop {number} order=100 - Index used to define the order of execution */\n    order: 100,\n    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n    enabled: true,\n    /** @prop {ModifierFn} */\n    fn: shift,\n  },\n\n  /**\n   * The `offset` modifier can shift your popper on both its axis.\n   *\n   * It accepts the following units:\n   * - `px` or unit-less, interpreted as pixels\n   * - `%` or `%r`, percentage relative to the length of the reference element\n   * - `%p`, percentage relative to the length of the popper element\n   * - `vw`, CSS viewport width unit\n   * - `vh`, CSS viewport height unit\n   *\n   * For length is intended the main axis relative to the placement of the popper.<br />\n   * This means that if the placement is `top` or `bottom`, the length will be the\n   * `width`. In case of `left` or `right`, it will be the `height`.\n   *\n   * You can provide a single value (as `Number` or `String`), or a pair of values\n   * as `String` divided by a comma or one (or more) white spaces.<br />\n   * The latter is a deprecated method because it leads to confusion and will be\n   * removed in v2.<br />\n   * Additionally, it accepts additions and subtractions between different units.\n   * Note that multiplications and divisions aren't supported.\n   *\n   * Valid examples are:\n   * ```\n   * 10\n   * '10%'\n   * '10, 10'\n   * '10%, 10'\n   * '10 + 10%'\n   * '10 - 5vh + 3%'\n   * '-10px + 5vh, 5px - 6%'\n   * ```\n   * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap\n   * > with their reference element, unfortunately, you will have to disable the `flip` modifier.\n   * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).\n   *\n   * @memberof modifiers\n   * @inner\n   */\n  offset: {\n    /** @prop {number} order=200 - Index used to define the order of execution */\n    order: 200,\n    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n    enabled: true,\n    /** @prop {ModifierFn} */\n    fn: offset,\n    /** @prop {Number|String} offset=0\n     * The offset value as described in the modifier description\n     */\n    offset: 0,\n  },\n\n  /**\n   * Modifier used to prevent the popper from being positioned outside the boundary.\n   *\n   * A scenario exists where the reference itself is not within the boundaries.<br />\n   * We can say it has \"escaped the boundaries\" — or just \"escaped\".<br />\n   * In this case we need to decide whether the popper should either:\n   *\n   * - detach from the reference and remain \"trapped\" in the boundaries, or\n   * - if it should ignore the boundary and \"escape with its reference\"\n   *\n   * When `escapeWithReference` is set to`true` and reference is completely\n   * outside its boundaries, the popper will overflow (or completely leave)\n   * the boundaries in order to remain attached to the edge of the reference.\n   *\n   * @memberof modifiers\n   * @inner\n   */\n  preventOverflow: {\n    /** @prop {number} order=300 - Index used to define the order of execution */\n    order: 300,\n    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n    enabled: true,\n    /** @prop {ModifierFn} */\n    fn: preventOverflow,\n    /**\n     * @prop {Array} [priority=['left','right','top','bottom']]\n     * Popper will try to prevent overflow following these priorities by default,\n     * then, it could overflow on the left and on top of the `boundariesElement`\n     */\n    priority: ['left', 'right', 'top', 'bottom'],\n    /**\n     * @prop {number} padding=5\n     * Amount of pixel used to define a minimum distance between the boundaries\n     * and the popper. This makes sure the popper always has a little padding\n     * between the edges of its container\n     */\n    padding: 5,\n    /**\n     * @prop {String|HTMLElement} boundariesElement='scrollParent'\n     * Boundaries used by the modifier. Can be `scrollParent`, `window`,\n     * `viewport` or any DOM element.\n     */\n    boundariesElement: 'scrollParent',\n  },\n\n  /**\n   * Modifier used to make sure the reference and its popper stay near each other\n   * without leaving any gap between the two. Especially useful when the arrow is\n   * enabled and you want to ensure that it points to its reference element.\n   * It cares only about the first axis. You can still have poppers with margin\n   * between the popper and its reference element.\n   * @memberof modifiers\n   * @inner\n   */\n  keepTogether: {\n    /** @prop {number} order=400 - Index used to define the order of execution */\n    order: 400,\n    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n    enabled: true,\n    /** @prop {ModifierFn} */\n    fn: keepTogether,\n  },\n\n  /**\n   * This modifier is used to move the `arrowElement` of the popper to make\n   * sure it is positioned between the reference element and its popper element.\n   * It will read the outer size of the `arrowElement` node to detect how many\n   * pixels of conjunction are needed.\n   *\n   * It has no effect if no `arrowElement` is provided.\n   * @memberof modifiers\n   * @inner\n   */\n  arrow: {\n    /** @prop {number} order=500 - Index used to define the order of execution */\n    order: 500,\n    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n    enabled: true,\n    /** @prop {ModifierFn} */\n    fn: arrow,\n    /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */\n    element: '[x-arrow]',\n  },\n\n  /**\n   * Modifier used to flip the popper's placement when it starts to overlap its\n   * reference element.\n   *\n   * Requires the `preventOverflow` modifier before it in order to work.\n   *\n   * **NOTE:** this modifier will interrupt the current update cycle and will\n   * restart it if it detects the need to flip the placement.\n   * @memberof modifiers\n   * @inner\n   */\n  flip: {\n    /** @prop {number} order=600 - Index used to define the order of execution */\n    order: 600,\n    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n    enabled: true,\n    /** @prop {ModifierFn} */\n    fn: flip,\n    /**\n     * @prop {String|Array} behavior='flip'\n     * The behavior used to change the popper's placement. It can be one of\n     * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid\n     * placements (with optional variations)\n     */\n    behavior: 'flip',\n    /**\n     * @prop {number} padding=5\n     * The popper will flip if it hits the edges of the `boundariesElement`\n     */\n    padding: 5,\n    /**\n     * @prop {String|HTMLElement} boundariesElement='viewport'\n     * The element which will define the boundaries of the popper position.\n     * The popper will never be placed outside of the defined boundaries\n     * (except if `keepTogether` is enabled)\n     */\n    boundariesElement: 'viewport',\n    /**\n     * @prop {Boolean} flipVariations=false\n     * The popper will switch placement variation between `-start` and `-end` when\n     * the reference element overlaps its boundaries.\n     *\n     * The original placement should have a set variation.\n     */\n    flipVariations: false,\n    /**\n     * @prop {Boolean} flipVariationsByContent=false\n     * The popper will switch placement variation between `-start` and `-end` when\n     * the popper element overlaps its reference boundaries.\n     *\n     * The original placement should have a set variation.\n     */\n    flipVariationsByContent: false,\n  },\n\n  /**\n   * Modifier used to make the popper flow toward the inner of the reference element.\n   * By default, when this modifier is disabled, the popper will be placed outside\n   * the reference element.\n   * @memberof modifiers\n   * @inner\n   */\n  inner: {\n    /** @prop {number} order=700 - Index used to define the order of execution */\n    order: 700,\n    /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */\n    enabled: false,\n    /** @prop {ModifierFn} */\n    fn: inner,\n  },\n\n  /**\n   * Modifier used to hide the popper when its reference element is outside of the\n   * popper boundaries. It will set a `x-out-of-boundaries` attribute which can\n   * be used to hide with a CSS selector the popper when its reference is\n   * out of boundaries.\n   *\n   * Requires the `preventOverflow` modifier before it in order to work.\n   * @memberof modifiers\n   * @inner\n   */\n  hide: {\n    /** @prop {number} order=800 - Index used to define the order of execution */\n    order: 800,\n    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n    enabled: true,\n    /** @prop {ModifierFn} */\n    fn: hide,\n  },\n\n  /**\n   * Computes the style that will be applied to the popper element to gets\n   * properly positioned.\n   *\n   * Note that this modifier will not touch the DOM, it just prepares the styles\n   * so that `applyStyle` modifier can apply it. This separation is useful\n   * in case you need to replace `applyStyle` with a custom implementation.\n   *\n   * This modifier has `850` as `order` value to maintain backward compatibility\n   * with previous versions of Popper.js. Expect the modifiers ordering method\n   * to change in future major versions of the library.\n   *\n   * @memberof modifiers\n   * @inner\n   */\n  computeStyle: {\n    /** @prop {number} order=850 - Index used to define the order of execution */\n    order: 850,\n    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n    enabled: true,\n    /** @prop {ModifierFn} */\n    fn: computeStyle,\n    /**\n     * @prop {Boolean} gpuAcceleration=true\n     * If true, it uses the CSS 3D transformation to position the popper.\n     * Otherwise, it will use the `top` and `left` properties\n     */\n    gpuAcceleration: true,\n    /**\n     * @prop {string} [x='bottom']\n     * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.\n     * Change this if your popper should grow in a direction different from `bottom`\n     */\n    x: 'bottom',\n    /**\n     * @prop {string} [x='left']\n     * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.\n     * Change this if your popper should grow in a direction different from `right`\n     */\n    y: 'right',\n  },\n\n  /**\n   * Applies the computed styles to the popper element.\n   *\n   * All the DOM manipulations are limited to this modifier. This is useful in case\n   * you want to integrate Popper.js inside a framework or view library and you\n   * want to delegate all the DOM manipulations to it.\n   *\n   * Note that if you disable this modifier, you must make sure the popper element\n   * has its position set to `absolute` before Popper.js can do its work!\n   *\n   * Just disable this modifier and define your own to achieve the desired effect.\n   *\n   * @memberof modifiers\n   * @inner\n   */\n  applyStyle: {\n    /** @prop {number} order=900 - Index used to define the order of execution */\n    order: 900,\n    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n    enabled: true,\n    /** @prop {ModifierFn} */\n    fn: applyStyle,\n    /** @prop {Function} */\n    onLoad: applyStyleOnLoad,\n    /**\n     * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier\n     * @prop {Boolean} gpuAcceleration=true\n     * If true, it uses the CSS 3D transformation to position the popper.\n     * Otherwise, it will use the `top` and `left` properties\n     */\n    gpuAcceleration: undefined,\n  },\n};\n\n/**\n * The `dataObject` is an object containing all the information used by Popper.js.\n * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.\n * @name dataObject\n * @property {Object} data.instance The Popper.js instance\n * @property {String} data.placement Placement applied to popper\n * @property {String} data.originalPlacement Placement originally defined on init\n * @property {Boolean} data.flipped True if popper has been flipped by flip modifier\n * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper\n * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier\n * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.boundaries Offsets of the popper boundaries\n * @property {Object} data.offsets The measurements of popper, reference and arrow elements\n * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0\n */\n","/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function shift(data) {\n  const placement = data.placement;\n  const basePlacement = placement.split('-')[0];\n  const shiftvariation = placement.split('-')[1];\n\n  // if shift shiftvariation is specified, run the modifier\n  if (shiftvariation) {\n    const { reference, popper } = data.offsets;\n    const isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;\n    const side = isVertical ? 'left' : 'top';\n    const measurement = isVertical ? 'width' : 'height';\n\n    const shiftOffsets = {\n      start: { [side]: reference[side] },\n      end: {\n        [side]: reference[side] + reference[measurement] - popper[measurement],\n      },\n    };\n\n    data.offsets.popper = { ...popper, ...shiftOffsets[shiftvariation] };\n  }\n\n  return data;\n}\n","import isNumeric from '../utils/isNumeric';\nimport getClientRect from '../utils/getClientRect';\nimport find from '../utils/find';\n\n/**\n * Converts a string containing value + unit into a px value number\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} str - Value + unit string\n * @argument {String} measurement - `height` or `width`\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @returns {Number|String}\n * Value in pixels, or original string if no values were extracted\n */\nexport function toValue(str, measurement, popperOffsets, referenceOffsets) {\n  // separate value from unit\n  const split = str.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/);\n  const value = +split[1];\n  const unit = split[2];\n\n  // If it's not a number it's an operator, I guess\n  if (!value) {\n    return str;\n  }\n\n  if (unit.indexOf('%') === 0) {\n    let element;\n    switch (unit) {\n      case '%p':\n        element = popperOffsets;\n        break;\n      case '%':\n      case '%r':\n      default:\n        element = referenceOffsets;\n    }\n\n    const rect = getClientRect(element);\n    return rect[measurement] / 100 * value;\n  } else if (unit === 'vh' || unit === 'vw') {\n    // if is a vh or vw, we calculate the size based on the viewport\n    let size;\n    if (unit === 'vh') {\n      size = Math.max(\n        document.documentElement.clientHeight,\n        window.innerHeight || 0\n      );\n    } else {\n      size = Math.max(\n        document.documentElement.clientWidth,\n        window.innerWidth || 0\n      );\n    }\n    return size / 100 * value;\n  } else {\n    // if is an explicit pixel unit, we get rid of the unit and keep the value\n    // if is an implicit unit, it's px, and we return just the value\n    return value;\n  }\n}\n\n/**\n * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} offset\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @argument {String} basePlacement\n * @returns {Array} a two cells array with x and y offsets in numbers\n */\nexport function parseOffset(\n  offset,\n  popperOffsets,\n  referenceOffsets,\n  basePlacement\n) {\n  const offsets = [0, 0];\n\n  // Use height if placement is left or right and index is 0 otherwise use width\n  // in this way the first offset will use an axis and the second one\n  // will use the other one\n  const useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;\n\n  // Split the offset string to obtain a list of values and operands\n  // The regex addresses values with the plus or minus sign in front (+10, -20, etc)\n  const fragments = offset.split(/(\\+|\\-)/).map(frag => frag.trim());\n\n  // Detect if the offset string contains a pair of values or a single one\n  // they could be separated by comma or space\n  const divider = fragments.indexOf(\n    find(fragments, frag => frag.search(/,|\\s/) !== -1)\n  );\n\n  if (fragments[divider] && fragments[divider].indexOf(',') === -1) {\n    console.warn(\n      'Offsets separated by white space(s) are deprecated, use a comma (,) instead.'\n    );\n  }\n\n  // If divider is found, we divide the list of values and operands to divide\n  // them by ofset X and Y.\n  const splitRegex = /\\s*,\\s*|\\s+/;\n  let ops = divider !== -1\n    ? [\n        fragments\n          .slice(0, divider)\n          .concat([fragments[divider].split(splitRegex)[0]]),\n        [fragments[divider].split(splitRegex)[1]].concat(\n          fragments.slice(divider + 1)\n        ),\n      ]\n    : [fragments];\n\n  // Convert the values with units to absolute pixels to allow our computations\n  ops = ops.map((op, index) => {\n    // Most of the units rely on the orientation of the popper\n    const measurement = (index === 1 ? !useHeight : useHeight)\n      ? 'height'\n      : 'width';\n    let mergeWithPrevious = false;\n    return (\n      op\n        // This aggregates any `+` or `-` sign that aren't considered operators\n        // e.g.: 10 + +5 => [10, +, +5]\n        .reduce((a, b) => {\n          if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {\n            a[a.length - 1] = b;\n            mergeWithPrevious = true;\n            return a;\n          } else if (mergeWithPrevious) {\n            a[a.length - 1] += b;\n            mergeWithPrevious = false;\n            return a;\n          } else {\n            return a.concat(b);\n          }\n        }, [])\n        // Here we convert the string values into number values (in px)\n        .map(str => toValue(str, measurement, popperOffsets, referenceOffsets))\n    );\n  });\n\n  // Loop trough the offsets arrays and execute the operations\n  ops.forEach((op, index) => {\n    op.forEach((frag, index2) => {\n      if (isNumeric(frag)) {\n        offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);\n      }\n    });\n  });\n  return offsets;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @argument {Number|String} options.offset=0\n * The offset value as described in the modifier description\n * @returns {Object} The data object, properly modified\n */\nexport default function offset(data, { offset }) {\n  const { placement, offsets: { popper, reference } } = data;\n  const basePlacement = placement.split('-')[0];\n\n  let offsets;\n  if (isNumeric(+offset)) {\n    offsets = [+offset, 0];\n  } else {\n    offsets = parseOffset(offset, popper, reference, basePlacement);\n  }\n\n  if (basePlacement === 'left') {\n    popper.top += offsets[0];\n    popper.left -= offsets[1];\n  } else if (basePlacement === 'right') {\n    popper.top += offsets[0];\n    popper.left += offsets[1];\n  } else if (basePlacement === 'top') {\n    popper.left += offsets[0];\n    popper.top -= offsets[1];\n  } else if (basePlacement === 'bottom') {\n    popper.left += offsets[0];\n    popper.top += offsets[1];\n  }\n\n  data.popper = popper;\n  return data;\n}\n","import getOffsetParent from '../utils/getOffsetParent';\nimport getBoundaries from '../utils/getBoundaries';\nimport getSupportedPropertyName from '../utils/getSupportedPropertyName';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function preventOverflow(data, options) {\n  let boundariesElement =\n    options.boundariesElement || getOffsetParent(data.instance.popper);\n\n  // If offsetParent is the reference element, we really want to\n  // go one step up and use the next offsetParent as reference to\n  // avoid to make this modifier completely useless and look like broken\n  if (data.instance.reference === boundariesElement) {\n    boundariesElement = getOffsetParent(boundariesElement);\n  }\n\n  // NOTE: DOM access here\n  // resets the popper's position so that the document size can be calculated excluding\n  // the size of the popper element itself\n  const transformProp = getSupportedPropertyName('transform');\n  const popperStyles = data.instance.popper.style; // assignment to help minification\n  const { top, left, [transformProp]: transform } = popperStyles;\n  popperStyles.top = '';\n  popperStyles.left = '';\n  popperStyles[transformProp] = '';\n\n  const boundaries = getBoundaries(\n    data.instance.popper,\n    data.instance.reference,\n    options.padding,\n    boundariesElement,\n    data.positionFixed\n  );\n\n  // NOTE: DOM access here\n  // restores the original style properties after the offsets have been computed\n  popperStyles.top = top;\n  popperStyles.left = left;\n  popperStyles[transformProp] = transform;\n\n  options.boundaries = boundaries;\n\n  const order = options.priority;\n  let popper = data.offsets.popper;\n\n  const check = {\n    primary(placement) {\n      let value = popper[placement];\n      if (\n        popper[placement] < boundaries[placement] &&\n        !options.escapeWithReference\n      ) {\n        value = Math.max(popper[placement], boundaries[placement]);\n      }\n      return { [placement]: value };\n    },\n    secondary(placement) {\n      const mainSide = placement === 'right' ? 'left' : 'top';\n      let value = popper[mainSide];\n      if (\n        popper[placement] > boundaries[placement] &&\n        !options.escapeWithReference\n      ) {\n        value = Math.min(\n          popper[mainSide],\n          boundaries[placement] -\n            (placement === 'right' ? popper.width : popper.height)\n        );\n      }\n      return { [mainSide]: value };\n    },\n  };\n\n  order.forEach(placement => {\n    const side =\n      ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';\n    popper = { ...popper, ...check[side](placement) };\n  });\n\n  data.offsets.popper = popper;\n\n  return data;\n}\n","/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function keepTogether(data) {\n  const { popper, reference } = data.offsets;\n  const placement = data.placement.split('-')[0];\n  const floor = Math.floor;\n  const isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n  const side = isVertical ? 'right' : 'bottom';\n  const opSide = isVertical ? 'left' : 'top';\n  const measurement = isVertical ? 'width' : 'height';\n\n  if (popper[side] < floor(reference[opSide])) {\n    data.offsets.popper[opSide] =\n      floor(reference[opSide]) - popper[measurement];\n  }\n  if (popper[opSide] > floor(reference[side])) {\n    data.offsets.popper[opSide] = floor(reference[side]);\n  }\n\n  return data;\n}\n","import getClientRect from '../utils/getClientRect';\nimport getOuterSizes from '../utils/getOuterSizes';\nimport isModifierRequired from '../utils/isModifierRequired';\nimport getStyleComputedProperty from '../utils/getStyleComputedProperty';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function arrow(data, options) {\n  // arrow depends on keepTogether in order to work\n  if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {\n    return data;\n  }\n\n  let arrowElement = options.element;\n\n  // if arrowElement is a string, suppose it's a CSS selector\n  if (typeof arrowElement === 'string') {\n    arrowElement = data.instance.popper.querySelector(arrowElement);\n\n    // if arrowElement is not found, don't run the modifier\n    if (!arrowElement) {\n      return data;\n    }\n  } else {\n    // if the arrowElement isn't a query selector we must check that the\n    // provided DOM node is child of its popper node\n    if (!data.instance.popper.contains(arrowElement)) {\n      console.warn(\n        'WARNING: `arrow.element` must be child of its popper element!'\n      );\n      return data;\n    }\n  }\n\n  const placement = data.placement.split('-')[0];\n  const { popper, reference } = data.offsets;\n  const isVertical = ['left', 'right'].indexOf(placement) !== -1;\n\n  const len = isVertical ? 'height' : 'width';\n  const sideCapitalized = isVertical ? 'Top' : 'Left';\n  const side = sideCapitalized.toLowerCase();\n  const altSide = isVertical ? 'left' : 'top';\n  const opSide = isVertical ? 'bottom' : 'right';\n  const arrowElementSize = getOuterSizes(arrowElement)[len];\n\n  //\n  // extends keepTogether behavior making sure the popper and its\n  // reference have enough pixels in conjunction\n  //\n\n  // top/left side\n  if (reference[opSide] - arrowElementSize < popper[side]) {\n    data.offsets.popper[side] -=\n      popper[side] - (reference[opSide] - arrowElementSize);\n  }\n  // bottom/right side\n  if (reference[side] + arrowElementSize > popper[opSide]) {\n    data.offsets.popper[side] +=\n      reference[side] + arrowElementSize - popper[opSide];\n  }\n  data.offsets.popper = getClientRect(data.offsets.popper);\n\n  // compute center of the popper\n  const center = reference[side] + reference[len] / 2 - arrowElementSize / 2;\n\n  // Compute the sideValue using the updated popper offsets\n  // take popper margin in account because we don't have this info available\n  const css = getStyleComputedProperty(data.instance.popper);\n  const popperMarginSide = parseFloat(css[`margin${sideCapitalized}`]);\n  const popperBorderSide = parseFloat(css[`border${sideCapitalized}Width`]);\n  let sideValue =\n    center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;\n\n  // prevent arrowElement from being placed not contiguously to its popper\n  sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);\n\n  data.arrowElement = arrowElement;\n  data.offsets.arrow = {\n    [side]: Math.round(sideValue),\n    [altSide]: '', // make sure to unset any eventual altSide value from the DOM node\n  };\n\n  return data;\n}\n","import getOppositePlacement from '../utils/getOppositePlacement';\nimport getOppositeVariation from '../utils/getOppositeVariation';\nimport getPopperOffsets from '../utils/getPopperOffsets';\nimport runModifiers from '../utils/runModifiers';\nimport getBoundaries from '../utils/getBoundaries';\nimport isModifierEnabled from '../utils/isModifierEnabled';\nimport clockwise from '../utils/clockwise';\n\nconst BEHAVIORS = {\n  FLIP: 'flip',\n  CLOCKWISE: 'clockwise',\n  COUNTERCLOCKWISE: 'counterclockwise',\n};\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function flip(data, options) {\n  // if `inner` modifier is enabled, we can't use the `flip` modifier\n  if (isModifierEnabled(data.instance.modifiers, 'inner')) {\n    return data;\n  }\n\n  if (data.flipped && data.placement === data.originalPlacement) {\n    // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides\n    return data;\n  }\n\n  const boundaries = getBoundaries(\n    data.instance.popper,\n    data.instance.reference,\n    options.padding,\n    options.boundariesElement,\n    data.positionFixed\n  );\n\n  let placement = data.placement.split('-')[0];\n  let placementOpposite = getOppositePlacement(placement);\n  let variation = data.placement.split('-')[1] || '';\n\n  let flipOrder = [];\n\n  switch (options.behavior) {\n    case BEHAVIORS.FLIP:\n      flipOrder = [placement, placementOpposite];\n      break;\n    case BEHAVIORS.CLOCKWISE:\n      flipOrder = clockwise(placement);\n      break;\n    case BEHAVIORS.COUNTERCLOCKWISE:\n      flipOrder = clockwise(placement, true);\n      break;\n    default:\n      flipOrder = options.behavior;\n  }\n\n  flipOrder.forEach((step, index) => {\n    if (placement !== step || flipOrder.length === index + 1) {\n      return data;\n    }\n\n    placement = data.placement.split('-')[0];\n    placementOpposite = getOppositePlacement(placement);\n\n    const popperOffsets = data.offsets.popper;\n    const refOffsets = data.offsets.reference;\n\n    // using floor because the reference offsets may contain decimals we are not going to consider here\n    const floor = Math.floor;\n    const overlapsRef =\n      (placement === 'left' &&\n        floor(popperOffsets.right) > floor(refOffsets.left)) ||\n      (placement === 'right' &&\n        floor(popperOffsets.left) < floor(refOffsets.right)) ||\n      (placement === 'top' &&\n        floor(popperOffsets.bottom) > floor(refOffsets.top)) ||\n      (placement === 'bottom' &&\n        floor(popperOffsets.top) < floor(refOffsets.bottom));\n\n    const overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);\n    const overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);\n    const overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);\n    const overflowsBottom =\n      floor(popperOffsets.bottom) > floor(boundaries.bottom);\n\n    const overflowsBoundaries =\n      (placement === 'left' && overflowsLeft) ||\n      (placement === 'right' && overflowsRight) ||\n      (placement === 'top' && overflowsTop) ||\n      (placement === 'bottom' && overflowsBottom);\n\n    // flip the variation if required\n    const isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n\n    // flips variation if reference element overflows boundaries\n    const flippedVariationByRef =\n      !!options.flipVariations &&\n      ((isVertical && variation === 'start' && overflowsLeft) ||\n        (isVertical && variation === 'end' && overflowsRight) ||\n        (!isVertical && variation === 'start' && overflowsTop) ||\n        (!isVertical && variation === 'end' && overflowsBottom));\n\n    // flips variation if popper content overflows boundaries\n    const flippedVariationByContent =\n      !!options.flipVariationsByContent &&\n      ((isVertical && variation === 'start' && overflowsRight) ||\n        (isVertical && variation === 'end' && overflowsLeft) ||\n        (!isVertical && variation === 'start' && overflowsBottom) ||\n        (!isVertical && variation === 'end' && overflowsTop));\n\n    const flippedVariation = flippedVariationByRef || flippedVariationByContent;\n\n    if (overlapsRef || overflowsBoundaries || flippedVariation) {\n      // this boolean to detect any flip loop\n      data.flipped = true;\n\n      if (overlapsRef || overflowsBoundaries) {\n        placement = flipOrder[index + 1];\n      }\n\n      if (flippedVariation) {\n        variation = getOppositeVariation(variation);\n      }\n\n      data.placement = placement + (variation ? '-' + variation : '');\n\n      // this object contains `position`, we want to preserve it along with\n      // any additional property we may add in the future\n      data.offsets.popper = {\n        ...data.offsets.popper,\n        ...getPopperOffsets(\n          data.instance.popper,\n          data.offsets.reference,\n          data.placement\n        ),\n      };\n\n      data = runModifiers(data.instance.modifiers, data, 'flip');\n    }\n  });\n  return data;\n}\n","/**\n * Get the opposite placement variation of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement variation\n * @returns {String} flipped placement variation\n */\nexport default function getOppositeVariation(variation) {\n  if (variation === 'end') {\n    return 'start';\n  } else if (variation === 'start') {\n    return 'end';\n  }\n  return variation;\n}\n","import getClientRect from '../utils/getClientRect';\nimport getOppositePlacement from '../utils/getOppositePlacement';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function inner(data) {\n  const placement = data.placement;\n  const basePlacement = placement.split('-')[0];\n  const { popper, reference } = data.offsets;\n  const isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;\n\n  const subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;\n\n  popper[isHoriz ? 'left' : 'top'] =\n    reference[basePlacement] -\n    (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);\n\n  data.placement = getOppositePlacement(placement);\n  data.offsets.popper = getClientRect(popper);\n\n  return data;\n}\n","import isModifierRequired from '../utils/isModifierRequired';\nimport find from '../utils/find';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function hide(data) {\n  if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {\n    return data;\n  }\n\n  const refRect = data.offsets.reference;\n  const bound = find(\n    data.instance.modifiers,\n    modifier => modifier.name === 'preventOverflow'\n  ).boundaries;\n\n  if (\n    refRect.bottom < bound.top ||\n    refRect.left > bound.right ||\n    refRect.top > bound.bottom ||\n    refRect.right < bound.left\n  ) {\n    // Avoid unnecessary DOM access if visibility hasn't changed\n    if (data.hide === true) {\n      return data;\n    }\n\n    data.hide = true;\n    data.attributes['x-out-of-boundaries'] = '';\n  } else {\n    // Avoid unnecessary DOM access if visibility hasn't changed\n    if (data.hide === false) {\n      return data;\n    }\n\n    data.hide = false;\n    data.attributes['x-out-of-boundaries'] = false;\n  }\n\n  return data;\n}\n","/**\n * @function\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Boolean} shouldRound - If the offsets should be rounded at all\n * @returns {Object} The popper's position offsets rounded\n *\n * The tale of pixel-perfect positioning. It's still not 100% perfect, but as\n * good as it can be within reason.\n * Discussion here: https://github.com/FezVrasta/popper.js/pull/715\n *\n * Low DPI screens cause a popper to be blurry if not using full pixels (Safari\n * as well on High DPI screens).\n *\n * Firefox prefers no rounding for positioning and does not have blurriness on\n * high DPI screens.\n *\n * Only horizontal placement and left/right values need to be considered.\n */\nexport default function getRoundedOffsets(data, shouldRound) {\n  const { popper, reference } = data.offsets;\n  const { round, floor } = Math;\n  const noRound = v => v;\n  \n  const referenceWidth = round(reference.width);\n  const popperWidth = round(popper.width);\n  \n  const isVertical = ['left', 'right'].indexOf(data.placement) !== -1;\n  const isVariation = data.placement.indexOf('-') !== -1;\n  const sameWidthParity = referenceWidth % 2 === popperWidth % 2;\n  const bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;\n\n  const horizontalToInteger = !shouldRound\n    ? noRound\n    : isVertical || isVariation || sameWidthParity\n    ? round\n    : floor;\n  const verticalToInteger = !shouldRound ? noRound : round;\n\n  return {\n    left: horizontalToInteger(\n      bothOddWidth && !isVariation && shouldRound\n        ? popper.left - 1\n        : popper.left\n    ),\n    top: verticalToInteger(popper.top),\n    bottom: verticalToInteger(popper.bottom),\n    right: horizontalToInteger(popper.right),\n  };\n}\n","import setStyles from '../utils/setStyles';\nimport setAttributes from '../utils/setAttributes';\nimport getReferenceOffsets from '../utils/getReferenceOffsets';\nimport computeAutoPlacement from '../utils/computeAutoPlacement';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} data.styles - List of style properties - values to apply to popper element\n * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The same data object\n */\nexport default function applyStyle(data) {\n  // any property present in `data.styles` will be applied to the popper,\n  // in this way we can make the 3rd party modifiers add custom styles to it\n  // Be aware, modifiers could override the properties defined in the previous\n  // lines of this modifier!\n  setStyles(data.instance.popper, data.styles);\n\n  // any property present in `data.attributes` will be applied to the popper,\n  // they will be set as HTML attributes of the element\n  setAttributes(data.instance.popper, data.attributes);\n\n  // if arrowElement is defined and arrowStyles has some properties\n  if (data.arrowElement && Object.keys(data.arrowStyles).length) {\n    setStyles(data.arrowElement, data.arrowStyles);\n  }\n\n  return data;\n}\n\n/**\n * Set the x-placement attribute before everything else because it could be used\n * to add margins to the popper margins needs to be calculated to get the\n * correct popper offsets.\n * @method\n * @memberof Popper.modifiers\n * @param {HTMLElement} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper\n * @param {Object} options - Popper.js options\n */\nexport function applyStyleOnLoad(\n  reference,\n  popper,\n  options,\n  modifierOptions,\n  state\n) {\n  // compute reference element offsets\n  const referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);\n\n  // compute auto placement, store placement inside the data object,\n  // modifiers will be able to edit `placement` if needed\n  // and refer to originalPlacement to know the original value\n  const placement = computeAutoPlacement(\n    options.placement,\n    referenceOffsets,\n    popper,\n    reference,\n    options.modifiers.flip.boundariesElement,\n    options.modifiers.flip.padding\n  );\n\n  popper.setAttribute('x-placement', placement);\n\n  // Apply `position` to popper before anything else because\n  // without the position applied we can't guarantee correct computations\n  setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });\n\n  return options;\n}\n","/**\n * Set the attributes to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the attributes to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nexport default function setAttributes(element, attributes) {\n  Object.keys(attributes).forEach(function(prop) {\n    const value = attributes[prop];\n    if (value !== false) {\n      element.setAttribute(prop, attributes[prop]);\n    } else {\n      element.removeAttribute(prop);\n    }\n  });\n}\n","import modifiers from '../modifiers/index';\n\n/**\n * Default options provided to Popper.js constructor.<br />\n * These can be overridden using the `options` argument of Popper.js.<br />\n * To override an option, simply pass an object with the same\n * structure of the `options` object, as the 3rd argument. For example:\n * ```\n * new Popper(ref, pop, {\n *   modifiers: {\n *     preventOverflow: { enabled: false }\n *   }\n * })\n * ```\n * @type {Object}\n * @static\n * @memberof Popper\n */\nexport default {\n  /**\n   * Popper's placement.\n   * @prop {Popper.placements} placement='bottom'\n   */\n  placement: 'bottom',\n\n  /**\n   * Set this to true if you want popper to position it self in 'fixed' mode\n   * @prop {Boolean} positionFixed=false\n   */\n  positionFixed: false,\n\n  /**\n   * Whether events (resize, scroll) are initially enabled.\n   * @prop {Boolean} eventsEnabled=true\n   */\n  eventsEnabled: true,\n\n  /**\n   * Set to true if you want to automatically remove the popper when\n   * you call the `destroy` method.\n   * @prop {Boolean} removeOnDestroy=false\n   */\n  removeOnDestroy: false,\n\n  /**\n   * Callback called when the popper is created.<br />\n   * By default, it is set to no-op.<br />\n   * Access Popper.js instance with `data.instance`.\n   * @prop {onCreate}\n   */\n  onCreate: () => {},\n\n  /**\n   * Callback called when the popper is updated. This callback is not called\n   * on the initialization/creation of the popper, but only on subsequent\n   * updates.<br />\n   * By default, it is set to no-op.<br />\n   * Access Popper.js instance with `data.instance`.\n   * @prop {onUpdate}\n   */\n  onUpdate: () => {},\n\n  /**\n   * List of modifiers used to modify the offsets before they are applied to the popper.\n   * They provide most of the functionalities of Popper.js.\n   * @prop {modifiers}\n   */\n  modifiers,\n};\n\n/**\n * @callback onCreate\n * @param {dataObject} data\n */\n\n/**\n * @callback onUpdate\n * @param {dataObject} data\n */\n","// Utils\nimport debounce from './utils/debounce';\nimport isFunction from './utils/isFunction';\n\n// Methods\nimport update from './methods/update';\nimport destroy from './methods/destroy';\nimport enableEventListeners from './methods/enableEventListeners';\nimport disableEventListeners from './methods/disableEventListeners';\nimport Defaults from './methods/defaults';\nimport placements from './methods/placements';\n\nexport default class Popper {\n  /**\n   * Creates a new Popper.js instance.\n   * @class Popper\n   * @param {Element|referenceObject} reference - The reference element used to position the popper\n   * @param {Element} popper - The HTML / XML element used as the popper\n   * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)\n   * @return {Object} instance - The generated Popper.js instance\n   */\n  constructor(reference, popper, options = {}) {\n    // make update() debounced, so that it only runs at most once-per-tick\n    this.update = debounce(this.update.bind(this));\n\n    // with {} we create a new object with the options inside it\n    this.options = { ...Popper.Defaults, ...options };\n\n    // init state\n    this.state = {\n      isDestroyed: false,\n      isCreated: false,\n      scrollParents: [],\n    };\n\n    // get reference and popper elements (allow jQuery wrappers)\n    this.reference = reference && reference.jquery ? reference[0] : reference;\n    this.popper = popper && popper.jquery ? popper[0] : popper;\n\n    // Deep merge modifiers options\n    this.options.modifiers = {};\n    Object.keys({\n      ...Popper.Defaults.modifiers,\n      ...options.modifiers,\n    }).forEach(name => {\n      this.options.modifiers[name] = {\n        // If it's a built-in modifier, use it as base\n        ...(Popper.Defaults.modifiers[name] || {}),\n        // If there are custom options, override and merge with default ones\n        ...(options.modifiers ? options.modifiers[name] : {}),\n      };\n    });\n\n    // Refactoring modifiers' list (Object => Array)\n    this.modifiers = Object.keys(this.options.modifiers)\n      .map(name => ({\n        name,\n        ...this.options.modifiers[name],\n      }))\n      // sort the modifiers by order\n      .sort((a, b) => a.order - b.order);\n\n    // modifiers have the ability to execute arbitrary code when Popper.js get inited\n    // such code is executed in the same order of its modifier\n    // they could add new properties to their options configuration\n    // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!\n    this.modifiers.forEach(modifierOptions => {\n      if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {\n        modifierOptions.onLoad(\n          this.reference,\n          this.popper,\n          this.options,\n          modifierOptions,\n          this.state\n        );\n      }\n    });\n\n    // fire the first update to position the popper in the right place\n    this.update();\n\n    const eventsEnabled = this.options.eventsEnabled;\n    if (eventsEnabled) {\n      // setup event listeners, they will take care of update the position in specific situations\n      this.enableEventListeners();\n    }\n\n    this.state.eventsEnabled = eventsEnabled;\n  }\n\n  // We can't use class properties because they don't get listed in the\n  // class prototype and break stuff like Sinon stubs\n  update() {\n    return update.call(this);\n  }\n  destroy() {\n    return destroy.call(this);\n  }\n  enableEventListeners() {\n    return enableEventListeners.call(this);\n  }\n  disableEventListeners() {\n    return disableEventListeners.call(this);\n  }\n\n  /**\n   * Schedules an update. It will run on the next UI update available.\n   * @method scheduleUpdate\n   * @memberof Popper\n   */\n  scheduleUpdate = () => requestAnimationFrame(this.update);\n\n  /**\n   * Collection of utilities useful when writing custom modifiers.\n   * Starting from version 1.7, this method is available only if you\n   * include `popper-utils.js` before `popper.js`.\n   *\n   * **DEPRECATION**: This way to access PopperUtils is deprecated\n   * and will be removed in v2! Use the PopperUtils module directly instead.\n   * Due to the high instability of the methods contained in Utils, we can't\n   * guarantee them to follow semver. Use them at your own risk!\n   * @static\n   * @private\n   * @type {Object}\n   * @deprecated since version 1.8\n   * @member Utils\n   * @memberof Popper\n   */\n  static Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;\n\n  static placements = placements;\n\n  static Defaults = Defaults;\n}\n\n/**\n * The `referenceObject` is an object that provides an interface compatible with Popper.js\n * and lets you use it as replacement of a real DOM node.<br />\n * You can use this method to position a popper relatively to a set of coordinates\n * in case you don't have a DOM node to use as reference.\n *\n * ```\n * new Popper(referenceObject, popperNode);\n * ```\n *\n * NB: This feature isn't supported in Internet Explorer 10.\n * @name referenceObject\n * @property {Function} data.getBoundingClientRect\n * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.\n * @property {number} data.clientWidth\n * An ES6 getter that will return the width of the virtual reference element.\n * @property {number} data.clientHeight\n * An ES6 getter that will return the height of the virtual reference element.\n */\n","/**\n * Check if the given variable is a function\n * @method\n * @memberof Popper.Utils\n * @argument {Any} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\nexport default function isFunction(functionToCheck) {\n  const getType = {};\n  return (\n    functionToCheck &&\n    getType.toString.call(functionToCheck) === '[object Function]'\n  );\n}\n","/////////////////////////////////////////////////////////////////////////////////\n/* UAParser.js v0.7.32\n   Copyright © 2012-2021 Faisal Salman <f@faisalman.com>\n   MIT License *//*\n   Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.\n   Supports browser & node.js environment. \n   Demo   : https://faisalman.github.io/ua-parser-js\n   Source : https://github.com/faisalman/ua-parser-js */\n/////////////////////////////////////////////////////////////////////////////////\n\n(function (window, undefined) {\n\n    'use strict';\n\n    //////////////\n    // Constants\n    /////////////\n\n\n    var LIBVERSION  = '0.7.32',\n        EMPTY       = '',\n        UNKNOWN     = '?',\n        FUNC_TYPE   = 'function',\n        UNDEF_TYPE  = 'undefined',\n        OBJ_TYPE    = 'object',\n        STR_TYPE    = 'string',\n        MAJOR       = 'major',\n        MODEL       = 'model',\n        NAME        = 'name',\n        TYPE        = 'type',\n        VENDOR      = 'vendor',\n        VERSION     = 'version',\n        ARCHITECTURE= 'architecture',\n        CONSOLE     = 'console',\n        MOBILE      = 'mobile',\n        TABLET      = 'tablet',\n        SMARTTV     = 'smarttv',\n        WEARABLE    = 'wearable',\n        EMBEDDED    = 'embedded',\n        UA_MAX_LENGTH = 350;\n\n    var AMAZON  = 'Amazon',\n        APPLE   = 'Apple',\n        ASUS    = 'ASUS',\n        BLACKBERRY = 'BlackBerry',\n        BROWSER = 'Browser',\n        CHROME  = 'Chrome',\n        EDGE    = 'Edge',\n        FIREFOX = 'Firefox',\n        GOOGLE  = 'Google',\n        HUAWEI  = 'Huawei',\n        LG      = 'LG',\n        MICROSOFT = 'Microsoft',\n        MOTOROLA  = 'Motorola',\n        OPERA   = 'Opera',\n        SAMSUNG = 'Samsung',\n        SHARP   = 'Sharp',\n        SONY    = 'Sony',\n        XIAOMI  = 'Xiaomi',\n        ZEBRA   = 'Zebra',\n        FACEBOOK   = 'Facebook';\n\n    ///////////\n    // Helper\n    //////////\n\n    var extend = function (regexes, extensions) {\n            var mergedRegexes = {};\n            for (var i in regexes) {\n                if (extensions[i] && extensions[i].length % 2 === 0) {\n                    mergedRegexes[i] = extensions[i].concat(regexes[i]);\n                } else {\n                    mergedRegexes[i] = regexes[i];\n                }\n            }\n            return mergedRegexes;\n        },\n        enumerize = function (arr) {\n            var enums = {};\n            for (var i=0; i<arr.length; i++) {\n                enums[arr[i].toUpperCase()] = arr[i];\n            }\n            return enums;\n        },\n        has = function (str1, str2) {\n            return typeof str1 === STR_TYPE ? lowerize(str2).indexOf(lowerize(str1)) !== -1 : false;\n        },\n        lowerize = function (str) {\n            return str.toLowerCase();\n        },\n        majorize = function (version) {\n            return typeof(version) === STR_TYPE ? version.replace(/[^\\d\\.]/g, EMPTY).split('.')[0] : undefined;\n        },\n        trim = function (str, len) {\n            if (typeof(str) === STR_TYPE) {\n                str = str.replace(/^\\s\\s*/, EMPTY).replace(/\\s\\s*$/, EMPTY);\n                return typeof(len) === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH);\n            }\n    };\n\n    ///////////////\n    // Map helper\n    //////////////\n\n    var rgxMapper = function (ua, arrays) {\n\n            var i = 0, j, k, p, q, matches, match;\n\n            // loop through all regexes maps\n            while (i < arrays.length && !matches) {\n\n                var regex = arrays[i],       // even sequence (0,2,4,..)\n                    props = arrays[i + 1];   // odd sequence (1,3,5,..)\n                j = k = 0;\n\n                // try matching uastring with regexes\n                while (j < regex.length && !matches) {\n\n                    matches = regex[j++].exec(ua);\n\n                    if (!!matches) {\n                        for (p = 0; p < props.length; p++) {\n                            match = matches[++k];\n                            q = props[p];\n                            // check if given property is actually array\n                            if (typeof q === OBJ_TYPE && q.length > 0) {\n                                if (q.length === 2) {\n                                    if (typeof q[1] == FUNC_TYPE) {\n                                        // assign modified match\n                                        this[q[0]] = q[1].call(this, match);\n                                    } else {\n                                        // assign given value, ignore regex match\n                                        this[q[0]] = q[1];\n                                    }\n                                } else if (q.length === 3) {\n                                    // check whether function or regex\n                                    if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) {\n                                        // call function (usually string mapper)\n                                        this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined;\n                                    } else {\n                                        // sanitize match using given regex\n                                        this[q[0]] = match ? match.replace(q[1], q[2]) : undefined;\n                                    }\n                                } else if (q.length === 4) {\n                                        this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined;\n                                }\n                            } else {\n                                this[q] = match ? match : undefined;\n                            }\n                        }\n                    }\n                }\n                i += 2;\n            }\n        },\n\n        strMapper = function (str, map) {\n\n            for (var i in map) {\n                // check if current value is array\n                if (typeof map[i] === OBJ_TYPE && map[i].length > 0) {\n                    for (var j = 0; j < map[i].length; j++) {\n                        if (has(map[i][j], str)) {\n                            return (i === UNKNOWN) ? undefined : i;\n                        }\n                    }\n                } else if (has(map[i], str)) {\n                    return (i === UNKNOWN) ? undefined : i;\n                }\n            }\n            return str;\n    };\n\n    ///////////////\n    // String map\n    //////////////\n\n    // Safari < 3.0\n    var oldSafariMap = {\n            '1.0'   : '/8',\n            '1.2'   : '/1',\n            '1.3'   : '/3',\n            '2.0'   : '/412',\n            '2.0.2' : '/416',\n            '2.0.3' : '/417',\n            '2.0.4' : '/419',\n            '?'     : '/'\n        },\n        windowsVersionMap = {\n            'ME'        : '4.90',\n            'NT 3.11'   : 'NT3.51',\n            'NT 4.0'    : 'NT4.0',\n            '2000'      : 'NT 5.0',\n            'XP'        : ['NT 5.1', 'NT 5.2'],\n            'Vista'     : 'NT 6.0',\n            '7'         : 'NT 6.1',\n            '8'         : 'NT 6.2',\n            '8.1'       : 'NT 6.3',\n            '10'        : ['NT 6.4', 'NT 10.0'],\n            'RT'        : 'ARM'\n    };\n\n    //////////////\n    // Regex map\n    /////////////\n\n    var regexes = {\n\n        browser : [[\n\n            /\\b(?:crmo|crios)\\/([\\w\\.]+)/i                                      // Chrome for Android/iOS\n            ], [VERSION, [NAME, 'Chrome']], [\n            /edg(?:e|ios|a)?\\/([\\w\\.]+)/i                                       // Microsoft Edge\n            ], [VERSION, [NAME, 'Edge']], [\n\n            // Presto based\n            /(opera mini)\\/([-\\w\\.]+)/i,                                        // Opera Mini\n            /(opera [mobiletab]{3,6})\\b.+version\\/([-\\w\\.]+)/i,                 // Opera Mobi/Tablet\n            /(opera)(?:.+version\\/|[\\/ ]+)([\\w\\.]+)/i                           // Opera\n            ], [NAME, VERSION], [\n            /opios[\\/ ]+([\\w\\.]+)/i                                             // Opera mini on iphone >= 8.0\n            ], [VERSION, [NAME, OPERA+' Mini']], [\n            /\\bopr\\/([\\w\\.]+)/i                                                 // Opera Webkit\n            ], [VERSION, [NAME, OPERA]], [\n\n            // Mixed\n            /(kindle)\\/([\\w\\.]+)/i,                                             // Kindle\n            /(lunascape|maxthon|netfront|jasmine|blazer)[\\/ ]?([\\w\\.]*)/i,      // Lunascape/Maxthon/Netfront/Jasmine/Blazer\n            // Trident based\n            /(avant |iemobile|slim)(?:browser)?[\\/ ]?([\\w\\.]*)/i,               // Avant/IEMobile/SlimBrowser\n            /(ba?idubrowser)[\\/ ]?([\\w\\.]+)/i,                                  // Baidu Browser\n            /(?:ms|\\()(ie) ([\\w\\.]+)/i,                                         // Internet Explorer\n\n            // Webkit/KHTML based                                               // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon\n            /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\\/([-\\w\\.]+)/i,\n                                                                                // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ\n            /(weibo)__([\\d\\.]+)/i                                               // Weibo\n            ], [NAME, VERSION], [\n            /(?:\\buc? ?browser|(?:juc.+)ucweb)[\\/ ]?([\\w\\.]+)/i                 // UCBrowser\n            ], [VERSION, [NAME, 'UC'+BROWSER]], [\n            /microm.+\\bqbcore\\/([\\w\\.]+)/i,                                     // WeChat Desktop for Windows Built-in Browser\n            /\\bqbcore\\/([\\w\\.]+).+microm/i\n            ], [VERSION, [NAME, 'WeChat(Win) Desktop']], [\n            /micromessenger\\/([\\w\\.]+)/i                                        // WeChat\n            ], [VERSION, [NAME, 'WeChat']], [\n            /konqueror\\/([\\w\\.]+)/i                                             // Konqueror\n            ], [VERSION, [NAME, 'Konqueror']], [\n            /trident.+rv[: ]([\\w\\.]{1,9})\\b.+like gecko/i                       // IE11\n            ], [VERSION, [NAME, 'IE']], [\n            /yabrowser\\/([\\w\\.]+)/i                                             // Yandex\n            ], [VERSION, [NAME, 'Yandex']], [\n            /(avast|avg)\\/([\\w\\.]+)/i                                           // Avast/AVG Secure Browser\n            ], [[NAME, /(.+)/, '$1 Secure '+BROWSER], VERSION], [\n            /\\bfocus\\/([\\w\\.]+)/i                                               // Firefox Focus\n            ], [VERSION, [NAME, FIREFOX+' Focus']], [\n            /\\bopt\\/([\\w\\.]+)/i                                                 // Opera Touch\n            ], [VERSION, [NAME, OPERA+' Touch']], [\n            /coc_coc\\w+\\/([\\w\\.]+)/i                                            // Coc Coc Browser\n            ], [VERSION, [NAME, 'Coc Coc']], [\n            /dolfin\\/([\\w\\.]+)/i                                                // Dolphin\n            ], [VERSION, [NAME, 'Dolphin']], [\n            /coast\\/([\\w\\.]+)/i                                                 // Opera Coast\n            ], [VERSION, [NAME, OPERA+' Coast']], [\n            /miuibrowser\\/([\\w\\.]+)/i                                           // MIUI Browser\n            ], [VERSION, [NAME, 'MIUI '+BROWSER]], [\n            /fxios\\/([-\\w\\.]+)/i                                                // Firefox for iOS\n            ], [VERSION, [NAME, FIREFOX]], [\n            /\\bqihu|(qi?ho?o?|360)browser/i                                     // 360\n            ], [[NAME, '360 '+BROWSER]], [\n            /(oculus|samsung|sailfish|huawei)browser\\/([\\w\\.]+)/i\n            ], [[NAME, /(.+)/, '$1 '+BROWSER], VERSION], [                      // Oculus/Samsung/Sailfish/Huawei Browser\n            /(comodo_dragon)\\/([\\w\\.]+)/i                                       // Comodo Dragon\n            ], [[NAME, /_/g, ' '], VERSION], [\n            /(electron)\\/([\\w\\.]+) safari/i,                                    // Electron-based App\n            /(tesla)(?: qtcarbrowser|\\/(20\\d\\d\\.[-\\w\\.]+))/i,                   // Tesla\n            /m?(qqbrowser|baiduboxapp|2345Explorer)[\\/ ]?([\\w\\.]+)/i            // QQBrowser/Baidu App/2345 Browser\n            ], [NAME, VERSION], [\n            /(metasr)[\\/ ]?([\\w\\.]+)/i,                                         // SouGouBrowser\n            /(lbbrowser)/i,                                                     // LieBao Browser\n            /\\[(linkedin)app\\]/i                                                // LinkedIn App for iOS & Android\n            ], [NAME], [\n\n            // WebView\n            /((?:fban\\/fbios|fb_iab\\/fb4a)(?!.+fbav)|;fbav\\/([\\w\\.]+);)/i       // Facebook App for iOS & Android\n            ], [[NAME, FACEBOOK], VERSION], [\n            /safari (line)\\/([\\w\\.]+)/i,                                        // Line App for iOS\n            /\\b(line)\\/([\\w\\.]+)\\/iab/i,                                        // Line App for Android\n            /(chromium|instagram)[\\/ ]([-\\w\\.]+)/i                              // Chromium/Instagram\n            ], [NAME, VERSION], [\n            /\\bgsa\\/([\\w\\.]+) .*safari\\//i                                      // Google Search Appliance on iOS\n            ], [VERSION, [NAME, 'GSA']], [\n\n            /headlesschrome(?:\\/([\\w\\.]+)| )/i                                  // Chrome Headless\n            ], [VERSION, [NAME, CHROME+' Headless']], [\n\n            / wv\\).+(chrome)\\/([\\w\\.]+)/i                                       // Chrome WebView\n            ], [[NAME, CHROME+' WebView'], VERSION], [\n\n            /droid.+ version\\/([\\w\\.]+)\\b.+(?:mobile safari|safari)/i           // Android Browser\n            ], [VERSION, [NAME, 'Android '+BROWSER]], [\n\n            /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\\/v?([\\w\\.]+)/i       // Chrome/OmniWeb/Arora/Tizen/Nokia\n            ], [NAME, VERSION], [\n\n            /version\\/([\\w\\.\\,]+) .*mobile\\/\\w+ (safari)/i                      // Mobile Safari\n            ], [VERSION, [NAME, 'Mobile Safari']], [\n            /version\\/([\\w(\\.|\\,)]+) .*(mobile ?safari|safari)/i                // Safari & Safari Mobile\n            ], [VERSION, NAME], [\n            /webkit.+?(mobile ?safari|safari)(\\/[\\w\\.]+)/i                      // Safari < 3.0\n            ], [NAME, [VERSION, strMapper, oldSafariMap]], [\n\n            /(webkit|khtml)\\/([\\w\\.]+)/i\n            ], [NAME, VERSION], [\n\n            // Gecko based\n            /(navigator|netscape\\d?)\\/([-\\w\\.]+)/i                              // Netscape\n            ], [[NAME, 'Netscape'], VERSION], [\n            /mobile vr; rv:([\\w\\.]+)\\).+firefox/i                               // Firefox Reality\n            ], [VERSION, [NAME, FIREFOX+' Reality']], [\n            /ekiohf.+(flow)\\/([\\w\\.]+)/i,                                       // Flow\n            /(swiftfox)/i,                                                      // Swiftfox\n            /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\\/ ]?([\\w\\.\\+]+)/i,\n                                                                                // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror/Klar\n            /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\\/([-\\w\\.]+)$/i,\n                                                                                // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix\n            /(firefox)\\/([\\w\\.]+)/i,                                            // Other Firefox-based\n            /(mozilla)\\/([\\w\\.]+) .+rv\\:.+gecko\\/\\d+/i,                         // Mozilla\n\n            // Other\n            /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\\. ]?browser)[-\\/ ]?v?([\\w\\.]+)/i,\n                                                                                // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser\n            /(links) \\(([\\w\\.]+)/i                                              // Links\n            ], [NAME, VERSION]\n        ],\n\n        cpu : [[\n\n            /(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\\)]/i                     // AMD64 (x64)\n            ], [[ARCHITECTURE, 'amd64']], [\n\n            /(ia32(?=;))/i                                                      // IA32 (quicktime)\n            ], [[ARCHITECTURE, lowerize]], [\n\n            /((?:i[346]|x)86)[;\\)]/i                                            // IA32 (x86)\n            ], [[ARCHITECTURE, 'ia32']], [\n\n            /\\b(aarch64|arm(v?8e?l?|_?64))\\b/i                                 // ARM64\n            ], [[ARCHITECTURE, 'arm64']], [\n\n            /\\b(arm(?:v[67])?ht?n?[fl]p?)\\b/i                                   // ARMHF\n            ], [[ARCHITECTURE, 'armhf']], [\n\n            // PocketPC mistakenly identified as PowerPC\n            /windows (ce|mobile); ppc;/i\n            ], [[ARCHITECTURE, 'arm']], [\n\n            /((?:ppc|powerpc)(?:64)?)(?: mac|;|\\))/i                            // PowerPC\n            ], [[ARCHITECTURE, /ower/, EMPTY, lowerize]], [\n\n            /(sun4\\w)[;\\)]/i                                                    // SPARC\n            ], [[ARCHITECTURE, 'sparc']], [\n\n            /((?:avr32|ia64(?=;))|68k(?=\\))|\\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\\b|pa-risc)/i\n                                                                                // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC\n            ], [[ARCHITECTURE, lowerize]]\n        ],\n\n        device : [[\n\n            //////////////////////////\n            // MOBILES & TABLETS\n            // Ordered by popularity\n            /////////////////////////\n\n            // Samsung\n            /\\b(sch-i[89]0\\d|shw-m380s|sm-[ptx]\\w{2,4}|gt-[pn]\\d{2,4}|sgh-t8[56]9|nexus 10)/i\n            ], [MODEL, [VENDOR, SAMSUNG], [TYPE, TABLET]], [\n            /\\b((?:s[cgp]h|gt|sm)-\\w+|galaxy nexus)/i,\n            /samsung[- ]([-\\w]+)/i,\n            /sec-(sgh\\w+)/i\n            ], [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]], [\n\n            // Apple\n            /\\((ip(?:hone|od)[\\w ]*);/i                                         // iPod/iPhone\n            ], [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]], [\n            /\\((ipad);[-\\w\\),; ]+apple/i,                                       // iPad\n            /applecoremedia\\/[\\w\\.]+ \\((ipad)/i,\n            /\\b(ipad)\\d\\d?,\\d\\d?[;\\]].+ios/i\n            ], [MODEL, [VENDOR, APPLE], [TYPE, TABLET]], [\n\n            // Huawei\n            /\\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\\d{2})\\b(?!.+d\\/s)/i\n            ], [MODEL, [VENDOR, HUAWEI], [TYPE, TABLET]], [\n            /(?:huawei|honor)([-\\w ]+)[;\\)]/i,\n            /\\b(nexus 6p|\\w{2,4}e?-[atu]?[ln][\\dx][012359c][adn]?)\\b(?!.+d\\/s)/i\n            ], [MODEL, [VENDOR, HUAWEI], [TYPE, MOBILE]], [\n\n            // Xiaomi\n            /\\b(poco[\\w ]+)(?: bui|\\))/i,                                       // Xiaomi POCO\n            /\\b; (\\w+) build\\/hm\\1/i,                                           // Xiaomi Hongmi 'numeric' models\n            /\\b(hm[-_ ]?note?[_ ]?(?:\\d\\w)?) bui/i,                             // Xiaomi Hongmi\n            /\\b(redmi[\\-_ ]?(?:note|k)?[\\w_ ]+)(?: bui|\\))/i,                   // Xiaomi Redmi\n            /\\b(mi[-_ ]?(?:a\\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\\d?\\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\\))/i // Xiaomi Mi\n            ], [[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, MOBILE]], [\n            /\\b(mi[-_ ]?(?:pad)(?:[\\w_ ]+))(?: bui|\\))/i                        // Mi Pad tablets\n            ],[[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, TABLET]], [\n\n            // OPPO\n            /; (\\w+) bui.+ oppo/i,\n            /\\b(cph[12]\\d{3}|p(?:af|c[al]|d\\w|e[ar])[mt]\\d0|x9007|a101op)\\b/i\n            ], [MODEL, [VENDOR, 'OPPO'], [TYPE, MOBILE]], [\n\n            // Vivo\n            /vivo (\\w+)(?: bui|\\))/i,\n            /\\b(v[12]\\d{3}\\w?[at])(?: bui|;)/i\n            ], [MODEL, [VENDOR, 'Vivo'], [TYPE, MOBILE]], [\n\n            // Realme\n            /\\b(rmx[12]\\d{3})(?: bui|;|\\))/i\n            ], [MODEL, [VENDOR, 'Realme'], [TYPE, MOBILE]], [\n\n            // Motorola\n            /\\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\\b[\\w ]+build\\//i,\n            /\\bmot(?:orola)?[- ](\\w*)/i,\n            /((?:moto[\\w\\(\\) ]+|xt\\d{3,4}|nexus 6)(?= bui|\\)))/i\n            ], [MODEL, [VENDOR, MOTOROLA], [TYPE, MOBILE]], [\n            /\\b(mz60\\d|xoom[2 ]{0,2}) build\\//i\n            ], [MODEL, [VENDOR, MOTOROLA], [TYPE, TABLET]], [\n\n            // LG\n            /((?=lg)?[vl]k\\-?\\d{3}) bui| 3\\.[-\\w; ]{10}lg?-([06cv9]{3,4})/i\n            ], [MODEL, [VENDOR, LG], [TYPE, TABLET]], [\n            /(lm(?:-?f100[nv]?|-[\\w\\.]+)(?= bui|\\))|nexus [45])/i,\n            /\\blg[-e;\\/ ]+((?!browser|netcast|android tv)\\w+)/i,\n            /\\blg-?([\\d\\w]+) bui/i\n            ], [MODEL, [VENDOR, LG], [TYPE, MOBILE]], [\n\n            // Lenovo\n            /(ideatab[-\\w ]+)/i,\n            /lenovo ?(s[56]000[-\\w]+|tab(?:[\\w ]+)|yt[-\\d\\w]{6}|tb[-\\d\\w]{6})/i\n            ], [MODEL, [VENDOR, 'Lenovo'], [TYPE, TABLET]], [\n\n            // Nokia\n            /(?:maemo|nokia).*(n900|lumia \\d+)/i,\n            /nokia[-_ ]?([-\\w\\.]*)/i\n            ], [[MODEL, /_/g, ' '], [VENDOR, 'Nokia'], [TYPE, MOBILE]], [\n\n            // Google\n            /(pixel c)\\b/i                                                      // Google Pixel C\n            ], [MODEL, [VENDOR, GOOGLE], [TYPE, TABLET]], [\n            /droid.+; (pixel[\\daxl ]{0,6})(?: bui|\\))/i                         // Google Pixel\n            ], [MODEL, [VENDOR, GOOGLE], [TYPE, MOBILE]], [\n\n            // Sony\n            /droid.+ (a?\\d[0-2]{2}so|[c-g]\\d{4}|so[-gl]\\w+|xq-a\\w[4-7][12])(?= bui|\\).+chrome\\/(?![1-6]{0,1}\\d\\.))/i\n            ], [MODEL, [VENDOR, SONY], [TYPE, MOBILE]], [\n            /sony tablet [ps]/i,\n            /\\b(?:sony)?sgp\\w+(?: bui|\\))/i\n            ], [[MODEL, 'Xperia Tablet'], [VENDOR, SONY], [TYPE, TABLET]], [\n\n            // OnePlus\n            / (kb2005|in20[12]5|be20[12][59])\\b/i,\n            /(?:one)?(?:plus)? (a\\d0\\d\\d)(?: b|\\))/i\n            ], [MODEL, [VENDOR, 'OnePlus'], [TYPE, MOBILE]], [\n\n            // Amazon\n            /(alexa)webm/i,\n            /(kf[a-z]{2}wi)( bui|\\))/i,                                         // Kindle Fire without Silk\n            /(kf[a-z]+)( bui|\\)).+silk\\//i                                      // Kindle Fire HD\n            ], [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]], [\n            /((?:sd|kf)[0349hijorstuw]+)( bui|\\)).+silk\\//i                     // Fire Phone\n            ], [[MODEL, /(.+)/g, 'Fire Phone $1'], [VENDOR, AMAZON], [TYPE, MOBILE]], [\n\n            // BlackBerry\n            /(playbook);[-\\w\\),; ]+(rim)/i                                      // BlackBerry PlayBook\n            ], [MODEL, VENDOR, [TYPE, TABLET]], [\n            /\\b((?:bb[a-f]|st[hv])100-\\d)/i,\n            /\\(bb10; (\\w+)/i                                                    // BlackBerry 10\n            ], [MODEL, [VENDOR, BLACKBERRY], [TYPE, MOBILE]], [\n\n            // Asus\n            /(?:\\b|asus_)(transfo[prime ]{4,10} \\w+|eeepc|slider \\w+|nexus 7|padfone|p00[cj])/i\n            ], [MODEL, [VENDOR, ASUS], [TYPE, TABLET]], [\n            / (z[bes]6[027][012][km][ls]|zenfone \\d\\w?)\\b/i\n            ], [MODEL, [VENDOR, ASUS], [TYPE, MOBILE]], [\n\n            // HTC\n            /(nexus 9)/i                                                        // HTC Nexus 9\n            ], [MODEL, [VENDOR, 'HTC'], [TYPE, TABLET]], [\n            /(htc)[-;_ ]{1,2}([\\w ]+(?=\\)| bui)|\\w+)/i,                         // HTC\n\n            // ZTE\n            /(zte)[- ]([\\w ]+?)(?: bui|\\/|\\))/i,\n            /(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\\w]*)/i         // Alcatel/GeeksPhone/Nexian/Panasonic/Sony\n            ], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [\n\n            // Acer\n            /droid.+; ([ab][1-7]-?[0178a]\\d\\d?)/i\n            ], [MODEL, [VENDOR, 'Acer'], [TYPE, TABLET]], [\n\n            // Meizu\n            /droid.+; (m[1-5] note) bui/i,\n            /\\bmz-([-\\w]{2,})/i\n            ], [MODEL, [VENDOR, 'Meizu'], [TYPE, MOBILE]], [\n\n            // Sharp\n            /\\b(sh-?[altvz]?\\d\\d[a-ekm]?)/i\n            ], [MODEL, [VENDOR, SHARP], [TYPE, MOBILE]], [\n\n            // MIXED\n            /(blackberry|benq|palm(?=\\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\\w]*)/i,\n                                                                                // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron\n            /(hp) ([\\w ]+\\w)/i,                                                 // HP iPAQ\n            /(asus)-?(\\w+)/i,                                                   // Asus\n            /(microsoft); (lumia[\\w ]+)/i,                                      // Microsoft Lumia\n            /(lenovo)[-_ ]?([-\\w]+)/i,                                          // Lenovo\n            /(jolla)/i,                                                         // Jolla\n            /(oppo) ?([\\w ]+) bui/i                                             // OPPO\n            ], [VENDOR, MODEL, [TYPE, MOBILE]], [\n\n            /(archos) (gamepad2?)/i,                                            // Archos\n            /(hp).+(touchpad(?!.+tablet)|tablet)/i,                             // HP TouchPad\n            /(kindle)\\/([\\w\\.]+)/i,                                             // Kindle\n            /(nook)[\\w ]+build\\/(\\w+)/i,                                        // Nook\n            /(dell) (strea[kpr\\d ]*[\\dko])/i,                                   // Dell Streak\n            /(le[- ]+pan)[- ]+(\\w{1,9}) bui/i,                                  // Le Pan Tablets\n            /(trinity)[- ]*(t\\d{3}) bui/i,                                      // Trinity Tablets\n            /(gigaset)[- ]+(q\\w{1,9}) bui/i,                                    // Gigaset Tablets\n            /(vodafone) ([\\w ]+)(?:\\)| bui)/i                                   // Vodafone\n            ], [VENDOR, MODEL, [TYPE, TABLET]], [\n\n            /(surface duo)/i                                                    // Surface Duo\n            ], [MODEL, [VENDOR, MICROSOFT], [TYPE, TABLET]], [\n            /droid [\\d\\.]+; (fp\\du?)(?: b|\\))/i                                 // Fairphone\n            ], [MODEL, [VENDOR, 'Fairphone'], [TYPE, MOBILE]], [\n            /(u304aa)/i                                                         // AT&T\n            ], [MODEL, [VENDOR, 'AT&T'], [TYPE, MOBILE]], [\n            /\\bsie-(\\w*)/i                                                      // Siemens\n            ], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [\n            /\\b(rct\\w+) b/i                                                     // RCA Tablets\n            ], [MODEL, [VENDOR, 'RCA'], [TYPE, TABLET]], [\n            /\\b(venue[\\d ]{2,7}) b/i                                            // Dell Venue Tablets\n            ], [MODEL, [VENDOR, 'Dell'], [TYPE, TABLET]], [\n            /\\b(q(?:mv|ta)\\w+) b/i                                              // Verizon Tablet\n            ], [MODEL, [VENDOR, 'Verizon'], [TYPE, TABLET]], [\n            /\\b(?:barnes[& ]+noble |bn[rt])([\\w\\+ ]*) b/i                       // Barnes & Noble Tablet\n            ], [MODEL, [VENDOR, 'Barnes & Noble'], [TYPE, TABLET]], [\n            /\\b(tm\\d{3}\\w+) b/i\n            ], [MODEL, [VENDOR, 'NuVision'], [TYPE, TABLET]], [\n            /\\b(k88) b/i                                                        // ZTE K Series Tablet\n            ], [MODEL, [VENDOR, 'ZTE'], [TYPE, TABLET]], [\n            /\\b(nx\\d{3}j) b/i                                                   // ZTE Nubia\n            ], [MODEL, [VENDOR, 'ZTE'], [TYPE, MOBILE]], [\n            /\\b(gen\\d{3}) b.+49h/i                                              // Swiss GEN Mobile\n            ], [MODEL, [VENDOR, 'Swiss'], [TYPE, MOBILE]], [\n            /\\b(zur\\d{3}) b/i                                                   // Swiss ZUR Tablet\n            ], [MODEL, [VENDOR, 'Swiss'], [TYPE, TABLET]], [\n            /\\b((zeki)?tb.*\\b) b/i                                              // Zeki Tablets\n            ], [MODEL, [VENDOR, 'Zeki'], [TYPE, TABLET]], [\n            /\\b([yr]\\d{2}) b/i,\n            /\\b(dragon[- ]+touch |dt)(\\w{5}) b/i                                // Dragon Touch Tablet\n            ], [[VENDOR, 'Dragon Touch'], MODEL, [TYPE, TABLET]], [\n            /\\b(ns-?\\w{0,9}) b/i                                                // Insignia Tablets\n            ], [MODEL, [VENDOR, 'Insignia'], [TYPE, TABLET]], [\n            /\\b((nxa|next)-?\\w{0,9}) b/i                                        // NextBook Tablets\n            ], [MODEL, [VENDOR, 'NextBook'], [TYPE, TABLET]], [\n            /\\b(xtreme\\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i                  // Voice Xtreme Phones\n            ], [[VENDOR, 'Voice'], MODEL, [TYPE, MOBILE]], [\n            /\\b(lvtel\\-)?(v1[12]) b/i                                           // LvTel Phones\n            ], [[VENDOR, 'LvTel'], MODEL, [TYPE, MOBILE]], [\n            /\\b(ph-1) /i                                                        // Essential PH-1\n            ], [MODEL, [VENDOR, 'Essential'], [TYPE, MOBILE]], [\n            /\\b(v(100md|700na|7011|917g).*\\b) b/i                               // Envizen Tablets\n            ], [MODEL, [VENDOR, 'Envizen'], [TYPE, TABLET]], [\n            /\\b(trio[-\\w\\. ]+) b/i                                              // MachSpeed Tablets\n            ], [MODEL, [VENDOR, 'MachSpeed'], [TYPE, TABLET]], [\n            /\\btu_(1491) b/i                                                    // Rotor Tablets\n            ], [MODEL, [VENDOR, 'Rotor'], [TYPE, TABLET]], [\n            /(shield[\\w ]+) b/i                                                 // Nvidia Shield Tablets\n            ], [MODEL, [VENDOR, 'Nvidia'], [TYPE, TABLET]], [\n            /(sprint) (\\w+)/i                                                   // Sprint Phones\n            ], [VENDOR, MODEL, [TYPE, MOBILE]], [\n            /(kin\\.[onetw]{3})/i                                                // Microsoft Kin\n            ], [[MODEL, /\\./g, ' '], [VENDOR, MICROSOFT], [TYPE, MOBILE]], [\n            /droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\\)/i             // Zebra\n            ], [MODEL, [VENDOR, ZEBRA], [TYPE, TABLET]], [\n            /droid.+; (ec30|ps20|tc[2-8]\\d[kx])\\)/i\n            ], [MODEL, [VENDOR, ZEBRA], [TYPE, MOBILE]], [\n\n            ///////////////////\n            // CONSOLES\n            ///////////////////\n\n            /(ouya)/i,                                                          // Ouya\n            /(nintendo) ([wids3utch]+)/i                                        // Nintendo\n            ], [VENDOR, MODEL, [TYPE, CONSOLE]], [\n            /droid.+; (shield) bui/i                                            // Nvidia\n            ], [MODEL, [VENDOR, 'Nvidia'], [TYPE, CONSOLE]], [\n            /(playstation [345portablevi]+)/i                                   // Playstation\n            ], [MODEL, [VENDOR, SONY], [TYPE, CONSOLE]], [\n            /\\b(xbox(?: one)?(?!; xbox))[\\); ]/i                                // Microsoft Xbox\n            ], [MODEL, [VENDOR, MICROSOFT], [TYPE, CONSOLE]], [\n\n            ///////////////////\n            // SMARTTVS\n            ///////////////////\n\n            /smart-tv.+(samsung)/i                                              // Samsung\n            ], [VENDOR, [TYPE, SMARTTV]], [\n            /hbbtv.+maple;(\\d+)/i\n            ], [[MODEL, /^/, 'SmartTV'], [VENDOR, SAMSUNG], [TYPE, SMARTTV]], [\n            /(nux; netcast.+smarttv|lg (netcast\\.tv-201\\d|android tv))/i        // LG SmartTV\n            ], [[VENDOR, LG], [TYPE, SMARTTV]], [\n            /(apple) ?tv/i                                                      // Apple TV\n            ], [VENDOR, [MODEL, APPLE+' TV'], [TYPE, SMARTTV]], [\n            /crkey/i                                                            // Google Chromecast\n            ], [[MODEL, CHROME+'cast'], [VENDOR, GOOGLE], [TYPE, SMARTTV]], [\n            /droid.+aft(\\w)( bui|\\))/i                                          // Fire TV\n            ], [MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]], [\n            /\\(dtv[\\);].+(aquos)/i,\n            /(aquos-tv[\\w ]+)\\)/i                                               // Sharp\n            ], [MODEL, [VENDOR, SHARP], [TYPE, SMARTTV]],[\n            /(bravia[\\w ]+)( bui|\\))/i                                              // Sony\n            ], [MODEL, [VENDOR, SONY], [TYPE, SMARTTV]], [\n            /(mitv-\\w{5}) bui/i                                                 // Xiaomi\n            ], [MODEL, [VENDOR, XIAOMI], [TYPE, SMARTTV]], [\n            /\\b(roku)[\\dx]*[\\)\\/]((?:dvp-)?[\\d\\.]*)/i,                          // Roku\n            /hbbtv\\/\\d+\\.\\d+\\.\\d+ +\\([\\w ]*; *(\\w[^;]*);([^;]*)/i               // HbbTV devices\n            ], [[VENDOR, trim], [MODEL, trim], [TYPE, SMARTTV]], [\n            /\\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\\b/i                   // SmartTV from Unidentified Vendors\n            ], [[TYPE, SMARTTV]], [\n\n            ///////////////////\n            // WEARABLES\n            ///////////////////\n\n            /((pebble))app/i                                                    // Pebble\n            ], [VENDOR, MODEL, [TYPE, WEARABLE]], [\n            /droid.+; (glass) \\d/i                                              // Google Glass\n            ], [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]], [\n            /droid.+; (wt63?0{2,3})\\)/i\n            ], [MODEL, [VENDOR, ZEBRA], [TYPE, WEARABLE]], [\n            /(quest( 2)?)/i                                                     // Oculus Quest\n            ], [MODEL, [VENDOR, FACEBOOK], [TYPE, WEARABLE]], [\n\n            ///////////////////\n            // EMBEDDED\n            ///////////////////\n\n            /(tesla)(?: qtcarbrowser|\\/[-\\w\\.]+)/i                              // Tesla\n            ], [VENDOR, [TYPE, EMBEDDED]], [\n\n            ////////////////////\n            // MIXED (GENERIC)\n            ///////////////////\n\n            /droid .+?; ([^;]+?)(?: bui|\\) applew).+? mobile safari/i           // Android Phones from Unidentified Vendors\n            ], [MODEL, [TYPE, MOBILE]], [\n            /droid .+?; ([^;]+?)(?: bui|\\) applew).+?(?! mobile) safari/i       // Android Tablets from Unidentified Vendors\n            ], [MODEL, [TYPE, TABLET]], [\n            /\\b((tablet|tab)[;\\/]|focus\\/\\d(?!.+mobile))/i                      // Unidentifiable Tablet\n            ], [[TYPE, TABLET]], [\n            /(phone|mobile(?:[;\\/]| [ \\w\\/\\.]*safari)|pda(?=.+windows ce))/i    // Unidentifiable Mobile\n            ], [[TYPE, MOBILE]], [\n            /(android[-\\w\\. ]{0,9});.+buil/i                                    // Generic Android Device\n            ], [MODEL, [VENDOR, 'Generic']]\n        ],\n\n        engine : [[\n\n            /windows.+ edge\\/([\\w\\.]+)/i                                       // EdgeHTML\n            ], [VERSION, [NAME, EDGE+'HTML']], [\n\n            /webkit\\/537\\.36.+chrome\\/(?!27)([\\w\\.]+)/i                         // Blink\n            ], [VERSION, [NAME, 'Blink']], [\n\n            /(presto)\\/([\\w\\.]+)/i,                                             // Presto\n            /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\\/([\\w\\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna\n            /ekioh(flow)\\/([\\w\\.]+)/i,                                          // Flow\n            /(khtml|tasman|links)[\\/ ]\\(?([\\w\\.]+)/i,                           // KHTML/Tasman/Links\n            /(icab)[\\/ ]([23]\\.[\\d\\.]+)/i                                       // iCab\n            ], [NAME, VERSION], [\n\n            /rv\\:([\\w\\.]{1,9})\\b.+(gecko)/i                                     // Gecko\n            ], [VERSION, NAME]\n        ],\n\n        os : [[\n\n            // Windows\n            /microsoft (windows) (vista|xp)/i                                   // Windows (iTunes)\n            ], [NAME, VERSION], [\n            /(windows) nt 6\\.2; (arm)/i,                                        // Windows RT\n            /(windows (?:phone(?: os)?|mobile))[\\/ ]?([\\d\\.\\w ]*)/i,            // Windows Phone\n            /(windows)[\\/ ]?([ntce\\d\\. ]+\\w)(?!.+xbox)/i\n            ], [NAME, [VERSION, strMapper, windowsVersionMap]], [\n            /(win(?=3|9|n)|win 9x )([nt\\d\\.]+)/i\n            ], [[NAME, 'Windows'], [VERSION, strMapper, windowsVersionMap]], [\n\n            // iOS/macOS\n            /ip[honead]{2,4}\\b(?:.*os ([\\w]+) like mac|; opera)/i,              // iOS\n            /cfnetwork\\/.+darwin/i\n            ], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [\n            /(mac os x) ?([\\w\\. ]*)/i,\n            /(macintosh|mac_powerpc\\b)(?!.+haiku)/i                             // Mac OS\n            ], [[NAME, 'Mac OS'], [VERSION, /_/g, '.']], [\n\n            // Mobile OSes\n            /droid ([\\w\\.]+)\\b.+(android[- ]x86|harmonyos)/i                    // Android-x86/HarmonyOS\n            ], [VERSION, NAME], [                                               // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS\n            /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\\/ ]?([\\w\\.]*)/i,\n            /(blackberry)\\w*\\/([\\w\\.]*)/i,                                      // Blackberry\n            /(tizen|kaios)[\\/ ]([\\w\\.]+)/i,                                     // Tizen/KaiOS\n            /\\((series40);/i                                                    // Series 40\n            ], [NAME, VERSION], [\n            /\\(bb(10);/i                                                        // BlackBerry 10\n            ], [VERSION, [NAME, BLACKBERRY]], [\n            /(?:symbian ?os|symbos|s60(?=;)|series60)[-\\/ ]?([\\w\\.]*)/i         // Symbian\n            ], [VERSION, [NAME, 'Symbian']], [\n            /mozilla\\/[\\d\\.]+ \\((?:mobile|tablet|tv|mobile; [\\w ]+); rv:.+ gecko\\/([\\w\\.]+)/i // Firefox OS\n            ], [VERSION, [NAME, FIREFOX+' OS']], [\n            /web0s;.+rt(tv)/i,\n            /\\b(?:hp)?wos(?:browser)?\\/([\\w\\.]+)/i                              // WebOS\n            ], [VERSION, [NAME, 'webOS']], [\n\n            // Google Chromecast\n            /crkey\\/([\\d\\.]+)/i                                                 // Google Chromecast\n            ], [VERSION, [NAME, CHROME+'cast']], [\n            /(cros) [\\w]+ ([\\w\\.]+\\w)/i                                         // Chromium OS\n            ], [[NAME, 'Chromium OS'], VERSION],[\n\n            // Console\n            /(nintendo|playstation) ([wids345portablevuch]+)/i,                 // Nintendo/Playstation\n            /(xbox); +xbox ([^\\);]+)/i,                                         // Microsoft Xbox (360, One, X, S, Series X, Series S)\n\n            // Other\n            /\\b(joli|palm)\\b ?(?:os)?\\/?([\\w\\.]*)/i,                            // Joli/Palm\n            /(mint)[\\/\\(\\) ]?(\\w*)/i,                                           // Mint\n            /(mageia|vectorlinux)[; ]/i,                                        // Mageia/VectorLinux\n            /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\\/ ]?(?!chrom|package)([-\\w\\.]*)/i,\n                                                                                // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire\n            /(hurd|linux) ?([\\w\\.]*)/i,                                         // Hurd/Linux\n            /(gnu) ?([\\w\\.]*)/i,                                                // GNU\n            /\\b([-frentopcghs]{0,5}bsd|dragonfly)[\\/ ]?(?!amd|[ix346]{1,2}86)([\\w\\.]*)/i, // FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly\n            /(haiku) (\\w+)/i                                                    // Haiku\n            ], [NAME, VERSION], [\n            /(sunos) ?([\\w\\.\\d]*)/i                                             // Solaris\n            ], [[NAME, 'Solaris'], VERSION], [\n            /((?:open)?solaris)[-\\/ ]?([\\w\\.]*)/i,                              // Solaris\n            /(aix) ((\\d)(?=\\.|\\)| )[\\w\\.])*/i,                                  // AIX\n            /\\b(beos|os\\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,            // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX\n            /(unix) ?([\\w\\.]*)/i                                                // UNIX\n            ], [NAME, VERSION]\n        ]\n    };\n\n    /////////////////\n    // Constructor\n    ////////////////\n\n    var UAParser = function (ua, extensions) {\n\n        if (typeof ua === OBJ_TYPE) {\n            extensions = ua;\n            ua = undefined;\n        }\n\n        if (!(this instanceof UAParser)) {\n            return new UAParser(ua, extensions).getResult();\n        }\n\n        var _ua = ua || ((typeof window !== UNDEF_TYPE && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY);\n        var _rgxmap = extensions ? extend(regexes, extensions) : regexes;\n\n        this.getBrowser = function () {\n            var _browser = {};\n            _browser[NAME] = undefined;\n            _browser[VERSION] = undefined;\n            rgxMapper.call(_browser, _ua, _rgxmap.browser);\n            _browser.major = majorize(_browser.version);\n            return _browser;\n        };\n        this.getCPU = function () {\n            var _cpu = {};\n            _cpu[ARCHITECTURE] = undefined;\n            rgxMapper.call(_cpu, _ua, _rgxmap.cpu);\n            return _cpu;\n        };\n        this.getDevice = function () {\n            var _device = {};\n            _device[VENDOR] = undefined;\n            _device[MODEL] = undefined;\n            _device[TYPE] = undefined;\n            rgxMapper.call(_device, _ua, _rgxmap.device);\n            return _device;\n        };\n        this.getEngine = function () {\n            var _engine = {};\n            _engine[NAME] = undefined;\n            _engine[VERSION] = undefined;\n            rgxMapper.call(_engine, _ua, _rgxmap.engine);\n            return _engine;\n        };\n        this.getOS = function () {\n            var _os = {};\n            _os[NAME] = undefined;\n            _os[VERSION] = undefined;\n            rgxMapper.call(_os, _ua, _rgxmap.os);\n            return _os;\n        };\n        this.getResult = function () {\n            return {\n                ua      : this.getUA(),\n                browser : this.getBrowser(),\n                engine  : this.getEngine(),\n                os      : this.getOS(),\n                device  : this.getDevice(),\n                cpu     : this.getCPU()\n            };\n        };\n        this.getUA = function () {\n            return _ua;\n        };\n        this.setUA = function (ua) {\n            _ua = (typeof ua === STR_TYPE && ua.length > UA_MAX_LENGTH) ? trim(ua, UA_MAX_LENGTH) : ua;\n            return this;\n        };\n        this.setUA(_ua);\n        return this;\n    };\n\n    UAParser.VERSION = LIBVERSION;\n    UAParser.BROWSER =  enumerize([NAME, VERSION, MAJOR]);\n    UAParser.CPU = enumerize([ARCHITECTURE]);\n    UAParser.DEVICE = enumerize([MODEL, VENDOR, TYPE, CONSOLE, MOBILE, SMARTTV, TABLET, WEARABLE, EMBEDDED]);\n    UAParser.ENGINE = UAParser.OS = enumerize([NAME, VERSION]);\n\n    ///////////\n    // Export\n    //////////\n\n    // check js environment\n    if (typeof(exports) !== UNDEF_TYPE) {\n        // nodejs env\n        if (typeof module !== UNDEF_TYPE && module.exports) {\n            exports = module.exports = UAParser;\n        }\n        exports.UAParser = UAParser;\n    } else {\n        // requirejs env (optional)\n        if (typeof(define) === FUNC_TYPE && define.amd) {\n            define(function () {\n                return UAParser;\n            });\n        } else if (typeof window !== UNDEF_TYPE) {\n            // browser env\n            window.UAParser = UAParser;\n        }\n    }\n\n    // jQuery/Zepto specific (optional)\n    // Note:\n    //   In AMD env the global scope should be kept clean, but jQuery is an exception.\n    //   jQuery always exports to global scope, unless jQuery.noConflict(true) is used,\n    //   and we should catch that.\n    var $ = typeof window !== UNDEF_TYPE && (window.jQuery || window.Zepto);\n    if ($ && !$.ua) {\n        var parser = new UAParser();\n        $.ua = parser.getResult();\n        $.ua.get = function () {\n            return parser.getUA();\n        };\n        $.ua.set = function (ua) {\n            parser.setUA(ua);\n            var result = parser.getResult();\n            for (var prop in result) {\n                $.ua[prop] = result[prop];\n            }\n        };\n    }\n\n})(typeof window === 'object' ? window : this);\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nvar __assign = function() {\r\n    __assign = Object.assign || function __assign(t) {\r\n        for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n            s = arguments[i];\r\n            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n        }\r\n        return t;\r\n    };\r\n    return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __rest(s, e) {\r\n    var t = {};\r\n    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n        t[p] = s[p];\r\n    if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n                t[p[i]] = s[p[i]];\r\n        }\r\n    return t;\r\n}\r\n\r\nfunction __values(o) {\r\n    var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n    if (m) return m.call(o);\r\n    if (o && typeof o.length === \"number\") return {\r\n        next: function () {\r\n            if (o && i >= o.length) o = void 0;\r\n            return { value: o && o[i++], done: !o };\r\n        }\r\n    };\r\n    throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nfunction __read(o, n) {\r\n    var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n    if (!m) return o;\r\n    var i = m.call(o), r, ar = [], e;\r\n    try {\r\n        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n    }\r\n    catch (error) { e = { error: error }; }\r\n    finally {\r\n        try {\r\n            if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n        }\r\n        finally { if (e) throw e.error; }\r\n    }\r\n    return ar;\r\n}\r\n\r\nfunction __spreadArray(to, from, pack) {\r\n    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n        if (ar || !(i in from)) {\r\n            if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n            ar[i] = from[i];\r\n        }\r\n    }\r\n    return to.concat(ar || Array.prototype.slice.call(from));\r\n}\n\nexport { __assign, __read, __rest, __spreadArray, __values };\n","var ActionTypes;\n\n(function (ActionTypes) {\n  ActionTypes[\"Start\"] = \"xstate.start\";\n  ActionTypes[\"Stop\"] = \"xstate.stop\";\n  ActionTypes[\"Raise\"] = \"xstate.raise\";\n  ActionTypes[\"Send\"] = \"xstate.send\";\n  ActionTypes[\"Cancel\"] = \"xstate.cancel\";\n  ActionTypes[\"NullEvent\"] = \"\";\n  ActionTypes[\"Assign\"] = \"xstate.assign\";\n  ActionTypes[\"After\"] = \"xstate.after\";\n  ActionTypes[\"DoneState\"] = \"done.state\";\n  ActionTypes[\"DoneInvoke\"] = \"done.invoke\";\n  ActionTypes[\"Log\"] = \"xstate.log\";\n  ActionTypes[\"Init\"] = \"xstate.init\";\n  ActionTypes[\"Invoke\"] = \"xstate.invoke\";\n  ActionTypes[\"ErrorExecution\"] = \"error.execution\";\n  ActionTypes[\"ErrorCommunication\"] = \"error.communication\";\n  ActionTypes[\"ErrorPlatform\"] = \"error.platform\";\n  ActionTypes[\"ErrorCustom\"] = \"xstate.error\";\n  ActionTypes[\"Update\"] = \"xstate.update\";\n  ActionTypes[\"Pure\"] = \"xstate.pure\";\n  ActionTypes[\"Choose\"] = \"xstate.choose\";\n})(ActionTypes || (ActionTypes = {}));\n\nvar SpecialTargets;\n\n(function (SpecialTargets) {\n  SpecialTargets[\"Parent\"] = \"#_parent\";\n  SpecialTargets[\"Internal\"] = \"#_internal\";\n})(SpecialTargets || (SpecialTargets = {}));\n\nexport { ActionTypes, SpecialTargets };\n","import { ActionTypes } from './types.js';\n\nvar start = ActionTypes.Start;\nvar stop = ActionTypes.Stop;\nvar raise = ActionTypes.Raise;\nvar send = ActionTypes.Send;\nvar cancel = ActionTypes.Cancel;\nvar nullEvent = ActionTypes.NullEvent;\nvar assign = ActionTypes.Assign;\nvar after = ActionTypes.After;\nvar doneState = ActionTypes.DoneState;\nvar log = ActionTypes.Log;\nvar init = ActionTypes.Init;\nvar invoke = ActionTypes.Invoke;\nvar errorExecution = ActionTypes.ErrorExecution;\nvar errorPlatform = ActionTypes.ErrorPlatform;\nvar error = ActionTypes.ErrorCustom;\nvar update = ActionTypes.Update;\nvar choose = ActionTypes.Choose;\nvar pure = ActionTypes.Pure;\n\nexport { after, assign, cancel, choose, doneState, error, errorExecution, errorPlatform, init, invoke, log, nullEvent, pure, raise, send, start, stop, update };\n","import { __values, __spreadArray, __read, __assign } from './_virtual/_tslib.js';\nimport { DEFAULT_GUARD_TYPE, TARGETLESS_KEY, STATE_DELIMITER } from './constants.js';\nimport { IS_PRODUCTION } from './environment.js';\n\nvar _a;\nfunction keys(value) {\n  return Object.keys(value);\n}\nfunction matchesState(parentStateId, childStateId, delimiter) {\n  if (delimiter === void 0) {\n    delimiter = STATE_DELIMITER;\n  }\n\n  var parentStateValue = toStateValue(parentStateId, delimiter);\n  var childStateValue = toStateValue(childStateId, delimiter);\n\n  if (isString(childStateValue)) {\n    if (isString(parentStateValue)) {\n      return childStateValue === parentStateValue;\n    } // Parent more specific than child\n\n\n    return false;\n  }\n\n  if (isString(parentStateValue)) {\n    return parentStateValue in childStateValue;\n  }\n\n  return Object.keys(parentStateValue).every(function (key) {\n    if (!(key in childStateValue)) {\n      return false;\n    }\n\n    return matchesState(parentStateValue[key], childStateValue[key]);\n  });\n}\nfunction getEventType(event) {\n  try {\n    return isString(event) || typeof event === 'number' ? \"\".concat(event) : event.type;\n  } catch (e) {\n    throw new Error('Events must be strings or objects with a string event.type property.');\n  }\n}\nfunction getActionType(action) {\n  try {\n    return isString(action) || typeof action === 'number' ? \"\".concat(action) : isFunction(action) ? action.name : action.type;\n  } catch (e) {\n    throw new Error('Actions must be strings or objects with a string action.type property.');\n  }\n}\nfunction toStatePath(stateId, delimiter) {\n  try {\n    if (isArray(stateId)) {\n      return stateId;\n    }\n\n    return stateId.toString().split(delimiter);\n  } catch (e) {\n    throw new Error(\"'\".concat(stateId, \"' is not a valid state path.\"));\n  }\n}\nfunction isStateLike(state) {\n  return typeof state === 'object' && 'value' in state && 'context' in state && 'event' in state && '_event' in state;\n}\nfunction toStateValue(stateValue, delimiter) {\n  if (isStateLike(stateValue)) {\n    return stateValue.value;\n  }\n\n  if (isArray(stateValue)) {\n    return pathToStateValue(stateValue);\n  }\n\n  if (typeof stateValue !== 'string') {\n    return stateValue;\n  }\n\n  var statePath = toStatePath(stateValue, delimiter);\n  return pathToStateValue(statePath);\n}\nfunction pathToStateValue(statePath) {\n  if (statePath.length === 1) {\n    return statePath[0];\n  }\n\n  var value = {};\n  var marker = value;\n\n  for (var i = 0; i < statePath.length - 1; i++) {\n    if (i === statePath.length - 2) {\n      marker[statePath[i]] = statePath[i + 1];\n    } else {\n      marker[statePath[i]] = {};\n      marker = marker[statePath[i]];\n    }\n  }\n\n  return value;\n}\nfunction mapValues(collection, iteratee) {\n  var result = {};\n  var collectionKeys = Object.keys(collection);\n\n  for (var i = 0; i < collectionKeys.length; i++) {\n    var key = collectionKeys[i];\n    result[key] = iteratee(collection[key], key, collection, i);\n  }\n\n  return result;\n}\nfunction mapFilterValues(collection, iteratee, predicate) {\n  var e_1, _a;\n\n  var result = {};\n\n  try {\n    for (var _b = __values(Object.keys(collection)), _c = _b.next(); !_c.done; _c = _b.next()) {\n      var key = _c.value;\n      var item = collection[key];\n\n      if (!predicate(item)) {\n        continue;\n      }\n\n      result[key] = iteratee(item, key, collection);\n    }\n  } catch (e_1_1) {\n    e_1 = {\n      error: e_1_1\n    };\n  } finally {\n    try {\n      if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n    } finally {\n      if (e_1) throw e_1.error;\n    }\n  }\n\n  return result;\n}\n/**\r\n * Retrieves a value at the given path.\r\n * @param props The deep path to the prop of the desired value\r\n */\n\nvar path = function (props) {\n  return function (object) {\n    var e_2, _a;\n\n    var result = object;\n\n    try {\n      for (var props_1 = __values(props), props_1_1 = props_1.next(); !props_1_1.done; props_1_1 = props_1.next()) {\n        var prop = props_1_1.value;\n        result = result[prop];\n      }\n    } catch (e_2_1) {\n      e_2 = {\n        error: e_2_1\n      };\n    } finally {\n      try {\n        if (props_1_1 && !props_1_1.done && (_a = props_1.return)) _a.call(props_1);\n      } finally {\n        if (e_2) throw e_2.error;\n      }\n    }\n\n    return result;\n  };\n};\n/**\r\n * Retrieves a value at the given path via the nested accessor prop.\r\n * @param props The deep path to the prop of the desired value\r\n */\n\nfunction nestedPath(props, accessorProp) {\n  return function (object) {\n    var e_3, _a;\n\n    var result = object;\n\n    try {\n      for (var props_2 = __values(props), props_2_1 = props_2.next(); !props_2_1.done; props_2_1 = props_2.next()) {\n        var prop = props_2_1.value;\n        result = result[accessorProp][prop];\n      }\n    } catch (e_3_1) {\n      e_3 = {\n        error: e_3_1\n      };\n    } finally {\n      try {\n        if (props_2_1 && !props_2_1.done && (_a = props_2.return)) _a.call(props_2);\n      } finally {\n        if (e_3) throw e_3.error;\n      }\n    }\n\n    return result;\n  };\n}\nfunction toStatePaths(stateValue) {\n  if (!stateValue) {\n    return [[]];\n  }\n\n  if (isString(stateValue)) {\n    return [[stateValue]];\n  }\n\n  var result = flatten(Object.keys(stateValue).map(function (key) {\n    var subStateValue = stateValue[key];\n\n    if (typeof subStateValue !== 'string' && (!subStateValue || !Object.keys(subStateValue).length)) {\n      return [[key]];\n    }\n\n    return toStatePaths(stateValue[key]).map(function (subPath) {\n      return [key].concat(subPath);\n    });\n  }));\n  return result;\n}\nfunction pathsToStateValue(paths) {\n  var e_4, _a;\n\n  var result = {};\n\n  if (paths && paths.length === 1 && paths[0].length === 1) {\n    return paths[0][0];\n  }\n\n  try {\n    for (var paths_1 = __values(paths), paths_1_1 = paths_1.next(); !paths_1_1.done; paths_1_1 = paths_1.next()) {\n      var currentPath = paths_1_1.value;\n      var marker = result; // tslint:disable-next-line:prefer-for-of\n\n      for (var i = 0; i < currentPath.length; i++) {\n        var subPath = currentPath[i];\n\n        if (i === currentPath.length - 2) {\n          marker[subPath] = currentPath[i + 1];\n          break;\n        }\n\n        marker[subPath] = marker[subPath] || {};\n        marker = marker[subPath];\n      }\n    }\n  } catch (e_4_1) {\n    e_4 = {\n      error: e_4_1\n    };\n  } finally {\n    try {\n      if (paths_1_1 && !paths_1_1.done && (_a = paths_1.return)) _a.call(paths_1);\n    } finally {\n      if (e_4) throw e_4.error;\n    }\n  }\n\n  return result;\n}\nfunction flatten(array) {\n  var _a;\n\n  return (_a = []).concat.apply(_a, __spreadArray([], __read(array), false));\n}\nfunction toArrayStrict(value) {\n  if (isArray(value)) {\n    return value;\n  }\n\n  return [value];\n}\nfunction toArray(value) {\n  if (value === undefined) {\n    return [];\n  }\n\n  return toArrayStrict(value);\n}\nfunction mapContext(mapper, context, _event) {\n  var e_5, _a;\n\n  if (isFunction(mapper)) {\n    return mapper(context, _event.data);\n  }\n\n  var result = {};\n\n  try {\n    for (var _b = __values(Object.keys(mapper)), _c = _b.next(); !_c.done; _c = _b.next()) {\n      var key = _c.value;\n      var subMapper = mapper[key];\n\n      if (isFunction(subMapper)) {\n        result[key] = subMapper(context, _event.data);\n      } else {\n        result[key] = subMapper;\n      }\n    }\n  } catch (e_5_1) {\n    e_5 = {\n      error: e_5_1\n    };\n  } finally {\n    try {\n      if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n    } finally {\n      if (e_5) throw e_5.error;\n    }\n  }\n\n  return result;\n}\nfunction isBuiltInEvent(eventType) {\n  return /^(done|error)\\./.test(eventType);\n}\nfunction isPromiseLike(value) {\n  if (value instanceof Promise) {\n    return true;\n  } // Check if shape matches the Promise/A+ specification for a \"thenable\".\n\n\n  if (value !== null && (isFunction(value) || typeof value === 'object') && isFunction(value.then)) {\n    return true;\n  }\n\n  return false;\n}\nfunction isBehavior(value) {\n  return value !== null && typeof value === 'object' && 'transition' in value && typeof value.transition === 'function';\n}\nfunction partition(items, predicate) {\n  var e_6, _a;\n\n  var _b = __read([[], []], 2),\n      truthy = _b[0],\n      falsy = _b[1];\n\n  try {\n    for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {\n      var item = items_1_1.value;\n\n      if (predicate(item)) {\n        truthy.push(item);\n      } else {\n        falsy.push(item);\n      }\n    }\n  } catch (e_6_1) {\n    e_6 = {\n      error: e_6_1\n    };\n  } finally {\n    try {\n      if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);\n    } finally {\n      if (e_6) throw e_6.error;\n    }\n  }\n\n  return [truthy, falsy];\n}\nfunction updateHistoryStates(hist, stateValue) {\n  return mapValues(hist.states, function (subHist, key) {\n    if (!subHist) {\n      return undefined;\n    }\n\n    var subStateValue = (isString(stateValue) ? undefined : stateValue[key]) || (subHist ? subHist.current : undefined);\n\n    if (!subStateValue) {\n      return undefined;\n    }\n\n    return {\n      current: subStateValue,\n      states: updateHistoryStates(subHist, subStateValue)\n    };\n  });\n}\nfunction updateHistoryValue(hist, stateValue) {\n  return {\n    current: stateValue,\n    states: updateHistoryStates(hist, stateValue)\n  };\n}\nfunction updateContext(context, _event, assignActions, state) {\n  if (!IS_PRODUCTION) {\n    warn(!!context, 'Attempting to update undefined context');\n  }\n\n  var updatedContext = context ? assignActions.reduce(function (acc, assignAction) {\n    var e_7, _a;\n\n    var assignment = assignAction.assignment;\n    var meta = {\n      state: state,\n      action: assignAction,\n      _event: _event\n    };\n    var partialUpdate = {};\n\n    if (isFunction(assignment)) {\n      partialUpdate = assignment(acc, _event.data, meta);\n    } else {\n      try {\n        for (var _b = __values(Object.keys(assignment)), _c = _b.next(); !_c.done; _c = _b.next()) {\n          var key = _c.value;\n          var propAssignment = assignment[key];\n          partialUpdate[key] = isFunction(propAssignment) ? propAssignment(acc, _event.data, meta) : propAssignment;\n        }\n      } catch (e_7_1) {\n        e_7 = {\n          error: e_7_1\n        };\n      } finally {\n        try {\n          if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n        } finally {\n          if (e_7) throw e_7.error;\n        }\n      }\n    }\n\n    return Object.assign({}, acc, partialUpdate);\n  }, context) : context;\n  return updatedContext;\n} // tslint:disable-next-line:no-empty\n\nvar warn = function () {};\n\nif (!IS_PRODUCTION) {\n  warn = function (condition, message) {\n    var error = condition instanceof Error ? condition : undefined;\n\n    if (!error && condition) {\n      return;\n    }\n\n    if (console !== undefined) {\n      var args = [\"Warning: \".concat(message)];\n\n      if (error) {\n        args.push(error);\n      } // tslint:disable-next-line:no-console\n\n\n      console.warn.apply(console, args);\n    }\n  };\n}\nfunction isArray(value) {\n  return Array.isArray(value);\n} // tslint:disable-next-line:ban-types\n\nfunction isFunction(value) {\n  return typeof value === 'function';\n}\nfunction isString(value) {\n  return typeof value === 'string';\n}\nfunction toGuard(condition, guardMap) {\n  if (!condition) {\n    return undefined;\n  }\n\n  if (isString(condition)) {\n    return {\n      type: DEFAULT_GUARD_TYPE,\n      name: condition,\n      predicate: guardMap ? guardMap[condition] : undefined\n    };\n  }\n\n  if (isFunction(condition)) {\n    return {\n      type: DEFAULT_GUARD_TYPE,\n      name: condition.name,\n      predicate: condition\n    };\n  }\n\n  return condition;\n}\nfunction isObservable(value) {\n  try {\n    return 'subscribe' in value && isFunction(value.subscribe);\n  } catch (e) {\n    return false;\n  }\n}\nvar symbolObservable = /*#__PURE__*/function () {\n  return typeof Symbol === 'function' && Symbol.observable || '@@observable';\n}(); // TODO: to be removed in v5, left it out just to minimize the scope of the change and maintain compatibility with older versions of integration paackages\n\nvar interopSymbols = (_a = {}, _a[symbolObservable] = function () {\n  return this;\n}, _a[Symbol.observable] = function () {\n  return this;\n}, _a);\nfunction isMachine(value) {\n  return !!value && '__xstatenode' in value;\n}\nfunction isActor(value) {\n  return !!value && typeof value.send === 'function';\n}\nvar uniqueId = /*#__PURE__*/function () {\n  var currentId = 0;\n  return function () {\n    currentId++;\n    return currentId.toString(16);\n  };\n}();\nfunction toEventObject(event, payload // id?: TEvent['type']\n) {\n  if (isString(event) || typeof event === 'number') {\n    return __assign({\n      type: event\n    }, payload);\n  }\n\n  return event;\n}\nfunction toSCXMLEvent(event, scxmlEvent) {\n  if (!isString(event) && '$$type' in event && event.$$type === 'scxml') {\n    return event;\n  }\n\n  var eventObject = toEventObject(event);\n  return __assign({\n    name: eventObject.type,\n    data: eventObject,\n    $$type: 'scxml',\n    type: 'external'\n  }, scxmlEvent);\n}\nfunction toTransitionConfigArray(event, configLike) {\n  var transitions = toArrayStrict(configLike).map(function (transitionLike) {\n    if (typeof transitionLike === 'undefined' || typeof transitionLike === 'string' || isMachine(transitionLike)) {\n      return {\n        target: transitionLike,\n        event: event\n      };\n    }\n\n    return __assign(__assign({}, transitionLike), {\n      event: event\n    });\n  });\n  return transitions;\n}\nfunction normalizeTarget(target) {\n  if (target === undefined || target === TARGETLESS_KEY) {\n    return undefined;\n  }\n\n  return toArray(target);\n}\nfunction reportUnhandledExceptionOnInvocation(originalError, currentError, id) {\n  if (!IS_PRODUCTION) {\n    var originalStackTrace = originalError.stack ? \" Stacktrace was '\".concat(originalError.stack, \"'\") : '';\n\n    if (originalError === currentError) {\n      // tslint:disable-next-line:no-console\n      console.error(\"Missing onError handler for invocation '\".concat(id, \"', error was '\").concat(originalError, \"'.\").concat(originalStackTrace));\n    } else {\n      var stackTrace = currentError.stack ? \" Stacktrace was '\".concat(currentError.stack, \"'\") : ''; // tslint:disable-next-line:no-console\n\n      console.error(\"Missing onError handler and/or unhandled exception/promise rejection for invocation '\".concat(id, \"'. \") + \"Original error: '\".concat(originalError, \"'. \").concat(originalStackTrace, \" Current error is '\").concat(currentError, \"'.\").concat(stackTrace));\n    }\n  }\n}\nfunction evaluateGuard(machine, guard, context, _event, state) {\n  var guards = machine.options.guards;\n  var guardMeta = {\n    state: state,\n    cond: guard,\n    _event: _event\n  }; // TODO: do not hardcode!\n\n  if (guard.type === DEFAULT_GUARD_TYPE) {\n    return ((guards === null || guards === void 0 ? void 0 : guards[guard.name]) || guard.predicate)(context, _event.data, guardMeta);\n  }\n\n  var condFn = guards === null || guards === void 0 ? void 0 : guards[guard.type];\n\n  if (!condFn) {\n    throw new Error(\"Guard '\".concat(guard.type, \"' is not implemented on machine '\").concat(machine.id, \"'.\"));\n  }\n\n  return condFn(context, _event.data, guardMeta);\n}\nfunction toInvokeSource(src) {\n  if (typeof src === 'string') {\n    return {\n      type: src\n    };\n  }\n\n  return src;\n}\nfunction toObserver(nextHandler, errorHandler, completionHandler) {\n  var noop = function () {};\n\n  var isObserver = typeof nextHandler === 'object';\n  var self = isObserver ? nextHandler : null;\n  return {\n    next: ((isObserver ? nextHandler.next : nextHandler) || noop).bind(self),\n    error: ((isObserver ? nextHandler.error : errorHandler) || noop).bind(self),\n    complete: ((isObserver ? nextHandler.complete : completionHandler) || noop).bind(self)\n  };\n}\nfunction createInvokeId(stateNodeId, index) {\n  return \"\".concat(stateNodeId, \":invocation[\").concat(index, \"]\");\n}\n\nexport { createInvokeId, evaluateGuard, flatten, getActionType, getEventType, interopSymbols, isActor, isArray, isBehavior, isBuiltInEvent, isFunction, isMachine, isObservable, isPromiseLike, isStateLike, isString, keys, mapContext, mapFilterValues, mapValues, matchesState, nestedPath, normalizeTarget, partition, path, pathToStateValue, pathsToStateValue, reportUnhandledExceptionOnInvocation, symbolObservable, toArray, toArrayStrict, toEventObject, toGuard, toInvokeSource, toObserver, toSCXMLEvent, toStatePath, toStatePaths, toStateValue, toTransitionConfigArray, uniqueId, updateContext, updateHistoryStates, updateHistoryValue, warn };\n","var STATE_DELIMITER = '.';\nvar EMPTY_ACTIVITY_MAP = {};\nvar DEFAULT_GUARD_TYPE = 'xstate.guard';\nvar TARGETLESS_KEY = '';\n\nexport { DEFAULT_GUARD_TYPE, EMPTY_ACTIVITY_MAP, STATE_DELIMITER, TARGETLESS_KEY };\n","var IS_PRODUCTION = process.env.NODE_ENV === 'production';\n\nexport { IS_PRODUCTION };\n","import { __assign, __spreadArray, __read, __values } from './_virtual/_tslib.js';\nimport { SpecialTargets, ActionTypes } from './types.js';\nimport { init, send as send$1, raise as raise$1, update, log as log$1, cancel as cancel$1, assign as assign$1, error as error$1, stop as stop$1, pure as pure$1, choose as choose$1 } from './actionTypes.js';\nimport * as actionTypes from './actionTypes.js';\nexport { actionTypes };\nimport { toSCXMLEvent, isString, isFunction, toEventObject, getEventType, updateContext, flatten, isArray, toArray, toGuard, evaluateGuard, warn } from './utils.js';\nimport { IS_PRODUCTION } from './environment.js';\n\nvar initEvent = /*#__PURE__*/toSCXMLEvent({\n  type: init\n});\nfunction getActionFunction(actionType, actionFunctionMap) {\n  return actionFunctionMap ? actionFunctionMap[actionType] || undefined : undefined;\n}\nfunction toActionObject(action, actionFunctionMap) {\n  var actionObject;\n\n  if (isString(action) || typeof action === 'number') {\n    var exec = getActionFunction(action, actionFunctionMap);\n\n    if (isFunction(exec)) {\n      actionObject = {\n        type: action,\n        exec: exec\n      };\n    } else if (exec) {\n      actionObject = exec;\n    } else {\n      actionObject = {\n        type: action,\n        exec: undefined\n      };\n    }\n  } else if (isFunction(action)) {\n    actionObject = {\n      // Convert action to string if unnamed\n      type: action.name || action.toString(),\n      exec: action\n    };\n  } else {\n    var exec = getActionFunction(action.type, actionFunctionMap);\n\n    if (isFunction(exec)) {\n      actionObject = __assign(__assign({}, action), {\n        exec: exec\n      });\n    } else if (exec) {\n      var actionType = exec.type || action.type;\n      actionObject = __assign(__assign(__assign({}, exec), action), {\n        type: actionType\n      });\n    } else {\n      actionObject = action;\n    }\n  }\n\n  return actionObject;\n}\nvar toActionObjects = function (action, actionFunctionMap) {\n  if (!action) {\n    return [];\n  }\n\n  var actions = isArray(action) ? action : [action];\n  return actions.map(function (subAction) {\n    return toActionObject(subAction, actionFunctionMap);\n  });\n};\nfunction toActivityDefinition(action) {\n  var actionObject = toActionObject(action);\n  return __assign(__assign({\n    id: isString(action) ? action : actionObject.id\n  }, actionObject), {\n    type: actionObject.type\n  });\n}\n/**\r\n * Raises an event. This places the event in the internal event queue, so that\r\n * the event is immediately consumed by the machine in the current step.\r\n *\r\n * @param eventType The event to raise.\r\n */\n\nfunction raise(event) {\n  if (!isString(event)) {\n    return send(event, {\n      to: SpecialTargets.Internal\n    });\n  }\n\n  return {\n    type: raise$1,\n    event: event\n  };\n}\nfunction resolveRaise(action) {\n  return {\n    type: raise$1,\n    _event: toSCXMLEvent(action.event)\n  };\n}\n/**\r\n * Sends an event. This returns an action that will be read by an interpreter to\r\n * send the event in the next step, after the current step is finished executing.\r\n *\r\n * @param event The event to send.\r\n * @param options Options to pass into the send event:\r\n *  - `id` - The unique send event identifier (used with `cancel()`).\r\n *  - `delay` - The number of milliseconds to delay the sending of the event.\r\n *  - `to` - The target of this event (by default, the machine the event was sent from).\r\n */\n\nfunction send(event, options) {\n  return {\n    to: options ? options.to : undefined,\n    type: send$1,\n    event: isFunction(event) ? event : toEventObject(event),\n    delay: options ? options.delay : undefined,\n    id: options && options.id !== undefined ? options.id : isFunction(event) ? event.name : getEventType(event)\n  };\n}\nfunction resolveSend(action, ctx, _event, delaysMap) {\n  var meta = {\n    _event: _event\n  }; // TODO: helper function for resolving Expr\n\n  var resolvedEvent = toSCXMLEvent(isFunction(action.event) ? action.event(ctx, _event.data, meta) : action.event);\n  var resolvedDelay;\n\n  if (isString(action.delay)) {\n    var configDelay = delaysMap && delaysMap[action.delay];\n    resolvedDelay = isFunction(configDelay) ? configDelay(ctx, _event.data, meta) : configDelay;\n  } else {\n    resolvedDelay = isFunction(action.delay) ? action.delay(ctx, _event.data, meta) : action.delay;\n  }\n\n  var resolvedTarget = isFunction(action.to) ? action.to(ctx, _event.data, meta) : action.to;\n  return __assign(__assign({}, action), {\n    to: resolvedTarget,\n    _event: resolvedEvent,\n    event: resolvedEvent.data,\n    delay: resolvedDelay\n  });\n}\n/**\r\n * Sends an event to this machine's parent.\r\n *\r\n * @param event The event to send to the parent machine.\r\n * @param options Options to pass into the send event.\r\n */\n\nfunction sendParent(event, options) {\n  return send(event, __assign(__assign({}, options), {\n    to: SpecialTargets.Parent\n  }));\n}\n/**\r\n * Sends an event to an actor.\r\n *\r\n * @param actor The `ActorRef` to send the event to.\r\n * @param event The event to send, or an expression that evaluates to the event to send\r\n * @param options Send action options\r\n * @returns An XState send action object\r\n */\n\nfunction sendTo(actor, event, options) {\n  return send(event, __assign(__assign({}, options), {\n    to: actor\n  }));\n}\n/**\r\n * Sends an update event to this machine's parent.\r\n */\n\nfunction sendUpdate() {\n  return sendParent(update);\n}\n/**\r\n * Sends an event back to the sender of the original event.\r\n *\r\n * @param event The event to send back to the sender\r\n * @param options Options to pass into the send event\r\n */\n\nfunction respond(event, options) {\n  return send(event, __assign(__assign({}, options), {\n    to: function (_, __, _a) {\n      var _event = _a._event;\n      return _event.origin; // TODO: handle when _event.origin is undefined\n    }\n  }));\n}\n\nvar defaultLogExpr = function (context, event) {\n  return {\n    context: context,\n    event: event\n  };\n};\n/**\r\n *\r\n * @param expr The expression function to evaluate which will be logged.\r\n *  Takes in 2 arguments:\r\n *  - `ctx` - the current state context\r\n *  - `event` - the event that caused this action to be executed.\r\n * @param label The label to give to the logged expression.\r\n */\n\n\nfunction log(expr, label) {\n  if (expr === void 0) {\n    expr = defaultLogExpr;\n  }\n\n  return {\n    type: log$1,\n    label: label,\n    expr: expr\n  };\n}\nvar resolveLog = function (action, ctx, _event) {\n  return __assign(__assign({}, action), {\n    value: isString(action.expr) ? action.expr : action.expr(ctx, _event.data, {\n      _event: _event\n    })\n  });\n};\n/**\r\n * Cancels an in-flight `send(...)` action. A canceled sent action will not\r\n * be executed, nor will its event be sent, unless it has already been sent\r\n * (e.g., if `cancel(...)` is called after the `send(...)` action's `delay`).\r\n *\r\n * @param sendId The `id` of the `send(...)` action to cancel.\r\n */\n\nvar cancel = function (sendId) {\n  return {\n    type: cancel$1,\n    sendId: sendId\n  };\n};\n/**\r\n * Starts an activity.\r\n *\r\n * @param activity The activity to start.\r\n */\n\nfunction start(activity) {\n  var activityDef = toActivityDefinition(activity);\n  return {\n    type: ActionTypes.Start,\n    activity: activityDef,\n    exec: undefined\n  };\n}\n/**\r\n * Stops an activity.\r\n *\r\n * @param actorRef The activity to stop.\r\n */\n\nfunction stop(actorRef) {\n  var activity = isFunction(actorRef) ? actorRef : toActivityDefinition(actorRef);\n  return {\n    type: ActionTypes.Stop,\n    activity: activity,\n    exec: undefined\n  };\n}\nfunction resolveStop(action, context, _event) {\n  var actorRefOrString = isFunction(action.activity) ? action.activity(context, _event.data) : action.activity;\n  var resolvedActorRef = typeof actorRefOrString === 'string' ? {\n    id: actorRefOrString\n  } : actorRefOrString;\n  var actionObject = {\n    type: ActionTypes.Stop,\n    activity: resolvedActorRef\n  };\n  return actionObject;\n}\n/**\r\n * Updates the current context of the machine.\r\n *\r\n * @param assignment An object that represents the partial context to update.\r\n */\n\nvar assign = function (assignment) {\n  return {\n    type: assign$1,\n    assignment: assignment\n  };\n};\nfunction isActionObject(action) {\n  return typeof action === 'object' && 'type' in action;\n}\n/**\r\n * Returns an event type that represents an implicit event that\r\n * is sent after the specified `delay`.\r\n *\r\n * @param delayRef The delay in milliseconds\r\n * @param id The state node ID where this event is handled\r\n */\n\nfunction after(delayRef, id) {\n  var idSuffix = id ? \"#\".concat(id) : '';\n  return \"\".concat(ActionTypes.After, \"(\").concat(delayRef, \")\").concat(idSuffix);\n}\n/**\r\n * Returns an event that represents that a final state node\r\n * has been reached in the parent state node.\r\n *\r\n * @param id The final state node's parent state node `id`\r\n * @param data The data to pass into the event\r\n */\n\nfunction done(id, data) {\n  var type = \"\".concat(ActionTypes.DoneState, \".\").concat(id);\n  var eventObject = {\n    type: type,\n    data: data\n  };\n\n  eventObject.toString = function () {\n    return type;\n  };\n\n  return eventObject;\n}\n/**\r\n * Returns an event that represents that an invoked service has terminated.\r\n *\r\n * An invoked service is terminated when it has reached a top-level final state node,\r\n * but not when it is canceled.\r\n *\r\n * @param id The final state node ID\r\n * @param data The data to pass into the event\r\n */\n\nfunction doneInvoke(id, data) {\n  var type = \"\".concat(ActionTypes.DoneInvoke, \".\").concat(id);\n  var eventObject = {\n    type: type,\n    data: data\n  };\n\n  eventObject.toString = function () {\n    return type;\n  };\n\n  return eventObject;\n}\nfunction error(id, data) {\n  var type = \"\".concat(ActionTypes.ErrorPlatform, \".\").concat(id);\n  var eventObject = {\n    type: type,\n    data: data\n  };\n\n  eventObject.toString = function () {\n    return type;\n  };\n\n  return eventObject;\n}\nfunction pure(getActions) {\n  return {\n    type: ActionTypes.Pure,\n    get: getActions\n  };\n}\n/**\r\n * Forwards (sends) an event to a specified service.\r\n *\r\n * @param target The target service to forward the event to.\r\n * @param options Options to pass into the send action creator.\r\n */\n\nfunction forwardTo(target, options) {\n  if (!IS_PRODUCTION && (!target || typeof target === 'function')) {\n    var originalTarget_1 = target;\n\n    target = function () {\n      var args = [];\n\n      for (var _i = 0; _i < arguments.length; _i++) {\n        args[_i] = arguments[_i];\n      }\n\n      var resolvedTarget = typeof originalTarget_1 === 'function' ? originalTarget_1.apply(void 0, __spreadArray([], __read(args), false)) : originalTarget_1;\n\n      if (!resolvedTarget) {\n        throw new Error(\"Attempted to forward event to undefined actor. This risks an infinite loop in the sender.\");\n      }\n\n      return resolvedTarget;\n    };\n  }\n\n  return send(function (_, event) {\n    return event;\n  }, __assign(__assign({}, options), {\n    to: target\n  }));\n}\n/**\r\n * Escalates an error by sending it as an event to this machine's parent.\r\n *\r\n * @param errorData The error data to send, or the expression function that\r\n * takes in the `context`, `event`, and `meta`, and returns the error data to send.\r\n * @param options Options to pass into the send action creator.\r\n */\n\nfunction escalate(errorData, options) {\n  return sendParent(function (context, event, meta) {\n    return {\n      type: error$1,\n      data: isFunction(errorData) ? errorData(context, event, meta) : errorData\n    };\n  }, __assign(__assign({}, options), {\n    to: SpecialTargets.Parent\n  }));\n}\nfunction choose(conds) {\n  return {\n    type: ActionTypes.Choose,\n    conds: conds\n  };\n}\n\nvar pluckAssigns = function (actionBlocks) {\n  var e_1, _a;\n\n  var assignActions = [];\n\n  try {\n    for (var actionBlocks_1 = __values(actionBlocks), actionBlocks_1_1 = actionBlocks_1.next(); !actionBlocks_1_1.done; actionBlocks_1_1 = actionBlocks_1.next()) {\n      var block = actionBlocks_1_1.value;\n      var i = 0;\n\n      while (i < block.length) {\n        if (block[i].type === assign$1) {\n          assignActions.push(block[i]);\n          block.splice(i, 1);\n          continue;\n        }\n\n        i++;\n      }\n    }\n  } catch (e_1_1) {\n    e_1 = {\n      error: e_1_1\n    };\n  } finally {\n    try {\n      if (actionBlocks_1_1 && !actionBlocks_1_1.done && (_a = actionBlocks_1.return)) _a.call(actionBlocks_1);\n    } finally {\n      if (e_1) throw e_1.error;\n    }\n  }\n\n  return assignActions;\n};\n\nfunction resolveActions(machine, currentState, currentContext, _event, actionBlocks, predictableExec, preserveActionOrder) {\n  if (preserveActionOrder === void 0) {\n    preserveActionOrder = false;\n  }\n\n  var assignActions = preserveActionOrder ? [] : pluckAssigns(actionBlocks);\n  var updatedContext = assignActions.length ? updateContext(currentContext, _event, assignActions, currentState) : currentContext;\n  var preservedContexts = preserveActionOrder ? [currentContext] : undefined;\n  var deferredToBlockEnd = [];\n\n  function handleAction(actionObject) {\n    var _a;\n\n    switch (actionObject.type) {\n      case raise$1:\n        {\n          return resolveRaise(actionObject);\n        }\n\n      case send$1:\n        var sendAction = resolveSend(actionObject, updatedContext, _event, machine.options.delays); // TODO: fix ActionTypes.Init\n\n        if (!IS_PRODUCTION) {\n          // warn after resolving as we can create better contextual message here\n          warn(!isString(actionObject.delay) || typeof sendAction.delay === 'number', // tslint:disable-next-line:max-line-length\n          \"No delay reference for delay expression '\".concat(actionObject.delay, \"' was found on machine '\").concat(machine.id, \"'\"));\n        }\n\n        if (predictableExec && sendAction.to !== SpecialTargets.Internal) {\n          deferredToBlockEnd.push(sendAction);\n        }\n\n        return sendAction;\n\n      case log$1:\n        {\n          var resolved = resolveLog(actionObject, updatedContext, _event);\n          predictableExec === null || predictableExec === void 0 ? void 0 : predictableExec(resolved, updatedContext, _event);\n          return resolved;\n        }\n\n      case choose$1:\n        {\n          var chooseAction = actionObject;\n          var matchedActions = (_a = chooseAction.conds.find(function (condition) {\n            var guard = toGuard(condition.cond, machine.options.guards);\n            return !guard || evaluateGuard(machine, guard, updatedContext, _event, !predictableExec ? currentState : undefined);\n          })) === null || _a === void 0 ? void 0 : _a.actions;\n\n          if (!matchedActions) {\n            return [];\n          }\n\n          var _b = __read(resolveActions(machine, currentState, updatedContext, _event, [toActionObjects(toArray(matchedActions), machine.options.actions)], predictableExec, preserveActionOrder), 2),\n              resolvedActionsFromChoose = _b[0],\n              resolvedContextFromChoose = _b[1];\n\n          updatedContext = resolvedContextFromChoose;\n          preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);\n          return resolvedActionsFromChoose;\n        }\n\n      case pure$1:\n        {\n          var matchedActions = actionObject.get(updatedContext, _event.data);\n\n          if (!matchedActions) {\n            return [];\n          }\n\n          var _c = __read(resolveActions(machine, currentState, updatedContext, _event, [toActionObjects(toArray(matchedActions), machine.options.actions)], predictableExec, preserveActionOrder), 2),\n              resolvedActionsFromPure = _c[0],\n              resolvedContext = _c[1];\n\n          updatedContext = resolvedContext;\n          preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);\n          return resolvedActionsFromPure;\n        }\n\n      case stop$1:\n        {\n          var resolved = resolveStop(actionObject, updatedContext, _event);\n          predictableExec === null || predictableExec === void 0 ? void 0 : predictableExec(resolved, currentContext, _event);\n          return resolved;\n        }\n\n      case assign$1:\n        {\n          updatedContext = updateContext(updatedContext, _event, [actionObject], !predictableExec ? currentState : undefined);\n          preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);\n          break;\n        }\n\n      default:\n        var resolvedActionObject = toActionObject(actionObject, machine.options.actions);\n        var exec_1 = resolvedActionObject.exec;\n\n        if (predictableExec) {\n          predictableExec(resolvedActionObject, updatedContext, _event);\n        } else if (exec_1 && preservedContexts) {\n          var contextIndex_1 = preservedContexts.length - 1;\n          resolvedActionObject = __assign(__assign({}, resolvedActionObject), {\n            exec: function (_ctx) {\n              var args = [];\n\n              for (var _i = 1; _i < arguments.length; _i++) {\n                args[_i - 1] = arguments[_i];\n              }\n\n              exec_1.apply(void 0, __spreadArray([preservedContexts[contextIndex_1]], __read(args), false));\n            }\n          });\n        }\n\n        return resolvedActionObject;\n    }\n  }\n\n  function processBlock(block) {\n    var e_2, _a;\n\n    var resolvedActions = [];\n\n    try {\n      for (var block_1 = __values(block), block_1_1 = block_1.next(); !block_1_1.done; block_1_1 = block_1.next()) {\n        var action = block_1_1.value;\n        var resolved = handleAction(action);\n\n        if (resolved) {\n          resolvedActions = resolvedActions.concat(resolved);\n        }\n      }\n    } catch (e_2_1) {\n      e_2 = {\n        error: e_2_1\n      };\n    } finally {\n      try {\n        if (block_1_1 && !block_1_1.done && (_a = block_1.return)) _a.call(block_1);\n      } finally {\n        if (e_2) throw e_2.error;\n      }\n    }\n\n    deferredToBlockEnd.forEach(function (action) {\n      predictableExec(action, updatedContext, _event);\n    });\n    deferredToBlockEnd.length = 0;\n    return resolvedActions;\n  }\n\n  var resolvedActions = flatten(actionBlocks.map(processBlock));\n  return [resolvedActions, updatedContext];\n}\n\nexport { after, assign, cancel, choose, done, doneInvoke, error, escalate, forwardTo, getActionFunction, initEvent, isActionObject, log, pure, raise, resolveActions, resolveLog, resolveRaise, resolveSend, resolveStop, respond, send, sendParent, sendTo, sendUpdate, start, stop, toActionObject, toActionObjects, toActivityDefinition };\n","/**\r\n * Maintains a stack of the current service in scope.\r\n * This is used to provide the correct service to spawn().\r\n */\nvar serviceStack = [];\nvar provide = function (service, fn) {\n  serviceStack.push(service);\n  var result = fn(service);\n  serviceStack.pop();\n  return result;\n};\nvar consume = function (fn) {\n  return fn(serviceStack[serviceStack.length - 1]);\n};\n\nexport { consume, provide };\n","import { __assign } from './_virtual/_tslib.js';\nimport { symbolObservable, toInvokeSource, mapContext, isMachine } from './utils.js';\nimport { provide } from './serviceScope.js';\n\nfunction createNullActor(id) {\n  var _a;\n\n  return _a = {\n    id: id,\n    send: function () {\n      return void 0;\n    },\n    subscribe: function () {\n      return {\n        unsubscribe: function () {\n          return void 0;\n        }\n      };\n    },\n    getSnapshot: function () {\n      return undefined;\n    },\n    toJSON: function () {\n      return {\n        id: id\n      };\n    }\n  }, _a[symbolObservable] = function () {\n    return this;\n  }, _a;\n}\n/**\r\n * Creates a deferred actor that is able to be invoked given the provided\r\n * invocation information in its `.meta` value.\r\n *\r\n * @param invokeDefinition The meta information needed to invoke the actor.\r\n */\n\nfunction createInvocableActor(invokeDefinition, machine, context, _event) {\n  var _a;\n\n  var invokeSrc = toInvokeSource(invokeDefinition.src);\n  var serviceCreator = (_a = machine === null || machine === void 0 ? void 0 : machine.options.services) === null || _a === void 0 ? void 0 : _a[invokeSrc.type];\n  var resolvedData = invokeDefinition.data ? mapContext(invokeDefinition.data, context, _event) : undefined;\n  var tempActor = serviceCreator ? createDeferredActor(serviceCreator, invokeDefinition.id, resolvedData) : createNullActor(invokeDefinition.id); // @ts-ignore\n\n  tempActor.meta = invokeDefinition;\n  return tempActor;\n}\nfunction createDeferredActor(entity, id, data) {\n  var tempActor = createNullActor(id); // @ts-ignore\n\n  tempActor.deferred = true;\n\n  if (isMachine(entity)) {\n    // \"mute\" the existing service scope so potential spawned actors within the `.initialState` stay deferred here\n    var initialState_1 = tempActor.state = provide(undefined, function () {\n      return (data ? entity.withContext(data) : entity).initialState;\n    });\n\n    tempActor.getSnapshot = function () {\n      return initialState_1;\n    };\n  }\n\n  return tempActor;\n}\nfunction isActor(item) {\n  try {\n    return typeof item.send === 'function';\n  } catch (e) {\n    return false;\n  }\n}\nfunction isSpawnedActor(item) {\n  return isActor(item) && 'id' in item;\n} // TODO: refactor the return type, this could be written in a better way but it's best to avoid unneccessary breaking changes now\n\nfunction toActorRef(actorRefLike) {\n  var _a;\n\n  return __assign((_a = {\n    subscribe: function () {\n      return {\n        unsubscribe: function () {\n          return void 0;\n        }\n      };\n    },\n    id: 'anonymous',\n    getSnapshot: function () {\n      return undefined;\n    }\n  }, _a[symbolObservable] = function () {\n    return this;\n  }, _a), actorRefLike);\n}\n\nexport { createDeferredActor, createInvocableActor, createNullActor, isActor, isSpawnedActor, toActorRef };\n","import { __values, __spreadArray, __read } from './_virtual/_tslib.js';\nimport { flatten } from './utils.js';\n\nvar isLeafNode = function (stateNode) {\n  return stateNode.type === 'atomic' || stateNode.type === 'final';\n};\nfunction getAllChildren(stateNode) {\n  return Object.keys(stateNode.states).map(function (key) {\n    return stateNode.states[key];\n  });\n}\nfunction getChildren(stateNode) {\n  return getAllChildren(stateNode).filter(function (sn) {\n    return sn.type !== 'history';\n  });\n}\nfunction getAllStateNodes(stateNode) {\n  var stateNodes = [stateNode];\n\n  if (isLeafNode(stateNode)) {\n    return stateNodes;\n  }\n\n  return stateNodes.concat(flatten(getChildren(stateNode).map(getAllStateNodes)));\n}\nfunction getConfiguration(prevStateNodes, stateNodes) {\n  var e_1, _a, e_2, _b, e_3, _c, e_4, _d;\n\n  var prevConfiguration = new Set(prevStateNodes);\n  var prevAdjList = getAdjList(prevConfiguration);\n  var configuration = new Set(stateNodes);\n\n  try {\n    // add all ancestors\n    for (var configuration_1 = __values(configuration), configuration_1_1 = configuration_1.next(); !configuration_1_1.done; configuration_1_1 = configuration_1.next()) {\n      var s = configuration_1_1.value;\n      var m = s.parent;\n\n      while (m && !configuration.has(m)) {\n        configuration.add(m);\n        m = m.parent;\n      }\n    }\n  } catch (e_1_1) {\n    e_1 = {\n      error: e_1_1\n    };\n  } finally {\n    try {\n      if (configuration_1_1 && !configuration_1_1.done && (_a = configuration_1.return)) _a.call(configuration_1);\n    } finally {\n      if (e_1) throw e_1.error;\n    }\n  }\n\n  var adjList = getAdjList(configuration);\n\n  try {\n    // add descendants\n    for (var configuration_2 = __values(configuration), configuration_2_1 = configuration_2.next(); !configuration_2_1.done; configuration_2_1 = configuration_2.next()) {\n      var s = configuration_2_1.value; // if previously active, add existing child nodes\n\n      if (s.type === 'compound' && (!adjList.get(s) || !adjList.get(s).length)) {\n        if (prevAdjList.get(s)) {\n          prevAdjList.get(s).forEach(function (sn) {\n            return configuration.add(sn);\n          });\n        } else {\n          s.initialStateNodes.forEach(function (sn) {\n            return configuration.add(sn);\n          });\n        }\n      } else {\n        if (s.type === 'parallel') {\n          try {\n            for (var _e = (e_3 = void 0, __values(getChildren(s))), _f = _e.next(); !_f.done; _f = _e.next()) {\n              var child = _f.value;\n\n              if (!configuration.has(child)) {\n                configuration.add(child);\n\n                if (prevAdjList.get(child)) {\n                  prevAdjList.get(child).forEach(function (sn) {\n                    return configuration.add(sn);\n                  });\n                } else {\n                  child.initialStateNodes.forEach(function (sn) {\n                    return configuration.add(sn);\n                  });\n                }\n              }\n            }\n          } catch (e_3_1) {\n            e_3 = {\n              error: e_3_1\n            };\n          } finally {\n            try {\n              if (_f && !_f.done && (_c = _e.return)) _c.call(_e);\n            } finally {\n              if (e_3) throw e_3.error;\n            }\n          }\n        }\n      }\n    }\n  } catch (e_2_1) {\n    e_2 = {\n      error: e_2_1\n    };\n  } finally {\n    try {\n      if (configuration_2_1 && !configuration_2_1.done && (_b = configuration_2.return)) _b.call(configuration_2);\n    } finally {\n      if (e_2) throw e_2.error;\n    }\n  }\n\n  try {\n    // add all ancestors\n    for (var configuration_3 = __values(configuration), configuration_3_1 = configuration_3.next(); !configuration_3_1.done; configuration_3_1 = configuration_3.next()) {\n      var s = configuration_3_1.value;\n      var m = s.parent;\n\n      while (m && !configuration.has(m)) {\n        configuration.add(m);\n        m = m.parent;\n      }\n    }\n  } catch (e_4_1) {\n    e_4 = {\n      error: e_4_1\n    };\n  } finally {\n    try {\n      if (configuration_3_1 && !configuration_3_1.done && (_d = configuration_3.return)) _d.call(configuration_3);\n    } finally {\n      if (e_4) throw e_4.error;\n    }\n  }\n\n  return configuration;\n}\n\nfunction getValueFromAdj(baseNode, adjList) {\n  var childStateNodes = adjList.get(baseNode);\n\n  if (!childStateNodes) {\n    return {}; // todo: fix?\n  }\n\n  if (baseNode.type === 'compound') {\n    var childStateNode = childStateNodes[0];\n\n    if (childStateNode) {\n      if (isLeafNode(childStateNode)) {\n        return childStateNode.key;\n      }\n    } else {\n      return {};\n    }\n  }\n\n  var stateValue = {};\n  childStateNodes.forEach(function (csn) {\n    stateValue[csn.key] = getValueFromAdj(csn, adjList);\n  });\n  return stateValue;\n}\n\nfunction getAdjList(configuration) {\n  var e_5, _a;\n\n  var adjList = new Map();\n\n  try {\n    for (var configuration_4 = __values(configuration), configuration_4_1 = configuration_4.next(); !configuration_4_1.done; configuration_4_1 = configuration_4.next()) {\n      var s = configuration_4_1.value;\n\n      if (!adjList.has(s)) {\n        adjList.set(s, []);\n      }\n\n      if (s.parent) {\n        if (!adjList.has(s.parent)) {\n          adjList.set(s.parent, []);\n        }\n\n        adjList.get(s.parent).push(s);\n      }\n    }\n  } catch (e_5_1) {\n    e_5 = {\n      error: e_5_1\n    };\n  } finally {\n    try {\n      if (configuration_4_1 && !configuration_4_1.done && (_a = configuration_4.return)) _a.call(configuration_4);\n    } finally {\n      if (e_5) throw e_5.error;\n    }\n  }\n\n  return adjList;\n}\nfunction getValue(rootNode, configuration) {\n  var config = getConfiguration([rootNode], configuration);\n  return getValueFromAdj(rootNode, getAdjList(config));\n}\nfunction has(iterable, item) {\n  if (Array.isArray(iterable)) {\n    return iterable.some(function (member) {\n      return member === item;\n    });\n  }\n\n  if (iterable instanceof Set) {\n    return iterable.has(item);\n  }\n\n  return false; // TODO: fix\n}\nfunction nextEvents(configuration) {\n  return __spreadArray([], __read(new Set(flatten(__spreadArray([], __read(configuration.map(function (sn) {\n    return sn.ownEvents;\n  })), false)))), false);\n}\nfunction isInFinalState(configuration, stateNode) {\n  if (stateNode.type === 'compound') {\n    return getChildren(stateNode).some(function (s) {\n      return s.type === 'final' && has(configuration, s);\n    });\n  }\n\n  if (stateNode.type === 'parallel') {\n    return getChildren(stateNode).every(function (sn) {\n      return isInFinalState(configuration, sn);\n    });\n  }\n\n  return false;\n}\nfunction getMeta(configuration) {\n  if (configuration === void 0) {\n    configuration = [];\n  }\n\n  return configuration.reduce(function (acc, stateNode) {\n    if (stateNode.meta !== undefined) {\n      acc[stateNode.id] = stateNode.meta;\n    }\n\n    return acc;\n  }, {});\n}\nfunction getTagsFromConfiguration(configuration) {\n  return new Set(flatten(configuration.map(function (sn) {\n    return sn.tags;\n  })));\n}\n\nexport { getAdjList, getAllChildren, getAllStateNodes, getChildren, getConfiguration, getMeta, getTagsFromConfiguration, getValue, has, isInFinalState, isLeafNode, nextEvents };\n","import { __assign, __spreadArray, __read, __rest } from './_virtual/_tslib.js';\nimport { EMPTY_ACTIVITY_MAP } from './constants.js';\nimport { isString, matchesState, warn } from './utils.js';\nimport { getMeta, nextEvents } from './stateUtils.js';\nimport { initEvent } from './actions.js';\nimport { IS_PRODUCTION } from './environment.js';\n\nfunction stateValuesEqual(a, b) {\n  if (a === b) {\n    return true;\n  }\n\n  if (a === undefined || b === undefined) {\n    return false;\n  }\n\n  if (isString(a) || isString(b)) {\n    return a === b;\n  }\n\n  var aKeys = Object.keys(a);\n  var bKeys = Object.keys(b);\n  return aKeys.length === bKeys.length && aKeys.every(function (key) {\n    return stateValuesEqual(a[key], b[key]);\n  });\n}\nfunction isStateConfig(state) {\n  if (typeof state !== 'object' || state === null) {\n    return false;\n  }\n\n  return 'value' in state && '_event' in state;\n}\n/**\r\n * @deprecated Use `isStateConfig(object)` or `state instanceof State` instead.\r\n */\n\nvar isState = isStateConfig;\nfunction bindActionToState(action, state) {\n  var exec = action.exec;\n\n  var boundAction = __assign(__assign({}, action), {\n    exec: exec !== undefined ? function () {\n      return exec(state.context, state.event, {\n        action: action,\n        state: state,\n        _event: state._event\n      });\n    } : undefined\n  });\n\n  return boundAction;\n}\n\nvar State =\n/*#__PURE__*/\n\n/** @class */\nfunction () {\n  /**\r\n   * Creates a new State instance.\r\n   * @param value The state value\r\n   * @param context The extended state\r\n   * @param historyValue The tree representing historical values of the state nodes\r\n   * @param history The previous state\r\n   * @param actions An array of action objects to execute as side-effects\r\n   * @param activities A mapping of activities and whether they are started (`true`) or stopped (`false`).\r\n   * @param meta\r\n   * @param events Internal event queue. Should be empty with run-to-completion semantics.\r\n   * @param configuration\r\n   */\n  function State(config) {\n    var _this = this;\n\n    var _a;\n\n    this.actions = [];\n    this.activities = EMPTY_ACTIVITY_MAP;\n    this.meta = {};\n    this.events = [];\n    this.value = config.value;\n    this.context = config.context;\n    this._event = config._event;\n    this._sessionid = config._sessionid;\n    this.event = this._event.data;\n    this.historyValue = config.historyValue;\n    this.history = config.history;\n    this.actions = config.actions || [];\n    this.activities = config.activities || EMPTY_ACTIVITY_MAP;\n    this.meta = getMeta(config.configuration);\n    this.events = config.events || [];\n    this.matches = this.matches.bind(this);\n    this.toStrings = this.toStrings.bind(this);\n    this.configuration = config.configuration;\n    this.transitions = config.transitions;\n    this.children = config.children;\n    this.done = !!config.done;\n    this.tags = (_a = Array.isArray(config.tags) ? new Set(config.tags) : config.tags) !== null && _a !== void 0 ? _a : new Set();\n    this.machine = config.machine;\n    Object.defineProperty(this, 'nextEvents', {\n      get: function () {\n        return nextEvents(_this.configuration);\n      }\n    });\n  }\n  /**\r\n   * Creates a new State instance for the given `stateValue` and `context`.\r\n   * @param stateValue\r\n   * @param context\r\n   */\n\n\n  State.from = function (stateValue, context) {\n    if (stateValue instanceof State) {\n      if (stateValue.context !== context) {\n        return new State({\n          value: stateValue.value,\n          context: context,\n          _event: stateValue._event,\n          _sessionid: null,\n          historyValue: stateValue.historyValue,\n          history: stateValue.history,\n          actions: [],\n          activities: stateValue.activities,\n          meta: {},\n          events: [],\n          configuration: [],\n          transitions: [],\n          children: {}\n        });\n      }\n\n      return stateValue;\n    }\n\n    var _event = initEvent;\n    return new State({\n      value: stateValue,\n      context: context,\n      _event: _event,\n      _sessionid: null,\n      historyValue: undefined,\n      history: undefined,\n      actions: [],\n      activities: undefined,\n      meta: undefined,\n      events: [],\n      configuration: [],\n      transitions: [],\n      children: {}\n    });\n  };\n  /**\r\n   * Creates a new State instance for the given `config`.\r\n   * @param config The state config\r\n   */\n\n\n  State.create = function (config) {\n    return new State(config);\n  };\n  /**\r\n   * Creates a new `State` instance for the given `stateValue` and `context` with no actions (side-effects).\r\n   * @param stateValue\r\n   * @param context\r\n   */\n\n\n  State.inert = function (stateValue, context) {\n    if (stateValue instanceof State) {\n      if (!stateValue.actions.length) {\n        return stateValue;\n      }\n\n      var _event = initEvent;\n      return new State({\n        value: stateValue.value,\n        context: context,\n        _event: _event,\n        _sessionid: null,\n        historyValue: stateValue.historyValue,\n        history: stateValue.history,\n        activities: stateValue.activities,\n        configuration: stateValue.configuration,\n        transitions: [],\n        children: {}\n      });\n    }\n\n    return State.from(stateValue, context);\n  };\n  /**\r\n   * Returns an array of all the string leaf state node paths.\r\n   * @param stateValue\r\n   * @param delimiter The character(s) that separate each subpath in the string state node path.\r\n   */\n\n\n  State.prototype.toStrings = function (stateValue, delimiter) {\n    var _this = this;\n\n    if (stateValue === void 0) {\n      stateValue = this.value;\n    }\n\n    if (delimiter === void 0) {\n      delimiter = '.';\n    }\n\n    if (isString(stateValue)) {\n      return [stateValue];\n    }\n\n    var valueKeys = Object.keys(stateValue);\n    return valueKeys.concat.apply(valueKeys, __spreadArray([], __read(valueKeys.map(function (key) {\n      return _this.toStrings(stateValue[key], delimiter).map(function (s) {\n        return key + delimiter + s;\n      });\n    })), false));\n  };\n\n  State.prototype.toJSON = function () {\n    var _a = this;\n        _a.configuration;\n        _a.transitions;\n        var tags = _a.tags;\n        _a.machine;\n        var jsonValues = __rest(_a, [\"configuration\", \"transitions\", \"tags\", \"machine\"]);\n\n    return __assign(__assign({}, jsonValues), {\n      tags: Array.from(tags)\n    });\n  };\n\n  State.prototype.matches = function (parentStateValue) {\n    return matchesState(parentStateValue, this.value);\n  };\n  /**\r\n   * Whether the current state configuration has a state node with the specified `tag`.\r\n   * @param tag\r\n   */\n\n\n  State.prototype.hasTag = function (tag) {\n    return this.tags.has(tag);\n  };\n  /**\r\n   * Determines whether sending the `event` will cause a non-forbidden transition\r\n   * to be selected, even if the transitions have no actions nor\r\n   * change the state value.\r\n   *\r\n   * @param event The event to test\r\n   * @returns Whether the event will cause a transition\r\n   */\n\n\n  State.prototype.can = function (event) {\n    var _a;\n\n    if (IS_PRODUCTION) {\n      warn(!!this.machine, \"state.can(...) used outside of a machine-created State object; this will always return false.\");\n    }\n\n    var transitionData = (_a = this.machine) === null || _a === void 0 ? void 0 : _a.getTransitionData(this, event);\n    return !!(transitionData === null || transitionData === void 0 ? void 0 : transitionData.transitions.length) && // Check that at least one transition is not forbidden\n    transitionData.transitions.some(function (t) {\n      return t.target !== undefined || t.actions.length;\n    });\n  };\n\n  return State;\n}();\n\nexport { State, bindActionToState, isState, isStateConfig, stateValuesEqual };\n","import { __assign } from './_virtual/_tslib.js';\n\nvar defaultOptions = {\n  deferEvents: false\n};\n\nvar Scheduler =\n/*#__PURE__*/\n\n/** @class */\nfunction () {\n  function Scheduler(options) {\n    this.processingEvent = false;\n    this.queue = [];\n    this.initialized = false;\n    this.options = __assign(__assign({}, defaultOptions), options);\n  }\n\n  Scheduler.prototype.initialize = function (callback) {\n    this.initialized = true;\n\n    if (callback) {\n      if (!this.options.deferEvents) {\n        this.schedule(callback);\n        return;\n      }\n\n      this.process(callback);\n    }\n\n    this.flushEvents();\n  };\n\n  Scheduler.prototype.schedule = function (task) {\n    if (!this.initialized || this.processingEvent) {\n      this.queue.push(task);\n      return;\n    }\n\n    if (this.queue.length !== 0) {\n      throw new Error('Event queue should be empty when it is not processing events');\n    }\n\n    this.process(task);\n    this.flushEvents();\n  };\n\n  Scheduler.prototype.clear = function () {\n    this.queue = [];\n  };\n\n  Scheduler.prototype.flushEvents = function () {\n    var nextCallback = this.queue.shift();\n\n    while (nextCallback) {\n      this.process(nextCallback);\n      nextCallback = this.queue.shift();\n    }\n  };\n\n  Scheduler.prototype.process = function (callback) {\n    this.processingEvent = true;\n\n    try {\n      callback();\n    } catch (e) {\n      // there is no use to keep the future events\n      // as the situation is not anymore the same\n      this.clear();\n      throw e;\n    } finally {\n      this.processingEvent = false;\n    }\n  };\n\n  return Scheduler;\n}();\n\nexport { Scheduler };\n","var children = /*#__PURE__*/new Map();\nvar sessionIdIndex = 0;\nvar registry = {\n  bookId: function () {\n    return \"x:\".concat(sessionIdIndex++);\n  },\n  register: function (id, actor) {\n    children.set(id, actor);\n    return id;\n  },\n  get: function (id) {\n    return children.get(id);\n  },\n  free: function (id) {\n    children.delete(id);\n  }\n};\n\nexport { registry };\n","import { IS_PRODUCTION } from './environment.js';\n\nfunction getGlobal() {\n  if (typeof globalThis !== 'undefined') {\n    return globalThis;\n  }\n\n  if (typeof self !== 'undefined') {\n    return self;\n  }\n\n  if (typeof window !== 'undefined') {\n    return window;\n  }\n\n  if (typeof global !== 'undefined') {\n    return global;\n  }\n\n  if (!IS_PRODUCTION) {\n    console.warn('XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues');\n  }\n}\n\nfunction getDevTools() {\n  var global = getGlobal();\n\n  if (global && '__xstate__' in global) {\n    return global.__xstate__;\n  }\n\n  return undefined;\n}\n\nfunction registerService(service) {\n  if (!getGlobal()) {\n    return;\n  }\n\n  var devTools = getDevTools();\n\n  if (devTools) {\n    devTools.register(service);\n  }\n}\n\nexport { getGlobal, registerService };\n","import { error, doneInvoke } from './actions.js';\nimport { toActorRef } from './Actor.js';\nimport { toObserver } from './utils.js';\n\n/**\r\n * Returns an actor behavior from a reducer and its initial state.\r\n *\r\n * @param transition The pure reducer that returns the next state given the current state and event.\r\n * @param initialState The initial state of the reducer.\r\n * @returns An actor behavior\r\n */\n\nfunction fromReducer(transition, initialState) {\n  return {\n    transition: transition,\n    initialState: initialState\n  };\n}\nfunction fromPromise(promiseFn) {\n  var initialState = {\n    error: undefined,\n    data: undefined,\n    status: 'pending'\n  };\n  return {\n    transition: function (state, event, _a) {\n      var parent = _a.parent,\n          id = _a.id,\n          observers = _a.observers;\n\n      switch (event.type) {\n        case 'fulfill':\n          parent === null || parent === void 0 ? void 0 : parent.send(doneInvoke(id, event.data));\n          return {\n            error: undefined,\n            data: event.data,\n            status: 'fulfilled'\n          };\n\n        case 'reject':\n          parent === null || parent === void 0 ? void 0 : parent.send(error(id, event.error));\n          observers.forEach(function (observer) {\n            observer.error(event.error);\n          });\n          return {\n            error: event.error,\n            data: undefined,\n            status: 'rejected'\n          };\n\n        default:\n          return state;\n      }\n    },\n    initialState: initialState,\n    start: function (_a) {\n      var self = _a.self;\n      promiseFn().then(function (data) {\n        self.send({\n          type: 'fulfill',\n          data: data\n        });\n      }, function (reason) {\n        self.send({\n          type: 'reject',\n          error: reason\n        });\n      });\n      return initialState;\n    }\n  };\n}\nfunction spawnBehavior(behavior, options) {\n  if (options === void 0) {\n    options = {};\n  }\n\n  var state = behavior.initialState;\n  var observers = new Set();\n  var mailbox = [];\n  var flushing = false;\n\n  var flush = function () {\n    if (flushing) {\n      return;\n    }\n\n    flushing = true;\n\n    while (mailbox.length > 0) {\n      var event_1 = mailbox.shift();\n      state = behavior.transition(state, event_1, actorCtx);\n      observers.forEach(function (observer) {\n        return observer.next(state);\n      });\n    }\n\n    flushing = false;\n  };\n\n  var actor = toActorRef({\n    id: options.id,\n    send: function (event) {\n      mailbox.push(event);\n      flush();\n    },\n    getSnapshot: function () {\n      return state;\n    },\n    subscribe: function (next, handleError, complete) {\n      var observer = toObserver(next, handleError, complete);\n      observers.add(observer);\n      observer.next(state);\n      return {\n        unsubscribe: function () {\n          observers.delete(observer);\n        }\n      };\n    }\n  });\n  var actorCtx = {\n    parent: options.parent,\n    self: actor,\n    id: options.id || 'anonymous',\n    observers: observers\n  };\n  state = behavior.start ? behavior.start(actorCtx) : state;\n  return actor;\n}\n\nexport { fromPromise, fromReducer, spawnBehavior };\n","import { __values, __spreadArray, __read, __assign } from './_virtual/_tslib.js';\nimport { SpecialTargets, ActionTypes } from './types.js';\nimport { isStateConfig, State, bindActionToState } from './State.js';\nimport { raise, send, errorPlatform, update, error as error$1, log, stop, start, cancel } from './actionTypes.js';\nimport { initEvent, doneInvoke, toActionObjects, resolveActions, error, getActionFunction } from './actions.js';\nimport { IS_PRODUCTION } from './environment.js';\nimport { warn, mapContext, toObserver, isFunction, toSCXMLEvent, flatten, isPromiseLike, isObservable, isMachine, isBehavior, reportUnhandledExceptionOnInvocation, symbolObservable, isArray, toEventObject, isString, isActor, toInvokeSource, uniqueId } from './utils.js';\nimport { Scheduler } from './scheduler.js';\nimport { createDeferredActor, isSpawnedActor } from './Actor.js';\nimport { registry } from './registry.js';\nimport { getGlobal, registerService } from './devTools.js';\nimport { provide, consume } from './serviceScope.js';\nimport { spawnBehavior } from './behaviors.js';\n\nvar DEFAULT_SPAWN_OPTIONS = {\n  sync: false,\n  autoForward: false\n};\nvar InterpreterStatus;\n\n(function (InterpreterStatus) {\n  InterpreterStatus[InterpreterStatus[\"NotStarted\"] = 0] = \"NotStarted\";\n  InterpreterStatus[InterpreterStatus[\"Running\"] = 1] = \"Running\";\n  InterpreterStatus[InterpreterStatus[\"Stopped\"] = 2] = \"Stopped\";\n})(InterpreterStatus || (InterpreterStatus = {}));\n\nvar Interpreter =\n/*#__PURE__*/\n\n/** @class */\nfunction () {\n  /**\r\n   * Creates a new Interpreter instance (i.e., service) for the given machine with the provided options, if any.\r\n   *\r\n   * @param machine The machine to be interpreted\r\n   * @param options Interpreter options\r\n   */\n  function Interpreter(machine, options) {\n    if (options === void 0) {\n      options = Interpreter.defaultOptions;\n    }\n\n    var _this = this;\n\n    this.machine = machine;\n    this.delayedEventsMap = {};\n    this.listeners = new Set();\n    this.contextListeners = new Set();\n    this.stopListeners = new Set();\n    this.doneListeners = new Set();\n    this.eventListeners = new Set();\n    this.sendListeners = new Set();\n    /**\r\n     * Whether the service is started.\r\n     */\n\n    this.initialized = false;\n    this.status = InterpreterStatus.NotStarted;\n    this.children = new Map();\n    this.forwardTo = new Set();\n    this._outgoingQueue = [];\n    /**\r\n     * Alias for Interpreter.prototype.start\r\n     */\n\n    this.init = this.start;\n    /**\r\n     * Sends an event to the running interpreter to trigger a transition.\r\n     *\r\n     * An array of events (batched) can be sent as well, which will send all\r\n     * batched events to the running interpreter. The listeners will be\r\n     * notified only **once** when all events are processed.\r\n     *\r\n     * @param event The event(s) to send\r\n     */\n\n    this.send = function (event, payload) {\n      if (isArray(event)) {\n        _this.batch(event);\n\n        return _this.state;\n      }\n\n      var _event = toSCXMLEvent(toEventObject(event, payload));\n\n      if (_this.status === InterpreterStatus.Stopped) {\n        // do nothing\n        if (!IS_PRODUCTION) {\n          warn(false, \"Event \\\"\".concat(_event.name, \"\\\" was sent to stopped service \\\"\").concat(_this.machine.id, \"\\\". This service has already reached its final state, and will not transition.\\nEvent: \").concat(JSON.stringify(_event.data)));\n        }\n\n        return _this.state;\n      }\n\n      if (_this.status !== InterpreterStatus.Running && !_this.options.deferEvents) {\n        throw new Error(\"Event \\\"\".concat(_event.name, \"\\\" was sent to uninitialized service \\\"\").concat(_this.machine.id // tslint:disable-next-line:max-line-length\n        , \"\\\". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\\nEvent: \").concat(JSON.stringify(_event.data)));\n      }\n\n      _this.scheduler.schedule(function () {\n        // Forward copy of event to child actors\n        _this.forward(_event);\n\n        var nextState = _this._nextState(_event);\n\n        _this.update(nextState, _event);\n      });\n\n      return _this._state; // TODO: deprecate (should return void)\n      // tslint:disable-next-line:semicolon\n    };\n\n    this.sendTo = function (event, to, immediate) {\n      var isParent = _this.parent && (to === SpecialTargets.Parent || _this.parent.id === to);\n      var target = isParent ? _this.parent : isString(to) ? _this.children.get(to) || registry.get(to) : isActor(to) ? to : undefined;\n\n      if (!target) {\n        if (!isParent) {\n          throw new Error(\"Unable to send event to child '\".concat(to, \"' from service '\").concat(_this.id, \"'.\"));\n        } // tslint:disable-next-line:no-console\n\n\n        if (!IS_PRODUCTION) {\n          warn(false, \"Service '\".concat(_this.id, \"' has no parent: unable to send event \").concat(event.type));\n        }\n\n        return;\n      }\n\n      if ('machine' in target) {\n        // perhaps those events should be rejected in the parent\n        // but atm it doesn't have easy access to all of the information that is required to do it reliably\n        if (_this.status !== InterpreterStatus.Stopped || _this.parent !== target || // we need to send events to the parent from exit handlers of a machine that reached its final state\n        _this.state.done) {\n          // Send SCXML events to machines\n          var scxmlEvent = __assign(__assign({}, event), {\n            name: event.name === error$1 ? \"\".concat(error(_this.id)) : event.name,\n            origin: _this.sessionId\n          });\n\n          if (!immediate && _this.machine.config.predictableActionArguments) {\n            _this._outgoingQueue.push([target, scxmlEvent]);\n          } else {\n            target.send(scxmlEvent);\n          }\n        }\n      } else {\n        // Send normal events to other targets\n        if (!immediate && _this.machine.config.predictableActionArguments) {\n          _this._outgoingQueue.push([target, event.data]);\n        } else {\n          target.send(event.data);\n        }\n      }\n    };\n\n    this._exec = function (action, context, _event, actionFunctionMap) {\n      if (actionFunctionMap === void 0) {\n        actionFunctionMap = _this.machine.options.actions;\n      }\n\n      var actionOrExec = action.exec || getActionFunction(action.type, actionFunctionMap);\n      var exec = isFunction(actionOrExec) ? actionOrExec : actionOrExec ? actionOrExec.exec : action.exec;\n\n      if (exec) {\n        try {\n          return exec(context, _event.data, !_this.machine.config.predictableActionArguments ? {\n            action: action,\n            state: _this.state,\n            _event: _event\n          } : {\n            action: action,\n            _event: _event\n          });\n        } catch (err) {\n          if (_this.parent) {\n            _this.parent.send({\n              type: 'xstate.error',\n              data: err\n            });\n          }\n\n          throw err;\n        }\n      }\n\n      switch (action.type) {\n        case send:\n          var sendAction = action;\n\n          if (typeof sendAction.delay === 'number') {\n            _this.defer(sendAction);\n\n            return;\n          } else {\n            if (sendAction.to) {\n              _this.sendTo(sendAction._event, sendAction.to, _event === initEvent);\n            } else {\n              _this.send(sendAction._event);\n            }\n          }\n\n          break;\n\n        case cancel:\n          _this.cancel(action.sendId);\n\n          break;\n\n        case start:\n          {\n            if (_this.status !== InterpreterStatus.Running) {\n              return;\n            }\n\n            var activity = action.activity; // If the activity will be stopped right after it's started\n            // (such as in transient states)\n            // don't bother starting the activity.\n\n            if ( // in v4 with `predictableActionArguments` invokes are called eagerly when the `this.state` still points to the previous state\n            !_this.machine.config.predictableActionArguments && !_this.state.activities[activity.id || activity.type]) {\n              break;\n            } // Invoked services\n\n\n            if (activity.type === ActionTypes.Invoke) {\n              var invokeSource = toInvokeSource(activity.src);\n              var serviceCreator = _this.machine.options.services ? _this.machine.options.services[invokeSource.type] : undefined;\n              var id = activity.id,\n                  data = activity.data;\n\n              if (!IS_PRODUCTION) {\n                warn(!('forward' in activity), // tslint:disable-next-line:max-line-length\n                \"`forward` property is deprecated (found in invocation of '\".concat(activity.src, \"' in in machine '\").concat(_this.machine.id, \"'). \") + \"Please use `autoForward` instead.\");\n              }\n\n              var autoForward = 'autoForward' in activity ? activity.autoForward : !!activity.forward;\n\n              if (!serviceCreator) {\n                // tslint:disable-next-line:no-console\n                if (!IS_PRODUCTION) {\n                  warn(false, \"No service found for invocation '\".concat(activity.src, \"' in machine '\").concat(_this.machine.id, \"'.\"));\n                }\n\n                return;\n              }\n\n              var resolvedData = data ? mapContext(data, context, _event) : undefined;\n\n              if (typeof serviceCreator === 'string') {\n                // TODO: warn\n                return;\n              }\n\n              var source = isFunction(serviceCreator) ? serviceCreator(context, _event.data, {\n                data: resolvedData,\n                src: invokeSource,\n                meta: activity.meta\n              }) : serviceCreator;\n\n              if (!source) {\n                // TODO: warn?\n                return;\n              }\n\n              var options = void 0;\n\n              if (isMachine(source)) {\n                source = resolvedData ? source.withContext(resolvedData) : source;\n                options = {\n                  autoForward: autoForward\n                };\n              }\n\n              _this.spawn(source, id, options);\n            } else {\n              _this.spawnActivity(activity);\n            }\n\n            break;\n          }\n\n        case stop:\n          {\n            _this.stopChild(action.activity.id);\n\n            break;\n          }\n\n        case log:\n          var label = action.label,\n              value = action.value;\n\n          if (label) {\n            _this.logger(label, value);\n          } else {\n            _this.logger(value);\n          }\n\n          break;\n\n        default:\n          if (!IS_PRODUCTION) {\n            warn(false, \"No implementation found for action type '\".concat(action.type, \"'\"));\n          }\n\n          break;\n      }\n    };\n\n    var resolvedOptions = __assign(__assign({}, Interpreter.defaultOptions), options);\n\n    var clock = resolvedOptions.clock,\n        logger = resolvedOptions.logger,\n        parent = resolvedOptions.parent,\n        id = resolvedOptions.id;\n    var resolvedId = id !== undefined ? id : machine.id;\n    this.id = resolvedId;\n    this.logger = logger;\n    this.clock = clock;\n    this.parent = parent;\n    this.options = resolvedOptions;\n    this.scheduler = new Scheduler({\n      deferEvents: this.options.deferEvents\n    });\n    this.sessionId = registry.bookId();\n  }\n\n  Object.defineProperty(Interpreter.prototype, \"initialState\", {\n    get: function () {\n      var _this = this;\n\n      if (this._initialState) {\n        return this._initialState;\n      }\n\n      return provide(this, function () {\n        _this._initialState = _this.machine.initialState;\n        return _this._initialState;\n      });\n    },\n    enumerable: false,\n    configurable: true\n  });\n  Object.defineProperty(Interpreter.prototype, \"state\", {\n    /**\r\n     * @deprecated Use `.getSnapshot()` instead.\r\n     */\n    get: function () {\n      if (!IS_PRODUCTION) {\n        warn(this.status !== InterpreterStatus.NotStarted, \"Attempted to read state from uninitialized service '\".concat(this.id, \"'. Make sure the service is started first.\"));\n      }\n\n      return this._state;\n    },\n    enumerable: false,\n    configurable: true\n  });\n  /**\r\n   * Executes the actions of the given state, with that state's `context` and `event`.\r\n   *\r\n   * @param state The state whose actions will be executed\r\n   * @param actionsConfig The action implementations to use\r\n   */\n\n  Interpreter.prototype.execute = function (state, actionsConfig) {\n    var e_1, _a;\n\n    try {\n      for (var _b = __values(state.actions), _c = _b.next(); !_c.done; _c = _b.next()) {\n        var action = _c.value;\n        this.exec(action, state, actionsConfig);\n      }\n    } catch (e_1_1) {\n      e_1 = {\n        error: e_1_1\n      };\n    } finally {\n      try {\n        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n      } finally {\n        if (e_1) throw e_1.error;\n      }\n    }\n  };\n\n  Interpreter.prototype.update = function (state, _event) {\n    var e_2, _a, e_3, _b, e_4, _c, e_5, _d;\n\n    var _this = this; // Attach session ID to state\n\n\n    state._sessionid = this.sessionId; // Update state\n\n    this._state = state; // Execute actions\n\n    if ((!this.machine.config.predictableActionArguments || // this is currently required to execute initial actions as the `initialState` gets cached\n    // we can't just recompute it (and execute actions while doing so) because we try to preserve identity of actors created within initial assigns\n    _event === initEvent) && this.options.execute) {\n      this.execute(this.state);\n    } else {\n      var item = void 0;\n\n      while (item = this._outgoingQueue.shift()) {\n        item[0].send(item[1]);\n      }\n    } // Update children\n\n\n    this.children.forEach(function (child) {\n      _this.state.children[child.id] = child;\n    }); // Dev tools\n\n    if (this.devTools) {\n      this.devTools.send(_event.data, state);\n    } // Execute listeners\n\n\n    if (state.event) {\n      try {\n        for (var _e = __values(this.eventListeners), _f = _e.next(); !_f.done; _f = _e.next()) {\n          var listener = _f.value;\n          listener(state.event);\n        }\n      } catch (e_2_1) {\n        e_2 = {\n          error: e_2_1\n        };\n      } finally {\n        try {\n          if (_f && !_f.done && (_a = _e.return)) _a.call(_e);\n        } finally {\n          if (e_2) throw e_2.error;\n        }\n      }\n    }\n\n    try {\n      for (var _g = __values(this.listeners), _h = _g.next(); !_h.done; _h = _g.next()) {\n        var listener = _h.value;\n        listener(state, state.event);\n      }\n    } catch (e_3_1) {\n      e_3 = {\n        error: e_3_1\n      };\n    } finally {\n      try {\n        if (_h && !_h.done && (_b = _g.return)) _b.call(_g);\n      } finally {\n        if (e_3) throw e_3.error;\n      }\n    }\n\n    try {\n      for (var _j = __values(this.contextListeners), _k = _j.next(); !_k.done; _k = _j.next()) {\n        var contextListener = _k.value;\n        contextListener(this.state.context, this.state.history ? this.state.history.context : undefined);\n      }\n    } catch (e_4_1) {\n      e_4 = {\n        error: e_4_1\n      };\n    } finally {\n      try {\n        if (_k && !_k.done && (_c = _j.return)) _c.call(_j);\n      } finally {\n        if (e_4) throw e_4.error;\n      }\n    }\n\n    if (this.state.done) {\n      // get final child state node\n      var finalChildStateNode = state.configuration.find(function (sn) {\n        return sn.type === 'final' && sn.parent === _this.machine;\n      });\n      var doneData = finalChildStateNode && finalChildStateNode.doneData ? mapContext(finalChildStateNode.doneData, state.context, _event) : undefined;\n\n      try {\n        for (var _l = __values(this.doneListeners), _m = _l.next(); !_m.done; _m = _l.next()) {\n          var listener = _m.value;\n          listener(doneInvoke(this.id, doneData));\n        }\n      } catch (e_5_1) {\n        e_5 = {\n          error: e_5_1\n        };\n      } finally {\n        try {\n          if (_m && !_m.done && (_d = _l.return)) _d.call(_l);\n        } finally {\n          if (e_5) throw e_5.error;\n        }\n      }\n\n      this._stop();\n\n      this._stopChildren();\n    }\n  };\n  /*\r\n   * Adds a listener that is notified whenever a state transition happens. The listener is called with\r\n   * the next state and the event object that caused the state transition.\r\n   *\r\n   * @param listener The state listener\r\n   */\n\n\n  Interpreter.prototype.onTransition = function (listener) {\n    this.listeners.add(listener); // Send current state to listener\n\n    if (this.status === InterpreterStatus.Running) {\n      listener(this.state, this.state.event);\n    }\n\n    return this;\n  };\n\n  Interpreter.prototype.subscribe = function (nextListenerOrObserver, _, // TODO: error listener\n  completeListener) {\n    var _this = this;\n\n    var observer = toObserver(nextListenerOrObserver, _, completeListener);\n    this.listeners.add(observer.next); // Send current state to listener\n\n    if (this.status !== InterpreterStatus.NotStarted) {\n      observer.next(this.state);\n    }\n\n    var completeOnce = function () {\n      _this.doneListeners.delete(completeOnce);\n\n      _this.stopListeners.delete(completeOnce);\n\n      observer.complete();\n    };\n\n    if (this.status === InterpreterStatus.Stopped) {\n      observer.complete();\n    } else {\n      this.onDone(completeOnce);\n      this.onStop(completeOnce);\n    }\n\n    return {\n      unsubscribe: function () {\n        _this.listeners.delete(observer.next);\n\n        _this.doneListeners.delete(completeOnce);\n\n        _this.stopListeners.delete(completeOnce);\n      }\n    };\n  };\n  /**\r\n   * Adds an event listener that is notified whenever an event is sent to the running interpreter.\r\n   * @param listener The event listener\r\n   */\n\n\n  Interpreter.prototype.onEvent = function (listener) {\n    this.eventListeners.add(listener);\n    return this;\n  };\n  /**\r\n   * Adds an event listener that is notified whenever a `send` event occurs.\r\n   * @param listener The event listener\r\n   */\n\n\n  Interpreter.prototype.onSend = function (listener) {\n    this.sendListeners.add(listener);\n    return this;\n  };\n  /**\r\n   * Adds a context listener that is notified whenever the state context changes.\r\n   * @param listener The context listener\r\n   */\n\n\n  Interpreter.prototype.onChange = function (listener) {\n    this.contextListeners.add(listener);\n    return this;\n  };\n  /**\r\n   * Adds a listener that is notified when the machine is stopped.\r\n   * @param listener The listener\r\n   */\n\n\n  Interpreter.prototype.onStop = function (listener) {\n    this.stopListeners.add(listener);\n    return this;\n  };\n  /**\r\n   * Adds a state listener that is notified when the statechart has reached its final state.\r\n   * @param listener The state listener\r\n   */\n\n\n  Interpreter.prototype.onDone = function (listener) {\n    this.doneListeners.add(listener);\n    return this;\n  };\n  /**\r\n   * Removes a listener.\r\n   * @param listener The listener to remove\r\n   */\n\n\n  Interpreter.prototype.off = function (listener) {\n    this.listeners.delete(listener);\n    this.eventListeners.delete(listener);\n    this.sendListeners.delete(listener);\n    this.stopListeners.delete(listener);\n    this.doneListeners.delete(listener);\n    this.contextListeners.delete(listener);\n    return this;\n  };\n  /**\r\n   * Starts the interpreter from the given state, or the initial state.\r\n   * @param initialState The state to start the statechart from\r\n   */\n\n\n  Interpreter.prototype.start = function (initialState) {\n    var _this = this;\n\n    if (this.status === InterpreterStatus.Running) {\n      // Do not restart the service if it is already started\n      return this;\n    } // yes, it's a hack but we need the related cache to be populated for some things to work (like delayed transitions)\n    // this is usually called by `machine.getInitialState` but if we rehydrate from a state we might bypass this call\n    // we also don't want to call this method here as it resolves the full initial state which might involve calling assign actions\n    // and that could potentially lead to some unwanted side-effects (even such as creating some rogue actors)\n\n\n    this.machine._init();\n\n    registry.register(this.sessionId, this);\n    this.initialized = true;\n    this.status = InterpreterStatus.Running;\n    var resolvedState = initialState === undefined ? this.initialState : provide(this, function () {\n      return isStateConfig(initialState) ? _this.machine.resolveState(initialState) : _this.machine.resolveState(State.from(initialState, _this.machine.context));\n    });\n\n    if (this.options.devTools) {\n      this.attachDev();\n    }\n\n    this.scheduler.initialize(function () {\n      _this.update(resolvedState, initEvent);\n    });\n    return this;\n  };\n\n  Interpreter.prototype._stopChildren = function () {\n    // TODO: think about converting those to actions\n    this.children.forEach(function (child) {\n      if (isFunction(child.stop)) {\n        child.stop();\n      }\n    });\n    this.children.clear();\n  };\n\n  Interpreter.prototype._stop = function () {\n    var e_6, _a, e_7, _b, e_8, _c, e_9, _d, e_10, _e;\n\n    try {\n      for (var _f = __values(this.listeners), _g = _f.next(); !_g.done; _g = _f.next()) {\n        var listener = _g.value;\n        this.listeners.delete(listener);\n      }\n    } catch (e_6_1) {\n      e_6 = {\n        error: e_6_1\n      };\n    } finally {\n      try {\n        if (_g && !_g.done && (_a = _f.return)) _a.call(_f);\n      } finally {\n        if (e_6) throw e_6.error;\n      }\n    }\n\n    try {\n      for (var _h = __values(this.stopListeners), _j = _h.next(); !_j.done; _j = _h.next()) {\n        var listener = _j.value; // call listener, then remove\n\n        listener();\n        this.stopListeners.delete(listener);\n      }\n    } catch (e_7_1) {\n      e_7 = {\n        error: e_7_1\n      };\n    } finally {\n      try {\n        if (_j && !_j.done && (_b = _h.return)) _b.call(_h);\n      } finally {\n        if (e_7) throw e_7.error;\n      }\n    }\n\n    try {\n      for (var _k = __values(this.contextListeners), _l = _k.next(); !_l.done; _l = _k.next()) {\n        var listener = _l.value;\n        this.contextListeners.delete(listener);\n      }\n    } catch (e_8_1) {\n      e_8 = {\n        error: e_8_1\n      };\n    } finally {\n      try {\n        if (_l && !_l.done && (_c = _k.return)) _c.call(_k);\n      } finally {\n        if (e_8) throw e_8.error;\n      }\n    }\n\n    try {\n      for (var _m = __values(this.doneListeners), _o = _m.next(); !_o.done; _o = _m.next()) {\n        var listener = _o.value;\n        this.doneListeners.delete(listener);\n      }\n    } catch (e_9_1) {\n      e_9 = {\n        error: e_9_1\n      };\n    } finally {\n      try {\n        if (_o && !_o.done && (_d = _m.return)) _d.call(_m);\n      } finally {\n        if (e_9) throw e_9.error;\n      }\n    }\n\n    if (!this.initialized) {\n      // Interpreter already stopped; do nothing\n      return this;\n    }\n\n    this.initialized = false;\n    this.status = InterpreterStatus.Stopped;\n    this._initialState = undefined;\n\n    try {\n      // we are going to stop within the current sync frame\n      // so we can safely just cancel this here as nothing async should be fired anyway\n      for (var _p = __values(Object.keys(this.delayedEventsMap)), _q = _p.next(); !_q.done; _q = _p.next()) {\n        var key = _q.value;\n        this.clock.clearTimeout(this.delayedEventsMap[key]);\n      }\n    } catch (e_10_1) {\n      e_10 = {\n        error: e_10_1\n      };\n    } finally {\n      try {\n        if (_q && !_q.done && (_e = _p.return)) _e.call(_p);\n      } finally {\n        if (e_10) throw e_10.error;\n      }\n    } // clear everything that might be enqueued\n\n\n    this.scheduler.clear();\n    this.scheduler = new Scheduler({\n      deferEvents: this.options.deferEvents\n    });\n  };\n  /**\r\n   * Stops the interpreter and unsubscribe all listeners.\r\n   *\r\n   * This will also notify the `onStop` listeners.\r\n   */\n\n\n  Interpreter.prototype.stop = function () {\n    // TODO: add warning for stopping non-root interpreters\n    var _this = this; // grab the current scheduler as it will be replaced in _stop\n\n\n    var scheduler = this.scheduler;\n\n    this._stop(); // let what is currently processed to be finished\n\n\n    scheduler.schedule(function () {\n      // it feels weird to handle this here but we need to handle this even slightly \"out of band\"\n      var _event = toSCXMLEvent({\n        type: 'xstate.stop'\n      });\n\n      var nextState = provide(_this, function () {\n        var exitActions = flatten(__spreadArray([], __read(_this.state.configuration), false).sort(function (a, b) {\n          return b.order - a.order;\n        }).map(function (stateNode) {\n          return toActionObjects(stateNode.onExit, _this.machine.options.actions);\n        }));\n\n        var _a = __read(resolveActions(_this.machine, _this.state, _this.state.context, _event, [exitActions], _this.machine.config.predictableActionArguments ? _this._exec : undefined, _this.machine.config.predictableActionArguments || _this.machine.config.preserveActionOrder), 2),\n            resolvedActions = _a[0],\n            updatedContext = _a[1];\n\n        var newState = new State({\n          value: _this.state.value,\n          context: updatedContext,\n          _event: _event,\n          _sessionid: _this.sessionId,\n          historyValue: undefined,\n          history: _this.state,\n          actions: resolvedActions.filter(function (action) {\n            return action.type !== raise && (action.type !== send || !!action.to && action.to !== SpecialTargets.Internal);\n          }),\n          activities: {},\n          events: [],\n          configuration: [],\n          transitions: [],\n          children: {},\n          done: _this.state.done,\n          tags: _this.state.tags,\n          machine: _this.machine\n        });\n        newState.changed = true;\n        return newState;\n      });\n\n      _this.update(nextState, _event);\n\n      _this._stopChildren();\n\n      registry.free(_this.sessionId);\n    });\n    return this;\n  };\n\n  Interpreter.prototype.batch = function (events) {\n    var _this = this;\n\n    if (this.status === InterpreterStatus.NotStarted && this.options.deferEvents) {\n      // tslint:disable-next-line:no-console\n      if (!IS_PRODUCTION) {\n        warn(false, \"\".concat(events.length, \" event(s) were sent to uninitialized service \\\"\").concat(this.machine.id, \"\\\" and are deferred. Make sure .start() is called for this service.\\nEvent: \").concat(JSON.stringify(event)));\n      }\n    } else if (this.status !== InterpreterStatus.Running) {\n      throw new Error( // tslint:disable-next-line:max-line-length\n      \"\".concat(events.length, \" event(s) were sent to uninitialized service \\\"\").concat(this.machine.id, \"\\\". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\"));\n    }\n\n    if (!events.length) {\n      return;\n    }\n\n    var exec = !!this.machine.config.predictableActionArguments && this._exec;\n    this.scheduler.schedule(function () {\n      var e_11, _a;\n\n      var nextState = _this.state;\n      var batchChanged = false;\n      var batchedActions = [];\n\n      var _loop_1 = function (event_1) {\n        var _event = toSCXMLEvent(event_1);\n\n        _this.forward(_event);\n\n        nextState = provide(_this, function () {\n          return _this.machine.transition(nextState, _event, undefined, exec || undefined);\n        });\n        batchedActions.push.apply(batchedActions, __spreadArray([], __read(_this.machine.config.predictableActionArguments ? nextState.actions : nextState.actions.map(function (a) {\n          return bindActionToState(a, nextState);\n        })), false));\n        batchChanged = batchChanged || !!nextState.changed;\n      };\n\n      try {\n        for (var events_1 = __values(events), events_1_1 = events_1.next(); !events_1_1.done; events_1_1 = events_1.next()) {\n          var event_1 = events_1_1.value;\n\n          _loop_1(event_1);\n        }\n      } catch (e_11_1) {\n        e_11 = {\n          error: e_11_1\n        };\n      } finally {\n        try {\n          if (events_1_1 && !events_1_1.done && (_a = events_1.return)) _a.call(events_1);\n        } finally {\n          if (e_11) throw e_11.error;\n        }\n      }\n\n      nextState.changed = batchChanged;\n      nextState.actions = batchedActions;\n\n      _this.update(nextState, toSCXMLEvent(events[events.length - 1]));\n    });\n  };\n  /**\r\n   * Returns a send function bound to this interpreter instance.\r\n   *\r\n   * @param event The event to be sent by the sender.\r\n   */\n\n\n  Interpreter.prototype.sender = function (event) {\n    return this.send.bind(this, event);\n  };\n\n  Interpreter.prototype._nextState = function (event, exec) {\n    var _this = this;\n\n    if (exec === void 0) {\n      exec = !!this.machine.config.predictableActionArguments && this._exec;\n    }\n\n    var _event = toSCXMLEvent(event);\n\n    if (_event.name.indexOf(errorPlatform) === 0 && !this.state.nextEvents.some(function (nextEvent) {\n      return nextEvent.indexOf(errorPlatform) === 0;\n    })) {\n      throw _event.data.data;\n    }\n\n    var nextState = provide(this, function () {\n      return _this.machine.transition(_this.state, _event, undefined, exec || undefined);\n    });\n    return nextState;\n  };\n  /**\r\n   * Returns the next state given the interpreter's current state and the event.\r\n   *\r\n   * This is a pure method that does _not_ update the interpreter's state.\r\n   *\r\n   * @param event The event to determine the next state\r\n   */\n\n\n  Interpreter.prototype.nextState = function (event) {\n    return this._nextState(event, false);\n  };\n\n  Interpreter.prototype.forward = function (event) {\n    var e_12, _a;\n\n    try {\n      for (var _b = __values(this.forwardTo), _c = _b.next(); !_c.done; _c = _b.next()) {\n        var id = _c.value;\n        var child = this.children.get(id);\n\n        if (!child) {\n          throw new Error(\"Unable to forward event '\".concat(event, \"' from interpreter '\").concat(this.id, \"' to nonexistant child '\").concat(id, \"'.\"));\n        }\n\n        child.send(event);\n      }\n    } catch (e_12_1) {\n      e_12 = {\n        error: e_12_1\n      };\n    } finally {\n      try {\n        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n      } finally {\n        if (e_12) throw e_12.error;\n      }\n    }\n  };\n\n  Interpreter.prototype.defer = function (sendAction) {\n    var _this = this;\n\n    this.delayedEventsMap[sendAction.id] = this.clock.setTimeout(function () {\n      if (sendAction.to) {\n        _this.sendTo(sendAction._event, sendAction.to, true);\n      } else {\n        _this.send(sendAction._event);\n      }\n    }, sendAction.delay);\n  };\n\n  Interpreter.prototype.cancel = function (sendId) {\n    this.clock.clearTimeout(this.delayedEventsMap[sendId]);\n    delete this.delayedEventsMap[sendId];\n  };\n\n  Interpreter.prototype.exec = function (action, state, actionFunctionMap) {\n    if (actionFunctionMap === void 0) {\n      actionFunctionMap = this.machine.options.actions;\n    }\n\n    this._exec(action, state.context, state._event, actionFunctionMap);\n  };\n\n  Interpreter.prototype.removeChild = function (childId) {\n    var _a;\n\n    this.children.delete(childId);\n    this.forwardTo.delete(childId); // this.state might not exist at the time this is called,\n    // such as when a child is added then removed while initializing the state\n\n    (_a = this.state) === null || _a === void 0 ? true : delete _a.children[childId];\n  };\n\n  Interpreter.prototype.stopChild = function (childId) {\n    var child = this.children.get(childId);\n\n    if (!child) {\n      return;\n    }\n\n    this.removeChild(childId);\n\n    if (isFunction(child.stop)) {\n      child.stop();\n    }\n  };\n\n  Interpreter.prototype.spawn = function (entity, name, options) {\n    if (this.status !== InterpreterStatus.Running) {\n      return createDeferredActor(entity, name);\n    }\n\n    if (isPromiseLike(entity)) {\n      return this.spawnPromise(Promise.resolve(entity), name);\n    } else if (isFunction(entity)) {\n      return this.spawnCallback(entity, name);\n    } else if (isSpawnedActor(entity)) {\n      return this.spawnActor(entity, name);\n    } else if (isObservable(entity)) {\n      return this.spawnObservable(entity, name);\n    } else if (isMachine(entity)) {\n      return this.spawnMachine(entity, __assign(__assign({}, options), {\n        id: name\n      }));\n    } else if (isBehavior(entity)) {\n      return this.spawnBehavior(entity, name);\n    } else {\n      throw new Error(\"Unable to spawn entity \\\"\".concat(name, \"\\\" of type \\\"\").concat(typeof entity, \"\\\".\"));\n    }\n  };\n\n  Interpreter.prototype.spawnMachine = function (machine, options) {\n    var _this = this;\n\n    if (options === void 0) {\n      options = {};\n    }\n\n    var childService = new Interpreter(machine, __assign(__assign({}, this.options), {\n      parent: this,\n      id: options.id || machine.id\n    }));\n\n    var resolvedOptions = __assign(__assign({}, DEFAULT_SPAWN_OPTIONS), options);\n\n    if (resolvedOptions.sync) {\n      childService.onTransition(function (state) {\n        _this.send(update, {\n          state: state,\n          id: childService.id\n        });\n      });\n    }\n\n    var actor = childService;\n    this.children.set(childService.id, actor);\n\n    if (resolvedOptions.autoForward) {\n      this.forwardTo.add(childService.id);\n    }\n\n    childService.onDone(function (doneEvent) {\n      _this.removeChild(childService.id);\n\n      _this.send(toSCXMLEvent(doneEvent, {\n        origin: childService.id\n      }));\n    }).start();\n    return actor;\n  };\n\n  Interpreter.prototype.spawnBehavior = function (behavior, id) {\n    var actorRef = spawnBehavior(behavior, {\n      id: id,\n      parent: this\n    });\n    this.children.set(id, actorRef);\n    return actorRef;\n  };\n\n  Interpreter.prototype.spawnPromise = function (promise, id) {\n    var _a;\n\n    var _this = this;\n\n    var canceled = false;\n    var resolvedData;\n    promise.then(function (response) {\n      if (!canceled) {\n        resolvedData = response;\n\n        _this.removeChild(id);\n\n        _this.send(toSCXMLEvent(doneInvoke(id, response), {\n          origin: id\n        }));\n      }\n    }, function (errorData) {\n      if (!canceled) {\n        _this.removeChild(id);\n\n        var errorEvent = error(id, errorData);\n\n        try {\n          // Send \"error.platform.id\" to this (parent).\n          _this.send(toSCXMLEvent(errorEvent, {\n            origin: id\n          }));\n        } catch (error) {\n          reportUnhandledExceptionOnInvocation(errorData, error, id);\n\n          if (_this.devTools) {\n            _this.devTools.send(errorEvent, _this.state);\n          }\n\n          if (_this.machine.strict) {\n            // it would be better to always stop the state machine if unhandled\n            // exception/promise rejection happens but because we don't want to\n            // break existing code so enforce it on strict mode only especially so\n            // because documentation says that onError is optional\n            _this.stop();\n          }\n        }\n      }\n    });\n    var actor = (_a = {\n      id: id,\n      send: function () {\n        return void 0;\n      },\n      subscribe: function (next, handleError, complete) {\n        var observer = toObserver(next, handleError, complete);\n        var unsubscribed = false;\n        promise.then(function (response) {\n          if (unsubscribed) {\n            return;\n          }\n\n          observer.next(response);\n\n          if (unsubscribed) {\n            return;\n          }\n\n          observer.complete();\n        }, function (err) {\n          if (unsubscribed) {\n            return;\n          }\n\n          observer.error(err);\n        });\n        return {\n          unsubscribe: function () {\n            return unsubscribed = true;\n          }\n        };\n      },\n      stop: function () {\n        canceled = true;\n      },\n      toJSON: function () {\n        return {\n          id: id\n        };\n      },\n      getSnapshot: function () {\n        return resolvedData;\n      }\n    }, _a[symbolObservable] = function () {\n      return this;\n    }, _a);\n    this.children.set(id, actor);\n    return actor;\n  };\n\n  Interpreter.prototype.spawnCallback = function (callback, id) {\n    var _a;\n\n    var _this = this;\n\n    var canceled = false;\n    var receivers = new Set();\n    var listeners = new Set();\n    var emitted;\n\n    var receive = function (e) {\n      emitted = e;\n      listeners.forEach(function (listener) {\n        return listener(e);\n      });\n\n      if (canceled) {\n        return;\n      }\n\n      _this.send(toSCXMLEvent(e, {\n        origin: id\n      }));\n    };\n\n    var callbackStop;\n\n    try {\n      callbackStop = callback(receive, function (newListener) {\n        receivers.add(newListener);\n      });\n    } catch (err) {\n      this.send(error(id, err));\n    }\n\n    if (isPromiseLike(callbackStop)) {\n      // it turned out to be an async function, can't reliably check this before calling `callback`\n      // because transpiled async functions are not recognizable\n      return this.spawnPromise(callbackStop, id);\n    }\n\n    var actor = (_a = {\n      id: id,\n      send: function (event) {\n        return receivers.forEach(function (receiver) {\n          return receiver(event);\n        });\n      },\n      subscribe: function (next) {\n        var observer = toObserver(next);\n        listeners.add(observer.next);\n        return {\n          unsubscribe: function () {\n            listeners.delete(observer.next);\n          }\n        };\n      },\n      stop: function () {\n        canceled = true;\n\n        if (isFunction(callbackStop)) {\n          callbackStop();\n        }\n      },\n      toJSON: function () {\n        return {\n          id: id\n        };\n      },\n      getSnapshot: function () {\n        return emitted;\n      }\n    }, _a[symbolObservable] = function () {\n      return this;\n    }, _a);\n    this.children.set(id, actor);\n    return actor;\n  };\n\n  Interpreter.prototype.spawnObservable = function (source, id) {\n    var _a;\n\n    var _this = this;\n\n    var emitted;\n    var subscription = source.subscribe(function (value) {\n      emitted = value;\n\n      _this.send(toSCXMLEvent(value, {\n        origin: id\n      }));\n    }, function (err) {\n      _this.removeChild(id);\n\n      _this.send(toSCXMLEvent(error(id, err), {\n        origin: id\n      }));\n    }, function () {\n      _this.removeChild(id);\n\n      _this.send(toSCXMLEvent(doneInvoke(id), {\n        origin: id\n      }));\n    });\n    var actor = (_a = {\n      id: id,\n      send: function () {\n        return void 0;\n      },\n      subscribe: function (next, handleError, complete) {\n        return source.subscribe(next, handleError, complete);\n      },\n      stop: function () {\n        return subscription.unsubscribe();\n      },\n      getSnapshot: function () {\n        return emitted;\n      },\n      toJSON: function () {\n        return {\n          id: id\n        };\n      }\n    }, _a[symbolObservable] = function () {\n      return this;\n    }, _a);\n    this.children.set(id, actor);\n    return actor;\n  };\n\n  Interpreter.prototype.spawnActor = function (actor, name) {\n    this.children.set(name, actor);\n    return actor;\n  };\n\n  Interpreter.prototype.spawnActivity = function (activity) {\n    var implementation = this.machine.options && this.machine.options.activities ? this.machine.options.activities[activity.type] : undefined;\n\n    if (!implementation) {\n      if (!IS_PRODUCTION) {\n        warn(false, \"No implementation found for activity '\".concat(activity.type, \"'\"));\n      } // tslint:disable-next-line:no-console\n\n\n      return;\n    } // Start implementation\n\n\n    var dispose = implementation(this.state.context, activity);\n    this.spawnEffect(activity.id, dispose);\n  };\n\n  Interpreter.prototype.spawnEffect = function (id, dispose) {\n    var _a;\n\n    this.children.set(id, (_a = {\n      id: id,\n      send: function () {\n        return void 0;\n      },\n      subscribe: function () {\n        return {\n          unsubscribe: function () {\n            return void 0;\n          }\n        };\n      },\n      stop: dispose || undefined,\n      getSnapshot: function () {\n        return undefined;\n      },\n      toJSON: function () {\n        return {\n          id: id\n        };\n      }\n    }, _a[symbolObservable] = function () {\n      return this;\n    }, _a));\n  };\n\n  Interpreter.prototype.attachDev = function () {\n    var global = getGlobal();\n\n    if (this.options.devTools && global) {\n      if (global.__REDUX_DEVTOOLS_EXTENSION__) {\n        var devToolsOptions = typeof this.options.devTools === 'object' ? this.options.devTools : undefined;\n        this.devTools = global.__REDUX_DEVTOOLS_EXTENSION__.connect(__assign(__assign({\n          name: this.id,\n          autoPause: true,\n          stateSanitizer: function (state) {\n            return {\n              value: state.value,\n              context: state.context,\n              actions: state.actions\n            };\n          }\n        }, devToolsOptions), {\n          features: __assign({\n            jump: false,\n            skip: false\n          }, devToolsOptions ? devToolsOptions.features : undefined)\n        }), this.machine);\n        this.devTools.init(this.state);\n      } // add XState-specific dev tooling hook\n\n\n      registerService(this);\n    }\n  };\n\n  Interpreter.prototype.toJSON = function () {\n    return {\n      id: this.id\n    };\n  };\n\n  Interpreter.prototype[symbolObservable] = function () {\n    return this;\n  };\n\n  Interpreter.prototype.getSnapshot = function () {\n    if (this.status === InterpreterStatus.NotStarted) {\n      return this.initialState;\n    }\n\n    return this._state;\n  };\n  /**\r\n   * The default interpreter options:\r\n   *\r\n   * - `clock` uses the global `setTimeout` and `clearTimeout` functions\r\n   * - `logger` uses the global `console.log()` method\r\n   */\n\n\n  Interpreter.defaultOptions = {\n    execute: true,\n    deferEvents: true,\n    clock: {\n      setTimeout: function (fn, ms) {\n        return setTimeout(fn, ms);\n      },\n      clearTimeout: function (id) {\n        return clearTimeout(id);\n      }\n    },\n    logger: /*#__PURE__*/console.log.bind(console),\n    devTools: false\n  };\n  Interpreter.interpret = interpret;\n  return Interpreter;\n}();\n\nvar resolveSpawnOptions = function (nameOrOptions) {\n  if (isString(nameOrOptions)) {\n    return __assign(__assign({}, DEFAULT_SPAWN_OPTIONS), {\n      name: nameOrOptions\n    });\n  }\n\n  return __assign(__assign(__assign({}, DEFAULT_SPAWN_OPTIONS), {\n    name: uniqueId()\n  }), nameOrOptions);\n};\n\nfunction spawn(entity, nameOrOptions) {\n  var resolvedOptions = resolveSpawnOptions(nameOrOptions);\n  return consume(function (service) {\n    if (!IS_PRODUCTION) {\n      var isLazyEntity = isMachine(entity) || isFunction(entity);\n      warn(!!service || isLazyEntity, \"Attempted to spawn an Actor (ID: \\\"\".concat(isMachine(entity) ? entity.id : 'undefined', \"\\\") outside of a service. This will have no effect.\"));\n    }\n\n    if (service) {\n      return service.spawn(entity, resolvedOptions.name, resolvedOptions);\n    } else {\n      return createDeferredActor(entity, resolvedOptions.name);\n    }\n  });\n}\n/**\r\n * Creates a new Interpreter instance for the given machine with the provided options, if any.\r\n *\r\n * @param machine The machine to interpret\r\n * @param options Interpreter options\r\n */\n\nfunction interpret(machine, options) {\n  var interpreter = new Interpreter(machine, options);\n  return interpreter;\n}\n\nexport { Interpreter, InterpreterStatus, interpret, spawn };\n","import { __assign, __rest } from './_virtual/_tslib.js';\nimport './types.js';\nimport { invoke } from './actionTypes.js';\nimport './utils.js';\nimport './environment.js';\n\nfunction toInvokeSource(src) {\n  if (typeof src === 'string') {\n    var simpleSrc = {\n      type: src\n    };\n\n    simpleSrc.toString = function () {\n      return src;\n    }; // v4 compat - TODO: remove in v5\n\n\n    return simpleSrc;\n  }\n\n  return src;\n}\nfunction toInvokeDefinition(invokeConfig) {\n  return __assign(__assign({\n    type: invoke\n  }, invokeConfig), {\n    toJSON: function () {\n      invokeConfig.onDone;\n          invokeConfig.onError;\n          var invokeDef = __rest(invokeConfig, [\"onDone\", \"onError\"]);\n\n      return __assign(__assign({}, invokeDef), {\n        type: invoke,\n        src: toInvokeSource(invokeConfig.src)\n      });\n    }\n  });\n}\n\nexport { toInvokeDefinition, toInvokeSource };\n","import { __assign, __spreadArray, __read, __values, __rest } from './_virtual/_tslib.js';\nimport { isFunction, mapValues, isArray, flatten, toArray, toStateValue, isString, getEventType, toSCXMLEvent, matchesState, path, evaluateGuard, mapContext, pathToStateValue, isBuiltInEvent, partition, updateHistoryValue, toStatePath, mapFilterValues, warn, toStatePaths, nestedPath, normalizeTarget, toGuard, toTransitionConfigArray, isMachine, createInvokeId } from './utils.js';\nimport { SpecialTargets } from './types.js';\nimport { State, stateValuesEqual } from './State.js';\nimport { raise as raise$1, send, start as start$1, stop as stop$1, invoke, update, nullEvent } from './actionTypes.js';\nimport { done, start, toActionObjects, raise, stop, resolveActions, doneInvoke, error, toActionObject, toActivityDefinition, after, send as send$1, cancel, initEvent } from './actions.js';\nimport { IS_PRODUCTION } from './environment.js';\nimport { STATE_DELIMITER } from './constants.js';\nimport { getAllStateNodes, getConfiguration, isInFinalState, getTagsFromConfiguration, has, getChildren, getValue, isLeafNode, getAllChildren } from './stateUtils.js';\nimport { createInvocableActor } from './Actor.js';\nimport { toInvokeDefinition } from './invokeUtils.js';\n\nvar NULL_EVENT = '';\nvar STATE_IDENTIFIER = '#';\nvar WILDCARD = '*';\nvar EMPTY_OBJECT = {};\n\nvar isStateId = function (str) {\n  return str[0] === STATE_IDENTIFIER;\n};\n\nvar createDefaultOptions = function () {\n  return {\n    actions: {},\n    guards: {},\n    services: {},\n    activities: {},\n    delays: {}\n  };\n};\n\nvar validateArrayifiedTransitions = function (stateNode, event, transitions) {\n  var hasNonLastUnguardedTarget = transitions.slice(0, -1).some(function (transition) {\n    return !('cond' in transition) && !('in' in transition) && (isString(transition.target) || isMachine(transition.target));\n  });\n  var eventText = event === NULL_EVENT ? 'the transient event' : \"event '\".concat(event, \"'\");\n  warn(!hasNonLastUnguardedTarget, \"One or more transitions for \".concat(eventText, \" on state '\").concat(stateNode.id, \"' are unreachable. \") + \"Make sure that the default transition is the last one defined.\");\n};\n\nvar StateNode =\n/*#__PURE__*/\n\n/** @class */\nfunction () {\n  function StateNode(\n  /**\r\n   * The raw config used to create the machine.\r\n   */\n  config, options,\n  /**\r\n   * The initial extended state\r\n   */\n  _context, // TODO: this is unsafe, but we're removing it in v5 anyway\n  _stateInfo) {\n    if (_context === void 0) {\n      _context = 'context' in config ? config.context : undefined;\n    }\n\n    var _this = this;\n\n    var _a;\n\n    this.config = config;\n    this._context = _context;\n    /**\r\n     * The order this state node appears. Corresponds to the implicit SCXML document order.\r\n     */\n\n    this.order = -1;\n    this.__xstatenode = true;\n    this.__cache = {\n      events: undefined,\n      relativeValue: new Map(),\n      initialStateValue: undefined,\n      initialState: undefined,\n      on: undefined,\n      transitions: undefined,\n      candidates: {},\n      delayedTransitions: undefined\n    };\n    this.idMap = {};\n    this.tags = [];\n    this.options = Object.assign(createDefaultOptions(), options);\n    this.parent = _stateInfo === null || _stateInfo === void 0 ? void 0 : _stateInfo.parent;\n    this.key = this.config.key || (_stateInfo === null || _stateInfo === void 0 ? void 0 : _stateInfo.key) || this.config.id || '(machine)';\n    this.machine = this.parent ? this.parent.machine : this;\n    this.path = this.parent ? this.parent.path.concat(this.key) : [];\n    this.delimiter = this.config.delimiter || (this.parent ? this.parent.delimiter : STATE_DELIMITER);\n    this.id = this.config.id || __spreadArray([this.machine.key], __read(this.path), false).join(this.delimiter);\n    this.version = this.parent ? this.parent.version : this.config.version;\n    this.type = this.config.type || (this.config.parallel ? 'parallel' : this.config.states && Object.keys(this.config.states).length ? 'compound' : this.config.history ? 'history' : 'atomic');\n    this.schema = this.parent ? this.machine.schema : (_a = this.config.schema) !== null && _a !== void 0 ? _a : {};\n    this.description = this.config.description;\n\n    if (!IS_PRODUCTION) {\n      warn(!('parallel' in this.config), \"The \\\"parallel\\\" property is deprecated and will be removed in version 4.1. \".concat(this.config.parallel ? \"Replace with `type: 'parallel'`\" : \"Use `type: '\".concat(this.type, \"'`\"), \" in the config for state node '\").concat(this.id, \"' instead.\"));\n    }\n\n    this.initial = this.config.initial;\n    this.states = this.config.states ? mapValues(this.config.states, function (stateConfig, key) {\n      var _a;\n\n      var stateNode = new StateNode(stateConfig, {}, undefined, {\n        parent: _this,\n        key: key\n      });\n      Object.assign(_this.idMap, __assign((_a = {}, _a[stateNode.id] = stateNode, _a), stateNode.idMap));\n      return stateNode;\n    }) : EMPTY_OBJECT; // Document order\n\n    var order = 0;\n\n    function dfs(stateNode) {\n      var e_1, _a;\n\n      stateNode.order = order++;\n\n      try {\n        for (var _b = __values(getAllChildren(stateNode)), _c = _b.next(); !_c.done; _c = _b.next()) {\n          var child = _c.value;\n          dfs(child);\n        }\n      } catch (e_1_1) {\n        e_1 = {\n          error: e_1_1\n        };\n      } finally {\n        try {\n          if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n        } finally {\n          if (e_1) throw e_1.error;\n        }\n      }\n    }\n\n    dfs(this); // History config\n\n    this.history = this.config.history === true ? 'shallow' : this.config.history || false;\n    this._transient = !!this.config.always || (!this.config.on ? false : Array.isArray(this.config.on) ? this.config.on.some(function (_a) {\n      var event = _a.event;\n      return event === NULL_EVENT;\n    }) : NULL_EVENT in this.config.on);\n    this.strict = !!this.config.strict; // TODO: deprecate (entry)\n\n    this.onEntry = toArray(this.config.entry || this.config.onEntry).map(function (action) {\n      return toActionObject(action);\n    }); // TODO: deprecate (exit)\n\n    this.onExit = toArray(this.config.exit || this.config.onExit).map(function (action) {\n      return toActionObject(action);\n    });\n    this.meta = this.config.meta;\n    this.doneData = this.type === 'final' ? this.config.data : undefined;\n    this.invoke = toArray(this.config.invoke).map(function (invokeConfig, i) {\n      var _a, _b;\n\n      if (isMachine(invokeConfig)) {\n        var invokeId = createInvokeId(_this.id, i);\n        _this.machine.options.services = __assign((_a = {}, _a[invokeId] = invokeConfig, _a), _this.machine.options.services);\n        return toInvokeDefinition({\n          src: invokeId,\n          id: invokeId\n        });\n      } else if (isString(invokeConfig.src)) {\n        var invokeId = invokeConfig.id || createInvokeId(_this.id, i);\n        return toInvokeDefinition(__assign(__assign({}, invokeConfig), {\n          id: invokeId,\n          src: invokeConfig.src\n        }));\n      } else if (isMachine(invokeConfig.src) || isFunction(invokeConfig.src)) {\n        var invokeId = invokeConfig.id || createInvokeId(_this.id, i);\n        _this.machine.options.services = __assign((_b = {}, _b[invokeId] = invokeConfig.src, _b), _this.machine.options.services);\n        return toInvokeDefinition(__assign(__assign({\n          id: invokeId\n        }, invokeConfig), {\n          src: invokeId\n        }));\n      } else {\n        var invokeSource = invokeConfig.src;\n        return toInvokeDefinition(__assign(__assign({\n          id: createInvokeId(_this.id, i)\n        }, invokeConfig), {\n          src: invokeSource\n        }));\n      }\n    });\n    this.activities = toArray(this.config.activities).concat(this.invoke).map(function (activity) {\n      return toActivityDefinition(activity);\n    });\n    this.transition = this.transition.bind(this);\n    this.tags = toArray(this.config.tags); // TODO: this is the real fix for initialization once\n    // state node getters are deprecated\n    // if (!this.parent) {\n    //   this._init();\n    // }\n  }\n\n  StateNode.prototype._init = function () {\n    if (this.__cache.transitions) {\n      return;\n    }\n\n    getAllStateNodes(this).forEach(function (stateNode) {\n      return stateNode.on;\n    });\n  };\n  /**\r\n   * Clones this state machine with custom options and context.\r\n   *\r\n   * @param options Options (actions, guards, activities, services) to recursively merge with the existing options.\r\n   * @param context Custom context (will override predefined context)\r\n   */\n\n\n  StateNode.prototype.withConfig = function (options, context) {\n    var _a = this.options,\n        actions = _a.actions,\n        activities = _a.activities,\n        guards = _a.guards,\n        services = _a.services,\n        delays = _a.delays;\n    return new StateNode(this.config, {\n      actions: __assign(__assign({}, actions), options.actions),\n      activities: __assign(__assign({}, activities), options.activities),\n      guards: __assign(__assign({}, guards), options.guards),\n      services: __assign(__assign({}, services), options.services),\n      delays: __assign(__assign({}, delays), options.delays)\n    }, context !== null && context !== void 0 ? context : this.context);\n  };\n  /**\r\n   * Clones this state machine with custom context.\r\n   *\r\n   * @param context Custom context (will override predefined context, not recursive)\r\n   */\n\n\n  StateNode.prototype.withContext = function (context) {\n    return new StateNode(this.config, this.options, context);\n  };\n\n  Object.defineProperty(StateNode.prototype, \"context\", {\n    get: function () {\n      return isFunction(this._context) ? this._context() : this._context;\n    },\n    enumerable: false,\n    configurable: true\n  });\n  Object.defineProperty(StateNode.prototype, \"definition\", {\n    /**\r\n     * The well-structured state node definition.\r\n     */\n    get: function () {\n      return {\n        id: this.id,\n        key: this.key,\n        version: this.version,\n        context: this.context,\n        type: this.type,\n        initial: this.initial,\n        history: this.history,\n        states: mapValues(this.states, function (state) {\n          return state.definition;\n        }),\n        on: this.on,\n        transitions: this.transitions,\n        entry: this.onEntry,\n        exit: this.onExit,\n        activities: this.activities || [],\n        meta: this.meta,\n        order: this.order || -1,\n        data: this.doneData,\n        invoke: this.invoke,\n        description: this.description,\n        tags: this.tags\n      };\n    },\n    enumerable: false,\n    configurable: true\n  });\n\n  StateNode.prototype.toJSON = function () {\n    return this.definition;\n  };\n\n  Object.defineProperty(StateNode.prototype, \"on\", {\n    /**\r\n     * The mapping of events to transitions.\r\n     */\n    get: function () {\n      if (this.__cache.on) {\n        return this.__cache.on;\n      }\n\n      var transitions = this.transitions;\n      return this.__cache.on = transitions.reduce(function (map, transition) {\n        map[transition.eventType] = map[transition.eventType] || [];\n        map[transition.eventType].push(transition);\n        return map;\n      }, {});\n    },\n    enumerable: false,\n    configurable: true\n  });\n  Object.defineProperty(StateNode.prototype, \"after\", {\n    get: function () {\n      return this.__cache.delayedTransitions || (this.__cache.delayedTransitions = this.getDelayedTransitions(), this.__cache.delayedTransitions);\n    },\n    enumerable: false,\n    configurable: true\n  });\n  Object.defineProperty(StateNode.prototype, \"transitions\", {\n    /**\r\n     * All the transitions that can be taken from this state node.\r\n     */\n    get: function () {\n      return this.__cache.transitions || (this.__cache.transitions = this.formatTransitions(), this.__cache.transitions);\n    },\n    enumerable: false,\n    configurable: true\n  });\n\n  StateNode.prototype.getCandidates = function (eventName) {\n    if (this.__cache.candidates[eventName]) {\n      return this.__cache.candidates[eventName];\n    }\n\n    var transient = eventName === NULL_EVENT;\n    var candidates = this.transitions.filter(function (transition) {\n      var sameEventType = transition.eventType === eventName; // null events should only match against eventless transitions\n\n      return transient ? sameEventType : sameEventType || transition.eventType === WILDCARD;\n    });\n    this.__cache.candidates[eventName] = candidates;\n    return candidates;\n  };\n  /**\r\n   * All delayed transitions from the config.\r\n   */\n\n\n  StateNode.prototype.getDelayedTransitions = function () {\n    var _this = this;\n\n    var afterConfig = this.config.after;\n\n    if (!afterConfig) {\n      return [];\n    }\n\n    var mutateEntryExit = function (delay, i) {\n      var delayRef = isFunction(delay) ? \"\".concat(_this.id, \":delay[\").concat(i, \"]\") : delay;\n      var eventType = after(delayRef, _this.id);\n\n      _this.onEntry.push(send$1(eventType, {\n        delay: delay\n      }));\n\n      _this.onExit.push(cancel(eventType));\n\n      return eventType;\n    };\n\n    var delayedTransitions = isArray(afterConfig) ? afterConfig.map(function (transition, i) {\n      var eventType = mutateEntryExit(transition.delay, i);\n      return __assign(__assign({}, transition), {\n        event: eventType\n      });\n    }) : flatten(Object.keys(afterConfig).map(function (delay, i) {\n      var configTransition = afterConfig[delay];\n      var resolvedTransition = isString(configTransition) ? {\n        target: configTransition\n      } : configTransition;\n      var resolvedDelay = !isNaN(+delay) ? +delay : delay;\n      var eventType = mutateEntryExit(resolvedDelay, i);\n      return toArray(resolvedTransition).map(function (transition) {\n        return __assign(__assign({}, transition), {\n          event: eventType,\n          delay: resolvedDelay\n        });\n      });\n    }));\n    return delayedTransitions.map(function (delayedTransition) {\n      var delay = delayedTransition.delay;\n      return __assign(__assign({}, _this.formatTransition(delayedTransition)), {\n        delay: delay\n      });\n    });\n  };\n  /**\r\n   * Returns the state nodes represented by the current state value.\r\n   *\r\n   * @param state The state value or State instance\r\n   */\n\n\n  StateNode.prototype.getStateNodes = function (state) {\n    var _a;\n\n    var _this = this;\n\n    if (!state) {\n      return [];\n    }\n\n    var stateValue = state instanceof State ? state.value : toStateValue(state, this.delimiter);\n\n    if (isString(stateValue)) {\n      var initialStateValue = this.getStateNode(stateValue).initial;\n      return initialStateValue !== undefined ? this.getStateNodes((_a = {}, _a[stateValue] = initialStateValue, _a)) : [this, this.states[stateValue]];\n    }\n\n    var subStateKeys = Object.keys(stateValue);\n    var subStateNodes = [this];\n    subStateNodes.push.apply(subStateNodes, __spreadArray([], __read(flatten(subStateKeys.map(function (subStateKey) {\n      return _this.getStateNode(subStateKey).getStateNodes(stateValue[subStateKey]);\n    }))), false));\n    return subStateNodes;\n  };\n  /**\r\n   * Returns `true` if this state node explicitly handles the given event.\r\n   *\r\n   * @param event The event in question\r\n   */\n\n\n  StateNode.prototype.handles = function (event) {\n    var eventType = getEventType(event);\n    return this.events.includes(eventType);\n  };\n  /**\r\n   * Resolves the given `state` to a new `State` instance relative to this machine.\r\n   *\r\n   * This ensures that `.events` and `.nextEvents` represent the correct values.\r\n   *\r\n   * @param state The state to resolve\r\n   */\n\n\n  StateNode.prototype.resolveState = function (state) {\n    var stateFromConfig = state instanceof State ? state : State.create(state);\n    var configuration = Array.from(getConfiguration([], this.getStateNodes(stateFromConfig.value)));\n    return new State(__assign(__assign({}, stateFromConfig), {\n      value: this.resolve(stateFromConfig.value),\n      configuration: configuration,\n      done: isInFinalState(configuration, this),\n      tags: getTagsFromConfiguration(configuration),\n      machine: this.machine\n    }));\n  };\n\n  StateNode.prototype.transitionLeafNode = function (stateValue, state, _event) {\n    var stateNode = this.getStateNode(stateValue);\n    var next = stateNode.next(state, _event);\n\n    if (!next || !next.transitions.length) {\n      return this.next(state, _event);\n    }\n\n    return next;\n  };\n\n  StateNode.prototype.transitionCompoundNode = function (stateValue, state, _event) {\n    var subStateKeys = Object.keys(stateValue);\n    var stateNode = this.getStateNode(subStateKeys[0]);\n\n    var next = stateNode._transition(stateValue[subStateKeys[0]], state, _event);\n\n    if (!next || !next.transitions.length) {\n      return this.next(state, _event);\n    }\n\n    return next;\n  };\n\n  StateNode.prototype.transitionParallelNode = function (stateValue, state, _event) {\n    var e_2, _a;\n\n    var transitionMap = {};\n\n    try {\n      for (var _b = __values(Object.keys(stateValue)), _c = _b.next(); !_c.done; _c = _b.next()) {\n        var subStateKey = _c.value;\n        var subStateValue = stateValue[subStateKey];\n\n        if (!subStateValue) {\n          continue;\n        }\n\n        var subStateNode = this.getStateNode(subStateKey);\n\n        var next = subStateNode._transition(subStateValue, state, _event);\n\n        if (next) {\n          transitionMap[subStateKey] = next;\n        }\n      }\n    } catch (e_2_1) {\n      e_2 = {\n        error: e_2_1\n      };\n    } finally {\n      try {\n        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n      } finally {\n        if (e_2) throw e_2.error;\n      }\n    }\n\n    var stateTransitions = Object.keys(transitionMap).map(function (key) {\n      return transitionMap[key];\n    });\n    var enabledTransitions = flatten(stateTransitions.map(function (st) {\n      return st.transitions;\n    }));\n    var willTransition = stateTransitions.some(function (st) {\n      return st.transitions.length > 0;\n    });\n\n    if (!willTransition) {\n      return this.next(state, _event);\n    }\n\n    var entryNodes = flatten(stateTransitions.map(function (t) {\n      return t.entrySet;\n    }));\n    var configuration = flatten(Object.keys(transitionMap).map(function (key) {\n      return transitionMap[key].configuration;\n    }));\n    return {\n      transitions: enabledTransitions,\n      entrySet: entryNodes,\n      exitSet: flatten(stateTransitions.map(function (t) {\n        return t.exitSet;\n      })),\n      configuration: configuration,\n      source: state,\n      actions: flatten(Object.keys(transitionMap).map(function (key) {\n        return transitionMap[key].actions;\n      }))\n    };\n  };\n\n  StateNode.prototype._transition = function (stateValue, state, _event) {\n    // leaf node\n    if (isString(stateValue)) {\n      return this.transitionLeafNode(stateValue, state, _event);\n    } // hierarchical node\n\n\n    if (Object.keys(stateValue).length === 1) {\n      return this.transitionCompoundNode(stateValue, state, _event);\n    } // orthogonal node\n\n\n    return this.transitionParallelNode(stateValue, state, _event);\n  };\n\n  StateNode.prototype.getTransitionData = function (state, event) {\n    return this._transition(state.value, state, toSCXMLEvent(event));\n  };\n\n  StateNode.prototype.next = function (state, _event) {\n    var e_3, _a;\n\n    var _this = this;\n\n    var eventName = _event.name;\n    var actions = [];\n    var nextStateNodes = [];\n    var selectedTransition;\n\n    try {\n      for (var _b = __values(this.getCandidates(eventName)), _c = _b.next(); !_c.done; _c = _b.next()) {\n        var candidate = _c.value;\n        var cond = candidate.cond,\n            stateIn = candidate.in;\n        var resolvedContext = state.context;\n        var isInState = stateIn ? isString(stateIn) && isStateId(stateIn) ? // Check if in state by ID\n        state.matches(toStateValue(this.getStateNodeById(stateIn).path, this.delimiter)) : // Check if in state by relative grandparent\n        matchesState(toStateValue(stateIn, this.delimiter), path(this.path.slice(0, -2))(state.value)) : true;\n        var guardPassed = false;\n\n        try {\n          guardPassed = !cond || evaluateGuard(this.machine, cond, resolvedContext, _event, state);\n        } catch (err) {\n          throw new Error(\"Unable to evaluate guard '\".concat(cond.name || cond.type, \"' in transition for event '\").concat(eventName, \"' in state node '\").concat(this.id, \"':\\n\").concat(err.message));\n        }\n\n        if (guardPassed && isInState) {\n          if (candidate.target !== undefined) {\n            nextStateNodes = candidate.target;\n          }\n\n          actions.push.apply(actions, __spreadArray([], __read(candidate.actions), false));\n          selectedTransition = candidate;\n          break;\n        }\n      }\n    } catch (e_3_1) {\n      e_3 = {\n        error: e_3_1\n      };\n    } finally {\n      try {\n        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n      } finally {\n        if (e_3) throw e_3.error;\n      }\n    }\n\n    if (!selectedTransition) {\n      return undefined;\n    }\n\n    if (!nextStateNodes.length) {\n      return {\n        transitions: [selectedTransition],\n        entrySet: [],\n        exitSet: [],\n        configuration: state.value ? [this] : [],\n        source: state,\n        actions: actions\n      };\n    }\n\n    var allNextStateNodes = flatten(nextStateNodes.map(function (stateNode) {\n      return _this.getRelativeStateNodes(stateNode, state.historyValue);\n    }));\n    var isInternal = !!selectedTransition.internal;\n    var reentryNodes = [];\n\n    if (!isInternal) {\n      nextStateNodes.forEach(function (targetNode) {\n        reentryNodes.push.apply(reentryNodes, __spreadArray([], __read(_this.getExternalReentryNodes(targetNode)), false));\n      });\n    }\n\n    return {\n      transitions: [selectedTransition],\n      entrySet: reentryNodes,\n      exitSet: isInternal ? [] : [this],\n      configuration: allNextStateNodes,\n      source: state,\n      actions: actions\n    };\n  };\n\n  StateNode.prototype.getExternalReentryNodes = function (targetNode) {\n    var nodes = [];\n\n    var _a = __read(targetNode.order > this.order ? [targetNode, this] : [this, targetNode], 2),\n        marker = _a[0],\n        possibleAncestor = _a[1];\n\n    while (marker && marker !== possibleAncestor) {\n      nodes.push(marker);\n      marker = marker.parent;\n    }\n\n    if (marker !== possibleAncestor) {\n      // we never got to `possibleAncestor`, therefore the initial `marker` \"escapes\" it\n      // it's in a different part of the tree so no states will be reentered for such an external transition\n      return [];\n    }\n\n    nodes.push(possibleAncestor);\n    return nodes;\n  };\n\n  StateNode.prototype.getActions = function (resolvedConfig, isDone, transition, currentContext, _event, prevState, predictableExec) {\n    var e_4, _a, e_5, _b;\n\n    var _this = this;\n\n    var prevConfig = getConfiguration([], prevState ? this.getStateNodes(prevState.value) : [this]);\n\n    try {\n      for (var resolvedConfig_1 = __values(resolvedConfig), resolvedConfig_1_1 = resolvedConfig_1.next(); !resolvedConfig_1_1.done; resolvedConfig_1_1 = resolvedConfig_1.next()) {\n        var sn = resolvedConfig_1_1.value;\n\n        if (!has(prevConfig, sn) || has(transition.entrySet, sn.parent)) {\n          transition.entrySet.push(sn);\n        }\n      }\n    } catch (e_4_1) {\n      e_4 = {\n        error: e_4_1\n      };\n    } finally {\n      try {\n        if (resolvedConfig_1_1 && !resolvedConfig_1_1.done && (_a = resolvedConfig_1.return)) _a.call(resolvedConfig_1);\n      } finally {\n        if (e_4) throw e_4.error;\n      }\n    }\n\n    try {\n      for (var prevConfig_1 = __values(prevConfig), prevConfig_1_1 = prevConfig_1.next(); !prevConfig_1_1.done; prevConfig_1_1 = prevConfig_1.next()) {\n        var sn = prevConfig_1_1.value;\n\n        if (!has(resolvedConfig, sn) || has(transition.exitSet, sn.parent)) {\n          transition.exitSet.push(sn);\n        }\n      }\n    } catch (e_5_1) {\n      e_5 = {\n        error: e_5_1\n      };\n    } finally {\n      try {\n        if (prevConfig_1_1 && !prevConfig_1_1.done && (_b = prevConfig_1.return)) _b.call(prevConfig_1);\n      } finally {\n        if (e_5) throw e_5.error;\n      }\n    }\n\n    var doneEvents = flatten(transition.entrySet.map(function (sn) {\n      var events = [];\n\n      if (sn.type !== 'final') {\n        return events;\n      }\n\n      var parent = sn.parent;\n\n      if (!parent.parent) {\n        return events;\n      }\n\n      events.push(done(sn.id, sn.doneData), // TODO: deprecate - final states should not emit done events for their own state.\n      done(parent.id, sn.doneData ? mapContext(sn.doneData, currentContext, _event) : undefined));\n      var grandparent = parent.parent;\n\n      if (grandparent.type === 'parallel') {\n        if (getChildren(grandparent).every(function (parentNode) {\n          return isInFinalState(transition.configuration, parentNode);\n        })) {\n          events.push(done(grandparent.id));\n        }\n      }\n\n      return events;\n    }));\n    transition.exitSet.sort(function (a, b) {\n      return b.order - a.order;\n    });\n    transition.entrySet.sort(function (a, b) {\n      return a.order - b.order;\n    });\n    var entryStates = new Set(transition.entrySet);\n    var exitStates = new Set(transition.exitSet);\n    var entryActions = Array.from(entryStates).map(function (stateNode) {\n      var entryActions = stateNode.onEntry;\n      var invokeActions = stateNode.activities.map(function (activity) {\n        return start(activity);\n      });\n      return toActionObjects(predictableExec ? __spreadArray(__spreadArray([], __read(entryActions), false), __read(invokeActions), false) : __spreadArray(__spreadArray([], __read(invokeActions), false), __read(entryActions), false), _this.machine.options.actions);\n    }).concat([doneEvents.map(raise)]);\n    var exitActions = Array.from(exitStates).map(function (stateNode) {\n      return toActionObjects(__spreadArray(__spreadArray([], __read(stateNode.onExit), false), __read(stateNode.activities.map(function (activity) {\n        return stop(activity);\n      })), false), _this.machine.options.actions);\n    });\n    var actions = exitActions.concat([toActionObjects(transition.actions, this.machine.options.actions)]).concat(entryActions);\n\n    if (isDone) {\n      var stopActions = toActionObjects(flatten(__spreadArray([], __read(resolvedConfig), false).sort(function (a, b) {\n        return b.order - a.order;\n      }).map(function (stateNode) {\n        return stateNode.onExit;\n      })), this.machine.options.actions).filter(function (action) {\n        return action.type !== raise$1 && (action.type !== send || !!action.to && action.to !== SpecialTargets.Internal);\n      });\n      return actions.concat([stopActions]);\n    }\n\n    return actions;\n  };\n  /**\r\n   * Determines the next state given the current `state` and sent `event`.\r\n   *\r\n   * @param state The current State instance or state value\r\n   * @param event The event that was sent at the current state\r\n   * @param context The current context (extended state) of the current state\r\n   */\n\n\n  StateNode.prototype.transition = function (state, event, context, exec) {\n    if (state === void 0) {\n      state = this.initialState;\n    }\n\n    var _event = toSCXMLEvent(event);\n\n    var currentState;\n\n    if (state instanceof State) {\n      currentState = context === undefined ? state : this.resolveState(State.from(state, context));\n    } else {\n      var resolvedStateValue = isString(state) ? this.resolve(pathToStateValue(this.getResolvedPath(state))) : this.resolve(state);\n      var resolvedContext = context !== null && context !== void 0 ? context : this.machine.context;\n      currentState = this.resolveState(State.from(resolvedStateValue, resolvedContext));\n    }\n\n    if (!IS_PRODUCTION && _event.name === WILDCARD) {\n      throw new Error(\"An event cannot have the wildcard type ('\".concat(WILDCARD, \"')\"));\n    }\n\n    if (this.strict) {\n      if (!this.events.includes(_event.name) && !isBuiltInEvent(_event.name)) {\n        throw new Error(\"Machine '\".concat(this.id, \"' does not accept event '\").concat(_event.name, \"'\"));\n      }\n    }\n\n    var stateTransition = this._transition(currentState.value, currentState, _event) || {\n      transitions: [],\n      configuration: [],\n      entrySet: [],\n      exitSet: [],\n      source: currentState,\n      actions: []\n    };\n    var prevConfig = getConfiguration([], this.getStateNodes(currentState.value));\n    var resolvedConfig = stateTransition.configuration.length ? getConfiguration(prevConfig, stateTransition.configuration) : prevConfig;\n    stateTransition.configuration = __spreadArray([], __read(resolvedConfig), false);\n    return this.resolveTransition(stateTransition, currentState, currentState.context, exec, _event);\n  };\n\n  StateNode.prototype.resolveRaisedTransition = function (state, _event, originalEvent, predictableExec) {\n    var _a;\n\n    var currentActions = state.actions;\n    state = this.transition(state, _event, undefined, predictableExec); // Save original event to state\n    // TODO: this should be the raised event! Delete in V5 (breaking)\n\n    state._event = originalEvent;\n    state.event = originalEvent.data;\n\n    (_a = state.actions).unshift.apply(_a, __spreadArray([], __read(currentActions), false));\n\n    return state;\n  };\n\n  StateNode.prototype.resolveTransition = function (stateTransition, currentState, context, predictableExec, _event) {\n    var e_6, _a, e_7, _b;\n\n    var _this = this;\n\n    if (_event === void 0) {\n      _event = initEvent;\n    }\n\n    var configuration = stateTransition.configuration; // Transition will \"apply\" if:\n    // - this is the initial state (there is no current state)\n    // - OR there are transitions\n\n    var willTransition = !currentState || stateTransition.transitions.length > 0;\n    var resolvedConfiguration = willTransition ? stateTransition.configuration : currentState ? currentState.configuration : [];\n    var isDone = isInFinalState(resolvedConfiguration, this);\n    var resolvedStateValue = willTransition ? getValue(this.machine, configuration) : undefined;\n    var historyValue = currentState ? currentState.historyValue ? currentState.historyValue : stateTransition.source ? this.machine.historyValue(currentState.value) : undefined : undefined;\n    var actionBlocks = this.getActions(new Set(resolvedConfiguration), isDone, stateTransition, context, _event, currentState, predictableExec);\n    var activities = currentState ? __assign({}, currentState.activities) : {};\n\n    try {\n      for (var actionBlocks_1 = __values(actionBlocks), actionBlocks_1_1 = actionBlocks_1.next(); !actionBlocks_1_1.done; actionBlocks_1_1 = actionBlocks_1.next()) {\n        var block = actionBlocks_1_1.value;\n\n        try {\n          for (var block_1 = (e_7 = void 0, __values(block)), block_1_1 = block_1.next(); !block_1_1.done; block_1_1 = block_1.next()) {\n            var action = block_1_1.value;\n\n            if (action.type === start$1) {\n              activities[action.activity.id || action.activity.type] = action;\n            } else if (action.type === stop$1) {\n              activities[action.activity.id || action.activity.type] = false;\n            }\n          }\n        } catch (e_7_1) {\n          e_7 = {\n            error: e_7_1\n          };\n        } finally {\n          try {\n            if (block_1_1 && !block_1_1.done && (_b = block_1.return)) _b.call(block_1);\n          } finally {\n            if (e_7) throw e_7.error;\n          }\n        }\n      }\n    } catch (e_6_1) {\n      e_6 = {\n        error: e_6_1\n      };\n    } finally {\n      try {\n        if (actionBlocks_1_1 && !actionBlocks_1_1.done && (_a = actionBlocks_1.return)) _a.call(actionBlocks_1);\n      } finally {\n        if (e_6) throw e_6.error;\n      }\n    }\n\n    var _c = __read(resolveActions(this, currentState, context, _event, actionBlocks, predictableExec, this.machine.config.predictableActionArguments || this.machine.config.preserveActionOrder), 2),\n        resolvedActions = _c[0],\n        updatedContext = _c[1];\n\n    var _d = __read(partition(resolvedActions, function (action) {\n      return action.type === raise$1 || action.type === send && action.to === SpecialTargets.Internal;\n    }), 2),\n        raisedEvents = _d[0],\n        nonRaisedActions = _d[1];\n\n    var invokeActions = resolvedActions.filter(function (action) {\n      var _a;\n\n      return action.type === start$1 && ((_a = action.activity) === null || _a === void 0 ? void 0 : _a.type) === invoke;\n    });\n    var children = invokeActions.reduce(function (acc, action) {\n      acc[action.activity.id] = createInvocableActor(action.activity, _this.machine, updatedContext, _event);\n      return acc;\n    }, currentState ? __assign({}, currentState.children) : {});\n    var nextState = new State({\n      value: resolvedStateValue || currentState.value,\n      context: updatedContext,\n      _event: _event,\n      // Persist _sessionid between states\n      _sessionid: currentState ? currentState._sessionid : null,\n      historyValue: resolvedStateValue ? historyValue ? updateHistoryValue(historyValue, resolvedStateValue) : undefined : currentState ? currentState.historyValue : undefined,\n      history: !resolvedStateValue || stateTransition.source ? currentState : undefined,\n      actions: resolvedStateValue ? nonRaisedActions : [],\n      activities: resolvedStateValue ? activities : currentState ? currentState.activities : {},\n      events: [],\n      configuration: resolvedConfiguration,\n      transitions: stateTransition.transitions,\n      children: children,\n      done: isDone,\n      tags: getTagsFromConfiguration(resolvedConfiguration),\n      machine: this\n    });\n    var didUpdateContext = context !== updatedContext;\n    nextState.changed = _event.name === update || didUpdateContext; // Dispose of penultimate histories to prevent memory leaks\n\n    var history = nextState.history;\n\n    if (history) {\n      delete history.history;\n    } // There are transient transitions if the machine is not in a final state\n    // and if some of the state nodes have transient (\"always\") transitions.\n\n\n    var hasAlwaysTransitions = !isDone && (this._transient || configuration.some(function (stateNode) {\n      return stateNode._transient;\n    })); // If there are no enabled transitions, check if there are transient transitions.\n    // If there are transient transitions, continue checking for more transitions\n    // because an transient transition should be triggered even if there are no\n    // enabled transitions.\n    //\n    // If we're already working on an transient transition then stop to prevent an infinite loop.\n    //\n    // Otherwise, if there are no enabled nor transient transitions, we are done.\n\n    if (!willTransition && (!hasAlwaysTransitions || _event.name === NULL_EVENT)) {\n      return nextState;\n    }\n\n    var maybeNextState = nextState;\n\n    if (!isDone) {\n      if (hasAlwaysTransitions) {\n        maybeNextState = this.resolveRaisedTransition(maybeNextState, {\n          type: nullEvent\n        }, _event, predictableExec);\n      }\n\n      while (raisedEvents.length) {\n        var raisedEvent = raisedEvents.shift();\n        maybeNextState = this.resolveRaisedTransition(maybeNextState, raisedEvent._event, _event, predictableExec);\n      }\n    } // Detect if state changed\n\n\n    var changed = maybeNextState.changed || (history ? !!maybeNextState.actions.length || didUpdateContext || typeof history.value !== typeof maybeNextState.value || !stateValuesEqual(maybeNextState.value, history.value) : undefined);\n    maybeNextState.changed = changed; // Preserve original history after raised events\n\n    maybeNextState.history = history;\n    return maybeNextState;\n  };\n  /**\r\n   * Returns the child state node from its relative `stateKey`, or throws.\r\n   */\n\n\n  StateNode.prototype.getStateNode = function (stateKey) {\n    if (isStateId(stateKey)) {\n      return this.machine.getStateNodeById(stateKey);\n    }\n\n    if (!this.states) {\n      throw new Error(\"Unable to retrieve child state '\".concat(stateKey, \"' from '\").concat(this.id, \"'; no child states exist.\"));\n    }\n\n    var result = this.states[stateKey];\n\n    if (!result) {\n      throw new Error(\"Child state '\".concat(stateKey, \"' does not exist on '\").concat(this.id, \"'\"));\n    }\n\n    return result;\n  };\n  /**\r\n   * Returns the state node with the given `stateId`, or throws.\r\n   *\r\n   * @param stateId The state ID. The prefix \"#\" is removed.\r\n   */\n\n\n  StateNode.prototype.getStateNodeById = function (stateId) {\n    var resolvedStateId = isStateId(stateId) ? stateId.slice(STATE_IDENTIFIER.length) : stateId;\n\n    if (resolvedStateId === this.id) {\n      return this;\n    }\n\n    var stateNode = this.machine.idMap[resolvedStateId];\n\n    if (!stateNode) {\n      throw new Error(\"Child state node '#\".concat(resolvedStateId, \"' does not exist on machine '\").concat(this.id, \"'\"));\n    }\n\n    return stateNode;\n  };\n  /**\r\n   * Returns the relative state node from the given `statePath`, or throws.\r\n   *\r\n   * @param statePath The string or string array relative path to the state node.\r\n   */\n\n\n  StateNode.prototype.getStateNodeByPath = function (statePath) {\n    if (typeof statePath === 'string' && isStateId(statePath)) {\n      try {\n        return this.getStateNodeById(statePath.slice(1));\n      } catch (e) {// try individual paths\n        // throw e;\n      }\n    }\n\n    var arrayStatePath = toStatePath(statePath, this.delimiter).slice();\n    var currentStateNode = this;\n\n    while (arrayStatePath.length) {\n      var key = arrayStatePath.shift();\n\n      if (!key.length) {\n        break;\n      }\n\n      currentStateNode = currentStateNode.getStateNode(key);\n    }\n\n    return currentStateNode;\n  };\n  /**\r\n   * Resolves a partial state value with its full representation in this machine.\r\n   *\r\n   * @param stateValue The partial state value to resolve.\r\n   */\n\n\n  StateNode.prototype.resolve = function (stateValue) {\n    var _a;\n\n    var _this = this;\n\n    if (!stateValue) {\n      return this.initialStateValue || EMPTY_OBJECT; // TODO: type-specific properties\n    }\n\n    switch (this.type) {\n      case 'parallel':\n        return mapValues(this.initialStateValue, function (subStateValue, subStateKey) {\n          return subStateValue ? _this.getStateNode(subStateKey).resolve(stateValue[subStateKey] || subStateValue) : EMPTY_OBJECT;\n        });\n\n      case 'compound':\n        if (isString(stateValue)) {\n          var subStateNode = this.getStateNode(stateValue);\n\n          if (subStateNode.type === 'parallel' || subStateNode.type === 'compound') {\n            return _a = {}, _a[stateValue] = subStateNode.initialStateValue, _a;\n          }\n\n          return stateValue;\n        }\n\n        if (!Object.keys(stateValue).length) {\n          return this.initialStateValue || {};\n        }\n\n        return mapValues(stateValue, function (subStateValue, subStateKey) {\n          return subStateValue ? _this.getStateNode(subStateKey).resolve(subStateValue) : EMPTY_OBJECT;\n        });\n\n      default:\n        return stateValue || EMPTY_OBJECT;\n    }\n  };\n\n  StateNode.prototype.getResolvedPath = function (stateIdentifier) {\n    if (isStateId(stateIdentifier)) {\n      var stateNode = this.machine.idMap[stateIdentifier.slice(STATE_IDENTIFIER.length)];\n\n      if (!stateNode) {\n        throw new Error(\"Unable to find state node '\".concat(stateIdentifier, \"'\"));\n      }\n\n      return stateNode.path;\n    }\n\n    return toStatePath(stateIdentifier, this.delimiter);\n  };\n\n  Object.defineProperty(StateNode.prototype, \"initialStateValue\", {\n    get: function () {\n      var _a;\n\n      if (this.__cache.initialStateValue) {\n        return this.__cache.initialStateValue;\n      }\n\n      var initialStateValue;\n\n      if (this.type === 'parallel') {\n        initialStateValue = mapFilterValues(this.states, function (state) {\n          return state.initialStateValue || EMPTY_OBJECT;\n        }, function (stateNode) {\n          return !(stateNode.type === 'history');\n        });\n      } else if (this.initial !== undefined) {\n        if (!this.states[this.initial]) {\n          throw new Error(\"Initial state '\".concat(this.initial, \"' not found on '\").concat(this.key, \"'\"));\n        }\n\n        initialStateValue = isLeafNode(this.states[this.initial]) ? this.initial : (_a = {}, _a[this.initial] = this.states[this.initial].initialStateValue, _a);\n      } else {\n        // The finite state value of a machine without child states is just an empty object\n        initialStateValue = {};\n      }\n\n      this.__cache.initialStateValue = initialStateValue;\n      return this.__cache.initialStateValue;\n    },\n    enumerable: false,\n    configurable: true\n  });\n\n  StateNode.prototype.getInitialState = function (stateValue, context) {\n    this._init(); // TODO: this should be in the constructor (see note in constructor)\n\n\n    var configuration = this.getStateNodes(stateValue);\n    return this.resolveTransition({\n      configuration: configuration,\n      entrySet: __spreadArray([], __read(configuration), false),\n      exitSet: [],\n      transitions: [],\n      source: undefined,\n      actions: []\n    }, undefined, context !== null && context !== void 0 ? context : this.machine.context, undefined);\n  };\n\n  Object.defineProperty(StateNode.prototype, \"initialState\", {\n    /**\r\n     * The initial State instance, which includes all actions to be executed from\r\n     * entering the initial state.\r\n     */\n    get: function () {\n      var initialStateValue = this.initialStateValue;\n\n      if (!initialStateValue) {\n        throw new Error(\"Cannot retrieve initial state from simple state '\".concat(this.id, \"'.\"));\n      }\n\n      return this.getInitialState(initialStateValue);\n    },\n    enumerable: false,\n    configurable: true\n  });\n  Object.defineProperty(StateNode.prototype, \"target\", {\n    /**\r\n     * The target state value of the history state node, if it exists. This represents the\r\n     * default state value to transition to if no history value exists yet.\r\n     */\n    get: function () {\n      var target;\n\n      if (this.type === 'history') {\n        var historyConfig = this.config;\n\n        if (isString(historyConfig.target)) {\n          target = isStateId(historyConfig.target) ? pathToStateValue(this.machine.getStateNodeById(historyConfig.target).path.slice(this.path.length - 1)) : historyConfig.target;\n        } else {\n          target = historyConfig.target;\n        }\n      }\n\n      return target;\n    },\n    enumerable: false,\n    configurable: true\n  });\n  /**\r\n   * Returns the leaf nodes from a state path relative to this state node.\r\n   *\r\n   * @param relativeStateId The relative state path to retrieve the state nodes\r\n   * @param history The previous state to retrieve history\r\n   * @param resolve Whether state nodes should resolve to initial child state nodes\r\n   */\n\n  StateNode.prototype.getRelativeStateNodes = function (relativeStateId, historyValue, resolve) {\n    if (resolve === void 0) {\n      resolve = true;\n    }\n\n    return resolve ? relativeStateId.type === 'history' ? relativeStateId.resolveHistory(historyValue) : relativeStateId.initialStateNodes : [relativeStateId];\n  };\n\n  Object.defineProperty(StateNode.prototype, \"initialStateNodes\", {\n    get: function () {\n      var _this = this;\n\n      if (isLeafNode(this)) {\n        return [this];\n      } // Case when state node is compound but no initial state is defined\n\n\n      if (this.type === 'compound' && !this.initial) {\n        if (!IS_PRODUCTION) {\n          warn(false, \"Compound state node '\".concat(this.id, \"' has no initial state.\"));\n        }\n\n        return [this];\n      }\n\n      var initialStateNodePaths = toStatePaths(this.initialStateValue);\n      return flatten(initialStateNodePaths.map(function (initialPath) {\n        return _this.getFromRelativePath(initialPath);\n      }));\n    },\n    enumerable: false,\n    configurable: true\n  });\n  /**\r\n   * Retrieves state nodes from a relative path to this state node.\r\n   *\r\n   * @param relativePath The relative path from this state node\r\n   * @param historyValue\r\n   */\n\n  StateNode.prototype.getFromRelativePath = function (relativePath) {\n    if (!relativePath.length) {\n      return [this];\n    }\n\n    var _a = __read(relativePath),\n        stateKey = _a[0],\n        childStatePath = _a.slice(1);\n\n    if (!this.states) {\n      throw new Error(\"Cannot retrieve subPath '\".concat(stateKey, \"' from node with no states\"));\n    }\n\n    var childStateNode = this.getStateNode(stateKey);\n\n    if (childStateNode.type === 'history') {\n      return childStateNode.resolveHistory();\n    }\n\n    if (!this.states[stateKey]) {\n      throw new Error(\"Child state '\".concat(stateKey, \"' does not exist on '\").concat(this.id, \"'\"));\n    }\n\n    return this.states[stateKey].getFromRelativePath(childStatePath);\n  };\n\n  StateNode.prototype.historyValue = function (relativeStateValue) {\n    if (!Object.keys(this.states).length) {\n      return undefined;\n    }\n\n    return {\n      current: relativeStateValue || this.initialStateValue,\n      states: mapFilterValues(this.states, function (stateNode, key) {\n        if (!relativeStateValue) {\n          return stateNode.historyValue();\n        }\n\n        var subStateValue = isString(relativeStateValue) ? undefined : relativeStateValue[key];\n        return stateNode.historyValue(subStateValue || stateNode.initialStateValue);\n      }, function (stateNode) {\n        return !stateNode.history;\n      })\n    };\n  };\n  /**\r\n   * Resolves to the historical value(s) of the parent state node,\r\n   * represented by state nodes.\r\n   *\r\n   * @param historyValue\r\n   */\n\n\n  StateNode.prototype.resolveHistory = function (historyValue) {\n    var _this = this;\n\n    if (this.type !== 'history') {\n      return [this];\n    }\n\n    var parent = this.parent;\n\n    if (!historyValue) {\n      var historyTarget = this.target;\n      return historyTarget ? flatten(toStatePaths(historyTarget).map(function (relativeChildPath) {\n        return parent.getFromRelativePath(relativeChildPath);\n      })) : parent.initialStateNodes;\n    }\n\n    var subHistoryValue = nestedPath(parent.path, 'states')(historyValue).current;\n\n    if (isString(subHistoryValue)) {\n      return [parent.getStateNode(subHistoryValue)];\n    }\n\n    return flatten(toStatePaths(subHistoryValue).map(function (subStatePath) {\n      return _this.history === 'deep' ? parent.getFromRelativePath(subStatePath) : [parent.states[subStatePath[0]]];\n    }));\n  };\n\n  Object.defineProperty(StateNode.prototype, \"stateIds\", {\n    /**\r\n     * All the state node IDs of this state node and its descendant state nodes.\r\n     */\n    get: function () {\n      var _this = this;\n\n      var childStateIds = flatten(Object.keys(this.states).map(function (stateKey) {\n        return _this.states[stateKey].stateIds;\n      }));\n      return [this.id].concat(childStateIds);\n    },\n    enumerable: false,\n    configurable: true\n  });\n  Object.defineProperty(StateNode.prototype, \"events\", {\n    /**\r\n     * All the event types accepted by this state node and its descendants.\r\n     */\n    get: function () {\n      var e_8, _a, e_9, _b;\n\n      if (this.__cache.events) {\n        return this.__cache.events;\n      }\n\n      var states = this.states;\n      var events = new Set(this.ownEvents);\n\n      if (states) {\n        try {\n          for (var _c = __values(Object.keys(states)), _d = _c.next(); !_d.done; _d = _c.next()) {\n            var stateId = _d.value;\n            var state = states[stateId];\n\n            if (state.states) {\n              try {\n                for (var _e = (e_9 = void 0, __values(state.events)), _f = _e.next(); !_f.done; _f = _e.next()) {\n                  var event_1 = _f.value;\n                  events.add(\"\".concat(event_1));\n                }\n              } catch (e_9_1) {\n                e_9 = {\n                  error: e_9_1\n                };\n              } finally {\n                try {\n                  if (_f && !_f.done && (_b = _e.return)) _b.call(_e);\n                } finally {\n                  if (e_9) throw e_9.error;\n                }\n              }\n            }\n          }\n        } catch (e_8_1) {\n          e_8 = {\n            error: e_8_1\n          };\n        } finally {\n          try {\n            if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n          } finally {\n            if (e_8) throw e_8.error;\n          }\n        }\n      }\n\n      return this.__cache.events = Array.from(events);\n    },\n    enumerable: false,\n    configurable: true\n  });\n  Object.defineProperty(StateNode.prototype, \"ownEvents\", {\n    /**\r\n     * All the events that have transitions directly from this state node.\r\n     *\r\n     * Excludes any inert events.\r\n     */\n    get: function () {\n      var events = new Set(this.transitions.filter(function (transition) {\n        return !(!transition.target && !transition.actions.length && transition.internal);\n      }).map(function (transition) {\n        return transition.eventType;\n      }));\n      return Array.from(events);\n    },\n    enumerable: false,\n    configurable: true\n  });\n\n  StateNode.prototype.resolveTarget = function (_target) {\n    var _this = this;\n\n    if (_target === undefined) {\n      // an undefined target signals that the state node should not transition from that state when receiving that event\n      return undefined;\n    }\n\n    return _target.map(function (target) {\n      if (!isString(target)) {\n        return target;\n      }\n\n      var isInternalTarget = target[0] === _this.delimiter; // If internal target is defined on machine,\n      // do not include machine key on target\n\n      if (isInternalTarget && !_this.parent) {\n        return _this.getStateNodeByPath(target.slice(1));\n      }\n\n      var resolvedTarget = isInternalTarget ? _this.key + target : target;\n\n      if (_this.parent) {\n        try {\n          var targetStateNode = _this.parent.getStateNodeByPath(resolvedTarget);\n\n          return targetStateNode;\n        } catch (err) {\n          throw new Error(\"Invalid transition definition for state node '\".concat(_this.id, \"':\\n\").concat(err.message));\n        }\n      } else {\n        return _this.getStateNodeByPath(resolvedTarget);\n      }\n    });\n  };\n\n  StateNode.prototype.formatTransition = function (transitionConfig) {\n    var _this = this;\n\n    var normalizedTarget = normalizeTarget(transitionConfig.target);\n    var internal = 'internal' in transitionConfig ? transitionConfig.internal : normalizedTarget ? normalizedTarget.some(function (_target) {\n      return isString(_target) && _target[0] === _this.delimiter;\n    }) : true;\n    var guards = this.machine.options.guards;\n    var target = this.resolveTarget(normalizedTarget);\n\n    var transition = __assign(__assign({}, transitionConfig), {\n      actions: toActionObjects(toArray(transitionConfig.actions)),\n      cond: toGuard(transitionConfig.cond, guards),\n      target: target,\n      source: this,\n      internal: internal,\n      eventType: transitionConfig.event,\n      toJSON: function () {\n        return __assign(__assign({}, transition), {\n          target: transition.target ? transition.target.map(function (t) {\n            return \"#\".concat(t.id);\n          }) : undefined,\n          source: \"#\".concat(_this.id)\n        });\n      }\n    });\n\n    return transition;\n  };\n\n  StateNode.prototype.formatTransitions = function () {\n    var e_10, _a;\n\n    var _this = this;\n\n    var onConfig;\n\n    if (!this.config.on) {\n      onConfig = [];\n    } else if (Array.isArray(this.config.on)) {\n      onConfig = this.config.on;\n    } else {\n      var _b = this.config.on,\n          _c = WILDCARD,\n          _d = _b[_c],\n          wildcardConfigs = _d === void 0 ? [] : _d,\n          strictTransitionConfigs_1 = __rest(_b, [typeof _c === \"symbol\" ? _c : _c + \"\"]);\n\n      onConfig = flatten(Object.keys(strictTransitionConfigs_1).map(function (key) {\n        if (!IS_PRODUCTION && key === NULL_EVENT) {\n          warn(false, \"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. \" + \"Please check the `on` configuration for \\\"#\".concat(_this.id, \"\\\".\"));\n        }\n\n        var transitionConfigArray = toTransitionConfigArray(key, strictTransitionConfigs_1[key]);\n\n        if (!IS_PRODUCTION) {\n          validateArrayifiedTransitions(_this, key, transitionConfigArray);\n        }\n\n        return transitionConfigArray;\n      }).concat(toTransitionConfigArray(WILDCARD, wildcardConfigs)));\n    }\n\n    var eventlessConfig = this.config.always ? toTransitionConfigArray('', this.config.always) : [];\n    var doneConfig = this.config.onDone ? toTransitionConfigArray(String(done(this.id)), this.config.onDone) : [];\n\n    if (!IS_PRODUCTION) {\n      warn(!(this.config.onDone && !this.parent), \"Root nodes cannot have an \\\".onDone\\\" transition. Please check the config of \\\"\".concat(this.id, \"\\\".\"));\n    }\n\n    var invokeConfig = flatten(this.invoke.map(function (invokeDef) {\n      var settleTransitions = [];\n\n      if (invokeDef.onDone) {\n        settleTransitions.push.apply(settleTransitions, __spreadArray([], __read(toTransitionConfigArray(String(doneInvoke(invokeDef.id)), invokeDef.onDone)), false));\n      }\n\n      if (invokeDef.onError) {\n        settleTransitions.push.apply(settleTransitions, __spreadArray([], __read(toTransitionConfigArray(String(error(invokeDef.id)), invokeDef.onError)), false));\n      }\n\n      return settleTransitions;\n    }));\n    var delayedTransitions = this.after;\n    var formattedTransitions = flatten(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(doneConfig), false), __read(invokeConfig), false), __read(onConfig), false), __read(eventlessConfig), false).map(function (transitionConfig) {\n      return toArray(transitionConfig).map(function (transition) {\n        return _this.formatTransition(transition);\n      });\n    }));\n\n    try {\n      for (var delayedTransitions_1 = __values(delayedTransitions), delayedTransitions_1_1 = delayedTransitions_1.next(); !delayedTransitions_1_1.done; delayedTransitions_1_1 = delayedTransitions_1.next()) {\n        var delayedTransition = delayedTransitions_1_1.value;\n        formattedTransitions.push(delayedTransition);\n      }\n    } catch (e_10_1) {\n      e_10 = {\n        error: e_10_1\n      };\n    } finally {\n      try {\n        if (delayedTransitions_1_1 && !delayedTransitions_1_1.done && (_a = delayedTransitions_1.return)) _a.call(delayedTransitions_1);\n      } finally {\n        if (e_10) throw e_10.error;\n      }\n    }\n\n    return formattedTransitions;\n  };\n\n  return StateNode;\n}();\n\nexport { StateNode };\n","import { StateNode } from './StateNode.js';\nimport { IS_PRODUCTION } from './environment.js';\n\nvar warned = false;\nfunction Machine(config, options, initialContext) {\n  if (initialContext === void 0) {\n    initialContext = config.context;\n  }\n\n  return new StateNode(config, options, initialContext);\n}\nfunction createMachine(config, options) {\n  if (!IS_PRODUCTION && !config.predictableActionArguments && !warned) {\n    warned = true;\n    console.warn('It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html');\n  }\n\n  return new StateNode(config, options);\n}\n\nexport { Machine, createMachine };\n","import { __values } from './_virtual/_tslib.js';\nimport { matchesState } from './utils.js';\n\nfunction mapState(stateMap, stateId) {\n  var e_1, _a;\n\n  var foundStateId;\n\n  try {\n    for (var _b = __values(Object.keys(stateMap)), _c = _b.next(); !_c.done; _c = _b.next()) {\n      var mappedStateId = _c.value;\n\n      if (matchesState(mappedStateId, stateId) && (!foundStateId || stateId.length > foundStateId.length)) {\n        foundStateId = mappedStateId;\n      }\n    }\n  } catch (e_1_1) {\n    e_1 = {\n      error: e_1_1\n    };\n  } finally {\n    try {\n      if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n    } finally {\n      if (e_1) throw e_1.error;\n    }\n  }\n\n  return stateMap[foundStateId];\n}\n\nexport { mapState };\n","import { __values, __read } from './_virtual/_tslib.js';\nimport { State } from './State.js';\n\nfunction matchState(state, patterns, defaultValue) {\n  var e_1, _a;\n\n  var resolvedState = State.from(state, state instanceof State ? state.context : undefined);\n\n  try {\n    for (var patterns_1 = __values(patterns), patterns_1_1 = patterns_1.next(); !patterns_1_1.done; patterns_1_1 = patterns_1.next()) {\n      var _b = __read(patterns_1_1.value, 2),\n          stateValue = _b[0],\n          getValue = _b[1];\n\n      if (resolvedState.matches(stateValue)) {\n        return getValue(resolvedState);\n      }\n    }\n  } catch (e_1_1) {\n    e_1 = {\n      error: e_1_1\n    };\n  } finally {\n    try {\n      if (patterns_1_1 && !patterns_1_1.done && (_a = patterns_1.return)) _a.call(patterns_1);\n    } finally {\n      if (e_1) throw e_1.error;\n    }\n  }\n\n  return defaultValue(resolvedState);\n}\n\nexport { matchState };\n","function createSchema(schema) {\n  return schema;\n}\nvar t = createSchema;\n\nexport { createSchema, t };\n","import { assign as assign$1, send as send$1, sendParent as sendParent$1, sendUpdate as sendUpdate$1, forwardTo as forwardTo$1, doneInvoke as doneInvoke$1 } from './actions.js';\nimport * as actions from './actions.js';\nexport { actions };\nexport { toActorRef } from './Actor.js';\nexport { Interpreter, InterpreterStatus, interpret, spawn } from './interpreter.js';\nexport { Machine, createMachine } from './Machine.js';\nexport { mapState } from './mapState.js';\nexport { matchState } from './match.js';\nexport { createSchema, t } from './schema.js';\nexport { State } from './State.js';\nexport { StateNode } from './StateNode.js';\nexport { spawnBehavior } from './behaviors.js';\nexport { ActionTypes, SpecialTargets } from './types.js';\nexport { matchesState, toEventObject, toObserver, toSCXMLEvent } from './utils.js';\n\nvar assign = assign$1,\n    send = send$1,\n    sendParent = sendParent$1,\n    sendUpdate = sendUpdate$1,\n    forwardTo = forwardTo$1,\n    doneInvoke = doneInvoke$1;\n\nexport { assign, doneInvoke, forwardTo, send, sendParent, sendUpdate };\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _utils = require(\"./utils.js\");\n\nconst addedDiff = (lhs, rhs) => {\n  if (lhs === rhs || !(0, _utils.isObject)(lhs) || !(0, _utils.isObject)(rhs)) return {};\n  const l = lhs;\n  const r = rhs;\n  return Object.keys(r).reduce((acc, key) => {\n    if ((0, _utils.hasOwnProperty)(l, key)) {\n      const difference = addedDiff(l[key], r[key]);\n      if ((0, _utils.isObject)(difference) && (0, _utils.isEmpty)(difference)) return acc;\n      acc[key] = difference;\n      return acc;\n    }\n\n    acc[key] = r[key];\n    return acc;\n  }, {});\n};\n\nvar _default = addedDiff;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _utils = require(\"./utils.js\");\n\nconst deletedDiff = (lhs, rhs) => {\n  if (lhs === rhs || !(0, _utils.isObject)(lhs) || !(0, _utils.isObject)(rhs)) return {};\n  const l = lhs;\n  const r = rhs;\n  return Object.keys(l).reduce((acc, key) => {\n    if ((0, _utils.hasOwnProperty)(r, key)) {\n      const difference = deletedDiff(l[key], r[key]);\n      if ((0, _utils.isObject)(difference) && (0, _utils.isEmpty)(difference)) return acc;\n      acc[key] = difference;\n      return acc;\n    }\n\n    acc[key] = undefined;\n    return acc;\n  }, {});\n};\n\nvar _default = deletedDiff;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _added = _interopRequireDefault(require(\"./added.js\"));\n\nvar _deleted = _interopRequireDefault(require(\"./deleted.js\"));\n\nvar _updated = _interopRequireDefault(require(\"./updated.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst detailedDiff = (lhs, rhs) => ({\n  added: (0, _added.default)(lhs, rhs),\n  deleted: (0, _deleted.default)(lhs, rhs),\n  updated: (0, _updated.default)(lhs, rhs)\n});\n\nvar _default = detailedDiff;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _utils = require(\"./utils.js\");\n\nconst diff = (lhs, rhs) => {\n  if (lhs === rhs) return {}; // equal return no diff\n\n  if (!(0, _utils.isObject)(lhs) || !(0, _utils.isObject)(rhs)) return rhs; // return updated rhs\n\n  const l = lhs;\n  const r = rhs;\n  const deletedValues = Object.keys(l).reduce((acc, key) => {\n    if (!(0, _utils.hasOwnProperty)(r, key)) {\n      acc[key] = undefined;\n    }\n\n    return acc;\n  }, {});\n\n  if ((0, _utils.isDate)(l) || (0, _utils.isDate)(r)) {\n    if (l.valueOf() == r.valueOf()) return {};\n    return r;\n  }\n\n  return Object.keys(r).reduce((acc, key) => {\n    if (!(0, _utils.hasOwnProperty)(l, key)) {\n      acc[key] = r[key]; // return added r key\n\n      return acc;\n    }\n\n    const difference = diff(l[key], r[key]); // If the difference is empty, and the lhs is an empty object or the rhs is not an empty object\n\n    if ((0, _utils.isEmptyObject)(difference) && !(0, _utils.isDate)(difference) && ((0, _utils.isEmptyObject)(l[key]) || !(0, _utils.isEmptyObject)(r[key]))) return acc; // return no diff\n\n    acc[key] = difference; // return updated key\n\n    return acc; // return updated key\n  }, deletedValues);\n};\n\nvar _default = diff;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nObject.defineProperty(exports, \"addedDiff\", {\n  enumerable: true,\n  get: function () {\n    return _added.default;\n  }\n});\nObject.defineProperty(exports, \"deletedDiff\", {\n  enumerable: true,\n  get: function () {\n    return _deleted.default;\n  }\n});\nObject.defineProperty(exports, \"detailedDiff\", {\n  enumerable: true,\n  get: function () {\n    return _detailed.default;\n  }\n});\nObject.defineProperty(exports, \"diff\", {\n  enumerable: true,\n  get: function () {\n    return _diff.default;\n  }\n});\nObject.defineProperty(exports, \"updatedDiff\", {\n  enumerable: true,\n  get: function () {\n    return _updated.default;\n  }\n});\n\nvar _diff = _interopRequireDefault(require(\"./diff.js\"));\n\nvar _added = _interopRequireDefault(require(\"./added.js\"));\n\nvar _deleted = _interopRequireDefault(require(\"./deleted.js\"));\n\nvar _updated = _interopRequireDefault(require(\"./updated.js\"));\n\nvar _detailed = _interopRequireDefault(require(\"./detailed.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _utils = require(\"./utils.js\");\n\nconst updatedDiff = (lhs, rhs) => {\n  if (lhs === rhs) return {};\n  if (!(0, _utils.isObject)(lhs) || !(0, _utils.isObject)(rhs)) return rhs;\n  const l = lhs;\n  const r = rhs;\n\n  if ((0, _utils.isDate)(l) || (0, _utils.isDate)(r)) {\n    if (l.valueOf() == r.valueOf()) return {};\n    return r;\n  }\n\n  return Object.keys(r).reduce((acc, key) => {\n    if ((0, _utils.hasOwnProperty)(l, key)) {\n      const difference = updatedDiff(l[key], r[key]); // If the difference is empty, and the lhs is an empty object or the rhs is not an empty object\n\n      if ((0, _utils.isEmptyObject)(difference) && !(0, _utils.isDate)(difference) && ((0, _utils.isEmptyObject)(l[key]) || !(0, _utils.isEmptyObject)(r[key]))) return acc; // return no diff\n\n      acc[key] = difference;\n      return acc;\n    }\n\n    return acc;\n  }, {});\n};\n\nvar _default = updatedDiff;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.isObject = exports.isEmptyObject = exports.isEmpty = exports.isDate = exports.hasOwnProperty = void 0;\n\nconst isDate = d => d instanceof Date;\n\nexports.isDate = isDate;\n\nconst isEmpty = o => Object.keys(o).length === 0;\n\nexports.isEmpty = isEmpty;\n\nconst isObject = o => o != null && typeof o === 'object';\n\nexports.isObject = isObject;\n\nconst hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);\n\nexports.hasOwnProperty = hasOwnProperty;\n\nconst isEmptyObject = o => isObject(o) && isEmpty(o);\n\nexports.isEmptyObject = isEmptyObject;","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n  for (var name in all)\n    __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n  if (from && typeof from === \"object\" || typeof from === \"function\") {\n    for (let key of __getOwnPropNames(from))\n      if (!__hasOwnProp.call(to, key) && key !== except)\n        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n  }\n  return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n  BASE64_REGEX: () => BASE64_REGEX,\n  BIC_REGEX: () => BIC_REGEX,\n  CUID2_REGEX: () => CUID2_REGEX,\n  DECIMAL_REGEX: () => DECIMAL_REGEX,\n  EMAIL_REGEX: () => EMAIL_REGEX,\n  EMOJI_REGEX: () => EMOJI_REGEX,\n  HEXADECIMAL_REGEX: () => HEXADECIMAL_REGEX,\n  HEX_COLOR_REGEX: () => HEX_COLOR_REGEX,\n  IMEI_REGEX: () => IMEI_REGEX,\n  IPV4_REGEX: () => IPV4_REGEX,\n  IPV6_REGEX: () => IPV6_REGEX,\n  IP_REGEX: () => IP_REGEX,\n  ISO_DATE_REGEX: () => ISO_DATE_REGEX,\n  ISO_DATE_TIME_REGEX: () => ISO_DATE_TIME_REGEX,\n  ISO_TIMESTAMP_REGEX: () => ISO_TIMESTAMP_REGEX,\n  ISO_TIME_REGEX: () => ISO_TIME_REGEX,\n  ISO_TIME_SECOND_REGEX: () => ISO_TIME_SECOND_REGEX,\n  ISO_WEEK_REGEX: () => ISO_WEEK_REGEX,\n  MAC48_REGEX: () => MAC48_REGEX,\n  MAC64_REGEX: () => MAC64_REGEX,\n  MAC_REGEX: () => MAC_REGEX,\n  NANO_ID_REGEX: () => NANO_ID_REGEX,\n  OCTAL_REGEX: () => OCTAL_REGEX,\n  ULID_REGEX: () => ULID_REGEX,\n  UUID_REGEX: () => UUID_REGEX,\n  ValiError: () => ValiError,\n  _addIssue: () => _addIssue,\n  _isLuhnAlgo: () => _isLuhnAlgo,\n  _isValidObjectKey: () => _isValidObjectKey,\n  _joinExpects: () => _joinExpects,\n  _stringify: () => _stringify,\n  any: () => any,\n  array: () => array,\n  arrayAsync: () => arrayAsync,\n  awaitAsync: () => awaitAsync,\n  base64: () => base64,\n  bic: () => bic,\n  bigint: () => bigint,\n  blob: () => blob,\n  boolean: () => boolean,\n  brand: () => brand,\n  bytes: () => bytes,\n  check: () => check,\n  checkAsync: () => checkAsync,\n  checkItems: () => checkItems,\n  config: () => config,\n  creditCard: () => creditCard,\n  cuid2: () => cuid2,\n  custom: () => custom,\n  customAsync: () => customAsync,\n  date: () => date,\n  decimal: () => decimal,\n  deleteGlobalConfig: () => deleteGlobalConfig,\n  deleteGlobalMessage: () => deleteGlobalMessage,\n  deleteSchemaMessage: () => deleteSchemaMessage,\n  deleteSpecificMessage: () => deleteSpecificMessage,\n  description: () => description,\n  email: () => email,\n  emoji: () => emoji,\n  empty: () => empty,\n  endsWith: () => endsWith,\n  entriesFromList: () => entriesFromList,\n  enum: () => enum_,\n  enum_: () => enum_,\n  everyItem: () => everyItem,\n  excludes: () => excludes,\n  fallback: () => fallback,\n  fallbackAsync: () => fallbackAsync,\n  file: () => file,\n  filterItems: () => filterItems,\n  findItem: () => findItem,\n  finite: () => finite,\n  flatten: () => flatten,\n  forward: () => forward,\n  forwardAsync: () => forwardAsync,\n  function: () => function_,\n  function_: () => function_,\n  getDefault: () => getDefault,\n  getDefaults: () => getDefaults,\n  getDefaultsAsync: () => getDefaultsAsync,\n  getDotPath: () => getDotPath,\n  getFallback: () => getFallback,\n  getFallbacks: () => getFallbacks,\n  getFallbacksAsync: () => getFallbacksAsync,\n  getGlobalConfig: () => getGlobalConfig,\n  getGlobalMessage: () => getGlobalMessage,\n  getSchemaMessage: () => getSchemaMessage,\n  getSpecificMessage: () => getSpecificMessage,\n  hash: () => hash,\n  hexColor: () => hexColor,\n  hexadecimal: () => hexadecimal,\n  imei: () => imei,\n  includes: () => includes,\n  instance: () => instance,\n  integer: () => integer,\n  intersect: () => intersect,\n  intersectAsync: () => intersectAsync,\n  ip: () => ip,\n  ipv4: () => ipv4,\n  ipv6: () => ipv6,\n  is: () => is,\n  isOfKind: () => isOfKind,\n  isOfType: () => isOfType,\n  isValiError: () => isValiError,\n  isoDate: () => isoDate,\n  isoDateTime: () => isoDateTime,\n  isoTime: () => isoTime,\n  isoTimeSecond: () => isoTimeSecond,\n  isoTimestamp: () => isoTimestamp,\n  isoWeek: () => isoWeek,\n  keyof: () => keyof,\n  lazy: () => lazy,\n  lazyAsync: () => lazyAsync,\n  length: () => length,\n  literal: () => literal,\n  looseObject: () => looseObject,\n  looseObjectAsync: () => looseObjectAsync,\n  looseTuple: () => looseTuple,\n  looseTupleAsync: () => looseTupleAsync,\n  mac: () => mac,\n  mac48: () => mac48,\n  mac64: () => mac64,\n  map: () => map,\n  mapAsync: () => mapAsync,\n  mapItems: () => mapItems,\n  maxBytes: () => maxBytes,\n  maxLength: () => maxLength,\n  maxSize: () => maxSize,\n  maxValue: () => maxValue,\n  mimeType: () => mimeType,\n  minBytes: () => minBytes,\n  minLength: () => minLength,\n  minSize: () => minSize,\n  minValue: () => minValue,\n  multipleOf: () => multipleOf,\n  nan: () => nan,\n  nanoid: () => nanoid,\n  never: () => never,\n  nonEmpty: () => nonEmpty,\n  nonNullable: () => nonNullable,\n  nonNullableAsync: () => nonNullableAsync,\n  nonNullish: () => nonNullish,\n  nonNullishAsync: () => nonNullishAsync,\n  nonOptional: () => nonOptional,\n  nonOptionalAsync: () => nonOptionalAsync,\n  normalize: () => normalize,\n  notBytes: () => notBytes,\n  notLength: () => notLength,\n  notSize: () => notSize,\n  notValue: () => notValue,\n  null: () => null_,\n  null_: () => null_,\n  nullable: () => nullable,\n  nullableAsync: () => nullableAsync,\n  nullish: () => nullish,\n  nullishAsync: () => nullishAsync,\n  number: () => number,\n  object: () => object,\n  objectAsync: () => objectAsync,\n  objectWithRest: () => objectWithRest,\n  objectWithRestAsync: () => objectWithRestAsync,\n  octal: () => octal,\n  omit: () => omit,\n  optional: () => optional,\n  optionalAsync: () => optionalAsync,\n  parse: () => parse,\n  parseAsync: () => parseAsync,\n  parser: () => parser,\n  parserAsync: () => parserAsync,\n  partial: () => partial,\n  partialAsync: () => partialAsync,\n  partialCheck: () => partialCheck,\n  partialCheckAsync: () => partialCheckAsync,\n  pick: () => pick,\n  picklist: () => picklist,\n  pipe: () => pipe,\n  pipeAsync: () => pipeAsync,\n  promise: () => promise,\n  rawCheck: () => rawCheck,\n  rawCheckAsync: () => rawCheckAsync,\n  rawTransform: () => rawTransform,\n  rawTransformAsync: () => rawTransformAsync,\n  readonly: () => readonly,\n  record: () => record,\n  recordAsync: () => recordAsync,\n  reduceItems: () => reduceItems,\n  regex: () => regex,\n  required: () => required,\n  requiredAsync: () => requiredAsync,\n  safeInteger: () => safeInteger,\n  safeParse: () => safeParse,\n  safeParseAsync: () => safeParseAsync,\n  safeParser: () => safeParser,\n  safeParserAsync: () => safeParserAsync,\n  set: () => set,\n  setAsync: () => setAsync,\n  setGlobalConfig: () => setGlobalConfig,\n  setGlobalMessage: () => setGlobalMessage,\n  setSchemaMessage: () => setSchemaMessage,\n  setSpecificMessage: () => setSpecificMessage,\n  size: () => size,\n  someItem: () => someItem,\n  sortItems: () => sortItems,\n  startsWith: () => startsWith,\n  strictObject: () => strictObject,\n  strictObjectAsync: () => strictObjectAsync,\n  strictTuple: () => strictTuple,\n  strictTupleAsync: () => strictTupleAsync,\n  string: () => string,\n  symbol: () => symbol,\n  toLowerCase: () => toLowerCase,\n  toMaxValue: () => toMaxValue,\n  toMinValue: () => toMinValue,\n  toUpperCase: () => toUpperCase,\n  transform: () => transform,\n  transformAsync: () => transformAsync,\n  trim: () => trim,\n  trimEnd: () => trimEnd,\n  trimStart: () => trimStart,\n  tuple: () => tuple,\n  tupleAsync: () => tupleAsync,\n  tupleWithRest: () => tupleWithRest,\n  tupleWithRestAsync: () => tupleWithRestAsync,\n  ulid: () => ulid,\n  undefined: () => undefined_,\n  undefined_: () => undefined_,\n  undefinedable: () => undefinedable,\n  undefinedableAsync: () => undefinedableAsync,\n  union: () => union,\n  unionAsync: () => unionAsync,\n  unknown: () => unknown,\n  unwrap: () => unwrap,\n  url: () => url,\n  uuid: () => uuid,\n  value: () => value,\n  variant: () => variant,\n  variantAsync: () => variantAsync,\n  void: () => void_,\n  void_: () => void_\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/actions/await/awaitAsync.ts\nfunction awaitAsync() {\n  return {\n    kind: \"transformation\",\n    type: \"await\",\n    reference: awaitAsync,\n    async: true,\n    async _run(dataset) {\n      dataset.value = await dataset.value;\n      return dataset;\n    }\n  };\n}\n\n// src/regex.ts\nvar BASE64_REGEX = /^(?:[\\da-z+/]{4})*(?:[\\da-z+/]{2}==|[\\da-z+/]{3}=)?$/iu;\nvar BIC_REGEX = /^[A-Z]{6}(?!00)[\\dA-Z]{2}(?:[\\dA-Z]{3})?$/u;\nvar CUID2_REGEX = /^[a-z][\\da-z]*$/u;\nvar DECIMAL_REGEX = /^\\d+$/u;\nvar EMAIL_REGEX = /^[\\w+-]+(?:\\.[\\w+-]+)*@[\\da-z]+(?:[.-][\\da-z]+)*\\.[a-z]{2,}$/iu;\nvar EMOJI_REGEX = (\n  // eslint-disable-next-line redos-detector/no-unsafe-regex, regexp/no-dupe-disjunctions -- false positives\n  /^(?:[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}))*)+$/u\n);\nvar HEXADECIMAL_REGEX = /^(?:0[hx])?[\\da-f]+$/iu;\nvar HEX_COLOR_REGEX = /^#(?:[\\da-f]{3,4}|[\\da-f]{6}|[\\da-f]{8})$/iu;\nvar IMEI_REGEX = /^\\d{15}$|^\\d{2}-\\d{6}-\\d{6}-\\d$/u;\nvar IPV4_REGEX = (\n  // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive\n  /^(?:(?:[1-9]|1\\d|2[0-4])?\\d|25[0-5])(?:\\.(?:(?:[1-9]|1\\d|2[0-4])?\\d|25[0-5])){3}$/u\n);\nvar IPV6_REGEX = /^(?:(?:[\\da-f]{1,4}:){7}[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,7}:|(?:[\\da-f]{1,4}:){1,6}:[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,5}(?::[\\da-f]{1,4}){1,2}|(?:[\\da-f]{1,4}:){1,4}(?::[\\da-f]{1,4}){1,3}|(?:[\\da-f]{1,4}:){1,3}(?::[\\da-f]{1,4}){1,4}|(?:[\\da-f]{1,4}:){1,2}(?::[\\da-f]{1,4}){1,5}|[\\da-f]{1,4}:(?::[\\da-f]{1,4}){1,6}|:(?:(?::[\\da-f]{1,4}){1,7}|:)|fe80:(?::[\\da-f]{0,4}){0,4}%[\\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)\\.){3}(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)|(?:[\\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)\\.){3}(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d))$/iu;\nvar IP_REGEX = /^(?:(?:[1-9]|1\\d|2[0-4])?\\d|25[0-5])(?:\\.(?:(?:[1-9]|1\\d|2[0-4])?\\d|25[0-5])){3}$|^(?:(?:[\\da-f]{1,4}:){7}[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,7}:|(?:[\\da-f]{1,4}:){1,6}:[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,5}(?::[\\da-f]{1,4}){1,2}|(?:[\\da-f]{1,4}:){1,4}(?::[\\da-f]{1,4}){1,3}|(?:[\\da-f]{1,4}:){1,3}(?::[\\da-f]{1,4}){1,4}|(?:[\\da-f]{1,4}:){1,2}(?::[\\da-f]{1,4}){1,5}|[\\da-f]{1,4}:(?::[\\da-f]{1,4}){1,6}|:(?:(?::[\\da-f]{1,4}){1,7}|:)|fe80:(?::[\\da-f]{0,4}){0,4}%[\\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)\\.){3}(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)|(?:[\\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)\\.){3}(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d))$/iu;\nvar ISO_DATE_REGEX = /^\\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\\d|0[1-9]|3[01])$/u;\nvar ISO_DATE_TIME_REGEX = /^\\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\\d|0[1-9]|3[01])T(?:0\\d|1\\d|2[0-3]):[0-5]\\d$/u;\nvar ISO_TIME_REGEX = /^(?:0\\d|1\\d|2[0-3]):[0-5]\\d$/u;\nvar ISO_TIME_SECOND_REGEX = /^(?:0\\d|1\\d|2[0-3])(?::[0-5]\\d){2}$/u;\nvar ISO_TIMESTAMP_REGEX = /^\\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\\d|0[1-9]|3[01])T(?:0\\d|1\\d|2[0-3])(?::[0-5]\\d){2}(?:\\.\\d{1,9})?(?:Z|[+-](?:0\\d|1\\d|2[0-3])(?::?[0-5]\\d)?)$/u;\nvar ISO_WEEK_REGEX = /^\\d{4}-W(?:0[1-9]|[1-4]\\d|5[0-3])$/u;\nvar MAC48_REGEX = /^(?:[\\da-f]{2}:){5}[\\da-f]{2}$|^(?:[\\da-f]{2}-){5}[\\da-f]{2}$|^(?:[\\da-f]{4}\\.){2}[\\da-f]{4}$/iu;\nvar MAC64_REGEX = /^(?:[\\da-f]{2}:){7}[\\da-f]{2}$|^(?:[\\da-f]{2}-){7}[\\da-f]{2}$|^(?:[\\da-f]{4}\\.){3}[\\da-f]{4}$|^(?:[\\da-f]{4}:){3}[\\da-f]{4}$/iu;\nvar MAC_REGEX = /^(?:[\\da-f]{2}:){5}[\\da-f]{2}$|^(?:[\\da-f]{2}-){5}[\\da-f]{2}$|^(?:[\\da-f]{4}\\.){2}[\\da-f]{4}$|^(?:[\\da-f]{2}:){7}[\\da-f]{2}$|^(?:[\\da-f]{2}-){7}[\\da-f]{2}$|^(?:[\\da-f]{4}\\.){3}[\\da-f]{4}$|^(?:[\\da-f]{4}:){3}[\\da-f]{4}$/iu;\nvar NANO_ID_REGEX = /^[\\w-]+$/u;\nvar OCTAL_REGEX = /^(?:0o)?[0-7]+$/iu;\nvar ULID_REGEX = /^[\\da-hjkmnp-tv-z]{26}$/iu;\nvar UUID_REGEX = /^[\\da-f]{8}(?:-[\\da-f]{4}){3}-[\\da-f]{12}$/iu;\n\n// src/storages/globalConfig/globalConfig.ts\nvar store;\nfunction setGlobalConfig(config2) {\n  store = { ...store, ...config2 };\n}\nfunction getGlobalConfig(config2) {\n  return {\n    lang: config2?.lang ?? store?.lang,\n    message: config2?.message,\n    abortEarly: config2?.abortEarly ?? store?.abortEarly,\n    abortPipeEarly: config2?.abortPipeEarly ?? store?.abortPipeEarly\n  };\n}\nfunction deleteGlobalConfig() {\n  store = void 0;\n}\n\n// src/storages/globalMessage/globalMessage.ts\nvar store2;\nfunction setGlobalMessage(message, lang) {\n  if (!store2) store2 = /* @__PURE__ */ new Map();\n  store2.set(lang, message);\n}\nfunction getGlobalMessage(lang) {\n  return store2?.get(lang);\n}\nfunction deleteGlobalMessage(lang) {\n  store2?.delete(lang);\n}\n\n// src/storages/schemaMessage/schemaMessage.ts\nvar store3;\nfunction setSchemaMessage(message, lang) {\n  if (!store3) store3 = /* @__PURE__ */ new Map();\n  store3.set(lang, message);\n}\nfunction getSchemaMessage(lang) {\n  return store3?.get(lang);\n}\nfunction deleteSchemaMessage(lang) {\n  store3?.delete(lang);\n}\n\n// src/storages/specificMessage/specificMessage.ts\nvar store4;\nfunction setSpecificMessage(reference, message, lang) {\n  if (!store4) store4 = /* @__PURE__ */ new Map();\n  if (!store4.get(reference)) store4.set(reference, /* @__PURE__ */ new Map());\n  store4.get(reference).set(lang, message);\n}\nfunction getSpecificMessage(reference, lang) {\n  return store4?.get(reference)?.get(lang);\n}\nfunction deleteSpecificMessage(reference, lang) {\n  store4?.get(reference)?.delete(lang);\n}\n\n// src/utils/_stringify/_stringify.ts\nfunction _stringify(input) {\n  const type = typeof input;\n  if (type === \"string\") {\n    return `\"${input}\"`;\n  }\n  if (type === \"number\" || type === \"bigint\" || type === \"boolean\") {\n    return `${input}`;\n  }\n  if (type === \"object\" || type === \"function\") {\n    return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? \"null\";\n  }\n  return type;\n}\n\n// src/utils/_addIssue/_addIssue.ts\nfunction _addIssue(context, label, dataset, config2, other) {\n  const input = other && \"input\" in other ? other.input : dataset.value;\n  const expected = other?.expected ?? context.expects ?? null;\n  const received = other?.received ?? _stringify(input);\n  const issue = {\n    kind: context.kind,\n    type: context.type,\n    input,\n    expected,\n    received,\n    message: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : \"R\"}eceived ${received}`,\n    // @ts-expect-error\n    requirement: context.requirement,\n    path: other?.path,\n    issues: other?.issues,\n    lang: config2.lang,\n    abortEarly: config2.abortEarly,\n    abortPipeEarly: config2.abortPipeEarly\n  };\n  const isSchema = context.kind === \"schema\";\n  const message = other?.message ?? // @ts-expect-error\n  context.message ?? getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? getSchemaMessage(issue.lang) : null) ?? config2.message ?? getGlobalMessage(issue.lang);\n  if (message) {\n    issue.message = typeof message === \"function\" ? message(issue) : message;\n  }\n  if (isSchema) {\n    dataset.typed = false;\n  }\n  if (dataset.issues) {\n    dataset.issues.push(issue);\n  } else {\n    dataset.issues = [issue];\n  }\n}\n\n// src/utils/_isLuhnAlgo/_isLuhnAlgo.ts\nvar NON_DIGIT_REGEX = /\\D/gu;\nfunction _isLuhnAlgo(input) {\n  const number2 = input.replace(NON_DIGIT_REGEX, \"\");\n  let length2 = number2.length;\n  let bit = 1;\n  let sum = 0;\n  while (length2) {\n    const value2 = +number2[--length2];\n    bit ^= 1;\n    sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value2] : value2;\n  }\n  return sum % 10 === 0;\n}\n\n// src/utils/_isValidObjectKey/_isValidObjectKey.ts\nfunction _isValidObjectKey(object2, key) {\n  return Object.hasOwn(object2, key) && key !== \"__proto__\" && key !== \"prototype\" && key !== \"constructor\";\n}\n\n// src/utils/_joinExpects/_joinExpects.ts\nfunction _joinExpects(values, separator) {\n  const list = [...new Set(values)];\n  if (list.length > 1) {\n    return `(${list.join(` ${separator} `)})`;\n  }\n  return list[0] ?? \"never\";\n}\n\n// src/utils/entriesFromList/entriesFromList.ts\nfunction entriesFromList(list, schema) {\n  const entries = {};\n  for (const key of list) {\n    entries[key] = schema;\n  }\n  return entries;\n}\n\n// src/utils/getDotPath/getDotPath.ts\nfunction getDotPath(issue) {\n  if (issue.path) {\n    let key = \"\";\n    for (const item of issue.path) {\n      if (typeof item.key === \"string\" || typeof item.key === \"number\") {\n        if (key) {\n          key += `.${item.key}`;\n        } else {\n          key += item.key;\n        }\n      } else {\n        return null;\n      }\n    }\n    return key;\n  }\n  return null;\n}\n\n// src/utils/isOfKind/isOfKind.ts\nfunction isOfKind(kind, object2) {\n  return object2.kind === kind;\n}\n\n// src/utils/isOfType/isOfType.ts\nfunction isOfType(type, object2) {\n  return object2.type === type;\n}\n\n// src/utils/isValiError/isValiError.ts\nfunction isValiError(error) {\n  return error instanceof ValiError;\n}\n\n// src/utils/ValiError/ValiError.ts\nvar ValiError = class extends Error {\n  /**\n   * The error issues.\n   */\n  issues;\n  /**\n   * Creates a Valibot error with useful information.\n   *\n   * @param issues The error issues.\n   */\n  constructor(issues) {\n    super(issues[0].message);\n    this.name = \"ValiError\";\n    this.issues = issues;\n  }\n};\n\n// src/actions/base64/base64.ts\nfunction base64(message) {\n  return {\n    kind: \"validation\",\n    type: \"base64\",\n    reference: base64,\n    async: false,\n    expects: null,\n    requirement: BASE64_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"Base64\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/bic/bic.ts\nfunction bic(message) {\n  return {\n    kind: \"validation\",\n    type: \"bic\",\n    reference: bic,\n    async: false,\n    expects: null,\n    requirement: BIC_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"BIC\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/brand/brand.ts\nfunction brand(name) {\n  return {\n    kind: \"transformation\",\n    type: \"brand\",\n    reference: brand,\n    async: false,\n    name,\n    _run(dataset) {\n      return dataset;\n    }\n  };\n}\n\n// src/actions/bytes/bytes.ts\nfunction bytes(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"bytes\",\n    reference: bytes,\n    async: false,\n    expects: `${requirement}`,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed) {\n        const length2 = new TextEncoder().encode(dataset.value).length;\n        if (length2 !== this.requirement) {\n          _addIssue(this, \"bytes\", dataset, config2, {\n            received: `${length2}`\n          });\n        }\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/check/check.ts\nfunction check(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"check\",\n    reference: check,\n    async: false,\n    expects: null,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement(dataset.value)) {\n        _addIssue(this, \"input\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/check/checkAsync.ts\nfunction checkAsync(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"check\",\n    reference: checkAsync,\n    async: true,\n    expects: null,\n    requirement,\n    message,\n    async _run(dataset, config2) {\n      if (dataset.typed && !await this.requirement(dataset.value)) {\n        _addIssue(this, \"input\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/checkItems/checkItems.ts\nfunction checkItems(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"check_items\",\n    reference: checkItems,\n    async: false,\n    expects: null,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed) {\n        for (let index = 0; index < dataset.value.length; index++) {\n          const item = dataset.value[index];\n          if (!this.requirement(item, index, dataset.value)) {\n            _addIssue(this, \"item\", dataset, config2, {\n              input: item,\n              path: [\n                {\n                  type: \"array\",\n                  origin: \"value\",\n                  input: dataset.value,\n                  key: index,\n                  value: item\n                }\n              ]\n            });\n          }\n        }\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/creditCard/creditCard.ts\nvar CREDIT_CARD_REGEX = /^(?:\\d{14,19}|\\d{4}(?: \\d{3,6}){2,4}|\\d{4}(?:-\\d{3,6}){2,4})$/u;\nvar SANITIZE_REGEX = /[- ]/gu;\nvar PROVIDER_REGEX_LIST = [\n  // American Express\n  /^3[47]\\d{13}$/u,\n  // Diners Club\n  /^3(?:0[0-5]|[68]\\d)\\d{11,13}$/u,\n  // Discover\n  /^6(?:011|5\\d{2})\\d{12,15}$/u,\n  // JCB\n  /^(?:2131|1800|35\\d{3})\\d{11}$/u,\n  // Mastercard\n  /^5[1-5]\\d{2}|(?:222\\d|22[3-9]\\d|2[3-6]\\d{2}|27[01]\\d|2720)\\d{12}$/u,\n  // UnionPay\n  /^(?:6[27]\\d{14,17}|81\\d{14,17})$/u,\n  // Visa\n  /^4\\d{12}(?:\\d{3,6})?$/u\n];\nfunction creditCard(message) {\n  return {\n    kind: \"validation\",\n    type: \"credit_card\",\n    reference: creditCard,\n    async: false,\n    expects: null,\n    requirement(input) {\n      let sanitized;\n      return CREDIT_CARD_REGEX.test(input) && // Remove any hyphens and blanks\n      (sanitized = input.replace(SANITIZE_REGEX, \"\")) && // Check if it matches a provider\n      PROVIDER_REGEX_LIST.some((regex2) => regex2.test(sanitized)) && // Check if passes luhn algorithm\n      _isLuhnAlgo(sanitized);\n    },\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement(dataset.value)) {\n        _addIssue(this, \"credit card\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/cuid2/cuid2.ts\nfunction cuid2(message) {\n  return {\n    kind: \"validation\",\n    type: \"cuid2\",\n    reference: cuid2,\n    async: false,\n    expects: null,\n    requirement: CUID2_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"Cuid2\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/decimal/decimal.ts\nfunction decimal(message) {\n  return {\n    kind: \"validation\",\n    type: \"decimal\",\n    reference: decimal,\n    async: false,\n    expects: null,\n    requirement: DECIMAL_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"decimal\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/description/description.ts\nfunction description(description_) {\n  return {\n    kind: \"metadata\",\n    type: \"description\",\n    reference: description,\n    description: description_\n  };\n}\n\n// src/actions/email/email.ts\nfunction email(message) {\n  return {\n    kind: \"validation\",\n    type: \"email\",\n    reference: email,\n    expects: null,\n    async: false,\n    requirement: EMAIL_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"email\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/emoji/emoji.ts\nfunction emoji(message) {\n  return {\n    kind: \"validation\",\n    type: \"emoji\",\n    reference: emoji,\n    async: false,\n    expects: null,\n    requirement: EMOJI_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"emoji\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/empty/empty.ts\nfunction empty(message) {\n  return {\n    kind: \"validation\",\n    type: \"empty\",\n    reference: empty,\n    async: false,\n    expects: \"0\",\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && dataset.value.length > 0) {\n        _addIssue(this, \"length\", dataset, config2, {\n          received: `${dataset.value.length}`\n        });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/endsWith/endsWith.ts\nfunction endsWith(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"ends_with\",\n    reference: endsWith,\n    async: false,\n    expects: `\"${requirement}\"`,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !dataset.value.endsWith(this.requirement)) {\n        _addIssue(this, \"end\", dataset, config2, {\n          received: `\"${dataset.value.slice(-this.requirement.length)}\"`\n        });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/everyItem/everyItem.ts\nfunction everyItem(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"every_item\",\n    reference: everyItem,\n    async: false,\n    expects: null,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !dataset.value.every(this.requirement)) {\n        _addIssue(this, \"item\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/excludes/excludes.ts\nfunction excludes(requirement, message) {\n  const received = _stringify(requirement);\n  return {\n    kind: \"validation\",\n    type: \"excludes\",\n    reference: excludes,\n    async: false,\n    expects: `!${received}`,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && dataset.value.includes(this.requirement)) {\n        _addIssue(this, \"content\", dataset, config2, { received });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/filterItems/filterItems.ts\nfunction filterItems(operation) {\n  return {\n    kind: \"transformation\",\n    type: \"filter_items\",\n    reference: filterItems,\n    async: false,\n    operation,\n    _run(dataset) {\n      dataset.value = dataset.value.filter(this.operation);\n      return dataset;\n    }\n  };\n}\n\n// src/actions/findItem/findItem.ts\nfunction findItem(operation) {\n  return {\n    kind: \"transformation\",\n    type: \"find_item\",\n    reference: findItem,\n    async: false,\n    operation,\n    _run(dataset) {\n      dataset.value = dataset.value.find(this.operation);\n      return dataset;\n    }\n  };\n}\n\n// src/actions/finite/finite.ts\nfunction finite(message) {\n  return {\n    kind: \"validation\",\n    type: \"finite\",\n    reference: finite,\n    async: false,\n    expects: null,\n    requirement: Number.isFinite,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement(dataset.value)) {\n        _addIssue(this, \"finite\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/hash/hash.ts\nvar HASH_LENGTHS = {\n  md4: 32,\n  md5: 32,\n  sha1: 40,\n  sha256: 64,\n  sha384: 96,\n  sha512: 128,\n  ripemd128: 32,\n  ripemd160: 40,\n  tiger128: 32,\n  tiger160: 40,\n  tiger192: 48,\n  crc32: 8,\n  crc32b: 8,\n  adler32: 8\n};\nfunction hash(types, message) {\n  return {\n    kind: \"validation\",\n    type: \"hash\",\n    reference: hash,\n    expects: null,\n    async: false,\n    requirement: RegExp(\n      types.map((type) => `^[a-f0-9]{${HASH_LENGTHS[type]}}$`).join(\"|\"),\n      \"iu\"\n    ),\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"hash\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/hexadecimal/hexadecimal.ts\nfunction hexadecimal(message) {\n  return {\n    kind: \"validation\",\n    type: \"hexadecimal\",\n    reference: hexadecimal,\n    async: false,\n    expects: null,\n    requirement: HEXADECIMAL_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"hexadecimal\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/hexColor/hexColor.ts\nfunction hexColor(message) {\n  return {\n    kind: \"validation\",\n    type: \"hex_color\",\n    reference: hexColor,\n    async: false,\n    expects: null,\n    requirement: HEX_COLOR_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"hex color\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/imei/imei.ts\nfunction imei(message) {\n  return {\n    kind: \"validation\",\n    type: \"imei\",\n    reference: imei,\n    async: false,\n    expects: null,\n    requirement(input) {\n      return IMEI_REGEX.test(input) && _isLuhnAlgo(input);\n    },\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement(dataset.value)) {\n        _addIssue(this, \"IMEI\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/includes/includes.ts\nfunction includes(requirement, message) {\n  const expects = _stringify(requirement);\n  return {\n    kind: \"validation\",\n    type: \"includes\",\n    reference: includes,\n    async: false,\n    expects,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !dataset.value.includes(this.requirement)) {\n        _addIssue(this, \"content\", dataset, config2, {\n          received: `!${expects}`\n        });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/integer/integer.ts\nfunction integer(message) {\n  return {\n    kind: \"validation\",\n    type: \"integer\",\n    reference: integer,\n    async: false,\n    expects: null,\n    requirement: Number.isInteger,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement(dataset.value)) {\n        _addIssue(this, \"integer\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/ip/ip.ts\nfunction ip(message) {\n  return {\n    kind: \"validation\",\n    type: \"ip\",\n    reference: ip,\n    async: false,\n    expects: null,\n    requirement: IP_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"IP\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/ipv4/ipv4.ts\nfunction ipv4(message) {\n  return {\n    kind: \"validation\",\n    type: \"ipv4\",\n    reference: ipv4,\n    async: false,\n    expects: null,\n    requirement: IPV4_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"IPv4\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/ipv6/ipv6.ts\nfunction ipv6(message) {\n  return {\n    kind: \"validation\",\n    type: \"ipv6\",\n    reference: ipv6,\n    async: false,\n    expects: null,\n    requirement: IPV6_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"IPv6\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/isoDate/isoDate.ts\nfunction isoDate(message) {\n  return {\n    kind: \"validation\",\n    type: \"iso_date\",\n    reference: isoDate,\n    async: false,\n    expects: null,\n    requirement: ISO_DATE_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"date\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/isoDateTime/isoDateTime.ts\nfunction isoDateTime(message) {\n  return {\n    kind: \"validation\",\n    type: \"iso_date_time\",\n    reference: isoDateTime,\n    async: false,\n    expects: null,\n    requirement: ISO_DATE_TIME_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"date-time\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/isoTime/isoTime.ts\nfunction isoTime(message) {\n  return {\n    kind: \"validation\",\n    type: \"iso_time\",\n    reference: isoTime,\n    async: false,\n    expects: null,\n    requirement: ISO_TIME_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"time\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/isoTimeSecond/isoTimeSecond.ts\nfunction isoTimeSecond(message) {\n  return {\n    kind: \"validation\",\n    type: \"iso_time_second\",\n    reference: isoTimeSecond,\n    async: false,\n    expects: null,\n    requirement: ISO_TIME_SECOND_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"time-second\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/isoTimestamp/isoTimestamp.ts\nfunction isoTimestamp(message) {\n  return {\n    kind: \"validation\",\n    type: \"iso_timestamp\",\n    reference: isoTimestamp,\n    async: false,\n    expects: null,\n    requirement: ISO_TIMESTAMP_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"timestamp\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/isoWeek/isoWeek.ts\nfunction isoWeek(message) {\n  return {\n    kind: \"validation\",\n    type: \"iso_week\",\n    reference: isoWeek,\n    async: false,\n    expects: null,\n    requirement: ISO_WEEK_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"week\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/length/length.ts\nfunction length(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"length\",\n    reference: length,\n    async: false,\n    expects: `${requirement}`,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && dataset.value.length !== this.requirement) {\n        _addIssue(this, \"length\", dataset, config2, {\n          received: `${dataset.value.length}`\n        });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/mac/mac.ts\nfunction mac(message) {\n  return {\n    kind: \"validation\",\n    type: \"mac\",\n    reference: mac,\n    async: false,\n    expects: null,\n    requirement: MAC_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"MAC\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/mac48/mac48.ts\nfunction mac48(message) {\n  return {\n    kind: \"validation\",\n    type: \"mac48\",\n    reference: mac48,\n    async: false,\n    expects: null,\n    requirement: MAC48_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"48-bit MAC\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/mac64/mac64.ts\nfunction mac64(message) {\n  return {\n    kind: \"validation\",\n    type: \"mac64\",\n    reference: mac64,\n    async: false,\n    expects: null,\n    requirement: MAC64_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"64-bit MAC\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/mapItems/mapItems.ts\nfunction mapItems(operation) {\n  return {\n    kind: \"transformation\",\n    type: \"map_items\",\n    reference: mapItems,\n    async: false,\n    operation,\n    _run(dataset) {\n      dataset.value = dataset.value.map(this.operation);\n      return dataset;\n    }\n  };\n}\n\n// src/actions/maxBytes/maxBytes.ts\nfunction maxBytes(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"max_bytes\",\n    reference: maxBytes,\n    async: false,\n    expects: `<=${requirement}`,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed) {\n        const length2 = new TextEncoder().encode(dataset.value).length;\n        if (length2 > this.requirement) {\n          _addIssue(this, \"bytes\", dataset, config2, {\n            received: `${length2}`\n          });\n        }\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/maxLength/maxLength.ts\nfunction maxLength(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"max_length\",\n    reference: maxLength,\n    async: false,\n    expects: `<=${requirement}`,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && dataset.value.length > this.requirement) {\n        _addIssue(this, \"length\", dataset, config2, {\n          received: `${dataset.value.length}`\n        });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/maxSize/maxSize.ts\nfunction maxSize(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"max_size\",\n    reference: maxSize,\n    async: false,\n    expects: `<=${requirement}`,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && dataset.value.size > this.requirement) {\n        _addIssue(this, \"size\", dataset, config2, {\n          received: `${dataset.value.size}`\n        });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/maxValue/maxValue.ts\nfunction maxValue(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"max_value\",\n    reference: maxValue,\n    async: false,\n    expects: `<=${requirement instanceof Date ? requirement.toJSON() : _stringify(requirement)}`,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && dataset.value > this.requirement) {\n        _addIssue(this, \"value\", dataset, config2, {\n          received: dataset.value instanceof Date ? dataset.value.toJSON() : _stringify(dataset.value)\n        });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/mimeType/mimeType.ts\nfunction mimeType(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"mime_type\",\n    reference: mimeType,\n    async: false,\n    expects: _joinExpects(\n      requirement.map((option) => `\"${option}\"`),\n      \"|\"\n    ),\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.includes(dataset.value.type)) {\n        _addIssue(this, \"MIME type\", dataset, config2, {\n          received: `\"${dataset.value.type}\"`\n        });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/minBytes/minBytes.ts\nfunction minBytes(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"min_bytes\",\n    reference: minBytes,\n    async: false,\n    expects: `>=${requirement}`,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed) {\n        const length2 = new TextEncoder().encode(dataset.value).length;\n        if (length2 < this.requirement) {\n          _addIssue(this, \"bytes\", dataset, config2, {\n            received: `${length2}`\n          });\n        }\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/minLength/minLength.ts\nfunction minLength(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"min_length\",\n    reference: minLength,\n    async: false,\n    expects: `>=${requirement}`,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && dataset.value.length < this.requirement) {\n        _addIssue(this, \"length\", dataset, config2, {\n          received: `${dataset.value.length}`\n        });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/minSize/minSize.ts\nfunction minSize(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"min_size\",\n    reference: minSize,\n    async: false,\n    expects: `>=${requirement}`,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && dataset.value.size < this.requirement) {\n        _addIssue(this, \"size\", dataset, config2, {\n          received: `${dataset.value.size}`\n        });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/minValue/minValue.ts\nfunction minValue(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"min_value\",\n    reference: minValue,\n    async: false,\n    expects: `>=${requirement instanceof Date ? requirement.toJSON() : _stringify(requirement)}`,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && dataset.value < this.requirement) {\n        _addIssue(this, \"value\", dataset, config2, {\n          received: dataset.value instanceof Date ? dataset.value.toJSON() : _stringify(dataset.value)\n        });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/multipleOf/multipleOf.ts\nfunction multipleOf(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"multiple_of\",\n    reference: multipleOf,\n    async: false,\n    expects: `%${requirement}`,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && dataset.value % this.requirement !== 0) {\n        _addIssue(this, \"multiple\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/nanoid/nanoid.ts\nfunction nanoid(message) {\n  return {\n    kind: \"validation\",\n    type: \"nanoid\",\n    reference: nanoid,\n    async: false,\n    expects: null,\n    requirement: NANO_ID_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"Nano ID\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/nonEmpty/nonEmpty.ts\nfunction nonEmpty(message) {\n  return {\n    kind: \"validation\",\n    type: \"non_empty\",\n    reference: nonEmpty,\n    async: false,\n    expects: \"!0\",\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && dataset.value.length === 0) {\n        _addIssue(this, \"length\", dataset, config2, {\n          received: \"0\"\n        });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/normalize/normalize.ts\nfunction normalize(form) {\n  return {\n    kind: \"transformation\",\n    type: \"normalize\",\n    reference: normalize,\n    async: false,\n    form,\n    _run(dataset) {\n      dataset.value = dataset.value.normalize(this.form);\n      return dataset;\n    }\n  };\n}\n\n// src/actions/notBytes/notBytes.ts\nfunction notBytes(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"not_bytes\",\n    reference: notBytes,\n    async: false,\n    expects: `!${requirement}`,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed) {\n        const length2 = new TextEncoder().encode(dataset.value).length;\n        if (length2 === this.requirement) {\n          _addIssue(this, \"bytes\", dataset, config2, {\n            received: `${length2}`\n          });\n        }\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/notLength/notLength.ts\nfunction notLength(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"not_length\",\n    reference: notLength,\n    async: false,\n    expects: `!${requirement}`,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && dataset.value.length === this.requirement) {\n        _addIssue(this, \"length\", dataset, config2, {\n          received: `${dataset.value.length}`\n        });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/notSize/notSize.ts\nfunction notSize(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"not_size\",\n    reference: notSize,\n    async: false,\n    expects: `!${requirement}`,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && dataset.value.size === this.requirement) {\n        _addIssue(this, \"size\", dataset, config2, {\n          received: `${dataset.value.size}`\n        });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/notValue/notValue.ts\nfunction notValue(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"not_value\",\n    reference: notValue,\n    async: false,\n    expects: requirement instanceof Date ? `!${requirement.toJSON()}` : `!${_stringify(requirement)}`,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && this.requirement <= dataset.value && this.requirement >= dataset.value) {\n        _addIssue(this, \"value\", dataset, config2, {\n          received: dataset.value instanceof Date ? dataset.value.toJSON() : _stringify(dataset.value)\n        });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/octal/octal.ts\nfunction octal(message) {\n  return {\n    kind: \"validation\",\n    type: \"octal\",\n    reference: octal,\n    async: false,\n    expects: null,\n    requirement: OCTAL_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"octal\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/partialCheck/utils/_isPartiallyTyped/_isPartiallyTyped.ts\nfunction _isPartiallyTyped(dataset, pathList) {\n  if (dataset.issues) {\n    for (const path of pathList) {\n      for (const issue of dataset.issues) {\n        let typed = false;\n        const bound = Math.min(path.length, issue.path?.length ?? 0);\n        for (let index = 0; index < bound; index++) {\n          if (path[index] !== issue.path[index].key) {\n            typed = true;\n            break;\n          }\n        }\n        if (!typed) {\n          return false;\n        }\n      }\n    }\n  }\n  return true;\n}\n\n// src/actions/partialCheck/partialCheck.ts\nfunction partialCheck(pathList, requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"partial_check\",\n    reference: partialCheck,\n    async: false,\n    expects: null,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (_isPartiallyTyped(dataset, pathList) && // @ts-expect-error\n      !this.requirement(dataset.value)) {\n        _addIssue(this, \"input\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/partialCheck/partialCheckAsync.ts\nfunction partialCheckAsync(pathList, requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"partial_check\",\n    reference: partialCheckAsync,\n    async: true,\n    expects: null,\n    requirement,\n    message,\n    async _run(dataset, config2) {\n      if (_isPartiallyTyped(dataset, pathList) && // @ts-expect-error\n      !await this.requirement(dataset.value)) {\n        _addIssue(this, \"input\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/rawCheck/rawCheck.ts\nfunction rawCheck(action) {\n  return {\n    kind: \"validation\",\n    type: \"raw_check\",\n    reference: rawCheck,\n    async: false,\n    expects: null,\n    _run(dataset, config2) {\n      action({\n        dataset,\n        config: config2,\n        addIssue: (info) => _addIssue(this, info?.label ?? \"input\", dataset, config2, info)\n      });\n      return dataset;\n    }\n  };\n}\n\n// src/actions/rawCheck/rawCheckAsync.ts\nfunction rawCheckAsync(action) {\n  return {\n    kind: \"validation\",\n    type: \"raw_check\",\n    reference: rawCheckAsync,\n    async: true,\n    expects: null,\n    async _run(dataset, config2) {\n      await action({\n        dataset,\n        config: config2,\n        addIssue: (info) => _addIssue(this, info?.label ?? \"input\", dataset, config2, info)\n      });\n      return dataset;\n    }\n  };\n}\n\n// src/actions/rawTransform/rawTransform.ts\nfunction rawTransform(action) {\n  return {\n    kind: \"transformation\",\n    type: \"raw_transform\",\n    reference: rawTransform,\n    async: false,\n    _run(dataset, config2) {\n      const output = action({\n        dataset,\n        config: config2,\n        addIssue: (info) => _addIssue(this, info?.label ?? \"input\", dataset, config2, info),\n        NEVER: null\n      });\n      if (dataset.issues) {\n        dataset.typed = false;\n      } else {\n        dataset.value = output;\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/rawTransform/rawTransformAsync.ts\nfunction rawTransformAsync(action) {\n  return {\n    kind: \"transformation\",\n    type: \"raw_transform\",\n    reference: rawTransformAsync,\n    async: true,\n    async _run(dataset, config2) {\n      const output = await action({\n        dataset,\n        config: config2,\n        addIssue: (info) => _addIssue(this, info?.label ?? \"input\", dataset, config2, info),\n        NEVER: null\n      });\n      if (dataset.issues) {\n        dataset.typed = false;\n      } else {\n        dataset.value = output;\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/readonly/readonly.ts\nfunction readonly() {\n  return {\n    kind: \"transformation\",\n    type: \"readonly\",\n    reference: readonly,\n    async: false,\n    _run(dataset) {\n      return dataset;\n    }\n  };\n}\n\n// src/actions/reduceItems/reduceItems.ts\nfunction reduceItems(operation, initial) {\n  return {\n    kind: \"transformation\",\n    type: \"reduce_items\",\n    reference: reduceItems,\n    async: false,\n    operation,\n    initial,\n    _run(dataset) {\n      dataset.value = dataset.value.reduce(this.operation, this.initial);\n      return dataset;\n    }\n  };\n}\n\n// src/actions/regex/regex.ts\nfunction regex(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"regex\",\n    reference: regex,\n    async: false,\n    expects: `${requirement}`,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"format\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/safeInteger/safeInteger.ts\nfunction safeInteger(message) {\n  return {\n    kind: \"validation\",\n    type: \"safe_integer\",\n    reference: safeInteger,\n    async: false,\n    expects: null,\n    requirement: Number.isSafeInteger,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement(dataset.value)) {\n        _addIssue(this, \"safe integer\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/size/size.ts\nfunction size(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"size\",\n    reference: size,\n    async: false,\n    expects: `${requirement}`,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && dataset.value.size !== this.requirement) {\n        _addIssue(this, \"size\", dataset, config2, {\n          received: `${dataset.value.size}`\n        });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/someItem/someItem.ts\nfunction someItem(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"some_item\",\n    reference: someItem,\n    async: false,\n    expects: null,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !dataset.value.some(this.requirement)) {\n        _addIssue(this, \"item\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/sortItems/sortItems.ts\nfunction sortItems(operation) {\n  return {\n    kind: \"transformation\",\n    type: \"sort_items\",\n    reference: sortItems,\n    async: false,\n    operation,\n    _run(dataset) {\n      dataset.value = dataset.value.sort(this.operation);\n      return dataset;\n    }\n  };\n}\n\n// src/actions/startsWith/startsWith.ts\nfunction startsWith(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"starts_with\",\n    reference: startsWith,\n    async: false,\n    expects: `\"${requirement}\"`,\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !dataset.value.startsWith(this.requirement)) {\n        _addIssue(this, \"start\", dataset, config2, {\n          received: `\"${dataset.value.slice(0, this.requirement.length)}\"`\n        });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/toLowerCase/toLowerCase.ts\nfunction toLowerCase() {\n  return {\n    kind: \"transformation\",\n    type: \"to_lower_case\",\n    reference: toLowerCase,\n    async: false,\n    _run(dataset) {\n      dataset.value = dataset.value.toLowerCase();\n      return dataset;\n    }\n  };\n}\n\n// src/actions/toMaxValue/toMaxValue.ts\nfunction toMaxValue(requirement) {\n  return {\n    kind: \"transformation\",\n    type: \"to_max_value\",\n    reference: toMaxValue,\n    async: false,\n    requirement,\n    _run(dataset) {\n      dataset.value = dataset.value > this.requirement ? this.requirement : dataset.value;\n      return dataset;\n    }\n  };\n}\n\n// src/actions/toMinValue/toMinValue.ts\nfunction toMinValue(requirement) {\n  return {\n    kind: \"transformation\",\n    type: \"to_min_value\",\n    reference: toMinValue,\n    async: false,\n    requirement,\n    _run(dataset) {\n      dataset.value = dataset.value < this.requirement ? this.requirement : dataset.value;\n      return dataset;\n    }\n  };\n}\n\n// src/actions/toUpperCase/toUpperCase.ts\nfunction toUpperCase() {\n  return {\n    kind: \"transformation\",\n    type: \"to_upper_case\",\n    reference: toUpperCase,\n    async: false,\n    _run(dataset) {\n      dataset.value = dataset.value.toUpperCase();\n      return dataset;\n    }\n  };\n}\n\n// src/actions/transform/transform.ts\nfunction transform(operation) {\n  return {\n    kind: \"transformation\",\n    type: \"transform\",\n    reference: transform,\n    async: false,\n    operation,\n    _run(dataset) {\n      dataset.value = this.operation(dataset.value);\n      return dataset;\n    }\n  };\n}\n\n// src/actions/transform/transformAsync.ts\nfunction transformAsync(operation) {\n  return {\n    kind: \"transformation\",\n    type: \"transform\",\n    reference: transformAsync,\n    async: true,\n    operation,\n    async _run(dataset) {\n      dataset.value = await this.operation(dataset.value);\n      return dataset;\n    }\n  };\n}\n\n// src/actions/trim/trim.ts\nfunction trim() {\n  return {\n    kind: \"transformation\",\n    type: \"trim\",\n    reference: trim,\n    async: false,\n    _run(dataset) {\n      dataset.value = dataset.value.trim();\n      return dataset;\n    }\n  };\n}\n\n// src/actions/trimEnd/trimEnd.ts\nfunction trimEnd() {\n  return {\n    kind: \"transformation\",\n    type: \"trim_end\",\n    reference: trimEnd,\n    async: false,\n    _run(dataset) {\n      dataset.value = dataset.value.trimEnd();\n      return dataset;\n    }\n  };\n}\n\n// src/actions/trimStart/trimStart.ts\nfunction trimStart() {\n  return {\n    kind: \"transformation\",\n    type: \"trim_start\",\n    reference: trimStart,\n    async: false,\n    _run(dataset) {\n      dataset.value = dataset.value.trimStart();\n      return dataset;\n    }\n  };\n}\n\n// src/actions/ulid/ulid.ts\nfunction ulid(message) {\n  return {\n    kind: \"validation\",\n    type: \"ulid\",\n    reference: ulid,\n    async: false,\n    expects: null,\n    requirement: ULID_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"ULID\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/url/url.ts\nfunction url(message) {\n  return {\n    kind: \"validation\",\n    type: \"url\",\n    reference: url,\n    async: false,\n    expects: null,\n    requirement(input) {\n      try {\n        new URL(input);\n        return true;\n      } catch {\n        return false;\n      }\n    },\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement(dataset.value)) {\n        _addIssue(this, \"URL\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/uuid/uuid.ts\nfunction uuid(message) {\n  return {\n    kind: \"validation\",\n    type: \"uuid\",\n    reference: uuid,\n    async: false,\n    expects: null,\n    requirement: UUID_REGEX,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !this.requirement.test(dataset.value)) {\n        _addIssue(this, \"UUID\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/actions/value/value.ts\nfunction value(requirement, message) {\n  return {\n    kind: \"validation\",\n    type: \"value\",\n    reference: value,\n    async: false,\n    expects: requirement instanceof Date ? requirement.toJSON() : _stringify(requirement),\n    requirement,\n    message,\n    _run(dataset, config2) {\n      if (dataset.typed && !(this.requirement <= dataset.value && this.requirement >= dataset.value)) {\n        _addIssue(this, \"value\", dataset, config2, {\n          received: dataset.value instanceof Date ? dataset.value.toJSON() : _stringify(dataset.value)\n        });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/methods/config/config.ts\nfunction config(schema, config2) {\n  return {\n    ...schema,\n    _run(dataset, config_) {\n      return schema._run(dataset, { ...config_, ...config2 });\n    }\n  };\n}\n\n// src/methods/getFallback/getFallback.ts\nfunction getFallback(schema, dataset, config2) {\n  return typeof schema.fallback === \"function\" ? (\n    // @ts-expect-error\n    schema.fallback(dataset, config2)\n  ) : (\n    // @ts-expect-error\n    schema.fallback\n  );\n}\n\n// src/methods/fallback/fallback.ts\nfunction fallback(schema, fallback2) {\n  return {\n    ...schema,\n    fallback: fallback2,\n    _run(dataset, config2) {\n      const outputDataset = schema._run(dataset, config2);\n      return outputDataset.issues ? { typed: true, value: getFallback(this, outputDataset, config2) } : outputDataset;\n    }\n  };\n}\n\n// src/methods/fallback/fallbackAsync.ts\nfunction fallbackAsync(schema, fallback2) {\n  return {\n    ...schema,\n    fallback: fallback2,\n    async: true,\n    async _run(dataset, config2) {\n      const outputDataset = await schema._run(dataset, config2);\n      return outputDataset.issues ? (\n        // @ts-expect-error\n        { typed: true, value: await getFallback(this, outputDataset, config2) }\n      ) : outputDataset;\n    }\n  };\n}\n\n// src/methods/flatten/flatten.ts\nfunction flatten(issues) {\n  const flatErrors = {};\n  for (const issue of issues) {\n    if (issue.path) {\n      const dotPath = getDotPath(issue);\n      if (dotPath) {\n        if (!flatErrors.nested) {\n          flatErrors.nested = {};\n        }\n        if (flatErrors.nested[dotPath]) {\n          flatErrors.nested[dotPath].push(issue.message);\n        } else {\n          flatErrors.nested[dotPath] = [issue.message];\n        }\n      } else {\n        if (flatErrors.other) {\n          flatErrors.other.push(issue.message);\n        } else {\n          flatErrors.other = [issue.message];\n        }\n      }\n    } else {\n      if (flatErrors.root) {\n        flatErrors.root.push(issue.message);\n      } else {\n        flatErrors.root = [issue.message];\n      }\n    }\n  }\n  return flatErrors;\n}\n\n// src/methods/forward/forward.ts\nfunction forward(action, pathKeys) {\n  return {\n    ...action,\n    _run(dataset, config2) {\n      const prevIssues = dataset.issues && [...dataset.issues];\n      action._run(dataset, config2);\n      if (dataset.issues) {\n        for (const issue of dataset.issues) {\n          if (!prevIssues?.includes(issue)) {\n            let pathInput = dataset.value;\n            for (const key of pathKeys) {\n              const pathValue = pathInput[key];\n              const pathItem = {\n                type: \"unknown\",\n                origin: \"value\",\n                input: pathInput,\n                key,\n                value: pathValue\n              };\n              if (issue.path) {\n                issue.path.push(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              if (!pathValue) {\n                break;\n              }\n              pathInput = pathValue;\n            }\n          }\n        }\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/methods/forward/forwardAsync.ts\nfunction forwardAsync(action, pathKeys) {\n  return {\n    ...action,\n    async: true,\n    async _run(dataset, config2) {\n      const prevIssues = dataset.issues && [...dataset.issues];\n      await action._run(dataset, config2);\n      if (dataset.issues) {\n        for (const issue of dataset.issues) {\n          if (!prevIssues?.includes(issue)) {\n            let pathInput = dataset.value;\n            for (const key of pathKeys) {\n              const pathValue = pathInput[key];\n              const pathItem = {\n                type: \"unknown\",\n                origin: \"value\",\n                input: pathInput,\n                key,\n                value: pathValue\n              };\n              if (issue.path) {\n                issue.path.push(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              if (!pathValue) {\n                break;\n              }\n              pathInput = pathValue;\n            }\n          }\n        }\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/methods/getDefault/getDefault.ts\nfunction getDefault(schema, dataset, config2) {\n  return typeof schema.default === \"function\" ? (\n    // @ts-expect-error\n    schema.default(dataset, config2)\n  ) : (\n    // @ts-expect-error\n    schema.default\n  );\n}\n\n// src/methods/getDefaults/getDefaults.ts\nfunction getDefaults(schema) {\n  if (\"entries\" in schema) {\n    const object2 = {};\n    for (const key in schema.entries) {\n      object2[key] = getDefaults(schema.entries[key]);\n    }\n    return object2;\n  }\n  if (\"items\" in schema) {\n    return schema.items.map(getDefaults);\n  }\n  return getDefault(schema);\n}\n\n// src/methods/getDefaults/getDefaultsAsync.ts\nasync function getDefaultsAsync(schema) {\n  if (\"entries\" in schema) {\n    return Object.fromEntries(\n      await Promise.all(\n        Object.entries(schema.entries).map(async ([key, value2]) => [\n          key,\n          await getDefaultsAsync(value2)\n        ])\n      )\n    );\n  }\n  if (\"items\" in schema) {\n    return Promise.all(schema.items.map(getDefaultsAsync));\n  }\n  return getDefault(schema);\n}\n\n// src/methods/getFallbacks/getFallbacks.ts\nfunction getFallbacks(schema) {\n  if (\"entries\" in schema) {\n    const object2 = {};\n    for (const key in schema.entries) {\n      object2[key] = getFallbacks(schema.entries[key]);\n    }\n    return object2;\n  }\n  if (\"items\" in schema) {\n    return schema.items.map(getFallbacks);\n  }\n  return getFallback(schema);\n}\n\n// src/methods/getFallbacks/getFallbacksAsync.ts\nasync function getFallbacksAsync(schema) {\n  if (\"entries\" in schema) {\n    return Object.fromEntries(\n      await Promise.all(\n        Object.entries(schema.entries).map(async ([key, value2]) => [\n          key,\n          await getFallbacksAsync(value2)\n        ])\n      )\n    );\n  }\n  if (\"items\" in schema) {\n    return Promise.all(schema.items.map(getFallbacksAsync));\n  }\n  return getFallback(schema);\n}\n\n// src/methods/is/is.ts\nfunction is(schema, input) {\n  return !schema._run({ typed: false, value: input }, { abortEarly: true }).issues;\n}\n\n// src/schemas/any/any.ts\nfunction any() {\n  return {\n    kind: \"schema\",\n    type: \"any\",\n    reference: any,\n    expects: \"any\",\n    async: false,\n    _run(dataset) {\n      dataset.typed = true;\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/array/array.ts\nfunction array(item, message) {\n  return {\n    kind: \"schema\",\n    type: \"array\",\n    reference: array,\n    expects: \"Array\",\n    async: false,\n    item,\n    message,\n    _run(dataset, config2) {\n      const input = dataset.value;\n      if (Array.isArray(input)) {\n        dataset.typed = true;\n        dataset.value = [];\n        for (let key = 0; key < input.length; key++) {\n          const value2 = input[key];\n          const itemDataset = this.item._run({ typed: false, value: value2 }, config2);\n          if (itemDataset.issues) {\n            const pathItem = {\n              type: \"array\",\n              origin: \"value\",\n              input,\n              key,\n              value: value2\n            };\n            for (const issue of itemDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = itemDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!itemDataset.typed) {\n            dataset.typed = false;\n          }\n          dataset.value.push(itemDataset.value);\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/array/arrayAsync.ts\nfunction arrayAsync(item, message) {\n  return {\n    kind: \"schema\",\n    type: \"array\",\n    reference: arrayAsync,\n    expects: \"Array\",\n    async: true,\n    item,\n    message,\n    async _run(dataset, config2) {\n      const input = dataset.value;\n      if (Array.isArray(input)) {\n        dataset.typed = true;\n        dataset.value = [];\n        const itemDatasets = await Promise.all(\n          input.map((value2) => this.item._run({ typed: false, value: value2 }, config2))\n        );\n        for (let key = 0; key < itemDatasets.length; key++) {\n          const itemDataset = itemDatasets[key];\n          if (itemDataset.issues) {\n            const pathItem = {\n              type: \"array\",\n              origin: \"value\",\n              input,\n              key,\n              value: input[key]\n            };\n            for (const issue of itemDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = itemDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!itemDataset.typed) {\n            dataset.typed = false;\n          }\n          dataset.value.push(itemDataset.value);\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/bigint/bigint.ts\nfunction bigint(message) {\n  return {\n    kind: \"schema\",\n    type: \"bigint\",\n    reference: bigint,\n    expects: \"bigint\",\n    async: false,\n    message,\n    _run(dataset, config2) {\n      if (typeof dataset.value === \"bigint\") {\n        dataset.typed = true;\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/blob/blob.ts\nfunction blob(message) {\n  return {\n    kind: \"schema\",\n    type: \"blob\",\n    reference: blob,\n    expects: \"Blob\",\n    async: false,\n    message,\n    _run(dataset, config2) {\n      if (dataset.value instanceof Blob) {\n        dataset.typed = true;\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/boolean/boolean.ts\nfunction boolean(message) {\n  return {\n    kind: \"schema\",\n    type: \"boolean\",\n    reference: boolean,\n    expects: \"boolean\",\n    async: false,\n    message,\n    _run(dataset, config2) {\n      if (typeof dataset.value === \"boolean\") {\n        dataset.typed = true;\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/custom/custom.ts\nfunction custom(check2, message) {\n  return {\n    kind: \"schema\",\n    type: \"custom\",\n    reference: custom,\n    expects: \"unknown\",\n    async: false,\n    check: check2,\n    message,\n    _run(dataset, config2) {\n      if (this.check(dataset.value)) {\n        dataset.typed = true;\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/custom/customAsync.ts\nfunction customAsync(check2, message) {\n  return {\n    kind: \"schema\",\n    type: \"custom\",\n    reference: customAsync,\n    expects: \"unknown\",\n    async: true,\n    check: check2,\n    message,\n    async _run(dataset, config2) {\n      if (await this.check(dataset.value)) {\n        dataset.typed = true;\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/date/date.ts\nfunction date(message) {\n  return {\n    kind: \"schema\",\n    type: \"date\",\n    reference: date,\n    expects: \"Date\",\n    async: false,\n    message,\n    _run(dataset, config2) {\n      if (dataset.value instanceof Date) {\n        if (!isNaN(dataset.value)) {\n          dataset.typed = true;\n        } else {\n          _addIssue(this, \"type\", dataset, config2, {\n            received: '\"Invalid Date\"'\n          });\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/enum/enum.ts\nfunction enum_(enum__, message) {\n  const options = Object.entries(enum__).filter(([key]) => isNaN(+key)).map(([, value2]) => value2);\n  return {\n    kind: \"schema\",\n    type: \"enum\",\n    reference: enum_,\n    expects: _joinExpects(options.map(_stringify), \"|\"),\n    async: false,\n    enum: enum__,\n    options,\n    message,\n    _run(dataset, config2) {\n      if (this.options.includes(dataset.value)) {\n        dataset.typed = true;\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/file/file.ts\nfunction file(message) {\n  return {\n    kind: \"schema\",\n    type: \"file\",\n    reference: file,\n    expects: \"File\",\n    async: false,\n    message,\n    _run(dataset, config2) {\n      if (dataset.value instanceof File) {\n        dataset.typed = true;\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/function/function.ts\nfunction function_(message) {\n  return {\n    kind: \"schema\",\n    type: \"function\",\n    reference: function_,\n    expects: \"Function\",\n    async: false,\n    message,\n    _run(dataset, config2) {\n      if (typeof dataset.value === \"function\") {\n        dataset.typed = true;\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/instance/instance.ts\nfunction instance(class_, message) {\n  return {\n    kind: \"schema\",\n    type: \"instance\",\n    reference: instance,\n    expects: class_.name,\n    async: false,\n    class: class_,\n    message,\n    _run(dataset, config2) {\n      if (dataset.value instanceof this.class) {\n        dataset.typed = true;\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/intersect/utils/_merge/_merge.ts\nfunction _merge(value1, value2) {\n  if (typeof value1 === typeof value2) {\n    if (value1 === value2 || value1 instanceof Date && value2 instanceof Date && +value1 === +value2) {\n      return { value: value1 };\n    }\n    if (value1 && value2 && value1.constructor === Object && value2.constructor === Object) {\n      for (const key in value2) {\n        if (key in value1) {\n          const dataset = _merge(value1[key], value2[key]);\n          if (dataset.issue) {\n            return dataset;\n          }\n          value1[key] = dataset.value;\n        } else {\n          value1[key] = value2[key];\n        }\n      }\n      return { value: value1 };\n    }\n    if (Array.isArray(value1) && Array.isArray(value2)) {\n      if (value1.length === value2.length) {\n        for (let index = 0; index < value1.length; index++) {\n          const dataset = _merge(value1[index], value2[index]);\n          if (dataset.issue) {\n            return dataset;\n          }\n          value1[index] = dataset.value;\n        }\n        return { value: value1 };\n      }\n    }\n  }\n  return { issue: true };\n}\n\n// src/schemas/intersect/intersect.ts\nfunction intersect(options, message) {\n  return {\n    kind: \"schema\",\n    type: \"intersect\",\n    reference: intersect,\n    expects: _joinExpects(\n      options.map((option) => option.expects),\n      \"&\"\n    ),\n    async: false,\n    options,\n    message,\n    _run(dataset, config2) {\n      if (this.options.length) {\n        const input = dataset.value;\n        let outputs;\n        dataset.typed = true;\n        for (const schema of this.options) {\n          const optionDataset = schema._run(\n            { typed: false, value: input },\n            config2\n          );\n          if (optionDataset.issues) {\n            if (dataset.issues) {\n              dataset.issues.push(...optionDataset.issues);\n            } else {\n              dataset.issues = optionDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!optionDataset.typed) {\n            dataset.typed = false;\n          }\n          if (dataset.typed) {\n            if (outputs) {\n              outputs.push(optionDataset.value);\n            } else {\n              outputs = [optionDataset.value];\n            }\n          }\n        }\n        if (dataset.typed) {\n          dataset.value = outputs[0];\n          for (let index = 1; index < outputs.length; index++) {\n            const mergeDataset = _merge(dataset.value, outputs[index]);\n            if (mergeDataset.issue) {\n              _addIssue(this, \"type\", dataset, config2, {\n                received: \"unknown\"\n              });\n              break;\n            }\n            dataset.value = mergeDataset.value;\n          }\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/intersect/intersectAsync.ts\nfunction intersectAsync(options, message) {\n  return {\n    kind: \"schema\",\n    type: \"intersect\",\n    reference: intersectAsync,\n    expects: _joinExpects(\n      options.map((option) => option.expects),\n      \"&\"\n    ),\n    async: true,\n    options,\n    message,\n    async _run(dataset, config2) {\n      if (this.options.length) {\n        const input = dataset.value;\n        let outputs;\n        dataset.typed = true;\n        const optionDatasets = await Promise.all(\n          this.options.map(\n            (schema) => schema._run({ typed: false, value: input }, config2)\n          )\n        );\n        for (const optionDataset of optionDatasets) {\n          if (optionDataset.issues) {\n            if (dataset.issues) {\n              dataset.issues.push(...optionDataset.issues);\n            } else {\n              dataset.issues = optionDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!optionDataset.typed) {\n            dataset.typed = false;\n          }\n          if (dataset.typed) {\n            if (outputs) {\n              outputs.push(optionDataset.value);\n            } else {\n              outputs = [optionDataset.value];\n            }\n          }\n        }\n        if (dataset.typed) {\n          dataset.value = outputs[0];\n          for (let index = 1; index < outputs.length; index++) {\n            const mergeDataset = _merge(dataset.value, outputs[index]);\n            if (mergeDataset.issue) {\n              _addIssue(this, \"type\", dataset, config2, {\n                received: \"unknown\"\n              });\n              break;\n            }\n            dataset.value = mergeDataset.value;\n          }\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/lazy/lazy.ts\nfunction lazy(getter) {\n  return {\n    kind: \"schema\",\n    type: \"lazy\",\n    reference: lazy,\n    expects: \"unknown\",\n    async: false,\n    getter,\n    _run(dataset, config2) {\n      return this.getter(dataset.value)._run(dataset, config2);\n    }\n  };\n}\n\n// src/schemas/lazy/lazyAsync.ts\nfunction lazyAsync(getter) {\n  return {\n    kind: \"schema\",\n    type: \"lazy\",\n    reference: lazyAsync,\n    expects: \"unknown\",\n    async: true,\n    getter,\n    async _run(dataset, config2) {\n      return (await this.getter(dataset.value))._run(dataset, config2);\n    }\n  };\n}\n\n// src/schemas/literal/literal.ts\nfunction literal(literal_, message) {\n  return {\n    kind: \"schema\",\n    type: \"literal\",\n    reference: literal,\n    expects: _stringify(literal_),\n    async: false,\n    literal: literal_,\n    message,\n    _run(dataset, config2) {\n      if (dataset.value === this.literal) {\n        dataset.typed = true;\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/looseObject/looseObject.ts\nfunction looseObject(entries, message) {\n  return {\n    kind: \"schema\",\n    type: \"loose_object\",\n    reference: looseObject,\n    expects: \"Object\",\n    async: false,\n    entries,\n    message,\n    _run(dataset, config2) {\n      const input = dataset.value;\n      if (input && typeof input === \"object\") {\n        dataset.typed = true;\n        dataset.value = {};\n        for (const key in this.entries) {\n          const value2 = input[key];\n          const valueDataset = this.entries[key]._run(\n            { typed: false, value: value2 },\n            config2\n          );\n          if (valueDataset.issues) {\n            const pathItem = {\n              type: \"object\",\n              origin: \"value\",\n              input,\n              key,\n              value: value2\n            };\n            for (const issue of valueDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = valueDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!valueDataset.typed) {\n            dataset.typed = false;\n          }\n          if (valueDataset.value !== void 0 || key in input) {\n            dataset.value[key] = valueDataset.value;\n          }\n        }\n        if (!dataset.issues || !config2.abortEarly) {\n          for (const key in input) {\n            if (_isValidObjectKey(input, key) && !(key in this.entries)) {\n              dataset.value[key] = input[key];\n            }\n          }\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/looseObject/looseObjectAsync.ts\nfunction looseObjectAsync(entries, message) {\n  return {\n    kind: \"schema\",\n    type: \"loose_object\",\n    reference: looseObjectAsync,\n    expects: \"Object\",\n    async: true,\n    entries,\n    message,\n    async _run(dataset, config2) {\n      const input = dataset.value;\n      if (input && typeof input === \"object\") {\n        dataset.typed = true;\n        dataset.value = {};\n        const valueDatasets = await Promise.all(\n          Object.entries(this.entries).map(async ([key, schema]) => {\n            const value2 = input[key];\n            return [\n              key,\n              value2,\n              await schema._run({ typed: false, value: value2 }, config2)\n            ];\n          })\n        );\n        for (const [key, value2, valueDataset] of valueDatasets) {\n          if (valueDataset.issues) {\n            const pathItem = {\n              type: \"object\",\n              origin: \"value\",\n              input,\n              key,\n              value: value2\n            };\n            for (const issue of valueDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = valueDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!valueDataset.typed) {\n            dataset.typed = false;\n          }\n          if (valueDataset.value !== void 0 || key in input) {\n            dataset.value[key] = valueDataset.value;\n          }\n        }\n        if (!dataset.issues || !config2.abortEarly) {\n          for (const key in input) {\n            if (_isValidObjectKey(input, key) && !(key in this.entries)) {\n              dataset.value[key] = input[key];\n            }\n          }\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/looseTuple/looseTuple.ts\nfunction looseTuple(items, message) {\n  return {\n    kind: \"schema\",\n    type: \"loose_tuple\",\n    reference: looseTuple,\n    expects: \"Array\",\n    async: false,\n    items,\n    message,\n    _run(dataset, config2) {\n      const input = dataset.value;\n      if (Array.isArray(input)) {\n        dataset.typed = true;\n        dataset.value = [];\n        for (let key = 0; key < this.items.length; key++) {\n          const value2 = input[key];\n          const itemDataset = this.items[key]._run(\n            { typed: false, value: value2 },\n            config2\n          );\n          if (itemDataset.issues) {\n            const pathItem = {\n              type: \"array\",\n              origin: \"value\",\n              input,\n              key,\n              value: value2\n            };\n            for (const issue of itemDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = itemDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!itemDataset.typed) {\n            dataset.typed = false;\n          }\n          dataset.value.push(itemDataset.value);\n        }\n        if (!dataset.issues || !config2.abortEarly) {\n          for (let key = this.items.length; key < input.length; key++) {\n            dataset.value.push(input[key]);\n          }\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/looseTuple/looseTupleAsync.ts\nfunction looseTupleAsync(items, message) {\n  return {\n    kind: \"schema\",\n    type: \"loose_tuple\",\n    reference: looseTupleAsync,\n    expects: \"Array\",\n    async: true,\n    items,\n    message,\n    async _run(dataset, config2) {\n      const input = dataset.value;\n      if (Array.isArray(input)) {\n        dataset.typed = true;\n        dataset.value = [];\n        const itemDatasets = await Promise.all(\n          this.items.map(async (item, key) => {\n            const value2 = input[key];\n            return [\n              key,\n              value2,\n              await item._run({ typed: false, value: value2 }, config2)\n            ];\n          })\n        );\n        for (const [key, value2, itemDataset] of itemDatasets) {\n          if (itemDataset.issues) {\n            const pathItem = {\n              type: \"array\",\n              origin: \"value\",\n              input,\n              key,\n              value: value2\n            };\n            for (const issue of itemDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = itemDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!itemDataset.typed) {\n            dataset.typed = false;\n          }\n          dataset.value.push(itemDataset.value);\n        }\n        if (!dataset.issues || !config2.abortEarly) {\n          for (let key = this.items.length; key < input.length; key++) {\n            dataset.value.push(input[key]);\n          }\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/map/map.ts\nfunction map(key, value2, message) {\n  return {\n    kind: \"schema\",\n    type: \"map\",\n    reference: map,\n    expects: \"Map\",\n    async: false,\n    key,\n    value: value2,\n    message,\n    _run(dataset, config2) {\n      const input = dataset.value;\n      if (input instanceof Map) {\n        dataset.typed = true;\n        dataset.value = /* @__PURE__ */ new Map();\n        for (const [inputKey, inputValue] of input) {\n          const keyDataset = this.key._run(\n            { typed: false, value: inputKey },\n            config2\n          );\n          if (keyDataset.issues) {\n            const pathItem = {\n              type: \"map\",\n              origin: \"key\",\n              input,\n              key: inputKey,\n              value: inputValue\n            };\n            for (const issue of keyDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = keyDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          const valueDataset = this.value._run(\n            { typed: false, value: inputValue },\n            config2\n          );\n          if (valueDataset.issues) {\n            const pathItem = {\n              type: \"map\",\n              origin: \"value\",\n              input,\n              key: inputKey,\n              value: inputValue\n            };\n            for (const issue of valueDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = valueDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!keyDataset.typed || !valueDataset.typed) {\n            dataset.typed = false;\n          }\n          dataset.value.set(keyDataset.value, valueDataset.value);\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/map/mapAsync.ts\nfunction mapAsync(key, value2, message) {\n  return {\n    kind: \"schema\",\n    type: \"map\",\n    reference: mapAsync,\n    expects: \"Map\",\n    async: true,\n    key,\n    value: value2,\n    message,\n    async _run(dataset, config2) {\n      const input = dataset.value;\n      if (input instanceof Map) {\n        dataset.typed = true;\n        dataset.value = /* @__PURE__ */ new Map();\n        const datasets = await Promise.all(\n          [...input].map(\n            ([inputKey, inputValue]) => Promise.all([\n              inputKey,\n              inputValue,\n              this.key._run({ typed: false, value: inputKey }, config2),\n              this.value._run({ typed: false, value: inputValue }, config2)\n            ])\n          )\n        );\n        for (const [\n          inputKey,\n          inputValue,\n          keyDataset,\n          valueDataset\n        ] of datasets) {\n          if (keyDataset.issues) {\n            const pathItem = {\n              type: \"map\",\n              origin: \"key\",\n              input,\n              key: inputKey,\n              value: inputValue\n            };\n            for (const issue of keyDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = keyDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (valueDataset.issues) {\n            const pathItem = {\n              type: \"map\",\n              origin: \"value\",\n              input,\n              key: inputKey,\n              value: inputValue\n            };\n            for (const issue of valueDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = valueDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!keyDataset.typed || !valueDataset.typed) {\n            dataset.typed = false;\n          }\n          dataset.value.set(keyDataset.value, valueDataset.value);\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/nan/nan.ts\nfunction nan(message) {\n  return {\n    kind: \"schema\",\n    type: \"nan\",\n    reference: nan,\n    expects: \"NaN\",\n    async: false,\n    message,\n    _run(dataset, config2) {\n      if (Number.isNaN(dataset.value)) {\n        dataset.typed = true;\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/never/never.ts\nfunction never(message) {\n  return {\n    kind: \"schema\",\n    type: \"never\",\n    reference: never,\n    expects: \"never\",\n    async: false,\n    message,\n    _run(dataset, config2) {\n      _addIssue(this, \"type\", dataset, config2);\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/nonNullable/nonNullable.ts\nfunction nonNullable(wrapped, message) {\n  return {\n    kind: \"schema\",\n    type: \"non_nullable\",\n    reference: nonNullable,\n    expects: \"!null\",\n    async: false,\n    wrapped,\n    message,\n    _run(dataset, config2) {\n      if (dataset.value === null) {\n        _addIssue(this, \"type\", dataset, config2);\n        return dataset;\n      }\n      return this.wrapped._run(dataset, config2);\n    }\n  };\n}\n\n// src/schemas/nonNullable/nonNullableAsync.ts\nfunction nonNullableAsync(wrapped, message) {\n  return {\n    kind: \"schema\",\n    type: \"non_nullable\",\n    reference: nonNullableAsync,\n    expects: \"!null\",\n    async: true,\n    wrapped,\n    message,\n    async _run(dataset, config2) {\n      if (dataset.value === null) {\n        _addIssue(this, \"type\", dataset, config2);\n        return dataset;\n      }\n      return this.wrapped._run(dataset, config2);\n    }\n  };\n}\n\n// src/schemas/nonNullish/nonNullish.ts\nfunction nonNullish(wrapped, message) {\n  return {\n    kind: \"schema\",\n    type: \"non_nullish\",\n    reference: nonNullish,\n    expects: \"(!null & !undefined)\",\n    async: false,\n    wrapped,\n    message,\n    _run(dataset, config2) {\n      if (dataset.value === null || dataset.value === void 0) {\n        _addIssue(this, \"type\", dataset, config2);\n        return dataset;\n      }\n      return this.wrapped._run(dataset, config2);\n    }\n  };\n}\n\n// src/schemas/nonNullish/nonNullishAsync.ts\nfunction nonNullishAsync(wrapped, message) {\n  return {\n    kind: \"schema\",\n    type: \"non_nullish\",\n    reference: nonNullishAsync,\n    expects: \"(!null & !undefined)\",\n    async: true,\n    wrapped,\n    message,\n    async _run(dataset, config2) {\n      if (dataset.value === null || dataset.value === void 0) {\n        _addIssue(this, \"type\", dataset, config2);\n        return dataset;\n      }\n      return this.wrapped._run(dataset, config2);\n    }\n  };\n}\n\n// src/schemas/nonOptional/nonOptional.ts\nfunction nonOptional(wrapped, message) {\n  return {\n    kind: \"schema\",\n    type: \"non_optional\",\n    reference: nonOptional,\n    expects: \"!undefined\",\n    async: false,\n    wrapped,\n    message,\n    _run(dataset, config2) {\n      if (dataset.value === void 0) {\n        _addIssue(this, \"type\", dataset, config2);\n        return dataset;\n      }\n      return this.wrapped._run(dataset, config2);\n    }\n  };\n}\n\n// src/schemas/nonOptional/nonOptionalAsync.ts\nfunction nonOptionalAsync(wrapped, message) {\n  return {\n    kind: \"schema\",\n    type: \"non_optional\",\n    reference: nonOptionalAsync,\n    expects: \"!undefined\",\n    async: true,\n    wrapped,\n    message,\n    async _run(dataset, config2) {\n      if (dataset.value === void 0) {\n        _addIssue(this, \"type\", dataset, config2);\n        return dataset;\n      }\n      return this.wrapped._run(dataset, config2);\n    }\n  };\n}\n\n// src/schemas/null/null.ts\nfunction null_(message) {\n  return {\n    kind: \"schema\",\n    type: \"null\",\n    reference: null_,\n    expects: \"null\",\n    async: false,\n    message,\n    _run(dataset, config2) {\n      if (dataset.value === null) {\n        dataset.typed = true;\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/nullable/nullable.ts\nfunction nullable(wrapped, ...args) {\n  const schema = {\n    kind: \"schema\",\n    type: \"nullable\",\n    reference: nullable,\n    expects: `(${wrapped.expects} | null)`,\n    async: false,\n    wrapped,\n    _run(dataset, config2) {\n      if (dataset.value === null) {\n        if (\"default\" in this) {\n          dataset.value = getDefault(\n            this,\n            dataset,\n            config2\n          );\n        }\n        if (dataset.value === null) {\n          dataset.typed = true;\n          return dataset;\n        }\n      }\n      return this.wrapped._run(dataset, config2);\n    }\n  };\n  if (0 in args) {\n    schema.default = args[0];\n  }\n  return schema;\n}\n\n// src/schemas/nullable/nullableAsync.ts\nfunction nullableAsync(wrapped, ...args) {\n  const schema = {\n    kind: \"schema\",\n    type: \"nullable\",\n    reference: nullableAsync,\n    expects: `(${wrapped.expects} | null)`,\n    async: true,\n    wrapped,\n    async _run(dataset, config2) {\n      if (dataset.value === null) {\n        if (\"default\" in this) {\n          dataset.value = await getDefault(\n            this,\n            dataset,\n            config2\n          );\n        }\n        if (dataset.value === null) {\n          dataset.typed = true;\n          return dataset;\n        }\n      }\n      return this.wrapped._run(dataset, config2);\n    }\n  };\n  if (0 in args) {\n    schema.default = args[0];\n  }\n  return schema;\n}\n\n// src/schemas/nullish/nullish.ts\nfunction nullish(wrapped, ...args) {\n  const schema = {\n    kind: \"schema\",\n    type: \"nullish\",\n    reference: nullish,\n    expects: `(${wrapped.expects} | null | undefined)`,\n    async: false,\n    wrapped,\n    _run(dataset, config2) {\n      if (dataset.value === null || dataset.value === void 0) {\n        if (\"default\" in this) {\n          dataset.value = getDefault(\n            this,\n            dataset,\n            config2\n          );\n        }\n        if (dataset.value === null || dataset.value === void 0) {\n          dataset.typed = true;\n          return dataset;\n        }\n      }\n      return this.wrapped._run(dataset, config2);\n    }\n  };\n  if (0 in args) {\n    schema.default = args[0];\n  }\n  return schema;\n}\n\n// src/schemas/nullish/nullishAsync.ts\nfunction nullishAsync(wrapped, ...args) {\n  const schema = {\n    kind: \"schema\",\n    type: \"nullish\",\n    reference: nullishAsync,\n    expects: `(${wrapped.expects} | null | undefined)`,\n    async: true,\n    wrapped,\n    async _run(dataset, config2) {\n      if (dataset.value === null || dataset.value === void 0) {\n        if (\"default\" in this) {\n          dataset.value = await getDefault(\n            this,\n            dataset,\n            config2\n          );\n        }\n        if (dataset.value === null || dataset.value === void 0) {\n          dataset.typed = true;\n          return dataset;\n        }\n      }\n      return this.wrapped._run(dataset, config2);\n    }\n  };\n  if (0 in args) {\n    schema.default = args[0];\n  }\n  return schema;\n}\n\n// src/schemas/number/number.ts\nfunction number(message) {\n  return {\n    kind: \"schema\",\n    type: \"number\",\n    reference: number,\n    expects: \"number\",\n    async: false,\n    message,\n    _run(dataset, config2) {\n      if (typeof dataset.value === \"number\" && !isNaN(dataset.value)) {\n        dataset.typed = true;\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/object/object.ts\nfunction object(entries, message) {\n  return {\n    kind: \"schema\",\n    type: \"object\",\n    reference: object,\n    expects: \"Object\",\n    async: false,\n    entries,\n    message,\n    _run(dataset, config2) {\n      const input = dataset.value;\n      if (input && typeof input === \"object\") {\n        dataset.typed = true;\n        dataset.value = {};\n        for (const key in this.entries) {\n          const value2 = input[key];\n          const valueDataset = this.entries[key]._run(\n            { typed: false, value: value2 },\n            config2\n          );\n          if (valueDataset.issues) {\n            const pathItem = {\n              type: \"object\",\n              origin: \"value\",\n              input,\n              key,\n              value: value2\n            };\n            for (const issue of valueDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = valueDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!valueDataset.typed) {\n            dataset.typed = false;\n          }\n          if (valueDataset.value !== void 0 || key in input) {\n            dataset.value[key] = valueDataset.value;\n          }\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/object/objectAsync.ts\nfunction objectAsync(entries, message) {\n  return {\n    kind: \"schema\",\n    type: \"object\",\n    reference: objectAsync,\n    expects: \"Object\",\n    async: true,\n    entries,\n    message,\n    async _run(dataset, config2) {\n      const input = dataset.value;\n      if (input && typeof input === \"object\") {\n        dataset.typed = true;\n        dataset.value = {};\n        const valueDatasets = await Promise.all(\n          Object.entries(this.entries).map(async ([key, schema]) => {\n            const value2 = input[key];\n            return [\n              key,\n              value2,\n              await schema._run({ typed: false, value: value2 }, config2)\n            ];\n          })\n        );\n        for (const [key, value2, valueDataset] of valueDatasets) {\n          if (valueDataset.issues) {\n            const pathItem = {\n              type: \"object\",\n              origin: \"value\",\n              input,\n              key,\n              value: value2\n            };\n            for (const issue of valueDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = valueDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!valueDataset.typed) {\n            dataset.typed = false;\n          }\n          if (valueDataset.value !== void 0 || key in input) {\n            dataset.value[key] = valueDataset.value;\n          }\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/objectWithRest/objectWithRest.ts\nfunction objectWithRest(entries, rest, message) {\n  return {\n    kind: \"schema\",\n    type: \"object_with_rest\",\n    reference: objectWithRest,\n    expects: \"Object\",\n    async: false,\n    entries,\n    rest,\n    message,\n    _run(dataset, config2) {\n      const input = dataset.value;\n      if (input && typeof input === \"object\") {\n        dataset.typed = true;\n        dataset.value = {};\n        for (const key in this.entries) {\n          const value2 = input[key];\n          const valueDataset = this.entries[key]._run(\n            { typed: false, value: value2 },\n            config2\n          );\n          if (valueDataset.issues) {\n            const pathItem = {\n              type: \"object\",\n              origin: \"value\",\n              input,\n              key,\n              value: value2\n            };\n            for (const issue of valueDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = valueDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!valueDataset.typed) {\n            dataset.typed = false;\n          }\n          if (valueDataset.value !== void 0 || key in input) {\n            dataset.value[key] = valueDataset.value;\n          }\n        }\n        if (!dataset.issues || !config2.abortEarly) {\n          for (const key in input) {\n            if (_isValidObjectKey(input, key) && !(key in this.entries)) {\n              const value2 = input[key];\n              const valueDataset = this.rest._run(\n                { typed: false, value: value2 },\n                config2\n              );\n              if (valueDataset.issues) {\n                const pathItem = {\n                  type: \"object\",\n                  origin: \"value\",\n                  input,\n                  key,\n                  value: value2\n                };\n                for (const issue of valueDataset.issues) {\n                  if (issue.path) {\n                    issue.path.unshift(pathItem);\n                  } else {\n                    issue.path = [pathItem];\n                  }\n                  dataset.issues?.push(issue);\n                }\n                if (!dataset.issues) {\n                  dataset.issues = valueDataset.issues;\n                }\n                if (config2.abortEarly) {\n                  dataset.typed = false;\n                  break;\n                }\n              }\n              if (!valueDataset.typed) {\n                dataset.typed = false;\n              }\n              dataset.value[key] = valueDataset.value;\n            }\n          }\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/objectWithRest/objectWithRestAsync.ts\nfunction objectWithRestAsync(entries, rest, message) {\n  return {\n    kind: \"schema\",\n    type: \"object_with_rest\",\n    reference: objectWithRestAsync,\n    expects: \"Object\",\n    async: true,\n    entries,\n    rest,\n    message,\n    async _run(dataset, config2) {\n      const input = dataset.value;\n      if (input && typeof input === \"object\") {\n        dataset.typed = true;\n        dataset.value = {};\n        const [normalDatasets, restDatasets] = await Promise.all([\n          // Parse schema of each normal entry\n          // Hint: We do not distinguish between missing and `undefined` entries.\n          // The reason for this decision is that it reduces the bundle size, and\n          // we also expect that most users will expect this behavior.\n          Promise.all(\n            Object.entries(this.entries).map(async ([key, schema]) => {\n              const value2 = input[key];\n              return [\n                key,\n                value2,\n                await schema._run({ typed: false, value: value2 }, config2)\n              ];\n            })\n          ),\n          // Parse other entries with rest schema\n          // Hint: We exclude specific keys for security reasons\n          Promise.all(\n            Object.entries(input).filter(\n              ([key]) => _isValidObjectKey(input, key) && !(key in this.entries)\n            ).map(\n              async ([key, value2]) => [\n                key,\n                value2,\n                await this.rest._run({ typed: false, value: value2 }, config2)\n              ]\n            )\n          )\n        ]);\n        for (const [key, value2, valueDataset] of normalDatasets) {\n          if (valueDataset.issues) {\n            const pathItem = {\n              type: \"object\",\n              origin: \"value\",\n              input,\n              key,\n              value: value2\n            };\n            for (const issue of valueDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = valueDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!valueDataset.typed) {\n            dataset.typed = false;\n          }\n          if (valueDataset.value !== void 0 || key in input) {\n            dataset.value[key] = valueDataset.value;\n          }\n        }\n        if (!dataset.issues || !config2.abortEarly) {\n          for (const [key, value2, valueDataset] of restDatasets) {\n            if (valueDataset.issues) {\n              const pathItem = {\n                type: \"object\",\n                origin: \"value\",\n                input,\n                key,\n                value: value2\n              };\n              for (const issue of valueDataset.issues) {\n                if (issue.path) {\n                  issue.path.unshift(pathItem);\n                } else {\n                  issue.path = [pathItem];\n                }\n                dataset.issues?.push(issue);\n              }\n              if (!dataset.issues) {\n                dataset.issues = valueDataset.issues;\n              }\n              if (config2.abortEarly) {\n                dataset.typed = false;\n                break;\n              }\n            }\n            if (!valueDataset.typed) {\n              dataset.typed = false;\n            }\n            dataset.value[key] = valueDataset.value;\n          }\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/optional/optional.ts\nfunction optional(wrapped, ...args) {\n  const schema = {\n    kind: \"schema\",\n    type: \"optional\",\n    reference: optional,\n    expects: `(${wrapped.expects} | undefined)`,\n    async: false,\n    wrapped,\n    _run(dataset, config2) {\n      if (dataset.value === void 0) {\n        if (\"default\" in this) {\n          dataset.value = getDefault(\n            this,\n            dataset,\n            config2\n          );\n        }\n        if (dataset.value === void 0) {\n          dataset.typed = true;\n          return dataset;\n        }\n      }\n      return this.wrapped._run(dataset, config2);\n    }\n  };\n  if (0 in args) {\n    schema.default = args[0];\n  }\n  return schema;\n}\n\n// src/schemas/optional/optionalAsync.ts\nfunction optionalAsync(wrapped, ...args) {\n  const schema = {\n    kind: \"schema\",\n    type: \"optional\",\n    reference: optionalAsync,\n    expects: `(${wrapped.expects} | undefined)`,\n    async: true,\n    wrapped,\n    async _run(dataset, config2) {\n      if (dataset.value === void 0) {\n        if (\"default\" in this) {\n          dataset.value = await getDefault(\n            this,\n            dataset,\n            config2\n          );\n        }\n        if (dataset.value === void 0) {\n          dataset.typed = true;\n          return dataset;\n        }\n      }\n      return this.wrapped._run(dataset, config2);\n    }\n  };\n  if (0 in args) {\n    schema.default = args[0];\n  }\n  return schema;\n}\n\n// src/schemas/picklist/picklist.ts\nfunction picklist(options, message) {\n  return {\n    kind: \"schema\",\n    type: \"picklist\",\n    reference: picklist,\n    expects: _joinExpects(options.map(_stringify), \"|\"),\n    async: false,\n    options,\n    message,\n    _run(dataset, config2) {\n      if (this.options.includes(dataset.value)) {\n        dataset.typed = true;\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/promise/promise.ts\nfunction promise(message) {\n  return {\n    kind: \"schema\",\n    type: \"promise\",\n    reference: promise,\n    expects: \"Promise\",\n    async: false,\n    message,\n    _run(dataset, config2) {\n      if (dataset.value instanceof Promise) {\n        dataset.typed = true;\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/record/record.ts\nfunction record(key, value2, message) {\n  return {\n    kind: \"schema\",\n    type: \"record\",\n    reference: record,\n    expects: \"Object\",\n    async: false,\n    key,\n    value: value2,\n    message,\n    _run(dataset, config2) {\n      const input = dataset.value;\n      if (input && typeof input === \"object\") {\n        dataset.typed = true;\n        dataset.value = {};\n        for (const entryKey in input) {\n          if (_isValidObjectKey(input, entryKey)) {\n            const entryValue = input[entryKey];\n            const keyDataset = this.key._run(\n              { typed: false, value: entryKey },\n              config2\n            );\n            if (keyDataset.issues) {\n              const pathItem = {\n                type: \"object\",\n                origin: \"key\",\n                input,\n                key: entryKey,\n                value: entryValue\n              };\n              for (const issue of keyDataset.issues) {\n                issue.path = [pathItem];\n                dataset.issues?.push(issue);\n              }\n              if (!dataset.issues) {\n                dataset.issues = keyDataset.issues;\n              }\n              if (config2.abortEarly) {\n                dataset.typed = false;\n                break;\n              }\n            }\n            const valueDataset = this.value._run(\n              { typed: false, value: entryValue },\n              config2\n            );\n            if (valueDataset.issues) {\n              const pathItem = {\n                type: \"object\",\n                origin: \"value\",\n                input,\n                key: entryKey,\n                value: entryValue\n              };\n              for (const issue of valueDataset.issues) {\n                if (issue.path) {\n                  issue.path.unshift(pathItem);\n                } else {\n                  issue.path = [pathItem];\n                }\n                dataset.issues?.push(issue);\n              }\n              if (!dataset.issues) {\n                dataset.issues = valueDataset.issues;\n              }\n              if (config2.abortEarly) {\n                dataset.typed = false;\n                break;\n              }\n            }\n            if (!keyDataset.typed || !valueDataset.typed) {\n              dataset.typed = false;\n            }\n            if (keyDataset.typed) {\n              dataset.value[keyDataset.value] = valueDataset.value;\n            }\n          }\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/record/recordAsync.ts\nfunction recordAsync(key, value2, message) {\n  return {\n    kind: \"schema\",\n    type: \"record\",\n    reference: recordAsync,\n    expects: \"Object\",\n    async: true,\n    key,\n    value: value2,\n    message,\n    async _run(dataset, config2) {\n      const input = dataset.value;\n      if (input && typeof input === \"object\") {\n        dataset.typed = true;\n        dataset.value = {};\n        const datasets = await Promise.all(\n          Object.entries(input).filter(([key2]) => _isValidObjectKey(input, key2)).map(\n            ([entryKey, entryValue]) => Promise.all([\n              entryKey,\n              entryValue,\n              this.key._run({ typed: false, value: entryKey }, config2),\n              this.value._run({ typed: false, value: entryValue }, config2)\n            ])\n          )\n        );\n        for (const [\n          entryKey,\n          entryValue,\n          keyDataset,\n          valueDataset\n        ] of datasets) {\n          if (keyDataset.issues) {\n            const pathItem = {\n              type: \"object\",\n              origin: \"key\",\n              input,\n              key: entryKey,\n              value: entryValue\n            };\n            for (const issue of keyDataset.issues) {\n              issue.path = [pathItem];\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = keyDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (valueDataset.issues) {\n            const pathItem = {\n              type: \"object\",\n              origin: \"value\",\n              input,\n              key: entryKey,\n              value: entryValue\n            };\n            for (const issue of valueDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = valueDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!keyDataset.typed || !valueDataset.typed) {\n            dataset.typed = false;\n          }\n          if (keyDataset.typed) {\n            dataset.value[keyDataset.value] = valueDataset.value;\n          }\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/set/set.ts\nfunction set(value2, message) {\n  return {\n    kind: \"schema\",\n    type: \"set\",\n    reference: set,\n    expects: \"Set\",\n    async: false,\n    value: value2,\n    message,\n    _run(dataset, config2) {\n      const input = dataset.value;\n      if (input instanceof Set) {\n        dataset.typed = true;\n        dataset.value = /* @__PURE__ */ new Set();\n        for (const inputValue of input) {\n          const valueDataset = this.value._run(\n            { typed: false, value: inputValue },\n            config2\n          );\n          if (valueDataset.issues) {\n            const pathItem = {\n              type: \"set\",\n              origin: \"value\",\n              input,\n              key: null,\n              value: inputValue\n            };\n            for (const issue of valueDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = valueDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!valueDataset.typed) {\n            dataset.typed = false;\n          }\n          dataset.value.add(valueDataset.value);\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/set/setAsync.ts\nfunction setAsync(value2, message) {\n  return {\n    kind: \"schema\",\n    type: \"set\",\n    reference: setAsync,\n    expects: \"Set\",\n    async: true,\n    value: value2,\n    message,\n    async _run(dataset, config2) {\n      const input = dataset.value;\n      if (input instanceof Set) {\n        dataset.typed = true;\n        dataset.value = /* @__PURE__ */ new Set();\n        const valueDatasets = await Promise.all(\n          [...input].map(\n            async (inputValue) => [\n              inputValue,\n              await this.value._run(\n                { typed: false, value: inputValue },\n                config2\n              )\n            ]\n          )\n        );\n        for (const [inputValue, valueDataset] of valueDatasets) {\n          if (valueDataset.issues) {\n            const pathItem = {\n              type: \"set\",\n              origin: \"value\",\n              input,\n              key: null,\n              value: inputValue\n            };\n            for (const issue of valueDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = valueDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!valueDataset.typed) {\n            dataset.typed = false;\n          }\n          dataset.value.add(valueDataset.value);\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/strictObject/strictObject.ts\nfunction strictObject(entries, message) {\n  return {\n    kind: \"schema\",\n    type: \"strict_object\",\n    reference: strictObject,\n    expects: \"Object\",\n    async: false,\n    entries,\n    message,\n    _run(dataset, config2) {\n      const input = dataset.value;\n      if (input && typeof input === \"object\") {\n        dataset.typed = true;\n        dataset.value = {};\n        for (const key in this.entries) {\n          const value2 = input[key];\n          const valueDataset = this.entries[key]._run(\n            { typed: false, value: value2 },\n            config2\n          );\n          if (valueDataset.issues) {\n            const pathItem = {\n              type: \"object\",\n              origin: \"value\",\n              input,\n              key,\n              value: value2\n            };\n            for (const issue of valueDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = valueDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!valueDataset.typed) {\n            dataset.typed = false;\n          }\n          if (valueDataset.value !== void 0 || key in input) {\n            dataset.value[key] = valueDataset.value;\n          }\n        }\n        if (!dataset.issues || !config2.abortEarly) {\n          for (const key in input) {\n            if (!(key in this.entries)) {\n              const value2 = input[key];\n              _addIssue(this, \"type\", dataset, config2, {\n                input: value2,\n                expected: \"never\",\n                path: [\n                  {\n                    type: \"object\",\n                    origin: \"value\",\n                    input,\n                    key,\n                    value: value2\n                  }\n                ]\n              });\n              break;\n            }\n          }\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/strictObject/strictObjectAsync.ts\nfunction strictObjectAsync(entries, message) {\n  return {\n    kind: \"schema\",\n    type: \"strict_object\",\n    reference: strictObjectAsync,\n    expects: \"Object\",\n    async: true,\n    entries,\n    message,\n    async _run(dataset, config2) {\n      const input = dataset.value;\n      if (input && typeof input === \"object\") {\n        dataset.typed = true;\n        dataset.value = {};\n        const valueDatasets = await Promise.all(\n          Object.entries(this.entries).map(async ([key, schema]) => {\n            const value2 = input[key];\n            return [\n              key,\n              value2,\n              await schema._run({ typed: false, value: value2 }, config2)\n            ];\n          })\n        );\n        for (const [key, value2, valueDataset] of valueDatasets) {\n          if (valueDataset.issues) {\n            const pathItem = {\n              type: \"object\",\n              origin: \"value\",\n              input,\n              key,\n              value: value2\n            };\n            for (const issue of valueDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = valueDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!valueDataset.typed) {\n            dataset.typed = false;\n          }\n          if (valueDataset.value !== void 0 || key in input) {\n            dataset.value[key] = valueDataset.value;\n          }\n        }\n        if (!dataset.issues || !config2.abortEarly) {\n          for (const key in input) {\n            if (!(key in this.entries)) {\n              const value2 = input[key];\n              _addIssue(this, \"type\", dataset, config2, {\n                input: value2,\n                expected: \"never\",\n                path: [\n                  {\n                    type: \"object\",\n                    origin: \"value\",\n                    input,\n                    key,\n                    value: value2\n                  }\n                ]\n              });\n              break;\n            }\n          }\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/strictTuple/strictTuple.ts\nfunction strictTuple(items, message) {\n  return {\n    kind: \"schema\",\n    type: \"strict_tuple\",\n    reference: strictTuple,\n    expects: \"Array\",\n    async: false,\n    items,\n    message,\n    _run(dataset, config2) {\n      const input = dataset.value;\n      if (Array.isArray(input)) {\n        dataset.typed = true;\n        dataset.value = [];\n        for (let key = 0; key < this.items.length; key++) {\n          const value2 = input[key];\n          const itemDataset = this.items[key]._run(\n            { typed: false, value: value2 },\n            config2\n          );\n          if (itemDataset.issues) {\n            const pathItem = {\n              type: \"array\",\n              origin: \"value\",\n              input,\n              key,\n              value: value2\n            };\n            for (const issue of itemDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = itemDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!itemDataset.typed) {\n            dataset.typed = false;\n          }\n          dataset.value.push(itemDataset.value);\n        }\n        if (!(dataset.issues && config2.abortEarly) && this.items.length < input.length) {\n          const value2 = input[items.length];\n          _addIssue(this, \"type\", dataset, config2, {\n            input: value2,\n            expected: \"never\",\n            path: [\n              {\n                type: \"array\",\n                origin: \"value\",\n                input,\n                key: this.items.length,\n                value: value2\n              }\n            ]\n          });\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/strictTuple/strictTupleAsync.ts\nfunction strictTupleAsync(items, message) {\n  return {\n    kind: \"schema\",\n    type: \"strict_tuple\",\n    reference: strictTupleAsync,\n    expects: \"Array\",\n    async: true,\n    items,\n    message,\n    async _run(dataset, config2) {\n      const input = dataset.value;\n      if (Array.isArray(input)) {\n        dataset.typed = true;\n        dataset.value = [];\n        const itemDatasets = await Promise.all(\n          this.items.map(async (item, key) => {\n            const value2 = input[key];\n            return [\n              key,\n              value2,\n              await item._run({ typed: false, value: value2 }, config2)\n            ];\n          })\n        );\n        for (const [key, value2, itemDataset] of itemDatasets) {\n          if (itemDataset.issues) {\n            const pathItem = {\n              type: \"array\",\n              origin: \"value\",\n              input,\n              key,\n              value: value2\n            };\n            for (const issue of itemDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = itemDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!itemDataset.typed) {\n            dataset.typed = false;\n          }\n          dataset.value.push(itemDataset.value);\n        }\n        if (!(dataset.issues && config2.abortEarly) && this.items.length < input.length) {\n          const value2 = input[items.length];\n          _addIssue(this, \"type\", dataset, config2, {\n            input: value2,\n            expected: \"never\",\n            path: [\n              {\n                type: \"array\",\n                origin: \"value\",\n                input,\n                key: this.items.length,\n                value: value2\n              }\n            ]\n          });\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/string/string.ts\nfunction string(message) {\n  return {\n    kind: \"schema\",\n    type: \"string\",\n    reference: string,\n    expects: \"string\",\n    async: false,\n    message,\n    _run(dataset, config2) {\n      if (typeof dataset.value === \"string\") {\n        dataset.typed = true;\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/symbol/symbol.ts\nfunction symbol(message) {\n  return {\n    kind: \"schema\",\n    type: \"symbol\",\n    reference: symbol,\n    expects: \"symbol\",\n    async: false,\n    message,\n    _run(dataset, config2) {\n      if (typeof dataset.value === \"symbol\") {\n        dataset.typed = true;\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/tuple/tuple.ts\nfunction tuple(items, message) {\n  return {\n    kind: \"schema\",\n    type: \"tuple\",\n    reference: tuple,\n    expects: \"Array\",\n    async: false,\n    items,\n    message,\n    _run(dataset, config2) {\n      const input = dataset.value;\n      if (Array.isArray(input)) {\n        dataset.typed = true;\n        dataset.value = [];\n        for (let key = 0; key < this.items.length; key++) {\n          const value2 = input[key];\n          const itemDataset = this.items[key]._run(\n            { typed: false, value: value2 },\n            config2\n          );\n          if (itemDataset.issues) {\n            const pathItem = {\n              type: \"array\",\n              origin: \"value\",\n              input,\n              key,\n              value: value2\n            };\n            for (const issue of itemDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = itemDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!itemDataset.typed) {\n            dataset.typed = false;\n          }\n          dataset.value.push(itemDataset.value);\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/tuple/tupleAsync.ts\nfunction tupleAsync(items, message) {\n  return {\n    kind: \"schema\",\n    type: \"tuple\",\n    reference: tupleAsync,\n    expects: \"Array\",\n    async: true,\n    items,\n    message,\n    async _run(dataset, config2) {\n      const input = dataset.value;\n      if (Array.isArray(input)) {\n        dataset.typed = true;\n        dataset.value = [];\n        const itemDatasets = await Promise.all(\n          this.items.map(async (item, key) => {\n            const value2 = input[key];\n            return [\n              key,\n              value2,\n              await item._run({ typed: false, value: value2 }, config2)\n            ];\n          })\n        );\n        for (const [key, value2, itemDataset] of itemDatasets) {\n          if (itemDataset.issues) {\n            const pathItem = {\n              type: \"array\",\n              origin: \"value\",\n              input,\n              key,\n              value: value2\n            };\n            for (const issue of itemDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = itemDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!itemDataset.typed) {\n            dataset.typed = false;\n          }\n          dataset.value.push(itemDataset.value);\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/tupleWithRest/tupleWithRest.ts\nfunction tupleWithRest(items, rest, message) {\n  return {\n    kind: \"schema\",\n    type: \"tuple_with_rest\",\n    reference: tupleWithRest,\n    expects: \"Array\",\n    async: false,\n    items,\n    rest,\n    message,\n    _run(dataset, config2) {\n      const input = dataset.value;\n      if (Array.isArray(input)) {\n        dataset.typed = true;\n        dataset.value = [];\n        for (let key = 0; key < this.items.length; key++) {\n          const value2 = input[key];\n          const itemDataset = this.items[key]._run(\n            { typed: false, value: value2 },\n            config2\n          );\n          if (itemDataset.issues) {\n            const pathItem = {\n              type: \"array\",\n              origin: \"value\",\n              input,\n              key,\n              value: value2\n            };\n            for (const issue of itemDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = itemDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!itemDataset.typed) {\n            dataset.typed = false;\n          }\n          dataset.value.push(itemDataset.value);\n        }\n        if (!dataset.issues || !config2.abortEarly) {\n          for (let key = this.items.length; key < input.length; key++) {\n            const value2 = input[key];\n            const itemDataset = this.rest._run({ typed: false, value: value2 }, config2);\n            if (itemDataset.issues) {\n              const pathItem = {\n                type: \"array\",\n                origin: \"value\",\n                input,\n                key,\n                value: value2\n              };\n              for (const issue of itemDataset.issues) {\n                if (issue.path) {\n                  issue.path.unshift(pathItem);\n                } else {\n                  issue.path = [pathItem];\n                }\n                dataset.issues?.push(issue);\n              }\n              if (!dataset.issues) {\n                dataset.issues = itemDataset.issues;\n              }\n              if (config2.abortEarly) {\n                dataset.typed = false;\n                break;\n              }\n            }\n            if (!itemDataset.typed) {\n              dataset.typed = false;\n            }\n            dataset.value.push(itemDataset.value);\n          }\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/tupleWithRest/tupleWithRestAsync.ts\nfunction tupleWithRestAsync(items, rest, message) {\n  return {\n    kind: \"schema\",\n    type: \"tuple_with_rest\",\n    reference: tupleWithRestAsync,\n    expects: \"Array\",\n    async: true,\n    items,\n    rest,\n    message,\n    async _run(dataset, config2) {\n      const input = dataset.value;\n      if (Array.isArray(input)) {\n        dataset.typed = true;\n        dataset.value = [];\n        const [normalDatasets, restDatasets] = await Promise.all([\n          // Parse schema of each normal item\n          Promise.all(\n            this.items.map(async (item, key) => {\n              const value2 = input[key];\n              return [\n                key,\n                value2,\n                await item._run({ typed: false, value: value2 }, config2)\n              ];\n            })\n          ),\n          // Parse other items with rest schema\n          Promise.all(\n            input.slice(this.items.length).map(async (value2, key) => {\n              return [\n                key + this.items.length,\n                value2,\n                await this.rest._run({ typed: false, value: value2 }, config2)\n              ];\n            })\n          )\n        ]);\n        for (const [key, value2, itemDataset] of normalDatasets) {\n          if (itemDataset.issues) {\n            const pathItem = {\n              type: \"array\",\n              origin: \"value\",\n              input,\n              key,\n              value: value2\n            };\n            for (const issue of itemDataset.issues) {\n              if (issue.path) {\n                issue.path.unshift(pathItem);\n              } else {\n                issue.path = [pathItem];\n              }\n              dataset.issues?.push(issue);\n            }\n            if (!dataset.issues) {\n              dataset.issues = itemDataset.issues;\n            }\n            if (config2.abortEarly) {\n              dataset.typed = false;\n              break;\n            }\n          }\n          if (!itemDataset.typed) {\n            dataset.typed = false;\n          }\n          dataset.value.push(itemDataset.value);\n        }\n        if (!dataset.issues || !config2.abortEarly) {\n          for (const [key, value2, itemDataset] of restDatasets) {\n            if (itemDataset.issues) {\n              const pathItem = {\n                type: \"array\",\n                origin: \"value\",\n                input,\n                key,\n                value: value2\n              };\n              for (const issue of itemDataset.issues) {\n                if (issue.path) {\n                  issue.path.unshift(pathItem);\n                } else {\n                  issue.path = [pathItem];\n                }\n                dataset.issues?.push(issue);\n              }\n              if (!dataset.issues) {\n                dataset.issues = itemDataset.issues;\n              }\n              if (config2.abortEarly) {\n                dataset.typed = false;\n                break;\n              }\n            }\n            if (!itemDataset.typed) {\n              dataset.typed = false;\n            }\n            dataset.value.push(itemDataset.value);\n          }\n        }\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/undefined/undefined.ts\nfunction undefined_(message) {\n  return {\n    kind: \"schema\",\n    type: \"undefined\",\n    reference: undefined_,\n    expects: \"undefined\",\n    async: false,\n    message,\n    _run(dataset, config2) {\n      if (dataset.value === void 0) {\n        dataset.typed = true;\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/undefinedable/undefinedable.ts\nfunction undefinedable(wrapped, ...args) {\n  const schema = {\n    kind: \"schema\",\n    type: \"undefinedable\",\n    reference: undefinedable,\n    expects: `(${wrapped.expects} | undefined)`,\n    async: false,\n    wrapped,\n    _run(dataset, config2) {\n      if (dataset.value === void 0) {\n        if (\"default\" in this) {\n          dataset.value = getDefault(\n            this,\n            dataset,\n            config2\n          );\n        }\n        if (dataset.value === void 0) {\n          dataset.typed = true;\n          return dataset;\n        }\n      }\n      return this.wrapped._run(dataset, config2);\n    }\n  };\n  if (0 in args) {\n    schema.default = args[0];\n  }\n  return schema;\n}\n\n// src/schemas/undefinedable/undefinedableAsync.ts\nfunction undefinedableAsync(wrapped, ...args) {\n  const schema = {\n    kind: \"schema\",\n    type: \"undefinedable\",\n    reference: undefinedableAsync,\n    expects: `(${wrapped.expects} | undefined)`,\n    async: true,\n    wrapped,\n    async _run(dataset, config2) {\n      if (dataset.value === void 0) {\n        if (\"default\" in this) {\n          dataset.value = await getDefault(\n            this,\n            dataset,\n            config2\n          );\n        }\n        if (dataset.value === void 0) {\n          dataset.typed = true;\n          return dataset;\n        }\n      }\n      return this.wrapped._run(dataset, config2);\n    }\n  };\n  if (0 in args) {\n    schema.default = args[0];\n  }\n  return schema;\n}\n\n// src/schemas/union/utils/_subIssues/_subIssues.ts\nfunction _subIssues(datasets) {\n  let issues;\n  if (datasets) {\n    for (const dataset of datasets) {\n      if (issues) {\n        issues.push(...dataset.issues);\n      } else {\n        issues = dataset.issues;\n      }\n    }\n  }\n  return issues;\n}\n\n// src/schemas/union/union.ts\nfunction union(options, message) {\n  return {\n    kind: \"schema\",\n    type: \"union\",\n    reference: union,\n    expects: _joinExpects(\n      options.map((option) => option.expects),\n      \"|\"\n    ),\n    async: false,\n    options,\n    message,\n    _run(dataset, config2) {\n      let validDataset;\n      let typedDatasets;\n      let untypedDatasets;\n      for (const schema of this.options) {\n        const optionDataset = schema._run(\n          { typed: false, value: dataset.value },\n          config2\n        );\n        if (optionDataset.typed) {\n          if (optionDataset.issues) {\n            if (typedDatasets) {\n              typedDatasets.push(optionDataset);\n            } else {\n              typedDatasets = [optionDataset];\n            }\n          } else {\n            validDataset = optionDataset;\n            break;\n          }\n        } else {\n          if (untypedDatasets) {\n            untypedDatasets.push(optionDataset);\n          } else {\n            untypedDatasets = [optionDataset];\n          }\n        }\n      }\n      if (validDataset) {\n        return validDataset;\n      }\n      if (typedDatasets) {\n        if (typedDatasets.length === 1) {\n          return typedDatasets[0];\n        }\n        _addIssue(this, \"type\", dataset, config2, {\n          issues: _subIssues(typedDatasets)\n        });\n        dataset.typed = true;\n      } else if (untypedDatasets?.length === 1) {\n        return untypedDatasets[0];\n      } else {\n        _addIssue(this, \"type\", dataset, config2, {\n          issues: _subIssues(untypedDatasets)\n        });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/union/unionAsync.ts\nfunction unionAsync(options, message) {\n  return {\n    kind: \"schema\",\n    type: \"union\",\n    reference: unionAsync,\n    expects: _joinExpects(\n      options.map((option) => option.expects),\n      \"|\"\n    ),\n    async: true,\n    options,\n    message,\n    async _run(dataset, config2) {\n      let validDataset;\n      let typedDatasets;\n      let untypedDatasets;\n      for (const schema of this.options) {\n        const optionDataset = await schema._run(\n          { typed: false, value: dataset.value },\n          config2\n        );\n        if (optionDataset.typed) {\n          if (optionDataset.issues) {\n            if (typedDatasets) {\n              typedDatasets.push(optionDataset);\n            } else {\n              typedDatasets = [optionDataset];\n            }\n          } else {\n            validDataset = optionDataset;\n            break;\n          }\n        } else {\n          if (untypedDatasets) {\n            untypedDatasets.push(optionDataset);\n          } else {\n            untypedDatasets = [optionDataset];\n          }\n        }\n      }\n      if (validDataset) {\n        return validDataset;\n      }\n      if (typedDatasets) {\n        if (typedDatasets.length === 1) {\n          return typedDatasets[0];\n        }\n        _addIssue(this, \"type\", dataset, config2, {\n          issues: _subIssues(typedDatasets)\n        });\n        dataset.typed = true;\n      } else if (untypedDatasets?.length === 1) {\n        return untypedDatasets[0];\n      } else {\n        _addIssue(this, \"type\", dataset, config2, {\n          issues: _subIssues(untypedDatasets)\n        });\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/unknown/unknown.ts\nfunction unknown() {\n  return {\n    kind: \"schema\",\n    type: \"unknown\",\n    reference: unknown,\n    expects: \"unknown\",\n    async: false,\n    _run(dataset) {\n      dataset.typed = true;\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/variant/variant.ts\nfunction variant(key, options, message) {\n  return {\n    kind: \"schema\",\n    type: \"variant\",\n    reference: variant,\n    expects: \"Object\",\n    async: false,\n    key,\n    options,\n    message,\n    _run(dataset, config2) {\n      const input = dataset.value;\n      if (input && typeof input === \"object\") {\n        let outputDataset;\n        let maxDiscriminatorPriority = 0;\n        let invalidDiscriminatorKey = this.key;\n        let expectedDiscriminators = [];\n        const parseOptions = (variant2, allKeys) => {\n          for (const schema of variant2.options) {\n            if (schema.type === \"variant\") {\n              parseOptions(schema, new Set(allKeys).add(schema.key));\n            } else {\n              let keysAreValid = true;\n              let currentPriority = 0;\n              for (const currentKey of allKeys) {\n                if (schema.entries[currentKey]._run(\n                  // @ts-expect-error\n                  { typed: false, value: input[currentKey] },\n                  config2\n                ).issues) {\n                  keysAreValid = false;\n                  if (invalidDiscriminatorKey !== currentKey && (maxDiscriminatorPriority < currentPriority || maxDiscriminatorPriority === currentPriority && currentKey in input && !(invalidDiscriminatorKey in input))) {\n                    maxDiscriminatorPriority = currentPriority;\n                    invalidDiscriminatorKey = currentKey;\n                    expectedDiscriminators = [];\n                  }\n                  if (invalidDiscriminatorKey === currentKey) {\n                    expectedDiscriminators.push(\n                      schema.entries[currentKey].expects\n                    );\n                  }\n                  break;\n                }\n                currentPriority++;\n              }\n              if (keysAreValid) {\n                const optionDataset = schema._run(\n                  { typed: false, value: input },\n                  config2\n                );\n                if (!outputDataset || !outputDataset.typed && optionDataset.typed) {\n                  outputDataset = optionDataset;\n                }\n              }\n            }\n            if (outputDataset && !outputDataset.issues) {\n              break;\n            }\n          }\n        };\n        parseOptions(this, /* @__PURE__ */ new Set([this.key]));\n        if (outputDataset) {\n          return outputDataset;\n        }\n        _addIssue(this, \"type\", dataset, config2, {\n          // @ts-expect-error\n          input: input[invalidDiscriminatorKey],\n          expected: _joinExpects(expectedDiscriminators, \"|\"),\n          path: [\n            {\n              type: \"object\",\n              origin: \"value\",\n              input,\n              key: invalidDiscriminatorKey,\n              // @ts-expect-error\n              value: input[invalidDiscriminatorKey]\n            }\n          ]\n        });\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/variant/variantAsync.ts\nfunction variantAsync(key, options, message) {\n  return {\n    kind: \"schema\",\n    type: \"variant\",\n    reference: variantAsync,\n    expects: \"Object\",\n    async: true,\n    key,\n    options,\n    message,\n    async _run(dataset, config2) {\n      const input = dataset.value;\n      if (input && typeof input === \"object\") {\n        let outputDataset;\n        let maxDiscriminatorPriority = 0;\n        let invalidDiscriminatorKey = this.key;\n        let expectedDiscriminators = [];\n        const parseOptions = async (variant2, allKeys) => {\n          for (const schema of variant2.options) {\n            if (schema.type === \"variant\") {\n              await parseOptions(schema, new Set(allKeys).add(schema.key));\n            } else {\n              let keysAreValid = true;\n              let currentPriority = 0;\n              for (const currentKey of allKeys) {\n                if ((await schema.entries[currentKey]._run(\n                  // @ts-expect-error\n                  { typed: false, value: input[currentKey] },\n                  config2\n                )).issues) {\n                  keysAreValid = false;\n                  if (invalidDiscriminatorKey !== currentKey && (maxDiscriminatorPriority < currentPriority || maxDiscriminatorPriority === currentPriority && currentKey in input && !(invalidDiscriminatorKey in input))) {\n                    maxDiscriminatorPriority = currentPriority;\n                    invalidDiscriminatorKey = currentKey;\n                    expectedDiscriminators = [];\n                  }\n                  if (invalidDiscriminatorKey === currentKey) {\n                    expectedDiscriminators.push(\n                      schema.entries[currentKey].expects\n                    );\n                  }\n                  break;\n                }\n                currentPriority++;\n              }\n              if (keysAreValid) {\n                const optionDataset = await schema._run(\n                  { typed: false, value: input },\n                  config2\n                );\n                if (!outputDataset || !outputDataset.typed && optionDataset.typed) {\n                  outputDataset = optionDataset;\n                }\n              }\n            }\n            if (outputDataset && !outputDataset.issues) {\n              break;\n            }\n          }\n        };\n        await parseOptions(this, /* @__PURE__ */ new Set([this.key]));\n        if (outputDataset) {\n          return outputDataset;\n        }\n        _addIssue(this, \"type\", dataset, config2, {\n          // @ts-expect-error\n          input: input[invalidDiscriminatorKey],\n          expected: _joinExpects(expectedDiscriminators, \"|\"),\n          path: [\n            {\n              type: \"object\",\n              origin: \"value\",\n              input,\n              key: invalidDiscriminatorKey,\n              // @ts-expect-error\n              value: input[invalidDiscriminatorKey]\n            }\n          ]\n        });\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/schemas/void/void.ts\nfunction void_(message) {\n  return {\n    kind: \"schema\",\n    type: \"void\",\n    reference: void_,\n    expects: \"void\",\n    async: false,\n    message,\n    _run(dataset, config2) {\n      if (dataset.value === void 0) {\n        dataset.typed = true;\n      } else {\n        _addIssue(this, \"type\", dataset, config2);\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/methods/keyof/keyof.ts\nfunction keyof(schema, message) {\n  return picklist(Object.keys(schema.entries), message);\n}\n\n// src/methods/omit/omit.ts\nfunction omit(schema, keys) {\n  const entries = {\n    ...schema.entries\n  };\n  for (const key of keys) {\n    delete entries[key];\n  }\n  return { ...schema, entries };\n}\n\n// src/methods/parse/parse.ts\nfunction parse(schema, input, config2) {\n  const dataset = schema._run(\n    { typed: false, value: input },\n    getGlobalConfig(config2)\n  );\n  if (dataset.issues) {\n    throw new ValiError(dataset.issues);\n  }\n  return dataset.value;\n}\n\n// src/methods/parse/parseAsync.ts\nasync function parseAsync(schema, input, config2) {\n  const dataset = await schema._run(\n    { typed: false, value: input },\n    getGlobalConfig(config2)\n  );\n  if (dataset.issues) {\n    throw new ValiError(dataset.issues);\n  }\n  return dataset.value;\n}\n\n// src/methods/parser/parser.ts\nfunction parser(schema, config2) {\n  const func = (input) => parse(schema, input, config2);\n  func.schema = schema;\n  func.config = config2;\n  return func;\n}\n\n// src/methods/parser/parserAsync.ts\nfunction parserAsync(schema, config2) {\n  const func = (input) => parseAsync(schema, input, config2);\n  func.schema = schema;\n  func.config = config2;\n  return func;\n}\n\n// src/methods/partial/partial.ts\nfunction partial(schema, keys) {\n  const entries = {};\n  for (const key in schema.entries) {\n    entries[key] = !keys || keys.includes(key) ? optional(schema.entries[key]) : schema.entries[key];\n  }\n  return { ...schema, entries };\n}\n\n// src/methods/partial/partialAsync.ts\nfunction partialAsync(schema, keys) {\n  const entries = {};\n  for (const key in schema.entries) {\n    entries[key] = !keys || keys.includes(key) ? optionalAsync(schema.entries[key]) : schema.entries[key];\n  }\n  return { ...schema, entries };\n}\n\n// src/methods/pick/pick.ts\nfunction pick(schema, keys) {\n  const entries = {};\n  for (const key of keys) {\n    entries[key] = schema.entries[key];\n  }\n  return { ...schema, entries };\n}\n\n// src/methods/pipe/pipe.ts\nfunction pipe(...pipe2) {\n  return {\n    ...pipe2[0],\n    pipe: pipe2,\n    _run(dataset, config2) {\n      for (const item of pipe2) {\n        if (item.kind !== \"metadata\") {\n          if (dataset.issues && (item.kind === \"schema\" || item.kind === \"transformation\")) {\n            dataset.typed = false;\n            break;\n          }\n          if (!dataset.issues || !config2.abortEarly && !config2.abortPipeEarly) {\n            dataset = item._run(dataset, config2);\n          }\n        }\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/methods/pipe/pipeAsync.ts\nfunction pipeAsync(...pipe2) {\n  return {\n    ...pipe2[0],\n    pipe: pipe2,\n    async: true,\n    async _run(dataset, config2) {\n      for (const item of pipe2) {\n        if (item.kind !== \"metadata\") {\n          if (dataset.issues && (item.kind === \"schema\" || item.kind === \"transformation\")) {\n            dataset.typed = false;\n            break;\n          }\n          if (!dataset.issues || !config2.abortEarly && !config2.abortPipeEarly) {\n            dataset = await item._run(dataset, config2);\n          }\n        }\n      }\n      return dataset;\n    }\n  };\n}\n\n// src/methods/required/required.ts\nfunction required(schema, arg2, arg3) {\n  const keys = Array.isArray(arg2) ? arg2 : void 0;\n  const message = Array.isArray(arg2) ? arg3 : arg2;\n  const entries = {};\n  for (const key in schema.entries) {\n    entries[key] = !keys || keys.includes(key) ? nonOptional(schema.entries[key], message) : schema.entries[key];\n  }\n  return { ...schema, entries };\n}\n\n// src/methods/required/requiredAsync.ts\nfunction requiredAsync(schema, arg2, arg3) {\n  const keys = Array.isArray(arg2) ? arg2 : void 0;\n  const message = Array.isArray(arg2) ? arg3 : arg2;\n  const entries = {};\n  for (const key in schema.entries) {\n    entries[key] = !keys || keys.includes(key) ? nonOptionalAsync(schema.entries[key], message) : schema.entries[key];\n  }\n  return { ...schema, entries };\n}\n\n// src/methods/safeParse/safeParse.ts\nfunction safeParse(schema, input, config2) {\n  const dataset = schema._run(\n    { typed: false, value: input },\n    getGlobalConfig(config2)\n  );\n  return {\n    typed: dataset.typed,\n    success: !dataset.issues,\n    output: dataset.value,\n    issues: dataset.issues\n  };\n}\n\n// src/methods/safeParse/safeParseAsync.ts\nasync function safeParseAsync(schema, input, config2) {\n  const dataset = await schema._run(\n    { typed: false, value: input },\n    getGlobalConfig(config2)\n  );\n  return {\n    typed: dataset.typed,\n    success: !dataset.issues,\n    output: dataset.value,\n    issues: dataset.issues\n  };\n}\n\n// src/methods/safeParser/safeParser.ts\nfunction safeParser(schema, config2) {\n  const func = (input) => safeParse(schema, input, config2);\n  func.schema = schema;\n  func.config = config2;\n  return func;\n}\n\n// src/methods/safeParser/safeParserAsync.ts\nfunction safeParserAsync(schema, config2) {\n  const func = (input) => safeParseAsync(schema, input, config2);\n  func.schema = schema;\n  func.config = config2;\n  return func;\n}\n\n// src/methods/unwrap/unwrap.ts\nfunction unwrap(schema) {\n  return schema.wrapped;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  BASE64_REGEX,\n  BIC_REGEX,\n  CUID2_REGEX,\n  DECIMAL_REGEX,\n  EMAIL_REGEX,\n  EMOJI_REGEX,\n  HEXADECIMAL_REGEX,\n  HEX_COLOR_REGEX,\n  IMEI_REGEX,\n  IPV4_REGEX,\n  IPV6_REGEX,\n  IP_REGEX,\n  ISO_DATE_REGEX,\n  ISO_DATE_TIME_REGEX,\n  ISO_TIMESTAMP_REGEX,\n  ISO_TIME_REGEX,\n  ISO_TIME_SECOND_REGEX,\n  ISO_WEEK_REGEX,\n  MAC48_REGEX,\n  MAC64_REGEX,\n  MAC_REGEX,\n  NANO_ID_REGEX,\n  OCTAL_REGEX,\n  ULID_REGEX,\n  UUID_REGEX,\n  ValiError,\n  _addIssue,\n  _isLuhnAlgo,\n  _isValidObjectKey,\n  _joinExpects,\n  _stringify,\n  any,\n  array,\n  arrayAsync,\n  awaitAsync,\n  base64,\n  bic,\n  bigint,\n  blob,\n  boolean,\n  brand,\n  bytes,\n  check,\n  checkAsync,\n  checkItems,\n  config,\n  creditCard,\n  cuid2,\n  custom,\n  customAsync,\n  date,\n  decimal,\n  deleteGlobalConfig,\n  deleteGlobalMessage,\n  deleteSchemaMessage,\n  deleteSpecificMessage,\n  description,\n  email,\n  emoji,\n  empty,\n  endsWith,\n  entriesFromList,\n  enum: null,\n  enum_,\n  everyItem,\n  excludes,\n  fallback,\n  fallbackAsync,\n  file,\n  filterItems,\n  findItem,\n  finite,\n  flatten,\n  forward,\n  forwardAsync,\n  function: null,\n  function_,\n  getDefault,\n  getDefaults,\n  getDefaultsAsync,\n  getDotPath,\n  getFallback,\n  getFallbacks,\n  getFallbacksAsync,\n  getGlobalConfig,\n  getGlobalMessage,\n  getSchemaMessage,\n  getSpecificMessage,\n  hash,\n  hexColor,\n  hexadecimal,\n  imei,\n  includes,\n  instance,\n  integer,\n  intersect,\n  intersectAsync,\n  ip,\n  ipv4,\n  ipv6,\n  is,\n  isOfKind,\n  isOfType,\n  isValiError,\n  isoDate,\n  isoDateTime,\n  isoTime,\n  isoTimeSecond,\n  isoTimestamp,\n  isoWeek,\n  keyof,\n  lazy,\n  lazyAsync,\n  length,\n  literal,\n  looseObject,\n  looseObjectAsync,\n  looseTuple,\n  looseTupleAsync,\n  mac,\n  mac48,\n  mac64,\n  map,\n  mapAsync,\n  mapItems,\n  maxBytes,\n  maxLength,\n  maxSize,\n  maxValue,\n  mimeType,\n  minBytes,\n  minLength,\n  minSize,\n  minValue,\n  multipleOf,\n  nan,\n  nanoid,\n  never,\n  nonEmpty,\n  nonNullable,\n  nonNullableAsync,\n  nonNullish,\n  nonNullishAsync,\n  nonOptional,\n  nonOptionalAsync,\n  normalize,\n  notBytes,\n  notLength,\n  notSize,\n  notValue,\n  null: null,\n  null_,\n  nullable,\n  nullableAsync,\n  nullish,\n  nullishAsync,\n  number,\n  object,\n  objectAsync,\n  objectWithRest,\n  objectWithRestAsync,\n  octal,\n  omit,\n  optional,\n  optionalAsync,\n  parse,\n  parseAsync,\n  parser,\n  parserAsync,\n  partial,\n  partialAsync,\n  partialCheck,\n  partialCheckAsync,\n  pick,\n  picklist,\n  pipe,\n  pipeAsync,\n  promise,\n  rawCheck,\n  rawCheckAsync,\n  rawTransform,\n  rawTransformAsync,\n  readonly,\n  record,\n  recordAsync,\n  reduceItems,\n  regex,\n  required,\n  requiredAsync,\n  safeInteger,\n  safeParse,\n  safeParseAsync,\n  safeParser,\n  safeParserAsync,\n  set,\n  setAsync,\n  setGlobalConfig,\n  setGlobalMessage,\n  setSchemaMessage,\n  setSpecificMessage,\n  size,\n  someItem,\n  sortItems,\n  startsWith,\n  strictObject,\n  strictObjectAsync,\n  strictTuple,\n  strictTupleAsync,\n  string,\n  symbol,\n  toLowerCase,\n  toMaxValue,\n  toMinValue,\n  toUpperCase,\n  transform,\n  transformAsync,\n  trim,\n  trimEnd,\n  trimStart,\n  tuple,\n  tupleAsync,\n  tupleWithRest,\n  tupleWithRestAsync,\n  ulid,\n  undefined,\n  undefined_,\n  undefinedable,\n  undefinedableAsync,\n  union,\n  unionAsync,\n  unknown,\n  unwrap,\n  url,\n  uuid,\n  value,\n  variant,\n  variantAsync,\n  void: null,\n  void_\n});\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n    return (idbProxyableTypes ||\n        (idbProxyableTypes = [\n            IDBDatabase,\n            IDBObjectStore,\n            IDBIndex,\n            IDBCursor,\n            IDBTransaction,\n        ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n    return (cursorAdvanceMethods ||\n        (cursorAdvanceMethods = [\n            IDBCursor.prototype.advance,\n            IDBCursor.prototype.continue,\n            IDBCursor.prototype.continuePrimaryKey,\n        ]));\n}\nconst cursorRequestMap = new WeakMap();\nconst transactionDoneMap = new WeakMap();\nconst transactionStoreNamesMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n    const promise = new Promise((resolve, reject) => {\n        const unlisten = () => {\n            request.removeEventListener('success', success);\n            request.removeEventListener('error', error);\n        };\n        const success = () => {\n            resolve(wrap(request.result));\n            unlisten();\n        };\n        const error = () => {\n            reject(request.error);\n            unlisten();\n        };\n        request.addEventListener('success', success);\n        request.addEventListener('error', error);\n    });\n    promise\n        .then((value) => {\n        // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\n        // (see wrapFunction).\n        if (value instanceof IDBCursor) {\n            cursorRequestMap.set(value, request);\n        }\n        // Catching to avoid \"Uncaught Promise exceptions\"\n    })\n        .catch(() => { });\n    // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n    // is because we create many promises from a single IDBRequest.\n    reverseTransformCache.set(promise, request);\n    return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n    // Early bail if we've already created a done promise for this transaction.\n    if (transactionDoneMap.has(tx))\n        return;\n    const done = new Promise((resolve, reject) => {\n        const unlisten = () => {\n            tx.removeEventListener('complete', complete);\n            tx.removeEventListener('error', error);\n            tx.removeEventListener('abort', error);\n        };\n        const complete = () => {\n            resolve();\n            unlisten();\n        };\n        const error = () => {\n            reject(tx.error || new DOMException('AbortError', 'AbortError'));\n            unlisten();\n        };\n        tx.addEventListener('complete', complete);\n        tx.addEventListener('error', error);\n        tx.addEventListener('abort', error);\n    });\n    // Cache it for later retrieval.\n    transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n    get(target, prop, receiver) {\n        if (target instanceof IDBTransaction) {\n            // Special handling for transaction.done.\n            if (prop === 'done')\n                return transactionDoneMap.get(target);\n            // Polyfill for objectStoreNames because of Edge.\n            if (prop === 'objectStoreNames') {\n                return target.objectStoreNames || transactionStoreNamesMap.get(target);\n            }\n            // Make tx.store return the only store in the transaction, or undefined if there are many.\n            if (prop === 'store') {\n                return receiver.objectStoreNames[1]\n                    ? undefined\n                    : receiver.objectStore(receiver.objectStoreNames[0]);\n            }\n        }\n        // Else transform whatever we get back.\n        return wrap(target[prop]);\n    },\n    set(target, prop, value) {\n        target[prop] = value;\n        return true;\n    },\n    has(target, prop) {\n        if (target instanceof IDBTransaction &&\n            (prop === 'done' || prop === 'store')) {\n            return true;\n        }\n        return prop in target;\n    },\n};\nfunction replaceTraps(callback) {\n    idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n    // Due to expected object equality (which is enforced by the caching in `wrap`), we\n    // only create one new func per func.\n    // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\n    if (func === IDBDatabase.prototype.transaction &&\n        !('objectStoreNames' in IDBTransaction.prototype)) {\n        return function (storeNames, ...args) {\n            const tx = func.call(unwrap(this), storeNames, ...args);\n            transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\n            return wrap(tx);\n        };\n    }\n    // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n    // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n    // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n    // with real promises, so each advance methods returns a new promise for the cursor object, or\n    // undefined if the end of the cursor has been reached.\n    if (getCursorAdvanceMethods().includes(func)) {\n        return function (...args) {\n            // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n            // the original object.\n            func.apply(unwrap(this), args);\n            return wrap(cursorRequestMap.get(this));\n        };\n    }\n    return function (...args) {\n        // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n        // the original object.\n        return wrap(func.apply(unwrap(this), args));\n    };\n}\nfunction transformCachableValue(value) {\n    if (typeof value === 'function')\n        return wrapFunction(value);\n    // This doesn't return, it just creates a 'done' promise for the transaction,\n    // which is later returned for transaction.done (see idbObjectHandler).\n    if (value instanceof IDBTransaction)\n        cacheDonePromiseForTransaction(value);\n    if (instanceOfAny(value, getIdbProxyableTypes()))\n        return new Proxy(value, idbProxyTraps);\n    // Return the same value back if we're not going to transform it.\n    return value;\n}\nfunction wrap(value) {\n    // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n    // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n    if (value instanceof IDBRequest)\n        return promisifyRequest(value);\n    // If we've already transformed this value before, reuse the transformed value.\n    // This is faster, but it also provides object equality.\n    if (transformCache.has(value))\n        return transformCache.get(value);\n    const newValue = transformCachableValue(value);\n    // Not all types are transformed.\n    // These may be primitive types, so they can't be WeakMap keys.\n    if (newValue !== value) {\n        transformCache.set(value, newValue);\n        reverseTransformCache.set(newValue, value);\n    }\n    return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\nexport { reverseTransformCache as a, instanceOfAny as i, replaceTraps as r, unwrap as u, wrap as w };\n","import { w as wrap, r as replaceTraps } from './wrap-idb-value.js';\nexport { u as unwrap, w as wrap } from './wrap-idb-value.js';\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n    const request = indexedDB.open(name, version);\n    const openPromise = wrap(request);\n    if (upgrade) {\n        request.addEventListener('upgradeneeded', (event) => {\n            upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n        });\n    }\n    if (blocked) {\n        request.addEventListener('blocked', (event) => blocked(\n        // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n        event.oldVersion, event.newVersion, event));\n    }\n    openPromise\n        .then((db) => {\n        if (terminated)\n            db.addEventListener('close', () => terminated());\n        if (blocking) {\n            db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n        }\n    })\n        .catch(() => { });\n    return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n    const request = indexedDB.deleteDatabase(name);\n    if (blocked) {\n        request.addEventListener('blocked', (event) => blocked(\n        // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n        event.oldVersion, event));\n    }\n    return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n    if (!(target instanceof IDBDatabase &&\n        !(prop in target) &&\n        typeof prop === 'string')) {\n        return;\n    }\n    if (cachedMethods.get(prop))\n        return cachedMethods.get(prop);\n    const targetFuncName = prop.replace(/FromIndex$/, '');\n    const useIndex = prop !== targetFuncName;\n    const isWrite = writeMethods.includes(targetFuncName);\n    if (\n    // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n    !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n        !(isWrite || readMethods.includes(targetFuncName))) {\n        return;\n    }\n    const method = async function (storeName, ...args) {\n        // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n        const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n        let target = tx.store;\n        if (useIndex)\n            target = target.index(args.shift());\n        // Must reject if op rejects.\n        // If it's a write operation, must reject if tx.done rejects.\n        // Must reject with op rejection first.\n        // Must resolve with op value.\n        // Must handle both promises (no unhandled rejections)\n        return (await Promise.all([\n            target[targetFuncName](...args),\n            isWrite && tx.done,\n        ]))[0];\n    };\n    cachedMethods.set(prop, method);\n    return method;\n}\nreplaceTraps((oldTraps) => ({\n    ...oldTraps,\n    get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n    has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nexport { deleteDB, openDB };\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n  extendStatics = Object.setPrototypeOf ||\n      ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n      function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n  return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n  if (typeof b !== \"function\" && b !== null)\n      throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n  extendStatics(d, b);\n  function __() { this.constructor = d; }\n  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n  __assign = Object.assign || function __assign(t) {\n      for (var s, i = 1, n = arguments.length; i < n; i++) {\n          s = arguments[i];\n          for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n      }\n      return t;\n  }\n  return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n      t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n      for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n          if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n              t[p[i]] = s[p[i]];\n      }\n  return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n  if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n  return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n  return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n  function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n  var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n  var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n  var _, done = false;\n  for (var i = decorators.length - 1; i >= 0; i--) {\n      var context = {};\n      for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n      for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n      context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n      var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n      if (kind === \"accessor\") {\n          if (result === void 0) continue;\n          if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n          if (_ = accept(result.get)) descriptor.get = _;\n          if (_ = accept(result.set)) descriptor.set = _;\n          if (_ = accept(result.init)) initializers.unshift(_);\n      }\n      else if (_ = accept(result)) {\n          if (kind === \"field\") initializers.unshift(_);\n          else descriptor[key] = _;\n      }\n  }\n  if (target) Object.defineProperty(target, contextIn.name, descriptor);\n  done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n  var useValue = arguments.length > 2;\n  for (var i = 0; i < initializers.length; i++) {\n      value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n  }\n  return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n  return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n  if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n  return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n  if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n  return new (P || (P = Promise))(function (resolve, reject) {\n      function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n      function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n      function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n      step((generator = generator.apply(thisArg, _arguments || [])).next());\n  });\n}\n\nexport function __generator(thisArg, body) {\n  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n  return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n  function verb(n) { return function (v) { return step([n, v]); }; }\n  function step(op) {\n      if (f) throw new TypeError(\"Generator is already executing.\");\n      while (g && (g = 0, op[0] && (_ = 0)), _) try {\n          if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n          if (y = 0, t) op = [op[0] & 2, t.value];\n          switch (op[0]) {\n              case 0: case 1: t = op; break;\n              case 4: _.label++; return { value: op[1], done: false };\n              case 5: _.label++; y = op[1]; op = [0]; continue;\n              case 7: op = _.ops.pop(); _.trys.pop(); continue;\n              default:\n                  if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n                  if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n                  if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n                  if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n                  if (t[2]) _.ops.pop();\n                  _.trys.pop(); continue;\n          }\n          op = body.call(thisArg, _);\n      } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n      if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n  }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n  }\n  Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n  for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n  var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n  if (m) return m.call(o);\n  if (o && typeof o.length === \"number\") return {\n      next: function () {\n          if (o && i >= o.length) o = void 0;\n          return { value: o && o[i++], done: !o };\n      }\n  };\n  throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n  var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n  if (!m) return o;\n  var i = m.call(o), r, ar = [], e;\n  try {\n      while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n  }\n  catch (error) { e = { error: error }; }\n  finally {\n      try {\n          if (r && !r.done && (m = i[\"return\"])) m.call(i);\n      }\n      finally { if (e) throw e.error; }\n  }\n  return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n  for (var ar = [], i = 0; i < arguments.length; i++)\n      ar = ar.concat(__read(arguments[i]));\n  return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n  for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n  for (var r = Array(s), k = 0, i = 0; i < il; i++)\n      for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n          r[k] = a[j];\n  return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n      if (ar || !(i in from)) {\n          if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n          ar[i] = from[i];\n      }\n  }\n  return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n  return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n  if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n  var g = generator.apply(thisArg, _arguments || []), i, q = [];\n  return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n  function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n  function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n  function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n  function fulfill(value) { resume(\"next\", value); }\n  function reject(value) { resume(\"throw\", value); }\n  function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n  var i, p;\n  return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n  function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n  if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n  var m = o[Symbol.asyncIterator], i;\n  return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n  function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n  function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n  if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n  return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n  Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n  o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n  if (mod && mod.__esModule) return mod;\n  var result = {};\n  if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n  __setModuleDefault(result, mod);\n  return result;\n}\n\nexport function __importDefault(mod) {\n  return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n  if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n  if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n  return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n  if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n  if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n  if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n  return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n  if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n  return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n  if (value !== null && value !== void 0) {\n    if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n    var dispose;\n    if (async) {\n        if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n        dispose = value[Symbol.asyncDispose];\n    }\n    if (dispose === void 0) {\n        if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n        dispose = value[Symbol.dispose];\n    }\n    if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n    env.stack.push({ value: value, dispose: dispose, async: async });\n  }\n  else if (async) {\n    env.stack.push({ async: true });\n  }\n  return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n  var e = new Error(message);\n  return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n  function fail(e) {\n    env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n    env.hasError = true;\n  }\n  function next() {\n    while (env.stack.length) {\n      var rec = env.stack.pop();\n      try {\n        var result = rec.dispose && rec.dispose.call(rec.value);\n        if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n      }\n      catch (e) {\n          fail(e);\n      }\n    }\n    if (env.hasError) throw env.error;\n  }\n  return next();\n}\n\nexport default {\n  __extends,\n  __assign,\n  __rest,\n  __decorate,\n  __param,\n  __metadata,\n  __awaiter,\n  __generator,\n  __createBinding,\n  __exportStar,\n  __values,\n  __read,\n  __spread,\n  __spreadArrays,\n  __spreadArray,\n  __await,\n  __asyncGenerator,\n  __asyncDelegator,\n  __asyncValues,\n  __makeTemplateObject,\n  __importStar,\n  __importDefault,\n  __classPrivateFieldGet,\n  __classPrivateFieldSet,\n  __classPrivateFieldIn,\n  __addDisposableResource,\n  __disposeResources,\n};\n"],"mappings":";0HAAe,SAASA,EAASC,GAC/B,OAAOA,WAAGC,WAAaD,EAAI,CAAEE,QAASF,EACxC,CAAAG,EAAAC,EAAAC,EAAA,CAAAC,EAAA,IAAAC,GAAA,SAAAC,EAAAH,EAAAF,KAAA,aAAAM,OAAAC,eAAAL,EAAA,cAAAM,OAAA,QCaGJ,ECAAK,EAAAC,EAAAV,EAAA,OAAAW,EAAAX,EAAA,OAAAY,EAAAZ,EAAA,OAAAa,EAAAb,EAAA,OAAAc,EAAAd,EAAA,OCUHe,EAAA,WACE,SAAAV,EAA6BW,GAAAC,KAASD,UAATA,CAAS,CAmBxC,OAhBEE,kCAAA,WAIE,OAHkBD,KAAKD,UAAUG,eAI9BC,cAAIC,GACH,GAmBR,SAAkCA,GAChC,IAAMC,EAAYD,EAASE,eAC3B,MAAsB,aAAfD,iBAAWE,KACpB,CAHA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BACE,6EACF,uBACE,kDACF,uBAAsC,sCACtC,wBACE,oEACF,2BACE,oKAGF,mBAAkC,wCAClC,4BACE,2CACF,+BACE,mEACF,uBACE,wEACF,0BACE,uEACF,cACE,iDACF,8BACE,2EACF,6BACE,yEACF,2CACE,wJAGF,yBACE,kGACF,gBAA+B,sCAC/B,mBACE,6DACF,YACE,0GAEF,wBACE,yJAGF,8CACE,kLAGF,gBACE,4FACF,uBACE,yEACF,0BACE,kEACF,iBACE,4DACF,6BACE,2EACF,6BACE,mDACF,sBACE,6DACF,+BACE,yDACF,uCACE,4EACF,qBACE,sEACFhf,QAAyB,+BACzB,qBACE,yEACF,oBACE,0FAEF,4BACE,2GAEF,2BACE,sHACF,+BACE,2EACF,+BACE,6DACF,mBACE,2CACF,iBACE,wEACF,iBACE,4FAEF,gBACE,0DACF,gBACE,+EACF,kBAAiC,GACjC,gBACE,kDACF,0BACE,+EACF,sBACE,oOAIF,0BACE,sEACF,0BACE,sEACF,2BACE,uEACF,wBACE,oEACF,sBACE,4EACF,4BACE,wEACF,mBAAkC,8BAClC,4BACE,wEACF,6CACE,iIACF,sCACE,+CAEN,E0GtPqC1lC,EAAA2kD,WxCwM9BltC,eAA0BuE,GAC/B,OAAOG,qBAAmBH,GAAMvU,QAClC,EwC1MqCzH,EAAA4kD,2BG3F9BntC,eACLvG,EACAoJ,GAKA,MACMhD,EAAgC,CACpCutC,WAAYvqC,EACZwqC,YAHkBxyC,IAAmBJ,IAAmB,qBAMpD6yC,cAAEA,SChCHttC,eACLvG,EACAoG,GAEA,OAAOI,EACLxG,EAGA,oCAAAmG,EAAmBnG,EAAMoG,GAE7B,CAVOG,CDiCH0E,qBAAmBjL,GACnBoG,GAGF,OAAOytC,GAAiB,EAC1B,EHwEqC/kD,EAAAglD,sBzCR/B,SACJjrB,GAEA,MAAM/d,KAAEA,EAAIvB,eAAEA,GAAmBsf,EACjC,OAAI/d,EAAKmE,cAAgB1F,EAGhB,CACLwF,WAAY,KACZ4e,aACAC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P,gBACA,GAAAluP,GAAAskM,EAAA,CACA,MAAAxkM,EAAAmwP,GAAAjwP,EAAA,CACAoxE,MACA+4K,SACAC,aACAC,gBACAC,kBACAC,cACAC,gBACAC,kBACAC,mBACAC,qBACAC,aACAC,mBACAtD,mBACAuD,kBACAC,aACApD,cACAqD,iBACAC,iBACAC,eACAC,eACAQ,qBACAP,cACAC,eACAC,oBACAC,mBACAC,wBACAC,oBAEA3rP,GACAurP,MAEA,IACA16M,GAEAgyL,EAAArhO,OAAAokP,GAAAyJ,SACAW,oBACAA,iCA9iBA,SAA8B13N,EAAKp4B,EAAnCF,GACA,IACAI,EADAK,GAAA,EAEA,IACA+vP,SACA,CACA,MAAAnwP,GACA,MACA,CACA,GAAAD,EACA,OACA,MAAAM,EAAA2Z,YAAA,KACA5Z,IACAsiC,IACAutN,KACA,GACAtwP,GACAs4B,gCACAhe,gBACAg2O,KACAvtN,MAEA,CAtBA,CA+iBA0tN,QACA,GAAAlsP,EAAA,CACA,MAAArE,EAAAiwP,GAAA9vP,EAAA,CACAixE,MACA+4K,SACAC,aACAC,gBACAC,kBACAC,cACAC,gBACAC,kBACAC,mBACAC,qBACAC,aACAC,mBACAtD,mBACAuD,kBACAC,aACApD,cACAqD,iBACAC,iBACAC,eACAC,eACAQ,qBACAP,cACAC,eACAC,oBACAC,mBACAC,wBACAC,oBAEAzrP,GACAurP,MAEA,IACA5lP,GAEAg9N,CACA,CCrmCA,SAASthC,GAAG//L,EAAKtB,GAAjB,IAAAF,EAAA4Q,UAAA/E,OAAA,YAAA+E,UAAA,GAAAA,UAAA,GAAA6iB,SACA,MAAArzB,EAAA,CAAAu9J,SAAA,EAAA3D,SAAA,GAEA,OADA30H,0BACA,IAAArlC,EAAAqjC,oBAAAhjC,EAAAH,EAAAE,EACA,CACA,MAAMswP,GAAN,4NAKA,IAAIC,GAAJ,CACAvvP,OACA8lP,WACAj+O,mBACA,GAEAm+O,aACAn+O,kBACA,MAEAq+O,oBACAr+O,iBACA,EACA9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m9O,aAAAl9O,EAAAm9O,kBAAAhnD,EAAAinD,iBAAA56M,EAAA66M,sBAAAnnP,EAAAonP,gBAAA9lP,EAAA,UAAA3F,GAAA,GAuCA,OAAAiwP,GAAA9vP,EAAA,CACAixE,MACA+4K,SACAC,aACAC,gBACAC,kBACAC,cACAC,gBACAC,kBACAC,mBACAC,qBACAC,aACAC,mBACAtD,sBAnDA55O,EACA,CACAqmB,SACAlpB,QACA,oBACAwP,SACA8iN,SACA1lB,UACAj8I,SACAq/E,UACAkwH,OACAxmF,QACAxmD,QACA1qH,OACA23P,QACArc,YACA7B,gBAEA2d,EACA,GACAA,EAgCA5f,kBACAC,aACApD,cACAqD,oBAlCA/8O,GAAA,QAAAA,EAEA,CACAg3O,UACAgK,WACAG,eACAY,kBACAX,+BACAC,kBACAC,kBACAC,qBACAC,sBACAC,8BAEA2c,EACA,GACAA,EAmBAphB,iBACAC,eACAC,eACAQ,qBACAP,cACAC,eACAC,oBACAC,mBACAC,wBACAC,kBACAC,sBAEA,CAtEA,CoBn4BAn4N,SAAA,CACA42N,UACAC,aACAC,gBACAC,kBACAC,cACAC,gBACAC,kBACAC,mBACAC,qBACAE,mBACA6f,gBACA5f,kBACAnD,cACAoD,aACAshB,UACAphB,iBACAE,eACAD,eACAE,gBACA8J,GAAA/0P,EAAAguF,KACAgnK,eAEAE,GAAAl1P,EAAAguF,KACAmnK,sBAEAE,GAAAr1P,IACAs1P,wCAGApK,qBACA8J,oBACAM,0BAEAlK,yBACA+J,0BAEA7J,oBAEA,IAAAzrP,EACA,OAAA+I,QAAAX,KAAA,mCAEA86P,OACA5hQ,qBACAm9B,MACAujB,OACAsqN,4BAEAnsQ,GACAo4P,4BACAhlO,SAAAkwO,oBAAAlwO,SAAAkwO,mBAAA93P,OAAA,GACA2pP,kEACA,EACA,IACA,MAAAn1P,EAAA,GACAH,EAAAG,IACA,IAAAH,EACA,OAAA2jP,GAAA4oB,GAAA5oB,CAAA,CACAsV,aACAzC,aACAsE,0BACAx5P,4BACAm9B,MACA6vC,SACAiuL,gBAGAxB,6BACAz5P,4BACAm9B,sDAEA+6N,WACAwB,2BACA15P,4BACAm9B,oDAEAw8N,kBACA35P,4BACAm9B,2CAEAy8N,6BACA55P,4BACAm9B,sDAEA08N,2BACA75P,4BACAm9B,oDAEA28N,6BACA95P,4BACAm9B,sDAEA48N,mBACAC,iBACAh6P,4BACAm9B,0CAEA88N,gBACA2H,OACA5hQ,4BACAm9B,gDAGA+8N,oBACA0H,OACA5hQ,4BACAm9B,oDAGA2rN,aACA2T,cACAC,iBACAzT,cACAC,gBACAC,kBACAC,mBACAC,qBACApD,mBACAsD,mBACA4O,WACAtO,eACAD,eACA+S,uBACA4B,eACAzuL,MACA05K,kBACAnD,cACAoD,aACAU,kBACApB,gBACAC,kBACAU,iBACAC,iBACAd,UACAgL,gBACAG,oBACAG,mBACA6B,uBACAE,iBACAgI,sBACA0B,4FACAhxO,oBACAjsB,kBACAkf,mBACA7hB,eACAm9B,MACAwtO,cACA5uP,oBAGA,IACAnP,EAAA,EAEAinP,uBACA,IACA9wN,4BACA,CACA,MAAAlkC,GACA4I,eACA,KAEA,MAAAjJ,EAAA,KACAuqQ,KACAhmO,oBACAimO,OAwBA,MAtBA,gBAAA/2O,SAAAkB,YACAlB,iCACA+uB,KAGAje,mCACA6+N,OACA5hQ,yBACAm9B,WAEA,qBAAA9vB,GACA2zC,QAEAje,uBACA6+N,OACA5hQ,aACAm9B,WAEA,SAAA9vB,GACA2zC,MACApxB,UAEA,KACAmT,oBACAizN,YACAgT,MhB/ZAlS,SgBgaAoU,CAEA,CACA,MAAArsQ,GACA4I,eACA,CACA,CCxaA,SAAA0jQ,GAAAtsQ,GAEA,OADAA,EAAA,WACAA,EAAA,IAAAA,CACA,CCGA,SAAAusQ,GAAAvsQ,EAAAH,GACA,uBAAAA,EAAAw8O,WAIA,wBAAAj2N,SAAAvmB,EAAAw8O,UACAmwB,wBAEAA,iCAGAA,kBACAxsQ,EAAAysQ,kBAAA,C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,EAAU,EAEVC,EAAM,IAAIr+W,MAAM,IAChBs+W,EAAM,IAAIt+W,MAAM,IAChBu+W,EAAM,IAAIv+W,MAAM,IAChBo7T,EAAM,IAAIp7T,MAAM,KAChBw+W,EAAgB,IAAIx+W,MAAM,MAG1By+W,EAAS,CACX,EACA,EACA,EACA,EACA,GACA,GACA,GACA,GACA,EACA,EACA,EACA,GACA,GACA,GACA,GACA,GACA,EACA,EACA,GACA,GACA,GACA,GACA,GACA,GACA,EACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,IAGEC,EAA2B,CAC7B,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,GAEEC,EAA0B,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,GAAI,IAC7DC,EAA2B,CAC7B,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,KAEEC,EAA0B,CAC5B,EACA,EACA,EACA,EACA,EACA,GACA,EACA,GACA,GACA,GACA,GACA,EACA,GACA,GACA,GACA,EACA,GACA,IACA,GACA,GACA,IACA,IACA,IACA,EACA,GACA,GACA,IACA,IACA,GACA,GACA,IACA,IACA,GACA,GACA,GACA,IACA,IACA,EACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KAGEC,EAA6B,CAC/B,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,GAEEC,EAA4B,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,GAAI,IAC/DC,EAA6B,CAC/B,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,KAEEC,EAA4B,CAC9B,EACA,EACA,EACA,EACA,GACA,EACA,EACA,GACA,GACA,EACA,GACA,GACA,GACA,EACA,GACA,IACA,GACA,GACA,GACA,IACA,EACA,GACA,GACA,IACA,IACA,IACA,IACA,EACA,GACA,GACA,GACA,IACA,GACA,GACA,IACA,IACA,GACA,GACA,GACA,GACA,IACA,GACA,IACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IAC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A,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,GAEJ5jM,EAAE,aAAc,iBAChBx/K,EAAKguX,WAAa,kBACT,YAEThuX,EAAKiuX,WAAa,SAAS1/X,UAClBA,GAETyR,EAAKkuX,WAAa,SAAS3/X,EAAGyG,EAAGxG,UACxBwG,EAAExG,EAAI,EAAG,EAElBwR,EAAKmuX,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ACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,EACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,EACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,IACA,EACA,IACA,IACA,GACA,GACA,IACA,IACA,GACA,GACA,GACA,GACA,GACA,GACA,IACA,IACA,GACA,GACA,IACA,EACA,IACA,IACA,GACA,GACA,GACA,GACA,IACA,IACA,GACA,GACA,IACA,IACA,GACA,GACA,IACA,IACA,GACA,GACA,GACA,IACA,GACA,GACA,EACA,IACA,IACA,GACA,GACA,GACA,GACA,GACA,IACA,GACA,IACA,IACA,GACA,GACA,GACA,IACA,IACA,GACA,IACA,GACA,IACA,IACA,GACA,KAEFlhE,GAAK,CACH,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,MAEFjyG,GAAK,EACLo2U,GAAK,CACH,EACA,EACA,EACA,EACA,EACA,EACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KAEFt2N,GAAK,CACH,EACA,EACA,EACA,EACA,EACA,EACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KAEF0uN,GAAK,KACLl1U,GAAK,CACH,CAAC,IAAK,IAAK,IAAK,GAChB,CAAC,IAAK,IAAK,IAAK,IAAK,GACrB,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,GAC1B,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAE1DokH,GAAK,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,GAAI,GAAI,GAAI,EAAG,GAAI,GAAI,IACxDu0N,GAAK,EAAE,EAAG,GAAI,EAAG,GAAI,EAAG,EAAG,EAAG,GAAI,EAAG,GAAI,GAAI,GAAI,EAAG,GAAI,EAAG,GAAI,GAAI,GACnE93U,GAAK,CACH,CACE,CACE,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,KACnD,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IA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AAS3xN,EAAMixN,EAAmB1hH,GACzCmgH,EAAuBoC,IAGvBzB,EAhaM,EAiaNrwN,EAAO2xN,EAAS3xN,EAAMixN,EAAmB1hH,GACzCvvG,EAAOgxN,EAAchxN,EAAMixN,GAC3BZ,EAlaM,EAmaNX,KACA1vN,EAAO2xN,EAAS3xN,EAAMixN,EAAmB1hH,GACzCmgH,EAAuBoC,EACvB9xN,EAAOgxN,EAAchxN,EAAMixN,UAxC7BZ,EA/XQ,EAgYRrwN,EAAO2xN,EAAS3xN,EAAMixN,EAAmB1hH,QAdzC8gH,EAAOd,EAjXC,EADA,EAmXRvvN,EAAO2xN,EAAS3xN,EAAMixN,EAAmB1hH,UAuDpCvvG,QAcJmvN,eAAel1C,WAAa,SAASx6V,GACpCA,IACF6vY,EAAc7vY,EAAQsyY,cACtBvC,EAAe/vY,EAAQuyY,eACvBzC,EAAW9vY,EAAQwyY,WACnBxC,EAAYhwY,EAAQyyY,YACpBxC,EAAuBjwY,EAAQ0yY,2BAI9BhD,eAAel1C,WAAWx6V,GACxBlD,KAAK4yY,cAAe,EAAfA,IAGVS,EA5jFmB,CACrB,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,IACA,IACA,KACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,IACA,IACA,IACA,KACA,IACA,IACA,KACA,KACA,KACA,IACA,IACA,IACA,IACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,KACA,KACA,KACA,KACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KACA,IACA,IACA,KACA,KACA,KACA,KACA,IACA,IACA,IACA,IACA,IACA,KACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KACA,IACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,IACA,MACA,IACA,MACA,MACA,IACA,MACA,MACA,IACA,MACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,IACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,KACA,KACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,MACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,KACA,IACA,MACA,MACA,MACA,MACA,MACA,MACA,KACA,KACA,MACA,MACA,IACA,MACA,MACA,MACA,MACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,KACA,KACA,MACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,IACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,KACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KACA,IACA,MACA,MACA,MACA,MACA,MACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,MACA,MACA,MACA,MACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,IACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,IACA,IACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,MACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KACA,IACA,KACA,IACA,IACA,KACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KACA,IACA,IACA,KACA,KACA,IACA,IACA,IACA,IACA,IACA,KACA,KACA,IACA,IACA,IACA,IACA,IACA,KACA,KACA,KACA,KACA,KACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,IACA,KACA,IACA,IACA,IACA,KACA,KACA,KACA,IACA,IACA,IACA,IACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KACA,KACA,IACA,IACA,IACA,KACA,KACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KA8jBEwC,EAAa,IAAIj0E,EAAMgxE,eAAe,CAAE4C,mBAoC5C5zE,EAAM0W,IAAI53I,OAAOt5L,KAAK,CAAC,kBAlCE,SAASwI,OAC5B6zK,EAAO7zK,EAAK6zK,KAGZvgL,GAFI0M,EAAKmjF,EACLnjF,EAAK2zL,EACC3zL,EAAK1M,SAAW,CAAC,GAG3BwnW,GAFQ96V,EAAKo/U,MACN9rV,EAAQssV,KACL,OAEdtsV,EAAQsyY,cAC2B,kBAA1BtyY,EAAQsyY,eAA8BtyY,EAAQsyY,cACvDK,EAAWn4C,WAAWx6V,GAEuB,mBAAzC7D,OAAO8E,UAAUwY,SAASja,KAAK+gL,GAA4B,CAAC,IAC1DhkL,EAAI,EAAE,IACVirW,EAAU,GACLjrW,EAAI,EAAGA,EAAIgkL,EAAK74K,OAAQnL,GAAK,EACgB,mBAA5C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,EAAAI,GACA,OAAAyvJ,EAAAxvJ,EAAAH,EAAAF,EAAAI,EAAA,GACA,CA4UA,SAASulc,EAAoB96S,EAAIymS,EAAIvtX,EAAEljE,IA1UvC,SAAsBJ,EAAEP,EAAxBF,EAAAI,GAsBA,IArBA,IAmBAwlc,EAnBAllc,EAAA,IAAAN,EAAA,QAAAA,EAAA,YAAAA,EAAA,aAAAA,EAAA,QACAylc,uDACAC,uDACAC,yDACAC,2DACAC,uDACAC,uDACAC,uDACAC,yDACAC,2DACAC,yDACAC,2DACAC,2DACAC,2DACAC,2DACAC,2DAEAv4b,EAAA1N,EAAA2N,EAAA1N,EAAA6jM,EAAA5jM,EAAAiwC,EAAAhwC,EAAA0D,EAAAzD,EAAA+E,EAAA9E,EAAAmO,EAAAjP,EAAA4O,EAAA5M,EACA2kc,4BACAhB,IAEA/vS,EAAA,EAAiBn1J,KAAQA,KAQzBqmX,IADAhmX,GADA8lc,IADA9lc,GADA6lc,IADA7lc,GADAizV,IADAjzV,UACAizV,UACAjzV,MACA6lc,UACA7lc,MACA8lc,WACA9lc,MACAgmX,UASA+/E,IADA/lc,GADAyyV,IADAzyV,GADAgmc,IADAhmc,GADAimc,IADAjmc,UACAimc,UACAjmc,MACAgmc,UACAhmc,MACAyyV,WACAzyV,MACA+lc,UASAG,IADAlmc,GADAmmc,IADAnmc,GADA0yV,IADA1yV,GADAomc,IADApmc,UACAomc,UACApmc,MACA0yV,UACA1yV,MACAmmc,WACAnmc,MACAkmc,UASArB,IADA7kc,GADAqmc,IADArmc,GADAsmc,IADAtmc,GADA4yV,IADA5yV,UACA4yV,UACA5yV,MACAsmc,UACAtmc,MACAqmc,WACArmc,MACA6kc,UASA7+E,IADAhmX,GADA4yV,IADA5yV,GADA0yV,IADA1yV,GADAyyV,IADAzyV,UACAyyV,UACAzyV,MACA0yV,UACA1yV,MACA4yV,WACA5yV,MACAgmX,UASA+/E,IADA/lc,GADAizV,IADAjzV,GADAsmc,IADAtmc,GADAmmc,IADAnmc,UACAmmc,UACAnmc,MACAsmc,UACAtmc,MACAizV,WACAjzV,MACA+lc,UASAG,IADAlmc,GADAimc,IADAjmc,GADA6lc,IADA7lc,GADAqmc,IADArmc,UACAqmc,UACArmc,MACA6lc,UACA7lc,MACAimc,WACAjmc,MACAkmc,UASArB,IADA7kc,GADAomc,IADApmc,GADAgmc,IADAhmc,GADA8lc,IADA9lc,UACA8lc,UACA9lc,MACAgmc,UACAhmc,MACAomc,WACApmc,MACA6kc,UAEA7+E,QACAvzB,QACAC,QACAE,QACAK,QACA8yG,QACAI,QACAG,QACAT,QACAI,QACAC,QACAG,QACAP,QACAE,QACAI,QACAvB,QAEAnlc,eACAA,eACAA,gBACAA,gBAEAA,eACAA,eACAA,gBACAA,gBAEAA,eACAA,eACAA,iBACAA,iBAEAA,gBACAA,gBACAA,iBACAA,iBAEAA,gBACAA,gBACAA,iBACAA,iBAEAA,gBACAA,gBACAA,iBACAA,iBAEAA,gBACAA,gBACAA,iBACAA,iBAEAA,gBACAA,gBACAA,iBACAA,iBAEAA,gBACAA,gBACAA,iBACAA,iBAEAA,gBACAA,gBACAA,iBACAA,iBAEAA,gBACAA,gBACAA,iBACAA,iBAEAA,gBACAA,gBACAA,iBACAA,iBAEAA,gBACAA,gBACAA,iBACAA,iBAEAA,gBACAA,gBACAA,iBACAA,iBAEAA,gBACAA,gBACAA,iBACAA,iBAEAA,gBACAA,gBACAA,iBACAA,gBACA,CA/LA,CA2UA6mc,QACA,CAEA,SAASC,EAAqB18S,EAAIymS,EAAIvtX,EAAEljE,IA7IxC,SAAuBJ,EAAEK,EAAEijE,EAAEljE,GAsB7B,IArBA,IAmBA+kc,EAFAllc,EAjBA,IAAAN,EAAA,QAAAA,EAAA,YAAAA,EAAA,aAAAA,EAAA,QAiBAO,EAhBAklc,qDAgBAjlc,EAfAklc,qDAeAjlc,EAdAklc,uDAcAjlc,EAbAklc,yDAaAjlc,EAZAklc,qDAYAhmc,EAXAimc,qDAWAjkc,EAVAkkc,qDAWAS,EAVAR,uDAUAQ,EATAP,yDASAO,EARAN,uDAQAM,EAPAL,yDAOAK,EANAJ,yDAMAI,EALAH,yDAKAG,EAJAF,yDAKAd,EAJAe,yDAMAv4b,EAAA,EAAiB1N,KAAQA,KAQzBqmX,IADAhmX,GADA8lc,IADA9lc,GADA6lc,IADA7lc,GADAizV,IADAjzV,UACAizV,UACAjzV,MACA6lc,UACA7lc,MACA8lc,WACA9lc,MACAgmX,UASA+/E,IADA/lc,GADAyyV,IADAzyV,GADAgmc,IADAhmc,GADAimc,IADAjmc,UACAimc,UACAjmc,MACAgmc,UACAhmc,MACAyyV,WACAzyV,MACA+lc,UASAG,IADAlmc,GADAmmc,IADAnmc,GADA0yV,IADA1yV,GADAomc,IADApmc,UACAomc,UACApmc,MACA0yV,UACA1yV,MACAmmc,WACAnmc,MACAkmc,UASArB,IADA7kc,GADAqmc,IADArmc,GADAsmc,IADAtmc,GADA4yV,IADA5yV,UACA4yV,UACA5yV,MACAsmc,UACAtmc,MACAqmc,WACArmc,MACA6kc,UASA7+E,IADAhmX,GADA4yV,IADA5yV,GADA0yV,IADA1yV,GADAyyV,IADAzyV,UACAyyV,UACAzyV,MACA0yV,UACA1yV,MACA4yV,WACA5yV,MACAgmX,UASA+/E,IADA/lc,GADAizV,IADAjzV,GADAsmc,IADAtmc,GADAmmc,IADAnmc,UACAmmc,UACAnmc,MACAsmc,UACAtmc,MACAizV,WACAjzV,MACA+lc,UASAG,IADAlmc,GADAimc,IADAjmc,GADA6lc,IADA7lc,GADAqmc,IADArmc,UACAqmc,UACArmc,MACA6lc,UACA7lc,MACAimc,WACAjmc,MACAkmc,UASArB,IADA7kc,GADAomc,IADApmc,GADAgmc,IADAhmc,GADA8lc,IADA9lc,UACA8lc,UACA9lc,MACAgmc,UACAhmc,MACAomc,WACApmc,MACA6kc,UAGAnlc,eACAA,eACAA,gBACAA,gBAEAA,eACAA,eACAA,gBACAA,gBAEAA,eACAA,eACAA,iBACAA,iBAEAA,gBACAA,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z,EACAC,OACAtjI,OACAujI,OACAznK,OACA0nK,OACAC,OACAC,OACAY,OACAQ,OACAC,OACAC,OACAC,OACAC,OACAC,OACAC,OAEA9B,IADAv3Z,QACAu3Z,EACAtjI,OACAujI,OACAznK,OACA0nK,OACAC,OACAC,OACAY,OACAQ,OACAC,OACAC,OACAC,OACAC,OACAC,OACAC,OACAb,OAEAvkI,IADAj0R,QACAi0R,EACAujI,OACAznK,OACA0nK,OACAC,OACAC,OACAY,OACAQ,OACAC,OACAC,OACAC,OACAC,OACAC,OACAC,OACAb,OACAc,OAEA9B,IADAx3Z,QACAw3Z,EACAznK,OACA0nK,OACAC,OACAC,OACAY,OACAQ,OACAC,OACAC,OACAC,OACAC,OACAC,OACAC,OACAb,OACAc,OACAC,OAEAxpK,IADA/vP,QACA+vP,EACA0nK,OACAC,OACAC,OACAY,OACAQ,OACAC,OACAC,OACAC,OACAC,OACAC,OACAC,OACAb,OACAc,OACAC,OACAC,OAEA/B,IADAz3Z,QACAy3Z,EACAC,OACAC,OACAY,OACAQ,OACAC,OACAC,OACAC,OACAC,OACAC,OACAC,OACAb,OACAc,OACAC,OACAC,OACAC,OAEA/B,IADA13Z,QACA03Z,EACAC,OACAY,OACAQ,OACAC,OACAC,OACAC,OACAC,OACAC,OACAC,OACAb,OACAc,OACAC,OACAC,OACAC,OACAC,OAEA/B,IADA33Z,QACA23Z,EACAY,OACAQ,OACAC,OACAC,OACAC,OACAC,OACAC,OACAC,OACAb,OACAc,OACAC,OACAC,OACAC,OACAC,OACAC,OAEApB,IADAv4Z,QACAu4Z,EACAQ,OACAC,OACAC,OACAC,OACAC,OACAC,OACAC,OACAb,OACAc,OACAC,OACAC,OACAC,OACAC,OACAC,OACAC,OAEAb,IADA/4Z,QACA+4Z,EACAC,OACAC,OACAC,OACAC,OACAC,OACAC,OACAb,OACAc,OACAC,OACAC,OACAC,OACAC,OACAC,OACAC,OACAnB,OAEAO,IADAh5Z,SACAg5Z,EACAC,OACAC,OACAC,OACAC,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OACAA,WACAA,WAEAh+N,GADAg+N,cACAh+N,GAAoBg+N,QACpBA,WACAA,WACAA,WACAA,WAEAh+N,IADAg+N,cACAh+N,GAAqBg+N,QAErBC,IACAA,OACAA,OACAA,OACAA,WAEAj+N,GADAi+N,cACAj+N,GAAoBi+N,QACpBA,WACAA,WACAA,WACAA,WAIAC,EAFAl+N,IADAi+N,cACAj+N,GAGAk+N,OACAA,OACAA,OACAA,OAEAl+N,GADAk+N,cACAl+N,GAAoBk+N,QACpBA,WACAA,WACAA,WACAA,WAIAswJ,EAFAxuX,IADAk+N,cACAl+N,GAGAwuX,OACAA,OACAA,OACAA,OAEAxuX,GADAwuX,UACAxuX,GAAoBwuX,QACpBA,WACAA,WACAA,WACAA,WAIAC,EAFAzuX,IADAwuX,cACAxuX,GAGAyuX,OACAA,OACAA,OACAA,OAEAzuX,GADAyuX,UACAzuX,GAAoByuX,QACpBA,OACAA,WACAA,WACAA,WAIAC,EAFA1uX,IADAyuX,cACAzuX,GAGA0uX,OACAA,OACAA,OACAA,OAEA1uX,GADA0uX,UACA1uX,GAAoB0uX,QACpBA,OACAA,OACAA,WACAA,WAIAC,EAFA3uX,IADA0uX,cACA1uX,GAGA2uX,OACAA,OACAA,OACAA,OAEA3uX,GADA2uX,UACA3uX,GAAoB2uX,QACpBA,OACAA,OACAA,OACAA,WAIAg9E,EAFA3rc,IADA2uX,cACA3uX,GAGA2rc,OACAA,OACAA,OACAA,OAEA3rc,GADA2rc,UACA3rc,GAAoB2rc,QACpBA,OACAA,OACAA,OACAA,OAIAC,EAFA5rc,IADA2rc,cACA3rc,GAGA4rc,OACAA,OACAA,OACAA,OAEA5rc,GADA4rc,UACA5rc,GAAoB4rc,QACpBA,OACAA,OACAA,OACAA,OAUAF,EAJA3tO,QADA/9N,GADAA,IAFAA,IADA4rc,UACA5rc,KAEAA,SAhIqB+9N,SAiIrB/9N,GAMAsgN,EAHA0d,GADAh+N,QAKAwgN,EA5GqByd,QA6GrBysO,EA/FqBxsO,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